@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.
Files changed (280) hide show
  1. package/README.md +67 -9
  2. package/dist/build-revision.json +1 -1
  3. package/dist/modules/backend.mjs +34 -34
  4. package/dist/modules/browser.mjs +55 -49
  5. package/dist/modules/chunks/{chunk-EWSCJF77.mjs → chunk-2CMCY54A.mjs} +2 -2
  6. package/dist/modules/chunks/{chunk-M6S5YA6X.mjs → chunk-2RUKPDIE.mjs} +4 -4
  7. package/dist/modules/chunks/{chunk-M6S5YA6X.mjs.map → chunk-2RUKPDIE.mjs.map} +1 -1
  8. package/dist/modules/chunks/{chunk-DWT3TA6M.mjs → chunk-3FBX3P3H.mjs} +9 -8
  9. package/dist/modules/chunks/chunk-3FBX3P3H.mjs.map +7 -0
  10. package/dist/modules/chunks/{chunk-6KM24NH6.mjs → chunk-3Y5WN22T.mjs} +3 -3
  11. package/dist/modules/chunks/chunk-3Y5WN22T.mjs.map +7 -0
  12. package/dist/modules/chunks/{chunk-YFQGSDK3.mjs → chunk-45WL24XN.mjs} +2 -2
  13. package/dist/modules/chunks/{chunk-FMCHH5R4.mjs → chunk-4FYKRL46.mjs} +3 -3
  14. package/dist/modules/chunks/{chunk-VW2ZF3P4.mjs → chunk-4MJHVZMB.mjs} +6 -6
  15. package/dist/modules/chunks/{chunk-XQYF2P6M.mjs → chunk-5HVXQEO3.mjs} +7 -7
  16. package/dist/modules/chunks/{chunk-XMP4THLF.mjs → chunk-66LM6NO6.mjs} +4 -4
  17. package/dist/modules/chunks/{chunk-P4UPH74B.mjs → chunk-6C4OCCYB.mjs} +12 -12
  18. package/dist/modules/chunks/{chunk-P4UPH74B.mjs.map → chunk-6C4OCCYB.mjs.map} +1 -1
  19. package/dist/modules/chunks/{chunk-ZGOGO7SS.mjs → chunk-6J27SWMY.mjs} +1 -1
  20. package/dist/modules/chunks/{chunk-JK7K7RG3.mjs → chunk-6VK7HB4X.mjs} +4 -4
  21. package/dist/modules/chunks/{chunk-HRKW766Y.mjs → chunk-6WZZ7TIC.mjs} +2 -2
  22. package/dist/modules/chunks/{chunk-FICPCJKR.mjs → chunk-7DFCIN3T.mjs} +3 -3
  23. package/dist/modules/chunks/{chunk-FICPCJKR.mjs.map → chunk-7DFCIN3T.mjs.map} +1 -1
  24. package/dist/modules/chunks/{chunk-U64FRQKP.mjs → chunk-7MWZK7HS.mjs} +3 -3
  25. package/dist/modules/chunks/{chunk-F5RLQAPN.mjs → chunk-A7OGXJAV.mjs} +3 -3
  26. package/dist/modules/chunks/{chunk-QUFVUMSY.mjs → chunk-AUINYWZP.mjs} +2 -2
  27. package/dist/modules/chunks/{chunk-PZIAKZJC.mjs → chunk-B24VYGHV.mjs} +3 -3
  28. package/dist/modules/chunks/{chunk-SRYQLFBV.mjs → chunk-BIUWJROZ.mjs} +3 -3
  29. package/dist/modules/chunks/{chunk-SRYQLFBV.mjs.map → chunk-BIUWJROZ.mjs.map} +2 -2
  30. package/dist/modules/chunks/{chunk-X4NNZ5X6.mjs → chunk-C2AMOM7H.mjs} +3 -3
  31. package/dist/modules/chunks/{chunk-IZAHIOFU.mjs → chunk-C3WVSJZF.mjs} +6 -6
  32. package/dist/modules/chunks/{chunk-2Z5KEV6L.mjs → chunk-CAXCOZ7Y.mjs} +3 -3
  33. package/dist/modules/chunks/{chunk-HWZCLROY.mjs → chunk-CN6YN4HP.mjs} +251 -45
  34. package/dist/modules/chunks/chunk-CN6YN4HP.mjs.map +7 -0
  35. package/dist/modules/chunks/{chunk-B6QUJ33G.mjs → chunk-CXFQME65.mjs} +3 -3
  36. package/dist/modules/chunks/{chunk-IJPWKKIU.mjs → chunk-CYOLEAAY.mjs} +14 -13
  37. package/dist/modules/chunks/chunk-CYOLEAAY.mjs.map +7 -0
  38. package/dist/modules/chunks/{chunk-U6UMATPV.mjs → chunk-CYU3WWN6.mjs} +3 -3
  39. package/dist/modules/chunks/{chunk-AGVLPYVE.mjs → chunk-D2LZIQE2.mjs} +2 -2
  40. package/dist/modules/chunks/{chunk-5YTMN435.mjs → chunk-DC5JP46Y.mjs} +13 -3
  41. package/dist/modules/chunks/chunk-DC5JP46Y.mjs.map +7 -0
  42. package/dist/modules/chunks/{chunk-YNHEYXDG.mjs → chunk-DOU4MNMQ.mjs} +3 -3
  43. package/dist/modules/chunks/{chunk-ZIDEETK4.mjs → chunk-E4G4HDOC.mjs} +3 -3
  44. package/dist/modules/chunks/{chunk-ZHO2G4JR.mjs → chunk-EZAJ66NW.mjs} +3 -3
  45. package/dist/modules/chunks/{chunk-APD2EWSZ.mjs → chunk-FIWL6TQS.mjs} +2 -2
  46. package/dist/modules/chunks/{chunk-U5J7OTEB.mjs → chunk-FSSARTVM.mjs} +3 -3
  47. package/dist/modules/chunks/{chunk-47RJSHLM.mjs → chunk-FXXPWAXM.mjs} +3 -3
  48. package/dist/modules/chunks/{chunk-D2RCKG7Q.mjs → chunk-G2QCXN56.mjs} +6 -6
  49. package/dist/modules/chunks/{chunk-4T3D67CS.mjs → chunk-GRDCA6LD.mjs} +8 -8
  50. package/dist/modules/chunks/{chunk-4T3D67CS.mjs.map → chunk-GRDCA6LD.mjs.map} +1 -1
  51. package/dist/modules/chunks/{chunk-WVU3CQ62.mjs → chunk-GUVUL6D2.mjs} +3 -3
  52. package/dist/modules/chunks/{chunk-YLCJNKIW.mjs → chunk-I32EONBF.mjs} +70 -30
  53. package/dist/modules/chunks/chunk-I32EONBF.mjs.map +7 -0
  54. package/dist/modules/chunks/{chunk-E3PJGTLI.mjs → chunk-IGIELQZ2.mjs} +5 -5
  55. package/dist/modules/chunks/{chunk-5PHAXNFO.mjs → chunk-IMDR26Y3.mjs} +3 -3
  56. package/dist/modules/chunks/{chunk-55F55BQY.mjs → chunk-JVOHFCI4.mjs} +3 -3
  57. package/dist/modules/chunks/{chunk-6I7RY73G.mjs → chunk-KCM7ZCQ3.mjs} +5 -5
  58. package/dist/modules/chunks/chunk-KCM7ZCQ3.mjs.map +7 -0
  59. package/dist/modules/chunks/{chunk-K2QZRFLE.mjs → chunk-KJTMDFFX.mjs} +4 -4
  60. package/dist/modules/chunks/{chunk-KX2WU5Z6.mjs → chunk-KPLESRQY.mjs} +3 -3
  61. package/dist/modules/chunks/{chunk-PW5CE2Y6.mjs → chunk-KUOWDTI6.mjs} +2 -2
  62. package/dist/modules/chunks/chunk-L6IHUN7X.mjs +13 -0
  63. package/dist/modules/chunks/chunk-L6IHUN7X.mjs.map +7 -0
  64. package/dist/modules/chunks/{chunk-INTTYJVW.mjs → chunk-LBQ6DFMP.mjs} +2 -2
  65. package/dist/modules/chunks/{chunk-OKQ5RBKO.mjs → chunk-LVWHM3UN.mjs} +2 -2
  66. package/dist/modules/chunks/{chunk-D57DDEV2.mjs → chunk-MDQMARAN.mjs} +6 -6
  67. package/dist/modules/chunks/{chunk-D57DDEV2.mjs.map → chunk-MDQMARAN.mjs.map} +2 -2
  68. package/dist/modules/chunks/{chunk-STQPRNEO.mjs → chunk-MLXRIWJA.mjs} +2 -2
  69. package/dist/modules/chunks/{chunk-D25SR5FS.mjs → chunk-N2SH3JGI.mjs} +3 -3
  70. package/dist/modules/chunks/{chunk-KI4WGTWL.mjs → chunk-N7NXZ6R3.mjs} +4 -4
  71. package/dist/modules/chunks/{chunk-KI4WGTWL.mjs.map → chunk-N7NXZ6R3.mjs.map} +2 -2
  72. package/dist/modules/chunks/{chunk-7IGFAI5H.mjs → chunk-O5QX6H3U.mjs} +5 -5
  73. package/dist/modules/chunks/{chunk-5W7SC5D4.mjs → chunk-P2Y73QJJ.mjs} +11 -1
  74. package/dist/modules/chunks/{chunk-5W7SC5D4.mjs.map → chunk-P2Y73QJJ.mjs.map} +2 -2
  75. package/dist/modules/chunks/{chunk-FNRGLCZW.mjs → chunk-PCQNUFDL.mjs} +39 -13
  76. package/dist/modules/chunks/chunk-PCQNUFDL.mjs.map +7 -0
  77. package/dist/modules/chunks/{chunk-46UEGAXY.mjs → chunk-Q7M7VUOZ.mjs} +6 -6
  78. package/dist/modules/chunks/{chunk-XE6ITXHT.mjs → chunk-QB33CMEU.mjs} +2 -2
  79. package/dist/modules/chunks/{chunk-E3Z7GLFU.mjs → chunk-QJHQN6OD.mjs} +15 -4
  80. package/dist/modules/chunks/chunk-QJHQN6OD.mjs.map +7 -0
  81. package/dist/modules/chunks/{chunk-KAGFU64Y.mjs → chunk-QW2VT3XB.mjs} +2 -2
  82. package/dist/modules/chunks/{chunk-U5R6MVM4.mjs → chunk-RFTLGEB5.mjs} +2 -2
  83. package/dist/modules/chunks/{chunk-VKNIYV2W.mjs → chunk-RYYKMDNI.mjs} +202 -35
  84. package/dist/modules/chunks/chunk-RYYKMDNI.mjs.map +7 -0
  85. package/dist/modules/chunks/{chunk-P5XMFZY4.mjs → chunk-SFB5BDTB.mjs} +2 -2
  86. package/dist/modules/chunks/{chunk-4D3Q7K44.mjs → chunk-SNICHQJP.mjs} +2 -2
  87. package/dist/modules/chunks/{chunk-CX5WREJC.mjs → chunk-SPGFO2TA.mjs} +2 -2
  88. package/dist/modules/chunks/{chunk-H256DQT6.mjs → chunk-TMPTVIAP.mjs} +2 -2
  89. package/dist/modules/chunks/{chunk-OQXDADAS.mjs → chunk-UWJYROKS.mjs} +6 -6
  90. package/dist/modules/chunks/chunk-UWJYROKS.mjs.map +7 -0
  91. package/dist/modules/chunks/{chunk-TTRUYO7Q.mjs → chunk-UZH2664E.mjs} +3 -3
  92. package/dist/modules/chunks/{chunk-TTRUYO7Q.mjs.map → chunk-UZH2664E.mjs.map} +2 -2
  93. package/dist/modules/chunks/{chunk-CKYXAT7H.mjs → chunk-VC4OEPDH.mjs} +2 -2
  94. package/dist/modules/chunks/{chunk-RJVOH7G2.mjs → chunk-VKWEA6NG.mjs} +27 -27
  95. package/dist/modules/chunks/{chunk-LZ57Y73Z.mjs → chunk-VSJOW7J4.mjs} +9 -7
  96. package/dist/modules/chunks/chunk-VSJOW7J4.mjs.map +7 -0
  97. package/dist/modules/chunks/{chunk-PVP5YBNR.mjs → chunk-WFM434WJ.mjs} +2 -2
  98. package/dist/modules/chunks/{chunk-TXLD7JI5.mjs → chunk-WJNASQF2.mjs} +2 -2
  99. package/dist/modules/chunks/{chunk-357UOBAS.mjs → chunk-XUNDH3E7.mjs} +2 -2
  100. package/dist/modules/chunks/{chunk-PJFFCRRD.mjs → chunk-YDARD4EP.mjs} +2 -2
  101. package/dist/modules/chunks/{chunk-27XASYEH.mjs → chunk-YU3HRQX7.mjs} +17 -11
  102. package/dist/modules/chunks/chunk-YU3HRQX7.mjs.map +7 -0
  103. package/dist/modules/chunks/{chunk-EZSGDSCC.mjs → chunk-ZRE7BDDB.mjs} +30 -5
  104. package/dist/modules/chunks/chunk-ZRE7BDDB.mjs.map +7 -0
  105. package/dist/modules/cli-contributions.mjs +14 -14
  106. package/dist/modules/cli.mjs +5 -5
  107. package/dist/modules/command-executor.mjs +3 -3
  108. package/dist/modules/embedded.mjs +82 -42
  109. package/dist/modules/embedded.mjs.map +2 -2
  110. package/dist/modules/extension-bridge.mjs +4 -4
  111. package/dist/modules/frontend-root.mjs +46 -46
  112. package/dist/modules/index.mjs +71 -65
  113. package/dist/modules/index.mjs.map +1 -1
  114. package/dist/modules/pages/scene.mjs +5 -5
  115. package/dist/modules/plugin.mjs +35 -35
  116. package/dist/modules/plugins/asset/frontend.mjs +10 -10
  117. package/dist/modules/plugins/asset/identity.mjs +9 -9
  118. package/dist/modules/plugins/asset/ui.mjs +3 -3
  119. package/dist/modules/plugins/content-browser/frontend.mjs +3 -3
  120. package/dist/modules/plugins/content-browser/identity.mjs +2 -2
  121. package/dist/modules/plugins/content-browser/ui.mjs +3 -3
  122. package/dist/modules/plugins/display/api.mjs +1 -1
  123. package/dist/modules/plugins/display/backend.mjs +4 -4
  124. package/dist/modules/plugins/display/frontend.mjs +5 -5
  125. package/dist/modules/plugins/display/identity.mjs +2 -2
  126. package/dist/modules/plugins/display/ui.mjs +3 -3
  127. package/dist/modules/plugins/inspector/frontend.mjs +3 -3
  128. package/dist/modules/plugins/inspector/identity.mjs +2 -2
  129. package/dist/modules/plugins/inspector/ui.mjs +3 -3
  130. package/dist/modules/plugins/material/frontend.mjs +10 -10
  131. package/dist/modules/plugins/material/identity.mjs +9 -9
  132. package/dist/modules/plugins/material/ui.mjs +10 -10
  133. package/dist/modules/plugins/mesh/frontend.mjs +10 -10
  134. package/dist/modules/plugins/mesh/identity.mjs +9 -9
  135. package/dist/modules/plugins/mesh/ui.mjs +10 -10
  136. package/dist/modules/plugins/plugins/api.mjs +4 -4
  137. package/dist/modules/plugins/plugins/backend.mjs +7 -7
  138. package/dist/modules/plugins/plugins/cli.mjs +5 -5
  139. package/dist/modules/plugins/plugins/frontend.mjs +3 -3
  140. package/dist/modules/plugins/plugins/identity.mjs +2 -2
  141. package/dist/modules/plugins/plugins/runtime.mjs +6 -6
  142. package/dist/modules/plugins/plugins/ui/panel.mjs +3 -3
  143. package/dist/modules/plugins/plugins/ui.mjs +4 -4
  144. package/dist/modules/plugins/scene/frontend.mjs +5 -5
  145. package/dist/modules/plugins/scene/identity.mjs +2 -2
  146. package/dist/modules/plugins/scene-tree/frontend.mjs +3 -3
  147. package/dist/modules/plugins/scene-tree/identity.mjs +2 -2
  148. package/dist/modules/plugins/scene-tree/ui.mjs +3 -3
  149. package/dist/modules/plugins/texture/frontend.mjs +10 -10
  150. package/dist/modules/plugins/texture/identity.mjs +9 -9
  151. package/dist/modules/plugins/texture/ui.mjs +10 -10
  152. package/dist/modules/plugins/viewport/frontend.mjs +12 -12
  153. package/dist/modules/plugins/viewport/identity.mjs +2 -2
  154. package/dist/modules/plugins/viewport/presentation.mjs +4 -4
  155. package/dist/modules/plugins/viewport/schema.mjs +2 -2
  156. package/dist/modules/plugins/viewport/workspace-shell.mjs +9 -9
  157. package/dist/modules/product.mjs +35 -35
  158. package/dist/modules/shell/frontend.mjs +1 -1
  159. package/dist/modules/viewer/catalog/backend.mjs +31 -31
  160. package/dist/modules/viewer/catalog/frontend.mjs +42 -42
  161. package/dist/modules/viewer/catalog/shared.mjs +20 -20
  162. package/dist/modules/viewer/catalog.mjs +51 -51
  163. package/dist/modules/viewer/cli.mjs +10 -10
  164. package/dist/modules/viewer-host/frontend.mjs +48 -48
  165. package/dist/modules/viewer-host/page-registry.mjs +6 -6
  166. package/dist/modules/viewer-host.mjs +7 -7
  167. package/dist/modules/viewer.mjs +51 -51
  168. package/dist/modules/workspace/api.mjs +1 -1
  169. package/dist/modules/workspace/backend.mjs +10 -10
  170. package/dist/modules/workspace/broker.mjs +9 -9
  171. package/dist/modules/workspace/cli.mjs +2 -2
  172. package/dist/modules/workspace/client.mjs +3 -3
  173. package/dist/modules/workspace/command-error.mjs +2 -2
  174. package/dist/modules/workspace/contract.mjs +7 -1
  175. package/dist/modules/workspace/engine-adapter.mjs +3 -3
  176. package/dist/modules/workspace/extension-bridge.mjs +4 -4
  177. package/dist/modules/workspace/frontend-plugin.mjs +8 -8
  178. package/dist/modules/workspace/frontend.mjs +9 -9
  179. package/dist/modules/workspace/page-title.mjs +3 -3
  180. package/dist/modules/workspace/presentation.mjs +4 -4
  181. package/dist/modules/workspace/preview-surface.mjs +7 -7
  182. package/dist/modules/workspace/project-session.mjs +2 -2
  183. package/dist/modules/workspace/render-resize-sync.mjs +2 -2
  184. package/dist/modules/workspace/resident.mjs +4 -4
  185. package/dist/modules/workspace/resource-open.mjs +5 -5
  186. package/dist/modules/workspace/resource-page.mjs +8 -8
  187. package/dist/modules/workspace/tool-runtime.mjs +7 -5
  188. package/dist/modules/workspace/view-trace.mjs +3 -3
  189. package/dist/modules/workspace/workspace-recovery.mjs +4 -4
  190. package/dist/modules/workspace/workspace-state.mjs +2 -2
  191. package/dist/modules/workspace-frontend.mjs +8 -8
  192. package/dist/viewer/assets/{embedded-DXSSFAyM.js → embedded-BKEAtUD6.js} +2 -2
  193. package/dist/viewer/assets/{embedded-DXSSFAyM.js.map → embedded-BKEAtUD6.js.map} +1 -1
  194. package/dist/viewer/assets/main-BQrn6wsa.js +22 -0
  195. package/dist/viewer/assets/main-BQrn6wsa.js.map +1 -0
  196. package/dist/viewer/assets/{panels-lazy-DqCwhGd9.js → panels-lazy-C_Cs-76A.js} +2 -2
  197. package/dist/viewer/assets/{panels-lazy-DqCwhGd9.js.map → panels-lazy-C_Cs-76A.js.map} +1 -1
  198. package/dist/viewer/assets/panels-ui-DEDHJLuE.js +12 -0
  199. package/dist/viewer/assets/panels-ui-DEDHJLuE.js.map +1 -0
  200. package/dist/viewer/assets/style-CcYzhsIZ.css +2 -0
  201. package/dist/viewer/assets/{wgpu_wasm--oeqTwVY.js → wgpu_wasm-cNR5izZM.js} +126 -0
  202. package/dist/viewer/assets/{wgpu_wasm_bg-WoZ1YI1I.wasm → wgpu_wasm_bg-Dps0jNcQ.wasm} +0 -0
  203. package/dist/viewer/index.html +4 -4
  204. package/dist/viewer/panels.js +1 -1
  205. package/package.json +2 -2
  206. package/scripts/verify-runtime-content-engine.mjs +7 -4
  207. package/skills/forgeax-view-cli/SKILL.md +11 -0
  208. package/dist/modules/chunks/chunk-27XASYEH.mjs.map +0 -7
  209. package/dist/modules/chunks/chunk-5YTMN435.mjs.map +0 -7
  210. package/dist/modules/chunks/chunk-6I7RY73G.mjs.map +0 -7
  211. package/dist/modules/chunks/chunk-6KM24NH6.mjs.map +0 -7
  212. package/dist/modules/chunks/chunk-DWT3TA6M.mjs.map +0 -7
  213. package/dist/modules/chunks/chunk-E3Z7GLFU.mjs.map +0 -7
  214. package/dist/modules/chunks/chunk-EZSGDSCC.mjs.map +0 -7
  215. package/dist/modules/chunks/chunk-FNRGLCZW.mjs.map +0 -7
  216. package/dist/modules/chunks/chunk-HWZCLROY.mjs.map +0 -7
  217. package/dist/modules/chunks/chunk-IJPWKKIU.mjs.map +0 -7
  218. package/dist/modules/chunks/chunk-LZ57Y73Z.mjs.map +0 -7
  219. package/dist/modules/chunks/chunk-OQXDADAS.mjs.map +0 -7
  220. package/dist/modules/chunks/chunk-QELNKFSI.mjs +0 -10
  221. package/dist/modules/chunks/chunk-QELNKFSI.mjs.map +0 -7
  222. package/dist/modules/chunks/chunk-VKNIYV2W.mjs.map +0 -7
  223. package/dist/modules/chunks/chunk-YLCJNKIW.mjs.map +0 -7
  224. package/dist/viewer/assets/main-CI6ZQziX.js +0 -22
  225. package/dist/viewer/assets/main-CI6ZQziX.js.map +0 -1
  226. package/dist/viewer/assets/panels-ui-CfUtl68h.js +0 -12
  227. package/dist/viewer/assets/panels-ui-CfUtl68h.js.map +0 -1
  228. package/dist/viewer/assets/style-gOtSMZif.css +0 -2
  229. /package/dist/modules/chunks/{chunk-EWSCJF77.mjs.map → chunk-2CMCY54A.mjs.map} +0 -0
  230. /package/dist/modules/chunks/{chunk-YFQGSDK3.mjs.map → chunk-45WL24XN.mjs.map} +0 -0
  231. /package/dist/modules/chunks/{chunk-FMCHH5R4.mjs.map → chunk-4FYKRL46.mjs.map} +0 -0
  232. /package/dist/modules/chunks/{chunk-VW2ZF3P4.mjs.map → chunk-4MJHVZMB.mjs.map} +0 -0
  233. /package/dist/modules/chunks/{chunk-XQYF2P6M.mjs.map → chunk-5HVXQEO3.mjs.map} +0 -0
  234. /package/dist/modules/chunks/{chunk-XMP4THLF.mjs.map → chunk-66LM6NO6.mjs.map} +0 -0
  235. /package/dist/modules/chunks/{chunk-ZGOGO7SS.mjs.map → chunk-6J27SWMY.mjs.map} +0 -0
  236. /package/dist/modules/chunks/{chunk-JK7K7RG3.mjs.map → chunk-6VK7HB4X.mjs.map} +0 -0
  237. /package/dist/modules/chunks/{chunk-HRKW766Y.mjs.map → chunk-6WZZ7TIC.mjs.map} +0 -0
  238. /package/dist/modules/chunks/{chunk-U64FRQKP.mjs.map → chunk-7MWZK7HS.mjs.map} +0 -0
  239. /package/dist/modules/chunks/{chunk-F5RLQAPN.mjs.map → chunk-A7OGXJAV.mjs.map} +0 -0
  240. /package/dist/modules/chunks/{chunk-QUFVUMSY.mjs.map → chunk-AUINYWZP.mjs.map} +0 -0
  241. /package/dist/modules/chunks/{chunk-PZIAKZJC.mjs.map → chunk-B24VYGHV.mjs.map} +0 -0
  242. /package/dist/modules/chunks/{chunk-X4NNZ5X6.mjs.map → chunk-C2AMOM7H.mjs.map} +0 -0
  243. /package/dist/modules/chunks/{chunk-IZAHIOFU.mjs.map → chunk-C3WVSJZF.mjs.map} +0 -0
  244. /package/dist/modules/chunks/{chunk-2Z5KEV6L.mjs.map → chunk-CAXCOZ7Y.mjs.map} +0 -0
  245. /package/dist/modules/chunks/{chunk-B6QUJ33G.mjs.map → chunk-CXFQME65.mjs.map} +0 -0
  246. /package/dist/modules/chunks/{chunk-U6UMATPV.mjs.map → chunk-CYU3WWN6.mjs.map} +0 -0
  247. /package/dist/modules/chunks/{chunk-AGVLPYVE.mjs.map → chunk-D2LZIQE2.mjs.map} +0 -0
  248. /package/dist/modules/chunks/{chunk-YNHEYXDG.mjs.map → chunk-DOU4MNMQ.mjs.map} +0 -0
  249. /package/dist/modules/chunks/{chunk-ZIDEETK4.mjs.map → chunk-E4G4HDOC.mjs.map} +0 -0
  250. /package/dist/modules/chunks/{chunk-ZHO2G4JR.mjs.map → chunk-EZAJ66NW.mjs.map} +0 -0
  251. /package/dist/modules/chunks/{chunk-APD2EWSZ.mjs.map → chunk-FIWL6TQS.mjs.map} +0 -0
  252. /package/dist/modules/chunks/{chunk-U5J7OTEB.mjs.map → chunk-FSSARTVM.mjs.map} +0 -0
  253. /package/dist/modules/chunks/{chunk-47RJSHLM.mjs.map → chunk-FXXPWAXM.mjs.map} +0 -0
  254. /package/dist/modules/chunks/{chunk-D2RCKG7Q.mjs.map → chunk-G2QCXN56.mjs.map} +0 -0
  255. /package/dist/modules/chunks/{chunk-WVU3CQ62.mjs.map → chunk-GUVUL6D2.mjs.map} +0 -0
  256. /package/dist/modules/chunks/{chunk-E3PJGTLI.mjs.map → chunk-IGIELQZ2.mjs.map} +0 -0
  257. /package/dist/modules/chunks/{chunk-5PHAXNFO.mjs.map → chunk-IMDR26Y3.mjs.map} +0 -0
  258. /package/dist/modules/chunks/{chunk-55F55BQY.mjs.map → chunk-JVOHFCI4.mjs.map} +0 -0
  259. /package/dist/modules/chunks/{chunk-K2QZRFLE.mjs.map → chunk-KJTMDFFX.mjs.map} +0 -0
  260. /package/dist/modules/chunks/{chunk-KX2WU5Z6.mjs.map → chunk-KPLESRQY.mjs.map} +0 -0
  261. /package/dist/modules/chunks/{chunk-PW5CE2Y6.mjs.map → chunk-KUOWDTI6.mjs.map} +0 -0
  262. /package/dist/modules/chunks/{chunk-INTTYJVW.mjs.map → chunk-LBQ6DFMP.mjs.map} +0 -0
  263. /package/dist/modules/chunks/{chunk-OKQ5RBKO.mjs.map → chunk-LVWHM3UN.mjs.map} +0 -0
  264. /package/dist/modules/chunks/{chunk-STQPRNEO.mjs.map → chunk-MLXRIWJA.mjs.map} +0 -0
  265. /package/dist/modules/chunks/{chunk-D25SR5FS.mjs.map → chunk-N2SH3JGI.mjs.map} +0 -0
  266. /package/dist/modules/chunks/{chunk-7IGFAI5H.mjs.map → chunk-O5QX6H3U.mjs.map} +0 -0
  267. /package/dist/modules/chunks/{chunk-46UEGAXY.mjs.map → chunk-Q7M7VUOZ.mjs.map} +0 -0
  268. /package/dist/modules/chunks/{chunk-XE6ITXHT.mjs.map → chunk-QB33CMEU.mjs.map} +0 -0
  269. /package/dist/modules/chunks/{chunk-KAGFU64Y.mjs.map → chunk-QW2VT3XB.mjs.map} +0 -0
  270. /package/dist/modules/chunks/{chunk-U5R6MVM4.mjs.map → chunk-RFTLGEB5.mjs.map} +0 -0
  271. /package/dist/modules/chunks/{chunk-P5XMFZY4.mjs.map → chunk-SFB5BDTB.mjs.map} +0 -0
  272. /package/dist/modules/chunks/{chunk-4D3Q7K44.mjs.map → chunk-SNICHQJP.mjs.map} +0 -0
  273. /package/dist/modules/chunks/{chunk-CX5WREJC.mjs.map → chunk-SPGFO2TA.mjs.map} +0 -0
  274. /package/dist/modules/chunks/{chunk-H256DQT6.mjs.map → chunk-TMPTVIAP.mjs.map} +0 -0
  275. /package/dist/modules/chunks/{chunk-CKYXAT7H.mjs.map → chunk-VC4OEPDH.mjs.map} +0 -0
  276. /package/dist/modules/chunks/{chunk-RJVOH7G2.mjs.map → chunk-VKWEA6NG.mjs.map} +0 -0
  277. /package/dist/modules/chunks/{chunk-PVP5YBNR.mjs.map → chunk-WFM434WJ.mjs.map} +0 -0
  278. /package/dist/modules/chunks/{chunk-TXLD7JI5.mjs.map → chunk-WJNASQF2.mjs.map} +0 -0
  279. /package/dist/modules/chunks/{chunk-357UOBAS.mjs.map → chunk-XUNDH3E7.mjs.map} +0 -0
  280. /package/dist/modules/chunks/{chunk-PJFFCRRD.mjs.map → chunk-YDARD4EP.mjs.map} +0 -0
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  runWorkspaceToolApi
3
- } from "./chunk-EZSGDSCC.mjs";
3
+ } from "./chunk-ZRE7BDDB.mjs";
4
4
  import {
5
5
  isWorkspaceTargetRecoveryCode,
6
6
  resolveWorkspaceFailure,
7
7
  resolveWorkspaceReopenRoot
8
- } from "./chunk-K2QZRFLE.mjs";
8
+ } from "./chunk-KJTMDFFX.mjs";
9
9
  import {
10
10
  editorSceneTargetIds,
11
11
  isEditorWorkspaceAsset,
@@ -13,13 +13,16 @@ import {
13
13
  logResourceOpen,
14
14
  selectEditorWorkspacePreview,
15
15
  summarizeResourceAsset
16
- } from "./chunk-ZIDEETK4.mjs";
16
+ } from "./chunk-E4G4HDOC.mjs";
17
17
  import {
18
18
  workspaceDiagnosticRecord
19
- } from "./chunk-U5R6MVM4.mjs";
19
+ } from "./chunk-RFTLGEB5.mjs";
20
20
  import {
21
21
  VIEW_DISPLAY_TAB_ID,
22
22
  VIEW_FILE_GET_SERVICE,
23
+ VIEW_PACK_REVEAL_ACK_SERVICE,
24
+ VIEW_PACK_REVEAL_TOPIC,
25
+ VIEW_PACK_SOURCES_SERVICE,
23
26
  VIEW_WORKSPACE_API_VERSION,
24
27
  VIEW_WORKSPACE_OPERATIONS,
25
28
  VIEW_WORKSPACE_SERVICES,
@@ -35,7 +38,7 @@ import {
35
38
  workspaceCapabilities,
36
39
  workspaceError,
37
40
  workspaceUiFingerprint
38
- } from "./chunk-E3Z7GLFU.mjs";
41
+ } from "./chunk-QJHQN6OD.mjs";
39
42
  import {
40
43
  createWorkspaceId
41
44
  } from "./chunk-4XEXLHX4.mjs";
