@qwen-code/qwen-code 0.23.5-dev.codemode-responses.20260915.f024b37689 → 0.23.5-preview.0

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.
Files changed (377) hide show
  1. package/bundled/computer-use/SKILL.md +24 -3
  2. package/bundled/qc-helper/docs/configuration/model-providers.md +43 -0
  3. package/bundled/qc-helper/docs/configuration/settings.md +10 -9
  4. package/bundled/qc-helper/docs/extension/agent-plugins.md +1 -0
  5. package/bundled/qc-helper/docs/extension/introduction.md +49 -0
  6. package/bundled/qc-helper/docs/features/channels/dingtalk.md +39 -4
  7. package/bundled/qc-helper/docs/features/channels/overview.md +12 -0
  8. package/bundled/qc-helper/docs/features/commands.md +57 -52
  9. package/bundled/qc-helper/docs/features/computer-use.md +1 -1
  10. package/bundled/qc-helper/docs/features/goals.md +8 -0
  11. package/bundled/qc-helper/docs/features/hooks.md +16 -0
  12. package/bundled/qc-helper/docs/qwen-serve.md +3 -1
  13. package/bundled/workflow-authoring/SKILL.md +48 -22
  14. package/chunks/{MaxSizedBox-BFMIFJWT.js → MaxSizedBox-FCF6M53W.js} +40 -43
  15. package/chunks/{StandaloneSessionPicker-4ZH7MOVG.js → StandaloneSessionPicker-V635V72I.js} +60 -63
  16. package/chunks/{acp-startup-profiler-RUQNTNU5.js → acp-startup-profiler-MOOU37VM.js} +2 -2
  17. package/chunks/{acp-subagent-executor-AHMVA4P3.js → acp-subagent-executor-TND6W2O5.js} +46 -47
  18. package/chunks/{acpAgent-UMAJ3XR3.js → acpAgent-3DPWZTNC.js} +954 -322
  19. package/chunks/{agent-CXB2CCQN.js → agent-KIHGINKN.js} +27 -30
  20. package/chunks/{agent-headless-7D5ZC736.js → agent-headless-EJ4QOUSM.js} +27 -30
  21. package/chunks/{anthropicContentGenerator-H5YPXIDE.js → anthropicContentGenerator-4FGOM5LK.js} +46 -64
  22. package/chunks/{artifact-tool-MFGORTWZ.js → artifact-tool-MUTNH4NI.js} +1 -1
  23. package/chunks/{askUserQuestion-WS4GUT7C.js → askUserQuestion-AKIRLVB5.js} +1 -1
  24. package/chunks/bareMode-QWKZPLPX.js +14 -0
  25. package/chunks/{bridge-A2WKX6IK.js → bridge-MUX5YJZT.js} +46 -49
  26. package/chunks/{ca-GZ4FDJU2.js → ca-WC3A5B3Q.js} +12 -1
  27. package/chunks/{channel-management-service-AFVIT4VH.js → channel-management-service-RRILWSXX.js} +4 -4
  28. package/chunks/{channel-settings-store-AXJIN7HG.js → channel-settings-store-7CBIRZER.js} +51 -54
  29. package/chunks/{channel-worker-group-JR6JOELM.js → channel-worker-group-3DUJFZJR.js} +8 -8
  30. package/chunks/{channel-worker-manager-AVKJEZFL.js → channel-worker-manager-E5UW2VLA.js} +8 -8
  31. package/chunks/{channel-worker-supervisor-OOYY7BAQ.js → channel-worker-supervisor-VN33GSEC.js} +5 -5
  32. package/chunks/{chunk-2YMRRI2C.js → chunk-2C5TR6HN.js} +82 -9
  33. package/chunks/{chunk-YDFOHRS5.js → chunk-2GP6BQ2J.js} +1 -1
  34. package/chunks/{chunk-RN6BU77T.js → chunk-347O2YZJ.js} +158 -290
  35. package/chunks/{chunk-LTINUI3O.js → chunk-36NRLIR6.js} +10 -8
  36. package/chunks/{chunk-AXZMWAJV.js → chunk-36SDZ2Q4.js} +8 -0
  37. package/chunks/{chunk-QR4Q425T.js → chunk-3BZI5GDP.js} +1 -1
  38. package/chunks/{chunk-C3YMBSLR.js → chunk-3HTUE6ZR.js} +3 -3
  39. package/chunks/{chunk-QS5Q5F42.js → chunk-3LLEB5CU.js} +2 -2
  40. package/chunks/{chunk-FPPG5Y3W.js → chunk-3UGMLA4V.js} +10 -8
  41. package/chunks/{chunk-66N6C4EH.js → chunk-3WILPKTJ.js} +2 -2
  42. package/chunks/{chunk-SROLVJFY.js → chunk-3WWPEFMX.js} +1 -1
  43. package/chunks/{chunk-ZKIAGIGH.js → chunk-3XBUCOWS.js} +1 -1
  44. package/chunks/{chunk-6RQFMGN2.js → chunk-43Y26NPF.js} +3 -3
  45. package/chunks/{chunk-INGBUYL6.js → chunk-4FLUQWJ4.js} +1 -1
  46. package/chunks/{chunk-S77FFY67.js → chunk-4JFLRHNE.js} +1 -1
  47. package/chunks/{chunk-MJHLKWGJ.js → chunk-4QPVZA5J.js} +70 -23
  48. package/chunks/{chunk-XX5HQLCZ.js → chunk-6OTF7TTE.js} +32 -1
  49. package/chunks/{chunk-4Y2I3CI3.js → chunk-6USYH3EU.js} +99 -6
  50. package/chunks/{chunk-Q3TFRP5G.js → chunk-7D4CV7JH.js} +102 -9
  51. package/chunks/{chunk-EWJTAP3Y.js → chunk-7O5PYQ3M.js} +20 -1
  52. package/chunks/chunk-ADN5KESB.js +28 -0
  53. package/chunks/chunk-AKRSSKUT.js +229 -0
  54. package/chunks/{chunk-54YUXX7X.js → chunk-AQP3H22J.js} +1 -1
  55. package/chunks/{chunk-EQWKIA72.js → chunk-AUX2FL5T.js} +24 -7
  56. package/chunks/{chunk-YGFJ6BRT.js → chunk-AZCTY64Z.js} +1 -1
  57. package/chunks/{chunk-QLX4D55R.js → chunk-B5TJK7B3.js} +1 -1
  58. package/chunks/{chunk-HXMDDII6.js → chunk-B6RMK4ED.js} +4 -4
  59. package/chunks/{chunk-UCKM6KCJ.js → chunk-BHG3H6OZ.js} +1 -1
  60. package/chunks/{chunk-JLF2AQAL.js → chunk-BHVF3R6B.js} +7 -5
  61. package/chunks/{chunk-HFJSQ4GL.js → chunk-BTICBRPL.js} +1 -1
  62. package/chunks/{chunk-KZCK5JUN.js → chunk-C3T6HPNM.js} +1 -1
  63. package/chunks/{chunk-FCLMJS6N.js → chunk-CDDP4ONL.js} +164 -27
  64. package/chunks/{chunk-Y3ZXDBUL.js → chunk-CQPM66MG.js} +4 -4
  65. package/chunks/{chunk-WKVZES7O.js → chunk-CXONOVBN.js} +1 -1
  66. package/chunks/{chunk-TYBRGFYL.js → chunk-CXY6BICQ.js} +501 -479
  67. package/chunks/{chunk-W23HOFDK.js → chunk-D3KVGQUV.js} +1 -1
  68. package/chunks/{chunk-LMJSPC55.js → chunk-D7JMO2GP.js} +3 -7
  69. package/chunks/{chunk-CXXAZ2LZ.js → chunk-DC4ZNGH4.js} +1 -1
  70. package/chunks/{chunk-FMLBBXHB.js → chunk-DRAX5YAI.js} +2 -2
  71. package/chunks/{chunk-DOTF2PF2.js → chunk-DRD6VBNH.js} +1 -1
  72. package/chunks/chunk-DX6JTDMR.js +105 -0
  73. package/chunks/{chunk-MNRK6MIH.js → chunk-E2VSBAFA.js} +53 -11
  74. package/chunks/{chunk-QJKR2P2K.js → chunk-EIBECN2J.js} +3 -3
  75. package/chunks/{chunk-LWWRJRCD.js → chunk-ESBYWATJ.js} +1 -1
  76. package/chunks/{chunk-3544ZEGZ.js → chunk-FASYATAZ.js} +5 -7
  77. package/chunks/{chunk-6YUS5JCV.js → chunk-FBY32737.js} +4 -4
  78. package/chunks/{chunk-LBWIJ5T7.js → chunk-FCPJXKDG.js} +10 -7
  79. package/chunks/{chunk-FX6GJIPZ.js → chunk-FEDFZBGR.js} +3 -3
  80. package/chunks/{chunk-DQ4LBRZN.js → chunk-FIJODK52.js} +3 -3
  81. package/chunks/{chunk-HVSRWLOW.js → chunk-FX6PZBOV.js} +3 -3
  82. package/chunks/{chunk-L6DIANLD.js → chunk-G45B3INR.js} +1 -1
  83. package/chunks/{chunk-EYLUKEYW.js → chunk-GI7SLDOI.js} +2 -2
  84. package/chunks/chunk-GJKP6XOB.js +1092 -0
  85. package/chunks/{chunk-I6YJZGHS.js → chunk-GSAOVDTH.js} +9 -9
  86. package/chunks/{chunk-XK4UQSIR.js → chunk-H6L4NEAT.js} +1 -1
  87. package/chunks/{chunk-GMCEFKNR.js → chunk-HNFKYKHH.js} +103 -22
  88. package/chunks/{chunk-6XDB3FR4.js → chunk-HX4WXX3H.js} +301 -138
  89. package/chunks/{chunk-HG46TTAG.js → chunk-HXUI5D4H.js} +1 -1
  90. package/chunks/{chunk-QI4WBHPF.js → chunk-HYHSMTRA.js} +4 -4
  91. package/chunks/{chunk-ZUKC5J6Q.js → chunk-IKBEIDOH.js} +14 -14
  92. package/chunks/{chunk-LCAJ63TF.js → chunk-INN5ORKX.js} +1 -1
  93. package/chunks/{chunk-GNV2SFO7.js → chunk-IVFTLUZD.js} +26 -1
  94. package/chunks/{chunk-GNKSR3FU.js → chunk-IXO2OCIP.js} +2 -2
  95. package/chunks/{chunk-SNT634Q6.js → chunk-K4XMAIRX.js} +30 -33
  96. package/chunks/{chunk-WBP64MZR.js → chunk-KAYC5FBN.js} +5269 -2785
  97. package/chunks/chunk-KEM7MWS7.js +3541 -0
  98. package/chunks/{chunk-ADQUK6WA.js → chunk-KVC7HZWK.js} +1 -1
  99. package/chunks/{chunk-UQXURNLM.js → chunk-KVQ3QL4K.js} +3 -3
  100. package/chunks/{chunk-7U5G6JXI.js → chunk-KWYTSSTJ.js} +105 -6
  101. package/chunks/{chunk-Q4G2YPI4.js → chunk-L2A5VBDL.js} +3019 -2352
  102. package/chunks/{chunk-WD6YQI5M.js → chunk-L3SNMEDW.js} +1 -1
  103. package/chunks/{chunk-BYUAT5OC.js → chunk-L7TJUPNR.js} +19 -3
  104. package/chunks/{chunk-ABNX6E6K.js → chunk-LFKXIOGC.js} +1 -1
  105. package/chunks/{chunk-GFAK6DYU.js → chunk-LO2UWNO5.js} +2 -2
  106. package/chunks/{chunk-67ZDP7UX.js → chunk-M22WLKLI.js} +5 -5
  107. package/chunks/{chunk-54B2LTKP.js → chunk-M23GFJ5B.js} +24 -5
  108. package/chunks/{chunk-VGY2RGXL.js → chunk-M4U2LTD2.js} +1 -1
  109. package/chunks/{chunk-ZNI3YJHS.js → chunk-MFDKHGTD.js} +1 -1
  110. package/chunks/{chunk-R7OO56VZ.js → chunk-MMRGG6R4.js} +1 -1
  111. package/chunks/{chunk-E6IR653O.js → chunk-MO4XID7S.js} +1 -1
  112. package/chunks/{chunk-NJ4ZNDVP.js → chunk-NKTMUPHJ.js} +3 -6
  113. package/chunks/{chunk-4DTFTPTU.js → chunk-NQ272MQG.js} +1 -1
  114. package/chunks/{chunk-DWKFTUGI.js → chunk-OALXNGUA.js} +6 -6
  115. package/chunks/{chunk-FBDHP23D.js → chunk-OSG23MR3.js} +1 -1
  116. package/chunks/{chunk-NJ2OFVUX.js → chunk-P42KMMU6.js} +860 -1
  117. package/chunks/{chunk-5KJ54DY3.js → chunk-PF7GAP6K.js} +60 -58
  118. package/chunks/{chunk-MQRLLBMQ.js → chunk-PPJSG2PU.js} +2 -2
  119. package/chunks/{chunk-EPVEPTI3.js → chunk-PZRXWQUA.js} +753 -18
  120. package/chunks/{chunk-VI5UVPOB.js → chunk-Q54O3EIA.js} +30 -28
  121. package/chunks/{chunk-QTUQV33C.js → chunk-QGEISOJ2.js} +4 -4
  122. package/chunks/{chunk-XKRYQOHS.js → chunk-QHSOINX6.js} +2 -2
  123. package/chunks/{chunk-Z6Q7I37O.js → chunk-QIPLWW6Q.js} +1 -1
  124. package/chunks/chunk-QMENOK5T.js +1246 -0
  125. package/chunks/chunk-QT6Z2IBF.js +347 -0
  126. package/chunks/{chunk-TBSCTWKF.js → chunk-RN6A53UJ.js} +25 -0
  127. package/chunks/{chunk-E7ZTAOJZ.js → chunk-RRI764F7.js} +21 -19
  128. package/chunks/{chunk-YI2YCNSP.js → chunk-SENYKRII.js} +1 -1
  129. package/chunks/chunk-SFHX5G2S.js +2796 -0
  130. package/chunks/chunk-SK3RZOPS.js +34 -0
  131. package/chunks/{chunk-SKYOAH4Z.js → chunk-SOLRBF7L.js} +13 -9
  132. package/chunks/{chunk-5WLF44DS.js → chunk-SSWTA7CH.js} +12 -12
  133. package/chunks/{chunk-IAS753HG.js → chunk-SYMXYRM5.js} +11 -2
  134. package/chunks/{chunk-FGROOEKM.js → chunk-TDKUXSJO.js} +34 -6
  135. package/chunks/{chunk-ZJ7JQUGY.js → chunk-TKF4JINY.js} +1 -1
  136. package/chunks/{chunk-ZOQ6HC7U.js → chunk-TPY6HW55.js} +4 -4
  137. package/chunks/{chunk-EDB556X7.js → chunk-TRZ22SG5.js} +1 -1
  138. package/chunks/{chunk-FHSOZSBO.js → chunk-TXTCM3TC.js} +4 -4
  139. package/chunks/{chunk-5ODRE7E5.js → chunk-U4AASWUQ.js} +28 -12
  140. package/chunks/{chunk-PPE7VUMD.js → chunk-UQGRJTDK.js} +2 -2
  141. package/chunks/{chunk-JO67LVXW.js → chunk-UZSB57EV.js} +6 -8
  142. package/chunks/{chunk-UY4OCBX4.js → chunk-V4JJAVHQ.js} +2 -2
  143. package/chunks/chunk-VEXUA6DX.js +1026 -0
  144. package/chunks/{chunk-ME4JBHSB.js → chunk-VQDWCQOE.js} +2 -0
  145. package/chunks/{chunk-ZC75SULX.js → chunk-VU3XMZ5I.js} +23 -4
  146. package/chunks/{chunk-A2UYI473.js → chunk-WL36KHUQ.js} +6 -6
  147. package/chunks/{chunk-IWOJ2FHG.js → chunk-WNQIJTOP.js} +8 -8
  148. package/chunks/{chunk-IANIY25T.js → chunk-WSJI6ODG.js} +99 -30
  149. package/chunks/{chunk-3CKAOJ4L.js → chunk-WZWTY7SG.js} +6 -6
  150. package/chunks/{chunk-EKMJR7M3.js → chunk-X7AYIXC7.js} +1 -1
  151. package/chunks/{chunk-IBRQG2MP.js → chunk-XAJZFGD2.js} +11 -11
  152. package/chunks/{chunk-VRQZESKP.js → chunk-XICCGDWF.js} +2 -2
  153. package/chunks/{chunk-L5R4D5T4.js → chunk-Y2KJC55Y.js} +12 -7
  154. package/chunks/{chunk-2S2WIGCM.js → chunk-Y4NNIGYO.js} +1 -1
  155. package/chunks/{chunk-J7LBAKDH.js → chunk-YL3UJML3.js} +7 -7
  156. package/chunks/{chunk-GSS4SZNG.js → chunk-YP2K3WOS.js} +40 -56
  157. package/chunks/{chunk-ZZUXUBEB.js → chunk-YQQ2U7AS.js} +8 -5
  158. package/chunks/{chunk-FAWTMDX7.js → chunk-YXHY6BKS.js} +15 -0
  159. package/chunks/{chunk-FIP5QS2U.js → chunk-YZXSDPOQ.js} +140 -39
  160. package/chunks/{chunk-WATHOB6X.js → chunk-ZFHKUQZ4.js} +3 -3
  161. package/chunks/{chunk-R5OA3ONY.js → chunk-ZMYKNKET.js} +6 -6
  162. package/chunks/{codex-subagent-executor-LANZAZPH.js → codex-subagent-executor-AEAIQZDC.js} +48 -49
  163. package/chunks/{config-utils-CRK2LQPA.js → config-utils-KX2YS725.js} +43 -46
  164. package/chunks/{contextCommand-GY5X3LIY.js → contextCommand-RV6Y5LNJ.js} +41 -44
  165. package/chunks/{core-runtime-IJIV2LHP.js → core-runtime-ZI4RTOJQ.js} +45 -48
  166. package/chunks/{create-sub-session-MNIVRHGB.js → create-sub-session-BBWFQARJ.js} +46 -48
  167. package/chunks/{daemon-NJB4PWZ7.js → daemon-INCM4VBX.js} +3 -1
  168. package/chunks/{daemon-git-worktree-guard-W6Z2BGDH.js → daemon-git-worktree-guard-KECEMV6A.js} +39 -42
  169. package/chunks/{daemon-status-provider-TJF3APU3.js → daemon-status-provider-NULJNAEV.js} +53 -56
  170. package/chunks/{daemon-trust-policy-6INCISDU.js → daemon-trust-policy-S4KWGPV3.js} +47 -50
  171. package/chunks/{daemon-trust-policy-monitor-JRTAQG54.js → daemon-trust-policy-monitor-546N5ZVL.js} +47 -50
  172. package/chunks/{de-VGY3VNBU.js → de-6AVKPTXQ.js} +11 -0
  173. package/chunks/{deferred-core-runtime-2JRTPTNM.js → deferred-core-runtime-T23ZT443.js} +39 -42
  174. package/chunks/{dist-NIOJXMGY.js → dist-4P3ZJYGI.js} +1 -1
  175. package/chunks/{dist-VDLSBCLM.js → dist-7MGRENQ5.js} +1 -1
  176. package/chunks/{dist-SE4J6Z4O.js → dist-BNW423XT.js} +326 -77
  177. package/chunks/{dist-TFGETXFN.js → dist-CESMUYGN.js} +4 -4
  178. package/chunks/{dist-MPUZZOG5.js → dist-DBBOFWSC.js} +1 -1
  179. package/chunks/{dist-T6DDPDLQ.js → dist-G5UMXIGF.js} +1 -1
  180. package/chunks/{dist-PA7WPFVE.js → dist-UXVNLQHG.js} +3 -3
  181. package/chunks/{dist-GUB7QRYA.js → dist-VA4LREAQ.js} +2 -2
  182. package/chunks/{dist-2QYIVNS6.js → dist-XDRTR4QP.js} +1 -1
  183. package/chunks/{edit-JDIXXCYB.js → edit-CMSQB7NP.js} +27 -30
  184. package/chunks/{en-E5ZO5TZW.js → en-56QLKXS2.js} +23 -1
  185. package/chunks/{enter-worktree-CAARFWBI.js → enter-worktree-DA6A4XC5.js} +3 -3
  186. package/chunks/{enterPlanMode-YTNTBZBN.js → enterPlanMode-UDPMNESD.js} +27 -30
  187. package/chunks/{environment-UAI5L52V.js → environment-TSQJUTPV.js} +42 -45
  188. package/chunks/{errors-J4UCDCW5.js → errors-RIVYJS6T.js} +41 -44
  189. package/chunks/{exit-worktree-JXGGUOBP.js → exit-worktree-4H6Z2VQI.js} +3 -3
  190. package/chunks/{exitPlanMode-YMWJ2EO7.js → exitPlanMode-BYBBFN2T.js} +27 -30
  191. package/chunks/{fast-path-MBAN7TK3.js → fast-path-F2CYDDZ4.js} +4 -4
  192. package/chunks/{fast-path-settings-XDYX7X5Z.js → fast-path-settings-N2VGRGDJ.js} +2 -2
  193. package/chunks/{fr-UAZJJH5N.js → fr-EBUDHJL3.js} +11 -0
  194. package/chunks/{glob-YEM24E3Z.js → glob-Z2JMJKKN.js} +27 -30
  195. package/chunks/{goal-tools-LJIVH5T6.js → goal-tools-HXVVLGCV.js} +27 -30
  196. package/chunks/{handleAutoUpdate-DYCSYDYL.js → handleAutoUpdate-FZP45KOR.js} +43 -46
  197. package/chunks/{i18n-PTAV7SN3.js → i18n-OTB62AKW.js} +40 -43
  198. package/chunks/{image-gen-5G2TQ3DY.js → image-gen-HIAZCB5T.js} +6 -7
  199. package/chunks/{initializer-MPXTKQA4.js → initializer-4JXZEC4B.js} +47 -50
  200. package/chunks/{installationInfo-U5EFA3OL.js → installationInfo-2IJV5QKC.js} +39 -42
  201. package/chunks/{ja-2RITCMAJ.js → ja-NCDT4CGV.js} +11 -0
  202. package/chunks/{list-YOE25QUI.js → list-KQSQ4A5G.js} +50 -53
  203. package/chunks/{llm-ZZ2WNQMC.js → llm-LSUBOJAR.js} +154 -974
  204. package/chunks/{llm-content-generator-CG2HRJZC.js → llm-content-generator-MLIONRXE.js} +17 -12
  205. package/chunks/{loadedSettingsAdapter-NPGWGURF.js → loadedSettingsAdapter-TZTTNRHI.js} +47 -50
  206. package/chunks/{loggingContentGenerator-TUL6SJVL.js → loggingContentGenerator-TUPEXFMM.js} +31 -34
  207. package/chunks/{loop-wakeup-VG6CGBQA.js → loop-wakeup-ZBVRI6VH.js} +1 -1
  208. package/chunks/{managed-npm-update-YUDSCJP3.js → managed-npm-update-WEA5XMFZ.js} +40 -43
  209. package/chunks/{mcp-EX3GDQVO.js → mcp-TFDTUPIA.js} +47 -50
  210. package/chunks/{model-configuration-6DEKTXJI.js → model-configuration-ZCAKKIOF.js} +48 -51
  211. package/chunks/{modelConfigUtils-4NA2MHEE.js → modelConfigUtils-J3ZPW7ZK.js} +41 -44
  212. package/chunks/{monitor-PPUGNAWR.js → monitor-CI7YE7MT.js} +29 -32
  213. package/chunks/{nonInteractiveCli-6TW2XYP5.js → nonInteractiveCli-GPT3TVOK.js} +96 -98
  214. package/chunks/{notebook-edit-4MUXHZHT.js → notebook-edit-3WCVRNGL.js} +27 -30
  215. package/chunks/{openaiContentGenerator-5J73W5XZ.js → openaiContentGenerator-OGILGUZE.js} +12 -17
  216. package/chunks/{openaiResponsesContentGenerator-AWRYZLJU.js → openaiResponsesContentGenerator-NXOXUPFM.js} +45 -13
  217. package/chunks/{pidfile-M7WELKBB.js → pidfile-GBTBIGHF.js} +39 -42
  218. package/chunks/{process-registry-X6ZCASEN.js → process-registry-7LAPI3ZB.js} +1 -1
  219. package/chunks/{processUtils-SPRINFNY.js → processUtils-O4II3RYH.js} +2 -2
  220. package/chunks/{prompt-terminal-ledger-25BRD7FX.js → prompt-terminal-ledger-ILIXZI3E.js} +40 -43
  221. package/chunks/{pt-5ZF7ZQUV.js → pt-FYYFWYUC.js} +11 -0
  222. package/chunks/{qwenContentGenerator-H5AAKXPC.js → qwenContentGenerator-I4LRYADV.js} +33 -36
  223. package/chunks/{qwenOAuth2-WIEUEFEY.js → qwenOAuth2-3J66TOT5.js} +6 -7
  224. package/chunks/{read-file-ILGEFPB3.js → read-file-G4XKW2CS.js} +5 -9
  225. package/chunks/{record-artifact-PXMNP7GZ.js → record-artifact-L3CFJOMA.js} +2 -2
  226. package/chunks/{report-findings-W6GR7SYZ.js → report-findings-LY5HQY4K.js} +3 -3
  227. package/chunks/{resumeHistoryUtils-RB52QOCH.js → resumeHistoryUtils-YPJU4XFE.js} +44 -47
  228. package/chunks/{ripGrep-O6QAFHQK.js → ripGrep-AAKMALLM.js} +7 -11
  229. package/chunks/{ru-7BNZFQKG.js → ru-RHEB3RNS.js} +11 -0
  230. package/chunks/{run-qwen-serve-5NO3TKUL.js → run-qwen-serve-ZVEKGS7Y.js} +177 -98
  231. package/chunks/{runtime-G2YUYMSZ.js → runtime-SJCRYNPA.js} +52 -55
  232. package/chunks/safe-mode-KLGUG54M.js +11 -0
  233. package/chunks/sandbox-UIXL423Z.js +146 -0
  234. package/chunks/sandboxConfig-CY343YNJ.js +114 -0
  235. package/chunks/{scheduled-tasks-HDHV3URA.js → scheduled-tasks-5UGBEVNZ.js} +50 -53
  236. package/chunks/{scheduler-6MDJX2ZK.js → scheduler-GCZYLZ2P.js} +41 -44
  237. package/chunks/{sdk-exporters-http-3R2TRQHE.js → sdk-exporters-http-DR4G663K.js} +1 -1
  238. package/chunks/{sdk-impl-4WF3VZ2F.js → sdk-impl-SJR26MQF.js} +3 -3
  239. package/chunks/{send-message-UMJKN27Q.js → send-message-DN76MXDX.js} +6 -6
  240. package/chunks/{serve-Z2EJQYKB.js → serve-2XXQLVK2.js} +48 -51
  241. package/chunks/{server-JTNBK3LH.js → server-UHMKPCAZ.js} +408 -211
  242. package/chunks/{session-5YK2BXH4.js → session-ZLUK7E4P.js} +108 -108
  243. package/chunks/{session-attachments-root-QO3VFJS6.js → session-attachments-root-DHQM5IEZ.js} +39 -42
  244. package/chunks/{session-pr-refresh-OTK3HCJZ.js → session-pr-refresh-3OMTQWCZ.js} +48 -51
  245. package/chunks/{settings-2VKLACYV.js → settings-P4DHIIUP.js} +50 -53
  246. package/chunks/{shell-64NAVGMS.js → shell-IMFUVQQ5.js} +27 -30
  247. package/chunks/{skill-R3ALMLLM.js → skill-NB5RJGZW.js} +7 -11
  248. package/chunks/{skill-settings-HZ34TUMP.js → skill-settings-IXG5CTQO.js} +47 -50
  249. package/chunks/{spawnChannel-XGFWHEIK.js → spawnChannel-Q3YALTCJ.js} +44 -45
  250. package/chunks/{standalone-update-R32Y3XRR.js → standalone-update-H5OJ7MM7.js} +41 -44
  251. package/chunks/{start-opentui-ui-YGJOUE2H.js → start-opentui-ui-JKAIWGF7.js} +733 -386
  252. package/chunks/{startInteractiveUI-5ZEVKSFF.js → startInteractiveUI-YRPOT6GH.js} +370 -337
  253. package/chunks/task-create-75HVPEAH.js +1 -1
  254. package/chunks/{team-create-GCVUXJLE.js → team-create-2XTBYRJF.js} +31 -34
  255. package/chunks/{team-plan-approval-NOL62FJD.js → team-plan-approval-CFNWW7ZQ.js} +27 -30
  256. package/chunks/{terminal-image-renderer-WG5TLPGC.js → terminal-image-renderer-UDPJPGPQ.js} +39 -42
  257. package/chunks/{theme-manager-HDS4YFPW.js → theme-manager-SK57EKMO.js} +39 -42
  258. package/chunks/{tool-search-HMT5GYUR.js → tool-search-ZHTJU2MV.js} +5 -9
  259. package/chunks/{total-session-admission-Y5RCHEXO.js → total-session-admission-UUZBDQCG.js} +47 -50
  260. package/chunks/{tree-sitter-LSORDVZ3.js → tree-sitter-4D7QS7F6.js} +1 -1
  261. package/chunks/{tree-sitter-bash-UARELQ6C.js → tree-sitter-bash-VEJGF5XF.js} +1 -1
  262. package/chunks/{trustedFolders-3Y2WCXMR.js → trustedFolders-4LDBLNTS.js} +40 -43
  263. package/chunks/{update-relaunch-MTJ32SLF.js → update-relaunch-LI7GRP36.js} +5 -5
  264. package/chunks/{updateCheck-YFX3VY6O.js → updateCheck-PKSSORPO.js} +43 -46
  265. package/chunks/{useAutoAcceptIndicator-FCHNQPMD.js → useAutoAcceptIndicator-I32UEQPI.js} +50 -53
  266. package/chunks/{validateNonInterActiveAuth-HUFQKCGG.js → validateNonInterActiveAuth-YFPCYYNL.js} +93 -95
  267. package/chunks/{version-S5TGWCA3.js → version-4MTL4JVU.js} +1 -1
  268. package/chunks/{web-fetch-23M7BYHB.js → web-fetch-O6RG6ISB.js} +9 -13
  269. package/chunks/{web-search-F5PNIQUA.js → web-search-JHAXVEMD.js} +9 -14
  270. package/chunks/{web-shell-static-T7UGLVE4.js → web-shell-static-FFWCUUZS.js} +8 -4
  271. package/chunks/{workflow-BLJLID2C.js → workflow-O7L6VDYU.js} +396 -113
  272. package/chunks/{workspace-providers-status-UH7KLZDT.js → workspace-providers-status-WRX6CJM4.js} +53 -56
  273. package/chunks/{workspace-registration-store-3SA3V7BA.js → workspace-registration-store-7G4E7YPY.js} +1 -1
  274. package/chunks/{workspace-registry-C6C6EKQ5.js → workspace-registry-SXIMGT4D.js} +47 -50
  275. package/chunks/{workspace-runtime-coordinator-RAI6XDJB.js → workspace-runtime-coordinator-7DOEHXYT.js} +47 -50
  276. package/chunks/{workspace-service-H7UTJYJU.js → workspace-service-HDXOZMYC.js} +53 -56
  277. package/chunks/{workspace-skills-status-FPVC7XXK.js → workspace-skills-status-VN4L37CA.js} +50 -53
  278. package/chunks/{workspace-trust-reconciler-JS7A6UIF.js → workspace-trust-reconciler-XEBW5FUL.js} +57 -60
  279. package/chunks/{write-file-GQGG7NBQ.js → write-file-LKX4ETIO.js} +29 -32
  280. package/chunks/{zh-V2EYTYJP.js → zh-F76MZTL3.js} +23 -1
  281. package/chunks/{zh-TW-7PRVUGLW.js → zh-TW-S3YTQ4DS.js} +23 -1
  282. package/chunks/{zoom-image-EC43KL4H.js → zoom-image-RDPRTP4B.js} +5 -9
  283. package/cli.js +19 -15
  284. package/export-transcript-document.css +1 -1
  285. package/export-transcript-document.js +151 -150
  286. package/locales/ca.js +19 -2
  287. package/locales/de.js +18 -0
  288. package/locales/en.js +33 -2
  289. package/locales/fr.js +18 -0
  290. package/locales/ja.js +18 -0
  291. package/locales/pt.js +18 -0
  292. package/locales/ru.js +18 -0
  293. package/locales/zh-TW.js +33 -2
  294. package/locales/zh.js +33 -2
  295. package/package.json +3 -3
  296. package/web-shell/assets/{abnfDiagram-VCTEODGH-BtpzKw3A.js → abnfDiagram-VCTEODGH-RxykUDmi.js} +1 -1
  297. package/web-shell/assets/{arc-CQiVKZJP.js → arc-CZpgGCJC.js} +1 -1
  298. package/web-shell/assets/{architectureDiagram-5GKGNRK7-ekIPBb2d.js → architectureDiagram-5GKGNRK7-BHSMzNDT.js} +1 -1
  299. package/web-shell/assets/{blockDiagram-NRAW4CY4-BrRWkWri.js → blockDiagram-NRAW4CY4-Bn4mF9SZ.js} +1 -1
  300. package/web-shell/assets/{c4Diagram-UCG6FXSJ-qYS8CYZ3.js → c4Diagram-UCG6FXSJ-CBM-Bj6t.js} +1 -1
  301. package/web-shell/assets/channel-DFYs_LlK.js +1 -0
  302. package/web-shell/assets/{chunk-2Q5K7J3B-ZasyyEZm.js → chunk-2Q5K7J3B-D5Fin58O.js} +1 -1
  303. package/web-shell/assets/{chunk-5VM5RSS4-C_IzCGeA.js → chunk-5VM5RSS4-CY05weF7.js} +1 -1
  304. package/web-shell/assets/{chunk-F27PBJKO-C25NZOyD.js → chunk-F27PBJKO-3neZnj5Y.js} +1 -1
  305. package/web-shell/assets/{chunk-G27WJ6UU-XPOHNSGX.js → chunk-G27WJ6UU-Cd7EU4BE.js} +1 -1
  306. package/web-shell/assets/{chunk-JWPE2WC7-BQBh0Xni.js → chunk-JWPE2WC7-DwK1mqFw.js} +1 -1
  307. package/web-shell/assets/{chunk-LCL6LL3I-CoShjpX7.js → chunk-LCL6LL3I-Sl7vY22C.js} +1 -1
  308. package/web-shell/assets/{chunk-POPQ4Y6H-BwRmCDSz.js → chunk-POPQ4Y6H-BXNzpbVg.js} +1 -1
  309. package/web-shell/assets/{chunk-SVP7TREG-DSzE5-Mw.js → chunk-SVP7TREG-DjjButcp.js} +1 -1
  310. package/web-shell/assets/{chunk-XXDRQBXY-BQSQv30h.js → chunk-XXDRQBXY-DNOiCjOJ.js} +1 -1
  311. package/web-shell/assets/classDiagram-DTDB5LWJ-DnGrKXoM.js +1 -0
  312. package/web-shell/assets/classDiagram-v2-JRS7N3AN-DnGrKXoM.js +1 -0
  313. package/web-shell/assets/{cose-bilkent-JH36ORCC-XVUVTHVo.js → cose-bilkent-JH36ORCC-BUnker7a.js} +1 -1
  314. package/web-shell/assets/{cynefin-OW5HDTMX-CrsKx4lQ.js → cynefin-OW5HDTMX-DcUgdWE5.js} +1 -1
  315. package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-BPeZEuHw.js → cynefinDiagram-5FMLGOSQ-CvDKsZsL.js} +1 -1
  316. package/web-shell/assets/{dagre-3AP2YEHR-D31cQ2Qs.js → dagre-3AP2YEHR-jpCmUbr1.js} +1 -1
  317. package/web-shell/assets/{diagram-S7CK7UJ4-zyiG097Q.js → diagram-S7CK7UJ4-DBe_bKE5.js} +1 -1
  318. package/web-shell/assets/{diagram-UQ7AKVKN-Br3vtfsy.js → diagram-UQ7AKVKN-oXvPpDgs.js} +1 -1
  319. package/web-shell/assets/{diagram-VSXAHHWV-Bxkhjx4u.js → diagram-VSXAHHWV-BD7-_SGh.js} +1 -1
  320. package/web-shell/assets/{diagram-VX7I27RA-BQH8QiDk.js → diagram-VX7I27RA-DOJL0wub.js} +1 -1
  321. package/web-shell/assets/{diagram-Z3DM3KII-B_aQ1cw0.js → diagram-Z3DM3KII-DRIiodDD.js} +1 -1
  322. package/web-shell/assets/{ebnfDiagram-PWID7BFC-B9N7BRQE.js → ebnfDiagram-PWID7BFC-Db31Ulmb.js} +1 -1
  323. package/web-shell/assets/{erDiagram-SSCWMZ5O-Cx6Hb1Re.js → erDiagram-SSCWMZ5O-CVHhwI2_.js} +1 -1
  324. package/web-shell/assets/{flowDiagram-A5DVABFB-DTuLP7GU.js → flowDiagram-A5DVABFB-DWOFy1FK.js} +1 -1
  325. package/web-shell/assets/{ganttDiagram-EL5Y4UJY-DYS3d-sL.js → ganttDiagram-EL5Y4UJY-C0sxQtPd.js} +1 -1
  326. package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-Cp0EGx04.js → gitGraphDiagram-WWUBYQGX-CNituBYC.js} +1 -1
  327. package/web-shell/assets/index-B15NlwB8.js +2213 -0
  328. package/web-shell/assets/index-BSrS0tQ6.css +36 -0
  329. package/web-shell/assets/{index-45-LkPDB.js → index-gm9tLk7h.js} +1 -1
  330. package/web-shell/assets/{infoDiagram-RXCK75RN-9--kukiT.js → infoDiagram-RXCK75RN-CxhJYtIR.js} +1 -1
  331. package/web-shell/assets/{ishikawaDiagram-5VMMS53U-CGBdsDLD.js → ishikawaDiagram-5VMMS53U-By2mchUy.js} +1 -1
  332. package/web-shell/assets/{journeyDiagram-EYS64GPL-DeXhcscd.js → journeyDiagram-EYS64GPL-CVH-OweI.js} +1 -1
  333. package/web-shell/assets/{kanban-definition-3QL26DDD-CFdvsU3b.js → kanban-definition-3QL26DDD-Cc9dQXLy.js} +1 -1
  334. package/web-shell/assets/knowledge-Dg9788h4.svg +1 -0
  335. package/web-shell/assets/{layout-DAnwQ3KB.js → layout-C_60ysHw.js} +1 -1
  336. package/web-shell/assets/{linear-CTo7v7Nh.js → linear-BvAVfqwu.js} +1 -1
  337. package/web-shell/assets/{mermaid.core-jggSxF1i.js → mermaid.core-C3CoBKAc.js} +6 -6
  338. package/web-shell/assets/{mindmap-definition-FBJOCRG2-DzIepvlJ.js → mindmap-definition-FBJOCRG2-Cuu8Q8LM.js} +1 -1
  339. package/web-shell/assets/{pegDiagram-XKGWAZYB-BFGS9GJv.js → pegDiagram-XKGWAZYB-DmAeyDO2.js} +1 -1
  340. package/web-shell/assets/{pieDiagram-E7YTZNPT-B2UUcNIT.js → pieDiagram-E7YTZNPT-B7vbB_xv.js} +1 -1
  341. package/web-shell/assets/{quadrantDiagram-AXDQQJYC-BgM6htrX.js → quadrantDiagram-AXDQQJYC-BqOBkRR7.js} +1 -1
  342. package/web-shell/assets/{railroadDiagram-O6MQD6OU-Dk9cS7N-.js → railroadDiagram-O6MQD6OU-sI06lZIu.js} +1 -1
  343. package/web-shell/assets/{requirementDiagram-EFPCY7ZU-C9oRg7xi.js → requirementDiagram-EFPCY7ZU-Bg13d10S.js} +1 -1
  344. package/web-shell/assets/{sankeyDiagram-P5KCCOFB-B-_c7GzI.js → sankeyDiagram-P5KCCOFB-WFOzZHrR.js} +1 -1
  345. package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-R0M-347u.js → sequenceDiagram-WJ2MYXX4-CCdRbA4E.js} +1 -1
  346. package/web-shell/assets/{sizeCapture-X5ZJPWSS-Df0f8UAW.js → sizeCapture-X5ZJPWSS-BH5F3bGg.js} +1 -1
  347. package/web-shell/assets/{stateDiagram-HBIQ2CUA-CsUEfAA-.js → stateDiagram-HBIQ2CUA-NwS2X3QB.js} +1 -1
  348. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-1aU2JZXO.js +1 -0
  349. package/web-shell/assets/{swimlanes-XN3QIQJK-9OGHVSrx.js → swimlanes-XN3QIQJK-Bm38pM28.js} +1 -1
  350. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Dp-u6kQG.js +8 -0
  351. package/web-shell/assets/{timeline-definition-24CTP7MA-DAfGqS2B.js → timeline-definition-24CTP7MA-Do-agLSo.js} +1 -1
  352. package/web-shell/assets/{vennDiagram-4TSXK5OY-CKATpwHi.js → vennDiagram-4TSXK5OY-aggLfZzl.js} +1 -1
  353. package/web-shell/assets/{wardleyDiagram-VM6X3IG4-CQHdhTrm.js → wardleyDiagram-VM6X3IG4-D5JR3mXX.js} +1 -1
  354. package/web-shell/assets/{xychartDiagram-S5SC5T6Z-5k9NLqlY.js → xychartDiagram-S5SC5T6Z-DhtLDuXs.js} +1 -1
  355. package/web-shell/index.html +2 -2
  356. package/chunks/chunk-4OQSG35W.js +0 -1416
  357. package/chunks/chunk-7MIBD3LG.js +0 -137
  358. package/chunks/chunk-ARDHE6MM.js +0 -235
  359. package/chunks/chunk-C75BXMPM.js +0 -169
  360. package/chunks/chunk-ERU3SDXT.js +0 -27
  361. package/chunks/chunk-FPGTNKCP.js +0 -251
  362. package/chunks/chunk-JIJ65YKA.js +0 -2812
  363. package/chunks/chunk-JL6APGBX.js +0 -43
  364. package/chunks/chunk-SGXJQP5Q.js +0 -4172
  365. package/chunks/chunk-TPEV2QHG.js +0 -514
  366. package/chunks/chunk-YVWS4SLL.js +0 -137
  367. package/web-shell/assets/channel-DSQQnOZj.js +0 -1
  368. package/web-shell/assets/classDiagram-DTDB5LWJ-V94ta08R.js +0 -1
  369. package/web-shell/assets/classDiagram-v2-JRS7N3AN-V94ta08R.js +0 -1
  370. package/web-shell/assets/index-H8um-iEl.js +0 -2207
  371. package/web-shell/assets/index-n6N-2a3v.css +0 -36
  372. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-CnSuTPJ2.js +0 -1
  373. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Bb7TcWQw.js +0 -8
  374. package/chunks/{chunk-QZW6WRB7.js → chunk-5NUKK2DT.js} +2 -2
  375. package/chunks/{chunk-JS73NNWF.js → chunk-FUSEMYFX.js} +0 -0
  376. package/chunks/{chunk-SVWWF5TZ.js → chunk-WVURIAEE.js} +3 -3
  377. package/chunks/{task-update-RI7QNVDP.js → task-update-3LSYQDRW.js} +4 -4
