@fps-games/editor 0.2.1-beta.3 → 0.2.1-beta.4

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 (514) hide show
  1. package/dist/build-info.json +44 -44
  2. package/dist/editor-commands/capabilities/assets.d.ts +8 -0
  3. package/dist/editor-commands/capabilities/assets.d.ts.map +1 -0
  4. package/dist/{agent-bridge → editor-commands}/capabilities/assets.js +41 -41
  5. package/dist/editor-commands/capabilities/assets.js.map +1 -0
  6. package/dist/editor-commands/capabilities/editor-state.d.ts +5 -0
  7. package/dist/editor-commands/capabilities/editor-state.d.ts.map +1 -0
  8. package/dist/{agent-bridge → editor-commands}/capabilities/editor-state.js +22 -22
  9. package/dist/editor-commands/capabilities/editor-state.js.map +1 -0
  10. package/dist/editor-commands/capabilities/hierarchy.d.ts +4 -0
  11. package/dist/editor-commands/capabilities/hierarchy.d.ts.map +1 -0
  12. package/dist/{agent-bridge → editor-commands}/capabilities/hierarchy.js +5 -5
  13. package/dist/editor-commands/capabilities/hierarchy.js.map +1 -0
  14. package/dist/editor-commands/capabilities/host-lifecycle.d.ts +11 -0
  15. package/dist/editor-commands/capabilities/host-lifecycle.d.ts.map +1 -0
  16. package/dist/editor-commands/capabilities/host-lifecycle.js +149 -0
  17. package/dist/editor-commands/capabilities/host-lifecycle.js.map +1 -0
  18. package/dist/editor-commands/capabilities/prefabs.d.ts +5 -0
  19. package/dist/editor-commands/capabilities/prefabs.d.ts.map +1 -0
  20. package/dist/{agent-bridge → editor-commands}/capabilities/prefabs.js +93 -93
  21. package/dist/editor-commands/capabilities/prefabs.js.map +1 -0
  22. package/dist/editor-commands/capabilities/scene-objects.d.ts +8 -0
  23. package/dist/editor-commands/capabilities/scene-objects.d.ts.map +1 -0
  24. package/dist/editor-commands/capabilities/scene-objects.js +480 -0
  25. package/dist/editor-commands/capabilities/scene-objects.js.map +1 -0
  26. package/dist/editor-commands/capabilities/selection.d.ts +5 -0
  27. package/dist/editor-commands/capabilities/selection.d.ts.map +1 -0
  28. package/dist/editor-commands/capabilities/selection.js +60 -0
  29. package/dist/editor-commands/capabilities/selection.js.map +1 -0
  30. package/dist/editor-commands/capabilities/shadows.d.ts +5 -0
  31. package/dist/editor-commands/capabilities/shadows.d.ts.map +1 -0
  32. package/dist/{agent-bridge → editor-commands}/capabilities/shadows.js +74 -74
  33. package/dist/editor-commands/capabilities/shadows.js.map +1 -0
  34. package/dist/editor-commands/capabilities/transform.d.ts +5 -0
  35. package/dist/editor-commands/capabilities/transform.d.ts.map +1 -0
  36. package/dist/editor-commands/capabilities/transform.js +164 -0
  37. package/dist/editor-commands/capabilities/transform.js.map +1 -0
  38. package/dist/editor-commands/capabilities/ui-regions.d.ts +4 -0
  39. package/dist/editor-commands/capabilities/ui-regions.d.ts.map +1 -0
  40. package/dist/{agent-bridge → editor-commands}/capabilities/ui-regions.js +55 -57
  41. package/dist/editor-commands/capabilities/ui-regions.js.map +1 -0
  42. package/dist/editor-commands/capabilities/viewport.d.ts +5 -0
  43. package/dist/editor-commands/capabilities/viewport.d.ts.map +1 -0
  44. package/dist/{agent-bridge → editor-commands}/capabilities/viewport.js +100 -100
  45. package/dist/editor-commands/capabilities/viewport.js.map +1 -0
  46. package/dist/editor-commands/command-sources.d.ts +7 -0
  47. package/dist/editor-commands/command-sources.d.ts.map +1 -0
  48. package/dist/editor-commands/command-sources.js +34 -0
  49. package/dist/editor-commands/command-sources.js.map +1 -0
  50. package/dist/editor-commands/diagnostics.d.ts +12 -0
  51. package/dist/editor-commands/diagnostics.d.ts.map +1 -0
  52. package/dist/{agent-bridge → editor-commands}/diagnostics.js +4 -4
  53. package/dist/editor-commands/diagnostics.js.map +1 -0
  54. package/dist/{agent-bridge → editor-commands}/index.d.ts +1 -1
  55. package/dist/editor-commands/index.d.ts.map +1 -0
  56. package/dist/{agent-bridge → editor-commands}/index.js +1 -1
  57. package/dist/editor-commands/index.js.map +1 -0
  58. package/dist/editor-commands/register.d.ts +4 -0
  59. package/dist/editor-commands/register.d.ts.map +1 -0
  60. package/dist/{agent-bridge → editor-commands}/register.js +323 -286
  61. package/dist/editor-commands/register.js.map +1 -0
  62. package/dist/{agent-bridge → editor-commands}/shared.d.ts +80 -80
  63. package/dist/editor-commands/shared.d.ts.map +1 -0
  64. package/dist/{agent-bridge → editor-commands}/shared.js +29 -29
  65. package/dist/editor-commands/shared.js.map +1 -0
  66. package/dist/editor-commands/source-types.d.ts +110 -0
  67. package/dist/editor-commands/source-types.d.ts.map +1 -0
  68. package/dist/editor-commands/source-types.js.map +1 -0
  69. package/dist/editor-plugin-commands.d.ts +4 -0
  70. package/dist/editor-plugin-commands.d.ts.map +1 -0
  71. package/dist/editor-plugin-commands.js +18 -0
  72. package/dist/editor-plugin-commands.js.map +1 -0
  73. package/dist/index.d.ts +2 -2
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/index.js.map +1 -1
  77. package/dist/local-editor-commands.d.ts +2 -0
  78. package/dist/local-editor-commands.d.ts.map +1 -0
  79. package/dist/local-editor-commands.js +2 -0
  80. package/dist/local-editor-commands.js.map +1 -0
  81. package/dist/local-editor-harness.d.ts +35 -21
  82. package/dist/local-editor-harness.d.ts.map +1 -1
  83. package/dist/local-editor-harness.js +1721 -367
  84. package/dist/local-editor-harness.js.map +1 -1
  85. package/dist/local-editor-prefab-stage-transaction.d.ts +2 -1
  86. package/dist/local-editor-prefab-stage-transaction.d.ts.map +1 -1
  87. package/dist/local-editor-prefab-stage-transaction.js +6 -5
  88. package/dist/local-editor-prefab-stage-transaction.js.map +1 -1
  89. package/dist/local-editor-scene-view-interaction-runtime.d.ts.map +1 -1
  90. package/dist/local-editor-scene-view-interaction-runtime.js +2 -5
  91. package/dist/local-editor-scene-view-interaction-runtime.js.map +1 -1
  92. package/dist/playable-local-editor-entry.d.ts +10 -0
  93. package/dist/playable-local-editor-entry.d.ts.map +1 -1
  94. package/dist/playable-local-editor-entry.js +10 -2
  95. package/dist/playable-local-editor-entry.js.map +1 -1
  96. package/dist/playable-local-editor-host.d.ts +3 -32
  97. package/dist/playable-local-editor-host.d.ts.map +1 -1
  98. package/dist/playable-local-editor-host.js +6 -70
  99. package/dist/playable-local-editor-host.js.map +1 -1
  100. package/dist/playable-product-local-editor.d.ts +1 -2
  101. package/dist/playable-product-local-editor.d.ts.map +1 -1
  102. package/dist/playable-product-local-editor.js +0 -1
  103. package/dist/playable-product-local-editor.js.map +1 -1
  104. package/dist/playable-product-projection-preview.d.ts.map +1 -1
  105. package/dist/playable-product-projection-preview.js +1 -1
  106. package/dist/playable-product-projection-preview.js.map +1 -1
  107. package/dist/playable-product-scene-capabilities.d.ts +0 -2
  108. package/dist/playable-product-scene-capabilities.d.ts.map +1 -1
  109. package/dist/playable-product-scene-capabilities.js +33 -6
  110. package/dist/playable-product-scene-capabilities.js.map +1 -1
  111. package/dist/playable-runtime-babylon.d.ts +4 -0
  112. package/dist/playable-runtime-babylon.d.ts.map +1 -1
  113. package/dist/playable-runtime-babylon.js +4 -0
  114. package/dist/playable-runtime-babylon.js.map +1 -1
  115. package/dist/playable-sdk.d.ts +1 -1
  116. package/dist/playable-sdk.d.ts.map +1 -1
  117. package/dist/playable-sdk.js.map +1 -1
  118. package/dist/playable-standard-project.d.ts +0 -2
  119. package/dist/playable-standard-project.d.ts.map +1 -1
  120. package/dist/playable-standard-project.js +1 -2
  121. package/dist/playable-standard-project.js.map +1 -1
  122. package/dist/project-service-projection.d.ts +16 -0
  123. package/dist/project-service-projection.d.ts.map +1 -0
  124. package/dist/project-service-projection.js +67 -0
  125. package/dist/project-service-projection.js.map +1 -0
  126. package/node_modules/@fps-games/babylon-renderer/dist/post-process/babylon-default-pipeline.d.ts +18 -0
  127. package/node_modules/@fps-games/babylon-renderer/dist/post-process/babylon-default-pipeline.d.ts.map +1 -1
  128. package/node_modules/@fps-games/babylon-renderer/dist/post-process/babylon-default-pipeline.js +54 -18
  129. package/node_modules/@fps-games/babylon-renderer/dist/post-process/babylon-default-pipeline.js.map +1 -1
  130. package/node_modules/@fps-games/babylon-renderer/package.json +9 -9
  131. package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts +1 -0
  132. package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts.map +1 -1
  133. package/node_modules/@fps-games/editor-babylon/dist/projection.js +1 -1
  134. package/node_modules/@fps-games/editor-babylon/dist/projection.js.map +1 -1
  135. package/node_modules/@fps-games/editor-babylon/dist/selection-presentation-controller.d.ts.map +1 -1
  136. package/node_modules/@fps-games/editor-babylon/dist/selection-presentation-controller.js +127 -13
  137. package/node_modules/@fps-games/editor-babylon/dist/selection-presentation-controller.js.map +1 -1
  138. package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.d.ts.map +1 -1
  139. package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.js +66 -1
  140. package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.js.map +1 -1
  141. package/node_modules/@fps-games/editor-babylon/package.json +6 -6
  142. package/node_modules/@fps-games/editor-browser/dist/editor-command-service-client.d.ts +32 -0
  143. package/node_modules/@fps-games/editor-browser/dist/editor-command-service-client.d.ts.map +1 -0
  144. package/node_modules/@fps-games/editor-browser/dist/editor-command-service-client.js +254 -0
  145. package/node_modules/@fps-games/editor-browser/dist/editor-command-service-client.js.map +1 -0
  146. package/node_modules/@fps-games/editor-browser/dist/index.d.ts +3 -1
  147. package/node_modules/@fps-games/editor-browser/dist/index.d.ts.map +1 -1
  148. package/node_modules/@fps-games/editor-browser/dist/index.js +2 -0
  149. package/node_modules/@fps-games/editor-browser/dist/index.js.map +1 -1
  150. package/node_modules/@fps-games/editor-browser/dist/local-editor-command-center.d.ts +68 -0
  151. package/node_modules/@fps-games/editor-browser/dist/local-editor-command-center.d.ts.map +1 -0
  152. package/node_modules/@fps-games/editor-browser/dist/local-editor-command-center.js +650 -0
  153. package/node_modules/@fps-games/editor-browser/dist/local-editor-command-center.js.map +1 -0
  154. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-formal-surface-visibility.d.ts +1 -0
  155. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-formal-surface-visibility.d.ts.map +1 -1
  156. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-formal-surface-visibility.js +22 -0
  157. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-formal-surface-visibility.js.map +1 -1
  158. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.d.ts +8 -0
  159. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.d.ts.map +1 -1
  160. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js +117 -6
  161. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js.map +1 -1
  162. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.d.ts +14 -1
  163. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.d.ts.map +1 -1
  164. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.js +100 -1
  165. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.js.map +1 -1
  166. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.d.ts +8 -1
  167. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.d.ts.map +1 -1
  168. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js +75 -2
  169. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js.map +1 -1
  170. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts +37 -12
  171. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts.map +1 -1
  172. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.js.map +1 -1
  173. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts +25 -2
  174. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts.map +1 -1
  175. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js +332 -107
  176. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js.map +1 -1
  177. package/node_modules/@fps-games/editor-browser/package.json +7 -7
  178. package/node_modules/@fps-games/editor-core/dist/editor-authoring-host.d.ts +107 -0
  179. package/node_modules/@fps-games/editor-core/dist/editor-authoring-host.d.ts.map +1 -0
  180. package/node_modules/@fps-games/editor-core/dist/editor-authoring-host.js +1211 -0
  181. package/node_modules/@fps-games/editor-core/dist/editor-authoring-host.js.map +1 -0
  182. package/node_modules/@fps-games/editor-core/dist/editor-command-capability-adapter.d.ts +34 -0
  183. package/node_modules/@fps-games/editor-core/dist/editor-command-capability-adapter.d.ts.map +1 -0
  184. package/node_modules/@fps-games/editor-core/dist/editor-command-capability-adapter.js +260 -0
  185. package/node_modules/@fps-games/editor-core/dist/editor-command-capability-adapter.js.map +1 -0
  186. package/node_modules/@fps-games/editor-core/dist/editor-command-composed-authority.d.ts +9 -0
  187. package/node_modules/@fps-games/editor-core/dist/editor-command-composed-authority.d.ts.map +1 -0
  188. package/node_modules/@fps-games/editor-core/dist/editor-command-composed-authority.js +14 -0
  189. package/node_modules/@fps-games/editor-core/dist/editor-command-composed-authority.js.map +1 -0
  190. package/node_modules/@fps-games/editor-core/dist/editor-command-observability.d.ts +18 -0
  191. package/node_modules/@fps-games/editor-core/dist/editor-command-observability.d.ts.map +1 -0
  192. package/node_modules/@fps-games/editor-core/dist/editor-command-observability.js +113 -0
  193. package/node_modules/@fps-games/editor-core/dist/editor-command-observability.js.map +1 -0
  194. package/node_modules/@fps-games/editor-core/dist/editor-command-system.d.ts +82 -0
  195. package/node_modules/@fps-games/editor-core/dist/editor-command-system.d.ts.map +1 -0
  196. package/node_modules/@fps-games/editor-core/dist/editor-command-system.js +1098 -0
  197. package/node_modules/@fps-games/editor-core/dist/editor-command-system.js.map +1 -0
  198. package/node_modules/@fps-games/editor-core/dist/editor-plugin-host.d.ts +6 -7
  199. package/node_modules/@fps-games/editor-core/dist/editor-plugin-host.d.ts.map +1 -1
  200. package/node_modules/@fps-games/editor-core/dist/editor-plugin-host.js +62 -103
  201. package/node_modules/@fps-games/editor-core/dist/editor-plugin-host.js.map +1 -1
  202. package/node_modules/@fps-games/editor-core/dist/editor-service-gateway.d.ts +30 -0
  203. package/node_modules/@fps-games/editor-core/dist/editor-service-gateway.d.ts.map +1 -0
  204. package/node_modules/@fps-games/editor-core/dist/editor-service-gateway.js +540 -0
  205. package/node_modules/@fps-games/editor-core/dist/editor-service-gateway.js.map +1 -0
  206. package/node_modules/@fps-games/editor-core/dist/editor-session-authority.d.ts +9 -0
  207. package/node_modules/@fps-games/editor-core/dist/editor-session-authority.d.ts.map +1 -0
  208. package/node_modules/@fps-games/editor-core/dist/editor-session-authority.js +61 -0
  209. package/node_modules/@fps-games/editor-core/dist/editor-session-authority.js.map +1 -0
  210. package/node_modules/@fps-games/editor-core/dist/editor-session.d.ts +55 -0
  211. package/node_modules/@fps-games/editor-core/dist/editor-session.d.ts.map +1 -1
  212. package/node_modules/@fps-games/editor-core/dist/editor-session.js +247 -6
  213. package/node_modules/@fps-games/editor-core/dist/editor-session.js.map +1 -1
  214. package/node_modules/@fps-games/editor-core/dist/index.d.ts +6 -2
  215. package/node_modules/@fps-games/editor-core/dist/index.d.ts.map +1 -1
  216. package/node_modules/@fps-games/editor-core/dist/index.js +6 -2
  217. package/node_modules/@fps-games/editor-core/dist/index.js.map +1 -1
  218. package/node_modules/@fps-games/editor-core/package.json +6 -6
  219. package/node_modules/@fps-games/editor-forge-play/dist/index.d.ts +0 -1
  220. package/node_modules/@fps-games/editor-forge-play/dist/index.d.ts.map +1 -1
  221. package/node_modules/@fps-games/editor-forge-play/dist/index.js +0 -1
  222. package/node_modules/@fps-games/editor-forge-play/dist/index.js.map +1 -1
  223. package/node_modules/@fps-games/editor-forge-play/package.json +2 -2
  224. package/node_modules/@fps-games/editor-playable-sdk/dist/bridge-command/protocol.d.ts +2 -0
  225. package/node_modules/@fps-games/editor-playable-sdk/dist/bridge-command/protocol.d.ts.map +1 -1
  226. package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.d.ts.map +1 -1
  227. package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.js +41 -1
  228. package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.js.map +1 -1
  229. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play-types.d.ts +27 -1
  230. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play-types.d.ts.map +1 -1
  231. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play-types.js.map +1 -1
  232. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play.d.ts +2 -0
  233. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play.d.ts.map +1 -1
  234. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play.js +214 -7
  235. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play.js.map +1 -1
  236. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/host-controller.d.ts +1 -0
  237. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/host-controller.d.ts.map +1 -1
  238. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/host-controller.js +11 -3
  239. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/host-controller.js.map +1 -1
  240. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/index.d.ts +2 -4
  241. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/index.d.ts.map +1 -1
  242. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/index.js +0 -1
  243. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/index.js.map +1 -1
  244. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/lifecycle.d.ts.map +1 -1
  245. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/lifecycle.js +77 -31
  246. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/lifecycle.js.map +1 -1
  247. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/types.d.ts +8 -1
  248. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/types.d.ts.map +1 -1
  249. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/types.js.map +1 -1
  250. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/asset-fields.d.ts +21 -1
  251. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/asset-fields.d.ts.map +1 -1
  252. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/asset-fields.js +90 -4
  253. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/asset-fields.js.map +1 -1
  254. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/binding.d.ts +27 -1
  255. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/binding.d.ts.map +1 -1
  256. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/binding.js +161 -1
  257. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/binding.js.map +1 -1
  258. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/inspector.d.ts +2 -2
  259. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/inspector.d.ts.map +1 -1
  260. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/inspector.js +5 -92
  261. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/inspector.js.map +1 -1
  262. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/scene-inspector.d.ts +7 -0
  263. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/scene-inspector.d.ts.map +1 -1
  264. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/scene-inspector.js +26 -9
  265. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/scene-inspector.js.map +1 -1
  266. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/slot-inspector.d.ts +9 -0
  267. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/slot-inspector.d.ts.map +1 -1
  268. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/slot-inspector.js +19 -8
  269. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/slot-inspector.js.map +1 -1
  270. package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/material-override-inspector.d.ts +5 -0
  271. package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/material-override-inspector.d.ts.map +1 -1
  272. package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/material-override-inspector.js +16 -4
  273. package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/material-override-inspector.js.map +1 -1
  274. package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/stage-inspector.d.ts +9 -0
  275. package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/stage-inspector.d.ts.map +1 -1
  276. package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/stage-inspector.js +12 -2
  277. package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/stage-inspector.js.map +1 -1
  278. package/node_modules/@fps-games/editor-playable-sdk/dist/product/ground-decal.d.ts +2 -1
  279. package/node_modules/@fps-games/editor-playable-sdk/dist/product/ground-decal.d.ts.map +1 -1
  280. package/node_modules/@fps-games/editor-playable-sdk/dist/product/ground-decal.js +10 -5
  281. package/node_modules/@fps-games/editor-playable-sdk/dist/product/ground-decal.js.map +1 -1
  282. package/node_modules/@fps-games/editor-playable-sdk/dist/product/index.d.ts +1 -0
  283. package/node_modules/@fps-games/editor-playable-sdk/dist/product/index.d.ts.map +1 -1
  284. package/node_modules/@fps-games/editor-playable-sdk/dist/product/index.js +1 -0
  285. package/node_modules/@fps-games/editor-playable-sdk/dist/product/index.js.map +1 -1
  286. package/node_modules/@fps-games/editor-playable-sdk/dist/product/project-host-services.d.ts +17 -82
  287. package/node_modules/@fps-games/editor-playable-sdk/dist/product/project-host-services.d.ts.map +1 -1
  288. package/node_modules/@fps-games/editor-playable-sdk/dist/product/project-host-services.js +53 -57
  289. package/node_modules/@fps-games/editor-playable-sdk/dist/product/project-host-services.js.map +1 -1
  290. package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-session.d.ts.map +1 -1
  291. package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-session.js +3 -2
  292. package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-session.js.map +1 -1
  293. package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-authoring-commands.d.ts +10 -0
  294. package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-authoring-commands.d.ts.map +1 -0
  295. package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-authoring-commands.js +256 -0
  296. package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-authoring-commands.js.map +1 -0
  297. package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-scene-assembly.d.ts.map +1 -1
  298. package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-scene-assembly.js +7 -5
  299. package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-scene-assembly.js.map +1 -1
  300. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.d.ts.map +1 -1
  301. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.js +8 -0
  302. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.js.map +1 -1
  303. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/types.d.ts +1 -0
  304. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/types.d.ts.map +1 -1
  305. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/types.js.map +1 -1
  306. package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/inspectors.js +134 -12
  307. package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/inspectors.js.map +1 -1
  308. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-scene-workflow.d.ts.map +1 -1
  309. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-scene-workflow.js +47 -0
  310. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-scene-workflow.js.map +1 -1
  311. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-service-vite.d.ts +27 -0
  312. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-service-vite.d.ts.map +1 -0
  313. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-service-vite.js +592 -0
  314. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-service-vite.js.map +1 -0
  315. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts +3 -1
  316. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts.map +1 -1
  317. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.js +2 -1
  318. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.js.map +1 -1
  319. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/plugin.d.ts.map +1 -1
  320. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/plugin.js +61 -6
  321. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/plugin.js.map +1 -1
  322. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-adapter.d.ts +0 -2
  323. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-adapter.d.ts.map +1 -1
  324. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-adapter.js +1 -10
  325. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-adapter.js.map +1 -1
  326. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-authoring-api.d.ts.map +1 -1
  327. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-authoring-api.js +21 -0
  328. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-authoring-api.js.map +1 -1
  329. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-authoring-backend.d.ts +13 -0
  330. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-authoring-backend.d.ts.map +1 -0
  331. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-authoring-backend.js +18 -0
  332. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-authoring-backend.js.map +1 -0
  333. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-editor-service.d.ts +28 -0
  334. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-editor-service.d.ts.map +1 -0
  335. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-editor-service.js +863 -0
  336. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-editor-service.js.map +1 -0
  337. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/types.d.ts +2 -0
  338. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/types.d.ts.map +1 -1
  339. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/types.js.map +1 -1
  340. package/node_modules/@fps-games/editor-playable-sdk/package.json +6 -6
  341. package/node_modules/@fps-games/editor-protocol/dist/editor-command-capabilities.d.ts +1626 -0
  342. package/node_modules/@fps-games/editor-protocol/dist/editor-command-capabilities.d.ts.map +1 -0
  343. package/node_modules/@fps-games/editor-protocol/dist/{agent-bridge.js → editor-command-capabilities.js} +766 -620
  344. package/node_modules/@fps-games/editor-protocol/dist/editor-command-capabilities.js.map +1 -0
  345. package/node_modules/@fps-games/editor-protocol/dist/editor-command-trace.d.ts +69 -0
  346. package/node_modules/@fps-games/editor-protocol/dist/editor-command-trace.d.ts.map +1 -0
  347. package/node_modules/@fps-games/editor-protocol/dist/editor-command-trace.js +22 -0
  348. package/node_modules/@fps-games/editor-protocol/dist/editor-command-trace.js.map +1 -0
  349. package/node_modules/@fps-games/editor-protocol/dist/editor-command.d.ts +136 -0
  350. package/node_modules/@fps-games/editor-protocol/dist/editor-command.d.ts.map +1 -0
  351. package/node_modules/@fps-games/editor-protocol/dist/editor-command.js +2 -0
  352. package/node_modules/@fps-games/editor-protocol/dist/editor-command.js.map +1 -0
  353. package/node_modules/@fps-games/editor-protocol/dist/editor-service.d.ts +225 -0
  354. package/node_modules/@fps-games/editor-protocol/dist/editor-service.d.ts.map +1 -0
  355. package/node_modules/@fps-games/editor-protocol/dist/editor-service.js +4 -0
  356. package/node_modules/@fps-games/editor-protocol/dist/editor-service.js.map +1 -0
  357. package/node_modules/@fps-games/editor-protocol/dist/index.d.ts +6 -3
  358. package/node_modules/@fps-games/editor-protocol/dist/index.d.ts.map +1 -1
  359. package/node_modules/@fps-games/editor-protocol/dist/index.js +6 -3
  360. package/node_modules/@fps-games/editor-protocol/dist/index.js.map +1 -1
  361. package/node_modules/@fps-games/editor-protocol/package.json +2 -2
  362. package/node_modules/@fps-games/editor-tooling/package.json +3 -3
  363. package/node_modules/@fps-games/editor-ui/package.json +1 -1
  364. package/node_modules/@fps-games/playable-assets/package.json +1 -1
  365. package/node_modules/@fps-games/playable-contracts/package.json +1 -1
  366. package/node_modules/@fps-games/playable-rendering/package.json +2 -2
  367. package/node_modules/@fps-games/playable-runtime/package.json +12 -12
  368. package/node_modules/@fps-games/playable-runtime-data/package.json +4 -4
  369. package/node_modules/@fps-games/playable-scene/package.json +2 -2
  370. package/node_modules/@fps-games/plugin-api/package.json +1 -1
  371. package/node_modules/@fps-games/plugin-assets/dist/version.d.ts +1 -1
  372. package/node_modules/@fps-games/plugin-assets/dist/version.js +1 -1
  373. package/node_modules/@fps-games/plugin-assets/dist/version.js.map +1 -1
  374. package/node_modules/@fps-games/plugin-assets/package.json +6 -6
  375. package/node_modules/@fps-games/plugin-hierarchy/dist/kernel.d.ts +1 -0
  376. package/node_modules/@fps-games/plugin-hierarchy/dist/kernel.d.ts.map +1 -1
  377. package/node_modules/@fps-games/plugin-hierarchy/dist/kernel.js +78 -4
  378. package/node_modules/@fps-games/plugin-hierarchy/dist/kernel.js.map +1 -1
  379. package/node_modules/@fps-games/plugin-hierarchy/dist/version.d.ts +1 -1
  380. package/node_modules/@fps-games/plugin-hierarchy/dist/version.js +1 -1
  381. package/node_modules/@fps-games/plugin-hierarchy/dist/version.js.map +1 -1
  382. package/node_modules/@fps-games/plugin-hierarchy/package.json +5 -5
  383. package/node_modules/@fps-games/plugin-host/package.json +2 -2
  384. package/node_modules/@fps-games/plugin-markers/dist/version.d.ts +1 -1
  385. package/node_modules/@fps-games/plugin-markers/dist/version.js +1 -1
  386. package/node_modules/@fps-games/plugin-markers/dist/version.js.map +1 -1
  387. package/node_modules/@fps-games/plugin-markers/package.json +5 -5
  388. package/node_modules/@fps-games/plugin-materials/dist/version.d.ts +1 -1
  389. package/node_modules/@fps-games/plugin-materials/dist/version.js +1 -1
  390. package/node_modules/@fps-games/plugin-materials/dist/version.js.map +1 -1
  391. package/node_modules/@fps-games/plugin-materials/package.json +5 -5
  392. package/node_modules/@fps-games/plugin-rendering/dist/version.d.ts +1 -1
  393. package/node_modules/@fps-games/plugin-rendering/dist/version.js +1 -1
  394. package/node_modules/@fps-games/plugin-rendering/dist/version.js.map +1 -1
  395. package/node_modules/@fps-games/plugin-rendering/package.json +5 -5
  396. package/node_modules/@fps-games/plugin-scene/dist/version.d.ts +1 -1
  397. package/node_modules/@fps-games/plugin-scene/dist/version.js +1 -1
  398. package/node_modules/@fps-games/plugin-scene/dist/version.js.map +1 -1
  399. package/node_modules/@fps-games/plugin-scene/package.json +5 -5
  400. package/node_modules/@fps-games/plugin-shadow-map-experiment/dist/version.d.ts +1 -1
  401. package/node_modules/@fps-games/plugin-shadow-map-experiment/dist/version.js +1 -1
  402. package/node_modules/@fps-games/plugin-shadow-map-experiment/dist/version.js.map +1 -1
  403. package/node_modules/@fps-games/plugin-shadow-map-experiment/package.json +5 -5
  404. package/node_modules/@fps-games/plugin-shadows/dist/version.d.ts +1 -1
  405. package/node_modules/@fps-games/plugin-shadows/dist/version.js +1 -1
  406. package/node_modules/@fps-games/plugin-shadows/dist/version.js.map +1 -1
  407. package/node_modules/@fps-games/plugin-shadows/package.json +7 -7
  408. package/package.json +23 -23
  409. package/dist/agent-bridge/capabilities/assets.d.ts +0 -8
  410. package/dist/agent-bridge/capabilities/assets.d.ts.map +0 -1
  411. package/dist/agent-bridge/capabilities/assets.js.map +0 -1
  412. package/dist/agent-bridge/capabilities/editor-state.d.ts +0 -5
  413. package/dist/agent-bridge/capabilities/editor-state.d.ts.map +0 -1
  414. package/dist/agent-bridge/capabilities/editor-state.js.map +0 -1
  415. package/dist/agent-bridge/capabilities/hierarchy.d.ts +0 -4
  416. package/dist/agent-bridge/capabilities/hierarchy.d.ts.map +0 -1
  417. package/dist/agent-bridge/capabilities/hierarchy.js.map +0 -1
  418. package/dist/agent-bridge/capabilities/host-lifecycle.d.ts +0 -11
  419. package/dist/agent-bridge/capabilities/host-lifecycle.d.ts.map +0 -1
  420. package/dist/agent-bridge/capabilities/host-lifecycle.js +0 -149
  421. package/dist/agent-bridge/capabilities/host-lifecycle.js.map +0 -1
  422. package/dist/agent-bridge/capabilities/prefabs.d.ts +0 -5
  423. package/dist/agent-bridge/capabilities/prefabs.d.ts.map +0 -1
  424. package/dist/agent-bridge/capabilities/prefabs.js.map +0 -1
  425. package/dist/agent-bridge/capabilities/scene-objects.d.ts +0 -8
  426. package/dist/agent-bridge/capabilities/scene-objects.d.ts.map +0 -1
  427. package/dist/agent-bridge/capabilities/scene-objects.js +0 -480
  428. package/dist/agent-bridge/capabilities/scene-objects.js.map +0 -1
  429. package/dist/agent-bridge/capabilities/selection.d.ts +0 -5
  430. package/dist/agent-bridge/capabilities/selection.d.ts.map +0 -1
  431. package/dist/agent-bridge/capabilities/selection.js +0 -60
  432. package/dist/agent-bridge/capabilities/selection.js.map +0 -1
  433. package/dist/agent-bridge/capabilities/shadows.d.ts +0 -5
  434. package/dist/agent-bridge/capabilities/shadows.d.ts.map +0 -1
  435. package/dist/agent-bridge/capabilities/shadows.js.map +0 -1
  436. package/dist/agent-bridge/capabilities/transform.d.ts +0 -5
  437. package/dist/agent-bridge/capabilities/transform.d.ts.map +0 -1
  438. package/dist/agent-bridge/capabilities/transform.js +0 -164
  439. package/dist/agent-bridge/capabilities/transform.js.map +0 -1
  440. package/dist/agent-bridge/capabilities/ui-regions.d.ts +0 -4
  441. package/dist/agent-bridge/capabilities/ui-regions.d.ts.map +0 -1
  442. package/dist/agent-bridge/capabilities/ui-regions.js.map +0 -1
  443. package/dist/agent-bridge/capabilities/viewport.d.ts +0 -5
  444. package/dist/agent-bridge/capabilities/viewport.d.ts.map +0 -1
  445. package/dist/agent-bridge/capabilities/viewport.js.map +0 -1
  446. package/dist/agent-bridge/capability-sources.d.ts +0 -7
  447. package/dist/agent-bridge/capability-sources.d.ts.map +0 -1
  448. package/dist/agent-bridge/capability-sources.js +0 -34
  449. package/dist/agent-bridge/capability-sources.js.map +0 -1
  450. package/dist/agent-bridge/diagnostics.d.ts +0 -12
  451. package/dist/agent-bridge/diagnostics.d.ts.map +0 -1
  452. package/dist/agent-bridge/diagnostics.js.map +0 -1
  453. package/dist/agent-bridge/index.d.ts.map +0 -1
  454. package/dist/agent-bridge/index.js.map +0 -1
  455. package/dist/agent-bridge/register.d.ts +0 -4
  456. package/dist/agent-bridge/register.d.ts.map +0 -1
  457. package/dist/agent-bridge/register.js.map +0 -1
  458. package/dist/agent-bridge/shared.d.ts.map +0 -1
  459. package/dist/agent-bridge/shared.js.map +0 -1
  460. package/dist/agent-bridge/source-types.d.ts +0 -110
  461. package/dist/agent-bridge/source-types.d.ts.map +0 -1
  462. package/dist/agent-bridge/source-types.js.map +0 -1
  463. package/dist/editor-plugin-agent-capabilities.d.ts +0 -4
  464. package/dist/editor-plugin-agent-capabilities.d.ts.map +0 -1
  465. package/dist/editor-plugin-agent-capabilities.js +0 -64
  466. package/dist/editor-plugin-agent-capabilities.js.map +0 -1
  467. package/dist/local-editor-agent-actions.d.ts +0 -43
  468. package/dist/local-editor-agent-actions.d.ts.map +0 -1
  469. package/dist/local-editor-agent-actions.js +0 -321
  470. package/dist/local-editor-agent-actions.js.map +0 -1
  471. package/dist/local-editor-agent-bridge-transport.d.ts +0 -129
  472. package/dist/local-editor-agent-bridge-transport.d.ts.map +0 -1
  473. package/dist/local-editor-agent-bridge-transport.js +0 -403
  474. package/dist/local-editor-agent-bridge-transport.js.map +0 -1
  475. package/dist/local-editor-agent-bridge.d.ts +0 -2
  476. package/dist/local-editor-agent-bridge.d.ts.map +0 -1
  477. package/dist/local-editor-agent-bridge.js +0 -2
  478. package/dist/local-editor-agent-bridge.js.map +0 -1
  479. package/dist/local-editor-agent-context.d.ts +0 -68
  480. package/dist/local-editor-agent-context.d.ts.map +0 -1
  481. package/dist/local-editor-agent-context.js +0 -716
  482. package/dist/local-editor-agent-context.js.map +0 -1
  483. package/node_modules/@fps-games/editor-core/dist/agent-bridge.d.ts +0 -22
  484. package/node_modules/@fps-games/editor-core/dist/agent-bridge.d.ts.map +0 -1
  485. package/node_modules/@fps-games/editor-core/dist/agent-bridge.js +0 -106
  486. package/node_modules/@fps-games/editor-core/dist/agent-bridge.js.map +0 -1
  487. package/node_modules/@fps-games/editor-core/dist/agent-interaction.d.ts +0 -17
  488. package/node_modules/@fps-games/editor-core/dist/agent-interaction.d.ts.map +0 -1
  489. package/node_modules/@fps-games/editor-core/dist/agent-interaction.js +0 -14
  490. package/node_modules/@fps-games/editor-core/dist/agent-interaction.js.map +0 -1
  491. package/node_modules/@fps-games/editor-forge-play/dist/agent-transport.d.ts +0 -23
  492. package/node_modules/@fps-games/editor-forge-play/dist/agent-transport.d.ts.map +0 -1
  493. package/node_modules/@fps-games/editor-forge-play/dist/agent-transport.js +0 -47
  494. package/node_modules/@fps-games/editor-forge-play/dist/agent-transport.js.map +0 -1
  495. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/agent-descriptions.d.ts +0 -112
  496. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/agent-descriptions.d.ts.map +0 -1
  497. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/agent-descriptions.js +0 -159
  498. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/agent-descriptions.js.map +0 -1
  499. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/session-metadata.d.ts +0 -15
  500. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/session-metadata.d.ts.map +0 -1
  501. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/session-metadata.js +0 -76
  502. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/session-metadata.js.map +0 -1
  503. package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.d.ts +0 -1622
  504. package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.d.ts.map +0 -1
  505. package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.js.map +0 -1
  506. package/node_modules/@fps-games/editor-protocol/dist/agent-trace.d.ts +0 -68
  507. package/node_modules/@fps-games/editor-protocol/dist/agent-trace.d.ts.map +0 -1
  508. package/node_modules/@fps-games/editor-protocol/dist/agent-trace.js +0 -23
  509. package/node_modules/@fps-games/editor-protocol/dist/agent-trace.js.map +0 -1
  510. package/node_modules/@fps-games/editor-protocol/dist/agent.d.ts +0 -187
  511. package/node_modules/@fps-games/editor-protocol/dist/agent.d.ts.map +0 -1
  512. package/node_modules/@fps-games/editor-protocol/dist/agent.js +0 -5
  513. package/node_modules/@fps-games/editor-protocol/dist/agent.js.map +0 -1
  514. /package/dist/{agent-bridge → editor-commands}/source-types.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"editor-plugin-host.js","sourceRoot":"","sources":["../src/editor-plugin-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,qBAAqB,EACrB,oBAAoB,EACpB,iCAAiC,GAUlC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,GAIpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,kCAAkC,GAGnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,GAG9B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qCAAqC,EACrC,qCAAqC,GAEtC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,8BAA8B,GAG/B,MAAM,mBAAmB,CAAC;AAW3B,MAAM,8BAA8B,GAAqB,MAAM,CAAC,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AED,SAAS,gCAAgC,CACvC,YAA6C;IAE7C,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;IACjC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,aAAa,IAAI,CAAC,CAAC,cAAc,IAAI,KAAK,CAAC,EAAE,CAAC;QACnF,MAAM,IAAI,KAAK,CAAC,qCAAqC,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC;IAC1E,CAAC;IACD,MAAM,YAAY,GAAG,8BAA8B,CAAC,KAAK,CAAC,YAAsC,CAAC,CAAC;IAClG,IAAI,YAAY,CAAC,UAAU,CAAC,EAAE,KAAK,YAAY,CAAC,EAAE,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CACb,yCAAyC,YAAY,CAAC,EAAE,OAAO,YAAY,CAAC,UAAU,CAAC,EAAE,EAAE,CAC5F,CAAC;IACJ,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["import {\n type FpsCommand,\n type FpsCommandRegistry,\n defineFpsServiceToken,\n defineFpsPluginEntry,\n resolveFpsPluginEnvironmentScopes,\n type FpsDiagnostic,\n type FpsDisposer,\n type FpsEventRegistry,\n type FpsPluginEntry,\n type FpsPluginEnvironmentModule,\n type FpsPluginContext,\n type FpsPluginManifest,\n type FpsPluginScope,\n type FpsServiceToken,\n} from '@fps-games/plugin-api';\nimport {\n createFpsPluginHost,\n type FpsPluginHost,\n type FpsPluginHostInspection,\n type FpsPluginTeardownReservation,\n} from '@fps-games/plugin-host';\nimport {\n EDITOR_AGENT_BRIDGE_SCHEMA_VERSION,\n type EditorAgentBridgeCapabilityManifest,\n type EditorAgentBridgeJsonObject,\n} from '@fps-games/editor-protocol';\nimport {\n FPS_EDITOR_DIAGNOSTIC_REPORTED,\n createFpsEditorEventPublisher,\n type FpsEditorEventContext,\n type FpsEditorEventPublisher,\n} from './events.js';\nimport {\n FPS_EDITOR_LIFECYCLE_TRANSITION_TYPES,\n assertFpsEditorLifecycleScopeTopology,\n type FpsEditorLifecycleParticipant,\n} from './lifecycle.js';\nimport {\n snapshotEditorToolRegistration,\n type EditorToolRegistry,\n type EditorToolRegistration,\n} from './editor-tools.js';\n\nexport type FpsEditorContributionKind =\n | 'hierarchy'\n | 'inspector'\n | 'panel'\n | 'command'\n | 'capability'\n | 'tool'\n | 'lifecycle-participant';\n\nconst UNAVAILABLE_EDITOR_EVENT_ROUTE: FpsEventRegistry = Object.freeze({\n subscribe: () => () => {},\n publish: () => Promise.resolve(),\n});\n\nexport interface FpsEditorContribution<TValue = unknown> {\n readonly id: string;\n readonly kind: FpsEditorContributionKind;\n readonly value: TValue;\n readonly priority?: number;\n}\n\nexport interface FpsRegisteredEditorContribution<TValue = unknown>\n extends FpsEditorContribution<TValue> {\n readonly pluginId: string;\n}\n\nexport interface FpsEditorContributionRegistry {\n get(id: string): FpsRegisteredEditorContribution | undefined;\n list(kind?: FpsEditorContributionKind): readonly FpsRegisteredEditorContribution[];\n subscribe(listener: (registry: FpsEditorContributionRegistry) => void): FpsDisposer;\n}\n\ntype FpsEditorContributionRegistrar = <TValue>(\n pluginId: string,\n contribution: FpsEditorContribution<TValue>,\n) => FpsDisposer;\n\nconst contributionRegistrars = new WeakMap<FpsEditorContributionRegistry, FpsEditorContributionRegistrar>();\nconst trustedContributionContexts = new WeakMap<\n FpsPluginContext,\n {\n registry: FpsEditorContributionRegistry;\n pluginId: string;\n registrationOpen: boolean;\n addDisposer: (disposer: FpsDisposer) => void;\n }\n>();\nconst CONTRIBUTION_KINDS = new Set<FpsEditorContributionKind>([\n 'hierarchy', 'inspector', 'panel', 'command', 'capability', 'tool', 'lifecycle-participant',\n]);\n\nexport const FPS_EDITOR_CONTRIBUTIONS = defineFpsServiceToken<FpsEditorContributionRegistry>(\n 'fps.editor.contributions',\n);\n\nexport interface FpsEditorPluginHostOptions {\n readonly manifests: readonly FpsPluginManifest[];\n readonly loadEntry: (\n manifest: FpsPluginManifest,\n environment: 'editor',\n ) => Promise<FpsPluginEntry | null>;\n readonly initialServices?: readonly { token: FpsServiceToken<unknown>; value: unknown }[];\n readonly pluginConfigs?: Readonly<Record<string, unknown>>;\n readonly report?: Parameters<typeof createFpsPluginHost>[0]['report'];\n}\n\nexport interface FpsEditorPluginHost {\n readonly state: FpsPluginHost['state'];\n readonly transitioning: boolean;\n readonly contributions: FpsEditorContributionRegistry;\n readonly eventPublisher: FpsEditorEventPublisher;\n reportDiagnostic(diagnostic: FpsDiagnostic, context?: FpsEditorEventContext): void;\n inspect(): FpsPluginHostInspection;\n acquireConsumer(label?: string): () => void;\n listCommands(): readonly FpsEditorCommandRegistration[];\n executeCommand<TInput, TOutput>(command: FpsCommand<TInput, TOutput>, input: TInput): Promise<TOutput>;\n start(): Promise<void>;\n stop(): Promise<void>;\n dispose(): Promise<void>;\n}\n\nexport interface FpsEditorPluginLifecycleScopeInput {\n readonly id: string;\n readonly scope: FpsPluginScope;\n readonly parentId?: string;\n}\n\nexport interface FpsEditorPluginLifecycleScopeHost {\n openScope(input: FpsEditorPluginLifecycleScopeInput): Promise<void>;\n reserveScopeClose(scopeId: string): void;\n closeScope(scopeId: string): Promise<void>;\n}\n\ninterface FpsEditorPluginLifecycleScopeRecord {\n readonly input: FpsEditorPluginLifecycleScopeInput;\n readonly owner: object;\n host: FpsPluginHost | null;\n ready: Promise<void>;\n closing: Promise<void> | null;\n closeRequested: boolean;\n releaseTeardownReservation: FpsPluginTeardownReservation | null;\n}\n\nconst lifecycleScopeHostFactories = new WeakMap<\n FpsEditorPluginHost,\n () => FpsEditorPluginLifecycleScopeHost\n>();\n\nfunction createEditorPluginCleanupError(message: string, errors: readonly unknown[]): Error {\n const details = errors.map(error => error instanceof Error ? error.message : String(error)).join('; ');\n const combined = new Error(`${message}: ${details}`) as Error & { errors: unknown[] };\n combined.errors = [...errors];\n return combined;\n}\n\nexport function getFpsEditorPluginLifecycleScopeHost(\n host: FpsEditorPluginHost,\n): FpsEditorPluginLifecycleScopeHost {\n const createScopeHost = lifecycleScopeHostFactories.get(host);\n if (!createScopeHost) throw new Error('Editor Plugin lifecycle scope host is unavailable.');\n return createScopeHost();\n}\n\nexport interface FpsEditorCommandRegistration<TInput = unknown, TOutput = unknown> {\n readonly command: FpsCommand<TInput, TOutput>;\n readonly title: string;\n readonly description?: string;\n readonly agent?: EditorAgentBridgeCapabilityManifest;\n}\n\ninterface FpsEditorCommandContribution<TInput = unknown, TOutput = unknown> {\n readonly type: 'editor.command';\n readonly registration: FpsEditorCommandRegistration<TInput, TOutput>;\n}\n\nconst editorCommandDispatchers = new WeakMap<object, FpsCommandRegistry>();\n\nexport function registerFpsEditorCommand<TInput, TOutput>(\n context: FpsPluginContext,\n registration: FpsEditorCommandRegistration<TInput, TOutput>,\n handler: (input: TInput) => TOutput | Promise<TOutput>,\n): void {\n const trusted = requireTrustedContributionContext(context);\n assertApplicationContributionScope(context);\n const snapshot = snapshotEditorCommandRegistration(registration);\n const unregisterHandler = context.commands.register(snapshot.command, handler);\n trusted.addDisposer(unregisterHandler);\n try {\n const contribution = Object.freeze({\n type: 'editor.command' as const,\n registration: snapshot,\n }) satisfies FpsEditorCommandContribution<TInput, TOutput>;\n editorCommandDispatchers.set(contribution, context.commands);\n registerFpsEditorContribution(context, {\n id: snapshot.command.id,\n kind: 'command',\n value: contribution,\n });\n } catch (error) {\n unregisterHandler();\n throw error;\n }\n}\n\nexport function registerFpsEditorLifecycleParticipant(\n context: FpsPluginContext,\n participant: FpsEditorLifecycleParticipant,\n): FpsDisposer {\n const snapshot = snapshotEditorLifecycleParticipant(participant);\n return registerFpsEditorContribution(context, {\n id: snapshot.id,\n kind: 'lifecycle-participant',\n value: snapshot,\n });\n}\n\ninterface FpsEditorToolContribution {\n readonly type: 'editor.tool';\n readonly registration: EditorToolRegistration;\n}\n\nexport function registerFpsEditorTool(\n context: FpsPluginContext,\n registration: EditorToolRegistration,\n priority = 0,\n): FpsDisposer {\n const snapshot = snapshotEditorToolRegistration(registration);\n return registerFpsEditorContribution(context, {\n id: snapshot.definition.id,\n kind: 'tool',\n priority,\n value: Object.freeze({\n type: 'editor.tool',\n registration: snapshot,\n } satisfies FpsEditorToolContribution),\n });\n}\n\nexport function resolveFpsEditorTools(\n registry: FpsEditorContributionRegistry,\n): readonly EditorToolRegistration[] {\n return Object.freeze(registry.list('tool').map(contribution => {\n const value = contribution.value;\n if (!isRecord(value) || value.type !== 'editor.tool' || !('registration' in value)) {\n throw new Error(`Invalid Editor Tool contribution: ${contribution.id}`);\n }\n const registration = snapshotEditorToolRegistration(value.registration as EditorToolRegistration);\n if (registration.definition.id !== contribution.id) {\n throw new Error(\n `Editor Tool contribution id mismatch: ${contribution.id} != ${registration.definition.id}`,\n );\n }\n return registration;\n }));\n}\n\nexport function bindFpsEditorTools(\n contributions: FpsEditorContributionRegistry,\n tools: EditorToolRegistry,\n): FpsDisposer {\n const active = new Map<string, {\n contribution: FpsRegisteredEditorContribution;\n unregister: FpsDisposer;\n }>();\n const sync = (source: FpsEditorContributionRegistry): void => {\n const next = new Map(source.list('tool').map(contribution => [contribution.id, contribution]));\n for (const [id, binding] of [...active]) {\n if (next.get(id) === binding.contribution) continue;\n binding.unregister();\n active.delete(id);\n }\n for (const contribution of next.values()) {\n if (active.has(contribution.id)) continue;\n const registration = resolveFpsEditorToolContribution(contribution);\n active.set(contribution.id, {\n contribution,\n unregister: tools.register(registration),\n });\n }\n };\n sync(contributions);\n const unsubscribe = contributions.subscribe(sync);\n return () => {\n unsubscribe();\n for (const binding of [...active.values()].reverse()) binding.unregister();\n active.clear();\n };\n}\n\nexport function resolveFpsEditorLifecycleParticipants(\n registry: FpsEditorContributionRegistry,\n): readonly FpsEditorLifecycleParticipant[] {\n return registry.list('lifecycle-participant').map(contribution => {\n const participant = snapshotEditorLifecycleParticipant(contribution.value);\n if (participant.id !== contribution.id) {\n throw new Error(\n `Editor lifecycle participant contribution id mismatch: ${contribution.id} != ${participant.id}`,\n );\n }\n return participant;\n });\n}\n\nexport function createFpsEditorContributionRegistry(): FpsEditorContributionRegistry {\n const entries = new Map<string, FpsRegisteredEditorContribution>();\n const listeners = new Set<(registry: FpsEditorContributionRegistry) => void>();\n const publish = (): void => {\n for (const listener of [...listeners]) listener(registry);\n };\n const registry: FpsEditorContributionRegistry = {\n get: id => entries.get(id),\n list: kind => {\n if (kind !== undefined) assertContributionKind(kind);\n return [...entries.values()]\n .filter(entry => kind === undefined || entry.kind === kind)\n .sort(compareContributions);\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => { listeners.delete(listener); };\n },\n };\n contributionRegistrars.set(registry, (pluginId, contribution) => {\n const id = assertContributionId(contribution.id);\n const kind = assertContributionKind(contribution.kind);\n if (entries.has(id)) throw new Error(`Duplicate editor contribution id: ${id}`);\n const entry = Object.freeze({\n ...contribution,\n id,\n kind,\n pluginId,\n priority: normalizePriority(contribution.priority),\n });\n entries.set(id, entry);\n publish();\n let active = true;\n return () => {\n if (!active) return;\n active = false;\n if (entries.get(id) === entry) {\n entries.delete(id);\n publish();\n }\n };\n });\n return registry;\n}\n\nexport function registerFpsEditorContribution<TValue>(\n context: FpsPluginContext,\n contribution: FpsEditorContribution<TValue>,\n): FpsDisposer {\n const trusted = requireTrustedContributionContext(context);\n assertApplicationContributionScope(context);\n const declaredRegistry = context.services.get(FPS_EDITOR_CONTRIBUTIONS);\n if (declaredRegistry !== trusted.registry) {\n throw new Error('Editor contribution service does not belong to this Plugin Host.');\n }\n const register = contributionRegistrars.get(trusted.registry);\n if (!register) throw new Error('Editor contribution registry is not owned by this host.');\n if (contribution.kind === 'lifecycle-participant') {\n snapshotEditorLifecycleParticipant(contribution.value);\n }\n if (contribution.kind === 'tool') {\n resolveFpsEditorToolContribution(Object.freeze({\n ...contribution,\n pluginId: trusted.pluginId,\n priority: normalizePriority(contribution.priority),\n }));\n }\n const unregister = register(trusted.pluginId, contribution);\n trusted.addDisposer(unregister);\n let active = true;\n return () => {\n if (!active || !trusted.registrationOpen) return;\n active = false;\n return unregister();\n };\n}\n\nexport function createFpsEditorPluginHost(options: FpsEditorPluginHostOptions): FpsEditorPluginHost {\n const contributions = createFpsEditorContributionRegistry();\n const consumers = new Map<number, string>();\n let nextConsumerId = 1;\n let lifecycleTransitioning = false;\n let activeLifecycleScopeTransitions = 0;\n let lifecycleCleanupFailed = false;\n let cleanupRetryKind: 'stop' | 'dispose' | null = null;\n const lifecycleScopes = new Map<string, FpsEditorPluginLifecycleScopeRecord>();\n const failedLifecycleScopeIds = new Set<string>();\n const editorDiagnostics: FpsDiagnostic[] = [];\n let eventPublisher: FpsEditorEventPublisher | undefined;\n const reportEditorDiagnostic = (\n diagnostic: FpsDiagnostic,\n publishEvent: boolean,\n context: FpsEditorEventContext = { scope: 'application', scopeId: 'editor:application' },\n ): void => {\n editorDiagnostics.push(Object.freeze({\n code: diagnostic.code,\n message: diagnostic.message,\n severity: diagnostic.severity,\n ...(diagnostic.pluginId ? { pluginId: diagnostic.pluginId } : {}),\n }));\n if (editorDiagnostics.length > 200) editorDiagnostics.shift();\n try { options.report?.(diagnostic); }\n catch { /* Diagnostic observers cannot affect Plugin or Editor lifecycle state. */ }\n if (!publishEvent || !eventPublisher\n || diagnostic.details?.eventId === FPS_EDITOR_DIAGNOSTIC_REPORTED.id) return;\n void eventPublisher.publish(FPS_EDITOR_DIAGNOSTIC_REPORTED, Object.freeze({\n diagnostic: Object.freeze({\n code: diagnostic.code,\n message: diagnostic.message,\n severity: diagnostic.severity,\n ...(diagnostic.pluginId ? { pluginId: diagnostic.pluginId } : {}),\n }),\n }), {\n ...context,\n ...(context.sourcePluginId || !diagnostic.pluginId ? {} : { sourcePluginId: diagnostic.pluginId }),\n });\n };\n const hasLifecycleCleanupFailure = (): boolean => (\n lifecycleCleanupFailed || failedLifecycleScopeIds.size > 0\n );\n const applicationManifests = options.manifests.filter(manifest => (\n resolveFpsPluginEnvironmentScopes(manifest, 'editor').includes('application')\n ));\n const host = createFpsPluginHost({\n environment: 'editor',\n apiVersion: 1,\n scope: 'application',\n manifests: applicationManifests,\n initialServices: [\n { token: FPS_EDITOR_CONTRIBUTIONS as FpsServiceToken<unknown>, value: contributions },\n ...(options.initialServices ?? []),\n ],\n pluginConfigs: options.pluginConfigs,\n loadEntry: async (manifest, environment) => {\n const entry = await options.loadEntry(manifest, environment as 'editor');\n return entry ? bindEditorPluginEntry(defineFpsPluginEntry(entry), contributions) : null;\n },\n report: diagnostic => reportEditorDiagnostic(diagnostic, true),\n });\n eventPublisher = createFpsEditorEventPublisher({\n events: host.events,\n captureRoute(context) {\n const route: FpsEditorPluginLifecycleScopeRecord[] = [];\n let record = lifecycleScopes.get(context.scopeId);\n while (record) {\n route.push(record);\n record = record.input.parentId ? lifecycleScopes.get(record.input.parentId) : undefined;\n }\n return () => {\n for (const candidate of route) {\n if (lifecycleScopes.get(candidate.input.id) !== candidate\n || candidate.closeRequested\n || candidate.closing) continue;\n const routeHost = candidate.host ?? host;\n if (routeHost.state !== 'started' || routeHost.transitioning) continue;\n return routeHost.events;\n }\n // Scope-close facts are delivered asynchronously. A parent teardown can\n // reserve the complete host tree before an earlier child-close fact\n // reaches this resolver. In that interval public event operations are\n // intentionally unavailable, and every observer on that route is also\n // being torn down. Treat the route as closed instead of reporting an\n // observer failure for a lifecycle state that is working as designed.\n return host.state === 'started' && !host.transitioning\n ? host.events\n : UNAVAILABLE_EDITOR_EVENT_ROUTE;\n };\n },\n report: diagnostic => reportEditorDiagnostic(diagnostic, false),\n });\n const isLifecycleTransitioning = (): boolean => (\n lifecycleTransitioning || activeLifecycleScopeTransitions > 0 || host.transitioning\n );\n const assertStableObservation = (): void => {\n if (hasLifecycleCleanupFailure()) {\n throw new Error('Editor Plugin Host cleanup is incomplete; only cleanup retry operations are available.');\n }\n if (isLifecycleTransitioning()) {\n throw new Error('Editor Plugin Host observation is unavailable during a lifecycle transition.');\n }\n };\n const publicContributions: FpsEditorContributionRegistry = Object.freeze({\n get(id: string) {\n assertStableObservation();\n return contributions.get(id);\n },\n list(kind?: FpsEditorContributionKind) {\n assertStableObservation();\n return contributions.list(kind);\n },\n subscribe(listener: (registry: FpsEditorContributionRegistry) => void) {\n assertStableObservation();\n return contributions.subscribe(listener);\n },\n });\n const runLifecycleScopeTransition = async <T>(operation: () => Promise<T>): Promise<T> => {\n activeLifecycleScopeTransitions += 1;\n try { return await operation(); }\n finally { activeLifecycleScopeTransitions -= 1; }\n };\n const acquireConsumer = (label = 'anonymous'): (() => void) => {\n const transitioning = isLifecycleTransitioning();\n if (host.state !== 'started' || transitioning || hasLifecycleCleanupFailure()) {\n throw new Error(\n `Editor Plugin Host consumers require an idle started host, got: ${hasLifecycleCleanupFailure() ? 'cleanup-failed' : host.state}${transitioning ? ' (transitioning)' : ''}`,\n );\n }\n const id = nextConsumerId++;\n consumers.set(id, label);\n let active = true;\n return () => {\n if (!active) return;\n active = false;\n consumers.delete(id);\n };\n };\n const openLifecycleScope = async (\n owner: object,\n input: FpsEditorPluginLifecycleScopeInput,\n ): Promise<void> => {\n const existing = lifecycleScopes.get(input.id);\n if (existing) {\n if (existing.input.scope !== input.scope || existing.input.parentId !== input.parentId) {\n throw new Error(`Editor Plugin lifecycle scope identity conflicts with the existing scope: ${input.id}`);\n }\n if (existing.owner !== owner) {\n throw new Error(`Editor Plugin lifecycle scope is owned by another controller: ${input.id}`);\n }\n if (failedLifecycleScopeIds.has(input.id)) {\n throw new Error(`Editor Plugin lifecycle scope cleanup is incomplete; close must be retried: ${input.id}`);\n }\n if (existing.closing) throw new Error(`Editor Plugin lifecycle scope is closing: ${input.id}`);\n return existing.ready;\n }\n const transitioning = lifecycleTransitioning || host.transitioning;\n if (host.state !== 'started' || transitioning || hasLifecycleCleanupFailure()) {\n throw new Error(\n `Editor Plugin lifecycle scopes require an idle started host, got: ${hasLifecycleCleanupFailure() ? 'cleanup-failed' : host.state}${transitioning ? ' (transitioning)' : ''}`,\n );\n }\n assertFpsEditorLifecycleScopeTopology(input, [...lifecycleScopes.values()].map(record => ({\n id: record.input.id,\n scope: record.input.scope,\n state: record.closing ? 'failed' as const : 'open' as const,\n })));\n if (input.scope === 'application') {\n lifecycleScopes.set(input.id, {\n input: Object.freeze({ ...input }),\n owner,\n host: null,\n ready: Promise.resolve(),\n closing: null,\n closeRequested: false,\n releaseTeardownReservation: null,\n });\n return;\n }\n const parent = lifecycleScopes.get(input.parentId!);\n if (!parent || parent.closing) {\n throw new Error(`Editor Plugin lifecycle parent scope is not open: ${input.parentId}`);\n }\n if (parent.owner !== owner) {\n throw new Error(`Editor Plugin lifecycle parent scope is owned by another controller: ${input.parentId}`);\n }\n const childScope: Exclude<FpsPluginScope, 'application'> = input.scope;\n const scopedManifests = options.manifests.filter(manifest => (\n resolveFpsPluginEnvironmentScopes(manifest, 'editor').includes(childScope)\n ));\n const record: FpsEditorPluginLifecycleScopeRecord = {\n input: Object.freeze({ ...input }),\n owner,\n host: null,\n ready: Promise.resolve(),\n closing: null,\n closeRequested: false,\n releaseTeardownReservation: null,\n };\n lifecycleScopes.set(input.id, record);\n record.ready = parent.ready.then(async () => {\n const child = (parent.host ?? host).createScope({ scope: childScope, manifests: scopedManifests });\n record.host = child;\n if (record.closeRequested) {\n record.releaseTeardownReservation = child.reserveTeardown();\n return;\n }\n await child.start();\n }).catch(async error => {\n let cleanupError: unknown;\n try { await record.host?.dispose(); } catch (caught) { cleanupError = caught; }\n if (!record.host || record.host.state === 'disposed') {\n if (lifecycleScopes.get(input.id) === record) lifecycleScopes.delete(input.id);\n }\n if (cleanupError) {\n failedLifecycleScopeIds.add(input.id);\n cleanupRetryKind = 'dispose';\n const combined = new Error('Editor Plugin lifecycle scope start and cleanup failed.') as Error & { errors: unknown[] };\n combined.errors = [error, cleanupError];\n throw combined;\n }\n throw error;\n });\n await record.ready;\n };\n const reserveLifecycleScopeClose = (scopeId: string, owner?: object): FpsEditorPluginLifecycleScopeRecord | null => {\n const record = lifecycleScopes.get(scopeId);\n if (!record) return null;\n if (owner && record.owner !== owner) {\n throw new Error(`Editor Plugin lifecycle scope is owned by another controller: ${scopeId}`);\n }\n record.closeRequested = true;\n record.releaseTeardownReservation ??= record.input.scope === 'application'\n ? host.reserveTeardown()\n : record.host?.reserveTeardown() ?? null;\n try {\n record.releaseTeardownReservation?.assertReady();\n } catch (error) {\n failedLifecycleScopeIds.add(scopeId);\n cleanupRetryKind = 'dispose';\n throw error;\n }\n return record;\n };\n const closeLifecycleScope = async (scopeId: string, owner?: object): Promise<void> => {\n const record = reserveLifecycleScopeClose(scopeId, owner);\n if (!record) return;\n if (record.closing) return record.closing;\n record.closing = (async () => {\n try {\n try { await record.ready; } catch { /* The open caller already received the start failure. */ }\n const children = [...lifecycleScopes.values()]\n .filter(candidate => candidate.input.parentId === scopeId)\n .reverse();\n const childErrors: unknown[] = [];\n for (const child of children) {\n try { await closeLifecycleScope(child.input.id, owner); }\n catch (error) {\n childErrors.push(error);\n break;\n }\n }\n if (childErrors.length > 0) {\n throw createEditorPluginCleanupError(\n `Editor Plugin lifecycle child scope cleanup failed: ${scopeId}`,\n childErrors,\n );\n }\n if (record.host?.state !== 'disposed') await record.host?.dispose();\n failedLifecycleScopeIds.delete(scopeId);\n lifecycleScopes.delete(scopeId);\n } catch (error) {\n const scopeCleanupFailed = record.host?.state === 'cleanup-failed'\n || [...lifecycleScopes.values()].some(candidate => (\n candidate.input.parentId === scopeId && failedLifecycleScopeIds.has(candidate.input.id)\n ));\n if (scopeCleanupFailed) {\n failedLifecycleScopeIds.add(scopeId);\n cleanupRetryKind ??= 'dispose';\n }\n throw error;\n } finally {\n if (lifecycleScopes.get(scopeId) === record) {\n record.closing = null;\n } else {\n record.releaseTeardownReservation?.();\n record.releaseTeardownReservation = null;\n }\n }\n })();\n return record.closing;\n };\n const closeLifecycleScopeRoots = async (): Promise<void> => {\n const roots = [...lifecycleScopes.values()]\n .filter(record => !record.input.parentId)\n .reverse();\n const errors: unknown[] = [];\n for (const root of roots) {\n try { await closeLifecycleScope(root.input.id); }\n catch (error) { errors.push(error); }\n }\n if (errors.length > 0) {\n throw createEditorPluginCleanupError('Editor Plugin lifecycle root scope cleanup failed', errors);\n }\n };\n const editorHost: FpsEditorPluginHost = {\n get state() { return hasLifecycleCleanupFailure() ? 'cleanup-failed' : host.state; },\n get transitioning() { return isLifecycleTransitioning(); },\n contributions: publicContributions,\n eventPublisher,\n reportDiagnostic(diagnostic, context = { scope: 'application', scopeId: 'editor:application' }) {\n reportEditorDiagnostic(diagnostic, true, context);\n },\n inspect: () => {\n const inspection = host.inspect();\n return Object.freeze({\n ...inspection,\n ...(hasLifecycleCleanupFailure() ? { state: 'cleanup-failed' as const } : {}),\n transitioning: isLifecycleTransitioning(),\n diagnostics: Object.freeze([...editorDiagnostics]),\n });\n },\n acquireConsumer,\n listCommands: () => {\n assertStableObservation();\n return resolveEditorCommandRegistrations(contributions);\n },\n executeCommand(command, input) {\n const transitioning = isLifecycleTransitioning();\n if (host.state !== 'started' || transitioning || hasLifecycleCleanupFailure()) {\n throw new Error(\n `Editor Plugin Host commands require an idle started host, got: ${hasLifecycleCleanupFailure() ? 'cleanup-failed' : host.state}${transitioning ? ' (transitioning)' : ''}`,\n );\n }\n const contribution = resolveEditorCommandContribution(contributions, command.id);\n if (!contribution) throw new Error(`Editor command is not contributed by this host: ${command.id}`);\n const dispatcher = editorCommandDispatchers.get(contribution);\n if (!dispatcher) throw new Error(`Editor command dispatcher is unavailable: ${command.id}`);\n const release = acquireConsumer(`command:${command.id}`);\n return dispatcher.execute(command, input).finally(() => {\n release();\n });\n },\n start: () => host.start(),\n stop: () => {\n assertNoEditorPluginHostConsumers(consumers, 'stop');\n if (lifecycleTransitioning) throw new Error('Editor Plugin Host lifecycle is already transitioning.');\n if (hasLifecycleCleanupFailure() && cleanupRetryKind === 'dispose') {\n throw new Error('Editor Plugin Host disposal cleanup is incomplete; dispose or the owning scope close must be retried.');\n }\n lifecycleTransitioning = true;\n cleanupRetryKind = 'stop';\n return (async () => {\n try {\n await closeLifecycleScopeRoots();\n await host.stop();\n lifecycleCleanupFailed = false;\n cleanupRetryKind = null;\n } catch (error) {\n lifecycleCleanupFailed = true;\n throw error;\n } finally {\n lifecycleTransitioning = false;\n }\n })();\n },\n dispose: () => {\n assertNoEditorPluginHostConsumers(consumers, 'dispose');\n if (lifecycleTransitioning) throw new Error('Editor Plugin Host lifecycle is already transitioning.');\n lifecycleTransitioning = true;\n cleanupRetryKind = 'dispose';\n return (async () => {\n try {\n await closeLifecycleScopeRoots();\n await host.dispose();\n lifecycleCleanupFailed = false;\n cleanupRetryKind = null;\n } catch (error) {\n lifecycleCleanupFailed = true;\n throw error;\n } finally {\n lifecycleTransitioning = false;\n }\n })();\n },\n };\n lifecycleScopeHostFactories.set(editorHost, () => {\n const owner = Object.freeze({});\n const scopeHost: FpsEditorPluginLifecycleScopeHost = {\n openScope: input => runLifecycleScopeTransition(() => openLifecycleScope(owner, input)),\n reserveScopeClose: scopeId => { reserveLifecycleScopeClose(scopeId, owner); },\n closeScope: scopeId => runLifecycleScopeTransition(async () => {\n await closeLifecycleScope(scopeId, owner);\n if (!hasLifecycleCleanupFailure() && !lifecycleTransitioning) cleanupRetryKind = null;\n }),\n };\n return Object.freeze(scopeHost);\n });\n return editorHost;\n}\n\nexport interface FpsEditorPluginEnvironmentModuleHostOptions {\n readonly module: FpsPluginEnvironmentModule;\n readonly initialServices?: readonly { token: FpsServiceToken<unknown>; value: unknown }[];\n readonly report?: FpsEditorPluginHostOptions['report'];\n}\n\nexport function createFpsEditorPluginHostFromEnvironmentModule(\n options: FpsEditorPluginEnvironmentModuleHostOptions,\n): FpsEditorPluginHost {\n if (options.module.environment !== 'editor') {\n throw new Error(`Editor Plugin Host requires an editor environment module, got: ${options.module.environment}`);\n }\n const entries = new Map<string, FpsPluginEnvironmentModule['entries'][number]>();\n for (const entry of options.module.entries) {\n if (entries.has(entry.pluginId)) throw new Error(`Duplicate Editor Plugin module entry: ${entry.pluginId}`);\n entries.set(entry.pluginId, entry);\n }\n return createFpsEditorPluginHost({\n manifests: options.module.manifests,\n pluginConfigs: options.module.pluginConfigs,\n initialServices: options.initialServices,\n report: options.report,\n async loadEntry(manifest) {\n const entry = entries.get(manifest.id);\n if (!entry) throw new Error(`Editor Plugin module entry is missing: ${manifest.id}`);\n return entry.load();\n },\n });\n}\n\nfunction requireTrustedContributionContext(\n context: FpsPluginContext,\n): NonNullable<ReturnType<typeof trustedContributionContexts.get>> {\n const trusted = trustedContributionContexts.get(context);\n if (!trusted) throw new Error('Editor contribution registration requires a host-authenticated Plugin context.');\n if (!trusted.registrationOpen) {\n throw new Error('Editor contributions may only be registered during the Plugin register lifecycle.');\n }\n return trusted;\n}\n\nfunction assertApplicationContributionScope(context: FpsPluginContext): void {\n if (context.scope !== 'application') {\n throw new Error(\n `Editor contributions are application-scope extension definitions; ${context.scope} scopes may own resources but cannot register global contributions.`,\n );\n }\n}\n\nfunction resolveEditorCommandRegistrations(\n registry: FpsEditorContributionRegistry,\n): readonly FpsEditorCommandRegistration[] {\n return registry.list('command').map(contribution => {\n const value = contribution.value;\n if (!isEditorCommandContribution(value) || value.registration.command.id !== contribution.id) {\n throw new Error(`Invalid Editor command contribution: ${contribution.id}`);\n }\n return value.registration;\n });\n}\n\nfunction resolveEditorCommandContribution(\n registry: FpsEditorContributionRegistry,\n commandId: string,\n): FpsEditorCommandContribution | null {\n const contribution = registry.get(commandId);\n if (!contribution || contribution.kind !== 'command') return null;\n const value = contribution.value;\n if (!isEditorCommandContribution(value) || value.registration.command.id !== commandId) {\n throw new Error(`Invalid Editor command contribution: ${commandId}`);\n }\n return value;\n}\n\nfunction isEditorCommandContribution(value: unknown): value is FpsEditorCommandContribution {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return false;\n const contribution = value as Partial<FpsEditorCommandContribution>;\n return contribution.type === 'editor.command'\n && !!contribution.registration\n && contribution.registration.command?.kind === 'command';\n}\n\nfunction snapshotEditorCommandRegistration<TInput, TOutput>(\n registration: FpsEditorCommandRegistration<TInput, TOutput>,\n): FpsEditorCommandRegistration<TInput, TOutput> {\n if (registration.command?.kind !== 'command') throw new Error('Editor command registration requires a command token.');\n const title = registration.title?.trim();\n if (!title) throw new Error(`Editor command title is required: ${registration.command.id}`);\n const description = registration.description?.trim();\n const agent = registration.agent\n ? snapshotEditorAgentCapability(registration.command.id, registration.agent)\n : undefined;\n return Object.freeze({\n command: registration.command,\n title,\n ...(description ? { description } : {}),\n ...(agent ? { agent } : {}),\n });\n}\n\nfunction snapshotEditorLifecycleParticipant(\n value: unknown,\n): Readonly<FpsEditorLifecycleParticipant> {\n if (!value || typeof value !== 'object' || Array.isArray(value)) {\n throw new Error('Editor lifecycle participant must be an object.');\n }\n const participant = value as Partial<FpsEditorLifecycleParticipant>;\n const id = assertContributionId(participant.id ?? '');\n if (!Array.isArray(participant.transitions) || participant.transitions.length === 0) {\n throw new Error(`Editor lifecycle participant transitions are required: ${id}`);\n }\n const allowed = new Set<string>(FPS_EDITOR_LIFECYCLE_TRANSITION_TYPES);\n const transitions = participant.transitions.map(transition => {\n if (typeof transition !== 'string' || !allowed.has(transition)) {\n throw new Error(`Editor lifecycle participant transition is invalid: ${id} -> ${String(transition)}`);\n }\n return transition;\n }) as FpsEditorLifecycleParticipant['transitions'];\n for (const method of ['prepare', 'settled', 'failed'] as const) {\n if (participant[method] !== undefined && typeof participant[method] !== 'function') {\n throw new Error(`Editor lifecycle participant ${method} must be a function: ${id}`);\n }\n }\n return Object.freeze({\n id,\n transitions: Object.freeze([...new Set(transitions)]),\n ...(participant.prepare ? { prepare: participant.prepare } : {}),\n ...(participant.settled ? { settled: participant.settled } : {}),\n ...(participant.failed ? { failed: participant.failed } : {}),\n });\n}\n\nfunction snapshotEditorAgentCapability(\n commandId: string,\n manifest: EditorAgentBridgeCapabilityManifest,\n): EditorAgentBridgeCapabilityManifest {\n if (manifest.schemaVersion !== EDITOR_AGENT_BRIDGE_SCHEMA_VERSION) {\n throw new Error(`Editor command Agent capability schema mismatch: ${commandId}`);\n }\n if (manifest.id !== commandId) {\n throw new Error(`Editor command and Agent capability ids must match: ${commandId} != ${manifest.id}`);\n }\n if (!manifest.title?.trim()) throw new Error(`Editor command Agent capability title is required: ${commandId}`);\n if (manifest.access !== 'read' && manifest.access !== 'write') {\n throw new Error(`Editor command Agent capability access is invalid: ${commandId}`);\n }\n return Object.freeze({\n ...manifest,\n title: manifest.title.trim(),\n ...(manifest.description?.trim() ? { description: manifest.description.trim() } : {}),\n ...(manifest.inputSchema ? { inputSchema: cloneEditorJsonObject(manifest.inputSchema) } : {}),\n ...(manifest.outputSchema ? { outputSchema: cloneEditorJsonObject(manifest.outputSchema) } : {}),\n });\n}\n\nfunction cloneEditorJsonObject(value: EditorAgentBridgeJsonObject): EditorAgentBridgeJsonObject {\n return cloneEditorJsonValue(value, '$') as EditorAgentBridgeJsonObject;\n}\n\nfunction cloneEditorJsonValue(value: unknown, path: string): unknown {\n if (value === null || typeof value === 'string' || typeof value === 'boolean') return value;\n if (typeof value === 'number' && Number.isFinite(value)) return value;\n if (Array.isArray(value)) {\n return Object.freeze(value.map((entry, index) => cloneEditorJsonValue(entry, `${path}[${index}]`)));\n }\n if (!value || typeof value !== 'object') throw new Error(`Editor Agent schema contains invalid value at ${path}`);\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) {\n throw new Error(`Editor Agent schema must contain plain objects at ${path}`);\n }\n const result: Record<string, unknown> = {};\n for (const key of Object.keys(value)) {\n result[key] = cloneEditorJsonValue((value as Record<string, unknown>)[key], `${path}.${key}`);\n }\n return Object.freeze(result);\n}\n\nfunction assertNoEditorPluginHostConsumers(consumers: ReadonlyMap<number, string>, operation: string): void {\n if (consumers.size === 0) return;\n throw new Error(\n `Cannot ${operation} Editor Plugin Host with active consumers: ${[...consumers.values()].join(', ')}`,\n );\n}\n\nfunction bindEditorPluginEntry(\n entry: FpsPluginEntry,\n registry: FpsEditorContributionRegistry,\n): FpsPluginEntry {\n return {\n pluginId: entry.pluginId,\n environment: entry.environment,\n async register(context) {\n const trusted = {\n registry,\n pluginId: context.pluginId,\n registrationOpen: true,\n addDisposer: context.add.bind(context),\n };\n trustedContributionContexts.set(context, trusted);\n try {\n return await entry.register(context);\n } finally {\n trusted.registrationOpen = false;\n }\n },\n ...(entry.start ? { start: (context: FpsPluginContext) => entry.start!(context) } : {}),\n ...(entry.stop ? { stop: (context: FpsPluginContext) => entry.stop!(context) } : {}),\n dispose: async context => {\n try { await entry.dispose?.(context); }\n finally { trustedContributionContexts.delete(context); }\n },\n };\n}\n\nfunction assertContributionId(id: string): string {\n const normalized = id.trim();\n if (!/^[a-z0-9]+(?:[._-][a-z0-9]+)+$/.test(normalized)) {\n throw new Error(`Editor contribution id must be namespaced lowercase, got: ${id}`);\n }\n return normalized;\n}\n\nfunction normalizePriority(priority: number | undefined): number {\n if (priority === undefined) return 0;\n if (!Number.isFinite(priority)) throw new Error('Editor contribution priority must be finite.');\n return priority;\n}\n\nfunction assertContributionKind(value: unknown): FpsEditorContributionKind {\n if (typeof value !== 'string' || !CONTRIBUTION_KINDS.has(value as FpsEditorContributionKind)) {\n throw new Error(`Unknown editor contribution kind: ${String(value)}`);\n }\n return value as FpsEditorContributionKind;\n}\n\nfunction compareContributions(\n left: FpsRegisteredEditorContribution,\n right: FpsRegisteredEditorContribution,\n): number {\n const priority = (right.priority ?? 0) - (left.priority ?? 0);\n if (priority !== 0) return priority;\n return left.id < right.id ? -1 : left.id > right.id ? 1 : 0;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === 'object' && !Array.isArray(value);\n}\n\nfunction resolveFpsEditorToolContribution(\n contribution: FpsRegisteredEditorContribution,\n): EditorToolRegistration {\n const value = contribution.value;\n if (!isRecord(value) || value.type !== 'editor.tool' || !('registration' in value)) {\n throw new Error(`Invalid Editor Tool contribution: ${contribution.id}`);\n }\n const registration = snapshotEditorToolRegistration(value.registration as EditorToolRegistration);\n if (registration.definition.id !== contribution.id) {\n throw new Error(\n `Editor Tool contribution id mismatch: ${contribution.id} != ${registration.definition.id}`,\n );\n }\n return registration;\n}\n"]}
1
+ {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I,KAAK,CAAC,EAAE,CAAC;QACnF,MAAM,IAAI,KAAK,CAAC,qCAAqC,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC;IAC1E,CAAC;IACD,MAAM,YAAY,GAAG,8BAA8B,CAAC,KAAK,CAAC,YAAsC,CAAC,CAAC;IAClG,IAAI,YAAY,CAAC,UAAU,CAAC,EAAE,KAAK,YAAY,CAAC,EAAE,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CACb,yCAAyC,YAAY,CAAC,EAAE,OAAO,YAAY,CAAC,UAAU,CAAC,EAAE,EAAE,CAC5F,CAAC;IACJ,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["import {\n type FpsCommand,\n defineFpsServiceToken,\n defineFpsPluginEntry,\n resolveFpsPluginEnvironmentScopes,\n type FpsDiagnostic,\n type FpsDisposer,\n type FpsEventRegistry,\n type FpsPluginEntry,\n type FpsPluginEnvironmentModule,\n type FpsPluginContext,\n type FpsPluginManifest,\n type FpsPluginScope,\n type FpsServiceToken,\n} from '@fps-games/plugin-api';\nimport {\n createFpsPluginHost,\n type FpsPluginHost,\n type FpsPluginHostInspection,\n type FpsPluginTeardownReservation,\n} from '@fps-games/plugin-host';\nimport type { EditorCommandManifest } from '@fps-games/editor-protocol';\nimport {\n FPS_EDITOR_DIAGNOSTIC_REPORTED,\n createFpsEditorEventPublisher,\n type FpsEditorEventContext,\n type FpsEditorEventPublisher,\n} from './events.js';\nimport {\n FPS_EDITOR_LIFECYCLE_TRANSITION_TYPES,\n assertFpsEditorLifecycleScopeTopology,\n type FpsEditorLifecycleParticipant,\n} from './lifecycle.js';\nimport {\n snapshotEditorToolRegistration,\n type EditorToolRegistry,\n type EditorToolRegistration,\n} from './editor-tools.js';\nimport { snapshotEditorCommandManifest } from './editor-command-system.js';\nimport type {\n EditorAuthoringHost,\n EditorAuthoringHostCommandContext,\n} from './editor-authoring-host.js';\n\nexport type FpsEditorContributionKind =\n | 'hierarchy'\n | 'inspector'\n | 'panel'\n | 'command'\n | 'capability'\n | 'tool'\n | 'lifecycle-participant';\n\nconst UNAVAILABLE_EDITOR_EVENT_ROUTE: FpsEventRegistry = Object.freeze({\n subscribe: () => () => {},\n publish: () => Promise.resolve(),\n});\n\nexport interface FpsEditorContribution<TValue = unknown> {\n readonly id: string;\n readonly kind: FpsEditorContributionKind;\n readonly value: TValue;\n readonly priority?: number;\n}\n\nexport interface FpsRegisteredEditorContribution<TValue = unknown>\n extends FpsEditorContribution<TValue> {\n readonly pluginId: string;\n}\n\nexport interface FpsEditorContributionRegistry {\n get(id: string): FpsRegisteredEditorContribution | undefined;\n list(kind?: FpsEditorContributionKind): readonly FpsRegisteredEditorContribution[];\n subscribe(listener: (registry: FpsEditorContributionRegistry) => void): FpsDisposer;\n}\n\ntype FpsEditorContributionRegistrar = <TValue>(\n pluginId: string,\n contribution: FpsEditorContribution<TValue>,\n) => FpsDisposer;\n\nconst contributionRegistrars = new WeakMap<FpsEditorContributionRegistry, FpsEditorContributionRegistrar>();\nconst trustedContributionContexts = new WeakMap<\n FpsPluginContext,\n {\n registry: FpsEditorContributionRegistry;\n pluginId: string;\n registrationOpen: boolean;\n addDisposer: (disposer: FpsDisposer) => void;\n }\n>();\nconst CONTRIBUTION_KINDS = new Set<FpsEditorContributionKind>([\n 'hierarchy', 'inspector', 'panel', 'command', 'capability', 'tool', 'lifecycle-participant',\n]);\n\nexport const FPS_EDITOR_CONTRIBUTIONS = defineFpsServiceToken<FpsEditorContributionRegistry>(\n 'fps.editor.contributions',\n);\n\nexport interface FpsEditorPluginHostOptions {\n readonly manifests: readonly FpsPluginManifest[];\n readonly loadEntry: (\n manifest: FpsPluginManifest,\n environment: 'editor',\n ) => Promise<FpsPluginEntry | null>;\n readonly initialServices?: readonly { token: FpsServiceToken<unknown>; value: unknown }[];\n readonly pluginConfigs?: Readonly<Record<string, unknown>>;\n readonly report?: Parameters<typeof createFpsPluginHost>[0]['report'];\n}\n\nexport interface FpsEditorPluginHost {\n readonly state: FpsPluginHost['state'];\n readonly transitioning: boolean;\n readonly contributions: FpsEditorContributionRegistry;\n readonly eventPublisher: FpsEditorEventPublisher;\n reportDiagnostic(diagnostic: FpsDiagnostic, context?: FpsEditorEventContext): void;\n inspect(): FpsPluginHostInspection;\n acquireConsumer(label?: string): () => void;\n mountCommands<TDocument, TPatch>(\n authoringHost: EditorAuthoringHost<TDocument, TPatch>,\n ): () => void;\n start(): Promise<void>;\n stop(): Promise<void>;\n dispose(): Promise<void>;\n}\n\nexport interface FpsEditorPluginLifecycleScopeInput {\n readonly id: string;\n readonly scope: FpsPluginScope;\n readonly parentId?: string;\n}\n\nexport interface FpsEditorPluginLifecycleScopeHost {\n openScope(input: FpsEditorPluginLifecycleScopeInput): Promise<void>;\n reserveScopeClose(scopeId: string): void;\n closeScope(scopeId: string): Promise<void>;\n}\n\ninterface FpsEditorPluginLifecycleScopeRecord {\n readonly input: FpsEditorPluginLifecycleScopeInput;\n readonly owner: object;\n host: FpsPluginHost | null;\n ready: Promise<void>;\n closing: Promise<void> | null;\n closeRequested: boolean;\n releaseTeardownReservation: FpsPluginTeardownReservation | null;\n}\n\nconst lifecycleScopeHostFactories = new WeakMap<\n FpsEditorPluginHost,\n () => FpsEditorPluginLifecycleScopeHost\n>();\n\nfunction createEditorPluginCleanupError(message: string, errors: readonly unknown[]): Error {\n const details = errors.map(error => error instanceof Error ? error.message : String(error)).join('; ');\n const combined = new Error(`${message}: ${details}`) as Error & { errors: unknown[] };\n combined.errors = [...errors];\n return combined;\n}\n\nexport function getFpsEditorPluginLifecycleScopeHost(\n host: FpsEditorPluginHost,\n): FpsEditorPluginLifecycleScopeHost {\n const createScopeHost = lifecycleScopeHostFactories.get(host);\n if (!createScopeHost) throw new Error('Editor Plugin lifecycle scope host is unavailable.');\n return createScopeHost();\n}\n\nexport interface FpsEditorCommandRegistration<TInput = unknown, TOutput = unknown> {\n readonly command: FpsCommand<TInput, TOutput>;\n readonly manifest: EditorCommandManifest;\n}\n\ninterface FpsEditorCommandContribution<TInput = unknown, TOutput = unknown> {\n readonly type: 'editor.command';\n readonly registration: FpsEditorCommandRegistration<TInput, TOutput>;\n}\n\nconst editorCommandHandlers = new WeakMap<object, FpsEditorCommandHandler>();\n\nexport type FpsEditorCommandHandler<TInput = unknown, TOutput = unknown> = (\n input: TInput,\n context: EditorAuthoringHostCommandContext<unknown, unknown>,\n) => TOutput | Promise<TOutput>;\n\nexport function registerFpsEditorCommand<TInput, TOutput>(\n context: FpsPluginContext,\n registration: FpsEditorCommandRegistration<TInput, TOutput>,\n handler: FpsEditorCommandHandler<TInput, TOutput>,\n): void {\n requireTrustedContributionContext(context);\n assertApplicationContributionScope(context);\n const snapshot = snapshotEditorCommandRegistration(registration);\n if (typeof handler !== 'function') throw new Error(`Editor command handler is required: ${snapshot.command.id}`);\n const contribution = Object.freeze({\n type: 'editor.command' as const,\n registration: snapshot,\n }) satisfies FpsEditorCommandContribution<TInput, TOutput>;\n editorCommandHandlers.set(contribution, handler as FpsEditorCommandHandler);\n registerFpsEditorContribution(context, {\n id: snapshot.command.id,\n kind: 'command',\n value: contribution,\n });\n}\n\nexport function registerFpsEditorLifecycleParticipant(\n context: FpsPluginContext,\n participant: FpsEditorLifecycleParticipant,\n): FpsDisposer {\n const snapshot = snapshotEditorLifecycleParticipant(participant);\n return registerFpsEditorContribution(context, {\n id: snapshot.id,\n kind: 'lifecycle-participant',\n value: snapshot,\n });\n}\n\ninterface FpsEditorToolContribution {\n readonly type: 'editor.tool';\n readonly registration: EditorToolRegistration;\n}\n\nexport function registerFpsEditorTool(\n context: FpsPluginContext,\n registration: EditorToolRegistration,\n priority = 0,\n): FpsDisposer {\n const snapshot = snapshotEditorToolRegistration(registration);\n return registerFpsEditorContribution(context, {\n id: snapshot.definition.id,\n kind: 'tool',\n priority,\n value: Object.freeze({\n type: 'editor.tool',\n registration: snapshot,\n } satisfies FpsEditorToolContribution),\n });\n}\n\nexport function resolveFpsEditorTools(\n registry: FpsEditorContributionRegistry,\n): readonly EditorToolRegistration[] {\n return Object.freeze(registry.list('tool').map(contribution => {\n const value = contribution.value;\n if (!isRecord(value) || value.type !== 'editor.tool' || !('registration' in value)) {\n throw new Error(`Invalid Editor Tool contribution: ${contribution.id}`);\n }\n const registration = snapshotEditorToolRegistration(value.registration as EditorToolRegistration);\n if (registration.definition.id !== contribution.id) {\n throw new Error(\n `Editor Tool contribution id mismatch: ${contribution.id} != ${registration.definition.id}`,\n );\n }\n return registration;\n }));\n}\n\nexport function bindFpsEditorTools(\n contributions: FpsEditorContributionRegistry,\n tools: EditorToolRegistry,\n): FpsDisposer {\n const active = new Map<string, {\n contribution: FpsRegisteredEditorContribution;\n unregister: FpsDisposer;\n }>();\n const sync = (source: FpsEditorContributionRegistry): void => {\n const next = new Map(source.list('tool').map(contribution => [contribution.id, contribution]));\n for (const [id, binding] of [...active]) {\n if (next.get(id) === binding.contribution) continue;\n binding.unregister();\n active.delete(id);\n }\n for (const contribution of next.values()) {\n if (active.has(contribution.id)) continue;\n const registration = resolveFpsEditorToolContribution(contribution);\n active.set(contribution.id, {\n contribution,\n unregister: tools.register(registration),\n });\n }\n };\n sync(contributions);\n const unsubscribe = contributions.subscribe(sync);\n return () => {\n unsubscribe();\n for (const binding of [...active.values()].reverse()) binding.unregister();\n active.clear();\n };\n}\n\nexport function resolveFpsEditorLifecycleParticipants(\n registry: FpsEditorContributionRegistry,\n): readonly FpsEditorLifecycleParticipant[] {\n return registry.list('lifecycle-participant').map(contribution => {\n const participant = snapshotEditorLifecycleParticipant(contribution.value);\n if (participant.id !== contribution.id) {\n throw new Error(\n `Editor lifecycle participant contribution id mismatch: ${contribution.id} != ${participant.id}`,\n );\n }\n return participant;\n });\n}\n\nexport function createFpsEditorContributionRegistry(): FpsEditorContributionRegistry {\n const entries = new Map<string, FpsRegisteredEditorContribution>();\n const listeners = new Set<(registry: FpsEditorContributionRegistry) => void>();\n const publish = (): void => {\n for (const listener of [...listeners]) listener(registry);\n };\n const registry: FpsEditorContributionRegistry = {\n get: id => entries.get(id),\n list: kind => {\n if (kind !== undefined) assertContributionKind(kind);\n return [...entries.values()]\n .filter(entry => kind === undefined || entry.kind === kind)\n .sort(compareContributions);\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => { listeners.delete(listener); };\n },\n };\n contributionRegistrars.set(registry, (pluginId, contribution) => {\n const id = assertContributionId(contribution.id);\n const kind = assertContributionKind(contribution.kind);\n if (entries.has(id)) throw new Error(`Duplicate editor contribution id: ${id}`);\n const entry = Object.freeze({\n ...contribution,\n id,\n kind,\n pluginId,\n priority: normalizePriority(contribution.priority),\n });\n entries.set(id, entry);\n publish();\n let active = true;\n return () => {\n if (!active) return;\n active = false;\n if (entries.get(id) === entry) {\n entries.delete(id);\n publish();\n }\n };\n });\n return registry;\n}\n\nexport function registerFpsEditorContribution<TValue>(\n context: FpsPluginContext,\n contribution: FpsEditorContribution<TValue>,\n): FpsDisposer {\n const trusted = requireTrustedContributionContext(context);\n assertApplicationContributionScope(context);\n const declaredRegistry = context.services.get(FPS_EDITOR_CONTRIBUTIONS);\n if (declaredRegistry !== trusted.registry) {\n throw new Error('Editor contribution service does not belong to this Plugin Host.');\n }\n const register = contributionRegistrars.get(trusted.registry);\n if (!register) throw new Error('Editor contribution registry is not owned by this host.');\n if (contribution.kind === 'lifecycle-participant') {\n snapshotEditorLifecycleParticipant(contribution.value);\n }\n if (contribution.kind === 'tool') {\n resolveFpsEditorToolContribution(Object.freeze({\n ...contribution,\n pluginId: trusted.pluginId,\n priority: normalizePriority(contribution.priority),\n }));\n }\n const unregister = register(trusted.pluginId, contribution);\n trusted.addDisposer(unregister);\n let active = true;\n return () => {\n if (!active || !trusted.registrationOpen) return;\n active = false;\n return unregister();\n };\n}\n\nexport function createFpsEditorPluginHost(options: FpsEditorPluginHostOptions): FpsEditorPluginHost {\n const contributions = createFpsEditorContributionRegistry();\n const consumers = new Map<number, string>();\n let nextConsumerId = 1;\n let lifecycleTransitioning = false;\n let activeLifecycleScopeTransitions = 0;\n let lifecycleCleanupFailed = false;\n let cleanupRetryKind: 'stop' | 'dispose' | null = null;\n const lifecycleScopes = new Map<string, FpsEditorPluginLifecycleScopeRecord>();\n const failedLifecycleScopeIds = new Set<string>();\n const editorDiagnostics: FpsDiagnostic[] = [];\n let eventPublisher: FpsEditorEventPublisher | undefined;\n const reportEditorDiagnostic = (\n diagnostic: FpsDiagnostic,\n publishEvent: boolean,\n context: FpsEditorEventContext = { scope: 'application', scopeId: 'editor:application' },\n ): void => {\n editorDiagnostics.push(Object.freeze({\n code: diagnostic.code,\n message: diagnostic.message,\n severity: diagnostic.severity,\n ...(diagnostic.pluginId ? { pluginId: diagnostic.pluginId } : {}),\n }));\n if (editorDiagnostics.length > 200) editorDiagnostics.shift();\n try { options.report?.(diagnostic); }\n catch { /* Diagnostic observers cannot affect Plugin or Editor lifecycle state. */ }\n if (!publishEvent || !eventPublisher\n || diagnostic.details?.eventId === FPS_EDITOR_DIAGNOSTIC_REPORTED.id) return;\n void eventPublisher.publish(FPS_EDITOR_DIAGNOSTIC_REPORTED, Object.freeze({\n diagnostic: Object.freeze({\n code: diagnostic.code,\n message: diagnostic.message,\n severity: diagnostic.severity,\n ...(diagnostic.pluginId ? { pluginId: diagnostic.pluginId } : {}),\n }),\n }), {\n ...context,\n ...(context.sourcePluginId || !diagnostic.pluginId ? {} : { sourcePluginId: diagnostic.pluginId }),\n });\n };\n const hasLifecycleCleanupFailure = (): boolean => (\n lifecycleCleanupFailed || failedLifecycleScopeIds.size > 0\n );\n const applicationManifests = options.manifests.filter(manifest => (\n resolveFpsPluginEnvironmentScopes(manifest, 'editor').includes('application')\n ));\n const host = createFpsPluginHost({\n environment: 'editor',\n apiVersion: 1,\n scope: 'application',\n manifests: applicationManifests,\n initialServices: [\n { token: FPS_EDITOR_CONTRIBUTIONS as FpsServiceToken<unknown>, value: contributions },\n ...(options.initialServices ?? []),\n ],\n pluginConfigs: options.pluginConfigs,\n loadEntry: async (manifest, environment) => {\n const entry = await options.loadEntry(manifest, environment as 'editor');\n return entry ? bindEditorPluginEntry(defineFpsPluginEntry(entry), contributions) : null;\n },\n report: diagnostic => reportEditorDiagnostic(diagnostic, true),\n });\n eventPublisher = createFpsEditorEventPublisher({\n events: host.events,\n captureRoute(context) {\n const route: FpsEditorPluginLifecycleScopeRecord[] = [];\n let record = lifecycleScopes.get(context.scopeId);\n while (record) {\n route.push(record);\n record = record.input.parentId ? lifecycleScopes.get(record.input.parentId) : undefined;\n }\n return () => {\n for (const candidate of route) {\n if (lifecycleScopes.get(candidate.input.id) !== candidate\n || candidate.closeRequested\n || candidate.closing) continue;\n const routeHost = candidate.host ?? host;\n if (routeHost.state !== 'started' || routeHost.transitioning) continue;\n return routeHost.events;\n }\n // Scope-close facts are delivered asynchronously. A parent teardown can\n // reserve the complete host tree before an earlier child-close fact\n // reaches this resolver. In that interval public event operations are\n // intentionally unavailable, and every observer on that route is also\n // being torn down. Treat the route as closed instead of reporting an\n // observer failure for a lifecycle state that is working as designed.\n return host.state === 'started' && !host.transitioning\n ? host.events\n : UNAVAILABLE_EDITOR_EVENT_ROUTE;\n };\n },\n report: diagnostic => reportEditorDiagnostic(diagnostic, false),\n });\n const isLifecycleTransitioning = (): boolean => (\n lifecycleTransitioning || activeLifecycleScopeTransitions > 0 || host.transitioning\n );\n const assertStableObservation = (): void => {\n if (hasLifecycleCleanupFailure()) {\n throw new Error('Editor Plugin Host cleanup is incomplete; only cleanup retry operations are available.');\n }\n if (isLifecycleTransitioning()) {\n throw new Error('Editor Plugin Host observation is unavailable during a lifecycle transition.');\n }\n };\n const publicContributions: FpsEditorContributionRegistry = Object.freeze({\n get(id: string) {\n assertStableObservation();\n return contributions.get(id);\n },\n list(kind?: FpsEditorContributionKind) {\n assertStableObservation();\n return contributions.list(kind);\n },\n subscribe(listener: (registry: FpsEditorContributionRegistry) => void) {\n assertStableObservation();\n return contributions.subscribe(listener);\n },\n });\n const runLifecycleScopeTransition = async <T>(operation: () => Promise<T>): Promise<T> => {\n activeLifecycleScopeTransitions += 1;\n try { return await operation(); }\n finally { activeLifecycleScopeTransitions -= 1; }\n };\n const acquireConsumer = (label = 'anonymous'): (() => void) => {\n const transitioning = isLifecycleTransitioning();\n if (host.state !== 'started' || transitioning || hasLifecycleCleanupFailure()) {\n throw new Error(\n `Editor Plugin Host consumers require an idle started host, got: ${hasLifecycleCleanupFailure() ? 'cleanup-failed' : host.state}${transitioning ? ' (transitioning)' : ''}`,\n );\n }\n const id = nextConsumerId++;\n consumers.set(id, label);\n let active = true;\n return () => {\n if (!active) return;\n active = false;\n consumers.delete(id);\n };\n };\n const openLifecycleScope = async (\n owner: object,\n input: FpsEditorPluginLifecycleScopeInput,\n ): Promise<void> => {\n const existing = lifecycleScopes.get(input.id);\n if (existing) {\n if (existing.input.scope !== input.scope || existing.input.parentId !== input.parentId) {\n throw new Error(`Editor Plugin lifecycle scope identity conflicts with the existing scope: ${input.id}`);\n }\n if (existing.owner !== owner) {\n throw new Error(`Editor Plugin lifecycle scope is owned by another controller: ${input.id}`);\n }\n if (failedLifecycleScopeIds.has(input.id)) {\n throw new Error(`Editor Plugin lifecycle scope cleanup is incomplete; close must be retried: ${input.id}`);\n }\n if (existing.closing) throw new Error(`Editor Plugin lifecycle scope is closing: ${input.id}`);\n return existing.ready;\n }\n const transitioning = lifecycleTransitioning || host.transitioning;\n if (host.state !== 'started' || transitioning || hasLifecycleCleanupFailure()) {\n throw new Error(\n `Editor Plugin lifecycle scopes require an idle started host, got: ${hasLifecycleCleanupFailure() ? 'cleanup-failed' : host.state}${transitioning ? ' (transitioning)' : ''}`,\n );\n }\n assertFpsEditorLifecycleScopeTopology(input, [...lifecycleScopes.values()].map(record => ({\n id: record.input.id,\n scope: record.input.scope,\n state: record.closing ? 'failed' as const : 'open' as const,\n })));\n if (input.scope === 'application') {\n lifecycleScopes.set(input.id, {\n input: Object.freeze({ ...input }),\n owner,\n host: null,\n ready: Promise.resolve(),\n closing: null,\n closeRequested: false,\n releaseTeardownReservation: null,\n });\n return;\n }\n const parent = lifecycleScopes.get(input.parentId!);\n if (!parent || parent.closing) {\n throw new Error(`Editor Plugin lifecycle parent scope is not open: ${input.parentId}`);\n }\n if (parent.owner !== owner) {\n throw new Error(`Editor Plugin lifecycle parent scope is owned by another controller: ${input.parentId}`);\n }\n const childScope: Exclude<FpsPluginScope, 'application'> = input.scope;\n const scopedManifests = options.manifests.filter(manifest => (\n resolveFpsPluginEnvironmentScopes(manifest, 'editor').includes(childScope)\n ));\n const record: FpsEditorPluginLifecycleScopeRecord = {\n input: Object.freeze({ ...input }),\n owner,\n host: null,\n ready: Promise.resolve(),\n closing: null,\n closeRequested: false,\n releaseTeardownReservation: null,\n };\n lifecycleScopes.set(input.id, record);\n record.ready = parent.ready.then(async () => {\n const child = (parent.host ?? host).createScope({ scope: childScope, manifests: scopedManifests });\n record.host = child;\n if (record.closeRequested) {\n record.releaseTeardownReservation = child.reserveTeardown();\n return;\n }\n await child.start();\n }).catch(async error => {\n let cleanupError: unknown;\n try { await record.host?.dispose(); } catch (caught) { cleanupError = caught; }\n if (!record.host || record.host.state === 'disposed') {\n if (lifecycleScopes.get(input.id) === record) lifecycleScopes.delete(input.id);\n }\n if (cleanupError) {\n failedLifecycleScopeIds.add(input.id);\n cleanupRetryKind = 'dispose';\n const combined = new Error('Editor Plugin lifecycle scope start and cleanup failed.') as Error & { errors: unknown[] };\n combined.errors = [error, cleanupError];\n throw combined;\n }\n throw error;\n });\n await record.ready;\n };\n const reserveLifecycleScopeClose = (scopeId: string, owner?: object): FpsEditorPluginLifecycleScopeRecord | null => {\n const record = lifecycleScopes.get(scopeId);\n if (!record) return null;\n if (owner && record.owner !== owner) {\n throw new Error(`Editor Plugin lifecycle scope is owned by another controller: ${scopeId}`);\n }\n record.closeRequested = true;\n record.releaseTeardownReservation ??= record.input.scope === 'application'\n ? host.reserveTeardown()\n : record.host?.reserveTeardown() ?? null;\n try {\n record.releaseTeardownReservation?.assertReady();\n } catch (error) {\n failedLifecycleScopeIds.add(scopeId);\n cleanupRetryKind = 'dispose';\n throw error;\n }\n return record;\n };\n const closeLifecycleScope = async (scopeId: string, owner?: object): Promise<void> => {\n const record = reserveLifecycleScopeClose(scopeId, owner);\n if (!record) return;\n if (record.closing) return record.closing;\n record.closing = (async () => {\n try {\n try { await record.ready; } catch { /* The open caller already received the start failure. */ }\n const children = [...lifecycleScopes.values()]\n .filter(candidate => candidate.input.parentId === scopeId)\n .reverse();\n const childErrors: unknown[] = [];\n for (const child of children) {\n try { await closeLifecycleScope(child.input.id, owner); }\n catch (error) {\n childErrors.push(error);\n break;\n }\n }\n if (childErrors.length > 0) {\n throw createEditorPluginCleanupError(\n `Editor Plugin lifecycle child scope cleanup failed: ${scopeId}`,\n childErrors,\n );\n }\n if (record.host?.state !== 'disposed') await record.host?.dispose();\n failedLifecycleScopeIds.delete(scopeId);\n lifecycleScopes.delete(scopeId);\n } catch (error) {\n const scopeCleanupFailed = record.host?.state === 'cleanup-failed'\n || [...lifecycleScopes.values()].some(candidate => (\n candidate.input.parentId === scopeId && failedLifecycleScopeIds.has(candidate.input.id)\n ));\n if (scopeCleanupFailed) {\n failedLifecycleScopeIds.add(scopeId);\n cleanupRetryKind ??= 'dispose';\n }\n throw error;\n } finally {\n if (lifecycleScopes.get(scopeId) === record) {\n record.closing = null;\n } else {\n record.releaseTeardownReservation?.();\n record.releaseTeardownReservation = null;\n }\n }\n })();\n return record.closing;\n };\n const closeLifecycleScopeRoots = async (): Promise<void> => {\n const roots = [...lifecycleScopes.values()]\n .filter(record => !record.input.parentId)\n .reverse();\n const errors: unknown[] = [];\n for (const root of roots) {\n try { await closeLifecycleScope(root.input.id); }\n catch (error) { errors.push(error); }\n }\n if (errors.length > 0) {\n throw createEditorPluginCleanupError('Editor Plugin lifecycle root scope cleanup failed', errors);\n }\n };\n const editorHost: FpsEditorPluginHost = {\n get state() { return hasLifecycleCleanupFailure() ? 'cleanup-failed' : host.state; },\n get transitioning() { return isLifecycleTransitioning(); },\n contributions: publicContributions,\n eventPublisher,\n reportDiagnostic(diagnostic, context = { scope: 'application', scopeId: 'editor:application' }) {\n reportEditorDiagnostic(diagnostic, true, context);\n },\n inspect: () => {\n const inspection = host.inspect();\n return Object.freeze({\n ...inspection,\n ...(hasLifecycleCleanupFailure() ? { state: 'cleanup-failed' as const } : {}),\n transitioning: isLifecycleTransitioning(),\n diagnostics: Object.freeze([...editorDiagnostics]),\n });\n },\n acquireConsumer,\n mountCommands(authoringHost) {\n assertStableObservation();\n const unregister: Array<() => void> = [];\n try {\n for (const contribution of resolveEditorCommandContributions(contributions)) {\n const { registration } = contribution;\n const handler = editorCommandHandlers.get(contribution);\n if (!handler) throw new Error(`Editor command handler is unavailable: ${registration.command.id}`);\n unregister.push(authoringHost.registerCommand({\n manifest: registration.manifest,\n available: () => host.state === 'started'\n && !isLifecycleTransitioning()\n && !hasLifecycleCleanupFailure(),\n handler: async (input, context) => {\n const release = acquireConsumer(`command:${registration.command.id}`);\n try {\n return {\n ok: true,\n output: await handler(\n input,\n context as EditorAuthoringHostCommandContext<unknown, unknown>,\n ),\n };\n } finally {\n release();\n }\n },\n }));\n }\n } catch (error) {\n for (const dispose of unregister.reverse()) dispose();\n throw error;\n }\n let active = true;\n return () => {\n if (!active) return;\n active = false;\n for (const dispose of unregister.reverse()) dispose();\n };\n },\n start: () => host.start(),\n stop: () => {\n assertNoEditorPluginHostConsumers(consumers, 'stop');\n if (lifecycleTransitioning) throw new Error('Editor Plugin Host lifecycle is already transitioning.');\n if (hasLifecycleCleanupFailure() && cleanupRetryKind === 'dispose') {\n throw new Error('Editor Plugin Host disposal cleanup is incomplete; dispose or the owning scope close must be retried.');\n }\n lifecycleTransitioning = true;\n cleanupRetryKind = 'stop';\n return (async () => {\n try {\n await closeLifecycleScopeRoots();\n await host.stop();\n lifecycleCleanupFailed = false;\n cleanupRetryKind = null;\n } catch (error) {\n lifecycleCleanupFailed = true;\n throw error;\n } finally {\n lifecycleTransitioning = false;\n }\n })();\n },\n dispose: () => {\n assertNoEditorPluginHostConsumers(consumers, 'dispose');\n if (lifecycleTransitioning) throw new Error('Editor Plugin Host lifecycle is already transitioning.');\n lifecycleTransitioning = true;\n cleanupRetryKind = 'dispose';\n return (async () => {\n try {\n await closeLifecycleScopeRoots();\n await host.dispose();\n lifecycleCleanupFailed = false;\n cleanupRetryKind = null;\n } catch (error) {\n lifecycleCleanupFailed = true;\n throw error;\n } finally {\n lifecycleTransitioning = false;\n }\n })();\n },\n };\n lifecycleScopeHostFactories.set(editorHost, () => {\n const owner = Object.freeze({});\n const scopeHost: FpsEditorPluginLifecycleScopeHost = {\n openScope: input => runLifecycleScopeTransition(() => openLifecycleScope(owner, input)),\n reserveScopeClose: scopeId => { reserveLifecycleScopeClose(scopeId, owner); },\n closeScope: scopeId => runLifecycleScopeTransition(async () => {\n await closeLifecycleScope(scopeId, owner);\n if (!hasLifecycleCleanupFailure() && !lifecycleTransitioning) cleanupRetryKind = null;\n }),\n };\n return Object.freeze(scopeHost);\n });\n return editorHost;\n}\n\nexport interface FpsEditorPluginEnvironmentModuleHostOptions {\n readonly module: FpsPluginEnvironmentModule;\n readonly initialServices?: readonly { token: FpsServiceToken<unknown>; value: unknown }[];\n readonly report?: FpsEditorPluginHostOptions['report'];\n}\n\nexport function createFpsEditorPluginHostFromEnvironmentModule(\n options: FpsEditorPluginEnvironmentModuleHostOptions,\n): FpsEditorPluginHost {\n if (options.module.environment !== 'editor') {\n throw new Error(`Editor Plugin Host requires an editor environment module, got: ${options.module.environment}`);\n }\n const entries = new Map<string, FpsPluginEnvironmentModule['entries'][number]>();\n for (const entry of options.module.entries) {\n if (entries.has(entry.pluginId)) throw new Error(`Duplicate Editor Plugin module entry: ${entry.pluginId}`);\n entries.set(entry.pluginId, entry);\n }\n return createFpsEditorPluginHost({\n manifests: options.module.manifests,\n pluginConfigs: options.module.pluginConfigs,\n initialServices: options.initialServices,\n report: options.report,\n async loadEntry(manifest) {\n const entry = entries.get(manifest.id);\n if (!entry) throw new Error(`Editor Plugin module entry is missing: ${manifest.id}`);\n return entry.load();\n },\n });\n}\n\nfunction requireTrustedContributionContext(\n context: FpsPluginContext,\n): NonNullable<ReturnType<typeof trustedContributionContexts.get>> {\n const trusted = trustedContributionContexts.get(context);\n if (!trusted) throw new Error('Editor contribution registration requires a host-authenticated Plugin context.');\n if (!trusted.registrationOpen) {\n throw new Error('Editor contributions may only be registered during the Plugin register lifecycle.');\n }\n return trusted;\n}\n\nfunction assertApplicationContributionScope(context: FpsPluginContext): void {\n if (context.scope !== 'application') {\n throw new Error(\n `Editor contributions are application-scope extension definitions; ${context.scope} scopes may own resources but cannot register global contributions.`,\n );\n }\n}\n\nfunction resolveEditorCommandContributions(\n registry: FpsEditorContributionRegistry,\n): readonly FpsEditorCommandContribution[] {\n return registry.list('command').map(contribution => {\n const value = contribution.value;\n if (!isEditorCommandContribution(value) || value.registration.command.id !== contribution.id) {\n throw new Error(`Invalid Editor command contribution: ${contribution.id}`);\n }\n return value;\n });\n}\n\nfunction isEditorCommandContribution(value: unknown): value is FpsEditorCommandContribution {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return false;\n const contribution = value as Partial<FpsEditorCommandContribution>;\n return contribution.type === 'editor.command'\n && !!contribution.registration\n && contribution.registration.command?.kind === 'command';\n}\n\nfunction snapshotEditorCommandRegistration<TInput, TOutput>(\n registration: FpsEditorCommandRegistration<TInput, TOutput>,\n): FpsEditorCommandRegistration<TInput, TOutput> {\n if (registration.command?.kind !== 'command') throw new Error('Editor command registration requires a command token.');\n const manifest = snapshotEditorCommandManifest(registration.manifest);\n if (manifest.id !== registration.command.id) {\n throw new Error(`Editor command token and manifest ids must match: ${registration.command.id} != ${manifest.id}`);\n }\n return Object.freeze({\n command: registration.command,\n manifest,\n });\n}\n\nfunction snapshotEditorLifecycleParticipant(\n value: unknown,\n): Readonly<FpsEditorLifecycleParticipant> {\n if (!value || typeof value !== 'object' || Array.isArray(value)) {\n throw new Error('Editor lifecycle participant must be an object.');\n }\n const participant = value as Partial<FpsEditorLifecycleParticipant>;\n const id = assertContributionId(participant.id ?? '');\n if (!Array.isArray(participant.transitions) || participant.transitions.length === 0) {\n throw new Error(`Editor lifecycle participant transitions are required: ${id}`);\n }\n const allowed = new Set<string>(FPS_EDITOR_LIFECYCLE_TRANSITION_TYPES);\n const transitions = participant.transitions.map(transition => {\n if (typeof transition !== 'string' || !allowed.has(transition)) {\n throw new Error(`Editor lifecycle participant transition is invalid: ${id} -> ${String(transition)}`);\n }\n return transition;\n }) as FpsEditorLifecycleParticipant['transitions'];\n for (const method of ['prepare', 'settled', 'failed'] as const) {\n if (participant[method] !== undefined && typeof participant[method] !== 'function') {\n throw new Error(`Editor lifecycle participant ${method} must be a function: ${id}`);\n }\n }\n return Object.freeze({\n id,\n transitions: Object.freeze([...new Set(transitions)]),\n ...(participant.prepare ? { prepare: participant.prepare } : {}),\n ...(participant.settled ? { settled: participant.settled } : {}),\n ...(participant.failed ? { failed: participant.failed } : {}),\n });\n}\n\nfunction assertNoEditorPluginHostConsumers(consumers: ReadonlyMap<number, string>, operation: string): void {\n if (consumers.size === 0) return;\n throw new Error(\n `Cannot ${operation} Editor Plugin Host with active consumers: ${[...consumers.values()].join(', ')}`,\n );\n}\n\nfunction bindEditorPluginEntry(\n entry: FpsPluginEntry,\n registry: FpsEditorContributionRegistry,\n): FpsPluginEntry {\n return {\n pluginId: entry.pluginId,\n environment: entry.environment,\n async register(context) {\n const trusted = {\n registry,\n pluginId: context.pluginId,\n registrationOpen: true,\n addDisposer: context.add.bind(context),\n };\n trustedContributionContexts.set(context, trusted);\n try {\n return await entry.register(context);\n } finally {\n trusted.registrationOpen = false;\n }\n },\n ...(entry.start ? { start: (context: FpsPluginContext) => entry.start!(context) } : {}),\n ...(entry.stop ? { stop: (context: FpsPluginContext) => entry.stop!(context) } : {}),\n dispose: async context => {\n try { await entry.dispose?.(context); }\n finally { trustedContributionContexts.delete(context); }\n },\n };\n}\n\nfunction assertContributionId(id: string): string {\n const normalized = id.trim();\n if (!/^[a-z0-9]+(?:[._-][a-z0-9]+)+$/.test(normalized)) {\n throw new Error(`Editor contribution id must be namespaced lowercase, got: ${id}`);\n }\n return normalized;\n}\n\nfunction normalizePriority(priority: number | undefined): number {\n if (priority === undefined) return 0;\n if (!Number.isFinite(priority)) throw new Error('Editor contribution priority must be finite.');\n return priority;\n}\n\nfunction assertContributionKind(value: unknown): FpsEditorContributionKind {\n if (typeof value !== 'string' || !CONTRIBUTION_KINDS.has(value as FpsEditorContributionKind)) {\n throw new Error(`Unknown editor contribution kind: ${String(value)}`);\n }\n return value as FpsEditorContributionKind;\n}\n\nfunction compareContributions(\n left: FpsRegisteredEditorContribution,\n right: FpsRegisteredEditorContribution,\n): number {\n const priority = (right.priority ?? 0) - (left.priority ?? 0);\n if (priority !== 0) return priority;\n return left.id < right.id ? -1 : left.id > right.id ? 1 : 0;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === 'object' && !Array.isArray(value);\n}\n\nfunction resolveFpsEditorToolContribution(\n contribution: FpsRegisteredEditorContribution,\n): EditorToolRegistration {\n const value = contribution.value;\n if (!isRecord(value) || value.type !== 'editor.tool' || !('registration' in value)) {\n throw new Error(`Invalid Editor Tool contribution: ${contribution.id}`);\n }\n const registration = snapshotEditorToolRegistration(value.registration as EditorToolRegistration);\n if (registration.definition.id !== contribution.id) {\n throw new Error(\n `Editor Tool contribution id mismatch: ${contribution.id} != ${registration.definition.id}`,\n );\n }\n return registration;\n}\n"]}
@@ -0,0 +1,30 @@
1
+ import { type EditorServiceGatewayRequest, type EditorServiceGatewayResponse, type EditorServiceTokenScope, type EditorServiceDocumentExportArtifact, type EditorServiceTracePage } from '@fps-games/editor-protocol';
2
+ import type { EditorAuthoringHost } from './editor-authoring-host.js';
3
+ import type { EditorCommandHandlerContext, EditorCommandHandlerOutcome } from './editor-command-system.js';
4
+ export interface EditorServiceGatewayOptions<TDocument, TPatch> {
5
+ readonly canonicalProjectRoot: string;
6
+ readonly packageVersion: string;
7
+ readonly buildKey: string;
8
+ readonly startedAt: string;
9
+ readonly host: EditorAuthoringHost<TDocument, TPatch>;
10
+ readonly now?: () => number;
11
+ readonly maxCatalogPageSize?: number;
12
+ readonly maxTracePageSize?: number;
13
+ readonly maxBrowserAttachments?: number;
14
+ readonly browserAttachmentLeaseMs?: number;
15
+ readonly browserOperationTimeoutMs?: number;
16
+ readonly readTraces?: (input: {
17
+ traceId?: string;
18
+ cursor?: string;
19
+ limit: number;
20
+ }) => EditorServiceTracePage | Promise<EditorServiceTracePage>;
21
+ readonly readDocumentExport?: (transactionId: string) => EditorServiceDocumentExportArtifact | null | Promise<EditorServiceDocumentExportArtifact | null>;
22
+ }
23
+ export interface EditorServiceGateway {
24
+ readonly serviceInstanceId: string;
25
+ handle(request: EditorServiceGatewayRequest, tokenScopes?: readonly EditorServiceTokenScope[]): Promise<EditorServiceGatewayResponse>;
26
+ forwardBrowserCommand(context: EditorCommandHandlerContext, target: 'view' | 'renderer'): Promise<EditorCommandHandlerOutcome<unknown>>;
27
+ dispose(): void;
28
+ }
29
+ export declare function createEditorServiceGateway<TDocument, TPatch>(options: EditorServiceGatewayOptions<TDocument, TPatch>): EditorServiceGateway;
30
+ //# sourceMappingURL=editor-service-gateway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-service-gateway.d.ts","sourceRoot":"","sources":["../src/editor-service-gateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EAEjC,KAAK,uBAAuB,EAC5B,KAAK,mCAAmC,EACxC,KAAK,sBAAsB,EAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EACV,2BAA2B,EAC3B,2BAA2B,EAC5B,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,2BAA2B,CAAC,SAAS,EAAE,MAAM;IAC5D,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC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