@qwen-code/qwen-code 0.23.5-preview.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (480) hide show
  1. package/bundled/qc-helper/docs/features/_meta.ts +1 -0
  2. package/bundled/qc-helper/docs/features/goals.md +4 -2
  3. package/bundled/qc-helper/docs/features/omni-fixed-policies-preset.json +242 -0
  4. package/bundled/qc-helper/docs/features/omni-media-policies.md +443 -0
  5. package/bundled/qc-helper/docs/overview.md +1 -1
  6. package/bundled/qc-helper/docs/quickstart.md +2 -3
  7. package/chunks/MaxSizedBox-I5COUCHZ.js +148 -0
  8. package/chunks/{StandaloneSessionPicker-V635V72I.js → StandaloneSessionPicker-KUGOBVEW.js} +114 -90
  9. package/chunks/acp-subagent-executor-PRPMLKVJ.js +164 -0
  10. package/chunks/{acpAgent-3DPWZTNC.js → acpAgent-EHXZXVUB.js} +269 -194
  11. package/chunks/{agent-KIHGINKN.js → agent-FWPNJI6N.js} +59 -49
  12. package/chunks/agent-headless-M5Z7WIDL.js +104 -0
  13. package/chunks/{anthropicContentGenerator-4FGOM5LK.js → anthropicContentGenerator-FLTEUSIQ.js} +30 -27
  14. package/chunks/{artifact-tool-MUTNH4NI.js → artifact-tool-3MWM6SN2.js} +11 -7
  15. package/chunks/{askUserQuestion-AKIRLVB5.js → askUserQuestion-YFFBB4K3.js} +6 -4
  16. package/chunks/bridge-EWCKRGWY.js +156 -0
  17. package/chunks/{build-5KWQBWEQ.js → build-5OQN7CDU.js} +1 -1
  18. package/chunks/caption-audio-UXXLI3JZ.js +443 -0
  19. package/chunks/caption-image-B7O4TUFP.js +247 -0
  20. package/chunks/{channel-management-service-RRILWSXX.js → channel-management-service-GRJG5R46.js} +1 -1
  21. package/chunks/channel-settings-store-NXZNLT5L.js +158 -0
  22. package/chunks/{channel-worker-group-3DUJFZJR.js → channel-worker-group-SCSKCSBJ.js} +4 -4
  23. package/chunks/{channel-worker-manager-E5UW2VLA.js → channel-worker-manager-AHCZCKON.js} +4 -4
  24. package/chunks/{channel-worker-supervisor-VN33GSEC.js → channel-worker-supervisor-BGUAVITB.js} +3 -3
  25. package/chunks/{chunk-3LLEB5CU.js → chunk-24ZB2JNI.js} +2 -2
  26. package/chunks/{chunk-5NUKK2DT.js → chunk-25FMWESU.js} +47 -8
  27. package/chunks/{chunk-3WWPEFMX.js → chunk-2FQM443D.js} +82 -4
  28. package/chunks/{chunk-VEXUA6DX.js → chunk-2FRZ4ZP2.js} +13 -11
  29. package/chunks/{chunk-WBSJ6VPZ.js → chunk-2GNZTJRK.js} +3 -3
  30. package/chunks/{chunk-YP2K3WOS.js → chunk-2VWXODMY.js} +7 -4
  31. package/chunks/{chunk-L2A5VBDL.js → chunk-2ZCLSPE4.js} +9 -9
  32. package/chunks/{chunk-KEM7MWS7.js → chunk-366JNNY7.js} +6 -4
  33. package/chunks/{chunk-TKF4JINY.js → chunk-3FEGERVL.js} +1 -1
  34. package/chunks/{chunk-TDKUXSJO.js → chunk-3MW6PPA5.js} +1 -1
  35. package/chunks/{chunk-4LIPOIXS.js → chunk-3NHJLWOD.js} +1 -1
  36. package/chunks/{chunk-3UGMLA4V.js → chunk-3V7RNGLC.js} +10 -10
  37. package/chunks/{chunk-XICCGDWF.js → chunk-3WIPATJX.js} +2 -2
  38. package/chunks/chunk-43QUA4MC.js +135 -0
  39. package/chunks/{chunk-Q2SAQTEJ.js → chunk-4B7U3KQP.js} +1 -1
  40. package/chunks/{chunk-SFL6U7U7.js → chunk-4JFRCIMW.js} +2 -2
  41. package/chunks/{chunk-TPY6HW55.js → chunk-4OZY6LN2.js} +12 -6
  42. package/chunks/{chunk-IVFTLUZD.js → chunk-4SZ2636R.js} +3 -3
  43. package/chunks/{chunk-7CLLH5TI.js → chunk-4YS7RMCB.js} +6 -4
  44. package/chunks/{chunk-NQ272MQG.js → chunk-5XK2YELE.js} +7 -5
  45. package/chunks/{chunk-HX4WXX3H.js → chunk-65YADOPT.js} +89 -74
  46. package/chunks/chunk-6C3D7BKK.js +153 -0
  47. package/chunks/{chunk-DC4ZNGH4.js → chunk-6DB6UHY3.js} +3 -3
  48. package/chunks/{chunk-WZWTY7SG.js → chunk-6IW6SX75.js} +6 -6
  49. package/chunks/{chunk-HYHSMTRA.js → chunk-6XRR4RYH.js} +4 -4
  50. package/chunks/{chunk-AXPOOQAW.js → chunk-736AZVPL.js} +2 -2
  51. package/chunks/{chunk-UQGRJTDK.js → chunk-7JWD2EML.js} +3 -3
  52. package/chunks/{chunk-BUQN5LTI.js → chunk-7PQ65Z5F.js} +2 -2
  53. package/chunks/{chunk-43Y26NPF.js → chunk-A5EWSUYT.js} +3 -3
  54. package/chunks/{chunk-VQDWCQOE.js → chunk-ANKISCKU.js} +1 -0
  55. package/chunks/{chunk-NXUZFW3G.js → chunk-AUFTA63J.js} +1 -1
  56. package/chunks/{chunk-4QPVZA5J.js → chunk-AVVSSP4R.js} +3 -3
  57. package/chunks/{chunk-36SDZ2Q4.js → chunk-B3HGO6BB.js} +7 -5
  58. package/chunks/{chunk-6USYH3EU.js → chunk-B3XJFEEH.js} +5 -3
  59. package/chunks/{chunk-GSKX53AN.js → chunk-BA6AXQDA.js} +1 -1
  60. package/chunks/{chunk-FBY32737.js → chunk-BHHR5MEI.js} +4 -4
  61. package/chunks/{chunk-FX6PZBOV.js → chunk-BJ2TJY7V.js} +4 -4
  62. package/chunks/chunk-BKVPLSEI.js +133 -0
  63. package/chunks/chunk-BQMSZSG6.js +21 -0
  64. package/chunks/{chunk-BW2SMO6L.js → chunk-BXAU2UKM.js} +1 -1
  65. package/chunks/{chunk-3LMDSCLU.js → chunk-C4FISGDN.js} +2 -2
  66. package/chunks/{chunk-XFFRI3WM.js → chunk-CA63HYHU.js} +4 -2
  67. package/chunks/{chunk-IXO2OCIP.js → chunk-CKNBSVBC.js} +12 -8
  68. package/chunks/{chunk-347O2YZJ.js → chunk-CNG7ILRW.js} +39 -61
  69. package/chunks/chunk-CQULG2GJ.js +1330 -0
  70. package/chunks/{chunk-VVI7MK3V.js → chunk-CTGMXP4A.js} +9 -7
  71. package/chunks/{chunk-QT6Z2IBF.js → chunk-CYFQLCCG.js} +2 -2
  72. package/chunks/chunk-DBDJRURL.js +42 -0
  73. package/chunks/{chunk-X7AYIXC7.js → chunk-DJLCK66M.js} +5 -3
  74. package/chunks/chunk-DJYHML3Y.js +121 -0
  75. package/chunks/{chunk-MO4XID7S.js → chunk-DNDECZXY.js} +3 -3
  76. package/chunks/{chunk-D7JMO2GP.js → chunk-DNHL4S5B.js} +1 -1
  77. package/chunks/{chunk-WL36KHUQ.js → chunk-DTSG4EHA.js} +11 -9
  78. package/chunks/{chunk-M23GFJ5B.js → chunk-EHMLJKF5.js} +1 -1
  79. package/chunks/{chunk-TIGXX4PA.js → chunk-EKBQJ627.js} +2 -2
  80. package/chunks/{chunk-RSWBT7AZ.js → chunk-ERIBG3BX.js} +35 -551
  81. package/chunks/{chunk-PPJSG2PU.js → chunk-EVZT24AF.js} +6 -142
  82. package/chunks/{chunk-E2VSBAFA.js → chunk-FL2EJUOY.js} +5 -5
  83. package/chunks/{chunk-2C5TR6HN.js → chunk-FSNLTHNG.js} +1 -1
  84. package/chunks/chunk-FTKXJMQV.js +255 -0
  85. package/chunks/{chunk-TRZ22SG5.js → chunk-FXPP7VLM.js} +6 -4
  86. package/chunks/{chunk-CDDP4ONL.js → chunk-G3PBYAGM.js} +60 -134
  87. package/chunks/{chunk-AEWCOE64.js → chunk-GACWUBXV.js} +2 -2
  88. package/chunks/{chunk-OWUAZXXN.js → chunk-GHG4PQY2.js} +3 -3
  89. package/chunks/{chunk-VU3XMZ5I.js → chunk-GHZJQCSZ.js} +3 -3
  90. package/chunks/{chunk-FIJODK52.js → chunk-GJHAV2F7.js} +3 -3
  91. package/chunks/{chunk-36NRLIR6.js → chunk-GQZA7EYC.js} +11 -11
  92. package/chunks/{chunk-4JFLRHNE.js → chunk-GVHYY2RS.js} +1 -1
  93. package/chunks/{chunk-H6L4NEAT.js → chunk-GVMXFXQG.js} +1 -1
  94. package/chunks/{chunk-G45B3INR.js → chunk-GVTAFLWB.js} +2 -2
  95. package/chunks/{chunk-GJKP6XOB.js → chunk-GW5SJ3II.js} +16 -19
  96. package/chunks/{chunk-AQP3H22J.js → chunk-GY7FOHQP.js} +1 -1
  97. package/chunks/chunk-GZ5MEGA3.js +44 -0
  98. package/chunks/{chunk-FCPJXKDG.js → chunk-HA6DKD44.js} +9 -9
  99. package/chunks/{chunk-FEDFZBGR.js → chunk-HR4OWLKI.js} +3 -3
  100. package/chunks/{chunk-CXY6BICQ.js → chunk-HWKWZSZY.js} +162 -109
  101. package/chunks/{chunk-K4XMAIRX.js → chunk-I3NKMMHS.js} +12 -12
  102. package/chunks/{chunk-QMENOK5T.js → chunk-IH4TNUVS.js} +9 -7
  103. package/chunks/{chunk-FASYATAZ.js → chunk-IHUOMYBO.js} +1 -1
  104. package/chunks/{chunk-IZ2U57NY.js → chunk-IITTKFWM.js} +4 -2
  105. package/chunks/{chunk-M22WLKLI.js → chunk-IQGEZOGN.js} +7 -7
  106. package/chunks/chunk-IVPSLX4P.js +578 -0
  107. package/chunks/{chunk-BTICBRPL.js → chunk-IWMYX5LB.js} +3 -3
  108. package/chunks/{chunk-V4JJAVHQ.js → chunk-JCIDHFSB.js} +2 -2
  109. package/chunks/{chunk-PF7GAP6K.js → chunk-JENFAGVX.js} +65 -54
  110. package/chunks/{chunk-LO2UWNO5.js → chunk-JFEWKEKG.js} +3 -3
  111. package/chunks/{chunk-BHG3H6OZ.js → chunk-JJVDKHQU.js} +1 -1
  112. package/chunks/chunk-JYGESWZM.js +149 -0
  113. package/chunks/{chunk-KVC7HZWK.js → chunk-JYTJ5FCM.js} +1 -1
  114. package/chunks/{chunk-KVQ3QL4K.js → chunk-KCL6OMCX.js} +3 -3
  115. package/chunks/{chunk-3HTUE6ZR.js → chunk-KCRV4F3G.js} +4 -4
  116. package/chunks/{chunk-3WILPKTJ.js → chunk-KKPIFWTZ.js} +11 -6
  117. package/chunks/{chunk-CXONOVBN.js → chunk-KS6F6LZQ.js} +8 -6
  118. package/chunks/chunk-KSEKRQJO.js +253 -0
  119. package/chunks/{chunk-P42KMMU6.js → chunk-KWTLCPYY.js} +19 -6
  120. package/chunks/{chunk-U4AASWUQ.js → chunk-L4GF4IK2.js} +3 -3
  121. package/chunks/{chunk-5FK4MSHB.js → chunk-LADOQIYQ.js} +6 -4
  122. package/chunks/{chunk-DJXSOEFB.js → chunk-LAE6RY3L.js} +1 -1
  123. package/chunks/{chunk-CQPM66MG.js → chunk-LG475XAV.js} +4 -4
  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-M4U2LTD2.js → chunk-MS4SXNJ6.js} +1 -1
  128. package/chunks/{chunk-ZFHKUQZ4.js → chunk-NEVUE35Z.js} +5 -5
  129. package/chunks/{chunk-DRAX5YAI.js → chunk-NFC4WTY2.js} +6 -4
  130. package/chunks/{chunk-SOLRBF7L.js → chunk-NSKNTJHU.js} +10 -10
  131. package/chunks/{chunk-B5TJK7B3.js → chunk-NZRX5WYI.js} +1 -1
  132. package/chunks/{chunk-YM6KUQ2S.js → chunk-O4A2B6V2.js} +3 -3
  133. package/chunks/{chunk-DX6JTDMR.js → chunk-OB57Y2WH.js} +1 -1
  134. package/chunks/{chunk-INN5ORKX.js → chunk-OLFTIODD.js} +1 -1
  135. package/chunks/chunk-PF3RVYRK.js +108 -0
  136. package/chunks/{chunk-WSJI6ODG.js → chunk-PGMF3LSO.js} +29 -27
  137. package/chunks/{chunk-OALXNGUA.js → chunk-PJ3GAHED.js} +10 -10
  138. package/chunks/{chunk-XWJFDJZK.js → chunk-PJSZXERN.js} +1 -1
  139. package/chunks/{chunk-GSAOVDTH.js → chunk-POMFSBEC.js} +4 -4
  140. package/chunks/{chunk-EWNKP4V4.js → chunk-PPVM7YLS.js} +1 -1
  141. package/chunks/{chunk-WK6DEH3Q.js → chunk-PQQV3OBW.js} +6 -4
  142. package/chunks/{chunk-BHVF3R6B.js → chunk-PZT2654P.js} +4 -4
  143. package/chunks/{chunk-ZSTCM3MX.js → chunk-Q5N5NEVT.js} +1 -1
  144. package/chunks/{chunk-KFFCDLKV.js → chunk-QE36VXWP.js} +1 -1
  145. package/chunks/{chunk-V545KI73.js → chunk-QPTE6BKL.js} +1 -1
  146. package/chunks/{chunk-5VQR2DD7.js → chunk-QQPRTJOM.js} +5 -3
  147. package/chunks/{chunk-QIPLWW6Q.js → chunk-QU7T5PKF.js} +1 -1
  148. package/chunks/{chunk-Y2KJC55Y.js → chunk-QYT7J3UM.js} +4 -4
  149. package/chunks/{chunk-SFHX5G2S.js → chunk-R34ALEH5.js} +14 -14
  150. package/chunks/{chunk-TXTCM3TC.js → chunk-R4DAJXOV.js} +18 -14
  151. package/chunks/{chunk-2GP6BQ2J.js → chunk-RA6PKQVM.js} +2 -2
  152. package/chunks/{chunk-HXUI5D4H.js → chunk-RDN5ITXF.js} +1 -1
  153. package/chunks/{chunk-G6UUOCUT.js → chunk-RMI3DKMV.js} +1 -1
  154. package/chunks/chunk-RSFNJ6UU.js +1252 -0
  155. package/chunks/{chunk-EDIDYZBT.js → chunk-RVT5L74D.js} +1 -1
  156. package/chunks/{chunk-GI7SLDOI.js → chunk-RXP5FVC4.js} +6 -6
  157. package/chunks/chunk-S34QJ6IR.js +290 -0
  158. package/chunks/chunk-S5BHLTHK.js +190 -0
  159. package/chunks/{chunk-2XRE4KE4.js → chunk-S7BE3FMA.js} +1 -1
  160. package/chunks/{chunk-7O5PYQ3M.js → chunk-SBP43AO6.js} +1 -1
  161. package/chunks/chunk-SLHYLVRW.js +1377 -0
  162. package/chunks/{chunk-HNFKYKHH.js → chunk-SMAAYU3F.js} +16 -16
  163. package/chunks/{chunk-KAYC5FBN.js → chunk-SNPYTKXI.js} +825 -234
  164. package/chunks/{chunk-IKBEIDOH.js → chunk-SOZJODVX.js} +13 -13
  165. package/chunks/{chunk-Y4NNIGYO.js → chunk-SSFOFDNL.js} +1 -1
  166. package/chunks/{chunk-WNQIJTOP.js → chunk-SSGVTJ2W.js} +243 -17
  167. package/chunks/{chunk-NFXXBWSE.js → chunk-SU64336V.js} +2 -2
  168. package/chunks/chunk-TFDCK56Y.js +154 -0
  169. package/chunks/{chunk-JRHKM3YQ.js → chunk-TS4JJ7NN.js} +2 -2
  170. package/chunks/{chunk-C4HBZQNH.js → chunk-U3MTHCJF.js} +1 -1
  171. package/chunks/{chunk-AUX2FL5T.js → chunk-UBQVV7MX.js} +625 -6
  172. package/chunks/{chunk-B6RMK4ED.js → chunk-UHBYCY7U.js} +9 -7
  173. package/chunks/{chunk-Y53DG2HA.js → chunk-UIWUFHRJ.js} +1 -1
  174. package/chunks/chunk-UQRDQCWF.js +102 -0
  175. package/chunks/{chunk-NKTMUPHJ.js → chunk-UVMU7DDP.js} +5 -3
  176. package/chunks/chunk-UXEI7POA.js +273 -0
  177. package/chunks/chunk-V2XJJTAB.js +228 -0
  178. package/chunks/chunk-VDNCKE2O.js +24 -0
  179. package/chunks/{chunk-YQQ2U7AS.js → chunk-VISF4MEY.js} +1 -1
  180. package/chunks/{chunk-RRI764F7.js → chunk-VPFKSRAB.js} +13 -11
  181. package/chunks/chunk-VPGRGNNH.js +578 -0
  182. package/chunks/{chunk-SYMXYRM5.js → chunk-W7JWIIRC.js} +1 -1
  183. package/chunks/{chunk-AZCTY64Z.js → chunk-WEUQIY3Q.js} +1 -1
  184. package/chunks/{chunk-SSWTA7CH.js → chunk-WIKUMTAB.js} +12 -12
  185. package/chunks/chunk-WL2CTQGT.js +1625 -0
  186. package/chunks/chunk-WL2V7PTE.js +78 -0
  187. package/chunks/{chunk-Q54O3EIA.js → chunk-WSZ6VS24.js} +45 -30
  188. package/chunks/{chunk-UZSB57EV.js → chunk-WX4W3FCV.js} +5 -5
  189. package/chunks/{chunk-OSG23MR3.js → chunk-X3T5IOX6.js} +2 -2
  190. package/chunks/{chunk-EIBECN2J.js → chunk-XGHVF5DC.js} +5 -5
  191. package/chunks/{chunk-D3KVGQUV.js → chunk-XJ52OCCN.js} +4 -4
  192. package/chunks/{chunk-YZXSDPOQ.js → chunk-XMAIUTED.js} +84 -40
  193. package/chunks/{chunk-QGEISOJ2.js → chunk-XQBZZVJA.js} +3 -3
  194. package/chunks/{chunk-OZEV3R3S.js → chunk-XYAB5R6E.js} +3 -3
  195. package/chunks/chunk-XZA32HII.js +19 -0
  196. package/chunks/{chunk-4FLUQWJ4.js → chunk-Y3Q5OK4D.js} +1 -1
  197. package/chunks/chunk-YDERQ7ZV.js +248 -0
  198. package/chunks/{chunk-AKRSSKUT.js → chunk-YFHX6MOF.js} +10 -10
  199. package/chunks/{chunk-ZMYKNKET.js → chunk-YPJZDZMP.js} +3 -3
  200. package/chunks/{chunk-3XBUCOWS.js → chunk-YSD6IY6F.js} +2 -2
  201. package/chunks/{chunk-CH2YDT6X.js → chunk-YVYK3JYU.js} +5 -3
  202. package/chunks/{chunk-YL3UJML3.js → chunk-YWDVNBGE.js} +4 -4
  203. package/chunks/{chunk-C3T6HPNM.js → chunk-ZGADNVME.js} +5 -5
  204. package/chunks/{chunk-M3JGHRMQ.js → chunk-ZJ7KIWG5.js} +1 -1
  205. package/chunks/{chunk-QHSOINX6.js → chunk-ZJBYZN5D.js} +2 -2
  206. package/chunks/{chunk-SYROIHU7.js → chunk-ZRQGTRHA.js} +4 -2
  207. package/chunks/{chunk-NCPFOLM2.js → chunk-ZTBP4SFC.js} +78 -18
  208. package/chunks/{chunk-ZAFYHRVY.js → chunk-ZYDMQCQP.js} +4 -274
  209. package/chunks/clip-audio-SH4L7AEY.js +255 -0
  210. package/chunks/clip-image-BQRPECIS.js +239 -0
  211. package/chunks/clip-video-JIRMV5IH.js +277 -0
  212. package/chunks/{codex-subagent-executor-AEAIQZDC.js → codex-subagent-executor-Y5ILNWG6.js} +92 -68
  213. package/chunks/config-3X4AXU45.js +21 -0
  214. package/chunks/config-T5RO4NJV.js +17 -0
  215. package/chunks/config-utils-3YNEDKT4.js +151 -0
  216. package/chunks/contextCommand-7JVXVYN4.js +144 -0
  217. package/chunks/convert-image-D52K2FFB.js +231 -0
  218. package/chunks/{core-runtime-ZI4RTOJQ.js → core-runtime-6IZNPJUN.js} +92 -67
  219. package/chunks/{create-sub-session-BBWFQARJ.js → create-sub-session-5XHUO2PW.js} +90 -66
  220. package/chunks/{create-sub-session-MSGNIM37.js → create-sub-session-6EDEANCD.js} +7 -5
  221. package/chunks/{cron-create-U2JJ5CCF.js → cron-create-GS7ORRO6.js} +8 -5
  222. package/chunks/{cron-delete-7DM4LJWD.js → cron-delete-3GGDNNXD.js} +8 -5
  223. package/chunks/{cron-list-VCUSZK2Y.js → cron-list-EX27DW4H.js} +8 -5
  224. package/chunks/{daemon-git-worktree-guard-KECEMV6A.js → daemon-git-worktree-guard-BULXRIDA.js} +90 -66
  225. package/chunks/daemon-status-provider-VSVXVY4O.js +155 -0
  226. package/chunks/daemon-trust-policy-WVSDS2WT.js +150 -0
  227. package/chunks/{daemon-trust-policy-monitor-546N5ZVL.js → daemon-trust-policy-monitor-HXQ2GLTX.js} +95 -71
  228. package/chunks/deferred-core-runtime-EXI7LXLE.js +153 -0
  229. package/chunks/{display-image-QTHALY6N.js → display-image-FTWDRBOP.js} +10 -7
  230. package/chunks/{dist-BNW423XT.js → dist-CXDHIHN4.js} +5 -0
  231. package/chunks/downsample-audio-LPDWX6GF.js +217 -0
  232. package/chunks/downsample-image-A5JEYIV5.js +249 -0
  233. package/chunks/downscale-video-4W5BX5KO.js +249 -0
  234. package/chunks/{earlyInputCapture-BXP7V2P3.js → earlyInputCapture-UJ3KFVZQ.js} +3 -2
  235. package/chunks/{edit-CMSQB7NP.js → edit-JJ34NKRC.js} +68 -56
  236. package/chunks/{en-56QLKXS2.js → en-FCK6MBTI.js} +16 -0
  237. package/chunks/{enter-worktree-DA6A4XC5.js → enter-worktree-QK7DR5EF.js} +12 -9
  238. package/chunks/{enterPlanMode-UDPMNESD.js → enterPlanMode-H6FBPVLB.js} +62 -51
  239. package/chunks/environment-7DMLANWW.js +167 -0
  240. package/chunks/errors-OH3DYEDL.js +151 -0
  241. package/chunks/{exec-RPKEY6HP.js → exec-7CFNHYCV.js} +31 -9
  242. package/chunks/{exit-worktree-4H6Z2VQI.js → exit-worktree-62COYIHF.js} +14 -10
  243. package/chunks/exitPlanMode-5YR5VWXS.js +102 -0
  244. package/chunks/extract-audio-GSSZQV6G.js +229 -0
  245. package/chunks/extract-keyframes-Q6DRMQAJ.js +621 -0
  246. package/chunks/{fast-path-F2CYDDZ4.js → fast-path-4DS2GR5O.js} +5 -5
  247. package/chunks/ffmpeg-N4LIIVNR.js +21 -0
  248. package/chunks/{glob-Z2JMJKKN.js → glob-GFID3F3R.js} +63 -51
  249. package/chunks/{goal-tools-HXVVLGCV.js → goal-tools-2OB5WPNH.js} +59 -49
  250. package/chunks/{grep-H2I33VAO.js → grep-JB5DGQ3B.js} +13 -9
  251. package/chunks/handleAutoUpdate-5OQL4YBU.js +147 -0
  252. package/chunks/i18n-TV5G7SXO.js +164 -0
  253. package/chunks/{image-gen-HIAZCB5T.js → image-gen-LX3C4V3R.js} +16 -11
  254. package/chunks/initializer-R2EI4UJ6.js +151 -0
  255. package/chunks/installationInfo-HYOWC3BN.js +145 -0
  256. package/chunks/{keychain-token-storage-NQ5XWIPX.js → keychain-token-storage-ZZNRE6D4.js} +3 -2
  257. package/chunks/list-ORJQQUNR.js +154 -0
  258. package/chunks/{list-agents-EWDCEPIW.js → list-agents-HS6HH4DJ.js} +10 -7
  259. package/chunks/{llm-LSUBOJAR.js → llm-YKBQVN7S.js} +159 -134
  260. package/chunks/{llm-content-generator-MLIONRXE.js → llm-content-generator-QJBXJRKT.js} +11 -9
  261. package/chunks/loadedSettingsAdapter-4FQH6Y3D.js +148 -0
  262. package/chunks/{loggingContentGenerator-TUPEXFMM.js → loggingContentGenerator-DEOANG3F.js} +74 -63
  263. package/chunks/{loop-wakeup-ZBVRI6VH.js → loop-wakeup-4B7OY3TV.js} +9 -6
  264. package/chunks/{ls-6ZB3BEIR.js → ls-EZ5PSWU2.js} +8 -5
  265. package/chunks/{lsp-M54FQARP.js → lsp-DYFFHKB3.js} +6 -3
  266. package/chunks/{managed-npm-update-WEA5XMFZ.js → managed-npm-update-36U25ZEZ.js} +91 -67
  267. package/chunks/mcp-ZI7LXLAQ.js +148 -0
  268. package/chunks/memory-side-query-DRV7FXK4.js +221 -0
  269. package/chunks/model-call-collection-RX7C24YP.js +171 -0
  270. package/chunks/model-configuration-3JIO6IRV.js +161 -0
  271. package/chunks/modelConfigUtils-2BJQI2S4.js +140 -0
  272. package/chunks/{monitor-CI7YE7MT.js → monitor-LXQRI2IF.js} +63 -51
  273. package/chunks/nonInteractiveCli-HRXVUV2H.js +235 -0
  274. package/chunks/nonInteractiveToolExecutor-QPAIKNPL.js +101 -0
  275. package/chunks/{notebook-edit-3WCVRNGL.js → notebook-edit-5CM3VYNK.js} +63 -52
  276. package/chunks/ocr-image-Q4HYJ3U7.js +252 -0
  277. package/chunks/omni-A5XLPNSH.js +147 -0
  278. package/chunks/{openaiContentGenerator-OGILGUZE.js → openaiContentGenerator-O5G3QCHX.js} +36 -31
  279. package/chunks/{openaiResponsesContentGenerator-NXOXUPFM.js → openaiResponsesContentGenerator-W2V7AYVE.js} +12 -10
  280. package/chunks/pidfile-MI5FGYF5.js +151 -0
  281. package/chunks/{processUtils-O4II3RYH.js → processUtils-EWKUPVJH.js} +2 -2
  282. package/chunks/prompt-terminal-ledger-5HEXZMWT.js +143 -0
  283. package/chunks/{qwenContentGenerator-I4LRYADV.js → qwenContentGenerator-HHNDIW2Q.js} +70 -60
  284. package/chunks/{qwenOAuth2-3J66TOT5.js → qwenOAuth2-GD3UIYUP.js} +9 -8
  285. package/chunks/reactive-degrade-KWCJUHXH.js +375 -0
  286. package/chunks/read-file-ZQKBXJSH.js +37 -0
  287. package/chunks/{read-mcp-resource-LPSWXVOD.js → read-mcp-resource-INJIV3UC.js} +8 -4
  288. package/chunks/recall-media-memory-tool-PEE2BWRY.js +198 -0
  289. package/chunks/{record-artifact-L3CFJOMA.js → record-artifact-KKW3AIMJ.js} +6 -4
  290. package/chunks/record-source-2VSQINX6.js +24 -0
  291. package/chunks/{report-findings-LY5HQY4K.js → report-findings-OZSLWYAS.js} +7 -5
  292. package/chunks/{request-shutdown-53SNYGVR.js → request-shutdown-3RUGTWRR.js} +12 -9
  293. package/chunks/resumeHistoryUtils-5V3KISJ6.js +156 -0
  294. package/chunks/ripGrep-F5MM4HGA.js +43 -0
  295. package/chunks/{run-qwen-serve-ZVEKGS7Y.js → run-qwen-serve-3K3D5MSR.js} +70 -70
  296. package/chunks/{runtime-SJCRYNPA.js → runtime-FAWN3GQH.js} +98 -74
  297. package/chunks/sandbox-BPRE7KYF.js +170 -0
  298. package/chunks/sandboxConfig-V3OHETXW.js +138 -0
  299. package/chunks/scheduled-tasks-LB2PINB3.js +167 -0
  300. package/chunks/scheduler-NHAWKARI.js +160 -0
  301. package/chunks/{sdk-exporters-http-DR4G663K.js → sdk-exporters-http-SWXTEEVT.js} +3 -2
  302. package/chunks/{sdk-impl-SJR26MQF.js → sdk-impl-FK4JY6LX.js} +5 -4
  303. package/chunks/{send-message-DN76MXDX.js → send-message-TLF36UW2.js} +16 -13
  304. package/chunks/serve-UQL5X5K7.js +156 -0
  305. package/chunks/{server-UHMKPCAZ.js → server-3HUUEDUC.js} +286 -261
  306. package/chunks/{session-ZLUK7E4P.js → session-XODWSTJ3.js} +151 -127
  307. package/chunks/session-attachments-root-BENUIMZM.js +141 -0
  308. package/chunks/{session-pr-refresh-3OMTQWCZ.js → session-pr-refresh-CSRULMTI.js} +95 -71
  309. package/chunks/{settings-P4DHIIUP.js → settings-42FFX5TK.js} +94 -70
  310. package/chunks/{shell-IMFUVQQ5.js → shell-NLNU2TPF.js} +59 -49
  311. package/chunks/{skill-NB5RJGZW.js → skill-KIRNNJMK.js} +22 -17
  312. package/chunks/skill-settings-MPHPE43F.js +164 -0
  313. package/chunks/spawnChannel-TXNLXP2R.js +152 -0
  314. package/chunks/standalone-update-XAC364AM.js +156 -0
  315. package/chunks/{start-opentui-ui-JKAIWGF7.js → start-opentui-ui-3OLDXRMX.js} +223 -189
  316. package/chunks/{startInteractiveUI-YRPOT6GH.js → startInteractiveUI-UB2HRTV7.js} +339 -295
  317. package/chunks/storage-VZECDJNX.js +17 -0
  318. package/chunks/{syntheticOutput-EX5L5GYI.js → syntheticOutput-SSXJ2NEY.js} +5 -3
  319. package/chunks/task-create-EEMYF6LY.js +30 -0
  320. package/chunks/{task-list-ZLJSMRFA.js → task-list-GA5GOR74.js} +9 -6
  321. package/chunks/{task-stop-MD7P6QGK.js → task-stop-3MXTDL7H.js} +6 -3
  322. package/chunks/{task-update-3LSYQDRW.js → task-update-JSBHKL4L.js} +16 -13
  323. package/chunks/{team-create-2XTBYRJF.js → team-create-VES6TOBA.js} +62 -51
  324. package/chunks/{team-delete-RIDINW6I.js → team-delete-V2CROTI6.js} +9 -6
  325. package/chunks/{team-plan-approval-CFNWW7ZQ.js → team-plan-approval-ZMCHBBUM.js} +61 -50
  326. package/chunks/terminal-image-renderer-73NDY7OJ.js +156 -0
  327. package/chunks/theme-manager-YG3L7BV6.js +140 -0
  328. package/chunks/{todoWrite-XSTG2VT5.js → todoWrite-CMBHPR66.js} +8 -5
  329. package/chunks/tool-result-media-V3LNDB5Q.js +45 -0
  330. package/chunks/{tool-search-ZHTJU2MV.js → tool-search-7XR7RHMB.js} +43 -21
  331. package/chunks/total-session-admission-QUZYGACG.js +151 -0
  332. package/chunks/transcribe-audio-AJQZPNEV.js +30 -0
  333. package/chunks/trustedFolders-QRII2BL7.js +160 -0
  334. package/chunks/understand-video-segments-5TMRDQUB.js +438 -0
  335. package/chunks/{update-relaunch-LI7GRP36.js → update-relaunch-735DXN5P.js} +5 -5
  336. package/chunks/updateCheck-FXXOM4YS.js +156 -0
  337. package/chunks/upload-cache-5YULQVZZ.js +17 -0
  338. package/chunks/upload-config-CKDIXTPK.js +25 -0
  339. package/chunks/useAutoAcceptIndicator-KXXTKOGD.js +158 -0
  340. package/chunks/{validateNonInterActiveAuth-YFPCYYNL.js → validateNonInterActiveAuth-DXCBDHIX.js} +143 -119
  341. package/chunks/{version-4MTL4JVU.js → version-76T4NBMQ.js} +1 -1
  342. package/chunks/{web-fetch-O6RG6ISB.js → web-fetch-UIDZX5RN.js} +27 -20
  343. package/chunks/{web-search-JHAXVEMD.js → web-search-VETWDOUJ.js} +14 -11
  344. package/chunks/{web-shell-static-FFWCUUZS.js → web-shell-static-XSCCMXKQ.js} +3 -3
  345. package/chunks/{workflow-O7L6VDYU.js → workflow-MHYBJHPP.js} +63 -52
  346. package/chunks/workspace-providers-status-WFBT3LS5.js +154 -0
  347. package/chunks/{workspace-registration-store-7G4E7YPY.js → workspace-registration-store-M3WKKBJQ.js} +1 -1
  348. package/chunks/workspace-registry-FIUB7MGD.js +160 -0
  349. package/chunks/workspace-runtime-coordinator-5Z7M36W7.js +163 -0
  350. package/chunks/workspace-service-TP4VRTZF.js +165 -0
  351. package/chunks/workspace-skills-status-CILWVQHU.js +151 -0
  352. package/chunks/{workspace-trust-reconciler-XEBW5FUL.js → workspace-trust-reconciler-2OPSTQNS.js} +98 -74
  353. package/chunks/write-file-N7NBKIYD.js +107 -0
  354. package/chunks/{zh-TW-S3YTQ4DS.js → zh-TW-SRB5QSER.js} +16 -0
  355. package/chunks/{zh-F76MZTL3.js → zh-UBQIFP4A.js} +16 -0
  356. package/chunks/{zoom-image-RDPRTP4B.js → zoom-image-3GHVMYEW.js} +18 -13
  357. package/cli.js +14 -14
  358. package/export-transcript-document.js +3 -3
  359. package/locales/en.js +18 -0
  360. package/locales/zh-TW.js +17 -0
  361. package/locales/zh.js +17 -0
  362. package/package.json +3 -3
  363. package/web-shell/assets/{abnfDiagram-VCTEODGH-RxykUDmi.js → abnfDiagram-VCTEODGH-vfbwxn7H.js} +1 -1
  364. package/web-shell/assets/{arc-CZpgGCJC.js → arc-BT0KMrP5.js} +1 -1
  365. package/web-shell/assets/{architectureDiagram-5GKGNRK7-BHSMzNDT.js → architectureDiagram-5GKGNRK7-B3TlGgP4.js} +1 -1
  366. package/web-shell/assets/{blockDiagram-NRAW4CY4-Bn4mF9SZ.js → blockDiagram-NRAW4CY4-DnwF5xi-.js} +1 -1
  367. package/web-shell/assets/{c4Diagram-UCG6FXSJ-CBM-Bj6t.js → c4Diagram-UCG6FXSJ-8qvMMfFg.js} +1 -1
  368. package/web-shell/assets/channel-CTm0xByY.js +1 -0
  369. package/web-shell/assets/{chunk-2Q5K7J3B-D5Fin58O.js → chunk-2Q5K7J3B-CHM51UX6.js} +1 -1
  370. package/web-shell/assets/{chunk-5VM5RSS4-CY05weF7.js → chunk-5VM5RSS4-BNXaOtyN.js} +1 -1
  371. package/web-shell/assets/{chunk-F27PBJKO-3neZnj5Y.js → chunk-F27PBJKO-DT-vcF3X.js} +1 -1
  372. package/web-shell/assets/{chunk-G27WJ6UU-Cd7EU4BE.js → chunk-G27WJ6UU-BXz8438J.js} +1 -1
  373. package/web-shell/assets/{chunk-JWPE2WC7-DwK1mqFw.js → chunk-JWPE2WC7-CP2ozL3M.js} +1 -1
  374. package/web-shell/assets/{chunk-LCL6LL3I-Sl7vY22C.js → chunk-LCL6LL3I-DTAWXvja.js} +1 -1
  375. package/web-shell/assets/{chunk-POPQ4Y6H-BXNzpbVg.js → chunk-POPQ4Y6H-DZENJpGx.js} +1 -1
  376. package/web-shell/assets/{chunk-SVP7TREG-DjjButcp.js → chunk-SVP7TREG-Dl8djRwv.js} +1 -1
  377. package/web-shell/assets/{chunk-XXDRQBXY-DNOiCjOJ.js → chunk-XXDRQBXY-B3lJllMA.js} +1 -1
  378. package/web-shell/assets/classDiagram-DTDB5LWJ-DhMuMK_E.js +1 -0
  379. package/web-shell/assets/classDiagram-v2-JRS7N3AN-DhMuMK_E.js +1 -0
  380. package/web-shell/assets/{cose-bilkent-JH36ORCC-BUnker7a.js → cose-bilkent-JH36ORCC-DeosJDcB.js} +1 -1
  381. package/web-shell/assets/{cynefin-OW5HDTMX-DcUgdWE5.js → cynefin-OW5HDTMX-BvqcLoHm.js} +1 -1
  382. package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-CvDKsZsL.js → cynefinDiagram-5FMLGOSQ-BYS0pmSs.js} +1 -1
  383. package/web-shell/assets/{dagre-3AP2YEHR-jpCmUbr1.js → dagre-3AP2YEHR-IDScuL-R.js} +1 -1
  384. package/web-shell/assets/{diagram-S7CK7UJ4-DBe_bKE5.js → diagram-S7CK7UJ4-EYNlkkKJ.js} +1 -1
  385. package/web-shell/assets/{diagram-UQ7AKVKN-oXvPpDgs.js → diagram-UQ7AKVKN-D3x9g8Ep.js} +1 -1
  386. package/web-shell/assets/{diagram-VSXAHHWV-BD7-_SGh.js → diagram-VSXAHHWV-C35O1dtR.js} +1 -1
  387. package/web-shell/assets/{diagram-VX7I27RA-DOJL0wub.js → diagram-VX7I27RA-XvMv2aCN.js} +1 -1
  388. package/web-shell/assets/{diagram-Z3DM3KII-DRIiodDD.js → diagram-Z3DM3KII-CeryNvru.js} +1 -1
  389. package/web-shell/assets/{ebnfDiagram-PWID7BFC-Db31Ulmb.js → ebnfDiagram-PWID7BFC-DAmepjvB.js} +1 -1
  390. package/web-shell/assets/{erDiagram-SSCWMZ5O-CVHhwI2_.js → erDiagram-SSCWMZ5O-BkGfBZt_.js} +1 -1
  391. package/web-shell/assets/{flowDiagram-A5DVABFB-DWOFy1FK.js → flowDiagram-A5DVABFB-CzUCgun9.js} +1 -1
  392. package/web-shell/assets/{ganttDiagram-EL5Y4UJY-C0sxQtPd.js → ganttDiagram-EL5Y4UJY-BIFST90r.js} +1 -1
  393. package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-CNituBYC.js → gitGraphDiagram-WWUBYQGX-jVvRSGcu.js} +1 -1
  394. package/web-shell/assets/{index-B15NlwB8.js → index-M1TfOjx2.js} +457 -457
  395. package/web-shell/assets/{index-gm9tLk7h.js → index-krCDFzE6.js} +1 -1
  396. package/web-shell/assets/{infoDiagram-RXCK75RN-CxhJYtIR.js → infoDiagram-RXCK75RN-DsU7vA4Q.js} +1 -1
  397. package/web-shell/assets/{ishikawaDiagram-5VMMS53U-By2mchUy.js → ishikawaDiagram-5VMMS53U-K9mTNAbN.js} +1 -1
  398. package/web-shell/assets/{journeyDiagram-EYS64GPL-CVH-OweI.js → journeyDiagram-EYS64GPL-BKuHLGxv.js} +1 -1
  399. package/web-shell/assets/{kanban-definition-3QL26DDD-Cc9dQXLy.js → kanban-definition-3QL26DDD-CXG9frQ_.js} +1 -1
  400. package/web-shell/assets/{layout-C_60ysHw.js → layout-6G_l7UoH.js} +1 -1
  401. package/web-shell/assets/{linear-BvAVfqwu.js → linear-DYpvB2mh.js} +1 -1
  402. package/web-shell/assets/{mermaid.core-C3CoBKAc.js → mermaid.core-Sj3dJttQ.js} +6 -6
  403. package/web-shell/assets/{mindmap-definition-FBJOCRG2-Cuu8Q8LM.js → mindmap-definition-FBJOCRG2-DNJ1e6qd.js} +1 -1
  404. package/web-shell/assets/{pegDiagram-XKGWAZYB-DmAeyDO2.js → pegDiagram-XKGWAZYB-D-KPklHv.js} +1 -1
  405. package/web-shell/assets/{pieDiagram-E7YTZNPT-B7vbB_xv.js → pieDiagram-E7YTZNPT-BQPm03g2.js} +1 -1
  406. package/web-shell/assets/{quadrantDiagram-AXDQQJYC-BqOBkRR7.js → quadrantDiagram-AXDQQJYC-BubBXSqD.js} +1 -1
  407. package/web-shell/assets/{railroadDiagram-O6MQD6OU-sI06lZIu.js → railroadDiagram-O6MQD6OU-DatD6KIT.js} +1 -1
  408. package/web-shell/assets/{requirementDiagram-EFPCY7ZU-Bg13d10S.js → requirementDiagram-EFPCY7ZU-DiQ6jsZY.js} +1 -1
  409. package/web-shell/assets/{sankeyDiagram-P5KCCOFB-WFOzZHrR.js → sankeyDiagram-P5KCCOFB-C07fyxbH.js} +1 -1
  410. package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-CCdRbA4E.js → sequenceDiagram-WJ2MYXX4-DWXtsWzI.js} +1 -1
  411. package/web-shell/assets/{sizeCapture-X5ZJPWSS-BH5F3bGg.js → sizeCapture-X5ZJPWSS-B0cQ1v0l.js} +1 -1
  412. package/web-shell/assets/{stateDiagram-HBIQ2CUA-NwS2X3QB.js → stateDiagram-HBIQ2CUA-zHgWc00n.js} +1 -1
  413. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-C-3ZC2nf.js +1 -0
  414. package/web-shell/assets/{swimlanes-XN3QIQJK-Bm38pM28.js → swimlanes-XN3QIQJK-Dnrrhu0H.js} +1 -1
  415. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Ded1L5cw.js +8 -0
  416. package/web-shell/assets/{timeline-definition-24CTP7MA-Do-agLSo.js → timeline-definition-24CTP7MA-8BV7W2Xq.js} +1 -1
  417. package/web-shell/assets/{vennDiagram-4TSXK5OY-aggLfZzl.js → vennDiagram-4TSXK5OY-tmBBtlnj.js} +1 -1
  418. package/web-shell/assets/{wardleyDiagram-VM6X3IG4-D5JR3mXX.js → wardleyDiagram-VM6X3IG4-Cq96T3gb.js} +1 -1
  419. package/web-shell/assets/{xychartDiagram-S5SC5T6Z-DhtLDuXs.js → xychartDiagram-S5SC5T6Z-Dpzx_ZGQ.js} +1 -1
  420. package/web-shell/index.html +1 -1
  421. package/chunks/MaxSizedBox-FCF6M53W.js +0 -124
  422. package/chunks/acp-subagent-executor-TND6W2O5.js +0 -140
  423. package/chunks/agent-headless-EJ4QOUSM.js +0 -94
  424. package/chunks/bridge-MUX5YJZT.js +0 -132
  425. package/chunks/channel-settings-store-7CBIRZER.js +0 -134
  426. package/chunks/config-utils-KX2YS725.js +0 -127
  427. package/chunks/contextCommand-RV6Y5LNJ.js +0 -120
  428. package/chunks/daemon-status-provider-NULJNAEV.js +0 -131
  429. package/chunks/daemon-trust-policy-S4KWGPV3.js +0 -126
  430. package/chunks/deferred-core-runtime-T23ZT443.js +0 -128
  431. package/chunks/environment-TSQJUTPV.js +0 -143
  432. package/chunks/errors-RIVYJS6T.js +0 -127
  433. package/chunks/exitPlanMode-BYBBFN2T.js +0 -92
  434. package/chunks/handleAutoUpdate-FZP45KOR.js +0 -123
  435. package/chunks/i18n-OTB62AKW.js +0 -140
  436. package/chunks/initializer-4JXZEC4B.js +0 -127
  437. package/chunks/installationInfo-2IJV5QKC.js +0 -121
  438. package/chunks/list-KQSQ4A5G.js +0 -130
  439. package/chunks/loadedSettingsAdapter-TZTTNRHI.js +0 -124
  440. package/chunks/mcp-TFDTUPIA.js +0 -124
  441. package/chunks/model-configuration-ZCAKKIOF.js +0 -137
  442. package/chunks/modelConfigUtils-J3ZPW7ZK.js +0 -116
  443. package/chunks/nonInteractiveCli-GPT3TVOK.js +0 -211
  444. package/chunks/pidfile-GBTBIGHF.js +0 -127
  445. package/chunks/prompt-terminal-ledger-ILIXZI3E.js +0 -119
  446. package/chunks/read-file-G4XKW2CS.js +0 -31
  447. package/chunks/record-source-2GSY5JD5.js +0 -22
  448. package/chunks/resumeHistoryUtils-YPJU4XFE.js +0 -132
  449. package/chunks/ripGrep-AAKMALLM.js +0 -39
  450. package/chunks/sandbox-UIXL423Z.js +0 -146
  451. package/chunks/sandboxConfig-CY343YNJ.js +0 -114
  452. package/chunks/scheduled-tasks-5UGBEVNZ.js +0 -143
  453. package/chunks/scheduler-GCZYLZ2P.js +0 -136
  454. package/chunks/serve-2XXQLVK2.js +0 -132
  455. package/chunks/session-attachments-root-DHQM5IEZ.js +0 -117
  456. package/chunks/skill-settings-IXG5CTQO.js +0 -140
  457. package/chunks/spawnChannel-Q3YALTCJ.js +0 -128
  458. package/chunks/standalone-update-H5OJ7MM7.js +0 -132
  459. package/chunks/task-create-75HVPEAH.js +0 -28
  460. package/chunks/terminal-image-renderer-UDPJPGPQ.js +0 -132
  461. package/chunks/theme-manager-SK57EKMO.js +0 -116
  462. package/chunks/total-session-admission-UUZBDQCG.js +0 -127
  463. package/chunks/trustedFolders-4LDBLNTS.js +0 -136
  464. package/chunks/updateCheck-PKSSORPO.js +0 -132
  465. package/chunks/useAutoAcceptIndicator-I32UEQPI.js +0 -134
  466. package/chunks/workspace-providers-status-WRX6CJM4.js +0 -130
  467. package/chunks/workspace-registry-SXIMGT4D.js +0 -136
  468. package/chunks/workspace-runtime-coordinator-7DOEHXYT.js +0 -139
  469. package/chunks/workspace-service-HDXOZMYC.js +0 -141
  470. package/chunks/workspace-skills-status-VN4L37CA.js +0 -127
  471. package/chunks/write-file-LKX4ETIO.js +0 -97
  472. package/web-shell/assets/channel-DFYs_LlK.js +0 -1
  473. package/web-shell/assets/classDiagram-DTDB5LWJ-DnGrKXoM.js +0 -1
  474. package/web-shell/assets/classDiagram-v2-JRS7N3AN-DnGrKXoM.js +0 -1
  475. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-1aU2JZXO.js +0 -1
  476. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Dp-u6kQG.js +0 -8
  477. package/chunks/{chunk-XAJZFGD2.js → chunk-PXXYQOZO.js} +8 -8
  478. package/chunks/{chunk-WVURIAEE.js → chunk-SVWWF5TZ.js} +3 -3
  479. package/chunks/{dist-G5UMXIGF.js → dist-I6D6XOWV.js} +1 -1
  480. package/chunks/{dist-UXVNLQHG.js → dist-VIKOMAGG.js} +3 -3
