@forgeax/view 0.5.0-dev.13604.c415409c3b9d → 0.5.0-dev.13713.d28c4863d779
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/README.md +67 -9
- package/dist/build-revision.json +1 -1
- package/dist/modules/backend.mjs +34 -34
- package/dist/modules/browser.mjs +55 -49
- package/dist/modules/chunks/{chunk-EWSCJF77.mjs → chunk-2CMCY54A.mjs} +2 -2
- package/dist/modules/chunks/{chunk-M6S5YA6X.mjs → chunk-2RUKPDIE.mjs} +4 -4
- package/dist/modules/chunks/{chunk-M6S5YA6X.mjs.map → chunk-2RUKPDIE.mjs.map} +1 -1
- package/dist/modules/chunks/{chunk-DWT3TA6M.mjs → chunk-3FBX3P3H.mjs} +9 -8
- package/dist/modules/chunks/chunk-3FBX3P3H.mjs.map +7 -0
- package/dist/modules/chunks/{chunk-6KM24NH6.mjs → chunk-3Y5WN22T.mjs} +3 -3
- package/dist/modules/chunks/chunk-3Y5WN22T.mjs.map +7 -0
- package/dist/modules/chunks/{chunk-YFQGSDK3.mjs → chunk-45WL24XN.mjs} +2 -2
- package/dist/modules/chunks/{chunk-FMCHH5R4.mjs → chunk-4FYKRL46.mjs} +3 -3
- package/dist/modules/chunks/{chunk-VW2ZF3P4.mjs → chunk-4MJHVZMB.mjs} +6 -6
- package/dist/modules/chunks/{chunk-XQYF2P6M.mjs → chunk-5HVXQEO3.mjs} +7 -7
- package/dist/modules/chunks/{chunk-XMP4THLF.mjs → chunk-66LM6NO6.mjs} +4 -4
- package/dist/modules/chunks/{chunk-P4UPH74B.mjs → chunk-6C4OCCYB.mjs} +12 -12
- package/dist/modules/chunks/{chunk-P4UPH74B.mjs.map → chunk-6C4OCCYB.mjs.map} +1 -1
- package/dist/modules/chunks/{chunk-ZGOGO7SS.mjs → chunk-6J27SWMY.mjs} +1 -1
- package/dist/modules/chunks/{chunk-JK7K7RG3.mjs → chunk-6VK7HB4X.mjs} +4 -4
- package/dist/modules/chunks/{chunk-HRKW766Y.mjs → chunk-6WZZ7TIC.mjs} +2 -2
- package/dist/modules/chunks/{chunk-FICPCJKR.mjs → chunk-7DFCIN3T.mjs} +3 -3
- package/dist/modules/chunks/{chunk-FICPCJKR.mjs.map → chunk-7DFCIN3T.mjs.map} +1 -1
- package/dist/modules/chunks/{chunk-U64FRQKP.mjs → chunk-7MWZK7HS.mjs} +3 -3
- package/dist/modules/chunks/{chunk-F5RLQAPN.mjs → chunk-A7OGXJAV.mjs} +3 -3
- package/dist/modules/chunks/{chunk-QUFVUMSY.mjs → chunk-AUINYWZP.mjs} +2 -2
- package/dist/modules/chunks/{chunk-PZIAKZJC.mjs → chunk-B24VYGHV.mjs} +3 -3
- package/dist/modules/chunks/{chunk-SRYQLFBV.mjs → chunk-BIUWJROZ.mjs} +3 -3
- package/dist/modules/chunks/{chunk-SRYQLFBV.mjs.map → chunk-BIUWJROZ.mjs.map} +2 -2
- package/dist/modules/chunks/{chunk-X4NNZ5X6.mjs → chunk-C2AMOM7H.mjs} +3 -3
- package/dist/modules/chunks/{chunk-IZAHIOFU.mjs → chunk-C3WVSJZF.mjs} +6 -6
- package/dist/modules/chunks/{chunk-2Z5KEV6L.mjs → chunk-CAXCOZ7Y.mjs} +3 -3
- package/dist/modules/chunks/{chunk-HWZCLROY.mjs → chunk-CN6YN4HP.mjs} +251 -45
- package/dist/modules/chunks/chunk-CN6YN4HP.mjs.map +7 -0
- package/dist/modules/chunks/{chunk-B6QUJ33G.mjs → chunk-CXFQME65.mjs} +3 -3
- package/dist/modules/chunks/{chunk-IJPWKKIU.mjs → chunk-CYOLEAAY.mjs} +14 -13
- package/dist/modules/chunks/chunk-CYOLEAAY.mjs.map +7 -0
- package/dist/modules/chunks/{chunk-U6UMATPV.mjs → chunk-CYU3WWN6.mjs} +3 -3
- package/dist/modules/chunks/{chunk-AGVLPYVE.mjs → chunk-D2LZIQE2.mjs} +2 -2
- package/dist/modules/chunks/{chunk-5YTMN435.mjs → chunk-DC5JP46Y.mjs} +13 -3
- package/dist/modules/chunks/chunk-DC5JP46Y.mjs.map +7 -0
- package/dist/modules/chunks/{chunk-YNHEYXDG.mjs → chunk-DOU4MNMQ.mjs} +3 -3
- package/dist/modules/chunks/{chunk-ZIDEETK4.mjs → chunk-E4G4HDOC.mjs} +3 -3
- package/dist/modules/chunks/{chunk-ZHO2G4JR.mjs → chunk-EZAJ66NW.mjs} +3 -3
- package/dist/modules/chunks/{chunk-APD2EWSZ.mjs → chunk-FIWL6TQS.mjs} +2 -2
- package/dist/modules/chunks/{chunk-U5J7OTEB.mjs → chunk-FSSARTVM.mjs} +3 -3
- package/dist/modules/chunks/{chunk-47RJSHLM.mjs → chunk-FXXPWAXM.mjs} +3 -3
- package/dist/modules/chunks/{chunk-D2RCKG7Q.mjs → chunk-G2QCXN56.mjs} +6 -6
- package/dist/modules/chunks/{chunk-4T3D67CS.mjs → chunk-GRDCA6LD.mjs} +8 -8
- package/dist/modules/chunks/{chunk-4T3D67CS.mjs.map → chunk-GRDCA6LD.mjs.map} +1 -1
- package/dist/modules/chunks/{chunk-WVU3CQ62.mjs → chunk-GUVUL6D2.mjs} +3 -3
- package/dist/modules/chunks/{chunk-YLCJNKIW.mjs → chunk-I32EONBF.mjs} +70 -30
- package/dist/modules/chunks/chunk-I32EONBF.mjs.map +7 -0
- package/dist/modules/chunks/{chunk-E3PJGTLI.mjs → chunk-IGIELQZ2.mjs} +5 -5
- package/dist/modules/chunks/{chunk-5PHAXNFO.mjs → chunk-IMDR26Y3.mjs} +3 -3
- package/dist/modules/chunks/{chunk-55F55BQY.mjs → chunk-JVOHFCI4.mjs} +3 -3
- package/dist/modules/chunks/{chunk-6I7RY73G.mjs → chunk-KCM7ZCQ3.mjs} +5 -5
- package/dist/modules/chunks/chunk-KCM7ZCQ3.mjs.map +7 -0
- package/dist/modules/chunks/{chunk-K2QZRFLE.mjs → chunk-KJTMDFFX.mjs} +4 -4
- package/dist/modules/chunks/{chunk-KX2WU5Z6.mjs → chunk-KPLESRQY.mjs} +3 -3
- package/dist/modules/chunks/{chunk-PW5CE2Y6.mjs → chunk-KUOWDTI6.mjs} +2 -2
- package/dist/modules/chunks/chunk-L6IHUN7X.mjs +13 -0
- package/dist/modules/chunks/chunk-L6IHUN7X.mjs.map +7 -0
- package/dist/modules/chunks/{chunk-INTTYJVW.mjs → chunk-LBQ6DFMP.mjs} +2 -2
- package/dist/modules/chunks/{chunk-OKQ5RBKO.mjs → chunk-LVWHM3UN.mjs} +2 -2
- package/dist/modules/chunks/{chunk-D57DDEV2.mjs → chunk-MDQMARAN.mjs} +6 -6
- package/dist/modules/chunks/{chunk-D57DDEV2.mjs.map → chunk-MDQMARAN.mjs.map} +2 -2
- package/dist/modules/chunks/{chunk-STQPRNEO.mjs → chunk-MLXRIWJA.mjs} +2 -2
- package/dist/modules/chunks/{chunk-D25SR5FS.mjs → chunk-N2SH3JGI.mjs} +3 -3
- package/dist/modules/chunks/{chunk-KI4WGTWL.mjs → chunk-N7NXZ6R3.mjs} +4 -4
- package/dist/modules/chunks/{chunk-KI4WGTWL.mjs.map → chunk-N7NXZ6R3.mjs.map} +2 -2
- package/dist/modules/chunks/{chunk-7IGFAI5H.mjs → chunk-O5QX6H3U.mjs} +5 -5
- package/dist/modules/chunks/{chunk-5W7SC5D4.mjs → chunk-P2Y73QJJ.mjs} +11 -1
- package/dist/modules/chunks/{chunk-5W7SC5D4.mjs.map → chunk-P2Y73QJJ.mjs.map} +2 -2
- package/dist/modules/chunks/{chunk-FNRGLCZW.mjs → chunk-PCQNUFDL.mjs} +39 -13
- package/dist/modules/chunks/chunk-PCQNUFDL.mjs.map +7 -0
- package/dist/modules/chunks/{chunk-46UEGAXY.mjs → chunk-Q7M7VUOZ.mjs} +6 -6
- package/dist/modules/chunks/{chunk-XE6ITXHT.mjs → chunk-QB33CMEU.mjs} +2 -2
- package/dist/modules/chunks/{chunk-E3Z7GLFU.mjs → chunk-QJHQN6OD.mjs} +15 -4
- package/dist/modules/chunks/chunk-QJHQN6OD.mjs.map +7 -0
- package/dist/modules/chunks/{chunk-KAGFU64Y.mjs → chunk-QW2VT3XB.mjs} +2 -2
- package/dist/modules/chunks/{chunk-U5R6MVM4.mjs → chunk-RFTLGEB5.mjs} +2 -2
- package/dist/modules/chunks/{chunk-VKNIYV2W.mjs → chunk-RYYKMDNI.mjs} +202 -35
- package/dist/modules/chunks/chunk-RYYKMDNI.mjs.map +7 -0
- package/dist/modules/chunks/{chunk-P5XMFZY4.mjs → chunk-SFB5BDTB.mjs} +2 -2
- package/dist/modules/chunks/{chunk-4D3Q7K44.mjs → chunk-SNICHQJP.mjs} +2 -2
- package/dist/modules/chunks/{chunk-CX5WREJC.mjs → chunk-SPGFO2TA.mjs} +2 -2
- package/dist/modules/chunks/{chunk-H256DQT6.mjs → chunk-TMPTVIAP.mjs} +2 -2
- package/dist/modules/chunks/{chunk-OQXDADAS.mjs → chunk-UWJYROKS.mjs} +6 -6
- package/dist/modules/chunks/chunk-UWJYROKS.mjs.map +7 -0
- package/dist/modules/chunks/{chunk-TTRUYO7Q.mjs → chunk-UZH2664E.mjs} +3 -3
- package/dist/modules/chunks/{chunk-TTRUYO7Q.mjs.map → chunk-UZH2664E.mjs.map} +2 -2
- package/dist/modules/chunks/{chunk-CKYXAT7H.mjs → chunk-VC4OEPDH.mjs} +2 -2
- package/dist/modules/chunks/{chunk-RJVOH7G2.mjs → chunk-VKWEA6NG.mjs} +27 -27
- package/dist/modules/chunks/{chunk-LZ57Y73Z.mjs → chunk-VSJOW7J4.mjs} +9 -7
- package/dist/modules/chunks/chunk-VSJOW7J4.mjs.map +7 -0
- package/dist/modules/chunks/{chunk-PVP5YBNR.mjs → chunk-WFM434WJ.mjs} +2 -2
- package/dist/modules/chunks/{chunk-TXLD7JI5.mjs → chunk-WJNASQF2.mjs} +2 -2
- package/dist/modules/chunks/{chunk-357UOBAS.mjs → chunk-XUNDH3E7.mjs} +2 -2
- package/dist/modules/chunks/{chunk-PJFFCRRD.mjs → chunk-YDARD4EP.mjs} +2 -2
- package/dist/modules/chunks/{chunk-27XASYEH.mjs → chunk-YU3HRQX7.mjs} +17 -11
- package/dist/modules/chunks/chunk-YU3HRQX7.mjs.map +7 -0
- package/dist/modules/chunks/{chunk-EZSGDSCC.mjs → chunk-ZRE7BDDB.mjs} +30 -5
- package/dist/modules/chunks/chunk-ZRE7BDDB.mjs.map +7 -0
- package/dist/modules/cli-contributions.mjs +14 -14
- package/dist/modules/cli.mjs +5 -5
- package/dist/modules/command-executor.mjs +3 -3
- package/dist/modules/embedded.mjs +82 -42
- package/dist/modules/embedded.mjs.map +2 -2
- package/dist/modules/extension-bridge.mjs +4 -4
- package/dist/modules/frontend-root.mjs +46 -46
- package/dist/modules/index.mjs +71 -65
- package/dist/modules/index.mjs.map +1 -1
- package/dist/modules/pages/scene.mjs +5 -5
- package/dist/modules/plugin.mjs +35 -35
- package/dist/modules/plugins/asset/frontend.mjs +10 -10
- package/dist/modules/plugins/asset/identity.mjs +9 -9
- package/dist/modules/plugins/asset/ui.mjs +3 -3
- package/dist/modules/plugins/content-browser/frontend.mjs +3 -3
- package/dist/modules/plugins/content-browser/identity.mjs +2 -2
- package/dist/modules/plugins/content-browser/ui.mjs +3 -3
- package/dist/modules/plugins/display/api.mjs +1 -1
- package/dist/modules/plugins/display/backend.mjs +4 -4
- package/dist/modules/plugins/display/frontend.mjs +5 -5
- package/dist/modules/plugins/display/identity.mjs +2 -2
- package/dist/modules/plugins/display/ui.mjs +3 -3
- package/dist/modules/plugins/inspector/frontend.mjs +3 -3
- package/dist/modules/plugins/inspector/identity.mjs +2 -2
- package/dist/modules/plugins/inspector/ui.mjs +3 -3
- package/dist/modules/plugins/material/frontend.mjs +10 -10
- package/dist/modules/plugins/material/identity.mjs +9 -9
- package/dist/modules/plugins/material/ui.mjs +10 -10
- package/dist/modules/plugins/mesh/frontend.mjs +10 -10
- package/dist/modules/plugins/mesh/identity.mjs +9 -9
- package/dist/modules/plugins/mesh/ui.mjs +10 -10
- package/dist/modules/plugins/plugins/api.mjs +4 -4
- package/dist/modules/plugins/plugins/backend.mjs +7 -7
- package/dist/modules/plugins/plugins/cli.mjs +5 -5
- package/dist/modules/plugins/plugins/frontend.mjs +3 -3
- package/dist/modules/plugins/plugins/identity.mjs +2 -2
- package/dist/modules/plugins/plugins/runtime.mjs +6 -6
- package/dist/modules/plugins/plugins/ui/panel.mjs +3 -3
- package/dist/modules/plugins/plugins/ui.mjs +4 -4
- package/dist/modules/plugins/scene/frontend.mjs +5 -5
- package/dist/modules/plugins/scene/identity.mjs +2 -2
- package/dist/modules/plugins/scene-tree/frontend.mjs +3 -3
- package/dist/modules/plugins/scene-tree/identity.mjs +2 -2
- package/dist/modules/plugins/scene-tree/ui.mjs +3 -3
- package/dist/modules/plugins/texture/frontend.mjs +10 -10
- package/dist/modules/plugins/texture/identity.mjs +9 -9
- package/dist/modules/plugins/texture/ui.mjs +10 -10
- package/dist/modules/plugins/viewport/frontend.mjs +12 -12
- package/dist/modules/plugins/viewport/identity.mjs +2 -2
- package/dist/modules/plugins/viewport/presentation.mjs +4 -4
- package/dist/modules/plugins/viewport/schema.mjs +2 -2
- package/dist/modules/plugins/viewport/workspace-shell.mjs +9 -9
- package/dist/modules/product.mjs +35 -35
- package/dist/modules/shell/frontend.mjs +1 -1
- package/dist/modules/viewer/catalog/backend.mjs +31 -31
- package/dist/modules/viewer/catalog/frontend.mjs +42 -42
- package/dist/modules/viewer/catalog/shared.mjs +20 -20
- package/dist/modules/viewer/catalog.mjs +51 -51
- package/dist/modules/viewer/cli.mjs +10 -10
- package/dist/modules/viewer-host/frontend.mjs +48 -48
- package/dist/modules/viewer-host/page-registry.mjs +6 -6
- package/dist/modules/viewer-host.mjs +7 -7
- package/dist/modules/viewer.mjs +51 -51
- package/dist/modules/workspace/api.mjs +1 -1
- package/dist/modules/workspace/backend.mjs +10 -10
- package/dist/modules/workspace/broker.mjs +9 -9
- package/dist/modules/workspace/cli.mjs +2 -2
- package/dist/modules/workspace/client.mjs +3 -3
- package/dist/modules/workspace/command-error.mjs +2 -2
- package/dist/modules/workspace/contract.mjs +7 -1
- package/dist/modules/workspace/engine-adapter.mjs +3 -3
- package/dist/modules/workspace/extension-bridge.mjs +4 -4
- package/dist/modules/workspace/frontend-plugin.mjs +8 -8
- package/dist/modules/workspace/frontend.mjs +9 -9
- package/dist/modules/workspace/page-title.mjs +3 -3
- package/dist/modules/workspace/presentation.mjs +4 -4
- package/dist/modules/workspace/preview-surface.mjs +7 -7
- package/dist/modules/workspace/project-session.mjs +2 -2
- package/dist/modules/workspace/render-resize-sync.mjs +2 -2
- package/dist/modules/workspace/resident.mjs +4 -4
- package/dist/modules/workspace/resource-open.mjs +5 -5
- package/dist/modules/workspace/resource-page.mjs +8 -8
- package/dist/modules/workspace/tool-runtime.mjs +7 -5
- package/dist/modules/workspace/view-trace.mjs +3 -3
- package/dist/modules/workspace/workspace-recovery.mjs +4 -4
- package/dist/modules/workspace/workspace-state.mjs +2 -2
- package/dist/modules/workspace-frontend.mjs +8 -8
- package/dist/viewer/assets/{embedded-DXSSFAyM.js → embedded-BKEAtUD6.js} +2 -2
- package/dist/viewer/assets/{embedded-DXSSFAyM.js.map → embedded-BKEAtUD6.js.map} +1 -1
- package/dist/viewer/assets/main-BQrn6wsa.js +22 -0
- package/dist/viewer/assets/main-BQrn6wsa.js.map +1 -0
- package/dist/viewer/assets/{panels-lazy-DqCwhGd9.js → panels-lazy-C_Cs-76A.js} +2 -2
- package/dist/viewer/assets/{panels-lazy-DqCwhGd9.js.map → panels-lazy-C_Cs-76A.js.map} +1 -1
- package/dist/viewer/assets/panels-ui-DEDHJLuE.js +12 -0
- package/dist/viewer/assets/panels-ui-DEDHJLuE.js.map +1 -0
- package/dist/viewer/assets/style-CcYzhsIZ.css +2 -0
- package/dist/viewer/assets/{wgpu_wasm--oeqTwVY.js → wgpu_wasm-cNR5izZM.js} +126 -0
- package/dist/viewer/assets/{wgpu_wasm_bg-WoZ1YI1I.wasm → wgpu_wasm_bg-Dps0jNcQ.wasm} +0 -0
- package/dist/viewer/index.html +4 -4
- package/dist/viewer/panels.js +1 -1
- package/package.json +2 -2
- package/scripts/verify-runtime-content-engine.mjs +7 -4
- package/skills/forgeax-view-cli/SKILL.md +11 -0
- package/dist/modules/chunks/chunk-27XASYEH.mjs.map +0 -7
- package/dist/modules/chunks/chunk-5YTMN435.mjs.map +0 -7
- package/dist/modules/chunks/chunk-6I7RY73G.mjs.map +0 -7
- package/dist/modules/chunks/chunk-6KM24NH6.mjs.map +0 -7
- package/dist/modules/chunks/chunk-DWT3TA6M.mjs.map +0 -7
- package/dist/modules/chunks/chunk-E3Z7GLFU.mjs.map +0 -7
- package/dist/modules/chunks/chunk-EZSGDSCC.mjs.map +0 -7
- package/dist/modules/chunks/chunk-FNRGLCZW.mjs.map +0 -7
- package/dist/modules/chunks/chunk-HWZCLROY.mjs.map +0 -7
- package/dist/modules/chunks/chunk-IJPWKKIU.mjs.map +0 -7
- package/dist/modules/chunks/chunk-LZ57Y73Z.mjs.map +0 -7
- package/dist/modules/chunks/chunk-OQXDADAS.mjs.map +0 -7
- package/dist/modules/chunks/chunk-QELNKFSI.mjs +0 -10
- package/dist/modules/chunks/chunk-QELNKFSI.mjs.map +0 -7
- package/dist/modules/chunks/chunk-VKNIYV2W.mjs.map +0 -7
- package/dist/modules/chunks/chunk-YLCJNKIW.mjs.map +0 -7
- package/dist/viewer/assets/main-CI6ZQziX.js +0 -22
- package/dist/viewer/assets/main-CI6ZQziX.js.map +0 -1
- package/dist/viewer/assets/panels-ui-CfUtl68h.js +0 -12
- package/dist/viewer/assets/panels-ui-CfUtl68h.js.map +0 -1
- package/dist/viewer/assets/style-gOtSMZif.css +0 -2
- /package/dist/modules/chunks/{chunk-EWSCJF77.mjs.map → chunk-2CMCY54A.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-YFQGSDK3.mjs.map → chunk-45WL24XN.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-FMCHH5R4.mjs.map → chunk-4FYKRL46.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-VW2ZF3P4.mjs.map → chunk-4MJHVZMB.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-XQYF2P6M.mjs.map → chunk-5HVXQEO3.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-XMP4THLF.mjs.map → chunk-66LM6NO6.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-ZGOGO7SS.mjs.map → chunk-6J27SWMY.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-JK7K7RG3.mjs.map → chunk-6VK7HB4X.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-HRKW766Y.mjs.map → chunk-6WZZ7TIC.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-U64FRQKP.mjs.map → chunk-7MWZK7HS.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-F5RLQAPN.mjs.map → chunk-A7OGXJAV.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-QUFVUMSY.mjs.map → chunk-AUINYWZP.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-PZIAKZJC.mjs.map → chunk-B24VYGHV.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-X4NNZ5X6.mjs.map → chunk-C2AMOM7H.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-IZAHIOFU.mjs.map → chunk-C3WVSJZF.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-2Z5KEV6L.mjs.map → chunk-CAXCOZ7Y.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-B6QUJ33G.mjs.map → chunk-CXFQME65.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-U6UMATPV.mjs.map → chunk-CYU3WWN6.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-AGVLPYVE.mjs.map → chunk-D2LZIQE2.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-YNHEYXDG.mjs.map → chunk-DOU4MNMQ.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-ZIDEETK4.mjs.map → chunk-E4G4HDOC.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-ZHO2G4JR.mjs.map → chunk-EZAJ66NW.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-APD2EWSZ.mjs.map → chunk-FIWL6TQS.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-U5J7OTEB.mjs.map → chunk-FSSARTVM.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-47RJSHLM.mjs.map → chunk-FXXPWAXM.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-D2RCKG7Q.mjs.map → chunk-G2QCXN56.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-WVU3CQ62.mjs.map → chunk-GUVUL6D2.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-E3PJGTLI.mjs.map → chunk-IGIELQZ2.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-5PHAXNFO.mjs.map → chunk-IMDR26Y3.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-55F55BQY.mjs.map → chunk-JVOHFCI4.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-K2QZRFLE.mjs.map → chunk-KJTMDFFX.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-KX2WU5Z6.mjs.map → chunk-KPLESRQY.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-PW5CE2Y6.mjs.map → chunk-KUOWDTI6.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-INTTYJVW.mjs.map → chunk-LBQ6DFMP.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-OKQ5RBKO.mjs.map → chunk-LVWHM3UN.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-STQPRNEO.mjs.map → chunk-MLXRIWJA.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-D25SR5FS.mjs.map → chunk-N2SH3JGI.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-7IGFAI5H.mjs.map → chunk-O5QX6H3U.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-46UEGAXY.mjs.map → chunk-Q7M7VUOZ.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-XE6ITXHT.mjs.map → chunk-QB33CMEU.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-KAGFU64Y.mjs.map → chunk-QW2VT3XB.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-U5R6MVM4.mjs.map → chunk-RFTLGEB5.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-P5XMFZY4.mjs.map → chunk-SFB5BDTB.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-4D3Q7K44.mjs.map → chunk-SNICHQJP.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-CX5WREJC.mjs.map → chunk-SPGFO2TA.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-H256DQT6.mjs.map → chunk-TMPTVIAP.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-CKYXAT7H.mjs.map → chunk-VC4OEPDH.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-RJVOH7G2.mjs.map → chunk-VKWEA6NG.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-PVP5YBNR.mjs.map → chunk-WFM434WJ.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-TXLD7JI5.mjs.map → chunk-WJNASQF2.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-357UOBAS.mjs.map → chunk-XUNDH3E7.mjs.map} +0 -0
- /package/dist/modules/chunks/{chunk-PJFFCRRD.mjs.map → chunk-YDARD4EP.mjs.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
VIEW_PAGE_TYPES
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QJHQN6OD.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__export
|
|
6
6
|
} from "./chunk-FLGC65SR.mjs";
|
|
@@ -22,4 +22,4 @@ export {
|
|
|
22
22
|
PAGE_TYPE,
|
|
23
23
|
identity_exports
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-SFB5BDTB.mjs.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
PANEL_LAYOUT,
|
|
6
6
|
SLOT,
|
|
7
7
|
TITLE_I18N_KEY
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2CMCY54A.mjs";
|
|
9
9
|
|
|
10
10
|
// packages/view-plugin-plugins/src/frontend.ts
|
|
11
11
|
var VIEW_PLUGINS_FRONTEND_PLUGIN_ID = FRONTEND_PLUGIN_ID;
|
|
@@ -62,4 +62,4 @@ export {
|
|
|
62
62
|
viewPluginsListFrontendPlugin,
|
|
63
63
|
frontend_default
|
|
64
64
|
};
|
|
65
|
-
//# sourceMappingURL=chunk-
|
|
65
|
+
//# sourceMappingURL=chunk-SNICHQJP.mjs.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
PANEL_LAYOUT,
|
|
6
6
|
SLOT,
|
|
7
7
|
TITLE_I18N_KEY
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-AUINYWZP.mjs";
|
|
9
9
|
|
|
10
10
|
// packages/view-plugin-inspector/src/frontend.ts
|
|
11
11
|
var VIEW_OBJECT_INSPECTOR_FRONTEND_PLUGIN_ID = FRONTEND_PLUGIN_ID;
|
|
@@ -39,4 +39,4 @@ export {
|
|
|
39
39
|
viewObjectInspectorFrontendPlugin,
|
|
40
40
|
frontend_default
|
|
41
41
|
};
|
|
42
|
-
//# sourceMappingURL=chunk-
|
|
42
|
+
//# sourceMappingURL=chunk-SPGFO2TA.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
VIEW_PAGE_TYPES
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QJHQN6OD.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__export
|
|
6
6
|
} from "./chunk-FLGC65SR.mjs";
|
|
@@ -47,4 +47,4 @@ export {
|
|
|
47
47
|
VIEWPORT_TARGET_ROLE,
|
|
48
48
|
identity_exports
|
|
49
49
|
};
|
|
50
|
-
//# sourceMappingURL=chunk-
|
|
50
|
+
//# sourceMappingURL=chunk-TMPTVIAP.mjs.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createViewWorkspaceClient,
|
|
3
3
|
workspaceBrowserEndpoint
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PCQNUFDL.mjs";
|
|
5
5
|
import {
|
|
6
6
|
createProjectSession
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DC5JP46Y.mjs";
|
|
8
8
|
import {
|
|
9
9
|
logResourceOpen,
|
|
10
10
|
observeWorkspaceOpenRequests
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-E4G4HDOC.mjs";
|
|
12
12
|
import {
|
|
13
13
|
initViewTraceFromEnvironment,
|
|
14
14
|
wrapViewWorkspaceClient
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QW2VT3XB.mjs";
|
|
16
16
|
|
|
17
17
|
// packages/view-workspace-core/src/frontend-plugin.ts
|
|
18
18
|
import { createHostWebSocketClient } from "@forgeax/engine/host/transport";
|
|
@@ -31,7 +31,7 @@ var viewWorkspaceCoreFrontendPlugin = {
|
|
|
31
31
|
const window = config.window ?? globalThis;
|
|
32
32
|
const configuredTransport = ctx.get?.("hostTransport", false);
|
|
33
33
|
let transport = configuredTransport && "request" in configuredTransport ? configuredTransport : void 0;
|
|
34
|
-
if (workspace?.endpoint) {
|
|
34
|
+
if (workspace?.endpoint && !transport) {
|
|
35
35
|
const url = workspaceBrowserEndpoint(workspace.endpoint, workspace.token, window.location?.href, "frontend", workspace.frontendTicket);
|
|
36
36
|
let socket;
|
|
37
37
|
let ownedTransport;
|
|
@@ -101,4 +101,4 @@ export {
|
|
|
101
101
|
viewWorkspaceCoreFrontendPlugin,
|
|
102
102
|
frontend_plugin_default
|
|
103
103
|
};
|
|
104
|
-
//# sourceMappingURL=chunk-
|
|
104
|
+
//# sourceMappingURL=chunk-UWJYROKS.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../packages/view-workspace-core/src/frontend-plugin.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Plugin } from '@forgeax/engine-plugin';\nimport type { HostTransportClient } from '@forgeax/engine-host/transport';\nimport type { FrontendConfig } from './frontend-contract.ts';\nimport type { ViewWorkspaceClient } from './client.ts';\nexport type CoreFrontendConfig = FrontendConfig & { window?: Window & typeof globalThis; workspace?: { endpoint?: string; token: string; clientId: string; frontendTicket?: string } };\ndeclare module '@forgeax/engine-plugin' { interface EngineContextServices { viewOperationClient?: ViewWorkspaceClient; } }\nimport { createHostWebSocketClient } from '@forgeax/engine-host/transport';\nimport { createViewWorkspaceClient, workspaceBrowserEndpoint } from './client.ts';\nimport { createProjectSession } from './project-session.ts';\nimport { logResourceOpen, observeWorkspaceOpenRequests } from './resource-open.ts';\nimport { initViewTraceFromEnvironment, wrapViewWorkspaceClient } from './view-trace.ts';\n\nexport const viewWorkspaceCoreFrontendPlugin: Plugin.Object<CoreFrontendConfig> = {\n name: 'forgeax.view.service.workspace-client.frontend',\n provide: ['viewOperationClient'],\n async apply(ctx, config = {}) {\n ctx.effect(initViewTraceFromEnvironment);\n const lifetime = new AbortController();\n // Cordis emits removal before waiting for an asynchronous apply to settle.\n // Cancel pending I/O then, so ordinary effect cleanup can finish.\n ctx.on('internal/plugin', fiber => {\n if (fiber === ctx.fiber && fiber.uid === null) lifetime.abort();\n });\n ctx.effect(() => () => lifetime.abort());\n const pageHost = config.pageHost ?? ctx.get?.('pageHost', false);\n const workspace = config.workspace;\n const window = config.window ?? globalThis;\n const configuredTransport = ctx.get?.('hostTransport', false);\n let transport: HostTransportClient | undefined = configuredTransport && 'request' in configuredTransport ? configuredTransport : undefined;\n // The frontend Host already owns the page's trusted socket. Reuse it so\n // workspace commands and page status subscriptions have one caller identity.\n if (workspace?.endpoint && !transport) {\n const url = workspaceBrowserEndpoint(workspace.endpoint, workspace.token, window.location?.href, 'frontend', workspace.frontendTicket);\n let socket!: WebSocket;\n let ownedTransport: HostTransportClient | undefined;\n let disposed = false;\n ctx.effect(() => {\n socket = new window.WebSocket(url);\n const close = () => {\n disposed = true;\n if (ownedTransport) ownedTransport.close('View workspace client disposed');\n else socket.close(1000, 'View workspace client disposed');\n };\n lifetime.signal.addEventListener('abort', close, { once: true });\n return () => { lifetime.signal.removeEventListener('abort', close); close(); };\n });\n try { ownedTransport = await createHostWebSocketClient(socket); }\n catch (error) { if (lifetime.signal.aborted) return; throw error; }\n if (disposed) { ownedTransport.close('View workspace client disposed'); return; }\n transport = ownedTransport;\n }\n const rawClient =\n transport && workspace?.clientId && workspace?.token\n ? createViewWorkspaceClient({\n transport,\n clientId: workspace.clientId,\n token: workspace.token,\n })\n : undefined;\n const client = wrapViewWorkspaceClient(rawClient);\n if (lifetime.signal.aborted) return;\n if (rawClient && (config.window ?? globalThis).location) {\n const session = createProjectSession(rawClient, { window: config.window ?? globalThis });\n rawClient.projectSession = session;\n const dispose = () => session.dispose();\n lifetime.signal.addEventListener('abort', dispose, { once: true });\n ctx.effect(() => () => { lifetime.signal.removeEventListener('abort', dispose); dispose(); });\n // A headed document must finish exact-target recovery before its\n // plugins can construct an App. The View entry has no Engine workspace\n // surface, so let its Shell activate while a cold project opens.\n if (new URL(window.location.href).searchParams.has('forgeaxWorkspaceTarget'))\n await session.ready;\n }\n if (lifetime.signal.aborted) return;\n ctx.provide('viewOperationClient', client);\n if (pageHost?.openResource && client) {\n logResourceOpen('open-request-observer-wired', {});\n const stop = observeWorkspaceOpenRequests(client, (request) => pageHost.openResource(request));\n ctx.effect(() => stop);\n } else {\n logResourceOpen('open-request-observer-skipped', {\n hasPageHost: Boolean(pageHost),\n hasOpenResource: Boolean(pageHost?.openResource),\n hasClient: Boolean(client),\n }, { level: 'warn' });\n }\n },\n};\n\nexport default viewWorkspaceCoreFrontendPlugin;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAMA,SAAS,iCAAiC;AAMnC,IAAM,kCAAqE;AAAA,EAChF,MAAM;AAAA,EACN,SAAS,CAAC,qBAAqB;AAAA,EAC/B,MAAM,MAAM,KAAK,SAAS,CAAC,GAAG;AAC5B,QAAI,OAAO,4BAA4B;AACvC,UAAM,WAAW,IAAI,gBAAgB;AAGrC,QAAI,GAAG,mBAAmB,WAAS;AACjC,UAAI,UAAU,IAAI,SAAS,MAAM,QAAQ,KAAM,UAAS,MAAM;AAAA,IAChE,CAAC;AACD,QAAI,OAAO,MAAM,MAAM,SAAS,MAAM,CAAC;AACvC,UAAM,WAAW,OAAO,YAAY,IAAI,MAAM,YAAY,KAAK;AAC/D,UAAM,YAAY,OAAO;AACzB,UAAM,SAAS,OAAO,UAAU;AAChC,UAAM,sBAAsB,IAAI,MAAM,iBAAiB,KAAK;AAC5D,QAAI,YAA6C,uBAAuB,aAAa,sBAAsB,sBAAsB;AAGjI,QAAI,WAAW,YAAY,CAAC,WAAW;AACrC,YAAM,MAAM,yBAAyB,UAAU,UAAU,UAAU,OAAO,OAAO,UAAU,MAAM,YAAY,UAAU,cAAc;AACrI,UAAI;AACJ,UAAI;AACJ,UAAI,WAAW;AACf,UAAI,OAAO,MAAM;AACf,iBAAS,IAAI,OAAO,UAAU,GAAG;AACjC,cAAM,QAAQ,MAAM;AAClB,qBAAW;AACX,cAAI,eAAgB,gBAAe,MAAM,gCAAgC;AAAA,cACpE,QAAO,MAAM,KAAM,gCAAgC;AAAA,QAC1D;AACA,iBAAS,OAAO,iBAAiB,SAAS,OAAO,EAAE,MAAM,KAAK,CAAC;AAC/D,eAAO,MAAM;AAAE,mBAAS,OAAO,oBAAoB,SAAS,KA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AAQ,UAAU,YAAY;AAAA,QAC/C,WAAW,QAAQ,MAAM;AAAA,MAC3B,GAAG,EAAE,OAAO,OAAO,CAAC;AAAA,IACtB;AAAA,EACF;AACF;AAEA,IAAO,0BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
PANEL_LAYOUT,
|
|
6
6
|
SLOT,
|
|
7
7
|
TITLE_I18N_KEY
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-6WZZ7TIC.mjs";
|
|
9
9
|
|
|
10
10
|
// packages/view-plugin-content-browser/src/frontend.ts
|
|
11
11
|
var VIEW_CONTENT_BROWSER_FRONTEND_PLUGIN_ID = FRONTEND_PLUGIN_ID;
|
|
@@ -42,7 +42,7 @@ var viewContentBrowserFrontendPlugin = {
|
|
|
42
42
|
disposePanel = await panelHost.mountPanelInto({
|
|
43
43
|
element: reactMount,
|
|
44
44
|
panel: "ContentBrowser",
|
|
45
|
-
props: { client: workspaceClient }
|
|
45
|
+
props: { client: workspaceClient, revealPanel: () => panelHost.reveal?.(SLOT) ?? Promise.resolve(false) }
|
|
46
46
|
});
|
|
47
47
|
} catch (error) {
|
|
48
48
|
await disposePanel?.();
|
|
@@ -65,4 +65,4 @@ export {
|
|
|
65
65
|
viewContentBrowserFrontendPlugin,
|
|
66
66
|
frontend_default
|
|
67
67
|
};
|
|
68
|
-
//# sourceMappingURL=chunk-
|
|
68
|
+
//# sourceMappingURL=chunk-UZH2664E.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../packages/view-plugin-content-browser/src/frontend.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Context } from '@forgeax/engine-plugin';\nimport type { FrontendConfig } from '@forgeax/view-workspace-core/frontend-contract';\nimport { FRONTEND_PLUGIN_ID, FRONTEND_MODULE, PAGE_TYPE, PANEL_LAYOUT, SLOT, TITLE_I18N_KEY } from './identity.ts';\n\nexport const VIEW_CONTENT_BROWSER_FRONTEND_PLUGIN_ID = FRONTEND_PLUGIN_ID;\nexport const VIEW_CONTENT_BROWSER_FRONTEND_MODULE = FRONTEND_MODULE;\n\nconst viewContentBrowserFrontendPlugin = {\n name: VIEW_CONTENT_BROWSER_FRONTEND_PLUGIN_ID,\n inject: ['viewOperationClient', 'viewScenePage'],\n async apply(ctx: Context, config: FrontendConfig = {}) {\n const document = config.document ?? globalThis.document;\n const workspaceClient = ctx.get('viewOperationClient');\n const panelHost = config.panelHost ?? ctx.get('panelHost');\n if (!document?.createElement) return;\n if (!panelHost || typeof panelHost.claim !== 'function') {\n throw new TypeError('View content-browser Frontend Plugin requires panelHost');\n }\n const wrapper = document.createElement('div');\n wrapper.className = 'fx-view-content-browser-host';\n wrapper.dataset.forgeaxView = 'content-browser-root';\n const reactMount = document.createElement('div');\n reactMount.className = 'fx-view-content-browser-ui';\n wrapper.append(reactMount);\n const unclaim = panelHost.claim({\n id: SLOT,\n pageType: PAGE_TYPE,\n titleKey: TITLE_I18N_KEY,\n activity: { labelKey: TITLE_I18N_KEY, icon: 'boxes' },\n layout: PANEL_LAYOUT,\n });\n let unmountSlot;\n let disposePanel;\n try {\n await panelHost.waitForSlot(SLOT);\n unmountSlot = panelHost.mount(SLOT, wrapper);\n disposePanel = await panelHost.mountPanelInto({\n element: reactMount,\n panel: 'ContentBrowser',\n props: { client: workspaceClient },\n });\n } catch (error) {\n await disposePanel?.();\n unmountSlot?.();\n unclaim();\n throw error;\n }\n ctx.effect(() => async () => {\n await disposePanel?.();\n unmountSlot?.();\n unclaim();\n });\n },\n};\n\nexport { viewContentBrowserFrontendPlugin };\nexport default viewContentBrowserFrontendPlugin;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIO,IAAM,0CAA0C;AAChD,IAAM,uCAAuC;AAEpD,IAAM,mCAAmC;AAAA,EACvC,MAAM;AAAA,EACN,QAAQ,CAAC,uBAAuB,eAAe;AAAA,EAC/C,MAAM,MAAM,KAAc,SAAyB,CAAC,GAAG;AACrD,UAAM,WAAW,OAAO,YAAY,WAAW;AAC/C,UAAM,kBAAkB,IAAI,IAAI,qBAAqB;AACrD,UAAM,YAAY,OAAO,aAAa,IAAI,IAAI,WAAW;AACzD,QAAI,CAAC,UAAU,cAAe;AAC9B,QAAI,CAAC,aAAa,OAAO,UAAU,UAAU,YAAY;AACvD,YAAM,IAAI,UAAU,yDAAyD;AAAA,IAC/E;AACA,UAAM,UAAU,SAAS,cAAc,KAAK;AAC5C,YAAQ,YAAY;AACpB,YAAQ,QAAQ,cAAc;AAC9B,UAAM,aAAa,SAAS,cAAc,KAAK;AAC/C,eAAW,YAAY;AACvB,YAAQ,OAAO,UAAU;AACzB,UAAM,UAAU,UAAU,MAAM;AAAA,MAC9B,IAAI;AAAA,MACJ,UAAU;AAAA,MACV,UAAU;AAAA,MACV,UAAU,EAAE,UAAU,gBAAgB,MAAM,QAAQ;AAAA,MACpD,QAAQ;AAAA,IACV,CAAC;AACD,QAAI;AACJ,QAAI;AACJ,QAAI;AACF,YAAM,UAAU,YAAY,IAAI;AAChC,oBAAc,UAAU,MAAM,MAAM,OAAO;AAC3C,qBAAe,MAAM,UAAU,eAAe;AAAA,QAC5C,SAAS;AAAA,QACT,OAAO;AAAA,QACP,OAAO,EAAE,QAAQ,
|
|
4
|
+
"sourcesContent": ["import type { Context } from '@forgeax/engine-plugin';\nimport type { FrontendConfig } from '@forgeax/view-workspace-core/frontend-contract';\nimport { FRONTEND_PLUGIN_ID, FRONTEND_MODULE, PAGE_TYPE, PANEL_LAYOUT, SLOT, TITLE_I18N_KEY } from './identity.ts';\n\nexport const VIEW_CONTENT_BROWSER_FRONTEND_PLUGIN_ID = FRONTEND_PLUGIN_ID;\nexport const VIEW_CONTENT_BROWSER_FRONTEND_MODULE = FRONTEND_MODULE;\n\nconst viewContentBrowserFrontendPlugin = {\n name: VIEW_CONTENT_BROWSER_FRONTEND_PLUGIN_ID,\n inject: ['viewOperationClient', 'viewScenePage'],\n async apply(ctx: Context, config: FrontendConfig = {}) {\n const document = config.document ?? globalThis.document;\n const workspaceClient = ctx.get('viewOperationClient');\n const panelHost = config.panelHost ?? ctx.get('panelHost');\n if (!document?.createElement) return;\n if (!panelHost || typeof panelHost.claim !== 'function') {\n throw new TypeError('View content-browser Frontend Plugin requires panelHost');\n }\n const wrapper = document.createElement('div');\n wrapper.className = 'fx-view-content-browser-host';\n wrapper.dataset.forgeaxView = 'content-browser-root';\n const reactMount = document.createElement('div');\n reactMount.className = 'fx-view-content-browser-ui';\n wrapper.append(reactMount);\n const unclaim = panelHost.claim({\n id: SLOT,\n pageType: PAGE_TYPE,\n titleKey: TITLE_I18N_KEY,\n activity: { labelKey: TITLE_I18N_KEY, icon: 'boxes' },\n layout: PANEL_LAYOUT,\n });\n let unmountSlot;\n let disposePanel;\n try {\n await panelHost.waitForSlot(SLOT);\n unmountSlot = panelHost.mount(SLOT, wrapper);\n disposePanel = await panelHost.mountPanelInto({\n element: reactMount,\n panel: 'ContentBrowser',\n props: { client: workspaceClient, revealPanel: () => panelHost.reveal?.(SLOT) ?? Promise.resolve(false) },\n });\n } catch (error) {\n await disposePanel?.();\n unmountSlot?.();\n unclaim();\n throw error;\n }\n ctx.effect(() => async () => {\n await disposePanel?.();\n unmountSlot?.();\n unclaim();\n });\n },\n};\n\nexport { viewContentBrowserFrontendPlugin };\nexport default viewContentBrowserFrontendPlugin;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAIO,IAAM,0CAA0C;AAChD,IAAM,uCAAuC;AAEpD,IAAM,mCAAmC;AAAA,EACvC,MAAM;AAAA,EACN,QAAQ,CAAC,uBAAuB,eAAe;AAAA,EAC/C,MAAM,MAAM,KAAc,SAAyB,CAAC,GAAG;AACrD,UAAM,WAAW,OAAO,YAAY,WAAW;AAC/C,UAAM,kBAAkB,IAAI,IAAI,qBAAqB;AACrD,UAAM,YAAY,OAAO,aAAa,IAAI,IAAI,WAAW;AACzD,QAAI,CAAC,UAAU,cAAe;AAC9B,QAAI,CAAC,aAAa,OAAO,UAAU,UAAU,YAAY;AACvD,YAAM,IAAI,UAAU,yDAAyD;AAAA,IAC/E;AACA,UAAM,UAAU,SAAS,cAAc,KAAK;AAC5C,YAAQ,YAAY;AACpB,YAAQ,QAAQ,cAAc;AAC9B,UAAM,aAAa,SAAS,cAAc,KAAK;AAC/C,eAAW,YAAY;AACvB,YAAQ,OAAO,UAAU;AACzB,UAAM,UAAU,UAAU,MAAM;AAAA,MAC9B,IAAI;AAAA,MACJ,UAAU;AAAA,MACV,UAAU;AAAA,MACV,UAAU,EAAE,UAAU,gBAAgB,MAAM,QAAQ;AAAA,MACpD,QAAQ;AAAA,IACV,CAAC;AACD,QAAI;AACJ,QAAI;AACJ,QAAI;AACF,YAAM,UAAU,YAAY,IAAI;AAChC,oBAAc,UAAU,MAAM,MAAM,OAAO;AAC3C,qBAAe,MAAM,UAAU,eAAe;AAAA,QAC5C,SAAS;AAAA,QACT,OAAO;AAAA,QACP,OAAO,EAAE,QAAQ,iBAAiB,aAAa,MAAM,UAAU,SAAS,IAAI,KAAK,QAAQ,QAAQ,KAAK,EAAE;AAAA,MAC1G,CAAC;AAAA,IACH,SAAS,OAAO;AACd,YAAM,eAAe;AACrB,oBAAc;AACd,cAAQ;AACR,YAAM;AAAA,IACR;AACA,QAAI,OAAO,MAAM,YAAY;AAC3B,YAAM,eAAe;AACrB,oBAAc;AACd,cAAQ;AAAA,IACV,CAAC;AAAA,EACH;AACF;AAGA,IAAO,mBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWorkspaceStateReader
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WJNASQF2.mjs";
|
|
4
4
|
|
|
5
5
|
// packages/view-workspace-core/src/page-title.ts
|
|
6
6
|
function editorPageTitleFromWorkspace(state) {
|
|
@@ -30,4 +30,4 @@ export {
|
|
|
30
30
|
editorPageTitleFromWorkspace,
|
|
31
31
|
createEditorPageTitleController
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=chunk-
|
|
33
|
+
//# sourceMappingURL=chunk-VC4OEPDH.mjs.map
|
|
@@ -1,86 +1,86 @@
|
|
|
1
1
|
import {
|
|
2
2
|
frontend_default as frontend_default11
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IGIELQZ2.mjs";
|
|
4
4
|
import {
|
|
5
5
|
frontend_default as frontend_default10
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DOU4MNMQ.mjs";
|
|
7
7
|
import {
|
|
8
8
|
frontend_default as frontend_default8
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7MWZK7HS.mjs";
|
|
10
10
|
import {
|
|
11
11
|
frontend_default as frontend_default9
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CYU3WWN6.mjs";
|
|
13
13
|
import {
|
|
14
14
|
frontend_default as frontend_default6
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-45WL24XN.mjs";
|
|
16
16
|
import {
|
|
17
17
|
frontend_default as frontend_default7
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-EZAJ66NW.mjs";
|
|
19
19
|
import {
|
|
20
20
|
frontend_default as frontend_default4
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-SPGFO2TA.mjs";
|
|
22
22
|
import {
|
|
23
23
|
frontend_default as frontend_default5
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-UZH2664E.mjs";
|
|
25
25
|
import {
|
|
26
26
|
frontend_default as frontend_default2
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-A7OGXJAV.mjs";
|
|
28
28
|
import {
|
|
29
29
|
frontend_default as frontend_default3
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-SNICHQJP.mjs";
|
|
31
31
|
import {
|
|
32
32
|
frontend_plugin_default
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-UWJYROKS.mjs";
|
|
34
34
|
import {
|
|
35
35
|
VIEW_PLUGIN_VERSION,
|
|
36
36
|
VIEW_PRODUCT_PLUGINS,
|
|
37
37
|
VIEW_WORKSPACE_CORE
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-CYOLEAAY.mjs";
|
|
39
39
|
import {
|
|
40
40
|
FRONTEND_MODULE as FRONTEND_MODULE9
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-N2SH3JGI.mjs";
|
|
42
42
|
import {
|
|
43
43
|
FRONTEND_MODULE
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-D2LZIQE2.mjs";
|
|
45
45
|
import {
|
|
46
46
|
FRONTEND_MODULE as FRONTEND_MODULE2
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-2CMCY54A.mjs";
|
|
48
48
|
import {
|
|
49
49
|
FRONTEND_MODULE as FRONTEND_MODULE7
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-C2AMOM7H.mjs";
|
|
51
51
|
import {
|
|
52
52
|
FRONTEND_MODULE as FRONTEND_MODULE8
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-4FYKRL46.mjs";
|
|
54
54
|
import {
|
|
55
55
|
FRONTEND_MODULE as FRONTEND_MODULE5
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-MLXRIWJA.mjs";
|
|
57
57
|
import {
|
|
58
58
|
FRONTEND_MODULE as FRONTEND_MODULE6
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-B24VYGHV.mjs";
|
|
60
60
|
import {
|
|
61
61
|
FRONTEND_MODULE as FRONTEND_MODULE3
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-AUINYWZP.mjs";
|
|
63
63
|
import {
|
|
64
64
|
FRONTEND_MODULE as FRONTEND_MODULE4
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-6WZZ7TIC.mjs";
|
|
66
66
|
import {
|
|
67
67
|
FRONTEND_MODULE as FRONTEND_MODULE10
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-TMPTVIAP.mjs";
|
|
69
69
|
import {
|
|
70
70
|
presentation_default
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-FIWL6TQS.mjs";
|
|
72
72
|
import {
|
|
73
73
|
PRESENTATION_MODULE
|
|
74
74
|
} from "./chunk-J5B4LX5H.mjs";
|
|
75
75
|
import {
|
|
76
76
|
frontend_default
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-GUVUL6D2.mjs";
|
|
78
78
|
import {
|
|
79
79
|
FRONTEND_MODULE as FRONTEND_MODULE11
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-SFB5BDTB.mjs";
|
|
81
81
|
import {
|
|
82
82
|
shell_default
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-6J27SWMY.mjs";
|
|
84
84
|
import {
|
|
85
85
|
SHELL_MODULE
|
|
86
86
|
} from "./chunk-QAXALJEY.mjs";
|
|
@@ -132,4 +132,4 @@ for (const [name, plugin] of [[SHELL_MODULE, shell_default], [PRESENTATION_MODUL
|
|
|
132
132
|
export {
|
|
133
133
|
VIEW_PRODUCT_FRONTEND_CATALOG
|
|
134
134
|
};
|
|
135
|
-
//# sourceMappingURL=chunk-
|
|
135
|
+
//# sourceMappingURL=chunk-VKWEA6NG.mjs.map
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
VIEW_PRODUCT_BACKEND_CATALOG
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5HVXQEO3.mjs";
|
|
4
4
|
import {
|
|
5
5
|
startViewHostServer
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FSSARTVM.mjs";
|
|
7
7
|
import {
|
|
8
8
|
VIEW_FRONTEND_MODULE,
|
|
9
9
|
createViewProductPlan,
|
|
10
10
|
viewFrontendRoot
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CYOLEAAY.mjs";
|
|
12
12
|
import {
|
|
13
13
|
workspaceDiagnosticRecord
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-RFTLGEB5.mjs";
|
|
15
15
|
|
|
16
16
|
// src/plugins/backend.ts
|
|
17
17
|
import { randomUUID } from "node:crypto";
|
|
18
18
|
import { startNativePlugin } from "@forgeax/engine/plugin";
|
|
19
19
|
import { createBackendHost } from "@forgeax/engine/host/backend";
|
|
20
20
|
import { createHostAssembly } from "@forgeax/engine/host/protocol";
|
|
21
|
+
import { listPackSources } from "@forgeax/engine/pack/build";
|
|
21
22
|
function createViewPlatformBinding(platform) {
|
|
22
23
|
if (!platform || typeof platform.createPage !== "function") {
|
|
23
24
|
throw new TypeError("View platform binding requires platform.createPage");
|
|
@@ -83,7 +84,8 @@ async function createViewBackend({ platform, capabilities, frontendConfig, disab
|
|
|
83
84
|
capabilities: capabilities ?? platform?.getCapabilities?.(),
|
|
84
85
|
workspaceEngine,
|
|
85
86
|
workspaceAccessToken: token,
|
|
86
|
-
workspaceAuthorize
|
|
87
|
+
workspaceAuthorize,
|
|
88
|
+
packSources: listPackSources
|
|
87
89
|
},
|
|
88
90
|
frontendConfig: config,
|
|
89
91
|
disabledPages
|
|
@@ -130,7 +132,7 @@ async function createViewBackend({ platform, capabilities, frontendConfig, disab
|
|
|
130
132
|
port: workspacePort,
|
|
131
133
|
onClientConnect: (caller) => {
|
|
132
134
|
if (engineHost) engineHost.bindProjection(caller, { assembly: frontendAssembly });
|
|
133
|
-
workspaceCore.
|
|
135
|
+
workspaceCore.attachPageSession(caller, backendHost.transport);
|
|
134
136
|
},
|
|
135
137
|
onClientDisconnect: (caller) => workspaceCore.revokeConnection(caller.connectionId),
|
|
136
138
|
...workspacePath === void 0 ? {} : { path: workspacePath },
|
|
@@ -171,4 +173,4 @@ export {
|
|
|
171
173
|
createViewHostBinding,
|
|
172
174
|
createViewBackend
|
|
173
175
|
};
|
|
174
|
-
//# sourceMappingURL=chunk-
|
|
176
|
+
//# sourceMappingURL=chunk-VSJOW7J4.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugins/backend.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Fiber, Plugin } from '@forgeax/engine-plugin';\nimport type { BackendHost, BackendHostOptions } from '@forgeax/engine-host/backend';\nimport type { HostAssembly } from '@forgeax/engine-host/protocol';\nimport type { DevKitWorkspacePluginOptions } from '@forgeax/engine/devkit';\nimport type { ViewBackendProductConfig } from '@forgeax/view-viewer/catalog/shared';\nimport type { ViewFrontendConfig } from '@forgeax/view-viewer/config';\nimport type { ViewPlatform } from '@forgeax/view-plugin-display/carrier-contract';\nimport { workspaceDiagnosticRecord } from '@forgeax/view-workspace-core/command-error';\nexport type ViewBackendOptions = ViewBackendProductConfig & {\n platform?: ViewPlatform & { start?: () => void | Promise<void> };\n frontendConfig?: ViewFrontendConfig; disabledPages?: readonly string[];\n engineHost?: BackendHost; workspacePlugin?: Plugin<DevKitWorkspacePluginOptions>;\n workspaceOptions?: Omit<DevKitWorkspacePluginOptions, 'hostBinding' | 'provider'>;\n onActivationReport?: BackendHostOptions['onActivationReport'];\n workspaceServer?: boolean; workspaceHost?: string; workspacePort?: number;\n workspacePath?: string; staticRoot?: string | URL;\n};\nimport { randomUUID } from 'node:crypto';\nimport { startNativePlugin } from '@forgeax/engine-plugin';\nimport { createBackendHost } from '@forgeax/engine-host/backend';\nimport { createHostAssembly } from '@forgeax/engine-host/protocol';\nimport { createViewProductPlan, viewFrontendRoot, VIEW_FRONTEND_MODULE } from '@forgeax/view-viewer/catalog/shared';\nimport { listPackSources } from '@forgeax/engine-pack/build';\nimport { VIEW_PRODUCT_BACKEND_CATALOG } from '@forgeax/view-viewer/catalog/backend';\nimport { startViewHostServer } from '@forgeax/view-workspace-core/resident';\n\nexport function createViewPlatformBinding(platform: ViewPlatform) {\n if (!platform || typeof platform.createPage !== 'function') {\n throw new TypeError('View platform binding requires platform.createPage');\n }\n let disposal: Promise<void> | undefined;\n return {\n createPage: platform.createPage.bind(platform),\n ...(typeof platform.getCapabilities === 'function'\n ? { getCapabilities: platform.getCapabilities.bind(platform) }\n : {}),\n ...(typeof platform.dispose === 'function' ? { dispose: () => disposal ??= Promise.resolve().then(() => platform.dispose?.()) } : {}),\n };\n}\n\nexport function createViewHostBinding({ backendHost, frontendAssembly }: { backendHost?: BackendHost; frontendAssembly?: HostAssembly } = {}) {\n if (!backendHost || !frontendAssembly) {\n throw new TypeError('View Host binding requires a backend Host and a frontend root assembly');\n }\n return Object.freeze({\n backend: backendHost,\n frontendAssembly,\n frontendModule: VIEW_FRONTEND_MODULE,\n });\n}\n\n/** The embedding helper owns View Fibers; a supplied BackendHost remains borrowed. */\nexport async function createViewBackend({ platform, capabilities, frontendConfig, disabledPages, workspaceEngine, workspaceAccessToken, workspaceAuthorize, engineHost, workspacePlugin, workspaceOptions, onActivationReport, workspaceServer = true, workspaceHost = '127.0.0.1', workspacePort = 0, workspacePath, staticRoot }: ViewBackendOptions = {}) {\n const platformBinding = platform ? createViewPlatformBinding(platform) : undefined;\n let platformStarted = false;\n let backendHost: BackendHost | undefined;\n let workspaceFiber: Fiber | undefined;\n let resident: Awaited<ReturnType<typeof startViewHostServer>> | undefined;\n const fibers: Fiber[] = [];\n let disposal: Promise<void> | undefined;\n const dispose = () => disposal ??= (async () => {\n const failures: unknown[] = [];\n for (const release of [\n () => resident?.close(), ...fibers.toReversed().map(fiber => () => fiber.dispose()),\n () => workspaceFiber?.dispose(), () => !engineHost && backendHost?.dispose(),\n () => platformStarted && platformBinding?.dispose?.(),\n ]) {\n try { await release(); } catch (error) { failures.push(error); }\n }\n if (failures.length) throw new AggregateError(failures, 'View cleanup failed');\n })();\n try {\n platformStarted = platform !== undefined;\n await platform?.start?.();\n const token = workspaceAccessToken ?? randomUUID();\n const config = {\n ...(frontendConfig ?? {}),\n displayCarrier: platform !== undefined,\n workspace: {\n ...(frontendConfig?.workspace ?? {}),\n clientId: frontendConfig?.workspace?.clientId ?? 'view-frontend',\n token,\n },\n };\n const plan = createViewProductPlan({\n backendConfig: {\n ...(platform ? { platform: platformBinding } : {}),\n capabilities: capabilities ?? platform?.getCapabilities?.(),\n workspaceEngine,\n workspaceAccessToken: token,\n workspaceAuthorize,\n packSources: listPackSources,\n },\n frontendConfig: config,\n disabledPages,\n });\n const frontendAssembly = createHostAssembly({\n root: viewFrontendRoot(config, plan.disabledPages),\n });\n const selectedWorkspacePlugin = workspacePlugin ??\n (workspaceEngine ? (await import('@forgeax/engine/devkit')).devKitWorkspacePlugin : undefined);\n backendHost = engineHost ?? await createBackendHost({\n assembly: frontendAssembly,\n onActivationReport,\n });\n if (selectedWorkspacePlugin) {\n if (engineHost) throw new TypeError('Install the workspace plugin on the owner before borrowing a Host');\n const started = await startNativePlugin(backendHost.context, selectedWorkspacePlugin, {\n ...workspaceOptions,\n ...(workspaceAuthorize === undefined ? {} : { authorize: ({ operation, args, caller, signal }: Parameters<NonNullable<DevKitWorkspacePluginOptions['authorize']>>[0]) => {\n const id = operation.replace(/^engine\\./, '');\n const clientId = caller?.sourceId ?? (typeof workspaceDiagnosticRecord(args).clientId === 'string' ? String(workspaceDiagnosticRecord(args).clientId) : 'view-owner');\n return workspaceAuthorize({ operation: id, clientId, caller, signal, request: { operation: id, args: workspaceDiagnosticRecord(args), clientId } });\n } }),\n ...(workspaceEngine === undefined ? {} : { provider: workspaceEngine }),\n runAccess: 'observe',\n hostBinding: createViewHostBinding({ backendHost, frontendAssembly }),\n });\n if (!started.ok) throw started.error;\n workspaceFiber = started.value;\n }\n for (const component of plan.backend) {\n const record = VIEW_PRODUCT_BACKEND_CATALOG.get(component.module);\n if (!record) throw new Error(`View backend program is missing: ${component.module}`);\n const { default: plugin } = await record.load();\n const started = await startNativePlugin(backendHost.context, plugin, component.config);\n if (!started.ok) throw started.error;\n fibers.push(started.value);\n }\n const workspaceCore = backendHost.context.get('viewWorkspaceCore');\n if (!workspaceCore) throw new Error('View backend did not activate workspace core');\n if (workspaceServer) {\n resident = await startViewHostServer({\n backendHost,\n accessToken: backendHost.context.get('viewWorkspaceAccessToken'),\n host: workspaceHost,\n port: workspacePort,\n onClientConnect: (caller) => {\n if (engineHost) engineHost.bindProjection(caller, { assembly: frontendAssembly });\n workspaceCore.attachPageSession(caller, backendHost!.transport);\n },\n onClientDisconnect: (caller) => workspaceCore.revokeConnection(caller.connectionId),\n ...(workspacePath === undefined ? {} : { path: workspacePath }),\n ...(staticRoot === undefined ? {} : { staticRoot }),\n ...(config.layout === undefined ? {} : { frontendConfig: { layout: config.layout } }),\n });\n }\n return Object.freeze({\n backendHost,\n broker: backendHost.context.get('viewBroker', false),\n carrier: backendHost.context.get('viewCarrier', false),\n workspaceCore,\n workspaceAccessToken: backendHost.context.get('viewWorkspaceAccessToken'),\n ...(resident === undefined ? {} : {\n workspaceServer: resident,\n workspaceEndpoint: resident.endpoint,\n workspaceUrl: resident.url,\n workspaceFrontendEndpoint: resident.frontendEndpoint,\n workspaceFrontendUrl: resident.frontendUrl,\n workspaceFrontendTicket: resident.frontendTicket,\n }),\n assembly: backendHost.assembly,\n hostBinding: createViewHostBinding({ backendHost, frontendAssembly }),\n dispose,\n });\n } catch (error) {\n try { await dispose(); }\n catch (cleanup) { throw new AggregateError([error, cleanup], 'View startup and cleanup failed'); }\n throw error;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAiBA,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAClC,SAAS,yBAAyB;AAClC,SAAS,0BAA0B;AAEnC,SAAS,uBAAuB;AAIzB,SAAS,0BAA0B,UAAwB;AAChE,MAAI,CAAC,YAAY,OAAO,S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
|
|
5
5
|
|
|
6
6
|
// packages/viewer/src/host/page-registry.ts
|
|
7
7
|
var PAGE_TYPE_FIELDS = /* @__PURE__ */ new Set([
|
|
@@ -341,4 +341,4 @@ export {
|
|
|
341
341
|
createViewPageHost,
|
|
342
342
|
listOpenablePageTypes
|
|
343
343
|
};
|
|
344
|
-
//# sourceMappingURL=chunk-
|
|
344
|
+
//# sourceMappingURL=chunk-WFM434WJ.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
workspaceUiFingerprint
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QJHQN6OD.mjs";
|
|
4
4
|
|
|
5
5
|
// packages/view-workspace-core/src/workspace-state.ts
|
|
6
6
|
function createWorkspaceObservation(reader, isCurrent) {
|
|
@@ -77,4 +77,4 @@ export {
|
|
|
77
77
|
createWorkspaceObservation,
|
|
78
78
|
createWorkspaceStateReader
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-WJNASQF2.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWorkspaceStateReader
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WJNASQF2.mjs";
|
|
4
4
|
|
|
5
5
|
// packages/view-plugin-viewport/src/play-presentation.ts
|
|
6
6
|
var viewPlayPresentationPlugin = {
|
|
@@ -96,4 +96,4 @@ var viewPlayPresentationPlugin = {
|
|
|
96
96
|
export {
|
|
97
97
|
viewPlayPresentationPlugin
|
|
98
98
|
};
|
|
99
|
-
//# sourceMappingURL=chunk-
|
|
99
|
+
//# sourceMappingURL=chunk-XUNDH3E7.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
VIEW_WORKSPACE_TAB_ID
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QJHQN6OD.mjs";
|
|
4
4
|
|
|
5
5
|
// packages/view-workspace-core/src/render-resize-sync.ts
|
|
6
6
|
var DEFAULT_DEBOUNCE_MS = 100;
|
|
@@ -70,4 +70,4 @@ export {
|
|
|
70
70
|
attachPreviewRenderResizeSync,
|
|
71
71
|
attachViewportRenderResizeSync
|
|
72
72
|
};
|
|
73
|
-
//# sourceMappingURL=chunk-
|
|
73
|
+
//# sourceMappingURL=chunk-YDARD4EP.mjs.map
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViewWorkspaceBroker
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CN6YN4HP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createWorkspaceToolContributions,
|
|
6
|
-
defineWorkspaceOperations
|
|
7
|
-
|
|
6
|
+
defineWorkspaceOperations,
|
|
7
|
+
workspaceToolValue
|
|
8
|
+
} from "./chunk-ZRE7BDDB.mjs";
|
|
8
9
|
import {
|
|
9
10
|
VIEW_WORKSPACE_OPERATIONS,
|
|
10
11
|
createWorkspaceRequest
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QJHQN6OD.mjs";
|
|
12
13
|
|
|
13
14
|
// packages/view-workspace-core/src/backend.ts
|
|
14
15
|
import { registerTools } from "@forgeax/engine/plugin";
|
|
@@ -22,10 +23,12 @@ var viewWorkspaceCoreBackendPlugin = {
|
|
|
22
23
|
apply(ctx, config = {}) {
|
|
23
24
|
const workspace = new ViewWorkspaceBroker({
|
|
24
25
|
engine: ctx.get?.("engineWorkspace", false),
|
|
26
|
+
engineForCaller: ctx.get?.("engineWorkspaceForCaller", false),
|
|
25
27
|
toolApi: ctx.get?.("toolApi", false),
|
|
26
|
-
display: () => ctx.get?.("viewStatus", false)?.(),
|
|
28
|
+
display: (caller) => ctx.get?.("viewStatus", false)?.(caller),
|
|
27
29
|
accessToken: config.workspaceAccessToken,
|
|
28
|
-
authorize: config.workspaceAuthorize
|
|
30
|
+
authorize: config.workspaceAuthorize,
|
|
31
|
+
packSources: config.packSources
|
|
29
32
|
});
|
|
30
33
|
const toolApi = ctx.get?.("toolApi", false);
|
|
31
34
|
const operations = defineWorkspaceOperations(VIEW_WORKSPACE_OPERATIONS.map((operation) => ({
|
|
@@ -44,10 +47,13 @@ var viewWorkspaceCoreBackendPlugin = {
|
|
|
44
47
|
inputSchema: { type: "object" },
|
|
45
48
|
outputSchema: {},
|
|
46
49
|
evidence: []
|
|
47
|
-
}, (input, context) =>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
}, async (input, context) => {
|
|
51
|
+
const result = await workspace.call(createWorkspaceRequest(input.operation, input.args ?? {}, {
|
|
52
|
+
clientId: "view-cli",
|
|
53
|
+
token: workspace.accessToken
|
|
54
|
+
}), { signal: context.signal, caller: context.caller });
|
|
55
|
+
return workspaceToolValue(result);
|
|
56
|
+
}));
|
|
51
57
|
const revokeTools = toolApi ? registerTools(ctx, tools, {
|
|
52
58
|
sourceId: "view-workspace",
|
|
53
59
|
module: "@forgeax/view-workspace-core/backend",
|
|
@@ -75,4 +81,4 @@ export {
|
|
|
75
81
|
viewWorkspaceCoreBackendPlugin,
|
|
76
82
|
backend_default
|
|
77
83
|
};
|
|
78
|
-
//# sourceMappingURL=chunk-
|
|
84
|
+
//# sourceMappingURL=chunk-YU3HRQX7.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../packages/view-workspace-core/src/backend.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Context } from '@forgeax/engine-plugin';\nimport type { ToolContribution } from '@forgeax/engine-tool-runtime';\nimport type { BrokerOptions, WorkspaceAuthorization } from './broker.ts';\nexport type WorkspaceBackendConfig = { workspaceAccessToken?: string; workspaceAuthorize?: WorkspaceAuthorization; packSources?: BrokerOptions['packSources'] };\ndeclare module '@forgeax/engine-plugin' { interface EngineContextServices { viewWorkspaceCore: ViewWorkspaceBroker; viewWorkspaceAccessToken: string; } }\nimport { ViewWorkspaceBroker } from './broker.ts';\nimport { registerTools } from '@forgeax/engine-plugin';\nimport { defineTool, toolJsonSchema } from '@forgeax/engine-tool-runtime';\nimport { VIEW_WORKSPACE_OPERATIONS, createWorkspaceRequest } from './contract.ts';\nimport { createWorkspaceToolContributions, defineWorkspaceOperations, workspaceToolValue } from './tool-runtime.ts';\n\nexport const VIEW_WORKSPACE_CORE_PLUGIN_ID = 'forgeax.view.service.workspace.backend';\nexport const VIEW_WORKSPACE_CORE_MODULE = '@forgeax/view-workspace-core/backend';\n\nexport const viewWorkspaceCoreBackendPlugin = {\n name: VIEW_WORKSPACE_CORE_PLUGIN_ID,\n inject: ['toolApi'],\n provide: ['viewWorkspaceCore', 'viewWorkspaceAccessToken'],\n apply(ctx: Context, config: WorkspaceBackendConfig = {}) {\n const workspace = new ViewWorkspaceBroker({\n engine: ctx.get?.('engineWorkspace', false),\n engineForCaller: ctx.get?.('engineWorkspaceForCaller', false),\n toolApi: ctx.get?.('toolApi', false),\n display: caller => ctx.get?.('viewStatus', false)?.(caller),\n accessToken: config.workspaceAccessToken,\n authorize: config.workspaceAuthorize,\n packSources: config.packSources,\n });\n const toolApi = ctx.get?.('toolApi', false);\n const operations = defineWorkspaceOperations(VIEW_WORKSPACE_OPERATIONS.map(operation => ({\n id: `view.workspace.${operation}`,\n operation,\n })));\n const tools: ToolContribution[] = createWorkspaceToolContributions(workspace, operations);\n tools.push(defineTool({\n id: 'view.workspace.call', path: ['view', 'workspace', 'call'],\n title: 'Call View workspace API', summary: 'Call an operation on the running View workspace.',\n realm: 'host',\n argsSchema: toolJsonSchema({ type: 'object', properties: { operation: { type: 'string' }, args: { type: 'object' }, root: { type: 'string' } }, required: ['operation'], additionalProperties: false }),\n resultSchema: toolJsonSchema({}), inputSchema: { type: 'object' }, outputSchema: {}, evidence: [],\n }, async (input, context) => {\n const result = await workspace.call(createWorkspaceRequest((input as { operation: string }).operation, (input as { args?: Record<string, unknown> }).args ?? {}, {\n clientId: 'view-cli', token: workspace.accessToken,\n }), { signal: context.signal, caller: context.caller });\n return workspaceToolValue(result);\n }));\n const revokeTools = toolApi ? registerTools(ctx, tools, {\n sourceId: 'view-workspace', module: '@forgeax/view-workspace-core/backend', realm: 'host',\n }) : undefined;\n const connection = ctx.get?.('hostTransport', false);\n const transport = connection && 'register' in connection ? connection : undefined;\n const unregister = transport ? workspace.registerTransport(transport, {\n routeThroughTools: Boolean(revokeTools),\n }) : undefined;\n ctx.provide('viewWorkspaceCore', workspace);\n ctx.provide('viewWorkspaceAccessToken', workspace.accessToken);\n ctx.effect(() => async () => { unregister?.(); await revokeTools?.(); await workspace.dispose(); });\n },\n};\nexport default viewWorkspaceCoreBackendPlugin;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAMA,SAAS,qBAAqB;AAC9B,SAAS,YAAY,sBAAsB;AAIpC,IAAM,gCAAgC;AACtC,IAAM,6BAA6B;AAEnC,IAAM,iCAAiC;AAAA,EAC5C,MAAM;AAAA,EACN,QAAQ,CAAC,SAAS;AAAA,EAClB,SAAS,CAAC,qBAAqB,0BAA0B;AAAA,EACzD,MAAM,KAAc,SAAiC,CAAC,GAAG;AACvD,UAAM,YAAY,IAAI,oBAAoB;AAAA,MACxC,QAAQ,IAAI,MAAM,mBAAmB,KAAK;AAAA,MAC1C,iBAAiB,IAAI,MAAM,4BAA4B,KAAK;AAAA,MAC5D,SAAS,IAAI,MAAM,WAAW,KAAK;AAAA,MACnC,SAAS,YAAU,IAAI,MAAM,cAAc,KAAK,IAAI,MAAM;AAAA,MAC1D,aAAa,OAAO;AAAA,MACpB,WAAW,OAAO;AAAA,MAClB,aAAa,OAAO;AAAA,IACtB,CAAC;AACD,UAAM,UAAU,IAAI,MAAM,WAAW,KAAK;AAC1C,UAAM,aAAa,0BAA0B,0BAA0B,IAAI,gBAAc;AAAA,MACvF,IAAI,kBAAkB,SAAS;AAAA,MAC/B;AAAA,IACF,EAAE,CAAC;AACH,UAAM,QAA4B,iCAAiC,WA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;AAAA,IAAG,CAAC;AAAA,EACpG;AACF;AACA,IAAO,kBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
workspaceDiagnosticRecord
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RFTLGEB5.mjs";
|
|
4
4
|
import {
|
|
5
5
|
VIEW_WORKSPACE_API_VERSION,
|
|
6
6
|
ViewWorkspaceError,
|
|
7
7
|
cloneWorkspaceValue,
|
|
8
|
+
createWorkspaceRequest,
|
|
8
9
|
workspaceError
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QJHQN6OD.mjs";
|
|
10
11
|
|
|
11
12
|
// packages/view-workspace-core/src/tool-runtime.ts
|
|
12
13
|
import { defineTool, toolJsonSchema } from "@forgeax/engine/tool-runtime";
|
|
@@ -17,6 +18,9 @@ function safeClone(value) {
|
|
|
17
18
|
return null;
|
|
18
19
|
}
|
|
19
20
|
}
|
|
21
|
+
function workspaceToolValue(value) {
|
|
22
|
+
return { ok: true, value: safeClone(value) };
|
|
23
|
+
}
|
|
20
24
|
function toolFailureError(failure) {
|
|
21
25
|
const detail = workspaceDiagnosticRecord(failure?.detail);
|
|
22
26
|
const code = [detail?.code, detail?.remoteCode].find(
|
|
@@ -70,6 +74,16 @@ async function runWorkspaceToolApi(api, {
|
|
|
70
74
|
);
|
|
71
75
|
const terminal = await run.terminal;
|
|
72
76
|
if (terminal.outcome === "failed") throw toolFailureError(terminal.failure);
|
|
77
|
+
const result = workspaceDiagnosticRecord(terminal.result);
|
|
78
|
+
if (result.ok === false) {
|
|
79
|
+
const error = workspaceDiagnosticRecord(result.error);
|
|
80
|
+
throw workspaceError(
|
|
81
|
+
typeof error.code === "string" ? error.code : "view-workspace-provider-failed",
|
|
82
|
+
typeof error.expected === "string" ? error.expected : void 0,
|
|
83
|
+
typeof error.hint === "string" ? error.hint : void 0,
|
|
84
|
+
workspaceDiagnosticRecord(error.detail)
|
|
85
|
+
);
|
|
86
|
+
}
|
|
73
87
|
return terminal.result;
|
|
74
88
|
}
|
|
75
89
|
function defineWorkspaceOperations(operations) {
|
|
@@ -107,10 +121,20 @@ function createWorkspaceToolContributions(workspace, operations) {
|
|
|
107
121
|
},
|
|
108
122
|
async (input, context) => {
|
|
109
123
|
const envelope = input;
|
|
124
|
+
const backendClient = context.caller?.kind === "cli" && context.caller.sourceId === "devkit-backend-client";
|
|
125
|
+
const direct = backendClient && envelope.apiVersion === void 0;
|
|
110
126
|
try {
|
|
111
|
-
return
|
|
127
|
+
return workspaceToolValue(
|
|
112
128
|
await workspace.call(
|
|
113
|
-
|
|
129
|
+
direct ? createWorkspaceRequest(
|
|
130
|
+
description.operation ?? description.id,
|
|
131
|
+
input,
|
|
132
|
+
{
|
|
133
|
+
clientId: context.caller.sourceId,
|
|
134
|
+
token: workspace.accessToken,
|
|
135
|
+
requestId: envelope.requestId
|
|
136
|
+
}
|
|
137
|
+
) : {
|
|
114
138
|
apiVersion: VIEW_WORKSPACE_API_VERSION,
|
|
115
139
|
operation: description.operation ?? description.id,
|
|
116
140
|
clientId: envelope.clientId,
|
|
@@ -141,8 +165,9 @@ function createWorkspaceToolContributions(workspace, operations) {
|
|
|
141
165
|
}
|
|
142
166
|
|
|
143
167
|
export {
|
|
168
|
+
workspaceToolValue,
|
|
144
169
|
runWorkspaceToolApi,
|
|
145
170
|
defineWorkspaceOperations,
|
|
146
171
|
createWorkspaceToolContributions
|
|
147
172
|
};
|
|
148
|
-
//# sourceMappingURL=chunk-
|
|
173
|
+
//# sourceMappingURL=chunk-ZRE7BDDB.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../packages/view-workspace-core/src/tool-runtime.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ToolApi, ToolApiRunOptions, ToolRuntimeError, ToolSchema, JsonValue } from '@forgeax/engine-tool-runtime';\nimport type { WorkspaceRequest } from './contract.ts';\nimport type { ViewWorkspaceBroker } from './broker.ts';\nimport { workspaceDiagnosticRecord } from './command-error.ts';\nexport type WorkspaceOperation = { id: string; operation?: string; path?: readonly string[]; title?: string; summary?: string };\nimport { defineTool, toolJsonSchema } from '@forgeax/engine-tool-runtime';\n\nimport {\n VIEW_WORKSPACE_API_VERSION,\n createWorkspaceRequest,\n ViewWorkspaceError,\n cloneWorkspaceValue,\n workspaceError,\n} from './contract.ts';\n\nfunction safeClone<T>(value: T) {\n try {\n return cloneWorkspaceValue(value);\n } catch {\n return null;\n }\n}\n\nexport function workspaceToolValue(value: unknown) {\n return { ok: true, value: safeClone(value) };\n}\n\nfunction toolFailureError(failure: ToolRuntimeError) {\n const detail = workspaceDiagnosticRecord(failure?.detail);\n const code = [detail?.code, detail?.remoteCode].find(\n (candidate) => typeof candidate === 'string' && candidate.startsWith('view-'),\n );\n const payload = detail?.payload ?? detail?.detail;\n const diagnostic =\n (typeof failure?.hint === 'string' && failure.hint.trim() !== '' ? failure.hint : undefined)\n ?? (typeof failure?.expected === 'string' && failure.expected.trim() !== '' ? failure.expected : undefined)\n ?? (failure === undefined || failure === null ? undefined : String(failure));\n if (typeof code === 'string') {\n return workspaceError(\n code,\n typeof detail.expected === 'string' ? detail.expected : failure.expected,\n typeof detail.hint === 'string' ? detail.hint : diagnostic,\n {\n failure: safeClone(failure) ?? { failure },\n ...(payload && typeof payload === 'object' ? { cause: payload } : {}),\n },\n );\n }\n return workspaceError(\n 'view-workspace-provider-failed',\n typeof failure?.expected === 'string' ? failure.expected : diagnostic,\n diagnostic,\n { failure: safeClone(failure) ?? { failure } },\n );\n}\n\nexport async function runWorkspaceToolApi(\n api: ToolApi,\n {\n operation,\n args,\n clientId,\n token,\n requestId,\n caller,\n signal,\n providerId,\n generation,\n sourceId = 'view-backend',\n apiVersion = VIEW_WORKSPACE_API_VERSION,\n }: ToolApiRunOptions & { operation: string; args?: Record<string, unknown>; clientId: string; token?: string; requestId?: string; apiVersion?: string },\n) {\n const run = api.run(\n operation,\n {\n apiVersion,\n operation,\n ...args,\n args,\n clientId,\n token,\n requestId,\n },\n { sourceId, providerId, generation, caller, signal },\n );\n const terminal = await run.terminal;\n if (terminal.outcome === 'failed') throw toolFailureError(terminal.failure);\n const result = workspaceDiagnosticRecord(terminal.result);\n if (result.ok === false) {\n const error = workspaceDiagnosticRecord(result.error);\n throw workspaceError(\n typeof error.code === 'string' ? error.code : 'view-workspace-provider-failed',\n typeof error.expected === 'string' ? error.expected : undefined,\n typeof error.hint === 'string' ? error.hint : undefined,\n workspaceDiagnosticRecord(error.detail),\n );\n }\n return terminal.result;\n}\n\nexport function defineWorkspaceOperations(operations: readonly WorkspaceOperation[]) {\n return Object.freeze(\n operations.map((operation) =>\n Object.freeze({\n path: operation.id.split('.'),\n title: operation.id,\n summary: `View workspace operation ${operation.id}.`,\n ...operation,\n }),\n ),\n );\n}\n\nexport function createWorkspaceToolContributions(workspace: Pick<ViewWorkspaceBroker, 'call' | 'accessToken'>, operations: ReturnType<typeof defineWorkspaceOperations>) {\n const schema: ToolSchema<unknown> = {\n parse(value: unknown) {\n return value !== null && typeof value === 'object' && !Array.isArray(value)\n ? { ok: true, value: value as WorkspaceRequest }\n : { ok: false, error: 'workspace API arguments must be an object' };\n },\n describe: 'JSON object accepted by the View workspace operation.',\n };\n return operations.map((description) =>\n defineTool(\n {\n id: description.id,\n path: description.path,\n title: description.title,\n summary: description.summary,\n realm: 'host',\n argsSchema: schema,\n resultSchema: toolJsonSchema({}),\n inputSchema: { type: 'object' },\n outputSchema: {},\n evidence: [],\n },\n async (input, context) => {\n const envelope = input as WorkspaceRequest;\n const backendClient = context.caller?.kind === 'cli' && context.caller.sourceId === 'devkit-backend-client';\n const direct = backendClient && envelope.apiVersion === undefined;\n try {\n return workspaceToolValue(\n await workspace.call(\n direct ? createWorkspaceRequest(description.operation ?? description.id,\n input as Record<string, unknown>, { clientId: context.caller!.sourceId,\n token: workspace.accessToken, requestId: envelope.requestId }) : {\n apiVersion: VIEW_WORKSPACE_API_VERSION,\n operation: description.operation ?? description.id,\n clientId: envelope.clientId,\n requestId: envelope.requestId,\n args: envelope.args,\n ...(envelope.token === undefined ? {} : { token: envelope.token }),\n },\n { signal: context.signal, caller: context.caller },\n ),\n );\n } catch (error) {\n if (error instanceof ViewWorkspaceError) {\n return {\n ok: false,\n error: {\n code: error.code,\n expected: error.expected,\n hint: error.hint,\n detail: safeClone(error.detail) as JsonValue,\n },\n };\n }\n throw error;\n }\n },\n ),\n );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAKA,SAAS,YAAY,sBAAsB;AAU3C,SAAS,UAAa,OAAU;AAC9B,MAAI;AACF,WAAO,oBAAoB,KAAK;AAAA,EAClC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEO,SAAS,mBAAmB,OAAgB;AACjD,SAAO,EAAE,IAAI,MAAM,OAAO,UAAU,KAAK,EAAE;AAC7C;AAEA,SAAS,iBAAiB,SAA2B;AACnD,QAAM,SAAS,0BAA0B,SAAS,MAAM;AACxD,QAAM,OAAO,CAAC,QAAQ,MAAM,QAAQ,UAAU,EAAE;AAAA,IAC9C,CAAC,cAAc,OAAO,cAAc,YAAY,UAAU,WAAW,OAAO;AAAA,EAC9E;AACA,QAAM,UAAU,QAAQ,WAAW,QAAQ;AAC3C,QAAM,cACH,OAAO,SAAS,SAAS,YAAY,QAAQ,KAAK,KAAK,MAAM,KAAK,QAAQ,OAAO,YAC9E,OAAO,SAAS,aAAa,YAAY,QAAQ,SAAS,KAAK,MAAM,KAAK,QAAQ,WAAW,YAC7F,YAAY,UAAa,YAAY,OAAO,SAAY,OAAO,OAAO;AAC5E,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO;AAAA,MACL;AAAA,MACA,OAAO,OAAO,aAAa,WAAW,OAAO,WAAW,QAAQ;AAAA,MAChE,OAAO,OAAO,SAAS,WAAW,OAAO,OAAO;AAAA,MAChD;AAAA,QACE,SAAS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