@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
@@ -0,0 +1,592 @@
1
+ import { randomBytes, randomUUID, timingSafeEqual } from 'node:crypto';
2
+ import { readFileSync, unlinkSync } from 'node:fs';
3
+ import { chmod, mkdir, open, readFile, realpath, rename, unlink, } from 'node:fs/promises';
4
+ import path from 'node:path';
5
+ import { createEditorServiceGateway, } from '@fps-games/editor-core';
6
+ import { EDITOR_SERVICE_DESCRIPTOR_SCHEMA_VERSION, EDITOR_SERVICE_GATEWAY_PATH, EDITOR_SERVICE_PROTOCOL_VERSION, } from '@fps-games/editor-protocol';
7
+ import { createFpsGameEditorProjectServiceAuthority } from './project-editor-service.js';
8
+ export const PLAYABLE_EDITOR_AGENT_RUNTIME_RELATIVE_PATH = path.join('node_modules', '.fps-editor', 'agent-runtime.json');
9
+ const ACTIVE_PROJECT_SERVICE_ROOTS = new Map();
10
+ const PROCESS_TERMINATION_SIGNALS = ['SIGHUP', 'SIGINT', 'SIGTERM'];
11
+ const PROCESS_OWNED_FILE_CLEANUPS = new Set();
12
+ const PROCESS_SIGNAL_HANDLERS = new Map();
13
+ let processExitCleanupInstalled = false;
14
+ export async function installPlayableEditorViteEditorService(input) {
15
+ if (input.options?.enabled === false)
16
+ return null;
17
+ const canonicalProjectRoot = await realpath(input.integration.projectRoot);
18
+ const descriptorPath = path.resolve(canonicalProjectRoot, PLAYABLE_EDITOR_AGENT_RUNTIME_RELATIVE_PATH);
19
+ assertDescriptorInsideProject(canonicalProjectRoot, descriptorPath);
20
+ const serviceInstanceId = input.credentials?.serviceInstanceId ?? randomUUID();
21
+ const token = input.credentials?.token ?? randomBytes(32).toString('base64url');
22
+ const tokenScopes = normalizeTokenScopes(input.options?.tokenScopes);
23
+ const startedAt = new Date().toISOString();
24
+ const activeOwner = ACTIVE_PROJECT_SERVICE_ROOTS.get(canonicalProjectRoot);
25
+ if (activeOwner)
26
+ throw new Error(`A live Editor Service already owns this project: ${activeOwner}.`);
27
+ ACTIVE_PROJECT_SERVICE_ROOTS.set(canonicalProjectRoot, serviceInstanceId);
28
+ let projectRootClaimed = true;
29
+ const releaseProcessProjectRoot = () => {
30
+ if (!projectRootClaimed)
31
+ return;
32
+ projectRootClaimed = false;
33
+ if (ACTIVE_PROJECT_SERVICE_ROOTS.get(canonicalProjectRoot) === serviceInstanceId) {
34
+ ACTIVE_PROJECT_SERVICE_ROOTS.delete(canonicalProjectRoot);
35
+ }
36
+ };
37
+ const descriptorDirectory = path.dirname(descriptorPath);
38
+ let projectLeaseOwner;
39
+ const projectLeasePath = `${descriptorPath}.owner`;
40
+ try {
41
+ await mkdir(descriptorDirectory, { recursive: true, mode: 0o700 });
42
+ await chmod(descriptorDirectory, 0o700);
43
+ assertDescriptorInsideProject(canonicalProjectRoot, await realpath(descriptorDirectory));
44
+ projectLeaseOwner = await claimDescriptorLock(projectLeasePath);
45
+ }
46
+ catch (error) {
47
+ releaseProcessProjectRoot();
48
+ throw error;
49
+ }
50
+ let projectLeaseClaimed = true;
51
+ const cleanupOwnedFilesAtProcessExit = () => {
52
+ removeOwnedRuntimeDescriptorSync(descriptorPath, {
53
+ canonicalProjectRoot,
54
+ serviceInstanceId,
55
+ pid: process.pid,
56
+ token,
57
+ });
58
+ removeOwnedDescriptorLockSync(projectLeasePath, projectLeaseOwner);
59
+ };
60
+ const releaseProcessExitCleanup = registerProcessOwnedFileCleanup(cleanupOwnedFilesAtProcessExit);
61
+ const releaseProjectRoot = async () => {
62
+ if (!projectLeaseClaimed)
63
+ return;
64
+ projectLeaseClaimed = false;
65
+ try {
66
+ await removeOwnedDescriptorLock(projectLeasePath, projectLeaseOwner);
67
+ }
68
+ finally {
69
+ releaseProcessProjectRoot();
70
+ releaseProcessExitCleanup();
71
+ }
72
+ };
73
+ let authority;
74
+ try {
75
+ authority = await createFpsGameEditorProjectServiceAuthority({
76
+ projectRoot: canonicalProjectRoot,
77
+ project: input.options?.project,
78
+ serviceInstanceId,
79
+ server: input.server,
80
+ });
81
+ }
82
+ catch (error) {
83
+ await releaseProjectRoot();
84
+ throw error;
85
+ }
86
+ let gateway;
87
+ let releaseBrowserCommandForwarder;
88
+ try {
89
+ gateway = createEditorServiceGateway({
90
+ canonicalProjectRoot,
91
+ packageVersion: input.integration.buildInfo.version,
92
+ buildKey: input.integration.buildInfo.cacheKey,
93
+ startedAt,
94
+ host: authority.host,
95
+ readTraces: authority.readTraces,
96
+ readDocumentExport: authority.readDocumentExport,
97
+ });
98
+ releaseBrowserCommandForwarder = authority.bindBrowserCommandForwarder(gateway.forwardBrowserCommand);
99
+ }
100
+ catch (error) {
101
+ await authority.dispose().catch(() => undefined);
102
+ await releaseProjectRoot();
103
+ throw error;
104
+ }
105
+ const gatewayPath = EDITOR_SERVICE_GATEWAY_PATH;
106
+ let descriptor = null;
107
+ let descriptorPublication = null;
108
+ let disposal = null;
109
+ let disposed = false;
110
+ const gatewayMiddleware = async (request, response, next) => {
111
+ const requestUrl = new URL(request.url ?? '', 'http://fps-editor.local');
112
+ if (requestUrl.pathname !== gatewayPath)
113
+ return next();
114
+ setGatewayHeaders(request, response);
115
+ if (request.method === 'OPTIONS') {
116
+ response.statusCode = 204;
117
+ response.end();
118
+ return;
119
+ }
120
+ if (request.method !== 'POST') {
121
+ sendJson(response, 405, { ok: false, diagnostics: [{ severity: 'error', source: 'transport', code: 'http.methodNotAllowed', message: 'Editor Service Gateway requires POST.' }] });
122
+ return;
123
+ }
124
+ if (!hasBearerToken(request.headers?.authorization, token)) {
125
+ sendJson(response, 401, { ok: false, diagnostics: [{ severity: 'error', source: 'transport', code: 'auth.invalidToken', message: 'Editor Service bearer token is invalid.' }] });
126
+ return;
127
+ }
128
+ try {
129
+ const gatewayRequest = await readJsonBody(request);
130
+ const result = await gateway.handle(gatewayRequest, tokenScopes);
131
+ sendJson(response, result.ok ? 200 : 400, result);
132
+ }
133
+ catch (error) {
134
+ sendJson(response, 400, {
135
+ ok: false,
136
+ diagnostics: [{
137
+ severity: 'error',
138
+ source: 'transport',
139
+ code: 'request.invalidJson',
140
+ message: error instanceof Error ? error.message : String(error),
141
+ }],
142
+ });
143
+ }
144
+ };
145
+ try {
146
+ input.server.middlewares.use(gatewayMiddleware);
147
+ const middlewareStack = input.server.middlewares.stack;
148
+ const ownMiddlewareIndex = middlewareStack?.findIndex(layer => layer.handle === gatewayMiddleware) ?? -1;
149
+ const fallbackIndex = middlewareStack?.findIndex(layer => /vite(?:SpaFallback|IndexHtml|404)Middleware/.test(layer.handle?.name ?? '')) ?? -1;
150
+ if (middlewareStack && ownMiddlewareIndex >= 0 && fallbackIndex >= 0 && ownMiddlewareIndex > fallbackIndex) {
151
+ const [layer] = middlewareStack.splice(ownMiddlewareIndex, 1);
152
+ middlewareStack.splice(fallbackIndex, 0, layer);
153
+ }
154
+ }
155
+ catch (error) {
156
+ releaseBrowserCommandForwarder();
157
+ gateway.dispose();
158
+ await authority.dispose().catch(() => undefined);
159
+ await releaseProjectRoot();
160
+ throw error;
161
+ }
162
+ const publishDescriptor = () => {
163
+ if (disposed || descriptor)
164
+ return Promise.resolve();
165
+ if (descriptorPublication)
166
+ return descriptorPublication;
167
+ const publication = (async () => {
168
+ const endpoint = resolveServerEndpoint(input.server, gatewayPath);
169
+ const candidate = {
170
+ schemaVersion: EDITOR_SERVICE_DESCRIPTOR_SCHEMA_VERSION,
171
+ protocolVersion: EDITOR_SERVICE_PROTOCOL_VERSION,
172
+ canonicalProjectRoot,
173
+ serviceInstanceId,
174
+ pid: process.pid,
175
+ endpoint,
176
+ startedAt,
177
+ packageName: '@fps-games/editor',
178
+ packageVersion: input.integration.buildInfo.version,
179
+ buildKey: input.integration.buildInfo.cacheKey,
180
+ token,
181
+ tokenScopes,
182
+ };
183
+ await claimRuntimeDescriptor(descriptorPath, candidate);
184
+ descriptor = candidate;
185
+ if (disposed) {
186
+ await removeOwnedDescriptor(descriptorPath, candidate);
187
+ descriptor = null;
188
+ return;
189
+ }
190
+ input.logger?.info?.(`[fps-editor] Project Editor Service ready at ${endpoint}`);
191
+ })();
192
+ const trackedPublication = publication.finally(() => {
193
+ if (descriptorPublication === trackedPublication)
194
+ descriptorPublication = null;
195
+ });
196
+ descriptorPublication = trackedPublication;
197
+ return trackedPublication;
198
+ };
199
+ const onListening = () => {
200
+ void publishDescriptor().catch((error) => {
201
+ input.logger?.error?.(`[fps-editor] Failed to publish Agent runtime descriptor: ${formatError(error)}`);
202
+ void dispose();
203
+ });
204
+ };
205
+ const onClose = () => { void dispose(); };
206
+ input.server.httpServer?.once('close', onClose);
207
+ if (input.server.httpServer?.listening) {
208
+ try {
209
+ await publishDescriptor();
210
+ }
211
+ catch (error) {
212
+ await dispose().catch(() => undefined);
213
+ throw error;
214
+ }
215
+ }
216
+ else
217
+ input.server.httpServer?.once('listening', onListening);
218
+ async function dispose() {
219
+ if (disposal)
220
+ return disposal;
221
+ disposed = true;
222
+ disposal = (async () => {
223
+ input.server.httpServer?.off('listening', onListening);
224
+ input.server.httpServer?.off('close', onClose);
225
+ const activeMiddlewareStack = input.server.middlewares.stack;
226
+ const middlewareIndex = activeMiddlewareStack?.findIndex(layer => layer.handle === gatewayMiddleware) ?? -1;
227
+ if (middlewareIndex >= 0)
228
+ activeMiddlewareStack.splice(middlewareIndex, 1);
229
+ const errors = [];
230
+ try {
231
+ releaseBrowserCommandForwarder();
232
+ }
233
+ catch (error) {
234
+ errors.push(error);
235
+ }
236
+ gateway.dispose();
237
+ try {
238
+ await descriptorPublication;
239
+ }
240
+ catch (error) {
241
+ errors.push(error);
242
+ }
243
+ try {
244
+ if (descriptor)
245
+ await removeOwnedDescriptor(descriptorPath, descriptor);
246
+ }
247
+ catch (error) {
248
+ errors.push(error);
249
+ }
250
+ try {
251
+ await authority.dispose();
252
+ }
253
+ catch (error) {
254
+ errors.push(error);
255
+ }
256
+ finally {
257
+ try {
258
+ await releaseProjectRoot();
259
+ }
260
+ catch (error) {
261
+ errors.push(error);
262
+ }
263
+ }
264
+ if (errors.length) {
265
+ const error = new Error('Editor Service disposal failed.');
266
+ error.errors = errors;
267
+ throw error;
268
+ }
269
+ })();
270
+ return disposal;
271
+ }
272
+ return Object.freeze({ descriptorPath, serviceInstanceId, dispose });
273
+ }
274
+ async function claimRuntimeDescriptor(descriptorPath, descriptor) {
275
+ const directory = path.dirname(descriptorPath);
276
+ await mkdir(directory, { recursive: true, mode: 0o700 });
277
+ assertDescriptorInsideProject(descriptor.canonicalProjectRoot, await realpath(directory));
278
+ const lockPath = `${descriptorPath}.lock`;
279
+ const lockOwner = await claimDescriptorLock(lockPath);
280
+ try {
281
+ await assertOwnedDescriptorLock(lockPath, lockOwner);
282
+ await assertDescriptorAvailable(descriptorPath, descriptor.canonicalProjectRoot);
283
+ const temporaryPath = `${descriptorPath}.${process.pid}.${randomUUID()}.tmp`;
284
+ let committed = false;
285
+ try {
286
+ const handle = await open(temporaryPath, 'wx', 0o600);
287
+ try {
288
+ await handle.writeFile(`${JSON.stringify(descriptor, null, 2)}\n`, 'utf8');
289
+ await handle.sync();
290
+ }
291
+ finally {
292
+ await handle.close();
293
+ }
294
+ await chmod(temporaryPath, 0o600);
295
+ await assertOwnedDescriptorLock(lockPath, lockOwner);
296
+ await rename(temporaryPath, descriptorPath);
297
+ committed = true;
298
+ }
299
+ finally {
300
+ if (!committed)
301
+ await unlink(temporaryPath).catch(() => undefined);
302
+ }
303
+ }
304
+ finally {
305
+ await removeOwnedDescriptorLock(lockPath, lockOwner);
306
+ }
307
+ }
308
+ function registerProcessOwnedFileCleanup(cleanup) {
309
+ PROCESS_OWNED_FILE_CLEANUPS.add(cleanup);
310
+ installProcessOwnedFileCleanupHooks();
311
+ let registered = true;
312
+ return () => {
313
+ if (!registered)
314
+ return;
315
+ registered = false;
316
+ PROCESS_OWNED_FILE_CLEANUPS.delete(cleanup);
317
+ if (PROCESS_OWNED_FILE_CLEANUPS.size === 0)
318
+ removeProcessOwnedFileCleanupHooks();
319
+ };
320
+ }
321
+ function installProcessOwnedFileCleanupHooks() {
322
+ if (processExitCleanupInstalled)
323
+ return;
324
+ processExitCleanupInstalled = true;
325
+ process.once('exit', cleanupProcessOwnedFiles);
326
+ for (const signal of PROCESS_TERMINATION_SIGNALS) {
327
+ const handler = () => {
328
+ cleanupProcessOwnedFiles();
329
+ removeProcessOwnedFileCleanupHooks();
330
+ queueMicrotask(() => {
331
+ try {
332
+ process.kill(process.pid, signal);
333
+ }
334
+ catch {
335
+ // The process may already be exiting through another signal handler.
336
+ }
337
+ });
338
+ };
339
+ PROCESS_SIGNAL_HANDLERS.set(signal, handler);
340
+ process.once(signal, handler);
341
+ }
342
+ }
343
+ function removeProcessOwnedFileCleanupHooks() {
344
+ if (!processExitCleanupInstalled)
345
+ return;
346
+ processExitCleanupInstalled = false;
347
+ process.off('exit', cleanupProcessOwnedFiles);
348
+ for (const [signal, handler] of PROCESS_SIGNAL_HANDLERS) {
349
+ process.off(signal, handler);
350
+ }
351
+ PROCESS_SIGNAL_HANDLERS.clear();
352
+ }
353
+ function cleanupProcessOwnedFiles() {
354
+ for (const cleanup of PROCESS_OWNED_FILE_CLEANUPS)
355
+ cleanup();
356
+ }
357
+ function removeOwnedRuntimeDescriptorSync(descriptorPath, owner) {
358
+ try {
359
+ const current = JSON.parse(readFileSync(descriptorPath, 'utf8'));
360
+ if (current.canonicalProjectRoot !== owner.canonicalProjectRoot
361
+ || current.serviceInstanceId !== owner.serviceInstanceId
362
+ || current.pid !== owner.pid
363
+ || current.token !== owner.token)
364
+ return;
365
+ unlinkSync(descriptorPath);
366
+ }
367
+ catch {
368
+ // Process exit cleanup is best effort. Stale-owner recovery remains authoritative.
369
+ }
370
+ }
371
+ function removeOwnedDescriptorLockSync(lockPath, owner) {
372
+ try {
373
+ const current = parseDescriptorLockOwner(readFileSync(lockPath, 'utf8'));
374
+ if (!current || current.pid !== owner.pid || current.token !== owner.token)
375
+ return;
376
+ unlinkSync(lockPath);
377
+ }
378
+ catch {
379
+ // Process exit cleanup is best effort. Stale-owner recovery remains authoritative.
380
+ }
381
+ }
382
+ async function claimDescriptorLock(lockPath) {
383
+ const owner = { pid: process.pid, token: randomUUID() };
384
+ const serialized = `${JSON.stringify(owner)}\n`;
385
+ for (let attempt = 0; attempt < 8; attempt += 1) {
386
+ try {
387
+ const handle = await open(lockPath, 'wx', 0o600);
388
+ try {
389
+ await handle.writeFile(serialized, 'utf8');
390
+ await handle.chmod(0o600);
391
+ }
392
+ finally {
393
+ await handle.close();
394
+ }
395
+ return owner;
396
+ }
397
+ catch (error) {
398
+ if (error?.code !== 'EEXIST')
399
+ throw error;
400
+ }
401
+ const observed = await readFile(lockPath, 'utf8').catch(() => null);
402
+ if (observed === null)
403
+ continue;
404
+ const existing = parseDescriptorLockOwner(observed);
405
+ if (!existing || isProcessAlive(existing.pid)) {
406
+ throw new Error(`Editor Service descriptor lock has an ambiguous live owner at ${lockPath}.`);
407
+ }
408
+ const quarantine = `${lockPath}.stale.${process.pid}.${randomUUID()}`;
409
+ try {
410
+ await rename(lockPath, quarantine);
411
+ }
412
+ catch (error) {
413
+ if (error?.code === 'ENOENT')
414
+ continue;
415
+ throw error;
416
+ }
417
+ const moved = await readFile(quarantine, 'utf8').catch(() => null);
418
+ if (moved !== observed) {
419
+ await rename(quarantine, lockPath).catch(() => undefined);
420
+ throw new Error(`Editor Service descriptor lock changed during stale-owner recovery at ${lockPath}.`);
421
+ }
422
+ await unlink(quarantine).catch(() => undefined);
423
+ }
424
+ throw new Error(`Editor Service descriptor lock could not be claimed at ${lockPath}.`);
425
+ }
426
+ function parseDescriptorLockOwner(source) {
427
+ try {
428
+ const value = JSON.parse(source);
429
+ return Number.isSafeInteger(value?.pid) && value.pid > 0 && typeof value.token === 'string' && value.token
430
+ ? value
431
+ : null;
432
+ }
433
+ catch {
434
+ const legacyPid = Number(source.trim());
435
+ return Number.isSafeInteger(legacyPid) && legacyPid > 0
436
+ ? { pid: legacyPid, token: `legacy:${legacyPid}` }
437
+ : null;
438
+ }
439
+ }
440
+ async function assertOwnedDescriptorLock(lockPath, owner) {
441
+ const current = parseDescriptorLockOwner(await readFile(lockPath, 'utf8').catch(() => ''));
442
+ if (!current || current.pid !== owner.pid || current.token !== owner.token) {
443
+ throw new Error(`Editor Service descriptor lock ownership was lost at ${lockPath}.`);
444
+ }
445
+ }
446
+ async function removeOwnedDescriptorLock(lockPath, owner) {
447
+ const current = parseDescriptorLockOwner(await readFile(lockPath, 'utf8').catch(() => ''));
448
+ if (current?.pid === owner.pid && current.token === owner.token) {
449
+ await unlink(lockPath).catch(() => undefined);
450
+ }
451
+ }
452
+ async function assertDescriptorAvailable(descriptorPath, canonicalProjectRoot) {
453
+ const existing = await readDescriptor(descriptorPath);
454
+ if (!existing)
455
+ return;
456
+ if (existing.canonicalProjectRoot !== canonicalProjectRoot) {
457
+ throw new Error(`Editor Service descriptor project identity mismatch at ${descriptorPath}.`);
458
+ }
459
+ if (await isDescriptorHealthy(existing)) {
460
+ throw new Error(`A live Editor Service already owns this project: ${existing.serviceInstanceId}.`);
461
+ }
462
+ if (isProcessAlive(existing.pid)) {
463
+ throw new Error(`A live Editor Service owner is temporarily unreachable; refusing to replace ${existing.serviceInstanceId}.`);
464
+ }
465
+ await unlink(descriptorPath).catch((error) => {
466
+ if (error?.code !== 'ENOENT')
467
+ throw error;
468
+ });
469
+ }
470
+ async function readDescriptor(descriptorPath) {
471
+ try {
472
+ const value = JSON.parse(await readFile(descriptorPath, 'utf8'));
473
+ if (!value || typeof value !== 'object' || typeof value.serviceInstanceId !== 'string'
474
+ || typeof value.canonicalProjectRoot !== 'string' || typeof value.endpoint !== 'string'
475
+ || typeof value.token !== 'string' || !Number.isSafeInteger(value.pid)) {
476
+ throw new Error(`Editor Service runtime descriptor is malformed at ${descriptorPath}.`);
477
+ }
478
+ return value;
479
+ }
480
+ catch (error) {
481
+ if (error?.code === 'ENOENT')
482
+ return null;
483
+ throw error;
484
+ }
485
+ }
486
+ async function isDescriptorHealthy(descriptor) {
487
+ if (!isProcessAlive(descriptor.pid))
488
+ return false;
489
+ const controller = new AbortController();
490
+ const timer = setTimeout(() => controller.abort(), 750);
491
+ try {
492
+ const response = await fetch(descriptor.endpoint, {
493
+ method: 'POST',
494
+ headers: { authorization: `Bearer ${descriptor.token}`, 'content-type': 'application/json' },
495
+ body: JSON.stringify({ kind: 'status' }),
496
+ signal: controller.signal,
497
+ });
498
+ if (!response.ok)
499
+ return false;
500
+ const body = await response.json();
501
+ return body?.ok === true
502
+ && body?.kind === 'status'
503
+ && body?.status?.serviceInstanceId === descriptor.serviceInstanceId
504
+ && body?.status?.canonicalProjectRoot === descriptor.canonicalProjectRoot
505
+ && body?.status?.protocolVersion === descriptor.protocolVersion;
506
+ }
507
+ catch {
508
+ return false;
509
+ }
510
+ finally {
511
+ clearTimeout(timer);
512
+ }
513
+ }
514
+ function isProcessAlive(pid) {
515
+ try {
516
+ process.kill(pid, 0);
517
+ return true;
518
+ }
519
+ catch (error) {
520
+ return error?.code === 'EPERM';
521
+ }
522
+ }
523
+ async function removeOwnedDescriptor(descriptorPath, owner) {
524
+ const current = await readDescriptor(descriptorPath);
525
+ if (!current || current.serviceInstanceId !== owner.serviceInstanceId || current.token !== owner.token)
526
+ return;
527
+ await unlink(descriptorPath).catch((error) => {
528
+ if (error?.code !== 'ENOENT')
529
+ throw error;
530
+ });
531
+ }
532
+ function resolveServerEndpoint(server, gatewayPath) {
533
+ const address = server.httpServer?.address();
534
+ if (!address || typeof address === 'string')
535
+ throw new Error('Vite HTTP server address is unavailable.');
536
+ return `http://127.0.0.1:${address.port}${gatewayPath}`;
537
+ }
538
+ function normalizeTokenScopes(value) {
539
+ const defaults = ['read', 'write'];
540
+ const scopes = [...new Set(value ?? defaults)];
541
+ if (scopes.length === 0 || scopes.some(scope => scope !== 'read' && scope !== 'write')) {
542
+ throw new Error('Editor Service token scopes must contain read or write.');
543
+ }
544
+ return Object.freeze(scopes);
545
+ }
546
+ function assertDescriptorInsideProject(projectRoot, descriptorPath) {
547
+ const relative = path.relative(projectRoot, descriptorPath);
548
+ if (!relative || relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
549
+ throw new Error('Editor Service runtime descriptor must be inside the canonical project root.');
550
+ }
551
+ }
552
+ function hasBearerToken(header, expected) {
553
+ if (typeof header !== 'string' || !header.startsWith('Bearer '))
554
+ return false;
555
+ const received = Buffer.from(header.slice('Bearer '.length), 'utf8');
556
+ const target = Buffer.from(expected, 'utf8');
557
+ return received.length === target.length && timingSafeEqual(received, target);
558
+ }
559
+ async function readJsonBody(request) {
560
+ const chunks = [];
561
+ let bytes = 0;
562
+ for await (const chunk of request) {
563
+ const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
564
+ bytes += buffer.byteLength;
565
+ if (bytes > 1024 * 1024)
566
+ throw new Error('Editor Service request body exceeds 1 MiB.');
567
+ chunks.push(buffer);
568
+ }
569
+ if (chunks.length === 0)
570
+ throw new Error('Editor Service request body is required.');
571
+ return JSON.parse(Buffer.concat(chunks).toString('utf8'));
572
+ }
573
+ function setGatewayHeaders(request, response) {
574
+ response.setHeader('Cache-Control', 'no-store');
575
+ response.setHeader('Content-Type', 'application/json; charset=utf-8');
576
+ response.setHeader('X-Content-Type-Options', 'nosniff');
577
+ response.setHeader('Access-Control-Allow-Headers', 'authorization, content-type');
578
+ response.setHeader('Access-Control-Allow-Methods', 'POST, OPTIONS');
579
+ const origin = typeof request.headers?.origin === 'string' ? request.headers.origin : undefined;
580
+ if (origin) {
581
+ response.setHeader('Access-Control-Allow-Origin', origin);
582
+ response.setHeader('Vary', 'Origin');
583
+ }
584
+ }
585
+ function sendJson(response, statusCode, value) {
586
+ response.statusCode = statusCode;
587
+ response.end(`${JSON.stringify(value)}\n`);
588
+ }
589
+ function formatError(error) {
590
+ return error instanceof Error ? error.message : String(error);
591
+ }
592
+ //# sourceMappingURL=editor-service-vite.js.map