@@ -158,6 +161,15 @@ async function readWorkspaceFilePreview(workspace, payload = {}) {
158
161
  // packages/view-workspace-core/src/broker.ts
159
162
  var ENGINE_SOURCE = "engine-workspace";
160
163
  var UI_OPERATIONS = Object.freeze({
164
+ "summary.get": (workspace) => workspace.summary(),
165
+ "pages.list": (workspace) => workspace.pages(),
166
+ "pack.reveal": (workspace, args, context) => workspace.revealPack({
167
+ projectId: requireWorkspaceString(args.projectId, "projectId"),
168
+ sourcePath: requireWorkspaceString(args.sourcePath, "sourcePath"),
169
+ revision: requireWorkspaceString(args.revision, "revision"),
170
+ ...args.packageId === void 0 ? {} : { packageId: requireWorkspaceString(args.packageId, "packageId") },
171
+ ...args.connectionId === void 0 ? {} : { connectionId: requireWorkspaceString(args.connectionId, "connectionId") }
172
+ }, context.signal),
161
173
  "target.select": (workspace, args) => workspace.selectTarget(args),
162
174
  "tabs.get": (workspace) => workspace.snapshot(),
163
175
  "tabs.select": (workspace, args) => workspace.selectTab(args),
@@ -165,13 +177,30 @@ var UI_OPERATIONS = Object.freeze({
165
177
  "scene.pick": (workspace, args, context) => workspace.pickSceneEntity(args, context),
166
178
  "scene.clear": (workspace, args, context) => workspace.clearSceneSelection(args, context)
167
179
  });
168
- var ViewWorkspaceBroker = class {
169
- constructor({ engine, toolApi, display = () => void 0, accessToken = randomUUID(), authorize } = {}) {
180
+ var PAGE_OPERATIONS = /* @__PURE__ */ new Set([
181
+ "tabs.get",
182
+ "tabs.select",
183
+ "target.select",
184
+ "scene.select",
185
+ "scene.pick",
186
+ "scene.clear",
187
+ "asset.open",
188
+ "preview.close",
189
+ "play.start",
190
+ "play.ready",
191
+ "play.stop"
192
+ ]);
193
+ var ViewWorkspaceBroker = class _ViewWorkspaceBroker {
194
+ constructor({ engine, engineForCaller, projectIntent, toolApi, display = () => void 0, accessToken = randomUUID(), authorize, packSources } = {}, caller) {
170
195
  this.engine = engine;
196
+ this.engineForCaller = engineForCaller;
197
+ this.projectIntent = projectIntent;
198
+ this.caller = caller;
171
199
  this.toolApi = toolApi;
172
200
  this.display = display;
173
201
  this.accessToken = accessToken;
174
202
  this.authorize = authorize;
203
+ this.packSources = packSources;
175
204
  this.selectedTabId = VIEW_WORKSPACE_TAB_ID;
176
205
  this.targetBinding = "editor";
177
206
  this.editorTargetId = void 0;
@@ -192,6 +221,8 @@ var ViewWorkspaceBroker = class {
192
221
  this.catalogEpoch = -1;
193
222
  this.disposing = false;
194
223
  this.publishFingerprint = "";
224
+ this.pageSessions = /* @__PURE__ */ new Map();
225
+ this.pendingReveals = /* @__PURE__ */ new Map();
195
226
  }
196
227
  get project() {
197
228
  return this.engine?.project?.project ?? null;
@@ -273,6 +304,35 @@ var ViewWorkspaceBroker = class {
273
304
  } : null;
274
305
  }
275
306
  }
307
+ summary() {
308
+ const project = this.project;
309
+ const previews = this.previews();
310
+ const projectTarget = this.projectTarget && this.engine?.preview?.target.targetId === this.projectTarget.targetId ? this.engine.preview.target : this.projectTarget;
311
+ const active = [
312
+ ...projectTarget ? [{ target: projectTarget, role: "project" }] : [],
313
+ ...this.engine?.play ? [{ target: this.engine.play.target, role: "play" }] : []
314
+ ];
315
+ const targets = [...active, ...previews.slice(0, Math.max(0, 16 - active.length)).map((preview) => ({ target: preview.target, role: "preview" }))];
316
+ return {
317
+ revision: this.revision,
318
+ project: project ? { id: project.id, root: project.root, name: project.name } : null,
319
+ projectPhase: this.engine?.project?.phase ?? null,
320
+ browserGeneration: this.engine?.project?.browserGeneration ?? null,
321
+ targets: targets.map(({ target, role }) => ({
322
+ targetId: target.targetId,
323
+ ...target.generation === void 0 ? {} : { generation: target.generation },
324
+ role
325
+ })),
326
+ hasMoreTargets: active.length + previews.length > 16
327
+ };
328
+ }
329
+ pages() {
330
+ const entries = [...this.pageSessions.entries()];
331
+ return {
332
+ pages: entries.slice(0, 16).map(([connectionId, page]) => ({ connectionId, ...page.broker.summary() })),
333
+ hasMorePages: entries.length > 16
334
+ };
335
+ }
276
336
  snapshot() {
277
337
  this.syncBindings();
278
338
  const display = this.display?.();
@@ -299,6 +359,7 @@ var ViewWorkspaceBroker = class {
299
359
  ],
300
360
  project: this.project,
301
361
  projectTarget: this.projectTarget,
362
+ ...!this.project && this.projectIntent?.() ? { projectIntent: { root: this.projectIntent() } } : {},
302
363
  ...this.engine?.project?.phase === void 0 ? {} : { projectPhase: this.engine.project.phase },
303
364
  ...this.engine?.project?.browserGeneration === void 0 ? {} : { browserGeneration: this.engine.project.browserGeneration },
304
365
  assets: this.assets,
@@ -352,7 +413,21 @@ var ViewWorkspaceBroker = class {
352
413
  }
353
414
  async call(rawRequest, { signal, caller } = {}) {
354
415
  const request = assertWorkspaceRequest(rawRequest);
416
+ if (request.operation === "pages.list" || request.operation === "pack.reveal") {
417
+ await this.authorizeRequest(request, caller);
418
+ return UI_OPERATIONS[request.operation](this, request.args, { signal, caller, clientId: request.clientId });
419
+ }
420
+ const page = caller?.connectionId && this.pageSessions.get(caller.connectionId);
421
+ if (page) return page.broker.call(rawRequest, { signal, caller });
355
422
  await this.authorizeRequest(request, caller);
423
+ if (PAGE_OPERATIONS.has(request.operation) && this.pageSessions.size > 0) {
424
+ if (this.pageSessions.size !== 1) throw workspaceError(
425
+ "view-page-ambiguous",
426
+ "one View page for this page operation",
427
+ "Select the exact View page before retrying."
428
+ );
429
+ return this.pageSessions.values().next().value.broker.call(request, { signal, caller });
430
+ }
356
431
  const ui = UI_OPERATIONS[request.operation];
357
432
  if (ui) return ui(this, request.args, { signal, caller, clientId: request.clientId });
358
433
  if (request.operation === "project.reopen") {
@@ -367,12 +442,15 @@ var ViewWorkspaceBroker = class {
367
442
  return this.invoke(request.operation, request.args, { signal, caller, clientId: request.clientId, token: request.token, requestId: request.requestId });
368
443
  }
369
444
  async invoke(operation, args = {}, { signal, caller, clientId = "view-owner", token, requestId } = {}) {
445
+ caller ??= this.caller;
370
446
  const { tabId, ...input } = args;
371
447
  if (tabId !== void 0) this.assertWorkspaceTab(tabId);
372
448
  const inspector = operation.startsWith("plugins.");
373
449
  const presentation = operation.startsWith("display.");
374
450
  const id = inspector ? operation : `${presentation ? "view" : "engine"}.${operation}`;
375
451
  const sourceId = inspector || presentation ? "view-backend" : ENGINE_SOURCE;
452
+ if (this.caller && !inspector && !presentation && !operation.startsWith("run.") && input.targetId === void 0 && this.projectTarget)
453
+ input.targetId = this.projectTarget.targetId;
376
454
  const owner = this.toolApi?.describe(id, sourceId).find((record) => record.callable)?.owner;
377
455
  if (!owner) throw workspaceError("view-workspace-operation-unavailable", `Engine operation ${operation} to be installed`, "Enable the Engine capability; UI plugins do not provide domain APIs.", { operation });
378
456
  this.syncBindings();
@@ -415,7 +493,7 @@ var ViewWorkspaceBroker = class {
415
493
  this.previewProjection.cameraVersion = result?.version;
416
494
  this.previewProjection.interaction = result?.interaction ?? null;
417
495
  }
418
- if (!["scene-tree.get", "entity.inspect", "workspace.get", "preview.capture"].includes(operation)) this.changed();
496
+ if (!["scene.tree.get", "entity.inspect", "workspace.get", "preview.capture"].includes(operation)) this.changed();
419
497
  if (["project.open", "project.close", "project.reopen", "asset.open", "preview.close", "camera.abort", "play.start", "play.ready", "play.stop"].includes(operation)) {
420
498
  if (operation === "project.open" || operation === "project.reopen") this.workspaceTargetLost = false;
421
499
  return this.snapshot();
@@ -499,7 +577,7 @@ var ViewWorkspaceBroker = class {
499
577
  return this.invoke("asset.inspect", args, context);
500
578
  }
501
579
  rebuildAssetSource(args, { mode = "rebuild", ...context } = {}) {
502
- return this.invoke(`asset-source.${mode}`, args, context);
580
+ return this.invoke(`asset.source.${mode}`, args, context);
503
581
  }
504
582
  bindOpenedAsset(result, guid) {
505
583
  this.targetBinding = "editor";
@@ -601,10 +679,22 @@ var ViewWorkspaceBroker = class {
601
679
  return this.invoke("camera.abort", args, context);
602
680
  }
603
681
  getSceneTree(args, context) {
604
- return this.invoke("scene-tree.get", args, context);
682
+ return this.invoke("scene.tree.get", args, context);
605
683
  }
606
684
  async revokeConnection(connectionId) {
607
685
  if (typeof connectionId !== "string") return;
686
+ if (!this.pageSessions.has(connectionId) && ![...this.pendingReveals.values()].some((pending) => pending.connectionId === connectionId)) return;
687
+ for (const [requestId, pending] of this.pendingReveals) {
688
+ if (pending.connectionId !== connectionId) continue;
689
+ this.pendingReveals.delete(requestId);
690
+ pending.settle({ ok: false, code: "view-page-gone", requestId });
691
+ }
692
+ const page = this.pageSessions.get(connectionId);
693
+ if (page) {
694
+ this.pageSessions.delete(connectionId);
695
+ page.unsubscribe();
696
+ await page.broker.dispose();
697
+ }
608
698
  for (const preview of [this.engine?.preview, this.engine?.play]) {
609
699
  if (!preview) continue;
610
700
  try {
@@ -619,37 +709,94 @@ var ViewWorkspaceBroker = class {
619
709
  }
620
710
  this.changed();
621
711
  }
622
- /**
623
- * Reset per-page UI session state when a new View frontend page is admitted.
624
- * The open project and its Engine session stay; everything the previous page
625
- * accumulated after project.open returns to the just-opened state, so a
626
- * refreshed page's first snapshot does not inherit the old page's history.
627
- */
628
- resetPageSession() {
629
- if (this.disposing) return;
630
- this.selectedTabId = VIEW_WORKSPACE_TAB_ID;
631
- this.targetBinding = "editor";
632
- this.previewTargetId = void 0;
633
- this.inspection = null;
634
- this.openRequest = null;
635
- this.openRequestSequence = 0;
636
- this.resourceOpens = /* @__PURE__ */ new Map();
637
- this.sceneSelection = null;
638
- this.selectionAbort?.abort();
639
- this.selectionAbort = void 0;
640
- this.previewOwner = void 0;
641
- this.syncBindings();
642
- this.changed();
643
- const project = this.project;
644
- if (project) {
645
- void this.invoke("assets.list", { projectId: project.id }).catch(() => {
646
- });
712
+ /** One accepted View frontend owns one presentation projection and event stream. */
713
+ attachPageSession(caller, transport) {
714
+ const engine = this.engineForCaller ? this.engineForCaller(caller) : this.engine;
715
+ const projectTarget = engine?.project?.target;
716
+ const projectCaller = projectTarget && caller.sourceId === `forgeax-workspace:${projectTarget.sessionId}:${projectTarget.targetId}`;
717
+ if (caller.kind !== "frontend" || caller.sourceId !== "view-frontend" && !projectCaller || this.pageSessions.has(caller.connectionId)) return;
718
+ const broker = new _ViewWorkspaceBroker({
719
+ engine,
720
+ toolApi: this.toolApi,
721
+ display: () => this.display(caller),
722
+ ...this.engineForCaller && caller.sourceId === "view-frontend" ? { projectIntent: () => this.project?.root } : {},
723
+ accessToken: this.accessToken,
724
+ authorize: this.authorize,
725
+ packSources: this.packSources
726
+ }, caller);
727
+ broker.snapshot();
728
+ if (engine === this.engine) broker.assets = this.assets;
729
+ const unsubscribe = broker.subscribe((state) => transport.publish(VIEW_WORKSPACE_STATE_TOPIC, state, { connectionId: caller.connectionId }));
730
+ this.pageSessions.set(caller.connectionId, { broker, unsubscribe });
731
+ }
732
+ publishPageSessions() {
733
+ for (const { broker } of this.pageSessions.values()) {
734
+ broker.snapshot();
735
+ if (broker.engine === this.engine && this.assets !== null) broker.assets = this.assets;
736
+ broker.changed();
647
737
  }
648
738
  }
739
+ async revealPack(input, signal) {
740
+ const transport = this.transport;
741
+ if (!transport) return { ok: false, code: "view-page-unavailable" };
742
+ if (signal?.aborted) return { ok: false, code: "view-reveal-cancelled" };
743
+ const candidates = [...this.pageSessions.keys()];
744
+ if (!input.connectionId && candidates.length !== 1)
745
+ return { ok: false, code: candidates.length ? "view-page-ambiguous" : "view-page-unavailable", candidates };
746
+ const connectionId = input.connectionId ?? candidates[0];
747
+ const page = this.pageSessions.get(connectionId);
748
+ if (!page) return { ok: false, code: "view-page-gone" };
749
+ const project = page.broker.project;
750
+ if (!project || project.id !== input.projectId) return { ok: false, code: "view-project-stale" };
751
+ if (!this.packSources) return { ok: false, code: "view-pack-sources-unavailable" };
752
+ const source = (await this.packSources(project.root)).sources.find((row) => row.sourcePath === input.sourcePath);
753
+ if (signal?.aborted) return { ok: false, code: "view-reveal-cancelled" };
754
+ if (!source || source.revision !== input.revision || input.packageId && source.packageId !== input.packageId)
755
+ return { ok: false, code: "view-pack-stale" };
756
+ const requestId = randomUUID();
757
+ const intent = {
758
+ requestId,
759
+ connectionId,
760
+ projectId: input.projectId,
761
+ sourcePath: input.sourcePath,
762
+ revision: input.revision,
763
+ ...source.packageId ? { packageId: source.packageId } : {}
764
+ };
765
+ return new Promise((resolve2) => {
766
+ const retire = (code) => {
767
+ this.pendingReveals.delete(requestId);
768
+ transport.publish(VIEW_PACK_REVEAL_TOPIC, { ...intent, cancelled: true }, { connectionId });
769
+ settle({ ok: false, code, requestId });
770
+ };
771
+ const cancel = () => {
772
+ retire("view-reveal-cancelled");
773
+ };
774
+ const settle = (value) => {
775
+ clearTimeout(timeout);
776
+ signal?.removeEventListener("abort", cancel);
777
+ resolve2(value);
778
+ };
779
+ const timeout = setTimeout(() => {
780
+ retire("view-reveal-timeout");
781
+ }, 12e3);
782
+ timeout.unref?.();
783
+ this.pendingReveals.set(requestId, {
784
+ connectionId,
785
+ projectId: input.projectId,
786
+ sourcePath: input.sourcePath,
787
+ revision: input.revision,
788
+ settle
789
+ });
790
+ signal?.addEventListener("abort", cancel, { once: true });
791
+ transport.publish(VIEW_PACK_REVEAL_TOPIC, intent, { connectionId });
792
+ });
793
+ }
649
794
  registerTransport(transport, { routeThroughTools = false } = {}) {
795
+ this.transport = transport;
650
796
  const capabilities = transport.register(VIEW_WORKSPACE_SERVICES.capabilities, () => this.capabilities());
651
797
  const call = transport.register(VIEW_WORKSPACE_SERVICES.call, async ({ payload, signal, caller }) => {
652
798
  try {
799
+ this.attachPageSession(caller, transport);
653
800
  return routeThroughTools ? await runWorkspaceToolApi(this.toolApi, {
654
801
  operation: `view.workspace.${payload.operation}`,
655
802
  args: payload.args,
@@ -672,9 +819,9 @@ var ViewWorkspaceBroker = class {
672
819
  });
673
820
  }
674
821
  });
675
- const fileGet = transport.register(VIEW_FILE_GET_SERVICE, async ({ payload }) => {
822
+ const fileGet = transport.register(VIEW_FILE_GET_SERVICE, async ({ payload, caller }) => {
676
823
  try {
677
- return await readWorkspaceFilePreview(this, payload);
824
+ return await readWorkspaceFilePreview(this.pageSessions.get(caller.connectionId)?.broker ?? this, payload);
678
825
  } catch (error) {
679
826
  const failure = workspaceDiagnosticRecord(error);
680
827
  if (typeof failure.code !== "string" || !failure.code.startsWith("view-")) throw error;
@@ -687,27 +834,77 @@ var ViewWorkspaceBroker = class {
687
834
  });
688
835
  }
689
836
  });
690
- const subscription = this.subscribe((state) => transport.publish(VIEW_WORKSPACE_STATE_TOPIC, state));
837
+ const packSources = transport.register(VIEW_PACK_SOURCES_SERVICE, async ({ payload, caller }) => {
838
+ const project = (this.pageSessions.get(caller.connectionId)?.broker ?? this).project;
839
+ if (!project || payload?.projectId !== project.id) throw workspaceError("view-project-stale", "the currently open project", "Refresh the workspace before listing Pack sources.");
840
+ if (!this.packSources) throw workspaceError("view-pack-sources-unavailable", "an installed Pack source provider", "Update the View Host Pack.");
841
+ return this.packSources(project.root);
842
+ });
843
+ const revealAck = transport.register(VIEW_PACK_REVEAL_ACK_SERVICE, async ({ payload, caller }) => {
844
+ const requestId = typeof payload?.requestId === "string" ? payload.requestId : "";
845
+ const pending = this.pendingReveals.get(requestId);
846
+ if (!pending || pending.connectionId !== caller.connectionId) return { ok: false, code: "view-reveal-stale" };
847
+ if (pending.projectId !== payload.projectId || pending.sourcePath !== payload.sourcePath || pending.revision !== payload.revision)
848
+ return { ok: false, code: "view-reveal-identity-mismatch" };
849
+ const page = this.pageSessions.get(caller.connectionId);
850
+ const project = page?.broker.project;
851
+ const source = project && this.packSources ? (await this.packSources(project.root)).sources.find((row) => row.sourcePath === pending.sourcePath) : void 0;
852
+ if (this.pendingReveals.get(requestId) !== pending) return { ok: false, code: "view-reveal-stale" };
853
+ if (!project || project.id !== pending.projectId || source?.revision !== pending.revision) {
854
+ this.pendingReveals.delete(requestId);
855
+ pending.settle({ ok: false, code: "view-reveal-stale", requestId });
856
+ return { ok: false, code: "view-reveal-stale" };
857
+ }
858
+ this.pendingReveals.delete(requestId);
859
+ pending.settle({
860
+ ok: payload.shown === true,
861
+ code: payload.shown === true ? "shown" : "view-reveal-not-shown",
862
+ requestId,
863
+ connectionId: caller.connectionId,
864
+ projectId: payload.projectId,
865
+ sourcePath: payload.sourcePath,
866
+ revision: payload.revision,
867
+ ...typeof payload.reason === "string" ? { reason: payload.reason.slice(0, 160) } : {}
868
+ });
869
+ return { ok: true };
870
+ });
871
+ const subscription = this.subscribe((state) => transport.publish(VIEW_WORKSPACE_STATE_TOPIC, state, {
872
+ excludeConnectionIds: [...this.pageSessions.keys()]
873
+ }));
874
+ const removeConnect = transport.onClientConnect((caller) => this.attachPageSession(caller, transport));
875
+ const removeDisconnect = transport.onClientDisconnect((caller) => {
876
+ void this.revokeConnection(caller.connectionId);
877
+ });
691
878
  const observer = transport.connect();
692
879
  const engineSubscription = observer.subscribe("engine.workspace.state", (snapshot) => {
693
880
  const epoch = snapshot && typeof snapshot.catalogEpoch === "number" ? snapshot.catalogEpoch : void 0;
694
881
  if (epoch === void 0 || epoch <= this.catalogEpoch) {
695
882
  this.changed();
883
+ this.publishPageSessions();
696
884
  return;
697
885
  }
698
886
  this.catalogEpoch = epoch;
699
- const project = this.project;
700
- if (!project) return;
701
- const lost = this.workspaceTargetLost;
702
- void this.invoke("assets.list", { projectId: project.id }).catch(() => {
703
- this.workspaceTargetLost = lost;
704
- });
887
+ for (const broker of [this, ...[...this.pageSessions.values()].map((page) => page.broker)]) {
888
+ broker.catalogEpoch = epoch;
889
+ const project = broker.project;
890
+ if (!project || broker.engine?.project?.phase !== void 0 && broker.engine.project.phase !== "running") continue;
891
+ const lost = broker.workspaceTargetLost;
892
+ void broker.invoke("assets.list", { projectId: project.id }).catch(() => {
893
+ broker.workspaceTargetLost = lost;
894
+ }).finally(() => broker.changed());
895
+ }
896
+ this.publishPageSessions();
705
897
  });
706
898
  return () => {
899
+ if (this.transport === transport) this.transport = void 0;
707
900
  capabilities();
708
901
  call();
709
902
  fileGet();
903
+ packSources();
904
+ revealAck();
710
905
  subscription();
906
+ removeConnect();
907
+ removeDisconnect();
711
908
  engineSubscription();
712
909
  observer.close();
713
910
  };
@@ -716,10 +913,19 @@ var ViewWorkspaceBroker = class {
716
913
  this.selectionAbort?.abort();
717
914
  this.disposing = true;
718
915
  this.listeners.clear();
916
+ for (const [requestId, pending] of this.pendingReveals) {
917
+ this.pendingReveals.delete(requestId);
918
+ pending.settle({ ok: false, code: "view-page-gone", requestId });
919
+ }
920
+ for (const [connectionId, page] of this.pageSessions) {
921
+ this.pageSessions.delete(connectionId);
922
+ page.unsubscribe();
923
+ await page.broker.dispose();
924
+ }
719
925
  }
720
926
  };
721
927
 
722
928
  export {
723
929
  ViewWorkspaceBroker
724
930
  };
725
- //# sourceMappingURL=chunk-HWZCLROY.mjs.map
931
+ //# sourceMappingURL=chunk-CN6YN4HP.mjs.map