@qwen-code/qwen-code 0.23.5-preview.0 → 0.24.0-nightly.20260917.f822124af5

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 (498) hide show
  1. package/bundled/goal-draft/SKILL.md +5 -5
  2. package/bundled/qc-helper/docs/configuration/auth.md +1 -0
  3. package/bundled/qc-helper/docs/configuration/model-providers.md +43 -14
  4. package/bundled/qc-helper/docs/configuration/settings.md +2 -1
  5. package/bundled/qc-helper/docs/extension/introduction.md +2 -0
  6. package/bundled/qc-helper/docs/features/_meta.ts +1 -0
  7. package/bundled/qc-helper/docs/features/goals.md +11 -11
  8. package/bundled/qc-helper/docs/features/hooks.md +8 -10
  9. package/bundled/qc-helper/docs/features/omni-fixed-policies-preset.json +242 -0
  10. package/bundled/qc-helper/docs/features/omni-media-policies.md +443 -0
  11. package/bundled/qc-helper/docs/overview.md +1 -1
  12. package/bundled/qc-helper/docs/quickstart.md +2 -3
  13. package/bundled/review/SKILL.md +1 -1
  14. package/bundled/workflow-authoring/SKILL.md +22 -7
  15. package/chunks/MaxSizedBox-4VDYUHUI.js +148 -0
  16. package/chunks/{StandaloneSessionPicker-V635V72I.js → StandaloneSessionPicker-SGMGJOH3.js} +115 -91
  17. package/chunks/acp-subagent-executor-EGAATYQA.js +164 -0
  18. package/chunks/{acpAgent-3DPWZTNC.js → acpAgent-2JQ2N2T5.js} +361 -229
  19. package/chunks/{agent-KIHGINKN.js → agent-QWNE3MPD.js} +59 -49
  20. package/chunks/agent-headless-GRSMZK5Z.js +104 -0
  21. package/chunks/{anthropicContentGenerator-4FGOM5LK.js → anthropicContentGenerator-INV24RMG.js} +30 -27
  22. package/chunks/{artifact-tool-MUTNH4NI.js → artifact-tool-3MWM6SN2.js} +11 -7
  23. package/chunks/{askUserQuestion-AKIRLVB5.js → askUserQuestion-YFFBB4K3.js} +6 -4
  24. package/chunks/bridge-R65BJ2YL.js +156 -0
  25. package/chunks/{build-5KWQBWEQ.js → build-5OQN7CDU.js} +1 -1
  26. package/chunks/caption-audio-UXXLI3JZ.js +443 -0
  27. package/chunks/caption-image-B7O4TUFP.js +247 -0
  28. package/chunks/{channel-management-service-RRILWSXX.js → channel-management-service-GRJG5R46.js} +1 -1
  29. package/chunks/channel-settings-store-TBLCDTV2.js +158 -0
  30. package/chunks/{channel-worker-group-3DUJFZJR.js → channel-worker-group-SCSKCSBJ.js} +4 -4
  31. package/chunks/{channel-worker-manager-E5UW2VLA.js → channel-worker-manager-AHCZCKON.js} +4 -4
  32. package/chunks/{channel-worker-supervisor-VN33GSEC.js → channel-worker-supervisor-BGUAVITB.js} +3 -3
  33. package/chunks/{chunk-5NUKK2DT.js → chunk-25FMWESU.js} +47 -8
  34. package/chunks/{chunk-VVI7MK3V.js → chunk-2A6RZKP2.js} +9 -7
  35. package/chunks/{chunk-3WWPEFMX.js → chunk-2FQM443D.js} +82 -4
  36. package/chunks/{chunk-D3KVGQUV.js → chunk-37XDTMFG.js} +4 -4
  37. package/chunks/{chunk-TDKUXSJO.js → chunk-3MW6PPA5.js} +1 -1
  38. package/chunks/{chunk-4LIPOIXS.js → chunk-3NHJLWOD.js} +1 -1
  39. package/chunks/{chunk-AQP3H22J.js → chunk-3ZGIRRAE.js} +1 -1
  40. package/chunks/{chunk-WSJI6ODG.js → chunk-422D2UIO.js} +210 -150
  41. package/chunks/chunk-43QUA4MC.js +135 -0
  42. package/chunks/{chunk-Q2SAQTEJ.js → chunk-4B7U3KQP.js} +1 -1
  43. package/chunks/{chunk-SFL6U7U7.js → chunk-4JFRCIMW.js} +2 -2
  44. package/chunks/{chunk-IVFTLUZD.js → chunk-4SZ2636R.js} +3 -3
  45. package/chunks/{chunk-6OTF7TTE.js → chunk-4VYTH6OF.js} +24 -1
  46. package/chunks/{chunk-7CLLH5TI.js → chunk-4YS7RMCB.js} +6 -4
  47. package/chunks/{chunk-BW2SMO6L.js → chunk-5FHOPPLZ.js} +1 -1
  48. package/chunks/{chunk-QIPLWW6Q.js → chunk-5MYQ66UF.js} +1 -1
  49. package/chunks/{chunk-TXTCM3TC.js → chunk-5VDOVBNG.js} +18 -14
  50. package/chunks/{chunk-L2A5VBDL.js → chunk-67ZCKSV6.js} +9 -9
  51. package/chunks/chunk-6C3D7BKK.js +153 -0
  52. package/chunks/{chunk-DC4ZNGH4.js → chunk-6DB6UHY3.js} +3 -3
  53. package/chunks/{chunk-AXPOOQAW.js → chunk-736AZVPL.js} +2 -2
  54. package/chunks/{chunk-M22WLKLI.js → chunk-77ORAIEF.js} +7 -7
  55. package/chunks/{chunk-BUQN5LTI.js → chunk-7PQ65Z5F.js} +2 -2
  56. package/chunks/{chunk-CXY6BICQ.js → chunk-A5EGR6ZS.js} +204 -120
  57. package/chunks/{chunk-VQDWCQOE.js → chunk-ANKISCKU.js} +1 -0
  58. package/chunks/{chunk-7D4CV7JH.js → chunk-APHDK7GV.js} +116 -4
  59. package/chunks/{chunk-B5TJK7B3.js → chunk-ARKOX7HM.js} +1 -1
  60. package/chunks/{chunk-NXUZFW3G.js → chunk-AUFTA63J.js} +1 -1
  61. package/chunks/{chunk-36SDZ2Q4.js → chunk-B3HGO6BB.js} +7 -5
  62. package/chunks/{chunk-6USYH3EU.js → chunk-B3XJFEEH.js} +5 -3
  63. package/chunks/{chunk-AEWCOE64.js → chunk-B5WYAQ4I.js} +2 -2
  64. package/chunks/{chunk-GSKX53AN.js → chunk-BA6AXQDA.js} +1 -1
  65. package/chunks/{chunk-Y2KJC55Y.js → chunk-BBHLWLIK.js} +4 -4
  66. package/chunks/chunk-BKVPLSEI.js +133 -0
  67. package/chunks/chunk-BQMSZSG6.js +21 -0
  68. package/chunks/{chunk-3LMDSCLU.js → chunk-C4FISGDN.js} +2 -2
  69. package/chunks/{chunk-SFHX5G2S.js → chunk-C4MMZVYX.js} +80 -15
  70. package/chunks/{chunk-4JFLRHNE.js → chunk-C4QWV63F.js} +1 -1
  71. package/chunks/{chunk-XFFRI3WM.js → chunk-CA63HYHU.js} +4 -2
  72. package/chunks/{chunk-FBY32737.js → chunk-CJNWKJFH.js} +4 -4
  73. package/chunks/{chunk-QT6Z2IBF.js → chunk-CYFQLCCG.js} +2 -2
  74. package/chunks/{chunk-X7AYIXC7.js → chunk-DJLCK66M.js} +5 -3
  75. package/chunks/chunk-DJYHML3Y.js +121 -0
  76. package/chunks/{chunk-MO4XID7S.js → chunk-DNDECZXY.js} +3 -3
  77. package/chunks/{chunk-H6L4NEAT.js → chunk-DQCGGSDO.js} +1 -1
  78. package/chunks/{chunk-347O2YZJ.js → chunk-DUWQ5Q6R.js} +115 -67
  79. package/chunks/{chunk-FEDFZBGR.js → chunk-E6A52AP2.js} +28 -17
  80. package/chunks/{chunk-TIGXX4PA.js → chunk-EKBQJ627.js} +2 -2
  81. package/chunks/{chunk-RSWBT7AZ.js → chunk-ERIBG3BX.js} +35 -551
  82. package/chunks/{chunk-PPJSG2PU.js → chunk-EVZT24AF.js} +6 -142
  83. package/chunks/{chunk-YZXSDPOQ.js → chunk-F7L4ZMKS.js} +84 -40
  84. package/chunks/{chunk-HX4WXX3H.js → chunk-FGAWVV4X.js} +101 -75
  85. package/chunks/chunk-FT3O44AZ.js +1635 -0
  86. package/chunks/chunk-FTKXJMQV.js +255 -0
  87. package/chunks/{chunk-5FK4MSHB.js → chunk-FWP5GZRY.js} +6 -4
  88. package/chunks/{chunk-TRZ22SG5.js → chunk-FXPP7VLM.js} +6 -4
  89. package/chunks/{chunk-INN5ORKX.js → chunk-G25IQMCV.js} +1 -1
  90. package/chunks/{chunk-OWUAZXXN.js → chunk-GHG4PQY2.js} +3 -3
  91. package/chunks/{chunk-FASYATAZ.js → chunk-GL5TRVMS.js} +1 -1
  92. package/chunks/{chunk-G45B3INR.js → chunk-GVTAFLWB.js} +2 -2
  93. package/chunks/{chunk-G6UUOCUT.js → chunk-GXNXX7A2.js} +7 -1
  94. package/chunks/{chunk-GI7SLDOI.js → chunk-HUUBCY33.js} +6 -6
  95. package/chunks/chunk-I7MIPRIQ.js +181 -0
  96. package/chunks/{chunk-NQ272MQG.js → chunk-IAKJXTGS.js} +7 -5
  97. package/chunks/{chunk-V4JJAVHQ.js → chunk-ID7XHHY5.js} +2 -2
  98. package/chunks/{chunk-IXO2OCIP.js → chunk-IIHFUREY.js} +12 -8
  99. package/chunks/{chunk-IZ2U57NY.js → chunk-IITTKFWM.js} +4 -2
  100. package/chunks/chunk-IVPSLX4P.js +578 -0
  101. package/chunks/{chunk-BTICBRPL.js → chunk-IWMYX5LB.js} +3 -3
  102. package/chunks/{chunk-UZSB57EV.js → chunk-JR2WFCQG.js} +29 -17
  103. package/chunks/{chunk-GJKP6XOB.js → chunk-JWV5GI77.js} +16 -19
  104. package/chunks/chunk-JYGESWZM.js +149 -0
  105. package/chunks/{chunk-KVC7HZWK.js → chunk-JYTJ5FCM.js} +1 -1
  106. package/chunks/{chunk-SOLRBF7L.js → chunk-JZUSFW64.js} +10 -10
  107. package/chunks/{chunk-CDDP4ONL.js → chunk-K2T5PKFS.js} +60 -134
  108. package/chunks/{chunk-EIBECN2J.js → chunk-K5VVDHDV.js} +5 -5
  109. package/chunks/{chunk-NKTMUPHJ.js → chunk-KDM4KSVG.js} +14 -4
  110. package/chunks/{chunk-3WILPKTJ.js → chunk-KKPIFWTZ.js} +11 -6
  111. package/chunks/{chunk-3HTUE6ZR.js → chunk-KPK6NQVR.js} +4 -4
  112. package/chunks/{chunk-CXONOVBN.js → chunk-KS6F6LZQ.js} +8 -6
  113. package/chunks/{chunk-D7JMO2GP.js → chunk-KSECLXYH.js} +1 -1
  114. package/chunks/chunk-KSEKRQJO.js +253 -0
  115. package/chunks/{chunk-KEM7MWS7.js → chunk-KWZ2DDOC.js} +765 -428
  116. package/chunks/{chunk-U4AASWUQ.js → chunk-L4GF4IK2.js} +3 -3
  117. package/chunks/{chunk-CQPM66MG.js → chunk-L7HFHYGB.js} +4 -4
  118. package/chunks/{chunk-DJXSOEFB.js → chunk-LAE6RY3L.js} +1 -1
  119. package/chunks/{chunk-WNQIJTOP.js → chunk-LDM3JQZF.js} +243 -17
  120. package/chunks/{chunk-KVQ3QL4K.js → chunk-LLTRNLK2.js} +3 -3
  121. package/chunks/{chunk-IKBEIDOH.js → chunk-LVXTBFWP.js} +13 -13
  122. package/chunks/{chunk-AKRSSKUT.js → chunk-LWALWKFU.js} +10 -10
  123. package/chunks/{chunk-WL36KHUQ.js → chunk-LWV4RLBT.js} +11 -9
  124. package/chunks/{chunk-3BZI5GDP.js → chunk-M5YIHMXP.js} +6 -4
  125. package/chunks/{chunk-6WXVEDT2.js → chunk-MC2RYJMU.js} +5 -3
  126. package/chunks/chunk-MNU36NGH.js +233 -0
  127. package/chunks/{chunk-ZMYKNKET.js → chunk-MQWZWHTY.js} +3 -3
  128. package/chunks/{chunk-M4U2LTD2.js → chunk-MS4SXNJ6.js} +1 -1
  129. package/chunks/{chunk-QHSOINX6.js → chunk-MZKXPQWL.js} +2 -2
  130. package/chunks/{chunk-36NRLIR6.js → chunk-NBLWUMYE.js} +13 -11
  131. package/chunks/{chunk-DRAX5YAI.js → chunk-NFC4WTY2.js} +6 -4
  132. package/chunks/chunk-NX6JUO42.js +102 -0
  133. package/chunks/chunk-O345BAI3.js +42 -0
  134. package/chunks/{chunk-YM6KUQ2S.js → chunk-O4A2B6V2.js} +3 -3
  135. package/chunks/chunk-O55EKI4S.js +7668 -0
  136. package/chunks/{chunk-3UGMLA4V.js → chunk-OA5H5PPQ.js} +10 -10
  137. package/chunks/{chunk-DX6JTDMR.js → chunk-OB57Y2WH.js} +1 -1
  138. package/chunks/{chunk-4QPVZA5J.js → chunk-OOSOAFCT.js} +3 -3
  139. package/chunks/{chunk-E2VSBAFA.js → chunk-OXBD7VUE.js} +5 -5
  140. package/chunks/{chunk-M23GFJ5B.js → chunk-OY5GQPMU.js} +1 -1
  141. package/chunks/chunk-PF3RVYRK.js +108 -0
  142. package/chunks/{chunk-XWJFDJZK.js → chunk-PJSZXERN.js} +1 -1
  143. package/chunks/{chunk-GSAOVDTH.js → chunk-POMFSBEC.js} +4 -4
  144. package/chunks/{chunk-EWNKP4V4.js → chunk-PPVM7YLS.js} +1 -1
  145. package/chunks/{chunk-WK6DEH3Q.js → chunk-PQQV3OBW.js} +6 -4
  146. package/chunks/{chunk-ZSTCM3MX.js → chunk-Q5N5NEVT.js} +1 -1
  147. package/chunks/{chunk-HYHSMTRA.js → chunk-QCTWNYL6.js} +4 -4
  148. package/chunks/{chunk-KFFCDLKV.js → chunk-QE36VXWP.js} +1 -1
  149. package/chunks/{chunk-3LLEB5CU.js → chunk-QG73VXTF.js} +2 -2
  150. package/chunks/{chunk-QMENOK5T.js → chunk-QJJN2VJY.js} +10 -8
  151. package/chunks/{chunk-XICCGDWF.js → chunk-QKYAXSNG.js} +2 -2
  152. package/chunks/{chunk-V545KI73.js → chunk-QPTE6BKL.js} +1 -1
  153. package/chunks/{chunk-2GP6BQ2J.js → chunk-RA6PKQVM.js} +2 -2
  154. package/chunks/{chunk-TPY6HW55.js → chunk-RFAX4WKE.js} +13 -7
  155. package/chunks/chunk-RSFNJ6UU.js +1252 -0
  156. package/chunks/{chunk-EDIDYZBT.js → chunk-RVT5L74D.js} +1 -1
  157. package/chunks/{chunk-FCPJXKDG.js → chunk-RXDTMGUH.js} +9 -9
  158. package/chunks/{chunk-P42KMMU6.js → chunk-RZZLNI74.js} +27 -25
  159. package/chunks/{chunk-ZFHKUQZ4.js → chunk-S2R4L34O.js} +12 -5
  160. package/chunks/chunk-S34QJ6IR.js +290 -0
  161. package/chunks/chunk-S5BHLTHK.js +190 -0
  162. package/chunks/{chunk-2XRE4KE4.js → chunk-S7BE3FMA.js} +1 -1
  163. package/chunks/{chunk-7O5PYQ3M.js → chunk-SBP43AO6.js} +1 -1
  164. package/chunks/chunk-SLHYLVRW.js +1377 -0
  165. package/chunks/{chunk-SSWTA7CH.js → chunk-SLV3GU2S.js} +12 -12
  166. package/chunks/chunk-SLVJ55G3.js +11397 -0
  167. package/chunks/{chunk-5VQR2DD7.js → chunk-SQRZJD25.js} +5 -3
  168. package/chunks/{chunk-K4XMAIRX.js → chunk-SRFYBJ4P.js} +14 -14
  169. package/chunks/{chunk-Y4NNIGYO.js → chunk-SSFOFDNL.js} +1 -1
  170. package/chunks/{chunk-NFXXBWSE.js → chunk-SU64336V.js} +2 -2
  171. package/chunks/{chunk-RRI764F7.js → chunk-SWHBXWVS.js} +45 -26
  172. package/chunks/{chunk-BHVF3R6B.js → chunk-TAMBGU42.js} +4 -4
  173. package/chunks/chunk-TFDCK56Y.js +154 -0
  174. package/chunks/{chunk-Q54O3EIA.js → chunk-TNTYSST7.js} +55 -33
  175. package/chunks/{chunk-JRHKM3YQ.js → chunk-TS4JJ7NN.js} +2 -2
  176. package/chunks/{chunk-VEXUA6DX.js → chunk-TWD6EZLA.js} +13 -11
  177. package/chunks/{chunk-WZWTY7SG.js → chunk-TZ4QKMPU.js} +6 -6
  178. package/chunks/{chunk-C4HBZQNH.js → chunk-U3MTHCJF.js} +1 -1
  179. package/chunks/{chunk-VU3XMZ5I.js → chunk-U3VIKF53.js} +3 -3
  180. package/chunks/{chunk-BHG3H6OZ.js → chunk-U4KO33OD.js} +1 -1
  181. package/chunks/{chunk-2C5TR6HN.js → chunk-UANUZBL2.js} +1 -1
  182. package/chunks/{chunk-Y53DG2HA.js → chunk-UIWUFHRJ.js} +1 -1
  183. package/chunks/{chunk-UQGRJTDK.js → chunk-UP3XL4VB.js} +3 -3
  184. package/chunks/{chunk-43Y26NPF.js → chunk-UR27ZXFZ.js} +3 -3
  185. package/chunks/{chunk-LO2UWNO5.js → chunk-UXC6MURF.js} +3 -3
  186. package/chunks/chunk-UXEI7POA.js +273 -0
  187. package/chunks/chunk-V2XJJTAB.js +228 -0
  188. package/chunks/chunk-VDNCKE2O.js +24 -0
  189. package/chunks/{chunk-YQQ2U7AS.js → chunk-VLBL6Q7X.js} +1 -1
  190. package/chunks/{chunk-HNFKYKHH.js → chunk-VNQTV5NC.js} +104 -26
  191. package/chunks/chunk-VPGRGNNH.js +578 -0
  192. package/chunks/{chunk-TKF4JINY.js → chunk-VVQ57VLE.js} +1 -1
  193. package/chunks/{chunk-AUX2FL5T.js → chunk-W2UTVLT2.js} +641 -11
  194. package/chunks/{chunk-SYMXYRM5.js → chunk-W7JWIIRC.js} +1 -1
  195. package/chunks/{chunk-WBSJ6VPZ.js → chunk-WDVSRQIQ.js} +3 -3
  196. package/chunks/{chunk-AZCTY64Z.js → chunk-WEUQIY3Q.js} +1 -1
  197. package/chunks/{chunk-FX6PZBOV.js → chunk-WHBL5HJF.js} +4 -4
  198. package/chunks/chunk-WL2V7PTE.js +78 -0
  199. package/chunks/{chunk-OSG23MR3.js → chunk-X3T5IOX6.js} +2 -2
  200. package/chunks/{chunk-OZEV3R3S.js → chunk-XYAB5R6E.js} +3 -3
  201. package/chunks/chunk-XZA32HII.js +19 -0
  202. package/chunks/{chunk-4FLUQWJ4.js → chunk-Y3Q5OK4D.js} +1 -1
  203. package/chunks/chunk-YDERQ7ZV.js +248 -0
  204. package/chunks/{chunk-QGEISOJ2.js → chunk-YKM7SY3N.js} +3 -3
  205. package/chunks/{chunk-HXUI5D4H.js → chunk-YRNAZIDX.js} +1 -1
  206. package/chunks/{chunk-MFDKHGTD.js → chunk-YRNLF4SV.js} +3 -1
  207. package/chunks/{chunk-3XBUCOWS.js → chunk-YSD6IY6F.js} +2 -2
  208. package/chunks/{chunk-CH2YDT6X.js → chunk-YVYK3JYU.js} +5 -3
  209. package/chunks/{chunk-YL3UJML3.js → chunk-YWDVNBGE.js} +4 -4
  210. package/chunks/{chunk-KAYC5FBN.js → chunk-Z3DLUFMT.js} +1595 -1399
  211. package/chunks/chunk-Z547XC3A.js +44 -0
  212. package/chunks/{chunk-B6RMK4ED.js → chunk-Z5UFM7P6.js} +9 -7
  213. package/chunks/chunk-ZAX2LW35.js +1330 -0
  214. package/chunks/{chunk-C3T6HPNM.js → chunk-ZGADNVME.js} +5 -5
  215. package/chunks/{chunk-M3JGHRMQ.js → chunk-ZJ7KIWG5.js} +1 -1
  216. package/chunks/{chunk-SYROIHU7.js → chunk-ZRQGTRHA.js} +4 -2
  217. package/chunks/{chunk-NCPFOLM2.js → chunk-ZTBP4SFC.js} +78 -18
  218. package/chunks/{chunk-ZAFYHRVY.js → chunk-ZYDMQCQP.js} +4 -274
  219. package/chunks/{chunk-YP2K3WOS.js → chunk-ZYLZNSBW.js} +7 -4
  220. package/chunks/clip-audio-SH4L7AEY.js +255 -0
  221. package/chunks/clip-image-BQRPECIS.js +239 -0
  222. package/chunks/clip-video-JIRMV5IH.js +277 -0
  223. package/chunks/{codex-subagent-executor-AEAIQZDC.js → codex-subagent-executor-BQZZ3Z4E.js} +92 -68
  224. package/chunks/config-3X4AXU45.js +21 -0
  225. package/chunks/config-T5RO4NJV.js +17 -0
  226. package/chunks/config-utils-65HZJG2Y.js +151 -0
  227. package/chunks/contextCommand-P2WZOTZP.js +144 -0
  228. package/chunks/convert-image-D52K2FFB.js +231 -0
  229. package/chunks/{core-runtime-ZI4RTOJQ.js → core-runtime-G7RWUDR5.js} +94 -67
  230. package/chunks/{create-sub-session-MSGNIM37.js → create-sub-session-6EDEANCD.js} +7 -5
  231. package/chunks/{create-sub-session-BBWFQARJ.js → create-sub-session-C6OHZMEI.js} +90 -66
  232. package/chunks/{cron-create-U2JJ5CCF.js → cron-create-GS7ORRO6.js} +8 -5
  233. package/chunks/{cron-delete-7DM4LJWD.js → cron-delete-3GGDNNXD.js} +8 -5
  234. package/chunks/{cron-list-VCUSZK2Y.js → cron-list-EX27DW4H.js} +8 -5
  235. package/chunks/{daemon-INCM4VBX.js → daemon-62G2N3ZH.js} +1 -1
  236. package/chunks/{daemon-git-worktree-guard-KECEMV6A.js → daemon-git-worktree-guard-Y5MRUXHR.js} +90 -66
  237. package/chunks/daemon-status-provider-ORUXPQJO.js +155 -0
  238. package/chunks/daemon-trust-policy-CG35YJC5.js +150 -0
  239. package/chunks/{daemon-trust-policy-monitor-546N5ZVL.js → daemon-trust-policy-monitor-PT2ZJL3A.js} +96 -72
  240. package/chunks/deferred-core-runtime-K74JXKVR.js +153 -0
  241. package/chunks/{display-image-QTHALY6N.js → display-image-L3A755PZ.js} +10 -7
  242. package/chunks/{dist-BNW423XT.js → dist-CXDHIHN4.js} +5 -0
  243. package/chunks/downsample-audio-LPDWX6GF.js +217 -0
  244. package/chunks/downsample-image-A5JEYIV5.js +249 -0
  245. package/chunks/downscale-video-4W5BX5KO.js +249 -0
  246. package/chunks/{earlyInputCapture-BXP7V2P3.js → earlyInputCapture-UJ3KFVZQ.js} +3 -2
  247. package/chunks/{edit-CMSQB7NP.js → edit-VBS2GF24.js} +68 -56
  248. package/chunks/{en-56QLKXS2.js → en-FCK6MBTI.js} +16 -0
  249. package/chunks/{enter-worktree-DA6A4XC5.js → enter-worktree-QK7DR5EF.js} +12 -9
  250. package/chunks/{enterPlanMode-UDPMNESD.js → enterPlanMode-WC33QFGB.js} +62 -51
  251. package/chunks/environment-HN47IXJZ.js +167 -0
  252. package/chunks/errors-JC3V3RJA.js +151 -0
  253. package/chunks/{exec-RPKEY6HP.js → exec-7CFNHYCV.js} +31 -9
  254. package/chunks/{exit-worktree-4H6Z2VQI.js → exit-worktree-62COYIHF.js} +14 -10
  255. package/chunks/exitPlanMode-7R7DYPUV.js +102 -0
  256. package/chunks/extract-audio-GSSZQV6G.js +229 -0
  257. package/chunks/extract-keyframes-Q6DRMQAJ.js +621 -0
  258. package/chunks/{fast-path-F2CYDDZ4.js → fast-path-WN7SASHV.js} +6 -6
  259. package/chunks/{fast-path-settings-N2VGRGDJ.js → fast-path-settings-ASPHHCAG.js} +2 -2
  260. package/chunks/ffmpeg-N4LIIVNR.js +21 -0
  261. package/chunks/{glob-Z2JMJKKN.js → glob-HHM36TVT.js} +63 -51
  262. package/chunks/{goal-tools-HXVVLGCV.js → goal-tools-JTF7S4FP.js} +59 -49
  263. package/chunks/{grep-H2I33VAO.js → grep-JB5DGQ3B.js} +13 -9
  264. package/chunks/handleAutoUpdate-GGFSWLAH.js +147 -0
  265. package/chunks/i18n-NYQWDZWJ.js +164 -0
  266. package/chunks/{image-gen-HIAZCB5T.js → image-gen-LX3C4V3R.js} +16 -11
  267. package/chunks/initializer-6IZ4SNMM.js +151 -0
  268. package/chunks/installationInfo-K4KMCK7Q.js +145 -0
  269. package/chunks/{keychain-token-storage-NQ5XWIPX.js → keychain-token-storage-ZZNRE6D4.js} +3 -2
  270. package/chunks/list-KAWCG4I6.js +154 -0
  271. package/chunks/{list-agents-EWDCEPIW.js → list-agents-HS6HH4DJ.js} +10 -7
  272. package/chunks/{llm-LSUBOJAR.js → llm-UAZU4HC5.js} +162 -135
  273. package/chunks/{llm-content-generator-MLIONRXE.js → llm-content-generator-M3MT4BP3.js} +11 -9
  274. package/chunks/loadedSettingsAdapter-XKUVLEYR.js +152 -0
  275. package/chunks/{loggingContentGenerator-TUPEXFMM.js → loggingContentGenerator-2WW2O46K.js} +74 -63
  276. package/chunks/{loop-wakeup-ZBVRI6VH.js → loop-wakeup-4B7OY3TV.js} +9 -6
  277. package/chunks/{ls-6ZB3BEIR.js → ls-EZ5PSWU2.js} +8 -5
  278. package/chunks/{lsp-M54FQARP.js → lsp-DYFFHKB3.js} +6 -3
  279. package/chunks/{managed-npm-update-WEA5XMFZ.js → managed-npm-update-VRSID5W3.js} +91 -67
  280. package/chunks/mcp-DQEPGE5B.js +148 -0
  281. package/chunks/memory-side-query-DRV7FXK4.js +221 -0
  282. package/chunks/model-call-collection-HXYIVZDO.js +171 -0
  283. package/chunks/model-configuration-5FJL5BJE.js +161 -0
  284. package/chunks/modelConfigUtils-UE3FDHG3.js +140 -0
  285. package/chunks/{monitor-CI7YE7MT.js → monitor-IRKGV3RU.js} +63 -51
  286. package/chunks/nonInteractiveCli-LF5DTTUJ.js +235 -0
  287. package/chunks/nonInteractiveToolExecutor-KGIGCNUC.js +101 -0
  288. package/chunks/{notebook-edit-3WCVRNGL.js → notebook-edit-E2NGGRVT.js} +63 -52
  289. package/chunks/ocr-image-Q4HYJ3U7.js +252 -0
  290. package/chunks/omni-EHZU5MVU.js +147 -0
  291. package/chunks/{openaiContentGenerator-OGILGUZE.js → openaiContentGenerator-VZ4QWOSU.js} +36 -31
  292. package/chunks/{openaiResponsesContentGenerator-NXOXUPFM.js → openaiResponsesContentGenerator-OQFPKE6V.js} +15 -12
  293. package/chunks/pidfile-OQREIPGE.js +151 -0
  294. package/chunks/{processUtils-O4II3RYH.js → processUtils-VFFEEP7L.js} +2 -2
  295. package/chunks/prompt-terminal-ledger-46ELXYOX.js +143 -0
  296. package/chunks/{qwenContentGenerator-I4LRYADV.js → qwenContentGenerator-H3CWSIV5.js} +70 -60
  297. package/chunks/{qwenOAuth2-3J66TOT5.js → qwenOAuth2-GD3UIYUP.js} +9 -8
  298. package/chunks/reactive-degrade-KRTLV22M.js +375 -0
  299. package/chunks/read-file-BSZJVJ4F.js +37 -0
  300. package/chunks/{read-mcp-resource-LPSWXVOD.js → read-mcp-resource-INJIV3UC.js} +8 -4
  301. package/chunks/recall-media-memory-tool-PEE2BWRY.js +198 -0
  302. package/chunks/{record-artifact-L3CFJOMA.js → record-artifact-KKW3AIMJ.js} +6 -4
  303. package/chunks/record-source-OZ7JQFJK.js +24 -0
  304. package/chunks/{report-findings-LY5HQY4K.js → report-findings-OZSLWYAS.js} +7 -5
  305. package/chunks/{request-shutdown-53SNYGVR.js → request-shutdown-NMWMWGNR.js} +12 -9
  306. package/chunks/resumeHistoryUtils-P33LLL4M.js +156 -0
  307. package/chunks/ripGrep-2FWQ6RU3.js +43 -0
  308. package/chunks/{run-qwen-serve-ZVEKGS7Y.js → run-qwen-serve-HMQ2QCS7.js} +85 -73
  309. package/chunks/runtime-5X746HBH.js +188 -0
  310. package/chunks/sandbox-5FENHQ3J.js +170 -0
  311. package/chunks/sandboxConfig-7V6K3L4N.js +138 -0
  312. package/chunks/scheduled-tasks-Z4YOCKQV.js +167 -0
  313. package/chunks/scheduler-64LTQG3P.js +160 -0
  314. package/chunks/{sdk-exporters-http-DR4G663K.js → sdk-exporters-http-SWXTEEVT.js} +3 -2
  315. package/chunks/{sdk-impl-SJR26MQF.js → sdk-impl-FK4JY6LX.js} +5 -4
  316. package/chunks/{send-message-DN76MXDX.js → send-message-SNCXOZA7.js} +16 -13
  317. package/chunks/serve-C56AM3HW.js +156 -0
  318. package/chunks/{server-UHMKPCAZ.js → server-5NPGYNJG.js} +2169 -529
  319. package/chunks/{session-ZLUK7E4P.js → session-JOY4PHTN.js} +152 -128
  320. package/chunks/session-attachments-root-765GPAJU.js +141 -0
  321. package/chunks/{session-pr-refresh-3OMTQWCZ.js → session-pr-refresh-JUKB3A7P.js} +95 -71
  322. package/chunks/{settings-P4DHIIUP.js → settings-P326ULSH.js} +95 -71
  323. package/chunks/{shell-IMFUVQQ5.js → shell-747O3UYW.js} +59 -49
  324. package/chunks/{skill-NB5RJGZW.js → skill-DOHHQC32.js} +22 -17
  325. package/chunks/skill-settings-RI5JR6ZG.js +164 -0
  326. package/chunks/spawnChannel-745P6IB6.js +152 -0
  327. package/chunks/standalone-update-JC4E4UEO.js +156 -0
  328. package/chunks/{start-opentui-ui-JKAIWGF7.js → start-opentui-ui-RC62XZUC.js} +1611 -800
  329. package/chunks/{startInteractiveUI-YRPOT6GH.js → startInteractiveUI-PIBA3ADH.js} +521 -374
  330. package/chunks/storage-VZECDJNX.js +17 -0
  331. package/chunks/{syntheticOutput-EX5L5GYI.js → syntheticOutput-SSXJ2NEY.js} +5 -3
  332. package/chunks/task-create-FD3EJI7F.js +30 -0
  333. package/chunks/{task-list-ZLJSMRFA.js → task-list-GA5GOR74.js} +9 -6
  334. package/chunks/{task-stop-MD7P6QGK.js → task-stop-3MXTDL7H.js} +6 -3
  335. package/chunks/{task-update-3LSYQDRW.js → task-update-YHFYE7L6.js} +16 -13
  336. package/chunks/{team-create-2XTBYRJF.js → team-create-PJYGG3AE.js} +62 -51
  337. package/chunks/{team-delete-RIDINW6I.js → team-delete-V2CROTI6.js} +9 -6
  338. package/chunks/{team-plan-approval-CFNWW7ZQ.js → team-plan-approval-B36IMXRL.js} +61 -50
  339. package/chunks/terminal-image-renderer-7OSAIRLS.js +156 -0
  340. package/chunks/theme-manager-PVMU3VN5.js +140 -0
  341. package/chunks/{todoWrite-XSTG2VT5.js → todoWrite-LT75PK2W.js} +8 -5
  342. package/chunks/tool-result-media-S6D7T7TZ.js +45 -0
  343. package/chunks/{tool-search-ZHTJU2MV.js → tool-search-MNRENFML.js} +43 -21
  344. package/chunks/total-session-admission-XOFLP43R.js +151 -0
  345. package/chunks/transcribe-audio-AJQZPNEV.js +30 -0
  346. package/chunks/trustedFolders-SBORXKH4.js +160 -0
  347. package/chunks/understand-video-segments-5TMRDQUB.js +438 -0
  348. package/chunks/{update-relaunch-LI7GRP36.js → update-relaunch-FVAD6CYB.js} +5 -5
  349. package/chunks/updateCheck-PK4QHA67.js +156 -0
  350. package/chunks/upload-cache-5YULQVZZ.js +17 -0
  351. package/chunks/upload-config-AZ63YJU2.js +25 -0
  352. package/chunks/useAutoAcceptIndicator-SPTOOUWR.js +158 -0
  353. package/chunks/{validateNonInterActiveAuth-YFPCYYNL.js → validateNonInterActiveAuth-XXHRLXWV.js} +144 -120
  354. package/chunks/{version-4MTL4JVU.js → version-AGTZHZNY.js} +1 -1
  355. package/chunks/{web-fetch-O6RG6ISB.js → web-fetch-KMXKLQKY.js} +27 -20
  356. package/chunks/{web-search-JHAXVEMD.js → web-search-OLBQWW2Y.js} +14 -11
  357. package/chunks/{web-shell-static-FFWCUUZS.js → web-shell-static-XSCCMXKQ.js} +3 -3
  358. package/chunks/{workflow-O7L6VDYU.js → workflow-2LC5ZV4Z.js} +214 -73
  359. package/chunks/workspace-providers-status-4IJHDGCM.js +154 -0
  360. package/chunks/{workspace-registration-store-7G4E7YPY.js → workspace-registration-store-M4LBEY5A.js} +1 -1
  361. package/chunks/workspace-registry-D4HQ3TWX.js +160 -0
  362. package/chunks/workspace-runtime-coordinator-ZG3IRRQ6.js +163 -0
  363. package/chunks/workspace-service-7ORHK4P4.js +165 -0
  364. package/chunks/workspace-skills-status-J43O7A5Q.js +151 -0
  365. package/chunks/{workspace-trust-reconciler-XEBW5FUL.js → workspace-trust-reconciler-7ZMDX27O.js} +99 -75
  366. package/chunks/write-file-MWN2PNMG.js +107 -0
  367. package/chunks/{zh-TW-S3YTQ4DS.js → zh-TW-SRB5QSER.js} +16 -0
  368. package/chunks/{zh-F76MZTL3.js → zh-UBQIFP4A.js} +16 -0
  369. package/chunks/{zoom-image-RDPRTP4B.js → zoom-image-H7MLEC2E.js} +18 -13
  370. package/cli.js +14 -14
  371. package/export-transcript-document.js +52 -52
  372. package/locales/en.js +18 -0
  373. package/locales/zh-TW.js +17 -0
  374. package/locales/zh.js +17 -0
  375. package/package.json +3 -3
  376. package/web-shell/assets/{abnfDiagram-VCTEODGH-RxykUDmi.js → abnfDiagram-VCTEODGH-L57MVQ_O.js} +1 -1
  377. package/web-shell/assets/{arc-CZpgGCJC.js → arc-Cdl4BCU9.js} +1 -1
  378. package/web-shell/assets/{architectureDiagram-5GKGNRK7-BHSMzNDT.js → architectureDiagram-5GKGNRK7-wLGfVuoB.js} +1 -1
  379. package/web-shell/assets/{blockDiagram-NRAW4CY4-Bn4mF9SZ.js → blockDiagram-NRAW4CY4-LXdTypiA.js} +1 -1
  380. package/web-shell/assets/{c4Diagram-UCG6FXSJ-CBM-Bj6t.js → c4Diagram-UCG6FXSJ-Ci95CJAD.js} +1 -1
  381. package/web-shell/assets/channel-DwdlDVan.js +1 -0
  382. package/web-shell/assets/{chunk-2Q5K7J3B-D5Fin58O.js → chunk-2Q5K7J3B-CTb0CG3P.js} +1 -1
  383. package/web-shell/assets/{chunk-5VM5RSS4-CY05weF7.js → chunk-5VM5RSS4-BIyA8dbi.js} +1 -1
  384. package/web-shell/assets/{chunk-F27PBJKO-3neZnj5Y.js → chunk-F27PBJKO-BlcPeoaN.js} +1 -1
  385. package/web-shell/assets/{chunk-G27WJ6UU-Cd7EU4BE.js → chunk-G27WJ6UU-KdH5H1ne.js} +1 -1
  386. package/web-shell/assets/{chunk-JWPE2WC7-DwK1mqFw.js → chunk-JWPE2WC7-DEh0r7ty.js} +1 -1
  387. package/web-shell/assets/{chunk-LCL6LL3I-Sl7vY22C.js → chunk-LCL6LL3I-DwD-l0mq.js} +1 -1
  388. package/web-shell/assets/{chunk-POPQ4Y6H-BXNzpbVg.js → chunk-POPQ4Y6H-D_ybAWGG.js} +1 -1
  389. package/web-shell/assets/{chunk-SVP7TREG-DjjButcp.js → chunk-SVP7TREG-Bk6Dq0yA.js} +1 -1
  390. package/web-shell/assets/{chunk-XXDRQBXY-DNOiCjOJ.js → chunk-XXDRQBXY-D4vL2YuW.js} +1 -1
  391. package/web-shell/assets/classDiagram-DTDB5LWJ-CIyD-qft.js +1 -0
  392. package/web-shell/assets/classDiagram-v2-JRS7N3AN-CIyD-qft.js +1 -0
  393. package/web-shell/assets/{cose-bilkent-JH36ORCC-BUnker7a.js → cose-bilkent-JH36ORCC-BditfMcM.js} +1 -1
  394. package/web-shell/assets/{cynefin-OW5HDTMX-DcUgdWE5.js → cynefin-OW5HDTMX-DAlaYMkD.js} +1 -1
  395. package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-CvDKsZsL.js → cynefinDiagram-5FMLGOSQ-B9jOfS3X.js} +1 -1
  396. package/web-shell/assets/{dagre-3AP2YEHR-jpCmUbr1.js → dagre-3AP2YEHR-DO6EyeMX.js} +1 -1
  397. package/web-shell/assets/{diagram-S7CK7UJ4-DBe_bKE5.js → diagram-S7CK7UJ4-DIwGJ7mC.js} +1 -1
  398. package/web-shell/assets/{diagram-UQ7AKVKN-oXvPpDgs.js → diagram-UQ7AKVKN-DT5RqZBV.js} +1 -1
  399. package/web-shell/assets/{diagram-VSXAHHWV-BD7-_SGh.js → diagram-VSXAHHWV-DJBMayCs.js} +1 -1
  400. package/web-shell/assets/{diagram-VX7I27RA-DOJL0wub.js → diagram-VX7I27RA-BllSiq1w.js} +1 -1
  401. package/web-shell/assets/{diagram-Z3DM3KII-DRIiodDD.js → diagram-Z3DM3KII-Vw1NsAH3.js} +1 -1
  402. package/web-shell/assets/{ebnfDiagram-PWID7BFC-Db31Ulmb.js → ebnfDiagram-PWID7BFC-TY7loKI3.js} +1 -1
  403. package/web-shell/assets/{erDiagram-SSCWMZ5O-CVHhwI2_.js → erDiagram-SSCWMZ5O-BYrxi-FK.js} +1 -1
  404. package/web-shell/assets/{flowDiagram-A5DVABFB-DWOFy1FK.js → flowDiagram-A5DVABFB-BTQ4IRh-.js} +1 -1
  405. package/web-shell/assets/{ganttDiagram-EL5Y4UJY-C0sxQtPd.js → ganttDiagram-EL5Y4UJY-96GXN9_Z.js} +1 -1
  406. package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-CNituBYC.js → gitGraphDiagram-WWUBYQGX-BgIxQjuh.js} +1 -1
  407. package/web-shell/assets/{index-B15NlwB8.js → index-BvmsVGIg.js} +472 -465
  408. package/web-shell/assets/{index-BSrS0tQ6.css → index-D0aLpdAG.css} +2 -2
  409. package/web-shell/assets/{index-gm9tLk7h.js → index-SPar5CcF.js} +1 -1
  410. package/web-shell/assets/{infoDiagram-RXCK75RN-CxhJYtIR.js → infoDiagram-RXCK75RN-BlyUMpEA.js} +1 -1
  411. package/web-shell/assets/{ishikawaDiagram-5VMMS53U-By2mchUy.js → ishikawaDiagram-5VMMS53U-94uLMZ3k.js} +1 -1
  412. package/web-shell/assets/{journeyDiagram-EYS64GPL-CVH-OweI.js → journeyDiagram-EYS64GPL-DbnJfG3S.js} +1 -1
  413. package/web-shell/assets/{kanban-definition-3QL26DDD-Cc9dQXLy.js → kanban-definition-3QL26DDD-gjWM2ioU.js} +1 -1
  414. package/web-shell/assets/{layout-C_60ysHw.js → layout-CmDpGoK-.js} +1 -1
  415. package/web-shell/assets/{linear-BvAVfqwu.js → linear-DksWgqn0.js} +1 -1
  416. package/web-shell/assets/{mermaid.core-C3CoBKAc.js → mermaid.core-DCpE5atR.js} +6 -6
  417. package/web-shell/assets/{mindmap-definition-FBJOCRG2-Cuu8Q8LM.js → mindmap-definition-FBJOCRG2-DanEOvck.js} +1 -1
  418. package/web-shell/assets/{pegDiagram-XKGWAZYB-DmAeyDO2.js → pegDiagram-XKGWAZYB-V2ee76OP.js} +1 -1
  419. package/web-shell/assets/{pieDiagram-E7YTZNPT-B7vbB_xv.js → pieDiagram-E7YTZNPT-CYvmbkkp.js} +1 -1
  420. package/web-shell/assets/{quadrantDiagram-AXDQQJYC-BqOBkRR7.js → quadrantDiagram-AXDQQJYC-BRkw6ha0.js} +1 -1
  421. package/web-shell/assets/{railroadDiagram-O6MQD6OU-sI06lZIu.js → railroadDiagram-O6MQD6OU-D_YmVT7T.js} +1 -1
  422. package/web-shell/assets/{requirementDiagram-EFPCY7ZU-Bg13d10S.js → requirementDiagram-EFPCY7ZU-DTF9UgWw.js} +1 -1
  423. package/web-shell/assets/{sankeyDiagram-P5KCCOFB-WFOzZHrR.js → sankeyDiagram-P5KCCOFB-znmuOvtK.js} +1 -1
  424. package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-CCdRbA4E.js → sequenceDiagram-WJ2MYXX4-B8CE9gDr.js} +1 -1
  425. package/web-shell/assets/{sizeCapture-X5ZJPWSS-BH5F3bGg.js → sizeCapture-X5ZJPWSS-BqE_jooQ.js} +1 -1
  426. package/web-shell/assets/{stateDiagram-HBIQ2CUA-NwS2X3QB.js → stateDiagram-HBIQ2CUA-4AmlCOLW.js} +1 -1
  427. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-DwExf4Jm.js +1 -0
  428. package/web-shell/assets/{swimlanes-XN3QIQJK-Bm38pM28.js → swimlanes-XN3QIQJK-B40gtZOq.js} +1 -1
  429. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-CXXUsHPj.js +8 -0
  430. package/web-shell/assets/{timeline-definition-24CTP7MA-Do-agLSo.js → timeline-definition-24CTP7MA-B23KIwTc.js} +1 -1
  431. package/web-shell/assets/{vennDiagram-4TSXK5OY-aggLfZzl.js → vennDiagram-4TSXK5OY-eyJpBjg6.js} +1 -1
  432. package/web-shell/assets/{wardleyDiagram-VM6X3IG4-D5JR3mXX.js → wardleyDiagram-VM6X3IG4-BBjaaHeP.js} +1 -1
  433. package/web-shell/assets/{xychartDiagram-S5SC5T6Z-DhtLDuXs.js → xychartDiagram-S5SC5T6Z-Cq3Bnvj4.js} +1 -1
  434. package/web-shell/index.html +2 -2
  435. package/chunks/MaxSizedBox-FCF6M53W.js +0 -124
  436. package/chunks/acp-subagent-executor-TND6W2O5.js +0 -140
  437. package/chunks/agent-headless-EJ4QOUSM.js +0 -94
  438. package/chunks/bridge-MUX5YJZT.js +0 -132
  439. package/chunks/channel-settings-store-7CBIRZER.js +0 -134
  440. package/chunks/chunk-FIJODK52.js +0 -154
  441. package/chunks/chunk-OALXNGUA.js +0 -2137
  442. package/chunks/chunk-PF7GAP6K.js +0 -16861
  443. package/chunks/config-utils-KX2YS725.js +0 -127
  444. package/chunks/contextCommand-RV6Y5LNJ.js +0 -120
  445. package/chunks/daemon-status-provider-NULJNAEV.js +0 -131
  446. package/chunks/daemon-trust-policy-S4KWGPV3.js +0 -126
  447. package/chunks/deferred-core-runtime-T23ZT443.js +0 -128
  448. package/chunks/environment-TSQJUTPV.js +0 -143
  449. package/chunks/errors-RIVYJS6T.js +0 -127
  450. package/chunks/exitPlanMode-BYBBFN2T.js +0 -92
  451. package/chunks/handleAutoUpdate-FZP45KOR.js +0 -123
  452. package/chunks/i18n-OTB62AKW.js +0 -140
  453. package/chunks/initializer-4JXZEC4B.js +0 -127
  454. package/chunks/installationInfo-2IJV5QKC.js +0 -121
  455. package/chunks/list-KQSQ4A5G.js +0 -130
  456. package/chunks/loadedSettingsAdapter-TZTTNRHI.js +0 -124
  457. package/chunks/mcp-TFDTUPIA.js +0 -124
  458. package/chunks/model-configuration-ZCAKKIOF.js +0 -137
  459. package/chunks/modelConfigUtils-J3ZPW7ZK.js +0 -116
  460. package/chunks/nonInteractiveCli-GPT3TVOK.js +0 -211
  461. package/chunks/pidfile-GBTBIGHF.js +0 -127
  462. package/chunks/prompt-terminal-ledger-ILIXZI3E.js +0 -119
  463. package/chunks/read-file-G4XKW2CS.js +0 -31
  464. package/chunks/record-source-2GSY5JD5.js +0 -22
  465. package/chunks/resumeHistoryUtils-YPJU4XFE.js +0 -132
  466. package/chunks/ripGrep-AAKMALLM.js +0 -39
  467. package/chunks/runtime-SJCRYNPA.js +0 -164
  468. package/chunks/sandbox-UIXL423Z.js +0 -146
  469. package/chunks/sandboxConfig-CY343YNJ.js +0 -114
  470. package/chunks/scheduled-tasks-5UGBEVNZ.js +0 -143
  471. package/chunks/scheduler-GCZYLZ2P.js +0 -136
  472. package/chunks/serve-2XXQLVK2.js +0 -132
  473. package/chunks/session-attachments-root-DHQM5IEZ.js +0 -117
  474. package/chunks/skill-settings-IXG5CTQO.js +0 -140
  475. package/chunks/spawnChannel-Q3YALTCJ.js +0 -128
  476. package/chunks/standalone-update-H5OJ7MM7.js +0 -132
  477. package/chunks/task-create-75HVPEAH.js +0 -28
  478. package/chunks/terminal-image-renderer-UDPJPGPQ.js +0 -132
  479. package/chunks/theme-manager-SK57EKMO.js +0 -116
  480. package/chunks/total-session-admission-UUZBDQCG.js +0 -127
  481. package/chunks/trustedFolders-4LDBLNTS.js +0 -136
  482. package/chunks/updateCheck-PKSSORPO.js +0 -132
  483. package/chunks/useAutoAcceptIndicator-I32UEQPI.js +0 -134
  484. package/chunks/workspace-providers-status-WRX6CJM4.js +0 -130
  485. package/chunks/workspace-registry-SXIMGT4D.js +0 -136
  486. package/chunks/workspace-runtime-coordinator-7DOEHXYT.js +0 -139
  487. package/chunks/workspace-service-HDXOZMYC.js +0 -141
  488. package/chunks/workspace-skills-status-VN4L37CA.js +0 -127
  489. package/chunks/write-file-LKX4ETIO.js +0 -97
  490. package/web-shell/assets/channel-DFYs_LlK.js +0 -1
  491. package/web-shell/assets/classDiagram-DTDB5LWJ-DnGrKXoM.js +0 -1
  492. package/web-shell/assets/classDiagram-v2-JRS7N3AN-DnGrKXoM.js +0 -1
  493. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-1aU2JZXO.js +0 -1
  494. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Dp-u6kQG.js +0 -8
  495. package/chunks/{chunk-XAJZFGD2.js → chunk-PXXYQOZO.js} +8 -8
  496. package/chunks/{chunk-WVURIAEE.js → chunk-SVWWF5TZ.js} +3 -3
  497. package/chunks/{dist-G5UMXIGF.js → dist-I6D6XOWV.js} +1 -1
  498. package/chunks/{dist-UXVNLQHG.js → dist-VIKOMAGG.js} +3 -3
