@forgeax/view 0.2.1-beta-20260924075842
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/CHANGELOG.md +11 -0
- package/README.md +742 -0
- package/dist/modules/backend.mjs +54 -0
- package/dist/modules/backend.mjs.map +7 -0
- package/dist/modules/browser.mjs +180 -0
- package/dist/modules/browser.mjs.map +7 -0
- package/dist/modules/carrier-contract.mjs +38 -0
- package/dist/modules/carrier-contract.mjs.map +7 -0
- package/dist/modules/carrier.mjs +13 -0
- package/dist/modules/carrier.mjs.map +7 -0
- package/dist/modules/chunks/chunk-2ASWB6IX.mjs +225 -0
- package/dist/modules/chunks/chunk-2ASWB6IX.mjs.map +7 -0
- package/dist/modules/chunks/chunk-2IJKOG2F.mjs +801 -0
- package/dist/modules/chunks/chunk-2IJKOG2F.mjs.map +7 -0
- package/dist/modules/chunks/chunk-2K3BBJ5S.mjs +9 -0
- package/dist/modules/chunks/chunk-2K3BBJ5S.mjs.map +7 -0
- package/dist/modules/chunks/chunk-32GD5LL6.mjs +482 -0
- package/dist/modules/chunks/chunk-32GD5LL6.mjs.map +7 -0
- package/dist/modules/chunks/chunk-3B4KFAEC.mjs +10 -0
- package/dist/modules/chunks/chunk-3B4KFAEC.mjs.map +7 -0
- package/dist/modules/chunks/chunk-46O5WX43.mjs +25 -0
- package/dist/modules/chunks/chunk-46O5WX43.mjs.map +7 -0
- package/dist/modules/chunks/chunk-47J5JXAB.mjs +237 -0
- package/dist/modules/chunks/chunk-47J5JXAB.mjs.map +7 -0
- package/dist/modules/chunks/chunk-4BXQOUDQ.mjs +17 -0
- package/dist/modules/chunks/chunk-4BXQOUDQ.mjs.map +7 -0
- package/dist/modules/chunks/chunk-4GQWYU2V.mjs +126 -0
- package/dist/modules/chunks/chunk-4GQWYU2V.mjs.map +7 -0
- package/dist/modules/chunks/chunk-4N5X2PRQ.mjs +48 -0
- package/dist/modules/chunks/chunk-4N5X2PRQ.mjs.map +7 -0
- package/dist/modules/chunks/chunk-4WXD2KYX.mjs +56 -0
- package/dist/modules/chunks/chunk-4WXD2KYX.mjs.map +7 -0
- package/dist/modules/chunks/chunk-6ZWWVAZK.mjs +468 -0
- package/dist/modules/chunks/chunk-6ZWWVAZK.mjs.map +7 -0
- package/dist/modules/chunks/chunk-73UZNRHN.mjs +296 -0
- package/dist/modules/chunks/chunk-73UZNRHN.mjs.map +7 -0
- package/dist/modules/chunks/chunk-7ITLCRND.mjs +10 -0
- package/dist/modules/chunks/chunk-7ITLCRND.mjs.map +7 -0
- package/dist/modules/chunks/chunk-7TGVWKH7.mjs +59 -0
- package/dist/modules/chunks/chunk-7TGVWKH7.mjs.map +7 -0
- package/dist/modules/chunks/chunk-7URFF53W.mjs +42 -0
- package/dist/modules/chunks/chunk-7URFF53W.mjs.map +7 -0
- package/dist/modules/chunks/chunk-7YSDRIFN.mjs +14 -0
- package/dist/modules/chunks/chunk-7YSDRIFN.mjs.map +7 -0
- package/dist/modules/chunks/chunk-AAFVCQPK.mjs +52 -0
- package/dist/modules/chunks/chunk-AAFVCQPK.mjs.map +7 -0
- package/dist/modules/chunks/chunk-AEK7ZESQ.mjs +18 -0
- package/dist/modules/chunks/chunk-AEK7ZESQ.mjs.map +7 -0
- package/dist/modules/chunks/chunk-AL6ZWIEU.mjs +42 -0
- package/dist/modules/chunks/chunk-AL6ZWIEU.mjs.map +7 -0
- package/dist/modules/chunks/chunk-ALT7XVMQ.mjs +73 -0
- package/dist/modules/chunks/chunk-ALT7XVMQ.mjs.map +7 -0
- package/dist/modules/chunks/chunk-ASI2HBE6.mjs +116 -0
- package/dist/modules/chunks/chunk-ASI2HBE6.mjs.map +7 -0
- package/dist/modules/chunks/chunk-ATWGCH7I.mjs +174 -0
- package/dist/modules/chunks/chunk-ATWGCH7I.mjs.map +7 -0
- package/dist/modules/chunks/chunk-C45U6IIY.mjs +692 -0
- package/dist/modules/chunks/chunk-C45U6IIY.mjs.map +7 -0
- package/dist/modules/chunks/chunk-C7R3YRA7.mjs +98 -0
- package/dist/modules/chunks/chunk-C7R3YRA7.mjs.map +7 -0
- package/dist/modules/chunks/chunk-CRMICXKN.mjs +87 -0
- package/dist/modules/chunks/chunk-CRMICXKN.mjs.map +7 -0
- package/dist/modules/chunks/chunk-CUH2G6UF.mjs +81 -0
- package/dist/modules/chunks/chunk-CUH2G6UF.mjs.map +7 -0
- package/dist/modules/chunks/chunk-D7GWRZLL.mjs +77 -0
- package/dist/modules/chunks/chunk-D7GWRZLL.mjs.map +7 -0
- package/dist/modules/chunks/chunk-DBWUIBE3.mjs +10 -0
- package/dist/modules/chunks/chunk-DBWUIBE3.mjs.map +7 -0
- package/dist/modules/chunks/chunk-DQWVWWUU.mjs +77 -0
- package/dist/modules/chunks/chunk-DQWVWWUU.mjs.map +7 -0
- package/dist/modules/chunks/chunk-DZZ2WFEU.mjs +122 -0
- package/dist/modules/chunks/chunk-DZZ2WFEU.mjs.map +7 -0
- package/dist/modules/chunks/chunk-E4UIAN26.mjs +58 -0
- package/dist/modules/chunks/chunk-E4UIAN26.mjs.map +7 -0
- package/dist/modules/chunks/chunk-EJGBVKFE.mjs +77 -0
- package/dist/modules/chunks/chunk-EJGBVKFE.mjs.map +7 -0
- package/dist/modules/chunks/chunk-EPSTTHWV.mjs +173 -0
- package/dist/modules/chunks/chunk-EPSTTHWV.mjs.map +7 -0
- package/dist/modules/chunks/chunk-ER7T6QJ3.mjs +64 -0
- package/dist/modules/chunks/chunk-ER7T6QJ3.mjs.map +7 -0
- package/dist/modules/chunks/chunk-FD4BAJ6K.mjs +389 -0
- package/dist/modules/chunks/chunk-FD4BAJ6K.mjs.map +7 -0
- package/dist/modules/chunks/chunk-FJM6WWIY.mjs +80 -0
- package/dist/modules/chunks/chunk-FJM6WWIY.mjs.map +7 -0
- package/dist/modules/chunks/chunk-FKCQYDLX.mjs +162 -0
- package/dist/modules/chunks/chunk-FKCQYDLX.mjs.map +7 -0
- package/dist/modules/chunks/chunk-FLGC65SR.mjs +10 -0
- package/dist/modules/chunks/chunk-FLGC65SR.mjs.map +7 -0
- package/dist/modules/chunks/chunk-FMCACPX5.mjs +289 -0
- package/dist/modules/chunks/chunk-FMCACPX5.mjs.map +7 -0
- package/dist/modules/chunks/chunk-FOBRLUQV.mjs +51 -0
- package/dist/modules/chunks/chunk-FOBRLUQV.mjs.map +7 -0
- package/dist/modules/chunks/chunk-FV3DSKZB.mjs +33 -0
- package/dist/modules/chunks/chunk-FV3DSKZB.mjs.map +7 -0
- package/dist/modules/chunks/chunk-G7BAFAGO.mjs +98 -0
- package/dist/modules/chunks/chunk-G7BAFAGO.mjs.map +7 -0
- package/dist/modules/chunks/chunk-GQBZMCTK.mjs +145 -0
- package/dist/modules/chunks/chunk-GQBZMCTK.mjs.map +7 -0
- package/dist/modules/chunks/chunk-GYWIY7AL.mjs +131 -0
- package/dist/modules/chunks/chunk-GYWIY7AL.mjs.map +7 -0
- package/dist/modules/chunks/chunk-H3KNBALD.mjs +256 -0
- package/dist/modules/chunks/chunk-H3KNBALD.mjs.map +7 -0
- package/dist/modules/chunks/chunk-H3M22JDL.mjs +144 -0
- package/dist/modules/chunks/chunk-H3M22JDL.mjs.map +7 -0
- package/dist/modules/chunks/chunk-HES3DNTM.mjs +40 -0
- package/dist/modules/chunks/chunk-HES3DNTM.mjs.map +7 -0
- package/dist/modules/chunks/chunk-I5BFP7SS.mjs +2392 -0
- package/dist/modules/chunks/chunk-I5BFP7SS.mjs.map +7 -0
- package/dist/modules/chunks/chunk-IGRMZYRD.mjs +15 -0
- package/dist/modules/chunks/chunk-IGRMZYRD.mjs.map +7 -0
- package/dist/modules/chunks/chunk-IKNGC766.mjs +321 -0
- package/dist/modules/chunks/chunk-IKNGC766.mjs.map +7 -0
- package/dist/modules/chunks/chunk-IVHNYKZB.mjs +35 -0
- package/dist/modules/chunks/chunk-IVHNYKZB.mjs.map +7 -0
- package/dist/modules/chunks/chunk-JHOURMYW.mjs +101 -0
- package/dist/modules/chunks/chunk-JHOURMYW.mjs.map +7 -0
- package/dist/modules/chunks/chunk-JURXMRFA.mjs +282 -0
- package/dist/modules/chunks/chunk-JURXMRFA.mjs.map +7 -0
- package/dist/modules/chunks/chunk-JWZIREC3.mjs +18 -0
- package/dist/modules/chunks/chunk-JWZIREC3.mjs.map +7 -0
- package/dist/modules/chunks/chunk-KHRTIZ56.mjs +1400 -0
- package/dist/modules/chunks/chunk-KHRTIZ56.mjs.map +7 -0
- package/dist/modules/chunks/chunk-KLJZZ23J.mjs +102 -0
- package/dist/modules/chunks/chunk-KLJZZ23J.mjs.map +7 -0
- package/dist/modules/chunks/chunk-KNBAYU5I.mjs +49 -0
- package/dist/modules/chunks/chunk-KNBAYU5I.mjs.map +7 -0
- package/dist/modules/chunks/chunk-KSZNCFU4.mjs +125 -0
- package/dist/modules/chunks/chunk-KSZNCFU4.mjs.map +7 -0
- package/dist/modules/chunks/chunk-L45W6KM6.mjs +158 -0
- package/dist/modules/chunks/chunk-L45W6KM6.mjs.map +7 -0
- package/dist/modules/chunks/chunk-LERMYZRC.mjs +239 -0
- package/dist/modules/chunks/chunk-LERMYZRC.mjs.map +7 -0
- package/dist/modules/chunks/chunk-LKJCXYSJ.mjs +91 -0
- package/dist/modules/chunks/chunk-LKJCXYSJ.mjs.map +7 -0
- package/dist/modules/chunks/chunk-MBS3EICT.mjs +25 -0
- package/dist/modules/chunks/chunk-MBS3EICT.mjs.map +7 -0
- package/dist/modules/chunks/chunk-MUOQZPVH.mjs +609 -0
- package/dist/modules/chunks/chunk-MUOQZPVH.mjs.map +7 -0
- package/dist/modules/chunks/chunk-MVEPGFSB.mjs +1 -0
- package/dist/modules/chunks/chunk-MVEPGFSB.mjs.map +7 -0
- package/dist/modules/chunks/chunk-NBJKLWJ5.mjs +42 -0
- package/dist/modules/chunks/chunk-NBJKLWJ5.mjs.map +7 -0
- package/dist/modules/chunks/chunk-NBLGKTEM.mjs +86 -0
- package/dist/modules/chunks/chunk-NBLGKTEM.mjs.map +7 -0
- package/dist/modules/chunks/chunk-NI7CS3I2.mjs +110 -0
- package/dist/modules/chunks/chunk-NI7CS3I2.mjs.map +7 -0
- package/dist/modules/chunks/chunk-NJH2OJFC.mjs +2113 -0
- package/dist/modules/chunks/chunk-NJH2OJFC.mjs.map +7 -0
- package/dist/modules/chunks/chunk-OBK4LIJB.mjs +20 -0
- package/dist/modules/chunks/chunk-OBK4LIJB.mjs.map +7 -0
- package/dist/modules/chunks/chunk-PEUT3FW7.mjs +1 -0
- package/dist/modules/chunks/chunk-PEUT3FW7.mjs.map +7 -0
- package/dist/modules/chunks/chunk-PRZOWPDN.mjs +66 -0
- package/dist/modules/chunks/chunk-PRZOWPDN.mjs.map +7 -0
- package/dist/modules/chunks/chunk-Q4RXBGQS.mjs +55 -0
- package/dist/modules/chunks/chunk-Q4RXBGQS.mjs.map +7 -0
- package/dist/modules/chunks/chunk-QBHBKOIL.mjs +55 -0
- package/dist/modules/chunks/chunk-QBHBKOIL.mjs.map +7 -0
- package/dist/modules/chunks/chunk-QD6CCRMG.mjs +20 -0
- package/dist/modules/chunks/chunk-QD6CCRMG.mjs.map +7 -0
- package/dist/modules/chunks/chunk-QF4V23GW.mjs +39 -0
- package/dist/modules/chunks/chunk-QF4V23GW.mjs.map +7 -0
- package/dist/modules/chunks/chunk-QK6W7MJO.mjs +42 -0
- package/dist/modules/chunks/chunk-QK6W7MJO.mjs.map +7 -0
- package/dist/modules/chunks/chunk-QL7V6DK7.mjs +34 -0
- package/dist/modules/chunks/chunk-QL7V6DK7.mjs.map +7 -0
- package/dist/modules/chunks/chunk-QLBQQKRI.mjs +25 -0
- package/dist/modules/chunks/chunk-QLBQQKRI.mjs.map +7 -0
- package/dist/modules/chunks/chunk-QLZQGZDC.mjs +418 -0
- package/dist/modules/chunks/chunk-QLZQGZDC.mjs.map +7 -0
- package/dist/modules/chunks/chunk-QSKQZGK7.mjs +1625 -0
- package/dist/modules/chunks/chunk-QSKQZGK7.mjs.map +7 -0
- package/dist/modules/chunks/chunk-QURKBAG4.mjs +25 -0
- package/dist/modules/chunks/chunk-QURKBAG4.mjs.map +7 -0
- package/dist/modules/chunks/chunk-R274XBEH.mjs +53 -0
- package/dist/modules/chunks/chunk-R274XBEH.mjs.map +7 -0
- package/dist/modules/chunks/chunk-R4I4JEY5.mjs +77 -0
- package/dist/modules/chunks/chunk-R4I4JEY5.mjs.map +7 -0
- package/dist/modules/chunks/chunk-RR6L6VVR.mjs +9 -0
- package/dist/modules/chunks/chunk-RR6L6VVR.mjs.map +7 -0
- package/dist/modules/chunks/chunk-RXF7SBBZ.mjs +125 -0
- package/dist/modules/chunks/chunk-RXF7SBBZ.mjs.map +7 -0
- package/dist/modules/chunks/chunk-SR66S6EJ.mjs +138 -0
- package/dist/modules/chunks/chunk-SR66S6EJ.mjs.map +7 -0
- package/dist/modules/chunks/chunk-SSQMQJ52.mjs +27 -0
- package/dist/modules/chunks/chunk-SSQMQJ52.mjs.map +7 -0
- package/dist/modules/chunks/chunk-TP26TASL.mjs +20 -0
- package/dist/modules/chunks/chunk-TP26TASL.mjs.map +7 -0
- package/dist/modules/chunks/chunk-TSAEK5P3.mjs +50 -0
- package/dist/modules/chunks/chunk-TSAEK5P3.mjs.map +7 -0
- package/dist/modules/chunks/chunk-UAY27HT3.mjs +68 -0
- package/dist/modules/chunks/chunk-UAY27HT3.mjs.map +7 -0
- package/dist/modules/chunks/chunk-UDLIWGWS.mjs +103 -0
- package/dist/modules/chunks/chunk-UDLIWGWS.mjs.map +7 -0
- package/dist/modules/chunks/chunk-UDVQHPWV.mjs +89 -0
- package/dist/modules/chunks/chunk-UDVQHPWV.mjs.map +7 -0
- package/dist/modules/chunks/chunk-UM23W3G7.mjs +237 -0
- package/dist/modules/chunks/chunk-UM23W3G7.mjs.map +7 -0
- package/dist/modules/chunks/chunk-VDZJWEAA.mjs +214 -0
- package/dist/modules/chunks/chunk-VDZJWEAA.mjs.map +7 -0
- package/dist/modules/chunks/chunk-VIGOJWSO.mjs +42 -0
- package/dist/modules/chunks/chunk-VIGOJWSO.mjs.map +7 -0
- package/dist/modules/chunks/chunk-VY3S5BWI.mjs +284 -0
- package/dist/modules/chunks/chunk-VY3S5BWI.mjs.map +7 -0
- package/dist/modules/chunks/chunk-VZXGRZYU.mjs +47 -0
- package/dist/modules/chunks/chunk-VZXGRZYU.mjs.map +7 -0
- package/dist/modules/chunks/chunk-W5DMQZB5.mjs +42 -0
- package/dist/modules/chunks/chunk-W5DMQZB5.mjs.map +7 -0
- package/dist/modules/chunks/chunk-WOMHSTVZ.mjs +918 -0
- package/dist/modules/chunks/chunk-WOMHSTVZ.mjs.map +7 -0
- package/dist/modules/chunks/chunk-XFQT7XCG.mjs +42 -0
- package/dist/modules/chunks/chunk-XFQT7XCG.mjs.map +7 -0
- package/dist/modules/chunks/chunk-XJZEVRYX.mjs +98 -0
- package/dist/modules/chunks/chunk-XJZEVRYX.mjs.map +7 -0
- package/dist/modules/chunks/chunk-XUYFV23R.mjs +317 -0
- package/dist/modules/chunks/chunk-XUYFV23R.mjs.map +7 -0
- package/dist/modules/chunks/chunk-Y5HXCPPQ.mjs +58 -0
- package/dist/modules/chunks/chunk-Y5HXCPPQ.mjs.map +7 -0
- package/dist/modules/chunks/chunk-YTHGRKGI.mjs +147 -0
- package/dist/modules/chunks/chunk-YTHGRKGI.mjs.map +7 -0
- package/dist/modules/chunks/chunk-YVQSDKAO.mjs +341 -0
- package/dist/modules/chunks/chunk-YVQSDKAO.mjs.map +7 -0
- package/dist/modules/chunks/chunk-YYXQDUVT.mjs +123 -0
- package/dist/modules/chunks/chunk-YYXQDUVT.mjs.map +7 -0
- package/dist/modules/chunks/chunk-ZFXZ2NUI.mjs +142 -0
- package/dist/modules/chunks/chunk-ZFXZ2NUI.mjs.map +7 -0
- package/dist/modules/chunks/chunk-ZLNWF4ET.mjs +9 -0
- package/dist/modules/chunks/chunk-ZLNWF4ET.mjs.map +7 -0
- package/dist/modules/chunks/chunk-ZLU5QW2O.mjs +9 -0
- package/dist/modules/chunks/chunk-ZLU5QW2O.mjs.map +7 -0
- package/dist/modules/chunks/chunk-ZNZPYE2V.mjs +28 -0
- package/dist/modules/chunks/chunk-ZNZPYE2V.mjs.map +7 -0
- package/dist/modules/chunks/core-564N45MO.mjs +7480 -0
- package/dist/modules/chunks/core-564N45MO.mjs.map +7 -0
- package/dist/modules/chunks/css-BKH4SVJG.mjs +8 -0
- package/dist/modules/chunks/css-BKH4SVJG.mjs.map +7 -0
- package/dist/modules/chunks/engine-javascript-PDVIGNGR.mjs +3241 -0
- package/dist/modules/chunks/engine-javascript-PDVIGNGR.mjs.map +7 -0
- package/dist/modules/chunks/github-dark-default-6HVTHEWF.mjs +8 -0
- package/dist/modules/chunks/github-dark-default-6HVTHEWF.mjs.map +7 -0
- package/dist/modules/chunks/github-light-default-LAXRA6XL.mjs +8 -0
- package/dist/modules/chunks/github-light-default-LAXRA6XL.mjs.map +7 -0
- package/dist/modules/chunks/glsl-UC3YWUD2.mjs +18 -0
- package/dist/modules/chunks/glsl-UC3YWUD2.mjs.map +7 -0
- package/dist/modules/chunks/html-FRVIUV63.mjs +19 -0
- package/dist/modules/chunks/html-FRVIUV63.mjs.map +7 -0
- package/dist/modules/chunks/javascript-LN3OC7S2.mjs +8 -0
- package/dist/modules/chunks/javascript-LN3OC7S2.mjs.map +7 -0
- package/dist/modules/chunks/json-5CUGWTOP.mjs +11 -0
- package/dist/modules/chunks/json-5CUGWTOP.mjs.map +7 -0
- package/dist/modules/chunks/json5-YZQI5VNO.mjs +11 -0
- package/dist/modules/chunks/json5-YZQI5VNO.mjs.map +7 -0
- package/dist/modules/chunks/jsonc-SWID6VOZ.mjs +11 -0
- package/dist/modules/chunks/jsonc-SWID6VOZ.mjs.map +7 -0
- package/dist/modules/chunks/jsx-A7RDCLJO.mjs +11 -0
- package/dist/modules/chunks/jsx-A7RDCLJO.mjs.map +7 -0
- package/dist/modules/chunks/markdown-QTCU5KP5.mjs +11 -0
- package/dist/modules/chunks/markdown-QTCU5KP5.mjs.map +7 -0
- package/dist/modules/chunks/python-LAZONBIB.mjs +11 -0
- package/dist/modules/chunks/python-LAZONBIB.mjs.map +7 -0
- package/dist/modules/chunks/rust-XWTPJFJO.mjs +11 -0
- package/dist/modules/chunks/rust-XWTPJFJO.mjs.map +7 -0
- package/dist/modules/chunks/scss-CFXRHUUW.mjs +15 -0
- package/dist/modules/chunks/scss-CFXRHUUW.mjs.map +7 -0
- package/dist/modules/chunks/shellscript-OHO3LCVU.mjs +11 -0
- package/dist/modules/chunks/shellscript-OHO3LCVU.mjs.map +7 -0
- package/dist/modules/chunks/toml-IOHFZJ5B.mjs +11 -0
- package/dist/modules/chunks/toml-IOHFZJ5B.mjs.map +7 -0
- package/dist/modules/chunks/tsx-2E6WNX2E.mjs +11 -0
- package/dist/modules/chunks/tsx-2E6WNX2E.mjs.map +7 -0
- package/dist/modules/chunks/typescript-PBKAS54P.mjs +11 -0
- package/dist/modules/chunks/typescript-PBKAS54P.mjs.map +7 -0
- package/dist/modules/chunks/wgsl-PS6QPRLZ.mjs +11 -0
- package/dist/modules/chunks/wgsl-PS6QPRLZ.mjs.map +7 -0
- package/dist/modules/chunks/xml-JECR2ACB.mjs +18 -0
- package/dist/modules/chunks/xml-JECR2ACB.mjs.map +7 -0
- package/dist/modules/chunks/yaml-P2SV4LOE.mjs +11 -0
- package/dist/modules/chunks/yaml-P2SV4LOE.mjs.map +7 -0
- package/dist/modules/cli-contributions.mjs +32 -0
- package/dist/modules/cli-contributions.mjs.map +7 -0
- package/dist/modules/cli.mjs +14 -0
- package/dist/modules/cli.mjs.map +7 -0
- package/dist/modules/command-executor.mjs +65 -0
- package/dist/modules/command-executor.mjs.map +7 -0
- package/dist/modules/commands.mjs +10 -0
- package/dist/modules/commands.mjs.map +7 -0
- package/dist/modules/embedded.mjs +18608 -0
- package/dist/modules/embedded.mjs.map +7 -0
- package/dist/modules/extension-bridge.mjs +18 -0
- package/dist/modules/extension-bridge.mjs.map +7 -0
- package/dist/modules/frontend-root.mjs +61 -0
- package/dist/modules/frontend-root.mjs.map +7 -0
- package/dist/modules/index.mjs +784 -0
- package/dist/modules/index.mjs.map +7 -0
- package/dist/modules/page.mjs +45 -0
- package/dist/modules/page.mjs.map +7 -0
- package/dist/modules/pages/scene.mjs +18 -0
- package/dist/modules/pages/scene.mjs.map +7 -0
- package/dist/modules/plugin.mjs +56 -0
- package/dist/modules/plugin.mjs.map +7 -0
- package/dist/modules/plugins/asset/frontend.mjs +23 -0
- package/dist/modules/plugins/asset/frontend.mjs.map +7 -0
- package/dist/modules/plugins/asset/i18n.mjs +15 -0
- package/dist/modules/plugins/asset/i18n.mjs.map +7 -0
- package/dist/modules/plugins/asset/identity.mjs +42 -0
- package/dist/modules/plugins/asset/identity.mjs.map +7 -0
- package/dist/modules/plugins/asset/schema.mjs +10 -0
- package/dist/modules/plugins/asset/schema.mjs.map +7 -0
- package/dist/modules/plugins/asset/ui.mjs +16 -0
- package/dist/modules/plugins/asset/ui.mjs.map +7 -0
- package/dist/modules/plugins/content-browser/frontend.mjs +17 -0
- package/dist/modules/plugins/content-browser/frontend.mjs.map +7 -0
- package/dist/modules/plugins/content-browser/i18n.mjs +15 -0
- package/dist/modules/plugins/content-browser/i18n.mjs.map +7 -0
- package/dist/modules/plugins/content-browser/identity.mjs +22 -0
- package/dist/modules/plugins/content-browser/identity.mjs.map +7 -0
- package/dist/modules/plugins/content-browser/schema.mjs +12 -0
- package/dist/modules/plugins/content-browser/schema.mjs.map +7 -0
- package/dist/modules/plugins/content-browser/ui.mjs +15 -0
- package/dist/modules/plugins/content-browser/ui.mjs.map +7 -0
- package/dist/modules/plugins/display/api.mjs +10 -0
- package/dist/modules/plugins/display/api.mjs.map +7 -0
- package/dist/modules/plugins/display/backend.mjs +16 -0
- package/dist/modules/plugins/display/backend.mjs.map +7 -0
- package/dist/modules/plugins/display/carrier-contract.mjs +38 -0
- package/dist/modules/plugins/display/carrier-contract.mjs.map +7 -0
- package/dist/modules/plugins/display/carrier.mjs +13 -0
- package/dist/modules/plugins/display/carrier.mjs.map +7 -0
- package/dist/modules/plugins/display/effects.mjs +8 -0
- package/dist/modules/plugins/display/effects.mjs.map +7 -0
- package/dist/modules/plugins/display/frontend.mjs +14 -0
- package/dist/modules/plugins/display/frontend.mjs.map +7 -0
- package/dist/modules/plugins/display/i18n.mjs +58 -0
- package/dist/modules/plugins/display/i18n.mjs.map +7 -0
- package/dist/modules/plugins/display/identity.mjs +30 -0
- package/dist/modules/plugins/display/identity.mjs.map +7 -0
- package/dist/modules/plugins/display/page-broker.mjs +12 -0
- package/dist/modules/plugins/display/page-broker.mjs.map +7 -0
- package/dist/modules/plugins/display/schema.mjs +40 -0
- package/dist/modules/plugins/display/schema.mjs.map +7 -0
- package/dist/modules/plugins/display/ui.mjs +9 -0
- package/dist/modules/plugins/display/ui.mjs.map +7 -0
- package/dist/modules/plugins/inspector/frontend.mjs +17 -0
- package/dist/modules/plugins/inspector/frontend.mjs.map +7 -0
- package/dist/modules/plugins/inspector/i18n.mjs +15 -0
- package/dist/modules/plugins/inspector/i18n.mjs.map +7 -0
- package/dist/modules/plugins/inspector/identity.mjs +22 -0
- package/dist/modules/plugins/inspector/identity.mjs.map +7 -0
- package/dist/modules/plugins/inspector/schema.mjs +12 -0
- package/dist/modules/plugins/inspector/schema.mjs.map +7 -0
- package/dist/modules/plugins/inspector/ui.mjs +16 -0
- package/dist/modules/plugins/inspector/ui.mjs.map +7 -0
- package/dist/modules/plugins/material/frontend.mjs +25 -0
- package/dist/modules/plugins/material/frontend.mjs.map +7 -0
- package/dist/modules/plugins/material/i18n.mjs +15 -0
- package/dist/modules/plugins/material/i18n.mjs.map +7 -0
- package/dist/modules/plugins/material/identity.mjs +60 -0
- package/dist/modules/plugins/material/identity.mjs.map +7 -0
- package/dist/modules/plugins/material/schema.mjs +47 -0
- package/dist/modules/plugins/material/schema.mjs.map +7 -0
- package/dist/modules/plugins/material/ui.mjs +28 -0
- package/dist/modules/plugins/material/ui.mjs.map +7 -0
- package/dist/modules/plugins/mesh/frontend.mjs +23 -0
- package/dist/modules/plugins/mesh/frontend.mjs.map +7 -0
- package/dist/modules/plugins/mesh/i18n.mjs +15 -0
- package/dist/modules/plugins/mesh/i18n.mjs.map +7 -0
- package/dist/modules/plugins/mesh/identity.mjs +54 -0
- package/dist/modules/plugins/mesh/identity.mjs.map +7 -0
- package/dist/modules/plugins/mesh/schema.mjs +10 -0
- package/dist/modules/plugins/mesh/schema.mjs.map +7 -0
- package/dist/modules/plugins/mesh/ui.mjs +26 -0
- package/dist/modules/plugins/mesh/ui.mjs.map +7 -0
- package/dist/modules/plugins/plugins/api.mjs +11 -0
- package/dist/modules/plugins/plugins/api.mjs.map +7 -0
- package/dist/modules/plugins/plugins/backend.mjs +21 -0
- package/dist/modules/plugins/plugins/backend.mjs.map +7 -0
- package/dist/modules/plugins/plugins/cli.mjs +12 -0
- package/dist/modules/plugins/plugins/cli.mjs.map +7 -0
- package/dist/modules/plugins/plugins/frontend.mjs +17 -0
- package/dist/modules/plugins/plugins/frontend.mjs.map +7 -0
- package/dist/modules/plugins/plugins/i18n.mjs +15 -0
- package/dist/modules/plugins/plugins/i18n.mjs.map +7 -0
- package/dist/modules/plugins/plugins/identity.mjs +26 -0
- package/dist/modules/plugins/plugins/identity.mjs.map +7 -0
- package/dist/modules/plugins/plugins/runtime.mjs +50 -0
- package/dist/modules/plugins/plugins/runtime.mjs.map +7 -0
- package/dist/modules/plugins/plugins/schema.mjs +12 -0
- package/dist/modules/plugins/plugins/schema.mjs.map +7 -0
- package/dist/modules/plugins/plugins/ui/panel.mjs +14 -0
- package/dist/modules/plugins/plugins/ui/panel.mjs.map +7 -0
- package/dist/modules/plugins/plugins/ui.mjs +15 -0
- package/dist/modules/plugins/plugins/ui.mjs.map +7 -0
- package/dist/modules/plugins/scene/frontend.mjs +18 -0
- package/dist/modules/plugins/scene/frontend.mjs.map +7 -0
- package/dist/modules/plugins/scene/identity.mjs +14 -0
- package/dist/modules/plugins/scene/identity.mjs.map +7 -0
- package/dist/modules/plugins/scene-tree/frontend.mjs +17 -0
- package/dist/modules/plugins/scene-tree/frontend.mjs.map +7 -0
- package/dist/modules/plugins/scene-tree/i18n.mjs +15 -0
- package/dist/modules/plugins/scene-tree/i18n.mjs.map +7 -0
- package/dist/modules/plugins/scene-tree/identity.mjs +22 -0
- package/dist/modules/plugins/scene-tree/identity.mjs.map +7 -0
- package/dist/modules/plugins/scene-tree/schema.mjs +12 -0
- package/dist/modules/plugins/scene-tree/schema.mjs.map +7 -0
- package/dist/modules/plugins/scene-tree/ui.mjs +16 -0
- package/dist/modules/plugins/scene-tree/ui.mjs.map +7 -0
- package/dist/modules/plugins/texture/frontend.mjs +23 -0
- package/dist/modules/plugins/texture/frontend.mjs.map +7 -0
- package/dist/modules/plugins/texture/i18n.mjs +15 -0
- package/dist/modules/plugins/texture/i18n.mjs.map +7 -0
- package/dist/modules/plugins/texture/identity.mjs +54 -0
- package/dist/modules/plugins/texture/identity.mjs.map +7 -0
- package/dist/modules/plugins/texture/schema.mjs +10 -0
- package/dist/modules/plugins/texture/schema.mjs.map +7 -0
- package/dist/modules/plugins/texture/ui.mjs +26 -0
- package/dist/modules/plugins/texture/ui.mjs.map +7 -0
- package/dist/modules/plugins/viewport/frontend.mjs +27 -0
- package/dist/modules/plugins/viewport/frontend.mjs.map +7 -0
- package/dist/modules/plugins/viewport/identity.mjs +28 -0
- package/dist/modules/plugins/viewport/identity.mjs.map +7 -0
- package/dist/modules/plugins/viewport/presentation-identity.mjs +10 -0
- package/dist/modules/plugins/viewport/presentation-identity.mjs.map +7 -0
- package/dist/modules/plugins/viewport/presentation.mjs +18 -0
- package/dist/modules/plugins/viewport/presentation.mjs.map +7 -0
- package/dist/modules/plugins/viewport/schema.mjs +18 -0
- package/dist/modules/plugins/viewport/schema.mjs.map +7 -0
- package/dist/modules/plugins/viewport/workspace-shell.mjs +29 -0
- package/dist/modules/plugins/viewport/workspace-shell.mjs.map +7 -0
- package/dist/modules/shell/contract.mjs +10 -0
- package/dist/modules/shell/contract.mjs.map +7 -0
- package/dist/modules/shell/frontend.mjs +14 -0
- package/dist/modules/shell/frontend.mjs.map +7 -0
- package/dist/modules/shell/layout-zones.mjs +20 -0
- package/dist/modules/shell/layout-zones.mjs.map +7 -0
- package/dist/modules/start-cli.mjs +57 -0
- package/dist/modules/start-cli.mjs.map +7 -0
- package/dist/modules/start.mjs +18 -0
- package/dist/modules/start.mjs.map +7 -0
- package/dist/modules/viewer/catalog/backend.mjs +47 -0
- package/dist/modules/viewer/catalog/backend.mjs.map +7 -0
- package/dist/modules/viewer/catalog/frontend.mjs +55 -0
- package/dist/modules/viewer/catalog/frontend.mjs.map +7 -0
- package/dist/modules/viewer/catalog/shared.mjs +43 -0
- package/dist/modules/viewer/catalog/shared.mjs.map +7 -0
- package/dist/modules/viewer/catalog.mjs +85 -0
- package/dist/modules/viewer/catalog.mjs.map +7 -0
- package/dist/modules/viewer/cli.mjs +23 -0
- package/dist/modules/viewer/cli.mjs.map +7 -0
- package/dist/modules/viewer-host/frontend.mjs +65 -0
- package/dist/modules/viewer-host/frontend.mjs.map +7 -0
- package/dist/modules/viewer-host/page-registry.mjs +27 -0
- package/dist/modules/viewer-host/page-registry.mjs.map +7 -0
- package/dist/modules/viewer-host/slot-registry.mjs +8 -0
- package/dist/modules/viewer-host/slot-registry.mjs.map +7 -0
- package/dist/modules/viewer-host.mjs +43 -0
- package/dist/modules/viewer-host.mjs.map +7 -0
- package/dist/modules/viewer.mjs +85 -0
- package/dist/modules/viewer.mjs.map +7 -0
- package/dist/modules/workspace/adopt-surface.mjs +16 -0
- package/dist/modules/workspace/adopt-surface.mjs.map +7 -0
- package/dist/modules/workspace/api.mjs +8 -0
- package/dist/modules/workspace/api.mjs.map +7 -0
- package/dist/modules/workspace/backend.mjs +23 -0
- package/dist/modules/workspace/backend.mjs.map +7 -0
- package/dist/modules/workspace/broker.mjs +16 -0
- package/dist/modules/workspace/broker.mjs.map +7 -0
- package/dist/modules/workspace/cli.mjs +9 -0
- package/dist/modules/workspace/cli.mjs.map +7 -0
- package/dist/modules/workspace/client.mjs +15 -0
- package/dist/modules/workspace/client.mjs.map +7 -0
- package/dist/modules/workspace/command-error.mjs +16 -0
- package/dist/modules/workspace/command-error.mjs.map +7 -0
- package/dist/modules/workspace/contract.mjs +71 -0
- package/dist/modules/workspace/contract.mjs.map +7 -0
- package/dist/modules/workspace/demo-client.mjs +127 -0
- package/dist/modules/workspace/demo-client.mjs.map +7 -0
- package/dist/modules/workspace/engine-adapter.mjs +16 -0
- package/dist/modules/workspace/engine-adapter.mjs.map +7 -0
- package/dist/modules/workspace/engine-presentation.mjs +10 -0
- package/dist/modules/workspace/engine-presentation.mjs.map +7 -0
- package/dist/modules/workspace/extension-bridge.mjs +18 -0
- package/dist/modules/workspace/extension-bridge.mjs.map +7 -0
- package/dist/modules/workspace/frontend-plugin.mjs +18 -0
- package/dist/modules/workspace/frontend-plugin.mjs.map +7 -0
- package/dist/modules/workspace/frontend.mjs +29 -0
- package/dist/modules/workspace/frontend.mjs.map +7 -0
- package/dist/modules/workspace/id.mjs +8 -0
- package/dist/modules/workspace/id.mjs.map +7 -0
- package/dist/modules/workspace/inspection-presentation.mjs +12 -0
- package/dist/modules/workspace/inspection-presentation.mjs.map +7 -0
- package/dist/modules/workspace/locale-bridge.mjs +14 -0
- package/dist/modules/workspace/locale-bridge.mjs.map +7 -0
- package/dist/modules/workspace/page-title.mjs +13 -0
- package/dist/modules/workspace/page-title.mjs.map +7 -0
- package/dist/modules/workspace/presentation.mjs +18 -0
- package/dist/modules/workspace/presentation.mjs.map +7 -0
- package/dist/modules/workspace/preview-surface.mjs +17 -0
- package/dist/modules/workspace/preview-surface.mjs.map +7 -0
- package/dist/modules/workspace/project-session.mjs +18 -0
- package/dist/modules/workspace/project-session.mjs.map +7 -0
- package/dist/modules/workspace/render-resize-sync.mjs +12 -0
- package/dist/modules/workspace/render-resize-sync.mjs.map +7 -0
- package/dist/modules/workspace/resident.mjs +16 -0
- package/dist/modules/workspace/resident.mjs.map +7 -0
- package/dist/modules/workspace/resource-open.mjs +34 -0
- package/dist/modules/workspace/resource-open.mjs.map +7 -0
- package/dist/modules/workspace/resource-page.mjs +27 -0
- package/dist/modules/workspace/resource-page.mjs.map +7 -0
- package/dist/modules/workspace/tool-runtime.mjs +14 -0
- package/dist/modules/workspace/tool-runtime.mjs.map +7 -0
- package/dist/modules/workspace/view-trace.mjs +60 -0
- package/dist/modules/workspace/view-trace.mjs.map +7 -0
- package/dist/modules/workspace/workspace-client-connection.mjs +22 -0
- package/dist/modules/workspace/workspace-client-connection.mjs.map +7 -0
- package/dist/modules/workspace/workspace-recovery.mjs +35 -0
- package/dist/modules/workspace/workspace-recovery.mjs.map +7 -0
- package/dist/modules/workspace/workspace-state.mjs +12 -0
- package/dist/modules/workspace/workspace-state.mjs.map +7 -0
- package/dist/modules/workspace-frontend.mjs +17 -0
- package/dist/modules/workspace-frontend.mjs.map +7 -0
- package/dist/viewer/assets/chunk-CilyBKbf.js +1 -0
- package/dist/viewer/assets/core-DSQma37-.js +13 -0
- package/dist/viewer/assets/core-DSQma37-.js.map +1 -0
- package/dist/viewer/assets/css-Bq1BXecw.js +2 -0
- package/dist/viewer/assets/css-Bq1BXecw.js.map +1 -0
- package/dist/viewer/assets/css-CWQWazmX.js +1 -0
- package/dist/viewer/assets/embedded-D4ZDx--W.js +2 -0
- package/dist/viewer/assets/embedded-D4ZDx--W.js.map +1 -0
- package/dist/viewer/assets/engine-javascript-BvokIV9O.js +142 -0
- package/dist/viewer/assets/engine-javascript-BvokIV9O.js.map +1 -0
- package/dist/viewer/assets/github-dark-default-DaDlj-WZ.js +2 -0
- package/dist/viewer/assets/github-dark-default-DaDlj-WZ.js.map +1 -0
- package/dist/viewer/assets/github-light-default-BqhWxAZd.js +2 -0
- package/dist/viewer/assets/github-light-default-BqhWxAZd.js.map +1 -0
- package/dist/viewer/assets/glsl-BJgVnv11.js +2 -0
- package/dist/viewer/assets/glsl-BJgVnv11.js.map +1 -0
- package/dist/viewer/assets/html-AaaHGGyt.js +2 -0
- package/dist/viewer/assets/html-AaaHGGyt.js.map +1 -0
- package/dist/viewer/assets/javascript-BX9W64FE.js +1 -0
- package/dist/viewer/assets/javascript-DQODvD07.js +2 -0
- package/dist/viewer/assets/javascript-DQODvD07.js.map +1 -0
- package/dist/viewer/assets/json-CpcIDpT7.js +2 -0
- package/dist/viewer/assets/json-CpcIDpT7.js.map +1 -0
- package/dist/viewer/assets/json5-Czq4A7dk.js +2 -0
- package/dist/viewer/assets/json5-Czq4A7dk.js.map +1 -0
- package/dist/viewer/assets/jsonc-BXDfCMmu.js +2 -0
- package/dist/viewer/assets/jsonc-BXDfCMmu.js.map +1 -0
- package/dist/viewer/assets/jsx-DAWscEnf.js +2 -0
- package/dist/viewer/assets/jsx-DAWscEnf.js.map +1 -0
- package/dist/viewer/assets/main-C-2CHTN_.js +15 -0
- package/dist/viewer/assets/main-C-2CHTN_.js.map +1 -0
- package/dist/viewer/assets/markdown-Cx1FMNw-.js +2 -0
- package/dist/viewer/assets/markdown-Cx1FMNw-.js.map +1 -0
- package/dist/viewer/assets/panels-entry-Ddhfjgf0.js +46 -0
- package/dist/viewer/assets/panels-entry-Ddhfjgf0.js.map +1 -0
- package/dist/viewer/assets/python-CYPKjWV9.js +2 -0
- package/dist/viewer/assets/python-CYPKjWV9.js.map +1 -0
- package/dist/viewer/assets/rust-0e5cNx_V.js +2 -0
- package/dist/viewer/assets/rust-0e5cNx_V.js.map +1 -0
- package/dist/viewer/assets/scss-B-aKzLbT.js +2 -0
- package/dist/viewer/assets/scss-B-aKzLbT.js.map +1 -0
- package/dist/viewer/assets/shellscript-CpXD-pSm.js +2 -0
- package/dist/viewer/assets/shellscript-CpXD-pSm.js.map +1 -0
- package/dist/viewer/assets/style-ClttNKZk.css +2 -0
- package/dist/viewer/assets/styles-BXozhwiU.js +11 -0
- package/dist/viewer/assets/styles-BXozhwiU.js.map +1 -0
- package/dist/viewer/assets/toml-GmchYTXa.js +2 -0
- package/dist/viewer/assets/toml-GmchYTXa.js.map +1 -0
- package/dist/viewer/assets/tsx-Crj1Bi53.js +2 -0
- package/dist/viewer/assets/tsx-Crj1Bi53.js.map +1 -0
- package/dist/viewer/assets/typescript-xi0cSHCO.js +2 -0
- package/dist/viewer/assets/typescript-xi0cSHCO.js.map +1 -0
- package/dist/viewer/assets/wgsl-BoEPRo9U.js +2 -0
- package/dist/viewer/assets/wgsl-BoEPRo9U.js.map +1 -0
- package/dist/viewer/assets/xml-B8JqQrMD.js +2 -0
- package/dist/viewer/assets/xml-B8JqQrMD.js.map +1 -0
- package/dist/viewer/assets/yaml-DsIB85X9.js +2 -0
- package/dist/viewer/assets/yaml-DsIB85X9.js.map +1 -0
- package/dist/viewer/index.html +15 -0
- package/dist/viewer/panels.js +1 -0
- package/host.pack.json +13 -0
- package/package.json +174 -0
- package/skills/forgeax-view-cli/SKILL.md +74 -0
- package/skills/forgeax-view-start/SKILL.md +202 -0
- package/skills/forgeax-view-start/scripts/start-view.mjs +202 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ViewWorkspaceError
|
|
3
|
+
} from "./chunk-32GD5LL6.mjs";
|
|
4
|
+
|
|
5
|
+
// packages/view-workspace-core/src/engine-adapter.mjs
|
|
6
|
+
var VIEW_ENGINE_WORKSPACE_ADAPTER = Object.freeze({
|
|
7
|
+
openProject: "openProject({ root })",
|
|
8
|
+
closeProject: "closeProject({ project })",
|
|
9
|
+
listAssets: "assetList({ root }) | listAssets({ project })",
|
|
10
|
+
openPreview: "openPreview({ project, asset, width, height })",
|
|
11
|
+
closePreview: "preview.close()",
|
|
12
|
+
resizePreview: "preview.resize({ width, height })",
|
|
13
|
+
getCamera: "preview.getCamera()",
|
|
14
|
+
beginCamera: "preview.beginCameraInteraction({ interactionId, baseVersion, clientId })",
|
|
15
|
+
updateCamera: "preview.updateCameraDraft({ interactionId, input | camera })",
|
|
16
|
+
commitCamera: "preview.commitCamera({ interactionId, operationId, expectedVersion, camera })",
|
|
17
|
+
abortCamera: "preview.abortCamera({ interactionId, reason })",
|
|
18
|
+
capture: "preview.capture(options)",
|
|
19
|
+
assetInspect: "assetInspect({ root, subject })",
|
|
20
|
+
packInspect: "ScriptablePackAuthoringPort.inspect(sourcePath)",
|
|
21
|
+
packRebuild: "ScriptablePackAuthoringPort.rebuild(sourcePath, 'rebuild' | 'cold-cook')",
|
|
22
|
+
packGateway: "gateway.execute({ kind: 'inspect-meta' | 'rebuild' | 'cold-cook', sourcePath, requestId, expectedRevision })",
|
|
23
|
+
packTools: "ToolClient.run('asset-source.rebuild' | 'asset-source.cold-cook', args)"
|
|
24
|
+
});
|
|
25
|
+
var VIEW_ENGINE_ASSET_SOURCE_TOOLS = Object.freeze({
|
|
26
|
+
rebuild: "asset-source.rebuild",
|
|
27
|
+
"cold-cook": "asset-source.cold-cook"
|
|
28
|
+
});
|
|
29
|
+
function missing(name) {
|
|
30
|
+
throw new ViewWorkspaceError(
|
|
31
|
+
"view-engine-capability-unavailable",
|
|
32
|
+
`Engine workspace capability ${name} to be installed`,
|
|
33
|
+
"Build and install the matching Engine workspace plugin before opening a project.",
|
|
34
|
+
{ capability: name }
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
function method(source, names, name, { optional = false } = {}) {
|
|
38
|
+
for (const candidate of names) {
|
|
39
|
+
if (typeof source?.[candidate] === "function") return source[candidate].bind(source);
|
|
40
|
+
}
|
|
41
|
+
return optional ? void 0 : () => missing(name);
|
|
42
|
+
}
|
|
43
|
+
function asObject(value, name) {
|
|
44
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
45
|
+
throw new ViewWorkspaceError(
|
|
46
|
+
"view-engine-invalid-result",
|
|
47
|
+
`Engine ${name} to return an object`,
|
|
48
|
+
"Inspect the Engine workspace plugin result contract.",
|
|
49
|
+
{ capability: name }
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
function previewMethod(preview, names, name, { optional = false } = {}) {
|
|
55
|
+
for (const candidate of names) {
|
|
56
|
+
if (typeof preview?.[candidate] === "function") return preview[candidate].bind(preview);
|
|
57
|
+
}
|
|
58
|
+
return optional ? void 0 : () => missing(name);
|
|
59
|
+
}
|
|
60
|
+
function engineFailure(error, capability) {
|
|
61
|
+
if (error instanceof ViewWorkspaceError) throw error;
|
|
62
|
+
const payload = error !== null && typeof error === "object" ? error : { message: String(error) };
|
|
63
|
+
const message = typeof payload.message === "string" && payload.message.trim() !== "" ? payload.message : String(error);
|
|
64
|
+
const code = typeof payload.code === "string" && payload.code.length > 0 ? payload.code : "view-engine-invalid-result";
|
|
65
|
+
throw new ViewWorkspaceError(
|
|
66
|
+
code,
|
|
67
|
+
typeof payload.expected === "string" ? payload.expected : message,
|
|
68
|
+
typeof payload.hint === "string" ? payload.hint : message,
|
|
69
|
+
{
|
|
70
|
+
capability,
|
|
71
|
+
message,
|
|
72
|
+
...typeof payload.name === "string" ? { name: payload.name } : {},
|
|
73
|
+
...typeof payload.stack === "string" ? { stack: payload.stack } : {},
|
|
74
|
+
...payload.detail !== null && typeof payload.detail === "object" && !Array.isArray(payload.detail) ? payload.detail : payload.detail === void 0 ? {} : { engineDetail: payload.detail },
|
|
75
|
+
...typeof payload.actual === "string" ? { actual: payload.actual } : {}
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
function unwrapEngineResult(result, capability) {
|
|
80
|
+
if (Array.isArray(result)) return result;
|
|
81
|
+
if (result === void 0) return result;
|
|
82
|
+
if (result !== null && typeof result === "object") {
|
|
83
|
+
if ("ok" in result) {
|
|
84
|
+
if (result.ok === true) return result.value;
|
|
85
|
+
engineFailure(result.error ?? result, capability);
|
|
86
|
+
}
|
|
87
|
+
if (result.outcome === "succeeded") return result.result;
|
|
88
|
+
if (result.outcome === "failed") engineFailure(result.failure ?? result, capability);
|
|
89
|
+
}
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
function projectCatalogDdc(entry) {
|
|
93
|
+
if (!entry || typeof entry !== "object") return void 0;
|
|
94
|
+
if (entry.ddc !== null && typeof entry.ddc === "object" && !Array.isArray(entry.ddc)) {
|
|
95
|
+
return entry.ddc;
|
|
96
|
+
}
|
|
97
|
+
const receiptUrl = typeof entry.cookReceiptUrl === "string" ? entry.cookReceiptUrl : typeof entry.receiptUrl === "string" ? entry.receiptUrl : void 0;
|
|
98
|
+
const packageUrl = typeof entry.packageUrl === "string" ? entry.packageUrl : void 0;
|
|
99
|
+
const state = typeof entry.lifecycle === "string" ? entry.lifecycle : typeof entry.state === "string" ? entry.state : void 0;
|
|
100
|
+
if (receiptUrl === void 0 && packageUrl === void 0 && state === void 0) return void 0;
|
|
101
|
+
return {
|
|
102
|
+
...entry.guid === void 0 ? {} : { guid: String(entry.guid) },
|
|
103
|
+
...state === void 0 ? {} : { state },
|
|
104
|
+
...receiptUrl === void 0 ? {} : { receiptUrl },
|
|
105
|
+
...packageUrl === void 0 ? {} : { hint: packageUrl }
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function packNamespace(source) {
|
|
109
|
+
return source?.pack ?? source?.scriptablePack ?? source?.authoring ?? source?.assetSource ?? null;
|
|
110
|
+
}
|
|
111
|
+
function gatewayOf(source, pack) {
|
|
112
|
+
const candidate = source?.gateway ?? pack?.gateway ?? source?.scriptablePackGateway ?? pack;
|
|
113
|
+
return typeof candidate?.execute === "function" ? candidate : null;
|
|
114
|
+
}
|
|
115
|
+
function toolClientOf(source) {
|
|
116
|
+
const candidate = source?.tools ?? source?.toolClient ?? source;
|
|
117
|
+
return typeof candidate?.run === "function" ? candidate : null;
|
|
118
|
+
}
|
|
119
|
+
function isPackTs(sourcePath) {
|
|
120
|
+
return typeof sourcePath === "string" && sourcePath.endsWith(".pack.ts");
|
|
121
|
+
}
|
|
122
|
+
function createEngineWorkspaceAdapter(engine) {
|
|
123
|
+
const source = engine?.workspace ?? engine;
|
|
124
|
+
const projectSource = source?.project ?? source;
|
|
125
|
+
const assetSource = source?.assets ?? source;
|
|
126
|
+
const previewSource = source?.preview ?? source;
|
|
127
|
+
const pack = packNamespace(source);
|
|
128
|
+
const gateway = gatewayOf(source, pack);
|
|
129
|
+
const tools = toolClientOf(source);
|
|
130
|
+
const openProject = method(projectSource, ["openProject", "open"], "project.open");
|
|
131
|
+
const closeProject = method(projectSource, ["closeProject", "close"], "project.close");
|
|
132
|
+
const listAssets = method(
|
|
133
|
+
assetSource,
|
|
134
|
+
["listAssets", "list", "assetList", "asset.list"],
|
|
135
|
+
"assets.list"
|
|
136
|
+
);
|
|
137
|
+
const openPreview = method(previewSource, ["openPreview", "openAsset", "openScene", "open"], "asset.open");
|
|
138
|
+
const assetInspect = method(
|
|
139
|
+
assetSource,
|
|
140
|
+
["assetInspect", "asset.inspect"],
|
|
141
|
+
"asset.inspect",
|
|
142
|
+
{ optional: true }
|
|
143
|
+
);
|
|
144
|
+
const packInspect = method(
|
|
145
|
+
pack ?? {},
|
|
146
|
+
["inspect", "inspectMeta"],
|
|
147
|
+
"asset-source.inspect-meta",
|
|
148
|
+
{ optional: true }
|
|
149
|
+
);
|
|
150
|
+
const packPreflight = method(pack ?? {}, ["preflight"], "asset.preflight", { optional: true });
|
|
151
|
+
const packRebuild = method(pack ?? {}, ["rebuild"], "asset-source.rebuild", { optional: true });
|
|
152
|
+
async function runTool(id, args, capability) {
|
|
153
|
+
if (!tools) missing(capability);
|
|
154
|
+
return unwrapEngineResult(await tools.run(id, args), capability);
|
|
155
|
+
}
|
|
156
|
+
async function inspectPackMeta(sourcePath, requestId) {
|
|
157
|
+
if (typeof sourcePath !== "string" || sourcePath.length === 0) return void 0;
|
|
158
|
+
if (packInspect) {
|
|
159
|
+
return asObject(
|
|
160
|
+
unwrapEngineResult(await packInspect(sourcePath), "asset-source.inspect-meta"),
|
|
161
|
+
"asset-source.inspect-meta"
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
if (gateway) {
|
|
165
|
+
return asObject(
|
|
166
|
+
unwrapEngineResult(
|
|
167
|
+
await gateway.execute({
|
|
168
|
+
kind: "inspect-meta",
|
|
169
|
+
sourcePath,
|
|
170
|
+
requestId: requestId ?? "view-inspect-meta"
|
|
171
|
+
}),
|
|
172
|
+
"asset-source.inspect-meta"
|
|
173
|
+
),
|
|
174
|
+
"asset-source.inspect-meta"
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
return void 0;
|
|
178
|
+
}
|
|
179
|
+
return Object.freeze({
|
|
180
|
+
async openProject(input) {
|
|
181
|
+
return asObject(await openProject(input), "project.open");
|
|
182
|
+
},
|
|
183
|
+
async closeProject(input) {
|
|
184
|
+
return closeProject(input);
|
|
185
|
+
},
|
|
186
|
+
async listAssets(input) {
|
|
187
|
+
const result = unwrapEngineResult(
|
|
188
|
+
await listAssets({
|
|
189
|
+
...input,
|
|
190
|
+
root: input?.project?.root ?? input?.root
|
|
191
|
+
}),
|
|
192
|
+
"assets.list"
|
|
193
|
+
);
|
|
194
|
+
const entries = Array.isArray(result) ? result : Array.isArray(result?.entries) ? result.entries : void 0;
|
|
195
|
+
if (!Array.isArray(entries)) {
|
|
196
|
+
throw new ViewWorkspaceError(
|
|
197
|
+
"view-engine-invalid-result",
|
|
198
|
+
"Engine assets.list to return an array",
|
|
199
|
+
"Inspect the Engine asset catalog plugin result.",
|
|
200
|
+
{ capability: "assets.list" }
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
return entries;
|
|
204
|
+
},
|
|
205
|
+
async openPreview(input) {
|
|
206
|
+
let rawResult;
|
|
207
|
+
try {
|
|
208
|
+
rawResult = await openPreview(input);
|
|
209
|
+
} catch (error) {
|
|
210
|
+
if (error?.code === "engine-workspace-preview-capability-unavailable" || error?.detail?.code === "engine-workspace-preview-capability-unavailable" || /workspace preview (?:does not support asset kind|only supports SceneAsset)/i.test(error?.message ?? "")) {
|
|
211
|
+
const kind = typeof error?.detail?.kind === "string" ? error.detail.kind : input.asset?.kind;
|
|
212
|
+
throw new ViewWorkspaceError(
|
|
213
|
+
"view-workspace-asset-unsupported",
|
|
214
|
+
`Engine asset.open to support asset kind ${kind}`,
|
|
215
|
+
"Use an Engine type-preview capability for this asset kind.",
|
|
216
|
+
{ kind }
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
throw error;
|
|
220
|
+
}
|
|
221
|
+
const result = asObject(rawResult, "asset.open");
|
|
222
|
+
const target = asObject(result.target, "asset.open target");
|
|
223
|
+
if (typeof target.targetId !== "string" && typeof target.targetId !== "number") {
|
|
224
|
+
throw new ViewWorkspaceError(
|
|
225
|
+
"view-engine-invalid-result",
|
|
226
|
+
"Engine asset.open to return a stable target.targetId",
|
|
227
|
+
"The Engine preview target must expose its identity for API routing.",
|
|
228
|
+
{ capability: "asset.open" }
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
const handle = result.handle ?? result.preview ?? result;
|
|
232
|
+
return Object.freeze({
|
|
233
|
+
...result,
|
|
234
|
+
target: Object.freeze({ ...target, targetId: String(target.targetId) }),
|
|
235
|
+
handle
|
|
236
|
+
});
|
|
237
|
+
},
|
|
238
|
+
async closePreview(preview, input) {
|
|
239
|
+
const close = previewMethod(preview, ["close", "dispose"], "preview.close");
|
|
240
|
+
return close(input);
|
|
241
|
+
},
|
|
242
|
+
async getCamera(preview, input) {
|
|
243
|
+
const get = previewMethod(preview, ["getCamera", "cameraGet"], "camera.get");
|
|
244
|
+
return get(input);
|
|
245
|
+
},
|
|
246
|
+
async beginCamera(preview, input) {
|
|
247
|
+
const begin = previewMethod(preview, ["beginCameraInteraction", "beginCamera"], "camera.begin");
|
|
248
|
+
return begin(input);
|
|
249
|
+
},
|
|
250
|
+
async updateCamera(preview, input) {
|
|
251
|
+
const update = previewMethod(preview, ["updateCameraDraft", "updateCamera"], "camera.update");
|
|
252
|
+
return update(input);
|
|
253
|
+
},
|
|
254
|
+
async commitCamera(preview, input) {
|
|
255
|
+
const commit = previewMethod(preview, ["commitCamera", "setCamera"], "camera.commit");
|
|
256
|
+
return commit(input);
|
|
257
|
+
},
|
|
258
|
+
async abortCamera(preview, input) {
|
|
259
|
+
const abort = previewMethod(preview, ["abortCameraInteraction", "abortCamera"], "camera.abort");
|
|
260
|
+
return abort(input);
|
|
261
|
+
},
|
|
262
|
+
async capture(preview, input) {
|
|
263
|
+
const capture = previewMethod(preview, ["capture"], "preview.capture");
|
|
264
|
+
return capture(input);
|
|
265
|
+
},
|
|
266
|
+
async resizePreview(preview, input) {
|
|
267
|
+
const resize = previewMethod(preview, ["resize", "resizePreview", "setRenderSize"], "preview.resize");
|
|
268
|
+
return resize(input);
|
|
269
|
+
},
|
|
270
|
+
async inspectAsset(input) {
|
|
271
|
+
const asset = input?.asset ?? {};
|
|
272
|
+
const root = input?.project?.root ?? input?.root;
|
|
273
|
+
const subject = input?.subject ?? asset.guid;
|
|
274
|
+
let entry = asset;
|
|
275
|
+
if (assetInspect) {
|
|
276
|
+
entry = unwrapEngineResult(
|
|
277
|
+
await assetInspect({
|
|
278
|
+
...input,
|
|
279
|
+
root,
|
|
280
|
+
subject
|
|
281
|
+
}),
|
|
282
|
+
"asset.inspect"
|
|
283
|
+
);
|
|
284
|
+
entry = asObject(entry, "asset.inspect");
|
|
285
|
+
} else if (tools) {
|
|
286
|
+
try {
|
|
287
|
+
entry = asObject(
|
|
288
|
+
unwrapEngineResult(
|
|
289
|
+
await tools.run("asset.inspect", { root, subject }),
|
|
290
|
+
"asset.inspect"
|
|
291
|
+
),
|
|
292
|
+
"asset.inspect"
|
|
293
|
+
);
|
|
294
|
+
} catch (error) {
|
|
295
|
+
if (error?.code === "view-engine-capability-unavailable") throw error;
|
|
296
|
+
if (!asset?.guid) throw error;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
const sourcePath = entry.sourcePath ?? asset.sourcePath;
|
|
300
|
+
const packMeta = isPackTs(sourcePath) ? await inspectPackMeta(sourcePath, input?.requestId) : void 0;
|
|
301
|
+
if (!entry?.guid && !asset?.guid) missing("asset.inspect");
|
|
302
|
+
const revision = packMeta?.revision ?? entry.revision ?? asset.revision;
|
|
303
|
+
return {
|
|
304
|
+
guid: entry.guid ?? asset.guid,
|
|
305
|
+
asset: { ...asset, ...entry },
|
|
306
|
+
...sourcePath === void 0 ? {} : {
|
|
307
|
+
source: {
|
|
308
|
+
path: sourcePath,
|
|
309
|
+
...isPackTs(sourcePath) ? { kind: "pack.ts" } : {},
|
|
310
|
+
...revision === void 0 ? {} : { revision: String(revision) }
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
...packMeta?.meta === void 0 ? {} : { meta: packMeta.meta },
|
|
314
|
+
...revision === void 0 ? {} : { revision: String(revision) },
|
|
315
|
+
...projectCatalogDdc({ ...asset, ...entry }) === void 0 ? {} : { ddc: projectCatalogDdc({ ...asset, ...entry }) }
|
|
316
|
+
};
|
|
317
|
+
},
|
|
318
|
+
async rebuild(input) {
|
|
319
|
+
const mode = input?.mode === "cold-cook" ? "cold-cook" : "rebuild";
|
|
320
|
+
const capability = VIEW_ENGINE_ASSET_SOURCE_TOOLS[mode];
|
|
321
|
+
const sourcePath = input?.sourcePath ?? input?.asset?.sourcePath;
|
|
322
|
+
const expectedRevision = input?.expectedRevision;
|
|
323
|
+
const requestId = input?.requestId;
|
|
324
|
+
const args = {
|
|
325
|
+
...sourcePath === void 0 ? {} : { sourcePath },
|
|
326
|
+
...input?.asset?.guid === void 0 ? {} : { guid: input.asset.guid, ownerGuid: input.asset.guid },
|
|
327
|
+
...requestId === void 0 ? {} : { requestId },
|
|
328
|
+
...expectedRevision === void 0 ? {} : { expectedRevision }
|
|
329
|
+
};
|
|
330
|
+
if (gateway && sourcePath) {
|
|
331
|
+
return asObject(
|
|
332
|
+
unwrapEngineResult(
|
|
333
|
+
await gateway.execute({
|
|
334
|
+
kind: mode,
|
|
335
|
+
sourcePath,
|
|
336
|
+
requestId: requestId ?? `view-${mode}`,
|
|
337
|
+
...expectedRevision === void 0 ? {} : { expectedRevision }
|
|
338
|
+
}),
|
|
339
|
+
capability
|
|
340
|
+
),
|
|
341
|
+
capability
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
if (packRebuild && sourcePath) {
|
|
345
|
+
if (packPreflight && expectedRevision !== void 0) {
|
|
346
|
+
const preflight = asObject(
|
|
347
|
+
unwrapEngineResult(await packPreflight(sourcePath), "asset.preflight"),
|
|
348
|
+
"asset.preflight"
|
|
349
|
+
);
|
|
350
|
+
if (String(preflight.revision) !== String(expectedRevision)) {
|
|
351
|
+
engineFailure(
|
|
352
|
+
{
|
|
353
|
+
code: "pack-source-revision-conflict",
|
|
354
|
+
expected: expectedRevision,
|
|
355
|
+
actual: preflight.revision,
|
|
356
|
+
hint: "inspect the current source revision, then retry the build with a new requestId",
|
|
357
|
+
detail: { sourcePath, requestId }
|
|
358
|
+
},
|
|
359
|
+
capability
|
|
360
|
+
);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return asObject(
|
|
364
|
+
unwrapEngineResult(await packRebuild(sourcePath, mode), capability),
|
|
365
|
+
capability
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
if (tools) {
|
|
369
|
+
return asObject(await runTool(capability, args, capability), capability);
|
|
370
|
+
}
|
|
371
|
+
missing(capability);
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
function isEngineWorkspaceAdapter(value) {
|
|
376
|
+
const assets = value?.assets ?? value;
|
|
377
|
+
const preview = value?.preview ?? value;
|
|
378
|
+
return Boolean(
|
|
379
|
+
value && typeof (value.openProject ?? value.open) === "function" && typeof (value.closeProject ?? value.close) === "function" && typeof (assets.listAssets ?? assets.list ?? assets.assetList ?? assets["asset.list"]) === "function" && typeof (preview.openPreview ?? preview.openAsset ?? preview.openScene ?? preview.open) === "function"
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export {
|
|
384
|
+
VIEW_ENGINE_WORKSPACE_ADAPTER,
|
|
385
|
+
VIEW_ENGINE_ASSET_SOURCE_TOOLS,
|
|
386
|
+
createEngineWorkspaceAdapter,
|
|
387
|
+
isEngineWorkspaceAdapter
|
|
388
|
+
};
|
|
389
|
+
//# sourceMappingURL=chunk-FD4BAJ6K.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../packages/view-workspace-core/src/engine-adapter.mjs"],
|
|
4
|
+
"sourcesContent": ["import { ViewWorkspaceError } from './contract.mjs';\n\n/**\n * View binds the Engine public workspace / DevKit / ScriptablePack surfaces.\n * It does not invent inspectAsset, applyParams, cookAsset, or inspectDdc.\n *\n * Engine owners:\n * - catalog: `assetList` / `asset.list` / existing `listAssets` \u2192 PackEntry[]\n * - inspect: DevKit `assetInspect({ root, subject })` plus optional\n * ScriptablePack `inspect(sourcePath)` / gateway `inspect-meta`\n * - cook: ScriptablePack `rebuild(sourcePath, mode)` / gateway\n * `rebuild`|`cold-cook` / ToolClient `asset-source.rebuild`|`asset-source.cold-cook`\n */\nexport const VIEW_ENGINE_WORKSPACE_ADAPTER = Object.freeze({\n openProject: 'openProject({ root })',\n closeProject: 'closeProject({ project })',\n listAssets: 'assetList({ root }) | listAssets({ project })',\n openPreview: 'openPreview({ project, asset, width, height })',\n closePreview: 'preview.close()',\n resizePreview: 'preview.resize({ width, height })',\n getCamera: 'preview.getCamera()',\n beginCamera: 'preview.beginCameraInteraction({ interactionId, baseVersion, clientId })',\n updateCamera: 'preview.updateCameraDraft({ interactionId, input | camera })',\n commitCamera: 'preview.commitCamera({ interactionId, operationId, expectedVersion, camera })',\n abortCamera: 'preview.abortCamera({ interactionId, reason })',\n capture: 'preview.capture(options)',\n assetInspect: 'assetInspect({ root, subject })',\n packInspect: 'ScriptablePackAuthoringPort.inspect(sourcePath)',\n packRebuild: \"ScriptablePackAuthoringPort.rebuild(sourcePath, 'rebuild' | 'cold-cook')\",\n packGateway: \"gateway.execute({ kind: 'inspect-meta' | 'rebuild' | 'cold-cook', sourcePath, requestId, expectedRevision })\",\n packTools: \"ToolClient.run('asset-source.rebuild' | 'asset-source.cold-cook', args)\",\n});\n\nexport const VIEW_ENGINE_ASSET_SOURCE_TOOLS = Object.freeze({\n rebuild: 'asset-source.rebuild',\n 'cold-cook': 'asset-source.cold-cook',\n});\n\nfunction missing(name) {\n throw new ViewWorkspaceError(\n 'view-engine-capability-unavailable',\n `Engine workspace capability ${name} to be installed`,\n 'Build and install the matching Engine workspace plugin before opening a project.',\n { capability: name },\n );\n}\n\nfunction method(source, names, name, { optional = false } = {}) {\n for (const candidate of names) {\n if (typeof source?.[candidate] === 'function') return source[candidate].bind(source);\n }\n return optional ? undefined : () => missing(name);\n}\n\nfunction asObject(value, name) {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) {\n throw new ViewWorkspaceError(\n 'view-engine-invalid-result',\n `Engine ${name} to return an object`,\n 'Inspect the Engine workspace plugin result contract.',\n { capability: name },\n );\n }\n return value;\n}\n\nfunction previewMethod(preview, names, name, { optional = false } = {}) {\n // Engine's public shape puts operations on the outer preview. `handle` is\n // an opaque resource bundle and must never become a second operation\n // surface, otherwise a client can accidentally bypass the Engine contract.\n for (const candidate of names) {\n if (typeof preview?.[candidate] === 'function') return preview[candidate].bind(preview);\n }\n return optional ? undefined : () => missing(name);\n}\n\nfunction engineFailure(error, capability) {\n if (error instanceof ViewWorkspaceError) throw error;\n const payload = error !== null && typeof error === 'object' ? error : { message: String(error) };\n const message =\n typeof payload.message === 'string' && payload.message.trim() !== ''\n ? payload.message\n : String(error);\n const code =\n typeof payload.code === 'string' && payload.code.length > 0\n ? payload.code\n : 'view-engine-invalid-result';\n throw new ViewWorkspaceError(\n code,\n typeof payload.expected === 'string' ? payload.expected : message,\n typeof payload.hint === 'string' ? payload.hint : message,\n {\n capability,\n message,\n ...(typeof payload.name === 'string' ? { name: payload.name } : {}),\n ...(typeof payload.stack === 'string' ? { stack: payload.stack } : {}),\n ...(payload.detail !== null && typeof payload.detail === 'object' && !Array.isArray(payload.detail)\n ? payload.detail\n : payload.detail === undefined\n ? {}\n : { engineDetail: payload.detail }),\n ...(typeof payload.actual === 'string' ? { actual: payload.actual } : {}),\n },\n );\n}\n\nfunction unwrapEngineResult(result, capability) {\n if (Array.isArray(result)) return result;\n if (result === undefined) return result;\n if (result !== null && typeof result === 'object') {\n if ('ok' in result) {\n if (result.ok === true) return result.value;\n engineFailure(result.error ?? result, capability);\n }\n if (result.outcome === 'succeeded') return result.result;\n if (result.outcome === 'failed') engineFailure(result.failure ?? result, capability);\n }\n return result;\n}\n\nfunction projectCatalogDdc(entry) {\n if (!entry || typeof entry !== 'object') return undefined;\n if (entry.ddc !== null && typeof entry.ddc === 'object' && !Array.isArray(entry.ddc)) {\n return entry.ddc;\n }\n const receiptUrl =\n typeof entry.cookReceiptUrl === 'string'\n ? entry.cookReceiptUrl\n : typeof entry.receiptUrl === 'string'\n ? entry.receiptUrl\n : undefined;\n const packageUrl = typeof entry.packageUrl === 'string' ? entry.packageUrl : undefined;\n const state =\n typeof entry.lifecycle === 'string'\n ? entry.lifecycle\n : typeof entry.state === 'string'\n ? entry.state\n : undefined;\n if (receiptUrl === undefined && packageUrl === undefined && state === undefined) return undefined;\n return {\n ...(entry.guid === undefined ? {} : { guid: String(entry.guid) }),\n ...(state === undefined ? {} : { state }),\n ...(receiptUrl === undefined ? {} : { receiptUrl }),\n ...(packageUrl === undefined ? {} : { hint: packageUrl }),\n };\n}\n\nfunction packNamespace(source) {\n return source?.pack ?? source?.scriptablePack ?? source?.authoring ?? source?.assetSource ?? null;\n}\n\nfunction gatewayOf(source, pack) {\n const candidate = source?.gateway ?? pack?.gateway ?? source?.scriptablePackGateway ?? pack;\n return typeof candidate?.execute === 'function' ? candidate : null;\n}\n\nfunction toolClientOf(source) {\n const candidate = source?.tools ?? source?.toolClient ?? source;\n return typeof candidate?.run === 'function' ? candidate : null;\n}\n\nfunction isPackTs(sourcePath) {\n return typeof sourcePath === 'string' && sourcePath.endsWith('.pack.ts');\n}\n\n/**\n * Normalize the Engine public workspace capability into one call surface.\n * This function only adapts naming; all project, asset, target, scene and\n * camera behavior remains in the supplied Engine implementation.\n */\nexport function createEngineWorkspaceAdapter(engine) {\n const source = engine?.workspace ?? engine;\n const projectSource = source?.project ?? source;\n const assetSource = source?.assets ?? source;\n const previewSource = source?.preview ?? source;\n const pack = packNamespace(source);\n const gateway = gatewayOf(source, pack);\n const tools = toolClientOf(source);\n\n const openProject = method(projectSource, ['openProject', 'open'], 'project.open');\n const closeProject = method(projectSource, ['closeProject', 'close'], 'project.close');\n const listAssets = method(\n assetSource,\n ['listAssets', 'list', 'assetList', 'asset.list'],\n 'assets.list',\n );\n const openPreview = method(previewSource, ['openPreview', 'openAsset', 'openScene', 'open'], 'asset.open');\n const assetInspect = method(\n assetSource,\n ['assetInspect', 'asset.inspect'],\n 'asset.inspect',\n { optional: true },\n );\n const packInspect = method(\n pack ?? {},\n ['inspect', 'inspectMeta'],\n 'asset-source.inspect-meta',\n { optional: true },\n );\n const packPreflight = method(pack ?? {}, ['preflight'], 'asset.preflight', { optional: true });\n const packRebuild = method(pack ?? {}, ['rebuild'], 'asset-source.rebuild', { optional: true });\n\n async function runTool(id, args, capability) {\n if (!tools) missing(capability);\n return unwrapEngineResult(await tools.run(id, args), capability);\n }\n\n async function inspectPackMeta(sourcePath, requestId) {\n if (typeof sourcePath !== 'string' || sourcePath.length === 0) return undefined;\n if (packInspect) {\n return asObject(\n unwrapEngineResult(await packInspect(sourcePath), 'asset-source.inspect-meta'),\n 'asset-source.inspect-meta',\n );\n }\n if (gateway) {\n return asObject(\n unwrapEngineResult(\n await gateway.execute({\n kind: 'inspect-meta',\n sourcePath,\n requestId: requestId ?? 'view-inspect-meta',\n }),\n 'asset-source.inspect-meta',\n ),\n 'asset-source.inspect-meta',\n );\n }\n return undefined;\n }\n\n return Object.freeze({\n async openProject(input) {\n return asObject(await openProject(input), 'project.open');\n },\n async closeProject(input) {\n return closeProject(input);\n },\n async listAssets(input) {\n const result = unwrapEngineResult(\n await listAssets({\n ...input,\n root: input?.project?.root ?? input?.root,\n }),\n 'assets.list',\n );\n const entries = Array.isArray(result)\n ? result\n : Array.isArray(result?.entries)\n ? result.entries\n : undefined;\n if (!Array.isArray(entries)) {\n throw new ViewWorkspaceError(\n 'view-engine-invalid-result',\n 'Engine assets.list to return an array',\n 'Inspect the Engine asset catalog plugin result.',\n { capability: 'assets.list' },\n );\n }\n return entries;\n },\n async openPreview(input) {\n let rawResult;\n try {\n rawResult = await openPreview(input);\n } catch (error) {\n if (\n error?.code === 'engine-workspace-preview-capability-unavailable' ||\n error?.detail?.code === 'engine-workspace-preview-capability-unavailable' ||\n /workspace preview (?:does not support asset kind|only supports SceneAsset)/i.test(error?.message ?? '')\n ) {\n const kind =\n typeof error?.detail?.kind === 'string' ? error.detail.kind : input.asset?.kind;\n throw new ViewWorkspaceError(\n 'view-workspace-asset-unsupported',\n `Engine asset.open to support asset kind ${kind}`,\n 'Use an Engine type-preview capability for this asset kind.',\n { kind },\n );\n }\n throw error;\n }\n const result = asObject(rawResult, 'asset.open');\n const target = asObject(result.target, 'asset.open target');\n if (typeof target.targetId !== 'string' && typeof target.targetId !== 'number') {\n throw new ViewWorkspaceError(\n 'view-engine-invalid-result',\n 'Engine asset.open to return a stable target.targetId',\n 'The Engine preview target must expose its identity for API routing.',\n { capability: 'asset.open' },\n );\n }\n const handle = result.handle ?? result.preview ?? result;\n return Object.freeze({\n ...result,\n target: Object.freeze({ ...target, targetId: String(target.targetId) }),\n handle,\n });\n },\n async closePreview(preview, input) {\n const close = previewMethod(preview, ['close', 'dispose'], 'preview.close');\n return close(input);\n },\n async getCamera(preview, input) {\n const get = previewMethod(preview, ['getCamera', 'cameraGet'], 'camera.get');\n return get(input);\n },\n async beginCamera(preview, input) {\n const begin = previewMethod(preview, ['beginCameraInteraction', 'beginCamera'], 'camera.begin');\n return begin(input);\n },\n async updateCamera(preview, input) {\n const update = previewMethod(preview, ['updateCameraDraft', 'updateCamera'], 'camera.update');\n return update(input);\n },\n async commitCamera(preview, input) {\n const commit = previewMethod(preview, ['commitCamera', 'setCamera'], 'camera.commit');\n return commit(input);\n },\n async abortCamera(preview, input) {\n const abort = previewMethod(preview, ['abortCameraInteraction', 'abortCamera'], 'camera.abort');\n return abort(input);\n },\n async capture(preview, input) {\n const capture = previewMethod(preview, ['capture'], 'preview.capture');\n return capture(input);\n },\n async resizePreview(preview, input) {\n const resize = previewMethod(preview, ['resize', 'resizePreview', 'setRenderSize'], 'preview.resize');\n return resize(input);\n },\n async inspectAsset(input) {\n const asset = input?.asset ?? {};\n const root = input?.project?.root ?? input?.root;\n const subject = input?.subject ?? asset.guid;\n let entry = asset;\n if (assetInspect) {\n entry = unwrapEngineResult(\n await assetInspect({\n ...input,\n root,\n subject,\n }),\n 'asset.inspect',\n );\n entry = asObject(entry, 'asset.inspect');\n } else if (tools) {\n try {\n entry = asObject(\n unwrapEngineResult(\n await tools.run('asset.inspect', { root, subject }),\n 'asset.inspect',\n ),\n 'asset.inspect',\n );\n } catch (error) {\n if (error?.code === 'view-engine-capability-unavailable') throw error;\n if (!asset?.guid) throw error;\n }\n }\n const sourcePath = entry.sourcePath ?? asset.sourcePath;\n const packMeta = isPackTs(sourcePath) ? await inspectPackMeta(sourcePath, input?.requestId) : undefined;\n if (!entry?.guid && !asset?.guid) missing('asset.inspect');\n const revision = packMeta?.revision ?? entry.revision ?? asset.revision;\n return {\n guid: entry.guid ?? asset.guid,\n asset: { ...asset, ...entry },\n ...(sourcePath === undefined\n ? {}\n : {\n source: {\n path: sourcePath,\n ...(isPackTs(sourcePath) ? { kind: 'pack.ts' } : {}),\n ...(revision === undefined ? {} : { revision: String(revision) }),\n },\n }),\n ...(packMeta?.meta === undefined ? {} : { meta: packMeta.meta }),\n ...(revision === undefined ? {} : { revision: String(revision) }),\n ...(projectCatalogDdc({ ...asset, ...entry }) === undefined\n ? {}\n : { ddc: projectCatalogDdc({ ...asset, ...entry }) }),\n };\n },\n async rebuild(input) {\n const mode = input?.mode === 'cold-cook' ? 'cold-cook' : 'rebuild';\n const capability = VIEW_ENGINE_ASSET_SOURCE_TOOLS[mode];\n const sourcePath = input?.sourcePath ?? input?.asset?.sourcePath;\n const expectedRevision = input?.expectedRevision;\n const requestId = input?.requestId;\n const args = {\n ...(sourcePath === undefined ? {} : { sourcePath }),\n ...(input?.asset?.guid === undefined ? {} : { guid: input.asset.guid, ownerGuid: input.asset.guid }),\n ...(requestId === undefined ? {} : { requestId }),\n ...(expectedRevision === undefined ? {} : { expectedRevision }),\n };\n\n if (gateway && sourcePath) {\n return asObject(\n unwrapEngineResult(\n await gateway.execute({\n kind: mode,\n sourcePath,\n requestId: requestId ?? `view-${mode}`,\n ...(expectedRevision === undefined ? {} : { expectedRevision }),\n }),\n capability,\n ),\n capability,\n );\n }\n\n if (packRebuild && sourcePath) {\n if (packPreflight && expectedRevision !== undefined) {\n const preflight = asObject(\n unwrapEngineResult(await packPreflight(sourcePath), 'asset.preflight'),\n 'asset.preflight',\n );\n if (String(preflight.revision) !== String(expectedRevision)) {\n engineFailure(\n {\n code: 'pack-source-revision-conflict',\n expected: expectedRevision,\n actual: preflight.revision,\n hint: 'inspect the current source revision, then retry the build with a new requestId',\n detail: { sourcePath, requestId },\n },\n capability,\n );\n }\n }\n return asObject(\n unwrapEngineResult(await packRebuild(sourcePath, mode), capability),\n capability,\n );\n }\n\n if (tools) {\n return asObject(await runTool(capability, args, capability), capability);\n }\n missing(capability);\n },\n });\n}\n\nexport function isEngineWorkspaceAdapter(value) {\n const assets = value?.assets ?? value;\n const preview = value?.preview ?? value;\n return Boolean(\n value &&\n typeof (value.openProject ?? value.open) === 'function' &&\n typeof (value.closeProject ?? value.close) === 'function' &&\n typeof (\n assets.listAssets ??\n assets.list ??\n assets.assetList ??\n assets['asset.list']\n ) === 'function' &&\n typeof (\n preview.openPreview ??\n preview.openAsset ??\n preview.openScene ??\n preview.open\n ) === 'function',\n );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAaO,IAAM,gCAAgC,OAA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,aACR,QAAQ,aACR,QAAQ,UACJ;AAAA,EACV;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import {
|
|
2
|
+
workspaceUiFingerprint
|
|
3
|
+
} from "./chunk-32GD5LL6.mjs";
|
|
4
|
+
|
|
5
|
+
// packages/view-workspace-core/src/workspace-state.mjs
|
|
6
|
+
function createWorkspaceObservation(reader, isCurrent) {
|
|
7
|
+
const controller = new AbortController();
|
|
8
|
+
let unsubscribe;
|
|
9
|
+
const dispose = () => {
|
|
10
|
+
controller.abort();
|
|
11
|
+
unsubscribe?.();
|
|
12
|
+
unsubscribe = void 0;
|
|
13
|
+
};
|
|
14
|
+
const check = () => {
|
|
15
|
+
if (!isCurrent(reader.getSnapshot())) dispose();
|
|
16
|
+
};
|
|
17
|
+
unsubscribe = reader.subscribe(check);
|
|
18
|
+
if (controller.signal.aborted) dispose();
|
|
19
|
+
else check();
|
|
20
|
+
return { signal: controller.signal, dispose };
|
|
21
|
+
}
|
|
22
|
+
function createWorkspaceStateReader(client) {
|
|
23
|
+
if (!client || typeof client.subscribe !== "function") {
|
|
24
|
+
return { getSnapshot: () => null, subscribe: () => () => {
|
|
25
|
+
}, dispose() {
|
|
26
|
+
} };
|
|
27
|
+
}
|
|
28
|
+
let snapshot = null;
|
|
29
|
+
let published = null;
|
|
30
|
+
let publishedFingerprint = "";
|
|
31
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
32
|
+
let transportUnsubscribe;
|
|
33
|
+
let generation = 0;
|
|
34
|
+
const stop = () => {
|
|
35
|
+
generation++;
|
|
36
|
+
transportUnsubscribe?.();
|
|
37
|
+
transportUnsubscribe = void 0;
|
|
38
|
+
};
|
|
39
|
+
const start = () => {
|
|
40
|
+
const current = ++generation;
|
|
41
|
+
const accept = (next) => {
|
|
42
|
+
if (current !== generation || !next) return;
|
|
43
|
+
if (snapshot !== null && (next.revision ?? 0) < (snapshot.revision ?? 0)) return;
|
|
44
|
+
snapshot = next;
|
|
45
|
+
const fingerprint = workspaceUiFingerprint(next);
|
|
46
|
+
if (fingerprint === publishedFingerprint) return;
|
|
47
|
+
publishedFingerprint = fingerprint;
|
|
48
|
+
published = next;
|
|
49
|
+
for (const listener of listeners) listener();
|
|
50
|
+
};
|
|
51
|
+
transportUnsubscribe = client.subscribe(accept) ?? (() => {
|
|
52
|
+
});
|
|
53
|
+
void client.getState?.().then(accept).catch(() => {
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
return {
|
|
57
|
+
getSnapshot: () => published,
|
|
58
|
+
subscribe(listener) {
|
|
59
|
+
listeners.add(listener);
|
|
60
|
+
if (listeners.size === 1) start();
|
|
61
|
+
return () => {
|
|
62
|
+
if (!listeners.delete(listener)) return;
|
|
63
|
+
if (listeners.size === 0) stop();
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
dispose() {
|
|
67
|
+
stop();
|
|
68
|
+
listeners.clear();
|
|
69
|
+
snapshot = null;
|
|
70
|
+
published = null;
|
|
71
|
+
publishedFingerprint = "";
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export {
|
|
77
|
+
createWorkspaceObservation,
|
|
78
|
+
createWorkspaceStateReader
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=chunk-FJM6WWIY.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../packages/view-workspace-core/src/workspace-state.mjs"],
|
|
4
|
+
"sourcesContent": ["import { workspaceUiFingerprint } from './contract.mjs';\n\n/** Cancel a panel's reads at state publication, without waiting for React cleanup. */\nexport function createWorkspaceObservation(reader, isCurrent) {\n const controller = new AbortController();\n let unsubscribe;\n const dispose = () => {\n controller.abort();\n unsubscribe?.();\n unsubscribe = undefined;\n };\n const check = () => {\n if (!isCurrent(reader.getSnapshot())) dispose();\n };\n unsubscribe = reader.subscribe(check);\n // subscribe may synchronously publish, before its disposer has been assigned.\n if (controller.signal.aborted) dispose();\n else check();\n return { signal: controller.signal, dispose };\n}\n\n/** A subscription owns its transport lease; snapshots remain Engine/View API results. */\nexport function createWorkspaceStateReader(client) {\n if (!client || typeof client.subscribe !== 'function') {\n return { getSnapshot: () => null, subscribe: () => () => {}, dispose() {} };\n }\n let snapshot = null;\n let published = null;\n let publishedFingerprint = '';\n const listeners = new Set();\n let transportUnsubscribe;\n let generation = 0;\n const stop = () => {\n generation++;\n transportUnsubscribe?.();\n transportUnsubscribe = undefined;\n };\n const start = () => {\n const current = ++generation;\n const accept = next => {\n if (current !== generation || !next) return;\n if (snapshot !== null && (next.revision ?? 0) < (snapshot.revision ?? 0)) return;\n snapshot = next;\n const fingerprint = workspaceUiFingerprint(next);\n if (fingerprint === publishedFingerprint) return;\n publishedFingerprint = fingerprint;\n published = next;\n for (const listener of listeners) listener();\n };\n transportUnsubscribe = client.subscribe(accept) ?? (() => {});\n void client.getState?.().then(accept).catch(() => {});\n };\n return {\n getSnapshot: () => published,\n subscribe(listener) {\n listeners.add(listener);\n if (listeners.size === 1) start();\n return () => {\n if (!listeners.delete(listener)) return;\n if (listeners.size === 0) stop();\n };\n },\n dispose() { stop(); listeners.clear(); snapshot = null; published = null; publishedFingerprint = ''; },\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAGO,SAAS,2BAA2B,QAAQ,WAAW;AAC5D,QAAM,aAAa,IAAI,gBAAgB;AACvC,MAAI;AACJ,QAAM,UAAU,MAAM;AACpB,eAAW,MAAM;AACjB,kBAAc;AACd,kBAAc;AAAA,EAChB;AACA,QAAM,QAAQ,MAAM;AAClB,QAAI,CAAC,UAAU,OAAO,YAAY,CAAC,EAAG,SAAQ;AAAA,EAChD;AACA,gBAAc,OAAO,UAAU,KAAK;AAEpC,MAAI,WAAW,OAAO,QAAS,SAAQ;AAAA,MAClC,OAAM;AACX,SAAO,EAAE,QAAQ,WAAW,QAAQ,QAAQ;AAC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