@@ -0,0 +1,1330 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import {
4
+ resolvePolicyToolSettings
5
+ } from "./chunk-UXEI7POA.js";
6
+ import {
7
+ MEDIA_MEMORY_FILE_NAME
8
+ } from "./chunk-SLHYLVRW.js";
9
+ import {
10
+ DEFAULT_OMNI_PROCESSING_LIMITS,
11
+ conditionUsesNamespace,
12
+ evaluateFixedPolicyCondition
13
+ } from "./chunk-RSFNJ6UU.js";
14
+ import {
15
+ OmniJsonCacheFile
16
+ } from "./chunk-TFDCK56Y.js";
17
+ import {
18
+ OBJECT_EXTENSION_RE
19
+ } from "./chunk-FTKXJMQV.js";
20
+ import {
21
+ extensionForMime,
22
+ hashFileSha256,
23
+ recognizeMediaFile
24
+ } from "./chunk-S5BHLTHK.js";
25
+ import {
26
+ createDebugLogger
27
+ } from "./chunk-ZYDMQCQP.js";
28
+ import {
29
+ init_esbuild_shims
30
+ } from "./chunk-5O2XNYP6.js";
31
+ import {
32
+ __name
33
+ } from "./chunk-J2S4EL5Y.js";
34
+
35
+ // packages/core/src/omni/estimation.ts
36
+ init_esbuild_shims();
37
+ var AUDIO_TOKENS_PER_SECOND = 7;
38
+ var VISUAL_PIXELS_PER_TOKEN = 32 * 32 * 2;
39
+ function usable(value) {
40
+ return value !== void 0 && Number.isFinite(value) && value > 0;
41
+ }
42
+ __name(usable, "usable");
43
+ function estimateRawResourceTokens(media) {
44
+ const unavailable = {
45
+ estimatedTokenCount: 0,
46
+ method: "raw-resource-v1",
47
+ status: "unavailable"
48
+ };
49
+ switch (media.modality) {
50
+ case "audio": {
51
+ const durationMs = media.metadata.durationMs;
52
+ if (!usable(durationMs)) return unavailable;
53
+ return {
54
+ estimatedTokenCount: Math.ceil(
55
+ durationMs / 1e3 * AUDIO_TOKENS_PER_SECOND
56
+ ),
57
+ method: "raw-resource-v1",
58
+ status: "ok"
59
+ };
60
+ }
61
+ case "image": {
62
+ const { width, height, frameCount } = media.metadata;
63
+ if (!usable(width) || !usable(height)) return unavailable;
64
+ const frames = usable(frameCount) ? frameCount : 1;
65
+ return {
66
+ estimatedTokenCount: Math.ceil(
67
+ width * height * frames / VISUAL_PIXELS_PER_TOKEN
68
+ ),
69
+ method: "raw-resource-v1",
70
+ status: "ok"
71
+ };
72
+ }
73
+ case "video": {
74
+ const { width, height, durationMs, frameRate } = media.metadata;
75
+ if (!usable(width) || !usable(height) || !usable(durationMs) || !usable(frameRate)) {
76
+ return unavailable;
77
+ }
78
+ const frameCount = Math.ceil(durationMs / 1e3 * frameRate);
79
+ return {
80
+ estimatedTokenCount: Math.ceil(
81
+ width * height * frameCount / VISUAL_PIXELS_PER_TOKEN
82
+ ),
83
+ method: "raw-resource-v1",
84
+ status: "ok"
85
+ };
86
+ }
87
+ default:
88
+ return unavailable;
89
+ }
90
+ }
91
+ __name(estimateRawResourceTokens, "estimateRawResourceTokens");
92
+
93
+ // packages/core/src/omni/policy/degradation-cache.ts
94
+ init_esbuild_shims();
95
+ import { createHash } from "node:crypto";
96
+ import path from "node:path";
97
+ var MAX_CACHED_DISCLOSURE_LENGTH = 2048;
98
+ var FINGERPRINT_EXCLUDED_KEYS = /* @__PURE__ */ new Set([
99
+ "inputPath",
100
+ "outputDir",
101
+ "resourceId"
102
+ ]);
103
+ function stableStringify(value) {
104
+ if (Array.isArray(value)) {
105
+ return `[${value.map(stableStringify).join(",")}]`;
106
+ }
107
+ if (typeof value === "object" && value !== null) {
108
+ const record = value;
109
+ const body = Object.keys(record).sort().map((k) => `${JSON.stringify(k)}:${stableStringify(record[k])}`).join(",");
110
+ return `{${body}}`;
111
+ }
112
+ return JSON.stringify(value) ?? "null";
113
+ }
114
+ __name(stableStringify, "stableStringify");
115
+ function computePolicyFingerprint(toolName, args, toolVersion = "1") {
116
+ const tunables = {};
117
+ for (const [k, v] of Object.entries(args)) {
118
+ if (!FINGERPRINT_EXCLUDED_KEYS.has(k) && v !== void 0) {
119
+ tunables[k] = v;
120
+ }
121
+ }
122
+ return createHash("sha256").update(`${toolName}
123
+ ${stableStringify(tunables)}
124
+ ${toolVersion}`).digest("hex");
125
+ }
126
+ __name(computePolicyFingerprint, "computePolicyFingerprint");
127
+ var OmniDegradationCache = class {
128
+ static {
129
+ __name(this, "OmniDegradationCache");
130
+ }
131
+ file;
132
+ constructor(omniRootDir) {
133
+ this.file = new OmniJsonCacheFile(
134
+ path.join(omniRootDir, "policy-cache.json"),
135
+ "omni:policy-cache"
136
+ );
137
+ }
138
+ key(originalSha256, policyFingerprint) {
139
+ return `${originalSha256}|${policyFingerprint}`;
140
+ }
141
+ async get(originalSha256, policyFingerprint) {
142
+ return this.file.access(null, (entries) => {
143
+ const key = this.key(originalSha256, policyFingerprint);
144
+ const entry = entries[key];
145
+ if (!entry) return { result: null };
146
+ if (!/^[0-9a-f]{64}$/.test(entry.degradedSha256) || typeof entry.extension !== "string" || !OBJECT_EXTENSION_RE.test(entry.extension) || typeof entry.disclosure !== "string" || entry.disclosure.length === 0 || entry.disclosure.length > MAX_CACHED_DISCLOSURE_LENGTH || typeof entry.mimeType !== "string" || entry.mimeType.length === 0 || entry.role !== void 0 && (typeof entry.role !== "string" || entry.role.length === 0)) {
147
+ delete entries[key];
148
+ return { result: null, changed: true };
149
+ }
150
+ return { result: entry };
151
+ });
152
+ }
153
+ async put(originalSha256, policyFingerprint, entry) {
154
+ return this.file.access(void 0, (entries) => {
155
+ entries[this.key(originalSha256, policyFingerprint)] = {
156
+ ...entry,
157
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
158
+ };
159
+ return { result: void 0, changed: true };
160
+ });
161
+ }
162
+ /** Drop every policy result derived FROM the object (source object
163
+ * gone/corrupt — GC cascade). */
164
+ async removeByOriginalSha256(originalSha256) {
165
+ return this.file.access(void 0, (entries) => {
166
+ const prefix = `${originalSha256}|`;
167
+ let changed = false;
168
+ for (const k of Object.keys(entries)) {
169
+ if (k.startsWith(prefix)) {
170
+ delete entries[k];
171
+ changed = true;
172
+ }
173
+ }
174
+ return { result: void 0, changed };
175
+ });
176
+ }
177
+ /** Drop every entry POINTING AT the derived object (derivative
178
+ * gone/corrupt — the next run must re-transcode, not chase a missing
179
+ * object). */
180
+ async removeByDegradedSha256(degradedSha256) {
181
+ return this.file.access(void 0, (entries) => {
182
+ let changed = false;
183
+ for (const [k, v] of Object.entries(entries)) {
184
+ if (v.degradedSha256 === degradedSha256) {
185
+ delete entries[k];
186
+ changed = true;
187
+ }
188
+ }
189
+ return { result: void 0, changed };
190
+ });
191
+ }
192
+ };
193
+
194
+ // packages/core/src/omni/guard.ts
195
+ init_esbuild_shims();
196
+ var DEFAULT_OMNI_MAX_UPLOAD_FILE_BYTES = 1024 * 1024 * 1024;
197
+ var OmniTransportGuardError = class extends Error {
198
+ static {
199
+ __name(this, "OmniTransportGuardError");
200
+ }
201
+ /**
202
+ * Session handle for the SOURCE, when delivery had already bound one
203
+ * before the guard's verdict (memory design M §5.2). A rejection is the
204
+ * case where recall matters most — the model never sees the media, so
205
+ * this handle is its only remaining route to the content — and every
206
+ * throw site sits downstream of the bind, so dropping it would strand
207
+ * the resource for the rest of the session.
208
+ */
209
+ sessionResourceId;
210
+ constructor(message, options) {
211
+ super(message, options);
212
+ this.name = "OmniTransportGuardError";
213
+ }
214
+ };
215
+ function effectiveMaxUploadFileBytes(config) {
216
+ const configured = config.getOmniMaxUploadFileBytes?.();
217
+ return configured !== void 0 && configured > 0 ? configured : DEFAULT_OMNI_MAX_UPLOAD_FILE_BYTES;
218
+ }
219
+ __name(effectiveMaxUploadFileBytes, "effectiveMaxUploadFileBytes");
220
+ function assertWithinByteLimit(config, sizeBytes, displayName) {
221
+ const maxBytes = effectiveMaxUploadFileBytes(config);
222
+ if (sizeBytes > maxBytes) {
223
+ throw new OmniTransportGuardError(
224
+ `${displayName} exceeds the omni upload limit: ${sizeBytes} bytes > ${maxBytes} bytes (omni.processing.transportGuard.maxUploadFileBytes). Reduce the file size before retrying.`
225
+ );
226
+ }
227
+ }
228
+ __name(assertWithinByteLimit, "assertWithinByteLimit");
229
+ function assertWithinDurationLimit(config, media, displayName) {
230
+ const maxSeconds = config.getOmniMaxDurationSeconds?.();
231
+ if (maxSeconds === void 0 || maxSeconds <= 0) return;
232
+ const durationMs = media.metadata.durationMs;
233
+ if (durationMs === void 0 || !Number.isFinite(durationMs)) return;
234
+ const seconds = durationMs / 1e3;
235
+ if (seconds > maxSeconds) {
236
+ throw new OmniTransportGuardError(
237
+ `${displayName} exceeds the omni duration limit: ${Math.round(seconds)}s > ${maxSeconds}s (omni.processing.transportGuard.maxDurationSeconds). Clip a shorter span \u2014 downscaling cannot bring a long file within a duration limit.`
238
+ );
239
+ }
240
+ }
241
+ __name(assertWithinDurationLimit, "assertWithinDurationLimit");
242
+ function assertWithinTokenLimit(config, media, displayName) {
243
+ const estimate = estimateRawResourceTokens(media);
244
+ const maxTokens = config.getOmniMaxEstimatedTokens?.();
245
+ if (maxTokens === void 0 || maxTokens <= 0) return estimate;
246
+ if (estimate.status !== "ok") return estimate;
247
+ if (estimate.estimatedTokenCount > maxTokens) {
248
+ throw new OmniTransportGuardError(
249
+ `${displayName} exceeds the omni estimated-token limit: ~${estimate.estimatedTokenCount} tokens (${estimate.method}) > ${maxTokens} (omni.processing.transportGuard.maxEstimatedTokens). Reduce duration/resolution or raise the limit.`
250
+ );
251
+ }
252
+ return estimate;
253
+ }
254
+ __name(assertWithinTokenLimit, "assertWithinTokenLimit");
255
+
256
+ // packages/core/src/omni/gc.ts
257
+ init_esbuild_shims();
258
+ import fs from "node:fs/promises";
259
+ import path2 from "node:path";
260
+ var debugLogger = createDebugLogger("omni:gc");
261
+ var OBJECT_NAME_RE = /^([0-9a-f]{64})\.[A-Za-z0-9][A-Za-z0-9.]*$/;
262
+ var SKIPPED = {
263
+ ran: false,
264
+ deletedObjects: 0,
265
+ deletedBytes: 0,
266
+ remainingBytes: 0,
267
+ derivationsSuspended: false
268
+ };
269
+ var gcOnce = /* @__PURE__ */ new Map();
270
+ var suspendedRoots = /* @__PURE__ */ new Set();
271
+ function effectiveOmniStorageMaxTotalBytes(config) {
272
+ const configured = config.getOmniStorageMaxTotalBytes();
273
+ const floor = 10 * effectiveMaxUploadFileBytes(config);
274
+ if (configured < floor) {
275
+ debugLogger.warn(
276
+ `omni.storage.maxTotalBytes (${configured}) is below 10\xD7 the transport guard's single-media limit; using ${floor} bytes instead (the budget must hold at least ten normal uploads).`
277
+ );
278
+ return floor;
279
+ }
280
+ return configured;
281
+ }
282
+ __name(effectiveOmniStorageMaxTotalBytes, "effectiveOmniStorageMaxTotalBytes");
283
+ function isOmniDerivationSuspended(omniRootDir) {
284
+ return suspendedRoots.has(path2.resolve(omniRootDir));
285
+ }
286
+ __name(isOmniDerivationSuspended, "isOmniDerivationSuspended");
287
+ async function settleOmniGc(omniRootDir) {
288
+ const existing = gcOnce.get(path2.resolve(omniRootDir));
289
+ if (existing) await existing;
290
+ }
291
+ __name(settleOmniGc, "settleOmniGc");
292
+ async function isRealDirectory(p) {
293
+ try {
294
+ return (await fs.lstat(p)).isDirectory();
295
+ } catch {
296
+ return false;
297
+ }
298
+ }
299
+ __name(isRealDirectory, "isRealDirectory");
300
+ async function listObjects(objectsDir) {
301
+ const out = [];
302
+ if (!await isRealDirectory(objectsDir)) return out;
303
+ let shards;
304
+ try {
305
+ shards = await fs.readdir(objectsDir);
306
+ } catch {
307
+ return out;
308
+ }
309
+ for (const shard of shards) {
310
+ const shardDir = path2.join(objectsDir, shard);
311
+ if (!await isRealDirectory(shardDir)) continue;
312
+ let names;
313
+ try {
314
+ names = await fs.readdir(shardDir);
315
+ } catch {
316
+ continue;
317
+ }
318
+ for (const name of names) {
319
+ const match = OBJECT_NAME_RE.exec(name);
320
+ if (!match) continue;
321
+ const filePath = path2.join(shardDir, name);
322
+ try {
323
+ const st = await fs.lstat(filePath);
324
+ if (!st.isFile()) continue;
325
+ out.push({
326
+ sha256: match[1],
327
+ filePath,
328
+ mtimeMs: st.mtimeMs,
329
+ sizeBytes: st.size
330
+ });
331
+ } catch {
332
+ }
333
+ }
334
+ }
335
+ return out;
336
+ }
337
+ __name(listObjects, "listObjects");
338
+ async function deleteObject(object, options) {
339
+ try {
340
+ await fs.rm(object.filePath, { force: true });
341
+ } catch (err) {
342
+ debugLogger.debug(
343
+ `gc: failed to delete ${object.sha256}: ${err instanceof Error ? err.message : err}`
344
+ );
345
+ return false;
346
+ }
347
+ try {
348
+ await options.uploadCache?.removeBySha256(object.sha256);
349
+ } catch {
350
+ }
351
+ try {
352
+ await options.degradationCache?.removeByOriginalSha256(object.sha256);
353
+ await options.degradationCache?.removeByDegradedSha256(object.sha256);
354
+ } catch {
355
+ }
356
+ debugLogger.debug(
357
+ `gc: deleted unreferenced object ${object.sha256} (${object.sizeBytes} bytes)`
358
+ );
359
+ return true;
360
+ }
361
+ __name(deleteObject, "deleteObject");
362
+ function runOmniGcOnce(options) {
363
+ const rootKey = path2.resolve(options.store.getOmniRootDir());
364
+ const existing = gcOnce.get(rootKey);
365
+ if (existing) return existing;
366
+ const run = sweep(options, rootKey).catch((err) => {
367
+ debugLogger.debug(
368
+ `gc: run failed, skipped: ${err instanceof Error ? err.message : err}`
369
+ );
370
+ return SKIPPED;
371
+ });
372
+ gcOnce.set(rootKey, run);
373
+ return run;
374
+ }
375
+ __name(runOmniGcOnce, "runOmniGcOnce");
376
+ async function recentlyRecoveredFromCorruption(omniRootDir, retentionDays, nowMs) {
377
+ const prefix = `${MEDIA_MEMORY_FILE_NAME}.corrupt-`;
378
+ let names;
379
+ try {
380
+ names = await fs.readdir(omniRootDir);
381
+ } catch {
382
+ return false;
383
+ }
384
+ const cutoff = nowMs - retentionDays * 24 * 36e5;
385
+ for (const name of names) {
386
+ if (!name.startsWith(prefix)) continue;
387
+ const stamp = Number(name.slice(prefix.length));
388
+ if (Number.isFinite(stamp) && stamp >= cutoff) return true;
389
+ try {
390
+ const st = await fs.lstat(path2.join(omniRootDir, name));
391
+ if (st.mtimeMs >= cutoff) return true;
392
+ } catch {
393
+ return true;
394
+ }
395
+ }
396
+ return false;
397
+ }
398
+ __name(recentlyRecoveredFromCorruption, "recentlyRecoveredFromCorruption");
399
+ async function sweep(options, rootKey) {
400
+ const nowMsForGuard = options.nowMs ?? Date.now();
401
+ const refs = await options.memoryService.collectManagedRefs();
402
+ if (refs === null) {
403
+ debugLogger.debug("gc: memory snapshot unreadable, skipping run");
404
+ return SKIPPED;
405
+ }
406
+ if (await recentlyRecoveredFromCorruption(
407
+ options.store.getOmniRootDir(),
408
+ options.retentionDays,
409
+ nowMsForGuard
410
+ )) {
411
+ debugLogger.debug(
412
+ "gc: memory ledger recently recovered from corruption, skipping run"
413
+ );
414
+ return SKIPPED;
415
+ }
416
+ const objectsDir = options.store.getObjectsDir();
417
+ for (const fileRef of options.registry?.activeFileRefs() ?? []) {
418
+ const name = path2.basename(fileRef);
419
+ const match = OBJECT_NAME_RE.exec(name);
420
+ if (match && fileRef.startsWith(objectsDir)) refs.add(match[1]);
421
+ }
422
+ const nowMs = options.nowMs ?? Date.now();
423
+ const cutoffMs = nowMs - options.retentionDays * 24 * 36e5;
424
+ const objects = await listObjects(objectsDir);
425
+ let deletedObjects = 0;
426
+ let deletedBytes = 0;
427
+ const survivors = [];
428
+ const touchedSinceListing = /* @__PURE__ */ __name(async (object, freshCutoffMs) => {
429
+ try {
430
+ return (await fs.lstat(object.filePath)).mtimeMs >= freshCutoffMs;
431
+ } catch {
432
+ return true;
433
+ }
434
+ }, "touchedSinceListing");
435
+ for (const object of objects) {
436
+ if (refs.has(object.sha256) || object.mtimeMs >= cutoffMs) {
437
+ survivors.push(object);
438
+ continue;
439
+ }
440
+ if (await touchedSinceListing(object, cutoffMs)) {
441
+ survivors.push(object);
442
+ continue;
443
+ }
444
+ if (await deleteObject(object, options)) {
445
+ deletedObjects += 1;
446
+ deletedBytes += object.sizeBytes;
447
+ } else {
448
+ survivors.push(object);
449
+ }
450
+ }
451
+ let remainingBytes = survivors.reduce((sum, o) => sum + o.sizeBytes, 0);
452
+ if (remainingBytes > options.maxTotalBytes) {
453
+ const freshRefs = await options.memoryService.collectManagedRefs();
454
+ if (freshRefs === null) {
455
+ debugLogger.debug(
456
+ "gc: ledger unreadable at budget pass, skipping budget deletions"
457
+ );
458
+ } else {
459
+ const unreferenced = survivors.filter((o) => !refs.has(o.sha256) && !freshRefs.has(o.sha256)).sort((a, b) => a.mtimeMs - b.mtimeMs);
460
+ for (const object of unreferenced) {
461
+ if (remainingBytes <= options.maxTotalBytes) break;
462
+ if (await touchedSinceListing(object, nowMs)) continue;
463
+ if (await deleteObject(object, options)) {
464
+ deletedObjects += 1;
465
+ deletedBytes += object.sizeBytes;
466
+ remainingBytes -= object.sizeBytes;
467
+ }
468
+ }
469
+ }
470
+ }
471
+ const derivationsSuspended = remainingBytes > options.maxTotalBytes;
472
+ if (derivationsSuspended) {
473
+ suspendedRoots.add(rootKey);
474
+ debugLogger.warn(
475
+ `omni object store over budget with only referenced objects left (${remainingBytes} > ${options.maxTotalBytes} bytes); new policy derivations are suspended for this session. Raise omni.storage.maxTotalBytes or delete memory records you no longer need \u2014 either change takes effect at the next session start (the GC runs once per process).`
476
+ );
477
+ } else {
478
+ suspendedRoots.delete(rootKey);
479
+ }
480
+ if (deletedObjects > 0) {
481
+ debugLogger.debug(
482
+ `gc: removed ${deletedObjects} object(s) / ${deletedBytes} bytes; ${remainingBytes} bytes remain`
483
+ );
484
+ }
485
+ return {
486
+ ran: true,
487
+ deletedObjects,
488
+ deletedBytes,
489
+ remainingBytes,
490
+ derivationsSuspended
491
+ };
492
+ }
493
+ __name(sweep, "sweep");
494
+
495
+ // packages/core/src/omni/policy/orchestrator.ts
496
+ init_esbuild_shims();
497
+ import { createHash as createHash2, randomBytes } from "node:crypto";
498
+ import fs2 from "node:fs/promises";
499
+ import path3 from "node:path";
500
+ var debugLogger2 = createDebugLogger("omni:policy");
501
+ var MAX_FILE_ARTIFACT_BYTES = 256 * 1024;
502
+ var OmniPolicyExecutionError = class extends Error {
503
+ constructor(message, policyId, options) {
504
+ super(message, options);
505
+ this.policyId = policyId;
506
+ this.name = "OmniPolicyExecutionError";
507
+ }
508
+ static {
509
+ __name(this, "OmniPolicyExecutionError");
510
+ }
511
+ };
512
+ function resolveArtifactSelector(artifacts, kind, role) {
513
+ if (role !== void 0) {
514
+ const byRole = artifacts[`role:${role}`];
515
+ if (byRole) return byRole;
516
+ }
517
+ const byKind = artifacts[`kind:${kind}`];
518
+ if (byKind) return byKind;
519
+ return artifacts["*"] ?? "retain";
520
+ }
521
+ __name(resolveArtifactSelector, "resolveArtifactSelector");
522
+ function resourceConditionContext(recognized, shared) {
523
+ const resource = {};
524
+ const set = /* @__PURE__ */ __name((field, value) => {
525
+ if (typeof value === "number" && !Number.isNaN(value)) {
526
+ resource[field] = value;
527
+ }
528
+ }, "set");
529
+ const m = recognized.metadata;
530
+ set("sizeBytes", recognized.sizeBytes);
531
+ set("durationMs", m.durationMs);
532
+ set("width", m.width);
533
+ set("height", m.height);
534
+ set("maxWidth", m.width);
535
+ set("maxHeight", m.height);
536
+ set("frameRate", m.frameRate);
537
+ set("frameCount", m.frameCount);
538
+ set("bitRate", m.bitRate);
539
+ set("sampleRateHz", m.sampleRateHz);
540
+ set("channels", m.channels);
541
+ const estimate = estimateRawResourceTokens(recognized);
542
+ if (estimate.status === "ok") {
543
+ set("estimatedTokenCount", estimate.estimatedTokenCount);
544
+ }
545
+ return { resource, ...shared };
546
+ }
547
+ __name(resourceConditionContext, "resourceConditionContext");
548
+ var MEMORY_ROLE_FIELDS = {
549
+ transcript: "hasTranscript",
550
+ ocr: "hasOcr",
551
+ caption: "hasCaption",
552
+ summary: "hasSummary",
553
+ keyframe: "hasKeyframes",
554
+ clip: "hasClip"
555
+ };
556
+ async function memoryConditionNamespace(memory, binding) {
557
+ if (!memory || !binding) return void 0;
558
+ const roles = await memory.service.collectVersionOutputRoles(binding);
559
+ if (!roles) return void 0;
560
+ const namespace = {};
561
+ for (const field of Object.values(MEMORY_ROLE_FIELDS)) {
562
+ namespace[field] = 0;
563
+ }
564
+ for (const role of roles) {
565
+ const field = MEMORY_ROLE_FIELDS[role];
566
+ if (field) namespace[field] = 1;
567
+ }
568
+ return namespace;
569
+ }
570
+ __name(memoryConditionNamespace, "memoryConditionNamespace");
571
+ function requestConditionNamespace(items) {
572
+ let total = 0;
573
+ for (const item of items) {
574
+ if (!item.deliver) continue;
575
+ const estimate = estimateRawResourceTokens(item.recognized);
576
+ if (estimate.status !== "ok") return void 0;
577
+ total += estimate.estimatedTokenCount;
578
+ }
579
+ return { totalEstimatedMediaTokens: total };
580
+ }
581
+ __name(requestConditionNamespace, "requestConditionNamespace");
582
+ function sortPolicies(policies) {
583
+ return [...policies].sort(
584
+ (a, b) => b.priority - a.priority || a.id.localeCompare(b.id)
585
+ );
586
+ }
587
+ __name(sortPolicies, "sortPolicies");
588
+ var resourceGates = /* @__PURE__ */ new Map();
589
+ async function acquireResourceSlot(rootDir, limit) {
590
+ const effectiveLimit = Math.max(1, Math.floor(limit));
591
+ let gate = resourceGates.get(rootDir);
592
+ if (!gate) {
593
+ gate = { active: 0, waiters: [] };
594
+ resourceGates.set(rootDir, gate);
595
+ }
596
+ const heldGate = gate;
597
+ if (heldGate.active >= effectiveLimit) {
598
+ await new Promise((resolve) => heldGate.waiters.push(resolve));
599
+ } else {
600
+ heldGate.active++;
601
+ }
602
+ let released = false;
603
+ return () => {
604
+ if (released) return;
605
+ released = true;
606
+ const next = heldGate.waiters.shift();
607
+ if (next) {
608
+ next();
609
+ return;
610
+ }
611
+ heldGate.active--;
612
+ if (heldGate.active === 0 && heldGate.waiters.length === 0) {
613
+ resourceGates.delete(rootDir);
614
+ }
615
+ };
616
+ }
617
+ __name(acquireResourceSlot, "acquireResourceSlot");
618
+ async function runFixedPolicies(config, source, options) {
619
+ const policies = sortPolicies(options.policies);
620
+ const limits = options.limits ?? DEFAULT_OMNI_PROCESSING_LIMITS;
621
+ const releaseSlot = await acquireResourceSlot(
622
+ options.store.getOmniRootDir(),
623
+ limits.maxConcurrentResources
624
+ );
625
+ try {
626
+ return await runFixedPoliciesUnbounded(config, source, options, {
627
+ policies,
628
+ limits
629
+ });
630
+ } finally {
631
+ releaseSlot();
632
+ }
633
+ }
634
+ __name(runFixedPolicies, "runFixedPolicies");
635
+ async function runFixedPoliciesUnbounded(config, source, options, normalized) {
636
+ const { policies, limits } = normalized;
637
+ const cache = options.degradationCache ?? new OmniDegradationCache(options.store.getOmniRootDir());
638
+ const records = [];
639
+ const fileDeliveries = [];
640
+ const items = [
641
+ {
642
+ filePath: source.filePath,
643
+ recognized: source.recognized,
644
+ label: source.displayName,
645
+ origin: source.origin,
646
+ sha256: source.sha256,
647
+ memoryBinding: options.memory?.sourceBinding,
648
+ lineageRuns: /* @__PURE__ */ new Map(),
649
+ depth: 0,
650
+ deliver: true,
651
+ process: true
652
+ }
653
+ ];
654
+ let runsUsed = 0;
655
+ let artifactsProduced = 0;
656
+ let derivedBytesProduced = 0;
657
+ let budgetExhausted = false;
658
+ const stopOnBudget = /* @__PURE__ */ __name((policy, item, reason) => {
659
+ budgetExhausted = true;
660
+ records.push({
661
+ policyId: policy.id,
662
+ toolName: policy.toolName,
663
+ outcome: "budget_exhausted",
664
+ resource: item.label,
665
+ error: reason
666
+ });
667
+ debugLogger2.debug(
668
+ `per-root policy budget exhausted on ${item.label}: ${reason}; no further derivation for this root (committed deliveries stand)`
669
+ );
670
+ }, "stopOnBudget");
671
+ for (let i = 0; i < items.length && !budgetExhausted; i++) {
672
+ const item = items[i];
673
+ if (!item.process) continue;
674
+ if (item.recognized.modality === "image" && (item.recognized.metadata.frameCount ?? 1) > 1) {
675
+ debugLogger2.debug(
676
+ `animated image ${item.label} (${item.recognized.metadata.frameCount} frames) excluded from policy matching (D9)`
677
+ );
678
+ continue;
679
+ }
680
+ const needsMemoryNamespace = policies.some(
681
+ (policy) => policy.when && conditionUsesNamespace(policy.when, "memory")
682
+ );
683
+ const sharedConditionContext = {
684
+ request: options.conditionContext?.request ?? requestConditionNamespace(items),
685
+ session: options.conditionContext?.session,
686
+ memory: needsMemoryNamespace ? await memoryConditionNamespace(options.memory, item.memoryBinding) : void 0
687
+ };
688
+ for (const policy of policies) {
689
+ if (!policy.mediaTypes.includes(item.recognized.modality)) continue;
690
+ if (!policy.origins.includes(item.origin)) continue;
691
+ const runs = item.lineageRuns.get(policy.id) ?? 0;
692
+ if (runs >= policy.maxRunsPerLineage) continue;
693
+ if (policy.when) {
694
+ const evaluation = evaluateFixedPolicyCondition(
695
+ policy.when,
696
+ resourceConditionContext(item.recognized, sharedConditionContext)
697
+ );
698
+ if (evaluation.outcome === "no_match") continue;
699
+ if (evaluation.outcome === "unavailable" && policy.onConditionUnavailable === "skip") {
700
+ records.push({
701
+ policyId: policy.id,
702
+ toolName: policy.toolName,
703
+ outcome: "condition_unavailable",
704
+ resource: item.label,
705
+ missingFields: evaluation.missingFields
706
+ });
707
+ continue;
708
+ }
709
+ }
710
+ if (runsUsed >= limits.maxPolicyRunsPerRoot) {
711
+ stopOnBudget(
712
+ policy,
713
+ item,
714
+ `maxPolicyRunsPerRoot (${limits.maxPolicyRunsPerRoot}) reached`
715
+ );
716
+ break;
717
+ }
718
+ runsUsed++;
719
+ item.lineageRuns.set(policy.id, runs + 1);
720
+ try {
721
+ const execution = await executePolicy(
722
+ config,
723
+ item,
724
+ policy,
725
+ options.store,
726
+ cache,
727
+ options.signal,
728
+ options.memory && item.memoryBinding ? { service: options.memory.service, source: item.memoryBinding } : void 0
729
+ );
730
+ records.push({
731
+ policyId: policy.id,
732
+ toolName: policy.toolName,
733
+ outcome: execution.outcome,
734
+ resource: item.label
735
+ });
736
+ if (execution.outcome === "no_op") continue;
737
+ if (policy.output.source === "omit") item.deliver = false;
738
+ const childDepth = item.depth + 1;
739
+ const depthAllowsReprocess = childDepth < limits.maxLineageDepth;
740
+ if (policy.output.reprocessMedia && !depthAllowsReprocess) {
741
+ debugLogger2.debug(
742
+ `maxLineageDepth (${limits.maxLineageDepth}) reached under ${item.label}; derivatives deliver but do not re-enter policy matching`
743
+ );
744
+ }
745
+ for (const derived of execution.derived) {
746
+ artifactsProduced++;
747
+ derivedBytesProduced += derived.recognized.sizeBytes;
748
+ items.push({
749
+ ...derived,
750
+ label: `${item.label} \u2192 ${policy.id}`,
751
+ origin: "policy",
752
+ lineageRuns: new Map(item.lineageRuns),
753
+ depth: childDepth,
754
+ // `output.artifacts` selector decides delivery (upstream P):
755
+ // an included derivative enters the delivery set, a retained
756
+ // one is only registered in objects/.
757
+ deliver: resolveArtifactSelector(
758
+ policy.output.artifacts,
759
+ derived.recognized.modality,
760
+ derived.role
761
+ ) === "include",
762
+ process: policy.output.reprocessMedia && depthAllowsReprocess
763
+ });
764
+ }
765
+ for (const file of execution.derivedFiles) {
766
+ artifactsProduced++;
767
+ derivedBytesProduced += file.sizeBytes;
768
+ if (resolveArtifactSelector(
769
+ policy.output.artifacts,
770
+ "file",
771
+ file.role
772
+ ) === "include") {
773
+ fileDeliveries.push(file);
774
+ }
775
+ }
776
+ if (artifactsProduced > limits.maxArtifactsPerRoot) {
777
+ stopOnBudget(
778
+ policy,
779
+ item,
780
+ `maxArtifactsPerRoot (${limits.maxArtifactsPerRoot}) exceeded`
781
+ );
782
+ break;
783
+ }
784
+ if (derivedBytesProduced > limits.maxDerivedBytesPerRoot) {
785
+ stopOnBudget(
786
+ policy,
787
+ item,
788
+ `maxDerivedBytesPerRoot (${limits.maxDerivedBytesPerRoot}) exceeded`
789
+ );
790
+ break;
791
+ }
792
+ } catch (err) {
793
+ if (options.signal?.aborted) throw err;
794
+ const message = err instanceof Error ? err.message : String(err);
795
+ records.push({
796
+ policyId: policy.id,
797
+ toolName: policy.toolName,
798
+ outcome: "failed",
799
+ resource: item.label,
800
+ error: message
801
+ });
802
+ debugLogger2.debug(
803
+ `fixed policy ${policy.id} (${policy.toolName}) failed on ${item.label}: ${message}`
804
+ );
805
+ if (policy.onFailure === "abort" || policy.stage === "transport_guard") {
806
+ throw new OmniPolicyExecutionError(
807
+ `Fixed policy ${policy.id} failed: ${message}`,
808
+ policy.id,
809
+ { cause: err }
810
+ );
811
+ }
812
+ }
813
+ }
814
+ }
815
+ return {
816
+ deliveries: items.filter((item) => item.deliver).map((item) => ({
817
+ filePath: item.filePath,
818
+ recognized: item.recognized,
819
+ sha256: item.sha256,
820
+ disclosure: item.disclosure,
821
+ degraded: item.degraded,
822
+ memoryBinding: item.memoryBinding
823
+ })),
824
+ fileDeliveries,
825
+ records
826
+ };
827
+ }
828
+ __name(runFixedPoliciesUnbounded, "runFixedPoliciesUnbounded");
829
+ async function executePolicy(config, item, policy, store, cache, signal, memory) {
830
+ const tool = config.getToolRegistry().getTool(policy.toolName);
831
+ const descriptor = tool?.mediaPolicyDescriptor;
832
+ if (!descriptor) {
833
+ throw new Error(
834
+ `tool ${policy.toolName} is not a registered media-policy tool`
835
+ );
836
+ }
837
+ item.sha256 ??= await hashFileSha256(item.filePath, signal);
838
+ const settingsDefaults = resolvePolicyToolSettings(config, policy.toolName);
839
+ const effectiveArguments = { ...settingsDefaults, ...policy.arguments };
840
+ const fingerprint = computePolicyFingerprint(
841
+ policy.toolName,
842
+ effectiveArguments,
843
+ descriptor.version
844
+ );
845
+ const startedAt = (/* @__PURE__ */ new Date()).toISOString();
846
+ if (memory) {
847
+ const reusable = await memory.service.findReusableOutputs(
848
+ item.sha256,
849
+ fingerprint
850
+ );
851
+ const rebuilt = reusable ? await rebuildReusedOutputs(reusable, descriptor, store, signal) : void 0;
852
+ if (rebuilt) {
853
+ debugLogger2.debug(
854
+ `memory reuse hit: policy=${policy.id} sha256=${item.sha256.slice(0, 12)}\u2026 outputs=${rebuilt.outputs.length} (tool not executed)`
855
+ );
856
+ const commit = await memory.service.commitPolicySucceeded({
857
+ invocationId: "memory-reuse",
858
+ source: memory.source,
859
+ executionOrigin: {
860
+ kind: "fixed_policy",
861
+ policyId: policy.id,
862
+ stage: policy.stage
863
+ },
864
+ toolName: policy.toolName,
865
+ toolVersion: descriptor.version,
866
+ finalArguments: effectiveArguments,
867
+ omniConfigHash: fingerprint,
868
+ startedAt,
869
+ completedAt: (/* @__PURE__ */ new Date()).toISOString(),
870
+ outputs: rebuilt.outputs
871
+ });
872
+ return {
873
+ outcome: "succeeded",
874
+ derived: rebuilt.derived.map((d) => ({
875
+ ...d,
876
+ memoryBinding: commit?.mediaBindings.get(d.sha256)
877
+ })),
878
+ derivedFiles: rebuilt.derivedFiles
879
+ };
880
+ }
881
+ }
882
+ const hit = await cache.get(item.sha256, fingerprint);
883
+ if (hit) {
884
+ try {
885
+ const objectPath = store.objectPathFor(hit.degradedSha256, hit.extension);
886
+ const stat = await fs2.lstat(objectPath).catch(() => void 0);
887
+ if (stat?.isFile() && !stat.isSymbolicLink()) {
888
+ const actualSha256 = await hashFileSha256(objectPath, signal);
889
+ if (actualSha256 === hit.degradedSha256) {
890
+ const recognized = await recognizeMediaFile(objectPath, { signal });
891
+ const declared = descriptor.outputs.some(
892
+ (o) => o.kind === "media" && o.mimeTypes?.includes(recognized.detectedMimeType)
893
+ );
894
+ if (declared) {
895
+ debugLogger2.debug(
896
+ `degradation cache hit: policy=${policy.id} sha256=${item.sha256.slice(0, 12)}\u2026`
897
+ );
898
+ const commit = memory ? await memory.service.commitPolicySucceeded({
899
+ invocationId: "cache-hit",
900
+ source: memory.source,
901
+ executionOrigin: {
902
+ kind: "fixed_policy",
903
+ policyId: policy.id,
904
+ stage: policy.stage
905
+ },
906
+ toolName: policy.toolName,
907
+ toolVersion: descriptor.version,
908
+ finalArguments: effectiveArguments,
909
+ omniConfigHash: fingerprint,
910
+ startedAt,
911
+ completedAt: (/* @__PURE__ */ new Date()).toISOString(),
912
+ outputs: [
913
+ {
914
+ kind: "media",
915
+ objectPath,
916
+ sha256: hit.degradedSha256,
917
+ mediaType: recognized.modality,
918
+ metadata: recognized.metadata,
919
+ sizeBytes: recognized.sizeBytes,
920
+ mimeType: recognized.detectedMimeType,
921
+ role: hit.role,
922
+ disclosure: hit.disclosure
923
+ }
924
+ ]
925
+ }) : void 0;
926
+ return {
927
+ outcome: "cache_hit",
928
+ derived: [
929
+ {
930
+ filePath: objectPath,
931
+ recognized,
932
+ sha256: hit.degradedSha256,
933
+ disclosure: hit.disclosure,
934
+ degraded: true,
935
+ role: hit.role,
936
+ memoryBinding: commit?.mediaBindings.get(hit.degradedSha256)
937
+ }
938
+ ],
939
+ derivedFiles: []
940
+ };
941
+ }
942
+ debugLogger2.debug(
943
+ `degradation cache hit for policy=${policy.id} recognized as undeclared media type ${recognized.detectedMimeType}; dropping the entry and re-transcoding`
944
+ );
945
+ }
946
+ }
947
+ } catch (err) {
948
+ if (signal?.aborted) throw err;
949
+ debugLogger2.debug(
950
+ `degradation cache hit could not be verified for policy=${policy.id}: ${err instanceof Error ? err.message : String(err)}; dropping the entry and re-transcoding`
951
+ );
952
+ }
953
+ await cache.removeByDegradedSha256(hit.degradedSha256);
954
+ }
955
+ await settleOmniGc(store.getOmniRootDir());
956
+ if (isOmniDerivationSuspended(store.getOmniRootDir())) {
957
+ throw new Error(
958
+ `omni object store is over its byte budget with only memory-referenced objects left; new policy derivations are suspended. Raise omni.storage.maxTotalBytes or delete memory records you no longer need, then start a new session \u2014 the budget is re-evaluated once per process.`
959
+ );
960
+ }
961
+ const invocationId = randomBytes(8).toString("hex");
962
+ const stagingDir = await store.createStagingDir(invocationId);
963
+ let failure;
964
+ try {
965
+ const request = {
966
+ callId: invocationId,
967
+ name: policy.toolName,
968
+ args: {
969
+ ...effectiveArguments,
970
+ inputPath: item.filePath,
971
+ outputDir: stagingDir
972
+ },
973
+ isClientInitiated: true,
974
+ prompt_id: `omni-fixed-policy-${invocationId}`,
975
+ executionOrigin: {
976
+ kind: "fixed_policy",
977
+ policyId: policy.id,
978
+ stage: policy.stage
979
+ }
980
+ };
981
+ const { executeToolCall } = await import("./nonInteractiveToolExecutor-QPAIKNPL.js");
982
+ const response = await executeToolCall(
983
+ config,
984
+ request,
985
+ signal ?? new AbortController().signal,
986
+ { recordToolResult: false }
987
+ );
988
+ if (response.error) {
989
+ throw new Error(response.error.message, { cause: response.error });
990
+ }
991
+ const batch = response.policyArtifacts;
992
+ if (!batch || batch.artifacts.length === 0) {
993
+ throw new Error(
994
+ `tool ${policy.toolName} succeeded but produced no policy artifacts`
995
+ );
996
+ }
997
+ const validated = await Promise.all(
998
+ batch.artifacts.map(
999
+ (artifact) => validateArtifact(artifact, descriptor, stagingDir, signal)
1000
+ )
1001
+ );
1002
+ assertRequiredOutputsPresent(descriptor, validated, policy.toolName);
1003
+ if (validated.every((a) => a.sha256 === item.sha256)) {
1004
+ return { outcome: "no_op", derived: [], derivedFiles: [] };
1005
+ }
1006
+ const promoted = await Promise.all(
1007
+ validated.map(async (artifact) => {
1008
+ const mimeType = artifact.kind === "media" ? artifact.recognized.detectedMimeType : artifact.mimeType;
1009
+ const put = await store.putFile(
1010
+ artifact.absolutePath,
1011
+ artifact.sha256,
1012
+ extensionForMime(mimeType),
1013
+ signal
1014
+ );
1015
+ return { artifact, objectPath: put.objectPath };
1016
+ })
1017
+ );
1018
+ const derived = [];
1019
+ const derivedFiles = [];
1020
+ for (const { artifact, objectPath } of promoted) {
1021
+ if (artifact.kind === "media") {
1022
+ derived.push({
1023
+ filePath: objectPath,
1024
+ recognized: artifact.recognized,
1025
+ sha256: artifact.sha256,
1026
+ disclosure: artifact.disclosure,
1027
+ degraded: artifact.lossy,
1028
+ role: artifact.role
1029
+ });
1030
+ } else {
1031
+ derivedFiles.push({
1032
+ filePath: objectPath,
1033
+ role: artifact.role,
1034
+ mimeType: artifact.mimeType,
1035
+ text: artifact.text,
1036
+ sha256: artifact.sha256,
1037
+ sizeBytes: artifact.sizeBytes,
1038
+ disclosure: artifact.disclosure
1039
+ });
1040
+ }
1041
+ }
1042
+ if (memory) {
1043
+ const outputs = promoted.map(
1044
+ ({ artifact, objectPath }) => artifact.kind === "media" ? {
1045
+ kind: "media",
1046
+ objectPath,
1047
+ sha256: artifact.sha256,
1048
+ mediaType: artifact.recognized.modality,
1049
+ metadata: artifact.recognized.metadata,
1050
+ sizeBytes: artifact.recognized.sizeBytes,
1051
+ mimeType: artifact.recognized.detectedMimeType,
1052
+ role: artifact.role,
1053
+ disclosure: artifact.disclosure
1054
+ } : {
1055
+ kind: "text",
1056
+ objectPath,
1057
+ sha256: artifact.sha256,
1058
+ mimeType: artifact.mimeType,
1059
+ text: artifact.text,
1060
+ sizeBytes: artifact.sizeBytes,
1061
+ role: artifact.role,
1062
+ disclosure: artifact.disclosure
1063
+ }
1064
+ );
1065
+ const commit = await memory.service.commitPolicySucceeded({
1066
+ invocationId,
1067
+ source: memory.source,
1068
+ executionOrigin: {
1069
+ kind: "fixed_policy",
1070
+ policyId: policy.id,
1071
+ stage: policy.stage
1072
+ },
1073
+ toolName: policy.toolName,
1074
+ toolVersion: descriptor.version,
1075
+ finalArguments: effectiveArguments,
1076
+ omniConfigHash: fingerprint,
1077
+ startedAt,
1078
+ completedAt: (/* @__PURE__ */ new Date()).toISOString(),
1079
+ outputs
1080
+ });
1081
+ if (commit) {
1082
+ for (const entry of derived) {
1083
+ entry.memoryBinding = commit.mediaBindings.get(entry.sha256);
1084
+ }
1085
+ }
1086
+ }
1087
+ if (validated.length === 1 && validated[0].kind === "media" && validated[0].disclosure) {
1088
+ await cache.put(item.sha256, fingerprint, {
1089
+ degradedSha256: validated[0].sha256,
1090
+ extension: extensionForMime(validated[0].recognized.detectedMimeType),
1091
+ disclosure: validated[0].disclosure,
1092
+ mimeType: validated[0].recognized.detectedMimeType,
1093
+ // Persist the artifact's role so a cache hit reconstructs the SAME
1094
+ // derived shape as the fresh derivation above.
1095
+ ...validated[0].role !== void 0 ? { role: validated[0].role } : {}
1096
+ });
1097
+ }
1098
+ return { outcome: "succeeded", derived, derivedFiles };
1099
+ } catch (err) {
1100
+ failure = err;
1101
+ throw err;
1102
+ } finally {
1103
+ if (failure === void 0 || signal?.aborted) {
1104
+ await store.removeStagingDir(invocationId).catch(() => {
1105
+ });
1106
+ } else {
1107
+ try {
1108
+ await store.quarantineInvocation(invocationId, {
1109
+ policyId: policy.id,
1110
+ toolName: policy.toolName,
1111
+ reason: failure instanceof Error ? failure.message : String(failure)
1112
+ });
1113
+ } catch {
1114
+ await store.removeStagingDir(invocationId).catch(() => {
1115
+ });
1116
+ }
1117
+ }
1118
+ }
1119
+ }
1120
+ __name(executePolicy, "executePolicy");
1121
+ async function rebuildReusedOutputs(reusable, descriptor, store, signal) {
1122
+ const outputs = [];
1123
+ const derived = [];
1124
+ const derivedFiles = [];
1125
+ try {
1126
+ for (const record of reusable.outputs) {
1127
+ const objectPath = record.objectPath ?? store.objectPathFor(record.sha256, extensionForMime(record.mimeType));
1128
+ const stat = await fs2.lstat(objectPath).catch(() => void 0);
1129
+ if (!stat?.isFile() || stat.isSymbolicLink()) return void 0;
1130
+ if (await hashFileSha256(objectPath, signal) !== record.sha256) {
1131
+ return void 0;
1132
+ }
1133
+ if (record.kind === "media") {
1134
+ const recognized = await recognizeMediaFile(objectPath, { signal });
1135
+ const declared = descriptor.outputs.some(
1136
+ (o) => o.kind === "media" && o.mimeTypes?.includes(recognized.detectedMimeType)
1137
+ );
1138
+ if (!declared) return void 0;
1139
+ outputs.push({
1140
+ kind: "media",
1141
+ objectPath,
1142
+ sha256: record.sha256,
1143
+ mediaType: recognized.modality,
1144
+ metadata: recognized.metadata,
1145
+ sizeBytes: recognized.sizeBytes,
1146
+ mimeType: recognized.detectedMimeType,
1147
+ role: record.role,
1148
+ disclosure: record.disclosure
1149
+ });
1150
+ derived.push({
1151
+ filePath: objectPath,
1152
+ recognized,
1153
+ sha256: record.sha256,
1154
+ disclosure: record.disclosure,
1155
+ degraded: record.disclosure !== void 0,
1156
+ role: record.role
1157
+ });
1158
+ } else {
1159
+ const text = await fs2.readFile(objectPath, "utf8");
1160
+ outputs.push({
1161
+ kind: "text",
1162
+ objectPath,
1163
+ sha256: record.sha256,
1164
+ mimeType: record.mimeType,
1165
+ text,
1166
+ sizeBytes: record.sizeBytes,
1167
+ role: record.role,
1168
+ disclosure: record.disclosure
1169
+ });
1170
+ derivedFiles.push({
1171
+ filePath: objectPath,
1172
+ role: record.role,
1173
+ mimeType: record.mimeType,
1174
+ text,
1175
+ sha256: record.sha256,
1176
+ sizeBytes: record.sizeBytes,
1177
+ disclosure: record.disclosure
1178
+ });
1179
+ }
1180
+ }
1181
+ } catch (err) {
1182
+ if (signal?.aborted) throw err;
1183
+ debugLogger2.debug(
1184
+ `memory reuse could not be verified, re-deriving: ${err instanceof Error ? err.message : String(err)}`
1185
+ );
1186
+ return void 0;
1187
+ }
1188
+ return { outputs, derived, derivedFiles };
1189
+ }
1190
+ __name(rebuildReusedOutputs, "rebuildReusedOutputs");
1191
+ async function validateArtifact(artifact, descriptor, stagingDir, signal) {
1192
+ if (artifact.storage !== "workspace" || !artifact.workspacePath) {
1193
+ throw new Error(
1194
+ `policy artifact "${artifact.title}" is not a workspace file`
1195
+ );
1196
+ }
1197
+ const absolutePath = path3.resolve(stagingDir, artifact.workspacePath);
1198
+ if (!absolutePath.startsWith(stagingDir + path3.sep)) {
1199
+ throw new Error(
1200
+ `policy artifact "${artifact.title}" escapes the staging directory`
1201
+ );
1202
+ }
1203
+ const stat = await fs2.lstat(absolutePath).catch(() => void 0);
1204
+ if (!stat?.isFile() || stat.isSymbolicLink()) {
1205
+ throw new Error(
1206
+ `policy artifact "${artifact.title}" is missing or not a regular file`
1207
+ );
1208
+ }
1209
+ const rawRole = artifact.metadata?.["omniRole"];
1210
+ const role = typeof rawRole === "string" && rawRole ? rawRole : void 0;
1211
+ const rawDisclosure = artifact.metadata?.["omniDisclosure"];
1212
+ const disclosure = typeof rawDisclosure === "string" && rawDisclosure ? rawDisclosure : void 0;
1213
+ if (artifact.kind === "file") {
1214
+ const spec2 = descriptor.outputs.find(
1215
+ (o) => o.kind === "file" && (o.role === void 0 || o.role === role) && artifact.mimeType !== void 0 && o.mimeTypes?.includes(artifact.mimeType)
1216
+ );
1217
+ if (!spec2) {
1218
+ throw new Error(
1219
+ `policy artifact "${artifact.title}" (file, role ${role ?? "none"}, ${artifact.mimeType ?? "no mimeType"}) matches no declared file output`
1220
+ );
1221
+ }
1222
+ if (stat.size > MAX_FILE_ARTIFACT_BYTES) {
1223
+ throw new Error(
1224
+ `policy artifact "${artifact.title}" exceeds the file-artifact size budget (${stat.size} > ${MAX_FILE_ARTIFACT_BYTES} bytes)`
1225
+ );
1226
+ }
1227
+ const bytes = await fs2.readFile(absolutePath);
1228
+ let text;
1229
+ try {
1230
+ text = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
1231
+ } catch {
1232
+ throw new Error(
1233
+ `policy artifact "${artifact.title}" is not valid UTF-8 text`
1234
+ );
1235
+ }
1236
+ if (spec2.lossy && !disclosure) {
1237
+ throw new Error(
1238
+ `policy artifact "${artifact.title}" is lossy but carries no omniDisclosure`
1239
+ );
1240
+ }
1241
+ return {
1242
+ kind: "file",
1243
+ absolutePath,
1244
+ mimeType: artifact.mimeType,
1245
+ text,
1246
+ sizeBytes: bytes.byteLength,
1247
+ // The bytes are already in memory for the UTF-8 check — hash them
1248
+ // directly instead of streaming the file a second time.
1249
+ sha256: createHash2("sha256").update(bytes).digest("hex"),
1250
+ disclosure,
1251
+ lossy: spec2.lossy === true,
1252
+ role
1253
+ };
1254
+ }
1255
+ const recognized = await recognizeMediaFile(absolutePath, { signal });
1256
+ const spec = descriptor.outputs.find(
1257
+ (o) => o.kind === "media" && o.mimeTypes?.includes(recognized.detectedMimeType)
1258
+ );
1259
+ if (!spec) {
1260
+ throw new Error(
1261
+ `policy artifact "${artifact.title}" has undeclared media type ${recognized.detectedMimeType}`
1262
+ );
1263
+ }
1264
+ if (artifact.kind !== recognized.modality) {
1265
+ throw new Error(
1266
+ `policy artifact "${artifact.title}" declares kind ${String(artifact.kind)} but contains ${recognized.modality} content`
1267
+ );
1268
+ }
1269
+ if (spec.lossy && !disclosure) {
1270
+ throw new Error(
1271
+ `policy artifact "${artifact.title}" is lossy but carries no omniDisclosure`
1272
+ );
1273
+ }
1274
+ return {
1275
+ kind: "media",
1276
+ absolutePath,
1277
+ recognized,
1278
+ sha256: await hashFileSha256(absolutePath, signal),
1279
+ disclosure,
1280
+ lossy: spec.lossy === true,
1281
+ role
1282
+ };
1283
+ }
1284
+ __name(validateArtifact, "validateArtifact");
1285
+ function assertRequiredOutputsPresent(descriptor, validated, toolName) {
1286
+ for (const spec of descriptor.outputs) {
1287
+ if (!spec.required) continue;
1288
+ let produced;
1289
+ if (spec.kind === "media") {
1290
+ produced = validated.some(
1291
+ (a) => a.kind === "media" && spec.mimeTypes?.includes(a.recognized.detectedMimeType)
1292
+ );
1293
+ } else if (spec.kind === "file") {
1294
+ produced = validated.some(
1295
+ (a) => a.kind === "file" && (spec.role === void 0 || a.role === spec.role) && spec.mimeTypes?.includes(a.mimeType)
1296
+ );
1297
+ } else {
1298
+ continue;
1299
+ }
1300
+ if (!produced) {
1301
+ throw new Error(
1302
+ `tool ${toolName} did not produce its required ${spec.kind} ${spec.mimeTypes?.join("/") ?? spec.role ?? ""} output`
1303
+ );
1304
+ }
1305
+ }
1306
+ }
1307
+ __name(assertRequiredOutputsPresent, "assertRequiredOutputsPresent");
1308
+
1309
+ export {
1310
+ estimateRawResourceTokens,
1311
+ computePolicyFingerprint,
1312
+ OmniDegradationCache,
1313
+ DEFAULT_OMNI_MAX_UPLOAD_FILE_BYTES,
1314
+ OmniTransportGuardError,
1315
+ effectiveMaxUploadFileBytes,
1316
+ assertWithinByteLimit,
1317
+ assertWithinDurationLimit,
1318
+ assertWithinTokenLimit,
1319
+ effectiveOmniStorageMaxTotalBytes,
1320
+ runOmniGcOnce,
1321
+ OmniPolicyExecutionError,
1322
+ runFixedPolicies,
1323
+ validateArtifact,
1324
+ assertRequiredOutputsPresent
1325
+ };
1326
+ /**
1327
+ * @license
1328
+ * Copyright 2025 Google LLC
1329
+ * SPDX-License-Identifier: Apache-2.0
1330
+ */