@@ -15,69 +15,82 @@ import {
15
15
  WorkflowExecutionError,
16
16
  WorkflowJournal,
17
17
  WorkflowOrchestrator,
18
- compileWorkflowScript,
19
18
  createProductionDispatch,
20
- deleteInlineWorkflowScript,
21
- describeWorkflowCompileError,
22
- extractAndStripMeta,
23
- isSymlinkedRoot,
24
- persistInlineWorkflowScript,
19
+ describeWorkflowDeterminismViolations,
25
20
  readWorkflowAuthoringReference,
26
21
  resolveConcurrencyLimit,
27
- resolveMaxTokensPerWorkflow,
28
22
  resolveReviewWorkflowLimits,
29
- resolveSavedWorkflowScript,
30
23
  resolveWorkflowAuthoringSurface,
24
+ scanWorkflowScriptShape,
31
25
  toolSearchRevealSentence,
32
26
  writeWorkflowSnapshot
33
- } from "./chunk-SGXJQP5Q.js";
27
+ } from "./chunk-SFHX5G2S.js";
34
28
  import {
35
29
  RESUME_ARGS_TOO_LARGE_NOTE,
36
30
  buildFailureLines,
37
31
  buildResumeCall,
32
+ buildWorkflowSizeGuidelineParagraph,
33
+ compileWorkflowScript,
34
+ computeWorkflowScriptDigest,
35
+ deleteInlineWorkflowScript,
36
+ describeWorkflowCompileError,
37
+ evaluateWorkflowSize,
38
+ extractAndStripMeta,
39
+ findActiveExtensionWorkflowByPath,
40
+ findActiveExtensionWorkflowByPathCanonical,
41
+ getActiveExtensionWorkflows,
38
42
  getRuleDisplayName,
39
43
  getWorkflowTaskMutationKey,
40
44
  hasUninlinableResumeArgs,
45
+ isSymlinkedRoot,
41
46
  isTerminalWorkflowStatus,
42
47
  markWorkflowRunPersistenceActive,
48
+ parseExtensionWorkflowName,
49
+ persistInlineWorkflowScript,
50
+ readWorkflowSourceRef,
51
+ resolveSavedWorkflowScript,
43
52
  resolveToolName,
53
+ resolveWorkflowSizeCaps,
54
+ resolveWorkflowSizeGuidelineSetting,
44
55
  tryWithWorkflowTaskMutation
45
- } from "./chunk-WBP64MZR.js";
56
+ } from "./chunk-KAYC5FBN.js";
46
57
  import "./chunk-GOFAQQZA.js";
