@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.
- package/bundled/qc-helper/docs/features/_meta.ts +1 -0
- package/bundled/qc-helper/docs/features/goals.md +4 -2
- package/bundled/qc-helper/docs/features/omni-fixed-policies-preset.json +242 -0
- package/bundled/qc-helper/docs/features/omni-media-policies.md +443 -0
- package/bundled/qc-helper/docs/overview.md +1 -1
- package/bundled/qc-helper/docs/quickstart.md +2 -3
- package/chunks/MaxSizedBox-I5COUCHZ.js +148 -0
- package/chunks/{StandaloneSessionPicker-V635V72I.js → StandaloneSessionPicker-KUGOBVEW.js} +114 -90
- package/chunks/acp-subagent-executor-PRPMLKVJ.js +164 -0
- package/chunks/{acpAgent-3DPWZTNC.js → acpAgent-EHXZXVUB.js} +269 -194
- package/chunks/{agent-KIHGINKN.js → agent-FWPNJI6N.js} +59 -49
- package/chunks/agent-headless-M5Z7WIDL.js +104 -0
- package/chunks/{anthropicContentGenerator-4FGOM5LK.js → anthropicContentGenerator-FLTEUSIQ.js} +30 -27
- package/chunks/{artifact-tool-MUTNH4NI.js → artifact-tool-3MWM6SN2.js} +11 -7
- package/chunks/{askUserQuestion-AKIRLVB5.js → askUserQuestion-YFFBB4K3.js} +6 -4
- package/chunks/bridge-EWCKRGWY.js +156 -0
- package/chunks/{build-5KWQBWEQ.js → build-5OQN7CDU.js} +1 -1
- package/chunks/caption-audio-UXXLI3JZ.js +443 -0
- package/chunks/caption-image-B7O4TUFP.js +247 -0
- package/chunks/{channel-management-service-RRILWSXX.js → channel-management-service-GRJG5R46.js} +1 -1
- package/chunks/channel-settings-store-NXZNLT5L.js +158 -0
- package/chunks/{channel-worker-group-3DUJFZJR.js → channel-worker-group-SCSKCSBJ.js} +4 -4
- package/chunks/{channel-worker-manager-E5UW2VLA.js → channel-worker-manager-AHCZCKON.js} +4 -4
- package/chunks/{channel-worker-supervisor-VN33GSEC.js → channel-worker-supervisor-BGUAVITB.js} +3 -3
- package/chunks/{chunk-3LLEB5CU.js → chunk-24ZB2JNI.js} +2 -2
- package/chunks/{chunk-5NUKK2DT.js → chunk-25FMWESU.js} +47 -8
- package/chunks/{chunk-3WWPEFMX.js → chunk-2FQM443D.js} +82 -4
- package/chunks/{chunk-VEXUA6DX.js → chunk-2FRZ4ZP2.js} +13 -11
- package/chunks/{chunk-WBSJ6VPZ.js → chunk-2GNZTJRK.js} +3 -3
- package/chunks/{chunk-YP2K3WOS.js → chunk-2VWXODMY.js} +7 -4
- package/chunks/{chunk-L2A5VBDL.js → chunk-2ZCLSPE4.js} +9 -9
- package/chunks/{chunk-KEM7MWS7.js → chunk-366JNNY7.js} +6 -4
- package/chunks/{chunk-TKF4JINY.js → chunk-3FEGERVL.js} +1 -1
- package/chunks/{chunk-TDKUXSJO.js → chunk-3MW6PPA5.js} +1 -1
- package/chunks/{chunk-4LIPOIXS.js → chunk-3NHJLWOD.js} +1 -1
- package/chunks/{chunk-3UGMLA4V.js → chunk-3V7RNGLC.js} +10 -10
- package/chunks/{chunk-XICCGDWF.js → chunk-3WIPATJX.js} +2 -2
- package/chunks/chunk-43QUA4MC.js +135 -0
- package/chunks/{chunk-Q2SAQTEJ.js → chunk-4B7U3KQP.js} +1 -1
- package/chunks/{chunk-SFL6U7U7.js → chunk-4JFRCIMW.js} +2 -2
- package/chunks/{chunk-TPY6HW55.js → chunk-4OZY6LN2.js} +12 -6
- package/chunks/{chunk-IVFTLUZD.js → chunk-4SZ2636R.js} +3 -3
- package/chunks/{chunk-7CLLH5TI.js → chunk-4YS7RMCB.js} +6 -4
- package/chunks/{chunk-NQ272MQG.js → chunk-5XK2YELE.js} +7 -5
- package/chunks/{chunk-HX4WXX3H.js → chunk-65YADOPT.js} +89 -74
- package/chunks/chunk-6C3D7BKK.js +153 -0
- package/chunks/{chunk-DC4ZNGH4.js → chunk-6DB6UHY3.js} +3 -3
- package/chunks/{chunk-WZWTY7SG.js → chunk-6IW6SX75.js} +6 -6
- package/chunks/{chunk-HYHSMTRA.js → chunk-6XRR4RYH.js} +4 -4
- package/chunks/{chunk-AXPOOQAW.js → chunk-736AZVPL.js} +2 -2
- package/chunks/{chunk-UQGRJTDK.js → chunk-7JWD2EML.js} +3 -3
- package/chunks/{chunk-BUQN5LTI.js → chunk-7PQ65Z5F.js} +2 -2
- package/chunks/{chunk-43Y26NPF.js → chunk-A5EWSUYT.js} +3 -3
- package/chunks/{chunk-VQDWCQOE.js → chunk-ANKISCKU.js} +1 -0
- package/chunks/{chunk-NXUZFW3G.js → chunk-AUFTA63J.js} +1 -1
- package/chunks/{chunk-4QPVZA5J.js → chunk-AVVSSP4R.js} +3 -3
- package/chunks/{chunk-36SDZ2Q4.js → chunk-B3HGO6BB.js} +7 -5
- package/chunks/{chunk-6USYH3EU.js → chunk-B3XJFEEH.js} +5 -3
- package/chunks/{chunk-GSKX53AN.js → chunk-BA6AXQDA.js} +1 -1
- package/chunks/{chunk-FBY32737.js → chunk-BHHR5MEI.js} +4 -4
- package/chunks/{chunk-FX6PZBOV.js → chunk-BJ2TJY7V.js} +4 -4
- package/chunks/chunk-BKVPLSEI.js +133 -0
- package/chunks/chunk-BQMSZSG6.js +21 -0
- package/chunks/{chunk-BW2SMO6L.js → chunk-BXAU2UKM.js} +1 -1
- package/chunks/{chunk-3LMDSCLU.js → chunk-C4FISGDN.js} +2 -2
- package/chunks/{chunk-XFFRI3WM.js → chunk-CA63HYHU.js} +4 -2
- package/chunks/{chunk-IXO2OCIP.js → chunk-CKNBSVBC.js} +12 -8
- package/chunks/{chunk-347O2YZJ.js → chunk-CNG7ILRW.js} +39 -61
- package/chunks/chunk-CQULG2GJ.js +1330 -0
- package/chunks/{chunk-VVI7MK3V.js → chunk-CTGMXP4A.js} +9 -7
- package/chunks/{chunk-QT6Z2IBF.js → chunk-CYFQLCCG.js} +2 -2
- package/chunks/chunk-DBDJRURL.js +42 -0
- package/chunks/{chunk-X7AYIXC7.js → chunk-DJLCK66M.js} +5 -3
- package/chunks/chunk-DJYHML3Y.js +121 -0
- package/chunks/{chunk-MO4XID7S.js → chunk-DNDECZXY.js} +3 -3
- package/chunks/{chunk-D7JMO2GP.js → chunk-DNHL4S5B.js} +1 -1
- package/chunks/{chunk-WL36KHUQ.js → chunk-DTSG4EHA.js} +11 -9
- package/chunks/{chunk-M23GFJ5B.js → chunk-EHMLJKF5.js} +1 -1
- package/chunks/{chunk-TIGXX4PA.js → chunk-EKBQJ627.js} +2 -2
- package/chunks/{chunk-RSWBT7AZ.js → chunk-ERIBG3BX.js} +35 -551
- package/chunks/{chunk-PPJSG2PU.js → chunk-EVZT24AF.js} +6 -142
- package/chunks/{chunk-E2VSBAFA.js → chunk-FL2EJUOY.js} +5 -5
- package/chunks/{chunk-2C5TR6HN.js → chunk-FSNLTHNG.js} +1 -1
- package/chunks/chunk-FTKXJMQV.js +255 -0
- package/chunks/{chunk-TRZ22SG5.js → chunk-FXPP7VLM.js} +6 -4
- package/chunks/{chunk-CDDP4ONL.js → chunk-G3PBYAGM.js} +60 -134
- package/chunks/{chunk-AEWCOE64.js → chunk-GACWUBXV.js} +2 -2
- package/chunks/{chunk-OWUAZXXN.js → chunk-GHG4PQY2.js} +3 -3
- package/chunks/{chunk-VU3XMZ5I.js → chunk-GHZJQCSZ.js} +3 -3
- package/chunks/{chunk-FIJODK52.js → chunk-GJHAV2F7.js} +3 -3
- package/chunks/{chunk-36NRLIR6.js → chunk-GQZA7EYC.js} +11 -11
- package/chunks/{chunk-4JFLRHNE.js → chunk-GVHYY2RS.js} +1 -1
- package/chunks/{chunk-H6L4NEAT.js → chunk-GVMXFXQG.js} +1 -1
- package/chunks/{chunk-G45B3INR.js → chunk-GVTAFLWB.js} +2 -2
- package/chunks/{chunk-GJKP6XOB.js → chunk-GW5SJ3II.js} +16 -19
- package/chunks/{chunk-AQP3H22J.js → chunk-GY7FOHQP.js} +1 -1
- package/chunks/chunk-GZ5MEGA3.js +44 -0
- package/chunks/{chunk-FCPJXKDG.js → chunk-HA6DKD44.js} +9 -9
- package/chunks/{chunk-FEDFZBGR.js → chunk-HR4OWLKI.js} +3 -3
- package/chunks/{chunk-CXY6BICQ.js → chunk-HWKWZSZY.js} +162 -109
- package/chunks/{chunk-K4XMAIRX.js → chunk-I3NKMMHS.js} +12 -12
- package/chunks/{chunk-QMENOK5T.js → chunk-IH4TNUVS.js} +9 -7
- package/chunks/{chunk-FASYATAZ.js → chunk-IHUOMYBO.js} +1 -1
- package/chunks/{chunk-IZ2U57NY.js → chunk-IITTKFWM.js} +4 -2
- package/chunks/{chunk-M22WLKLI.js → chunk-IQGEZOGN.js} +7 -7
- package/chunks/chunk-IVPSLX4P.js +578 -0
- package/chunks/{chunk-BTICBRPL.js → chunk-IWMYX5LB.js} +3 -3
- package/chunks/{chunk-V4JJAVHQ.js → chunk-JCIDHFSB.js} +2 -2
- package/chunks/{chunk-PF7GAP6K.js → chunk-JENFAGVX.js} +65 -54
- package/chunks/{chunk-LO2UWNO5.js → chunk-JFEWKEKG.js} +3 -3
- package/chunks/{chunk-BHG3H6OZ.js → chunk-JJVDKHQU.js} +1 -1
- package/chunks/chunk-JYGESWZM.js +149 -0
- package/chunks/{chunk-KVC7HZWK.js → chunk-JYTJ5FCM.js} +1 -1
- package/chunks/{chunk-KVQ3QL4K.js → chunk-KCL6OMCX.js} +3 -3
- package/chunks/{chunk-3HTUE6ZR.js → chunk-KCRV4F3G.js} +4 -4
- package/chunks/{chunk-3WILPKTJ.js → chunk-KKPIFWTZ.js} +11 -6
- package/chunks/{chunk-CXONOVBN.js → chunk-KS6F6LZQ.js} +8 -6
- package/chunks/chunk-KSEKRQJO.js +253 -0
- package/chunks/{chunk-P42KMMU6.js → chunk-KWTLCPYY.js} +19 -6
- package/chunks/{chunk-U4AASWUQ.js → chunk-L4GF4IK2.js} +3 -3
- package/chunks/{chunk-5FK4MSHB.js → chunk-LADOQIYQ.js} +6 -4
- package/chunks/{chunk-DJXSOEFB.js → chunk-LAE6RY3L.js} +1 -1
- package/chunks/{chunk-CQPM66MG.js → chunk-LG475XAV.js} +4 -4
- package/chunks/{chunk-3BZI5GDP.js → chunk-M5YIHMXP.js} +6 -4
- package/chunks/{chunk-6WXVEDT2.js → chunk-MC2RYJMU.js} +5 -3
- package/chunks/chunk-MNU36NGH.js +233 -0
- package/chunks/{chunk-M4U2LTD2.js → chunk-MS4SXNJ6.js} +1 -1
- package/chunks/{chunk-ZFHKUQZ4.js → chunk-NEVUE35Z.js} +5 -5
- package/chunks/{chunk-DRAX5YAI.js → chunk-NFC4WTY2.js} +6 -4
- package/chunks/{chunk-SOLRBF7L.js → chunk-NSKNTJHU.js} +10 -10
- package/chunks/{chunk-B5TJK7B3.js → chunk-NZRX5WYI.js} +1 -1
- package/chunks/{chunk-YM6KUQ2S.js → chunk-O4A2B6V2.js} +3 -3
- package/chunks/{chunk-DX6JTDMR.js → chunk-OB57Y2WH.js} +1 -1
- package/chunks/{chunk-INN5ORKX.js → chunk-OLFTIODD.js} +1 -1
- package/chunks/chunk-PF3RVYRK.js +108 -0
- package/chunks/{chunk-WSJI6ODG.js → chunk-PGMF3LSO.js} +29 -27
- package/chunks/{chunk-OALXNGUA.js → chunk-PJ3GAHED.js} +10 -10
- package/chunks/{chunk-XWJFDJZK.js → chunk-PJSZXERN.js} +1 -1
- package/chunks/{chunk-GSAOVDTH.js → chunk-POMFSBEC.js} +4 -4
- package/chunks/{chunk-EWNKP4V4.js → chunk-PPVM7YLS.js} +1 -1
- package/chunks/{chunk-WK6DEH3Q.js → chunk-PQQV3OBW.js} +6 -4
- package/chunks/{chunk-BHVF3R6B.js → chunk-PZT2654P.js} +4 -4
- package/chunks/{chunk-ZSTCM3MX.js → chunk-Q5N5NEVT.js} +1 -1
- package/chunks/{chunk-KFFCDLKV.js → chunk-QE36VXWP.js} +1 -1
- package/chunks/{chunk-V545KI73.js → chunk-QPTE6BKL.js} +1 -1
- package/chunks/{chunk-5VQR2DD7.js → chunk-QQPRTJOM.js} +5 -3
- package/chunks/{chunk-QIPLWW6Q.js → chunk-QU7T5PKF.js} +1 -1
- package/chunks/{chunk-Y2KJC55Y.js → chunk-QYT7J3UM.js} +4 -4
- package/chunks/{chunk-SFHX5G2S.js → chunk-R34ALEH5.js} +14 -14
- package/chunks/{chunk-TXTCM3TC.js → chunk-R4DAJXOV.js} +18 -14
- package/chunks/{chunk-2GP6BQ2J.js → chunk-RA6PKQVM.js} +2 -2
- package/chunks/{chunk-HXUI5D4H.js → chunk-RDN5ITXF.js} +1 -1
- package/chunks/{chunk-G6UUOCUT.js → chunk-RMI3DKMV.js} +1 -1
- package/chunks/chunk-RSFNJ6UU.js +1252 -0
- package/chunks/{chunk-EDIDYZBT.js → chunk-RVT5L74D.js} +1 -1
- package/chunks/{chunk-GI7SLDOI.js → chunk-RXP5FVC4.js} +6 -6
- package/chunks/chunk-S34QJ6IR.js +290 -0
- package/chunks/chunk-S5BHLTHK.js +190 -0
- package/chunks/{chunk-2XRE4KE4.js → chunk-S7BE3FMA.js} +1 -1
- package/chunks/{chunk-7O5PYQ3M.js → chunk-SBP43AO6.js} +1 -1
- package/chunks/chunk-SLHYLVRW.js +1377 -0
- package/chunks/{chunk-HNFKYKHH.js → chunk-SMAAYU3F.js} +16 -16
- package/chunks/{chunk-KAYC5FBN.js → chunk-SNPYTKXI.js} +825 -234
- package/chunks/{chunk-IKBEIDOH.js → chunk-SOZJODVX.js} +13 -13
- package/chunks/{chunk-Y4NNIGYO.js → chunk-SSFOFDNL.js} +1 -1
- package/chunks/{chunk-WNQIJTOP.js → chunk-SSGVTJ2W.js} +243 -17
- package/chunks/{chunk-NFXXBWSE.js → chunk-SU64336V.js} +2 -2
- package/chunks/chunk-TFDCK56Y.js +154 -0
- package/chunks/{chunk-JRHKM3YQ.js → chunk-TS4JJ7NN.js} +2 -2
- package/chunks/{chunk-C4HBZQNH.js → chunk-U3MTHCJF.js} +1 -1
- package/chunks/{chunk-AUX2FL5T.js → chunk-UBQVV7MX.js} +625 -6
- package/chunks/{chunk-B6RMK4ED.js → chunk-UHBYCY7U.js} +9 -7
- package/chunks/{chunk-Y53DG2HA.js → chunk-UIWUFHRJ.js} +1 -1
- package/chunks/chunk-UQRDQCWF.js +102 -0
- package/chunks/{chunk-NKTMUPHJ.js → chunk-UVMU7DDP.js} +5 -3
- package/chunks/chunk-UXEI7POA.js +273 -0
- package/chunks/chunk-V2XJJTAB.js +228 -0
- package/chunks/chunk-VDNCKE2O.js +24 -0
- package/chunks/{chunk-YQQ2U7AS.js → chunk-VISF4MEY.js} +1 -1
- package/chunks/{chunk-RRI764F7.js → chunk-VPFKSRAB.js} +13 -11
- package/chunks/chunk-VPGRGNNH.js +578 -0
- package/chunks/{chunk-SYMXYRM5.js → chunk-W7JWIIRC.js} +1 -1
- package/chunks/{chunk-AZCTY64Z.js → chunk-WEUQIY3Q.js} +1 -1
- package/chunks/{chunk-SSWTA7CH.js → chunk-WIKUMTAB.js} +12 -12
- package/chunks/chunk-WL2CTQGT.js +1625 -0
- package/chunks/chunk-WL2V7PTE.js +78 -0
- package/chunks/{chunk-Q54O3EIA.js → chunk-WSZ6VS24.js} +45 -30
- package/chunks/{chunk-UZSB57EV.js → chunk-WX4W3FCV.js} +5 -5
- package/chunks/{chunk-OSG23MR3.js → chunk-X3T5IOX6.js} +2 -2
- package/chunks/{chunk-EIBECN2J.js → chunk-XGHVF5DC.js} +5 -5
- package/chunks/{chunk-D3KVGQUV.js → chunk-XJ52OCCN.js} +4 -4
- package/chunks/{chunk-YZXSDPOQ.js → chunk-XMAIUTED.js} +84 -40
- package/chunks/{chunk-QGEISOJ2.js → chunk-XQBZZVJA.js} +3 -3
- package/chunks/{chunk-OZEV3R3S.js → chunk-XYAB5R6E.js} +3 -3
- package/chunks/chunk-XZA32HII.js +19 -0
- package/chunks/{chunk-4FLUQWJ4.js → chunk-Y3Q5OK4D.js} +1 -1
- package/chunks/chunk-YDERQ7ZV.js +248 -0
- package/chunks/{chunk-AKRSSKUT.js → chunk-YFHX6MOF.js} +10 -10
- package/chunks/{chunk-ZMYKNKET.js → chunk-YPJZDZMP.js} +3 -3
- package/chunks/{chunk-3XBUCOWS.js → chunk-YSD6IY6F.js} +2 -2
- package/chunks/{chunk-CH2YDT6X.js → chunk-YVYK3JYU.js} +5 -3
- package/chunks/{chunk-YL3UJML3.js → chunk-YWDVNBGE.js} +4 -4
- package/chunks/{chunk-C3T6HPNM.js → chunk-ZGADNVME.js} +5 -5
- package/chunks/{chunk-M3JGHRMQ.js → chunk-ZJ7KIWG5.js} +1 -1
- package/chunks/{chunk-QHSOINX6.js → chunk-ZJBYZN5D.js} +2 -2
- package/chunks/{chunk-SYROIHU7.js → chunk-ZRQGTRHA.js} +4 -2
- package/chunks/{chunk-NCPFOLM2.js → chunk-ZTBP4SFC.js} +78 -18
- package/chunks/{chunk-ZAFYHRVY.js → chunk-ZYDMQCQP.js} +4 -274
- package/chunks/clip-audio-SH4L7AEY.js +255 -0
- package/chunks/clip-image-BQRPECIS.js +239 -0
- package/chunks/clip-video-JIRMV5IH.js +277 -0
- package/chunks/{codex-subagent-executor-AEAIQZDC.js → codex-subagent-executor-Y5ILNWG6.js} +92 -68
- package/chunks/config-3X4AXU45.js +21 -0
- package/chunks/config-T5RO4NJV.js +17 -0
- package/chunks/config-utils-3YNEDKT4.js +151 -0
- package/chunks/contextCommand-7JVXVYN4.js +144 -0
- package/chunks/convert-image-D52K2FFB.js +231 -0
- package/chunks/{core-runtime-ZI4RTOJQ.js → core-runtime-6IZNPJUN.js} +92 -67
- package/chunks/{create-sub-session-BBWFQARJ.js → create-sub-session-5XHUO2PW.js} +90 -66
- package/chunks/{create-sub-session-MSGNIM37.js → create-sub-session-6EDEANCD.js} +7 -5
- package/chunks/{cron-create-U2JJ5CCF.js → cron-create-GS7ORRO6.js} +8 -5
- package/chunks/{cron-delete-7DM4LJWD.js → cron-delete-3GGDNNXD.js} +8 -5
- package/chunks/{cron-list-VCUSZK2Y.js → cron-list-EX27DW4H.js} +8 -5
- package/chunks/{daemon-git-worktree-guard-KECEMV6A.js → daemon-git-worktree-guard-BULXRIDA.js} +90 -66
- package/chunks/daemon-status-provider-VSVXVY4O.js +155 -0
- package/chunks/daemon-trust-policy-WVSDS2WT.js +150 -0
- package/chunks/{daemon-trust-policy-monitor-546N5ZVL.js → daemon-trust-policy-monitor-HXQ2GLTX.js} +95 -71
- package/chunks/deferred-core-runtime-EXI7LXLE.js +153 -0
- package/chunks/{display-image-QTHALY6N.js → display-image-FTWDRBOP.js} +10 -7
- package/chunks/{dist-BNW423XT.js → dist-CXDHIHN4.js} +5 -0
- package/chunks/downsample-audio-LPDWX6GF.js +217 -0
- package/chunks/downsample-image-A5JEYIV5.js +249 -0
- package/chunks/downscale-video-4W5BX5KO.js +249 -0
- package/chunks/{earlyInputCapture-BXP7V2P3.js → earlyInputCapture-UJ3KFVZQ.js} +3 -2
- package/chunks/{edit-CMSQB7NP.js → edit-JJ34NKRC.js} +68 -56
- package/chunks/{en-56QLKXS2.js → en-FCK6MBTI.js} +16 -0
- package/chunks/{enter-worktree-DA6A4XC5.js → enter-worktree-QK7DR5EF.js} +12 -9
- package/chunks/{enterPlanMode-UDPMNESD.js → enterPlanMode-H6FBPVLB.js} +62 -51
- package/chunks/environment-7DMLANWW.js +167 -0
- package/chunks/errors-OH3DYEDL.js +151 -0
- package/chunks/{exec-RPKEY6HP.js → exec-7CFNHYCV.js} +31 -9
- package/chunks/{exit-worktree-4H6Z2VQI.js → exit-worktree-62COYIHF.js} +14 -10
- package/chunks/exitPlanMode-5YR5VWXS.js +102 -0
- package/chunks/extract-audio-GSSZQV6G.js +229 -0
- package/chunks/extract-keyframes-Q6DRMQAJ.js +621 -0
- package/chunks/{fast-path-F2CYDDZ4.js → fast-path-4DS2GR5O.js} +5 -5
- package/chunks/ffmpeg-N4LIIVNR.js +21 -0
- package/chunks/{glob-Z2JMJKKN.js → glob-GFID3F3R.js} +63 -51
- package/chunks/{goal-tools-HXVVLGCV.js → goal-tools-2OB5WPNH.js} +59 -49
- package/chunks/{grep-H2I33VAO.js → grep-JB5DGQ3B.js} +13 -9
- package/chunks/handleAutoUpdate-5OQL4YBU.js +147 -0
- package/chunks/i18n-TV5G7SXO.js +164 -0
- package/chunks/{image-gen-HIAZCB5T.js → image-gen-LX3C4V3R.js} +16 -11
- package/chunks/initializer-R2EI4UJ6.js +151 -0
- package/chunks/installationInfo-HYOWC3BN.js +145 -0
- package/chunks/{keychain-token-storage-NQ5XWIPX.js → keychain-token-storage-ZZNRE6D4.js} +3 -2
- package/chunks/list-ORJQQUNR.js +154 -0
- package/chunks/{list-agents-EWDCEPIW.js → list-agents-HS6HH4DJ.js} +10 -7
- package/chunks/{llm-LSUBOJAR.js → llm-YKBQVN7S.js} +159 -134
- package/chunks/{llm-content-generator-MLIONRXE.js → llm-content-generator-QJBXJRKT.js} +11 -9
- package/chunks/loadedSettingsAdapter-4FQH6Y3D.js +148 -0
- package/chunks/{loggingContentGenerator-TUPEXFMM.js → loggingContentGenerator-DEOANG3F.js} +74 -63
- package/chunks/{loop-wakeup-ZBVRI6VH.js → loop-wakeup-4B7OY3TV.js} +9 -6
- package/chunks/{ls-6ZB3BEIR.js → ls-EZ5PSWU2.js} +8 -5
- package/chunks/{lsp-M54FQARP.js → lsp-DYFFHKB3.js} +6 -3
- package/chunks/{managed-npm-update-WEA5XMFZ.js → managed-npm-update-36U25ZEZ.js} +91 -67
- package/chunks/mcp-ZI7LXLAQ.js +148 -0
- package/chunks/memory-side-query-DRV7FXK4.js +221 -0
- package/chunks/model-call-collection-RX7C24YP.js +171 -0
- package/chunks/model-configuration-3JIO6IRV.js +161 -0
- package/chunks/modelConfigUtils-2BJQI2S4.js +140 -0
- package/chunks/{monitor-CI7YE7MT.js → monitor-LXQRI2IF.js} +63 -51
- package/chunks/nonInteractiveCli-HRXVUV2H.js +235 -0
- package/chunks/nonInteractiveToolExecutor-QPAIKNPL.js +101 -0
- package/chunks/{notebook-edit-3WCVRNGL.js → notebook-edit-5CM3VYNK.js} +63 -52
- package/chunks/ocr-image-Q4HYJ3U7.js +252 -0
- package/chunks/omni-A5XLPNSH.js +147 -0
- package/chunks/{openaiContentGenerator-OGILGUZE.js → openaiContentGenerator-O5G3QCHX.js} +36 -31
- package/chunks/{openaiResponsesContentGenerator-NXOXUPFM.js → openaiResponsesContentGenerator-W2V7AYVE.js} +12 -10
- package/chunks/pidfile-MI5FGYF5.js +151 -0
- package/chunks/{processUtils-O4II3RYH.js → processUtils-EWKUPVJH.js} +2 -2
- package/chunks/prompt-terminal-ledger-5HEXZMWT.js +143 -0
- package/chunks/{qwenContentGenerator-I4LRYADV.js → qwenContentGenerator-HHNDIW2Q.js} +70 -60
- package/chunks/{qwenOAuth2-3J66TOT5.js → qwenOAuth2-GD3UIYUP.js} +9 -8
- package/chunks/reactive-degrade-KWCJUHXH.js +375 -0
- package/chunks/read-file-ZQKBXJSH.js +37 -0
- package/chunks/{read-mcp-resource-LPSWXVOD.js → read-mcp-resource-INJIV3UC.js} +8 -4
- package/chunks/recall-media-memory-tool-PEE2BWRY.js +198 -0
- package/chunks/{record-artifact-L3CFJOMA.js → record-artifact-KKW3AIMJ.js} +6 -4
- package/chunks/record-source-2VSQINX6.js +24 -0
- package/chunks/{report-findings-LY5HQY4K.js → report-findings-OZSLWYAS.js} +7 -5
- package/chunks/{request-shutdown-53SNYGVR.js → request-shutdown-3RUGTWRR.js} +12 -9
- package/chunks/resumeHistoryUtils-5V3KISJ6.js +156 -0
- package/chunks/ripGrep-F5MM4HGA.js +43 -0
- package/chunks/{run-qwen-serve-ZVEKGS7Y.js → run-qwen-serve-3K3D5MSR.js} +70 -70
- package/chunks/{runtime-SJCRYNPA.js → runtime-FAWN3GQH.js} +98 -74
- package/chunks/sandbox-BPRE7KYF.js +170 -0
- package/chunks/sandboxConfig-V3OHETXW.js +138 -0
- package/chunks/scheduled-tasks-LB2PINB3.js +167 -0
- package/chunks/scheduler-NHAWKARI.js +160 -0
- package/chunks/{sdk-exporters-http-DR4G663K.js → sdk-exporters-http-SWXTEEVT.js} +3 -2
- package/chunks/{sdk-impl-SJR26MQF.js → sdk-impl-FK4JY6LX.js} +5 -4
- package/chunks/{send-message-DN76MXDX.js → send-message-TLF36UW2.js} +16 -13
- package/chunks/serve-UQL5X5K7.js +156 -0
- package/chunks/{server-UHMKPCAZ.js → server-3HUUEDUC.js} +286 -261
- package/chunks/{session-ZLUK7E4P.js → session-XODWSTJ3.js} +151 -127
- package/chunks/session-attachments-root-BENUIMZM.js +141 -0
- package/chunks/{session-pr-refresh-3OMTQWCZ.js → session-pr-refresh-CSRULMTI.js} +95 -71
- package/chunks/{settings-P4DHIIUP.js → settings-42FFX5TK.js} +94 -70
- package/chunks/{shell-IMFUVQQ5.js → shell-NLNU2TPF.js} +59 -49
- package/chunks/{skill-NB5RJGZW.js → skill-KIRNNJMK.js} +22 -17
- package/chunks/skill-settings-MPHPE43F.js +164 -0
- package/chunks/spawnChannel-TXNLXP2R.js +152 -0
- package/chunks/standalone-update-XAC364AM.js +156 -0
- package/chunks/{start-opentui-ui-JKAIWGF7.js → start-opentui-ui-3OLDXRMX.js} +223 -189
- package/chunks/{startInteractiveUI-YRPOT6GH.js → startInteractiveUI-UB2HRTV7.js} +339 -295
- package/chunks/storage-VZECDJNX.js +17 -0
- package/chunks/{syntheticOutput-EX5L5GYI.js → syntheticOutput-SSXJ2NEY.js} +5 -3
- package/chunks/task-create-EEMYF6LY.js +30 -0
- package/chunks/{task-list-ZLJSMRFA.js → task-list-GA5GOR74.js} +9 -6
- package/chunks/{task-stop-MD7P6QGK.js → task-stop-3MXTDL7H.js} +6 -3
- package/chunks/{task-update-3LSYQDRW.js → task-update-JSBHKL4L.js} +16 -13
- package/chunks/{team-create-2XTBYRJF.js → team-create-VES6TOBA.js} +62 -51
- package/chunks/{team-delete-RIDINW6I.js → team-delete-V2CROTI6.js} +9 -6
- package/chunks/{team-plan-approval-CFNWW7ZQ.js → team-plan-approval-ZMCHBBUM.js} +61 -50
- package/chunks/terminal-image-renderer-73NDY7OJ.js +156 -0
- package/chunks/theme-manager-YG3L7BV6.js +140 -0
- package/chunks/{todoWrite-XSTG2VT5.js → todoWrite-CMBHPR66.js} +8 -5
- package/chunks/tool-result-media-V3LNDB5Q.js +45 -0
- package/chunks/{tool-search-ZHTJU2MV.js → tool-search-7XR7RHMB.js} +43 -21
- package/chunks/total-session-admission-QUZYGACG.js +151 -0
- package/chunks/transcribe-audio-AJQZPNEV.js +30 -0
- package/chunks/trustedFolders-QRII2BL7.js +160 -0
- package/chunks/understand-video-segments-5TMRDQUB.js +438 -0
- package/chunks/{update-relaunch-LI7GRP36.js → update-relaunch-735DXN5P.js} +5 -5
- package/chunks/updateCheck-FXXOM4YS.js +156 -0
- package/chunks/upload-cache-5YULQVZZ.js +17 -0
- package/chunks/upload-config-CKDIXTPK.js +25 -0
- package/chunks/useAutoAcceptIndicator-KXXTKOGD.js +158 -0
- package/chunks/{validateNonInterActiveAuth-YFPCYYNL.js → validateNonInterActiveAuth-DXCBDHIX.js} +143 -119
- package/chunks/{version-4MTL4JVU.js → version-76T4NBMQ.js} +1 -1
- package/chunks/{web-fetch-O6RG6ISB.js → web-fetch-UIDZX5RN.js} +27 -20
- package/chunks/{web-search-JHAXVEMD.js → web-search-VETWDOUJ.js} +14 -11
- package/chunks/{web-shell-static-FFWCUUZS.js → web-shell-static-XSCCMXKQ.js} +3 -3
- package/chunks/{workflow-O7L6VDYU.js → workflow-MHYBJHPP.js} +63 -52
- package/chunks/workspace-providers-status-WFBT3LS5.js +154 -0
- package/chunks/{workspace-registration-store-7G4E7YPY.js → workspace-registration-store-M3WKKBJQ.js} +1 -1
- package/chunks/workspace-registry-FIUB7MGD.js +160 -0
- package/chunks/workspace-runtime-coordinator-5Z7M36W7.js +163 -0
- package/chunks/workspace-service-TP4VRTZF.js +165 -0
- package/chunks/workspace-skills-status-CILWVQHU.js +151 -0
- package/chunks/{workspace-trust-reconciler-XEBW5FUL.js → workspace-trust-reconciler-2OPSTQNS.js} +98 -74
- package/chunks/write-file-N7NBKIYD.js +107 -0
- package/chunks/{zh-TW-S3YTQ4DS.js → zh-TW-SRB5QSER.js} +16 -0
- package/chunks/{zh-F76MZTL3.js → zh-UBQIFP4A.js} +16 -0
- package/chunks/{zoom-image-RDPRTP4B.js → zoom-image-3GHVMYEW.js} +18 -13
- package/cli.js +14 -14
- package/export-transcript-document.js +3 -3
- package/locales/en.js +18 -0
- package/locales/zh-TW.js +17 -0
- package/locales/zh.js +17 -0
- package/package.json +3 -3
- package/web-shell/assets/{abnfDiagram-VCTEODGH-RxykUDmi.js → abnfDiagram-VCTEODGH-vfbwxn7H.js} +1 -1
- package/web-shell/assets/{arc-CZpgGCJC.js → arc-BT0KMrP5.js} +1 -1
- package/web-shell/assets/{architectureDiagram-5GKGNRK7-BHSMzNDT.js → architectureDiagram-5GKGNRK7-B3TlGgP4.js} +1 -1
- package/web-shell/assets/{blockDiagram-NRAW4CY4-Bn4mF9SZ.js → blockDiagram-NRAW4CY4-DnwF5xi-.js} +1 -1
- package/web-shell/assets/{c4Diagram-UCG6FXSJ-CBM-Bj6t.js → c4Diagram-UCG6FXSJ-8qvMMfFg.js} +1 -1
- package/web-shell/assets/channel-CTm0xByY.js +1 -0
- package/web-shell/assets/{chunk-2Q5K7J3B-D5Fin58O.js → chunk-2Q5K7J3B-CHM51UX6.js} +1 -1
- package/web-shell/assets/{chunk-5VM5RSS4-CY05weF7.js → chunk-5VM5RSS4-BNXaOtyN.js} +1 -1
- package/web-shell/assets/{chunk-F27PBJKO-3neZnj5Y.js → chunk-F27PBJKO-DT-vcF3X.js} +1 -1
- package/web-shell/assets/{chunk-G27WJ6UU-Cd7EU4BE.js → chunk-G27WJ6UU-BXz8438J.js} +1 -1
- package/web-shell/assets/{chunk-JWPE2WC7-DwK1mqFw.js → chunk-JWPE2WC7-CP2ozL3M.js} +1 -1
- package/web-shell/assets/{chunk-LCL6LL3I-Sl7vY22C.js → chunk-LCL6LL3I-DTAWXvja.js} +1 -1
- package/web-shell/assets/{chunk-POPQ4Y6H-BXNzpbVg.js → chunk-POPQ4Y6H-DZENJpGx.js} +1 -1
- package/web-shell/assets/{chunk-SVP7TREG-DjjButcp.js → chunk-SVP7TREG-Dl8djRwv.js} +1 -1
- package/web-shell/assets/{chunk-XXDRQBXY-DNOiCjOJ.js → chunk-XXDRQBXY-B3lJllMA.js} +1 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-DhMuMK_E.js +1 -0
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-DhMuMK_E.js +1 -0
- package/web-shell/assets/{cose-bilkent-JH36ORCC-BUnker7a.js → cose-bilkent-JH36ORCC-DeosJDcB.js} +1 -1
- package/web-shell/assets/{cynefin-OW5HDTMX-DcUgdWE5.js → cynefin-OW5HDTMX-BvqcLoHm.js} +1 -1
- package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-CvDKsZsL.js → cynefinDiagram-5FMLGOSQ-BYS0pmSs.js} +1 -1
- package/web-shell/assets/{dagre-3AP2YEHR-jpCmUbr1.js → dagre-3AP2YEHR-IDScuL-R.js} +1 -1
- package/web-shell/assets/{diagram-S7CK7UJ4-DBe_bKE5.js → diagram-S7CK7UJ4-EYNlkkKJ.js} +1 -1
- package/web-shell/assets/{diagram-UQ7AKVKN-oXvPpDgs.js → diagram-UQ7AKVKN-D3x9g8Ep.js} +1 -1
- package/web-shell/assets/{diagram-VSXAHHWV-BD7-_SGh.js → diagram-VSXAHHWV-C35O1dtR.js} +1 -1
- package/web-shell/assets/{diagram-VX7I27RA-DOJL0wub.js → diagram-VX7I27RA-XvMv2aCN.js} +1 -1
- package/web-shell/assets/{diagram-Z3DM3KII-DRIiodDD.js → diagram-Z3DM3KII-CeryNvru.js} +1 -1
- package/web-shell/assets/{ebnfDiagram-PWID7BFC-Db31Ulmb.js → ebnfDiagram-PWID7BFC-DAmepjvB.js} +1 -1
- package/web-shell/assets/{erDiagram-SSCWMZ5O-CVHhwI2_.js → erDiagram-SSCWMZ5O-BkGfBZt_.js} +1 -1
- package/web-shell/assets/{flowDiagram-A5DVABFB-DWOFy1FK.js → flowDiagram-A5DVABFB-CzUCgun9.js} +1 -1
- package/web-shell/assets/{ganttDiagram-EL5Y4UJY-C0sxQtPd.js → ganttDiagram-EL5Y4UJY-BIFST90r.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-CNituBYC.js → gitGraphDiagram-WWUBYQGX-jVvRSGcu.js} +1 -1
- package/web-shell/assets/{index-B15NlwB8.js → index-M1TfOjx2.js} +457 -457
- package/web-shell/assets/{index-gm9tLk7h.js → index-krCDFzE6.js} +1 -1
- package/web-shell/assets/{infoDiagram-RXCK75RN-CxhJYtIR.js → infoDiagram-RXCK75RN-DsU7vA4Q.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-5VMMS53U-By2mchUy.js → ishikawaDiagram-5VMMS53U-K9mTNAbN.js} +1 -1
- package/web-shell/assets/{journeyDiagram-EYS64GPL-CVH-OweI.js → journeyDiagram-EYS64GPL-BKuHLGxv.js} +1 -1
- package/web-shell/assets/{kanban-definition-3QL26DDD-Cc9dQXLy.js → kanban-definition-3QL26DDD-CXG9frQ_.js} +1 -1
- package/web-shell/assets/{layout-C_60ysHw.js → layout-6G_l7UoH.js} +1 -1
- package/web-shell/assets/{linear-BvAVfqwu.js → linear-DYpvB2mh.js} +1 -1
- package/web-shell/assets/{mermaid.core-C3CoBKAc.js → mermaid.core-Sj3dJttQ.js} +6 -6
- package/web-shell/assets/{mindmap-definition-FBJOCRG2-Cuu8Q8LM.js → mindmap-definition-FBJOCRG2-DNJ1e6qd.js} +1 -1
- package/web-shell/assets/{pegDiagram-XKGWAZYB-DmAeyDO2.js → pegDiagram-XKGWAZYB-D-KPklHv.js} +1 -1
- package/web-shell/assets/{pieDiagram-E7YTZNPT-B7vbB_xv.js → pieDiagram-E7YTZNPT-BQPm03g2.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-AXDQQJYC-BqOBkRR7.js → quadrantDiagram-AXDQQJYC-BubBXSqD.js} +1 -1
- package/web-shell/assets/{railroadDiagram-O6MQD6OU-sI06lZIu.js → railroadDiagram-O6MQD6OU-DatD6KIT.js} +1 -1
- package/web-shell/assets/{requirementDiagram-EFPCY7ZU-Bg13d10S.js → requirementDiagram-EFPCY7ZU-DiQ6jsZY.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-P5KCCOFB-WFOzZHrR.js → sankeyDiagram-P5KCCOFB-C07fyxbH.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-CCdRbA4E.js → sequenceDiagram-WJ2MYXX4-DWXtsWzI.js} +1 -1
- package/web-shell/assets/{sizeCapture-X5ZJPWSS-BH5F3bGg.js → sizeCapture-X5ZJPWSS-B0cQ1v0l.js} +1 -1
- package/web-shell/assets/{stateDiagram-HBIQ2CUA-NwS2X3QB.js → stateDiagram-HBIQ2CUA-zHgWc00n.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-C-3ZC2nf.js +1 -0
- package/web-shell/assets/{swimlanes-XN3QIQJK-Bm38pM28.js → swimlanes-XN3QIQJK-Dnrrhu0H.js} +1 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Ded1L5cw.js +8 -0
- package/web-shell/assets/{timeline-definition-24CTP7MA-Do-agLSo.js → timeline-definition-24CTP7MA-8BV7W2Xq.js} +1 -1
- package/web-shell/assets/{vennDiagram-4TSXK5OY-aggLfZzl.js → vennDiagram-4TSXK5OY-tmBBtlnj.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-VM6X3IG4-D5JR3mXX.js → wardleyDiagram-VM6X3IG4-Cq96T3gb.js} +1 -1
- package/web-shell/assets/{xychartDiagram-S5SC5T6Z-DhtLDuXs.js → xychartDiagram-S5SC5T6Z-Dpzx_ZGQ.js} +1 -1
- package/web-shell/index.html +1 -1
- package/chunks/MaxSizedBox-FCF6M53W.js +0 -124
- package/chunks/acp-subagent-executor-TND6W2O5.js +0 -140
- package/chunks/agent-headless-EJ4QOUSM.js +0 -94
- package/chunks/bridge-MUX5YJZT.js +0 -132
- package/chunks/channel-settings-store-7CBIRZER.js +0 -134
- package/chunks/config-utils-KX2YS725.js +0 -127
- package/chunks/contextCommand-RV6Y5LNJ.js +0 -120
- package/chunks/daemon-status-provider-NULJNAEV.js +0 -131
- package/chunks/daemon-trust-policy-S4KWGPV3.js +0 -126
- package/chunks/deferred-core-runtime-T23ZT443.js +0 -128
- package/chunks/environment-TSQJUTPV.js +0 -143
- package/chunks/errors-RIVYJS6T.js +0 -127
- package/chunks/exitPlanMode-BYBBFN2T.js +0 -92
- package/chunks/handleAutoUpdate-FZP45KOR.js +0 -123
- package/chunks/i18n-OTB62AKW.js +0 -140
- package/chunks/initializer-4JXZEC4B.js +0 -127
- package/chunks/installationInfo-2IJV5QKC.js +0 -121
- package/chunks/list-KQSQ4A5G.js +0 -130
- package/chunks/loadedSettingsAdapter-TZTTNRHI.js +0 -124
- package/chunks/mcp-TFDTUPIA.js +0 -124
- package/chunks/model-configuration-ZCAKKIOF.js +0 -137
- package/chunks/modelConfigUtils-J3ZPW7ZK.js +0 -116
- package/chunks/nonInteractiveCli-GPT3TVOK.js +0 -211
- package/chunks/pidfile-GBTBIGHF.js +0 -127
- package/chunks/prompt-terminal-ledger-ILIXZI3E.js +0 -119
- package/chunks/read-file-G4XKW2CS.js +0 -31
- package/chunks/record-source-2GSY5JD5.js +0 -22
- package/chunks/resumeHistoryUtils-YPJU4XFE.js +0 -132
- package/chunks/ripGrep-AAKMALLM.js +0 -39
- package/chunks/sandbox-UIXL423Z.js +0 -146
- package/chunks/sandboxConfig-CY343YNJ.js +0 -114
- package/chunks/scheduled-tasks-5UGBEVNZ.js +0 -143
- package/chunks/scheduler-GCZYLZ2P.js +0 -136
- package/chunks/serve-2XXQLVK2.js +0 -132
- package/chunks/session-attachments-root-DHQM5IEZ.js +0 -117
- package/chunks/skill-settings-IXG5CTQO.js +0 -140
- package/chunks/spawnChannel-Q3YALTCJ.js +0 -128
- package/chunks/standalone-update-H5OJ7MM7.js +0 -132
- package/chunks/task-create-75HVPEAH.js +0 -28
- package/chunks/terminal-image-renderer-UDPJPGPQ.js +0 -132
- package/chunks/theme-manager-SK57EKMO.js +0 -116
- package/chunks/total-session-admission-UUZBDQCG.js +0 -127
- package/chunks/trustedFolders-4LDBLNTS.js +0 -136
- package/chunks/updateCheck-PKSSORPO.js +0 -132
- package/chunks/useAutoAcceptIndicator-I32UEQPI.js +0 -134
- package/chunks/workspace-providers-status-WRX6CJM4.js +0 -130
- package/chunks/workspace-registry-SXIMGT4D.js +0 -136
- package/chunks/workspace-runtime-coordinator-7DOEHXYT.js +0 -139
- package/chunks/workspace-service-HDXOZMYC.js +0 -141
- package/chunks/workspace-skills-status-VN4L37CA.js +0 -127
- package/chunks/write-file-LKX4ETIO.js +0 -97
- package/web-shell/assets/channel-DFYs_LlK.js +0 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-DnGrKXoM.js +0 -1
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-DnGrKXoM.js +0 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-1aU2JZXO.js +0 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Dp-u6kQG.js +0 -8
- package/chunks/{chunk-XAJZFGD2.js → chunk-PXXYQOZO.js} +8 -8
- package/chunks/{chunk-WVURIAEE.js → chunk-SVWWF5TZ.js} +3 -3
- package/chunks/{dist-G5UMXIGF.js → dist-I6D6XOWV.js} +1 -1
- package/chunks/{dist-UXVNLQHG.js → dist-VIKOMAGG.js} +3 -3
|
@@ -0,0 +1,1252 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
isPlainRecord
|
|
5
|
+
} from "./chunk-BQMSZSG6.js";
|
|
6
|
+
import {
|
|
7
|
+
SchemaValidator,
|
|
8
|
+
ToolNames
|
|
9
|
+
} from "./chunk-ERIBG3BX.js";
|
|
10
|
+
import {
|
|
11
|
+
createDebugLogger
|
|
12
|
+
} from "./chunk-ZYDMQCQP.js";
|
|
13
|
+
import {
|
|
14
|
+
init_esbuild_shims
|
|
15
|
+
} from "./chunk-5O2XNYP6.js";
|
|
16
|
+
import {
|
|
17
|
+
__name
|
|
18
|
+
} from "./chunk-J2S4EL5Y.js";
|
|
19
|
+
|
|
20
|
+
// packages/core/src/omni/policy/config.ts
|
|
21
|
+
init_esbuild_shims();
|
|
22
|
+
|
|
23
|
+
// packages/core/src/omni/recovery.ts
|
|
24
|
+
init_esbuild_shims();
|
|
25
|
+
import { createHash } from "node:crypto";
|
|
26
|
+
import { createReadStream } from "node:fs";
|
|
27
|
+
import fs from "node:fs/promises";
|
|
28
|
+
import path from "node:path";
|
|
29
|
+
import { pipeline } from "node:stream/promises";
|
|
30
|
+
var debugLogger = createDebugLogger("omni:recovery");
|
|
31
|
+
var PART_RETENTION_MS = 48 * 36e5;
|
|
32
|
+
var SAMPLE_VERIFY_LIMIT = 3;
|
|
33
|
+
var SAMPLE_VERIFY_MAX_BYTES = 64 * 1024 * 1024;
|
|
34
|
+
var TMP_GRACE_MS = 36e5;
|
|
35
|
+
var STAGING_GRACE_MS = 36e5;
|
|
36
|
+
var QUARANTINE_RETENTION_DAYS = 7;
|
|
37
|
+
var QUARANTINE_MAX_BYTES = 5 * 1024 * 1024 * 1024;
|
|
38
|
+
var recoveryOnce = /* @__PURE__ */ new Map();
|
|
39
|
+
function resetRecoveryLatchForTests() {
|
|
40
|
+
recoveryOnce.clear();
|
|
41
|
+
}
|
|
42
|
+
__name(resetRecoveryLatchForTests, "resetRecoveryLatchForTests");
|
|
43
|
+
async function isRealDirectory(p) {
|
|
44
|
+
try {
|
|
45
|
+
return (await fs.lstat(p)).isDirectory();
|
|
46
|
+
} catch {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
__name(isRealDirectory, "isRealDirectory");
|
|
51
|
+
async function sweepDownloads(downloadsDir) {
|
|
52
|
+
if (!await isRealDirectory(downloadsDir)) return;
|
|
53
|
+
let names;
|
|
54
|
+
try {
|
|
55
|
+
names = await fs.readdir(downloadsDir);
|
|
56
|
+
} catch {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const cutoff = Date.now() - PART_RETENTION_MS;
|
|
60
|
+
for (const name of names) {
|
|
61
|
+
if (!name.endsWith(".part")) continue;
|
|
62
|
+
const p = path.join(downloadsDir, name);
|
|
63
|
+
try {
|
|
64
|
+
const st = await fs.lstat(p);
|
|
65
|
+
if (!st.isFile()) continue;
|
|
66
|
+
if (st.mtimeMs < cutoff) {
|
|
67
|
+
await fs.rm(p, { force: true });
|
|
68
|
+
debugLogger.debug(`recovery: removed expired download ${name}`);
|
|
69
|
+
}
|
|
70
|
+
} catch {
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
__name(sweepDownloads, "sweepDownloads");
|
|
75
|
+
async function sweepStaging(stagingDir) {
|
|
76
|
+
if (!await isRealDirectory(stagingDir)) return;
|
|
77
|
+
let names;
|
|
78
|
+
try {
|
|
79
|
+
names = await fs.readdir(stagingDir);
|
|
80
|
+
} catch {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
for (const name of names) {
|
|
84
|
+
const p = path.join(stagingDir, name);
|
|
85
|
+
try {
|
|
86
|
+
const st = await fs.lstat(p);
|
|
87
|
+
if (!st.isSymbolicLink() && Date.now() - st.mtimeMs < STAGING_GRACE_MS) {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
await fs.rm(p, { recursive: true, force: true });
|
|
91
|
+
debugLogger.debug(`recovery: removed uncommitted staging ${name}`);
|
|
92
|
+
} catch {
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
__name(sweepStaging, "sweepStaging");
|
|
97
|
+
async function directorySizeBytes(dir) {
|
|
98
|
+
let total = 0;
|
|
99
|
+
let names;
|
|
100
|
+
try {
|
|
101
|
+
names = await fs.readdir(dir);
|
|
102
|
+
} catch {
|
|
103
|
+
return total;
|
|
104
|
+
}
|
|
105
|
+
for (const name of names) {
|
|
106
|
+
const p = path.join(dir, name);
|
|
107
|
+
try {
|
|
108
|
+
const st = await fs.lstat(p);
|
|
109
|
+
if (st.isFile()) {
|
|
110
|
+
total += st.size;
|
|
111
|
+
} else if (st.isDirectory()) {
|
|
112
|
+
total += await directorySizeBytes(p);
|
|
113
|
+
}
|
|
114
|
+
} catch {
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return total;
|
|
118
|
+
}
|
|
119
|
+
__name(directorySizeBytes, "directorySizeBytes");
|
|
120
|
+
async function sweepQuarantine(quarantineDir, retentionMs, maxBytes) {
|
|
121
|
+
if (!await isRealDirectory(quarantineDir)) return;
|
|
122
|
+
let names;
|
|
123
|
+
try {
|
|
124
|
+
names = await fs.readdir(quarantineDir);
|
|
125
|
+
} catch {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const entries = [];
|
|
129
|
+
const cutoff = Date.now() - retentionMs;
|
|
130
|
+
for (const name of names) {
|
|
131
|
+
const p = path.join(quarantineDir, name);
|
|
132
|
+
if (!await isRealDirectory(p)) continue;
|
|
133
|
+
try {
|
|
134
|
+
const st = await fs.lstat(p);
|
|
135
|
+
if (st.mtimeMs < cutoff) {
|
|
136
|
+
await fs.rm(p, { recursive: true, force: true });
|
|
137
|
+
debugLogger.debug(`recovery: removed expired quarantine ${name}`);
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
entries.push({
|
|
141
|
+
name,
|
|
142
|
+
mtimeMs: st.mtimeMs,
|
|
143
|
+
sizeBytes: await directorySizeBytes(p)
|
|
144
|
+
});
|
|
145
|
+
} catch {
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
let total = entries.reduce((sum, e) => sum + e.sizeBytes, 0);
|
|
149
|
+
if (total <= maxBytes) return;
|
|
150
|
+
entries.sort((a, b) => a.mtimeMs - b.mtimeMs);
|
|
151
|
+
for (const entry of entries) {
|
|
152
|
+
if (total <= maxBytes) break;
|
|
153
|
+
try {
|
|
154
|
+
await fs.rm(path.join(quarantineDir, entry.name), {
|
|
155
|
+
recursive: true,
|
|
156
|
+
force: true
|
|
157
|
+
});
|
|
158
|
+
total -= entry.sizeBytes;
|
|
159
|
+
debugLogger.debug(
|
|
160
|
+
`recovery: removed quarantine ${entry.name} (over size budget)`
|
|
161
|
+
);
|
|
162
|
+
} catch {
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
__name(sweepQuarantine, "sweepQuarantine");
|
|
167
|
+
async function sweepTmpFiles(objectsDir) {
|
|
168
|
+
if (!await isRealDirectory(objectsDir)) return;
|
|
169
|
+
let shards;
|
|
170
|
+
try {
|
|
171
|
+
shards = await fs.readdir(objectsDir);
|
|
172
|
+
} catch {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
for (const shard of shards) {
|
|
176
|
+
const shardDir = path.join(objectsDir, shard);
|
|
177
|
+
if (!await isRealDirectory(shardDir)) continue;
|
|
178
|
+
let names;
|
|
179
|
+
try {
|
|
180
|
+
names = await fs.readdir(shardDir);
|
|
181
|
+
} catch {
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
for (const name of names) {
|
|
185
|
+
if (!name.startsWith(".tmp-")) continue;
|
|
186
|
+
const p = path.join(shardDir, name);
|
|
187
|
+
try {
|
|
188
|
+
const st = await fs.lstat(p);
|
|
189
|
+
if (Date.now() - st.mtimeMs < TMP_GRACE_MS) continue;
|
|
190
|
+
await fs.rm(p, { force: true });
|
|
191
|
+
debugLogger.debug(`recovery: removed orphan temp ${shard}/${name}`);
|
|
192
|
+
} catch {
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
__name(sweepTmpFiles, "sweepTmpFiles");
|
|
198
|
+
async function sampleVerifyObjects(objectsDir, uploadCache, degradationCache, limit, maxBytes) {
|
|
199
|
+
const candidates = [];
|
|
200
|
+
if (!await isRealDirectory(objectsDir)) return;
|
|
201
|
+
let shards;
|
|
202
|
+
try {
|
|
203
|
+
shards = await fs.readdir(objectsDir);
|
|
204
|
+
} catch {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
for (const shard of shards) {
|
|
208
|
+
if (!await isRealDirectory(path.join(objectsDir, shard))) continue;
|
|
209
|
+
let names = [];
|
|
210
|
+
try {
|
|
211
|
+
names = await fs.readdir(path.join(objectsDir, shard));
|
|
212
|
+
} catch {
|
|
213
|
+
continue;
|
|
214
|
+
}
|
|
215
|
+
for (const name of names) {
|
|
216
|
+
if (!name.startsWith(".")) candidates.push(path.join(shard, name));
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
if (candidates.length === 0 || limit <= 0) return;
|
|
220
|
+
candidates.sort();
|
|
221
|
+
const n = candidates.length;
|
|
222
|
+
const stride = Math.max(1, Math.floor(n / limit));
|
|
223
|
+
const seed = Math.floor(Date.now() / 864e5) % n;
|
|
224
|
+
const picked = /* @__PURE__ */ new Set();
|
|
225
|
+
for (let k = 0; k < limit && picked.size < n; k++) {
|
|
226
|
+
picked.add((seed + k * stride) % n);
|
|
227
|
+
}
|
|
228
|
+
for (const i of picked) {
|
|
229
|
+
const rel = candidates[i];
|
|
230
|
+
const full = path.join(objectsDir, rel);
|
|
231
|
+
const expected = path.basename(rel).split(".")[0];
|
|
232
|
+
try {
|
|
233
|
+
const st = await fs.lstat(full);
|
|
234
|
+
if (!st.isFile()) continue;
|
|
235
|
+
if (st.size > maxBytes) continue;
|
|
236
|
+
const hash = createHash("sha256");
|
|
237
|
+
await pipeline(createReadStream(full), hash);
|
|
238
|
+
if (hash.digest("hex") !== expected) {
|
|
239
|
+
await fs.rm(full, { force: true });
|
|
240
|
+
await uploadCache?.removeBySha256(expected);
|
|
241
|
+
await degradationCache?.removeByOriginalSha256(expected);
|
|
242
|
+
await degradationCache?.removeByDegradedSha256(expected);
|
|
243
|
+
debugLogger.debug(
|
|
244
|
+
`recovery: removed corrupt object ${rel} (hash mismatch)`
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
} catch {
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
__name(sampleVerifyObjects, "sampleVerifyObjects");
|
|
252
|
+
function runStartupRecoveryOnce(store, uploadCache, options) {
|
|
253
|
+
let root;
|
|
254
|
+
try {
|
|
255
|
+
root = store.getOmniRootDir();
|
|
256
|
+
} catch (err) {
|
|
257
|
+
debugLogger.debug(
|
|
258
|
+
`recovery scan failed (ignored): ${err instanceof Error ? err.message : err}`
|
|
259
|
+
);
|
|
260
|
+
return Promise.resolve();
|
|
261
|
+
}
|
|
262
|
+
let scan = recoveryOnce.get(root);
|
|
263
|
+
if (!scan) {
|
|
264
|
+
scan = (async () => {
|
|
265
|
+
if (!await isRealDirectory(root)) return;
|
|
266
|
+
await sweepStaging(path.join(root, "staging"));
|
|
267
|
+
await sweepDownloads(path.join(root, "downloads"));
|
|
268
|
+
await sweepQuarantine(
|
|
269
|
+
path.join(root, "quarantine"),
|
|
270
|
+
(options?.quarantineRetentionDays ?? QUARANTINE_RETENTION_DAYS) * 864e5,
|
|
271
|
+
options?.quarantineMaxBytes ?? QUARANTINE_MAX_BYTES
|
|
272
|
+
);
|
|
273
|
+
if (!await isRealDirectory(path.join(root, "objects"))) return;
|
|
274
|
+
await sweepTmpFiles(store.getObjectsDir());
|
|
275
|
+
await sampleVerifyObjects(
|
|
276
|
+
store.getObjectsDir(),
|
|
277
|
+
uploadCache,
|
|
278
|
+
options?.degradationCache,
|
|
279
|
+
options?.sampleVerifyLimit ?? SAMPLE_VERIFY_LIMIT,
|
|
280
|
+
options?.sampleVerifyMaxBytes ?? SAMPLE_VERIFY_MAX_BYTES
|
|
281
|
+
);
|
|
282
|
+
})().catch((err) => {
|
|
283
|
+
debugLogger.debug(
|
|
284
|
+
`recovery scan failed (ignored): ${err instanceof Error ? err.message : err}`
|
|
285
|
+
);
|
|
286
|
+
});
|
|
287
|
+
recoveryOnce.set(root, scan);
|
|
288
|
+
}
|
|
289
|
+
return scan;
|
|
290
|
+
}
|
|
291
|
+
__name(runStartupRecoveryOnce, "runStartupRecoveryOnce");
|
|
292
|
+
|
|
293
|
+
// packages/core/src/omni/policy/conditions.ts
|
|
294
|
+
init_esbuild_shims();
|
|
295
|
+
var RESOURCE_CONDITION_FIELDS = [
|
|
296
|
+
"sizeBytes",
|
|
297
|
+
"durationMs",
|
|
298
|
+
"width",
|
|
299
|
+
"height",
|
|
300
|
+
"maxWidth",
|
|
301
|
+
"maxHeight",
|
|
302
|
+
"frameRate",
|
|
303
|
+
"frameCount",
|
|
304
|
+
"bitRate",
|
|
305
|
+
"sampleRateHz",
|
|
306
|
+
"channels",
|
|
307
|
+
"estimatedTokenCount"
|
|
308
|
+
];
|
|
309
|
+
var REQUEST_CONDITION_FIELDS = ["totalEstimatedMediaTokens"];
|
|
310
|
+
var SESSION_CONDITION_FIELDS = [
|
|
311
|
+
"contextWindowTokens",
|
|
312
|
+
"promptTokenCount",
|
|
313
|
+
"reservedOutputTokens",
|
|
314
|
+
"availableContextTokens"
|
|
315
|
+
];
|
|
316
|
+
var MEMORY_CONDITION_FIELDS = [
|
|
317
|
+
"hasTranscript",
|
|
318
|
+
"hasOcr",
|
|
319
|
+
"hasCaption",
|
|
320
|
+
"hasSummary",
|
|
321
|
+
"hasKeyframes",
|
|
322
|
+
"hasClip"
|
|
323
|
+
];
|
|
324
|
+
var MATCH = { outcome: "match" };
|
|
325
|
+
var NO_MATCH = { outcome: "no_match" };
|
|
326
|
+
function unavailable(missingFields) {
|
|
327
|
+
return { outcome: "unavailable", missingFields: [...new Set(missingFields)] };
|
|
328
|
+
}
|
|
329
|
+
__name(unavailable, "unavailable");
|
|
330
|
+
function isPlainObject(v) {
|
|
331
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
332
|
+
}
|
|
333
|
+
__name(isPlainObject, "isPlainObject");
|
|
334
|
+
var COMPARISON_OPERATORS = [
|
|
335
|
+
">",
|
|
336
|
+
">=",
|
|
337
|
+
"<",
|
|
338
|
+
"<=",
|
|
339
|
+
"==",
|
|
340
|
+
"!="
|
|
341
|
+
];
|
|
342
|
+
function isComparisonOperator(v) {
|
|
343
|
+
return COMPARISON_OPERATORS.includes(v);
|
|
344
|
+
}
|
|
345
|
+
__name(isComparisonOperator, "isComparisonOperator");
|
|
346
|
+
var KNOWN_FIELDS = /* @__PURE__ */ new Set([
|
|
347
|
+
...RESOURCE_CONDITION_FIELDS.map((f) => `resource.${f}`),
|
|
348
|
+
...REQUEST_CONDITION_FIELDS.map((f) => `request.${f}`),
|
|
349
|
+
...SESSION_CONDITION_FIELDS.map((f) => `session.${f}`),
|
|
350
|
+
...MEMORY_CONDITION_FIELDS.map((f) => `memory.${f}`)
|
|
351
|
+
]);
|
|
352
|
+
function conditionUsesNamespace(condition, namespace) {
|
|
353
|
+
const node = condition;
|
|
354
|
+
if (!Array.isArray(node)) return false;
|
|
355
|
+
const prefix = `${namespace}.`;
|
|
356
|
+
for (const operand of node) {
|
|
357
|
+
if (!Array.isArray(operand)) continue;
|
|
358
|
+
if (operand.length === 2 && operand[0] === "field" && typeof operand[1] === "string") {
|
|
359
|
+
if (operand[1].startsWith(prefix)) return true;
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
if (conditionUsesNamespace(operand, namespace)) {
|
|
363
|
+
return true;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return false;
|
|
367
|
+
}
|
|
368
|
+
__name(conditionUsesNamespace, "conditionUsesNamespace");
|
|
369
|
+
function resolveOperand(operand, context) {
|
|
370
|
+
if (Array.isArray(operand)) {
|
|
371
|
+
if (operand.length !== 2 || operand[0] !== "field" || typeof operand[1] !== "string") {
|
|
372
|
+
return { ok: false, missing: "<malformed operand>" };
|
|
373
|
+
}
|
|
374
|
+
const field = operand[1];
|
|
375
|
+
if (!KNOWN_FIELDS.has(field)) {
|
|
376
|
+
return { ok: false, missing: field };
|
|
377
|
+
}
|
|
378
|
+
const [namespace, name] = field.split(".");
|
|
379
|
+
const value = context[namespace]?.[name];
|
|
380
|
+
if (typeof value !== "number" || Number.isNaN(value)) {
|
|
381
|
+
return { ok: false, missing: field };
|
|
382
|
+
}
|
|
383
|
+
return { ok: true, value, describe: field };
|
|
384
|
+
}
|
|
385
|
+
if (typeof operand === "number" || typeof operand === "string" || typeof operand === "boolean") {
|
|
386
|
+
return { ok: true, value: operand, describe: "value" };
|
|
387
|
+
}
|
|
388
|
+
return { ok: false, missing: "<malformed operand>" };
|
|
389
|
+
}
|
|
390
|
+
__name(resolveOperand, "resolveOperand");
|
|
391
|
+
function evaluateComparison(operator, leftRaw, rightRaw, context) {
|
|
392
|
+
const left = resolveOperand(leftRaw, context);
|
|
393
|
+
const right = resolveOperand(rightRaw, context);
|
|
394
|
+
if (!left.ok || !right.ok) {
|
|
395
|
+
const missing = [];
|
|
396
|
+
if (!left.ok) missing.push(left.missing);
|
|
397
|
+
if (!right.ok) missing.push(right.missing);
|
|
398
|
+
return unavailable(missing);
|
|
399
|
+
}
|
|
400
|
+
if (operator === "==" || operator === "!=") {
|
|
401
|
+
const equal = left.value === right.value;
|
|
402
|
+
return equal === (operator === "==") ? MATCH : NO_MATCH;
|
|
403
|
+
}
|
|
404
|
+
if (typeof left.value !== "number" || typeof right.value !== "number" || !Number.isFinite(left.value) || !Number.isFinite(right.value)) {
|
|
405
|
+
const missing = [];
|
|
406
|
+
if (typeof left.value !== "number" || !Number.isFinite(left.value)) {
|
|
407
|
+
missing.push(`${left.describe} (not orderable)`);
|
|
408
|
+
}
|
|
409
|
+
if (typeof right.value !== "number" || !Number.isFinite(right.value)) {
|
|
410
|
+
missing.push(`${right.describe} (not orderable)`);
|
|
411
|
+
}
|
|
412
|
+
return unavailable(missing);
|
|
413
|
+
}
|
|
414
|
+
switch (operator) {
|
|
415
|
+
case ">":
|
|
416
|
+
return left.value > right.value ? MATCH : NO_MATCH;
|
|
417
|
+
case ">=":
|
|
418
|
+
return left.value >= right.value ? MATCH : NO_MATCH;
|
|
419
|
+
case "<":
|
|
420
|
+
return left.value < right.value ? MATCH : NO_MATCH;
|
|
421
|
+
case "<=":
|
|
422
|
+
return left.value <= right.value ? MATCH : NO_MATCH;
|
|
423
|
+
default: {
|
|
424
|
+
const exhaustive = operator;
|
|
425
|
+
return unavailable([`unknown operator ${String(exhaustive)}`]);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
__name(evaluateComparison, "evaluateComparison");
|
|
430
|
+
function evaluateFixedPolicyCondition(condition, context) {
|
|
431
|
+
const node = condition;
|
|
432
|
+
if (!Array.isArray(node) || node.length === 0) {
|
|
433
|
+
return unavailable(["<malformed condition>"]);
|
|
434
|
+
}
|
|
435
|
+
const head = node[0];
|
|
436
|
+
if (head === "all" || head === "any") {
|
|
437
|
+
const isAll = head === "all";
|
|
438
|
+
const missing = [];
|
|
439
|
+
let sawUnavailable = false;
|
|
440
|
+
for (let i = 1; i < node.length; i++) {
|
|
441
|
+
const result = evaluateFixedPolicyCondition(
|
|
442
|
+
node[i],
|
|
443
|
+
context
|
|
444
|
+
);
|
|
445
|
+
if (result.outcome === "unavailable") {
|
|
446
|
+
sawUnavailable = true;
|
|
447
|
+
missing.push(...result.missingFields);
|
|
448
|
+
continue;
|
|
449
|
+
}
|
|
450
|
+
if (isAll && result.outcome === "no_match") return NO_MATCH;
|
|
451
|
+
if (!isAll && result.outcome === "match") return MATCH;
|
|
452
|
+
}
|
|
453
|
+
if (sawUnavailable) return unavailable(missing);
|
|
454
|
+
return isAll ? MATCH : NO_MATCH;
|
|
455
|
+
}
|
|
456
|
+
if (head === "!") {
|
|
457
|
+
if (node.length !== 2) {
|
|
458
|
+
return unavailable(["<malformed condition>"]);
|
|
459
|
+
}
|
|
460
|
+
const result = evaluateFixedPolicyCondition(
|
|
461
|
+
node[1],
|
|
462
|
+
context
|
|
463
|
+
);
|
|
464
|
+
if (result.outcome === "unavailable") return result;
|
|
465
|
+
return result.outcome === "match" ? NO_MATCH : MATCH;
|
|
466
|
+
}
|
|
467
|
+
if (isComparisonOperator(head) && node.length === 3) {
|
|
468
|
+
return evaluateComparison(head, node[1], node[2], context);
|
|
469
|
+
}
|
|
470
|
+
return unavailable(["<malformed condition>"]);
|
|
471
|
+
}
|
|
472
|
+
__name(evaluateFixedPolicyCondition, "evaluateFixedPolicyCondition");
|
|
473
|
+
function validateOperand(raw, operator, where, errors) {
|
|
474
|
+
if (Array.isArray(raw)) {
|
|
475
|
+
if (raw.length !== 2 || raw[0] !== "field") {
|
|
476
|
+
errors.push(
|
|
477
|
+
`${where}: field reference must be ["field", "<namespace.field>"]`
|
|
478
|
+
);
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
if (typeof raw[1] !== "string" || !KNOWN_FIELDS.has(raw[1])) {
|
|
482
|
+
errors.push(`${where}: unknown field ${JSON.stringify(raw[1])}`);
|
|
483
|
+
}
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
if (typeof raw !== "number" && typeof raw !== "string" && typeof raw !== "boolean") {
|
|
487
|
+
errors.push(`${where}: literal must be a number, string, or boolean`);
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
if (operator !== "==" && operator !== "!=") {
|
|
491
|
+
if (typeof raw !== "number" || !Number.isFinite(raw)) {
|
|
492
|
+
errors.push(
|
|
493
|
+
`${where}: operator "${operator}" requires a finite numeric literal`
|
|
494
|
+
);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
__name(validateOperand, "validateOperand");
|
|
499
|
+
function validateFixedPolicyCondition(raw, where = "when") {
|
|
500
|
+
const errors = [];
|
|
501
|
+
if (isPlainObject(raw)) {
|
|
502
|
+
errors.push(
|
|
503
|
+
`${where}: condition must be an expression array like [">", ["field", "resource.width"], 3000] or ["all", <expr>, ...] (the {left, operator, right} object form is no longer supported)`
|
|
504
|
+
);
|
|
505
|
+
return errors;
|
|
506
|
+
}
|
|
507
|
+
if (!Array.isArray(raw) || raw.length === 0 || typeof raw[0] !== "string") {
|
|
508
|
+
errors.push(
|
|
509
|
+
`${where}: condition must be an expression array [operator, ...operands]`
|
|
510
|
+
);
|
|
511
|
+
return errors;
|
|
512
|
+
}
|
|
513
|
+
const head = raw[0];
|
|
514
|
+
if (head === "all" || head === "any") {
|
|
515
|
+
if (raw.length < 2) {
|
|
516
|
+
errors.push(
|
|
517
|
+
`${where}: "${head}" requires at least one operand condition`
|
|
518
|
+
);
|
|
519
|
+
return errors;
|
|
520
|
+
}
|
|
521
|
+
for (let i = 1; i < raw.length; i++) {
|
|
522
|
+
errors.push(...validateFixedPolicyCondition(raw[i], `${where}[${i}]`));
|
|
523
|
+
}
|
|
524
|
+
return errors;
|
|
525
|
+
}
|
|
526
|
+
if (head === "!") {
|
|
527
|
+
if (raw.length !== 2) {
|
|
528
|
+
errors.push(`${where}: "!" takes exactly one operand condition`);
|
|
529
|
+
return errors;
|
|
530
|
+
}
|
|
531
|
+
errors.push(...validateFixedPolicyCondition(raw[1], `${where}[1]`));
|
|
532
|
+
return errors;
|
|
533
|
+
}
|
|
534
|
+
if (!isComparisonOperator(head)) {
|
|
535
|
+
errors.push(
|
|
536
|
+
`${where}[0]: unknown operator ${JSON.stringify(head)} (expected one of ${COMPARISON_OPERATORS.join(", ")}, all, any, !)`
|
|
537
|
+
);
|
|
538
|
+
return errors;
|
|
539
|
+
}
|
|
540
|
+
if (raw.length !== 3) {
|
|
541
|
+
errors.push(`${where}: comparison "${head}" takes exactly two operands`);
|
|
542
|
+
return errors;
|
|
543
|
+
}
|
|
544
|
+
validateOperand(raw[1], head, `${where}[1]`, errors);
|
|
545
|
+
validateOperand(raw[2], head, `${where}[2]`, errors);
|
|
546
|
+
return errors;
|
|
547
|
+
}
|
|
548
|
+
__name(validateFixedPolicyCondition, "validateFixedPolicyCondition");
|
|
549
|
+
|
|
550
|
+
// packages/core/src/omni/policy/config.ts
|
|
551
|
+
var OmniPolicyConfigError = class extends Error {
|
|
552
|
+
static {
|
|
553
|
+
__name(this, "OmniPolicyConfigError");
|
|
554
|
+
}
|
|
555
|
+
constructor(message) {
|
|
556
|
+
super(message);
|
|
557
|
+
this.name = "OmniPolicyConfigError";
|
|
558
|
+
}
|
|
559
|
+
};
|
|
560
|
+
var DEFAULT_OMNI_PROCESSING_LIMITS = {
|
|
561
|
+
maxConcurrentResources: 1,
|
|
562
|
+
reservedOutputTokens: 8192,
|
|
563
|
+
maxLineageDepth: 8,
|
|
564
|
+
maxPolicyRunsPerRoot: 64,
|
|
565
|
+
maxArtifactsPerRoot: 256,
|
|
566
|
+
maxDerivedBytesPerRoot: 1024 * 1024 * 1024,
|
|
567
|
+
maxTransportPasses: 3
|
|
568
|
+
};
|
|
569
|
+
var GIB = 1024 * 1024 * 1024;
|
|
570
|
+
var MAX_UPLOAD_FILE_BYTES_CEILING = GIB;
|
|
571
|
+
var MAX_URL_TTL_HOURS = 48;
|
|
572
|
+
var POLICY_ENTRY_KEYS = /* @__PURE__ */ new Set([
|
|
573
|
+
"priority",
|
|
574
|
+
"mediaTypes",
|
|
575
|
+
"origins",
|
|
576
|
+
"when",
|
|
577
|
+
"onConditionUnavailable",
|
|
578
|
+
"toolName",
|
|
579
|
+
"arguments",
|
|
580
|
+
"maxRunsPerLineage",
|
|
581
|
+
"onFailure",
|
|
582
|
+
"output",
|
|
583
|
+
"description"
|
|
584
|
+
]);
|
|
585
|
+
var MAX_POLICY_DESCRIPTION_CHARS = 600;
|
|
586
|
+
var OUTPUT_KEYS = /* @__PURE__ */ new Set(["reprocessMedia", "source", "artifacts"]);
|
|
587
|
+
var ARTIFACT_SELECTOR_KINDS = /* @__PURE__ */ new Set(["image", "video", "audio", "file"]);
|
|
588
|
+
var MODALITIES = ["image", "video", "audio"];
|
|
589
|
+
var ORIGINS = ["user", "tool", "policy"];
|
|
590
|
+
var RESERVED_ARGUMENT_KEYS = ["inputPath", "outputDir", "resourceId"];
|
|
591
|
+
var POLICY_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
592
|
+
function systemDefaultTransportGuardPolicies() {
|
|
593
|
+
return {
|
|
594
|
+
"image-downsample": {
|
|
595
|
+
mediaTypes: ["image"],
|
|
596
|
+
toolName: ToolNames.OMNI_DOWNSAMPLE_IMAGE
|
|
597
|
+
},
|
|
598
|
+
"video-downscale": {
|
|
599
|
+
mediaTypes: ["video"],
|
|
600
|
+
toolName: ToolNames.OMNI_DOWNSCALE_VIDEO
|
|
601
|
+
},
|
|
602
|
+
"audio-downsample": {
|
|
603
|
+
mediaTypes: ["audio"],
|
|
604
|
+
toolName: ToolNames.OMNI_DOWNSAMPLE_AUDIO
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
__name(systemDefaultTransportGuardPolicies, "systemDefaultTransportGuardPolicies");
|
|
609
|
+
function fail(message) {
|
|
610
|
+
throw new OmniPolicyConfigError(message);
|
|
611
|
+
}
|
|
612
|
+
__name(fail, "fail");
|
|
613
|
+
function rejectUnknownKeys(record, where, known) {
|
|
614
|
+
for (const key of Object.keys(record)) {
|
|
615
|
+
if (!known.includes(key)) {
|
|
616
|
+
fail(`${where}: unknown key "${key}"`);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
__name(rejectUnknownKeys, "rejectUnknownKeys");
|
|
621
|
+
function requirePositiveInteger(value, where, { allowZero = false } = {}) {
|
|
622
|
+
if (typeof value !== "number" || !Number.isInteger(value) || (allowZero ? value < 0 : value <= 0)) {
|
|
623
|
+
fail(
|
|
624
|
+
`${where}: must be ${allowZero ? "a non-negative" : "a positive"} integer (got ${JSON.stringify(value)})`
|
|
625
|
+
);
|
|
626
|
+
}
|
|
627
|
+
return value;
|
|
628
|
+
}
|
|
629
|
+
__name(requirePositiveInteger, "requirePositiveInteger");
|
|
630
|
+
function mergePolicyMaps(defaults, raw, where, { allowTombstones }) {
|
|
631
|
+
const merged = Object.assign(
|
|
632
|
+
/* @__PURE__ */ Object.create(null),
|
|
633
|
+
defaults
|
|
634
|
+
);
|
|
635
|
+
if (raw === void 0) {
|
|
636
|
+
return merged;
|
|
637
|
+
}
|
|
638
|
+
if (!isPlainRecord(raw)) {
|
|
639
|
+
fail(`${where}: must be an object map of policy id \u2192 policy`);
|
|
640
|
+
}
|
|
641
|
+
for (const [id, entry] of Object.entries(raw)) {
|
|
642
|
+
if (entry === null) {
|
|
643
|
+
if (!allowTombstones) {
|
|
644
|
+
fail(
|
|
645
|
+
`${where}.${id}: transport guard policies cannot be removed (the guard is mandatory); override the entry instead`
|
|
646
|
+
);
|
|
647
|
+
}
|
|
648
|
+
delete merged[id];
|
|
649
|
+
continue;
|
|
650
|
+
}
|
|
651
|
+
if (!isPlainRecord(entry)) {
|
|
652
|
+
fail(`${where}.${id}: must be an object (or null to remove a default)`);
|
|
653
|
+
}
|
|
654
|
+
merged[id] = entry;
|
|
655
|
+
}
|
|
656
|
+
return merged;
|
|
657
|
+
}
|
|
658
|
+
__name(mergePolicyMaps, "mergePolicyMaps");
|
|
659
|
+
function normalizePolicy(id, entry, stage, where, tools) {
|
|
660
|
+
if (!POLICY_ID_PATTERN.test(id)) {
|
|
661
|
+
fail(
|
|
662
|
+
`${where}.${id}: policy id must match ${POLICY_ID_PATTERN} (letters, digits, ".", "_", "-")`
|
|
663
|
+
);
|
|
664
|
+
}
|
|
665
|
+
for (const key of Object.keys(entry)) {
|
|
666
|
+
if (!POLICY_ENTRY_KEYS.has(key)) {
|
|
667
|
+
fail(`${where}.${id}: unknown key "${key}"`);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
let description;
|
|
671
|
+
if (entry["description"] !== void 0) {
|
|
672
|
+
if (typeof entry["description"] !== "string") {
|
|
673
|
+
fail(`${where}.${id}.description: must be a string`);
|
|
674
|
+
}
|
|
675
|
+
const trimmed = entry["description"].trim();
|
|
676
|
+
if (trimmed.length > MAX_POLICY_DESCRIPTION_CHARS) {
|
|
677
|
+
fail(
|
|
678
|
+
`${where}.${id}.description: must be \u2264 ${MAX_POLICY_DESCRIPTION_CHARS} characters (got ${trimmed.length})`
|
|
679
|
+
);
|
|
680
|
+
}
|
|
681
|
+
if (trimmed.length > 0) description = trimmed;
|
|
682
|
+
}
|
|
683
|
+
const priority = entry["priority"] === void 0 ? 0 : typeof entry["priority"] === "number" && Number.isFinite(entry["priority"]) ? entry["priority"] : fail(`${where}.${id}.priority: must be a finite number`);
|
|
684
|
+
const rawMediaTypes = entry["mediaTypes"];
|
|
685
|
+
if (!Array.isArray(rawMediaTypes) || rawMediaTypes.length === 0) {
|
|
686
|
+
fail(`${where}.${id}.mediaTypes: must be a non-empty array`);
|
|
687
|
+
}
|
|
688
|
+
for (const m of rawMediaTypes) {
|
|
689
|
+
if (!MODALITIES.includes(m)) {
|
|
690
|
+
fail(
|
|
691
|
+
`${where}.${id}.mediaTypes: unknown modality ${JSON.stringify(m)} (expected ${MODALITIES.join(", ")})`
|
|
692
|
+
);
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
const mediaTypes = [...new Set(rawMediaTypes)];
|
|
696
|
+
const rawOrigins = entry["origins"] ?? ["user", "tool"];
|
|
697
|
+
if (!Array.isArray(rawOrigins) || rawOrigins.length === 0) {
|
|
698
|
+
fail(`${where}.${id}.origins: must be a non-empty array`);
|
|
699
|
+
}
|
|
700
|
+
for (const o of rawOrigins) {
|
|
701
|
+
if (!ORIGINS.includes(o)) {
|
|
702
|
+
fail(
|
|
703
|
+
`${where}.${id}.origins: unknown origin ${JSON.stringify(o)} (expected ${ORIGINS.join(", ")})`
|
|
704
|
+
);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
const origins = [...new Set(rawOrigins)];
|
|
708
|
+
const onConditionUnavailable = entry["onConditionUnavailable"] ?? "skip";
|
|
709
|
+
if (onConditionUnavailable === "abortTurn") {
|
|
710
|
+
fail(
|
|
711
|
+
`${where}.${id}.onConditionUnavailable: "abortTurn" is not yet supported (design reserves it for a later stage); use "skip" or "run"`
|
|
712
|
+
);
|
|
713
|
+
}
|
|
714
|
+
if (onConditionUnavailable !== "skip" && onConditionUnavailable !== "run") {
|
|
715
|
+
fail(
|
|
716
|
+
`${where}.${id}.onConditionUnavailable: must be "skip" or "run" (got ${JSON.stringify(onConditionUnavailable)})`
|
|
717
|
+
);
|
|
718
|
+
}
|
|
719
|
+
const onFailure = entry["onFailure"] ?? "continue";
|
|
720
|
+
if (onFailure !== "continue" && onFailure !== "abort") {
|
|
721
|
+
fail(
|
|
722
|
+
`${where}.${id}.onFailure: must be "continue" or "abort" (got ${JSON.stringify(onFailure)})`
|
|
723
|
+
);
|
|
724
|
+
}
|
|
725
|
+
const maxRunsPerLineage = entry["maxRunsPerLineage"] === void 0 ? 1 : requirePositiveInteger(
|
|
726
|
+
entry["maxRunsPerLineage"],
|
|
727
|
+
`${where}.${id}.maxRunsPerLineage`
|
|
728
|
+
);
|
|
729
|
+
const rawOutput = entry["output"] ?? {};
|
|
730
|
+
if (!isPlainRecord(rawOutput)) {
|
|
731
|
+
fail(`${where}.${id}.output: must be an object`);
|
|
732
|
+
}
|
|
733
|
+
for (const key of Object.keys(rawOutput)) {
|
|
734
|
+
if (!OUTPUT_KEYS.has(key)) {
|
|
735
|
+
fail(`${where}.${id}.output: unknown key "${key}"`);
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
const reprocessMedia = rawOutput["reprocessMedia"] ?? false;
|
|
739
|
+
if (typeof reprocessMedia !== "boolean") {
|
|
740
|
+
fail(`${where}.${id}.output.reprocessMedia: must be a boolean`);
|
|
741
|
+
}
|
|
742
|
+
const source = rawOutput["source"] ?? "omit";
|
|
743
|
+
if (source !== "keep" && source !== "omit") {
|
|
744
|
+
fail(
|
|
745
|
+
`${where}.${id}.output.source: must be "keep" or "omit" (got ${JSON.stringify(source)})`
|
|
746
|
+
);
|
|
747
|
+
}
|
|
748
|
+
if (stage === "transport_guard" && source !== "omit") {
|
|
749
|
+
fail(
|
|
750
|
+
`${where}.${id}.output.source: transport guard policies must use "omit" (the over-limit source cannot stay in the delivery set)`
|
|
751
|
+
);
|
|
752
|
+
}
|
|
753
|
+
const rawArtifacts = rawOutput["artifacts"];
|
|
754
|
+
let artifacts;
|
|
755
|
+
if (rawArtifacts === void 0) {
|
|
756
|
+
artifacts = { "*": "include" };
|
|
757
|
+
} else {
|
|
758
|
+
if (!isPlainRecord(rawArtifacts)) {
|
|
759
|
+
fail(`${where}.${id}.output.artifacts: must be an object`);
|
|
760
|
+
}
|
|
761
|
+
artifacts = {};
|
|
762
|
+
for (const [selector, action] of Object.entries(rawArtifacts)) {
|
|
763
|
+
const at = `${where}.${id}.output.artifacts["${selector}"]`;
|
|
764
|
+
if (action !== "include" && action !== "retain") {
|
|
765
|
+
fail(
|
|
766
|
+
`${at}: must be "include" or "retain" (got ${JSON.stringify(action)})`
|
|
767
|
+
);
|
|
768
|
+
}
|
|
769
|
+
if (selector === "*") {
|
|
770
|
+
} else if (selector.startsWith("kind:")) {
|
|
771
|
+
const kind = selector.slice("kind:".length);
|
|
772
|
+
if (!ARTIFACT_SELECTOR_KINDS.has(kind)) {
|
|
773
|
+
fail(
|
|
774
|
+
`${at}: unknown artifact kind "${kind}" (expected one of ${[...ARTIFACT_SELECTOR_KINDS].join(", ")})`
|
|
775
|
+
);
|
|
776
|
+
}
|
|
777
|
+
} else if (selector.startsWith("role:")) {
|
|
778
|
+
const role = selector.slice("role:".length);
|
|
779
|
+
if (!POLICY_ID_PATTERN.test(role)) {
|
|
780
|
+
fail(`${at}: invalid role token ${JSON.stringify(role)}`);
|
|
781
|
+
}
|
|
782
|
+
} else {
|
|
783
|
+
fail(
|
|
784
|
+
`${at}: unknown selector (expected "*", "kind:<kind>", or "role:<role>")`
|
|
785
|
+
);
|
|
786
|
+
}
|
|
787
|
+
artifacts[selector] = action;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
let when;
|
|
791
|
+
if (entry["when"] !== void 0) {
|
|
792
|
+
if (stage === "transport_guard") {
|
|
793
|
+
fail(
|
|
794
|
+
`${where}.${id}.when: transport guard policies must not declare "when" (they run exactly when transport limits are exceeded)`
|
|
795
|
+
);
|
|
796
|
+
}
|
|
797
|
+
const errors = validateFixedPolicyCondition(
|
|
798
|
+
entry["when"],
|
|
799
|
+
`${where}.${id}.when`
|
|
800
|
+
);
|
|
801
|
+
if (errors.length > 0) {
|
|
802
|
+
fail(errors.join("; "));
|
|
803
|
+
}
|
|
804
|
+
when = entry["when"];
|
|
805
|
+
}
|
|
806
|
+
const toolName = entry["toolName"];
|
|
807
|
+
if (typeof toolName !== "string" || toolName.length === 0) {
|
|
808
|
+
fail(`${where}.${id}.toolName: must be a non-empty string`);
|
|
809
|
+
}
|
|
810
|
+
const tool = tools.getTool(toolName);
|
|
811
|
+
if (!tool) {
|
|
812
|
+
fail(
|
|
813
|
+
`${where}.${id}.toolName: tool "${toolName}" is not registered (unknown name, or excluded by tool filtering)`
|
|
814
|
+
);
|
|
815
|
+
}
|
|
816
|
+
const descriptor = tool.mediaPolicyDescriptor;
|
|
817
|
+
if (!descriptor || descriptor.kind !== "media_policy") {
|
|
818
|
+
fail(
|
|
819
|
+
`${where}.${id}.toolName: tool "${toolName}" is not a media policy tool (no media_policy descriptor)`
|
|
820
|
+
);
|
|
821
|
+
}
|
|
822
|
+
if (!descriptor.outputs.some((o) => o.required)) {
|
|
823
|
+
fail(
|
|
824
|
+
`${where}.${id}.toolName: tool "${toolName}" declares no required output; a fixed policy cannot rely on it producing anything`
|
|
825
|
+
);
|
|
826
|
+
}
|
|
827
|
+
const hasLossyMedia = descriptor.outputs.some(
|
|
828
|
+
(o) => o.kind === "media" && o.lossy
|
|
829
|
+
);
|
|
830
|
+
const hasDisclosure = descriptor.outputs.some(
|
|
831
|
+
(o) => o.kind === "text" && o.role === "disclosure"
|
|
832
|
+
);
|
|
833
|
+
if (hasLossyMedia && !hasDisclosure) {
|
|
834
|
+
fail(
|
|
835
|
+
`${where}.${id}.toolName: tool "${toolName}" declares a lossy media output but no disclosure text output`
|
|
836
|
+
);
|
|
837
|
+
}
|
|
838
|
+
for (const m of mediaTypes) {
|
|
839
|
+
if (!descriptor.inputMediaTypes.includes(m)) {
|
|
840
|
+
fail(
|
|
841
|
+
`${where}.${id}.mediaTypes: tool "${toolName}" does not accept "${m}" input (accepts ${descriptor.inputMediaTypes.join(", ")})`
|
|
842
|
+
);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
{
|
|
846
|
+
const producibleKinds = /* @__PURE__ */ new Set();
|
|
847
|
+
const producibleRoleSpecs = /* @__PURE__ */ new Map();
|
|
848
|
+
for (const o of descriptor.outputs) {
|
|
849
|
+
if (o.kind === "media") {
|
|
850
|
+
for (const mimeType of o.mimeTypes ?? []) {
|
|
851
|
+
producibleKinds.add(mimeType.split("/")[0]);
|
|
852
|
+
}
|
|
853
|
+
if (o.role && !producibleRoleSpecs.has(o.role)) {
|
|
854
|
+
producibleRoleSpecs.set(o.role, o);
|
|
855
|
+
}
|
|
856
|
+
} else if (o.kind === "file") {
|
|
857
|
+
producibleKinds.add("file");
|
|
858
|
+
if (o.role && !producibleRoleSpecs.has(o.role)) {
|
|
859
|
+
producibleRoleSpecs.set(o.role, o);
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
for (const selector of Object.keys(artifacts)) {
|
|
864
|
+
const at = `${where}.${id}.output.artifacts["${selector}"]`;
|
|
865
|
+
if (selector === "*") continue;
|
|
866
|
+
if (selector.startsWith("kind:")) {
|
|
867
|
+
const kind = selector.slice("kind:".length);
|
|
868
|
+
if (!producibleKinds.has(kind)) {
|
|
869
|
+
fail(
|
|
870
|
+
`${at}: tool "${toolName}" declares no output of kind "${kind}"`
|
|
871
|
+
);
|
|
872
|
+
}
|
|
873
|
+
continue;
|
|
874
|
+
}
|
|
875
|
+
const role = selector.slice("role:".length);
|
|
876
|
+
const spec = producibleRoleSpecs.get(role);
|
|
877
|
+
if (!spec) {
|
|
878
|
+
fail(
|
|
879
|
+
`${at}: tool "${toolName}" declares no artifact output with role "${role}"`
|
|
880
|
+
);
|
|
881
|
+
}
|
|
882
|
+
if (role === "transcript" && (spec.kind !== "file" || spec.mimeTypes?.length !== 1 || spec.mimeTypes[0] !== "text/plain")) {
|
|
883
|
+
fail(
|
|
884
|
+
`${at}: a transcript selector must point at a bounded UTF-8 text/plain file output, but tool "${toolName}" declares role "transcript" differently`
|
|
885
|
+
);
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
const args = entry["arguments"] ?? {};
|
|
890
|
+
if (!isPlainRecord(args)) {
|
|
891
|
+
fail(`${where}.${id}.arguments: must be an object`);
|
|
892
|
+
}
|
|
893
|
+
for (const reserved of RESERVED_ARGUMENT_KEYS) {
|
|
894
|
+
if (Object.prototype.hasOwnProperty.call(args, reserved)) {
|
|
895
|
+
fail(
|
|
896
|
+
`${where}.${id}.arguments: "${reserved}" is injected by the orchestrator per invocation and must not be configured`
|
|
897
|
+
);
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
if (descriptor.settingsSchema) {
|
|
901
|
+
const schemaError = SchemaValidator.validate(
|
|
902
|
+
descriptor.settingsSchema,
|
|
903
|
+
args
|
|
904
|
+
);
|
|
905
|
+
if (schemaError) {
|
|
906
|
+
fail(`${where}.${id}.arguments: ${schemaError}`);
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
return {
|
|
910
|
+
id,
|
|
911
|
+
priority,
|
|
912
|
+
mediaTypes,
|
|
913
|
+
origins,
|
|
914
|
+
when,
|
|
915
|
+
onConditionUnavailable,
|
|
916
|
+
toolName,
|
|
917
|
+
arguments: args,
|
|
918
|
+
maxRunsPerLineage,
|
|
919
|
+
onFailure,
|
|
920
|
+
output: { reprocessMedia, source, artifacts },
|
|
921
|
+
stage,
|
|
922
|
+
...description !== void 0 ? { description } : {}
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
__name(normalizePolicy, "normalizePolicy");
|
|
926
|
+
function normalizeLimits(raw) {
|
|
927
|
+
if (raw === void 0) {
|
|
928
|
+
return { ...DEFAULT_OMNI_PROCESSING_LIMITS };
|
|
929
|
+
}
|
|
930
|
+
if (!isPlainRecord(raw)) {
|
|
931
|
+
fail("omni.processing.limits: must be an object");
|
|
932
|
+
}
|
|
933
|
+
const limits = { ...DEFAULT_OMNI_PROCESSING_LIMITS };
|
|
934
|
+
for (const [key, value] of Object.entries(raw)) {
|
|
935
|
+
if (!Object.prototype.hasOwnProperty.call(limits, key)) {
|
|
936
|
+
fail(`omni.processing.limits: unknown key "${key}"`);
|
|
937
|
+
}
|
|
938
|
+
limits[key] = requirePositiveInteger(value, `omni.processing.limits.${key}`, {
|
|
939
|
+
// Reserving zero output tokens is odd but not incoherent.
|
|
940
|
+
allowZero: key === "reservedOutputTokens"
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
return limits;
|
|
944
|
+
}
|
|
945
|
+
__name(normalizeLimits, "normalizeLimits");
|
|
946
|
+
function lowerBoundOf(s) {
|
|
947
|
+
let bound;
|
|
948
|
+
if (typeof s["minimum"] === "number") {
|
|
949
|
+
bound = { value: s["minimum"], exclusive: false };
|
|
950
|
+
}
|
|
951
|
+
if (typeof s["exclusiveMinimum"] === "number") {
|
|
952
|
+
const b = { value: s["exclusiveMinimum"], exclusive: true };
|
|
953
|
+
if (!bound || b.value >= bound.value) bound = b;
|
|
954
|
+
}
|
|
955
|
+
return bound;
|
|
956
|
+
}
|
|
957
|
+
__name(lowerBoundOf, "lowerBoundOf");
|
|
958
|
+
function upperBoundOf(s) {
|
|
959
|
+
let bound;
|
|
960
|
+
if (typeof s["maximum"] === "number") {
|
|
961
|
+
bound = { value: s["maximum"], exclusive: false };
|
|
962
|
+
}
|
|
963
|
+
if (typeof s["exclusiveMaximum"] === "number") {
|
|
964
|
+
const b = { value: s["exclusiveMaximum"], exclusive: true };
|
|
965
|
+
if (!bound || b.value <= bound.value) bound = b;
|
|
966
|
+
}
|
|
967
|
+
return bound;
|
|
968
|
+
}
|
|
969
|
+
__name(upperBoundOf, "upperBoundOf");
|
|
970
|
+
function findProjectionLoosening(native, override) {
|
|
971
|
+
const merged = { ...native, ...override };
|
|
972
|
+
if (typeof native["type"] === "string" && merged["type"] !== native["type"]) {
|
|
973
|
+
if (!(native["type"] === "number" && merged["type"] === "integer")) {
|
|
974
|
+
return `"type" changes the native type (${JSON.stringify(merged["type"])} vs native "${native["type"]}")`;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
if (Array.isArray(native["enum"])) {
|
|
978
|
+
if (!Array.isArray(merged["enum"])) {
|
|
979
|
+
return '"enum" replaces the native enum with a non-array';
|
|
980
|
+
}
|
|
981
|
+
const allowed = new Set(native["enum"].map((v) => JSON.stringify(v)));
|
|
982
|
+
const added = merged["enum"].filter((v) => !allowed.has(JSON.stringify(v)));
|
|
983
|
+
if (added.length > 0) {
|
|
984
|
+
return `"enum" adds values the native enum does not allow (${added.map((v) => JSON.stringify(v)).join(", ")})`;
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
const nativeLower = lowerBoundOf(native);
|
|
988
|
+
if (nativeLower) {
|
|
989
|
+
const mergedLower = lowerBoundOf(merged);
|
|
990
|
+
if (!mergedLower || mergedLower.value < nativeLower.value || mergedLower.value === nativeLower.value && nativeLower.exclusive && !mergedLower.exclusive) {
|
|
991
|
+
return `the lower bound loosens the native one (${mergedLower?.value ?? "none"} vs native ${nativeLower.value})`;
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
const nativeUpper = upperBoundOf(native);
|
|
995
|
+
if (nativeUpper) {
|
|
996
|
+
const mergedUpper = upperBoundOf(merged);
|
|
997
|
+
if (!mergedUpper || mergedUpper.value > nativeUpper.value || mergedUpper.value === nativeUpper.value && nativeUpper.exclusive && !mergedUpper.exclusive) {
|
|
998
|
+
return `the upper bound loosens the native one (${mergedUpper?.value ?? "none"} vs native ${nativeUpper.value})`;
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
for (const key of ["minLength", "minItems"]) {
|
|
1002
|
+
const n = native[key];
|
|
1003
|
+
if (typeof n !== "number") continue;
|
|
1004
|
+
const m = merged[key];
|
|
1005
|
+
if (typeof m !== "number" || m < n) {
|
|
1006
|
+
return `"${key}" loosens the native constraint (${JSON.stringify(m)} vs native ${n})`;
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
for (const key of ["maxLength", "maxItems"]) {
|
|
1010
|
+
const n = native[key];
|
|
1011
|
+
if (typeof n !== "number") continue;
|
|
1012
|
+
const m = merged[key];
|
|
1013
|
+
if (typeof m !== "number" || m > n) {
|
|
1014
|
+
return `"${key}" loosens the native constraint (${JSON.stringify(m)} vs native ${n})`;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
return void 0;
|
|
1018
|
+
}
|
|
1019
|
+
__name(findProjectionLoosening, "findProjectionLoosening");
|
|
1020
|
+
function validatePolicyTools(policyTools, tools) {
|
|
1021
|
+
if (policyTools === void 0) return;
|
|
1022
|
+
if (!isPlainRecord(policyTools)) {
|
|
1023
|
+
fail("omni.processing.policyTools: must be an object map");
|
|
1024
|
+
}
|
|
1025
|
+
for (const [toolName, entry] of Object.entries(policyTools)) {
|
|
1026
|
+
const where = `omni.processing.policyTools.${toolName}`;
|
|
1027
|
+
if (entry === null) continue;
|
|
1028
|
+
if (!isPlainRecord(entry)) {
|
|
1029
|
+
fail(`${where}: must be an object`);
|
|
1030
|
+
}
|
|
1031
|
+
const tool = tools.getTool(toolName);
|
|
1032
|
+
if (!tool?.mediaPolicyDescriptor) {
|
|
1033
|
+
fail(`${where}: "${toolName}" is not a registered media policy tool`);
|
|
1034
|
+
}
|
|
1035
|
+
const descriptor = tool.mediaPolicyDescriptor;
|
|
1036
|
+
rejectUnknownKeys(entry, where, ["settings", "runtime", "modelAccess"]);
|
|
1037
|
+
if (entry["settings"] !== void 0) {
|
|
1038
|
+
if (!isPlainRecord(entry["settings"])) {
|
|
1039
|
+
fail(`${where}.settings: must be an object`);
|
|
1040
|
+
}
|
|
1041
|
+
if (descriptor.settingsSchema) {
|
|
1042
|
+
const error = SchemaValidator.validate(
|
|
1043
|
+
descriptor.settingsSchema,
|
|
1044
|
+
entry["settings"]
|
|
1045
|
+
);
|
|
1046
|
+
if (error) {
|
|
1047
|
+
fail(`${where}.settings: ${error}`);
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
if (entry["runtime"] !== void 0) {
|
|
1052
|
+
if (!isPlainRecord(entry["runtime"])) {
|
|
1053
|
+
fail(`${where}.runtime: must be an object`);
|
|
1054
|
+
}
|
|
1055
|
+
rejectUnknownKeys(entry["runtime"], `${where}.runtime`, ["timeoutMs"]);
|
|
1056
|
+
const timeoutMs = entry["runtime"]["timeoutMs"];
|
|
1057
|
+
if (timeoutMs !== void 0) {
|
|
1058
|
+
requirePositiveInteger(timeoutMs, `${where}.runtime.timeoutMs`);
|
|
1059
|
+
if (timeoutMs >= STAGING_GRACE_MS) {
|
|
1060
|
+
fail(
|
|
1061
|
+
`${where}.runtime.timeoutMs: must be below the staging sweep grace window (${STAGING_GRACE_MS}ms) so a live invocation's staging directory is never reclaimed mid-run`
|
|
1062
|
+
);
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
const modelAccess = entry["modelAccess"];
|
|
1067
|
+
if (modelAccess === void 0) continue;
|
|
1068
|
+
if (!isPlainRecord(modelAccess)) {
|
|
1069
|
+
fail(`${where}.modelAccess: must be an object`);
|
|
1070
|
+
}
|
|
1071
|
+
rejectUnknownKeys(modelAccess, `${where}.modelAccess`, [
|
|
1072
|
+
"enabled",
|
|
1073
|
+
"description",
|
|
1074
|
+
"defaultArguments",
|
|
1075
|
+
"lockedArguments",
|
|
1076
|
+
"parameterSchema",
|
|
1077
|
+
"output"
|
|
1078
|
+
]);
|
|
1079
|
+
const defaults = modelAccess["defaultArguments"];
|
|
1080
|
+
const locked = modelAccess["lockedArguments"];
|
|
1081
|
+
if (defaults !== void 0 && !isPlainRecord(defaults)) {
|
|
1082
|
+
fail(`${where}.modelAccess.defaultArguments: must be an object`);
|
|
1083
|
+
}
|
|
1084
|
+
if (locked !== void 0 && !isPlainRecord(locked)) {
|
|
1085
|
+
fail(`${where}.modelAccess.lockedArguments: must be an object`);
|
|
1086
|
+
}
|
|
1087
|
+
if (isPlainRecord(defaults) && isPlainRecord(locked)) {
|
|
1088
|
+
const conflicts = Object.keys(defaults).filter(
|
|
1089
|
+
(k) => Object.prototype.hasOwnProperty.call(locked, k)
|
|
1090
|
+
);
|
|
1091
|
+
if (conflicts.length > 0) {
|
|
1092
|
+
fail(
|
|
1093
|
+
`${where}.modelAccess: ${conflicts.map((k) => `"${k}"`).join(", ")} present in both defaultArguments and lockedArguments`
|
|
1094
|
+
);
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
const nativeSchema = tool.parameterSchema;
|
|
1098
|
+
const nativeProperties = isPlainRecord(nativeSchema) && isPlainRecord(nativeSchema["properties"]) ? nativeSchema["properties"] : void 0;
|
|
1099
|
+
if (nativeProperties !== void 0) {
|
|
1100
|
+
for (const [label, record] of [
|
|
1101
|
+
["defaultArguments", defaults],
|
|
1102
|
+
["lockedArguments", locked]
|
|
1103
|
+
]) {
|
|
1104
|
+
if (!isPlainRecord(record)) continue;
|
|
1105
|
+
const error = SchemaValidator.validate(
|
|
1106
|
+
{
|
|
1107
|
+
type: "object",
|
|
1108
|
+
properties: nativeProperties,
|
|
1109
|
+
additionalProperties: false
|
|
1110
|
+
},
|
|
1111
|
+
record
|
|
1112
|
+
);
|
|
1113
|
+
if (error) {
|
|
1114
|
+
fail(`${where}.modelAccess.${label}: ${error}`);
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
const projection = modelAccess["parameterSchema"];
|
|
1119
|
+
if (projection !== void 0) {
|
|
1120
|
+
if (!isPlainRecord(projection)) {
|
|
1121
|
+
fail(`${where}.modelAccess.parameterSchema: must be an object`);
|
|
1122
|
+
}
|
|
1123
|
+
const projectionProps = isPlainRecord(projection["properties"]) ? Object.keys(projection["properties"]) : [];
|
|
1124
|
+
const nativeProps = nativeProperties !== void 0 ? new Set(Object.keys(nativeProperties)) : /* @__PURE__ */ new Set();
|
|
1125
|
+
const introduced = projectionProps.filter((p) => !nativeProps.has(p));
|
|
1126
|
+
if (introduced.length > 0) {
|
|
1127
|
+
fail(
|
|
1128
|
+
`${where}.modelAccess.parameterSchema: ${introduced.map((p) => `"${p}"`).join(", ")} not present in the tool's native schema (projection may only narrow)`
|
|
1129
|
+
);
|
|
1130
|
+
}
|
|
1131
|
+
if (isPlainRecord(projection["properties"]) && nativeProperties !== void 0) {
|
|
1132
|
+
for (const [prop, override] of Object.entries(
|
|
1133
|
+
projection["properties"]
|
|
1134
|
+
)) {
|
|
1135
|
+
const native = nativeProperties[prop];
|
|
1136
|
+
if (!isPlainRecord(override) || !isPlainRecord(native)) continue;
|
|
1137
|
+
const loosening = findProjectionLoosening(native, override);
|
|
1138
|
+
if (loosening !== void 0) {
|
|
1139
|
+
fail(
|
|
1140
|
+
`${where}.modelAccess.parameterSchema.properties.${prop}: ${loosening} (projection may only narrow)`
|
|
1141
|
+
);
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
__name(validatePolicyTools, "validatePolicyTools");
|
|
1149
|
+
function normalizeOmniProcessingConfig(raw, tools) {
|
|
1150
|
+
if (raw.maxUploadFileBytes !== void 0) {
|
|
1151
|
+
const bytes = requirePositiveInteger(
|
|
1152
|
+
raw.maxUploadFileBytes,
|
|
1153
|
+
"omni.processing.transportGuard.maxUploadFileBytes"
|
|
1154
|
+
);
|
|
1155
|
+
if (bytes > MAX_UPLOAD_FILE_BYTES_CEILING) {
|
|
1156
|
+
fail(
|
|
1157
|
+
`omni.processing.transportGuard.maxUploadFileBytes: ${bytes} exceeds the DashScope per-file upload cap (${MAX_UPLOAD_FILE_BYTES_CEILING})`
|
|
1158
|
+
);
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
if (raw.maxEstimatedTokens !== void 0) {
|
|
1162
|
+
const tokens = raw.maxEstimatedTokens;
|
|
1163
|
+
if (typeof tokens !== "number" || !Number.isFinite(tokens) || tokens < 0) {
|
|
1164
|
+
fail(
|
|
1165
|
+
`omni.processing.transportGuard.maxEstimatedTokens: must be a finite number >= 0, where 0 disables the token guard (got ${JSON.stringify(tokens)})`
|
|
1166
|
+
);
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
if (raw.urlTtlHours !== void 0) {
|
|
1170
|
+
const ttl = raw.urlTtlHours;
|
|
1171
|
+
if (typeof ttl !== "number" || !Number.isFinite(ttl) || ttl < 0 || ttl > MAX_URL_TTL_HOURS) {
|
|
1172
|
+
fail(
|
|
1173
|
+
`omni.delivery.upload.urlTtlHours: must be a number between 0 and ${MAX_URL_TTL_HOURS} (got ${JSON.stringify(ttl)})`
|
|
1174
|
+
);
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
const limits = normalizeLimits(raw.limits);
|
|
1178
|
+
validatePolicyTools(raw.policyTools, tools);
|
|
1179
|
+
const fixedMap = mergePolicyMaps(
|
|
1180
|
+
{},
|
|
1181
|
+
raw.fixedPolicies,
|
|
1182
|
+
"omni.processing.fixedPolicies",
|
|
1183
|
+
{ allowTombstones: true }
|
|
1184
|
+
);
|
|
1185
|
+
const guardMap = mergePolicyMaps(
|
|
1186
|
+
systemDefaultTransportGuardPolicies(),
|
|
1187
|
+
raw.transportGuardPolicies,
|
|
1188
|
+
"omni.processing.transportGuard.policies",
|
|
1189
|
+
{ allowTombstones: false }
|
|
1190
|
+
);
|
|
1191
|
+
const fixedPolicies = Object.entries(fixedMap).map(
|
|
1192
|
+
([id, entry]) => normalizePolicy(
|
|
1193
|
+
id,
|
|
1194
|
+
entry,
|
|
1195
|
+
"preprocessing",
|
|
1196
|
+
"omni.processing.fixedPolicies",
|
|
1197
|
+
tools
|
|
1198
|
+
)
|
|
1199
|
+
);
|
|
1200
|
+
const transportGuardPolicies = Object.entries(guardMap).map(
|
|
1201
|
+
([id, entry]) => normalizePolicy(
|
|
1202
|
+
id,
|
|
1203
|
+
entry,
|
|
1204
|
+
"transport_guard",
|
|
1205
|
+
"omni.processing.transportGuard.policies",
|
|
1206
|
+
tools
|
|
1207
|
+
)
|
|
1208
|
+
);
|
|
1209
|
+
if (transportGuardPolicies.length === 0) {
|
|
1210
|
+
fail(
|
|
1211
|
+
"omni.processing.transportGuard.policies: must not be empty (the transport guard is mandatory)"
|
|
1212
|
+
);
|
|
1213
|
+
}
|
|
1214
|
+
const covered = new Set(
|
|
1215
|
+
transportGuardPolicies.flatMap((policy) => policy.mediaTypes)
|
|
1216
|
+
);
|
|
1217
|
+
const uncovered = MODALITIES.filter((m) => !covered.has(m));
|
|
1218
|
+
if (uncovered.length > 0) {
|
|
1219
|
+
fail(
|
|
1220
|
+
`omni.processing.transportGuard.policies: no guard policy covers ${uncovered.join(", ")} \u2014 the merged set must cover image, video, and audio`
|
|
1221
|
+
);
|
|
1222
|
+
}
|
|
1223
|
+
for (const [where, set] of [
|
|
1224
|
+
["omni.processing.fixedPolicies", fixedPolicies],
|
|
1225
|
+
["omni.processing.transportGuard.policies", transportGuardPolicies]
|
|
1226
|
+
]) {
|
|
1227
|
+
const inert = set.filter((p) => p.output.reprocessMedia);
|
|
1228
|
+
if (inert.length > 0 && !set.some((p) => p.origins.includes("policy"))) {
|
|
1229
|
+
fail(
|
|
1230
|
+
`${where}: ${inert.map((p) => `"${p.id}"`).join(", ")} sets output.reprocessMedia, but no policy in this set accepts origin "policy" \u2014 derivatives would re-enter matching and never match. Add "policy" to some policy's origins or drop reprocessMedia.`
|
|
1231
|
+
);
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
return { fixedPolicies, transportGuardPolicies, limits };
|
|
1235
|
+
}
|
|
1236
|
+
__name(normalizeOmniProcessingConfig, "normalizeOmniProcessingConfig");
|
|
1237
|
+
|
|
1238
|
+
export {
|
|
1239
|
+
conditionUsesNamespace,
|
|
1240
|
+
evaluateFixedPolicyCondition,
|
|
1241
|
+
resetRecoveryLatchForTests,
|
|
1242
|
+
runStartupRecoveryOnce,
|
|
1243
|
+
OmniPolicyConfigError,
|
|
1244
|
+
DEFAULT_OMNI_PROCESSING_LIMITS,
|
|
1245
|
+
systemDefaultTransportGuardPolicies,
|
|
1246
|
+
normalizeOmniProcessingConfig
|
|
1247
|
+
};
|
|
1248
|
+
/**
|
|
1249
|
+
* @license
|
|
1250
|
+
* Copyright 2025 Google LLC
|
|
1251
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
1252
|
+
*/
|