@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,1400 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PLUGINS_OPERATION_DESCRIPTIONS
|
|
3
|
+
} from "./chunk-IGRMZYRD.mjs";
|
|
4
|
+
import {
|
|
5
|
+
BACKEND_MODULE,
|
|
6
|
+
BACKEND_PLUGIN_ID
|
|
7
|
+
} from "./chunk-VZXGRZYU.mjs";
|
|
8
|
+
import {
|
|
9
|
+
reportWorkspaceCommandError
|
|
10
|
+
} from "./chunk-ASI2HBE6.mjs";
|
|
11
|
+
import {
|
|
12
|
+
VIEW_WORKSPACE_API_VERSION,
|
|
13
|
+
VIEW_WORKSPACE_DOMAIN_OPERATIONS,
|
|
14
|
+
ViewWorkspaceError,
|
|
15
|
+
cloneWorkspaceValue,
|
|
16
|
+
jsonUnchanged,
|
|
17
|
+
requireWorkspaceObject,
|
|
18
|
+
requireWorkspaceString,
|
|
19
|
+
workspaceError
|
|
20
|
+
} from "./chunk-32GD5LL6.mjs";
|
|
21
|
+
import {
|
|
22
|
+
createWorkspaceId
|
|
23
|
+
} from "./chunk-TP26TASL.mjs";
|
|
24
|
+
|
|
25
|
+
// packages/view-plugin-plugins/src/runtime.mjs
|
|
26
|
+
import { defineTool } from "@forgeax/engine-tool-runtime";
|
|
27
|
+
import { inspectPluginFiber, registerTools } from "@forgeax/engine-plugin";
|
|
28
|
+
var VIEW_INSPECTOR_API_VERSION = "forgeax.view.inspector/1";
|
|
29
|
+
var VIEW_INSPECTOR_SERVICES = Object.freeze({
|
|
30
|
+
sources: "forgeax.view.inspector.sources",
|
|
31
|
+
inspect: "forgeax.view.inspector.inspect",
|
|
32
|
+
watch: "forgeax.view.inspector.watch",
|
|
33
|
+
unwatch: "forgeax.view.inspector.unwatch",
|
|
34
|
+
report: "forgeax.view.inspector.report"
|
|
35
|
+
});
|
|
36
|
+
var VIEW_INSPECTOR_TOPIC = "forgeax.view.inspector.changed";
|
|
37
|
+
var VIEW_STATUS_OPERATION = "view.status";
|
|
38
|
+
var VIEW_INSPECTOR_OPERATIONS = Object.freeze(
|
|
39
|
+
PLUGINS_OPERATION_DESCRIPTIONS.map((description) => description.id)
|
|
40
|
+
);
|
|
41
|
+
var VIEW_INSPECTOR_INTERNAL_OPERATIONS = Object.freeze(["plugins.report", "plugins.unwatch"]);
|
|
42
|
+
var INSPECTOR_OPERATION_SET = /* @__PURE__ */ new Set([
|
|
43
|
+
...VIEW_INSPECTOR_OPERATIONS,
|
|
44
|
+
...VIEW_INSPECTOR_INTERNAL_OPERATIONS
|
|
45
|
+
]);
|
|
46
|
+
var WORKSPACE_OPERATION_SET = new Set(VIEW_WORKSPACE_DOMAIN_OPERATIONS);
|
|
47
|
+
var MAX_TEXT = 512;
|
|
48
|
+
var SAFE_ERROR_FIELDS = /* @__PURE__ */ new Set([
|
|
49
|
+
"actual",
|
|
50
|
+
"actualGeneration",
|
|
51
|
+
"expectedGeneration",
|
|
52
|
+
"fiberState",
|
|
53
|
+
"generation",
|
|
54
|
+
"module",
|
|
55
|
+
"operation",
|
|
56
|
+
"phase",
|
|
57
|
+
"providerId",
|
|
58
|
+
"reason",
|
|
59
|
+
"remoteCode",
|
|
60
|
+
"runId",
|
|
61
|
+
"service",
|
|
62
|
+
"sourceId",
|
|
63
|
+
"watchId"
|
|
64
|
+
]);
|
|
65
|
+
function redactCredentials(value) {
|
|
66
|
+
return value.replace(/([a-z][a-z\d+.-]*:\/\/)([^\s/?#]+)@/gi, "$1[redacted]@").replace(
|
|
67
|
+
/\b(authorization|proxy-authorization)\b\s*([:=])\s*(?:(?:bearer|basic)\s+)?[^\s,;)}\]]+/gi,
|
|
68
|
+
(_match, key, separator) => `${key}${separator}[redacted]`
|
|
69
|
+
).replace(/\b(bearer|basic)\s+[a-z\d._~+\/-]+=*/gi, "$1 [redacted]").replace(
|
|
70
|
+
/([?&](?:token|password|passwd|secret|authorization|api[-_]?key|access[-_]?token)=)[^&#\s,;)}\]]+/gi,
|
|
71
|
+
"$1[redacted]"
|
|
72
|
+
).replace(
|
|
73
|
+
/\b(token|password|passwd|secret|authorization|api[-_]?key|access[-_]?token)\b\s*([:=])\s*("[^"]*"|'[^']*'|\[[^\]]*\]|[^\s,;)}\]]+)/gi,
|
|
74
|
+
(_match, key, separator) => `${key}${separator}[redacted]`
|
|
75
|
+
).replace(/\b(secret|password|passwd|token)(?:[-_][a-z\d][a-z\d_.-]*)?\b/gi, "[redacted]").replace(/\b(secret|password|passwd|token|api[-_]?key|access[-_]?token)[-_][a-z\d][a-z\d_.-]*\b/gi, "[redacted]");
|
|
76
|
+
}
|
|
77
|
+
function safeText(value, fallback = "unknown") {
|
|
78
|
+
const text = typeof value === "string" ? value : value === void 0 ? fallback : String(value);
|
|
79
|
+
const redacted = redactCredentials(text);
|
|
80
|
+
return redacted.length > MAX_TEXT ? `${redacted.slice(0, MAX_TEXT)}...` : redacted;
|
|
81
|
+
}
|
|
82
|
+
function safeStringArray(value) {
|
|
83
|
+
if (!Array.isArray(value)) return void 0;
|
|
84
|
+
return value.filter((entry) => typeof entry === "string").slice(0, 64).map((entry) => safeText(entry));
|
|
85
|
+
}
|
|
86
|
+
function safeClone(value) {
|
|
87
|
+
try {
|
|
88
|
+
return cloneWorkspaceValue(value);
|
|
89
|
+
} catch {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function safeDetail(value) {
|
|
94
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
95
|
+
const result = {};
|
|
96
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
97
|
+
if (!SAFE_ERROR_FIELDS.has(key)) continue;
|
|
98
|
+
if (typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean" || entry === null) {
|
|
99
|
+
result[key] = typeof entry === "string" ? safeText(entry) : entry;
|
|
100
|
+
} else if (Array.isArray(entry) && entry.every((item) => typeof item === "string")) {
|
|
101
|
+
result[key] = entry.map((item) => safeText(item));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return Object.keys(result).length === 0 ? void 0 : result;
|
|
105
|
+
}
|
|
106
|
+
function safeError(error) {
|
|
107
|
+
if (error === void 0 || error === null) return void 0;
|
|
108
|
+
const detail = error?.detail;
|
|
109
|
+
const safe = safeDetail(detail);
|
|
110
|
+
return {
|
|
111
|
+
code: safeText(error?.code, "unknown-error"),
|
|
112
|
+
expected: safeText(error?.expected),
|
|
113
|
+
hint: safeText(error?.hint),
|
|
114
|
+
...safe === void 0 ? {} : { detail: safe }
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function safeSchema(value) {
|
|
118
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
119
|
+
const allowed = /* @__PURE__ */ new Set([
|
|
120
|
+
"additionalProperties",
|
|
121
|
+
"const",
|
|
122
|
+
"description",
|
|
123
|
+
"enum",
|
|
124
|
+
"items",
|
|
125
|
+
"maximum",
|
|
126
|
+
"minimum",
|
|
127
|
+
"properties",
|
|
128
|
+
"required",
|
|
129
|
+
"type"
|
|
130
|
+
]);
|
|
131
|
+
const project = (schema) => {
|
|
132
|
+
if (!schema || typeof schema !== "object" || Array.isArray(schema)) return void 0;
|
|
133
|
+
const result = {};
|
|
134
|
+
for (const [key, entry] of Object.entries(schema)) {
|
|
135
|
+
if (!allowed.has(key)) continue;
|
|
136
|
+
if (key === "properties" && entry && typeof entry === "object" && !Array.isArray(entry)) {
|
|
137
|
+
result.properties = Object.fromEntries(
|
|
138
|
+
Object.entries(entry).map(([name, child]) => [name, project(child)]).filter(([, child]) => child !== void 0)
|
|
139
|
+
);
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (key === "items") {
|
|
143
|
+
const child = project(entry);
|
|
144
|
+
if (child !== void 0) result.items = child;
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
if (key === "description") result.description = safeText(entry, "");
|
|
148
|
+
else if (Array.isArray(entry)) result[key] = entry.filter((item) => typeof item === "string").map(safeText);
|
|
149
|
+
else if (typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean") result[key] = entry;
|
|
150
|
+
}
|
|
151
|
+
return result;
|
|
152
|
+
};
|
|
153
|
+
return project(value);
|
|
154
|
+
}
|
|
155
|
+
function safeOwner(owner) {
|
|
156
|
+
if (!owner || typeof owner !== "object") return null;
|
|
157
|
+
return {
|
|
158
|
+
providerId: safeText(owner.providerId),
|
|
159
|
+
sourceId: safeText(owner.sourceId),
|
|
160
|
+
generation: Number.isSafeInteger(owner.generation) ? owner.generation : null,
|
|
161
|
+
realm: safeText(owner.realm),
|
|
162
|
+
...owner.fiberId === void 0 ? {} : { fiberId: safeText(owner.fiberId) },
|
|
163
|
+
...owner.module === void 0 ? {} : { module: safeText(owner.module) }
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function safeToolDescriptor(descriptor) {
|
|
167
|
+
if (!descriptor || typeof descriptor !== "object") return null;
|
|
168
|
+
return {
|
|
169
|
+
id: safeText(descriptor.id),
|
|
170
|
+
path: Array.isArray(descriptor.path) ? descriptor.path.filter((value) => typeof value === "string").map((value) => safeText(value)) : safeText(descriptor.id).split("."),
|
|
171
|
+
title: safeText(descriptor.title),
|
|
172
|
+
summary: safeText(descriptor.summary),
|
|
173
|
+
realm: safeText(descriptor.realm),
|
|
174
|
+
evidence: Array.isArray(descriptor.evidence) ? descriptor.evidence.filter((value) => typeof value === "string").map((value) => safeText(value)) : [],
|
|
175
|
+
...descriptor.inputSchema === void 0 ? {} : { inputSchema: safeSchema(descriptor.inputSchema) },
|
|
176
|
+
...descriptor.outputSchema === void 0 ? {} : { outputSchema: safeSchema(descriptor.outputSchema) },
|
|
177
|
+
...Array.isArray(descriptor.capabilities) ? { capabilities: descriptor.capabilities.map((value) => safeText(value)) } : {},
|
|
178
|
+
...Array.isArray(descriptor.errors) ? { errors: descriptor.errors.map((value) => safeText(value)) } : {}
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
function safePluginEntry(entry) {
|
|
182
|
+
if (!entry || typeof entry !== "object") return null;
|
|
183
|
+
const desiredState = entry.desiredState === "disabled" || entry.disabled === true ? "disabled" : "enabled";
|
|
184
|
+
const state = typeof (entry.fiberState ?? entry.state) === "string" && ["pending", "loading", "active", "failed", "disposed", "disabled", "unloading", "unknown"].includes(
|
|
185
|
+
entry.fiberState ?? entry.state
|
|
186
|
+
) ? entry.fiberState ?? entry.state : void 0;
|
|
187
|
+
const origin = entry.origin && typeof entry.origin === "object" ? entry.origin : void 0;
|
|
188
|
+
return {
|
|
189
|
+
entryId: safeText(entry.entryId ?? entry.id ?? (entry.uid == null ? void 0 : `fiber:${entry.uid}`)),
|
|
190
|
+
module: safeText(entry.module ?? entry.name),
|
|
191
|
+
realm: safeText(entry.realm),
|
|
192
|
+
desiredState,
|
|
193
|
+
...(origin?.guid ?? entry.assetGuid) === void 0 ? {} : { assetGuid: safeText(origin?.guid ?? entry.assetGuid) },
|
|
194
|
+
...(origin?.program ?? entry.program) === void 0 ? {} : { program: safeText(origin?.program ?? entry.program) },
|
|
195
|
+
...entry.fiberId === void 0 ? {} : { fiberId: safeText(entry.fiberId) },
|
|
196
|
+
...entry.parent === void 0 ? {} : { parent: safeText(entry.parent) },
|
|
197
|
+
...safeStringArray(entry.requiredServices) === void 0 ? {} : { requiredServices: safeStringArray(entry.requiredServices) },
|
|
198
|
+
...safeStringArray(entry.providedServices) === void 0 ? {} : { providedServices: safeStringArray(entry.providedServices) },
|
|
199
|
+
...safeStringArray(entry.missingServices) === void 0 ? {} : { missingServices: safeStringArray(entry.missingServices) },
|
|
200
|
+
...entry.configDigest === void 0 ? {} : { configDigest: safeText(entry.configDigest) },
|
|
201
|
+
...state === void 0 ? {} : { fiberState: state },
|
|
202
|
+
...entry.failure === void 0 ? {} : { failure: safeError(entry.failure) }
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
function safeToolSnapshot(snapshot) {
|
|
206
|
+
if (!snapshot || typeof snapshot !== "object") {
|
|
207
|
+
return { providers: [], operations: [], state: "unavailable" };
|
|
208
|
+
}
|
|
209
|
+
return {
|
|
210
|
+
providers: Array.isArray(snapshot.providers) ? snapshot.providers.map((provider) => ({
|
|
211
|
+
owner: safeOwner(provider.owner),
|
|
212
|
+
state: safeText(provider.state),
|
|
213
|
+
callable: provider.callable === true,
|
|
214
|
+
...provider.fiberState === void 0 ? {} : { fiberState: safeText(provider.fiberState) },
|
|
215
|
+
operationIds: Array.isArray(provider.operationIds) ? provider.operationIds.map((value) => safeText(value)) : []
|
|
216
|
+
})) : [],
|
|
217
|
+
operations: Array.isArray(snapshot.operations) ? snapshot.operations.map((operation) => ({
|
|
218
|
+
descriptor: safeToolDescriptor(operation.descriptor),
|
|
219
|
+
owner: safeOwner(operation.owner),
|
|
220
|
+
providerState: safeText(operation.providerState),
|
|
221
|
+
declared: operation.declared === true,
|
|
222
|
+
callable: operation.callable === true,
|
|
223
|
+
...operation.fiberState === void 0 ? {} : { fiberState: safeText(operation.fiberState) }
|
|
224
|
+
})) : []
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
function safeProviderPlugins(snapshot) {
|
|
228
|
+
if (!snapshot || !Array.isArray(snapshot.providers)) return [];
|
|
229
|
+
return snapshot.providers.map((provider) => {
|
|
230
|
+
const owner = provider?.owner;
|
|
231
|
+
if (!owner || typeof owner !== "object") return null;
|
|
232
|
+
return safePluginEntry({
|
|
233
|
+
entryId: `provider:${owner.sourceId ?? "unknown"}:${owner.providerId ?? "unknown"}`,
|
|
234
|
+
module: owner.module ?? "tool-provider",
|
|
235
|
+
realm: owner.realm,
|
|
236
|
+
fiberState: provider.fiberState ?? provider.state
|
|
237
|
+
});
|
|
238
|
+
}).filter((entry) => entry !== null);
|
|
239
|
+
}
|
|
240
|
+
function actualPluginEntries(status, snapshot, supplied = []) {
|
|
241
|
+
const entries = Array.isArray(status?.entries) ? status.entries.map(safePluginEntry).filter((entry) => entry !== null) : [];
|
|
242
|
+
const byId = new Map(entries.map((entry) => [entry.entryId, entry]));
|
|
243
|
+
for (const entry of safeProviderPlugins(snapshot)) byId.set(entry.entryId, entry);
|
|
244
|
+
for (const entry of supplied) {
|
|
245
|
+
const safe = safePluginEntry(entry);
|
|
246
|
+
if (safe !== null) byId.set(safe.entryId, safe);
|
|
247
|
+
}
|
|
248
|
+
return [...byId.values()];
|
|
249
|
+
}
|
|
250
|
+
function fiberStateName(state) {
|
|
251
|
+
return ["pending", "loading", "active", "failed", "disposed", "unloading"][state] ?? "unknown";
|
|
252
|
+
}
|
|
253
|
+
function safeAssembly(value) {
|
|
254
|
+
const assembly = value?.current ?? value;
|
|
255
|
+
if (!assembly || typeof assembly !== "object") return null;
|
|
256
|
+
return {
|
|
257
|
+
revision: safeText(assembly.revision),
|
|
258
|
+
schemaVersion: safeText(assembly.schemaVersion),
|
|
259
|
+
sessionGeneration: assembly.sessionGeneration,
|
|
260
|
+
root: assembly.root ? {
|
|
261
|
+
program: safeText(assembly.root.program),
|
|
262
|
+
codeRevision: safeText(assembly.root.codeRevision),
|
|
263
|
+
...assembly.root.source === void 0 ? {} : { assetGuid: safeText(assembly.root.source) }
|
|
264
|
+
} : null
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
function safeActivationStatus(status) {
|
|
268
|
+
if (!status || typeof status !== "object") return { state: "unknown" };
|
|
269
|
+
const entries = Array.isArray(status.entries) ? status.entries.map((entry) => {
|
|
270
|
+
const safe = safePluginEntry(entry);
|
|
271
|
+
return {
|
|
272
|
+
entryId: safe?.entryId ?? safeText(entry.entryId ?? entry.id),
|
|
273
|
+
fiberState: safe?.fiberState ?? safeText(entry.fiberState),
|
|
274
|
+
...safe?.parent === void 0 ? {} : { parent: safe.parent },
|
|
275
|
+
...safe?.requiredServices === void 0 ? {} : { requiredServices: safe.requiredServices },
|
|
276
|
+
...safe?.providedServices === void 0 ? {} : { providedServices: safe.providedServices },
|
|
277
|
+
...safe?.configDigest === void 0 ? {} : { configDigest: safe.configDigest },
|
|
278
|
+
...entry.failure === void 0 ? {} : { failure: safeError(entry.failure) }
|
|
279
|
+
};
|
|
280
|
+
}) : void 0;
|
|
281
|
+
return {
|
|
282
|
+
state: safeText(status.state),
|
|
283
|
+
revision: safeText(status.revision),
|
|
284
|
+
...entries === void 0 ? {} : { entries: [...new Map(entries.map((entry) => [entry.entryId, entry])).values()] },
|
|
285
|
+
...status.error === void 0 ? {} : { error: safeError(status.error) }
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
function sourceIdFor(caller) {
|
|
289
|
+
return `view-frontend:${safeText(caller?.connectionId, "unknown-connection")}`;
|
|
290
|
+
}
|
|
291
|
+
function assertInspectorRequest(value, expectedOperation) {
|
|
292
|
+
const request = requireWorkspaceObject(value, "request");
|
|
293
|
+
if (request.apiVersion !== VIEW_INSPECTOR_API_VERSION) {
|
|
294
|
+
throw workspaceError(
|
|
295
|
+
"view-inspector-version-mismatch",
|
|
296
|
+
`API version ${VIEW_INSPECTOR_API_VERSION}`,
|
|
297
|
+
"Install a matching View inspector client.",
|
|
298
|
+
{ actual: request.apiVersion, expected: VIEW_INSPECTOR_API_VERSION }
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
if (!INSPECTOR_OPERATION_SET.has(request.operation) || request.operation !== expectedOperation) {
|
|
302
|
+
throw workspaceError(
|
|
303
|
+
"view-inspector-operation-unknown",
|
|
304
|
+
"operation to be present in the View inspector API",
|
|
305
|
+
"Refresh inspector capabilities and use a supported operation.",
|
|
306
|
+
{ operation: request.operation }
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
requireWorkspaceString(request.clientId, "clientId");
|
|
310
|
+
requireWorkspaceString(request.requestId, "requestId");
|
|
311
|
+
requireWorkspaceObject(request.args, "args");
|
|
312
|
+
return request;
|
|
313
|
+
}
|
|
314
|
+
function createInspectorRequest(operation, args = {}, { clientId, token, requestId } = {}) {
|
|
315
|
+
if (!INSPECTOR_OPERATION_SET.has(operation)) {
|
|
316
|
+
throw workspaceError(
|
|
317
|
+
"view-inspector-operation-unknown",
|
|
318
|
+
"operation to be present in the View inspector API",
|
|
319
|
+
"Refresh inspector capabilities and use a supported operation.",
|
|
320
|
+
{ operation }
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
const request = {
|
|
324
|
+
apiVersion: VIEW_INSPECTOR_API_VERSION,
|
|
325
|
+
operation,
|
|
326
|
+
clientId: requireWorkspaceString(clientId, "clientId"),
|
|
327
|
+
requestId: requestId === void 0 ? createWorkspaceId("inspector-request") : requireWorkspaceString(requestId, "requestId"),
|
|
328
|
+
args: requireWorkspaceObject(args, "args")
|
|
329
|
+
};
|
|
330
|
+
if (token !== void 0) request.token = requireWorkspaceString(token, "token");
|
|
331
|
+
return Object.freeze(request);
|
|
332
|
+
}
|
|
333
|
+
function decodeInspectorError(error) {
|
|
334
|
+
if (error instanceof ViewWorkspaceError) return error;
|
|
335
|
+
const remoteCode = typeof error?.detail?.remoteCode === "string" ? error.detail.remoteCode : void 0;
|
|
336
|
+
const code = [error?.code, remoteCode].find(
|
|
337
|
+
(candidate) => typeof candidate === "string" && candidate.startsWith("view-inspector-")
|
|
338
|
+
);
|
|
339
|
+
if (code === void 0) return error;
|
|
340
|
+
const message = typeof error?.message === "string" && error.message.trim() !== "" ? error.message : String(error);
|
|
341
|
+
return new ViewWorkspaceError(
|
|
342
|
+
code,
|
|
343
|
+
typeof error?.expected === "string" ? error.expected : message,
|
|
344
|
+
typeof error?.hint === "string" ? error.hint : message,
|
|
345
|
+
{
|
|
346
|
+
...error?.detail && typeof error.detail === "object" ? error.detail : {},
|
|
347
|
+
...remoteCode === void 0 ? {} : { remoteCode },
|
|
348
|
+
...typeof error?.name === "string" ? { name: error.name } : {}
|
|
349
|
+
}
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
function toolFailureError(failure) {
|
|
353
|
+
const detail = failure?.detail;
|
|
354
|
+
const operationCode = [detail?.code, detail?.remoteCode].find(
|
|
355
|
+
(candidate) => typeof candidate === "string" && candidate.startsWith("view-")
|
|
356
|
+
);
|
|
357
|
+
const payload = detail?.payload ?? detail?.detail;
|
|
358
|
+
const diagnostic = [failure?.code, detail?.code, detail?.remoteCode].filter((value, index, values) => typeof value === "string" && values.indexOf(value) === index).join(" -> ");
|
|
359
|
+
const preservedHint = (typeof failure?.hint === "string" && failure.hint.trim() !== "" ? failure.hint : void 0) ?? (typeof failure?.expected === "string" && failure.expected.trim() !== "" ? failure.expected : void 0);
|
|
360
|
+
const hint = `${preservedHint ?? ""}${diagnostic ? `${preservedHint ? " " : ""}(provider: ${diagnostic})` : ""}`.trim();
|
|
361
|
+
if (operationCode !== void 0) {
|
|
362
|
+
return workspaceError(
|
|
363
|
+
operationCode,
|
|
364
|
+
typeof detail.expected === "string" ? detail.expected : failure.expected,
|
|
365
|
+
typeof detail.hint === "string" ? detail.hint : hint || preservedHint,
|
|
366
|
+
{
|
|
367
|
+
failure: safeError(failure) ?? { failure },
|
|
368
|
+
...payload && typeof payload === "object" ? { cause: payload } : {}
|
|
369
|
+
}
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
return workspaceError(
|
|
373
|
+
"view-tool-provider-failed",
|
|
374
|
+
typeof failure?.expected === "string" ? safeText(failure.expected) : preservedHint,
|
|
375
|
+
hint || preservedHint,
|
|
376
|
+
{ failure: safeError(failure) }
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
async function runWorkspaceToolApi(api, { operation, args, clientId, token, requestId, caller, signal, providerId, generation }) {
|
|
380
|
+
const run = api.run(
|
|
381
|
+
operation,
|
|
382
|
+
{ args, clientId, token, requestId },
|
|
383
|
+
{ sourceId: "view-backend", providerId, generation, caller, signal }
|
|
384
|
+
);
|
|
385
|
+
const terminal = await run.terminal;
|
|
386
|
+
if (terminal.outcome === "failed") throw toolFailureError(terminal.failure);
|
|
387
|
+
return terminal.result;
|
|
388
|
+
}
|
|
389
|
+
async function runInspectorToolApi(api, { operation, payload, caller, signal, providerId, generation }) {
|
|
390
|
+
const run = api.run(operation, payload, {
|
|
391
|
+
sourceId: "view-backend",
|
|
392
|
+
providerId,
|
|
393
|
+
generation,
|
|
394
|
+
caller,
|
|
395
|
+
signal
|
|
396
|
+
});
|
|
397
|
+
const terminal = await run.terminal;
|
|
398
|
+
if (terminal.outcome === "failed") throw toolFailureError(terminal.failure);
|
|
399
|
+
return terminal.result;
|
|
400
|
+
}
|
|
401
|
+
async function runViewToolApi(api, { operation, args = {}, caller, signal, providerId, generation }) {
|
|
402
|
+
const run = api.run(operation, args, {
|
|
403
|
+
sourceId: "view-backend",
|
|
404
|
+
providerId,
|
|
405
|
+
generation,
|
|
406
|
+
caller,
|
|
407
|
+
signal
|
|
408
|
+
});
|
|
409
|
+
const terminal = await run.terminal;
|
|
410
|
+
if (terminal.outcome === "failed") throw toolFailureError(terminal.failure);
|
|
411
|
+
return terminal.result;
|
|
412
|
+
}
|
|
413
|
+
function createViewWorkspaceToolContributions(workspace) {
|
|
414
|
+
const schema = {
|
|
415
|
+
parse(value) {
|
|
416
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? { ok: true, value } : { ok: false, error: "workspace API arguments must be an object" };
|
|
417
|
+
},
|
|
418
|
+
describe: "JSON object accepted by the View workspace operation."
|
|
419
|
+
};
|
|
420
|
+
return VIEW_WORKSPACE_DOMAIN_OPERATIONS.filter((operation) => WORKSPACE_OPERATION_SET.has(operation)).map(
|
|
421
|
+
(operation) => defineTool(
|
|
422
|
+
{
|
|
423
|
+
id: operation,
|
|
424
|
+
path: operation.split("."),
|
|
425
|
+
title: operation,
|
|
426
|
+
summary: `View workspace operation ${operation}.`,
|
|
427
|
+
realm: "host",
|
|
428
|
+
argsSchema: schema,
|
|
429
|
+
resultSchema: schema,
|
|
430
|
+
inputSchema: { type: "object" },
|
|
431
|
+
outputSchema: { type: "object" },
|
|
432
|
+
evidence: []
|
|
433
|
+
},
|
|
434
|
+
async (envelope, context) => {
|
|
435
|
+
try {
|
|
436
|
+
const request = {
|
|
437
|
+
apiVersion: VIEW_WORKSPACE_API_VERSION,
|
|
438
|
+
operation,
|
|
439
|
+
clientId: envelope.clientId,
|
|
440
|
+
requestId: envelope.requestId,
|
|
441
|
+
args: envelope.args,
|
|
442
|
+
...envelope.token === void 0 ? {} : { token: envelope.token }
|
|
443
|
+
};
|
|
444
|
+
return safeClone(await workspace.call(request, { signal: context.signal, caller: context.caller }));
|
|
445
|
+
} catch (error) {
|
|
446
|
+
if (error instanceof ViewWorkspaceError) {
|
|
447
|
+
return {
|
|
448
|
+
ok: false,
|
|
449
|
+
error: {
|
|
450
|
+
code: error.code,
|
|
451
|
+
expected: error.expected,
|
|
452
|
+
hint: error.hint,
|
|
453
|
+
detail: safeClone(error.detail)
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
throw error;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
)
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
function inspectorRequestSchema(operation) {
|
|
464
|
+
return {
|
|
465
|
+
parse(value) {
|
|
466
|
+
try {
|
|
467
|
+
return { ok: true, value: assertInspectorRequest(value, operation) };
|
|
468
|
+
} catch (error) {
|
|
469
|
+
return { ok: false, error: error instanceof Error ? error.message : String(error) };
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
describe: '{"type":"object","required":["apiVersion","operation","clientId","requestId","args"]}'
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
var inspectorResultSchema = {
|
|
476
|
+
parse(value) {
|
|
477
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? { ok: true, value } : { ok: false, error: "inspector result must be an object" };
|
|
478
|
+
},
|
|
479
|
+
describe: '{"type":"object"}'
|
|
480
|
+
};
|
|
481
|
+
function inspectorFailure(error) {
|
|
482
|
+
if (!(error instanceof ViewWorkspaceError)) throw error;
|
|
483
|
+
return {
|
|
484
|
+
ok: false,
|
|
485
|
+
error: {
|
|
486
|
+
code: error.code,
|
|
487
|
+
expected: error.expected,
|
|
488
|
+
hint: error.hint,
|
|
489
|
+
detail: safeDetail(error.detail)
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
function createViewInspectorToolContributions(broker) {
|
|
494
|
+
return [...VIEW_INSPECTOR_OPERATIONS, ...VIEW_INSPECTOR_INTERNAL_OPERATIONS].map(
|
|
495
|
+
(operation) => {
|
|
496
|
+
const description = PLUGINS_OPERATION_DESCRIPTIONS.find((entry) => entry.id === operation);
|
|
497
|
+
return defineTool(
|
|
498
|
+
{
|
|
499
|
+
id: operation,
|
|
500
|
+
path: description?.path ?? operation.split("."),
|
|
501
|
+
title: description?.title ?? `Inspect ${operation}`,
|
|
502
|
+
summary: description?.summary ?? `Internal View inspector operation ${operation}.`,
|
|
503
|
+
realm: "host",
|
|
504
|
+
argsSchema: inspectorRequestSchema(operation),
|
|
505
|
+
resultSchema: inspectorResultSchema,
|
|
506
|
+
inputSchema: { type: "object" },
|
|
507
|
+
outputSchema: { type: "object" },
|
|
508
|
+
evidence: []
|
|
509
|
+
},
|
|
510
|
+
async (request, context) => {
|
|
511
|
+
try {
|
|
512
|
+
const canonical = { ...request, caller: context.caller };
|
|
513
|
+
if (operation === "plugins.sources") {
|
|
514
|
+
return broker.sources(canonical);
|
|
515
|
+
}
|
|
516
|
+
if (operation === "plugins.inspect") return broker.inspect(canonical);
|
|
517
|
+
if (operation === "plugins.watch") return broker.watch(canonical);
|
|
518
|
+
if (operation === "plugins.unwatch") return broker.unwatch(canonical);
|
|
519
|
+
return await broker.report(canonical, context.caller);
|
|
520
|
+
} catch (error) {
|
|
521
|
+
return inspectorFailure(error);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
);
|
|
525
|
+
}
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
function createViewStatusToolContributions(broker) {
|
|
529
|
+
const argsSchema = {
|
|
530
|
+
parse(value) {
|
|
531
|
+
return value === void 0 || value !== null && typeof value === "object" && !Array.isArray(value) ? { ok: true, value: value ?? {} } : { ok: false, error: "View status arguments must be an object" };
|
|
532
|
+
},
|
|
533
|
+
describe: "JSON object accepted by the read-only View status operation."
|
|
534
|
+
};
|
|
535
|
+
const resultSchema = {
|
|
536
|
+
parse(value) {
|
|
537
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? { ok: true, value } : { ok: false, error: "View status result must be an object" };
|
|
538
|
+
},
|
|
539
|
+
describe: "JSON object returned by the View status operation."
|
|
540
|
+
};
|
|
541
|
+
return [
|
|
542
|
+
defineTool(
|
|
543
|
+
{
|
|
544
|
+
id: VIEW_STATUS_OPERATION,
|
|
545
|
+
path: VIEW_STATUS_OPERATION.split("."),
|
|
546
|
+
title: "View status",
|
|
547
|
+
summary: "Read the current View display and workspace status.",
|
|
548
|
+
realm: "host",
|
|
549
|
+
argsSchema,
|
|
550
|
+
resultSchema,
|
|
551
|
+
inputSchema: { type: "object" },
|
|
552
|
+
outputSchema: { type: "object" },
|
|
553
|
+
evidence: []
|
|
554
|
+
},
|
|
555
|
+
async () => broker.handshake()
|
|
556
|
+
)
|
|
557
|
+
];
|
|
558
|
+
}
|
|
559
|
+
var ViewInspectorBroker = class {
|
|
560
|
+
constructor({ transport, accessToken, hostAssembly, toolApi, context } = {}) {
|
|
561
|
+
if (!transport || typeof transport.register !== "function") {
|
|
562
|
+
throw new TypeError("View inspector requires an Engine Host transport");
|
|
563
|
+
}
|
|
564
|
+
this.transport = transport;
|
|
565
|
+
this.accessToken = requireWorkspaceString(accessToken, "accessToken");
|
|
566
|
+
this.hostAssembly = hostAssembly;
|
|
567
|
+
this.toolApi = toolApi;
|
|
568
|
+
this.context = context;
|
|
569
|
+
this.reports = /* @__PURE__ */ new Map();
|
|
570
|
+
this.watches = /* @__PURE__ */ new Map();
|
|
571
|
+
this.frontendCapabilities = /* @__PURE__ */ new Map();
|
|
572
|
+
this.disposers = [];
|
|
573
|
+
this.backendSourceGeneration = 1;
|
|
574
|
+
}
|
|
575
|
+
grantFrontendConnection(caller) {
|
|
576
|
+
if (!caller || caller.kind !== "frontend" || caller.sourceId !== "view-frontend" || typeof caller.capability !== "string") {
|
|
577
|
+
throw workspaceError(
|
|
578
|
+
"view-inspector-unauthorized",
|
|
579
|
+
"a real FrontendHost connection to receive the inspector capability",
|
|
580
|
+
"Connect the frontend through the backend Host pairing before reporting activation."
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
this.frontendCapabilities.set(caller.connectionId, caller.capability);
|
|
584
|
+
return caller.capability;
|
|
585
|
+
}
|
|
586
|
+
assertFrontendCaller(caller) {
|
|
587
|
+
if (!caller || caller.kind !== "frontend" || caller.sourceId !== "view-frontend" || this.frontendCapabilities.get(caller.connectionId) !== caller.capability) {
|
|
588
|
+
throw workspaceError(
|
|
589
|
+
"view-inspector-unauthorized",
|
|
590
|
+
"a backend-issued inspector capability on a real FrontendHost connection",
|
|
591
|
+
"Report frontend activation only through the paired FrontendHost transport.",
|
|
592
|
+
{ kind: caller?.kind, sourceId: caller?.sourceId }
|
|
593
|
+
);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
backendSnapshot() {
|
|
597
|
+
let api;
|
|
598
|
+
let state = "unknown";
|
|
599
|
+
try {
|
|
600
|
+
api = safeToolSnapshot(this.toolApi?.snapshot?.());
|
|
601
|
+
} catch (error) {
|
|
602
|
+
state = "unavailable";
|
|
603
|
+
api = { providers: [], operations: [], error: safeError(error) };
|
|
604
|
+
}
|
|
605
|
+
const assembly = safeAssembly(this.hostAssembly);
|
|
606
|
+
const activation = safeActivationStatus(this.hostAssembly?.activation);
|
|
607
|
+
if (activation.state !== "unknown") state = activation.state;
|
|
608
|
+
const fibers = [];
|
|
609
|
+
for (const runtime of this.context?.registry?.values?.() ?? []) {
|
|
610
|
+
for (const fiber of runtime.fibers ?? []) {
|
|
611
|
+
const inspected = inspectPluginFiber(fiber);
|
|
612
|
+
if (inspected.uid !== null) fibers.push({ ...inspected, realm: "host" });
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
const actual = actualPluginEntries(this.hostAssembly?.activation, api, fibers);
|
|
616
|
+
return {
|
|
617
|
+
apiVersion: VIEW_INSPECTOR_API_VERSION,
|
|
618
|
+
sourceId: "view-backend",
|
|
619
|
+
kind: "backend",
|
|
620
|
+
generation: this.hostAssembly?.generation ?? this.backendSourceGeneration,
|
|
621
|
+
state,
|
|
622
|
+
observedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
623
|
+
coverage: {
|
|
624
|
+
assembly: assembly !== null,
|
|
625
|
+
activation: this.hostAssembly?.activation === void 0 ? "unknown" : "actual",
|
|
626
|
+
api: this.toolApi !== void 0,
|
|
627
|
+
frontend: false
|
|
628
|
+
},
|
|
629
|
+
assembly,
|
|
630
|
+
actual: activation,
|
|
631
|
+
api,
|
|
632
|
+
plugins: actual
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
frontendSnapshot(record) {
|
|
636
|
+
return {
|
|
637
|
+
apiVersion: VIEW_INSPECTOR_API_VERSION,
|
|
638
|
+
sourceId: record.sourceId,
|
|
639
|
+
kind: "frontend",
|
|
640
|
+
generation: record.generation,
|
|
641
|
+
state: record.state,
|
|
642
|
+
observedAt: record.observedAt,
|
|
643
|
+
connection: record.connection,
|
|
644
|
+
coverage: {
|
|
645
|
+
assembly: record.assembly !== null,
|
|
646
|
+
activation: record.actual?.entries === void 0 ? "unknown" : "actual",
|
|
647
|
+
api: true,
|
|
648
|
+
frontend: true
|
|
649
|
+
},
|
|
650
|
+
assembly: record.assembly,
|
|
651
|
+
actual: record.actual,
|
|
652
|
+
api: record.api,
|
|
653
|
+
plugins: record.plugins
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
source(sourceId) {
|
|
657
|
+
if (sourceId === "view-backend") return this.backendSnapshot();
|
|
658
|
+
const report = this.reports.get(sourceId);
|
|
659
|
+
return report === void 0 ? void 0 : this.frontendSnapshot(report);
|
|
660
|
+
}
|
|
661
|
+
requireSource(sourceId, generation) {
|
|
662
|
+
requireWorkspaceString(sourceId, "sourceId");
|
|
663
|
+
if (!Number.isSafeInteger(generation) || generation <= 0) {
|
|
664
|
+
throw workspaceError(
|
|
665
|
+
"view-inspector-generation-required",
|
|
666
|
+
"source generation to be a positive integer",
|
|
667
|
+
"Call plugins.sources and pass the generation returned for the selected source.",
|
|
668
|
+
{ sourceId }
|
|
669
|
+
);
|
|
670
|
+
}
|
|
671
|
+
const current = this.source(sourceId);
|
|
672
|
+
if (current === void 0) {
|
|
673
|
+
throw workspaceError(
|
|
674
|
+
"view-inspector-source-unavailable",
|
|
675
|
+
`source ${sourceId} to be connected and observed`,
|
|
676
|
+
"Refresh plugins.sources and select an authenticated source that is still connected.",
|
|
677
|
+
{ sourceId }
|
|
678
|
+
);
|
|
679
|
+
}
|
|
680
|
+
if (generation !== current.generation) {
|
|
681
|
+
throw workspaceError(
|
|
682
|
+
"view-inspector-stale-generation",
|
|
683
|
+
`source ${sourceId} generation ${generation} to match ${current.generation}`,
|
|
684
|
+
"Refresh plugins.sources before inspecting or watching this source.",
|
|
685
|
+
{ sourceId, expectedGeneration: current.generation, actualGeneration: generation }
|
|
686
|
+
);
|
|
687
|
+
}
|
|
688
|
+
return current;
|
|
689
|
+
}
|
|
690
|
+
authorize(request) {
|
|
691
|
+
if (request.token !== this.accessToken) {
|
|
692
|
+
throw workspaceError(
|
|
693
|
+
"view-inspector-unauthorized",
|
|
694
|
+
"the caller to use the View Host inspector token",
|
|
695
|
+
"Connect with the token issued by the View Host.",
|
|
696
|
+
{ clientId: request.clientId }
|
|
697
|
+
);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
sources(request) {
|
|
701
|
+
this.authorize(request);
|
|
702
|
+
const backend = this.backendSnapshot();
|
|
703
|
+
const frontend = [...this.reports.values()].map((record) => this.frontendSnapshot(record));
|
|
704
|
+
return {
|
|
705
|
+
apiVersion: VIEW_INSPECTOR_API_VERSION,
|
|
706
|
+
observedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
707
|
+
sources: [backend, ...frontend].map((source) => ({
|
|
708
|
+
sourceId: source.sourceId,
|
|
709
|
+
kind: source.kind,
|
|
710
|
+
generation: source.generation,
|
|
711
|
+
state: source.state,
|
|
712
|
+
observedAt: source.observedAt,
|
|
713
|
+
...source.connection === void 0 ? {} : { connection: source.connection },
|
|
714
|
+
coverage: source.coverage,
|
|
715
|
+
pluginCount: Array.isArray(source.plugins) ? source.plugins.length : 0,
|
|
716
|
+
operationCount: source.api?.operations?.length ?? 0
|
|
717
|
+
})),
|
|
718
|
+
caller: { connectionId: request.caller?.connectionId, kind: request.caller?.kind }
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
inspect(request) {
|
|
722
|
+
this.authorize(request);
|
|
723
|
+
const source = this.requireSource(request.args.sourceId, request.args.generation);
|
|
724
|
+
const entryId = request.args.entryId;
|
|
725
|
+
if (entryId !== void 0) requireWorkspaceString(entryId, "entryId");
|
|
726
|
+
if (entryId === void 0) return source;
|
|
727
|
+
return {
|
|
728
|
+
...source,
|
|
729
|
+
plugins: source.plugins.filter((entry) => entry.entryId === entryId),
|
|
730
|
+
api: {
|
|
731
|
+
...source.api,
|
|
732
|
+
operations: source.api.operations.filter(
|
|
733
|
+
(operation) => operation.owner?.fiberId === entryId || operation.descriptor?.id === entryId
|
|
734
|
+
)
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
watch(request) {
|
|
739
|
+
this.authorize(request);
|
|
740
|
+
const source = this.requireSource(request.args.sourceId, request.args.generation);
|
|
741
|
+
const watchId = createWorkspaceId("inspector-watch");
|
|
742
|
+
this.watches.set(watchId, {
|
|
743
|
+
watchId,
|
|
744
|
+
sourceId: source.sourceId,
|
|
745
|
+
generation: source.generation,
|
|
746
|
+
connectionId: request.caller.connectionId
|
|
747
|
+
});
|
|
748
|
+
return {
|
|
749
|
+
apiVersion: VIEW_INSPECTOR_API_VERSION,
|
|
750
|
+
watchId,
|
|
751
|
+
topic: VIEW_INSPECTOR_TOPIC,
|
|
752
|
+
source
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
unwatch(request) {
|
|
756
|
+
this.authorize(request);
|
|
757
|
+
const watchId = requireWorkspaceString(request.args.watchId, "watchId");
|
|
758
|
+
const watch = this.watches.get(watchId);
|
|
759
|
+
if (watch !== void 0 && watch.connectionId !== request.caller.connectionId) {
|
|
760
|
+
throw workspaceError(
|
|
761
|
+
"view-inspector-unauthorized",
|
|
762
|
+
"the watch to be owned by the authenticated caller",
|
|
763
|
+
"Use the watchId returned by this connection.",
|
|
764
|
+
{ watchId }
|
|
765
|
+
);
|
|
766
|
+
}
|
|
767
|
+
this.watches.delete(watchId);
|
|
768
|
+
return { apiVersion: VIEW_INSPECTOR_API_VERSION, watchId, released: true };
|
|
769
|
+
}
|
|
770
|
+
async report(request, caller) {
|
|
771
|
+
this.authorize(request);
|
|
772
|
+
this.assertFrontendCaller(caller);
|
|
773
|
+
const sourceId = sourceIdFor(caller);
|
|
774
|
+
const previous = this.reports.get(sourceId);
|
|
775
|
+
const generation = (previous?.generation ?? 0) + 1;
|
|
776
|
+
const report = request.args?.report ?? {};
|
|
777
|
+
if (!report || typeof report !== "object" || Array.isArray(report)) {
|
|
778
|
+
throw workspaceError(
|
|
779
|
+
"view-inspector-invalid-report",
|
|
780
|
+
"frontend report to be a structured object",
|
|
781
|
+
"Send the activation status and safe API projection produced by FrontendHost."
|
|
782
|
+
);
|
|
783
|
+
}
|
|
784
|
+
const record = {
|
|
785
|
+
sourceId,
|
|
786
|
+
generation,
|
|
787
|
+
state: safeText(report.actual?.state ?? report.state, "active"),
|
|
788
|
+
observedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
789
|
+
connection: { connectionId: caller.connectionId, kind: caller.kind ?? "unknown" },
|
|
790
|
+
assembly: safeAssembly(report.assembly),
|
|
791
|
+
actual: safeActivationStatus(report.actual ?? report.status),
|
|
792
|
+
api: safeToolSnapshot(report.api),
|
|
793
|
+
plugins: actualPluginEntries(
|
|
794
|
+
report.actual ?? report.status,
|
|
795
|
+
report.api,
|
|
796
|
+
Array.isArray(report.plugins) ? report.plugins : []
|
|
797
|
+
)
|
|
798
|
+
};
|
|
799
|
+
this.reports.set(sourceId, record);
|
|
800
|
+
this.publish(sourceId);
|
|
801
|
+
return { apiVersion: VIEW_INSPECTOR_API_VERSION, sourceId, generation };
|
|
802
|
+
}
|
|
803
|
+
publish(sourceId) {
|
|
804
|
+
const source = this.source(sourceId);
|
|
805
|
+
if (source === void 0) return;
|
|
806
|
+
for (const [watchId, watch] of this.watches) {
|
|
807
|
+
if (watch.sourceId !== sourceId) continue;
|
|
808
|
+
if (watch.generation !== source.generation) {
|
|
809
|
+
this.transport.publish(
|
|
810
|
+
VIEW_INSPECTOR_TOPIC,
|
|
811
|
+
{
|
|
812
|
+
apiVersion: VIEW_INSPECTOR_API_VERSION,
|
|
813
|
+
watchId,
|
|
814
|
+
sourceId,
|
|
815
|
+
state: "stale",
|
|
816
|
+
generation: source.generation,
|
|
817
|
+
reason: "source-generation-changed"
|
|
818
|
+
},
|
|
819
|
+
{ connectionId: watch.connectionId }
|
|
820
|
+
);
|
|
821
|
+
this.watches.delete(watchId);
|
|
822
|
+
continue;
|
|
823
|
+
}
|
|
824
|
+
this.transport.publish(
|
|
825
|
+
VIEW_INSPECTOR_TOPIC,
|
|
826
|
+
{ apiVersion: VIEW_INSPECTOR_API_VERSION, watchId, source },
|
|
827
|
+
{ connectionId: watch.connectionId }
|
|
828
|
+
);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
install({ dispatch } = {}) {
|
|
832
|
+
if (typeof dispatch !== "function") {
|
|
833
|
+
throw new TypeError("View inspector requires an Engine ToolApi dispatch adapter");
|
|
834
|
+
}
|
|
835
|
+
const register = (service, operation) => {
|
|
836
|
+
this.disposers.push(
|
|
837
|
+
this.transport.register(
|
|
838
|
+
service,
|
|
839
|
+
({ payload, signal, caller }) => dispatch({ operation, payload, signal, caller })
|
|
840
|
+
)
|
|
841
|
+
);
|
|
842
|
+
};
|
|
843
|
+
register(VIEW_INSPECTOR_SERVICES.sources, "plugins.sources");
|
|
844
|
+
register(VIEW_INSPECTOR_SERVICES.inspect, "plugins.inspect");
|
|
845
|
+
register(VIEW_INSPECTOR_SERVICES.watch, "plugins.watch");
|
|
846
|
+
register(VIEW_INSPECTOR_SERVICES.unwatch, "plugins.unwatch");
|
|
847
|
+
register(VIEW_INSPECTOR_SERVICES.report, "plugins.report");
|
|
848
|
+
if (typeof this.toolApi?.subscribe === "function") {
|
|
849
|
+
this.disposers.push(this.toolApi.subscribe(() => this.publish("view-backend")));
|
|
850
|
+
}
|
|
851
|
+
if (typeof this.transport.onClientConnect === "function") {
|
|
852
|
+
this.disposers.push(
|
|
853
|
+
this.transport.onClientConnect((caller) => {
|
|
854
|
+
if (caller.kind === "frontend" && caller.sourceId === "view-frontend") {
|
|
855
|
+
try {
|
|
856
|
+
this.grantFrontendConnection(caller);
|
|
857
|
+
} catch {
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
})
|
|
861
|
+
);
|
|
862
|
+
}
|
|
863
|
+
if (typeof this.transport.onClientDisconnect === "function") {
|
|
864
|
+
this.disposers.push(
|
|
865
|
+
this.transport.onClientDisconnect((caller) => {
|
|
866
|
+
const sourceId = sourceIdFor(caller);
|
|
867
|
+
const report = this.reports.get(sourceId);
|
|
868
|
+
if (report !== void 0) {
|
|
869
|
+
for (const [watchId, watch] of this.watches) {
|
|
870
|
+
if (watch.sourceId !== sourceId || watch.connectionId === caller.connectionId) continue;
|
|
871
|
+
this.transport.publish(
|
|
872
|
+
VIEW_INSPECTOR_TOPIC,
|
|
873
|
+
{
|
|
874
|
+
apiVersion: VIEW_INSPECTOR_API_VERSION,
|
|
875
|
+
watchId,
|
|
876
|
+
sourceId,
|
|
877
|
+
state: "stale",
|
|
878
|
+
generation: report.generation + 1,
|
|
879
|
+
reason: "source-disconnected"
|
|
880
|
+
},
|
|
881
|
+
{ connectionId: watch.connectionId }
|
|
882
|
+
);
|
|
883
|
+
this.watches.delete(watchId);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
this.reports.delete(sourceId);
|
|
887
|
+
this.frontendCapabilities.delete(caller.connectionId);
|
|
888
|
+
for (const [watchId, watch] of this.watches) {
|
|
889
|
+
if (watch.connectionId === caller.connectionId) this.watches.delete(watchId);
|
|
890
|
+
}
|
|
891
|
+
})
|
|
892
|
+
);
|
|
893
|
+
}
|
|
894
|
+
return () => {
|
|
895
|
+
for (const dispose of this.disposers.splice(0)) dispose?.();
|
|
896
|
+
this.reports.clear();
|
|
897
|
+
this.watches.clear();
|
|
898
|
+
this.frontendCapabilities.clear();
|
|
899
|
+
};
|
|
900
|
+
}
|
|
901
|
+
};
|
|
902
|
+
var viewInspectorBackendPlugin = {
|
|
903
|
+
name: BACKEND_PLUGIN_ID,
|
|
904
|
+
provide: ["viewInspector"],
|
|
905
|
+
async apply(ctx, config = {}) {
|
|
906
|
+
const transport = ctx.get?.("hostTransport", false);
|
|
907
|
+
if (!transport) return;
|
|
908
|
+
const broker = new ViewInspectorBroker({
|
|
909
|
+
transport,
|
|
910
|
+
accessToken: config.accessToken ?? ctx.get?.("viewWorkspaceAccessToken", false),
|
|
911
|
+
hostAssembly: ctx.get?.("hostAssembly", false),
|
|
912
|
+
toolApi: ctx.get?.("toolApi", false),
|
|
913
|
+
context: ctx
|
|
914
|
+
});
|
|
915
|
+
ctx.provide("viewInspector", broker);
|
|
916
|
+
const inspectorTools = createViewInspectorToolContributions(broker);
|
|
917
|
+
const inspectorProviderId = `view-inspector:${String(ctx.fiber.uid)}`;
|
|
918
|
+
ctx.effect(() => registerTools(ctx, inspectorTools, {
|
|
919
|
+
providerId: inspectorProviderId,
|
|
920
|
+
sourceId: "view-backend",
|
|
921
|
+
module: BACKEND_MODULE,
|
|
922
|
+
realm: "host"
|
|
923
|
+
}));
|
|
924
|
+
const inspectorOwner = ctx.get?.("toolApi", false)?.describe("plugins.sources", "view-backend")?.find((record) => record.owner.providerId === inspectorProviderId)?.owner;
|
|
925
|
+
if (!inspectorOwner) {
|
|
926
|
+
throw new Error("View inspector ToolApi provider did not activate");
|
|
927
|
+
}
|
|
928
|
+
const uninstall = broker.install({
|
|
929
|
+
dispatch: ({ operation, payload, signal, caller }) => runInspectorToolApi(ctx.get?.("toolApi", false), {
|
|
930
|
+
operation,
|
|
931
|
+
payload,
|
|
932
|
+
signal,
|
|
933
|
+
caller,
|
|
934
|
+
providerId: inspectorOwner.providerId,
|
|
935
|
+
generation: inspectorOwner.generation
|
|
936
|
+
})
|
|
937
|
+
});
|
|
938
|
+
ctx.effect(() => () => uninstall());
|
|
939
|
+
}
|
|
940
|
+
};
|
|
941
|
+
function projectLocalAssembly(value) {
|
|
942
|
+
const assembly = value?.current ?? value;
|
|
943
|
+
return safeAssembly(assembly);
|
|
944
|
+
}
|
|
945
|
+
var ViewInspectorClient = class {
|
|
946
|
+
constructor({ transport, clientId, token } = {}) {
|
|
947
|
+
if (!transport || typeof transport.request !== "function") {
|
|
948
|
+
throw new TypeError("View inspector client requires an Engine Host transport");
|
|
949
|
+
}
|
|
950
|
+
this.transport = transport;
|
|
951
|
+
this.clientId = requireWorkspaceString(clientId, "clientId");
|
|
952
|
+
this.token = token === void 0 ? void 0 : requireWorkspaceString(token, "token");
|
|
953
|
+
}
|
|
954
|
+
request(service, operation, args = {}, options = {}) {
|
|
955
|
+
const request = createInspectorRequest(operation, args, {
|
|
956
|
+
clientId: this.clientId,
|
|
957
|
+
token: this.token,
|
|
958
|
+
requestId: options.requestId
|
|
959
|
+
});
|
|
960
|
+
return this.transport.request(service, request, { signal: options.signal }).catch((error) => {
|
|
961
|
+
const decoded = decodeInspectorError(error);
|
|
962
|
+
reportWorkspaceCommandError(decoded, { operation, signal: options.signal });
|
|
963
|
+
throw decoded;
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
sources(options = {}) {
|
|
967
|
+
return this.request(VIEW_INSPECTOR_SERVICES.sources, "plugins.sources", {}, options);
|
|
968
|
+
}
|
|
969
|
+
inspect({ sourceId, generation, entryId, ...options } = {}) {
|
|
970
|
+
return this.request(
|
|
971
|
+
VIEW_INSPECTOR_SERVICES.inspect,
|
|
972
|
+
"plugins.inspect",
|
|
973
|
+
{ sourceId, generation, ...entryId === void 0 ? {} : { entryId } },
|
|
974
|
+
options
|
|
975
|
+
);
|
|
976
|
+
}
|
|
977
|
+
watch({ sourceId, generation, ...options } = {}) {
|
|
978
|
+
return this.request(VIEW_INSPECTOR_SERVICES.watch, "plugins.watch", { sourceId, generation }, options);
|
|
979
|
+
}
|
|
980
|
+
unwatch(watchId, options = {}) {
|
|
981
|
+
return this.request(VIEW_INSPECTOR_SERVICES.unwatch, "plugins.unwatch", { watchId }, options);
|
|
982
|
+
}
|
|
983
|
+
report(report) {
|
|
984
|
+
return this.request(VIEW_INSPECTOR_SERVICES.report, "plugins.report", { report });
|
|
985
|
+
}
|
|
986
|
+
subscribe(listener) {
|
|
987
|
+
return this.transport.subscribe?.(VIEW_INSPECTOR_TOPIC, listener) ?? (() => {
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
onDisconnect(listener) {
|
|
991
|
+
return this.transport.onDisconnect?.(listener) ?? (() => {
|
|
992
|
+
});
|
|
993
|
+
}
|
|
994
|
+
};
|
|
995
|
+
var ViewInspectorPanel = class {
|
|
996
|
+
constructor({
|
|
997
|
+
client,
|
|
998
|
+
document = globalThis.document,
|
|
999
|
+
mountId = "forgeax-view-inspector",
|
|
1000
|
+
registry,
|
|
1001
|
+
mountSlot
|
|
1002
|
+
} = {}) {
|
|
1003
|
+
this.client = client;
|
|
1004
|
+
this.document = document;
|
|
1005
|
+
this.mountId = mountId;
|
|
1006
|
+
this.sourceId = null;
|
|
1007
|
+
this.generation = null;
|
|
1008
|
+
this.watchId = null;
|
|
1009
|
+
this.sources = [];
|
|
1010
|
+
this.refreshToken = 0;
|
|
1011
|
+
this.search = null;
|
|
1012
|
+
this.stateFilter = null;
|
|
1013
|
+
this.sourceList = null;
|
|
1014
|
+
this.hierarchy = null;
|
|
1015
|
+
this.detail = null;
|
|
1016
|
+
this.opened = false;
|
|
1017
|
+
this.element = null;
|
|
1018
|
+
this.button = null;
|
|
1019
|
+
this.selector = null;
|
|
1020
|
+
this.output = null;
|
|
1021
|
+
this.unsubscribe = null;
|
|
1022
|
+
this.removeDisconnect = null;
|
|
1023
|
+
this.unmountSlot = void 0;
|
|
1024
|
+
if (document?.createElement) {
|
|
1025
|
+
const slotted = registry && mountSlot;
|
|
1026
|
+
if (!slotted) {
|
|
1027
|
+
this.button = document.createElement("button");
|
|
1028
|
+
this.button.type = "button";
|
|
1029
|
+
this.button.textContent = "Plugins";
|
|
1030
|
+
this.button.dataset.forgeaxView = "inspector-entry";
|
|
1031
|
+
this.button.addEventListener?.("click", () => void this.toggle());
|
|
1032
|
+
document.body?.append(this.button);
|
|
1033
|
+
}
|
|
1034
|
+
this.element = document.getElementById?.(mountId) ?? document.createElement("aside");
|
|
1035
|
+
this.element.id ||= mountId;
|
|
1036
|
+
this.element.dataset.forgeaxView = "inspector";
|
|
1037
|
+
this.element.hidden = !slotted;
|
|
1038
|
+
if (slotted) {
|
|
1039
|
+
this.unmountSlot = registry.mount(mountSlot, this.element);
|
|
1040
|
+
this.opened = true;
|
|
1041
|
+
} else {
|
|
1042
|
+
document.body?.append(this.element);
|
|
1043
|
+
}
|
|
1044
|
+
this.selector = document.createElement("select");
|
|
1045
|
+
this.selector.dataset.forgeaxView = "inspector-source";
|
|
1046
|
+
this.selector.addEventListener?.("change", () => {
|
|
1047
|
+
void this.selectSource(
|
|
1048
|
+
this.selector.value || null,
|
|
1049
|
+
Number(this.selector.selectedOptions?.[0]?.dataset?.generation ?? 0) || null
|
|
1050
|
+
);
|
|
1051
|
+
});
|
|
1052
|
+
this.element.append(this.selector);
|
|
1053
|
+
this.search = document.createElement("input");
|
|
1054
|
+
this.search.type = "search";
|
|
1055
|
+
this.search.placeholder = "Filter plugins, modules, entries, or services";
|
|
1056
|
+
this.search.dataset.forgeaxView = "inspector-search";
|
|
1057
|
+
this.search.addEventListener?.("input", () => {
|
|
1058
|
+
this.renderSources({ sources: this.sources });
|
|
1059
|
+
this.renderHierarchy(this.lastValue);
|
|
1060
|
+
});
|
|
1061
|
+
this.element.append(this.search);
|
|
1062
|
+
this.stateFilter = document.createElement("select");
|
|
1063
|
+
this.stateFilter.dataset.forgeaxView = "inspector-state-filter";
|
|
1064
|
+
for (const state of ["all", "active", "pending", "failed", "disposed", "unknown"]) {
|
|
1065
|
+
const option = document.createElement("option");
|
|
1066
|
+
option.value = state;
|
|
1067
|
+
option.textContent = state;
|
|
1068
|
+
this.stateFilter.append(option);
|
|
1069
|
+
}
|
|
1070
|
+
this.stateFilter.addEventListener?.("change", () => {
|
|
1071
|
+
this.renderSources({ sources: this.sources });
|
|
1072
|
+
this.renderHierarchy(this.lastValue);
|
|
1073
|
+
});
|
|
1074
|
+
this.element.append(this.stateFilter);
|
|
1075
|
+
this.sourceList = document.createElement("ul");
|
|
1076
|
+
this.sourceList.dataset.forgeaxView = "inspector-sources";
|
|
1077
|
+
this.element.append(this.sourceList);
|
|
1078
|
+
this.hierarchy = document.createElement("ul");
|
|
1079
|
+
this.hierarchy.dataset.forgeaxView = "inspector-hierarchy";
|
|
1080
|
+
this.element.append(this.hierarchy);
|
|
1081
|
+
this.detail = document.createElement("section");
|
|
1082
|
+
this.detail.dataset.forgeaxView = "inspector-detail";
|
|
1083
|
+
this.output = document.createElement("pre");
|
|
1084
|
+
this.output.dataset.forgeaxView = "inspector-output";
|
|
1085
|
+
this.detail.append(this.output);
|
|
1086
|
+
this.element.append(this.detail);
|
|
1087
|
+
this.unsubscribe = client?.subscribe?.((payload) => this.handleChange(payload));
|
|
1088
|
+
this.removeDisconnect = client?.onDisconnect?.(() => {
|
|
1089
|
+
this.watchId = null;
|
|
1090
|
+
this.sourceId = null;
|
|
1091
|
+
this.generation = null;
|
|
1092
|
+
if (this.opened) void this.refresh();
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
async toggle() {
|
|
1097
|
+
if (this.opened) return this.close();
|
|
1098
|
+
return this.open();
|
|
1099
|
+
}
|
|
1100
|
+
async open() {
|
|
1101
|
+
this.opened = true;
|
|
1102
|
+
if (this.element) this.element.hidden = false;
|
|
1103
|
+
await this.refresh();
|
|
1104
|
+
}
|
|
1105
|
+
async refresh() {
|
|
1106
|
+
if (!this.client) {
|
|
1107
|
+
if (this.element) this.element.textContent = "Plugin inspection unavailable";
|
|
1108
|
+
return;
|
|
1109
|
+
}
|
|
1110
|
+
const refreshToken = ++this.refreshToken;
|
|
1111
|
+
try {
|
|
1112
|
+
const listed = await this.client.sources();
|
|
1113
|
+
if (refreshToken !== this.refreshToken) return;
|
|
1114
|
+
this.renderSources(listed);
|
|
1115
|
+
const own = listed.sources.find((source) => source.sourceId === this.sourceId);
|
|
1116
|
+
const selected = own ?? (this.sourceId === null && listed.sources.length === 1 ? listed.sources[0] : void 0);
|
|
1117
|
+
if (selected === void 0) {
|
|
1118
|
+
this.render(listed);
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1121
|
+
this.sourceId = selected.sourceId;
|
|
1122
|
+
this.generation = selected.generation;
|
|
1123
|
+
const inspected = await this.client.inspect({ sourceId: this.sourceId, generation: this.generation });
|
|
1124
|
+
if (refreshToken !== this.refreshToken) return;
|
|
1125
|
+
this.render(inspected);
|
|
1126
|
+
if (this.watchId === null) {
|
|
1127
|
+
const watch = await this.client.watch({ sourceId: this.sourceId, generation: this.generation });
|
|
1128
|
+
if (refreshToken !== this.refreshToken) {
|
|
1129
|
+
await this.client.unwatch(watch.watchId).catch(() => {
|
|
1130
|
+
});
|
|
1131
|
+
return;
|
|
1132
|
+
}
|
|
1133
|
+
this.watchId = watch.watchId;
|
|
1134
|
+
}
|
|
1135
|
+
} catch (error) {
|
|
1136
|
+
if (refreshToken !== this.refreshToken) return;
|
|
1137
|
+
this.render({ state: "error", error: safeError(error) ?? { message: safeText(error?.message) } });
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
handleChange(payload) {
|
|
1141
|
+
if (!this.opened || payload?.watchId !== this.watchId) return;
|
|
1142
|
+
if (payload.state === "stale") {
|
|
1143
|
+
this.watchId = null;
|
|
1144
|
+
this.generation = null;
|
|
1145
|
+
void this.refresh();
|
|
1146
|
+
return;
|
|
1147
|
+
}
|
|
1148
|
+
if (payload.source) this.render(payload.source);
|
|
1149
|
+
}
|
|
1150
|
+
render(value) {
|
|
1151
|
+
if (jsonUnchanged(this.lastValue, value)) return value;
|
|
1152
|
+
this.lastValue = value;
|
|
1153
|
+
if (Array.isArray(value?.sources)) this.renderSources(value);
|
|
1154
|
+
this.renderHierarchy(value);
|
|
1155
|
+
if (this.output) this.output.textContent = JSON.stringify(value, null, 2);
|
|
1156
|
+
else if (this.element) this.element.textContent = JSON.stringify(value, null, 2);
|
|
1157
|
+
return value;
|
|
1158
|
+
}
|
|
1159
|
+
renderSources(value) {
|
|
1160
|
+
const sources = Array.isArray(value?.sources) ? value.sources : [];
|
|
1161
|
+
if (Array.isArray(value?.sources)) this.sources = sources;
|
|
1162
|
+
const query = String(this.search?.value ?? "").trim().toLowerCase();
|
|
1163
|
+
const state = this.stateFilter?.value || "all";
|
|
1164
|
+
const filtered = this.sources.filter((source) => {
|
|
1165
|
+
if (state !== "all" && source.state !== state) return false;
|
|
1166
|
+
if (query === "") return true;
|
|
1167
|
+
return `${source.sourceId} ${source.kind} ${source.state}`.toLowerCase().includes(query);
|
|
1168
|
+
});
|
|
1169
|
+
if (!this.selector) return;
|
|
1170
|
+
this.selector.replaceChildren?.();
|
|
1171
|
+
this.selector.hidden = this.sources.length === 0;
|
|
1172
|
+
for (const source of this.sources) {
|
|
1173
|
+
const option = this.document.createElement("option");
|
|
1174
|
+
option.value = source.sourceId;
|
|
1175
|
+
option.textContent = `${source.kind ?? "source"}: ${source.sourceId} (generation ${source.generation})`;
|
|
1176
|
+
option.dataset.generation = String(source.generation ?? "");
|
|
1177
|
+
option.selected = source.sourceId === this.sourceId;
|
|
1178
|
+
this.selector.append(option);
|
|
1179
|
+
}
|
|
1180
|
+
if (this.sourceList) {
|
|
1181
|
+
this.sourceList.replaceChildren?.();
|
|
1182
|
+
for (const source of filtered) {
|
|
1183
|
+
const item = this.document.createElement("li");
|
|
1184
|
+
item.textContent = `${source.kind ?? "source"} ${source.sourceId} \xB7 ${source.state ?? "unknown"}`;
|
|
1185
|
+
item.dataset.sourceId = source.sourceId;
|
|
1186
|
+
this.sourceList.append(item);
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
renderHierarchy(value) {
|
|
1191
|
+
if (!this.hierarchy) return;
|
|
1192
|
+
this.hierarchy.replaceChildren?.();
|
|
1193
|
+
const query = String(this.search?.value ?? "").trim().toLowerCase();
|
|
1194
|
+
const stateFilter = this.stateFilter?.value || "all";
|
|
1195
|
+
const plugins = Array.isArray(value?.plugins) ? value.plugins : [];
|
|
1196
|
+
const pluginsById = new Map(
|
|
1197
|
+
plugins.filter((plugin) => typeof plugin?.entryId === "string").map((plugin) => [plugin.entryId, plugin])
|
|
1198
|
+
);
|
|
1199
|
+
const depthById = /* @__PURE__ */ new Map();
|
|
1200
|
+
const depthFor = (plugin, visiting = /* @__PURE__ */ new Set()) => {
|
|
1201
|
+
if (!plugin?.parent || visiting.has(plugin.entryId)) return 0;
|
|
1202
|
+
const cached = depthById.get(plugin.entryId);
|
|
1203
|
+
if (cached !== void 0) return cached;
|
|
1204
|
+
visiting.add(plugin.entryId);
|
|
1205
|
+
const parent = pluginsById.get(plugin.parent);
|
|
1206
|
+
const depth = parent === void 0 ? 0 : Math.min(8, depthFor(parent, visiting) + 1);
|
|
1207
|
+
visiting.delete(plugin.entryId);
|
|
1208
|
+
depthById.set(plugin.entryId, depth);
|
|
1209
|
+
return depth;
|
|
1210
|
+
};
|
|
1211
|
+
const matches = (state, text) => (stateFilter === "all" || state === stateFilter) && (query === "" || text.toLowerCase().includes(query));
|
|
1212
|
+
for (const plugin of plugins) {
|
|
1213
|
+
const state = plugin.fiberState ?? plugin.state ?? "unknown";
|
|
1214
|
+
const services = [
|
|
1215
|
+
...Array.isArray(plugin.requiredServices) ? plugin.requiredServices : [],
|
|
1216
|
+
...Array.isArray(plugin.providedServices) ? plugin.providedServices : []
|
|
1217
|
+
];
|
|
1218
|
+
const text = `${plugin.entryId ?? ""} ${plugin.module ?? ""} ${plugin.realm ?? ""} ${state} ${services.join(" ")} ${plugin.parent ?? ""}`;
|
|
1219
|
+
if (!matches(state, text)) continue;
|
|
1220
|
+
const depth = depthFor(plugin);
|
|
1221
|
+
const parentModule = pluginsById.get(plugin.parent)?.module;
|
|
1222
|
+
const parent = parentModule && parentModule !== "unknown" ? ` parent ${parentModule}` : "";
|
|
1223
|
+
const item = this.document.createElement("li");
|
|
1224
|
+
item.dataset.parent = plugin.parent ?? "";
|
|
1225
|
+
item.dataset.state = state;
|
|
1226
|
+
if (item.style) {
|
|
1227
|
+
item.style.paddingInlineStart = `${depth * 1.25}rem`;
|
|
1228
|
+
item.style.paddingLeft = `${depth * 1.25}rem`;
|
|
1229
|
+
}
|
|
1230
|
+
item.textContent = `${" ".repeat(depth)}${plugin.module ?? "Unnamed plugin"} \xB7 ${state}${parent}`;
|
|
1231
|
+
item.dataset.entryId = plugin.entryId ?? "";
|
|
1232
|
+
this.hierarchy.append(item);
|
|
1233
|
+
}
|
|
1234
|
+
const operations = Array.isArray(value?.api?.operations) ? value.api.operations : [];
|
|
1235
|
+
for (const operation of operations) {
|
|
1236
|
+
const descriptor = operation.descriptor ?? {};
|
|
1237
|
+
const state = operation.fiberState ?? operation.providerState ?? "unknown";
|
|
1238
|
+
const services = [
|
|
1239
|
+
...Array.isArray(operation.requiredServices) ? operation.requiredServices : [],
|
|
1240
|
+
...Array.isArray(operation.providedServices) ? operation.providedServices : []
|
|
1241
|
+
];
|
|
1242
|
+
const text = `${descriptor.id ?? ""} ${descriptor.title ?? ""} ${descriptor.summary ?? ""} ${operation.owner?.module ?? ""} ${operation.owner?.providerId ?? ""} ${services.join(" ")}`;
|
|
1243
|
+
if (!matches(state, text)) continue;
|
|
1244
|
+
const item = this.document.createElement("li");
|
|
1245
|
+
item.dataset.state = state;
|
|
1246
|
+
item.textContent = `service ${descriptor.id ?? "unknown"} \xB7 ${state}`;
|
|
1247
|
+
item.dataset.operationId = descriptor.id ?? "";
|
|
1248
|
+
this.hierarchy.append(item);
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
async selectSource(sourceId, generation) {
|
|
1252
|
+
const refreshToken = ++this.refreshToken;
|
|
1253
|
+
const previousWatch = this.watchId;
|
|
1254
|
+
this.watchId = null;
|
|
1255
|
+
if (previousWatch !== null && this.client) {
|
|
1256
|
+
await this.client.unwatch(previousWatch).catch(() => {
|
|
1257
|
+
});
|
|
1258
|
+
}
|
|
1259
|
+
if (refreshToken !== this.refreshToken) return;
|
|
1260
|
+
this.sourceId = sourceId;
|
|
1261
|
+
this.generation = generation;
|
|
1262
|
+
await this.refresh();
|
|
1263
|
+
}
|
|
1264
|
+
async close() {
|
|
1265
|
+
this.opened = false;
|
|
1266
|
+
this.refreshToken += 1;
|
|
1267
|
+
if (this.element) this.element.hidden = true;
|
|
1268
|
+
if (this.watchId !== null) {
|
|
1269
|
+
if (this.client) await this.client.unwatch(this.watchId).catch(() => {
|
|
1270
|
+
});
|
|
1271
|
+
this.watchId = null;
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
async dispose() {
|
|
1275
|
+
await this.close();
|
|
1276
|
+
this.unsubscribe?.();
|
|
1277
|
+
this.unsubscribe = null;
|
|
1278
|
+
this.removeDisconnect?.();
|
|
1279
|
+
this.removeDisconnect = null;
|
|
1280
|
+
this.unmountSlot?.();
|
|
1281
|
+
this.unmountSlot = void 0;
|
|
1282
|
+
this.button?.remove?.();
|
|
1283
|
+
this.element?.remove?.();
|
|
1284
|
+
this.button = null;
|
|
1285
|
+
this.element = null;
|
|
1286
|
+
this.selector = null;
|
|
1287
|
+
this.search = null;
|
|
1288
|
+
this.stateFilter = null;
|
|
1289
|
+
this.sourceList = null;
|
|
1290
|
+
this.hierarchy = null;
|
|
1291
|
+
this.detail = null;
|
|
1292
|
+
this.output = null;
|
|
1293
|
+
}
|
|
1294
|
+
};
|
|
1295
|
+
var viewInspectorFrontendPlugin = {
|
|
1296
|
+
name: "forgeax.view.service.plugin-inspection-reporter.frontend",
|
|
1297
|
+
provide: ["viewInspectorClient", "viewInspectorPanel"],
|
|
1298
|
+
async apply(ctx, config = {}) {
|
|
1299
|
+
const transport = config.transport ?? ctx.get?.("hostTransport", false);
|
|
1300
|
+
const workspace = config.workspace ?? {};
|
|
1301
|
+
const token = config.token ?? workspace.token;
|
|
1302
|
+
const client = transport && typeof token === "string" && typeof workspace.clientId === "string" ? new ViewInspectorClient({ transport, clientId: workspace.clientId, token }) : void 0;
|
|
1303
|
+
const panel = new ViewInspectorPanel({
|
|
1304
|
+
client,
|
|
1305
|
+
document: config.document ?? globalThis.document,
|
|
1306
|
+
mountId: config.mountId ?? "forgeax-view-inspector",
|
|
1307
|
+
registry: config.registry,
|
|
1308
|
+
mountSlot: config.mountSlot
|
|
1309
|
+
});
|
|
1310
|
+
ctx.provide("viewInspectorClient", client);
|
|
1311
|
+
ctx.provide("viewInspectorPanel", panel);
|
|
1312
|
+
if (client) {
|
|
1313
|
+
const toolApi = ctx.get?.("toolApi", false);
|
|
1314
|
+
const hostAssembly = ctx.get?.("hostAssembly", false);
|
|
1315
|
+
const inspectorFiberEntry = () => ({
|
|
1316
|
+
entryId: `fiber:${String(ctx.fiber.uid ?? "unknown")}`,
|
|
1317
|
+
fiberId: String(ctx.fiber.uid ?? "unknown"),
|
|
1318
|
+
module: "forgeax.view.service.plugin-inspection-reporter.frontend",
|
|
1319
|
+
realm: "engine",
|
|
1320
|
+
fiberState: fiberStateName(ctx.fiber.state)
|
|
1321
|
+
});
|
|
1322
|
+
const report = () => ({
|
|
1323
|
+
// The report is emitted after this plugin's apply completed. The
|
|
1324
|
+
// outer FrontendHost may still be in its loading phase while it
|
|
1325
|
+
// collects the complete activation receipt.
|
|
1326
|
+
status: ctx.get?.("hostAssembly", false)?.status ?? { state: "unknown" },
|
|
1327
|
+
actual: (() => {
|
|
1328
|
+
const status = hostAssembly?.status ?? { state: "unknown" };
|
|
1329
|
+
const live = hostAssembly?.inspection;
|
|
1330
|
+
return {
|
|
1331
|
+
...status,
|
|
1332
|
+
entries: [
|
|
1333
|
+
...Array.isArray(status.entries) ? status.entries : [],
|
|
1334
|
+
...Array.isArray(live) ? live : [],
|
|
1335
|
+
inspectorFiberEntry()
|
|
1336
|
+
]
|
|
1337
|
+
};
|
|
1338
|
+
})(),
|
|
1339
|
+
assembly: projectLocalAssembly(ctx.get?.("hostAssembly", false)),
|
|
1340
|
+
api: safeToolSnapshot(toolApi?.snapshot?.()),
|
|
1341
|
+
plugins: [
|
|
1342
|
+
safePluginEntry(inspectorFiberEntry()),
|
|
1343
|
+
...Array.isArray(ctx.get?.("hostAssembly", false)?.status?.entries) ? ctx.get("hostAssembly", false).status.entries.map(safePluginEntry).filter((entry) => entry !== null) : [],
|
|
1344
|
+
...Array.isArray(ctx.get?.("hostAssembly", false)?.inspection) ? ctx.get("hostAssembly", false).inspection.map(safePluginEntry).filter((entry) => entry !== null) : []
|
|
1345
|
+
]
|
|
1346
|
+
});
|
|
1347
|
+
let reporting = Promise.resolve();
|
|
1348
|
+
const publishReport = ({ allowUnready = false } = {}) => {
|
|
1349
|
+
const state = hostAssembly?.status?.state;
|
|
1350
|
+
if (!allowUnready && hostAssembly !== void 0 && (state === "created" || state === "loading")) {
|
|
1351
|
+
return reporting;
|
|
1352
|
+
}
|
|
1353
|
+
reporting = reporting.then(async () => {
|
|
1354
|
+
const registered = await client.report(report());
|
|
1355
|
+
panel.sourceId = registered.sourceId;
|
|
1356
|
+
panel.generation = registered.generation;
|
|
1357
|
+
}).catch(() => {
|
|
1358
|
+
});
|
|
1359
|
+
return reporting;
|
|
1360
|
+
};
|
|
1361
|
+
const unsubscribeAssembly = hostAssembly?.subscribe?.(() => {
|
|
1362
|
+
void publishReport();
|
|
1363
|
+
});
|
|
1364
|
+
const unsubscribeToolApi = toolApi?.subscribe?.(() => {
|
|
1365
|
+
void publishReport();
|
|
1366
|
+
});
|
|
1367
|
+
await publishReport({ allowUnready: true });
|
|
1368
|
+
ctx.effect(() => async () => {
|
|
1369
|
+
unsubscribeAssembly?.();
|
|
1370
|
+
unsubscribeToolApi?.();
|
|
1371
|
+
await panel.dispose();
|
|
1372
|
+
});
|
|
1373
|
+
} else {
|
|
1374
|
+
ctx.effect(() => async () => panel.dispose());
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
};
|
|
1378
|
+
|
|
1379
|
+
export {
|
|
1380
|
+
VIEW_INSPECTOR_API_VERSION,
|
|
1381
|
+
VIEW_INSPECTOR_SERVICES,
|
|
1382
|
+
VIEW_INSPECTOR_TOPIC,
|
|
1383
|
+
VIEW_STATUS_OPERATION,
|
|
1384
|
+
VIEW_INSPECTOR_OPERATIONS,
|
|
1385
|
+
safeDetail,
|
|
1386
|
+
safeError,
|
|
1387
|
+
createInspectorRequest,
|
|
1388
|
+
runWorkspaceToolApi,
|
|
1389
|
+
runInspectorToolApi,
|
|
1390
|
+
runViewToolApi,
|
|
1391
|
+
createViewWorkspaceToolContributions,
|
|
1392
|
+
createViewInspectorToolContributions,
|
|
1393
|
+
createViewStatusToolContributions,
|
|
1394
|
+
ViewInspectorBroker,
|
|
1395
|
+
viewInspectorBackendPlugin,
|
|
1396
|
+
ViewInspectorClient,
|
|
1397
|
+
ViewInspectorPanel,
|
|
1398
|
+
viewInspectorFrontendPlugin
|
|
1399
|
+
};
|
|
1400
|
+
//# sourceMappingURL=chunk-KHRTIZ56.mjs.map
|