58
+ import "./chunk-65I7S4Z3.js";
47
59
  import "./chunk-HEOH7JZY.js";
48
60
  import "./chunk-TWPJO254.js";
49
61
  import "./chunk-CQ35AJ4Z.js";
50
- import "./chunk-65I7S4Z3.js";
62
+ import "./chunk-IVFTLUZD.js";
51
63
  import "./chunk-7CLLH5TI.js";
52
64
  import "./chunk-WK6DEH3Q.js";
53
65
  import "./chunk-6PVPNMXU.js";
54
- import "./chunk-4OQSG35W.js";
55
- import "./chunk-ME4JBHSB.js";
56
- import "./chunk-GNV2SFO7.js";
66
+ import "./chunk-DX6JTDMR.js";
67
+ import "./chunk-VQDWCQOE.js";
57
68
  import "./chunk-5EZRLTLQ.js";
58
69
  import "./chunk-QHWCP53L.js";
59
70
  import "./chunk-3LMDSCLU.js";
60
- import "./chunk-O6GEWCJA.js";
61
- import "./chunk-WKVZES7O.js";
62
- import "./chunk-NJ2OFVUX.js";
63
- import "./chunk-HFJSQ4GL.js";
64
71
  import "./chunk-QJNDUTOL.js";
72
+ import "./chunk-O6GEWCJA.js";
73
+ import "./chunk-CXONOVBN.js";
74
+ import "./chunk-OWUAZXXN.js";
75
+ import "./chunk-CH2YDT6X.js";
76
+ import "./chunk-P42KMMU6.js";
77
+ import "./chunk-BTICBRPL.js";
65
78
  import "./chunk-V545KI73.js";
