@qwen-code/qwen-code 0.19.3-nightly.20260701.a974594d7 → 0.19.4
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/loop/loop-tick-resolver.test.ts +42 -0
- package/bundled/loop/loop-tick-resolver.ts +1 -1
- package/bundled/qc-helper/docs/configuration/auth.md +1 -1
- package/bundled/qc-helper/docs/configuration/settings.md +23 -11
- package/bundled/qc-helper/docs/features/approval-mode.md +3 -0
- package/bundled/qc-helper/docs/features/auto-mode.md +40 -0
- package/bundled/qc-helper/docs/features/channels/overview.md +81 -18
- package/bundled/qc-helper/docs/features/code-review.md +17 -61
- package/bundled/qc-helper/docs/features/commands.md +6 -6
- package/bundled/qc-helper/docs/features/mcp.md +3 -1
- package/bundled/qc-helper/docs/features/scheduled-tasks.md +10 -0
- package/bundled/qc-helper/docs/qwen-serve.md +19 -0
- package/bundled/review/DESIGN.md +21 -26
- package/bundled/review/SKILL.md +45 -129
- package/chunks/{MaxSizedBox-UZHJ73JB.js → MaxSizedBox-ERTNFI22.js} +20 -18
- package/chunks/{StandaloneSessionPicker-GGUIZWCE.js → StandaloneSessionPicker-Y5NGRLRY.js} +32 -29
- package/chunks/{acpAgent-QYZFICEZ.js → acpAgent-UMN6OYTR.js} +473 -187
- package/chunks/{agent-2EN7YNSW.js → agent-56DZU4ZU.js} +17 -15
- package/chunks/{agent-headless-SLTEZ5LV.js → agent-headless-SR7N2IJG.js} +17 -15
- package/chunks/{anthropicContentGenerator-CA3JTAMO.js → anthropicContentGenerator-5OZFO6WQ.js} +1 -1
- package/chunks/{artifact-tool-RM7WINJO.js → artifact-tool-JVZMHA4B.js} +1 -1
- package/chunks/{askUserQuestion-J3P6QAJ7.js → askUserQuestion-CMJZ2F3D.js} +1 -1
- package/chunks/{bridge-HZVAUTMX.js → bridge-AUHNFOUS.js} +23 -21
- package/chunks/channel-worker-supervisor-A74FV522.js +308 -0
- package/chunks/{chunk-N4V4VBP6.js → chunk-2X2JUE47.js} +2 -2
- package/chunks/{chunk-JV7A66DR.js → chunk-4VZH35PN.js} +528 -358
- package/chunks/{chunk-M2U5NM24.js → chunk-54YZOP7P.js} +309 -72
- package/chunks/{chunk-WGY3GIPP.js → chunk-6AQR7732.js} +1 -1
- package/chunks/{chunk-FR3II765.js → chunk-6CIIP6OE.js} +4 -4
- package/chunks/{chunk-IKO44NAT.js → chunk-6TLY5W3B.js} +2 -2
- package/chunks/{chunk-VN4CKYUW.js → chunk-73H73ASU.js} +1 -1
- package/chunks/{chunk-IBEM64M4.js → chunk-75X2VLSH.js} +36 -25
- package/chunks/{chunk-PLQTLKMR.js → chunk-7KPI4LAI.js} +3 -3
- package/chunks/{chunk-NVTRORSK.js → chunk-7VPC7D7O.js} +2 -2
- package/chunks/chunk-AHNXYU4O.js +24 -0
- package/chunks/{chunk-MTJVHQDP.js → chunk-B7KGXIPZ.js} +302 -257
- package/chunks/{chunk-35FH347N.js → chunk-BFG6OZN7.js} +16097 -16236
- package/chunks/{chunk-T44AF4I6.js → chunk-BNJLLAQ7.js} +1 -1
- package/chunks/{chunk-OEY3YAL2.js → chunk-BQNJBEUA.js} +2 -2
- package/chunks/{chunk-Q7TDHJ2G.js → chunk-C2IHHGBZ.js} +10 -10
- package/chunks/chunk-CG7SVARK.js +367 -0
- package/chunks/{chunk-7SP275SH.js → chunk-CS5XYDBO.js} +5 -5
- package/chunks/{chunk-V5YJAUHW.js → chunk-CUGEBAKG.js} +1 -1
- package/chunks/{chunk-FQDMX5IL.js → chunk-D5KISTLW.js} +309 -72
- package/chunks/{chunk-I4MXURND.js → chunk-DQ74W65K.js} +356 -468
- package/chunks/chunk-E5A7LHNN.js +51 -0
- package/chunks/{chunk-3PJXIDKI.js → chunk-E6US47KI.js} +3 -27
- package/chunks/chunk-EDAGQADF.js +21 -0
- package/chunks/{chunk-HUGAEYZR.js → chunk-FNLXLI4I.js} +2 -2
- package/chunks/{chunk-WJAY4WXR.js → chunk-FYKX6XOT.js} +1 -1
- package/chunks/{chunk-CA4ML3VH.js → chunk-G7OQ3RFJ.js} +1 -1
- package/chunks/{chunk-VHRREANT.js → chunk-GICCHL2Q.js} +3 -1
- package/chunks/{chunk-QHHNFG22.js → chunk-GLPV75ES.js} +1 -1
- package/chunks/{chunk-LD2XBG6Z.js → chunk-GO6LNQXT.js} +1 -39
- package/chunks/chunk-HI55Z6PR.js +3523 -0
- package/chunks/{chunk-B5MPZI4K.js → chunk-HJDF3ZVU.js} +2670 -1233
- package/chunks/{chunk-GDIG7TMG.js → chunk-HRZB5CSC.js} +1 -1
- package/chunks/{chunk-LDWTYE33.js → chunk-J3F7X3LW.js} +1 -1
- package/chunks/{chunk-FV4SQ54H.js → chunk-KVPFPC4J.js} +227 -85
- package/chunks/{chunk-Q3JOGB4U.js → chunk-L7QPM2YD.js} +1 -1
- package/chunks/{chunk-4722VFFU.js → chunk-L7VH7HQA.js} +6 -6
- package/chunks/{chunk-HWG4XLD7.js → chunk-LKWAVAB5.js} +1 -1
- package/chunks/{chunk-YCRTJYSQ.js → chunk-MEQWZGK5.js} +1 -1
- package/chunks/{chunk-6FIWYVN4.js → chunk-MKHC4BYZ.js} +30 -5
- package/chunks/{chunk-YCEHOJZJ.js → chunk-MNDTD5E5.js} +65 -38
- package/chunks/{chunk-ZGSV5ORL.js → chunk-MVZXZWGT.js} +809 -759
- package/chunks/chunk-MX2YXRER.js +44 -0
- package/chunks/{chunk-TMILTLP3.js → chunk-ND25GXEU.js} +21 -4
- package/chunks/{chunk-AIBPG5MB.js → chunk-OAFUMTWW.js} +2 -2
- package/chunks/chunk-OJCECIJA.js +238 -0
- package/chunks/{chunk-EUURTJY7.js → chunk-PIYV6COW.js} +1 -1
- package/chunks/{chunk-LXEW6BHF.js → chunk-Q7VHIRDD.js} +1 -1
- package/chunks/{chunk-DBR7PF4B.js → chunk-QAFQLTXG.js} +1 -1
- package/chunks/{chunk-3TK7FSCP.js → chunk-QMIND2AS.js} +3 -3
- package/chunks/{chunk-ESVSWG6Z.js → chunk-QOMAHFYI.js} +1 -1
- package/chunks/{chunk-J37FGIOA.js → chunk-QXPI7FEC.js} +38 -4
- package/chunks/chunk-RM3PGSGL.js +66 -0
- package/chunks/chunk-RNBYOUGV.js +42 -0
- package/chunks/chunk-S5EQPDTM.js +91 -0
- package/chunks/{chunk-GZKQ36JS.js → chunk-SFN4TEHY.js} +4 -4
- package/chunks/{chunk-DHXWNSJA.js → chunk-T22H4V4R.js} +42 -0
- package/chunks/{chunk-LXGWLOCM.js → chunk-TENOUWY2.js} +1 -1
- package/chunks/{chunk-BLAE2TCO.js → chunk-TTFNVEO5.js} +3 -3
- package/chunks/{chunk-FZY7NH37.js → chunk-UANCYOOQ.js} +1 -1
- package/chunks/{chunk-E5I6YSNO.js → chunk-UQFP2FEF.js} +1 -1
- package/chunks/{chunk-3O2BJMFW.js → chunk-UQYOMM6J.js} +4 -4
- package/chunks/{chunk-JERW36RG.js → chunk-UT5JU5DJ.js} +15 -15
- package/chunks/{chunk-DJ25MIU2.js → chunk-VKGG724L.js} +8 -8
- package/chunks/{chunk-G525INVW.js → chunk-W2ZOAX7F.js} +3 -3
- package/chunks/{chunk-HIYUAXBG.js → chunk-W6X4FGWX.js} +1 -1
- package/chunks/{chunk-OE5J6UA7.js → chunk-XCUFHOAD.js} +1 -1
- package/chunks/{chunk-KXVVXAAC.js → chunk-YBDZ63KI.js} +3 -3
- package/chunks/{chunk-Z34RYLRO.js → chunk-ZJP5T7IA.js} +1 -1
- package/chunks/{chunk-NOYV2NXI.js → chunk-ZXCVPMIK.js} +411 -43
- package/chunks/{computer-use-FCNWHVPW.js → computer-use-VWN5HH6A.js} +20 -18
- package/chunks/{contextCommand-FVFMZZEU.js → contextCommand-DFFG5KDJ.js} +19 -17
- package/chunks/{cron-create-IY5NMIHQ.js → cron-create-CSSWJ67I.js} +1 -1
- package/chunks/{cron-delete-OLNEQWKO.js → cron-delete-E56CFQ7A.js} +1 -1
- package/chunks/{cron-list-YAUAUV24.js → cron-list-BKSINY6Y.js} +1 -1
- package/chunks/daemon-5T6IHWJV.js +8430 -0
- package/chunks/{daemon-status-provider-42JEXENZ.js → daemon-status-provider-V5UY7O7J.js} +26 -24
- package/chunks/{dist-4FCNM6KJ.js → dist-2HDL5SHQ.js} +2 -2
- package/chunks/{dist-SU6L7ZNJ.js → dist-B7SSDVWT.js} +3 -3
- package/chunks/{dist-VD7HXTML.js → dist-BL3SL665.js} +1 -1
- package/chunks/{dist-UKPWQJCL.js → dist-TAVAGZU6.js} +37 -13
- package/chunks/{dist-K4XZILIO.js → dist-XBOVZ3R5.js} +26 -5
- package/chunks/{earlyInputCapture-FFFEC6P4.js → earlyInputCapture-VVYU4FDO.js} +17 -15
- package/chunks/{edit-32ILSGZY.js → edit-F35PTMBA.js} +17 -15
- package/chunks/{en-U3LWGSFX.js → en-FZREZFPO.js} +18 -0
- package/chunks/{enter-worktree-XWZKIN6A.js → enter-worktree-3DIW7EGJ.js} +17 -15
- package/chunks/{enterPlanMode-LPFFY7BJ.js → enterPlanMode-QNXT77KP.js} +27 -15
- package/chunks/{errors-UXBPYPI2.js → errors-M53YG76R.js} +19 -17
- package/chunks/{exit-worktree-IBS4UIU7.js → exit-worktree-BSDWNWHZ.js} +17 -15
- package/chunks/{exitPlanMode-JA72YHII.js → exitPlanMode-EL7AY327.js} +41 -23
- package/chunks/{fast-path-7UU67Y2W.js → fast-path-DUCSMUFW.js} +2 -2
- package/chunks/{gemini-GMVKJNMX.js → gemini-F3IERB37.js} +59 -51
- package/chunks/{geminiContentGenerator-7NIFF2L4.js → geminiContentGenerator-6OULAKFQ.js} +1 -1
- package/chunks/{glob-4NJCW5HI.js → glob-ZMLFTD4T.js} +17 -15
- package/chunks/{grep-PAIMLQEL.js → grep-H5X66EI7.js} +17 -15
- package/chunks/{initializer-R6KU4VYM.js → initializer-LEOT2OLH.js} +21 -19
- package/chunks/{list-H7LXAO64.js → list-M3DKXML6.js} +23 -21
- package/chunks/{loadedSettingsAdapter-H27JMTLU.js → loadedSettingsAdapter-OKMQFGGG.js} +21 -19
- package/chunks/{loop-wakeup-Y3OIRQFM.js → loop-wakeup-FPBAVVPR.js} +2 -2
- package/chunks/{ls-TVJEYS7O.js → ls-UGWQXPTY.js} +1 -1
- package/chunks/{lsp-JZSDVR3F.js → lsp-24WV7NXB.js} +1 -1
- package/chunks/{monitor-JSIHDPXP.js → monitor-ARL5P45R.js} +19 -16
- package/chunks/{nonInteractiveCli-Y4CHOETG.js → nonInteractiveCli-NUVLF3YR.js} +53 -45
- package/chunks/{notebook-edit-SHRNL2UM.js → notebook-edit-ANTZ2DDY.js} +17 -15
- package/chunks/{openaiContentGenerator-ORZZ7VFO.js → openaiContentGenerator-TFGMKGHN.js} +6 -6
- package/chunks/pidfile-AWTL4C63.js +72 -0
- package/chunks/{qwenContentGenerator-H643PL2G.js → qwenContentGenerator-6QWAYTWS.js} +18 -16
- package/chunks/{qwenOAuth2-OI2B7PES.js → qwenOAuth2-LWLA6MQG.js} +3 -3
- package/chunks/{read-file-5PRNPTTY.js → read-file-EJY73XQ3.js} +4 -4
- package/chunks/{read-mcp-resource-QTXGKTEV.js → read-mcp-resource-NCBTPP7X.js} +1 -1
- package/chunks/{ripGrep-JIKZMABJ.js → ripGrep-HC4SA6CQ.js} +17 -15
- package/chunks/{run-qwen-serve-PQV7QOHZ.js → run-qwen-serve-AGLZ642J.js} +291 -55
- package/chunks/{scheduler-OS3R5MGU.js → scheduler-TURO7NGY.js} +17 -15
- package/chunks/{send-message-DKGHWSTF.js → send-message-3S2NYS3O.js} +5 -3
- package/chunks/{serve-LVYZDKCZ.js → serve-5DAMOIDW.js} +22 -19
- package/chunks/{server-P4YIH35I.js → server-4AGEK2HC.js} +2268 -1222
- package/chunks/{session-DE4TZBKH.js → session-7ZOQUC4Y.js} +54 -46
- package/chunks/{settings-DFTYMJYF.js → settings-DR4V6L5Y.js} +20 -18
- package/chunks/{shell-3GNQLNV7.js → shell-H5WFKUXH.js} +17 -15
- package/chunks/{skill-NCNG4KKZ.js → skill-ANHU5ZCR.js} +4 -4
- package/chunks/{spawnChannel-DHRIMDVL.js → spawnChannel-VN5LJV7Z.js} +19 -17
- package/chunks/{src-PNZYGM3R.js → src-OVZLTVVM.js} +49 -17
- package/chunks/{startInteractiveUI-P6GZBFQW.js → startInteractiveUI-OA22V32P.js} +11110 -10670
- package/chunks/{syntheticOutput-X7L5HWLN.js → syntheticOutput-SV7GBHZ5.js} +2 -2
- package/chunks/{task-create-AWEUI4GI.js → task-create-W2H2UJCH.js} +6 -5
- package/chunks/{task-list-KZ3VJLDU.js → task-list-THBOPV4G.js} +5 -4
- package/chunks/{task-stop-GUNOZKJ5.js → task-stop-33FVCNCJ.js} +1 -1
- package/chunks/{task-update-Y56GP6DU.js → task-update-LVFQLXEI.js} +6 -5
- package/chunks/{team-create-6JMW3KQK.js → team-create-OYL5CAQO.js} +17 -15
- package/chunks/{team-delete-6AFRGDJY.js → team-delete-NTUQ25UY.js} +5 -4
- package/chunks/{theme-manager-FEHQO22G.js → theme-manager-XCMPF2SI.js} +17 -15
- package/chunks/{todoWrite-JRS6NOEU.js → todoWrite-SEPO2RI3.js} +1 -1
- package/chunks/{tool-search-IXAEKS7J.js → tool-search-YXW55X6Z.js} +29 -5
- package/chunks/{trustedFolders-SJRXNHZE.js → trustedFolders-TEPGM5YL.js} +18 -16
- package/chunks/{validateNonInterActiveAuth-HCH7OBDH.js → validateNonInterActiveAuth-OQIS7WUE.js} +50 -42
- package/chunks/{web-fetch-RELNL37A.js → web-fetch-OE7LHURA.js} +4 -4
- package/chunks/{workflow-M2COBI7R.js → workflow-RTUWORAP.js} +48 -27
- package/chunks/{workspace-providers-status-GOCWYDMK.js → workspace-providers-status-DM2XANVB.js} +23 -21
- package/chunks/{workspace-service-34C7SUBU.js → workspace-service-VKBI2KZD.js} +27 -25
- package/chunks/{write-file-E52WRXZL.js → write-file-WGALQ53L.js} +17 -15
- package/chunks/{zh-TW-LKLBTZHE.js → zh-TW-6GIKXEAN.js} +18 -0
- package/chunks/{zh-F5T4WWZO.js → zh-V3B4TFWL.js} +18 -0
- package/cli.js +6 -6
- package/locales/en.js +30 -0
- package/locales/fr.js +1 -2
- package/locales/ja.js +1 -2
- package/locales/zh-TW.js +29 -0
- package/locales/zh.js +29 -0
- package/node_modules/@qwen-code/audio-capture/package.json +1 -1
- package/node_modules/@qwen-code/audio-capture/prebuilds/darwin-arm64/@qwen-code+audio-capture.node +0 -0
- package/node_modules/@qwen-code/audio-capture/prebuilds/darwin-x64/@qwen-code+audio-capture.node +0 -0
- package/node_modules/@qwen-code/audio-capture/prebuilds/win32-x64/@qwen-code+audio-capture.node +0 -0
- package/package.json +3 -3
- package/web-shell/assets/{arc-C2DILvUl.js → arc-Det5Ccum.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-b8gZ2cNw.js → architectureDiagram-3BPJPVTR-DqNWVFpl.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-BuRpghMj.js → blockDiagram-GPEHLZMM-CYl7tYBi.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-2ItdhFmE.js → c4Diagram-AAUBKEIU-DaAEi0NQ.js} +1 -1
- package/web-shell/assets/channel-Bm0bFauD.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-B1QXa0q3.js → chunk-2J33WTMH-Df2CDEE2.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-DXfhKlNq.js → chunk-4BX2VUAB-DNBFcyL2.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-ClSNjxLo.js → chunk-55IACEB6-BKjF-0HI.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-Dsh2wisB.js → chunk-727SXJPM-DYwAwfIM.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-C1TkY5AR.js → chunk-AQP2D5EJ-C6FswLqy.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-CGtN9XR6.js → chunk-FMBD7UC4-DRWAcZSY.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-BHiPi1SS.js → chunk-ND2GUHAM-AoL16mNR.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-CzG3I5o1.js → chunk-QZHKN3VN-a8PtLMck.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK--NgUfb55.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2--NgUfb55.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-EgrIoH_K.js → cose-bilkent-S5V4N54A-C4Aeu5qf.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-BUnpdX8S.js → dagre-BM42HDAG-BOulamjo.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-BlLUCVYu.js → diagram-2AECGRRQ-D1wt2ykO.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-FG-enmjQ.js → diagram-5GNKFQAL-BRseus-O.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-BlzmTONk.js → diagram-KO2AKTUF-XSMkNzpZ.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-CoBQ8mIx.js → diagram-LMA3HP47-21KNLqoi.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-DvxV6sX8.js → diagram-OG6HWLK6-DnUI8F5G.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-Jq1tpAoj.js → erDiagram-TEJ5UH35-BVSOMuM2.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-CbtYOry5.js → flowDiagram-I6XJVG4X-fYtDPJsW.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-ZEn2VEKR.js → ganttDiagram-6RSMTGT7-CmRXosW_.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-BZh-LkhJ.js → gitGraphDiagram-PVQCEYII-DPrmySxO.js} +1 -1
- package/web-shell/assets/index-BpKnmyFV.js +717 -0
- package/web-shell/assets/index-fLrtxpOG.css +5 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-B9HuZygK.js → infoDiagram-5YYISTIA-x3VbEuCV.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-D76cNpYG.js → ishikawaDiagram-YF4QCWOH-SmitHRMC.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-6bGo7P1t.js → journeyDiagram-JHISSGLW-BxvA551S.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-DuYyRBvB.js → kanban-definition-UN3LZRKU-DNHC16jY.js} +1 -1
- package/web-shell/assets/{linear-CpdSW1BC.js → linear-CQ6irBL9.js} +1 -1
- package/web-shell/assets/{mermaid.core-s5xbZMMj.js → mermaid.core-DtB6NO1e.js} +72 -72
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-go01fZ2y.js → mindmap-definition-RKZ34NQL-QKMAgV2v.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-BfuZiEHO.js → pieDiagram-4H26LBE5-bvb6dGn6.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-DsoINqV6.js → quadrantDiagram-W4KKPZXB-DLgdlG4D.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-B7FU4LiU.js → requirementDiagram-4Y6WPE33-2M9YH4GF.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-BEDjFnGB.js → sankeyDiagram-5OEKKPKP-DzwfclTH.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-gzmmL5tK.js → sequenceDiagram-3UESZ5HK-BvPmTuy2.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-BtHD4IN_.js → stateDiagram-AJRCARHV-BjwUmrJF.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-C4L8zXeL.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-T_8gmMCf.js → timeline-definition-PNZ67QCA-CXzS6qqz.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-DdjuqnjO.js → vennDiagram-CIIHVFJN-yRSolF5B.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-Cgtrvb37.js → wardley-L42UT6IY-ClLJjHPG.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-BW3f3-yW.js → wardleyDiagram-YWT4CUSO-VIa6t2p2.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-BUS9IKkc.js → xychartDiagram-2RQKCTM6-CtmrkezW.js} +1 -1
- package/web-shell/index.html +18 -2
- package/chunks/chunk-2JKEQWDZ.js +0 -1596
- package/chunks/chunk-32MCHZQC.js +0 -73
- package/chunks/chunk-UAKXW3DN.js +0 -30
- package/web-shell/assets/channel-eRvn2UA3.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-YZNwy1rx.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-YZNwy1rx.js +0 -1
- package/web-shell/assets/index-5FhE0ORO.css +0 -5
- package/web-shell/assets/index-CDTGmqVm.js +0 -720
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DFy6gLDd.js +0 -1
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import {
|
|
4
4
|
classifyApiError,
|
|
5
5
|
prefixMidTurnUserMessageParts
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VKGG724L.js";
|
|
7
7
|
import {
|
|
8
8
|
EXTENSION_CONTEXT_BUDGET,
|
|
9
9
|
buildExtensionMentionContext,
|
|
10
10
|
matchExtensionByRef,
|
|
11
11
|
parseExtensionRef
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-MNDTD5E5.js";
|
|
13
13
|
import {
|
|
14
14
|
HistoryReplayer,
|
|
15
15
|
MessageEmitter,
|
|
@@ -20,76 +20,87 @@ import {
|
|
|
20
20
|
insertAfterFunctionResponses,
|
|
21
21
|
isSlashCommand,
|
|
22
22
|
normalizePartList
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import {
|
|
25
|
-
collectContextData,
|
|
26
|
-
formatContextUsageText
|
|
27
|
-
} from "./chunk-GZKQ36JS.js";
|
|
23
|
+
} from "./chunk-ZXCVPMIK.js";
|
|
28
24
|
import {
|
|
29
25
|
appEvents,
|
|
30
26
|
buildDisabledSkillNamesProvider,
|
|
31
27
|
loadCliConfig,
|
|
32
28
|
normalizeDisabledToolList
|
|
33
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-MVZXZWGT.js";
|
|
30
|
+
import "./chunk-JZSY4WP3.js";
|
|
31
|
+
import {
|
|
32
|
+
collectContextData,
|
|
33
|
+
formatContextUsageText
|
|
34
|
+
} from "./chunk-SFN4TEHY.js";
|
|
34
35
|
import {
|
|
35
36
|
getCommandSubcommandNames
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import "./chunk-
|
|
37
|
+
} from "./chunk-TTFNVEO5.js";
|
|
38
|
+
import "./chunk-CG7SVARK.js";
|
|
38
39
|
import {
|
|
39
40
|
getEffectiveSupportedModes
|
|
40
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-75X2VLSH.js";
|
|
41
42
|
import {
|
|
42
43
|
isTerminalGoalStatusKind
|
|
43
44
|
} from "./chunk-KSPVDFE4.js";
|
|
44
45
|
import "./chunk-MRO43B25.js";
|
|
45
46
|
import "./chunk-VXGPYF7U.js";
|
|
46
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-2X2JUE47.js";
|
|
47
48
|
import "./chunk-KYMBIKIW.js";
|
|
48
|
-
import "./chunk-JZSY4WP3.js";
|
|
49
49
|
import "./chunk-HTWHAN44.js";
|
|
50
|
-
import "./chunk-
|
|
50
|
+
import "./chunk-AHNXYU4O.js";
|
|
51
|
+
import "./chunk-ND25GXEU.js";
|
|
52
|
+
import "./chunk-BJBWRCSK.js";
|
|
53
|
+
import "./chunk-CS5XYDBO.js";
|
|
51
54
|
import "./chunk-3GONHQOA.js";
|
|
52
|
-
import "./chunk-
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-2JKEQWDZ.js";
|
|
55
|
+
import "./chunk-OAFUMTWW.js";
|
|
56
|
+
import "./chunk-J3F7X3LW.js";
|
|
55
57
|
import {
|
|
58
|
+
createLoadedSettingsAdapter
|
|
59
|
+
} from "./chunk-73H73ASU.js";
|
|
60
|
+
import {
|
|
61
|
+
MAX_REMEMBER_CONTENT_BYTES,
|
|
62
|
+
extractRememberErrorCode,
|
|
56
63
|
isValidServerName
|
|
57
|
-
} from "./chunk-
|
|
58
|
-
import "./chunk-
|
|
59
|
-
import "./chunk-
|
|
60
|
-
import "./chunk-
|
|
61
|
-
import "./chunk-
|
|
64
|
+
} from "./chunk-RM3PGSGL.js";
|
|
65
|
+
import "./chunk-L7QPM2YD.js";
|
|
66
|
+
import "./chunk-54YZOP7P.js";
|
|
67
|
+
import "./chunk-HRZB5CSC.js";
|
|
68
|
+
import "./chunk-RNBYOUGV.js";
|
|
69
|
+
import "./chunk-W2ZOAX7F.js";
|
|
62
70
|
import "./chunk-KHDZHZMH.js";
|
|
71
|
+
import "./chunk-W6X4FGWX.js";
|
|
72
|
+
import {
|
|
73
|
+
CLIENT_MCP_OVER_WS_CONFIG_FLAG,
|
|
74
|
+
MID_TURN_QUEUE_DRAIN_METHOD
|
|
75
|
+
} from "./chunk-EWALXUAD.js";
|
|
76
|
+
import "./chunk-ALX6BUYW.js";
|
|
63
77
|
import {
|
|
64
78
|
formatAcpModelId,
|
|
65
79
|
parseAcpBaseModelId,
|
|
66
80
|
parseAcpModelOption,
|
|
67
81
|
sanitizeProviderBaseUrl
|
|
68
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-BQNJBEUA.js";
|
|
69
83
|
import {
|
|
70
84
|
PERMISSION_RULE_TYPES,
|
|
71
85
|
PermissionRulesValidationError,
|
|
72
86
|
buildPermissionSettings,
|
|
73
87
|
normalizePermissionRules,
|
|
74
88
|
readPermissionRuleSet
|
|
75
|
-
} from "./chunk-
|
|
76
|
-
import "./chunk-
|
|
89
|
+
} from "./chunk-QAFQLTXG.js";
|
|
90
|
+
import "./chunk-Q7VHIRDD.js";
|
|
77
91
|
import "./chunk-NIOPRZNN.js";
|
|
78
92
|
import {
|
|
79
93
|
NOT_CURRENTLY_GENERATING_CANCEL_MESSAGE
|
|
80
|
-
} from "./chunk-
|
|
81
|
-
import "./chunk-HIYUAXBG.js";
|
|
82
|
-
import {
|
|
83
|
-
CLIENT_MCP_OVER_WS_CONFIG_FLAG,
|
|
84
|
-
MID_TURN_QUEUE_DRAIN_METHOD
|
|
85
|
-
} from "./chunk-EWALXUAD.js";
|
|
94
|
+
} from "./chunk-T22H4V4R.js";
|
|
86
95
|
import "./chunk-SEZC2725.js";
|
|
87
|
-
import "./chunk-TMILTLP3.js";
|
|
88
|
-
import "./chunk-BJBWRCSK.js";
|
|
89
|
-
import "./chunk-ALX6BUYW.js";
|
|
90
96
|
import {
|
|
91
|
-
|
|
92
|
-
|
|
97
|
+
ACP_PREFLIGHT_KINDS,
|
|
98
|
+
IDLE_HOOK_EVENTS,
|
|
99
|
+
SERVE_CONTROL_EXT_METHODS,
|
|
100
|
+
SERVE_STATUS_EXT_METHODS,
|
|
101
|
+
STATUS_SCHEMA_VERSION,
|
|
102
|
+
mapDomainErrorToErrorKind
|
|
103
|
+
} from "./chunk-GICCHL2Q.js";
|
|
93
104
|
import {
|
|
94
105
|
OUTPUT_LANGUAGE_AUTO,
|
|
95
106
|
getOutputLanguageFilePath,
|
|
@@ -100,33 +111,29 @@ import {
|
|
|
100
111
|
resolveOutputLanguage,
|
|
101
112
|
updateOutputLanguageFile,
|
|
102
113
|
writeOutputLanguageAndRegisterPath
|
|
103
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-MKHC4BYZ.js";
|
|
104
115
|
import {
|
|
105
116
|
SUPPORTED_LANGUAGES,
|
|
106
117
|
getCurrentLanguage,
|
|
107
118
|
setLanguageAsync
|
|
108
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-UQYOMM6J.js";
|
|
109
120
|
import "./chunk-TLRYABYP.js";
|
|
121
|
+
import "./chunk-EDAGQADF.js";
|
|
122
|
+
import "./chunk-MX2YXRER.js";
|
|
123
|
+
import "./chunk-HI55Z6PR.js";
|
|
110
124
|
import {
|
|
111
125
|
AgentSideConnection,
|
|
112
126
|
PROTOCOL_VERSION,
|
|
113
127
|
RequestError,
|
|
114
128
|
ndJsonStream
|
|
115
129
|
} from "./chunk-UFC57OYT.js";
|
|
116
|
-
import
|
|
117
|
-
ACP_PREFLIGHT_KINDS,
|
|
118
|
-
IDLE_HOOK_EVENTS,
|
|
119
|
-
SERVE_CONTROL_EXT_METHODS,
|
|
120
|
-
SERVE_STATUS_EXT_METHODS,
|
|
121
|
-
STATUS_SCHEMA_VERSION,
|
|
122
|
-
mapDomainErrorToErrorKind
|
|
123
|
-
} from "./chunk-VHRREANT.js";
|
|
130
|
+
import "./chunk-OJCECIJA.js";
|
|
124
131
|
import "./chunk-PPFWEV7G.js";
|
|
125
132
|
import {
|
|
126
133
|
isFolderTrustEnabled,
|
|
127
134
|
isWorkspaceTrusted,
|
|
128
135
|
loadTrustedFolders
|
|
129
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-ZJP5T7IA.js";
|
|
130
137
|
import "./chunk-Y6Z2O3WR.js";
|
|
131
138
|
import "./chunk-QYUE6W3T.js";
|
|
132
139
|
import {
|
|
@@ -196,6 +203,7 @@ import {
|
|
|
196
203
|
getProviderToolCallId,
|
|
197
204
|
getScopedEnvContents,
|
|
198
205
|
getStartupContextLength,
|
|
206
|
+
hasImageParts,
|
|
199
207
|
injectPermissionRulesIfMissing,
|
|
200
208
|
isApproveOutcome,
|
|
201
209
|
isDenialFallbackReason,
|
|
@@ -204,6 +212,7 @@ import {
|
|
|
204
212
|
markDuplicateProviderToolCallResponseSent,
|
|
205
213
|
matchesAnyServerPattern,
|
|
206
214
|
needsConfirmation,
|
|
215
|
+
normalizeParts,
|
|
207
216
|
parsePositiveIntegerEnv,
|
|
208
217
|
persistPermissionOutcome,
|
|
209
218
|
readManyFiles,
|
|
@@ -213,34 +222,41 @@ import {
|
|
|
213
222
|
resolveBaseUrl,
|
|
214
223
|
restoreWorktreeContext,
|
|
215
224
|
runForkedAgent,
|
|
225
|
+
runManagedRememberByAgent,
|
|
226
|
+
runVisionBridge,
|
|
216
227
|
sessionIdContext,
|
|
217
228
|
setGoalTerminalObserver,
|
|
229
|
+
shouldClassifyAllShellForAutoMode,
|
|
218
230
|
shouldFallback,
|
|
219
231
|
shouldFirePermissionDeniedForAutoMode,
|
|
220
232
|
shouldForceAutoModeReviewForAllow,
|
|
221
233
|
shouldRunAutoModeForCall,
|
|
234
|
+
shouldRunVisionBridge,
|
|
235
|
+
splitImageParts,
|
|
222
236
|
subagentGenerator,
|
|
223
237
|
unregisterGoalHook,
|
|
224
238
|
updateSetting
|
|
225
|
-
} from "./chunk-
|
|
239
|
+
} from "./chunk-BFG6OZN7.js";
|
|
240
|
+
import "./chunk-5P5XGNYH.js";
|
|
226
241
|
import {
|
|
227
242
|
external_exports
|
|
228
243
|
} from "./chunk-K5PGHDBN.js";
|
|
229
|
-
import "./chunk-5P5XGNYH.js";
|
|
230
244
|
import "./chunk-SKAZWEV5.js";
|
|
231
|
-
import "./chunk-
|
|
232
|
-
import "./chunk-
|
|
233
|
-
import "./chunk-
|
|
245
|
+
import "./chunk-QOMAHFYI.js";
|
|
246
|
+
import "./chunk-G7OQ3RFJ.js";
|
|
247
|
+
import "./chunk-LKWAVAB5.js";
|
|
234
248
|
import {
|
|
235
249
|
runSideQuery
|
|
236
|
-
} from "./chunk-
|
|
237
|
-
import "./chunk-
|
|
250
|
+
} from "./chunk-MEQWZGK5.js";
|
|
251
|
+
import "./chunk-UANCYOOQ.js";
|
|
238
252
|
import "./chunk-2MPVVENX.js";
|
|
239
253
|
import "./chunk-ZTQ26VBE.js";
|
|
240
254
|
import "./chunk-SJBIFVD2.js";
|
|
241
255
|
import "./chunk-MLZQVCF3.js";
|
|
256
|
+
import "./chunk-S5EQPDTM.js";
|
|
242
257
|
import "./chunk-LQ7TMOCE.js";
|
|
243
|
-
import "./chunk-
|
|
258
|
+
import "./chunk-E5A7LHNN.js";
|
|
259
|
+
import "./chunk-GO6LNQXT.js";
|
|
244
260
|
import "./chunk-B236XPGF.js";
|
|
245
261
|
import {
|
|
246
262
|
HookEventName,
|
|
@@ -270,8 +286,8 @@ import {
|
|
|
270
286
|
startToolSpan,
|
|
271
287
|
uiTelemetryService,
|
|
272
288
|
withInteractionSpan
|
|
273
|
-
} from "./chunk-
|
|
274
|
-
import "./chunk-
|
|
289
|
+
} from "./chunk-HJDF3ZVU.js";
|
|
290
|
+
import "./chunk-E6US47KI.js";
|
|
275
291
|
import "./chunk-UWCTAVOD.js";
|
|
276
292
|
import "./chunk-OFEVLU4C.js";
|
|
277
293
|
import "./chunk-OMX7CUOE.js";
|
|
@@ -280,16 +296,16 @@ import {
|
|
|
280
296
|
getUserAutoMemoryRoot
|
|
281
297
|
} from "./chunk-MOUXUCXQ.js";
|
|
282
298
|
import "./chunk-BZHLWC6T.js";
|
|
283
|
-
import "./chunk-
|
|
299
|
+
import "./chunk-UQFP2FEF.js";
|
|
284
300
|
import {
|
|
285
301
|
ToolConfirmationOutcome,
|
|
286
302
|
ToolNames
|
|
287
|
-
} from "./chunk-
|
|
303
|
+
} from "./chunk-4VZH35PN.js";
|
|
288
304
|
import {
|
|
289
305
|
clearCachedCredentialFile,
|
|
290
306
|
qwenOAuth2Events
|
|
291
|
-
} from "./chunk-
|
|
292
|
-
import "./chunk-
|
|
307
|
+
} from "./chunk-TENOUWY2.js";
|
|
308
|
+
import "./chunk-GLPV75ES.js";
|
|
293
309
|
import "./chunk-22IFUCVR.js";
|
|
294
310
|
import "./chunk-T42ACHFI.js";
|
|
295
311
|
import {
|
|
@@ -303,7 +319,7 @@ import "./chunk-55ZMG67I.js";
|
|
|
303
319
|
import "./chunk-H6BD2ELD.js";
|
|
304
320
|
import "./chunk-5IFG2VC4.js";
|
|
305
321
|
import "./chunk-64WXLC72.js";
|
|
306
|
-
import "./chunk-
|
|
322
|
+
import "./chunk-D5KISTLW.js";
|
|
307
323
|
import {
|
|
308
324
|
Storage,
|
|
309
325
|
createDebugLogger,
|
|
@@ -311,10 +327,10 @@ import {
|
|
|
311
327
|
getErrorStatus,
|
|
312
328
|
isSubpath
|
|
313
329
|
} from "./chunk-AVQDCKNF.js";
|
|
314
|
-
import "./chunk-
|
|
330
|
+
import "./chunk-XCUFHOAD.js";
|
|
315
331
|
import {
|
|
316
332
|
runExitCleanup
|
|
317
|
-
} from "./chunk-
|
|
333
|
+
} from "./chunk-FYKX6XOT.js";
|
|
318
334
|
import "./chunk-ZERZSAZL.js";
|
|
319
335
|
import "./chunk-QN5NZ3UQ.js";
|
|
320
336
|
import "./chunk-BR4QREVK.js";
|
|
@@ -542,7 +558,6 @@ var AcpFileSystemService = class {
|
|
|
542
558
|
import { Readable, Writable } from "node:stream";
|
|
543
559
|
import { pipeline } from "node:stream/promises";
|
|
544
560
|
import * as fs from "node:fs/promises";
|
|
545
|
-
import { createRequire } from "node:module";
|
|
546
561
|
import * as path3 from "node:path";
|
|
547
562
|
import { createGunzip } from "node:zlib";
|
|
548
563
|
|
|
@@ -1252,6 +1267,8 @@ __name(maskApiKeyForDisplay, "maskApiKeyForDisplay");
|
|
|
1252
1267
|
var DAEMON_TURN_TOOL_CALL_CAP = 100;
|
|
1253
1268
|
var DAEMON_INVALID_TOOL_PARAMS_THRESHOLD = 3;
|
|
1254
1269
|
var PERMISSION_CANCEL_SKIP_MESSAGE = "Skipped because a permission request was cancelled before the user answered; user input is required before continuing.";
|
|
1270
|
+
var LOOP_DETECTED_SKIP_MESSAGE = "Skipped because loop detection stopped the current turn before this tool call could run.";
|
|
1271
|
+
var LOOP_DETECTED_CONTEXT_MESSAGE = "System: this turn was terminated because the model exceeded tool-call safety limits. Try a different approach on the next turn.";
|
|
1255
1272
|
function createDaemonToolLoopState() {
|
|
1256
1273
|
return {
|
|
1257
1274
|
totalToolCalls: 0,
|
|
@@ -1286,7 +1303,7 @@ __name(recordDaemonToolCalls, "recordDaemonToolCalls");
|
|
|
1286
1303
|
function recordDaemonInvalidToolParams(config, promptId, loopState, toolName, error) {
|
|
1287
1304
|
if (!loopState || loopState.loopDetected)
|
|
1288
1305
|
return loopState?.loopDetected ?? false;
|
|
1289
|
-
const key =
|
|
1306
|
+
const key = toolName;
|
|
1290
1307
|
const count = (loopState.invalidToolParamErrors.get(key) ?? 0) + 1;
|
|
1291
1308
|
loopState.invalidToolParamErrors.set(key, count);
|
|
1292
1309
|
if (count < DAEMON_INVALID_TOOL_PARAMS_THRESHOLD) return false;
|
|
@@ -1465,6 +1482,17 @@ var MidTurnDrainTimeoutError = class extends Error {
|
|
|
1465
1482
|
}
|
|
1466
1483
|
};
|
|
1467
1484
|
var MAX_NOTIFICATION_QUEUE = 20;
|
|
1485
|
+
function resolveHomeLoopResolverRoots({
|
|
1486
|
+
homeQwenDir = Storage.getGlobalQwenDir(),
|
|
1487
|
+
homeDir = os.homedir(),
|
|
1488
|
+
qwenHome = process.env["QWEN_HOME"]
|
|
1489
|
+
} = {}) {
|
|
1490
|
+
return {
|
|
1491
|
+
homeConfineRoot: (qwenHome ? homeQwenDir : homeDir) || path2.dirname(homeQwenDir),
|
|
1492
|
+
homeQwenDir
|
|
1493
|
+
};
|
|
1494
|
+
}
|
|
1495
|
+
__name(resolveHomeLoopResolverRoots, "resolveHomeLoopResolverRoots");
|
|
1468
1496
|
function computeInitialTurnFromHistory(records, sessionId) {
|
|
1469
1497
|
let maxPromptTurn = 0;
|
|
1470
1498
|
let userMessageCount = 0;
|
|
@@ -2386,7 +2414,7 @@ ${this.pendingWorktreeNotice}
|
|
|
2386
2414
|
toolLoopState
|
|
2387
2415
|
);
|
|
2388
2416
|
if (toolRun.stopAfterPermissionCancel) {
|
|
2389
|
-
await this.#
|
|
2417
|
+
await this.#preserveStoppedToolRun(
|
|
2390
2418
|
toolRun,
|
|
2391
2419
|
pendingSend.signal
|
|
2392
2420
|
);
|
|
@@ -2396,6 +2424,13 @@ ${this.pendingWorktreeNotice}
|
|
|
2396
2424
|
toolRun,
|
|
2397
2425
|
pendingSend.signal
|
|
2398
2426
|
);
|
|
2427
|
+
if (toolRun.loopDetected) {
|
|
2428
|
+
await this.#preserveStoppedToolRun(
|
|
2429
|
+
toolRun,
|
|
2430
|
+
pendingSend.signal
|
|
2431
|
+
);
|
|
2432
|
+
return { stopReason: "end_turn" };
|
|
2433
|
+
}
|
|
2399
2434
|
}
|
|
2400
2435
|
}
|
|
2401
2436
|
if (this.messageRewriter) {
|
|
@@ -2583,16 +2618,17 @@ ${this.pendingWorktreeNotice}
|
|
|
2583
2618
|
toolLoopState
|
|
2584
2619
|
);
|
|
2585
2620
|
if (toolRun.stopAfterPermissionCancel) {
|
|
2586
|
-
await this.#
|
|
2587
|
-
toolRun,
|
|
2588
|
-
pendingSend.signal
|
|
2589
|
-
);
|
|
2621
|
+
await this.#preserveStoppedToolRun(toolRun, pendingSend.signal);
|
|
2590
2622
|
return { stopReason: "end_turn" };
|
|
2591
2623
|
}
|
|
2592
2624
|
nextMessage = await this.#buildNextMessageAfterToolRun(
|
|
2593
2625
|
toolRun,
|
|
2594
2626
|
pendingSend.signal
|
|
2595
2627
|
);
|
|
2628
|
+
if (toolRun.loopDetected) {
|
|
2629
|
+
await this.#preserveStoppedToolRun(toolRun, pendingSend.signal);
|
|
2630
|
+
return { stopReason: "end_turn" };
|
|
2631
|
+
}
|
|
2596
2632
|
}
|
|
2597
2633
|
}
|
|
2598
2634
|
continue;
|
|
@@ -2714,12 +2750,13 @@ ${this.pendingWorktreeNotice}
|
|
|
2714
2750
|
});
|
|
2715
2751
|
}
|
|
2716
2752
|
}
|
|
2717
|
-
async #
|
|
2753
|
+
async #preserveStoppedToolRun(toolRun, abortSignal) {
|
|
2718
2754
|
this.#preserveUnsentMessageHistory(
|
|
2719
2755
|
{
|
|
2720
2756
|
role: "user",
|
|
2721
2757
|
parts: [
|
|
2722
2758
|
...toolRun.parts,
|
|
2759
|
+
...toolRun.loopDetected ? [{ text: LOOP_DETECTED_CONTEXT_MESSAGE }] : [],
|
|
2723
2760
|
...await this.#drainMidTurnUserMessages(abortSignal)
|
|
2724
2761
|
]
|
|
2725
2762
|
},
|
|
@@ -3013,8 +3050,7 @@ ${this.pendingWorktreeNotice}
|
|
|
3013
3050
|
#getLoopTickResolver() {
|
|
3014
3051
|
const root = this.config.getWorkingDir();
|
|
3015
3052
|
if (!this.loopTickResolver || this.loopTickResolverRoot !== root) {
|
|
3016
|
-
const homeQwenDir =
|
|
3017
|
-
const homeConfineRoot = (process.env["QWEN_HOME"] ? homeQwenDir : os.homedir()) || path2.dirname(homeQwenDir);
|
|
3053
|
+
const { homeConfineRoot, homeQwenDir } = resolveHomeLoopResolverRoots();
|
|
3018
3054
|
this.loopTickResolver = new LoopTickResolver({
|
|
3019
3055
|
projectRoot: root,
|
|
3020
3056
|
homeDir: homeConfineRoot,
|
|
@@ -3187,16 +3223,17 @@ ${this.pendingWorktreeNotice}
|
|
|
3187
3223
|
toolLoopState
|
|
3188
3224
|
);
|
|
3189
3225
|
if (toolRun.stopAfterPermissionCancel) {
|
|
3190
|
-
await this.#
|
|
3191
|
-
toolRun,
|
|
3192
|
-
ac.signal
|
|
3193
|
-
);
|
|
3226
|
+
await this.#preserveStoppedToolRun(toolRun, ac.signal);
|
|
3194
3227
|
return;
|
|
3195
3228
|
}
|
|
3196
3229
|
nextMessage = await this.#buildNextMessageAfterToolRun(
|
|
3197
3230
|
toolRun,
|
|
3198
3231
|
ac.signal
|
|
3199
3232
|
);
|
|
3233
|
+
if (toolRun.loopDetected) {
|
|
3234
|
+
await this.#preserveStoppedToolRun(toolRun, ac.signal);
|
|
3235
|
+
return;
|
|
3236
|
+
}
|
|
3200
3237
|
}
|
|
3201
3238
|
}
|
|
3202
3239
|
} catch (error) {
|
|
@@ -3424,10 +3461,7 @@ ${this.pendingWorktreeNotice}
|
|
|
3424
3461
|
toolLoopState
|
|
3425
3462
|
);
|
|
3426
3463
|
if (toolRun.stopAfterPermissionCancel) {
|
|
3427
|
-
await this.#
|
|
3428
|
-
toolRun,
|
|
3429
|
-
ac.signal
|
|
3430
|
-
);
|
|
3464
|
+
await this.#preserveStoppedToolRun(toolRun, ac.signal);
|
|
3431
3465
|
await this.#emitBackgroundNotificationEndTurn("end_turn");
|
|
3432
3466
|
return;
|
|
3433
3467
|
}
|
|
@@ -3435,6 +3469,11 @@ ${this.pendingWorktreeNotice}
|
|
|
3435
3469
|
toolRun,
|
|
3436
3470
|
ac.signal
|
|
3437
3471
|
);
|
|
3472
|
+
if (toolRun.loopDetected) {
|
|
3473
|
+
await this.#preserveStoppedToolRun(toolRun, ac.signal);
|
|
3474
|
+
await this.#emitBackgroundNotificationEndTurn("end_turn");
|
|
3475
|
+
return;
|
|
3476
|
+
}
|
|
3438
3477
|
}
|
|
3439
3478
|
}
|
|
3440
3479
|
if (this.messageRewriter) {
|
|
@@ -3673,19 +3712,57 @@ ${this.pendingWorktreeNotice}
|
|
|
3673
3712
|
* on. Response-part ordering matches the original `functionCalls` order.
|
|
3674
3713
|
*/
|
|
3675
3714
|
async runToolCalls(abortSignal, promptId, functionCalls, toolLoopState) {
|
|
3715
|
+
const dedupedFunctionCalls = dedupeToolCallsById(functionCalls);
|
|
3716
|
+
let skippedToolCallCounter = 0;
|
|
3717
|
+
const recordSkippedToolCall = /* @__PURE__ */ __name(async (fc, message = PERMISSION_CANCEL_SKIP_MESSAGE, emitStart = true) => {
|
|
3718
|
+
const toolName = fc.name ?? "unknown_tool";
|
|
3719
|
+
const callId = fc.id ?? `${toolName}-skip-${++skippedToolCallCounter}`;
|
|
3720
|
+
const part = {
|
|
3721
|
+
functionResponse: {
|
|
3722
|
+
id: callId,
|
|
3723
|
+
name: toolName,
|
|
3724
|
+
response: { error: message }
|
|
3725
|
+
}
|
|
3726
|
+
};
|
|
3727
|
+
const error = new Error(message);
|
|
3728
|
+
try {
|
|
3729
|
+
this.config.getChatRecordingService()?.recordToolResult([part], {
|
|
3730
|
+
callId,
|
|
3731
|
+
status: "error",
|
|
3732
|
+
resultDisplay: void 0,
|
|
3733
|
+
error,
|
|
3734
|
+
errorType: void 0
|
|
3735
|
+
});
|
|
3736
|
+
if (emitStart) {
|
|
3737
|
+
await this.toolCallEmitter.emitStart({
|
|
3738
|
+
callId,
|
|
3739
|
+
toolName,
|
|
3740
|
+
args: fc.args ?? {},
|
|
3741
|
+
status: "pending"
|
|
3742
|
+
});
|
|
3743
|
+
}
|
|
3744
|
+
await this.toolCallEmitter.emitError(callId, toolName, error);
|
|
3745
|
+
} catch (recordError) {
|
|
3746
|
+
debugLogger5.error("Failed to record skipped tool call:", recordError);
|
|
3747
|
+
}
|
|
3748
|
+
return part;
|
|
3749
|
+
}, "recordSkippedToolCall");
|
|
3676
3750
|
if (recordDaemonToolCalls(
|
|
3677
3751
|
this.config,
|
|
3678
3752
|
promptId,
|
|
3679
3753
|
toolLoopState,
|
|
3680
|
-
|
|
3754
|
+
dedupedFunctionCalls.length
|
|
3681
3755
|
)) {
|
|
3682
3756
|
return {
|
|
3683
|
-
parts:
|
|
3757
|
+
parts: await Promise.all(
|
|
3758
|
+
dedupedFunctionCalls.map(
|
|
3759
|
+
(fc) => recordSkippedToolCall(fc, LOOP_DETECTED_SKIP_MESSAGE, false)
|
|
3760
|
+
)
|
|
3761
|
+
),
|
|
3684
3762
|
stopAfterPermissionCancel: false,
|
|
3685
3763
|
loopDetected: true
|
|
3686
3764
|
};
|
|
3687
3765
|
}
|
|
3688
|
-
const dedupedFunctionCalls = dedupeToolCallsById(functionCalls);
|
|
3689
3766
|
const batches = [];
|
|
3690
3767
|
const handledProviderToolCallIds = new Set(
|
|
3691
3768
|
this.#getCurrentChat().getHistoryFunctionResponseIds()
|
|
@@ -3787,53 +3864,80 @@ ${this.pendingWorktreeNotice}
|
|
|
3787
3864
|
batches.push({ kind: "execute", concurrent: isAgent, calls: [fc] });
|
|
3788
3865
|
}
|
|
3789
3866
|
}
|
|
3790
|
-
|
|
3791
|
-
const recordSkippedToolCall = /* @__PURE__ */ __name(async (fc) => {
|
|
3792
|
-
const toolName = fc.name ?? "unknown_tool";
|
|
3793
|
-
const callId = fc.id ?? `${toolName}-skip-${++skippedToolCallCounter}`;
|
|
3794
|
-
const part = {
|
|
3795
|
-
functionResponse: {
|
|
3796
|
-
id: callId,
|
|
3797
|
-
name: toolName,
|
|
3798
|
-
response: { error: PERMISSION_CANCEL_SKIP_MESSAGE }
|
|
3799
|
-
}
|
|
3800
|
-
};
|
|
3801
|
-
const error = new Error(PERMISSION_CANCEL_SKIP_MESSAGE);
|
|
3802
|
-
try {
|
|
3803
|
-
this.config.getChatRecordingService()?.recordToolResult([part], {
|
|
3804
|
-
callId,
|
|
3805
|
-
status: "error",
|
|
3806
|
-
resultDisplay: void 0,
|
|
3807
|
-
error,
|
|
3808
|
-
errorType: void 0
|
|
3809
|
-
});
|
|
3810
|
-
await this.toolCallEmitter.emitStart({
|
|
3811
|
-
callId,
|
|
3812
|
-
toolName,
|
|
3813
|
-
args: fc.args ?? {},
|
|
3814
|
-
status: "pending"
|
|
3815
|
-
});
|
|
3816
|
-
await this.toolCallEmitter.emitError(callId, toolName, error);
|
|
3817
|
-
} catch (recordError) {
|
|
3818
|
-
debugLogger5.error("Failed to record skipped tool call:", recordError);
|
|
3819
|
-
}
|
|
3820
|
-
return part;
|
|
3821
|
-
}, "recordSkippedToolCall");
|
|
3822
|
-
const appendSkippedAfter = /* @__PURE__ */ __name(async (parts2, fc) => {
|
|
3867
|
+
const appendSkippedAfter = /* @__PURE__ */ __name(async (parts2, fc, message = PERMISSION_CANCEL_SKIP_MESSAGE) => {
|
|
3823
3868
|
const startIndex = dedupedFunctionCalls.indexOf(fc) + 1;
|
|
3824
3869
|
for (const remainingCall of dedupedFunctionCalls.slice(startIndex)) {
|
|
3825
|
-
parts2.push(await recordSkippedToolCall(remainingCall));
|
|
3870
|
+
parts2.push(await recordSkippedToolCall(remainingCall, message));
|
|
3826
3871
|
}
|
|
3827
3872
|
}, "appendSkippedAfter");
|
|
3828
|
-
const runBounded = /* @__PURE__ */ __name(async (calls, runAbortSignal, onStopAfterPermissionCancel, shouldSkipUnstarted) => {
|
|
3829
|
-
const
|
|
3873
|
+
const runBounded = /* @__PURE__ */ __name(async (calls, runAbortSignal, onStopAfterPermissionCancel, onStopAfterLoopDetected, shouldSkipUnstarted) => {
|
|
3874
|
+
const configuredMaxConcurrency = parsePositiveIntegerEnv(
|
|
3830
3875
|
process.env["QWEN_CODE_MAX_TOOL_CONCURRENCY"],
|
|
3831
3876
|
10
|
|
3832
3877
|
);
|
|
3878
|
+
const maxConcurrency = toolLoopState ? Math.min(
|
|
3879
|
+
configuredMaxConcurrency,
|
|
3880
|
+
DAEMON_INVALID_TOOL_PARAMS_THRESHOLD
|
|
3881
|
+
) : configuredMaxConcurrency;
|
|
3833
3882
|
const results = new Array(calls.length);
|
|
3834
3883
|
const executing = /* @__PURE__ */ new Set();
|
|
3835
|
-
|
|
3884
|
+
const fillLoopSkippedFrom = /* @__PURE__ */ __name(async (startIndex2) => {
|
|
3885
|
+
for (let i = startIndex2; i < calls.length; i++) {
|
|
3886
|
+
if (results[i]) continue;
|
|
3887
|
+
results[i] = {
|
|
3888
|
+
parts: [
|
|
3889
|
+
await recordSkippedToolCall(calls[i], LOOP_DETECTED_SKIP_MESSAGE)
|
|
3890
|
+
],
|
|
3891
|
+
stopAfterPermissionCancel: false,
|
|
3892
|
+
loopDetected: true
|
|
3893
|
+
};
|
|
3894
|
+
}
|
|
3895
|
+
}, "fillLoopSkippedFrom");
|
|
3896
|
+
const fillPermissionSkippedFrom = /* @__PURE__ */ __name(async (startIndex2) => {
|
|
3897
|
+
for (let i = startIndex2; i < calls.length; i++) {
|
|
3898
|
+
if (results[i]) continue;
|
|
3899
|
+
results[i] = {
|
|
3900
|
+
parts: [await recordSkippedToolCall(calls[i])],
|
|
3901
|
+
stopAfterPermissionCancel: false
|
|
3902
|
+
};
|
|
3903
|
+
}
|
|
3904
|
+
}, "fillPermissionSkippedFrom");
|
|
3905
|
+
let startIndex = 0;
|
|
3906
|
+
if (toolLoopState && calls.length > DAEMON_INVALID_TOOL_PARAMS_THRESHOLD) {
|
|
3907
|
+
startIndex = DAEMON_INVALID_TOOL_PARAMS_THRESHOLD;
|
|
3908
|
+
for (let i = 0; i < startIndex; i++) {
|
|
3909
|
+
if (runAbortSignal.aborted && shouldSkipUnstarted?.()) {
|
|
3910
|
+
results[i] = {
|
|
3911
|
+
parts: [await recordSkippedToolCall(calls[i])],
|
|
3912
|
+
stopAfterPermissionCancel: false
|
|
3913
|
+
};
|
|
3914
|
+
continue;
|
|
3915
|
+
}
|
|
3916
|
+
const r = await this.runTool(
|
|
3917
|
+
runAbortSignal,
|
|
3918
|
+
promptId,
|
|
3919
|
+
calls[i],
|
|
3920
|
+
onStopAfterPermissionCancel,
|
|
3921
|
+
toolLoopState,
|
|
3922
|
+
recordSkippedToolCall
|
|
3923
|
+
);
|
|
3924
|
+
results[i] = r;
|
|
3925
|
+
if (r.loopDetected) {
|
|
3926
|
+
await fillLoopSkippedFrom(i + 1);
|
|
3927
|
+
return results;
|
|
3928
|
+
}
|
|
3929
|
+
if (r.stopAfterPermissionCancel) {
|
|
3930
|
+
await fillPermissionSkippedFrom(i + 1);
|
|
3931
|
+
return results;
|
|
3932
|
+
}
|
|
3933
|
+
}
|
|
3934
|
+
}
|
|
3935
|
+
for (let i = startIndex; i < calls.length; i++) {
|
|
3836
3936
|
const idx = i;
|
|
3937
|
+
if (toolLoopState?.loopDetected) {
|
|
3938
|
+
await fillLoopSkippedFrom(idx);
|
|
3939
|
+
return results;
|
|
3940
|
+
}
|
|
3837
3941
|
if (runAbortSignal.aborted && shouldSkipUnstarted?.()) {
|
|
3838
3942
|
results[idx] = {
|
|
3839
3943
|
parts: [await recordSkippedToolCall(calls[idx])],
|
|
@@ -3846,7 +3950,8 @@ ${this.pendingWorktreeNotice}
|
|
|
3846
3950
|
promptId,
|
|
3847
3951
|
calls[idx],
|
|
3848
3952
|
onStopAfterPermissionCancel,
|
|
3849
|
-
toolLoopState
|
|
3953
|
+
toolLoopState,
|
|
3954
|
+
recordSkippedToolCall
|
|
3850
3955
|
).then((r) => {
|
|
3851
3956
|
results[idx] = r;
|
|
3852
3957
|
}).finally(() => {
|
|
@@ -3855,6 +3960,23 @@ ${this.pendingWorktreeNotice}
|
|
|
3855
3960
|
executing.add(p);
|
|
3856
3961
|
if (executing.size >= maxConcurrency) {
|
|
3857
3962
|
await Promise.race(executing);
|
|
3963
|
+
if (results.some((result) => result?.loopDetected)) {
|
|
3964
|
+
onStopAfterLoopDetected?.();
|
|
3965
|
+
await Promise.all(executing);
|
|
3966
|
+
await fillLoopSkippedFrom(idx + 1);
|
|
3967
|
+
return results;
|
|
3968
|
+
}
|
|
3969
|
+
const invalidToolErrorNearThreshold = toolLoopState && [...toolLoopState.invalidToolParamErrors.values()].some(
|
|
3970
|
+
(count) => count >= DAEMON_INVALID_TOOL_PARAMS_THRESHOLD - 1
|
|
3971
|
+
);
|
|
3972
|
+
if (invalidToolErrorNearThreshold && executing.size > 0) {
|
|
3973
|
+
await Promise.all(executing);
|
|
3974
|
+
if (results.some((result) => result?.loopDetected)) {
|
|
3975
|
+
onStopAfterLoopDetected?.();
|
|
3976
|
+
await fillLoopSkippedFrom(idx + 1);
|
|
3977
|
+
return results;
|
|
3978
|
+
}
|
|
3979
|
+
}
|
|
3858
3980
|
}
|
|
3859
3981
|
}
|
|
3860
3982
|
await Promise.all(executing);
|
|
@@ -3890,6 +4012,7 @@ ${this.pendingWorktreeNotice}
|
|
|
3890
4012
|
batch.calls,
|
|
3891
4013
|
batchAbortController.signal,
|
|
3892
4014
|
stopBatchAfterPermissionCancel,
|
|
4015
|
+
() => batchAbortController.abort("loop_detected"),
|
|
3893
4016
|
() => batchStopAfterPermissionCancel
|
|
3894
4017
|
);
|
|
3895
4018
|
} finally {
|
|
@@ -3903,6 +4026,11 @@ ${this.pendingWorktreeNotice}
|
|
|
3903
4026
|
shouldStopForLoop ||= r.loopDetected === true;
|
|
3904
4027
|
}
|
|
3905
4028
|
if (shouldStopForLoop) {
|
|
4029
|
+
await appendSkippedAfter(
|
|
4030
|
+
parts,
|
|
4031
|
+
batch.calls[batch.calls.length - 1],
|
|
4032
|
+
LOOP_DETECTED_SKIP_MESSAGE
|
|
4033
|
+
);
|
|
3906
4034
|
return {
|
|
3907
4035
|
parts,
|
|
3908
4036
|
stopAfterPermissionCancel: false,
|
|
@@ -3924,10 +4052,12 @@ ${this.pendingWorktreeNotice}
|
|
|
3924
4052
|
promptId,
|
|
3925
4053
|
fc,
|
|
3926
4054
|
void 0,
|
|
3927
|
-
toolLoopState
|
|
4055
|
+
toolLoopState,
|
|
4056
|
+
recordSkippedToolCall
|
|
3928
4057
|
);
|
|
3929
4058
|
parts.push(...r.parts);
|
|
3930
4059
|
if (r.loopDetected) {
|
|
4060
|
+
await appendSkippedAfter(parts, fc, LOOP_DETECTED_SKIP_MESSAGE);
|
|
3931
4061
|
return {
|
|
3932
4062
|
parts,
|
|
3933
4063
|
stopAfterPermissionCancel: false,
|
|
@@ -3981,9 +4111,24 @@ ${this.pendingWorktreeNotice}
|
|
|
3981
4111
|
}
|
|
3982
4112
|
return reminders;
|
|
3983
4113
|
}
|
|
3984
|
-
async runTool(abortSignal, promptId, fc, onStopAfterPermissionCancel, toolLoopState) {
|
|
4114
|
+
async runTool(abortSignal, promptId, fc, onStopAfterPermissionCancel, toolLoopState, recordSkippedToolCall) {
|
|
3985
4115
|
const callId = fc.id ?? `${fc.name}-${Date.now()}`;
|
|
3986
4116
|
let args = fc.args ?? {};
|
|
4117
|
+
if (toolLoopState?.loopDetected) {
|
|
4118
|
+
return {
|
|
4119
|
+
parts: [
|
|
4120
|
+
recordSkippedToolCall ? await recordSkippedToolCall(fc, LOOP_DETECTED_SKIP_MESSAGE, false) : {
|
|
4121
|
+
functionResponse: {
|
|
4122
|
+
id: callId,
|
|
4123
|
+
name: fc.name ?? "unknown_tool",
|
|
4124
|
+
response: { error: LOOP_DETECTED_SKIP_MESSAGE }
|
|
4125
|
+
}
|
|
4126
|
+
}
|
|
4127
|
+
],
|
|
4128
|
+
stopAfterPermissionCancel: false,
|
|
4129
|
+
loopDetected: true
|
|
4130
|
+
};
|
|
4131
|
+
}
|
|
3987
4132
|
const startTime = Date.now();
|
|
3988
4133
|
let spanError;
|
|
3989
4134
|
let activeToolAbortSignal = abortSignal;
|
|
@@ -4036,20 +4181,32 @@ ${this.pendingWorktreeNotice}
|
|
|
4036
4181
|
error,
|
|
4037
4182
|
errorType: void 0
|
|
4038
4183
|
});
|
|
4184
|
+
const loopDetected = opts?.recordInvalidToolParams === true && !activeToolAbortSignal.aborted && !opts?.stopAfterPermissionCancel && recordDaemonInvalidToolParams(
|
|
4185
|
+
this.config,
|
|
4186
|
+
promptId,
|
|
4187
|
+
toolLoopState,
|
|
4188
|
+
toolName2,
|
|
4189
|
+
error
|
|
4190
|
+
);
|
|
4039
4191
|
return {
|
|
4040
4192
|
parts: errorParts,
|
|
4041
|
-
stopAfterPermissionCancel: opts?.stopAfterPermissionCancel ?? false
|
|
4193
|
+
stopAfterPermissionCancel: opts?.stopAfterPermissionCancel ?? false,
|
|
4194
|
+
loopDetected
|
|
4042
4195
|
};
|
|
4043
4196
|
}, "earlyErrorResponse");
|
|
4044
4197
|
if (!fc.name) {
|
|
4045
|
-
return earlyErrorResponse(new Error("Missing function name")
|
|
4198
|
+
return earlyErrorResponse(new Error("Missing function name"), void 0, {
|
|
4199
|
+
recordInvalidToolParams: true
|
|
4200
|
+
});
|
|
4046
4201
|
}
|
|
4047
4202
|
const toolName = fc.name;
|
|
4048
4203
|
const toolRegistry = this.config.getToolRegistry();
|
|
4049
4204
|
const tool = toolRegistry.getTool(toolName);
|
|
4050
4205
|
if (!tool) {
|
|
4051
4206
|
return earlyErrorResponse(
|
|
4052
|
-
new Error(`Tool "${toolName}" not found in registry.`)
|
|
4207
|
+
new Error(`Tool "${toolName}" not found in registry.`),
|
|
4208
|
+
toolName,
|
|
4209
|
+
{ recordInvalidToolParams: true }
|
|
4053
4210
|
);
|
|
4054
4211
|
}
|
|
4055
4212
|
const toolSpan = startToolSpan(toolName, {
|
|
@@ -4133,7 +4290,7 @@ ${this.pendingWorktreeNotice}
|
|
|
4133
4290
|
toolName
|
|
4134
4291
|
);
|
|
4135
4292
|
}
|
|
4136
|
-
const forceAutoReviewForAllow = approvalMode === "auto" /* AUTO */ && shouldForceAutoModeReviewForAllow(pmCtx, this.config.getCwd());
|
|
4293
|
+
const forceAutoReviewForAllow = approvalMode === "auto" /* AUTO */ && (shouldForceAutoModeReviewForAllow(pmCtx, this.config.getCwd()) || shouldClassifyAllShellForAutoMode(toolName, this.config));
|
|
4137
4294
|
const confirmationPermission = getEffectivePermissionForConfirmation(
|
|
4138
4295
|
finalPermission,
|
|
4139
4296
|
forceAutoReviewForAllow
|
|
@@ -4733,12 +4890,29 @@ ${this.pendingWorktreeNotice}
|
|
|
4733
4890
|
const FILE_URI_SCHEME = "file://";
|
|
4734
4891
|
const embeddedContext = [];
|
|
4735
4892
|
const extensionMentions = /* @__PURE__ */ new Map();
|
|
4893
|
+
const preserveUnsupportedImageForBridge = shouldRunVisionBridge(
|
|
4894
|
+
this.config
|
|
4895
|
+
);
|
|
4736
4896
|
const parts = message.map((part) => {
|
|
4737
4897
|
switch (part.type) {
|
|
4738
4898
|
case "text":
|
|
4739
4899
|
collectExtensionMentionRefs(part.text, extensionMentions);
|
|
4740
4900
|
return { text: part.text };
|
|
4741
4901
|
case "image":
|
|
4902
|
+
if (preserveUnsupportedImageForBridge) {
|
|
4903
|
+
return {
|
|
4904
|
+
inlineData: {
|
|
4905
|
+
mimeType: part.mimeType,
|
|
4906
|
+
data: part.data
|
|
4907
|
+
}
|
|
4908
|
+
};
|
|
4909
|
+
}
|
|
4910
|
+
return clampInlineMediaPart({
|
|
4911
|
+
inlineData: {
|
|
4912
|
+
mimeType: part.mimeType,
|
|
4913
|
+
data: part.data
|
|
4914
|
+
}
|
|
4915
|
+
});
|
|
4742
4916
|
case "audio":
|
|
4743
4917
|
return clampInlineMediaPart({
|
|
4744
4918
|
inlineData: {
|
|
@@ -4775,10 +4949,13 @@ ${this.pendingWorktreeNotice}
|
|
|
4775
4949
|
abortSignal
|
|
4776
4950
|
);
|
|
4777
4951
|
if (atPathCommandParts.length === 0 && embeddedContext.length === 0 && extensionParts.length === 0) {
|
|
4778
|
-
return parts;
|
|
4952
|
+
return this.#applyVisionBridgeIfNeeded(parts, abortSignal);
|
|
4779
4953
|
}
|
|
4780
4954
|
if (atPathCommandParts.length === 0 && embeddedContext.length === 0) {
|
|
4781
|
-
return
|
|
4955
|
+
return this.#applyVisionBridgeIfNeeded(
|
|
4956
|
+
[...parts, ...extensionParts],
|
|
4957
|
+
abortSignal
|
|
4958
|
+
);
|
|
4782
4959
|
}
|
|
4783
4960
|
const pathSpecsToRead = atPathCommandParts.map(
|
|
4784
4961
|
(part) => part.fileData.fileUri
|
|
@@ -4800,7 +4977,8 @@ ${this.pendingWorktreeNotice}
|
|
|
4800
4977
|
if (pathSpecsToRead.length > 0) {
|
|
4801
4978
|
const readResult = await readManyFiles(this.config, {
|
|
4802
4979
|
paths: pathSpecsToRead,
|
|
4803
|
-
signal: abortSignal
|
|
4980
|
+
signal: abortSignal,
|
|
4981
|
+
...preserveUnsupportedImageForBridge ? { preserveUnsupportedImageForBridge } : {}
|
|
4804
4982
|
});
|
|
4805
4983
|
const contentParts = Array.isArray(readResult.contentParts) ? readResult.contentParts : [readResult.contentParts];
|
|
4806
4984
|
processedQueryParts.push({ text: initialQueryText });
|
|
@@ -4808,6 +4986,8 @@ ${this.pendingWorktreeNotice}
|
|
|
4808
4986
|
for (const part of contentParts) {
|
|
4809
4987
|
if (typeof part === "string") {
|
|
4810
4988
|
processedQueryParts.push({ text: part });
|
|
4989
|
+
} else if (preserveUnsupportedImageForBridge && hasImageParts([part])) {
|
|
4990
|
+
processedQueryParts.push(part);
|
|
4811
4991
|
} else {
|
|
4812
4992
|
processedQueryParts.push(clampInlineMediaPart(part));
|
|
4813
4993
|
}
|
|
@@ -4824,17 +5004,73 @@ ${contextPart.text}`
|
|
|
4824
5004
|
});
|
|
4825
5005
|
}
|
|
4826
5006
|
if ("blob" in contextPart && contextPart.blob) {
|
|
5007
|
+
const inlinePart = {
|
|
5008
|
+
inlineData: {
|
|
5009
|
+
mimeType: contextPart.mimeType ?? "application/octet-stream",
|
|
5010
|
+
data: contextPart.blob
|
|
5011
|
+
}
|
|
5012
|
+
};
|
|
4827
5013
|
processedQueryParts.push(
|
|
4828
|
-
clampInlineMediaPart(
|
|
4829
|
-
inlineData: {
|
|
4830
|
-
mimeType: contextPart.mimeType ?? "application/octet-stream",
|
|
4831
|
-
data: contextPart.blob
|
|
4832
|
-
}
|
|
4833
|
-
})
|
|
5014
|
+
preserveUnsupportedImageForBridge && hasImageParts([inlinePart]) ? inlinePart : clampInlineMediaPart(inlinePart)
|
|
4834
5015
|
);
|
|
4835
5016
|
}
|
|
4836
5017
|
}
|
|
4837
|
-
return processedQueryParts;
|
|
5018
|
+
return this.#applyVisionBridgeIfNeeded(processedQueryParts, abortSignal);
|
|
5019
|
+
}
|
|
5020
|
+
async #applyVisionBridgeIfNeeded(parts, abortSignal) {
|
|
5021
|
+
if (!hasImageParts(parts) || !shouldRunVisionBridge(this.config)) {
|
|
5022
|
+
return parts;
|
|
5023
|
+
}
|
|
5024
|
+
let bridgeResult;
|
|
5025
|
+
try {
|
|
5026
|
+
debugLogger5.debug("vision bridge: gate matched, running conversion");
|
|
5027
|
+
bridgeResult = await runVisionBridge({
|
|
5028
|
+
config: this.config,
|
|
5029
|
+
parts,
|
|
5030
|
+
signal: abortSignal
|
|
5031
|
+
});
|
|
5032
|
+
} catch (error) {
|
|
5033
|
+
debugLogger5.debug(
|
|
5034
|
+
`vision bridge: failed before replacement; falling back to text-only parts error=${String(error instanceof Error ? error.message : error)}`
|
|
5035
|
+
);
|
|
5036
|
+
return splitImageParts(parts).nonImageParts;
|
|
5037
|
+
}
|
|
5038
|
+
debugLogger5.debug(
|
|
5039
|
+
`vision bridge: status=${bridgeResult.status} applied=${bridgeResult.applied} model=${bridgeResult.modelId ?? "(none)"}${bridgeResult.error ? ` error=${bridgeResult.error}` : ""}`
|
|
5040
|
+
);
|
|
5041
|
+
if (bridgeResult.status !== "skipped" || bridgeResult.egressOccurred) {
|
|
5042
|
+
try {
|
|
5043
|
+
await this.messageEmitter.emitAgentMessage(
|
|
5044
|
+
this.#formatVisionBridgeNotice(bridgeResult)
|
|
5045
|
+
);
|
|
5046
|
+
} catch (error) {
|
|
5047
|
+
debugLogger5.debug(
|
|
5048
|
+
`vision bridge: failed to emit notice; continuing with bridge result error=${String(error instanceof Error ? error.message : error)}`
|
|
5049
|
+
);
|
|
5050
|
+
}
|
|
5051
|
+
}
|
|
5052
|
+
if (abortSignal.aborted) {
|
|
5053
|
+
debugLogger5.debug("vision bridge: turn aborted after bridge returned");
|
|
5054
|
+
return splitImageParts(parts).nonImageParts;
|
|
5055
|
+
}
|
|
5056
|
+
if (bridgeResult.applied && bridgeResult.parts != null) {
|
|
5057
|
+
return normalizeParts(bridgeResult.parts);
|
|
5058
|
+
}
|
|
5059
|
+
return splitImageParts(parts).nonImageParts;
|
|
5060
|
+
}
|
|
5061
|
+
#formatVisionBridgeNotice(result) {
|
|
5062
|
+
const modelName = result.modelId ?? "vision model";
|
|
5063
|
+
const target = result.modelEndpoint ? `${modelName} (${result.modelEndpoint})` : modelName;
|
|
5064
|
+
const egressNote = result.egressOccurred ? ` Your image and prompt/context were sent to ${target}.` : "";
|
|
5065
|
+
if (result.status === "failed") {
|
|
5066
|
+
const reason = result.egressOccurred ? "the vision model request failed" : "the vision bridge could not run";
|
|
5067
|
+
return `Vision bridge (${modelName}) failed: ${reason}.${egressNote} The image was not interpreted.`;
|
|
5068
|
+
}
|
|
5069
|
+
if (result.status === "skipped") {
|
|
5070
|
+
return `Vision bridge cancelled.${egressNote}`;
|
|
5071
|
+
}
|
|
5072
|
+
const omitted = result.omittedCount > 0 ? ` (${result.omittedCount} image(s) omitted)` : "";
|
|
5073
|
+
return `Converted ${result.convertedCount} image(s)${omitted} to text via ${target}. Your image and prompt/context were sent to that model.`;
|
|
4838
5074
|
}
|
|
4839
5075
|
async #resolveExtensionMentionParts(extensionMentions, abortSignal) {
|
|
4840
5076
|
if (extensionMentions.size === 0) return [];
|
|
@@ -4998,6 +5234,7 @@ __name(runWithAcpRuntimeOutputDir, "runWithAcpRuntimeOutputDir");
|
|
|
4998
5234
|
// packages/cli/src/acp-integration/acpAgent.ts
|
|
4999
5235
|
var debugLogger6 = createDebugLogger("ACP_AGENT");
|
|
5000
5236
|
var BTW_CHILD_TIMEOUT_MS = 55e3;
|
|
5237
|
+
var WORKSPACE_MEMORY_REMEMBER_CHILD_TIMEOUT_MS = 295e3;
|
|
5001
5238
|
function collapseForkDirective(directive, maxLength) {
|
|
5002
5239
|
const oneLine = directive.replace(/\s+/g, " ").trim();
|
|
5003
5240
|
return oneLine.length > maxLength ? `${oneLine.slice(0, maxLength - 3)}\u2026` : oneLine;
|
|
@@ -6682,12 +6919,30 @@ var QwenAgent = class {
|
|
|
6682
6919
|
);
|
|
6683
6920
|
}
|
|
6684
6921
|
}
|
|
6685
|
-
async closeStoredSession(sessionId) {
|
|
6922
|
+
async closeStoredSession(sessionId, opts) {
|
|
6686
6923
|
const session = this.sessions.get(sessionId);
|
|
6687
6924
|
if (!session) {
|
|
6688
6925
|
this.mcpPool?.releaseSession(sessionId);
|
|
6689
6926
|
return;
|
|
6690
6927
|
}
|
|
6928
|
+
const requireFlush = opts?.requireFlush === true;
|
|
6929
|
+
const flushRecording = /* @__PURE__ */ __name(async () => {
|
|
6930
|
+
try {
|
|
6931
|
+
await session.getConfig().getChatRecordingService()?.flush();
|
|
6932
|
+
return void 0;
|
|
6933
|
+
} catch (err) {
|
|
6934
|
+
debugLogger6.debug(
|
|
6935
|
+
`Session ${sessionId} chat recording flush during close failed: ${err instanceof Error ? err.message : String(err)}`
|
|
6936
|
+
);
|
|
6937
|
+
return err;
|
|
6938
|
+
}
|
|
6939
|
+
}, "flushRecording");
|
|
6940
|
+
if (requireFlush) {
|
|
6941
|
+
const preCancelFlushError = await flushRecording();
|
|
6942
|
+
if (preCancelFlushError !== void 0) {
|
|
6943
|
+
throw preCancelFlushError;
|
|
6944
|
+
}
|
|
6945
|
+
}
|
|
6691
6946
|
try {
|
|
6692
6947
|
await session.cancelPendingPrompt();
|
|
6693
6948
|
} catch (err) {
|
|
@@ -6695,6 +6950,10 @@ var QwenAgent = class {
|
|
|
6695
6950
|
`Session ${sessionId} cancel during close failed: ${err instanceof Error ? err.message : String(err)}`
|
|
6696
6951
|
);
|
|
6697
6952
|
}
|
|
6953
|
+
const flushError = await flushRecording();
|
|
6954
|
+
if (flushError !== void 0 && requireFlush) {
|
|
6955
|
+
throw flushError;
|
|
6956
|
+
}
|
|
6698
6957
|
try {
|
|
6699
6958
|
await session.getConfig().getToolRegistry()?.stop();
|
|
6700
6959
|
} catch (err) {
|
|
@@ -6741,7 +7000,7 @@ var QwenAgent = class {
|
|
|
6741
7000
|
async initialize(args) {
|
|
6742
7001
|
this.clientCapabilities = args.clientCapabilities;
|
|
6743
7002
|
const authMethods = buildAuthMethods();
|
|
6744
|
-
const version = "0.19.
|
|
7003
|
+
const version = "0.19.4";
|
|
6745
7004
|
return {
|
|
6746
7005
|
protocolVersion: PROTOCOL_VERSION,
|
|
6747
7006
|
agentInfo: {
|
|
@@ -8872,6 +9131,76 @@ var QwenAgent = class {
|
|
|
8872
9131
|
return this.buildWorkspaceExtensionsStatus(
|
|
8873
9132
|
this.config
|
|
8874
9133
|
);
|
|
9134
|
+
case SERVE_CONTROL_EXT_METHODS.workspaceMemoryRememberAvailability:
|
|
9135
|
+
return {
|
|
9136
|
+
available: this.config.isManagedMemoryAvailable()
|
|
9137
|
+
};
|
|
9138
|
+
case SERVE_CONTROL_EXT_METHODS.workspaceMemoryRemember: {
|
|
9139
|
+
const content = params["content"];
|
|
9140
|
+
if (typeof content !== "string" || !content.trim()) {
|
|
9141
|
+
throw RequestError.invalidParams(
|
|
9142
|
+
void 0,
|
|
9143
|
+
"Invalid or missing content"
|
|
9144
|
+
);
|
|
9145
|
+
}
|
|
9146
|
+
if (Buffer.byteLength(content, "utf8") > MAX_REMEMBER_CONTENT_BYTES) {
|
|
9147
|
+
throw RequestError.invalidParams(
|
|
9148
|
+
void 0,
|
|
9149
|
+
"Content exceeds maximum size"
|
|
9150
|
+
);
|
|
9151
|
+
}
|
|
9152
|
+
const rawContextMode = params["contextMode"] ?? "workspace";
|
|
9153
|
+
if (rawContextMode !== "workspace" && rawContextMode !== "clean") {
|
|
9154
|
+
throw RequestError.invalidParams(void 0, "Invalid contextMode");
|
|
9155
|
+
}
|
|
9156
|
+
const contextMode = rawContextMode;
|
|
9157
|
+
if (!this.config.isManagedMemoryAvailable()) {
|
|
9158
|
+
throw new RequestError(
|
|
9159
|
+
-32009,
|
|
9160
|
+
"Managed memory is unavailable for this daemon workspace",
|
|
9161
|
+
{ errorKind: "managed_memory_unavailable" }
|
|
9162
|
+
);
|
|
9163
|
+
}
|
|
9164
|
+
const childSignal = AbortSignal.timeout(
|
|
9165
|
+
WORKSPACE_MEMORY_REMEMBER_CHILD_TIMEOUT_MS
|
|
9166
|
+
);
|
|
9167
|
+
try {
|
|
9168
|
+
const result = await runManagedRememberByAgent({
|
|
9169
|
+
config: this.config,
|
|
9170
|
+
projectRoot: this.config.getProjectRoot(),
|
|
9171
|
+
content: content.trim(),
|
|
9172
|
+
contextMode,
|
|
9173
|
+
abortSignal: childSignal
|
|
9174
|
+
});
|
|
9175
|
+
return result;
|
|
9176
|
+
} catch (err) {
|
|
9177
|
+
if (err instanceof RequestError) {
|
|
9178
|
+
throw err;
|
|
9179
|
+
}
|
|
9180
|
+
if (childSignal.aborted) {
|
|
9181
|
+
throw new RequestError(
|
|
9182
|
+
-32099,
|
|
9183
|
+
"Workspace memory remember timed out",
|
|
9184
|
+
{ errorKind: "remember_timeout" }
|
|
9185
|
+
);
|
|
9186
|
+
}
|
|
9187
|
+
const code = extractRememberErrorCode(err);
|
|
9188
|
+
if (code === "managed_memory_unavailable") {
|
|
9189
|
+
throw new RequestError(
|
|
9190
|
+
-32009,
|
|
9191
|
+
"Managed memory is unavailable for this daemon workspace",
|
|
9192
|
+
{ errorKind: "managed_memory_unavailable" }
|
|
9193
|
+
);
|
|
9194
|
+
}
|
|
9195
|
+
throw new RequestError(
|
|
9196
|
+
-32099,
|
|
9197
|
+
err instanceof Error && err.message ? err.message : "Workspace memory remember failed",
|
|
9198
|
+
{
|
|
9199
|
+
errorKind: code
|
|
9200
|
+
}
|
|
9201
|
+
);
|
|
9202
|
+
}
|
|
9203
|
+
}
|
|
8875
9204
|
case SERVE_CONTROL_EXT_METHODS.workspaceMcpRestart: {
|
|
8876
9205
|
const serverName = params["serverName"];
|
|
8877
9206
|
if (typeof serverName !== "string" || serverName.length === 0) {
|
|
@@ -9211,7 +9540,9 @@ var QwenAgent = class {
|
|
|
9211
9540
|
"Invalid or missing sessionId"
|
|
9212
9541
|
);
|
|
9213
9542
|
}
|
|
9214
|
-
await this.closeStoredSession(sessionId
|
|
9543
|
+
await this.closeStoredSession(sessionId, {
|
|
9544
|
+
requireFlush: params["requireFlush"] === true
|
|
9545
|
+
});
|
|
9215
9546
|
return { sessionId, closed: true };
|
|
9216
9547
|
}
|
|
9217
9548
|
case SERVE_CONTROL_EXT_METHODS.sessionCd: {
|
|
@@ -10589,10 +10920,6 @@ ${outputText}
|
|
|
10589
10920
|
continue;
|
|
10590
10921
|
}
|
|
10591
10922
|
}
|
|
10592
|
-
const cdpTunnelMcp = buildCdpTunnelMcpServer();
|
|
10593
|
-
if (cdpTunnelMcp && !sessionMcpServers["chrome-devtools"]) {
|
|
10594
|
-
sessionMcpServers["chrome-devtools"] = cdpTunnelMcp;
|
|
10595
|
-
}
|
|
10596
10923
|
const settings = this.settings.merged;
|
|
10597
10924
|
const argvForSession = {
|
|
10598
10925
|
...this.argv,
|
|
@@ -10846,50 +11173,9 @@ function diffSettingsKeys(oldMerged, newMerged) {
|
|
|
10846
11173
|
return changed;
|
|
10847
11174
|
}
|
|
10848
11175
|
__name(diffSettingsKeys, "diffSettingsKeys");
|
|
10849
|
-
function buildCdpTunnelMcpServer() {
|
|
10850
|
-
if (process.env["QWEN_SERVE_CDP_TUNNEL_OVER_WS"] !== "1") return void 0;
|
|
10851
|
-
if (process.env["QWEN_SERVE_CDP_TUNNEL_AUTH_REQUIRED"] === "1") {
|
|
10852
|
-
process.stderr.write(
|
|
10853
|
-
"qwen serve: browser tools (chrome-devtools-mcp) disabled \u2014 the /cdp tunnel requires bearer auth, which is not yet supported for the auto-registered browser MCP server.\n"
|
|
10854
|
-
);
|
|
10855
|
-
return void 0;
|
|
10856
|
-
}
|
|
10857
|
-
const port = Number(process.env["QWEN_SERVE_CDP_TUNNEL_PORT"]);
|
|
10858
|
-
if (!Number.isInteger(port) || port <= 0) {
|
|
10859
|
-
process.stderr.write(
|
|
10860
|
-
`qwen serve: browser tools (chrome-devtools-mcp) disabled \u2014 no valid /cdp tunnel port (QWEN_SERVE_CDP_TUNNEL_PORT=${process.env["QWEN_SERVE_CDP_TUNNEL_PORT"] ?? "<unset>"}). Start the daemon with a fixed --port (ephemeral --port 0 is not supported for the CDP tunnel).
|
|
10861
|
-
`
|
|
10862
|
-
);
|
|
10863
|
-
return void 0;
|
|
10864
|
-
}
|
|
10865
|
-
try {
|
|
10866
|
-
const requireFromHere = createRequire(import.meta.url);
|
|
10867
|
-
const pkgJsonPath = requireFromHere.resolve(
|
|
10868
|
-
"chrome-devtools-mcp/package.json"
|
|
10869
|
-
);
|
|
10870
|
-
const pkg = requireFromHere("chrome-devtools-mcp/package.json");
|
|
10871
|
-
const binRel = typeof pkg.bin === "string" ? pkg.bin : Object.values(pkg.bin ?? {})[0];
|
|
10872
|
-
if (!binRel) return void 0;
|
|
10873
|
-
const pkgDir = path3.dirname(pkgJsonPath);
|
|
10874
|
-
const binPath = path3.resolve(pkgDir, binRel);
|
|
10875
|
-
const binRelToPkg = path3.relative(pkgDir, binPath);
|
|
10876
|
-
if (binRelToPkg.startsWith("..") || path3.isAbsolute(binRelToPkg)) {
|
|
10877
|
-
return void 0;
|
|
10878
|
-
}
|
|
10879
|
-
return new MCPServerConfig(process.execPath, [
|
|
10880
|
-
binPath,
|
|
10881
|
-
"--wsEndpoint",
|
|
10882
|
-
`ws://127.0.0.1:${port}/cdp`
|
|
10883
|
-
]);
|
|
10884
|
-
} catch {
|
|
10885
|
-
return void 0;
|
|
10886
|
-
}
|
|
10887
|
-
}
|
|
10888
|
-
__name(buildCdpTunnelMcpServer, "buildCdpTunnelMcpServer");
|
|
10889
11176
|
export {
|
|
10890
11177
|
AUTH_PREFLIGHT_ENV_KEYS,
|
|
10891
11178
|
AUTH_PREFLIGHT_WAIVED_AUTH_TYPES,
|
|
10892
|
-
buildCdpTunnelMcpServer,
|
|
10893
11179
|
createWorkspaceMcpBudget,
|
|
10894
11180
|
deliverClientMcpMessage,
|
|
10895
11181
|
extractFilesFromTarGz,
|