@@ -0,0 +1,1635 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import {
4
+ DashScopeUploader
5
+ } from "./chunk-V2XJJTAB.js";
6
+ import {
7
+ OmniDegradationCache,
8
+ OmniTransportGuardError,
9
+ assertWithinByteLimit,
10
+ assertWithinDurationLimit,
11
+ assertWithinTokenLimit,
12
+ effectiveMaxUploadFileBytes,
13
+ effectiveOmniStorageMaxTotalBytes,
14
+ estimateRawResourceTokens,
15
+ runFixedPolicies,
16
+ runOmniGcOnce
17
+ } from "./chunk-ZAX2LW35.js";
18
+ import {
19
+ MEDIA_DETECTOR_VERSION,
20
+ MediaMemoryService
21
+ } from "./chunk-SLHYLVRW.js";
22
+ import {
23
+ runStartupRecoveryOnce
24
+ } from "./chunk-RSFNJ6UU.js";
25
+ import {
26
+ DEFAULT_UPLOAD_CACHE_TTL_HOURS,
27
+ OmniUploadCache
28
+ } from "./chunk-JYGESWZM.js";
29
+ import {
30
+ OmniObjectStore,
31
+ prepareOmniDownloadsDir
32
+ } from "./chunk-FTKXJMQV.js";
33
+ import {
34
+ extensionForMime,
35
+ hashFileSha256,
36
+ recognizeMediaFile,
37
+ sniffMediaType
38
+ } from "./chunk-S5BHLTHK.js";
39
+ import {
40
+ isFfmpegAvailable,
41
+ isFfprobeAvailable
42
+ } from "./chunk-KSEKRQJO.js";
43
+ import {
44
+ resolveNetworkTarget
45
+ } from "./chunk-6C3D7BKK.js";
46
+ import {
47
+ isOmniDeliveryActive
48
+ } from "./chunk-O345BAI3.js";
49
+ import {
50
+ requireEffectiveOmniUploadConfig
51
+ } from "./chunk-NX6JUO42.js";
52
+ import {
53
+ OMNI_DISCLOSURE_TEXT_PREFIX,
54
+ OMNI_OMISSION_TEXT_PREFIX,
55
+ OMNI_RESOURCE_HANDLE_TEXT_PREFIX,
56
+ OMNI_RESOURCE_PATH_TEXT_PREFIX,
57
+ OMNI_TRANSCRIPT_TEXT_PREFIX,
58
+ formatDisclosureText,
59
+ formatOmissionText,
60
+ formatResourceHandleText,
61
+ formatTranscriptText,
62
+ harnessPathAnnotationPart,
63
+ isHarnessAnnotationPart,
64
+ parseResourceHandleText,
65
+ parseResourcePathText,
66
+ splitAnnotationBody,
67
+ unescapeAnnotationName
68
+ } from "./chunk-BKVPLSEI.js";
69
+ import {
70
+ isPermittedRedirect,
71
+ isPrivateHost
72
+ } from "./chunk-KKPIFWTZ.js";
73
+ import {
74
+ detectRuntime,
75
+ loadUndici
76
+ } from "./chunk-SBP43AO6.js";
77
+ import {
78
+ createDebugLogger
79
+ } from "./chunk-ZYDMQCQP.js";
80
+ import {
81
+ isAbortError
82
+ } from "./chunk-S34QJ6IR.js";
83
+ import {
84
+ init_esbuild_shims
85
+ } from "./chunk-5O2XNYP6.js";
86
+ import {
87
+ __name
88
+ } from "./chunk-J2S4EL5Y.js";
89
+
90
+ // packages/core/src/omni/index.ts
91
+ init_esbuild_shims();
92
+ import { createHash } from "node:crypto";
93
+ import path4 from "node:path";
94
+ import fs4 from "node:fs/promises";
95
+
96
+ // packages/core/src/omni/policy/session-context.ts
97
+ init_esbuild_shims();
98
+ function buildSessionConditionNamespace(config, reservedOutputTokens) {
99
+ const session = {
100
+ reservedOutputTokens
101
+ };
102
+ const windowSize = config.getContentGeneratorConfig?.()?.contextWindowSize;
103
+ const contextWindowTokens = typeof windowSize === "number" && Number.isFinite(windowSize) && windowSize > 0 ? windowSize : void 0;
104
+ if (contextWindowTokens !== void 0) {
105
+ session.contextWindowTokens = contextWindowTokens;
106
+ }
107
+ let promptTokenCount;
108
+ try {
109
+ const count = config.getGeminiClient?.()?.getChat?.()?.getLastPromptTokenCount();
110
+ if (typeof count === "number" && Number.isFinite(count) && count >= 0) {
111
+ promptTokenCount = count;
112
+ }
113
+ } catch {
114
+ }
115
+ if (promptTokenCount !== void 0) {
116
+ session.promptTokenCount = promptTokenCount;
117
+ }
118
+ if (contextWindowTokens !== void 0 && promptTokenCount !== void 0) {
119
+ session.availableContextTokens = Math.max(
120
+ 0,
121
+ contextWindowTokens - promptTokenCount - reservedOutputTokens
122
+ );
123
+ }
124
+ return session;
125
+ }
126
+ __name(buildSessionConditionNamespace, "buildSessionConditionNamespace");
127
+
128
+ // packages/core/src/omni/download.ts
129
+ init_esbuild_shims();
130
+ import { randomBytes } from "node:crypto";
131
+ import { once } from "node:events";
132
+ import { createWriteStream } from "node:fs";
133
+ import fs from "node:fs/promises";
134
+ import path from "node:path";
135
+ import { Readable } from "node:stream";
136
+ import { pipeline } from "node:stream/promises";
137
+ var debugLogger = createDebugLogger("omni:download");
138
+ var OmniDownloadError = class extends Error {
139
+ static {
140
+ __name(this, "OmniDownloadError");
141
+ }
142
+ constructor(message, options) {
143
+ super(message, options);
144
+ this.name = "OmniDownloadError";
145
+ }
146
+ };
147
+ var RESOLVE_TIMEOUT_MS = 3e4;
148
+ var HEADER_TIMEOUT_MS = 3e4;
149
+ var IDLE_TIMEOUT_MS = 6e4;
150
+ var MAX_REDIRECTS = 5;
151
+ function parseHttpUrlRef(pathName) {
152
+ if (!/^https?:\/\//i.test(pathName)) return null;
153
+ try {
154
+ return new URL(pathName);
155
+ } catch {
156
+ return null;
157
+ }
158
+ }
159
+ __name(parseHttpUrlRef, "parseHttpUrlRef");
160
+ function scrubPathsFromMessage(message) {
161
+ return message.replace(
162
+ /(?:[A-Za-z]:)?(?:[\\/][^\s'"`\\/]+){2,}[\\/]?/g,
163
+ (match) => path.basename(match)
164
+ );
165
+ }
166
+ __name(scrubPathsFromMessage, "scrubPathsFromMessage");
167
+ function formatCauseChain(err) {
168
+ const parts = [];
169
+ let cause = err instanceof Error ? err.cause : void 0;
170
+ for (let depth = 0; cause != null && depth < 4; depth++) {
171
+ const code = cause.code;
172
+ const message = cause instanceof Error ? cause.message : typeof cause === "string" ? cause : void 0;
173
+ if (typeof code === "string" && message && !message.includes(code)) {
174
+ parts.push(`${code}: ${message}`);
175
+ } else if (message) {
176
+ parts.push(message);
177
+ } else if (typeof code === "string") {
178
+ parts.push(code);
179
+ }
180
+ cause = cause instanceof Error ? cause.cause : void 0;
181
+ }
182
+ return parts.length > 0 ? scrubPathsFromMessage(parts.join("; ")) : void 0;
183
+ }
184
+ __name(formatCauseChain, "formatCauseChain");
185
+ function detectConfiguredProxy(undici) {
186
+ for (const key of [
187
+ "https_proxy",
188
+ "HTTPS_PROXY",
189
+ "http_proxy",
190
+ "HTTP_PROXY",
191
+ "all_proxy",
192
+ "ALL_PROXY"
193
+ ]) {
194
+ if (process.env[key]) return true;
195
+ }
196
+ try {
197
+ return undici.getGlobalDispatcher() instanceof undici.EnvHttpProxyAgent;
198
+ } catch {
199
+ return false;
200
+ }
201
+ }
202
+ __name(detectConfiguredProxy, "detectConfiguredProxy");
203
+ async function downloadMediaUrl(params) {
204
+ const {
205
+ url,
206
+ downloadsDir,
207
+ maxBytes,
208
+ signal,
209
+ resolveTimeoutMs = RESOLVE_TIMEOUT_MS,
210
+ headerTimeoutMs = HEADER_TIMEOUT_MS,
211
+ idleTimeoutMs = IDLE_TIMEOUT_MS
212
+ } = params;
213
+ const resolveTarget = params.resolveTarget ?? ((target) => resolveNetworkTarget(target, "public", signal));
214
+ if (isPrivateHost(url)) {
215
+ throw new OmniDownloadError(
216
+ `URL host is not publicly routable (refused for safety): ${new URL(url).hostname}`
217
+ );
218
+ }
219
+ let parsed;
220
+ try {
221
+ parsed = new URL(url);
222
+ } catch {
223
+ throw new OmniDownloadError("URL media ref is not a valid URL (refused).");
224
+ }
225
+ if (parsed.protocol !== "https:") {
226
+ throw new OmniDownloadError(
227
+ `URL media must be https (refused for safety): ${parsed.protocol}//${parsed.hostname}`
228
+ );
229
+ }
230
+ if (parsed.username || parsed.password) {
231
+ throw new OmniDownloadError(
232
+ `URL media must not embed credentials (refused for safety): ${parsed.hostname}`
233
+ );
234
+ }
235
+ const runtime = detectRuntime();
236
+ if (runtime !== "node") {
237
+ throw new OmniDownloadError(
238
+ `URL media requires the Node runtime to verify the connection target (refused for safety on ${runtime}): use a local file path instead of a URL, or run under Node.`
239
+ );
240
+ }
241
+ const undici = await loadUndici();
242
+ const proxied = params.detectProxy ? params.detectProxy() : detectConfiguredProxy(undici);
243
+ if (proxied) {
244
+ throw new OmniDownloadError(
245
+ `URL media fetching is not supported behind a proxy yet (refused): the connection pinning that enforces SSRF protection cannot be applied through a proxy. Download the file manually and use a local path instead.`
246
+ );
247
+ }
248
+ try {
249
+ await prepareOmniDownloadsDir(downloadsDir);
250
+ } catch (err) {
251
+ throw new OmniDownloadError(
252
+ `Could not prepare the downloads directory for URL media: ${err instanceof Error ? scrubPathsFromMessage(err.message) : String(err)}`,
253
+ { cause: err }
254
+ );
255
+ }
256
+ const partPath = path.join(
257
+ downloadsDir,
258
+ `${randomBytes(8).toString("hex")}.part`
259
+ );
260
+ let currentUrl = url;
261
+ let dispatcher;
262
+ try {
263
+ for (let redirects = 0; ; redirects++) {
264
+ let target;
265
+ const resolveAbort = new AbortController();
266
+ const resolveTimer = setTimeout(
267
+ () => resolveAbort.abort(new Error("resolve timeout")),
268
+ resolveTimeoutMs
269
+ );
270
+ try {
271
+ const pending = resolveTarget(currentUrl);
272
+ pending.catch(() => {
273
+ });
274
+ target = await Promise.race([
275
+ pending,
276
+ new Promise((_, reject) => {
277
+ resolveAbort.signal.addEventListener(
278
+ "abort",
279
+ () => reject(resolveAbort.signal.reason),
280
+ { once: true }
281
+ );
282
+ })
283
+ ]);
284
+ } catch (err) {
285
+ if (signal?.aborted) throw err;
286
+ if (resolveAbort.signal.aborted) {
287
+ throw new OmniDownloadError(
288
+ `Download timed out resolving ${new URL(currentUrl).hostname} (${resolveTimeoutMs / 1e3}s)`
289
+ );
290
+ }
291
+ const text = err instanceof Error ? err.message : String(err);
292
+ const reason = /blocked address/i.test(text) ? "resolved to a non-public address" : /did not resolve/i.test(text) ? "did not resolve" : "could not be verified";
293
+ throw new OmniDownloadError(
294
+ `URL host ${reason} (refused for safety): ${new URL(currentUrl).hostname}`,
295
+ { cause: err }
296
+ );
297
+ } finally {
298
+ clearTimeout(resolveTimer);
299
+ }
300
+ if (!target.lookup) {
301
+ throw new OmniDownloadError(
302
+ `URL host cannot be safely bound to a verified address (refused for safety): ${new URL(currentUrl).hostname}`
303
+ );
304
+ }
305
+ const fetchFn = params.fetchFn ?? undici.fetch;
306
+ const previousDispatcher = dispatcher;
307
+ dispatcher = new undici.Agent({ connect: { lookup: target.lookup } });
308
+ await previousDispatcher?.close().catch(() => {
309
+ });
310
+ const headerAbort = new AbortController();
311
+ const headerTimer = setTimeout(
312
+ () => headerAbort.abort(new Error("header timeout")),
313
+ headerTimeoutMs
314
+ );
315
+ const combined = AbortSignal.any(
316
+ signal ? [signal, headerAbort.signal] : [headerAbort.signal]
317
+ );
318
+ let res;
319
+ try {
320
+ res = await fetchFn(currentUrl, {
321
+ redirect: "manual",
322
+ signal: combined,
323
+ // Not in the DOM RequestInit type; undici reads it (same cast as
324
+ // services/image-generation-service.ts).
325
+ dispatcher
326
+ });
327
+ } catch (err) {
328
+ if (signal?.aborted) throw err;
329
+ if (headerAbort.signal.aborted) {
330
+ throw new OmniDownloadError(
331
+ `Download timed out waiting for response headers from ${new URL(currentUrl).hostname} (${headerTimeoutMs / 1e3}s)`
332
+ );
333
+ }
334
+ const detail = err instanceof Error ? scrubPathsFromMessage(err.message) : String(err);
335
+ const causeDetail = formatCauseChain(err);
336
+ throw new OmniDownloadError(
337
+ `Download request failed for ${new URL(currentUrl).hostname}: ${detail}${causeDetail ? ` (${causeDetail})` : ""}`,
338
+ { cause: err }
339
+ );
340
+ } finally {
341
+ clearTimeout(headerTimer);
342
+ }
343
+ if (res.status >= 300 && res.status < 400) {
344
+ await res.body?.cancel().catch(() => {
345
+ });
346
+ const location = res.headers.get("location");
347
+ if (!location || redirects >= MAX_REDIRECTS) {
348
+ throw new OmniDownloadError(
349
+ `Too many or invalid redirects downloading from ${new URL(currentUrl).hostname}`
350
+ );
351
+ }
352
+ let redirectUrl;
353
+ try {
354
+ redirectUrl = new URL(location, currentUrl).toString();
355
+ } catch {
356
+ throw new OmniDownloadError(
357
+ `Redirect with a malformed Location header from ${new URL(currentUrl).hostname}`
358
+ );
359
+ }
360
+ if (!isPermittedRedirect(currentUrl, redirectUrl)) {
361
+ throw new OmniDownloadError(
362
+ `Cross-origin redirect refused: ${new URL(currentUrl).hostname} \u2192 ${new URL(redirectUrl).hostname}`
363
+ );
364
+ }
365
+ currentUrl = redirectUrl;
366
+ continue;
367
+ }
368
+ if (!res.ok) {
369
+ await res.body?.cancel().catch(() => {
370
+ });
371
+ throw new OmniDownloadError(
372
+ `Download failed: HTTP ${res.status} from ${new URL(currentUrl).hostname}`
373
+ );
374
+ }
375
+ const contentLength = Number(res.headers.get("content-length"));
376
+ if (Number.isFinite(contentLength) && contentLength > maxBytes) {
377
+ await res.body?.cancel().catch(() => {
378
+ });
379
+ throw new OmniDownloadError(
380
+ `Download exceeds the omni media limit: Content-Length ${contentLength} > ${maxBytes} bytes.`
381
+ );
382
+ }
383
+ if (!res.body) {
384
+ throw new OmniDownloadError("Download response had no body.");
385
+ }
386
+ let written = 0;
387
+ const idleAbort = new AbortController();
388
+ let idleTimer = setTimeout(
389
+ () => idleAbort.abort(new Error("idle timeout")),
390
+ idleTimeoutMs
391
+ );
392
+ const streamSignal = AbortSignal.any(
393
+ signal ? [signal, idleAbort.signal] : [idleAbort.signal]
394
+ );
395
+ try {
396
+ const source = Readable.fromWeb(
397
+ res.body,
398
+ { signal: streamSignal }
399
+ );
400
+ const counter = /* @__PURE__ */ __name(async function* (src) {
401
+ for await (const chunk of src) {
402
+ clearTimeout(idleTimer);
403
+ idleTimer = setTimeout(
404
+ () => idleAbort.abort(new Error("idle timeout")),
405
+ idleTimeoutMs
406
+ );
407
+ written += chunk.length;
408
+ if (written > maxBytes) {
409
+ throw new OmniDownloadError(
410
+ `Download exceeds the omni media limit: >${maxBytes} bytes received.`
411
+ );
412
+ }
413
+ yield chunk;
414
+ }
415
+ }, "counter");
416
+ const destination = createWriteStream(partPath, { mode: 384 });
417
+ await once(destination, "open");
418
+ await pipeline(source, counter, destination);
419
+ } catch (err) {
420
+ if (signal?.aborted) throw err;
421
+ if (err instanceof OmniDownloadError) throw err;
422
+ if (idleAbort.signal.aborted) {
423
+ throw new OmniDownloadError(
424
+ `Download stalled from ${new URL(currentUrl).hostname}: no data for ${idleTimeoutMs / 1e3}s`
425
+ );
426
+ }
427
+ throw new OmniDownloadError(
428
+ `Download interrupted from ${new URL(currentUrl).hostname}: ${err instanceof Error ? scrubPathsFromMessage(err.message) : String(err)}`,
429
+ { cause: err }
430
+ );
431
+ } finally {
432
+ clearTimeout(idleTimer);
433
+ }
434
+ debugLogger.debug(
435
+ `downloaded ${written} bytes from ${new URL(currentUrl).hostname}`
436
+ );
437
+ return { partPath };
438
+ }
439
+ } catch (err) {
440
+ await fs.rm(partPath, { force: true });
441
+ throw err;
442
+ } finally {
443
+ await dispatcher?.close().catch(() => {
444
+ });
445
+ }
446
+ }
447
+ __name(downloadMediaUrl, "downloadMediaUrl");
448
+
449
+ // packages/core/src/omni/tool-result-media.ts
450
+ init_esbuild_shims();
451
+ import { randomBytes as randomBytes2 } from "node:crypto";
452
+ import fs2 from "node:fs/promises";
453
+ import path2 from "node:path";
454
+ var debugLogger2 = createDebugLogger("omni:tool-result");
455
+ var MAX_UPLOADS_PER_TOOL_RESULT = 8;
456
+ var MAX_UPLOAD_BYTES_PER_TOOL_RESULT = 128 * 1024 * 1024;
457
+ async function processToolResultOmniMedia(responseParts, config, signal) {
458
+ if (!isOmniDeliveryActive(config)) return responseParts;
459
+ const modalities = config.getContentGeneratorConfig?.()?.modalities ?? {};
460
+ let changed = false;
461
+ let uploadsRemaining = MAX_UPLOADS_PER_TOOL_RESULT;
462
+ let uploadBytesRemaining = MAX_UPLOAD_BYTES_PER_TOOL_RESULT;
463
+ const convertPart = /* @__PURE__ */ __name(async (part) => {
464
+ const inline = part.inlineData;
465
+ if (!inline?.data || !inline.mimeType) return [part];
466
+ const top = inline.mimeType.split("/")[0];
467
+ if (top !== "image" && top !== "audio" && top !== "video") return [part];
468
+ const bytes = Buffer.from(inline.data, "base64");
469
+ const sniffed = sniffMediaType(bytes.subarray(0, 4096));
470
+ if (!sniffed) return [part];
471
+ if (!modalities[sniffed.modality]) return [part];
472
+ if (uploadsRemaining <= 0 || bytes.length > uploadBytesRemaining) {
473
+ debugLogger2.debug(
474
+ `tool-result media budget exhausted; keeping part inline (${bytes.length} bytes)`
475
+ );
476
+ return [part];
477
+ }
478
+ const store = new OmniObjectStore(config.storage.getQwenDir());
479
+ let tempPath;
480
+ const displayName = inline.displayName ?? `tool-media.${top}`;
481
+ try {
482
+ const stagingDir = await prepareOmniDownloadsDir(
483
+ path2.join(store.getOmniRootDir(), "downloads")
484
+ );
485
+ tempPath = path2.join(
486
+ stagingDir,
487
+ `${randomBytes2(8).toString("hex")}.part`
488
+ );
489
+ await fs2.writeFile(tempPath, bytes, { mode: 384 });
490
+ const delivery = await processMediaForOmniDelivery(tempPath, config, {
491
+ expectedModality: sniffed.modality,
492
+ signal,
493
+ displayName,
494
+ origin: "tool"
495
+ });
496
+ const transcriptParts = buildTranscriptParts(
497
+ displayName,
498
+ delivery.transcripts
499
+ );
500
+ const additionalParts = buildAdditionalMediaParts(
501
+ displayName,
502
+ delivery.additionalMedia
503
+ );
504
+ uploadsRemaining -= delivery.additionalMedia?.filter((e) => !e.omission).length ?? 0;
505
+ const handleParts = delivery.resourceId ? [
506
+ {
507
+ text: formatResourceHandleText(displayName, delivery.resourceId)
508
+ }
509
+ ] : [];
510
+ if (delivery.omission) {
511
+ changed = true;
512
+ return [
513
+ ...handleParts,
514
+ { text: formatOmissionText(displayName, delivery.omission.reason) },
515
+ ...additionalParts,
516
+ ...transcriptParts
517
+ ];
518
+ }
519
+ if (!delivery.fileUri && transcriptParts.length > 0) {
520
+ changed = true;
521
+ return delivery.disclosure ? [
522
+ ...handleParts,
523
+ { text: formatDisclosureText(displayName, delivery.disclosure) },
524
+ ...additionalParts,
525
+ ...transcriptParts
526
+ ] : [...handleParts, ...additionalParts, ...transcriptParts];
527
+ }
528
+ changed = true;
529
+ uploadsRemaining--;
530
+ uploadBytesRemaining -= bytes.length;
531
+ const fileDataPart = {
532
+ fileData: {
533
+ fileUri: delivery.fileUri,
534
+ mimeType: delivery.mimeType,
535
+ displayName
536
+ }
537
+ };
538
+ return delivery.disclosure ? [
539
+ ...handleParts,
540
+ { text: formatDisclosureText(displayName, delivery.disclosure) },
541
+ fileDataPart,
542
+ ...additionalParts,
543
+ ...transcriptParts
544
+ ] : [
545
+ ...handleParts,
546
+ fileDataPart,
547
+ ...additionalParts,
548
+ ...transcriptParts
549
+ ];
550
+ } catch (err) {
551
+ if (signal.aborted) throw err;
552
+ if (err instanceof OmniTransportGuardError) {
553
+ changed = true;
554
+ return [
555
+ ...err.sessionResourceId ? [
556
+ {
557
+ text: formatResourceHandleText(
558
+ displayName,
559
+ err.sessionResourceId
560
+ )
561
+ }
562
+ ] : [],
563
+ {
564
+ text: `[Tool media part withheld by the omni transport guard: ${err.message}]`
565
+ }
566
+ ];
567
+ }
568
+ debugLogger2.debug(
569
+ `tool-result media upload failed, keeping inline: ${err instanceof Error ? err.message : String(err)}`
570
+ );
571
+ return [part];
572
+ } finally {
573
+ if (tempPath !== void 0) {
574
+ await fs2.rm(tempPath, { force: true }).catch(() => {
575
+ });
576
+ }
577
+ }
578
+ }, "convertPart");
579
+ const result = [];
580
+ for (const part of responseParts) {
581
+ const nested = part.functionResponse?.parts;
582
+ if (Array.isArray(nested) && nested.length > 0) {
583
+ const convertedNested = [];
584
+ let nestedChanged = false;
585
+ for (const nestedPart of nested) {
586
+ const converted = await convertPart(nestedPart);
587
+ if (converted.length !== 1 || converted[0] !== nestedPart) {
588
+ nestedChanged = true;
589
+ }
590
+ convertedNested.push(...converted);
591
+ }
592
+ if (nestedChanged) {
593
+ result.push({
594
+ ...part,
595
+ functionResponse: {
596
+ ...part.functionResponse,
597
+ parts: convertedNested
598
+ }
599
+ });
600
+ changed = true;
601
+ } else {
602
+ result.push(part);
603
+ }
604
+ continue;
605
+ }
606
+ result.push(...await convertPart(part));
607
+ }
608
+ return changed ? result : responseParts;
609
+ }
610
+ __name(processToolResultOmniMedia, "processToolResultOmniMedia");
611
+
612
+ // packages/core/src/omni/export.ts
613
+ init_esbuild_shims();
614
+ import fs3 from "node:fs/promises";
615
+ import path3 from "node:path";
616
+ var debugLogger3 = createDebugLogger("omni:export");
617
+ function textOfPart(part) {
618
+ if (typeof part === "string") return part;
619
+ if (typeof part === "object" && part !== null && "text" in part) {
620
+ const text = part.text;
621
+ return typeof text === "string" ? text : void 0;
622
+ }
623
+ return void 0;
624
+ }
625
+ __name(textOfPart, "textOfPart");
626
+ function functionResponseOfPart(part) {
627
+ if (typeof part !== "object" || part === null) return void 0;
628
+ const response = part.functionResponse;
629
+ if (typeof response !== "object" || response === null) return void 0;
630
+ const { id, parts } = response;
631
+ return { id, ...Array.isArray(parts) ? { parts } : {} };
632
+ }
633
+ __name(functionResponseOfPart, "functionResponseOfPart");
634
+ function isThoughtPart(part) {
635
+ return typeof part === "object" && part !== null && part.thought === true;
636
+ }
637
+ __name(isThoughtPart, "isThoughtPart");
638
+ function functionCallOfPart(part) {
639
+ if (typeof part !== "object" || part === null) return void 0;
640
+ const fc = part.functionCall;
641
+ if (typeof fc !== "object" || fc === null) return void 0;
642
+ const { id, name, args } = fc;
643
+ if (typeof name !== "string") return void 0;
644
+ const cleanArgs = typeof args === "object" && args !== null ? { ...args } : void 0;
645
+ return {
646
+ ...typeof id === "string" ? { callId: id } : {},
647
+ name,
648
+ ...cleanArgs ? { args: cleanArgs } : {}
649
+ };
650
+ }
651
+ __name(functionCallOfPart, "functionCallOfPart");
652
+ function stripSystemReminders(text) {
653
+ return text.replace(/<system-reminder>[\s\S]*?<\/system-reminder>/g, "");
654
+ }
655
+ __name(stripSystemReminders, "stripSystemReminders");
656
+ function mediaFor(turn, name) {
657
+ let media = turn.media.get(name);
658
+ if (!media) {
659
+ media = { name, disclosures: [], transcripts: [] };
660
+ turn.media.set(name, media);
661
+ }
662
+ return media;
663
+ }
664
+ __name(mediaFor, "mediaFor");
665
+ function consumeAnnotationPart(turn, text, isHarnessAnnotation) {
666
+ if (text.startsWith(OMNI_RESOURCE_HANDLE_TEXT_PREFIX)) {
667
+ const resourceId = parseResourceHandleText(text);
668
+ if (resourceId) {
669
+ const body = text.slice(OMNI_RESOURCE_HANDLE_TEXT_PREFIX.length);
670
+ const name = unescapeAnnotationName(
671
+ body.slice(0, body.length - resourceId.length - 1)
672
+ );
673
+ mediaFor(turn, name).resourceId = resourceId;
674
+ return true;
675
+ }
676
+ return false;
677
+ }
678
+ if (text.startsWith(OMNI_RESOURCE_PATH_TEXT_PREFIX)) {
679
+ if (!isHarnessAnnotation) return false;
680
+ const filePath = parseResourcePathText(text);
681
+ if (filePath) {
682
+ mediaFor(turn, filePath.split(/[\\/]/).pop() ?? filePath);
683
+ return true;
684
+ }
685
+ return false;
686
+ }
687
+ for (const [prefix, apply] of [
688
+ [
689
+ OMNI_DISCLOSURE_TEXT_PREFIX,
690
+ (m, payload) => {
691
+ m.disclosures.push(payload);
692
+ }
693
+ ],
694
+ [
695
+ OMNI_OMISSION_TEXT_PREFIX,
696
+ (m, payload) => {
697
+ m.omitted = payload;
698
+ }
699
+ ],
700
+ [
701
+ OMNI_TRANSCRIPT_TEXT_PREFIX,
702
+ (m, payload) => {
703
+ m.transcripts.push(payload);
704
+ }
705
+ ]
706
+ ]) {
707
+ if (!text.startsWith(prefix)) continue;
708
+ const split = splitAnnotationBody(text.slice(prefix.length));
709
+ if (!split) return false;
710
+ apply(mediaFor(turn, split.name), split.payload);
711
+ return true;
712
+ }
713
+ return false;
714
+ }
715
+ __name(consumeAnnotationPart, "consumeAnnotationPart");
716
+ function consumeRecordParts(turn, record, collectProse) {
717
+ const parts = (record.message?.parts ?? []).flatMap((part) => [
718
+ part,
719
+ ...functionResponseOfPart(part)?.parts ?? []
720
+ ]);
721
+ for (const part of parts) {
722
+ const raw = textOfPart(part);
723
+ if (raw === void 0) continue;
724
+ const withoutReminders = stripSystemReminders(raw);
725
+ const forAnnotation = withoutReminders.replace(/^\s+/, "");
726
+ if (consumeAnnotationPart(turn, forAnnotation, isHarnessAnnotationPart(part)))
727
+ continue;
728
+ const prose = withoutReminders.trim();
729
+ if (!prose) continue;
730
+ if (collectProse) turn.requestTexts.push(prose);
731
+ }
732
+ }
733
+ __name(consumeRecordParts, "consumeRecordParts");
734
+ function finishTurn(turn, sessionId) {
735
+ return {
736
+ kind: "turn",
737
+ sessionId,
738
+ turnIndex: turn.turnIndex,
739
+ ...turn.timestamp !== void 0 ? { timestamp: turn.timestamp } : {},
740
+ request: {
741
+ text: turn.requestTexts.join("\n"),
742
+ media: [...turn.media.values()],
743
+ ...turn.recall !== void 0 ? { recall: turn.recall } : {}
744
+ },
745
+ response: {
746
+ text: turn.responseTexts.join("\n"),
747
+ toolCalls: turn.toolCalls
748
+ }
749
+ };
750
+ }
751
+ __name(finishTurn, "finishTurn");
752
+ function activeChainRecords(records) {
753
+ const byUuid = /* @__PURE__ */ new Map();
754
+ for (const record of records) {
755
+ if (typeof record.uuid === "string") byUuid.set(record.uuid, record);
756
+ }
757
+ if (byUuid.size === 0) return records;
758
+ let leaf;
759
+ for (let i = records.length - 1; i >= 0; i--) {
760
+ if (typeof records[i].uuid === "string") {
761
+ leaf = records[i];
762
+ break;
763
+ }
764
+ }
765
+ if (!leaf) return records;
766
+ const active = /* @__PURE__ */ new Set();
767
+ let current = leaf;
768
+ while (current?.uuid && !active.has(current.uuid)) {
769
+ active.add(current.uuid);
770
+ current = typeof current.parentUuid === "string" ? byUuid.get(current.parentUuid) : void 0;
771
+ }
772
+ return records.filter(
773
+ (r) => typeof r.uuid !== "string" || active.has(r.uuid)
774
+ );
775
+ }
776
+ __name(activeChainRecords, "activeChainRecords");
777
+ function buildTurnRecords(transcriptLines) {
778
+ const turns = [];
779
+ let sessionId = "";
780
+ let current;
781
+ for (const record of activeChainRecords(transcriptLines)) {
782
+ if (typeof record.sessionId === "string" && sessionId === "") {
783
+ sessionId = record.sessionId;
784
+ }
785
+ if (record.type === "user" && record.subtype === void 0) {
786
+ if (current) turns.push(finishTurn(current, sessionId));
787
+ current = {
788
+ turnIndex: turns.length,
789
+ ...record.timestamp !== void 0 ? { timestamp: record.timestamp } : {},
790
+ requestTexts: [],
791
+ media: /* @__PURE__ */ new Map(),
792
+ responseTexts: [],
793
+ toolCalls: []
794
+ };
795
+ consumeRecordParts(current, record, true);
796
+ continue;
797
+ }
798
+ if (!current) continue;
799
+ if (record.type === "system" && record.subtype === "omni_recall") {
800
+ current.recall = record.systemPayload;
801
+ continue;
802
+ }
803
+ if (record.type === "tool_result") {
804
+ consumeRecordParts(current, record, false);
805
+ continue;
806
+ }
807
+ if (record.type === "assistant") {
808
+ for (const part of record.message?.parts ?? []) {
809
+ if (isThoughtPart(part)) continue;
810
+ const text = textOfPart(part);
811
+ if (text !== void 0 && text.trim()) {
812
+ current.responseTexts.push(text);
813
+ continue;
814
+ }
815
+ const call = functionCallOfPart(part);
816
+ if (call) current.toolCalls.push(call);
817
+ }
818
+ }
819
+ }
820
+ if (current) turns.push(finishTurn(current, sessionId));
821
+ return turns;
822
+ }
823
+ __name(buildTurnRecords, "buildTurnRecords");
824
+ async function readSnapshotRaw(omniRootDir) {
825
+ const filePath = path3.join(omniRootDir, "memory.json");
826
+ let raw;
827
+ try {
828
+ raw = await fs3.readFile(filePath, "utf8");
829
+ } catch {
830
+ return void 0;
831
+ }
832
+ try {
833
+ const parsed = JSON.parse(raw);
834
+ if (typeof parsed !== "object" || parsed === null || [parsed.files, parsed.versions, parsed.executions, parsed.entries].some(
835
+ (c) => typeof c !== "object" || c === null || Array.isArray(c)
836
+ )) {
837
+ throw new Error("unexpected snapshot shape");
838
+ }
839
+ return parsed;
840
+ } catch (err) {
841
+ debugLogger3.debug(
842
+ `trajectory export: memory unreadable, exporting transcript only: ${err instanceof Error ? err.message : err}`
843
+ );
844
+ return void 0;
845
+ }
846
+ }
847
+ __name(readSnapshotRaw, "readSnapshotRaw");
848
+ function buildMemoryRecords(snapshot) {
849
+ const files = [];
850
+ const executions = [];
851
+ for (const version of Object.values(snapshot.versions)) {
852
+ try {
853
+ const file = snapshot.files[version.fileId];
854
+ if (!file) continue;
855
+ files.push({
856
+ kind: "file",
857
+ fileId: version.fileId,
858
+ fileVersionId: version.fileVersionId,
859
+ rootFileId: file.rootFileId,
860
+ sha256: version.sha256,
861
+ mediaType: version.mediaType,
862
+ origin: file.origin,
863
+ sizeBytes: version.sizeBytes,
864
+ mimeType: version.mimeType,
865
+ source: version.source,
866
+ ...version.producedByExecutionId !== void 0 ? { producedByExecutionId: version.producedByExecutionId } : {},
867
+ ...version.parentVersionId !== void 0 ? { parentVersionId: version.parentVersionId } : {},
868
+ createdAt: version.createdAt
869
+ });
870
+ } catch {
871
+ }
872
+ }
873
+ for (const execution of Object.values(snapshot.executions)) {
874
+ try {
875
+ const outputs = execution.outputRefs.flatMap((entryId) => {
876
+ const entry = snapshot.entries[entryId];
877
+ if (!entry) return [];
878
+ return [
879
+ {
880
+ kind: entry.kind,
881
+ ...entry.role !== void 0 ? { role: entry.role } : {},
882
+ ...entry.artifactRef?.managedId?.startsWith("sha256/") ? { sha256: entry.artifactRef.managedId.slice("sha256/".length) } : {},
883
+ ...entry.artifactRef?.mimeType !== void 0 ? { mimeType: entry.artifactRef.mimeType } : {},
884
+ ...entry.artifactRef?.sizeBytes !== void 0 ? { sizeBytes: entry.artifactRef.sizeBytes } : {},
885
+ ...entry.disclosure !== void 0 ? { disclosure: entry.disclosure } : {}
886
+ }
887
+ ];
888
+ });
889
+ executions.push({
890
+ kind: "execution",
891
+ executionId: execution.executionId,
892
+ invocationId: execution.invocationId,
893
+ executionOrigin: execution.executionOrigin,
894
+ toolName: execution.toolName,
895
+ ...execution.toolVersion !== void 0 ? { toolVersion: execution.toolVersion } : {},
896
+ finalArguments: execution.finalArguments,
897
+ omniConfigHash: execution.omniConfigHash,
898
+ sourceVersionId: execution.sourceVersionId,
899
+ rootFileId: execution.rootFileId,
900
+ startedAt: execution.startedAt,
901
+ completedAt: execution.completedAt,
902
+ ...execution.reusedExecutionId !== void 0 ? { reusedExecutionId: execution.reusedExecutionId } : {},
903
+ outputs
904
+ });
905
+ } catch {
906
+ }
907
+ }
908
+ return { files, executions };
909
+ }
910
+ __name(buildMemoryRecords, "buildMemoryRecords");
911
+ function filterToSession(memory, turns, transcriptLines) {
912
+ const callIds = /* @__PURE__ */ new Set();
913
+ for (const record of activeChainRecords(transcriptLines)) {
914
+ if (record.type !== "tool_result") continue;
915
+ for (const part of record.message?.parts ?? []) {
916
+ const id = functionResponseOfPart(part)?.id;
917
+ if (typeof id === "string") callIds.add(id);
918
+ }
919
+ }
920
+ const mediaNames = /* @__PURE__ */ new Set();
921
+ for (const turn of turns) {
922
+ for (const call of turn.response.toolCalls) {
923
+ if (call.callId) callIds.add(call.callId);
924
+ }
925
+ for (const media of turn.request.media) mediaNames.add(media.name);
926
+ }
927
+ const filesByVersion = new Map(memory.files.map((f) => [f.fileVersionId, f]));
928
+ const versionsByFile = /* @__PURE__ */ new Map();
929
+ for (const f of memory.files) {
930
+ const list = versionsByFile.get(f.fileId) ?? [];
931
+ list.push(f);
932
+ versionsByFile.set(f.fileId, list);
933
+ }
934
+ const includedFiles = /* @__PURE__ */ new Set();
935
+ const includedExecutions = /* @__PURE__ */ new Set();
936
+ const includeFile = /* @__PURE__ */ __name((fileId) => {
937
+ if (!fileId || includedFiles.has(fileId)) return false;
938
+ if (!versionsByFile.has(fileId)) return false;
939
+ includedFiles.add(fileId);
940
+ return true;
941
+ }, "includeFile");
942
+ for (const f of memory.files) {
943
+ if (mediaNames.has(f.source.locator)) includeFile(f.fileId);
944
+ }
945
+ for (const e of memory.executions) {
946
+ if (callIds.has(e.invocationId)) includedExecutions.add(e.executionId);
947
+ }
948
+ let changed = true;
949
+ while (changed) {
950
+ changed = false;
951
+ for (const e of memory.executions) {
952
+ const sourceFile = filesByVersion.get(e.sourceVersionId)?.fileId;
953
+ if (!includedExecutions.has(e.executionId)) {
954
+ if (sourceFile && includedFiles.has(sourceFile)) {
955
+ includedExecutions.add(e.executionId);
956
+ changed = true;
957
+ } else {
958
+ continue;
959
+ }
960
+ }
961
+ if (includeFile(sourceFile)) changed = true;
962
+ }
963
+ for (const f of memory.files) {
964
+ if (includedFiles.has(f.fileId)) continue;
965
+ if (f.producedByExecutionId !== void 0 && includedExecutions.has(f.producedByExecutionId)) {
966
+ includeFile(f.fileId);
967
+ changed = true;
968
+ }
969
+ }
970
+ }
971
+ return {
972
+ files: memory.files.filter((f) => includedFiles.has(f.fileId)),
973
+ executions: memory.executions.filter(
974
+ (e) => includedExecutions.has(e.executionId)
975
+ )
976
+ };
977
+ }
978
+ __name(filterToSession, "filterToSession");
979
+ async function exportOmniTrajectory(options) {
980
+ const raw = await fs3.readFile(options.transcriptPath, "utf8");
981
+ const transcriptLines = [];
982
+ for (const line of raw.split("\n")) {
983
+ if (!line.trim()) continue;
984
+ try {
985
+ transcriptLines.push(JSON.parse(line));
986
+ } catch {
987
+ }
988
+ }
989
+ const turns = buildTurnRecords(transcriptLines);
990
+ const records = [...turns];
991
+ const snapshot = await readSnapshotRaw(options.omniRootDir);
992
+ const memoryRecords = snapshot ? filterToSession(buildMemoryRecords(snapshot), turns, transcriptLines) : { files: [], executions: [] };
993
+ records.push(
994
+ ...memoryRecords.files.sort(
995
+ (a, b) => a.fileVersionId.localeCompare(b.fileVersionId)
996
+ ),
997
+ ...memoryRecords.executions.sort(
998
+ (a, b) => a.executionId.localeCompare(b.executionId)
999
+ )
1000
+ );
1001
+ return records;
1002
+ }
1003
+ __name(exportOmniTrajectory, "exportOmniTrajectory");
1004
+ function serializeOmniTrajectory(records) {
1005
+ return records.map((r) => JSON.stringify(r)).join("\n") + "\n";
1006
+ }
1007
+ __name(serializeOmniTrajectory, "serializeOmniTrajectory");
1008
+ async function writeOmniTrajectoryJsonl(options) {
1009
+ const outPath = path3.resolve(options.outPath);
1010
+ if (outPath === path3.resolve(options.transcriptPath)) {
1011
+ throw new Error("trajectory outPath must differ from the transcript path");
1012
+ }
1013
+ const records = await exportOmniTrajectory(options);
1014
+ await fs3.mkdir(path3.dirname(outPath), { recursive: true });
1015
+ await fs3.writeFile(outPath, serializeOmniTrajectory(records), "utf8");
1016
+ return { records: records.length };
1017
+ }
1018
+ __name(writeOmniTrajectoryJsonl, "writeOmniTrajectoryJsonl");
1019
+
1020
+ // packages/core/src/omni/index.ts
1021
+ var debugLogger4 = createDebugLogger("omni");
1022
+ function sanitizeErrorMessage(err, knownPaths = []) {
1023
+ let msg = err instanceof Error ? err.message : String(err);
1024
+ for (const known of knownPaths) {
1025
+ if (!known) continue;
1026
+ msg = msg.split(known).join(path4.basename(known));
1027
+ const segments = known.split(/[\\/]+/).filter(Boolean);
1028
+ if (/^[A-Za-z]:$/.test(segments[0] ?? "")) segments.shift();
1029
+ if (segments.length >= 2) {
1030
+ const spelled = segments.map((segment) => segment.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("[\\\\/]+");
1031
+ msg = msg.replace(
1032
+ new RegExp(`(?:[A-Za-z]:)?[\\\\/]*${spelled}`, "g"),
1033
+ () => path4.basename(known)
1034
+ );
1035
+ }
1036
+ }
1037
+ return msg.replace(/(?:\/[^/\s'"]+)+\/([^/\s'"]+)/g, "$1").replace(/(?:[A-Za-z]:)?(?:\\[^\\\s'"]+)+\\([^\\\s'"]+)/g, "$1");
1038
+ }
1039
+ __name(sanitizeErrorMessage, "sanitizeErrorMessage");
1040
+ function buildAdditionalMediaParts(displayName, additionalMedia) {
1041
+ const parts = [];
1042
+ for (const extra of additionalMedia ?? []) {
1043
+ if (extra.disclosure) {
1044
+ parts.push({ text: formatDisclosureText(displayName, extra.disclosure) });
1045
+ }
1046
+ if (extra.omission) {
1047
+ parts.push({
1048
+ text: formatOmissionText(displayName, extra.omission.reason)
1049
+ });
1050
+ } else {
1051
+ parts.push({
1052
+ fileData: {
1053
+ fileUri: extra.fileUri,
1054
+ mimeType: extra.mimeType,
1055
+ displayName
1056
+ }
1057
+ });
1058
+ }
1059
+ }
1060
+ return parts;
1061
+ }
1062
+ __name(buildAdditionalMediaParts, "buildAdditionalMediaParts");
1063
+ function buildTranscriptParts(displayName, transcripts) {
1064
+ const parts = [];
1065
+ for (const t of transcripts ?? []) {
1066
+ if (t.disclosure) {
1067
+ parts.push({ text: formatDisclosureText(displayName, t.disclosure) });
1068
+ }
1069
+ parts.push({ text: formatTranscriptText(displayName, t.text) });
1070
+ }
1071
+ return parts;
1072
+ }
1073
+ __name(buildTranscriptParts, "buildTranscriptParts");
1074
+ var OmniDeliveryError = class extends Error {
1075
+ static {
1076
+ __name(this, "OmniDeliveryError");
1077
+ }
1078
+ constructor(message, options) {
1079
+ super(message, options);
1080
+ this.name = "OmniDeliveryError";
1081
+ }
1082
+ };
1083
+ function evaluateTransportLimits(config, recognized, displayName) {
1084
+ try {
1085
+ assertWithinByteLimit(config, recognized.sizeBytes, displayName);
1086
+ assertWithinDurationLimit(config, recognized, displayName);
1087
+ return {
1088
+ estimate: assertWithinTokenLimit(config, recognized, displayName)
1089
+ };
1090
+ } catch (err) {
1091
+ if (err instanceof OmniTransportGuardError) {
1092
+ return {
1093
+ estimate: estimateRawResourceTokens(recognized),
1094
+ violation: err.message
1095
+ };
1096
+ }
1097
+ throw err;
1098
+ }
1099
+ }
1100
+ __name(evaluateTransportLimits, "evaluateTransportLimits");
1101
+ async function processMediaForOmniDelivery(filePath, config, options) {
1102
+ const { expectedModality, signal } = options ?? {};
1103
+ const displayName = options?.displayName ?? path4.basename(filePath);
1104
+ const [ffmpeg, ffprobe] = await Promise.all([
1105
+ isFfmpegAvailable(),
1106
+ isFfprobeAvailable()
1107
+ ]);
1108
+ if (!ffmpeg || !ffprobe) {
1109
+ throw new OmniDeliveryError(
1110
+ "ffmpeg/ffprobe not available; omni media delivery requires both on PATH."
1111
+ );
1112
+ }
1113
+ await fs4.stat(filePath).catch((err) => {
1114
+ throw new OmniDeliveryError(
1115
+ `Cannot stat media file ${displayName}: ${sanitizeErrorMessage(err, [filePath])}`,
1116
+ { cause: err }
1117
+ );
1118
+ });
1119
+ let recognized;
1120
+ try {
1121
+ recognized = await recognizeMediaFile(filePath, {
1122
+ expectedModality,
1123
+ signal
1124
+ });
1125
+ } catch (err) {
1126
+ if (signal?.aborted) throw err;
1127
+ throw new OmniDeliveryError(
1128
+ `Media recognition failed for ${displayName}: ${sanitizeErrorMessage(err, [filePath])}`,
1129
+ { cause: err }
1130
+ );
1131
+ }
1132
+ const store = new OmniObjectStore(config.storage.getQwenDir());
1133
+ const uploadConfig = requireEffectiveOmniUploadConfig(config);
1134
+ const cacheScope = createHash("sha256").update(`${uploadConfig.baseUrl}|${uploadConfig.apiKey}`).digest("hex").slice(0, 16);
1135
+ const configuredTtl = config.getOmniUploadUrlTtlHours?.();
1136
+ const uploadCache = new OmniUploadCache(
1137
+ store.getOmniRootDir(),
1138
+ configuredTtl === void 0 ? DEFAULT_UPLOAD_CACHE_TTL_HOURS : configuredTtl,
1139
+ cacheScope
1140
+ );
1141
+ await runStartupRecoveryOnce(store, uploadCache, {
1142
+ quarantineRetentionDays: config.getOmniQuarantineRetentionDays?.(),
1143
+ quarantineMaxBytes: config.getOmniQuarantineMaxBytes?.(),
1144
+ // Corrupt-object deletion must also invalidate degradation-cache
1145
+ // entries (as source or derivative) — otherwise policy-cache.json
1146
+ // accumulates orphans that can never be served again.
1147
+ degradationCache: new OmniDegradationCache(store.getOmniRootDir())
1148
+ });
1149
+ const processingConfig = config.getOmniProcessingConfig?.();
1150
+ const conditionContext = processingConfig ? {
1151
+ session: buildSessionConditionNamespace(
1152
+ config,
1153
+ processingConfig.limits.reservedOutputTokens
1154
+ )
1155
+ } : void 0;
1156
+ const memoryConfig = config.getOmniMemoryConfig?.();
1157
+ const memoryService = memoryConfig ? new MediaMemoryService(store.getOmniRootDir(), {
1158
+ maxInlineTextBytes: memoryConfig.collection.maxInlineTextBytes
1159
+ }) : void 0;
1160
+ if (memoryService) {
1161
+ void runOmniGcOnce({
1162
+ store,
1163
+ memoryService,
1164
+ registry: config.getOmniMediaResourceRegistry?.(),
1165
+ uploadCache,
1166
+ degradationCache: new OmniDegradationCache(store.getOmniRootDir()),
1167
+ retentionDays: config.getOmniStorageRetentionDays?.() ?? 14,
1168
+ // Floor-clamped: a budget below 10× the single-media limit cannot
1169
+ // hold normal artifacts and would read as permanent suspension.
1170
+ maxTotalBytes: typeof config.getOmniStorageMaxTotalBytes === "function" ? effectiveOmniStorageMaxTotalBytes(config) : 20 * 1024 * 1024 * 1024
1171
+ });
1172
+ }
1173
+ const registry = memoryService ? config.getOmniMediaResourceRegistry?.() : void 0;
1174
+ const bindSessionResource = /* @__PURE__ */ __name((item, fileRefOverride) => registry && item.memoryBinding ? registry.bind({
1175
+ ...item.memoryBinding,
1176
+ fileRef: fileRefOverride ?? item.filePath,
1177
+ mediaType: item.recognized.modality
1178
+ }) : void 0, "bindSessionResource");
1179
+ let sourceSha256;
1180
+ let sourceBinding;
1181
+ let sourceFileRef = filePath;
1182
+ if (memoryService) {
1183
+ try {
1184
+ sourceSha256 = await hashFileSha256(filePath, signal);
1185
+ } catch (err) {
1186
+ if (signal?.aborted) throw err;
1187
+ debugLogger4.debug(
1188
+ `omni memory: hashing ${displayName} failed, skipping collection: ${sanitizeErrorMessage(err, [filePath])}`
1189
+ );
1190
+ }
1191
+ if (sourceSha256) {
1192
+ const origin = options?.origin ?? "user";
1193
+ const ephemeralSource = origin === "tool" || options?.sourceUrl !== void 0;
1194
+ sourceFileRef = ephemeralSource ? store.objectPathFor(
1195
+ sourceSha256,
1196
+ extensionForMime(recognized.detectedMimeType)
1197
+ ) : filePath;
1198
+ sourceBinding = await memoryService.recordFileRecognized({
1199
+ fileRef: sourceFileRef,
1200
+ sha256: sourceSha256,
1201
+ mediaType: recognized.modality,
1202
+ metadata: recognized.metadata,
1203
+ sizeBytes: recognized.sizeBytes,
1204
+ mimeType: recognized.detectedMimeType,
1205
+ origin,
1206
+ source: options?.sourceUrl !== void 0 ? { protocol: "url", locator: options.sourceUrl } : origin === "tool" ? { protocol: "managed", locator: `sha256/${sourceSha256}` } : { protocol: "local", locator: displayName },
1207
+ recognition: {
1208
+ ingestionConfigHash: "",
1209
+ detectorVersion: MEDIA_DETECTOR_VERSION,
1210
+ probeStatus: "complete"
1211
+ }
1212
+ });
1213
+ }
1214
+ }
1215
+ let final = {
1216
+ filePath,
1217
+ recognized,
1218
+ sha256: sourceSha256,
1219
+ memoryBinding: sourceBinding
1220
+ };
1221
+ const sessionResourceId = bindSessionResource(
1222
+ final,
1223
+ sourceFileRef
1224
+ )?.resourceId;
1225
+ const guardRejection = /* @__PURE__ */ __name((message, options2) => {
1226
+ const err = new OmniTransportGuardError(message, options2);
1227
+ if (sessionResourceId !== void 0) {
1228
+ err.sessionResourceId = sessionResourceId;
1229
+ }
1230
+ return err;
1231
+ }, "guardRejection");
1232
+ let extraDeliveries = [];
1233
+ const transcripts = [];
1234
+ const collectTranscripts = /* @__PURE__ */ __name((files) => {
1235
+ for (const file of files) {
1236
+ transcripts.push({ text: file.text, disclosure: file.disclosure });
1237
+ }
1238
+ }, "collectTranscripts");
1239
+ const textOnlyDelivery = /* @__PURE__ */ __name((recognizedFinal, tokenEstimate2, extras) => ({
1240
+ fileUri: "",
1241
+ mimeType: recognizedFinal.detectedMimeType,
1242
+ sha256: "",
1243
+ recognized: recognizedFinal,
1244
+ tokenEstimate: tokenEstimate2,
1245
+ deduped: false,
1246
+ uploadCacheHit: false,
1247
+ degraded: true,
1248
+ transcripts,
1249
+ resourceId: sessionResourceId,
1250
+ ...extras
1251
+ }), "textOnlyDelivery");
1252
+ const policies = processingConfig?.fixedPolicies ?? [];
1253
+ if (policies.length > 0) {
1254
+ let deliveries;
1255
+ let fileDeliveries;
1256
+ try {
1257
+ ({ deliveries, fileDeliveries } = await runFixedPolicies(
1258
+ config,
1259
+ {
1260
+ filePath,
1261
+ recognized,
1262
+ displayName,
1263
+ origin: options?.origin ?? "user",
1264
+ sha256: sourceSha256
1265
+ },
1266
+ {
1267
+ store,
1268
+ policies,
1269
+ signal,
1270
+ limits: processingConfig?.limits,
1271
+ conditionContext,
1272
+ memory: memoryService ? { service: memoryService, sourceBinding } : void 0
1273
+ }
1274
+ ));
1275
+ } catch (err) {
1276
+ if (signal?.aborted) throw err;
1277
+ throw new OmniDeliveryError(
1278
+ `Fixed-policy processing failed for ${displayName}: ${sanitizeErrorMessage(err, [filePath, store.getOmniRootDir()])}`,
1279
+ { cause: err }
1280
+ );
1281
+ }
1282
+ collectTranscripts(fileDeliveries);
1283
+ if (deliveries.length === 0 && transcripts.length > 0) {
1284
+ return textOnlyDelivery(
1285
+ recognized,
1286
+ evaluateTransportLimits(config, recognized, displayName).estimate
1287
+ );
1288
+ }
1289
+ if (deliveries.length === 0) {
1290
+ throw new OmniDeliveryError(
1291
+ `Fixed policies produced 0 media deliverables for ${displayName}; exactly one is supported.`
1292
+ );
1293
+ }
1294
+ final = deliveries[0];
1295
+ extraDeliveries = deliveries.slice(1);
1296
+ for (const delivery of deliveries) bindSessionResource(delivery);
1297
+ }
1298
+ const uploadModel = uploadConfig.model;
1299
+ const uploadResource = /* @__PURE__ */ __name(async (item, estimate) => {
1300
+ let sha256;
1301
+ try {
1302
+ sha256 = item.sha256 ?? await hashFileSha256(item.filePath, signal);
1303
+ } catch (err) {
1304
+ if (signal?.aborted) throw err;
1305
+ throw new OmniDeliveryError(
1306
+ `Failed to hash media file ${displayName}: ${sanitizeErrorMessage(err, [item.filePath])}`,
1307
+ { cause: err }
1308
+ );
1309
+ }
1310
+ const cachedUrl = await uploadCache.get(sha256, uploadModel);
1311
+ if (cachedUrl) {
1312
+ debugLogger4.debug(
1313
+ `omni upload cache hit: sha256=${sha256.slice(0, 12)}\u2026 model=${uploadModel}`
1314
+ );
1315
+ return {
1316
+ fileUri: cachedUrl,
1317
+ sha256,
1318
+ deduped: true,
1319
+ uploadCacheHit: true
1320
+ };
1321
+ }
1322
+ const extension = extensionForMime(item.recognized.detectedMimeType);
1323
+ let objectPath;
1324
+ let deduped;
1325
+ try {
1326
+ const put = await store.putFile(item.filePath, sha256, extension, signal);
1327
+ objectPath = put.objectPath;
1328
+ deduped = put.deduped;
1329
+ } catch (err) {
1330
+ if (signal?.aborted) throw err;
1331
+ throw new OmniDeliveryError(
1332
+ `Failed to store media in the omni object store: ${sanitizeErrorMessage(err, [item.filePath, store.getOmniRootDir()])}`,
1333
+ { cause: err }
1334
+ );
1335
+ }
1336
+ const uploader = new DashScopeUploader({
1337
+ apiKey: uploadConfig.apiKey,
1338
+ baseUrl: uploadConfig.baseUrl
1339
+ });
1340
+ let fileUri;
1341
+ try {
1342
+ fileUri = await uploader.uploadFile({
1343
+ filePath: objectPath,
1344
+ model: uploadModel,
1345
+ mimeType: item.recognized.detectedMimeType,
1346
+ signal
1347
+ });
1348
+ } catch (err) {
1349
+ if (signal?.aborted) throw err;
1350
+ throw new OmniDeliveryError(
1351
+ sanitizeErrorMessage(err, [objectPath, store.getOmniRootDir()]),
1352
+ { cause: err }
1353
+ );
1354
+ }
1355
+ debugLogger4.debug(
1356
+ `omni ${item.recognized.modality} delivered: sha256=${sha256.slice(0, 12)}\u2026 size=${item.recognized.sizeBytes} est=${estimate.estimatedTokenCount}(${estimate.status}) deduped=${deduped} degraded=${item.degraded === true} uri=${fileUri}`
1357
+ );
1358
+ await uploadCache.put(sha256, uploadModel, fileUri);
1359
+ return { fileUri, sha256, deduped, uploadCacheHit: false };
1360
+ }, "uploadResource");
1361
+ const processAdditionalMedia = /* @__PURE__ */ __name(async () => {
1362
+ if (extraDeliveries.length === 0) return void 0;
1363
+ return Promise.all(
1364
+ extraDeliveries.map(
1365
+ async (extra) => {
1366
+ const extraGuard = evaluateTransportLimits(
1367
+ config,
1368
+ extra.recognized,
1369
+ displayName
1370
+ );
1371
+ if (extraGuard.violation) {
1372
+ debugLogger4.debug(
1373
+ `omni additional ${extra.recognized.modality} explicitly omitted (transport guard): ${extraGuard.violation}`
1374
+ );
1375
+ return {
1376
+ fileUri: "",
1377
+ mimeType: extra.recognized.detectedMimeType,
1378
+ sha256: extra.sha256 ?? "",
1379
+ disclosure: extra.disclosure,
1380
+ omission: { reason: extraGuard.violation }
1381
+ };
1382
+ }
1383
+ const uploaded2 = await uploadResource(extra, extraGuard.estimate);
1384
+ return {
1385
+ fileUri: uploaded2.fileUri,
1386
+ mimeType: extra.recognized.detectedMimeType,
1387
+ sha256: uploaded2.sha256,
1388
+ disclosure: extra.disclosure
1389
+ };
1390
+ }
1391
+ )
1392
+ );
1393
+ }, "processAdditionalMedia");
1394
+ let guard = evaluateTransportLimits(config, final.recognized, displayName);
1395
+ if (guard.violation && processingConfig) {
1396
+ const maxPasses = processingConfig.limits.maxTransportPasses;
1397
+ for (let pass = 0; guard.violation && pass < maxPasses; pass++) {
1398
+ const guardPolicies = processingConfig.transportGuardPolicies.filter(
1399
+ (p) => p.mediaTypes.includes(final.recognized.modality)
1400
+ );
1401
+ if (guardPolicies.length === 0) break;
1402
+ let deliveries;
1403
+ let fileDeliveries;
1404
+ try {
1405
+ ({ deliveries, fileDeliveries } = await runFixedPolicies(
1406
+ config,
1407
+ {
1408
+ filePath: final.filePath,
1409
+ recognized: final.recognized,
1410
+ displayName,
1411
+ origin: options?.origin ?? "user",
1412
+ sha256: final.sha256
1413
+ },
1414
+ {
1415
+ store,
1416
+ policies: guardPolicies,
1417
+ signal,
1418
+ limits: processingConfig.limits,
1419
+ conditionContext,
1420
+ // The guard pass derives FROM the current final resource, so
1421
+ // its memory lineage hangs off that resource's own binding
1422
+ // (a derivative's version when preprocessing degraded it).
1423
+ memory: memoryService ? { service: memoryService, sourceBinding: final.memoryBinding } : void 0
1424
+ }
1425
+ ));
1426
+ } catch (err) {
1427
+ if (signal?.aborted) throw err;
1428
+ throw guardRejection(
1429
+ `Transport-guard processing failed for ${displayName}: ${sanitizeErrorMessage(err, [final.filePath, store.getOmniRootDir()])}`,
1430
+ { cause: err }
1431
+ );
1432
+ }
1433
+ collectTranscripts(fileDeliveries);
1434
+ if (deliveries.length === 0 && fileDeliveries.length > 0) {
1435
+ return textOnlyDelivery(final.recognized, guard.estimate, {
1436
+ disclosure: final.disclosure,
1437
+ additionalMedia: await processAdditionalMedia()
1438
+ });
1439
+ }
1440
+ if (deliveries.length !== 1) {
1441
+ throw guardRejection(
1442
+ `Transport-guard policies produced ${deliveries.length} media deliverables for ${displayName}; exactly one is supported.`
1443
+ );
1444
+ }
1445
+ if (deliveries[0].filePath === final.filePath) {
1446
+ break;
1447
+ }
1448
+ const priorDisclosure = final.disclosure;
1449
+ final = deliveries[0];
1450
+ if (priorDisclosure && final.disclosure) {
1451
+ final = {
1452
+ ...final,
1453
+ disclosure: `${priorDisclosure}\uFF1B${final.disclosure}`
1454
+ };
1455
+ } else if (priorDisclosure) {
1456
+ final = { ...final, disclosure: priorDisclosure };
1457
+ }
1458
+ bindSessionResource(final);
1459
+ guard = evaluateTransportLimits(config, final.recognized, displayName);
1460
+ }
1461
+ }
1462
+ if (guard.violation) {
1463
+ if (!processingConfig) {
1464
+ throw guardRejection(guard.violation);
1465
+ }
1466
+ debugLogger4.debug(
1467
+ `omni ${final.recognized.modality} explicitly omitted (transport guard): ${guard.violation}`
1468
+ );
1469
+ return {
1470
+ fileUri: "",
1471
+ mimeType: final.recognized.detectedMimeType,
1472
+ sha256: final.sha256 ?? "",
1473
+ recognized: final.recognized,
1474
+ tokenEstimate: guard.estimate,
1475
+ deduped: false,
1476
+ uploadCacheHit: false,
1477
+ disclosure: final.disclosure,
1478
+ degraded: final.degraded,
1479
+ omission: { reason: guard.violation },
1480
+ transcripts: transcripts.length > 0 ? transcripts : void 0,
1481
+ additionalMedia: await processAdditionalMedia(),
1482
+ resourceId: sessionResourceId
1483
+ };
1484
+ }
1485
+ const tokenEstimate = guard.estimate;
1486
+ const uploaded = await uploadResource(final, tokenEstimate);
1487
+ return {
1488
+ fileUri: uploaded.fileUri,
1489
+ mimeType: final.recognized.detectedMimeType,
1490
+ sha256: uploaded.sha256,
1491
+ recognized: final.recognized,
1492
+ tokenEstimate,
1493
+ deduped: uploaded.deduped,
1494
+ uploadCacheHit: uploaded.uploadCacheHit,
1495
+ disclosure: final.disclosure,
1496
+ degraded: final.degraded,
1497
+ transcripts: transcripts.length > 0 ? transcripts : void 0,
1498
+ additionalMedia: await processAdditionalMedia(),
1499
+ resourceId: sessionResourceId
1500
+ };
1501
+ }
1502
+ __name(processMediaForOmniDelivery, "processMediaForOmniDelivery");
1503
+ async function readMediaViaOmniDelivery(params) {
1504
+ const {
1505
+ filePath,
1506
+ config,
1507
+ displayName,
1508
+ relativePathForDisplay,
1509
+ expectedModality,
1510
+ signal
1511
+ } = params;
1512
+ try {
1513
+ const delivery = await processMediaForOmniDelivery(filePath, config, {
1514
+ expectedModality,
1515
+ signal
1516
+ });
1517
+ const transcriptParts = buildTranscriptParts(
1518
+ displayName,
1519
+ delivery.transcripts
1520
+ );
1521
+ const additionalParts = buildAdditionalMediaParts(
1522
+ displayName,
1523
+ delivery.additionalMedia
1524
+ );
1525
+ const handleParts = (() => {
1526
+ if (!delivery.resourceId) return [];
1527
+ const binding = config.getOmniMediaResourceRegistry?.()?.resolve(delivery.resourceId);
1528
+ if (binding && binding.fileRef === filePath && !/[\r\n]/.test(filePath)) {
1529
+ return [harnessPathAnnotationPart(filePath)];
1530
+ }
1531
+ return [
1532
+ { text: formatResourceHandleText(displayName, delivery.resourceId) }
1533
+ ];
1534
+ })();
1535
+ if (delivery.omission) {
1536
+ const omissionPart = {
1537
+ text: formatOmissionText(displayName, delivery.omission.reason)
1538
+ };
1539
+ return {
1540
+ llmContent: transcriptParts.length > 0 || additionalParts.length > 0 || handleParts.length > 0 ? [
1541
+ ...handleParts,
1542
+ omissionPart,
1543
+ ...additionalParts,
1544
+ ...transcriptParts
1545
+ ] : omissionPart.text,
1546
+ returnDisplay: `Media omitted by the omni transport guard: ${relativePathForDisplay}`,
1547
+ tokenEstimate: delivery.tokenEstimate
1548
+ };
1549
+ }
1550
+ if (!delivery.fileUri && transcriptParts.length > 0) {
1551
+ const disclosureParts = delivery.disclosure ? [{ text: formatDisclosureText(displayName, delivery.disclosure) }] : [];
1552
+ return {
1553
+ llmContent: [
1554
+ ...handleParts,
1555
+ ...disclosureParts,
1556
+ ...additionalParts,
1557
+ ...transcriptParts
1558
+ ],
1559
+ returnDisplay: `Read ${delivery.recognized.modality} as transcript (omni policy): ${relativePathForDisplay}`,
1560
+ tokenEstimate: delivery.tokenEstimate
1561
+ };
1562
+ }
1563
+ const fileDataPart = {
1564
+ fileData: {
1565
+ fileUri: delivery.fileUri,
1566
+ mimeType: delivery.mimeType,
1567
+ displayName
1568
+ }
1569
+ };
1570
+ const parts = [
1571
+ ...handleParts
1572
+ ];
1573
+ const { width, height } = delivery.recognized.metadata;
1574
+ if (delivery.recognized.modality === "image" && width !== void 0 && height !== void 0) {
1575
+ parts.push({
1576
+ text: delivery.disclosure ? `Image ${displayName}: delivered at ${width}x${height} px after degradation. Use zoom_image to inspect details \u2014 it reads the original file.` : `Image ${displayName}: full resolution ${width}x${height} px. Use zoom_image for a closer look at details.`
1577
+ });
1578
+ }
1579
+ if (delivery.disclosure) {
1580
+ parts.push({
1581
+ text: formatDisclosureText(displayName, delivery.disclosure)
1582
+ });
1583
+ }
1584
+ parts.push(fileDataPart);
1585
+ parts.push(...additionalParts);
1586
+ parts.push(...transcriptParts);
1587
+ const llmContent = parts.length === 1 ? fileDataPart : parts;
1588
+ return {
1589
+ llmContent,
1590
+ returnDisplay: `Read ${delivery.recognized.modality} file (omni upload): ${relativePathForDisplay}`,
1591
+ tokenEstimate: delivery.tokenEstimate
1592
+ };
1593
+ } catch (err) {
1594
+ if (isAbortError(err) || signal?.aborted) throw err;
1595
+ const message = sanitizeErrorMessage(err, [filePath]);
1596
+ return {
1597
+ llmContent: `[Omni media delivery failed for ${displayName}: ${message}]`,
1598
+ returnDisplay: `Failed to deliver media via omni upload: ${relativePathForDisplay}`,
1599
+ error: `Omni media delivery failed: ${displayName}: ${message}`,
1600
+ errorType: "read_content_failure" /* READ_CONTENT_FAILURE */
1601
+ };
1602
+ }
1603
+ }
1604
+ __name(readMediaViaOmniDelivery, "readMediaViaOmniDelivery");
1605
+ function effectiveMaxDownloadFileBytes(config) {
1606
+ const uploadCap = effectiveMaxUploadFileBytes(config);
1607
+ const configured = config.getOmniUrlDownloadMaxFileBytes?.();
1608
+ if (configured !== void 0 && configured > 0) {
1609
+ return Math.min(configured, uploadCap);
1610
+ }
1611
+ return uploadCap;
1612
+ }
1613
+ __name(effectiveMaxDownloadFileBytes, "effectiveMaxDownloadFileBytes");
1614
+
1615
+ export {
1616
+ OmniDownloadError,
1617
+ parseHttpUrlRef,
1618
+ downloadMediaUrl,
1619
+ exportOmniTrajectory,
1620
+ serializeOmniTrajectory,
1621
+ writeOmniTrajectoryJsonl,
1622
+ sanitizeErrorMessage,
1623
+ buildAdditionalMediaParts,
1624
+ buildTranscriptParts,
1625
+ OmniDeliveryError,
1626
+ processMediaForOmniDelivery,
1627
+ readMediaViaOmniDelivery,
1628
+ effectiveMaxDownloadFileBytes,
1629
+ processToolResultOmniMedia
1630
+ };
1631
+ /**
1632
+ * @license
1633
+ * Copyright 2025 Google LLC
1634
+ * SPDX-License-Identifier: Apache-2.0
1635
+ */