66
- import "./chunk-MQRLLBMQ.js";
79
+ import "./chunk-ADN5KESB.js";
80
+ import "./chunk-PPJSG2PU.js";
67
81
  import "./chunk-ELRMZTPF.js";
68
82
  import "./chunk-U6H3XTFA.js";
69
83
  import "./chunk-ACHCT36C.js";
70
84
  import "./chunk-CHEIIBT3.js";
71
85
  import "./chunk-AEWCOE64.js";
72
- import "./chunk-OWUAZXXN.js";
73
- import "./chunk-CH2YDT6X.js";
74
86
  import "./chunk-JX6XHPTX.js";
75
87
  import "./chunk-ZSTCM3MX.js";
88
+ import "./chunk-SK3RZOPS.js";
76
89
  import "./chunk-MLXTMF7H.js";
77
- import "./chunk-AXZMWAJV.js";
90
+ import "./chunk-36SDZ2Q4.js";
78
91
  import "./chunk-NXUZFW3G.js";
79
92
  import "./chunk-WFNEY5G7.js";
80
- import "./chunk-GSS4SZNG.js";
93
+ import "./chunk-YP2K3WOS.js";
81
94
  import "./chunk-BW2SMO6L.js";
82
95
  import "./chunk-S6LOFUVP.js";
83
96
  import "./chunk-VVI7MK3V.js";
@@ -87,45 +100,42 @@ import "./chunk-IZ2U57NY.js";
87
100
  import "./chunk-Z72PLR74.js";
88
101
  import "./chunk-NUQ4GK5I.js";
89
102
  import "./chunk-NAVJD2PQ.js";
90
- import "./chunk-66N6C4EH.js";
91
- import "./chunk-FMLBBXHB.js";
103
+ import "./chunk-3WILPKTJ.js";
104
+ import "./chunk-DRAX5YAI.js";
92
105
  import "./chunk-S7UQ3V2H.js";
93
- import "./chunk-JL6APGBX.js";
94
106
  import {
95
107
  createAbortController,
96
108
  createChildAbortController
97
109
  } from "./chunk-DJ2GSRLV.js";
98
- import "./chunk-ZKIAGIGH.js";
99
- import "./chunk-VGY2RGXL.js";
100
- import "./chunk-C75BXMPM.js";
110
+ import "./chunk-3XBUCOWS.js";
111
+ import "./chunk-M4U2LTD2.js";
101
112
  import "./chunk-KFFCDLKV.js";
102
113
  import "./chunk-KP2FHIFR.js";
103
- import "./chunk-L6DIANLD.js";
114
+ import "./chunk-KEM7MWS7.js";
115
+ import "./chunk-G45B3INR.js";
104
116
  import {
105
117
  WorkflowRunEvent,
106
- logWorkflowRun
107
- } from "./chunk-FCLMJS6N.js";
118
+ WorkflowSizeWarningEvent,
119
+ logWorkflowRun,
120
+ logWorkflowSizeWarning
121
+ } from "./chunk-CDDP4ONL.js";
108
122
  import "./chunk-5ETULJLP.js";
109
- import "./chunk-7MIBD3LG.js";
110
123
  import "./chunk-VGC4I5JJ.js";
111
124
  import {
112
125
  isWithinRoot
113
- } from "./chunk-QZW6WRB7.js";
126
+ } from "./chunk-5NUKK2DT.js";
114
127
  import "./chunk-EDIDYZBT.js";
115
128
  import "./chunk-HD7O6WLV.js";
116
129
  import "./chunk-CFMZLE3L.js";
117
130
  import "./chunk-WZAD4ZNJ.js";
118
- import "./chunk-ARDHE6MM.js";
119
- import "./chunk-FPGTNKCP.js";
120
131
  import "./chunk-TIGXX4PA.js";
121
- import "./chunk-TPEV2QHG.js";
122
132
  import "./chunk-XFFRI3WM.js";
123
- import "./chunk-ERU3SDXT.js";
124
- import "./chunk-EWJTAP3Y.js";
133
+ import "./chunk-GJKP6XOB.js";
134
+ import "./chunk-7O5PYQ3M.js";
125
135
  import "./chunk-HHJLM3WQ.js";
