@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 @@
1
+ {"version":3,"file":"editor-command-system.js","sourceRoot":"","sources":["../src/editor-command-system.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,GAS9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,uCAAuC,EAAE,MAAM,wCAAwC,CAAC;AAuHjG,MAAM,+BAA+B,GAAG,GAAG,CAAC;AAC5C,MAAM,wBAAwB,GAAG,GAAG,GAAG,IAAI,CAAC;AAC5C,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAElC,MAAM,UAAU,yBAAyB,CACvC,UAA4C,EAAE;IAE9C,MAAM,aAAa,GAAG,IAAI,GAAG,EAAgC,CAAC;IAC9D,MAAM,UAAU,GAAG,IAAI,GAAG,EAA2B,CAAC;IACtD,MAAM,WAAW,GAAG,IAAI,GAA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,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,WAAW,CAAC;AACjF,CAAC;AAED,SAAS,+BAA+B;IACtC,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,OAAO,GAAG,EAAE,CAAC,kBAAkB,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;AACxF,CAAC","sourcesContent":["import {\n EDITOR_COMMAND_SCHEMA_VERSION,\n type EditorCommandAvailability,\n type EditorCommandCatalogSnapshot,\n type EditorCommandDiagnostic,\n type EditorCommandExecutionResult,\n type EditorCommandInvocation,\n type EditorCommandJsonObject,\n type EditorCommandManifest,\n type EditorCommandOperationSnapshot,\n} from '@fps-games/editor-protocol';\nimport { isAuthorizedCommandComposedRegistration } from './editor-command-composed-authority.js';\n\nexport type EditorCommandMaybePromise<T> = T | Promise<T>;\n\nexport interface EditorCommandHandlerContext extends EditorCommandInvocation {\n readonly operationId: string;\n readonly manifest: EditorCommandManifest;\n readonly signal: AbortSignal;\n /** Host-owned composed handlers use an already-admitted authoring transaction. */\n readonly authorityTransaction?: 'isolated' | 'composed';\n /** Opaque Host-issued access for the currently serialized external command handler. */\n readonly authorityContext?: unknown;\n}\n\nexport type EditorCommandHandlerOutcome<TOutput = unknown> =\n | { ok: true; output: TOutput; diagnostics?: readonly EditorCommandDiagnostic[] }\n | { ok: false; diagnostics: readonly EditorCommandDiagnostic[] };\n\nexport interface EditorCommandRegistration<TInput = unknown, TOutput = unknown> {\n readonly manifest: EditorCommandManifest;\n readonly available?: () => EditorCommandMaybePromise<boolean | string | EditorCommandAvailability>;\n readonly handler: (\n input: TInput,\n context: EditorCommandHandlerContext,\n ) => EditorCommandMaybePromise<EditorCommandHandlerOutcome<TOutput>>;\n /** Command capability adapters may defer validation to their existing handler. */\n readonly validateInput?: boolean;\n /** Command capability adapters may return an capability result envelope. */\n readonly validateOutput?: boolean;\n /** External command adapter for handlers that still own their Session mutation path. */\n readonly authorityTransaction?: 'isolated' | 'composed';\n}\n\nexport interface EditorCommandExecutionInterceptorContext extends EditorCommandHandlerContext {}\n\nexport type EditorCommandExecutionInterceptor = (\n context: EditorCommandExecutionInterceptorContext,\n execute: (authorityContext?: unknown) => Promise<EditorCommandHandlerOutcome<unknown>>,\n) => Promise<EditorCommandHandlerOutcome<unknown>>;\n\nexport interface EditorCommandCatalogQuery {\n readonly text?: string;\n readonly limit?: number;\n readonly target?: EditorCommandManifest['target'];\n readonly access?: EditorCommandManifest['access'];\n}\n\nexport interface EditorCommandInvocationHandle<TOutput = unknown> {\n readonly operationId: string;\n readonly requestId: string;\n readonly reused: boolean;\n readonly completion: Promise<EditorCommandExecutionResult<TOutput>>;\n}\n\nexport interface EditorCommandSystem {\n readonly catalogRevision: number;\n readonly executionAuthorityInstalled: boolean;\n registerCommand<TInput = unknown, TOutput = unknown>(\n registration: EditorCommandRegistration<TInput, TOutput>,\n ): () => void;\n /** Installs the process-local execution authority. Only one owner may be active. */\n installExecutionInterceptor(\n interceptor: EditorCommandExecutionInterceptor,\n options?: { scopeId?: string },\n ): () => void;\n listManifests(): EditorCommandManifest[];\n getCatalog(query?: EditorCommandCatalogQuery): Promise<EditorCommandCatalogSnapshot>;\n describeCommand(commandId: string): Promise<EditorCommandCatalogSnapshot['commands'][number] | null>;\n invoke<TOutput = unknown>(invocation: EditorCommandInvocation): EditorCommandInvocationHandle<TOutput>;\n execute<TOutput = unknown>(invocation: EditorCommandInvocation): Promise<EditorCommandExecutionResult<TOutput>>;\n getOperation<TOutput = unknown>(operationId: string): EditorCommandOperationSnapshot<TOutput> | null;\n cancelOperation(operationId: string): boolean;\n dispose(): void;\n}\n\n/**\n * Invocation/catalog surface exposed by an authoring Host. Registration and\n * execution-authority ownership stay private to the Host.\n */\nexport type EditorCommandClient = Pick<EditorCommandSystem,\n | 'catalogRevision'\n | 'executionAuthorityInstalled'\n | 'listManifests'\n | 'getCatalog'\n | 'describeCommand'\n | 'invoke'\n | 'execute'\n | 'getOperation'\n | 'cancelOperation'\n>;\n\nexport interface CreateEditorCommandSystemOptions {\n readonly now?: () => number;\n readonly createOperationId?: () => string;\n readonly maxRetainedOperations?: number;\n readonly maxResultBytes?: number;\n readonly onOperationSettled?: (event: EditorCommandOperationSettledEvent) => void;\n}\n\nexport interface EditorCommandOperationSettledEvent {\n readonly invocation: EditorCommandInvocation;\n readonly manifest?: EditorCommandManifest;\n readonly operation: EditorCommandExecutionResult<unknown>;\n}\n\ntype InternalRegistration = EditorCommandRegistration<unknown, unknown> & {\n readonly manifest: EditorCommandManifest;\n};\n\ninterface OperationRecord {\n readonly controller: AbortController;\n readonly fingerprint: string;\n readonly idempotencyScope?: string;\n readonly registration?: InternalRegistration;\n readonly invocation: EditorCommandInvocation;\n snapshot: EditorCommandOperationSnapshot<unknown>;\n completion: Promise<EditorCommandExecutionResult<unknown>>;\n}\n\nconst DEFAULT_MAX_RETAINED_OPERATIONS = 200;\nconst DEFAULT_MAX_RESULT_BYTES = 128 * 1024;\nconst MAX_SCHEMA_DIAGNOSTICS = 20;\n\nexport function createEditorCommandSystem(\n options: CreateEditorCommandSystemOptions = {},\n): EditorCommandSystem {\n const registrations = new Map<string, InternalRegistration>();\n const operations = new Map<string, OperationRecord>();\n const idempotency = new Map<string, OperationRecord>();\n const now = options.now ?? Date.now;\n const createOperationId = options.createOperationId ?? createDefaultOperationIdFactory();\n const maxRetainedOperations = normalizePositiveInteger(\n options.maxRetainedOperations,\n DEFAULT_MAX_RETAINED_OPERATIONS,\n );\n const maxResultBytes = normalizePositiveInteger(options.maxResultBytes, DEFAULT_MAX_RESULT_BYTES);\n let catalogRevision = 0;\n let disposed = false;\n let executionInterceptor: EditorCommandExecutionInterceptor | undefined;\n let executionAuthorityScopeId = '';\n\n const readTimestamp = (fallback: number): number => {\n try {\n const value = now();\n return typeof value === 'number' && Number.isFinite(value) ? value : fallback;\n } catch {\n // Operation timestamps are observability metadata. A broken clock must\n // never turn an already-committed command into a failed operation.\n return fallback;\n }\n };\n\n const system: EditorCommandSystem = {\n get catalogRevision() { return catalogRevision; },\n get executionAuthorityInstalled() { return executionInterceptor !== undefined; },\n registerCommand<TInput, TOutput>(registration: EditorCommandRegistration<TInput, TOutput>) {\n assertActive();\n const normalized = snapshotRegistration(registration);\n const commandId = normalized.manifest.id;\n if (registrations.has(commandId)) {\n throw new Error(`Editor command is already registered: ${commandId}`);\n }\n registrations.set(commandId, normalized);\n catalogRevision += 1;\n let active = true;\n return () => {\n if (!active) return;\n active = false;\n if (registrations.get(commandId) === normalized) {\n registrations.delete(commandId);\n for (const [scope, record] of idempotency) {\n if (record.registration === normalized) idempotency.delete(scope);\n }\n catalogRevision += 1;\n }\n };\n },\n installExecutionInterceptor(interceptor, interceptorOptions = {}) {\n assertActive();\n if (typeof interceptor !== 'function') throw new Error('Editor command execution interceptor is required.');\n if (executionInterceptor) throw new Error('Editor command execution authority is already installed.');\n executionInterceptor = interceptor;\n executionAuthorityScopeId = interceptorOptions.scopeId?.trim() ?? '';\n let active = true;\n return () => {\n if (!active) return;\n active = false;\n if (executionInterceptor === interceptor) {\n executionInterceptor = undefined;\n executionAuthorityScopeId = '';\n }\n };\n },\n listManifests() {\n assertActive();\n return [...registrations.values()]\n .map(registration => cloneManifest(registration.manifest));\n },\n async getCatalog(query = {}) {\n assertActive();\n const normalizedQuery = normalizeCatalogQuery(query);\n const candidates = [...registrations.values()]\n .filter(registration => !normalizedQuery.target || registration.manifest.target === normalizedQuery.target)\n .filter(registration => !normalizedQuery.access || registration.manifest.access === normalizedQuery.access)\n .map(registration => ({\n registration,\n score: scoreManifest(registration.manifest, normalizedQuery.text),\n }))\n .filter(candidate => candidate.score >= 0)\n .sort((left, right) => right.score - left.score\n || left.registration.manifest.id.localeCompare(right.registration.manifest.id))\n .slice(0, normalizedQuery.limit);\n const commands = await Promise.all(candidates.map(async ({ registration }) => ({\n manifest: cloneManifest(registration.manifest),\n availability: await resolveAvailability(registration),\n })));\n return { catalogRevision, commands };\n },\n async describeCommand(commandId: string) {\n assertActive();\n const normalizedId = normalizeCommandId(commandId);\n const registration = registrations.get(normalizedId);\n if (!registration) return null;\n return {\n manifest: cloneManifest(registration.manifest),\n availability: await resolveAvailability(registration),\n };\n },\n invoke<TOutput>(rawInvocation: EditorCommandInvocation) {\n assertActive();\n const commandId = normalizeCommandId(rawInvocation?.commandId);\n const registration = registrations.get(commandId);\n const invocation = snapshotInvocation(rawInvocation, registration?.validateInput === false);\n const fingerprint = stableStringify({\n intentCommandId: invocation.intentCommandId ?? null,\n input: invocation.input === undefined\n ? { presence: 'omitted' }\n : { presence: 'provided', value: invocation.input },\n expectedRevision: invocation.expectedRevision ?? null,\n });\n const idempotencyScope = invocation.idempotencyKey\n ? createIdempotencyScope(invocation, executionAuthorityScopeId)\n : undefined;\n if (idempotencyScope) {\n const existing = idempotency.get(idempotencyScope);\n if (existing) {\n if (existing.fingerprint === fingerprint) {\n return createHandle<TOutput>(existing, true);\n }\n const conflict = createOperationRecord(invocation, registration, fingerprint);\n operations.set(conflict.snapshot.operationId, conflict);\n conflict.completion = observeCompletion(conflict, Promise.resolve(finalizeFailure(conflict, [{\n severity: 'error',\n source: 'command-system',\n code: 'command.idempotencyConflict',\n message: `Idempotency key was reused with different input: ${invocation.idempotencyKey}`,\n }])));\n pruneOperations();\n return createHandle<TOutput>(conflict, false);\n }\n }\n const record = createOperationRecord(invocation, registration, fingerprint, idempotencyScope);\n operations.set(record.snapshot.operationId, record);\n if (idempotencyScope) idempotency.set(idempotencyScope, record);\n record.completion = observeCompletion(record, runOperation(record));\n return createHandle<TOutput>(record, false);\n },\n execute<TOutput>(invocation: EditorCommandInvocation) {\n return system.invoke<TOutput>(invocation).completion;\n },\n getOperation<TOutput>(operationId: string) {\n const record = operations.get(operationId);\n return record ? cloneOperationSnapshot(record.snapshot) as EditorCommandOperationSnapshot<TOutput> : null;\n },\n cancelOperation(operationId: string) {\n const record = operations.get(operationId);\n if (!record || record.snapshot.status !== 'accepted') return false;\n record.controller.abort();\n return true;\n },\n dispose() {\n if (disposed) return;\n disposed = true;\n registrations.clear();\n executionInterceptor = undefined;\n catalogRevision += 1;\n for (const record of operations.values()) {\n if (record.snapshot.status === 'accepted') record.controller.abort();\n }\n idempotency.clear();\n },\n };\n\n return system;\n\n function assertActive(): void {\n if (disposed) throw new Error('Editor Command System is disposed.');\n }\n\n function createOperationRecord(\n invocation: EditorCommandInvocation,\n registration: InternalRegistration | undefined,\n fingerprint: string,\n idempotencyScope?: string,\n ): OperationRecord {\n const operationId = normalizeOpaqueId(createOperationId(), 'operationId');\n const snapshot: EditorCommandOperationSnapshot<unknown> = {\n operationId,\n requestId: invocation.requestId,\n commandId: invocation.commandId,\n ...(invocation.intentCommandId ? { intentCommandId: invocation.intentCommandId } : {}),\n status: 'accepted',\n source: invocation.source,\n principal: { ...invocation.principal },\n createdAt: readTimestamp(0),\n ...(invocation.traceId ? { traceId: invocation.traceId } : {}),\n ...(invocation.traceStepId ? { traceStepId: invocation.traceStepId } : {}),\n ...(invocation.transactionId ? { transactionId: invocation.transactionId } : {}),\n };\n const record: OperationRecord = {\n controller: new AbortController(),\n fingerprint,\n ...(idempotencyScope ? { idempotencyScope } : {}),\n ...(registration ? { registration } : {}),\n invocation,\n snapshot,\n completion: Promise.resolve(undefined as never),\n };\n return record;\n }\n\n async function runOperation(record: OperationRecord): Promise<EditorCommandExecutionResult<unknown>> {\n if (record.controller.signal.aborted) return finalizeCancelled(record);\n const registration = record.registration;\n if (!registration) {\n return finalizeFailure(record, [{\n severity: 'error',\n source: 'command-system',\n code: 'command.notFound',\n message: `Editor command is not registered: ${record.invocation.commandId}`,\n }]);\n }\n if (registration.manifest.target === 'authoring'\n && registration.manifest.access === 'write'\n && !executionInterceptor) {\n return finalizeFailure(record, [{\n severity: 'error',\n source: 'command-system',\n code: 'command.authorityUnavailable',\n message: 'Editor authoring authority is unavailable.',\n }]);\n }\n try {\n const context: EditorCommandHandlerContext = {\n ...record.invocation,\n operationId: record.snapshot.operationId,\n manifest: cloneManifest(registration.manifest),\n signal: record.controller.signal,\n ...(registration.authorityTransaction\n ? { authorityTransaction: registration.authorityTransaction }\n : {}),\n };\n const execute = async (authorityContext?: unknown): Promise<EditorCommandHandlerOutcome<unknown>> => {\n const availability = await resolveAvailability(registration, record.controller.signal);\n if (record.controller.signal.aborted) return cancelledOutcome(record.invocation.commandId);\n if (!availability.available) return { ok: false, diagnostics: availability.reasons };\n const input = record.invocation.input !== undefined\n ? record.invocation.input\n : registration.manifest.presentation?.inputMode === 'none' ? {} : null;\n if (registration.validateInput !== false) {\n const diagnostics = validateJsonSchema(\n input,\n registration.manifest.inputSchema,\n '$',\n 'command.inputInvalid',\n );\n if (diagnostics.length) return { ok: false, diagnostics };\n }\n if (record.controller.signal.aborted) return cancelledOutcome(record.invocation.commandId);\n record.snapshot = {\n ...record.snapshot,\n status: 'running',\n startedAt: readTimestamp(record.snapshot.createdAt),\n };\n const handlerContext = authorityContext === undefined\n ? context\n : { ...context, authorityContext };\n const handlerPromise = Promise.resolve(registration.handler(input, handlerContext));\n const outcome = registration.authorityTransaction === 'composed'\n ? await handlerPromise\n : await awaitAbortable(handlerPromise, record.controller.signal);\n if (outcome === ABORTED) return cancelledOutcome(record.invocation.commandId);\n if (!outcome.ok) return { ok: false, diagnostics: normalizeDiagnostics(outcome.diagnostics) };\n if (registration.validateOutput !== false) {\n const diagnostics = validateJsonSchema(\n outcome.output,\n registration.manifest.outputSchema,\n '$',\n 'command.outputInvalid',\n );\n if (diagnostics.length) return { ok: false, diagnostics };\n }\n const diagnostics = outcome.diagnostics?.length\n ? normalizeDiagnostics(outcome.diagnostics)\n : undefined;\n return {\n ok: true,\n output: cloneBoundedResult(outcome.output, maxResultBytes),\n ...(diagnostics ? { diagnostics } : {}),\n };\n };\n const outcome = executionInterceptor\n ? await executionInterceptor(context, execute)\n : await execute();\n if (!outcome.ok) {\n const diagnostics = normalizeDiagnostics(outcome.diagnostics);\n return diagnostics.some(diagnostic => diagnostic.code === 'command.cancelled')\n ? finalizeFailure(record, diagnostics, 'cancelled')\n : finalizeFailure(record, diagnostics);\n }\n record.snapshot = {\n ...record.snapshot,\n status: 'completed',\n completedAt: readTimestamp(record.snapshot.startedAt ?? record.snapshot.createdAt),\n output: outcome.output,\n ...(outcome.diagnostics?.length\n ? { diagnostics: [...outcome.diagnostics] }\n : {}),\n };\n pruneOperations();\n return cloneOperationSnapshot(record.snapshot) as EditorCommandExecutionResult<unknown>;\n } catch (error) {\n if (record.controller.signal.aborted) return finalizeCancelled(record);\n return finalizeFailure(record, [{\n severity: 'error',\n source: 'command-system',\n code: error instanceof EditorCommandResultTooLargeError\n ? 'command.resultTooLarge'\n : 'command.exception',\n message: error instanceof Error ? error.message : String(error),\n }]);\n }\n }\n\n function finalizeCancelled(record: OperationRecord): EditorCommandExecutionResult<never> {\n return finalizeFailure(record, [{\n severity: 'warning',\n source: 'command-system',\n code: 'command.cancelled',\n message: `Editor command was cancelled: ${record.invocation.commandId}`,\n }], 'cancelled');\n }\n\n function finalizeFailure(\n record: OperationRecord,\n diagnostics: readonly EditorCommandDiagnostic[],\n status: 'failed' | 'cancelled' = 'failed',\n ): EditorCommandExecutionResult<never> {\n record.snapshot = {\n ...record.snapshot,\n status,\n completedAt: readTimestamp(record.snapshot.startedAt ?? record.snapshot.createdAt),\n diagnostics: normalizeDiagnostics(diagnostics),\n };\n pruneOperations();\n return cloneOperationSnapshot(record.snapshot) as EditorCommandExecutionResult<never>;\n }\n\n async function observeCompletion(\n record: OperationRecord,\n completion: Promise<EditorCommandExecutionResult<unknown>>,\n ): Promise<EditorCommandExecutionResult<unknown>> {\n const operation = await completion;\n try {\n options.onOperationSettled?.({\n invocation: snapshotInvocation(record.invocation, record.registration?.validateInput === false),\n ...(record.registration ? { manifest: cloneManifest(record.registration.manifest) } : {}),\n operation: structuredClone(operation),\n });\n } catch {\n // Observability is bounded best-effort metadata and never changes command semantics.\n }\n return operation;\n }\n\n function pruneOperations(): void {\n if (operations.size <= maxRetainedOperations) return;\n for (const [operationId, record] of operations) {\n if (!isTerminalStatus(record.snapshot.status)) continue;\n operations.delete(operationId);\n // Operation query retention is bounded, but idempotency lives for the\n // service instance. A late retry must not execute again merely because\n // its operation snapshot aged out of the query window.\n if (operations.size <= maxRetainedOperations) break;\n }\n }\n}\n\nfunction snapshotRegistration<TInput, TOutput>(\n registration: EditorCommandRegistration<TInput, TOutput>,\n): InternalRegistration {\n if (!registration || typeof registration !== 'object') {\n throw new Error('Editor command registration must be an object.');\n }\n if (typeof registration.handler !== 'function') {\n throw new Error('Editor command handler is required.');\n }\n if (registration.available !== undefined && typeof registration.available !== 'function') {\n throw new Error('Editor command availability must be a function.');\n }\n if (registration.authorityTransaction !== undefined\n && registration.authorityTransaction !== 'isolated'\n && registration.authorityTransaction !== 'composed') {\n throw new Error('Editor command authority transaction mode is invalid.');\n }\n if (registration.authorityTransaction === 'composed'\n && !isAuthorizedCommandComposedRegistration(\n registration as EditorCommandRegistration<unknown, unknown>,\n )) {\n throw new Error('Composed Editor command authority is reserved for the owning Authoring Host.');\n }\n return {\n manifest: snapshotEditorCommandManifest(registration.manifest),\n ...(registration.available ? { available: registration.available } : {}),\n handler: registration.handler as InternalRegistration['handler'],\n ...(registration.validateInput === false ? { validateInput: false } : {}),\n ...(registration.validateOutput === false ? { validateOutput: false } : {}),\n ...(registration.authorityTransaction ? { authorityTransaction: registration.authorityTransaction } : {}),\n };\n}\n\nexport function snapshotEditorCommandManifest(manifest: EditorCommandManifest): EditorCommandManifest {\n if (!manifest || typeof manifest !== 'object') throw new Error('Editor command manifest is required.');\n if (manifest.schemaVersion !== EDITOR_COMMAND_SCHEMA_VERSION) {\n throw new Error(`Unsupported Editor command schema version: ${String(manifest.schemaVersion)}`);\n }\n const id = normalizeCommandId(manifest.id);\n if (!Number.isInteger(manifest.version) || manifest.version <= 0) {\n throw new Error(`Editor command version must be a positive integer: ${id}`);\n }\n const title = normalizeRequiredText(manifest.title, `Editor command title is required: ${id}`);\n const targets = new Set(['workspace-service', 'tooling', 'authoring', 'view', 'renderer']);\n if (!targets.has(manifest.target)) throw new Error(`Editor command target is invalid: ${id}`);\n if (manifest.access !== 'read' && manifest.access !== 'write') {\n throw new Error(`Editor command access is invalid: ${id}`);\n }\n const stabilities = new Set(['experimental', 'stable', 'deprecated']);\n if (!stabilities.has(manifest.stability)) throw new Error(`Editor command stability is invalid: ${id}`);\n if (!manifest.effects || typeof manifest.effects !== 'object') {\n throw new Error(`Editor command effects are required: ${id}`);\n }\n const persistence = new Set(['none', 'view', 'authoring', 'filesystem']);\n if (!persistence.has(manifest.effects.persistence)) {\n throw new Error(`Editor command persistence is invalid: ${id}`);\n }\n if (typeof manifest.effects.undoable !== 'boolean' || typeof manifest.effects.idempotent !== 'boolean') {\n throw new Error(`Editor command effects flags are invalid: ${id}`);\n }\n const description = normalizeOptionalText(manifest.description);\n const snapshot: EditorCommandManifest = {\n schemaVersion: EDITOR_COMMAND_SCHEMA_VERSION,\n id,\n version: manifest.version,\n title,\n ...(description ? { description } : {}),\n target: manifest.target,\n access: manifest.access,\n stability: manifest.stability,\n inputSchema: snapshotJsonSchema(manifest.inputSchema, `${id}.inputSchema`),\n outputSchema: snapshotJsonSchema(manifest.outputSchema, `${id}.outputSchema`),\n ...(manifest.requires ? { requires: snapshotRequirements(manifest.requires, id) } : {}),\n effects: Object.freeze({ ...manifest.effects }),\n ...(manifest.presentation ? { presentation: snapshotPresentation(manifest.presentation, id, manifest.inputSchema) } : {}),\n };\n return Object.freeze(snapshot);\n}\n\nfunction snapshotRequirements(\n value: NonNullable<EditorCommandManifest['requires']>,\n commandId: string,\n): NonNullable<EditorCommandManifest['requires']> {\n for (const key of ['editorReady', 'viewAttached', 'rendererAttached'] as const) {\n if (value[key] !== undefined && typeof value[key] !== 'boolean') {\n throw new Error(`Editor command requirement ${key} is invalid: ${commandId}`);\n }\n }\n return Object.freeze({\n ...(value.editorReady !== undefined ? { editorReady: value.editorReady } : {}),\n ...(value.viewAttached !== undefined ? { viewAttached: value.viewAttached } : {}),\n ...(value.rendererAttached !== undefined ? { rendererAttached: value.rendererAttached } : {}),\n ...(value.activeScope ? { activeScope: Object.freeze(snapshotStringList(value.activeScope, commandId)) } : {}),\n ...(value.permissions ? { permissions: Object.freeze(snapshotStringList(value.permissions, commandId)) } : {}),\n });\n}\n\nfunction snapshotPresentation(\n value: NonNullable<EditorCommandManifest['presentation']>,\n commandId: string,\n inputSchema: EditorCommandJsonObject,\n): NonNullable<EditorCommandManifest['presentation']> {\n const category = normalizeOptionalText(value.category);\n const shortcut = normalizeOptionalText(value.shortcut);\n const inputModes = new Set(['none', 'inline-json', 'schema-form']);\n if (value.inputMode !== undefined && !inputModes.has(value.inputMode)) {\n throw new Error(`Editor command presentation input mode is invalid: ${commandId}`);\n }\n const menu = value.menu\n ? Object.freeze({\n path: Object.freeze(snapshotStringList(value.menu.path, commandId)),\n ...(normalizeOptionalText(value.menu.group) ? { group: value.menu.group!.trim() } : {}),\n ...(value.menu.order !== undefined ? { order: normalizeFiniteNumber(value.menu.order, `${commandId}.menu.order`) } : {}),\n })\n : undefined;\n const selectionBinding = value.selectionBinding\n ? snapshotSelectionBinding(value.selectionBinding, commandId, inputSchema)\n : undefined;\n return Object.freeze({\n ...(category ? { category } : {}),\n ...(value.aliases ? { aliases: Object.freeze(snapshotStringList(value.aliases, commandId)) } : {}),\n ...(value.keywords ? { keywords: Object.freeze(snapshotStringList(value.keywords, commandId)) } : {}),\n ...(value.examples ? { examples: Object.freeze(snapshotStringList(value.examples, commandId)) } : {}),\n ...(shortcut ? { shortcut } : {}),\n ...(menu ? { menu } : {}),\n ...(value.inputMode ? { inputMode: value.inputMode } : {}),\n ...(selectionBinding ? { selectionBinding } : {}),\n });\n}\n\nfunction snapshotSelectionBinding(\n value: NonNullable<NonNullable<EditorCommandManifest['presentation']>['selectionBinding']>,\n commandId: string,\n inputSchema: EditorCommandJsonObject,\n) {\n const activeId = normalizeOptionalText(value.activeId);\n const selectedIds = normalizeOptionalText(value.selectedIds);\n if (!activeId && !selectedIds) throw new Error(`Editor command selection binding is empty: ${commandId}`);\n const properties = inputSchema.properties && typeof inputSchema.properties === 'object'\n ? inputSchema.properties as Record<string, any>\n : {};\n if (activeId && properties[activeId]?.type !== 'string') {\n throw new Error(`Editor command active selection binding must target a string property: ${commandId}.${activeId}`);\n }\n if (selectedIds && (properties[selectedIds]?.type !== 'array' || properties[selectedIds]?.items?.type !== 'string')) {\n throw new Error(`Editor command multi-selection binding must target a string array property: ${commandId}.${selectedIds}`);\n }\n return Object.freeze({ ...(activeId ? { activeId } : {}), ...(selectedIds ? { selectedIds } : {}) });\n}\n\nfunction snapshotInvocation(\n invocation: EditorCommandInvocation,\n allowUnvalidatedInput = false,\n): EditorCommandInvocation {\n if (!invocation || typeof invocation !== 'object') throw new Error('Editor command invocation is required.');\n const commandId = normalizeCommandId(invocation.commandId);\n const intentCommandId = invocation.intentCommandId === undefined\n ? undefined\n : normalizeCommandId(invocation.intentCommandId);\n const requestId = normalizeOpaqueId(invocation.requestId, 'requestId');\n if (!invocation.principal || typeof invocation.principal !== 'object') {\n throw new Error('Editor command principal is required.');\n }\n const principalType = normalizeRequiredText(invocation.principal.type, 'Editor command principal type is required.');\n const source = normalizeRequiredText(invocation.source, 'Editor command source is required.');\n const principalId = normalizeOptionalText(invocation.principal.id);\n const idempotencyKey = normalizeOptionalText(invocation.idempotencyKey);\n const traceId = normalizeOptionalText(invocation.traceId);\n const traceStepId = normalizeOptionalText(invocation.traceStepId);\n const transactionId = normalizeOptionalText(invocation.transactionId);\n const clientId = normalizeOptionalText(invocation.clientId);\n return Object.freeze({\n commandId,\n ...(intentCommandId ? { intentCommandId } : {}),\n ...(invocation.input !== undefined ? {\n input: (allowUnvalidatedInput\n ? cloneUnvalidatedInput(invocation.input, '$input')\n : cloneJsonValue(invocation.input, '$input')) as never,\n } : {}),\n requestId,\n ...(idempotencyKey ? { idempotencyKey } : {}),\n principal: Object.freeze({ type: principalType, ...(principalId ? { id: principalId } : {}) }),\n source,\n ...(invocation.expectedRevision ? {\n expectedRevision: Object.freeze(snapshotExpectedRevision(invocation.expectedRevision)),\n } : {}),\n ...(traceId ? { traceId } : {}),\n ...(traceStepId ? { traceStepId } : {}),\n ...(transactionId ? { transactionId } : {}),\n ...(clientId ? { clientId } : {}),\n });\n}\n\nfunction snapshotExpectedRevision(\n value: NonNullable<EditorCommandInvocation['expectedRevision']>,\n): NonNullable<EditorCommandInvocation['expectedRevision']> {\n const result: { serviceInstanceId?: string; document?: number; scope?: number; catalog?: number } = {};\n if (value.serviceInstanceId !== undefined) {\n const serviceInstanceId = normalizeRequiredText(value.serviceInstanceId, 'expectedRevision.serviceInstanceId');\n result.serviceInstanceId = serviceInstanceId;\n }\n for (const key of ['document', 'scope', 'catalog'] as const) {\n const revision = value[key];\n if (revision === undefined) continue;\n if (!Number.isSafeInteger(revision) || revision < 0) {\n throw new Error(`Editor command expected revision is invalid: ${key}`);\n }\n result[key] = revision;\n }\n return result;\n}\n\nconst ABORTED = Symbol('editor-command-aborted');\n\nasync function awaitAbortable<T>(promise: Promise<T>, signal: AbortSignal): Promise<T | typeof ABORTED> {\n if (signal.aborted) return ABORTED;\n return new Promise<T | typeof ABORTED>((resolve, reject) => {\n const onAbort = (): void => resolve(ABORTED);\n signal.addEventListener('abort', onAbort, { once: true });\n promise.then(\n value => {\n signal.removeEventListener('abort', onAbort);\n resolve(value);\n },\n error => {\n signal.removeEventListener('abort', onAbort);\n reject(error);\n },\n );\n });\n}\n\nfunction cancelledOutcome(commandId: string): EditorCommandHandlerOutcome<never> {\n return {\n ok: false,\n diagnostics: [{\n severity: 'warning',\n source: 'command-system',\n code: 'command.cancelled',\n message: `Editor command was cancelled: ${commandId}`,\n }],\n };\n}\n\nasync function resolveAvailability(\n registration: InternalRegistration,\n signal?: AbortSignal,\n): Promise<EditorCommandAvailability> {\n if (!registration.available) return { available: true, reasons: [] };\n try {\n const pending = Promise.resolve(registration.available());\n const value = signal ? await awaitAbortable(pending, signal) : await pending;\n if (value === ABORTED) return unavailable('Editor command was cancelled.', 'command.cancelled');\n if (value === true) return { available: true, reasons: [] };\n if (value === false) return unavailable('Editor command is unavailable.');\n if (typeof value === 'string') return unavailable(value.trim() || 'Editor command is unavailable.');\n if (!value || typeof value !== 'object' || typeof value.available !== 'boolean') {\n return unavailable('Editor command availability returned an invalid result.', 'command.availabilityInvalid');\n }\n return {\n available: value.available,\n reasons: value.available || value.reasons?.length\n ? normalizeDiagnostics(value.reasons ?? [])\n : unavailable('Editor command is unavailable.').reasons,\n };\n } catch (error) {\n return unavailable(\n error instanceof Error ? error.message : String(error),\n 'command.availabilityException',\n );\n }\n}\n\nfunction unavailable(message: string, code = 'command.unavailable'): EditorCommandAvailability {\n return {\n available: false,\n reasons: [{ severity: 'error', source: 'command-system', code, message }],\n };\n}\n\nfunction validateJsonSchema(\n value: unknown,\n schema: EditorCommandJsonObject,\n path: string,\n code: string,\n): EditorCommandDiagnostic[] {\n const issues: string[] = [];\n validateSchemaNode(value, schema, path, issues);\n return issues.slice(0, MAX_SCHEMA_DIAGNOSTICS).map(message => ({\n severity: 'error',\n source: 'command-system',\n code,\n message,\n path: message.split(':', 1)[0],\n }));\n}\n\nfunction snapshotJsonSchema(value: unknown, path: string): EditorCommandJsonObject {\n const schema = cloneJsonObject(value, path);\n assertJsonSchemaDefinition(schema, path);\n return schema;\n}\n\nfunction assertJsonSchemaDefinition(rawSchema: unknown, path: string): void {\n if (typeof rawSchema === 'boolean') return;\n if (!isPlainObject(rawSchema)) throw new Error(`Editor command JSON Schema is invalid at ${path}.`);\n const schema = rawSchema as Record<string, unknown>;\n const jsonTypes = new Set(['null', 'object', 'array', 'string', 'number', 'integer', 'boolean']);\n if ('type' in schema) {\n const types = typeof schema.type === 'string' ? [schema.type] : schema.type;\n if (!Array.isArray(types) || types.length === 0\n || types.some(type => typeof type !== 'string' || !jsonTypes.has(type))\n || new Set(types).size !== types.length) {\n throw new Error(`Editor command JSON Schema type is invalid at ${path}.type.`);\n }\n }\n if ('required' in schema) {\n if (!Array.isArray(schema.required)\n || schema.required.some(key => typeof key !== 'string' || key.length === 0)\n || new Set(schema.required).size !== schema.required.length) {\n throw new Error(`Editor command JSON Schema required is invalid at ${path}.required.`);\n }\n }\n if ('properties' in schema) {\n if (!isPlainObject(schema.properties)) {\n throw new Error(`Editor command JSON Schema properties is invalid at ${path}.properties.`);\n }\n for (const [key, child] of Object.entries(schema.properties)) {\n assertJsonSchemaDefinition(child, `${path}.properties.${key}`);\n }\n }\n if ('additionalProperties' in schema\n && typeof schema.additionalProperties !== 'boolean'\n && !isPlainObject(schema.additionalProperties)) {\n throw new Error(`Editor command JSON Schema additionalProperties is invalid at ${path}.additionalProperties.`);\n }\n if (isPlainObject(schema.additionalProperties)) {\n assertJsonSchemaDefinition(schema.additionalProperties, `${path}.additionalProperties`);\n }\n if ('items' in schema) assertJsonSchemaDefinition(schema.items, `${path}.items`);\n for (const keyword of ['allOf', 'anyOf', 'oneOf'] as const) {\n if (!(keyword in schema)) continue;\n const children = schema[keyword];\n if (!Array.isArray(children) || children.length === 0) {\n throw new Error(`Editor command JSON Schema ${keyword} is invalid at ${path}.${keyword}.`);\n }\n children.forEach((child, index) => assertJsonSchemaDefinition(child, `${path}.${keyword}[${index}]`));\n }\n if ('not' in schema) assertJsonSchemaDefinition(schema.not, `${path}.not`);\n if ('enum' in schema && (!Array.isArray(schema.enum) || schema.enum.length === 0)) {\n throw new Error(`Editor command JSON Schema enum is invalid at ${path}.enum.`);\n }\n for (const keyword of ['minLength', 'maxLength', 'minItems', 'maxItems', 'minProperties', 'maxProperties'] as const) {\n if (keyword in schema && (!Number.isSafeInteger(schema[keyword]) || (schema[keyword] as number) < 0)) {\n throw new Error(`Editor command JSON Schema ${keyword} is invalid at ${path}.${keyword}.`);\n }\n }\n for (const keyword of ['minimum', 'maximum', 'exclusiveMinimum', 'exclusiveMaximum'] as const) {\n if (keyword in schema && (typeof schema[keyword] !== 'number' || !Number.isFinite(schema[keyword]))) {\n throw new Error(`Editor command JSON Schema ${keyword} is invalid at ${path}.${keyword}.`);\n }\n }\n if ('multipleOf' in schema\n && (typeof schema.multipleOf !== 'number' || !Number.isFinite(schema.multipleOf) || schema.multipleOf <= 0)) {\n throw new Error(`Editor command JSON Schema multipleOf is invalid at ${path}.multipleOf.`);\n }\n if ('uniqueItems' in schema && typeof schema.uniqueItems !== 'boolean') {\n throw new Error(`Editor command JSON Schema uniqueItems is invalid at ${path}.uniqueItems.`);\n }\n if ('pattern' in schema) {\n if (typeof schema.pattern !== 'string') {\n throw new Error(`Editor command JSON Schema pattern is invalid at ${path}.pattern.`);\n }\n try { new RegExp(schema.pattern); }\n catch { throw new Error(`Editor command JSON Schema pattern is invalid at ${path}.pattern.`); }\n }\n}\n\nfunction validateSchemaNode(value: unknown, rawSchema: unknown, path: string, issues: string[]): void {\n if (issues.length >= MAX_SCHEMA_DIAGNOSTICS) return;\n if (rawSchema === true || rawSchema === undefined) return;\n if (rawSchema === false) {\n issues.push(`${path}: value is not allowed`);\n return;\n }\n if (!rawSchema || typeof rawSchema !== 'object' || Array.isArray(rawSchema)) {\n issues.push(`${path}: schema is invalid`);\n return;\n }\n const schema = rawSchema as Record<string, unknown>;\n if (Array.isArray(schema.allOf)) {\n for (const child of schema.allOf) validateSchemaNode(value, child, path, issues);\n }\n if (Array.isArray(schema.anyOf)) {\n const matched = schema.anyOf.some(child => {\n const childIssues: string[] = [];\n validateSchemaNode(value, child, path, childIssues);\n return childIssues.length === 0;\n });\n if (!matched) issues.push(`${path}: value does not match any allowed schema`);\n }\n if (Array.isArray(schema.oneOf)) {\n const matches = schema.oneOf.filter(child => {\n const childIssues: string[] = [];\n validateSchemaNode(value, child, path, childIssues);\n return childIssues.length === 0;\n }).length;\n if (matches !== 1) issues.push(`${path}: value must match exactly one allowed schema`);\n }\n if (schema.not !== undefined) {\n const childIssues: string[] = [];\n validateSchemaNode(value, schema.not, path, childIssues);\n if (childIssues.length === 0) issues.push(`${path}: value matches a disallowed schema`);\n }\n if (Array.isArray(schema.enum) && !schema.enum.some(entry => deepJsonEqual(entry, value))) {\n issues.push(`${path}: value is not in the allowed enum`);\n return;\n }\n if ('const' in schema && !deepJsonEqual(schema.const, value)) {\n issues.push(`${path}: value does not match the required constant`);\n return;\n }\n const allowedTypes = typeof schema.type === 'string'\n ? [schema.type]\n : Array.isArray(schema.type)\n ? schema.type.filter(type => typeof type === 'string') as string[]\n : [];\n if (allowedTypes.length && !allowedTypes.some(type => matchesJsonType(value, type))) {\n issues.push(`${path}: expected ${allowedTypes.join(' or ')}`);\n return;\n }\n if (typeof value === 'string') {\n if (typeof schema.minLength === 'number' && value.length < schema.minLength) {\n issues.push(`${path}: string is shorter than ${schema.minLength}`);\n }\n if (typeof schema.maxLength === 'number' && value.length > schema.maxLength) {\n issues.push(`${path}: string is longer than ${schema.maxLength}`);\n }\n if (typeof schema.pattern === 'string') {\n try {\n if (!new RegExp(schema.pattern).test(value)) issues.push(`${path}: string does not match pattern`);\n } catch {\n issues.push(`${path}: schema pattern is invalid`);\n }\n }\n }\n if (typeof value === 'number') {\n if (typeof schema.minimum === 'number' && value < schema.minimum) issues.push(`${path}: number is below minimum`);\n if (typeof schema.maximum === 'number' && value > schema.maximum) issues.push(`${path}: number is above maximum`);\n if (typeof schema.exclusiveMinimum === 'number' && value <= schema.exclusiveMinimum) issues.push(`${path}: number is not above exclusive minimum`);\n if (typeof schema.exclusiveMaximum === 'number' && value >= schema.exclusiveMaximum) issues.push(`${path}: number is not below exclusive maximum`);\n if (typeof schema.multipleOf === 'number' && !isJsonNumberMultipleOf(value, schema.multipleOf)) {\n issues.push(`${path}: number is not a multiple of ${schema.multipleOf}`);\n }\n }\n if (Array.isArray(value)) {\n if (typeof schema.minItems === 'number' && value.length < schema.minItems) issues.push(`${path}: array has too few items`);\n if (typeof schema.maxItems === 'number' && value.length > schema.maxItems) issues.push(`${path}: array has too many items`);\n if (schema.uniqueItems === true && value.some((entry, index) => value.slice(0, index).some(previous => deepJsonEqual(previous, entry)))) {\n issues.push(`${path}: array items are not unique`);\n }\n if (schema.items !== undefined) {\n value.forEach((entry, index) => validateSchemaNode(entry, schema.items, `${path}[${index}]`, issues));\n }\n }\n if (isPlainObject(value)) {\n const properties = isPlainObject(schema.properties) ? schema.properties : {};\n const required = Array.isArray(schema.required)\n ? schema.required.filter(key => typeof key === 'string') as string[]\n : [];\n if (typeof schema.minProperties === 'number' && Object.keys(value).length < schema.minProperties) {\n issues.push(`${path}: object has too few properties`);\n }\n if (typeof schema.maxProperties === 'number' && Object.keys(value).length > schema.maxProperties) {\n issues.push(`${path}: object has too many properties`);\n }\n for (const key of required) {\n if (!hasOwn(value, key)) issues.push(`${path}.${key}: required property is missing`);\n }\n for (const [key, child] of Object.entries(value)) {\n if (hasOwn(properties, key)) {\n validateSchemaNode(child, properties[key], `${path}.${key}`, issues);\n } else if (schema.additionalProperties === false) {\n issues.push(`${path}.${key}: additional property is not allowed`);\n } else if (isPlainObject(schema.additionalProperties)) {\n validateSchemaNode(child, schema.additionalProperties, `${path}.${key}`, issues);\n }\n }\n }\n}\n\nfunction matchesJsonType(value: unknown, type: string): boolean {\n switch (type) {\n case 'null': return value === null;\n case 'object': return isPlainObject(value);\n case 'array': return Array.isArray(value);\n case 'string': return typeof value === 'string';\n case 'number': return typeof value === 'number' && Number.isFinite(value);\n case 'integer': return typeof value === 'number' && Number.isSafeInteger(value);\n case 'boolean': return typeof value === 'boolean';\n default: return false;\n }\n}\n\nfunction hasOwn(value: object, key: PropertyKey): boolean {\n return Object.prototype.hasOwnProperty.call(value, key);\n}\n\nfunction isJsonNumberMultipleOf(value: number, multiple: number): boolean {\n const left = toDecimalInteger(value);\n const right = toDecimalInteger(multiple);\n const numerator = left.coefficient * (10n ** BigInt(right.scale));\n const denominator = right.coefficient * (10n ** BigInt(left.scale));\n return denominator !== 0n && numerator % denominator === 0n;\n}\n\nfunction toDecimalInteger(value: number): { coefficient: bigint; scale: number } {\n const text = value.toString().toLowerCase();\n const [mantissa, exponentText] = text.split('e');\n const exponent = exponentText === undefined ? 0 : Number(exponentText);\n const negative = mantissa!.startsWith('-');\n const unsigned = negative ? mantissa!.slice(1) : mantissa!;\n const [integerPart, fractionalPart = ''] = unsigned.split('.');\n const digits = `${integerPart}${fractionalPart}`.replace(/^0+(?=\\d)/, '') || '0';\n let coefficient = BigInt(digits);\n if (negative) coefficient = -coefficient;\n const scale = fractionalPart.length - exponent;\n if (scale >= 0) return { coefficient, scale };\n return { coefficient: coefficient * (10n ** BigInt(-scale)), scale: 0 };\n}\n\nfunction normalizeDiagnostics(\n diagnostics: readonly EditorCommandDiagnostic[],\n): EditorCommandDiagnostic[] {\n if (!Array.isArray(diagnostics)) return unavailable('Command diagnostics are invalid.').reasons;\n return diagnostics.slice(0, MAX_SCHEMA_DIAGNOSTICS).map((diagnostic, index) => {\n if (!diagnostic || typeof diagnostic !== 'object') {\n return {\n severity: 'error', source: 'command-system', code: 'command.diagnosticInvalid',\n message: `Command diagnostic is invalid at index ${index}.`,\n };\n }\n return {\n severity: diagnostic.severity === 'info' || diagnostic.severity === 'warning'\n ? diagnostic.severity\n : 'error',\n source: normalizeOptionalText(diagnostic.source) ?? 'command',\n code: normalizeOptionalText(diagnostic.code) ?? 'command.failed',\n message: normalizeOptionalText(diagnostic.message) ?? 'Editor command failed.',\n ...(normalizeOptionalText(diagnostic.path) ? { path: diagnostic.path!.trim() } : {}),\n ...(normalizeOptionalText(diagnostic.objectId) ? { objectId: diagnostic.objectId!.trim() } : {}),\n ...(diagnostic.details ? { details: cloneJsonObject(diagnostic.details, '$diagnostic.details') } : {}),\n };\n });\n}\n\nfunction normalizeCatalogQuery(query: EditorCommandCatalogQuery): Required<Pick<EditorCommandCatalogQuery, 'limit'>> & EditorCommandCatalogQuery {\n const text = normalizeOptionalText(query.text)?.toLocaleLowerCase();\n const limit = query.limit === undefined ? 200 : query.limit;\n if (!Number.isInteger(limit) || limit < 1 || limit > 1000) {\n throw new Error('Editor command catalog limit must be an integer between 1 and 1000.');\n }\n return { ...query, ...(text ? { text } : {}), limit };\n}\n\nfunction scoreManifest(manifest: EditorCommandManifest, query: string | undefined): number {\n if (!query) return 0;\n const id = manifest.id.toLocaleLowerCase();\n const title = manifest.title.toLocaleLowerCase();\n const aliases = manifest.presentation?.aliases?.map(value => value.toLocaleLowerCase()) ?? [];\n const keywords = manifest.presentation?.keywords?.map(value => value.toLocaleLowerCase()) ?? [];\n if (id === query) return 100;\n if (aliases.includes(query)) return 90;\n if (id.startsWith(query)) return 80;\n if (title.startsWith(query)) return 70;\n if (id.includes(query)) return 60;\n if (title.includes(query)) return 50;\n if (aliases.some(value => value.includes(query))) return 40;\n if (keywords.some(value => value.includes(query))) return 30;\n return manifest.description?.toLocaleLowerCase().includes(query) ? 10 : -1;\n}\n\nfunction createHandle<TOutput>(\n record: OperationRecord,\n reused: boolean,\n): EditorCommandInvocationHandle<TOutput> {\n return {\n operationId: record.snapshot.operationId,\n requestId: record.snapshot.requestId,\n reused,\n completion: record.completion as Promise<EditorCommandExecutionResult<TOutput>>,\n };\n}\n\nfunction createIdempotencyScope(invocation: EditorCommandInvocation, authorityScopeId: string): string {\n return stableStringify([\n authorityScopeId,\n invocation.principal.type,\n invocation.principal.id ?? '',\n invocation.source,\n invocation.commandId,\n invocation.idempotencyKey ?? '',\n ]);\n}\n\nfunction cloneManifest(manifest: EditorCommandManifest): EditorCommandManifest {\n return cloneJsonValue(manifest, '$manifest') as unknown as EditorCommandManifest;\n}\n\nfunction cloneOperationSnapshot<TOutput>(\n snapshot: EditorCommandOperationSnapshot<TOutput>,\n): EditorCommandOperationSnapshot<TOutput> {\n return cloneJsonValue(snapshot, '$operation') as unknown as EditorCommandOperationSnapshot<TOutput>;\n}\n\nfunction cloneBoundedResult<T>(value: T, maxBytes: number): T {\n if (value === undefined) throw new Error('Editor command result is not JSON-serializable: undefined.');\n let json: string;\n try {\n json = JSON.stringify(value);\n } catch (error) {\n throw new Error(`Editor command result is not serializable: ${error instanceof Error ? error.message : String(error)}`);\n }\n if (json === undefined) throw new Error('Editor command result is not serializable.');\n const byteLength = new TextEncoder().encode(json).byteLength;\n if (byteLength > maxBytes) {\n throw new EditorCommandResultTooLargeError(\n `Editor command result exceeds the ${maxBytes} byte limit (${byteLength} bytes).`,\n );\n }\n return JSON.parse(json) as T;\n}\n\nclass EditorCommandResultTooLargeError extends Error {}\n\nfunction cloneJsonObject(value: unknown, path: string): EditorCommandJsonObject {\n const cloned = cloneJsonValue(value, path);\n if (!isPlainObject(cloned)) throw new Error(`Editor command JSON object is required at ${path}.`);\n return Object.freeze(cloned) as EditorCommandJsonObject;\n}\n\nfunction cloneJsonValue(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)) return Object.freeze(value.map((entry, index) => cloneJsonValue(entry, `${path}[${index}]`)));\n if (!isPlainObject(value)) throw new Error(`Editor command value must be JSON-compatible at ${path}.`);\n const result: Record<string, unknown> = Object.create(null) as Record<string, unknown>;\n for (const [key, entry] of Object.entries(value)) {\n if (entry === undefined) continue;\n result[key] = cloneJsonValue(entry, `${path}.${key}`);\n }\n return Object.freeze(result);\n}\n\nfunction cloneUnvalidatedInput(value: unknown, path: string): unknown {\n if (value === null || typeof value === 'string' || typeof value === 'boolean') return value;\n if (typeof value === 'number') return value;\n if (Array.isArray(value)) return Object.freeze(value.map((entry, index) => cloneUnvalidatedInput(entry, `${path}[${index}]`)));\n if (!isPlainObject(value)) throw new Error(`Unvalidated Editor command input must contain plain values at ${path}.`);\n const result: Record<string, unknown> = Object.create(null) as Record<string, unknown>;\n for (const [key, entry] of Object.entries(value)) {\n if (entry === undefined) continue;\n result[key] = cloneUnvalidatedInput(entry, `${path}.${key}`);\n }\n return Object.freeze(result);\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return false;\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n\nfunction deepJsonEqual(left: unknown, right: unknown): boolean {\n try { return stableStringify(left) === stableStringify(right); }\n catch { return false; }\n}\n\nfunction stableStringify(value: unknown): string {\n if (value === null || typeof value === 'string' || typeof value === 'boolean') return JSON.stringify(value);\n if (typeof value === 'number') {\n if (Number.isFinite(value)) return JSON.stringify(value);\n if (Number.isNaN(value)) return '\"__non_json_finite_nan__\"';\n return value > 0 ? '\"__non_json_finite_infinity__\"' : '\"__non_json_finite_negative_infinity__\"';\n }\n if (Array.isArray(value)) return `[${value.map(stableStringify).join(',')}]`;\n if (!isPlainObject(value)) throw new Error('Editor command idempotency input must be JSON-compatible.');\n return `{${Object.keys(value).sort().filter(key => value[key] !== undefined).map(key => (\n `${JSON.stringify(key)}:${stableStringify(value[key])}`\n )).join(',')}}`;\n}\n\nfunction snapshotStringList(value: readonly string[], commandId: string): string[] {\n if (!Array.isArray(value)) throw new Error(`Editor command string list is invalid: ${commandId}`);\n return [...new Set(value.map(entry => normalizeRequiredText(\n entry,\n `Editor command string list contains an empty value: ${commandId}`,\n )))];\n}\n\nfunction normalizeCommandId(value: string): string {\n const id = normalizeRequiredText(value, 'Editor command id is required.');\n if (id.length > 160 || /\\s/.test(id)) throw new Error(`Editor command id is invalid: ${id}`);\n return id;\n}\n\nfunction normalizeOpaqueId(value: string, label: string): string {\n const id = normalizeRequiredText(value, `Editor command ${label} is required.`);\n if (id.length > 256) throw new Error(`Editor command ${label} is too long.`);\n return id;\n}\n\nfunction normalizeRequiredText(value: unknown, message: string): string {\n if (typeof value !== 'string' || !value.trim()) throw new Error(message);\n return value.trim();\n}\n\nfunction normalizeOptionalText(value: unknown): string | undefined {\n return typeof value === 'string' && value.trim() ? value.trim() : undefined;\n}\n\nfunction normalizeFiniteNumber(value: unknown, path: string): number {\n if (typeof value !== 'number' || !Number.isFinite(value)) {\n throw new Error(`Editor command number is invalid: ${path}`);\n }\n return value;\n}\n\nfunction normalizePositiveInteger(value: number | undefined, fallback: number): number {\n return Number.isInteger(value) && value! > 0 ? value! : fallback;\n}\n\nfunction isTerminalStatus(status: EditorCommandOperationSnapshot['status']): boolean {\n return status === 'completed' || status === 'failed' || status === 'cancelled';\n}\n\nfunction createDefaultOperationIdFactory(): () => string {\n let sequence = 0;\n return () => `editor-command-${Date.now().toString(36)}-${(++sequence).toString(36)}`;\n}\n"]}
@@ -1,9 +1,10 @@
1
1
  import { type FpsCommand, type FpsDiagnostic, type FpsDisposer, type FpsPluginEntry, type FpsPluginEnvironmentModule, type FpsPluginContext, type FpsPluginManifest, type FpsPluginScope, type FpsServiceToken } from '@fps-games/plugin-api';
2
2
  import { createFpsPluginHost, type FpsPluginHost, type FpsPluginHostInspection } from '@fps-games/plugin-host';
3
- import { type EditorAgentBridgeCapabilityManifest } from '@fps-games/editor-protocol';
3
+ import type { EditorCommandManifest } from '@fps-games/editor-protocol';
4
4
  import { type FpsEditorEventContext, type FpsEditorEventPublisher } from './events.js';
5
5
  import { type FpsEditorLifecycleParticipant } from './lifecycle.js';
6
6
  import { type EditorToolRegistry, type EditorToolRegistration } from './editor-tools.js';
7
+ import type { EditorAuthoringHost, EditorAuthoringHostCommandContext } from './editor-authoring-host.js';
7
8
  export type FpsEditorContributionKind = 'hierarchy' | 'inspector' | 'panel' | 'command' | 'capability' | 'tool' | 'lifecycle-participant';
8
9
  export interface FpsEditorContribution<TValue = unknown> {
9
10
  readonly id: string;
@@ -38,8 +39,7 @@ export interface FpsEditorPluginHost {
38
39
  reportDiagnostic(diagnostic: FpsDiagnostic, context?: FpsEditorEventContext): void;
39
40
  inspect(): FpsPluginHostInspection;
40
41
  acquireConsumer(label?: string): () => void;
41
- listCommands(): readonly FpsEditorCommandRegistration[];
42
- executeCommand<TInput, TOutput>(command: FpsCommand<TInput, TOutput>, input: TInput): Promise<TOutput>;
42
+ mountCommands<TDocument, TPatch>(authoringHost: EditorAuthoringHost<TDocument, TPatch>): () => void;
43
43
  start(): Promise<void>;
44
44
  stop(): Promise<void>;
45
45
  dispose(): Promise<void>;
@@ -57,11 +57,10 @@ export interface FpsEditorPluginLifecycleScopeHost {
57
57
  export declare function getFpsEditorPluginLifecycleScopeHost(host: FpsEditorPluginHost): FpsEditorPluginLifecycleScopeHost;
58
58
  export interface FpsEditorCommandRegistration<TInput = unknown, TOutput = unknown> {
59
59
  readonly command: FpsCommand<TInput, TOutput>;
60
- readonly title: string;
61
- readonly description?: string;
62
- readonly agent?: EditorAgentBridgeCapabilityManifest;
60
+ readonly manifest: EditorCommandManifest;
63
61
  }
64
- export declare function registerFpsEditorCommand<TInput, TOutput>(context: FpsPluginContext, registration: FpsEditorCommandRegistration<TInput, TOutput>, handler: (input: TInput) => TOutput | Promise<TOutput>): void;
62
+ export type FpsEditorCommandHandler<TInput = unknown, TOutput = unknown> = (input: TInput, context: EditorAuthoringHostCommandContext<unknown, unknown>) => TOutput | Promise<TOutput>;
63
+ export declare function registerFpsEditorCommand<TInput, TOutput>(context: FpsPluginContext, registration: FpsEditorCommandRegistration<TInput, TOutput>, handler: FpsEditorCommandHandler<TInput, TOutput>): void;
65
64
  export declare function registerFpsEditorLifecycleParticipant(context: FpsPluginContext, participant: FpsEditorLifecycleParticipant): FpsDisposer;
66
65
  export declare function registerFpsEditorTool(context: FpsPluginContext, registration: EditorToolRegistration, priority?: number): FpsDisposer;
67
66
  export declare function resolveFpsEditorTools(registry: FpsEditorContributionRegistry): readonly EditorToolRegistration[];
@@ -1 +1 @@
1
- {"version":3,"file":"editor-plugin-host.d.ts","sourceRoot":"","sources":["../src/editor-plugin-host.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EAKf,KAAK,aAAa,EAClB,KAAK,WAAW,EAEhB,KAAK,cAAc,EACnB,KAAK,0BAA0B,EAC/B,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mB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AAY,EAAE,sBAAsB,EACpC,QAAQ,SAAI,GACX,WAAW,CAWb;AAED,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,6BAA6B,GACtC,SAAS,sBAAsB,EAAE,CAcnC;AAED,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,6BAA6B,EAC5C,KAAK,EAAE,kBAAkB,GACxB,WAAW,CA4Bb;AAED,wBAAgB,qCAAqC,CACnD,QAAQ,EAAE,6BAA6B,GACtC,SAAS,6BAA6B,EAAE,CAU1C;AAED,wBAAgB,mCAAmC,IAAI,6BAA6B,CA2CnF;AAED,wBAAgB,6BAA6B,CAAC,MAAM,EAClD,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,qBAAqB,CAAC,MAAM,CAAC,GAC1C,WAAW,CA2Bb;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,0BAA0B,GAAG,mBAAmB,CAoalG;AAED,MAAM,WAAW,2CAA2C;IAC1D,QAAQ,CAAC,MAAM,EAAE,0BAA0B,CAAC;IAC5C,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS;QAAE,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IAC1F,QAAQ,CAAC,MAAM,CAAC,EAAE,0BAA0B,CAAC,QAAQ,CAAC,CAAC;CACxD;AAED,wBAAgB,8CAA8C,CAC5D,OAAO,EAAE,2CAA2C,GACnD,mBAAmB,CAoBrB"}
@@ -1,9 +1,9 @@
1
1
  import { defineFpsServiceToken, defineFpsPluginEntry, resolveFpsPluginEnvironmentScopes, } from '@fps-games/plugin-api';
2
2
  import { createFpsPluginHost, } from '@fps-games/plugin-host';
3
- import { EDITOR_AGENT_BRIDGE_SCHEMA_VERSION, } from '@fps-games/editor-protocol';
4
3
  import { FPS_EDITOR_DIAGNOSTIC_REPORTED, createFpsEditorEventPublisher, } from './events.js';
5
4
  import { FPS_EDITOR_LIFECYCLE_TRANSITION_TYPES, assertFpsEditorLifecycleScopeTopology, } from './lifecycle.js';
6
5
  import { snapshotEditorToolRegistration, } from './editor-tools.js';
6
+ import { snapshotEditorCommandManifest } from './editor-command-system.js';
7
7
  const UNAVAILABLE_EDITOR_EVENT_ROUTE = Object.freeze({
8
8
  subscribe: () => () => { },
9
9
  publish: () => Promise.resolve(),
@@ -27,29 +27,23 @@ export function getFpsEditorPluginLifecycleScopeHost(host) {
27
27
  throw new Error('Editor Plugin lifecycle scope host is unavailable.');
28
28
  return createScopeHost();
29
29
  }
30
- const editorCommandDispatchers = new WeakMap();
30
+ const editorCommandHandlers = new WeakMap();
31
31
  export function registerFpsEditorCommand(context, registration, handler) {
32
- const trusted = requireTrustedContributionContext(context);
32
+ requireTrustedContributionContext(context);
33
33
  assertApplicationContributionScope(context);
34
34
  const snapshot = snapshotEditorCommandRegistration(registration);
35
- const unregisterHandler = context.commands.register(snapshot.command, handler);
36
- trusted.addDisposer(unregisterHandler);
37
- try {
38
- const contribution = Object.freeze({
39
- type: 'editor.command',
40
- registration: snapshot,
41
- });
42
- editorCommandDispatchers.set(contribution, context.commands);
43
- registerFpsEditorContribution(context, {
44
- id: snapshot.command.id,
45
- kind: 'command',
46
- value: contribution,
47
- });
48
- }
49
- catch (error) {
50
- unregisterHandler();
51
- throw error;
52
- }
35
+ if (typeof handler !== 'function')
36
+ throw new Error(`Editor command handler is required: ${snapshot.command.id}`);
37
+ const contribution = Object.freeze({
38
+ type: 'editor.command',
39
+ registration: snapshot,
40
+ });
41
+ editorCommandHandlers.set(contribution, handler);
42
+ registerFpsEditorContribution(context, {
43
+ id: snapshot.command.id,
44
+ kind: 'command',
45
+ value: contribution,
46
+ });
53
47
  }
54
48
  export function registerFpsEditorLifecycleParticipant(context, participant) {
55
49
  const snapshot = snapshotEditorLifecycleParticipant(participant);
@@ -535,25 +529,48 @@ export function createFpsEditorPluginHost(options) {
535
529
  });
536
530
  },
537
531
  acquireConsumer,
538
- listCommands: () => {
532
+ mountCommands(authoringHost) {
539
533
  assertStableObservation();
540
- return resolveEditorCommandRegistrations(contributions);
541
- },
542
- executeCommand(command, input) {
543
- const transitioning = isLifecycleTransitioning();
544
- if (host.state !== 'started' || transitioning || hasLifecycleCleanupFailure()) {
545
- throw new Error(`Editor Plugin Host commands require an idle started host, got: ${hasLifecycleCleanupFailure() ? 'cleanup-failed' : host.state}${transitioning ? ' (transitioning)' : ''}`);
534
+ const unregister = [];
535
+ try {
536
+ for (const contribution of resolveEditorCommandContributions(contributions)) {
537
+ const { registration } = contribution;
538
+ const handler = editorCommandHandlers.get(contribution);
539
+ if (!handler)
540
+ throw new Error(`Editor command handler is unavailable: ${registration.command.id}`);
541
+ unregister.push(authoringHost.registerCommand({
542
+ manifest: registration.manifest,
543
+ available: () => host.state === 'started'
544
+ && !isLifecycleTransitioning()
545
+ && !hasLifecycleCleanupFailure(),
546
+ handler: async (input, context) => {
547
+ const release = acquireConsumer(`command:${registration.command.id}`);
548
+ try {
549
+ return {
550
+ ok: true,
551
+ output: await handler(input, context),
552
+ };
553
+ }
554
+ finally {
555
+ release();
556
+ }
557
+ },
558
+ }));
559
+ }
546
560
  }
547
- const contribution = resolveEditorCommandContribution(contributions, command.id);
548
- if (!contribution)
549
- throw new Error(`Editor command is not contributed by this host: ${command.id}`);
550
- const dispatcher = editorCommandDispatchers.get(contribution);
551
- if (!dispatcher)
552
- throw new Error(`Editor command dispatcher is unavailable: ${command.id}`);
553
- const release = acquireConsumer(`command:${command.id}`);
554
- return dispatcher.execute(command, input).finally(() => {
555
- release();
556
- });
561
+ catch (error) {
562
+ for (const dispose of unregister.reverse())
563
+ dispose();
564
+ throw error;
565
+ }
566
+ let active = true;
567
+ return () => {
568
+ if (!active)
569
+ return;
570
+ active = false;
571
+ for (const dispose of unregister.reverse())
572
+ dispose();
573
+ };
557
574
  },
558
575
  start: () => host.start(),
559
576
  stop: () => {
@@ -656,25 +673,15 @@ function assertApplicationContributionScope(context) {
656
673
  throw new Error(`Editor contributions are application-scope extension definitions; ${context.scope} scopes may own resources but cannot register global contributions.`);
657
674
  }
658
675
  }
659
- function resolveEditorCommandRegistrations(registry) {
676
+ function resolveEditorCommandContributions(registry) {
660
677
  return registry.list('command').map(contribution => {
661
678
  const value = contribution.value;
662
679
  if (!isEditorCommandContribution(value) || value.registration.command.id !== contribution.id) {
663
680
  throw new Error(`Invalid Editor command contribution: ${contribution.id}`);
664
681
  }
665
- return value.registration;
682
+ return value;
666
683
  });
667
684
  }
668
- function resolveEditorCommandContribution(registry, commandId) {
669
- const contribution = registry.get(commandId);
670
- if (!contribution || contribution.kind !== 'command')
671
- return null;
672
- const value = contribution.value;
673
- if (!isEditorCommandContribution(value) || value.registration.command.id !== commandId) {
674
- throw new Error(`Invalid Editor command contribution: ${commandId}`);
675
- }
676
- return value;
677
- }
678
685
  function isEditorCommandContribution(value) {
679
686
  if (!value || typeof value !== 'object' || Array.isArray(value))
680
687
  return false;
@@ -686,18 +693,13 @@ function isEditorCommandContribution(value) {
686
693
  function snapshotEditorCommandRegistration(registration) {
687
694
  if (registration.command?.kind !== 'command')
688
695
  throw new Error('Editor command registration requires a command token.');
689
- const title = registration.title?.trim();
690
- if (!title)
691
- throw new Error(`Editor command title is required: ${registration.command.id}`);
692
- const description = registration.description?.trim();
693
- const agent = registration.agent
694
- ? snapshotEditorAgentCapability(registration.command.id, registration.agent)
695
- : undefined;
696
+ const manifest = snapshotEditorCommandManifest(registration.manifest);
697
+ if (manifest.id !== registration.command.id) {
698
+ throw new Error(`Editor command token and manifest ids must match: ${registration.command.id} != ${manifest.id}`);
699
+ }
696
700
  return Object.freeze({
697
701
  command: registration.command,
698
- title,
699
- ...(description ? { description } : {}),
700
- ...(agent ? { agent } : {}),
702
+ manifest,
701
703
  });
702
704
  }
703
705
  function snapshotEditorLifecycleParticipant(value) {
@@ -729,49 +731,6 @@ function snapshotEditorLifecycleParticipant(value) {
729
731
  ...(participant.failed ? { failed: participant.failed } : {}),
730
732
  });
731
733
  }
732
- function snapshotEditorAgentCapability(commandId, manifest) {
733
- if (manifest.schemaVersion !== EDITOR_AGENT_BRIDGE_SCHEMA_VERSION) {
734
- throw new Error(`Editor command Agent capability schema mismatch: ${commandId}`);
735
- }
736
- if (manifest.id !== commandId) {
737
- throw new Error(`Editor command and Agent capability ids must match: ${commandId} != ${manifest.id}`);
738
- }
739
- if (!manifest.title?.trim())
740
- throw new Error(`Editor command Agent capability title is required: ${commandId}`);
741
- if (manifest.access !== 'read' && manifest.access !== 'write') {
742
- throw new Error(`Editor command Agent capability access is invalid: ${commandId}`);
743
- }
744
- return Object.freeze({
745
- ...manifest,
746
- title: manifest.title.trim(),
747
- ...(manifest.description?.trim() ? { description: manifest.description.trim() } : {}),
748
- ...(manifest.inputSchema ? { inputSchema: cloneEditorJsonObject(manifest.inputSchema) } : {}),
749
- ...(manifest.outputSchema ? { outputSchema: cloneEditorJsonObject(manifest.outputSchema) } : {}),
750
- });
751
- }
752
- function cloneEditorJsonObject(value) {
753
- return cloneEditorJsonValue(value, '$');
754
- }
755
- function cloneEditorJsonValue(value, path) {
756
- if (value === null || typeof value === 'string' || typeof value === 'boolean')
757
- return value;
758
- if (typeof value === 'number' && Number.isFinite(value))
759
- return value;
760
- if (Array.isArray(value)) {
761
- return Object.freeze(value.map((entry, index) => cloneEditorJsonValue(entry, `${path}[${index}]`)));
762
- }
763
- if (!value || typeof value !== 'object')
764
- throw new Error(`Editor Agent schema contains invalid value at ${path}`);
765
- const prototype = Object.getPrototypeOf(value);
766
- if (prototype !== Object.prototype && prototype !== null) {
767
- throw new Error(`Editor Agent schema must contain plain objects at ${path}`);
768
- }
769
- const result = {};
770
- for (const key of Object.keys(value)) {
771
- result[key] = cloneEditorJsonValue(value[key], `${path}.${key}`);
772
- }
773
- return Object.freeze(result);
774
- }
775
734
  function assertNoEditorPluginHostConsumers(consumers, operation) {
776
735
  if (consumers.size === 0)
777
736
  return;