@qwen-code/qwen-code 0.21.4 → 0.21.5
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/model-providers.md +8 -7
- package/bundled/qc-helper/docs/configuration/settings.md +1 -1
- package/bundled/qc-helper/docs/features/code-review.md +2 -0
- package/bundled/qc-helper/docs/features/mcp.md +11 -3
- package/bundled/review/SKILL.md +32 -1
- package/chunks/{MaxSizedBox-5XDFQHTQ.js → MaxSizedBox-2MWU5JYB.js} +16 -16
- package/chunks/{StandaloneSessionPicker-DLADA54K.js → StandaloneSessionPicker-B6MI5NTB.js} +30 -30
- package/chunks/{acpAgent-MVEFZSBS.js → acpAgent-MRPYN6FH.js} +674 -290
- package/chunks/{agent-RB6LCRZX.js → agent-NAOXNW4I.js} +16 -16
- package/chunks/{agent-headless-272ZACJV.js → agent-headless-L4PPVFKW.js} +16 -16
- package/chunks/{artifact-tool-TBOYEKTY.js → artifact-tool-RROCCJDA.js} +1 -1
- package/chunks/{askUserQuestion-23Y5WZFJ.js → askUserQuestion-2EPPBPUZ.js} +1 -1
- package/chunks/{bridge-GXUXFSHK.js → bridge-LHXGYNCO.js} +17 -17
- package/chunks/{channel-settings-store-5UA2SABE.js → channel-settings-store-QB54TLYE.js} +21 -21
- package/chunks/{chunk-PWCQRLM5.js → chunk-2AGOQ7QO.js} +1 -1
- package/chunks/{chunk-XSOAW7FC.js → chunk-2JBETW4S.js} +5 -5
- package/chunks/{chunk-O4IWFYUW.js → chunk-3GOCVBYR.js} +4 -4
- package/chunks/{chunk-3PHUGFPH.js → chunk-3H5RFLTS.js} +1 -1
- package/chunks/{chunk-OOPFAIWP.js → chunk-3P4GP4S2.js} +1 -1
- package/chunks/{chunk-YXEVDA66.js → chunk-4LLUH3A7.js} +19 -18
- package/chunks/{chunk-ZRQY5BBS.js → chunk-4NEBUDWS.js} +10 -10
- package/chunks/{chunk-C5YFS6VR.js → chunk-4NNR24EP.js} +4 -4
- package/chunks/{chunk-RL2NPV5E.js → chunk-4O6HLCOF.js} +1 -1
- package/chunks/{chunk-AFJSRJTO.js → chunk-5HWAJ4BK.js} +1 -1
- package/chunks/{chunk-O2ZYHG33.js → chunk-5L6CQ4ZU.js} +131 -67
- package/chunks/{chunk-AWTLFUVN.js → chunk-5XNO4AW7.js} +13 -13
- package/chunks/{chunk-LLMGP5IC.js → chunk-6WBWIPBF.js} +2 -2
- package/chunks/{chunk-4CTV3FZH.js → chunk-7M2RLFNX.js} +23 -19
- package/chunks/{chunk-X6QNZOTC.js → chunk-7MFQLOHZ.js} +1 -1
- package/chunks/{chunk-DZPOYHBT.js → chunk-7W5KOBYU.js} +1 -1
- package/chunks/{chunk-SBBHZ3YT.js → chunk-AEWOKOJY.js} +1 -1
- package/chunks/{chunk-2CCUHZP5.js → chunk-B2RBYP7Z.js} +2 -2
- package/chunks/{chunk-URVJ4AZC.js → chunk-B3EBIZUY.js} +1 -1
- package/chunks/{chunk-GDREW3U5.js → chunk-BWLUCN35.js} +1 -1
- package/chunks/{chunk-DJA7YBLJ.js → chunk-C6ARWPCG.js} +2 -2
- package/chunks/{chunk-RNKGMZEW.js → chunk-CAX76R46.js} +1 -1
- package/chunks/{chunk-CFDR3GNL.js → chunk-D7D7RXIJ.js} +11 -0
- package/chunks/{chunk-PCVMRBLN.js → chunk-D7QAZ5DF.js} +1 -1
- package/chunks/{chunk-THLV7YGY.js → chunk-EXHQZBVJ.js} +2 -2
- package/chunks/{chunk-DOCBJIBL.js → chunk-FEUXV3DC.js} +1 -1
- package/chunks/{chunk-QZQ72YF6.js → chunk-G2UXFO2B.js} +1 -1
- package/chunks/{chunk-QXTGHZCX.js → chunk-GBY3ODW7.js} +3 -3
- package/chunks/{chunk-LPLMUGIM.js → chunk-GEP54CHX.js} +5 -5
- package/chunks/{chunk-2T3RYG4L.js → chunk-GP4IMBX5.js} +420 -94
- package/chunks/{chunk-XPAY4EMH.js → chunk-IK3RYLAD.js} +3 -3
- package/chunks/{chunk-I32URQI7.js → chunk-IWGMDSC3.js} +5 -5
- package/chunks/{chunk-WDLQGFWP.js → chunk-IWYXZAGT.js} +27 -27
- package/chunks/{chunk-HBCKZF2A.js → chunk-IZ2CMEYO.js} +1 -1
- package/chunks/{chunk-PQEIKQXN.js → chunk-J7I2BZHS.js} +4 -3
- package/chunks/{chunk-PQ5JFCNL.js → chunk-JDNWIXHJ.js} +3 -3
- package/chunks/{chunk-KHSJSMFS.js → chunk-K2ETEWG6.js} +1 -1
- package/chunks/{chunk-FV4TUUDE.js → chunk-K64OI7S7.js} +1 -1
- package/chunks/{chunk-C6FU76AA.js → chunk-K6VEL5KP.js} +1 -1
- package/chunks/{chunk-B3EBXISV.js → chunk-KH2BIJ4H.js} +3 -3
- package/chunks/{chunk-G7XXKQYS.js → chunk-LKRMNRSN.js} +27 -1
- package/chunks/{chunk-G6KI6B5L.js → chunk-LMNM37OE.js} +1 -1
- package/chunks/{chunk-SV5X2EUV.js → chunk-LSYVASZS.js} +1 -1
- package/chunks/{chunk-4PZ7SPD5.js → chunk-LYPXNRBX.js} +1 -1
- package/chunks/{chunk-HFVW54NL.js → chunk-MBEMTXQT.js} +9 -2
- package/chunks/{chunk-RPYYTL7E.js → chunk-MGSSJT27.js} +2 -2
- package/chunks/{chunk-M2L4TMH3.js → chunk-N3RERU5N.js} +3 -3
- package/chunks/{chunk-HI4YGRJD.js → chunk-NLQIEY6W.js} +3 -3
- package/chunks/{chunk-UATJZOAJ.js → chunk-OGAARVN7.js} +3 -3
- package/chunks/{chunk-6KQUOXT5.js → chunk-OIGB253L.js} +6 -6
- package/chunks/{chunk-EIAPOG76.js → chunk-P3SLTSNY.js} +3 -3
- package/chunks/{chunk-BC4LTKEG.js → chunk-Q2V4AOQL.js} +1 -1
- package/chunks/{chunk-KB6VSG2U.js → chunk-RM3F46UT.js} +6 -6
- package/chunks/{chunk-6ME3PVMM.js → chunk-SJMCYCUQ.js} +5 -5
- package/chunks/{chunk-2JN5V3I7.js → chunk-SQTA6PAY.js} +1 -1
- package/chunks/{chunk-2ON2O4MD.js → chunk-SVIEVA3L.js} +3 -3
- package/chunks/{chunk-FPPVCCAH.js → chunk-TCOJPG2P.js} +1 -1
- package/chunks/{chunk-BOWKLLWA.js → chunk-TJ56V3AR.js} +2 -2
- package/chunks/{chunk-A7PONO5G.js → chunk-URJHXOSO.js} +2 -2
- package/chunks/{chunk-EJXATV5R.js → chunk-VJPF6GF2.js} +2 -2
- package/chunks/{chunk-5XGI4IPK.js → chunk-VOA2UPZM.js} +3 -3
- package/chunks/{chunk-XGA6XHH3.js → chunk-WTM5QONI.js} +3 -3
- package/chunks/{chunk-IMGNGOGC.js → chunk-WU5NBSLD.js} +3 -3
- package/chunks/{chunk-7UXI6P72.js → chunk-WVAESIM6.js} +2 -2
- package/chunks/{chunk-TXZDRD36.js → chunk-XD2PNH3K.js} +5 -5
- package/chunks/{chunk-E2SYUEIA.js → chunk-YLL3SC5S.js} +743 -312
- package/chunks/{chunk-M6RNMBUO.js → chunk-YMUZQ3MQ.js} +4 -4
- package/chunks/{chunk-DHNFB7NC.js → chunk-YO4JI7B4.js} +5 -5
- package/chunks/{chunk-VA5NLVPT.js → chunk-Z7JILXGX.js} +1 -1
- package/chunks/{chunk-P5UJMCVS.js → chunk-ZLGPHA34.js} +4 -4
- package/chunks/{chunk-JDJ7SC4E.js → chunk-ZPGMDT4S.js} +237 -106
- package/chunks/{chunk-UEJESCS7.js → chunk-ZPPP6VCL.js} +1 -1
- package/chunks/{computer-use-MDOMIVTL.js → computer-use-XDOGP2KA.js} +16 -16
- package/chunks/{contextCommand-FCK3CB37.js → contextCommand-N3LQDCYJ.js} +18 -18
- package/chunks/{core-runtime-UHRHHU2O.js → core-runtime-STAFP45W.js} +16 -16
- package/chunks/{create-sub-session-MIXUVLWW.js → create-sub-session-2B3JENWD.js} +16 -16
- package/chunks/{create-sub-session-J32WC64U.js → create-sub-session-6EWLAZD5.js} +1 -1
- package/chunks/{cron-create-HMFSHIAR.js → cron-create-CCRIULJE.js} +1 -1
- package/chunks/{cron-delete-ZJFHOX57.js → cron-delete-FCFW6BGP.js} +1 -1
- package/chunks/{cron-list-ZEX2NBMN.js → cron-list-QDBVCHRF.js} +1 -1
- package/chunks/{daemon-status-provider-6LC7LUNR.js → daemon-status-provider-PPAH3ATF.js} +21 -21
- package/chunks/{daemon-trust-policy-Y36HGRAM.js → daemon-trust-policy-X6XL3MB4.js} +21 -21
- package/chunks/{daemon-trust-policy-monitor-ROTBBDOH.js → daemon-trust-policy-monitor-M5LBL2HD.js} +21 -21
- package/chunks/{deferred-core-runtime-ZQ4JIAJD.js → deferred-core-runtime-O54YPTBU.js} +16 -16
- package/chunks/{display-image-2WOG27DY.js → display-image-GUJA352B.js} +2 -2
- package/chunks/{earlyInputCapture-GPRUNXTP.js → earlyInputCapture-CBIT2RGT.js} +16 -16
- package/chunks/{edit-YK3UP6D2.js → edit-KW2TOC6A.js} +17 -17
- package/chunks/{enter-worktree-QMVQW7UG.js → enter-worktree-YL34NEU5.js} +16 -16
- package/chunks/{enterPlanMode-TZAYQ5MP.js → enterPlanMode-JFJTDASQ.js} +16 -16
- package/chunks/{environment-3UQURCZG.js → environment-IATU5GXG.js} +18 -18
- package/chunks/{errors-VBIMTNNI.js → errors-SAVRDE7Q.js} +18 -18
- package/chunks/{exit-worktree-4EC7LBBC.js → exit-worktree-5M43QPBB.js} +16 -16
- package/chunks/{exitPlanMode-K5Y3REU2.js → exitPlanMode-W4EICZ4N.js} +16 -16
- package/chunks/{fast-path-KS6IE7YR.js → fast-path-YQJPIKMP.js} +2 -2
- package/chunks/{gemini-LTUCUOJH.js → gemini-FUF5SSPR.js} +47 -47
- package/chunks/{geminiContentGenerator-M3HJTHKR.js → geminiContentGenerator-LLLZBOUG.js} +1 -1
- package/chunks/{glob-SKUYGTF2.js → glob-LJFFMN4D.js} +16 -16
- package/chunks/{goal-tools-SPQ5M6D3.js → goal-tools-3AZKX5WQ.js} +2 -18
- package/chunks/{grep-SQ7RD7SV.js → grep-Q64EAM73.js} +16 -16
- package/chunks/{handleAutoUpdate-OK7OX23A.js → handleAutoUpdate-QBMPRTSQ.js} +20 -20
- package/chunks/{i18n-P77YBKY4.js → i18n-LDUW5DMN.js} +17 -17
- package/chunks/{image-gen-2ZWPS42A.js → image-gen-G7RLG3KR.js} +2 -2
- package/chunks/{initializer-PIOYXVW7.js → initializer-74A7DMMD.js} +21 -21
- package/chunks/{installationInfo-IWMM6DPV.js → installationInfo-OFDYLDFD.js} +17 -17
- package/chunks/{list-3DCR4TRI.js → list-JA2EWRHJ.js} +24 -24
- package/chunks/{list-agents-TWEGRJWO.js → list-agents-GC4BRET7.js} +1 -1
- package/chunks/{loadedSettingsAdapter-EJC6CU5N.js → loadedSettingsAdapter-2GNJOQ3L.js} +21 -21
- package/chunks/{loggingContentGenerator-2JEFU25T.js → loggingContentGenerator-B6B5EGB3.js} +8 -8
- package/chunks/{loop-wakeup-6LLEOQYV.js → loop-wakeup-SQQSBMEY.js} +2 -2
- package/chunks/{ls-H5WX22VK.js → ls-63CC3NNX.js} +1 -1
- package/chunks/{lsp-G6FXYEIS.js → lsp-P6NVJVNT.js} +1 -1
- package/chunks/{managed-npm-update-EGVQPSBR.js → managed-npm-update-4YZHLUER.js} +17 -17
- package/chunks/{mcp-KFFH2MBV.js → mcp-LLK5YJVH.js} +21 -21
- package/chunks/{monitor-6Y3NDMTI.js → monitor-NYJPAWVP.js} +16 -16
- package/chunks/{nonInteractiveCli-426IQDPE.js → nonInteractiveCli-HZBBBDJD.js} +45 -45
- package/chunks/{notebook-edit-373IQQLE.js → notebook-edit-LLM6UXFX.js} +17 -17
- package/chunks/{openaiContentGenerator-PGFSOMIQ.js → openaiContentGenerator-2AEXDN55.js} +8 -8
- package/chunks/{pidfile-Y4INDMHG.js → pidfile-3JUWX7G2.js} +16 -16
- package/chunks/{processUtils-6BCPCJZW.js → processUtils-JLLRVZHT.js} +2 -2
- package/chunks/{qwenContentGenerator-QC3KSHSX.js → qwenContentGenerator-2FESCF27.js} +17 -17
- package/chunks/{qwenOAuth2-IOAXKJ3L.js → qwenOAuth2-2KKPYA5J.js} +1 -1
- package/chunks/{read-file-2T54FYZV.js → read-file-5GVXLY74.js} +6 -6
- package/chunks/{read-mcp-resource-DRZSI3HE.js → read-mcp-resource-RTSSEER5.js} +1 -1
- package/chunks/{record-artifact-IPIRWMFY.js → record-artifact-L3BAHQFN.js} +2 -2
- package/chunks/{resumeHistoryUtils-O62RDCZ3.js → resumeHistoryUtils-Z4OFBXPM.js} +19 -19
- package/chunks/{ripGrep-3H72KY7S.js → ripGrep-TKOJTIAB.js} +16 -16
- package/chunks/{run-qwen-serve-3AIDNNHO.js → run-qwen-serve-K5W6MM6M.js} +27 -27
- package/chunks/{runtime-AZ4EHHFV.js → runtime-IADXMRCY.js} +22 -22
- package/chunks/{scheduler-L4UUCU4Z.js → scheduler-T7AV37LD.js} +16 -16
- package/chunks/{sdk-exporters-http-IKNWQJNV.js → sdk-exporters-http-IL2346MJ.js} +6 -2
- package/chunks/{sdk-impl-7CUUMQDB.js → sdk-impl-SYKGVWOZ.js} +2 -2
- package/chunks/{send-message-LHJLVWFD.js → send-message-TL6FIMMN.js} +3 -3
- package/chunks/{serve-CLXGSYOE.js → serve-ROEGMS3I.js} +21 -21
- package/chunks/{server-MEAE3WMM.js → server-NGXMRODI.js} +40 -40
- package/chunks/{session-OSLD2LT5.js → session-RCDLDJA4.js} +46 -46
- package/chunks/{settings-ILWAOKA4.js → settings-E6H3AURD.js} +20 -20
- package/chunks/{shell-RT5DBH6B.js → shell-RHGGJ6BE.js} +16 -16
- package/chunks/{skill-LVGA3ATZ.js → skill-GQ7PBS25.js} +7 -7
- package/chunks/{skill-settings-WTZE7EPE.js → skill-settings-E2F7OCBL.js} +20 -20
- package/chunks/{spawnChannel-BOBS7DVM.js → spawnChannel-Q2IQBHME.js} +16 -16
- package/chunks/{standalone-update-Y5JB4S2K.js → standalone-update-NYYZEHLD.js} +18 -18
- package/chunks/{startInteractiveUI-ZV25CD2S.js → startInteractiveUI-IX6I3Y2Z.js} +62 -59
- package/chunks/{syntheticOutput-EYL7DWO7.js → syntheticOutput-BN7E626U.js} +2 -2
- package/chunks/{task-create-4ALZMGP5.js → task-create-2X4UP4F3.js} +4 -4
- package/chunks/{task-list-6CVQPORX.js → task-list-WOLJPZ64.js} +1 -1
- package/chunks/{task-stop-Y5ZTFVRX.js → task-stop-TNXRNAL2.js} +1 -1
- package/chunks/{task-update-IKCEEWJ6.js → task-update-VDUSN36E.js} +4 -4
- package/chunks/{team-create-ZVPQIXCP.js → team-create-UTRVUEDA.js} +16 -16
- package/chunks/{team-delete-CE7DC53R.js → team-delete-D2VMSDOT.js} +1 -1
- package/chunks/{team-plan-approval-5UHUBY3W.js → team-plan-approval-YZNB4U5U.js} +16 -16
- package/chunks/{terminal-image-renderer-NWC2RALG.js → terminal-image-renderer-QRSCS2BE.js} +17 -17
- package/chunks/{theme-manager-5KICSBOB.js → theme-manager-EKZBY34I.js} +16 -16
- package/chunks/{todoWrite-FTZWQRZH.js → todoWrite-MHWHO5UO.js} +1 -1
- package/chunks/{tool-search-2AOU77H4.js → tool-search-N2R7LVMC.js} +8 -8
- package/chunks/{total-session-admission-FR7RMHVL.js → total-session-admission-HBIYARPO.js} +17 -17
- package/chunks/{trustedFolders-V7UUPQXO.js → trustedFolders-ZQLYRCSY.js} +17 -17
- package/chunks/{update-relaunch-TBWRMQD6.js → update-relaunch-PJWXMPCR.js} +5 -5
- package/chunks/{updateCheck-42SPCLH7.js → updateCheck-ZXRCGY66.js} +19 -19
- package/chunks/{useAutoAcceptIndicator-4C2KM345.js → useAutoAcceptIndicator-ZYQW5SGJ.js} +22 -22
- package/chunks/{validateNonInterActiveAuth-UVFRXV3Z.js → validateNonInterActiveAuth-M7J7OTRH.js} +42 -42
- package/chunks/{version-HKTV6TPN.js → version-2AOHMPK3.js} +1 -1
- package/chunks/{web-fetch-ZRXSV5AN.js → web-fetch-DS34CJ3R.js} +6 -6
- package/chunks/{web-search-WOLV3L6T.js → web-search-ITFPD7V4.js} +4 -4
- package/chunks/{workflow-F63ES3OB.js → workflow-LZQ4PGNS.js} +17 -17
- package/chunks/{workspace-providers-status-PJMGMYMC.js → workspace-providers-status-ZPTLKOBM.js} +23 -23
- package/chunks/{workspace-registration-store-LNBOX5TJ.js → workspace-registration-store-OTFKSGG7.js} +1 -1
- package/chunks/{workspace-registry-4PR7VDQ3.js → workspace-registry-YZ3OXPHP.js} +17 -17
- package/chunks/{workspace-service-PVI3VUNQ.js → workspace-service-OCZXOOSQ.js} +24 -24
- package/chunks/{workspace-skills-status-2Q5ZISO6.js → workspace-skills-status-K2ALGUCD.js} +21 -21
- package/chunks/{workspace-trust-reconciler-NOILUH3C.js → workspace-trust-reconciler-KMRZISJP.js} +22 -22
- package/chunks/{write-file-MOM4JDHG.js → write-file-AWBI4GJS.js} +16 -16
- package/chunks/{zoom-image-E3VHRCFU.js → zoom-image-NHKN6F77.js} +6 -6
- package/cli.js +12 -12
- package/package.json +3 -3
- package/web-shell/assets/{arc-GpdmhIxr.js → arc-Dpg66jw7.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-C-LhCgH_.js → architectureDiagram-3BPJPVTR-BJ4FIBxN.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-CzNdTCm-.js → blockDiagram-GPEHLZMM-VXmYdtYT.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-Ce7hbrRM.js → c4Diagram-AAUBKEIU-BNLDb8FE.js} +1 -1
- package/web-shell/assets/channel-Bd9wOnaA.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-BBSEn1PK.js → chunk-2J33WTMH-DR5yHxr0.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-_llgjfe5.js → chunk-4BX2VUAB-Czkq8UZU.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-9fJZ_oZE.js → chunk-55IACEB6-DugUgM6s.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-DgEzQWOu.js → chunk-727SXJPM-Dw6quA1K.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-B4RthUTc.js → chunk-AQP2D5EJ-BoVYOTTz.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-CDI-emMW.js → chunk-FMBD7UC4--Amcse-j.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-jM2-yOd8.js → chunk-ND2GUHAM-ajaEYAC8.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-XGZHlKPF.js → chunk-QZHKN3VN-CUNDZ7im.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-XhCT8FE3.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-XhCT8FE3.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-90nbW1xQ.js → cose-bilkent-S5V4N54A-BnfkD-m1.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-BtzlyqZ9.js → dagre-BM42HDAG-BuUdFk7Z.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-DAaqGWaH.js → diagram-2AECGRRQ-B2ZXxoab.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-CxlzSIFa.js → diagram-5GNKFQAL-BsgOICzM.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-8kj-1H6u.js → diagram-KO2AKTUF-DTTjG6U-.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-6NhjFwRF.js → diagram-LMA3HP47-temLf1x7.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-Bn9kvInz.js → diagram-OG6HWLK6-CRFjScs2.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-CaRoGsAt.js → erDiagram-TEJ5UH35-D4oaY-rQ.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-TkLweHdf.js → flowDiagram-I6XJVG4X-BqG8B49b.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-ruwhCKBl.js → ganttDiagram-6RSMTGT7-DffQBdd5.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-DNI_PxoU.js → gitGraphDiagram-PVQCEYII-CMDPfseF.js} +1 -1
- package/web-shell/assets/{index-T4KluHvu.js → index-2F4RsNzd.js} +322 -322
- package/web-shell/assets/index-CaucmEO_.css +5 -0
- package/web-shell/assets/{index-p1gz-sxE.js → index-qTQR_smP.js} +1 -1
- package/web-shell/assets/{infoDiagram-5YYISTIA-DarXq1-A.js → infoDiagram-5YYISTIA-Cn3T83MA.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-GxDaDlT0.js → ishikawaDiagram-YF4QCWOH-ijFs7e25.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-mDEoGBzY.js → journeyDiagram-JHISSGLW-CINTv8VB.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-Ds0t-Mup.js → kanban-definition-UN3LZRKU-CMGRZCxx.js} +1 -1
- package/web-shell/assets/{linear-05nJ0xZ7.js → linear-Co-2_37d.js} +1 -1
- package/web-shell/assets/{mermaid.core-Bua24ThM.js → mermaid.core-DijbyaN5.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-D_zRdvUS.js → mindmap-definition-RKZ34NQL-k_sDYDPZ.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-DZHr1x16.js → pieDiagram-4H26LBE5-CG-oz8V3.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-HA06Wf0h.js → quadrantDiagram-W4KKPZXB-Baq7HIG2.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-DH3urmJf.js → requirementDiagram-4Y6WPE33-CDM3ZvBt.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-C4xgz0TT.js → sankeyDiagram-5OEKKPKP-C2dJbWKN.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-DAUoZWgv.js → sequenceDiagram-3UESZ5HK-Cf1_h59p.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-v7NzXy4l.js → stateDiagram-AJRCARHV-CI5clUEc.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-BDc8asKD.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-B3GTYR2W.js → timeline-definition-PNZ67QCA-B2O8cAZX.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-BWHjSPAq.js → vennDiagram-CIIHVFJN-BLsJ_h9s.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-m9r6IUBC.js → wardley-L42UT6IY-BlPU4FTA.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-kT0FkVfK.js → wardleyDiagram-YWT4CUSO-D_U-RdU4.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-CYRm10z5.js → xychartDiagram-2RQKCTM6-BynXGSTl.js} +1 -1
- package/web-shell/index.html +2 -2
- package/web-shell/assets/channel-95y6Rcp3.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-pfzVkmjQ.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-pfzVkmjQ.js +0 -1
- package/web-shell/assets/index-WxSvj2tI.css +0 -5
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-CtdFexEf.js +0 -1
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
CronScheduler,
|
|
41
41
|
DEFAULT_RECURRING_MAX_AGE_DAYS,
|
|
42
42
|
normalizeRecurringMaxAge
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-Z7JILXGX.js";
|
|
44
44
|
import {
|
|
45
45
|
consumeUnread,
|
|
46
46
|
forwardApproval,
|
|
@@ -71,13 +71,13 @@ import {
|
|
|
71
71
|
RUNTIME_SNAPSHOT_PREFIX,
|
|
72
72
|
buildModelIdContext,
|
|
73
73
|
resolveModelId
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-7W5KOBYU.js";
|
|
75
75
|
import {
|
|
76
76
|
ARTIFACT_TITLE_MAX_LENGTH,
|
|
77
77
|
ARTIFACT_WORKSPACE_PATH_MAX_LENGTH,
|
|
78
78
|
hasControlCharacter,
|
|
79
79
|
hasUnsafeDisplayPayload
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-7MFQLOHZ.js";
|
|
81
81
|
import {
|
|
82
82
|
promptIdContext,
|
|
83
83
|
todoWorkChainContext
|
|
@@ -139,7 +139,7 @@ import {
|
|
|
139
139
|
goalRequiresExactPermit,
|
|
140
140
|
goalTurnContext,
|
|
141
141
|
parseGoalStateRecordPayloadV2
|
|
142
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-MBEMTXQT.js";
|
|
143
143
|
import {
|
|
144
144
|
APPROVAL_MODES,
|
|
145
145
|
SUBAGENT_PLAN_LIFECYCLE_TOOLS,
|
|
@@ -163,7 +163,7 @@ import {
|
|
|
163
163
|
runWithRuntimeContentGenerator,
|
|
164
164
|
shouldUsePlanOnlyReminderInSubagentContext,
|
|
165
165
|
spawnBlockReason
|
|
166
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-6WBWIPBF.js";
|
|
167
167
|
import {
|
|
168
168
|
getTeammateContext,
|
|
169
169
|
isTeammate,
|
|
@@ -202,7 +202,7 @@ import {
|
|
|
202
202
|
selectForkHistory,
|
|
203
203
|
stripSystemReminderBlocks,
|
|
204
204
|
validateForkToolList
|
|
205
|
-
} from "./chunk-
|
|
205
|
+
} from "./chunk-WVAESIM6.js";
|
|
206
206
|
import {
|
|
207
207
|
collectAvailableSkillEntries,
|
|
208
208
|
renderAvailableSkillsBlock
|
|
@@ -223,7 +223,7 @@ import {
|
|
|
223
223
|
} from "./chunk-432XCUHF.js";
|
|
224
224
|
import {
|
|
225
225
|
DashScopeOpenAICompatibleProvider
|
|
226
|
-
} from "./chunk-
|
|
226
|
+
} from "./chunk-4LLUH3A7.js";
|
|
227
227
|
import {
|
|
228
228
|
openBrowserSecurely,
|
|
229
229
|
shouldAttemptBrowserLaunch
|
|
@@ -248,7 +248,7 @@ import {
|
|
|
248
248
|
addToolArgumentsAttributes,
|
|
249
249
|
addToolCallResultAttributes,
|
|
250
250
|
addUserPromptAttributes
|
|
251
|
-
} from "./chunk-
|
|
251
|
+
} from "./chunk-MGSSJT27.js";
|
|
252
252
|
import {
|
|
253
253
|
InvalidStreamError,
|
|
254
254
|
getThoughtSummary
|
|
@@ -383,7 +383,7 @@ import {
|
|
|
383
383
|
updateMCPServerStatus,
|
|
384
384
|
writeLine,
|
|
385
385
|
writeLineSync
|
|
386
|
-
} from "./chunk-
|
|
386
|
+
} from "./chunk-ZPGMDT4S.js";
|
|
387
387
|
import {
|
|
388
388
|
E_TIMEOUT,
|
|
389
389
|
Mutex,
|
|
@@ -411,13 +411,14 @@ import {
|
|
|
411
411
|
} from "./chunk-E4WHKETF.js";
|
|
412
412
|
import {
|
|
413
413
|
STRUCTURED_OUTPUT_REDACTED_ARGS
|
|
414
|
-
} from "./chunk-
|
|
414
|
+
} from "./chunk-ZPPP6VCL.js";
|
|
415
415
|
import {
|
|
416
416
|
AgentStatistics,
|
|
417
417
|
BaseDeclarativeTool,
|
|
418
418
|
BaseToolInvocation,
|
|
419
419
|
CONCURRENCY_SAFE_KINDS,
|
|
420
420
|
SchemaValidator,
|
|
421
|
+
StructuredToolError,
|
|
421
422
|
ToolDisplayNames,
|
|
422
423
|
ToolDisplayNamesMigration,
|
|
423
424
|
ToolNames,
|
|
@@ -428,7 +429,7 @@ import {
|
|
|
428
429
|
require_dist,
|
|
429
430
|
require_fast_deep_equal,
|
|
430
431
|
require_fast_uri
|
|
431
|
-
} from "./chunk-
|
|
432
|
+
} from "./chunk-D7D7RXIJ.js";
|
|
432
433
|
import {
|
|
433
434
|
AUTH_ENV_MAPPINGS,
|
|
434
435
|
AuthType,
|
|
@@ -442,7 +443,7 @@ import {
|
|
|
442
443
|
createContentGenerator,
|
|
443
444
|
resetPreloadedContentGenerator,
|
|
444
445
|
resolveContentGeneratorConfigWithSources
|
|
445
|
-
} from "./chunk-
|
|
446
|
+
} from "./chunk-XD2PNH3K.js";
|
|
446
447
|
import {
|
|
447
448
|
normalizeMcpToolName,
|
|
448
449
|
sanitizeToolNameForProvider
|
|
@@ -494,15 +495,28 @@ import {
|
|
|
494
495
|
startToolExecutionSpan,
|
|
495
496
|
startToolSpan,
|
|
496
497
|
truncateSpanError
|
|
497
|
-
} from "./chunk-
|
|
498
|
+
} from "./chunk-5L6CQ4ZU.js";
|
|
498
499
|
import {
|
|
499
500
|
safeJsonStringify
|
|
500
501
|
} from "./chunk-W4RQUHY3.js";
|
|
501
502
|
import {
|
|
502
503
|
DEFAULT_SENSITIVE_SPAN_ATTRIBUTE_MAX_LENGTH,
|
|
503
504
|
SENSITIVE_SPAN_ATTRIBUTE_MAX_LENGTH_LIMIT,
|
|
505
|
+
TOOL_FAILURE_KIND_ATTRIBUTE,
|
|
506
|
+
TOOL_FAILURE_KIND_BACKGROUND_AGENT_DENIED,
|
|
507
|
+
TOOL_FAILURE_KIND_CANCELLED,
|
|
508
|
+
TOOL_FAILURE_KIND_INVOCATION_GUARD_DENIED,
|
|
509
|
+
TOOL_FAILURE_KIND_NON_INTERACTIVE_DENIED,
|
|
510
|
+
TOOL_FAILURE_KIND_PERMISSION_DENIED,
|
|
511
|
+
TOOL_FAILURE_KIND_PERMISSION_HOOK_DENIED,
|
|
512
|
+
TOOL_FAILURE_KIND_PLAN_MODE_BLOCKED,
|
|
513
|
+
TOOL_FAILURE_KIND_POST_HOOK_STOPPED,
|
|
514
|
+
TOOL_FAILURE_KIND_PRE_HOOK_BLOCKED,
|
|
515
|
+
TOOL_FAILURE_KIND_TIMEOUT,
|
|
516
|
+
TOOL_FAILURE_KIND_TOOL_ERROR,
|
|
517
|
+
TOOL_FAILURE_KIND_TOOL_EXCEPTION,
|
|
504
518
|
isValidSensitiveSpanAttributeMaxLength
|
|
505
|
-
} from "./chunk-
|
|
519
|
+
} from "./chunk-LKRMNRSN.js";
|
|
506
520
|
import {
|
|
507
521
|
FatalConfigError,
|
|
508
522
|
PATH_ARG_KEYS,
|
|
@@ -22441,6 +22455,9 @@ Okay, I can write those tests. First, I'll read someFile.ts to understand its fu
|
|
|
22441
22455
|
Now I'll look for existing or related test files to understand current testing conventions and dependencies.
|
|
22442
22456
|
[tool_call: ${ToolNames.READ_FILE} for file_path '/path/to/existingTest.test.ts']
|
|
22443
22457
|
(After reviewing existing tests and the file content)
|
|
22458
|
+
I'll check whether the intended test file already exists.
|
|
22459
|
+
[tool_call: ${ToolNames.READ_FILE} for file_path '/path/to/someFile.test.ts']
|
|
22460
|
+
(After read_file reports that /path/to/someFile.test.ts does not exist)
|
|
22444
22461
|
[tool_call: ${ToolNames.WRITE_FILE} for file_path '/path/to/someFile.test.ts' with content '(test code content)']
|
|
22445
22462
|
I've written the tests. Now I'll run the project's test command to verify them.
|
|
22446
22463
|
[tool_call: ${ToolNames.SHELL} for 'npm run test']
|
|
@@ -22580,6 +22597,15 @@ Now I'll look for existing or related test files to understand current testing c
|
|
|
22580
22597
|
</function>
|
|
22581
22598
|
</tool_call>
|
|
22582
22599
|
(After reviewing existing tests and the file content)
|
|
22600
|
+
I'll check whether the intended test file already exists.
|
|
22601
|
+
<tool_call>
|
|
22602
|
+
<function=${ToolNames.READ_FILE}>
|
|
22603
|
+
<parameter=file_path>
|
|
22604
|
+
/path/to/someFile.test.ts
|
|
22605
|
+
</parameter>
|
|
22606
|
+
</function>
|
|
22607
|
+
</tool_call>
|
|
22608
|
+
(After read_file reports that /path/to/someFile.test.ts does not exist)
|
|
22583
22609
|
<tool_call>
|
|
22584
22610
|
<function=${ToolNames.WRITE_FILE}>
|
|
22585
22611
|
<parameter=file_path>
|
|
@@ -22693,6 +22719,11 @@ Now I'll look for existing or related test files to understand current testing c
|
|
|
22693
22719
|
{"name": "${ToolNames.READ_FILE}", "arguments": {"file_path": "/path/to/existingTest.test.ts"}}
|
|
22694
22720
|
</tool_call>
|
|
22695
22721
|
(After reviewing existing tests and the file content)
|
|
22722
|
+
I'll check whether the intended test file already exists.
|
|
22723
|
+
<tool_call>
|
|
22724
|
+
{"name": "${ToolNames.READ_FILE}", "arguments": {"file_path": "/path/to/someFile.test.ts"}}
|
|
22725
|
+
</tool_call>
|
|
22726
|
+
(After read_file reports that /path/to/someFile.test.ts does not exist)
|
|
22696
22727
|
<tool_call>
|
|
22697
22728
|
{"name": "${ToolNames.WRITE_FILE}", "arguments": {"file_path": "/path/to/someFile.test.ts", "content": "(test code content)"}}
|
|
22698
22729
|
</tool_call>
|
|
@@ -22774,6 +22805,9 @@ Okay, I can write those tests. First, I'll read someFile.ts to understand its fu
|
|
|
22774
22805
|
Now I'll look for existing or related test files to understand current testing conventions and dependencies.
|
|
22775
22806
|
<|tool_call>call:${ToolNames.READ_FILE}{file_path:<|"|>/path/to/existingTest.test.ts<|"|>}<tool_call|>
|
|
22776
22807
|
(After reviewing existing tests and the file content)
|
|
22808
|
+
I'll check whether the intended test file already exists.
|
|
22809
|
+
<|tool_call>call:${ToolNames.READ_FILE}{file_path:<|"|>/path/to/someFile.test.ts<|"|>}<tool_call|>
|
|
22810
|
+
(After read_file reports that /path/to/someFile.test.ts does not exist)
|
|
22777
22811
|
<|tool_call>call:${ToolNames.WRITE_FILE}{file_path:<|"|>/path/to/someFile.test.ts<|"|>,content:<|"|>(test code content)<|"|>}<tool_call|>
|
|
22778
22812
|
I've written the tests. Now I'll run the project's test command to verify them.
|
|
22779
22813
|
<|tool_call>call:${ToolNames.SHELL}{command:<|"|>npm run test<|"|>}<tool_call|>
|
|
@@ -35090,7 +35124,8 @@ function createDuplicateProviderToolCallResponse(request) {
|
|
|
35090
35124
|
],
|
|
35091
35125
|
resultDisplay: message,
|
|
35092
35126
|
error: new Error(message),
|
|
35093
|
-
errorType: "execution_failed" /* EXECUTION_FAILED
|
|
35127
|
+
errorType: "execution_failed" /* EXECUTION_FAILED */,
|
|
35128
|
+
executionStatus: "not_started"
|
|
35094
35129
|
};
|
|
35095
35130
|
}
|
|
35096
35131
|
__name(createDuplicateProviderToolCallResponse, "createDuplicateProviderToolCallResponse");
|
|
@@ -74585,16 +74620,6 @@ __name(toReadTextFileResponse, "toReadTextFileResponse");
|
|
|
74585
74620
|
// packages/core/src/tools/priorReadEnforcement.ts
|
|
74586
74621
|
init_esbuild_shims();
|
|
74587
74622
|
import * as fs26 from "node:fs";
|
|
74588
|
-
var StructuredToolError = class extends Error {
|
|
74589
|
-
constructor(message, errorType) {
|
|
74590
|
-
super(message);
|
|
74591
|
-
this.errorType = errorType;
|
|
74592
|
-
}
|
|
74593
|
-
static {
|
|
74594
|
-
__name(this, "StructuredToolError");
|
|
74595
|
-
}
|
|
74596
|
-
name = "StructuredToolError";
|
|
74597
|
-
};
|
|
74598
74623
|
async function checkPriorRead(cache, filePath, verb, options2 = {}) {
|
|
74599
74624
|
let stats;
|
|
74600
74625
|
try {
|
|
@@ -75120,7 +75145,7 @@ var WriteFileTool = class _WriteFileTool extends BaseDeclarativeTool {
|
|
|
75120
75145
|
super(
|
|
75121
75146
|
_WriteFileTool.Name,
|
|
75122
75147
|
ToolDisplayNames.WRITE_FILE,
|
|
75123
|
-
`Writes content to a specified file in the local filesystem. The file_path argument MUST be an absolute path. Always construct it by combining the project root with the file's relative path (e.g. project root '/path/to/project/' + relative 'foo/bar.txt' = '/path/to/project/foo/bar.txt'). If the user provides a relative path, resolve it against the project root first.
|
|
75148
|
+
`Writes content to a specified file in the local filesystem. A request to create or generate a file does not establish that the target path is new. Unless the target's absence or current text contents have already been established in this session, you MUST use the ${ToolNames.READ_FILE} tool first; if the file does not exist, then create it. With prior-read enforcement enabled, blind overwrites are rejected. The file_path argument MUST be an absolute path. Always construct it by combining the project root with the file's relative path (e.g. project root '/path/to/project/' + relative 'foo/bar.txt' = '/path/to/project/foo/bar.txt'). If the user provides a relative path, resolve it against the project root first.
|
|
75124
75149
|
|
|
75125
75150
|
The user has the ability to modify \`content\`. If modified, this will be stated in the response.`,
|
|
75126
75151
|
"edit" /* Edit */,
|
|
@@ -130612,18 +130637,6 @@ function extractTextFromPartListUnion(c) {
|
|
|
130612
130637
|
return "";
|
|
130613
130638
|
}
|
|
130614
130639
|
__name(extractTextFromPartListUnion, "extractTextFromPartListUnion");
|
|
130615
|
-
var TOOL_FAILURE_KIND_ATTRIBUTE = "tool.failure_kind";
|
|
130616
|
-
var TOOL_FAILURE_KIND_PRE_HOOK_BLOCKED = "pre_hook_blocked";
|
|
130617
|
-
var TOOL_FAILURE_KIND_INVOCATION_GUARD_DENIED = "invocation_guard_denied";
|
|
130618
|
-
var TOOL_FAILURE_KIND_POST_HOOK_STOPPED = "post_hook_stopped";
|
|
130619
|
-
var TOOL_FAILURE_KIND_TOOL_ERROR = "tool_error";
|
|
130620
|
-
var TOOL_FAILURE_KIND_TOOL_EXCEPTION = "tool_exception";
|
|
130621
|
-
var TOOL_FAILURE_KIND_CANCELLED = "cancelled";
|
|
130622
|
-
var TOOL_FAILURE_KIND_PERMISSION_DENIED = "permission_denied";
|
|
130623
|
-
var TOOL_FAILURE_KIND_PERMISSION_HOOK_DENIED = "permission_hook_denied";
|
|
130624
|
-
var TOOL_FAILURE_KIND_PLAN_MODE_BLOCKED = "plan_mode_blocked";
|
|
130625
|
-
var TOOL_FAILURE_KIND_NON_INTERACTIVE_DENIED = "non_interactive_denied";
|
|
130626
|
-
var TOOL_FAILURE_KIND_BACKGROUND_AGENT_DENIED = "background_agent_denied";
|
|
130627
130640
|
var TOOL_SPAN_STATUS_PRE_HOOK_BLOCKED = "Tool execution blocked by hook";
|
|
130628
130641
|
var TOOL_SPAN_STATUS_INVOCATION_GUARD_DENIED = "Tool execution blocked by host policy";
|
|
130629
130642
|
var TOOL_SPAN_STATUS_POST_HOOK_STOPPED = "Tool execution stopped by hook";
|
|
@@ -130635,8 +130648,9 @@ var TOOL_SPAN_STATUS_BACKGROUND_AGENT_DENIED = "Background agent cannot prompt f
|
|
|
130635
130648
|
var TOOL_SPAN_STATUS_TOOL_ERROR = "Tool execution failed";
|
|
130636
130649
|
var TOOL_SPAN_STATUS_TOOL_EXCEPTION = "Tool execution failed with exception";
|
|
130637
130650
|
var TOOL_SPAN_STATUS_TOOL_CANCELLED = "Tool execution cancelled by user";
|
|
130638
|
-
var TOOL_FAILURE_KIND_TIMEOUT = "timeout";
|
|
130639
130651
|
var TOOL_SPAN_STATUS_TOOL_TIMEOUT = "Tool execution timed out";
|
|
130652
|
+
var TOOL_CANCELLED_BEFORE_COMPLETION_MESSAGE = "User cancelled tool execution.";
|
|
130653
|
+
var TOOL_CANCELLED_AFTER_COMPLETION_MESSAGE = "The tool had already completed; its output was discarded.";
|
|
130640
130654
|
function createToolTimeoutResult(timeoutMs) {
|
|
130641
130655
|
const display = timeoutMs >= 1e3 ? `${Math.round(timeoutMs / 1e3)}s` : `${timeoutMs}ms`;
|
|
130642
130656
|
const message = `Tool execution timed out after ${display}. The tool may be stuck or operating on too large a scope.`;
|
|
@@ -130914,7 +130928,7 @@ __name(toParts2, "toParts");
|
|
|
130914
130928
|
var VALIDATION_RETRY_LOOP_THRESHOLD = 3;
|
|
130915
130929
|
var RETRY_LOOP_STOP_DIRECTIVE = "\n\n\u26A0 RETRY LOOP DETECTED: This tool call has failed validation multiple times with the same error. STOP retrying the same approach. Re-examine the tool schema and parameter requirements, then try a fundamentally different approach. If you cannot resolve the validation error, explain the issue to the user instead of retrying.";
|
|
130916
130930
|
var TRUNCATION_RETRY_LOOP_DIRECTIVE = "\n\n\u26A0 RETRY LOOP DETECTED: The same truncated file write has been rejected multiple times. STOP resending the same large content. Either split it into smaller write_file + incremental edit calls, or explain to the user that the content is too large to write safely in one call.";
|
|
130917
|
-
var createErrorResponse = /* @__PURE__ */ __name((request, error, errorType, artifacts, resultDisplay) => ({
|
|
130931
|
+
var createErrorResponse = /* @__PURE__ */ __name((request, error, errorType, executionStatus, artifacts, resultDisplay) => ({
|
|
130918
130932
|
callId: request.callId,
|
|
130919
130933
|
error,
|
|
130920
130934
|
responseParts: [
|
|
@@ -130928,10 +130942,11 @@ var createErrorResponse = /* @__PURE__ */ __name((request, error, errorType, art
|
|
|
130928
130942
|
],
|
|
130929
130943
|
resultDisplay: resultDisplay ?? error.message,
|
|
130930
130944
|
errorType,
|
|
130945
|
+
executionStatus,
|
|
130931
130946
|
contentLength: error.message.length,
|
|
130932
130947
|
...artifacts && artifacts.length > 0 ? { artifacts } : {}
|
|
130933
130948
|
}), "createErrorResponse");
|
|
130934
|
-
var createCancelledResponse = /* @__PURE__ */ __name((request, reason, artifacts) => {
|
|
130949
|
+
var createCancelledResponse = /* @__PURE__ */ __name((request, reason, executionStatus, artifacts, persistedOutputFiles, visionBridgeNotice) => {
|
|
130935
130950
|
const errorMessage = `[Operation Cancelled] Reason: ${reason}`;
|
|
130936
130951
|
return {
|
|
130937
130952
|
callId: request.callId,
|
|
@@ -130947,8 +130962,11 @@ var createCancelledResponse = /* @__PURE__ */ __name((request, reason, artifacts
|
|
|
130947
130962
|
resultDisplay: void 0,
|
|
130948
130963
|
error: void 0,
|
|
130949
130964
|
errorType: void 0,
|
|
130965
|
+
executionStatus,
|
|
130950
130966
|
contentLength: errorMessage.length,
|
|
130951
|
-
...artifacts && artifacts.length > 0 ? { artifacts } : {}
|
|
130967
|
+
...artifacts && artifacts.length > 0 ? { artifacts } : {},
|
|
130968
|
+
...persistedOutputFiles !== void 0 ? { persistedOutputFiles } : {},
|
|
130969
|
+
...visionBridgeNotice !== void 0 ? { visionBridgeNotice } : {}
|
|
130952
130970
|
};
|
|
130953
130971
|
}, "createCancelledResponse");
|
|
130954
130972
|
function isToolCallResponseInfo(value) {
|
|
@@ -130965,6 +130983,7 @@ function serializeToolResponse(response) {
|
|
|
130965
130983
|
result_display: response.resultDisplay,
|
|
130966
130984
|
error: response.error?.message,
|
|
130967
130985
|
error_type: response.errorType,
|
|
130986
|
+
execution_status: response.executionStatus,
|
|
130968
130987
|
content_length: response.contentLength,
|
|
130969
130988
|
...response.visionBridgeNotice !== void 0 ? { vision_bridge_notice: response.visionBridgeNotice } : {}
|
|
130970
130989
|
};
|
|
@@ -131097,15 +131116,19 @@ function withPostToolBatchStop(completedCalls, stopReason) {
|
|
|
131097
131116
|
}
|
|
131098
131117
|
const calls = [...completedCalls];
|
|
131099
131118
|
const lastCall = calls[calls.length - 1];
|
|
131119
|
+
const executionStatus = lastCall.response.executionStatus;
|
|
131120
|
+
const { executionStatus: _es, ...baseResponse } = createErrorResponse(
|
|
131121
|
+
lastCall.request,
|
|
131122
|
+
new Error(stopReason),
|
|
131123
|
+
"execution_denied" /* EXECUTION_DENIED */,
|
|
131124
|
+
executionStatus ?? "not_started"
|
|
131125
|
+
);
|
|
131126
|
+
const response = executionStatus !== void 0 ? { ...baseResponse, executionStatus } : baseResponse;
|
|
131100
131127
|
calls[calls.length - 1] = {
|
|
131101
131128
|
status: "error",
|
|
131102
131129
|
request: lastCall.request,
|
|
131103
131130
|
tool: lastCall.tool,
|
|
131104
|
-
response
|
|
131105
|
-
lastCall.request,
|
|
131106
|
-
new Error(stopReason),
|
|
131107
|
-
"execution_denied" /* EXECUTION_DENIED */
|
|
131108
|
-
),
|
|
131131
|
+
response,
|
|
131109
131132
|
durationMs: lastCall.durationMs,
|
|
131110
131133
|
outcome: void 0
|
|
131111
131134
|
};
|
|
@@ -131167,6 +131190,9 @@ var CoreToolScheduler = class {
|
|
|
131167
131190
|
chatRecordingService;
|
|
131168
131191
|
onToolResultFullTurnModel;
|
|
131169
131192
|
isFinalizingToolCalls = false;
|
|
131193
|
+
postToolBatchEnabledForBatch = false;
|
|
131194
|
+
postToolBatchSpanCallId;
|
|
131195
|
+
postToolBatchConfigWarned = false;
|
|
131170
131196
|
isScheduling = false;
|
|
131171
131197
|
validationRetryCounts = /* @__PURE__ */ new Map();
|
|
131172
131198
|
autoModeFallbackCallIds = /* @__PURE__ */ new Set();
|
|
@@ -131249,7 +131275,7 @@ var CoreToolScheduler = class {
|
|
|
131249
131275
|
...notices.length > 0 ? { visionBridgeNotice: notices.join("\n") } : {}
|
|
131250
131276
|
};
|
|
131251
131277
|
}
|
|
131252
|
-
setStatusInternal(targetCallId, newStatus, auxiliaryData) {
|
|
131278
|
+
setStatusInternal(targetCallId, newStatus, auxiliaryData, executionStatus) {
|
|
131253
131279
|
this.toolCalls = this.toolCalls.map((currentCall) => {
|
|
131254
131280
|
if (currentCall.request.callId !== targetCallId || currentCall.status === "success" || currentCall.status === "error" || currentCall.status === "cancelled") {
|
|
131255
131281
|
return currentCall;
|
|
@@ -131330,8 +131356,11 @@ var CoreToolScheduler = class {
|
|
|
131330
131356
|
}
|
|
131331
131357
|
const preservedResultDisplay = this.compactResultDisplayForInteractiveHistory(resultDisplay);
|
|
131332
131358
|
const errorMessage = `[Operation Cancelled] Reason: ${auxiliaryData}`;
|
|
131333
|
-
const response = isToolCallResponseInfo(
|
|
131359
|
+
const response = isToolCallResponseInfo(
|
|
131360
|
+
auxiliaryData
|
|
131361
|
+
) ? {
|
|
131334
131362
|
...auxiliaryData,
|
|
131363
|
+
executionStatus: auxiliaryData.executionStatus ?? executionStatus ?? "not_started",
|
|
131335
131364
|
resultDisplay: auxiliaryData.resultDisplay ?? preservedResultDisplay
|
|
131336
131365
|
} : {
|
|
131337
131366
|
callId: currentCall.request.callId,
|
|
@@ -131349,6 +131378,7 @@ var CoreToolScheduler = class {
|
|
|
131349
131378
|
resultDisplay: preservedResultDisplay,
|
|
131350
131379
|
error: void 0,
|
|
131351
131380
|
errorType: void 0,
|
|
131381
|
+
executionStatus: executionStatus ?? "not_started",
|
|
131352
131382
|
contentLength: errorMessage.length
|
|
131353
131383
|
};
|
|
131354
131384
|
return {
|
|
@@ -131394,8 +131424,10 @@ var CoreToolScheduler = class {
|
|
|
131394
131424
|
});
|
|
131395
131425
|
}
|
|
131396
131426
|
setArgsInternal(targetCallId, args) {
|
|
131427
|
+
let invocationError;
|
|
131428
|
+
let argsUpdated = false;
|
|
131397
131429
|
this.toolCalls = this.toolCalls.map((call) => {
|
|
131398
|
-
if (call.request.callId !== targetCallId || call.status === "error") {
|
|
131430
|
+
if (call.request.callId !== targetCallId || call.status === "success" || call.status === "error" || call.status === "cancelled") {
|
|
131399
131431
|
return call;
|
|
131400
131432
|
}
|
|
131401
131433
|
const invocationOrError = runInRequestGoalContext(
|
|
@@ -131408,10 +131440,12 @@ var CoreToolScheduler = class {
|
|
|
131408
131440
|
)
|
|
131409
131441
|
);
|
|
131410
131442
|
if (invocationOrError instanceof Error) {
|
|
131443
|
+
invocationError = invocationOrError;
|
|
131411
131444
|
const response = createErrorResponse(
|
|
131412
131445
|
call.request,
|
|
131413
131446
|
invocationOrError,
|
|
131414
|
-
"invalid_tool_params" /* INVALID_TOOL_PARAMS
|
|
131447
|
+
"invalid_tool_params" /* INVALID_TOOL_PARAMS */,
|
|
131448
|
+
"not_started"
|
|
131415
131449
|
);
|
|
131416
131450
|
return {
|
|
131417
131451
|
request: { ...call.request, args },
|
|
@@ -131420,18 +131454,54 @@ var CoreToolScheduler = class {
|
|
|
131420
131454
|
response
|
|
131421
131455
|
};
|
|
131422
131456
|
}
|
|
131457
|
+
argsUpdated = true;
|
|
131423
131458
|
return {
|
|
131424
131459
|
...call,
|
|
131425
131460
|
request: { ...call.request, args },
|
|
131426
131461
|
invocation: invocationOrError
|
|
131427
131462
|
};
|
|
131428
131463
|
});
|
|
131464
|
+
if (invocationError) {
|
|
131465
|
+
this.finalizeBlockedSpan(targetCallId, "error", "system");
|
|
131466
|
+
const toolSpan = this.toolSpans.get(targetCallId);
|
|
131467
|
+
if (toolSpan) {
|
|
131468
|
+
setToolSpanFailure(
|
|
131469
|
+
toolSpan,
|
|
131470
|
+
TOOL_FAILURE_KIND_TOOL_EXCEPTION,
|
|
131471
|
+
invocationError.message
|
|
131472
|
+
);
|
|
131473
|
+
}
|
|
131474
|
+
this.finalizeToolSpan(targetCallId);
|
|
131475
|
+
this.notifyToolCallsUpdate();
|
|
131476
|
+
void this.checkAndNotifyCompletion().catch((error) => {
|
|
131477
|
+
debugLogger122.warn(
|
|
131478
|
+
`setArgsInternal completion notification failed: ${error instanceof Error ? error.message : String(error)}`
|
|
131479
|
+
);
|
|
131480
|
+
});
|
|
131481
|
+
return false;
|
|
131482
|
+
}
|
|
131483
|
+
return argsUpdated;
|
|
131429
131484
|
}
|
|
131430
131485
|
isRunning() {
|
|
131431
131486
|
return this.isFinalizingToolCalls || this.toolCalls.some(
|
|
131432
131487
|
(call) => call.status === "executing" || call.status === "awaiting_approval"
|
|
131433
131488
|
);
|
|
131434
131489
|
}
|
|
131490
|
+
cancelPreExecutionIfAborted(callId, signal, toolSpan = this.toolSpans.get(callId)) {
|
|
131491
|
+
if (!signal.aborted) return false;
|
|
131492
|
+
this.setStatusInternal(
|
|
131493
|
+
callId,
|
|
131494
|
+
"cancelled",
|
|
131495
|
+
"Tool call cancelled by user.",
|
|
131496
|
+
"not_started"
|
|
131497
|
+
);
|
|
131498
|
+
this.finalizeBlockedSpan(callId, "aborted", "system");
|
|
131499
|
+
if (toolSpan) {
|
|
131500
|
+
setToolSpanCancelled(toolSpan);
|
|
131501
|
+
}
|
|
131502
|
+
this.finalizeToolSpan(callId);
|
|
131503
|
+
return true;
|
|
131504
|
+
}
|
|
131435
131505
|
/**
|
|
131436
131506
|
* End the tool span for `callId` (if any) and remove it from the map.
|
|
131437
131507
|
* Centralizes terminal-state cleanup so every cancel/error/success path
|
|
@@ -131441,10 +131511,12 @@ var CoreToolScheduler = class {
|
|
|
131441
131511
|
* No `metadata` parameter: every caller pre-sets span status via
|
|
131442
131512
|
* `setToolSpan{Failure,Cancelled,Ok}` before this call (#4321 review).
|
|
131443
131513
|
*/
|
|
131444
|
-
finalizeToolSpan(callId) {
|
|
131514
|
+
finalizeToolSpan(callId, force = false) {
|
|
131445
131515
|
this.bouncedAwaitingApproval.delete(callId);
|
|
131446
131516
|
this.bouncedToolUseId.delete(callId);
|
|
131517
|
+
this.autoModeFallbackCallIds.delete(callId);
|
|
131447
131518
|
this.runtimeContentGeneratorViews.delete(callId);
|
|
131519
|
+
if (callId === this.postToolBatchSpanCallId && !force) return;
|
|
131448
131520
|
const span = this.toolSpans.get(callId);
|
|
131449
131521
|
if (!span) return;
|
|
131450
131522
|
this.toolSpans.delete(callId);
|
|
@@ -131521,7 +131593,8 @@ var CoreToolScheduler = class {
|
|
|
131521
131593
|
this.setStatusInternal(
|
|
131522
131594
|
callId,
|
|
131523
131595
|
"cancelled",
|
|
131524
|
-
"Tool call cancelled by user."
|
|
131596
|
+
"Tool call cancelled by user.",
|
|
131597
|
+
"not_started"
|
|
131525
131598
|
);
|
|
131526
131599
|
if (this.blockedSpans.has(callId)) {
|
|
131527
131600
|
this.finalizeBlockedSpan(callId, "aborted", "system");
|
|
@@ -131529,7 +131602,7 @@ var CoreToolScheduler = class {
|
|
|
131529
131602
|
const span = this.toolSpans.get(callId);
|
|
131530
131603
|
if (span) {
|
|
131531
131604
|
setToolSpanCancelled(span);
|
|
131532
|
-
this.finalizeToolSpan(callId);
|
|
131605
|
+
this.finalizeToolSpan(callId, true);
|
|
131533
131606
|
}
|
|
131534
131607
|
this.callIdToPostToolBatchSignal.delete(callId);
|
|
131535
131608
|
this.autoModeFallbackCallIds.delete(callId);
|
|
@@ -131729,6 +131802,13 @@ var CoreToolScheduler = class {
|
|
|
131729
131802
|
}
|
|
131730
131803
|
return this._schedule(request, signal, runtimeView);
|
|
131731
131804
|
}
|
|
131805
|
+
drainRequestQueueIfIdle() {
|
|
131806
|
+
if (this.requestQueue.length === 0 || this.isScheduling || this.isRunning()) {
|
|
131807
|
+
return;
|
|
131808
|
+
}
|
|
131809
|
+
const next = this.requestQueue.shift();
|
|
131810
|
+
this._schedule(next.request, next.signal, next.runtimeView).then(next.resolve).catch(next.reject);
|
|
131811
|
+
}
|
|
131732
131812
|
/**
|
|
131733
131813
|
* Removes all validation retry counters for the given tool. Keys are
|
|
131734
131814
|
* "<toolName>:<errorMessage>", so a plain `Map.delete(toolName)` would not
|
|
@@ -131820,147 +131900,220 @@ var CoreToolScheduler = class {
|
|
|
131820
131900
|
return count;
|
|
131821
131901
|
}, "recordBatchRetryableToolError");
|
|
131822
131902
|
for (const [requestIndex, reqInfo] of requestsToProcess.entries()) {
|
|
131823
|
-
|
|
131903
|
+
let resolvedTool;
|
|
131904
|
+
let resolvedInvocation;
|
|
131905
|
+
const recordPrevalidationCancellation = /* @__PURE__ */ __name(() => {
|
|
131906
|
+
if (!signal.aborted) return false;
|
|
131824
131907
|
newToolCalls.push({
|
|
131825
|
-
status: "
|
|
131826
|
-
request: reqInfo,
|
|
131827
|
-
response: createErrorResponse(
|
|
131828
|
-
reqInfo,
|
|
131829
|
-
new Error(PLAN_MODE_ENTRY_SIBLING_SKIP_MESSAGE),
|
|
131830
|
-
"execution_denied" /* EXECUTION_DENIED */
|
|
131831
|
-
),
|
|
131832
|
-
durationMs: 0
|
|
131833
|
-
});
|
|
131834
|
-
continue;
|
|
131835
|
-
}
|
|
131836
|
-
const canonicalName = canonicalToolName2(reqInfo.name);
|
|
131837
|
-
const pm = this.config.getPermissionManager?.();
|
|
131838
|
-
if (pm && !await pm.isToolEnabled(canonicalName)) {
|
|
131839
|
-
const matchingRule = pm.findMatchingDenyRule({
|
|
131840
|
-
toolName: canonicalName
|
|
131841
|
-
});
|
|
131842
|
-
const ruleInfo = matchingRule ? ` Matching deny rule: "${matchingRule}".` : "";
|
|
131843
|
-
const permissionErrorMessage = `Qwen Code requires permission to use "${reqInfo.name}", but that permission was declined.${ruleInfo}`;
|
|
131844
|
-
newToolCalls.push({
|
|
131845
|
-
status: "error",
|
|
131908
|
+
status: "cancelled",
|
|
131846
131909
|
request: reqInfo,
|
|
131847
|
-
response:
|
|
131910
|
+
response: createCancelledResponse(
|
|
131848
131911
|
reqInfo,
|
|
131849
|
-
|
|
131850
|
-
"
|
|
131912
|
+
"Tool call cancelled before execution.",
|
|
131913
|
+
"not_started"
|
|
131851
131914
|
),
|
|
131915
|
+
...resolvedTool ? { tool: resolvedTool } : {},
|
|
131916
|
+
...resolvedInvocation ? { invocation: resolvedInvocation } : {},
|
|
131852
131917
|
durationMs: 0
|
|
131853
131918
|
});
|
|
131854
|
-
|
|
131855
|
-
}
|
|
131856
|
-
|
|
131857
|
-
|
|
131858
|
-
if (
|
|
131859
|
-
|
|
131860
|
-
|
|
131861
|
-
|
|
131862
|
-
|
|
131863
|
-
|
|
131864
|
-
|
|
131865
|
-
|
|
131866
|
-
|
|
131867
|
-
|
|
131868
|
-
|
|
131869
|
-
|
|
131870
|
-
|
|
131871
|
-
|
|
131872
|
-
|
|
131873
|
-
|
|
131874
|
-
|
|
131875
|
-
|
|
131919
|
+
return true;
|
|
131920
|
+
}, "recordPrevalidationCancellation");
|
|
131921
|
+
try {
|
|
131922
|
+
if (recordPrevalidationCancellation()) continue;
|
|
131923
|
+
if (planModeEntryBoundaryIndex !== void 0 && requestIndex !== planModeEntryBoundaryIndex) {
|
|
131924
|
+
newToolCalls.push({
|
|
131925
|
+
status: "error",
|
|
131926
|
+
request: reqInfo,
|
|
131927
|
+
response: createErrorResponse(
|
|
131928
|
+
reqInfo,
|
|
131929
|
+
new Error(PLAN_MODE_ENTRY_SIBLING_SKIP_MESSAGE),
|
|
131930
|
+
"execution_denied" /* EXECUTION_DENIED */,
|
|
131931
|
+
"not_started"
|
|
131932
|
+
),
|
|
131933
|
+
durationMs: 0
|
|
131934
|
+
});
|
|
131935
|
+
continue;
|
|
131936
|
+
}
|
|
131937
|
+
const canonicalName = canonicalToolName2(reqInfo.name);
|
|
131938
|
+
const pm = this.config.getPermissionManager?.();
|
|
131939
|
+
const permissionEnabled = pm ? await pm.isToolEnabled(canonicalName) : true;
|
|
131940
|
+
if (recordPrevalidationCancellation()) continue;
|
|
131941
|
+
if (pm && !permissionEnabled) {
|
|
131942
|
+
const matchingRule = pm.findMatchingDenyRule({
|
|
131943
|
+
toolName: canonicalName
|
|
131944
|
+
});
|
|
131945
|
+
const ruleInfo = matchingRule ? ` Matching deny rule: "${matchingRule}".` : "";
|
|
131946
|
+
const permissionErrorMessage = `Qwen Code requires permission to use "${reqInfo.name}", but that permission was declined.${ruleInfo}`;
|
|
131947
|
+
newToolCalls.push({
|
|
131948
|
+
status: "error",
|
|
131949
|
+
request: reqInfo,
|
|
131950
|
+
response: createErrorResponse(
|
|
131951
|
+
reqInfo,
|
|
131952
|
+
new Error(permissionErrorMessage),
|
|
131953
|
+
"execution_denied" /* EXECUTION_DENIED */,
|
|
131954
|
+
"not_started"
|
|
131955
|
+
),
|
|
131956
|
+
durationMs: 0
|
|
131957
|
+
});
|
|
131958
|
+
continue;
|
|
131959
|
+
}
|
|
131960
|
+
if (!pm) {
|
|
131961
|
+
const excludeTools = this.config.getPermissionsDeny?.() ?? void 0;
|
|
131962
|
+
if (excludeTools && excludeTools.length > 0) {
|
|
131963
|
+
const normalizedToolName = canonicalName.toLowerCase().trim();
|
|
131964
|
+
const excludedMatch = excludeTools.find(
|
|
131965
|
+
(excludedTool) => excludedTool.toLowerCase().trim() === normalizedToolName
|
|
131966
|
+
);
|
|
131967
|
+
if (excludedMatch) {
|
|
131968
|
+
const permissionErrorMessage = `Qwen Code requires permission to use ${excludedMatch}, but that permission was declined.`;
|
|
131969
|
+
newToolCalls.push({
|
|
131970
|
+
status: "error",
|
|
131971
|
+
request: reqInfo,
|
|
131972
|
+
response: createErrorResponse(
|
|
131973
|
+
reqInfo,
|
|
131974
|
+
new Error(permissionErrorMessage),
|
|
131975
|
+
"execution_denied" /* EXECUTION_DENIED */,
|
|
131976
|
+
"not_started"
|
|
131977
|
+
),
|
|
131978
|
+
durationMs: 0
|
|
131979
|
+
});
|
|
131980
|
+
continue;
|
|
131981
|
+
}
|
|
131876
131982
|
}
|
|
131877
131983
|
}
|
|
131878
|
-
|
|
131879
|
-
const toolInstance = await runInRequestGoalContext(
|
|
131880
|
-
reqInfo,
|
|
131881
|
-
() => this.toolRegistry.ensureTool(canonicalName)
|
|
131882
|
-
);
|
|
131883
|
-
if (!toolInstance) {
|
|
131884
|
-
const errorMessage = await runInRequestGoalContext(
|
|
131984
|
+
const toolInstance = await runInRequestGoalContext(
|
|
131885
131985
|
reqInfo,
|
|
131886
|
-
() => this.
|
|
131986
|
+
() => this.toolRegistry.ensureTool(canonicalName)
|
|
131887
131987
|
);
|
|
131888
|
-
|
|
131889
|
-
|
|
131890
|
-
|
|
131891
|
-
|
|
131988
|
+
resolvedTool = toolInstance;
|
|
131989
|
+
if (recordPrevalidationCancellation()) continue;
|
|
131990
|
+
if (!toolInstance) {
|
|
131991
|
+
const errorMessage = await runInRequestGoalContext(
|
|
131892
131992
|
reqInfo,
|
|
131893
|
-
|
|
131894
|
-
|
|
131895
|
-
)
|
|
131896
|
-
|
|
131897
|
-
|
|
131898
|
-
|
|
131899
|
-
|
|
131900
|
-
|
|
131901
|
-
|
|
131902
|
-
|
|
131903
|
-
|
|
131904
|
-
|
|
131905
|
-
|
|
131906
|
-
|
|
131993
|
+
() => this.getToolNotFoundMessage(reqInfo.name)
|
|
131994
|
+
);
|
|
131995
|
+
if (recordPrevalidationCancellation()) continue;
|
|
131996
|
+
newToolCalls.push({
|
|
131997
|
+
status: "error",
|
|
131998
|
+
request: reqInfo,
|
|
131999
|
+
response: createErrorResponse(
|
|
132000
|
+
reqInfo,
|
|
132001
|
+
new Error(errorMessage),
|
|
132002
|
+
"tool_not_registered" /* TOOL_NOT_REGISTERED */,
|
|
132003
|
+
"not_started"
|
|
132004
|
+
),
|
|
132005
|
+
durationMs: 0
|
|
132006
|
+
});
|
|
132007
|
+
continue;
|
|
132008
|
+
}
|
|
132009
|
+
if (reqInfo.wasOutputTruncated && toolInstance.kind === "edit" /* Edit */) {
|
|
132010
|
+
const count = recordBatchRetryableToolError(
|
|
132011
|
+
reqInfo.name,
|
|
132012
|
+
TRUNCATION_EDIT_REJECTION
|
|
132013
|
+
);
|
|
132014
|
+
const truncationError = new Error(
|
|
132015
|
+
count >= VALIDATION_RETRY_LOOP_THRESHOLD ? `${TRUNCATION_EDIT_REJECTION}${TRUNCATION_RETRY_LOOP_DIRECTIVE}` : TRUNCATION_EDIT_REJECTION
|
|
132016
|
+
);
|
|
132017
|
+
newToolCalls.push({
|
|
132018
|
+
status: "error",
|
|
132019
|
+
request: reqInfo,
|
|
132020
|
+
tool: toolInstance,
|
|
132021
|
+
response: createErrorResponse(
|
|
132022
|
+
reqInfo,
|
|
132023
|
+
truncationError,
|
|
132024
|
+
"output_truncated" /* OUTPUT_TRUNCATED */,
|
|
132025
|
+
"not_started"
|
|
132026
|
+
),
|
|
132027
|
+
durationMs: 0
|
|
132028
|
+
});
|
|
132029
|
+
continue;
|
|
132030
|
+
}
|
|
132031
|
+
const invocationOrError = runInRequestGoalContext(
|
|
132032
|
+
reqInfo,
|
|
132033
|
+
() => this.buildInvocation(
|
|
132034
|
+
toolInstance,
|
|
132035
|
+
reqInfo.args,
|
|
132036
|
+
reqInfo.callId,
|
|
132037
|
+
reqInfo.prompt_id
|
|
132038
|
+
)
|
|
131907
132039
|
);
|
|
132040
|
+
if (recordPrevalidationCancellation()) continue;
|
|
132041
|
+
if (invocationOrError instanceof Error) {
|
|
132042
|
+
const displayError = reqInfo.wasOutputTruncated ? new Error(
|
|
132043
|
+
`${invocationOrError.message} ${TRUNCATION_PARAM_GUIDANCE}`
|
|
132044
|
+
) : invocationOrError;
|
|
132045
|
+
const count = recordBatchRetryableToolError(
|
|
132046
|
+
reqInfo.name,
|
|
132047
|
+
invocationOrError.message
|
|
132048
|
+
);
|
|
132049
|
+
const finalError = count >= VALIDATION_RETRY_LOOP_THRESHOLD ? new Error(
|
|
132050
|
+
`${invocationOrError.message}${RETRY_LOOP_STOP_DIRECTIVE}`
|
|
132051
|
+
) : displayError;
|
|
132052
|
+
newToolCalls.push({
|
|
132053
|
+
status: "error",
|
|
132054
|
+
request: reqInfo,
|
|
132055
|
+
tool: toolInstance,
|
|
132056
|
+
response: createErrorResponse(
|
|
132057
|
+
reqInfo,
|
|
132058
|
+
finalError,
|
|
132059
|
+
"invalid_tool_params" /* INVALID_TOOL_PARAMS */,
|
|
132060
|
+
"not_started"
|
|
132061
|
+
),
|
|
132062
|
+
durationMs: 0
|
|
132063
|
+
});
|
|
132064
|
+
continue;
|
|
132065
|
+
}
|
|
132066
|
+
resolvedInvocation = invocationOrError;
|
|
132067
|
+
this.clearRetryCountsForTool(reqInfo.name);
|
|
131908
132068
|
newToolCalls.push({
|
|
131909
|
-
status: "
|
|
132069
|
+
status: "validating",
|
|
131910
132070
|
request: reqInfo,
|
|
131911
132071
|
tool: toolInstance,
|
|
131912
|
-
|
|
131913
|
-
|
|
131914
|
-
truncationError,
|
|
131915
|
-
"output_truncated" /* OUTPUT_TRUNCATED */
|
|
131916
|
-
),
|
|
131917
|
-
durationMs: 0
|
|
132072
|
+
invocation: invocationOrError,
|
|
132073
|
+
startTime: Date.now()
|
|
131918
132074
|
});
|
|
131919
|
-
|
|
131920
|
-
|
|
131921
|
-
|
|
131922
|
-
reqInfo,
|
|
131923
|
-
() => this.buildInvocation(
|
|
131924
|
-
toolInstance,
|
|
131925
|
-
reqInfo.args,
|
|
131926
|
-
reqInfo.callId,
|
|
131927
|
-
reqInfo.prompt_id
|
|
131928
|
-
)
|
|
131929
|
-
);
|
|
131930
|
-
if (invocationOrError instanceof Error) {
|
|
131931
|
-
const displayError = reqInfo.wasOutputTruncated ? new Error(
|
|
131932
|
-
`${invocationOrError.message} ${TRUNCATION_PARAM_GUIDANCE}`
|
|
131933
|
-
) : invocationOrError;
|
|
131934
|
-
const count = recordBatchRetryableToolError(
|
|
131935
|
-
reqInfo.name,
|
|
131936
|
-
invocationOrError.message
|
|
131937
|
-
);
|
|
131938
|
-
const finalError = count >= VALIDATION_RETRY_LOOP_THRESHOLD ? new Error(
|
|
131939
|
-
`${invocationOrError.message}${RETRY_LOOP_STOP_DIRECTIVE}`
|
|
131940
|
-
) : displayError;
|
|
132075
|
+
} catch (error) {
|
|
132076
|
+
if (recordPrevalidationCancellation()) continue;
|
|
132077
|
+
const normalizedError = error instanceof Error ? error : new Error(String(error));
|
|
131941
132078
|
newToolCalls.push({
|
|
131942
132079
|
status: "error",
|
|
131943
132080
|
request: reqInfo,
|
|
131944
|
-
tool: toolInstance,
|
|
131945
132081
|
response: createErrorResponse(
|
|
131946
132082
|
reqInfo,
|
|
131947
|
-
|
|
131948
|
-
"
|
|
132083
|
+
normalizedError,
|
|
132084
|
+
error?.errorType ?? "unhandled_exception" /* UNHANDLED_EXCEPTION */,
|
|
132085
|
+
"not_started"
|
|
131949
132086
|
),
|
|
132087
|
+
...resolvedTool ? { tool: resolvedTool } : {},
|
|
131950
132088
|
durationMs: 0
|
|
131951
132089
|
});
|
|
131952
|
-
continue;
|
|
131953
132090
|
}
|
|
131954
|
-
this.clearRetryCountsForTool(reqInfo.name);
|
|
131955
|
-
newToolCalls.push({
|
|
131956
|
-
status: "validating",
|
|
131957
|
-
request: reqInfo,
|
|
131958
|
-
tool: toolInstance,
|
|
131959
|
-
invocation: invocationOrError,
|
|
131960
|
-
startTime: Date.now()
|
|
131961
|
-
});
|
|
131962
132091
|
}
|
|
131963
132092
|
this.toolCalls = this.toolCalls.concat(newToolCalls);
|
|
132093
|
+
for (const toolCall of newToolCalls) {
|
|
132094
|
+
this.callIdToPostToolBatchSignal.set(toolCall.request.callId, signal);
|
|
132095
|
+
}
|
|
132096
|
+
const postToolBatchParentCallId = newToolCalls.findLast(
|
|
132097
|
+
(toolCall) => toolCall.status === "validating"
|
|
132098
|
+
)?.request.callId;
|
|
132099
|
+
this.postToolBatchEnabledForBatch = false;
|
|
132100
|
+
this.postToolBatchSpanCallId = void 0;
|
|
132101
|
+
try {
|
|
132102
|
+
this.postToolBatchEnabledForBatch = !this.config.getDisableAllHooks() && (this.config.hasHooksForEvent?.("PostToolBatch") ?? false);
|
|
132103
|
+
if (this.postToolBatchEnabledForBatch) {
|
|
132104
|
+
this.postToolBatchSpanCallId = postToolBatchParentCallId;
|
|
132105
|
+
}
|
|
132106
|
+
} catch (configError) {
|
|
132107
|
+
this.postToolBatchEnabledForBatch = true;
|
|
132108
|
+
this.postToolBatchSpanCallId = postToolBatchParentCallId;
|
|
132109
|
+
if (!this.postToolBatchConfigWarned) {
|
|
132110
|
+
this.postToolBatchConfigWarned = true;
|
|
132111
|
+
debugLogger122.warn(
|
|
132112
|
+
"PostToolBatch hook detection failed; deferring span as a precaution:",
|
|
132113
|
+
configError
|
|
132114
|
+
);
|
|
132115
|
+
}
|
|
132116
|
+
}
|
|
131964
132117
|
this.notifyToolCallsUpdate();
|
|
131965
132118
|
const batchState = {
|
|
131966
132119
|
signal,
|
|
@@ -131988,16 +132141,8 @@ var CoreToolScheduler = class {
|
|
|
131988
132141
|
this.toolSpans.set(reqInfo.callId, toolSpan);
|
|
131989
132142
|
batchState.callIds.add(reqInfo.callId);
|
|
131990
132143
|
this.callIdToBatch.set(reqInfo.callId, batchState);
|
|
131991
|
-
this.callIdToPostToolBatchSignal.set(reqInfo.callId, signal);
|
|
131992
132144
|
try {
|
|
131993
|
-
if (signal
|
|
131994
|
-
this.setStatusInternal(
|
|
131995
|
-
reqInfo.callId,
|
|
131996
|
-
"cancelled",
|
|
131997
|
-
"Tool call cancelled by user."
|
|
131998
|
-
);
|
|
131999
|
-
setToolSpanCancelled(toolSpan);
|
|
132000
|
-
this.finalizeToolSpan(reqInfo.callId);
|
|
132145
|
+
if (this.cancelPreExecutionIfAborted(reqInfo.callId, signal, toolSpan)) {
|
|
132001
132146
|
continue;
|
|
132002
132147
|
}
|
|
132003
132148
|
let toolParams = invocation.params;
|
|
@@ -132010,6 +132155,9 @@ var CoreToolScheduler = class {
|
|
|
132010
132155
|
toolParams
|
|
132011
132156
|
)
|
|
132012
132157
|
);
|
|
132158
|
+
if (this.cancelPreExecutionIfAborted(reqInfo.callId, signal, toolSpan)) {
|
|
132159
|
+
continue;
|
|
132160
|
+
}
|
|
132013
132161
|
const {
|
|
132014
132162
|
defaultPermission,
|
|
132015
132163
|
finalPermission,
|
|
@@ -132054,7 +132202,8 @@ var CoreToolScheduler = class {
|
|
|
132054
132202
|
createErrorResponse(
|
|
132055
132203
|
reqInfo,
|
|
132056
132204
|
new Error(message),
|
|
132057
|
-
"execution_denied" /* EXECUTION_DENIED
|
|
132205
|
+
"execution_denied" /* EXECUTION_DENIED */,
|
|
132206
|
+
"not_started"
|
|
132058
132207
|
)
|
|
132059
132208
|
);
|
|
132060
132209
|
setToolSpanFailure(
|
|
@@ -132072,7 +132221,8 @@ var CoreToolScheduler = class {
|
|
|
132072
132221
|
createErrorResponse(
|
|
132073
132222
|
reqInfo,
|
|
132074
132223
|
new Error(denyMessage ?? `Tool "${reqInfo.name}" is denied.`),
|
|
132075
|
-
"execution_denied" /* EXECUTION_DENIED
|
|
132224
|
+
"execution_denied" /* EXECUTION_DENIED */,
|
|
132225
|
+
"not_started"
|
|
132076
132226
|
)
|
|
132077
132227
|
);
|
|
132078
132228
|
setToolSpanFailure(
|
|
@@ -132105,12 +132255,16 @@ var CoreToolScheduler = class {
|
|
|
132105
132255
|
signal
|
|
132106
132256
|
})
|
|
132107
132257
|
) : { classification: "not-applicable" };
|
|
132258
|
+
if (this.cancelPreExecutionIfAborted(reqInfo.callId, signal, toolSpan)) {
|
|
132259
|
+
continue;
|
|
132260
|
+
}
|
|
132108
132261
|
const rejectPlanShell = /* @__PURE__ */ __name((message) => {
|
|
132109
132262
|
this.setStatusInternal(reqInfo.callId, "error", {
|
|
132110
132263
|
...createErrorResponse(
|
|
132111
132264
|
reqInfo,
|
|
132112
132265
|
new Error(message),
|
|
132113
|
-
"execution_denied" /* EXECUTION_DENIED
|
|
132266
|
+
"execution_denied" /* EXECUTION_DENIED */,
|
|
132267
|
+
"not_started"
|
|
132114
132268
|
),
|
|
132115
132269
|
resultDisplay: message
|
|
132116
132270
|
});
|
|
@@ -132132,6 +132286,9 @@ var CoreToolScheduler = class {
|
|
|
132132
132286
|
signal
|
|
132133
132287
|
})
|
|
132134
132288
|
);
|
|
132289
|
+
if (this.cancelPreExecutionIfAborted(reqInfo.callId, signal, toolSpan)) {
|
|
132290
|
+
continue;
|
|
132291
|
+
}
|
|
132135
132292
|
if (initialPlanShellError) {
|
|
132136
132293
|
rejectPlanShell(initialPlanShellError);
|
|
132137
132294
|
continue;
|
|
@@ -132172,6 +132329,9 @@ var CoreToolScheduler = class {
|
|
|
132172
132329
|
skipClassifierReason: fallback.fallback ? fallback.reason : void 0
|
|
132173
132330
|
})
|
|
132174
132331
|
);
|
|
132332
|
+
if (this.cancelPreExecutionIfAborted(reqInfo.callId, signal, toolSpan)) {
|
|
132333
|
+
continue;
|
|
132334
|
+
}
|
|
132175
132335
|
const outcome = applyAutoModeDecision(
|
|
132176
132336
|
decision,
|
|
132177
132337
|
this.config,
|
|
@@ -132196,6 +132356,9 @@ var CoreToolScheduler = class {
|
|
|
132196
132356
|
);
|
|
132197
132357
|
}
|
|
132198
132358
|
}
|
|
132359
|
+
if (this.cancelPreExecutionIfAborted(reqInfo.callId, signal, toolSpan)) {
|
|
132360
|
+
continue;
|
|
132361
|
+
}
|
|
132199
132362
|
switch (outcome.kind) {
|
|
132200
132363
|
case "approved":
|
|
132201
132364
|
this.setToolCallOutcome(
|
|
@@ -132214,9 +132377,16 @@ var CoreToolScheduler = class {
|
|
|
132214
132377
|
createErrorResponse(
|
|
132215
132378
|
reqInfo,
|
|
132216
132379
|
new Error(outcome.errorMessage),
|
|
132217
|
-
"execution_denied" /* EXECUTION_DENIED
|
|
132380
|
+
"execution_denied" /* EXECUTION_DENIED */,
|
|
132381
|
+
"not_started"
|
|
132218
132382
|
)
|
|
132219
132383
|
);
|
|
132384
|
+
setToolSpanFailure(
|
|
132385
|
+
toolSpan,
|
|
132386
|
+
TOOL_FAILURE_KIND_PERMISSION_DENIED,
|
|
132387
|
+
outcome.errorMessage
|
|
132388
|
+
);
|
|
132389
|
+
this.finalizeToolSpan(reqInfo.callId);
|
|
132220
132390
|
continue;
|
|
132221
132391
|
case "fallback":
|
|
132222
132392
|
if (isDenialFallbackReason(outcome.reason) || outcome.reason === "classifier_unavailable") {
|
|
@@ -132251,6 +132421,9 @@ var CoreToolScheduler = class {
|
|
|
132251
132421
|
reqInfo,
|
|
132252
132422
|
() => invocation.getConfirmationDetails(signal)
|
|
132253
132423
|
);
|
|
132424
|
+
if (this.cancelPreExecutionIfAborted(reqInfo.callId, signal, toolSpan)) {
|
|
132425
|
+
continue;
|
|
132426
|
+
}
|
|
132254
132427
|
if (autoModeFallbackMessage) {
|
|
132255
132428
|
confirmationDetails = decorateClassifierUnavailableConfirmation(
|
|
132256
132429
|
confirmationDetails,
|
|
@@ -132268,6 +132441,13 @@ var CoreToolScheduler = class {
|
|
|
132268
132441
|
signal
|
|
132269
132442
|
})
|
|
132270
132443
|
);
|
|
132444
|
+
if (this.cancelPreExecutionIfAborted(
|
|
132445
|
+
reqInfo.callId,
|
|
132446
|
+
signal,
|
|
132447
|
+
toolSpan
|
|
132448
|
+
)) {
|
|
132449
|
+
continue;
|
|
132450
|
+
}
|
|
132271
132451
|
if (preDisplayPlanShellError) {
|
|
132272
132452
|
rejectPlanShell(preDisplayPlanShellError);
|
|
132273
132453
|
continue;
|
|
@@ -132301,7 +132481,8 @@ var CoreToolScheduler = class {
|
|
|
132301
132481
|
...createErrorResponse(
|
|
132302
132482
|
reqInfo,
|
|
132303
132483
|
planModeError,
|
|
132304
|
-
"execution_denied" /* EXECUTION_DENIED
|
|
132484
|
+
"execution_denied" /* EXECUTION_DENIED */,
|
|
132485
|
+
"not_started"
|
|
132305
132486
|
),
|
|
132306
132487
|
resultDisplay: "Plan mode blocked a non-read-only tool call."
|
|
132307
132488
|
});
|
|
@@ -132334,7 +132515,8 @@ var CoreToolScheduler = class {
|
|
|
132334
132515
|
createErrorResponse(
|
|
132335
132516
|
reqInfo,
|
|
132336
132517
|
new Error(errorMessage),
|
|
132337
|
-
"execution_denied" /* EXECUTION_DENIED
|
|
132518
|
+
"execution_denied" /* EXECUTION_DENIED */,
|
|
132519
|
+
"not_started"
|
|
132338
132520
|
)
|
|
132339
132521
|
);
|
|
132340
132522
|
setToolSpanFailure(
|
|
@@ -132361,6 +132543,13 @@ var CoreToolScheduler = class {
|
|
|
132361
132543
|
signal
|
|
132362
132544
|
)
|
|
132363
132545
|
);
|
|
132546
|
+
if (this.cancelPreExecutionIfAborted(
|
|
132547
|
+
reqInfo.callId,
|
|
132548
|
+
signal,
|
|
132549
|
+
toolSpan
|
|
132550
|
+
)) {
|
|
132551
|
+
continue;
|
|
132552
|
+
}
|
|
132364
132553
|
if (hookResult.hasDecision && (!hookResult.shouldAllow || !requiresUserInteraction)) {
|
|
132365
132554
|
if (hookResult.shouldAllow) {
|
|
132366
132555
|
if (planShellDecision.classification !== "not-applicable") {
|
|
@@ -132376,6 +132565,13 @@ var CoreToolScheduler = class {
|
|
|
132376
132565
|
payload: hookResult.updatedInput ? { updatedInput: hookResult.updatedInput } : void 0
|
|
132377
132566
|
})
|
|
132378
132567
|
);
|
|
132568
|
+
if (this.cancelPreExecutionIfAborted(
|
|
132569
|
+
reqInfo.callId,
|
|
132570
|
+
signal,
|
|
132571
|
+
toolSpan
|
|
132572
|
+
)) {
|
|
132573
|
+
continue;
|
|
132574
|
+
}
|
|
132379
132575
|
if (approval.outcome === "cancel" /* Cancel */) {
|
|
132380
132576
|
await runInRequestGoalContext(
|
|
132381
132577
|
reqInfo,
|
|
@@ -132384,6 +132580,13 @@ var CoreToolScheduler = class {
|
|
|
132384
132580
|
approval.payload
|
|
132385
132581
|
)
|
|
132386
132582
|
);
|
|
132583
|
+
if (this.cancelPreExecutionIfAborted(
|
|
132584
|
+
reqInfo.callId,
|
|
132585
|
+
signal,
|
|
132586
|
+
toolSpan
|
|
132587
|
+
)) {
|
|
132588
|
+
continue;
|
|
132589
|
+
}
|
|
132387
132590
|
rejectPlanShell(
|
|
132388
132591
|
approval.payload?.cancelMessage ?? planShellDecision.noApprovalMessage
|
|
132389
132592
|
);
|
|
@@ -132396,6 +132599,13 @@ var CoreToolScheduler = class {
|
|
|
132396
132599
|
approval.payload
|
|
132397
132600
|
)
|
|
132398
132601
|
);
|
|
132602
|
+
if (this.cancelPreExecutionIfAborted(
|
|
132603
|
+
reqInfo.callId,
|
|
132604
|
+
signal,
|
|
132605
|
+
toolSpan
|
|
132606
|
+
)) {
|
|
132607
|
+
continue;
|
|
132608
|
+
}
|
|
132399
132609
|
this.recordAutoModeFallbackResolution(
|
|
132400
132610
|
reqInfo.callId,
|
|
132401
132611
|
approval.outcome
|
|
@@ -132405,10 +132615,12 @@ var CoreToolScheduler = class {
|
|
|
132405
132615
|
continue;
|
|
132406
132616
|
}
|
|
132407
132617
|
if (hookResult.updatedInput && typeof reqInfo.args === "object") {
|
|
132408
|
-
this.setArgsInternal(
|
|
132618
|
+
if (!this.setArgsInternal(
|
|
132409
132619
|
reqInfo.callId,
|
|
132410
132620
|
hookResult.updatedInput
|
|
132411
|
-
)
|
|
132621
|
+
)) {
|
|
132622
|
+
continue;
|
|
132623
|
+
}
|
|
132412
132624
|
}
|
|
132413
132625
|
await runInRequestGoalContext(
|
|
132414
132626
|
reqInfo,
|
|
@@ -132416,6 +132628,13 @@ var CoreToolScheduler = class {
|
|
|
132416
132628
|
"proceed_once" /* ProceedOnce */
|
|
132417
132629
|
)
|
|
132418
132630
|
);
|
|
132631
|
+
if (this.cancelPreExecutionIfAborted(
|
|
132632
|
+
reqInfo.callId,
|
|
132633
|
+
signal,
|
|
132634
|
+
toolSpan
|
|
132635
|
+
)) {
|
|
132636
|
+
continue;
|
|
132637
|
+
}
|
|
132419
132638
|
this.recordAutoModeFallbackResolution(
|
|
132420
132639
|
reqInfo.callId,
|
|
132421
132640
|
"proceed_once" /* ProceedOnce */
|
|
@@ -132434,6 +132653,13 @@ var CoreToolScheduler = class {
|
|
|
132434
132653
|
cancelPayload
|
|
132435
132654
|
)
|
|
132436
132655
|
);
|
|
132656
|
+
if (this.cancelPreExecutionIfAborted(
|
|
132657
|
+
reqInfo.callId,
|
|
132658
|
+
signal,
|
|
132659
|
+
toolSpan
|
|
132660
|
+
)) {
|
|
132661
|
+
continue;
|
|
132662
|
+
}
|
|
132437
132663
|
this.recordAutoModeFallbackResolution(
|
|
132438
132664
|
reqInfo.callId,
|
|
132439
132665
|
"cancel" /* Cancel */
|
|
@@ -132450,7 +132676,8 @@ var CoreToolScheduler = class {
|
|
|
132450
132676
|
new Error(
|
|
132451
132677
|
hookResult.denyMessage || `Permission denied by hook for "${reqInfo.name}"`
|
|
132452
132678
|
),
|
|
132453
|
-
"execution_denied" /* EXECUTION_DENIED
|
|
132679
|
+
"execution_denied" /* EXECUTION_DENIED */,
|
|
132680
|
+
"not_started"
|
|
132454
132681
|
)
|
|
132455
132682
|
);
|
|
132456
132683
|
setToolSpanFailure(
|
|
@@ -132475,7 +132702,8 @@ var CoreToolScheduler = class {
|
|
|
132475
132702
|
createErrorResponse(
|
|
132476
132703
|
reqInfo,
|
|
132477
132704
|
new Error(errorMessage),
|
|
132478
|
-
"execution_denied" /* EXECUTION_DENIED
|
|
132705
|
+
"execution_denied" /* EXECUTION_DENIED */,
|
|
132706
|
+
"not_started"
|
|
132479
132707
|
)
|
|
132480
132708
|
);
|
|
132481
132709
|
setToolSpanFailure(
|
|
@@ -132486,14 +132714,7 @@ var CoreToolScheduler = class {
|
|
|
132486
132714
|
this.finalizeToolSpan(reqInfo.callId);
|
|
132487
132715
|
continue;
|
|
132488
132716
|
}
|
|
132489
|
-
if (signal
|
|
132490
|
-
this.setStatusInternal(
|
|
132491
|
-
reqInfo.callId,
|
|
132492
|
-
"cancelled",
|
|
132493
|
-
"Tool call cancelled by user."
|
|
132494
|
-
);
|
|
132495
|
-
setToolSpanCancelled(toolSpan);
|
|
132496
|
-
this.finalizeToolSpan(reqInfo.callId);
|
|
132717
|
+
if (this.cancelPreExecutionIfAborted(reqInfo.callId, signal, toolSpan)) {
|
|
132497
132718
|
continue;
|
|
132498
132719
|
}
|
|
132499
132720
|
if (planShellDecision.classification !== "not-applicable") {
|
|
@@ -132507,6 +132728,13 @@ var CoreToolScheduler = class {
|
|
|
132507
132728
|
signal
|
|
132508
132729
|
})
|
|
132509
132730
|
);
|
|
132731
|
+
if (this.cancelPreExecutionIfAborted(
|
|
132732
|
+
reqInfo.callId,
|
|
132733
|
+
signal,
|
|
132734
|
+
toolSpan
|
|
132735
|
+
)) {
|
|
132736
|
+
continue;
|
|
132737
|
+
}
|
|
132510
132738
|
if (finalPreDisplayPlanShellError) {
|
|
132511
132739
|
rejectPlanShell(finalPreDisplayPlanShellError);
|
|
132512
132740
|
continue;
|
|
@@ -132593,7 +132821,8 @@ var CoreToolScheduler = class {
|
|
|
132593
132821
|
this.setStatusInternal(
|
|
132594
132822
|
reqInfo.callId,
|
|
132595
132823
|
"cancelled",
|
|
132596
|
-
"Tool call cancelled by user."
|
|
132824
|
+
"Tool call cancelled by user.",
|
|
132825
|
+
"not_started"
|
|
132597
132826
|
);
|
|
132598
132827
|
this.finalizeBlockedSpan(reqInfo.callId, "aborted", "system");
|
|
132599
132828
|
setToolSpanCancelled(toolSpan);
|
|
@@ -132607,7 +132836,8 @@ var CoreToolScheduler = class {
|
|
|
132607
132836
|
createErrorResponse(
|
|
132608
132837
|
reqInfo,
|
|
132609
132838
|
error instanceof Error ? error : new Error(String(error)),
|
|
132610
|
-
explicitErrorType ?? "unhandled_exception" /* UNHANDLED_EXCEPTION
|
|
132839
|
+
explicitErrorType ?? "unhandled_exception" /* UNHANDLED_EXCEPTION */,
|
|
132840
|
+
"not_started"
|
|
132611
132841
|
)
|
|
132612
132842
|
);
|
|
132613
132843
|
this.finalizeBlockedSpan(reqInfo.callId, "error", "system");
|
|
@@ -132630,6 +132860,7 @@ var CoreToolScheduler = class {
|
|
|
132630
132860
|
}
|
|
132631
132861
|
} finally {
|
|
132632
132862
|
this.isScheduling = false;
|
|
132863
|
+
this.drainRequestQueueIfIdle();
|
|
132633
132864
|
}
|
|
132634
132865
|
}
|
|
132635
132866
|
async handleConfirmationResponse(callId, originalOnConfirm, outcome, signal, payload) {
|
|
@@ -132673,6 +132904,25 @@ var CoreToolScheduler = class {
|
|
|
132673
132904
|
);
|
|
132674
132905
|
} catch (error) {
|
|
132675
132906
|
const aborted = signal.aborted;
|
|
132907
|
+
if (aborted) {
|
|
132908
|
+
this.setStatusInternal(
|
|
132909
|
+
callId,
|
|
132910
|
+
"cancelled",
|
|
132911
|
+
"Tool call cancelled by user.",
|
|
132912
|
+
"not_started"
|
|
132913
|
+
);
|
|
132914
|
+
} else {
|
|
132915
|
+
this.setStatusInternal(
|
|
132916
|
+
callId,
|
|
132917
|
+
"error",
|
|
132918
|
+
createErrorResponse(
|
|
132919
|
+
toolCall.request,
|
|
132920
|
+
error instanceof Error ? error : new Error(String(error)),
|
|
132921
|
+
"unhandled_exception" /* UNHANDLED_EXCEPTION */,
|
|
132922
|
+
"not_started"
|
|
132923
|
+
)
|
|
132924
|
+
);
|
|
132925
|
+
}
|
|
132676
132926
|
this.finalizeBlockedSpan(callId, aborted ? "aborted" : "error", "system");
|
|
132677
132927
|
const toolSpan = this.toolSpans.get(callId);
|
|
132678
132928
|
if (toolSpan) {
|
|
@@ -132716,7 +132966,7 @@ var CoreToolScheduler = class {
|
|
|
132716
132966
|
this.recordAutoModeFallbackResolution(callId, outcome);
|
|
132717
132967
|
if (outcome === "cancel" /* Cancel */ || signal.aborted) {
|
|
132718
132968
|
const cancelMessage = payload?.cancelMessage || "User did not allow tool call";
|
|
132719
|
-
this.setStatusInternal(callId, "cancelled", cancelMessage);
|
|
132969
|
+
this.setStatusInternal(callId, "cancelled", cancelMessage, "not_started");
|
|
132720
132970
|
const toolSpan = this.toolSpans.get(callId);
|
|
132721
132971
|
if (toolSpan) {
|
|
132722
132972
|
setToolSpanCancelled(toolSpan);
|
|
@@ -132771,7 +133021,7 @@ var CoreToolScheduler = class {
|
|
|
132771
133021
|
signal,
|
|
132772
133022
|
this.onEditorClose
|
|
132773
133023
|
);
|
|
132774
|
-
this.setArgsInternal(callId, updatedParams);
|
|
133024
|
+
if (!this.setArgsInternal(callId, updatedParams)) return;
|
|
132775
133025
|
this.setStatusInternal(callId, "awaiting_approval", {
|
|
132776
133026
|
...waitingToolCall.confirmationDetails,
|
|
132777
133027
|
fileDiff: updatedDiff,
|
|
@@ -132780,11 +133030,13 @@ var CoreToolScheduler = class {
|
|
|
132780
133030
|
}
|
|
132781
133031
|
} else {
|
|
132782
133032
|
if (payload?.newContent && toolCall) {
|
|
132783
|
-
await this._applyInlineModify(
|
|
133033
|
+
if (!await this._applyInlineModify(
|
|
132784
133034
|
toolCall,
|
|
132785
133035
|
payload,
|
|
132786
133036
|
signal
|
|
132787
|
-
)
|
|
133037
|
+
)) {
|
|
133038
|
+
return;
|
|
133039
|
+
}
|
|
132788
133040
|
}
|
|
132789
133041
|
this.setStatusInternal(callId, "scheduled");
|
|
132790
133042
|
const decision = outcome === "proceed_once" /* ProceedOnce */ ? "proceed_once" : "proceed_always";
|
|
@@ -132868,7 +133120,7 @@ var CoreToolScheduler = class {
|
|
|
132868
133120
|
async _applyInlineModify(toolCall, payload, signal) {
|
|
132869
133121
|
const confirmDetails = toolCall.confirmationDetails;
|
|
132870
133122
|
if (confirmDetails.type !== "edit" || !isModifiableDeclarativeTool(toolCall.tool) || !payload.newContent) {
|
|
132871
|
-
return;
|
|
133123
|
+
return true;
|
|
132872
133124
|
}
|
|
132873
133125
|
const currentContent = confirmDetails.originalContent ?? "";
|
|
132874
133126
|
const modifyContext = toolCall.tool.getModifyContext(signal);
|
|
@@ -132884,11 +133136,14 @@ var CoreToolScheduler = class {
|
|
|
132884
133136
|
"Current",
|
|
132885
133137
|
"Proposed"
|
|
132886
133138
|
);
|
|
132887
|
-
this.setArgsInternal(toolCall.request.callId, updatedParams)
|
|
133139
|
+
if (!this.setArgsInternal(toolCall.request.callId, updatedParams)) {
|
|
133140
|
+
return false;
|
|
133141
|
+
}
|
|
132888
133142
|
this.setStatusInternal(toolCall.request.callId, "awaiting_approval", {
|
|
132889
133143
|
...confirmDetails,
|
|
132890
133144
|
fileDiff: updatedDiff
|
|
132891
133145
|
});
|
|
133146
|
+
return true;
|
|
132892
133147
|
}
|
|
132893
133148
|
async attemptExecutionOfScheduledCalls(signal) {
|
|
132894
133149
|
while (true) {
|
|
@@ -133002,10 +133257,10 @@ var CoreToolScheduler = class {
|
|
|
133002
133257
|
createErrorResponse(
|
|
133003
133258
|
scheduledCall.request,
|
|
133004
133259
|
error instanceof Error ? error : new Error(errorMessage),
|
|
133005
|
-
"unhandled_exception" /* UNHANDLED_EXCEPTION
|
|
133260
|
+
"unhandled_exception" /* UNHANDLED_EXCEPTION */,
|
|
133261
|
+
this.toolCalls.find((call) => call.request.callId === callId)?.status === "executing" ? "error" : "not_started"
|
|
133006
133262
|
)
|
|
133007
133263
|
);
|
|
133008
|
-
throw error;
|
|
133009
133264
|
} finally {
|
|
133010
133265
|
if (!this.bouncedAwaitingApproval.has(callId)) {
|
|
133011
133266
|
this.finalizeToolSpan(callId);
|
|
@@ -133145,7 +133400,7 @@ var CoreToolScheduler = class {
|
|
|
133145
133400
|
hasAdditionalContext: !!r.additionalContext
|
|
133146
133401
|
}
|
|
133147
133402
|
);
|
|
133148
|
-
if (!preHookResult.shouldProceed) {
|
|
133403
|
+
if (!signal.aborted && !preHookResult.shouldProceed) {
|
|
133149
133404
|
if (preHookResult.blockType === "ask" && !signal.aborted && this.canPromptForAskBounce()) {
|
|
133150
133405
|
this.bouncedToolUseId.set(callId, toolUseId);
|
|
133151
133406
|
this.bounceToAwaitingApprovalForAsk(
|
|
@@ -133160,7 +133415,8 @@ var CoreToolScheduler = class {
|
|
|
133160
133415
|
const errorResponse = createErrorResponse(
|
|
133161
133416
|
scheduledCall.request,
|
|
133162
133417
|
new Error(blockMessage),
|
|
133163
|
-
"execution_denied" /* EXECUTION_DENIED
|
|
133418
|
+
"execution_denied" /* EXECUTION_DENIED */,
|
|
133419
|
+
"not_started"
|
|
133164
133420
|
);
|
|
133165
133421
|
this.setStatusInternal(callId, "error", errorResponse);
|
|
133166
133422
|
setToolSpanFailure(
|
|
@@ -133186,16 +133442,23 @@ var CoreToolScheduler = class {
|
|
|
133186
133442
|
this.setStatusInternal(
|
|
133187
133443
|
callId,
|
|
133188
133444
|
"cancelled",
|
|
133189
|
-
|
|
133445
|
+
createCancelledResponse(
|
|
133446
|
+
scheduledCall.request,
|
|
133447
|
+
"Tool call cancelled before execution.",
|
|
133448
|
+
"not_started"
|
|
133449
|
+
)
|
|
133190
133450
|
);
|
|
133191
|
-
|
|
133451
|
+
if (this.toolSpans.has(callId)) {
|
|
133452
|
+
setToolSpanCancelled(span);
|
|
133453
|
+
}
|
|
133192
133454
|
return;
|
|
133193
133455
|
}
|
|
133194
133456
|
if (!guardDecision.allowed) {
|
|
133195
133457
|
const errorResponse = createErrorResponse(
|
|
133196
133458
|
scheduledCall.request,
|
|
133197
133459
|
new Error(guardDecision.reason),
|
|
133198
|
-
"execution_denied" /* EXECUTION_DENIED
|
|
133460
|
+
"execution_denied" /* EXECUTION_DENIED */,
|
|
133461
|
+
"not_started"
|
|
133199
133462
|
);
|
|
133200
133463
|
this.setStatusInternal(callId, "error", errorResponse);
|
|
133201
133464
|
setToolSpanFailure(
|
|
@@ -133206,7 +133469,26 @@ var CoreToolScheduler = class {
|
|
|
133206
133469
|
return;
|
|
133207
133470
|
}
|
|
133208
133471
|
}
|
|
133209
|
-
|
|
133472
|
+
if (signal.aborted) {
|
|
133473
|
+
const currentCall = this.toolCalls.find(
|
|
133474
|
+
(call) => call.request.callId === callId
|
|
133475
|
+
);
|
|
133476
|
+
if (currentCall && currentCall.status !== "success" && currentCall.status !== "error" && currentCall.status !== "cancelled") {
|
|
133477
|
+
this.setStatusInternal(
|
|
133478
|
+
callId,
|
|
133479
|
+
"cancelled",
|
|
133480
|
+
createCancelledResponse(
|
|
133481
|
+
scheduledCall.request,
|
|
133482
|
+
"Tool call cancelled before execution.",
|
|
133483
|
+
"not_started"
|
|
133484
|
+
)
|
|
133485
|
+
);
|
|
133486
|
+
if (this.toolSpans.has(callId)) {
|
|
133487
|
+
setToolSpanCancelled(span);
|
|
133488
|
+
}
|
|
133489
|
+
}
|
|
133490
|
+
return;
|
|
133491
|
+
}
|
|
133210
133492
|
const liveOutputCallback = scheduledCall.tool.canUpdateOutput ? (outputChunk) => {
|
|
133211
133493
|
if (isShellProgressData(outputChunk)) {
|
|
133212
133494
|
if (this.outputUpdateHandler) {
|
|
@@ -133224,12 +133506,14 @@ var CoreToolScheduler = class {
|
|
|
133224
133506
|
this.notifyToolCallsUpdate();
|
|
133225
133507
|
} : void 0;
|
|
133226
133508
|
const shellExecutionConfig = this.config.getShellExecutionConfig();
|
|
133227
|
-
const execSpan = startToolExecutionSpan();
|
|
133228
133509
|
const sleepInhibitorHandle = acquireSleepInhibitor(
|
|
133229
133510
|
this.config,
|
|
133230
133511
|
`Qwen Code is executing tool ${canonicalName}`
|
|
133231
133512
|
);
|
|
133232
133513
|
let removeParentAbortForward;
|
|
133514
|
+
let executionStatus = "not_started";
|
|
133515
|
+
let executionSettled = false;
|
|
133516
|
+
let execSpan;
|
|
133233
133517
|
try {
|
|
133234
133518
|
let promise;
|
|
133235
133519
|
const toolExecutionTimeoutMs = Math.min(
|
|
@@ -133280,30 +133564,40 @@ var CoreToolScheduler = class {
|
|
|
133280
133564
|
this.safelyAddToolArgumentsAttributes(span, invocation.params);
|
|
133281
133565
|
promise = todoWorkChainContext.run(
|
|
133282
133566
|
todoWorkChainId,
|
|
133283
|
-
() => promptIdContext.run(
|
|
133284
|
-
|
|
133285
|
-
|
|
133567
|
+
() => promptIdContext.run(scheduledCall.request.prompt_id, () => {
|
|
133568
|
+
this.setStatusInternal(callId, "executing");
|
|
133569
|
+
execSpan = startToolExecutionSpan({
|
|
133570
|
+
toolName: canonicalName,
|
|
133571
|
+
callId
|
|
133572
|
+
});
|
|
133573
|
+
executionStatus = "error";
|
|
133574
|
+
return invocation.execute(
|
|
133286
133575
|
execSignal,
|
|
133287
133576
|
liveOutputCallback,
|
|
133288
133577
|
shellExecutionConfig,
|
|
133289
133578
|
setPidCallback,
|
|
133290
133579
|
setPromoteAbortControllerCallback,
|
|
133291
133580
|
canPromoteForegroundShell
|
|
133292
|
-
)
|
|
133293
|
-
)
|
|
133581
|
+
);
|
|
133582
|
+
})
|
|
133294
133583
|
);
|
|
133295
133584
|
} else {
|
|
133296
133585
|
this.safelyAddToolArgumentsAttributes(span, invocation.params);
|
|
133297
133586
|
promise = todoWorkChainContext.run(
|
|
133298
133587
|
todoWorkChainId,
|
|
133299
|
-
() => promptIdContext.run(
|
|
133300
|
-
|
|
133301
|
-
|
|
133588
|
+
() => promptIdContext.run(scheduledCall.request.prompt_id, () => {
|
|
133589
|
+
this.setStatusInternal(callId, "executing");
|
|
133590
|
+
execSpan = startToolExecutionSpan({
|
|
133591
|
+
toolName: canonicalName,
|
|
133592
|
+
callId
|
|
133593
|
+
});
|
|
133594
|
+
executionStatus = "error";
|
|
133595
|
+
return invocation.execute(
|
|
133302
133596
|
execSignal,
|
|
133303
133597
|
liveOutputCallback,
|
|
133304
133598
|
shellExecutionConfig
|
|
133305
|
-
)
|
|
133306
|
-
)
|
|
133599
|
+
);
|
|
133600
|
+
})
|
|
133307
133601
|
);
|
|
133308
133602
|
}
|
|
133309
133603
|
let toolResult;
|
|
@@ -133338,14 +133632,24 @@ var CoreToolScheduler = class {
|
|
|
133338
133632
|
toolResult = await promise;
|
|
133339
133633
|
}
|
|
133340
133634
|
const isTimeout = toolResult.error?.type === "execution_timeout" /* EXECUTION_TIMEOUT */ && (!schedulerTimeoutResultSelected || schedulerTimeoutWon);
|
|
133341
|
-
const
|
|
133342
|
-
|
|
133343
|
-
|
|
133344
|
-
|
|
133345
|
-
|
|
133346
|
-
|
|
133635
|
+
const parentAbortedAtExecutionSettle = signal.aborted;
|
|
133636
|
+
const aborted = parentAbortedAtExecutionSettle && !isTimeout;
|
|
133637
|
+
const executionErrorType = toolResult.error ? toolResult.error.type ?? (scheduledCall.tool instanceof DiscoveredMCPTool ? "mcp_tool_error" /* MCP_TOOL_ERROR */ : "unknown" /* UNKNOWN */) : void 0;
|
|
133638
|
+
executionStatus = aborted ? "cancelled" : toolResult.error ? "error" : "success";
|
|
133639
|
+
executionSettled = true;
|
|
133640
|
+
if (execSpan) {
|
|
133641
|
+
const completedExecSpan = execSpan;
|
|
133642
|
+
execSpan = void 0;
|
|
133643
|
+
endToolExecutionSpan(completedExecSpan, {
|
|
133644
|
+
success: executionStatus === "success",
|
|
133645
|
+
error: aborted ? TOOL_SPAN_STATUS_TOOL_CANCELLED : isTimeout ? TOOL_SPAN_STATUS_TOOL_TIMEOUT : toolResult.error ? TOOL_SPAN_STATUS_TOOL_ERROR : void 0,
|
|
133646
|
+
cancelled: aborted,
|
|
133647
|
+
executionStatus,
|
|
133648
|
+
errorType: executionErrorType
|
|
133649
|
+
});
|
|
133650
|
+
}
|
|
133347
133651
|
if (aborted) {
|
|
133348
|
-
let cancelMessage =
|
|
133652
|
+
let cancelMessage = TOOL_CANCELLED_AFTER_COMPLETION_MESSAGE;
|
|
133349
133653
|
let failureHookArtifacts;
|
|
133350
133654
|
if (hooksEnabled && messageBus) {
|
|
133351
133655
|
const failureHookResult = await this.withHookSpan(
|
|
@@ -133377,15 +133681,37 @@ ${failureHookResult.additionalContext}`;
|
|
|
133377
133681
|
this.setStatusInternal(
|
|
133378
133682
|
callId,
|
|
133379
133683
|
"cancelled",
|
|
133380
|
-
|
|
133684
|
+
createCancelledResponse(
|
|
133381
133685
|
scheduledCall.request,
|
|
133382
133686
|
cancelMessage,
|
|
133383
|
-
|
|
133384
|
-
|
|
133687
|
+
executionStatus,
|
|
133688
|
+
failureHookArtifacts,
|
|
133689
|
+
toolResult.persistedOutputFiles
|
|
133690
|
+
)
|
|
133385
133691
|
);
|
|
133386
133692
|
setToolSpanCancelled(span);
|
|
133387
133693
|
return;
|
|
133388
133694
|
}
|
|
133695
|
+
const cancelAfterPostProcessing = /* @__PURE__ */ __name((artifacts, preserved) => {
|
|
133696
|
+
if (!signal.aborted || isTimeout && parentAbortedAtExecutionSettle) {
|
|
133697
|
+
return false;
|
|
133698
|
+
}
|
|
133699
|
+
this.setStatusInternal(
|
|
133700
|
+
callId,
|
|
133701
|
+
"cancelled",
|
|
133702
|
+
createCancelledResponse(
|
|
133703
|
+
scheduledCall.request,
|
|
133704
|
+
// Reached only after `execute()` settled with a result.
|
|
133705
|
+
TOOL_CANCELLED_AFTER_COMPLETION_MESSAGE,
|
|
133706
|
+
executionStatus,
|
|
133707
|
+
artifacts,
|
|
133708
|
+
preserved?.persistedOutputFiles,
|
|
133709
|
+
preserved?.visionBridgeNotice
|
|
133710
|
+
)
|
|
133711
|
+
);
|
|
133712
|
+
setToolSpanCancelled(span);
|
|
133713
|
+
return true;
|
|
133714
|
+
}, "cancelAfterPostProcessing");
|
|
133389
133715
|
if (toolResult.error === void 0) {
|
|
133390
133716
|
let content = toolResult.llmContent ?? "";
|
|
133391
133717
|
let persistedOutputFiles = toolResult.persistedOutputFiles ? [...toolResult.persistedOutputFiles] : toolResult.persistedOutputFiles;
|
|
@@ -133442,12 +133768,21 @@ ${failureHookResult.additionalContext}`;
|
|
|
133442
133768
|
postToolUseArtifacts = postHookResult.artifacts;
|
|
133443
133769
|
}
|
|
133444
133770
|
if (postHookResult.shouldStop) {
|
|
133771
|
+
if (cancelAfterPostProcessing(postHookResult.artifacts, {
|
|
133772
|
+
persistedOutputFiles
|
|
133773
|
+
})) {
|
|
133774
|
+
return;
|
|
133775
|
+
}
|
|
133445
133776
|
const stopMessage = postHookResult.stopReason || "Execution stopped by hook";
|
|
133446
133777
|
const errorResponse = createErrorResponse(
|
|
133447
133778
|
scheduledCall.request,
|
|
133448
133779
|
new Error(stopMessage),
|
|
133449
|
-
"execution_denied" /* EXECUTION_DENIED
|
|
133780
|
+
"execution_denied" /* EXECUTION_DENIED */,
|
|
133781
|
+
executionStatus
|
|
133450
133782
|
);
|
|
133783
|
+
if (persistedOutputFiles !== void 0) {
|
|
133784
|
+
errorResponse.persistedOutputFiles = persistedOutputFiles;
|
|
133785
|
+
}
|
|
133451
133786
|
this.setStatusInternal(callId, "error", errorResponse);
|
|
133452
133787
|
setToolSpanFailure(
|
|
133453
133788
|
span,
|
|
@@ -133613,6 +133948,7 @@ ${body}
|
|
|
133613
133948
|
),
|
|
133614
133949
|
error: void 0,
|
|
133615
133950
|
errorType: void 0,
|
|
133951
|
+
executionStatus,
|
|
133616
133952
|
contentLength,
|
|
133617
133953
|
...persistedOutputFiles !== void 0 ? { persistedOutputFiles } : {},
|
|
133618
133954
|
// Propagate modelOverride from skill tools. Use `in` to distinguish
|
|
@@ -133644,6 +133980,12 @@ ${body}
|
|
|
133644
133980
|
);
|
|
133645
133981
|
}
|
|
133646
133982
|
}
|
|
133983
|
+
if (cancelAfterPostProcessing(artifacts, {
|
|
133984
|
+
persistedOutputFiles: successResponse.persistedOutputFiles,
|
|
133985
|
+
visionBridgeNotice: successResponse.visionBridgeNotice
|
|
133986
|
+
})) {
|
|
133987
|
+
return;
|
|
133988
|
+
}
|
|
133647
133989
|
this.setStatusInternal(callId, "success", successResponse);
|
|
133648
133990
|
safeSetStatus(span, { code: SpanStatusCode.OK });
|
|
133649
133991
|
try {
|
|
@@ -133732,6 +134074,12 @@ ${failureHookResult.additionalContext}`;
|
|
|
133732
134074
|
...timeoutContent.persistedOutputFiles ?? []
|
|
133733
134075
|
])
|
|
133734
134076
|
);
|
|
134077
|
+
if (cancelAfterPostProcessing(artifacts, {
|
|
134078
|
+
persistedOutputFiles: timeoutPersistedOutputFiles,
|
|
134079
|
+
visionBridgeNotice: processedImages.visionBridgeNotice
|
|
134080
|
+
})) {
|
|
134081
|
+
return;
|
|
134082
|
+
}
|
|
133735
134083
|
this.setStatusInternal(callId, "error", {
|
|
133736
134084
|
callId,
|
|
133737
134085
|
responseParts,
|
|
@@ -133740,6 +134088,7 @@ ${failureHookResult.additionalContext}`;
|
|
|
133740
134088
|
),
|
|
133741
134089
|
error: new Error(operationalErrorMessage),
|
|
133742
134090
|
errorType: "execution_timeout" /* EXECUTION_TIMEOUT */,
|
|
134091
|
+
executionStatus,
|
|
133743
134092
|
contentLength,
|
|
133744
134093
|
...timeoutPersistedOutputFiles !== void 0 ? { persistedOutputFiles: timeoutPersistedOutputFiles } : {},
|
|
133745
134094
|
...processedImages.modelOverride !== void 0 ? { modelOverride: processedImages.modelOverride } : {},
|
|
@@ -133773,7 +134122,8 @@ ${failureHookResult.additionalContext}`;
|
|
|
133773
134122
|
let errorResponse = createErrorResponse(
|
|
133774
134123
|
scheduledCall.request,
|
|
133775
134124
|
error,
|
|
133776
|
-
|
|
134125
|
+
executionErrorType ?? "unknown" /* UNKNOWN */,
|
|
134126
|
+
executionStatus,
|
|
133777
134127
|
failureHookArtifacts,
|
|
133778
134128
|
typeof toolResult.returnDisplay === "string" ? void 0 : this.compactResultDisplayForInteractiveHistory(
|
|
133779
134129
|
toolResult.returnDisplay
|
|
@@ -133821,6 +134171,15 @@ ${failureHookResult.additionalContext}`;
|
|
|
133821
134171
|
};
|
|
133822
134172
|
}
|
|
133823
134173
|
}
|
|
134174
|
+
if (cancelAfterPostProcessing(
|
|
134175
|
+
[...toolResult.artifacts ?? [], ...failureHookArtifacts ?? []],
|
|
134176
|
+
{
|
|
134177
|
+
persistedOutputFiles: errorResponse.persistedOutputFiles,
|
|
134178
|
+
visionBridgeNotice: errorResponse.visionBridgeNotice
|
|
134179
|
+
}
|
|
134180
|
+
)) {
|
|
134181
|
+
return;
|
|
134182
|
+
}
|
|
133824
134183
|
this.setStatusInternal(callId, "error", errorResponse);
|
|
133825
134184
|
setToolSpanFailure(
|
|
133826
134185
|
span,
|
|
@@ -133830,14 +134189,28 @@ ${failureHookResult.additionalContext}`;
|
|
|
133830
134189
|
}
|
|
133831
134190
|
} catch (executionError) {
|
|
133832
134191
|
const errorMessage = executionError instanceof Error ? executionError.message : String(executionError);
|
|
133833
|
-
const
|
|
133834
|
-
|
|
133835
|
-
|
|
133836
|
-
|
|
133837
|
-
|
|
133838
|
-
|
|
134192
|
+
const executionThrew = !executionSettled && executionStatus !== "not_started";
|
|
134193
|
+
const explicitErrorType = executionError?.errorType;
|
|
134194
|
+
const executionTimedOut = executionThrew && explicitErrorType === "execution_timeout" /* EXECUTION_TIMEOUT */;
|
|
134195
|
+
const aborted = signal.aborted && !executionTimedOut;
|
|
134196
|
+
if (executionThrew) {
|
|
134197
|
+
executionStatus = aborted ? "cancelled" : "error";
|
|
134198
|
+
executionSettled = true;
|
|
134199
|
+
}
|
|
134200
|
+
const exceptionErrorType = explicitErrorType ?? (executionThrew && scheduledCall.tool instanceof DiscoveredMCPTool ? "mcp_tool_error" /* MCP_TOOL_ERROR */ : "unhandled_exception" /* UNHANDLED_EXCEPTION */);
|
|
134201
|
+
if (execSpan) {
|
|
134202
|
+
const failedExecSpan = execSpan;
|
|
134203
|
+
execSpan = void 0;
|
|
134204
|
+
endToolExecutionSpan(failedExecSpan, {
|
|
134205
|
+
success: false,
|
|
134206
|
+
error: aborted ? TOOL_SPAN_STATUS_TOOL_CANCELLED : executionTimedOut ? TOOL_SPAN_STATUS_TOOL_TIMEOUT : TOOL_SPAN_STATUS_TOOL_EXCEPTION,
|
|
134207
|
+
cancelled: aborted,
|
|
134208
|
+
executionStatus,
|
|
134209
|
+
errorType: executionStatus === "error" ? exceptionErrorType : void 0
|
|
134210
|
+
});
|
|
134211
|
+
}
|
|
133839
134212
|
if (aborted) {
|
|
133840
|
-
let cancelMessage =
|
|
134213
|
+
let cancelMessage = executionThrew ? TOOL_CANCELLED_BEFORE_COMPLETION_MESSAGE : TOOL_CANCELLED_AFTER_COMPLETION_MESSAGE;
|
|
133841
134214
|
let failureHookArtifacts;
|
|
133842
134215
|
if (hooksEnabled && messageBus) {
|
|
133843
134216
|
const failureHookResult = await this.withHookSpan(
|
|
@@ -133869,11 +134242,12 @@ ${failureHookResult.additionalContext}`;
|
|
|
133869
134242
|
this.setStatusInternal(
|
|
133870
134243
|
callId,
|
|
133871
134244
|
"cancelled",
|
|
133872
|
-
|
|
134245
|
+
createCancelledResponse(
|
|
133873
134246
|
scheduledCall.request,
|
|
133874
134247
|
cancelMessage,
|
|
134248
|
+
executionStatus,
|
|
133875
134249
|
failureHookArtifacts
|
|
133876
|
-
)
|
|
134250
|
+
)
|
|
133877
134251
|
);
|
|
133878
134252
|
setToolSpanCancelled(span);
|
|
133879
134253
|
return;
|
|
@@ -133907,13 +134281,30 @@ ${failureHookResult.additionalContext}`;
|
|
|
133907
134281
|
}
|
|
133908
134282
|
failureHookArtifacts = failureHookResult.artifacts;
|
|
133909
134283
|
}
|
|
134284
|
+
if (signal.aborted && !executionTimedOut) {
|
|
134285
|
+
this.setStatusInternal(
|
|
134286
|
+
callId,
|
|
134287
|
+
"cancelled",
|
|
134288
|
+
createCancelledResponse(
|
|
134289
|
+
scheduledCall.request,
|
|
134290
|
+
// The abort landed while the failure hook was running; the
|
|
134291
|
+
// tool's own outcome is still what `executionThrew` says.
|
|
134292
|
+
executionThrew ? TOOL_CANCELLED_BEFORE_COMPLETION_MESSAGE : TOOL_CANCELLED_AFTER_COMPLETION_MESSAGE,
|
|
134293
|
+
executionStatus,
|
|
134294
|
+
failureHookArtifacts
|
|
134295
|
+
)
|
|
134296
|
+
);
|
|
134297
|
+
setToolSpanCancelled(span);
|
|
134298
|
+
return;
|
|
134299
|
+
}
|
|
133910
134300
|
this.setStatusInternal(
|
|
133911
134301
|
callId,
|
|
133912
134302
|
"error",
|
|
133913
134303
|
createErrorResponse(
|
|
133914
134304
|
scheduledCall.request,
|
|
133915
134305
|
executionError instanceof Error ? new Error(exceptionErrorMessage) : new Error(String(executionError)),
|
|
133916
|
-
|
|
134306
|
+
exceptionErrorType,
|
|
134307
|
+
executionStatus,
|
|
133917
134308
|
failureHookArtifacts
|
|
133918
134309
|
)
|
|
133919
134310
|
);
|
|
@@ -133944,8 +134335,7 @@ ${failureHookResult.additionalContext}`;
|
|
|
133944
134335
|
}
|
|
133945
134336
|
let messageBus;
|
|
133946
134337
|
try {
|
|
133947
|
-
|
|
133948
|
-
messageBus = shouldFirePostToolBatch ? this.config.getMessageBus() : void 0;
|
|
134338
|
+
messageBus = this.postToolBatchEnabledForBatch ? this.config.getMessageBus() : void 0;
|
|
133949
134339
|
} catch (error) {
|
|
133950
134340
|
debugLogger122.warn(
|
|
133951
134341
|
`PostToolBatch hook setup failed: ${error instanceof Error ? error.message : String(error)}`
|
|
@@ -133959,7 +134349,7 @@ ${failureHookResult.additionalContext}`;
|
|
|
133959
134349
|
if (messageBus) {
|
|
133960
134350
|
const batchToolCalls = completedCalls.map(toPostToolBatchToolCall);
|
|
133961
134351
|
const permissionMode = this.config.getApprovalMode();
|
|
133962
|
-
const
|
|
134352
|
+
const fireBatchHook = /* @__PURE__ */ __name(() => this.withHookSpan(
|
|
133963
134353
|
{ hookEvent: "PostToolBatch", toolName: "batch" },
|
|
133964
134354
|
() => firePostToolBatchHook(
|
|
133965
134355
|
messageBus,
|
|
@@ -133981,15 +134371,28 @@ ${failureHookResult.additionalContext}`;
|
|
|
133981
134371
|
postBatchStop: r.shouldStop,
|
|
133982
134372
|
postBatchStopReason: r.shouldStop ? r.stopReason || "no reason given" : void 0
|
|
133983
134373
|
}
|
|
133984
|
-
);
|
|
134374
|
+
), "fireBatchHook");
|
|
134375
|
+
const batchParentSpan = this.postToolBatchSpanCallId ? this.toolSpans.get(this.postToolBatchSpanCallId) : void 0;
|
|
134376
|
+
const batchHookResult = await (batchParentSpan ? runInToolSpanContext(batchParentSpan, fireBatchHook) : fireBatchHook());
|
|
133985
134377
|
if (batchHookResult.shouldStop) {
|
|
134378
|
+
const stopMessage = batchHookResult.stopReason || "Execution stopped by PostToolBatch hook";
|
|
133986
134379
|
debugLogger122.info(
|
|
133987
134380
|
`PostToolBatch hook stopped batch (${completedCalls.length} calls): ${batchHookResult.stopReason || "no reason given"}`
|
|
133988
134381
|
);
|
|
133989
|
-
completedCalls = withPostToolBatchStop(
|
|
133990
|
-
|
|
133991
|
-
|
|
133992
|
-
)
|
|
134382
|
+
completedCalls = withPostToolBatchStop(completedCalls, stopMessage);
|
|
134383
|
+
const stoppedCall = completedCalls.at(-1);
|
|
134384
|
+
const stoppedSpan = stoppedCall ? this.toolSpans.get(stoppedCall.request.callId) : void 0;
|
|
134385
|
+
if (stoppedSpan) {
|
|
134386
|
+
setToolSpanFailure(
|
|
134387
|
+
stoppedSpan,
|
|
134388
|
+
TOOL_FAILURE_KIND_POST_HOOK_STOPPED,
|
|
134389
|
+
stopMessage
|
|
134390
|
+
);
|
|
134391
|
+
} else {
|
|
134392
|
+
debugLogger122.debug(
|
|
134393
|
+
`PostToolBatch stop: no tool span for stopped call ${stoppedCall?.request.callId}; post_hook_stopped not recorded`
|
|
134394
|
+
);
|
|
134395
|
+
}
|
|
133993
134396
|
}
|
|
133994
134397
|
completedCalls = withPostToolBatchAdditionalContext(
|
|
133995
134398
|
completedCalls,
|
|
@@ -134001,6 +134404,9 @@ ${failureHookResult.additionalContext}`;
|
|
|
134001
134404
|
);
|
|
134002
134405
|
}
|
|
134003
134406
|
completedCalls = await this.applyBatchOutputBudget(completedCalls);
|
|
134407
|
+
for (const call of completedCalls) {
|
|
134408
|
+
this.finalizeToolSpan(call.request.callId, true);
|
|
134409
|
+
}
|
|
134004
134410
|
for (const call of completedCalls) {
|
|
134005
134411
|
this.runtimeContentGeneratorViews.delete(call.request.callId);
|
|
134006
134412
|
logToolCall(this.config, new ToolCallEvent(call));
|
|
@@ -134011,13 +134417,15 @@ ${failureHookResult.additionalContext}`;
|
|
|
134011
134417
|
}
|
|
134012
134418
|
} finally {
|
|
134013
134419
|
try {
|
|
134420
|
+
for (const call of completedCalls) {
|
|
134421
|
+
this.finalizeToolSpan(call.request.callId, true);
|
|
134422
|
+
}
|
|
134423
|
+
this.postToolBatchEnabledForBatch = false;
|
|
134424
|
+
this.postToolBatchSpanCallId = void 0;
|
|
134014
134425
|
this.notifyToolCallsUpdate();
|
|
134015
134426
|
} finally {
|
|
134016
134427
|
this.isFinalizingToolCalls = false;
|
|
134017
|
-
|
|
134018
|
-
const next = this.requestQueue.shift();
|
|
134019
|
-
this._schedule(next.request, next.signal, next.runtimeView).then(next.resolve).catch(next.reject);
|
|
134020
|
-
}
|
|
134428
|
+
this.drainRequestQueueIfIdle();
|
|
134021
134429
|
}
|
|
134022
134430
|
}
|
|
134023
134431
|
}
|
|
@@ -134082,6 +134490,7 @@ ${failureHookResult.additionalContext}`;
|
|
|
134082
134490
|
const result = {
|
|
134083
134491
|
callId: call.request.callId,
|
|
134084
134492
|
status: call.status,
|
|
134493
|
+
executionStatus: call.response.executionStatus,
|
|
134085
134494
|
resultDisplay: call.response.resultDisplay,
|
|
134086
134495
|
...call.response.visionBridgeNotice !== void 0 ? { visionBridgeNotice: call.response.visionBridgeNotice } : {},
|
|
134087
134496
|
error: call.response.error,
|
|
@@ -134109,8 +134518,15 @@ ${failureHookResult.additionalContext}`;
|
|
|
134109
134518
|
}
|
|
134110
134519
|
}
|
|
134111
134520
|
notifyToolCallsUpdate() {
|
|
134112
|
-
if (this.onToolCallsUpdate) {
|
|
134521
|
+
if (!this.onToolCallsUpdate) {
|
|
134522
|
+
return;
|
|
134523
|
+
}
|
|
134524
|
+
try {
|
|
134113
134525
|
this.onToolCallsUpdate([...this.toolCalls]);
|
|
134526
|
+
} catch (error) {
|
|
134527
|
+
debugLogger122.error(
|
|
134528
|
+
`Tool call update observer failed: ${error instanceof Error ? error.message : String(error)}`
|
|
134529
|
+
);
|
|
134114
134530
|
}
|
|
134115
134531
|
}
|
|
134116
134532
|
setToolCallOutcome(callId, outcome) {
|
|
@@ -134133,6 +134549,9 @@ ${failureHookResult.additionalContext}`;
|
|
|
134133
134549
|
);
|
|
134134
134550
|
for (const pendingTool of pendingTools) {
|
|
134135
134551
|
try {
|
|
134552
|
+
if (this.cancelPreExecutionIfAborted(pendingTool.request.callId, signal)) {
|
|
134553
|
+
continue;
|
|
134554
|
+
}
|
|
134136
134555
|
const toolParams = pendingTool.invocation.params;
|
|
134137
134556
|
const flowResult = await runInRequestGoalContext(
|
|
134138
134557
|
pendingTool.request,
|
|
@@ -134143,6 +134562,9 @@ ${failureHookResult.additionalContext}`;
|
|
|
134143
134562
|
toolParams
|
|
134144
134563
|
)
|
|
134145
134564
|
);
|
|
134565
|
+
if (this.cancelPreExecutionIfAborted(pendingTool.request.callId, signal)) {
|
|
134566
|
+
continue;
|
|
134567
|
+
}
|
|
134146
134568
|
const { finalPermission, pmForcedAsk, pmCtx, requiresUserInteraction } = flowResult;
|
|
134147
134569
|
if (requiresUserInteraction) {
|
|
134148
134570
|
continue;
|
|
@@ -134170,6 +134592,9 @@ ${failureHookResult.additionalContext}`;
|
|
|
134170
134592
|
skipClassifierReason: fallback.fallback ? fallback.reason : void 0
|
|
134171
134593
|
})
|
|
134172
134594
|
);
|
|
134595
|
+
if (this.cancelPreExecutionIfAborted(pendingTool.request.callId, signal)) {
|
|
134596
|
+
continue;
|
|
134597
|
+
}
|
|
134173
134598
|
const outcome = applyAutoModeDecision(
|
|
134174
134599
|
decision,
|
|
134175
134600
|
this.config,
|
|
@@ -134194,6 +134619,9 @@ ${failureHookResult.additionalContext}`;
|
|
|
134194
134619
|
);
|
|
134195
134620
|
}
|
|
134196
134621
|
}
|
|
134622
|
+
if (this.cancelPreExecutionIfAborted(pendingTool.request.callId, signal)) {
|
|
134623
|
+
continue;
|
|
134624
|
+
}
|
|
134197
134625
|
switch (outcome.kind) {
|
|
134198
134626
|
case "approved":
|
|
134199
134627
|
this.setToolCallOutcome(
|
|
@@ -134214,7 +134642,8 @@ ${failureHookResult.additionalContext}`;
|
|
|
134214
134642
|
createErrorResponse(
|
|
134215
134643
|
pendingTool.request,
|
|
134216
134644
|
new Error(outcome.errorMessage),
|
|
134217
|
-
"execution_denied" /* EXECUTION_DENIED
|
|
134645
|
+
"execution_denied" /* EXECUTION_DENIED */,
|
|
134646
|
+
"not_started"
|
|
134218
134647
|
)
|
|
134219
134648
|
);
|
|
134220
134649
|
this.finalizeBlockedSpan(
|
|
@@ -134273,6 +134702,9 @@ ${failureHookResult.additionalContext}`;
|
|
|
134273
134702
|
);
|
|
134274
134703
|
}
|
|
134275
134704
|
} catch (error) {
|
|
134705
|
+
if (this.cancelPreExecutionIfAborted(pendingTool.request.callId, signal)) {
|
|
134706
|
+
continue;
|
|
134707
|
+
}
|
|
134276
134708
|
debugLogger122.error(
|
|
134277
134709
|
`Error checking confirmation for tool ${pendingTool.request.callId}:`,
|
|
134278
134710
|
error
|
|
@@ -150331,7 +150763,7 @@ var Config = class _Config {
|
|
|
150331
150763
|
}
|
|
150332
150764
|
if (!enabled) return;
|
|
150333
150765
|
registry.registerFactory(ToolNames.IMAGE_GEN, async () => {
|
|
150334
|
-
const { ImageGenTool } = await import("./image-gen-
|
|
150766
|
+
const { ImageGenTool } = await import("./image-gen-G7RLG3KR.js");
|
|
150335
150767
|
return new ImageGenTool(this);
|
|
150336
150768
|
});
|
|
150337
150769
|
}
|
|
@@ -150361,36 +150793,36 @@ var Config = class _Config {
|
|
|
150361
150793
|
if (options2?.forSubAgent) return;
|
|
150362
150794
|
const schema = this.jsonSchema;
|
|
150363
150795
|
await registerLazy(ToolNames.STRUCTURED_OUTPUT, async () => {
|
|
150364
|
-
const { SyntheticOutputTool } = await import("./syntheticOutput-
|
|
150796
|
+
const { SyntheticOutputTool } = await import("./syntheticOutput-BN7E626U.js");
|
|
150365
150797
|
return new SyntheticOutputTool(schema);
|
|
150366
150798
|
});
|
|
150367
150799
|
}, "registerStructuredOutputIfRequested");
|
|
150368
150800
|
const registerGoalWorkerTools = /* @__PURE__ */ __name(async () => {
|
|
150369
150801
|
if (options2?.forSubAgent) return;
|
|
150370
150802
|
await registerLazy(ToolNames.GET_GOAL, async () => {
|
|
150371
|
-
const { GetGoalTool } = await import("./goal-tools-
|
|
150803
|
+
const { GetGoalTool } = await import("./goal-tools-3AZKX5WQ.js");
|
|
150372
150804
|
return new GetGoalTool(this);
|
|
150373
150805
|
});
|
|
150374
150806
|
await registerLazy(ToolNames.UPDATE_GOAL, async () => {
|
|
150375
|
-
const { UpdateGoalTool } = await import("./goal-tools-
|
|
150807
|
+
const { UpdateGoalTool } = await import("./goal-tools-3AZKX5WQ.js");
|
|
150376
150808
|
return new UpdateGoalTool(this);
|
|
150377
150809
|
});
|
|
150378
150810
|
}, "registerGoalWorkerTools");
|
|
150379
150811
|
if (this.getBareMode()) {
|
|
150380
150812
|
await registerLazy(ToolNames.READ_FILE, async () => {
|
|
150381
|
-
const { ReadFileTool } = await import("./read-file-
|
|
150813
|
+
const { ReadFileTool } = await import("./read-file-5GVXLY74.js");
|
|
150382
150814
|
return new ReadFileTool(this);
|
|
150383
150815
|
});
|
|
150384
150816
|
await registerLazy(ToolNames.EDIT, async () => {
|
|
150385
|
-
const { EditTool } = await import("./edit-
|
|
150817
|
+
const { EditTool } = await import("./edit-KW2TOC6A.js");
|
|
150386
150818
|
return new EditTool(this);
|
|
150387
150819
|
});
|
|
150388
150820
|
await registerLazy(ToolNames.NOTEBOOK_EDIT, async () => {
|
|
150389
|
-
const { NotebookEditTool } = await import("./notebook-edit-
|
|
150821
|
+
const { NotebookEditTool } = await import("./notebook-edit-LLM6UXFX.js");
|
|
150390
150822
|
return new NotebookEditTool(this);
|
|
150391
150823
|
});
|
|
150392
150824
|
await registerLazy(ToolNames.SHELL, async () => {
|
|
150393
|
-
const { ShellTool: ShellTool2 } = await import("./shell-
|
|
150825
|
+
const { ShellTool: ShellTool2 } = await import("./shell-RHGGJ6BE.js");
|
|
150394
150826
|
return new ShellTool2(this);
|
|
150395
150827
|
});
|
|
150396
150828
|
await registerGoalWorkerTools();
|
|
@@ -150402,43 +150834,43 @@ var Config = class _Config {
|
|
|
150402
150834
|
}
|
|
150403
150835
|
await registerGoalWorkerTools();
|
|
150404
150836
|
await registerLazy(ToolNames.TOOL_SEARCH, async () => {
|
|
150405
|
-
const { ToolSearchTool } = await import("./tool-search-
|
|
150837
|
+
const { ToolSearchTool } = await import("./tool-search-N2R7LVMC.js");
|
|
150406
150838
|
return new ToolSearchTool(this);
|
|
150407
150839
|
});
|
|
150408
150840
|
await registerLazy(ToolNames.READ_MCP_RESOURCE, async () => {
|
|
150409
|
-
const { ReadMcpResourceTool } = await import("./read-mcp-resource-
|
|
150841
|
+
const { ReadMcpResourceTool } = await import("./read-mcp-resource-RTSSEER5.js");
|
|
150410
150842
|
return new ReadMcpResourceTool(this);
|
|
150411
150843
|
});
|
|
150412
150844
|
await registerLazy(ToolNames.AGENT, async () => {
|
|
150413
|
-
const { AgentTool: AgentTool2 } = await import("./agent-
|
|
150845
|
+
const { AgentTool: AgentTool2 } = await import("./agent-NAOXNW4I.js");
|
|
150414
150846
|
return new AgentTool2(this);
|
|
150415
150847
|
});
|
|
150416
150848
|
await registerLazy(ToolNames.LIST_AGENTS, async () => {
|
|
150417
|
-
const { ListAgentsTool } = await import("./list-agents-
|
|
150849
|
+
const { ListAgentsTool } = await import("./list-agents-GC4BRET7.js");
|
|
150418
150850
|
return new ListAgentsTool(this);
|
|
150419
150851
|
});
|
|
150420
150852
|
await registerLazy(ToolNames.TASK_STOP, async () => {
|
|
150421
|
-
const { TaskStopTool } = await import("./task-stop-
|
|
150853
|
+
const { TaskStopTool } = await import("./task-stop-TNXRNAL2.js");
|
|
150422
150854
|
return new TaskStopTool(this);
|
|
150423
150855
|
});
|
|
150424
150856
|
await registerLazy(ToolNames.SEND_MESSAGE, async () => {
|
|
150425
|
-
const { SendMessageTool } = await import("./send-message-
|
|
150857
|
+
const { SendMessageTool } = await import("./send-message-TL6FIMMN.js");
|
|
150426
150858
|
return new SendMessageTool(this);
|
|
150427
150859
|
});
|
|
150428
150860
|
await registerLazy(ToolNames.SKILL, async () => {
|
|
150429
|
-
const { SkillTool } = await import("./skill-
|
|
150861
|
+
const { SkillTool } = await import("./skill-GQ7PBS25.js");
|
|
150430
150862
|
return new SkillTool(this);
|
|
150431
150863
|
});
|
|
150432
150864
|
await registerLazy(ToolNames.LS, async () => {
|
|
150433
|
-
const { LSTool } = await import("./ls-
|
|
150865
|
+
const { LSTool } = await import("./ls-63CC3NNX.js");
|
|
150434
150866
|
return new LSTool(this);
|
|
150435
150867
|
});
|
|
150436
150868
|
await registerLazy(ToolNames.READ_FILE, async () => {
|
|
150437
|
-
const { ReadFileTool } = await import("./read-file-
|
|
150869
|
+
const { ReadFileTool } = await import("./read-file-5GVXLY74.js");
|
|
150438
150870
|
return new ReadFileTool(this);
|
|
150439
150871
|
});
|
|
150440
150872
|
await registerLazy(ToolNames.ZOOM_IMAGE, async () => {
|
|
150441
|
-
const { ZoomImageTool } = await import("./zoom-image-
|
|
150873
|
+
const { ZoomImageTool } = await import("./zoom-image-NHKN6F77.js");
|
|
150442
150874
|
return new ZoomImageTool(this);
|
|
150443
150875
|
});
|
|
150444
150876
|
if (this.getUseRipgrep()) {
|
|
@@ -150453,7 +150885,7 @@ var Config = class _Config {
|
|
|
150453
150885
|
recordStartupEvent("config_initialize_ripgrep_probe_end");
|
|
150454
150886
|
if (useRipgrep) {
|
|
150455
150887
|
await registerLazy(ToolNames.GREP, async () => {
|
|
150456
|
-
const { RipGrepTool: RipGrepTool2 } = await import("./ripGrep-
|
|
150888
|
+
const { RipGrepTool: RipGrepTool2 } = await import("./ripGrep-TKOJTIAB.js");
|
|
150457
150889
|
return new RipGrepTool2(this);
|
|
150458
150890
|
});
|
|
150459
150891
|
} else {
|
|
@@ -150466,7 +150898,7 @@ var Config = class _Config {
|
|
|
150466
150898
|
)
|
|
150467
150899
|
);
|
|
150468
150900
|
await registerLazy(ToolNames.GREP, async () => {
|
|
150469
|
-
const { GrepTool } = await import("./grep-
|
|
150901
|
+
const { GrepTool } = await import("./grep-Q64EAM73.js");
|
|
150470
150902
|
return new GrepTool(this);
|
|
150471
150903
|
});
|
|
150472
150904
|
}
|
|
@@ -150474,77 +150906,77 @@ var Config = class _Config {
|
|
|
150474
150906
|
recordStartupEvent("config_initialize_ripgrep_probe_start");
|
|
150475
150907
|
recordStartupEvent("config_initialize_ripgrep_probe_end");
|
|
150476
150908
|
await registerLazy(ToolNames.GREP, async () => {
|
|
150477
|
-
const { GrepTool } = await import("./grep-
|
|
150909
|
+
const { GrepTool } = await import("./grep-Q64EAM73.js");
|
|
150478
150910
|
return new GrepTool(this);
|
|
150479
150911
|
});
|
|
150480
150912
|
}
|
|
150481
150913
|
await registerLazy(ToolNames.GLOB, async () => {
|
|
150482
|
-
const { GlobTool } = await import("./glob-
|
|
150914
|
+
const { GlobTool } = await import("./glob-LJFFMN4D.js");
|
|
150483
150915
|
return new GlobTool(this);
|
|
150484
150916
|
});
|
|
150485
150917
|
await registerLazy(ToolNames.EDIT, async () => {
|
|
150486
|
-
const { EditTool } = await import("./edit-
|
|
150918
|
+
const { EditTool } = await import("./edit-KW2TOC6A.js");
|
|
150487
150919
|
return new EditTool(this);
|
|
150488
150920
|
});
|
|
150489
150921
|
await registerLazy(ToolNames.NOTEBOOK_EDIT, async () => {
|
|
150490
|
-
const { NotebookEditTool } = await import("./notebook-edit-
|
|
150922
|
+
const { NotebookEditTool } = await import("./notebook-edit-LLM6UXFX.js");
|
|
150491
150923
|
return new NotebookEditTool(this);
|
|
150492
150924
|
});
|
|
150493
150925
|
await registerLazy(ToolNames.WRITE_FILE, async () => {
|
|
150494
|
-
const { WriteFileTool: WriteFileTool2 } = await import("./write-file-
|
|
150926
|
+
const { WriteFileTool: WriteFileTool2 } = await import("./write-file-AWBI4GJS.js");
|
|
150495
150927
|
return new WriteFileTool2(this);
|
|
150496
150928
|
});
|
|
150497
150929
|
await registerLazy(ToolNames.SHELL, async () => {
|
|
150498
|
-
const { ShellTool: ShellTool2 } = await import("./shell-
|
|
150930
|
+
const { ShellTool: ShellTool2 } = await import("./shell-RHGGJ6BE.js");
|
|
150499
150931
|
return new ShellTool2(this);
|
|
150500
150932
|
});
|
|
150501
150933
|
await registerLazy(ToolNames.TODO_WRITE, async () => {
|
|
150502
|
-
const { TodoWriteTool } = await import("./todoWrite-
|
|
150934
|
+
const { TodoWriteTool } = await import("./todoWrite-MHWHO5UO.js");
|
|
150503
150935
|
return new TodoWriteTool(this);
|
|
150504
150936
|
});
|
|
150505
150937
|
const supportsUserInteraction = resolveInteractionMode(this) !== "headless";
|
|
150506
150938
|
if (supportsUserInteraction) {
|
|
150507
150939
|
await registerLazy(ToolNames.ASK_USER_QUESTION, async () => {
|
|
150508
|
-
const { AskUserQuestionTool } = await import("./askUserQuestion-
|
|
150940
|
+
const { AskUserQuestionTool } = await import("./askUserQuestion-2EPPBPUZ.js");
|
|
150509
150941
|
return new AskUserQuestionTool(this);
|
|
150510
150942
|
});
|
|
150511
150943
|
}
|
|
150512
150944
|
if (!this.sdkMode && (supportsUserInteraction || options2?.forSubAgent)) {
|
|
150513
150945
|
await registerLazy(ToolNames.EXIT_PLAN_MODE, async () => {
|
|
150514
|
-
const { ExitPlanModeTool: ExitPlanModeTool2 } = await import("./exitPlanMode-
|
|
150946
|
+
const { ExitPlanModeTool: ExitPlanModeTool2 } = await import("./exitPlanMode-W4EICZ4N.js");
|
|
150515
150947
|
return new ExitPlanModeTool2(this);
|
|
150516
150948
|
});
|
|
150517
150949
|
}
|
|
150518
150950
|
if (!this.sdkMode && supportsUserInteraction) {
|
|
150519
150951
|
await registerLazy(ToolNames.ENTER_PLAN_MODE, async () => {
|
|
150520
|
-
const { EnterPlanModeTool } = await import("./enterPlanMode-
|
|
150952
|
+
const { EnterPlanModeTool } = await import("./enterPlanMode-JFJTDASQ.js");
|
|
150521
150953
|
return new EnterPlanModeTool(this);
|
|
150522
150954
|
});
|
|
150523
150955
|
}
|
|
150524
150956
|
await registerLazy(ToolNames.ENTER_WORKTREE, async () => {
|
|
150525
|
-
const { EnterWorktreeTool } = await import("./enter-worktree-
|
|
150957
|
+
const { EnterWorktreeTool } = await import("./enter-worktree-YL34NEU5.js");
|
|
150526
150958
|
return new EnterWorktreeTool(this);
|
|
150527
150959
|
});
|
|
150528
150960
|
await registerLazy(ToolNames.EXIT_WORKTREE, async () => {
|
|
150529
|
-
const { ExitWorktreeTool } = await import("./exit-worktree-
|
|
150961
|
+
const { ExitWorktreeTool } = await import("./exit-worktree-5M43QPBB.js");
|
|
150530
150962
|
return new ExitWorktreeTool(this);
|
|
150531
150963
|
});
|
|
150532
150964
|
await registerLazy(ToolNames.WEB_FETCH, async () => {
|
|
150533
|
-
const { WebFetchTool } = await import("./web-fetch-
|
|
150965
|
+
const { WebFetchTool } = await import("./web-fetch-DS34CJ3R.js");
|
|
150534
150966
|
return new WebFetchTool(this);
|
|
150535
150967
|
});
|
|
150536
150968
|
if (resolveInteractionMode(this) === "interactive" && !this.sdkMode && !this.getScreenReader() && !options2?.forSubAgent) {
|
|
150537
150969
|
await registerLazy(ToolNames.DISPLAY_IMAGE, async () => {
|
|
150538
|
-
const { DisplayImageTool } = await import("./display-image-
|
|
150970
|
+
const { DisplayImageTool } = await import("./display-image-GUJA352B.js");
|
|
150539
150971
|
return new DisplayImageTool(this);
|
|
150540
150972
|
});
|
|
150541
150973
|
}
|
|
150542
150974
|
if (this.webSearchSettings?.enabled) {
|
|
150543
|
-
const { evaluateWebSearchGate } = await import("./web-search-
|
|
150975
|
+
const { evaluateWebSearchGate } = await import("./web-search-ITFPD7V4.js");
|
|
150544
150976
|
const gate = evaluateWebSearchGate(this);
|
|
150545
150977
|
if (gate.ok) {
|
|
150546
150978
|
await registerLazy(ToolNames.WEB_SEARCH, async () => {
|
|
150547
|
-
const { WebSearchTool } = await import("./web-search-
|
|
150979
|
+
const { WebSearchTool } = await import("./web-search-ITFPD7V4.js");
|
|
150548
150980
|
return new WebSearchTool(this);
|
|
150549
150981
|
});
|
|
150550
150982
|
} else if (!this.webSearchNoticeEmitted && !options2?.forSubAgent) {
|
|
@@ -150555,83 +150987,83 @@ var Config = class _Config {
|
|
|
150555
150987
|
await this.registerImageGenerationTool(registry);
|
|
150556
150988
|
if (this.isArtifactEnabled()) {
|
|
150557
150989
|
await registerLazy(ToolNames.ARTIFACT, async () => {
|
|
150558
|
-
const { ArtifactTool } = await import("./artifact-tool-
|
|
150990
|
+
const { ArtifactTool } = await import("./artifact-tool-RROCCJDA.js");
|
|
150559
150991
|
return new ArtifactTool(this);
|
|
150560
150992
|
});
|
|
150561
150993
|
}
|
|
150562
150994
|
if (this.isRecordArtifactEnabled()) {
|
|
150563
150995
|
await registerLazy(ToolNames.RECORD_ARTIFACT, async () => {
|
|
150564
|
-
const { RecordArtifactTool } = await import("./record-artifact-
|
|
150996
|
+
const { RecordArtifactTool } = await import("./record-artifact-L3BAHQFN.js");
|
|
150565
150997
|
return new RecordArtifactTool();
|
|
150566
150998
|
});
|
|
150567
150999
|
}
|
|
150568
151000
|
if (this.isLspEnabled() && this.getLspClient()) {
|
|
150569
151001
|
await registerLazy(ToolNames.LSP, async () => {
|
|
150570
|
-
const { LspTool } = await import("./lsp-
|
|
151002
|
+
const { LspTool } = await import("./lsp-P6NVJVNT.js");
|
|
150571
151003
|
return new LspTool(this);
|
|
150572
151004
|
});
|
|
150573
151005
|
}
|
|
150574
151006
|
await registerStructuredOutputIfRequested();
|
|
150575
151007
|
if (this.isCronEnabled()) {
|
|
150576
151008
|
await registerLazy(ToolNames.CRON_CREATE, async () => {
|
|
150577
|
-
const { CronCreateTool } = await import("./cron-create-
|
|
151009
|
+
const { CronCreateTool } = await import("./cron-create-CCRIULJE.js");
|
|
150578
151010
|
return new CronCreateTool(this);
|
|
150579
151011
|
});
|
|
150580
151012
|
await registerLazy(ToolNames.CRON_LIST, async () => {
|
|
150581
|
-
const { CronListTool } = await import("./cron-list-
|
|
151013
|
+
const { CronListTool } = await import("./cron-list-QDBVCHRF.js");
|
|
150582
151014
|
return new CronListTool(this);
|
|
150583
151015
|
});
|
|
150584
151016
|
await registerLazy(ToolNames.CRON_DELETE, async () => {
|
|
150585
|
-
const { CronDeleteTool } = await import("./cron-delete-
|
|
151017
|
+
const { CronDeleteTool } = await import("./cron-delete-FCFW6BGP.js");
|
|
150586
151018
|
return new CronDeleteTool(this);
|
|
150587
151019
|
});
|
|
150588
151020
|
await registerLazy(ToolNames.LOOP_WAKEUP, async () => {
|
|
150589
|
-
const { LoopWakeupTool } = await import("./loop-wakeup-
|
|
151021
|
+
const { LoopWakeupTool } = await import("./loop-wakeup-SQQSBMEY.js");
|
|
150590
151022
|
return new LoopWakeupTool(this);
|
|
150591
151023
|
});
|
|
150592
151024
|
}
|
|
150593
151025
|
await registerLazy(ToolNames.CREATE_SUB_SESSION, async () => {
|
|
150594
|
-
const { CreateSubSessionTool } = await import("./create-sub-session-
|
|
151026
|
+
const { CreateSubSessionTool } = await import("./create-sub-session-6EWLAZD5.js");
|
|
150595
151027
|
return new CreateSubSessionTool(this);
|
|
150596
151028
|
});
|
|
150597
151029
|
if (this.isAgentTeamEnabled()) {
|
|
150598
151030
|
await registerLazy(ToolNames.TEAM_CREATE, async () => {
|
|
150599
|
-
const { TeamCreateTool } = await import("./team-create-
|
|
151031
|
+
const { TeamCreateTool } = await import("./team-create-UTRVUEDA.js");
|
|
150600
151032
|
return new TeamCreateTool(this);
|
|
150601
151033
|
});
|
|
150602
151034
|
await registerLazy(ToolNames.TEAM_DELETE, async () => {
|
|
150603
|
-
const { TeamDeleteTool } = await import("./team-delete-
|
|
151035
|
+
const { TeamDeleteTool } = await import("./team-delete-D2VMSDOT.js");
|
|
150604
151036
|
return new TeamDeleteTool(this);
|
|
150605
151037
|
});
|
|
150606
151038
|
await registerLazy(ToolNames.TEAM_PLAN_APPROVAL, async () => {
|
|
150607
|
-
const { TeamPlanApprovalTool } = await import("./team-plan-approval-
|
|
151039
|
+
const { TeamPlanApprovalTool } = await import("./team-plan-approval-YZNB4U5U.js");
|
|
150608
151040
|
return new TeamPlanApprovalTool(this);
|
|
150609
151041
|
});
|
|
150610
151042
|
await registerLazy(ToolNames.TASK_CREATE, async () => {
|
|
150611
|
-
const { TaskCreateTool } = await import("./task-create-
|
|
151043
|
+
const { TaskCreateTool } = await import("./task-create-2X4UP4F3.js");
|
|
150612
151044
|
return new TaskCreateTool(this);
|
|
150613
151045
|
});
|
|
150614
151046
|
await registerLazy(ToolNames.TASK_UPDATE, async () => {
|
|
150615
|
-
const { TaskUpdateTool } = await import("./task-update-
|
|
151047
|
+
const { TaskUpdateTool } = await import("./task-update-VDUSN36E.js");
|
|
150616
151048
|
return new TaskUpdateTool(this);
|
|
150617
151049
|
});
|
|
150618
151050
|
await registerLazy(ToolNames.TASK_LIST, async () => {
|
|
150619
|
-
const { TaskListTool } = await import("./task-list-
|
|
151051
|
+
const { TaskListTool } = await import("./task-list-WOLJPZ64.js");
|
|
150620
151052
|
return new TaskListTool(this);
|
|
150621
151053
|
});
|
|
150622
151054
|
}
|
|
150623
151055
|
if (this.isWorkflowsEnabled()) {
|
|
150624
151056
|
await registerLazy(ToolNames.WORKFLOW, async () => {
|
|
150625
|
-
const { WorkflowTool } = await import("./workflow-
|
|
151057
|
+
const { WorkflowTool } = await import("./workflow-LZQ4PGNS.js");
|
|
150626
151058
|
return new WorkflowTool(this);
|
|
150627
151059
|
});
|
|
150628
151060
|
}
|
|
150629
151061
|
if (this.isComputerUseEnabled()) {
|
|
150630
|
-
const { registerComputerUseTools } = await import("./computer-use-
|
|
151062
|
+
const { registerComputerUseTools } = await import("./computer-use-XDOGP2KA.js");
|
|
150631
151063
|
await registerComputerUseTools(registerLazy, this);
|
|
150632
151064
|
}
|
|
150633
151065
|
await registerLazy(ToolNames.MONITOR, async () => {
|
|
150634
|
-
const { MonitorTool } = await import("./monitor-
|
|
151066
|
+
const { MonitorTool } = await import("./monitor-NYJPAWVP.js");
|
|
150635
151067
|
return new MonitorTool(this);
|
|
150636
151068
|
});
|
|
150637
151069
|
if (this.pendingMcpBudgetCallback) {
|
|
@@ -151071,7 +151503,6 @@ export {
|
|
|
151071
151503
|
findPlanModeEntryBatchBoundaryIndex,
|
|
151072
151504
|
finalizeToolResponses,
|
|
151073
151505
|
parseAndFormatApiError,
|
|
151074
|
-
StructuredToolError,
|
|
151075
151506
|
checkPriorRead,
|
|
151076
151507
|
PLAN_EXIT_APPROVED_LLM_CONTENT_PREFIXES,
|
|
151077
151508
|
ExitPlanModeTool,
|