126
136
  import {
127
137
  stripAnsiAndControl
128
- } from "./chunk-4Y2I3CI3.js";
138
+ } from "./chunk-6USYH3EU.js";
129
139
  import "./chunk-74TONY4F.js";
130
140
  import "./chunk-SYROIHU7.js";
131
141
  import {
@@ -163,6 +173,7 @@ var WorkflowRunHandle = class {
163
173
  this.scheduler = scheduler;
164
174
  this.scriptPath = locations.scriptPath;
165
175
  this.journalPath = locations.journalPath;
176
+ this.sourceRef = locations.sourceRef;
166
177
  this.completion = Promise.resolve().then(start);
167
178
  }
168
179
  static {
@@ -179,6 +190,7 @@ var WorkflowRunHandle = class {
179
190
  scriptPath;
180
191
  /** This run's resume journal, when the config has a `storage` to hold one. */
181
192
  journalPath;
193
+ sourceRef;
182
194
  abort() {
183
195
  this.controller.abort();
184
196
  }
@@ -189,13 +201,21 @@ var WorkflowRunHandle = class {
189
201
  return this.scheduler.resume();
190
202
  }
191
203
  };
204
+ var WORKFLOW_SCRIPT_SYNTAX_HINT = "Workflow scripts must be plain JavaScript \u2014 the usual causes are TypeScript syntax (type annotations, interfaces, generics) and broken string quoting or escaping. Metadata must use literal values.";
192
205
  var WorkflowScriptNotLaunchedError = class extends Error {
193
- constructor(detail) {
206
+ /**
207
+ * @param detail What is wrong with the script.
208
+ * @param hint The usual causes, appended after `detail`. Defaults to the
209
+ * syntax causes of a compile failure; a refusal with a cause of its own
210
+ * passes an empty hint, so the reader is not sent looking for TypeScript
211
+ * syntax that is not there.
212
+ */
213
+ constructor(detail, hint = WORKFLOW_SCRIPT_SYNTAX_HINT) {
194
214
  super(
195
215
  `Workflow script is invalid and was not launched:
196
- ${detail}
216
+ ${detail}` + (hint ? `
197
217
 
198
- Workflow scripts must be plain JavaScript \u2014 the usual causes are TypeScript syntax (type annotations, interfaces, generics) and broken string quoting or escaping. Metadata must use literal values.`
218
+ ${hint}` : "")
199
219
  );
200
220
  this.detail = detail;
201
221
  this.name = "WorkflowScriptNotLaunchedError";
@@ -235,7 +255,10 @@ var WorkflowRunner = class {
235
255
  static async startClaimed(options) {
236
256
  const config = options.config;
237
257
  const runInBackground = options.runInBackground === true;
238
- const budget = WorkflowBudgetImpl.fromEnv();
258
+ const budget = WorkflowBudgetImpl.fromConfig(config);
259
+ const sizeCaps = resolveWorkflowSizeCaps(
260
+ config.getWorkflowSizeGuideline?.() ?? resolveWorkflowSizeGuidelineSetting(void 0)
261
+ );
239
262
  const runId = options.resumeFromRunId ?? `wf_${randomBytes(8).toString("hex")}`;
240
263
  const registry = config.getWorkflowRunRegistry?.();
241
264
  let entry;
@@ -261,12 +284,13 @@ var WorkflowRunner = class {
261
284
  let script;
262
285
  let scriptPath;
263
286
  let resumeReplay;
287
+ let sourceRef;
264
288
  let persistedInlineScript = false;
265
289
  let callerWasAbortedBeforeStart;
266
290
  let orchestrator;
267
291
  let reviewLimits;
268
292
  try {
269
- const loaded = options.scriptPath && options.script === void 0 ? await resolveSavedWorkflowScript(
293
+ const loaded = options.loadScript ? await options.loadScript() : options.scriptPath && options.script === void 0 ? await resolveSavedWorkflowScript(
270
294
  { scriptPath: options.scriptPath },
271
295
  config
272
296
  ) : void 0;
@@ -290,9 +314,45 @@ var WorkflowRunner = class {
290
314
  )
291
315
  );
292
316
  }
317
+ const determinismViolations = scanWorkflowScriptShape(script).determinismViolations;
318
+ if (determinismViolations.length > 0) {
319
+ throw new WorkflowScriptNotLaunchedError(
320
+ describeWorkflowDeterminismViolations(determinismViolations),
321
+ ""
322
+ );
323
+ }
293
324
  resumeReplay = options.resumeFromRunId ? await journal?.load() : void 0;
325
+ sourceRef = readWorkflowSourceRef(options.sourceRef);
326
+ if (resumeReplay?.sourceError) throw new Error(resumeReplay.sourceError);
327
+ if (options.resumeFromRunId) {
328
+ const original = resumeReplay?.sourceRef;
329
+ if (sourceRef && (!original || sourceRef.id !== original.id || sourceRef.revision !== original.revision)) {
330
+ throw new Error(
331
+ "Workflow sourceRef must match the original journal. Start a new run to use a different source."
332
+ );
333
+ }
334
+ if (previousEntry?.sourceRef && !original) {
335
+ throw new Error(
336
+ "Workflow source metadata is missing from its journal."
337
+ );
338
+ }
339
+ sourceRef = original;
340
+ }
294
341
  assertStartNotCancelled();
295
342
  callerWasAbortedBeforeStart = options.signal.aborted;
343
+ if (journal && !await journal.ensureExists()) {
344
+ journalPath = void 0;
345
+ }
346
+ if (sourceRef) {
347
+ if (!journal || !journalPath) {
348
+ throw new Error(
349
+ "Workflow sourceRef requires a writable resume journal."
350
+ );
351
+ }
352
+ if (!options.resumeFromRunId) {
353
+ await journal.append({ type: "source", version: 1, sourceRef });
354
+ }
355
+ }
296
356
  if (options.script !== void 0 && scriptPath === void 0) {
297
357
  const persisted = await persistInlineWorkflowScript(
298
358
  config,
@@ -302,9 +362,6 @@ var WorkflowRunner = class {
302
362
  scriptPath = persisted ?? void 0;
303
363
  persistedInlineScript = persisted !== null;
304
364
  }
305
- if (journal && !await journal.ensureExists()) {
306
- journalPath = void 0;
307
- }
308
365
  assertStartNotCancelled();
309
366
  const dispatch = options.dispatch ?? createProductionDispatch(
310
367
  config,
@@ -324,12 +381,15 @@ var WorkflowRunner = class {
324
381
  runId,
325
382
  toolUseId: options.toolUseId,
326
383
  ...workflowName ? { workflowName } : {},
384
+ ...sourceRef ? { sourceRef } : {},
327
385
  meta: null,
328
386
  status: "running",
329
387
  startTime: Date.now(),
330
388
  outputFile: "",
331
389
  abortController: controller,
332
- tokenBudgetTotal: budget.total,
390
+ // The registry and `/workflows` show one run: a turn target is not
391
+ // this run's cap, and its spend is not this run's alone.
392
+ tokenBudgetTotal: budget.runCap(),
333
393
  script,
334
394
  scriptPath,
335
395
  ...journalPath ? { journalPath } : {},
@@ -370,7 +430,39 @@ var WorkflowRunner = class {
370
430
  } catch {
371
431
  }
372
432
  }, "emitUpdate");
433
+ const maybeWarnSize = /* @__PURE__ */ __name(() => {
434
+ const current = registry?.get(runId);
435
+ if (!registry || !current || current.sizeWarning !== void 0) return;
436
+ let scheduledAgents = 0;
437
+ let settledAgents = 0;
438
+ for (const dispatch of current.dispatches) {
439
+ if (dispatch.status === "cached") continue;
440
+ scheduledAgents++;
441
+ if (dispatch.status === "completed" || dispatch.status === "failed" || dispatch.status === "cancelled") {
442
+ settledAgents++;
443
+ }
444
+ }
445
+ const warning = evaluateWorkflowSize(
446
+ { scheduledAgents, settledAgents, tokensSpent: current.tokensSpent },
447
+ sizeCaps
448
+ );
449
+ if (!warning || !registry.onSizeWarning(runId, warning)) return;
450
+ try {
451
+ logWorkflowSizeWarning(config, new WorkflowSizeWarningEvent(warning));
452
+ } catch {
453
+ }
454
+ }, "maybeWarnSize");
373
455
  const emitter = {
456
+ workflowCallUpdated: /* @__PURE__ */ __name((call) => {
457
+ if (!isCurrentEntry()) return;
458
+ registry?.onWorkflowCallUpdated(runId, call);
459
+ emitUpdate();
460
+ }, "workflowCallUpdated"),
461
+ workflowCallsTruncated: /* @__PURE__ */ __name(() => {
462
+ if (!isCurrentEntry()) return;
463
+ registry?.onWorkflowCallsTruncated(runId);
464
+ emitUpdate();
465
+ }, "workflowCallsTruncated"),
374
466
  phaseStarted: /* @__PURE__ */ __name((title) => {
375
467
  if (!isCurrentEntry()) return;
376
468
  registry?.onPhaseStarted(runId, title);
@@ -388,6 +480,7 @@ var WorkflowRunner = class {
388
480
  dispatchQueued: /* @__PURE__ */ __name((event) => {
389
481
  if (!isCurrentEntry()) return;
390
482
  registry?.onDispatchQueued(runId, event);
483
+ maybeWarnSize();
391
484
  emitUpdate();
392
485
  }, "dispatchQueued"),
393
486
  dispatchStarted: /* @__PURE__ */ __name((dispatchId, startedAt) => {
@@ -415,6 +508,7 @@ var WorkflowRunner = class {
415
508
  budgetUpdated: /* @__PURE__ */ __name((spent, total) => {
416
509
  if (!isCurrentEntry()) return;
417
510
  registry?.onBudgetUpdated(runId, spent, total);
511
+ maybeWarnSize();
418
512
  emitUpdate();
419
513
  }, "budgetUpdated"),
420
514
  resumeRespawn: /* @__PURE__ */ __name((line) => {
@@ -528,7 +622,8 @@ var WorkflowRunner = class {
528
622
  },
529
623
  {
530
624
  ...scriptPath ? { scriptPath } : {},
531
- ...journalPath ? { journalPath } : {}
625
+ ...journalPath ? { journalPath } : {},
626
+ ...sourceRef ? { sourceRef } : {}
532
627
  }
533
628
  );
534
629
  registry?.attachHandle(handle);
@@ -551,13 +646,27 @@ import * as path from "node:path";
551
646
  var WORKFLOW_PARAM_SCHEMA = {
552
647
  type: "object",
553
648
  properties: {
649
+ sourceRef: {
650
+ type: "object",
651
+ description: "Optional caller-supplied definition id and revision for run correlation. Requires a writable journal; omit for ordinary workflows.",
652
+ properties: {
653
+ id: { type: "string", minLength: 1, maxLength: 256 },
654
+ revision: { type: "string", minLength: 1, maxLength: 256 }
655
+ },
656
+ required: ["id", "revision"],
657
+ additionalProperties: false
658
+ },
554
659
  script: {
555
660
  type: "string",
556
661
  description: "JavaScript source of the workflow, wrapped as an async IIFE: top-level `await` and `return` are both legal, and a trailing expression is NOT a return value. Uses the injected globals `phase()`, `log()`, `agent()`, `parallel()`, `pipeline()`, `workflow()`, `args` and `budget`, and cannot import anything. May start with a literal `export const meta = {...}` (stripped before execution). `Math.random()` and all of `Date` (`new Date()`, `Date.now()` included) throw \u2014 a script must be deterministic for resume, so pass timestamps in via `args` or stamp the result after the run returns. Pass THUNKS to parallel(), not eager calls: `parallel([() => agent(...)])`, not `parallel([agent(...)])`."
557
662
  },
558
663
  scriptPath: {
559
664
  type: "string",
560
- description: "Optional. Absolute path to a workflow `.js` file to load and run instead of inline `script`. Primarily set by the `/<name>` saved-workflow slash command; a tool that generated a script for this run hands you its path the same way. The file must resolve inside a saved-workflow directory (`.qwen/workflows`, `~/.qwen/workflows`) or the generated-scripts root (`$QWEN_CODE_PROJECT_DIR/workflows/generated` \u2014 the per-project runtime dir, not the project tree) \u2014 any other path is refused. Provide exactly ONE of `script` or `scriptPath`. The file is read at execution time, so edits to a saved workflow take effect on the next run. An inline `script` is persisted to `<generated root>/inline/<runId>.js` and that path comes back in the result, so a resume passes the path instead of the source."
665
+ description: "Optional. Absolute path to a workflow `.js` file to load and run instead of inline `script`. Primarily set by the `/<name>` saved-workflow slash command; a tool that generated a script for this run hands you its path the same way. The file must resolve inside a saved-workflow directory (`.qwen/workflows`, `~/.qwen/workflows`), be a workflow file an active extension ships, or sit under the generated-scripts root (`$QWEN_CODE_PROJECT_DIR/workflows/generated` \u2014 the per-project runtime dir, not the project tree) \u2014 any other path is refused. Provide exactly ONE of `script`, `scriptPath` or `name`. The file is read once per call, before approval, so edits to a saved workflow take effect on the next call. An inline `script` is persisted to `<generated root>/inline/<runId>.js` and that path comes back in the result, so a resume passes the path instead of the source."
666
+ },
667
+ name: {
668
+ type: "string",
669
+ description: "Optional. Name of a saved workflow to run instead of inline `script`: `<name>` for one in `.qwen/workflows` or `~/.qwen/workflows`, or `<extension>:<name>` for one an active extension ships. Provide exactly ONE of `script`, `scriptPath` or `name`."
561
670
  },
562
671
  args: {
563
672
  description: "Optional structured value bound to the `args` global. Pass actual JSON, not a stringified value."
@@ -572,10 +681,10 @@ var WORKFLOW_PARAM_SCHEMA = {
572
681
  description: "Optional. When true, start the workflow under the interactive session and return a run handle immediately. The Background Tasks view can observe, cooperatively pause/resume, or stop it, and completion is delivered to the conversation when the run settles. Interactive TUI only. Defaults to false."
573
682
  }
574
683
  }
575
- // `script` is required UNLESS `scriptPath` is supplied; this XOR can't be
576
- // expressed as a plain `required` list, so it's enforced in
577
- // `validateToolParamValues`. Inline authoring (the LLM path) should always
578
- // pass `script`; the `scriptPath` property description states the XOR.
684
+ // Exactly one of `script`, `scriptPath` and `name`; that can't be expressed
685
+ // as a plain `required` list, so it's enforced in `validateToolParamValues`.
686
+ // Inline authoring (the LLM path) passes `script`; the `scriptPath` and
687
+ // `name` property descriptions state the rule.
579
688
  };
580
689
  var WorkflowToolInvocation = class extends BaseToolInvocation {
581
690
  constructor(config, toolOptions, params, authoringHint, workflowName) {
@@ -600,7 +709,7 @@ var WorkflowToolInvocation = class extends BaseToolInvocation {
600
709
  if (!this.authoringHint) return null;
601
710
  return isScriptAuthoredByThisCall(
602
711
  this.config,
603
- this.workflowName,
712
+ this.workflowName ?? this.params.name,
604
713
  this.params.scriptPath
605
714
  ) ? this.authoringHint : null;
606
715
  }
@@ -619,25 +728,82 @@ var WorkflowToolInvocation = class extends BaseToolInvocation {
619
728
  }
620
729
  return this.metaCache;
621
730
  }
731
+ /**
732
+ * The file a `scriptPath` or `name` call runs, read once. The permission
733
+ * check, the approval dialog and the run all use this one read, so the
734
+ * script the user approved is the script that runs, even when the file
735
+ * changes while the dialog is open.
736
+ */
737
+ scriptLoad;
738
+ /** {@link scriptLoad} once settled, for the synchronous rule-match hook. */
739
+ settledScriptLoad;
740
+ loadReferencedScript() {
741
+ if (this.params.script !== void 0) return void 0;
742
+ const { name, scriptPath } = this.params;
743
+ if (!name && !scriptPath) return void 0;
744
+ this.scriptLoad ??= (async () => {
745
+ try {
746
+ const loaded = await resolveSavedWorkflowScript(
747
+ name ? name : { scriptPath },
748
+ this.config
749
+ );
750
+ return {
751
+ ok: true,
752
+ loaded,
753
+ digest: computeWorkflowScriptDigest(loaded.script)
754
+ };
755
+ } catch (error) {
756
+ return { ok: false, error };
757
+ }
758
+ })().then((load) => {
759
+ this.settledScriptLoad = load;
760
+ return load;
761
+ });
762
+ return this.scriptLoad;
763
+ }
622
764
  getDescription() {
623
765
  const meta = this.resolveMeta();
624
766
  if (meta) {
625
767
  return `Run workflow: ${sanitizeLine(meta.name)}`;
626
768
  }
769
+ if (this.params.name && this.params.script === void 0) {
770
+ const kind = parseExtensionWorkflowName(this.params.name) ? "extension" : "saved";
771
+ return `Run ${kind} workflow (${sanitizeLine(this.params.name)})`;
772
+ }
627
773
  if (this.params.scriptPath && this.params.script === void 0) {
628
- const kind = isGeneratedWorkflowScriptPath(
774
+ if (isGeneratedWorkflowScriptPath(this.config, this.params.scriptPath)) {
775
+ return `Run generated workflow script (${path.basename(this.params.scriptPath)})`;
776
+ }
777
+ const extensionWorkflow = findActiveExtensionWorkflowByPath(
629
778
  this.config,
630
779
  this.params.scriptPath
631
- ) ? "generated workflow script" : "saved workflow";
632
- return `Run ${kind} (${path.basename(this.params.scriptPath)})`;
780
+ );
781
+ if (extensionWorkflow) {
782
+ return `Run extension workflow (${sanitizeLine(extensionWorkflow.name)})`;
783
+ }
784
+ return `Run saved workflow (${path.basename(this.params.scriptPath)})`;
633
785
  }
634
786
  return `Run a workflow script (${this.params.script?.length ?? 0} chars)`;
635
787
  }
636
788
  toolLocations() {
637
789
  return [];
638
790
  }
639
- getDefaultPermission() {
640
- return Promise.resolve("ask");
791
+ async getDefaultPermission() {
792
+ const load = await this.loadReferencedScript();
793
+ return load && !load.ok ? "allow" : "ask";
794
+ }
795
+ /**
796
+ * An "always allow" for a saved or extension workflow is pinned to the
797
+ * script it approved: `Workflow(name:gcp:audit,sha256:…)`. The digest is
798
+ * computed from the file this call loaded. A `sha256` the model passed is
799
+ * overwritten, and a call that loaded nothing matches no digest.
800
+ */
801
+ getPermissionMatchParams() {
802
+ const load = this.settledScriptLoad;
803
+ return {
804
+ ...this.params,
805
+ [WORKFLOW_RULE_DIGEST_KEY]: load?.ok ? load.digest : void 0
806
+ };
641
807
  }
642
808
  /**
643
809
  * Show what is about to run, and scope the grant that approves it.
@@ -658,12 +824,16 @@ var WorkflowToolInvocation = class extends BaseToolInvocation {
658
824
  * empty `permissionRules` stops `injectPermissionRulesIfMissing` from
659
825
  * supplying the bare-tool-name rule, which `buildPermissionRules`
660
826
  * documents as matching *all* invocations.
661
- * - A `scriptPath` names a file on disk that the user chose, so it can be
662
- * pre-approved — but scoped to that path. The rule is built with the
663
- * same helpers the matcher uses so a tool rename moves both sides.
827
+ * - A `scriptPath` or `name` names a file on disk that the user chose,
828
+ * so it can be pre-approved — scoped to that path or name, and pinned
829
+ * to the digest of the content shown here, so a changed script asks
830
+ * again. The rule is built with the same helpers the matcher uses so a
831
+ * tool rename moves both sides.
664
832
  */
665
833
  async getConfirmationDetails(_abortSignal) {
666
- const meta = this.resolveMeta();
834
+ const load = await this.loadReferencedScript();
835
+ const loaded = load?.ok ? load : void 0;
836
+ const meta = loaded ? readMetaForConfirmation(loaded.loaded.script) : this.resolveMeta();
667
837
  const isGeneratedScriptPath = this.params.scriptPath !== void 0 && await isGeneratedWorkflowScriptPathCanonical(
668
838
  this.config,
669
839
  this.params.scriptPath
@@ -672,17 +842,29 @@ var WorkflowToolInvocation = class extends BaseToolInvocation {
672
842
  this.params.scriptPath,
673
843
  path.dirname(this.config.storage.getInlineWorkflowScriptPath("wf_0"))
674
844
  );
845
+ const extensionWorkflow = isGeneratedScriptPath ? void 0 : this.params.name ? getActiveExtensionWorkflows(this.config).find(
846
+ (workflow) => workflow.name === this.params.name
847
+ ) : this.params.scriptPath !== void 0 ? await findActiveExtensionWorkflowByPathCanonical(
848
+ this.config,
849
+ this.params.scriptPath
850
+ ) : void 0;
675
851
  const body = buildConfirmationPrompt(
676
852
  this.params,
677
853
  meta,
678
- isGeneratedScriptPath
854
+ isGeneratedScriptPath ? { kind: "generated" } : extensionWorkflow ? { kind: "extension", workflow: extensionWorkflow } : { kind: "saved" },
855
+ loaded ? {
856
+ scriptPath: loaded.loaded.scriptPath,
857
+ script: loaded.loaded.script,
858
+ digest: loaded.digest
859
+ } : load ? { error: describeLoadError(load) } : void 0
679
860
  );
680
861
  const banner = resolveUsageBanner(
681
862
  this.config,
682
863
  this.config.getWorkflowRunRegistry?.(),
683
- resolveMaxTokensPerWorkflow()
864
+ WorkflowBudgetImpl.fromConfig(this.config)
684
865
  );
685
866
  const isInlineScript = this.params.script !== void 0 || isGeneratedInlineScriptPath;
867
+ const grantRule = isInlineScript || !loaded ? void 0 : buildWorkflowGrantRule(this.params, loaded.digest);
686
868
  const details = {
687
869
  type: "info",
688
870
  title: "Run a dynamic workflow?",
@@ -690,10 +872,8 @@ var WorkflowToolInvocation = class extends BaseToolInvocation {
690
872
  // The body is a script excerpt and a phase list: rendering it as
691
873
  // Markdown would swallow the very characters the reader needs to see.
692
874
  renderPromptAsPlainText: true,
693
- hideAlwaysAllow: isInlineScript,
694
- permissionRules: isInlineScript ? [] : [
695
- `${getRuleDisplayName(resolveToolName(ToolNames.WORKFLOW))}(scriptPath:${this.params.scriptPath})`
696
- ],
875
+ hideAlwaysAllow: grantRule === void 0,
876
+ permissionRules: grantRule ? [grantRule] : [],
697
877
  onConfirm: /* @__PURE__ */ __name(async (_outcome, _payload) => {
698
878
  }, "onConfirm")
699
879
  };
@@ -704,6 +884,7 @@ var WorkflowToolInvocation = class extends BaseToolInvocation {
704
884
  if (runInBackground && signal.aborted) {
705
885
  return startCancelledResult();
706
886
  }
887
+ const load = this.loadReferencedScript();
707
888
  let handle;
708
889
  try {
709
890
  handle = await WorkflowRunner.start({
@@ -714,7 +895,9 @@ var WorkflowToolInvocation = class extends BaseToolInvocation {
714
895
  ...authoringHintOption(this.authoredScriptHint()),
715
896
  script: this.params.script,
716
897
  scriptPath: this.params.scriptPath,
898
+ ...load ? { loadScript: /* @__PURE__ */ __name(() => unwrapScriptLoad(load), "loadScript") } : {},
717
899
  args: this.params.args,
900
+ sourceRef: this.params.sourceRef,
718
901
  resumeFromRunId: this.params.resumeFromRunId,
719
902
  dispatch: this.toolOptions.dispatch,
720
903
  runInBackground,
@@ -744,12 +927,13 @@ ${hint}` : error.message;
744
927
  const usageBanner = resolveUsageBanner(
745
928
  this.config,
746
929
  handle.registry,
747
- handle.budget.total
930
+ handle.budget
748
931
  );
749
932
  return {
750
933
  workflowRunId: handle.runId,
751
934
  ...handle.scriptPath ? { scriptPath: handle.scriptPath } : {},
752
935
  ...handle.journalPath ? { journalPath: handle.journalPath } : {},
936
+ ...handle.sourceRef ? { sourceRef: handle.sourceRef } : {},
753
937
  llmContent: [
754
938
  {
755
939
  text: buildBackgroundStartText(handle, status)
@@ -764,11 +948,12 @@ ${hint}` : error.message;
764
948
  const usageBanner = resolveUsageBanner(
765
949
  this.config,
766
950
  handle.registry,
767
- handle.budget.total
951
+ handle.budget
768
952
  );
769
953
  const llmText = safeStringifyResult(outcome.result);
770
954
  const displayJson = safeStringifyDisplayPayload({
771
955
  runId: outcome.runId,
956
+ ...handle.sourceRef ? { sourceRef: handle.sourceRef } : {},
772
957
  ...outcome.meta ? { meta: outcome.meta } : {},
773
958
  phases: outcome.phases,
774
959
  logs: outcome.logs,
@@ -779,16 +964,23 @@ ${hint}` : error.message;
779
964
  // tokens whenever ANY usage is reported OR a cap is set, not
780
965
  // only when spend > 0. A capped-but-zero-spend run still wants
781
966
  // the cap visible so the user sees the gate engaged.
782
- ...handle.budget.spent() > 0 || handle.budget.total !== null ? {
967
+ // Per run, like `/workflows`; a turn target adds the turn's figures
968
+ // beside them rather than in place of them.
969
+ ...handle.budget.runSpent() > 0 || handle.budget.total !== null ? {
783
970
  tokens: {
784
- spent: handle.budget.spent(),
785
- total: handle.budget.total
971
+ spent: handle.budget.runSpent(),
972
+ total: handle.budget.runCap(),
973
+ ...handle.budget.source === "directive" ? {
974
+ turnSpent: handle.budget.spent(),
975
+ turnTotal: handle.budget.total
976
+ } : {}
786
977
  }
787
978
  } : {}
788
979
  });
789
980
  return {
790
981
  ...handle.scriptPath ? { scriptPath: handle.scriptPath } : {},
791
982
  ...handle.journalPath ? { journalPath: handle.journalPath } : {},
983
+ ...handle.sourceRef ? { sourceRef: handle.sourceRef } : {},
792
984
  // Two parts: the script's return value is left exactly as it was,
793
985
  // and the run handle follows as a separate part. Note what this does
794
986
  // NOT mean — `convertToFunctionResponse` joins the text parts with a
@@ -833,6 +1025,7 @@ ${safeStringifyDisplayPayload(
833
1025
  return {
834
1026
  ...handle.scriptPath ? { scriptPath: handle.scriptPath } : {},
835
1027
  ...handle.journalPath ? { journalPath: handle.journalPath } : {},
1028
+ ...handle.sourceRef ? { sourceRef: handle.sourceRef } : {},
836
1029
  // The failure message alone names what threw but not where to look:
837
1030
  // the logs the runtime already mirrored (`dispatch failed (result not
838
1031
  // consumed)` and friends) only reached `returnDisplay`, which the
@@ -880,9 +1073,10 @@ function buildRunTrailer(config, handle, args, logs, includeResume = true, autho
880
1073
  `agents: ${entry.dispatches.length} dispatched` + (respawned > 0 ? ` (${respawned} re-ran from a prior run)` : "") + ` \xB7 ${countByStatus("completed")} completed \xB7 ${countByStatus("cached")} cached \xB7 ${failedCount} failed \xB7 ${countByStatus("cancelled")} cancelled`
881
1074
  );
882
1075
  }
883
- const spent = handle.budget.spent();
1076
+ const budget = handle.budget;
1077
+ const runSpent = budget.runSpent();
884
1078
  lines.push(
885
- handle.budget.total === null ? `tokens: ${spent} spent (no cap)` : `tokens: ${spent} / ${handle.budget.total} spent`
1079
+ budget.source === "directive" && budget.total !== null ? `tokens: ${runSpent} spent by this run \xB7 ${budget.spent()} / ${budget.total} this turn` + (budget.directiveText ? ` (${sanitizeLine(budget.directiveText)} directive)` : "") : budget.total === null ? `tokens: ${runSpent} spent (no cap)` : `tokens: ${runSpent} / ${budget.total} spent`
886
1080
  );
887
1081
  const failures = entry ? buildFailureLines(entry) : [];
888
1082
  if (failures.length > 0 && entry) {
@@ -899,7 +1093,8 @@ function buildRunTrailer(config, handle, args, logs, includeResume = true, autho
899
1093
  args
900
1094
  });
901
1095
  if (resume && includeResume) {
902
- const pathAdvice = entry?.workflowName || !isGeneratedWorkflowScriptPath(config, handle.scriptPath) ? "this reads the saved workflow; copy it before making a run-specific change" : "edit that generated copy first if the script needs to change";
1096
+ const isExtensionWorkflow = entry?.workflowName !== void 0 && parseExtensionWorkflowName(entry.workflowName) !== null || findActiveExtensionWorkflowByPath(config, handle.scriptPath) !== void 0;
1097
+ const pathAdvice = isExtensionWorkflow ? "this reads an extension's workflow file; copy it into .qwen/workflows before making a run-specific change" : entry?.workflowName || !isGeneratedWorkflowScriptPath(config, handle.scriptPath) ? "this reads the saved workflow; copy it before making a run-specific change" : "edit that generated copy first if the script needs to change";
903
1098
  const journalAdvice = handle.journalPath ? "the journal replays the longest unchanged prefix of agent() calls, and the first changed call onward runs live" : "no journal was written for this run, so every agent() call runs live";
904
1099
  lines.push(`resume: ${resume} \u2014 ${pathAdvice}; ${journalAdvice}.`);
905
1100
  if (hasUninlinableResumeArgs({ runId: handle.runId, args })) {
@@ -967,16 +1162,18 @@ function buildLivePhaseTreeDisplay(entry) {
967
1162
  }
968
1163
  }
969
1164
  __name(buildLivePhaseTreeDisplay, "buildLivePhaseTreeDisplay");
970
- function resolveUsageBanner(config, registry, budgetTotal) {
1165
+ function resolveUsageBanner(config, registry, budget) {
971
1166
  if (!registry) return "";
972
1167
  if (config.getSkipWorkflowUsageWarning?.()) return "";
973
1168
  if (!registry.shouldShowUsageWarning()) return "";
974
- return buildUsageBanner(budgetTotal);
1169
+ return buildUsageBanner(budget);
975
1170
  }
976
1171
  __name(resolveUsageBanner, "resolveUsageBanner");
977
1172
  var CONFIRM_SCRIPT_EXCERPT_CHARS = 1200;
978
1173
  var CONFIRM_ARGS_CHARS = 300;
979
1174
  var CONFIRM_MAX_PHASES = 12;
1175
+ var CONFIRM_MAX_STRUCTURE_ROWS = 12;
1176
+ var CONFIRM_STRUCTURE_HEADING = "Structure (where the script calls agent(); a loop or a fan-out runs each call many times):";
980
1177
  function sanitizeLine(text) {
981
1178
  return stripAnsiAndControl(text);
982
1179
  }
@@ -1027,16 +1224,40 @@ async function isWorkflowScriptPathWithinCanonicalRoot(scriptPath, root) {
1027
1224
  return isWithinRoot(realScriptPath, realRoot);
1028
1225
  }
1029
1226
  __name(isWorkflowScriptPathWithinCanonicalRoot, "isWorkflowScriptPathWithinCanonicalRoot");
1030
- function buildConfirmationPrompt(params, meta, isGeneratedScriptPath) {
1227
+ function buildConfirmationPrompt(params, meta, provenance, referenced) {
1031
1228
  const lines = [];
1032
- if (meta) {
1033
- lines.push(`Workflow: ${sanitizeLine(meta.name)}`);
1034
- lines.push(sanitizeLine(meta.description));
1035
- } else if (params.scriptPath) {
1036
- const label = isGeneratedScriptPath ? "Generated workflow script" : "Saved workflow";
1037
- lines.push(`${label}: ${sanitizeLine(params.scriptPath)}`);
1229
+ const loaded = referenced && "script" in referenced ? referenced : void 0;
1230
+ const loadError = referenced && "error" in referenced ? referenced.error : void 0;
1231
+ const isReference = params.script === void 0 && Boolean(params.name || params.scriptPath);
1232
+ if (!isReference) {
1233
+ if (meta) {
1234
+ lines.push(`Workflow: ${sanitizeLine(meta.name)}`);
1235
+ lines.push(sanitizeLine(meta.description));
1236
+ } else {
1237
+ lines.push("Workflow: (the script declares no meta block)");
1238
+ }
1239
+ } else if (provenance.kind === "extension") {
1240
+ lines.push(`Extension workflow: ${sanitizeLine(provenance.workflow.name)}`);
1241
+ lines.push(sanitizeLine(provenance.workflow.description));
1242
+ lines.push(
1243
+ "",
1244
+ `Loaded from: ${sanitizeLine(params.scriptPath ?? loaded?.scriptPath ?? provenance.workflow.scriptPath)}`
1245
+ );
1038
1246
  } else {
1039
- lines.push("Workflow: (the script declares no meta block)");
1247
+ const label = provenance.kind === "generated" ? "Generated workflow script" : "Saved workflow";
1248
+ lines.push(
1249
+ `${label}: ${sanitizeLine(params.name || params.scriptPath || "")}`
1250
+ );
1251
+ if (meta) {
1252
+ lines.push(`Workflow: ${sanitizeLine(meta.name)}`);
1253
+ lines.push(sanitizeLine(meta.description));
1254
+ }
1255
+ if (params.name && loaded) {
1256
+ lines.push("", `Loaded from: ${sanitizeLine(loaded.scriptPath)}`);
1257
+ }
1258
+ }
1259
+ if (loadError !== void 0) {
1260
+ lines.push("", `Cannot load the script: ${sanitizeLine(loadError)}`);
1040
1261
  }
1041
1262
  if (meta?.phases?.length) {
1042
1263
  const shown = meta.phases.slice(0, CONFIRM_MAX_PHASES);
@@ -1049,8 +1270,12 @@ function buildConfirmationPrompt(params, meta, isGeneratedScriptPath) {
1049
1270
  lines.push(` \u2026 and ${meta.phases.length - shown.length} more`);
1050
1271
  }
1051
1272
  }
1052
- if (params.scriptPath && meta) {
1053
- lines.push("", `Loaded from: ${sanitizeLine(params.scriptPath)}`);
1273
+ const structureSource = params.script || loaded?.script;
1274
+ if (structureSource) {
1275
+ const structure = buildConfirmationStructure(structureSource);
1276
+ if (structure.length > 0) {
1277
+ lines.push("", CONFIRM_STRUCTURE_HEADING, ...structure);
1278
+ }
1054
1279
  }
1055
1280
  if (params.resumeFromRunId) {
1056
1281
  lines.push("", `Resuming run: ${sanitizeLine(params.resumeFromRunId)}`);
@@ -1067,26 +1292,67 @@ function buildConfirmationPrompt(params, meta, isGeneratedScriptPath) {
1067
1292
  `Args: ${clampForDisplay(sanitizeLine(rendered), CONFIRM_ARGS_CHARS)}`
1068
1293
  );
1069
1294
  }
1070
- if (params.script) {
1295
+ const scriptText = params.script || loaded?.script;
1296
+ if (scriptText) {
1071
1297
  lines.push(
1072
1298
  "",
1073
- "Script:",
1074
- clampForDisplay(
1075
- sanitizeBlock(params.script),
1076
- CONFIRM_SCRIPT_EXCERPT_CHARS
1077
- )
1299
+ loaded ? `Script (${WORKFLOW_RULE_DIGEST_KEY} ${loaded.digest}):` : "Script:",
1300
+ clampForDisplay(sanitizeBlock(scriptText), CONFIRM_SCRIPT_EXCERPT_CHARS)
1078
1301
  );
1079
1302
  }
1080
1303
  return lines.join("\n");
1081
1304
  }
1082
1305
  __name(buildConfirmationPrompt, "buildConfirmationPrompt");
1083
- function buildUsageBanner(total) {
1084
- if (total === null) {
1085
- return `> Workflows have no per-run token cap. Set \`${MAX_TOKENS_PER_WORKFLOW_ENV}=<n>\` (env) for a soft cap. Suppress this notice with \`skipWorkflowUsageWarning: true\` in settings.
1306
+ function buildConfirmationStructure(script) {
1307
+ const shape = scanWorkflowScriptShape(script);
1308
+ const shown = shape.rows.slice(0, CONFIRM_MAX_STRUCTURE_ROWS);
1309
+ const lines = shown.map((row) => {
1310
+ const label = row.kind === "loop" ? `loop ${sanitizeLine(row.condition ?? "")}` : row.kind;
1311
+ if (row.count === 0) {
1312
+ return ` ${label} \u2014 runs functions built elsewhere in the script`;
1313
+ }
1314
+ const sites = row.count > 1 ? `, ${row.count} agent() call sites` : "";
1315
+ const prompts = row.prompts.map((prompt) => `"${sanitizeLine(prompt)}"`).join(", ");
1316
+ return prompts ? ` ${label}${sites} \u2014 ${prompts}` : ` ${label}${sites}`;
1317
+ });
1318
+ if (shape.rows.length > shown.length) {
1319
+ lines.push(` \u2026 and ${shape.rows.length - shown.length} more`);
1320
+ }
1321
+ return lines;
1322
+ }
1323
+ __name(buildConfirmationStructure, "buildConfirmationStructure");
1324
+ var WORKFLOW_RULE_DIGEST_KEY = "sha256";
1325
+ function describeLoadError(load) {
1326
+ if (load.ok) return "";
1327
+ return load.error instanceof Error ? load.error.message : String(load.error);
1328
+ }
1329
+ __name(describeLoadError, "describeLoadError");
1330
+ async function unwrapScriptLoad(load) {
1331
+ const settled = await load;
1332
+ if (settled.ok) return settled.loaded;
1333
+ throw settled.error;
1334
+ }
1335
+ __name(unwrapScriptLoad, "unwrapScriptLoad");
1336
+ function buildWorkflowGrantRule(params, digest) {
1337
+ const [key, value] = params.name ? ["name", params.name] : ["scriptPath", params.scriptPath];
1338
+ if (!value || /[,*]/.test(value) || value.trim() !== value) {
1339
+ return void 0;
1340
+ }
1341
+ return `${getRuleDisplayName(resolveToolName(ToolNames.WORKFLOW))}(${key}:${value},${WORKFLOW_RULE_DIGEST_KEY}:${digest})`;
1342
+ }
1343
+ __name(buildWorkflowGrantRule, "buildWorkflowGrantRule");
1344
+ function buildUsageBanner(budget) {
1345
+ if (budget.total === null) {
1346
+ return `> Workflows have no per-run token cap. Put a \`+500k\`-style target in your message to cap a turn, or set \`${MAX_TOKENS_PER_WORKFLOW_ENV}=<n>\` (env) for a per-run soft cap. Suppress this notice with \`skipWorkflowUsageWarning: true\` in settings.
1086
1347
 
1087
1348
  `;
1088
1349
  }
1089
- return `> Workflow token cap is ${total} (per \`${MAX_TOKENS_PER_WORKFLOW_ENV}\`). Suppress this notice with \`skipWorkflowUsageWarning: true\` in settings.
1350
+ if (budget.source === "directive") {
1351
+ return `> This turn's output-token target is ${budget.total}` + (budget.directiveText ? ` (set by \`${budget.directiveText}\` in your message)` : "") + `; workflow agent() calls stop once the turn's spend reaches it. Suppress this notice with \`skipWorkflowUsageWarning: true\` in settings.
1352
+
1353
+ `;
1354
+ }
1355
+ return `> Workflow token cap is ${budget.total} (per \`${MAX_TOKENS_PER_WORKFLOW_ENV}\`). Suppress this notice with \`skipWorkflowUsageWarning: true\` in settings.
1090
1356
 
1091
1357
  `;
1092
1358
  }
@@ -1140,8 +1406,8 @@ Do not call this tool unless the user has asked for multi-agent orchestration. A
1140
1406
 
1141
1407
  - The user's message contains the word \`workflow\`; a system reminder confirms it when it does.
1142
1408
  - The user asked for orchestration in their own words \u2014 run a workflow, fan out agents, orchestrate this with subagents.
1143
- - A skill or slash command the user invoked instructs you to use this tool.
1144
- - The user named a saved workflow to run, reached through \`workflow('<name>')\` or \`scriptPath\`.
1409
+ - A skill or slash command that ran \u2014 invoked by the user, or by you through the Skill tool \u2014 instructs you to use this tool.
1410
+ - The user named a saved workflow to run, reached through \`name\`, \`workflow('<name>')\` or \`scriptPath\`.
1145
1411
  - The user asked to resume or continue an earlier run, which is \`resumeFromRunId\`.
1146
1412
 
1147
1413
  Otherwise do not call it, however well the task would parallelize. Do the work in the main loop, or spawn a single subagent for one self-contained piece. When a workflow would genuinely be the better tool, say in one sentence what it would fan out over and roughly how many agents that is, then let the user decide \u2014 and mention that including the word \`workflow\` next time skips the ask.
@@ -1151,16 +1417,20 @@ Otherwise do not call it, however well the task would parallelize. Do the work i
1151
1417
  Reach for one to be comprehensive (cover every part of the work in parallel), to be confident (independent perspectives and adversarial checks before an answer is committed to), or to take on scale a single context cannot hold. Parallelism on its own is not a reason; work that is already one short sequence of edits belongs in the main loop.`;
1152
1418
  var WORKFLOW_TOOL_RUNTIME = `**Runtime**
1153
1419
 
1154
- \`phase(title)\`, \`log(msg)\`, \`agent(prompt, opts?)\`, \`parallel(thunks)\`, \`pipeline(items, ...stages)\`, \`workflow(nameOrRef, args?)\`, plus the \`args\` and \`budget\` globals. Saved workflows are \`<name>.js\` files under \`<projectRoot>/.qwen/workflows\` (project scope, also surfaced as \`/<name>\` slash commands) or \`~/.qwen/workflows\` (user scope); \`scriptPath\` additionally accepts a path inside the generated-scripts root (\`$QWEN_CODE_PROJECT_DIR/workflows/generated\` \u2014 the per-project runtime dir, not the project tree), and a path outside those roots is refused. Default \`max(2, min(16, availableParallelism()-2))\` agents in flight per run, which follows CPU affinity and container CPU limits (\`${MAX_WORKFLOW_CONCURRENCY_ENV}\`), up to ${DEFAULT_MAX_AGENTS_PER_RUN} agents total (\`${MAX_WORKFLOW_AGENTS_ENV}\`), under a 30-minute wall-clock cap per run (\`QWEN_CODE_MAX_WORKFLOW_SECONDS\`) \u2014 a fan-out near the agent cap will not fit inside the default cap. Each subagent attempt is separately capped at ${DEFAULT_WORKFLOW_SUBAGENT_MAX_TURNS} turns (\`${WORKFLOW_SUBAGENT_MAX_TURNS_ENV}\`) and ${DEFAULT_WORKFLOW_SUBAGENT_MAX_TIME_MINUTES} minutes (\`${WORKFLOW_SUBAGENT_MAX_MINUTES_ENV}\`). \`agent()\` resolves to \`null\` when that admitted agent fails on its own \u2014 turn/time caps, model or setup errors, missing structured output, exhausted stall retries \u2014 for a bare \`await agent()\` exactly as inside \`parallel()\`/\`pipeline()\`, so check for \`null\` wherever you read a result; run-level rejections no later call could survive (the token budget, the ${DEFAULT_MAX_AGENTS_PER_RUN}-agent cap, cancellation) throw instead. Every run hands back its runId, the script's path on disk (an inline script is persisted, so a resume edits that file rather than re-sending the source) and its journal path; read it before diagnosing an empty or surprising result. Runs appear in the background-tasks view and the \`/workflows\` dialog (live phase tree, token usage, cooperative pause/resume, cancel); \`run_in_background: true\` returns a run handle immediately in the interactive TUI and delivers completion through the conversation. Scripts run in a node:vm sandbox with no filesystem or shell access \u2014 all I/O happens through the spawned agents.`;
1420
+ \`phase(title)\`, \`log(msg)\`, \`agent(prompt, opts?)\`, \`parallel(thunks)\`, \`pipeline(items, ...stages)\`, \`workflow(nameOrRef, args?)\`, plus the \`args\` and \`budget\` globals. Saved workflows are \`<name>.js\` files under \`<projectRoot>/.qwen/workflows\` (project scope, also surfaced as \`/<name>\` slash commands) or \`~/.qwen/workflows\` (user scope), plus active extensions' \`<extension>:<name>\`; \`scriptPath\` additionally accepts an active extension's workflow file or a path inside the generated-scripts root (\`$QWEN_CODE_PROJECT_DIR/workflows/generated\` \u2014 the per-project runtime dir, not the project tree); any other path is refused. Default \`max(2, min(16, availableParallelism()-2))\` agents in flight per run, which follows CPU affinity and container CPU limits (\`${MAX_WORKFLOW_CONCURRENCY_ENV}\`), up to ${DEFAULT_MAX_AGENTS_PER_RUN} agents total (\`${MAX_WORKFLOW_AGENTS_ENV}\`), under a 30-minute wall-clock cap per run (\`QWEN_CODE_MAX_WORKFLOW_SECONDS\`) \u2014 a fan-out near the agent cap will not fit inside the default cap. Each subagent attempt is separately capped at ${DEFAULT_WORKFLOW_SUBAGENT_MAX_TURNS} turns (\`${WORKFLOW_SUBAGENT_MAX_TURNS_ENV}\`) and ${DEFAULT_WORKFLOW_SUBAGENT_MAX_TIME_MINUTES} minutes (\`${WORKFLOW_SUBAGENT_MAX_MINUTES_ENV}\`). \`agent()\` resolves to \`null\` when that admitted agent fails on its own \u2014 turn/time caps, model or setup errors, missing structured output, exhausted stall retries \u2014 for a bare \`await agent()\` exactly as inside \`parallel()\`/\`pipeline()\`, so check for \`null\` wherever you read a result; run-level rejections no later call could survive (the token budget, the ${DEFAULT_MAX_AGENTS_PER_RUN}-agent cap, cancellation) throw instead. \`budget.total\` is the turn's output-token target when the user's message sets one with a \`+500k\`-style directive, and \`budget.spent()\` then counts every output token this turn, the main loop included. Every run hands back its runId, the script's path on disk (an inline script is persisted, so a resume edits that file rather than re-sending the source) and its journal path; read it before diagnosing an empty or surprising result. Runs appear in the background-tasks view and the \`/workflows\` dialog (live phase tree, token usage, cooperative pause/resume, cancel); \`run_in_background: true\` returns a run handle immediately in the interactive TUI and delivers completion through the conversation. Scripts run in a node:vm sandbox with no filesystem or shell access \u2014 all I/O happens through the spawned agents.`;
1155
1421
  var WORKFLOW_AUTHORING_POINTER = `**Writing the script**
1156
1422
 
1157
1423
  Before writing a script, load the \`${WORKFLOW_AUTHORING_SKILL_NAME}\` skill \u2014 the authoring reference: the sandbox contract, agent() options, \`pipeline()\` vs \`parallel()\`, verification and convergence patterns, resume, and a worked example.`;
1158
1424
  var WORKFLOW_AUTHORING_TOOL_SEARCH_NOTE = ` ${toolSearchRevealSentence(ToolDisplayNames.SKILL)}`;
1159
1425
  var WORKFLOW_AUTHORING_INLINE_NOTE = "Skills cannot be loaded in this session, even one named in a skill listing, so the authoring reference follows in full. Where it points at another skill, that skill is not available here either.";
1160
- function buildWorkflowToolDescription(surface, reference = readWorkflowAuthoringReference()) {
1426
+ function buildWorkflowToolDescription(surface, reference = readWorkflowAuthoringReference(), sizeGuideline = null) {
1427
+ const size = sizeGuideline ? buildWorkflowSizeGuidelineParagraph(sizeGuideline) : null;
1428
+ const runtime = size ? `${WORKFLOW_TOOL_RUNTIME}
1429
+
1430
+ ${size}` : WORKFLOW_TOOL_RUNTIME;
1161
1431
  const pointer = `${WORKFLOW_TOOL_DECISION}
1162
1432
 
1163
- ${WORKFLOW_TOOL_RUNTIME}
1433
+ ${runtime}
1164
1434
 
1165
1435
  ${WORKFLOW_AUTHORING_POINTER}`;
1166
1436
  switch (surface) {
@@ -1171,11 +1441,13 @@ ${WORKFLOW_AUTHORING_POINTER}`;
1171
1441
  case "withheld":
1172
1442
  return `${WORKFLOW_TOOL_DECISION}
1173
1443
 
1174
- ${WORKFLOW_TOOL_RUNTIME}`;
1444
+ ${runtime}`;
1175
1445
  case "inline":
1176
1446
  return reference ? `${WORKFLOW_TOOL_DECISION}
1177
1447
 
1178
- ${WORKFLOW_AUTHORING_INLINE_NOTE}
1448
+ ${size ? `${size}
1449
+
1450
+ ` : ""}${WORKFLOW_AUTHORING_INLINE_NOTE}
1179
1451
 
1180
1452
  ---
1181
1453
 
@@ -1237,7 +1509,11 @@ var WorkflowTool = class extends BaseDeclarativeTool {
1237
1509
  super(
1238
1510
  ToolNames.WORKFLOW,
1239
1511
  ToolDisplayNames.WORKFLOW,
1240
- buildWorkflowToolDescription(surface),
1512
+ buildWorkflowToolDescription(
1513
+ surface,
1514
+ void 0,
1515
+ config.getWorkflowSizeGuideline?.() ?? resolveWorkflowSizeGuidelineSetting(void 0)
1516
+ ),
1241
1517
  "other" /* Other */,
1242
1518
  buildWorkflowParamSchema(surface),
1243
1519
  /* isOutputMarkdown */
@@ -1278,13 +1554,20 @@ var WorkflowTool = class extends BaseDeclarativeTool {
1278
1554
  );
1279
1555
  }
1280
1556
  validateToolParamValues(params) {
1557
+ try {
1558
+ readWorkflowSourceRef(params.sourceRef);
1559
+ } catch (error) {
1560
+ return error instanceof Error ? error.message : "Invalid workflow sourceRef.";
1561
+ }
1281
1562
  const hasScript = typeof params.script === "string" && params.script.length > 0;
1282
1563
  const hasPath = typeof params.scriptPath === "string" && params.scriptPath.length > 0;
1283
- if (!hasScript && !hasPath) {
1284
- return "WorkflowTool: provide `script` (inline source) or `scriptPath` (a workflow script file).";
1564
+ const hasName = typeof params.name === "string" && params.name.length > 0;
1565
+ const sources = [hasScript, hasPath, hasName].filter(Boolean).length;
1566
+ if (sources === 0) {
1567
+ return "WorkflowTool: provide `script` (inline source), `scriptPath` (a workflow script file) or `name` (a saved workflow).";
1285
1568
  }
1286
- if (hasScript && hasPath) {
1287
- return "WorkflowTool: provide exactly one of `script` or `scriptPath`, not both.";
1569
+ if (sources > 1) {
1570
+ return "WorkflowTool: provide exactly one of `script`, `scriptPath` or `name`.";
1288
1571
  }
1289
1572
  if (params.resumeFromRunId !== void 0 && !/^wf_[0-9a-f]+$/.test(params.resumeFromRunId)) {
1290
1573
  return "WorkflowTool: `resumeFromRunId` must match the generated id format `wf_<hex>`.";