@qwen-code/qwen-code 0.21.1 → 0.21.2-nightly.20260801.bc382c3ff
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 +9 -7
- package/bundled/qc-helper/docs/features/channels/_meta.ts +1 -0
- package/bundled/qc-helper/docs/features/channels/github.md +49 -10
- package/bundled/qc-helper/docs/features/channels/gitlab.md +177 -0
- package/bundled/qc-helper/docs/features/code-review.md +20 -0
- package/bundled/qc-helper/docs/features/commands.md +1 -0
- package/bundled/qc-helper/docs/features/hooks.md +135 -18
- package/bundled/qc-helper/docs/features/memory.md +27 -0
- package/bundled/qc-helper/docs/features/skills.md +14 -0
- package/bundled/qc-helper/docs/features/sub-agents.md +55 -8
- package/bundled/qc-helper/docs/features/tool-use-summaries.md +7 -7
- package/bundled/qc-helper/docs/qwen-serve.md +28 -6
- package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +2 -2
- package/bundled/review/SKILL.md +1 -1
- package/chunks/{MaxSizedBox-VI3ROJJA.js → MaxSizedBox-CDHTDITS.js} +45 -40
- package/chunks/{StandaloneSessionPicker-LYXKD2EV.js → StandaloneSessionPicker-L63HUAHP.js} +65 -60
- package/chunks/{acp-startup-profiler-DFVPFQ6C.js → acp-startup-profiler-3RICG2YW.js} +2 -2
- package/chunks/{acpAgent-WN5SRDQO.js → acpAgent-6WVVT2P3.js} +962 -599
- package/chunks/{agent-K6ECSM64.js → agent-KDM4CBOU.js} +40 -35
- package/chunks/agent-headless-AS7K2K57.js +79 -0
- package/chunks/{anthropicContentGenerator-V2QOGVYD.js → anthropicContentGenerator-WCBYB6JG.js} +337 -27
- package/chunks/{artifact-tool-6K6U7XYJ.js → artifact-tool-ANV4CFCR.js} +2 -2
- package/chunks/{askUserQuestion-GD2IJJ7I.js → askUserQuestion-MALEB47H.js} +2 -2
- package/chunks/{bridge-3KJEWDNE.js → bridge-JNEW6FES.js} +46 -41
- package/chunks/{build-S6DO7LMM.js → build-GDBLPA24.js} +1 -1
- package/chunks/{ca-6W3SK7OQ.js → ca-4OJN75WT.js} +46 -5
- package/chunks/{channel-management-service-XR7GZSWF.js → channel-management-service-QOO7TD3T.js} +21 -6
- package/chunks/{channel-settings-store-HW4FXXUA.js → channel-settings-store-4CSMTR4L.js} +47 -42
- package/chunks/{channel-worker-group-XDPTDWTX.js → channel-worker-group-ERSUOPIR.js} +8 -8
- package/chunks/{channel-worker-manager-YYEHVRRE.js → channel-worker-manager-X247YDQ7.js} +8 -8
- package/chunks/{channel-worker-supervisor-74HTWA2G.js → channel-worker-supervisor-ORJIEEPP.js} +4 -4
- package/chunks/{chunk-VWOOBLTY.js → chunk-25QQVOCG.js} +5 -5
- package/chunks/{chunk-CAPPWD3X.js → chunk-2A6MHYIA.js} +3 -3
- package/chunks/{chunk-2XSLTRFZ.js → chunk-2CTKGIFR.js} +2 -2
- package/chunks/{chunk-DZLYR4U3.js → chunk-2DNKEBXY.js} +1 -1
- package/chunks/{chunk-UWMLWVCA.js → chunk-2IIJTXYF.js} +26 -10
- package/chunks/{chunk-JYBU6YUE.js → chunk-2M5N3DHY.js} +1 -1
- package/chunks/{chunk-AQIDMUGU.js → chunk-2PNQQ4UR.js} +2 -2
- package/chunks/{chunk-OKF7JF3R.js → chunk-2UISUFHQ.js} +3 -3
- package/chunks/{chunk-2LQTH543.js → chunk-33FNCQSY.js} +2 -2
- package/chunks/{chunk-M7OONWYU.js → chunk-3LGZEYOF.js} +4 -2
- package/chunks/{chunk-ZURDMIDR.js → chunk-3MHPWQ2M.js} +242 -76
- package/chunks/{chunk-UHUSJ6X7.js → chunk-3RXUYQJI.js} +25 -6
- package/chunks/{chunk-E5Z2AVNV.js → chunk-3SH53ANB.js} +0 -11
- package/chunks/{chunk-BNWB5CYE.js → chunk-3WXMXT7C.js} +22 -11
- package/chunks/{chunk-A2D5BAVP.js → chunk-42IKVPST.js} +1 -1
- package/chunks/{chunk-2DN4J57Y.js → chunk-432XCUHF.js} +1 -1
- package/chunks/{chunk-EVKE2FZL.js → chunk-433VD3HX.js} +4 -4
- package/chunks/{chunk-Q43KPN7X.js → chunk-434YCHSV.js} +6 -6
- package/chunks/{chunk-5TBMQLGG.js → chunk-4LKVQFHM.js} +2 -2
- package/chunks/{chunk-YDLJGZHL.js → chunk-4NFY2S7N.js} +0 -33
- package/chunks/{chunk-6PE7N3A4.js → chunk-5UJ6A3CH.js} +145 -10
- package/chunks/{chunk-GNR2RNMP.js → chunk-5UZITEHA.js} +3 -3
- package/chunks/chunk-6FMJLI5M.js +1591 -0
- package/chunks/{chunk-RPLGZJV2.js → chunk-6O5DVH27.js} +1 -1
- package/chunks/{chunk-2RFKHEXL.js → chunk-6PLDPT2C.js} +1 -1
- package/chunks/{chunk-7AEJDLRA.js → chunk-7IYLHTTM.js} +3 -3
- package/chunks/{chunk-65PQENQP.js → chunk-7K2WTPQO.js} +5 -5
- package/chunks/{chunk-P4WOAOJW.js → chunk-7MY2AR5A.js} +72 -26
- package/chunks/{chunk-GXIJHV66.js → chunk-A2A34TSB.js} +3 -3
- package/chunks/{chunk-XWWKIXVD.js → chunk-A5YZ3FA2.js} +2 -1
- package/chunks/{chunk-64LQLPL7.js → chunk-A6SX5TAH.js} +3 -3
- package/chunks/{chunk-SZ3KHTDR.js → chunk-AKA24BGO.js} +1 -1
- package/chunks/chunk-AQ37AY7B.js +93 -0
- package/chunks/{chunk-2N7CODY5.js → chunk-AQEWCKX4.js} +2 -2
- package/chunks/{chunk-KCO4FLFJ.js → chunk-AYB4HSBI.js} +3 -3
- package/chunks/{chunk-WZRWHXFE.js → chunk-BFHXDAR7.js} +1 -1
- package/chunks/{chunk-L55JWS76.js → chunk-BGXZBI5B.js} +1 -1
- package/chunks/{chunk-5MKRTI4T.js → chunk-BKUN5QHP.js} +7 -7
- package/chunks/{chunk-Y4IHBGBP.js → chunk-BV4QX43X.js} +1 -1
- package/chunks/{chunk-PB3MBFKG.js → chunk-C4L2MEIT.js} +4 -4
- package/chunks/{chunk-TCIFAA7K.js → chunk-CHCLO3M7.js} +14 -14
- package/chunks/{chunk-CVHIL5IG.js → chunk-CWEIMFFW.js} +13 -6
- package/chunks/{chunk-2FAK6PNM.js → chunk-DUIJ2IXG.js} +5 -13
- package/chunks/{chunk-T2QMKU3R.js → chunk-DVGTU5TC.js} +19 -7
- package/chunks/{chunk-LGAOC3ZS.js → chunk-DYA25Y7U.js} +1 -1
- package/chunks/{chunk-SGFT55XI.js → chunk-E4WHKETF.js} +32 -4
- package/chunks/{chunk-WBL3FJEU.js → chunk-FC4KQFCS.js} +1 -1
- package/chunks/{chunk-MHAIJPTD.js → chunk-FJHA23GM.js} +12 -12
- package/chunks/{chunk-S7W2GKIO.js → chunk-G7XXKQYS.js} +2 -0
- package/chunks/{chunk-MR5EAQ5M.js → chunk-GALUTA2C.js} +1 -1
- package/chunks/{chunk-7I5GTCT4.js → chunk-GB3AB7TR.js} +4008 -3648
- package/chunks/{chunk-QIZKCVM3.js → chunk-GHJM2C2T.js} +6 -8
- package/chunks/chunk-GOFAQQZA.js +132 -0
- package/chunks/{chunk-BCZFQXWK.js → chunk-GTM6IHBB.js} +2 -2
- package/chunks/{chunk-5ZF5XXTS.js → chunk-GVISB2OH.js} +2 -2
- package/chunks/{chunk-FNMZK765.js → chunk-H36SETQS.js} +1 -1
- package/chunks/{chunk-UBEPNVDI.js → chunk-H4346YW5.js} +28 -16
- package/chunks/{chunk-CQL64ESB.js → chunk-H4DSRWAS.js} +24 -13
- package/chunks/{chunk-YGF33UXG.js → chunk-H6MC6VQX.js} +222 -173
- package/chunks/{chunk-GZXCZHCT.js → chunk-I3G5JWBV.js} +1 -1
- package/chunks/{chunk-Y6AXW2OG.js → chunk-I5GNT6ZS.js} +7 -1
- package/chunks/{chunk-GEBV2JGB.js → chunk-I6FAHB4N.js} +1 -1
- package/chunks/{chunk-UPUG4GXM.js → chunk-I7JDGNG6.js} +3 -3
- package/chunks/{chunk-JHNRZMHI.js → chunk-II6WPWHY.js} +9 -9
- package/chunks/{chunk-B4AJNNOL.js → chunk-J26HHFI5.js} +1 -1
- package/chunks/{chunk-S3TWXGKA.js → chunk-JE7KQ2UP.js} +4 -2
- package/chunks/{chunk-ZHBO7WVX.js → chunk-JELIWHXD.js} +1 -1
- package/chunks/{chunk-3EFXSQCM.js → chunk-JRIDA5HF.js} +7 -7
- package/chunks/{chunk-TFRMVU6R.js → chunk-K4CGQN4Q.js} +1 -1
- package/chunks/{chunk-WUZ7H6DP.js → chunk-K5Q62CGR.js} +1 -1
- package/chunks/{chunk-JCW2R7WC.js → chunk-K623ENWT.js} +3 -79
- package/chunks/{chunk-T2NCM2ET.js → chunk-K6KS3LTN.js} +2 -749
- package/chunks/{chunk-TDL6LB4K.js → chunk-KG22G46Y.js} +22 -10
- package/chunks/{chunk-GATT5TKW.js → chunk-KKN2IE7Q.js} +1 -1
- package/chunks/{chunk-JMONIXMJ.js → chunk-KVUBYJDM.js} +2 -2
- package/chunks/{chunk-TBBV36Y4.js → chunk-KXSYDCP2.js} +4 -4
- package/chunks/{chunk-EIF3FXTB.js → chunk-LAPK3GLC.js} +121 -18
- package/chunks/chunk-LBOVL47Y.js +29 -0
- package/chunks/{chunk-U3E3UQAA.js → chunk-LBWNSLJK.js} +4 -4
- package/chunks/{chunk-S4WJVPZW.js → chunk-LL4U3BSH.js} +15 -7
- package/chunks/{chunk-657BH7VM.js → chunk-LRJWFR6L.js} +4 -4
- package/chunks/{chunk-PT722TDT.js → chunk-M2F5PLOW.js} +770 -125
- package/chunks/{chunk-3L2SPEBH.js → chunk-M744OFVE.js} +1 -1
- package/chunks/{chunk-VYOXCEPJ.js → chunk-MBKPUM5Y.js} +1 -1
- package/chunks/chunk-MISUEWB4.js +8749 -0
- package/chunks/{chunk-PONHVBRT.js → chunk-MOHAWIAW.js} +2 -2
- package/chunks/{chunk-HMRM2A3U.js → chunk-MSIVKDRC.js} +4 -4
- package/chunks/{record-artifact-XAMSFSW4.js → chunk-MYT7N6QH.js} +22 -7
- package/chunks/{chunk-X5WNMMIA.js → chunk-NGWYUZZO.js} +11510 -15137
- package/chunks/{chunk-PQNHRFJC.js → chunk-NYX53SV4.js} +0 -2
- package/chunks/{chunk-6RPMI2AB.js → chunk-NZB4NDJL.js} +10 -10
- package/chunks/{chunk-BGTQCTQW.js → chunk-O2ZYHG33.js} +6 -5
- package/chunks/chunk-O6GEWCJA.js +21 -0
- package/chunks/{chunk-JX27F6QS.js → chunk-OBAIHYFT.js} +1 -1
- package/chunks/{chunk-BPZKP57P.js → chunk-OCRM53TT.js} +3 -3
- package/chunks/{chunk-V7RNNPGC.js → chunk-P5Y23G2L.js} +18 -1
- package/chunks/{chunk-FTD6DP4T.js → chunk-PDDYAXL2.js} +5 -1
- package/chunks/{chunk-JSD33JG6.js → chunk-PGEGUNH5.js} +67 -10
- package/chunks/{chunk-A4COXFB3.js → chunk-PGP7Y3RQ.js} +5 -5
- package/chunks/{chunk-T3O2B4XO.js → chunk-PHODQP2V.js} +6 -6
- package/chunks/{chunk-BMFALVGQ.js → chunk-PXA5AWHY.js} +1 -1
- package/chunks/chunk-QL4TN4HS.js +59 -0
- package/chunks/{chunk-W4MIWP6M.js → chunk-QMBEW7EW.js} +2 -2
- package/chunks/{chunk-U4VTUMMK.js → chunk-QONSRAEV.js} +1 -1
- package/chunks/{chunk-LW3RFMG7.js → chunk-QYPT3QUD.js} +3 -3
- package/chunks/{chunk-TV64SXKD.js → chunk-RGJ4JWSU.js} +131 -48
- package/chunks/{chunk-75MIQ3LV.js → chunk-RPYYTL7E.js} +61 -13
- package/chunks/{chunk-52ZSWYEG.js → chunk-SK2UKB45.js} +1 -1
- package/chunks/{chunk-PLDQBIO6.js → chunk-SWEBEXPI.js} +1 -1
- package/chunks/chunk-T3CHYWJZ.js +758 -0
- package/chunks/{chunk-VCPIZRYH.js → chunk-TFFMATHX.js} +9 -7
- package/chunks/{chunk-J7OACQDE.js → chunk-TNVKFQXQ.js} +458 -97
- package/chunks/{chunk-A3NDJ5SB.js → chunk-TYERNYH4.js} +2 -2
- package/chunks/{chunk-GKX7E4CO.js → chunk-U25CMJYY.js} +1 -1
- package/chunks/{chunk-7XATOOE7.js → chunk-UH7Z7Y45.js} +1 -1
- package/chunks/{chunk-XFZYFU3I.js → chunk-UHQ3L6GC.js} +1 -1
- package/chunks/{chunk-GZ3RCT54.js → chunk-UHTJC7O3.js} +1 -1
- package/chunks/{chunk-XZC5VLBZ.js → chunk-UKZEXS6K.js} +6 -0
- package/chunks/{chunk-LO4ROVP4.js → chunk-UOFFZNXV.js} +111 -13
- package/chunks/{chunk-5YKDXHUY.js → chunk-URN76TKR.js} +2 -2
- package/chunks/{chunk-T4TXDL7G.js → chunk-UWLG4UCE.js} +132 -35
- package/chunks/{chunk-KAMYKP7E.js → chunk-UWSXFI6E.js} +1 -1
- package/chunks/{chunk-7BAU433D.js → chunk-VS3GXRNZ.js} +1198 -240
- package/chunks/{chunk-EJGJIBRS.js → chunk-VWF42XC6.js} +3 -3
- package/chunks/{chunk-RCUQIPTN.js → chunk-W7XZ3KP5.js} +1 -1
- package/chunks/{chunk-OCESJA77.js → chunk-WISQLM4Q.js} +1197 -1154
- package/chunks/{chunk-NOKIVHOL.js → chunk-WK4TJUEA.js} +1 -1
- package/chunks/{chunk-JFMA7Y5M.js → chunk-WP4HGHFG.js} +5 -5
- package/chunks/{chunk-4G2BISNC.js → chunk-XC2VAFVZ.js} +1 -1
- package/chunks/{chunk-2LKVPASC.js → chunk-XC656O42.js} +3 -3
- package/chunks/{chunk-5KTQXHPY.js → chunk-XCLLRKY5.js} +3 -3
- package/chunks/{chunk-HV26XH34.js → chunk-XFDPIC4P.js} +3 -3
- package/chunks/{chunk-JTV5K7NH.js → chunk-XSA5EKTJ.js} +1 -1
- package/chunks/{chunk-75GFAX4R.js → chunk-YAVY33G4.js} +1 -1
- package/chunks/{chunk-WBSMNTSV.js → chunk-YXEVDA66.js} +2 -2
- package/chunks/{chunk-7DXQIJID.js → chunk-ZRFJ75D7.js} +3 -3
- package/chunks/{chunk-XBYYDKAZ.js → chunk-ZTN6OA5J.js} +8 -7
- package/chunks/{computer-use-ZTIDHMMA.js → computer-use-Z4NCIIJN.js} +40 -35
- package/chunks/{config-utils-NYSXDMEQ.js → config-utils-64LM6OEQ.js} +4 -4
- package/chunks/{contextCommand-2PIEU37Z.js → contextCommand-HVM7XFCB.js} +43 -38
- package/chunks/{core-runtime-3XEYLQFK.js → core-runtime-NL3ZBHBU.js} +40 -35
- package/chunks/{create-sub-session-SBYUMSSS.js → create-sub-session-AM32K2HD.js} +2 -2
- package/chunks/{create-sub-session-R76FVXCI.js → create-sub-session-XHSCDYFU.js} +43 -38
- package/chunks/{cron-create-2QK6TCEC.js → cron-create-HPXYE6C5.js} +4 -4
- package/chunks/{cron-delete-FDCDFYMG.js → cron-delete-FPVNTKPK.js} +4 -4
- package/chunks/{cron-list-XN3WVBTP.js → cron-list-ZEI6PAAV.js} +4 -4
- package/chunks/{daemon-Q2AB5Z23.js → daemon-PCNCI5YU.js} +72 -3
- package/chunks/daemon-status-provider-XD23SNAM.js +94 -0
- package/chunks/{daemon-trust-policy-ILUDTLHD.js → daemon-trust-policy-NOHK7IW5.js} +46 -41
- package/chunks/{daemon-trust-policy-monitor-HS3PKKRO.js → daemon-trust-policy-monitor-ZBTSR333.js} +46 -41
- package/chunks/{de-SY6O76BF.js → de-A6TI4LBB.js} +46 -5
- package/chunks/{deferred-core-runtime-X4QV662U.js → deferred-core-runtime-JJBHKM2C.js} +40 -35
- package/chunks/{dist-HVRQ2CFL.js → dist-4LAMY2SK.js} +1180 -5
- package/chunks/{dist-DOLYHMXE.js → dist-4T4NCJFL.js} +2 -2
- package/chunks/dist-7KOL6OMD.js +13467 -0
- package/chunks/{dist-SSU66DM4.js → dist-BH76AT7N.js} +1 -1
- package/chunks/{dist-BSTVRPMT.js → dist-BXA3JXVQ.js} +541 -19
- package/chunks/{dist-SV7Q3AWJ.js → dist-OEEFI6UU.js} +12 -9
- package/chunks/{dist-YGBBMK3Z.js → dist-SMLVOWKV.js} +5 -4
- package/chunks/{dist-IXQEQWRG.js → dist-V2RK6S6Q.js} +1 -1
- package/chunks/{earlyInputCapture-XKLZT7ZD.js → earlyInputCapture-KLAZDAIP.js} +41 -36
- package/chunks/{edit-HHGIOTQ2.js → edit-YQZWCISX.js} +40 -35
- package/chunks/{en-NBK3JKCE.js → en-RESOFG55.js} +46 -5
- package/chunks/{enter-worktree-ZN7PUQ46.js → enter-worktree-WLVWI3FP.js} +40 -35
- package/chunks/{enterPlanMode-EIFIDSIV.js → enterPlanMode-6RYXFQUD.js} +40 -35
- package/chunks/{environment-XXQ75D2Q.js → environment-DXJTXSVT.js} +43 -38
- package/chunks/{errors-4GMVU7CK.js → errors-XGAGG2S2.js} +43 -38
- package/chunks/{exit-worktree-GXMI4ATY.js → exit-worktree-C4276VPP.js} +40 -35
- package/chunks/{exitPlanMode-34UVY7M6.js → exitPlanMode-MM5HIRUF.js} +40 -35
- package/chunks/{fast-path-VPIVA7L6.js → fast-path-PIXYOHCH.js} +6 -2
- package/chunks/{fr-4KG5V7UT.js → fr-QF7RI5ZE.js} +46 -5
- package/chunks/{gemini-4BWIK4WD.js → gemini-43RLVUNP.js} +158 -96
- package/chunks/{geminiContentGenerator-3XVV5MSS.js → geminiContentGenerator-PNQ4TSID.js} +6 -6
- package/chunks/{glob-TZ2ABCJG.js → glob-ZMBQKAU5.js} +40 -35
- package/chunks/goal-tools-Y767F7LZ.js +335 -0
- package/chunks/{grep-BEF463NA.js → grep-HSV37W2Q.js} +40 -35
- package/chunks/handleAutoUpdate-QDHZPBAY.js +85 -0
- package/chunks/{i18n-FMM5FDXR.js → i18n-ME22A6RN.js} +42 -37
- package/chunks/{image-gen-HHVLF7HS.js → image-gen-IFC7ZWSB.js} +9 -9
- package/chunks/{initializer-625TIAIO.js → initializer-J7H2CHVB.js} +47 -42
- package/chunks/{installationInfo-6AM4I2Y3.js → installationInfo-R7FXPQN5.js} +41 -36
- package/chunks/{ja-F3GSQXMF.js → ja-URQESVGW.js} +46 -5
- package/chunks/{keychain-token-storage-72IYCAZV.js → keychain-token-storage-7BT4TQ2A.js} +2 -2
- package/chunks/{kittyProtocolDetector-MBRTDRBK.js → kittyProtocolDetector-BFLAKYXH.js} +1 -1
- package/chunks/list-OYDIBA4N.js +93 -0
- package/chunks/{list-agents-R6KDXQR3.js → list-agents-GATIBBQQ.js} +2 -2
- package/chunks/{loadedSettingsAdapter-SPUTNKAV.js → loadedSettingsAdapter-OK6GK2GE.js} +46 -41
- package/chunks/{loggingContentGenerator-LKOF7XI7.js → loggingContentGenerator-U4ZEG4GL.js} +53 -38
- package/chunks/{loop-wakeup-3IQKCYAH.js → loop-wakeup-3DZMQQQQ.js} +13 -6
- package/chunks/{ls-DKZ37A7N.js → ls-7F4GHXIH.js} +4 -4
- package/chunks/{lsp-QNWN7KN3.js → lsp-6FEHVBWI.js} +2 -2
- package/chunks/{managed-npm-update-ACQGGIN5.js → managed-npm-update-PGKAJLLO.js} +43 -38
- package/chunks/mcp-S4DXJD2G.js +87 -0
- package/chunks/{monitor-DF52UVHI.js → monitor-E5ZFMT74.js} +40 -35
- package/chunks/nonInteractiveCli-HNOHKEPE.js +149 -0
- package/chunks/{notebook-edit-FCWS4XVN.js → notebook-edit-6QDN6VZJ.js} +40 -35
- package/chunks/{openaiContentGenerator-7LDK3DCJ.js → openaiContentGenerator-3NLB2C5O.js} +19 -19
- package/chunks/{pidfile-6ERW3DF4.js → pidfile-ZMOIUGG6.js} +41 -36
- package/chunks/{processUtils-COKZAMUP.js → processUtils-E4QGQVWW.js} +2 -2
- package/chunks/{pt-EQ33KWEN.js → pt-EEEQXRUI.js} +46 -5
- package/chunks/{qwenContentGenerator-TKWUMR7N.js → qwenContentGenerator-2LFRWJTM.js} +46 -41
- package/chunks/{qwenOAuth2-7HMU47SF.js → qwenOAuth2-N32BUQDC.js} +8 -8
- package/chunks/{read-file-X6DRC574.js → read-file-GLDCWZBG.js} +11 -11
- package/chunks/{read-mcp-resource-GFTWYXMK.js → read-mcp-resource-AFS3UKZO.js} +2 -2
- package/chunks/record-artifact-ECZSCEG5.js +21 -0
- package/chunks/{resumeHistoryUtils-PFPM2GWM.js → resumeHistoryUtils-F5BE5QDW.js} +48 -43
- package/chunks/ripGrep-T23Y4AGY.js +77 -0
- package/chunks/{ru-7OZAUKGG.js → ru-WGZDYQAB.js} +46 -5
- package/chunks/{run-qwen-serve-TSTCO4XE.js → run-qwen-serve-TI2HGLLU.js} +290 -75
- package/chunks/{runtime-DAUPSUKI.js → runtime-WCWM3DO7.js} +53 -46
- package/chunks/{scheduler-KMADMT26.js → scheduler-2QZO5AV5.js} +40 -35
- package/chunks/{sdk-exporters-http-WO556XNU.js → sdk-exporters-http-IKNWQJNV.js} +3 -3
- package/chunks/{sdk-impl-LPAVACSF.js → sdk-impl-7CUUMQDB.js} +3 -3
- package/chunks/{send-message-SAWK4DZX.js → send-message-X7G2JSII.js} +6 -11
- package/chunks/{serve-NNRWS6F4.js → serve-DZOMYUFU.js} +46 -41
- package/chunks/{server-WEH7DVCH.js → server-N4AJRKIQ.js} +2269 -1016
- package/chunks/{session-WXC56V2I.js → session-GS6AKMN7.js} +151 -86
- package/chunks/{settings-DJDXFDZ3.js → settings-CUN3SELH.js} +50 -45
- package/chunks/{shell-JN5VRQXD.js → shell-NGBFVXC5.js} +40 -35
- package/chunks/{skill-SGXPKJCS.js → skill-SC2BSO75.js} +30 -16
- package/chunks/{skill-settings-VJ5PDMZI.js → skill-settings-XVPCPW5K.js} +45 -40
- package/chunks/{spawnChannel-ETMJW7YX.js → spawnChannel-RILO4YY3.js} +42 -37
- package/chunks/{standalone-update-MK3Z7KBI.js → standalone-update-TMLT6LVJ.js} +43 -38
- package/chunks/{startInteractiveUI-ZCGIXPGT.js → startInteractiveUI-J45WOEOU.js} +883 -1112
- package/chunks/{syntheticOutput-355CB6CJ.js → syntheticOutput-FHRY3BPQ.js} +3 -3
- package/chunks/{task-create-INGWNUG4.js → task-create-LAQXBIHC.js} +11 -10
- package/chunks/{task-list-5XNNGTF4.js → task-list-V6K5DRDH.js} +6 -6
- package/chunks/{task-stop-4ROAOBXH.js → task-stop-LQXE52L6.js} +2 -2
- package/chunks/{task-update-CRK5VWWZ.js → task-update-NXRCXSPB.js} +11 -10
- package/chunks/{team-create-QQGAJG7P.js → team-create-W3EVWCTA.js} +40 -35
- package/chunks/{team-delete-S2RCXA4P.js → team-delete-Z4KGO7RC.js} +6 -6
- package/chunks/{team-plan-approval-RT7Q5R6O.js → team-plan-approval-URYVKJF4.js} +40 -35
- package/chunks/theme-manager-CUAMS2NI.js +81 -0
- package/chunks/{todoWrite-7WM3VDMY.js → todoWrite-OFIZDI7P.js} +32 -4
- package/chunks/{tool-search-Z3Z4AYKP.js → tool-search-DCICFL32.js} +15 -14
- package/chunks/total-session-admission-3ZTAXVUK.js +89 -0
- package/chunks/{trustedFolders-X2JEIO57.js → trustedFolders-EVCN36O5.js} +42 -37
- package/chunks/{update-relaunch-VWNPYDIP.js → update-relaunch-XLW46RHQ.js} +5 -5
- package/chunks/{updateCheck-KAQH67DV.js → updateCheck-ZHVXDAIH.js} +44 -39
- package/chunks/{useAutoAcceptIndicator-JH6BCF7S.js → useAutoAcceptIndicator-ZGD6BJSP.js} +50 -45
- package/chunks/{validateNonInterActiveAuth-GIUJ2UFS.js → validateNonInterActiveAuth-R3BAQFDY.js} +88 -83
- package/chunks/{version-BGLYIJUY.js → version-PMWREGCG.js} +1 -1
- package/chunks/{web-fetch-OTDU4VQF.js → web-fetch-PGN27SGF.js} +14 -14
- package/chunks/{web-search-FP6SIHPR.js → web-search-KW4UNMRE.js} +8 -8
- package/chunks/{workflow-YCIVBYSB.js → workflow-SN3TJBTJ.js} +363 -310
- package/chunks/workspace-providers-status-O3HUZGGR.js +90 -0
- package/chunks/{workspace-registration-store-OTMS3H4C.js → workspace-registration-store-M3FJ74RS.js} +2 -2
- package/chunks/{workspace-registry-O63R6IZ4.js → workspace-registry-U7ISW23N.js} +47 -42
- package/chunks/{workspace-service-M6LLHKJ5.js → workspace-service-VH6IWADT.js} +53 -48
- package/chunks/{workspace-skills-status-C2V7BAIS.js → workspace-skills-status-XANARSZS.js} +48 -43
- package/chunks/{workspace-trust-reconciler-IBUPOUJN.js → workspace-trust-reconciler-35EFR4GC.js} +53 -48
- package/chunks/write-file-NCRSGUDT.js +79 -0
- package/chunks/{zh-H3YDK5QW.js → zh-OHX23Q44.js} +43 -5
- package/chunks/{zh-TW-JYCP7XUA.js → zh-TW-4G7YKDAQ.js} +43 -5
- package/chunks/zoom-image-X7CIADYC.js +224 -0
- package/cli.js +55 -48
- package/locales/ca.js +60 -4
- package/locales/de.js +62 -4
- package/locales/en.js +59 -4
- 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 +52 -4
- package/locales/zh.js +52 -4
- package/package.json +3 -3
- package/web-shell/assets/{arc-75-Wdeo3.js → arc-CaMTqKio.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-FKeXQbyP.js → architectureDiagram-3BPJPVTR-Bjxztij2.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-CY0vc-A3.js → blockDiagram-GPEHLZMM-BYJzeHi9.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-CNP-A-8u.js → c4Diagram-AAUBKEIU-fYAa-Eil.js} +1 -1
- package/web-shell/assets/channel-LEZei0-5.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-GybS4Gii.js → chunk-2J33WTMH-B1OTlTml.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-02H91V8v.js → chunk-4BX2VUAB-DNj4uy6k.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-D3M-2VT6.js → chunk-55IACEB6-DAqNmg3c.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-CCu29u4H.js → chunk-727SXJPM-BwB4ddxE.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-CaFKWgrn.js → chunk-AQP2D5EJ-DmHR_UZs.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-ZZpPqIwQ.js → chunk-FMBD7UC4-BlfOXumo.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-D22DqGs8.js → chunk-ND2GUHAM-BKogiSy7.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-Bu85S0fw.js → chunk-QZHKN3VN-DEclVrOF.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-BiaRhfvf.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-BiaRhfvf.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-f1CK1Gwe.js → cose-bilkent-S5V4N54A-CwtS21WT.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-D0Ow8F_n.js → dagre-BM42HDAG-BAAIlB4p.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-BPrmTWp8.js → diagram-2AECGRRQ-ChljtF_V.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-HccuFAzy.js → diagram-5GNKFQAL-BIXVd31-.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-BrS76mbA.js → diagram-KO2AKTUF-BEiBaS15.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-V7T9lU-5.js → diagram-LMA3HP47-C-g4tWKM.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-DKidyJMR.js → diagram-OG6HWLK6-CNCCbNQG.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-DBadZIkp.js → erDiagram-TEJ5UH35-v8ysnsdI.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-BymfqdNJ.js → flowDiagram-I6XJVG4X-LKVlLjwA.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-DOw340jf.js → ganttDiagram-6RSMTGT7-DA5MrKYG.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-_8EiD8sl.js → gitGraphDiagram-PVQCEYII-Cyg5fe6d.js} +1 -1
- package/web-shell/assets/index-BgOcEaVt.js +1756 -0
- package/web-shell/assets/index-C2GE3DAF.js +74 -0
- package/web-shell/assets/{index-CKIadvET.js → index-CKdUkVVS.js} +1 -1
- package/web-shell/assets/index-DA5Lvscv.css +5 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-D61KYQBu.js → infoDiagram-5YYISTIA-SLsfu3Qd.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-CsiXSpNx.js → ishikawaDiagram-YF4QCWOH-CmHOmTNx.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-Sdfionyh.js → journeyDiagram-JHISSGLW-C3gM_HFQ.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-C3WI3Cnl.js → kanban-definition-UN3LZRKU-BbHD7duM.js} +1 -1
- package/web-shell/assets/{linear-Dpigcc62.js → linear-CSBvm435.js} +1 -1
- package/web-shell/assets/{mermaid.core-Ct97pqgW.js → mermaid.core-CPMw15lU.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-BzeaN0rB.js → mindmap-definition-RKZ34NQL-C_tNqXQW.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-CvjgcbVD.js → pieDiagram-4H26LBE5-DH_N-8yY.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-BUzgTNdH.js → quadrantDiagram-W4KKPZXB-CRbS8UkN.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-B7zKlgUQ.js → requirementDiagram-4Y6WPE33-DJgdZPZn.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-Bb9CQgrT.js → sankeyDiagram-5OEKKPKP-vhL1y5zx.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-DJ6V7itG.js → sequenceDiagram-3UESZ5HK-UQthhFwd.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-IImflERY.js → stateDiagram-AJRCARHV-CAywEm20.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-lfJQHw-7.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-6Q_uWHKh.js → timeline-definition-PNZ67QCA-CLO8b3FD.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-TmyKyjwv.js → vennDiagram-CIIHVFJN-BNAAh0Mu.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-CRh9uiPv.js → wardley-L42UT6IY-CUY7bLpN.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-59TKAW8w.js → wardleyDiagram-YWT4CUSO-CSg_ORdW.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-GCSUIK2L.js → xychartDiagram-2RQKCTM6-BjffV208.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/agent-headless-NO4Y2HOE.js +0 -74
- package/chunks/chunk-6QIGFD5W.js +0 -82
- package/chunks/chunk-HGT6JR3U.js +0 -177
- package/chunks/daemon-status-provider-3XJI6CAL.js +0 -89
- package/chunks/handleAutoUpdate-L6ERF36Y.js +0 -80
- package/chunks/list-L2GA674Y.js +0 -88
- package/chunks/mcp-SZLHKFJW.js +0 -82
- package/chunks/nonInteractiveCli-5T7KYKLK.js +0 -144
- package/chunks/ripGrep-OWV2IVJC.js +0 -72
- package/chunks/theme-manager-EEWIQJ7J.js +0 -76
- package/chunks/total-session-admission-44JKRWQD.js +0 -84
- package/chunks/workspace-providers-status-S35YAIUS.js +0 -85
- package/chunks/write-file-3BZC3EAE.js +0 -72
- package/chunks/zoom-image-TZ6S2O57.js +0 -351
- package/web-shell/assets/channel-DPYMT76A.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK--JstsIgL.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2--JstsIgL.js +0 -1
- package/web-shell/assets/index-D1eXNRHe.js +0 -1389
- package/web-shell/assets/index-DVLD4CQq.css +0 -5
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-CYI_YoNR.js +0 -1
|
@@ -11,84 +11,89 @@ import {
|
|
|
11
11
|
toModelVisibleSubagentResult,
|
|
12
12
|
writeWorkflowSnapshot,
|
|
13
13
|
writeWorktreeSessionMarker
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-NGWYUZZO.js";
|
|
15
|
+
import "./chunk-GOFAQQZA.js";
|
|
16
|
+
import "./chunk-5M6IDOMF.js";
|
|
15
17
|
import "./chunk-TWPJO254.js";
|
|
16
18
|
import "./chunk-H6XPXXMH.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-KRXPRVGL.js";
|
|
22
|
-
import "./chunk-BMFALVGQ.js";
|
|
23
|
-
import "./chunk-CVHIL5IG.js";
|
|
24
|
-
import "./chunk-IRH27ZC2.js";
|
|
25
|
-
import "./chunk-QHWCP53L.js";
|
|
26
|
-
import "./chunk-PONHVBRT.js";
|
|
27
|
-
import "./chunk-T26EAKDL.js";
|
|
19
|
+
import "./chunk-CWEIMFFW.js";
|
|
20
|
+
import "./chunk-I7JDGNG6.js";
|
|
21
|
+
import "./chunk-A6SX5TAH.js";
|
|
22
|
+
import "./chunk-33FNCQSY.js";
|
|
28
23
|
import {
|
|
29
24
|
parsePositiveIntegerEnv
|
|
30
25
|
} from "./chunk-6PVPNMXU.js";
|
|
26
|
+
import "./chunk-PXA5AWHY.js";
|
|
27
|
+
import "./chunk-IRH27ZC2.js";
|
|
28
|
+
import "./chunk-QHWCP53L.js";
|
|
29
|
+
import "./chunk-MOHAWIAW.js";
|
|
30
|
+
import "./chunk-MYT7N6QH.js";
|
|
31
|
+
import "./chunk-O6GEWCJA.js";
|
|
32
|
+
import "./chunk-T26EAKDL.js";
|
|
31
33
|
import "./chunk-CPBF7KYF.js";
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-MISUEWB4.js";
|
|
35
|
+
import "./chunk-KRXPRVGL.js";
|
|
36
|
+
import "./chunk-A5YZ3FA2.js";
|
|
37
|
+
import "./chunk-YAVY33G4.js";
|
|
38
|
+
import "./chunk-2UISUFHQ.js";
|
|
39
|
+
import "./chunk-6FMJLI5M.js";
|
|
36
40
|
import {
|
|
37
41
|
SUBAGENT_PLAN_LIFECYCLE_TOOLS,
|
|
38
42
|
runWithAgentContext
|
|
39
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-PGEGUNH5.js";
|
|
40
44
|
import "./chunk-S6LOFUVP.js";
|
|
41
|
-
import "./chunk-
|
|
45
|
+
import "./chunk-K623ENWT.js";
|
|
46
|
+
import "./chunk-AQ37AY7B.js";
|
|
42
47
|
import {
|
|
43
48
|
WorkspaceContext
|
|
44
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-432XCUHF.js";
|
|
45
50
|
import "./chunk-ZPJWUGCS.js";
|
|
46
|
-
import "./chunk-
|
|
51
|
+
import "./chunk-XC656O42.js";
|
|
47
52
|
import "./chunk-NAVJD2PQ.js";
|
|
48
|
-
import "./chunk-
|
|
49
|
-
import "./chunk-
|
|
53
|
+
import "./chunk-QYPT3QUD.js";
|
|
54
|
+
import "./chunk-QMBEW7EW.js";
|
|
50
55
|
import "./chunk-DGEIYUC3.js";
|
|
51
56
|
import "./chunk-MPHPFVKK.js";
|
|
52
57
|
import "./chunk-GLNBDYUX.js";
|
|
53
58
|
import {
|
|
54
59
|
createChildAbortController
|
|
55
60
|
} from "./chunk-DJ2GSRLV.js";
|
|
56
|
-
import "./chunk-
|
|
57
|
-
import "./chunk-
|
|
61
|
+
import "./chunk-XCLLRKY5.js";
|
|
62
|
+
import "./chunk-RPYYTL7E.js";
|
|
58
63
|
import "./chunk-2J3OJGTL.js";
|
|
59
64
|
import "./chunk-P3QQPMQA.js";
|
|
60
|
-
import "./chunk-
|
|
65
|
+
import "./chunk-6O5DVH27.js";
|
|
61
66
|
import "./chunk-GLCZKT5V.js";
|
|
62
|
-
import "./chunk-
|
|
67
|
+
import "./chunk-2DNKEBXY.js";
|
|
63
68
|
import {
|
|
64
69
|
WorkflowRunEvent,
|
|
65
70
|
logWorkflowRun,
|
|
66
71
|
read,
|
|
67
72
|
writeLine
|
|
68
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-M2F5PLOW.js";
|
|
69
74
|
import "./chunk-VGC4I5JJ.js";
|
|
70
|
-
import "./chunk-
|
|
75
|
+
import "./chunk-E4WHKETF.js";
|
|
71
76
|
import {
|
|
72
77
|
SyntheticOutputTool
|
|
73
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-BV4QX43X.js";
|
|
74
79
|
import {
|
|
75
80
|
BaseDeclarativeTool,
|
|
76
81
|
BaseToolInvocation,
|
|
77
82
|
ToolDisplayNames,
|
|
78
83
|
ToolNames
|
|
79
|
-
} from "./chunk-
|
|
80
|
-
import "./chunk-
|
|
84
|
+
} from "./chunk-I5GNT6ZS.js";
|
|
85
|
+
import "./chunk-TFFMATHX.js";
|
|
81
86
|
import "./chunk-46UV252V.js";
|
|
82
87
|
import "./chunk-ZBVS26BY.js";
|
|
83
|
-
import "./chunk-
|
|
84
|
-
import "./chunk-
|
|
85
|
-
import "./chunk-
|
|
86
|
-
import "./chunk-
|
|
88
|
+
import "./chunk-BFHXDAR7.js";
|
|
89
|
+
import "./chunk-TYERNYH4.js";
|
|
90
|
+
import "./chunk-UH7Z7Y45.js";
|
|
91
|
+
import "./chunk-O2ZYHG33.js";
|
|
87
92
|
import "./chunk-W4RQUHY3.js";
|
|
88
|
-
import "./chunk-
|
|
93
|
+
import "./chunk-G7XXKQYS.js";
|
|
89
94
|
import {
|
|
90
95
|
createDebugLogger
|
|
91
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-3RXUYQJI.js";
|
|
92
97
|
import "./chunk-VOQXFAY5.js";
|
|
93
98
|
import "./chunk-75DOP5OR.js";
|
|
94
99
|
import "./chunk-DMTGGOSA.js";
|
|
@@ -105,6 +110,95 @@ import {
|
|
|
105
110
|
// packages/core/src/tools/workflow/workflow.ts
|
|
106
111
|
init_esbuild_shims();
|
|
107
112
|
|
|
113
|
+
// packages/core/src/agents/runtime/workflow-budget.ts
|
|
114
|
+
init_esbuild_shims();
|
|
115
|
+
var debugLogger = createDebugLogger("WORKFLOW_BUDGET");
|
|
116
|
+
var MAX_TOKENS_PER_WORKFLOW_ENV = "QWEN_CODE_MAX_TOKENS_PER_WORKFLOW";
|
|
117
|
+
var HARD_MAX_TOKENS_CEILING = 1e8;
|
|
118
|
+
function resolveMaxTokensPerWorkflow(env = process.env) {
|
|
119
|
+
const raw = env[MAX_TOKENS_PER_WORKFLOW_ENV];
|
|
120
|
+
if (raw === void 0 || raw.trim() === "") {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
const parsed = parsePositiveIntegerEnv(raw, 0);
|
|
124
|
+
if (parsed < 1) {
|
|
125
|
+
debugLogger.warn(
|
|
126
|
+
`Invalid ${MAX_TOKENS_PER_WORKFLOW_ENV}=${JSON.stringify(raw)}, treating as unset (no cap)`
|
|
127
|
+
);
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
if (parsed > HARD_MAX_TOKENS_CEILING) {
|
|
131
|
+
debugLogger.warn(
|
|
132
|
+
`${MAX_TOKENS_PER_WORKFLOW_ENV}=${parsed} exceeds hard ceiling (${HARD_MAX_TOKENS_CEILING}); clamping.`
|
|
133
|
+
);
|
|
134
|
+
return HARD_MAX_TOKENS_CEILING;
|
|
135
|
+
}
|
|
136
|
+
return parsed;
|
|
137
|
+
}
|
|
138
|
+
__name(resolveMaxTokensPerWorkflow, "resolveMaxTokensPerWorkflow");
|
|
139
|
+
var WorkflowBudgetImpl = class _WorkflowBudgetImpl {
|
|
140
|
+
static {
|
|
141
|
+
__name(this, "WorkflowBudgetImpl");
|
|
142
|
+
}
|
|
143
|
+
total;
|
|
144
|
+
_spent;
|
|
145
|
+
constructor(total) {
|
|
146
|
+
this.total = total;
|
|
147
|
+
this._spent = 0;
|
|
148
|
+
}
|
|
149
|
+
spent() {
|
|
150
|
+
return this._spent;
|
|
151
|
+
}
|
|
152
|
+
remaining() {
|
|
153
|
+
if (this.total === null) return Infinity;
|
|
154
|
+
return Math.max(0, this.total - this._spent);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Host-side increment. NOT exposed to the script — the
|
|
158
|
+
* `WorkflowBudget` interface deliberately omits any setter so a
|
|
159
|
+
* malicious workflow cannot inflate / deflate the budget. Only the
|
|
160
|
+
* orchestrator (in `countedDispatch`) calls this after a dispatch
|
|
161
|
+
* resolves with the agent's output token count.
|
|
162
|
+
*
|
|
163
|
+
* Non-positive deltas are silently dropped (some dispatches return
|
|
164
|
+
* `output_tokens: 0` on early failures); negative deltas would be a
|
|
165
|
+
* caller bug and are also dropped rather than silently rewinding
|
|
166
|
+
* the counter.
|
|
167
|
+
*/
|
|
168
|
+
recordSpent(deltaTokens) {
|
|
169
|
+
if (!Number.isFinite(deltaTokens) || deltaTokens <= 0) return;
|
|
170
|
+
this._spent += deltaTokens;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Factory: build a budget from the current environment. Convenience
|
|
174
|
+
* over `new WorkflowBudgetImpl(resolveMaxTokensPerWorkflow(env))`.
|
|
175
|
+
*/
|
|
176
|
+
static fromEnv(env = process.env) {
|
|
177
|
+
return new _WorkflowBudgetImpl(resolveMaxTokensPerWorkflow(env));
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
var WorkflowBudgetExceededError = class extends Error {
|
|
181
|
+
static {
|
|
182
|
+
__name(this, "WorkflowBudgetExceededError");
|
|
183
|
+
}
|
|
184
|
+
name = "WorkflowBudgetExceededError";
|
|
185
|
+
runId;
|
|
186
|
+
budgetTotal;
|
|
187
|
+
spent;
|
|
188
|
+
constructor(runId, budgetTotal, spent) {
|
|
189
|
+
super(
|
|
190
|
+
`Workflow ${runId} exceeded the token budget (${spent} / ${budgetTotal} output tokens spent).`
|
|
191
|
+
);
|
|
192
|
+
this.runId = runId;
|
|
193
|
+
this.budgetTotal = budgetTotal;
|
|
194
|
+
this.spent = spent;
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
// packages/core/src/agents/runtime/workflow-runner.ts
|
|
199
|
+
init_esbuild_shims();
|
|
200
|
+
import { randomBytes as randomBytes2 } from "node:crypto";
|
|
201
|
+
|
|
108
202
|
// packages/core/src/agents/runtime/workflow-orchestrator.ts
|
|
109
203
|
init_esbuild_shims();
|
|
110
204
|
import { randomBytes } from "node:crypto";
|
|
@@ -290,7 +384,7 @@ function isRegexContext(source, i) {
|
|
|
290
384
|
return /[{[(,;:=!&|?+\-*/%^~<>]/.test(prev);
|
|
291
385
|
}
|
|
292
386
|
__name(isRegexContext, "isRegexContext");
|
|
293
|
-
var
|
|
387
|
+
var debugLogger2 = createDebugLogger("WORKFLOW");
|
|
294
388
|
var MAX_LOG_LINES = 1e4;
|
|
295
389
|
var MAX_PHASE_ENTRIES = 1e4;
|
|
296
390
|
var ARGS_MAX_DEPTH = 64;
|
|
@@ -349,7 +443,7 @@ function createWorkflowSandbox(opts) {
|
|
|
349
443
|
try {
|
|
350
444
|
opts.emitter?.logAppended?.(line);
|
|
351
445
|
} catch (e) {
|
|
352
|
-
|
|
446
|
+
debugLogger2.warn("emitter.logAppended threw:", e);
|
|
353
447
|
}
|
|
354
448
|
} else if (logs.length === MAX_LOG_LINES) {
|
|
355
449
|
logs.push(`[workflow log truncated at ${MAX_LOG_LINES} lines]`);
|
|
@@ -363,7 +457,7 @@ function createWorkflowSandbox(opts) {
|
|
|
363
457
|
try {
|
|
364
458
|
opts.emitter?.phaseStarted?.(t);
|
|
365
459
|
} catch (e) {
|
|
366
|
-
|
|
460
|
+
debugLogger2.warn("emitter.phaseStarted threw:", e);
|
|
367
461
|
}
|
|
368
462
|
} else if (phases.length === MAX_PHASE_ENTRIES) {
|
|
369
463
|
phases.push(
|
|
@@ -386,7 +480,7 @@ function createWorkflowSandbox(opts) {
|
|
|
386
480
|
// value" (this warn). Receives only primitive strings/numbers — the bridge
|
|
387
481
|
// contract forbids host objects crossing back to the script.
|
|
388
482
|
logRevivalFailure: /* @__PURE__ */ __name((idx, reason) => {
|
|
389
|
-
|
|
483
|
+
debugLogger2.warn(
|
|
390
484
|
`Workflow result revival failed at index ${idx}: ${reason}; slot set to null (non-JSON-serializable thunk return).`
|
|
391
485
|
);
|
|
392
486
|
}, "logRevivalFailure"),
|
|
@@ -815,91 +909,6 @@ ${stripped}
|
|
|
815
909
|
}
|
|
816
910
|
__name(createWorkflowSandbox, "createWorkflowSandbox");
|
|
817
911
|
|
|
818
|
-
// packages/core/src/agents/runtime/workflow-budget.ts
|
|
819
|
-
init_esbuild_shims();
|
|
820
|
-
var debugLogger2 = createDebugLogger("WORKFLOW_BUDGET");
|
|
821
|
-
var MAX_TOKENS_PER_WORKFLOW_ENV = "QWEN_CODE_MAX_TOKENS_PER_WORKFLOW";
|
|
822
|
-
var HARD_MAX_TOKENS_CEILING = 1e8;
|
|
823
|
-
function resolveMaxTokensPerWorkflow(env = process.env) {
|
|
824
|
-
const raw = env[MAX_TOKENS_PER_WORKFLOW_ENV];
|
|
825
|
-
if (raw === void 0 || raw.trim() === "") {
|
|
826
|
-
return null;
|
|
827
|
-
}
|
|
828
|
-
const parsed = parsePositiveIntegerEnv(raw, 0);
|
|
829
|
-
if (parsed < 1) {
|
|
830
|
-
debugLogger2.warn(
|
|
831
|
-
`Invalid ${MAX_TOKENS_PER_WORKFLOW_ENV}=${JSON.stringify(raw)}, treating as unset (no cap)`
|
|
832
|
-
);
|
|
833
|
-
return null;
|
|
834
|
-
}
|
|
835
|
-
if (parsed > HARD_MAX_TOKENS_CEILING) {
|
|
836
|
-
debugLogger2.warn(
|
|
837
|
-
`${MAX_TOKENS_PER_WORKFLOW_ENV}=${parsed} exceeds hard ceiling (${HARD_MAX_TOKENS_CEILING}); clamping.`
|
|
838
|
-
);
|
|
839
|
-
return HARD_MAX_TOKENS_CEILING;
|
|
840
|
-
}
|
|
841
|
-
return parsed;
|
|
842
|
-
}
|
|
843
|
-
__name(resolveMaxTokensPerWorkflow, "resolveMaxTokensPerWorkflow");
|
|
844
|
-
var WorkflowBudgetImpl = class _WorkflowBudgetImpl {
|
|
845
|
-
static {
|
|
846
|
-
__name(this, "WorkflowBudgetImpl");
|
|
847
|
-
}
|
|
848
|
-
total;
|
|
849
|
-
_spent;
|
|
850
|
-
constructor(total) {
|
|
851
|
-
this.total = total;
|
|
852
|
-
this._spent = 0;
|
|
853
|
-
}
|
|
854
|
-
spent() {
|
|
855
|
-
return this._spent;
|
|
856
|
-
}
|
|
857
|
-
remaining() {
|
|
858
|
-
if (this.total === null) return Infinity;
|
|
859
|
-
return Math.max(0, this.total - this._spent);
|
|
860
|
-
}
|
|
861
|
-
/**
|
|
862
|
-
* Host-side increment. NOT exposed to the script — the
|
|
863
|
-
* `WorkflowBudget` interface deliberately omits any setter so a
|
|
864
|
-
* malicious workflow cannot inflate / deflate the budget. Only the
|
|
865
|
-
* orchestrator (in `countedDispatch`) calls this after a dispatch
|
|
866
|
-
* resolves with the agent's output token count.
|
|
867
|
-
*
|
|
868
|
-
* Non-positive deltas are silently dropped (some dispatches return
|
|
869
|
-
* `output_tokens: 0` on early failures); negative deltas would be a
|
|
870
|
-
* caller bug and are also dropped rather than silently rewinding
|
|
871
|
-
* the counter.
|
|
872
|
-
*/
|
|
873
|
-
recordSpent(deltaTokens) {
|
|
874
|
-
if (!Number.isFinite(deltaTokens) || deltaTokens <= 0) return;
|
|
875
|
-
this._spent += deltaTokens;
|
|
876
|
-
}
|
|
877
|
-
/**
|
|
878
|
-
* Factory: build a budget from the current environment. Convenience
|
|
879
|
-
* over `new WorkflowBudgetImpl(resolveMaxTokensPerWorkflow(env))`.
|
|
880
|
-
*/
|
|
881
|
-
static fromEnv(env = process.env) {
|
|
882
|
-
return new _WorkflowBudgetImpl(resolveMaxTokensPerWorkflow(env));
|
|
883
|
-
}
|
|
884
|
-
};
|
|
885
|
-
var WorkflowBudgetExceededError = class extends Error {
|
|
886
|
-
static {
|
|
887
|
-
__name(this, "WorkflowBudgetExceededError");
|
|
888
|
-
}
|
|
889
|
-
name = "WorkflowBudgetExceededError";
|
|
890
|
-
runId;
|
|
891
|
-
budgetTotal;
|
|
892
|
-
spent;
|
|
893
|
-
constructor(runId, budgetTotal, spent) {
|
|
894
|
-
super(
|
|
895
|
-
`Workflow ${runId} exceeded the token budget (${spent} / ${budgetTotal} output tokens spent).`
|
|
896
|
-
);
|
|
897
|
-
this.runId = runId;
|
|
898
|
-
this.budgetTotal = budgetTotal;
|
|
899
|
-
this.spent = spent;
|
|
900
|
-
}
|
|
901
|
-
};
|
|
902
|
-
|
|
903
912
|
// packages/core/src/agents/runtime/workflow-stall.ts
|
|
904
913
|
init_esbuild_shims();
|
|
905
914
|
var DEFAULT_STALL_MS = 6e4;
|
|
@@ -1195,13 +1204,13 @@ function resolveMaxAgentsPerRun(env = process.env) {
|
|
|
1195
1204
|
}
|
|
1196
1205
|
const parsed = parsePositiveIntegerEnv(raw, 0);
|
|
1197
1206
|
if (parsed < 1) {
|
|
1198
|
-
|
|
1207
|
+
debugLogger2.warn(
|
|
1199
1208
|
`Invalid ${MAX_WORKFLOW_AGENTS_ENV}=${JSON.stringify(raw)}, using default (${DEFAULT_MAX_AGENTS_PER_RUN})`
|
|
1200
1209
|
);
|
|
1201
1210
|
return DEFAULT_MAX_AGENTS_PER_RUN;
|
|
1202
1211
|
}
|
|
1203
1212
|
if (parsed > HARD_MAX_AGENTS_PER_RUN_CEILING) {
|
|
1204
|
-
|
|
1213
|
+
debugLogger2.warn(
|
|
1205
1214
|
`${MAX_WORKFLOW_AGENTS_ENV}=${parsed} exceeds hard ceiling (${HARD_MAX_AGENTS_PER_RUN_CEILING}); clamping.`
|
|
1206
1215
|
);
|
|
1207
1216
|
return HARD_MAX_AGENTS_PER_RUN_CEILING;
|
|
@@ -1217,14 +1226,14 @@ function resolveConcurrencyLimit(env = process.env) {
|
|
|
1217
1226
|
const parsed = parsePositiveIntegerEnv(raw, 0);
|
|
1218
1227
|
if (parsed >= 1) {
|
|
1219
1228
|
if (parsed > HARD_MAX_CONCURRENCY_CEILING) {
|
|
1220
|
-
|
|
1229
|
+
debugLogger2.warn(
|
|
1221
1230
|
`${MAX_WORKFLOW_CONCURRENCY_ENV}=${parsed} exceeds hard ceiling (${HARD_MAX_CONCURRENCY_CEILING}); clamping.`
|
|
1222
1231
|
);
|
|
1223
1232
|
return HARD_MAX_CONCURRENCY_CEILING;
|
|
1224
1233
|
}
|
|
1225
1234
|
return parsed;
|
|
1226
1235
|
}
|
|
1227
|
-
|
|
1236
|
+
debugLogger2.warn(
|
|
1228
1237
|
`Invalid ${MAX_WORKFLOW_CONCURRENCY_ENV}=${JSON.stringify(raw)}, using cpu-derived default`
|
|
1229
1238
|
);
|
|
1230
1239
|
}
|
|
@@ -1234,6 +1243,7 @@ __name(resolveConcurrencyLimit, "resolveConcurrencyLimit");
|
|
|
1234
1243
|
var WORKFLOW_SUBAGENT_MAX_TURNS = 50;
|
|
1235
1244
|
var WORKFLOW_SUBAGENT_MAX_TIME_MINUTES = 10;
|
|
1236
1245
|
var WORKFLOW_SUBAGENT_DISALLOWED_TOOLS = [
|
|
1246
|
+
ToolNames.ASK_USER_QUESTION,
|
|
1237
1247
|
ToolNames.SEND_MESSAGE,
|
|
1238
1248
|
ToolNames.MONITOR,
|
|
1239
1249
|
...SUBAGENT_PLAN_LIFECYCLE_TOOLS,
|
|
@@ -1265,20 +1275,27 @@ function sanitizeForErrorMessage(value) {
|
|
|
1265
1275
|
return stripAnsiAndControl(value);
|
|
1266
1276
|
}
|
|
1267
1277
|
__name(sanitizeForErrorMessage, "sanitizeForErrorMessage");
|
|
1268
|
-
function createProductionDispatch(config, signal, onTokens) {
|
|
1278
|
+
function createProductionDispatch(config, signal, onTokens, bridgeApprovalEvents) {
|
|
1269
1279
|
return async (prompt, opts) => {
|
|
1270
1280
|
const stallMs = resolveStallMs(
|
|
1271
1281
|
typeof opts.stallMs === "number" ? opts.stallMs : void 0
|
|
1272
1282
|
);
|
|
1273
1283
|
return runStallResilient(
|
|
1274
|
-
(attemptSignal, emitter) =>
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1284
|
+
async (attemptSignal, emitter) => {
|
|
1285
|
+
const cleanupApprovalBridge = bridgeApprovalEvents?.(emitter);
|
|
1286
|
+
try {
|
|
1287
|
+
return await runSingleDispatch(
|
|
1288
|
+
config,
|
|
1289
|
+
prompt,
|
|
1290
|
+
opts,
|
|
1291
|
+
attemptSignal,
|
|
1292
|
+
emitter,
|
|
1293
|
+
onTokens
|
|
1294
|
+
);
|
|
1295
|
+
} finally {
|
|
1296
|
+
cleanupApprovalBridge?.();
|
|
1297
|
+
}
|
|
1298
|
+
},
|
|
1282
1299
|
{
|
|
1283
1300
|
stallMs,
|
|
1284
1301
|
signal,
|
|
@@ -1289,11 +1306,11 @@ function createProductionDispatch(config, signal, onTokens) {
|
|
|
1289
1306
|
}
|
|
1290
1307
|
__name(createProductionDispatch, "createProductionDispatch");
|
|
1291
1308
|
async function runSingleDispatch(config, prompt, opts, attemptSignal, emitter, onTokens) {
|
|
1292
|
-
const { AgentHeadless, ContextState } = await import("./agent-headless-
|
|
1309
|
+
const { AgentHeadless, ContextState } = await import("./agent-headless-AS7K2K57.js");
|
|
1293
1310
|
const ctx = new ContextState();
|
|
1294
1311
|
ctx.set("task_prompt", prompt);
|
|
1295
1312
|
const workflowAgentId = `workflow-agent-${randomBytes(8).toString("hex")}`;
|
|
1296
|
-
|
|
1313
|
+
debugLogger2.debug(`[workflow] Dispatch ${workflowAgentId}`);
|
|
1297
1314
|
if (opts.agentType === void 0 && opts.model === void 0 && opts.isolation === void 0 && opts.schema === void 0) {
|
|
1298
1315
|
const subagent = await AgentHeadless.create(
|
|
1299
1316
|
opts.label ?? "workflow-agent",
|
|
@@ -1351,7 +1368,7 @@ function reportTokens(subagent, opts, onTokens) {
|
|
|
1351
1368
|
const summary = subagent.getExecutionSummary();
|
|
1352
1369
|
onTokens(summary.outputTokens, opts);
|
|
1353
1370
|
} catch (e) {
|
|
1354
|
-
|
|
1371
|
+
debugLogger2.warn("onTokens callback threw:", e);
|
|
1355
1372
|
}
|
|
1356
1373
|
}
|
|
1357
1374
|
__name(reportTokens, "reportTokens");
|
|
@@ -1470,7 +1487,7 @@ ${WORKFLOW_SUBAGENT_SYSTEM_PROMPT_WITH_SCHEMA}` : WORKFLOW_SUBAGENT_SYSTEM_PROMP
|
|
|
1470
1487
|
worktreeIsolation = null;
|
|
1471
1488
|
const preserved = await cleanupWorkflowWorktree(isolation);
|
|
1472
1489
|
if (preserved) {
|
|
1473
|
-
|
|
1490
|
+
debugLogger2.info(
|
|
1474
1491
|
`[Workflow] Schema-mode subagent preserved worktree at ${preserved.path ?? "(directory removed)"} on branch ${preserved.branch}. The structured payload is returned verbatim; recover the work from the preserved path / branch.`
|
|
1475
1492
|
);
|
|
1476
1493
|
}
|
|
@@ -1525,7 +1542,7 @@ ${WORKFLOW_SUBAGENT_SYSTEM_PROMPT_WITH_SCHEMA}` : WORKFLOW_SUBAGENT_SYSTEM_PROMP
|
|
|
1525
1542
|
try {
|
|
1526
1543
|
await cleanupWorkflowWorktree(worktreeIsolation);
|
|
1527
1544
|
} catch (error) {
|
|
1528
|
-
|
|
1545
|
+
debugLogger2.warn(
|
|
1529
1546
|
`Workflow worktree cleanup in fallback finally failed for ${worktreeIsolation.path}: ${error instanceof Error ? error.message : String(error)}`
|
|
1530
1547
|
);
|
|
1531
1548
|
}
|
|
@@ -1558,7 +1575,7 @@ async function provisionWorkflowWorktree(config) {
|
|
|
1558
1575
|
try {
|
|
1559
1576
|
parentDirty = await wtService.hasWorktreeChanges(projectRoot);
|
|
1560
1577
|
} catch (error) {
|
|
1561
|
-
|
|
1578
|
+
debugLogger2.warn(
|
|
1562
1579
|
`[Workflow] hasWorktreeChanges failed at ${projectRoot}: ${error}`
|
|
1563
1580
|
);
|
|
1564
1581
|
parentDirty = true;
|
|
@@ -1573,7 +1590,7 @@ async function provisionWorkflowWorktree(config) {
|
|
|
1573
1590
|
try {
|
|
1574
1591
|
parentBranch = await wtService.getCurrentBranch();
|
|
1575
1592
|
} catch (error) {
|
|
1576
|
-
|
|
1593
|
+
debugLogger2.warn(
|
|
1577
1594
|
`[Workflow] getCurrentBranch failed at ${projectRoot}: ${error}`
|
|
1578
1595
|
);
|
|
1579
1596
|
}
|
|
@@ -1591,7 +1608,7 @@ async function provisionWorkflowWorktree(config) {
|
|
|
1591
1608
|
config.getSessionId()
|
|
1592
1609
|
);
|
|
1593
1610
|
} catch (error) {
|
|
1594
|
-
|
|
1611
|
+
debugLogger2.warn(
|
|
1595
1612
|
`[Workflow] failed to write session marker at ${created.worktree.path}: ${error}`
|
|
1596
1613
|
);
|
|
1597
1614
|
}
|
|
@@ -1624,20 +1641,20 @@ async function cleanupWorkflowWorktree(isolation) {
|
|
|
1624
1641
|
const wtService = new GitWorktreeService(isolation.repoRoot);
|
|
1625
1642
|
const [hasChanges, hasUnmerged] = await Promise.all([
|
|
1626
1643
|
wtService.hasWorktreeChanges(isolation.path).catch((error) => {
|
|
1627
|
-
|
|
1644
|
+
debugLogger2.warn(
|
|
1628
1645
|
`[Workflow] hasWorktreeChanges failed for ${isolation.path}: ${error}`
|
|
1629
1646
|
);
|
|
1630
1647
|
return true;
|
|
1631
1648
|
}),
|
|
1632
1649
|
wtService.hasUnmergedWorktreeCommits(isolation.slug).catch((error) => {
|
|
1633
|
-
|
|
1650
|
+
debugLogger2.warn(
|
|
1634
1651
|
`[Workflow] hasUnmergedWorktreeCommits failed for ${isolation.slug}: ${error}`
|
|
1635
1652
|
);
|
|
1636
1653
|
return true;
|
|
1637
1654
|
})
|
|
1638
1655
|
]);
|
|
1639
1656
|
if (hasChanges || hasUnmerged) {
|
|
1640
|
-
|
|
1657
|
+
debugLogger2.info(
|
|
1641
1658
|
`[Workflow] Preserving isolation worktree ${isolation.path} (branch ${isolation.branch}, hasChanges=${hasChanges}, hasUnmerged=${hasUnmerged})`
|
|
1642
1659
|
);
|
|
1643
1660
|
return { path: isolation.path, branch: isolation.branch };
|
|
@@ -1647,19 +1664,19 @@ async function cleanupWorkflowWorktree(isolation) {
|
|
|
1647
1664
|
deleteBranch: true
|
|
1648
1665
|
});
|
|
1649
1666
|
if (!result.success) {
|
|
1650
|
-
|
|
1667
|
+
debugLogger2.warn(
|
|
1651
1668
|
`[Workflow] Failed to remove ephemeral worktree ${isolation.path}: ${result.error}`
|
|
1652
1669
|
);
|
|
1653
1670
|
return { path: isolation.path, branch: isolation.branch };
|
|
1654
1671
|
}
|
|
1655
1672
|
if (result.branchPreserved) {
|
|
1656
|
-
|
|
1673
|
+
debugLogger2.warn(
|
|
1657
1674
|
`[Workflow] Removed worktree directory ${isolation.path} but kept branch ${isolation.branch} (unmerged commits at delete time)`
|
|
1658
1675
|
);
|
|
1659
1676
|
return { branch: isolation.branch };
|
|
1660
1677
|
}
|
|
1661
1678
|
} catch (error) {
|
|
1662
|
-
|
|
1679
|
+
debugLogger2.warn(
|
|
1663
1680
|
`[Workflow] Failed to remove ephemeral worktree ${isolation.path}: ${error}`
|
|
1664
1681
|
);
|
|
1665
1682
|
return { path: isolation.path, branch: isolation.branch };
|
|
@@ -1747,7 +1764,7 @@ var WorkflowOrchestrator = class {
|
|
|
1747
1764
|
if (cached !== void 0) {
|
|
1748
1765
|
const respawns = replay.started.get(journalKey);
|
|
1749
1766
|
if (respawns && respawns.length > 0) {
|
|
1750
|
-
|
|
1767
|
+
debugLogger2.info(
|
|
1751
1768
|
`[Workflow] resume cache hit after ${respawns.length} prior respawn(s) for runId=${runId}.`
|
|
1752
1769
|
);
|
|
1753
1770
|
}
|
|
@@ -1755,12 +1772,12 @@ var WorkflowOrchestrator = class {
|
|
|
1755
1772
|
try {
|
|
1756
1773
|
emitter?.agentDispatched?.(label2);
|
|
1757
1774
|
} catch (e) {
|
|
1758
|
-
|
|
1775
|
+
debugLogger2.warn("emitter.agentDispatched threw:", e);
|
|
1759
1776
|
}
|
|
1760
1777
|
try {
|
|
1761
1778
|
emitter?.agentCompleted?.(label2);
|
|
1762
1779
|
} catch (e) {
|
|
1763
|
-
|
|
1780
|
+
debugLogger2.warn("emitter.agentCompleted threw:", e);
|
|
1764
1781
|
}
|
|
1765
1782
|
return Promise.resolve(cached.result);
|
|
1766
1783
|
}
|
|
@@ -1768,11 +1785,11 @@ var WorkflowOrchestrator = class {
|
|
|
1768
1785
|
hadMiss = true;
|
|
1769
1786
|
journalEntryId = String(journalAgentId += 1);
|
|
1770
1787
|
journal.append({ type: "started", key: journalKey, agentId: journalEntryId }).catch(
|
|
1771
|
-
(e) =>
|
|
1788
|
+
(e) => debugLogger2.warn(`journal started-append failed: ${e}`)
|
|
1772
1789
|
);
|
|
1773
1790
|
}
|
|
1774
1791
|
if (budget && budget.total !== null && budget.remaining() <= 0) {
|
|
1775
|
-
|
|
1792
|
+
debugLogger2.warn(
|
|
1776
1793
|
`[Workflow] budget gate refused dispatch at entry: runId=${runId} spent=${budget.spent()} total=${budget.total}`
|
|
1777
1794
|
);
|
|
1778
1795
|
return Promise.reject(
|
|
@@ -1791,11 +1808,11 @@ var WorkflowOrchestrator = class {
|
|
|
1791
1808
|
try {
|
|
1792
1809
|
emitter?.agentDispatched?.(label);
|
|
1793
1810
|
} catch (e) {
|
|
1794
|
-
|
|
1811
|
+
debugLogger2.warn("emitter.agentDispatched threw:", e);
|
|
1795
1812
|
}
|
|
1796
1813
|
return limiter.run(() => {
|
|
1797
1814
|
if (budget && budget.total !== null && budget.remaining() <= 0) {
|
|
1798
|
-
|
|
1815
|
+
debugLogger2.warn(
|
|
1799
1816
|
`[Workflow] budget gate refused dispatch at slot-acquire: runId=${runId} spent=${budget.spent()} total=${budget.total}`
|
|
1800
1817
|
);
|
|
1801
1818
|
throw new WorkflowBudgetExceededError(
|
|
@@ -1810,7 +1827,7 @@ var WorkflowOrchestrator = class {
|
|
|
1810
1827
|
try {
|
|
1811
1828
|
emitter?.agentCompleted?.(label);
|
|
1812
1829
|
} catch (e) {
|
|
1813
|
-
|
|
1830
|
+
debugLogger2.warn("emitter.agentCompleted threw:", e);
|
|
1814
1831
|
}
|
|
1815
1832
|
if (journal && journalKey !== void 0) {
|
|
1816
1833
|
journal.append({
|
|
@@ -1819,14 +1836,14 @@ var WorkflowOrchestrator = class {
|
|
|
1819
1836
|
agentId: journalEntryId ?? "",
|
|
1820
1837
|
result
|
|
1821
1838
|
}).catch(
|
|
1822
|
-
(e) =>
|
|
1839
|
+
(e) => debugLogger2.warn(`journal result-append failed: ${e}`)
|
|
1823
1840
|
);
|
|
1824
1841
|
}
|
|
1825
1842
|
if (budget) {
|
|
1826
1843
|
try {
|
|
1827
1844
|
emitter?.budgetUpdated?.(budget.spent(), budget.total);
|
|
1828
1845
|
} catch (e) {
|
|
1829
|
-
|
|
1846
|
+
debugLogger2.warn("emitter.budgetUpdated threw:", e);
|
|
1830
1847
|
}
|
|
1831
1848
|
}
|
|
1832
1849
|
return result;
|
|
@@ -1836,13 +1853,13 @@ var WorkflowOrchestrator = class {
|
|
|
1836
1853
|
try {
|
|
1837
1854
|
emitter?.agentCompleted?.(label, msg);
|
|
1838
1855
|
} catch (e) {
|
|
1839
|
-
|
|
1856
|
+
debugLogger2.warn("emitter.agentCompleted threw:", e);
|
|
1840
1857
|
}
|
|
1841
1858
|
if (budget) {
|
|
1842
1859
|
try {
|
|
1843
1860
|
emitter?.budgetUpdated?.(budget.spent(), budget.total);
|
|
1844
1861
|
} catch (e) {
|
|
1845
|
-
|
|
1862
|
+
debugLogger2.warn("emitter.budgetUpdated threw:", e);
|
|
1846
1863
|
}
|
|
1847
1864
|
}
|
|
1848
1865
|
throw err;
|
|
@@ -1908,14 +1925,14 @@ async function settleToNullArray(thunks, signal, kind = "parallel") {
|
|
|
1908
1925
|
if (reason?.name === "WorkflowBudgetExceededError") {
|
|
1909
1926
|
budgetDropped += 1;
|
|
1910
1927
|
} else {
|
|
1911
|
-
|
|
1928
|
+
debugLogger2.warn(
|
|
1912
1929
|
`Workflow thunk at index ${i} rejected: ${String(reason?.message ?? r.reason)}`
|
|
1913
1930
|
);
|
|
1914
1931
|
}
|
|
1915
1932
|
return null;
|
|
1916
1933
|
});
|
|
1917
1934
|
if (budgetDropped > 0) {
|
|
1918
|
-
|
|
1935
|
+
debugLogger2.warn(
|
|
1919
1936
|
`${kind}: ${budgetDropped} slot${budgetDropped === 1 ? "" : "s"} dropped \u2014 token budget exceeded.`
|
|
1920
1937
|
);
|
|
1921
1938
|
}
|
|
@@ -1988,8 +2005,164 @@ function extractErrorMessage(err) {
|
|
|
1988
2005
|
}
|
|
1989
2006
|
__name(extractErrorMessage, "extractErrorMessage");
|
|
1990
2007
|
|
|
2008
|
+
// packages/core/src/agents/runtime/workflow-runner.ts
|
|
2009
|
+
var WorkflowRunHandle = class {
|
|
2010
|
+
constructor(runId, budget, registry, controller, start) {
|
|
2011
|
+
this.runId = runId;
|
|
2012
|
+
this.budget = budget;
|
|
2013
|
+
this.registry = registry;
|
|
2014
|
+
this.controller = controller;
|
|
2015
|
+
this.completion = Promise.resolve().then(start);
|
|
2016
|
+
}
|
|
2017
|
+
static {
|
|
2018
|
+
__name(this, "WorkflowRunHandle");
|
|
2019
|
+
}
|
|
2020
|
+
completion;
|
|
2021
|
+
abort() {
|
|
2022
|
+
this.controller.abort();
|
|
2023
|
+
}
|
|
2024
|
+
};
|
|
2025
|
+
var WorkflowRunner = class {
|
|
2026
|
+
static {
|
|
2027
|
+
__name(this, "WorkflowRunner");
|
|
2028
|
+
}
|
|
2029
|
+
static async start(options) {
|
|
2030
|
+
const config = options.config;
|
|
2031
|
+
const budget = WorkflowBudgetImpl.fromEnv();
|
|
2032
|
+
const loaded = options.scriptPath && options.script === void 0 ? await resolveSavedWorkflowScript(
|
|
2033
|
+
{ scriptPath: options.scriptPath },
|
|
2034
|
+
config
|
|
2035
|
+
) : void 0;
|
|
2036
|
+
const script = loaded?.script ?? options.script ?? "";
|
|
2037
|
+
const scriptPath = loaded?.scriptPath ?? options.scriptPath;
|
|
2038
|
+
const runId = options.resumeFromRunId ?? `wf_${randomBytes2(8).toString("hex")}`;
|
|
2039
|
+
const storage = config.storage;
|
|
2040
|
+
const journal = storage ? new WorkflowJournal(storage.getWorkflowRunJournalPath(runId)) : void 0;
|
|
2041
|
+
const resumeReplay = options.resumeFromRunId ? await journal?.load() : void 0;
|
|
2042
|
+
const controller = createChildAbortController(options.signal);
|
|
2043
|
+
const registry = config.getWorkflowRunRegistry?.();
|
|
2044
|
+
const dispatch = options.dispatch ?? createProductionDispatch(
|
|
2045
|
+
config,
|
|
2046
|
+
controller.signal,
|
|
2047
|
+
(outputTokens) => budget.recordSpent(outputTokens),
|
|
2048
|
+
registry ? (emitter2) => registry.bridgeApprovalEvents(runId, emitter2) : void 0
|
|
2049
|
+
);
|
|
2050
|
+
const orchestrator = new WorkflowOrchestrator(dispatch);
|
|
2051
|
+
const entry = registry?.register({
|
|
2052
|
+
runId,
|
|
2053
|
+
meta: null,
|
|
2054
|
+
status: "running",
|
|
2055
|
+
startTime: Date.now(),
|
|
2056
|
+
outputFile: "",
|
|
2057
|
+
abortController: controller,
|
|
2058
|
+
tokenBudgetTotal: budget.total,
|
|
2059
|
+
script,
|
|
2060
|
+
scriptPath
|
|
2061
|
+
});
|
|
2062
|
+
const emitUpdate = /* @__PURE__ */ __name(() => {
|
|
2063
|
+
if (!entry || !options.onUpdate) return;
|
|
2064
|
+
try {
|
|
2065
|
+
options.onUpdate(entry);
|
|
2066
|
+
} catch {
|
|
2067
|
+
}
|
|
2068
|
+
}, "emitUpdate");
|
|
2069
|
+
const emitter = {
|
|
2070
|
+
phaseStarted: /* @__PURE__ */ __name((title) => {
|
|
2071
|
+
registry?.onPhaseStarted(runId, title);
|
|
2072
|
+
emitUpdate();
|
|
2073
|
+
}, "phaseStarted"),
|
|
2074
|
+
agentDispatched: /* @__PURE__ */ __name(() => {
|
|
2075
|
+
registry?.onAgentDispatched(runId);
|
|
2076
|
+
emitUpdate();
|
|
2077
|
+
}, "agentDispatched"),
|
|
2078
|
+
agentCompleted: /* @__PURE__ */ __name(() => {
|
|
2079
|
+
registry?.onAgentCompleted(runId);
|
|
2080
|
+
}, "agentCompleted"),
|
|
2081
|
+
// Deliberate no-op: logs are snapshotted at terminal via
|
|
2082
|
+
// setRecentLogs; per-line emit would cause up to 10k TUI redraws.
|
|
2083
|
+
logAppended: /* @__PURE__ */ __name(() => {
|
|
2084
|
+
}, "logAppended"),
|
|
2085
|
+
budgetUpdated: /* @__PURE__ */ __name((spent, total) => {
|
|
2086
|
+
registry?.onBudgetUpdated(runId, spent, total);
|
|
2087
|
+
emitUpdate();
|
|
2088
|
+
}, "budgetUpdated")
|
|
2089
|
+
};
|
|
2090
|
+
const handle = new WorkflowRunHandle(
|
|
2091
|
+
runId,
|
|
2092
|
+
budget,
|
|
2093
|
+
registry,
|
|
2094
|
+
controller,
|
|
2095
|
+
async () => {
|
|
2096
|
+
try {
|
|
2097
|
+
const outcome = await orchestrator.run({
|
|
2098
|
+
script,
|
|
2099
|
+
args: options.args,
|
|
2100
|
+
abortOnTimeout: controller,
|
|
2101
|
+
runId,
|
|
2102
|
+
emitter,
|
|
2103
|
+
budget,
|
|
2104
|
+
resolveSavedWorkflow: /* @__PURE__ */ __name((ref) => resolveSavedWorkflowScript(ref, config), "resolveSavedWorkflow"),
|
|
2105
|
+
journal,
|
|
2106
|
+
resumeReplay
|
|
2107
|
+
});
|
|
2108
|
+
if (entry) {
|
|
2109
|
+
entry.meta = outcome.meta;
|
|
2110
|
+
if (outcome.meta?.name && entry.description === runId) {
|
|
2111
|
+
entry.description = outcome.meta.name;
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
registry?.setRecentLogs(runId, outcome.logs);
|
|
2115
|
+
registry?.complete(runId, outcome.result, Date.now());
|
|
2116
|
+
return { ok: true, outcome };
|
|
2117
|
+
} catch (error) {
|
|
2118
|
+
const details = error instanceof WorkflowExecutionError ? error : void 0;
|
|
2119
|
+
const message = extractErrorMessage2(error);
|
|
2120
|
+
if (entry && details?.meta && !entry.meta) entry.meta = details.meta;
|
|
2121
|
+
if (details?.logs) registry?.setRecentLogs(runId, details.logs);
|
|
2122
|
+
if (options.signal.aborted) {
|
|
2123
|
+
registry?.cancel(runId, Date.now());
|
|
2124
|
+
} else {
|
|
2125
|
+
registry?.fail(runId, message, Date.now());
|
|
2126
|
+
}
|
|
2127
|
+
return { ok: false, message, details };
|
|
2128
|
+
} finally {
|
|
2129
|
+
controller.abort();
|
|
2130
|
+
if (entry && entry.status !== "running") {
|
|
2131
|
+
await writeWorkflowSnapshot(config, entry);
|
|
2132
|
+
try {
|
|
2133
|
+
logWorkflowRun(
|
|
2134
|
+
config,
|
|
2135
|
+
new WorkflowRunEvent({
|
|
2136
|
+
status: entry.status,
|
|
2137
|
+
agents_dispatched: entry.agentsDispatched,
|
|
2138
|
+
agents_completed: entry.agentsCompleted,
|
|
2139
|
+
phase_count: entry.phases.length,
|
|
2140
|
+
tokens_spent: entry.tokensSpent,
|
|
2141
|
+
duration_ms: (entry.endTime ?? entry.startTime) - entry.startTime
|
|
2142
|
+
})
|
|
2143
|
+
);
|
|
2144
|
+
} catch {
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
registry?.releaseHandle(runId, handle);
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
);
|
|
2151
|
+
registry?.attachHandle(handle);
|
|
2152
|
+
return handle;
|
|
2153
|
+
}
|
|
2154
|
+
};
|
|
2155
|
+
function extractErrorMessage2(error) {
|
|
2156
|
+
if (error && typeof error === "object" && "message" in error) {
|
|
2157
|
+
const message = error.message;
|
|
2158
|
+
if (typeof message === "string") return message;
|
|
2159
|
+
return String(message);
|
|
2160
|
+
}
|
|
2161
|
+
return String(error);
|
|
2162
|
+
}
|
|
2163
|
+
__name(extractErrorMessage2, "extractErrorMessage");
|
|
2164
|
+
|
|
1991
2165
|
// packages/core/src/tools/workflow/workflow.ts
|
|
1992
|
-
import { randomBytes as randomBytes2 } from "node:crypto";
|
|
1993
2166
|
import * as path from "node:path";
|
|
1994
2167
|
var WORKFLOW_PARAM_SCHEMA = {
|
|
1995
2168
|
type: "object",
|
|
@@ -2037,104 +2210,23 @@ var WorkflowToolInvocation = class extends BaseToolInvocation {
|
|
|
2037
2210
|
return Promise.resolve("ask");
|
|
2038
2211
|
}
|
|
2039
2212
|
async execute(signal, updateOutput, _shellExecutionConfig) {
|
|
2040
|
-
const
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
this.
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
(
|
|
2049
|
-
);
|
|
2050
|
-
const orchestrator = new WorkflowOrchestrator(dispatch);
|
|
2051
|
-
let resolvedScript = this.params.script ?? "";
|
|
2052
|
-
let resolvedScriptPath = this.params.scriptPath;
|
|
2053
|
-
if (this.params.scriptPath && this.params.script === void 0) {
|
|
2054
|
-
const loaded = await resolveSavedWorkflowScript(
|
|
2055
|
-
{ scriptPath: this.params.scriptPath },
|
|
2056
|
-
this.config
|
|
2057
|
-
);
|
|
2058
|
-
resolvedScript = loaded.script;
|
|
2059
|
-
resolvedScriptPath = loaded.scriptPath;
|
|
2060
|
-
}
|
|
2061
|
-
const runId = this.params.resumeFromRunId ?? `wf_${randomBytes2(8).toString("hex")}`;
|
|
2062
|
-
let journal;
|
|
2063
|
-
let resumeReplay;
|
|
2064
|
-
const storage = this.config.storage;
|
|
2065
|
-
if (storage) {
|
|
2066
|
-
journal = new WorkflowJournal(storage.getWorkflowRunJournalPath(runId));
|
|
2067
|
-
if (this.params.resumeFromRunId) {
|
|
2068
|
-
resumeReplay = await journal.load();
|
|
2069
|
-
}
|
|
2070
|
-
}
|
|
2071
|
-
const registry = this.config.getWorkflowRunRegistry?.();
|
|
2072
|
-
const registryEntry = registry?.register({
|
|
2073
|
-
runId,
|
|
2074
|
-
meta: null,
|
|
2075
|
-
// populated after meta parses; safe default until then
|
|
2076
|
-
status: "running",
|
|
2077
|
-
startTime: Date.now(),
|
|
2078
|
-
outputFile: "",
|
|
2079
|
-
// P4b reserves the field but doesn't materialize
|
|
2080
|
-
abortController: dispatchController,
|
|
2081
|
-
// P5: seed the cap so the dialog can render the `M / N` form
|
|
2082
|
-
// immediately, before the first `budgetUpdated` fires. Stays
|
|
2083
|
-
// `null` when no env override.
|
|
2084
|
-
tokenBudgetTotal: budget.total,
|
|
2085
|
-
// P7b: carry the script source so a completed run can be snapshotted
|
|
2086
|
-
// to disk and saved to `.qwen/workflows/<name>.js` from the dialog.
|
|
2087
|
-
// `scriptPath` is set when the run was launched from a saved file (run
|
|
2088
|
-
// provenance for the snapshot).
|
|
2089
|
-
script: resolvedScript,
|
|
2090
|
-
scriptPath: resolvedScriptPath
|
|
2213
|
+
const handle = await WorkflowRunner.start({
|
|
2214
|
+
config: this.config,
|
|
2215
|
+
signal,
|
|
2216
|
+
script: this.params.script,
|
|
2217
|
+
scriptPath: this.params.scriptPath,
|
|
2218
|
+
args: this.params.args,
|
|
2219
|
+
resumeFromRunId: this.params.resumeFromRunId,
|
|
2220
|
+
dispatch: this.toolOptions.dispatch,
|
|
2221
|
+
onUpdate: updateOutput ? (entry) => safeEmitUpdate(updateOutput, entry) : void 0
|
|
2091
2222
|
});
|
|
2092
|
-
const
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
safeEmitUpdate(updateOutput, registryEntry);
|
|
2096
|
-
}, "phaseStarted"),
|
|
2097
|
-
agentDispatched: /* @__PURE__ */ __name(() => {
|
|
2098
|
-
registry?.onAgentDispatched(runId);
|
|
2099
|
-
safeEmitUpdate(updateOutput, registryEntry);
|
|
2100
|
-
}, "agentDispatched"),
|
|
2101
|
-
agentCompleted: /* @__PURE__ */ __name(() => {
|
|
2102
|
-
registry?.onAgentCompleted(runId);
|
|
2103
|
-
}, "agentCompleted"),
|
|
2104
|
-
logAppended: /* @__PURE__ */ __name(() => {
|
|
2105
|
-
}, "logAppended"),
|
|
2106
|
-
budgetUpdated: /* @__PURE__ */ __name((spent, total) => {
|
|
2107
|
-
registry?.onBudgetUpdated(runId, spent, total);
|
|
2108
|
-
safeEmitUpdate(updateOutput, registryEntry);
|
|
2109
|
-
}, "budgetUpdated")
|
|
2110
|
-
};
|
|
2111
|
-
try {
|
|
2112
|
-
const outcome = await orchestrator.run({
|
|
2113
|
-
script: resolvedScript,
|
|
2114
|
-
args: this.params.args,
|
|
2115
|
-
abortOnTimeout: dispatchController,
|
|
2116
|
-
runId,
|
|
2117
|
-
emitter,
|
|
2118
|
-
budget,
|
|
2119
|
-
// P-nested: resolve `workflow('<name>')` / `workflow({scriptPath})`
|
|
2120
|
-
// against the saved-workflow scripts in `.qwen/workflows/`.
|
|
2121
|
-
resolveSavedWorkflow: /* @__PURE__ */ __name((ref) => resolveSavedWorkflowScript(ref, this.config), "resolveSavedWorkflow"),
|
|
2122
|
-
// P6: resume journal (always wired) + replay maps (resume only).
|
|
2123
|
-
journal,
|
|
2124
|
-
resumeReplay
|
|
2125
|
-
});
|
|
2126
|
-
if (registryEntry) {
|
|
2127
|
-
registryEntry.meta = outcome.meta;
|
|
2128
|
-
if (outcome.meta?.name && registryEntry.description === runId) {
|
|
2129
|
-
registryEntry.description = outcome.meta.name;
|
|
2130
|
-
}
|
|
2131
|
-
}
|
|
2132
|
-
registry?.setRecentLogs(runId, outcome.logs);
|
|
2133
|
-
registry?.complete(runId, outcome.result, Date.now());
|
|
2223
|
+
const settlement = await handle.completion;
|
|
2224
|
+
if (settlement.ok) {
|
|
2225
|
+
const { outcome } = settlement;
|
|
2134
2226
|
const usageBanner = resolveUsageBanner(
|
|
2135
2227
|
this.config,
|
|
2136
|
-
registry,
|
|
2137
|
-
budget.total
|
|
2228
|
+
handle.registry,
|
|
2229
|
+
handle.budget.total
|
|
2138
2230
|
);
|
|
2139
2231
|
const llmText = safeStringifyResult(outcome.result);
|
|
2140
2232
|
const displayJson = safeStringifyDisplayPayload({
|
|
@@ -2149,10 +2241,10 @@ var WorkflowToolInvocation = class extends BaseToolInvocation {
|
|
|
2149
2241
|
// tokens whenever ANY usage is reported OR a cap is set, not
|
|
2150
2242
|
// only when spend > 0. A capped-but-zero-spend run still wants
|
|
2151
2243
|
// the cap visible so the user sees the gate engaged.
|
|
2152
|
-
...budget.spent() > 0 || budget.total !== null ? {
|
|
2244
|
+
...handle.budget.spent() > 0 || handle.budget.total !== null ? {
|
|
2153
2245
|
tokens: {
|
|
2154
|
-
spent: budget.spent(),
|
|
2155
|
-
total: budget.total
|
|
2246
|
+
spent: handle.budget.spent(),
|
|
2247
|
+
total: handle.budget.total
|
|
2156
2248
|
}
|
|
2157
2249
|
} : {}
|
|
2158
2250
|
});
|
|
@@ -2160,20 +2252,9 @@ var WorkflowToolInvocation = class extends BaseToolInvocation {
|
|
|
2160
2252
|
llmContent: [{ text: llmText }],
|
|
2161
2253
|
returnDisplay: usageBanner + "```json\n" + displayJson + "\n```"
|
|
2162
2254
|
};
|
|
2163
|
-
}
|
|
2164
|
-
const message =
|
|
2165
|
-
const phases
|
|
2166
|
-
const logs = err instanceof WorkflowExecutionError ? err.logs : void 0;
|
|
2167
|
-
const meta = err instanceof WorkflowExecutionError ? err.meta : void 0;
|
|
2168
|
-
if (registryEntry) {
|
|
2169
|
-
if (meta && !registryEntry.meta) registryEntry.meta = meta;
|
|
2170
|
-
}
|
|
2171
|
-
if (logs) registry?.setRecentLogs(runId, logs);
|
|
2172
|
-
if (signal.aborted) {
|
|
2173
|
-
registry?.cancel(runId, Date.now());
|
|
2174
|
-
} else {
|
|
2175
|
-
registry?.fail(runId, message, Date.now());
|
|
2176
|
-
}
|
|
2255
|
+
} else {
|
|
2256
|
+
const { message, details } = settlement;
|
|
2257
|
+
const { phases, logs, meta } = details ?? {};
|
|
2177
2258
|
const display = phases || logs || meta ? `Workflow failed: ${message}
|
|
2178
2259
|
|
|
2179
2260
|
${safeStringifyDisplayPayload({
|
|
@@ -2189,25 +2270,6 @@ ${safeStringifyDisplayPayload({
|
|
|
2189
2270
|
// the same way as other execution-time tool errors.
|
|
2190
2271
|
error: { message, type: "execution_failed" /* EXECUTION_FAILED */ }
|
|
2191
2272
|
};
|
|
2192
|
-
} finally {
|
|
2193
|
-
dispatchController.abort();
|
|
2194
|
-
if (registryEntry && registryEntry.status !== "running") {
|
|
2195
|
-
await writeWorkflowSnapshot(this.config, registryEntry);
|
|
2196
|
-
try {
|
|
2197
|
-
logWorkflowRun(
|
|
2198
|
-
this.config,
|
|
2199
|
-
new WorkflowRunEvent({
|
|
2200
|
-
status: registryEntry.status,
|
|
2201
|
-
agents_dispatched: registryEntry.agentsDispatched,
|
|
2202
|
-
agents_completed: registryEntry.agentsCompleted,
|
|
2203
|
-
phase_count: registryEntry.phases.length,
|
|
2204
|
-
tokens_spent: registryEntry.tokensSpent,
|
|
2205
|
-
duration_ms: (registryEntry.endTime ?? registryEntry.startTime) - registryEntry.startTime
|
|
2206
|
-
})
|
|
2207
|
-
);
|
|
2208
|
-
} catch {
|
|
2209
|
-
}
|
|
2210
|
-
}
|
|
2211
2273
|
}
|
|
2212
2274
|
}
|
|
2213
2275
|
};
|
|
@@ -2293,15 +2355,6 @@ function safeStringifyDisplayPayload(payload) {
|
|
|
2293
2355
|
}
|
|
2294
2356
|
}
|
|
2295
2357
|
__name(safeStringifyDisplayPayload, "safeStringifyDisplayPayload");
|
|
2296
|
-
function extractErrorMessage2(err) {
|
|
2297
|
-
if (err && typeof err === "object" && "message" in err) {
|
|
2298
|
-
const m = err.message;
|
|
2299
|
-
if (typeof m === "string") return m;
|
|
2300
|
-
return String(m);
|
|
2301
|
-
}
|
|
2302
|
-
return String(err);
|
|
2303
|
-
}
|
|
2304
|
-
__name(extractErrorMessage2, "extractErrorMessage");
|
|
2305
2358
|
var WorkflowTool = class extends BaseDeclarativeTool {
|
|
2306
2359
|
constructor(config, toolOptions = {}) {
|
|
2307
2360
|
super(
|
|
@@ -2344,11 +2397,11 @@ export {
|
|
|
2344
2397
|
};
|
|
2345
2398
|
/**
|
|
2346
2399
|
* @license
|
|
2347
|
-
* Copyright
|
|
2400
|
+
* Copyright 2026 Qwen Team
|
|
2348
2401
|
* SPDX-License-Identifier: Apache-2.0
|
|
2349
2402
|
*/
|
|
2350
2403
|
/**
|
|
2351
2404
|
* @license
|
|
2352
|
-
* Copyright
|
|
2405
|
+
* Copyright 2025 Qwen
|
|
2353
2406
|
* SPDX-License-Identifier: Apache-2.0
|
|
2354
2407
|
*/
|