@salsita-ai/sdk 0.50.0-develop.9440e83ee3 → 0.50.0-develop.95b896fd8c

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 (573) hide show
  1. package/README.md +1 -1
  2. package/dist/application/index.d.ts +1 -0
  3. package/dist/application/index.js +1 -1
  4. package/dist/application/mount-application.d.ts +1 -1
  5. package/dist/application/mount-application.js +1 -1
  6. package/dist/application/mount-configurator.d.ts +19 -0
  7. package/dist/application/mount-configurator.js +1 -0
  8. package/dist/application/mounted-application-runtime.d.ts +4 -0
  9. package/dist/application/mounted-application-runtime.js +1 -0
  10. package/dist/application/register-web-component.d.ts +2 -0
  11. package/dist/application/register-web-component.js +1 -0
  12. package/dist/application-spec/core/enhanced-json-value.d.ts +2 -31
  13. package/dist/application-spec/core/enhanced-json-value.js +1 -1
  14. package/dist/application-spec/core/index.d.ts +1 -3
  15. package/dist/application-spec/core/index.js +1 -1
  16. package/dist/application-spec/core/json-schema.d.ts +2 -52
  17. package/dist/application-spec/core/markers/index.d.ts +1 -1
  18. package/dist/application-spec/core/markers/index.js +1 -1
  19. package/dist/application-spec/core/markers/msg-marker.d.ts +2 -28
  20. package/dist/application-spec/core/markers/msg-marker.js +1 -1
  21. package/dist/application-spec/core/markers/raw-eval-write-marker.d.ts +1 -1
  22. package/dist/application-spec/core/markers/raw-eval-write-marker.js +1 -1
  23. package/dist/application-spec/core/markers/raw-read-write-marker.js +1 -1
  24. package/dist/application-spec/errors/diagnostic-codes.d.ts +1 -0
  25. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  26. package/dist/application-spec/errors/diagnostic-messages.d.ts +1 -0
  27. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  28. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  29. package/dist/application-spec/generate-application/code/templates/index.d.ts +2 -6
  30. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  31. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.d.ts +10 -0
  32. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +7 -0
  33. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  34. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +12 -6
  35. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +1 -1
  36. package/dist/application-spec/generate-application/implementations/phx-application-types.d.ts +25 -0
  37. package/dist/application-spec/generate-application/implementations/phx-application-types.js +1 -0
  38. package/dist/application-spec/generate-application/implementations/phx-domain.d.ts +36 -0
  39. package/dist/application-spec/generate-application/implementations/phx-domain.js +1 -0
  40. package/dist/application-spec/generate-application/implementations/phx-model.d.ts +24 -0
  41. package/dist/application-spec/generate-application/implementations/phx-model.js +1 -0
  42. package/dist/application-spec/generate-application/implementations/phx.d.ts +22 -0
  43. package/dist/application-spec/generate-application/implementations/phx.js +1 -0
  44. package/dist/application-spec/generate-application/index.d.ts +2 -0
  45. package/dist/application-spec/generate-application/index.js +1 -1
  46. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +3 -4
  47. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +7 -4
  48. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
  49. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.d.ts +16 -0
  50. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.js +1 -0
  51. package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +17 -4
  52. package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
  53. package/dist/application-spec/generate-application/runtime/application-spec-slice.d.ts +71 -0
  54. package/dist/application-spec/generate-application/runtime/application-spec-slice.js +1 -0
  55. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +3 -4
  56. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +7 -5
  57. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
  58. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.d.ts +16 -0
  59. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.js +1 -0
  60. package/dist/application-spec/generate-application/runtime/create-application.d.ts +57 -0
  61. package/dist/application-spec/generate-application/runtime/create-application.js +1 -0
  62. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +2 -2
  63. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.d.ts +1 -1
  64. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +1 -1
  65. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +1 -1
  66. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +1 -1
  67. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.d.ts +1 -1
  68. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.js +1 -1
  69. package/dist/application-spec/generate-application/runtime/index.d.ts +8 -0
  70. package/dist/application-spec/generate-application/runtime/index.js +1 -0
  71. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +1 -1
  72. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
  73. package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.d.ts +1 -1
  74. package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +1 -2
  75. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +9 -4
  76. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
  77. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +1 -2
  78. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.js +1 -1
  79. package/dist/application-spec/generate-application/runtime/sections/preset-runtime.d.ts +2 -3
  80. package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +1 -1
  81. package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.d.ts +1 -1
  82. package/dist/application-spec/generate-application/runtime/spec-runtime.d.ts +21 -0
  83. package/dist/application-spec/generate-application/runtime/spec-runtime.js +1 -0
  84. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.d.ts +3 -2
  85. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +44 -9
  86. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.js +1 -1
  87. package/dist/application-spec/generate-application/runtime-spec/spec-code-id.d.ts +1 -1
  88. package/dist/application-spec/parse-application-files/parse-application-files.js +1 -1
  89. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.d.ts +1 -1
  90. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.js +1 -1
  91. package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding.d.ts +3 -13
  92. package/dist/application-spec/parse-application-files/spec/components/bindings/write-binding.d.ts +4 -32
  93. package/dist/application-spec/parse-application-files/spec/components/component-filter.d.ts +4 -10
  94. package/dist/application-spec/parse-application-files/spec/components/components.d.ts +3 -4
  95. package/dist/application-spec/parse-application-files/spec/components/index.d.ts +1 -2
  96. package/dist/application-spec/parse-application-files/spec/components/index.js +1 -1
  97. package/dist/application-spec/parse-application-files/spec/components/sdk-component-entry.d.ts +1 -1
  98. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.d.ts +2 -3
  99. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.js +1 -1
  100. package/dist/application-spec/parse-application-files/spec/components/user-components.d.ts +2 -3
  101. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +2 -2
  102. package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +7 -29
  103. package/dist/application-spec/parse-application-files/spec/expressions/index.d.ts +0 -1
  104. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.d.ts +4 -71
  105. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.js +1 -1
  106. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts +2 -2
  107. package/dist/application-spec/parse-application-files/spec/model/aliases.d.ts +3 -9
  108. package/dist/application-spec/parse-application-files/spec/model/common-types.d.ts +6 -14
  109. package/dist/application-spec/parse-application-files/spec/model/defaults.d.ts +6 -31
  110. package/dist/application-spec/parse-application-files/spec/model/entity-types.d.ts +3 -8
  111. package/dist/application-spec/parse-application-files/spec/model/model-version-key.d.ts +3 -3
  112. package/dist/application-spec/parse-application-files/spec/model/names/action-name.d.ts +3 -7
  113. package/dist/application-spec/parse-application-files/spec/model/names/alias-name.d.ts +3 -7
  114. package/dist/application-spec/parse-application-files/spec/model/names/entity-or-alias-name.d.ts +3 -8
  115. package/dist/application-spec/parse-application-files/spec/model/names/entity-type-name.d.ts +3 -8
  116. package/dist/application-spec/parse-application-files/spec/model/names/expression-name.d.ts +3 -6
  117. package/dist/application-spec/parse-application-files/spec/model/names/instance-name.d.ts +3 -7
  118. package/dist/application-spec/parse-application-files/spec/model/names/invariant-name.d.ts +3 -3
  119. package/dist/application-spec/parse-application-files/spec/model/names/shape-property-name.d.ts +3 -11
  120. package/dist/application-spec/parse-application-files/spec/model/names/violation-type-name.d.ts +3 -3
  121. package/dist/application-spec/parse-application-files/spec/model/presets.d.ts +6 -29
  122. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  123. package/dist/client/authorized-client.d.ts +3 -1
  124. package/dist/client/authorized-client.js +1 -1
  125. package/dist/client/contract.d.ts +17 -0
  126. package/dist/client/index.d.ts +1 -1
  127. package/dist/client/local-authorized-client.d.ts +3 -1
  128. package/dist/client/local-authorized-client.js +1 -1
  129. package/dist/client/memory-authorized-client.d.ts +4 -1
  130. package/dist/client/memory-authorized-client.js +1 -1
  131. package/dist/client/phoenix-api.d.ts +228 -0
  132. package/dist/configurator/ConfiguratorApp.js +1 -1
  133. package/dist/configurator/app-loader-content/index.d.ts +0 -1
  134. package/dist/configurator/app-loader-content/index.js +1 -1
  135. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  136. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +17 -3
  137. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  138. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +42 -9
  139. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  140. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +15 -10
  141. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  142. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +30 -9
  143. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  144. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.d.ts +40 -0
  145. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.js +1 -0
  146. package/dist/configurator/common/configurator-interface.d.ts +9 -6
  147. package/dist/configurator/common/configurator-interface.js +1 -1
  148. package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.d.ts +5 -0
  149. package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.js +1 -0
  150. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.d.ts +0 -6
  151. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.js +1 -1
  152. package/dist/configurator/configuration-not-found-page/index.d.ts +2 -2
  153. package/dist/configurator/configuration-not-found-page/index.js +1 -1
  154. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.d.ts +3 -3
  155. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.js +1 -1
  156. package/dist/configurator/configurator-context/PresetSelectionProvider.js +1 -1
  157. package/dist/configurator/configurator-context/PreviewContextProvider.js +1 -1
  158. package/dist/configurator/configurator-context/configurator-hooks/index.d.ts +0 -1
  159. package/dist/configurator/configurator-context/configurator-hooks/index.js +1 -1
  160. package/dist/configurator/configurator-context/index.d.ts +0 -4
  161. package/dist/configurator/configurator-context/index.js +1 -1
  162. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.d.ts +3 -3
  163. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.js +1 -1
  164. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.d.ts +0 -5
  165. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.js +1 -1
  166. package/dist/configurator/configurator-error-page/index.d.ts +1 -2
  167. package/dist/configurator/configurator-error-page/index.js +1 -1
  168. package/dist/configurator/index.d.ts +9 -2
  169. package/dist/configurator/index.js +1 -1
  170. package/dist/configurator/pages/ConfiguratorNotFoundPage.js +1 -1
  171. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  172. package/dist/configurator/pages/default-configurator-elements.js +1 -1
  173. package/dist/configurator/pages/error-boundaries/DevContextFallback.js +1 -1
  174. package/dist/configurator/pages/error-boundaries/DevLoadingFallback.js +1 -1
  175. package/dist/configurator/pages/error-boundaries/LoadingErrorBoundary.js +1 -1
  176. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  177. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.d.ts +1 -1
  178. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -1
  179. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +12 -4
  180. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -1
  181. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +8 -0
  182. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -0
  183. package/dist/configurator/ui/assistant/tool-chip.d.ts +15 -5
  184. package/dist/configurator/ui/assistant/tool-chip.js +1 -1
  185. package/dist/configurator/ui/configurator-layout/slots/canvas/GPUAccelerationDisabled.js +1 -1
  186. package/dist/configurator/ui/configurator-layout/slots/canvas/LayoutCanvas.js +1 -1
  187. package/dist/configurator/ui/configurator-layout/slots/canvas/SharedCanvas.js +1 -1
  188. package/dist/configurator/ui/configurator-layout/slots/canvas/WebGLNotSupported.js +1 -1
  189. package/dist/configurator/ui/configurator-layout/slots/readonly-banner/CloneToEditDialog.js +1 -1
  190. package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.js +1 -1
  191. package/dist/configurator/ui/legacy/chat/MobileChat.js +1 -1
  192. package/dist/configurator/ui/legacy/layout/common/CommonTopNavigation.js +1 -1
  193. package/dist/configurator/ui/legacy/layout/common/ReactiveInterfaceLayout.js +1 -1
  194. package/dist/configurator/ui/legacy/layout/simple/SimpleSidebar.js +1 -1
  195. package/dist/configurator/ui/legacy/layout/simple/SimpleTopNavigation.js +1 -1
  196. package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.js +1 -1
  197. package/dist/configurator/ui/legacy/layout/steps/StepsOwnerLayout.js +1 -1
  198. package/dist/configurator/ui/legacy/layout/steps/StepsSideBar.js +1 -1
  199. package/dist/configurator/ui/legacy/layout/tabs/TabsSidebar.js +1 -1
  200. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.d.ts +0 -7
  201. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.js +2 -2
  202. package/dist/configurator/ui/phoenix-layout-elements/header/common/back-button/use-go-back-action.js +1 -1
  203. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.js +1 -1
  204. package/dist/configurator/ui/phoenix-layout-elements/index.d.ts +8 -1
  205. package/dist/configurator/ui/phoenix-layout-elements/index.js +1 -1
  206. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/PreviousStepButton.js +1 -1
  207. package/dist/configurator/ui/preset-layout/PresetUi.d.ts +0 -2
  208. package/dist/configurator/ui/preset-layout/PresetUi.js +1 -1
  209. package/dist/configurator/ui/preset-layout/index.d.ts +6 -1
  210. package/dist/configurator/ui/preset-layout/index.js +1 -1
  211. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -1
  212. package/dist/docs/3d-scene/cameras/custom.mdx +4 -2
  213. package/dist/docs/index.json +78 -1
  214. package/dist/docs/integrations/webcomponent-api/basics.mdx +2 -0
  215. package/dist/docs/layouts/custom-layout.mdx +318 -158
  216. package/dist/docs/layouts/gallery/ardent-compressor.mdx +3516 -0
  217. package/dist/docs/layouts/gallery/corvid-drone.mdx +3428 -0
  218. package/dist/docs/layouts/gallery/fenwick-window.mdx +2803 -0
  219. package/dist/docs/layouts/gallery/ferrule-bar-station.mdx +6567 -0
  220. package/dist/docs/layouts/gallery/nightjar-guitar.mdx +3698 -0
  221. package/dist/docs/layouts/gallery/sunfold-solar.mdx +2683 -0
  222. package/dist/docs/layouts/gallery/tidepool-aquascape.mdx +5203 -0
  223. package/dist/docs/phoenix/configurator-interface.mdx +8 -6
  224. package/dist/docs/phoenix/domain-model.mdx +4 -1
  225. package/dist/docs/phoenix/phoenix-cli.mdx +14 -6
  226. package/dist/docs/phoenix/project-structure.mdx +21 -17
  227. package/dist/docs/phoenix/sdk-builder-workflow.mdx +6 -4
  228. package/dist/docs/phoenix/sessions-and-access.mdx +2 -0
  229. package/dist/docs/phoenix/webhooks.mdx +5 -1
  230. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +2 -0
  231. package/dist/domain/application/assistant/build-assistant-lenses.js +3 -3
  232. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  233. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  234. package/dist/domain/application/configurator-builder.d.ts +7 -1
  235. package/dist/domain/application/configurator-builder.js +1 -1
  236. package/dist/domain/application/index.d.ts +1 -1
  237. package/dist/domain/application/index.js +1 -1
  238. package/dist/domain/application/standard-properties.js +1 -1
  239. package/dist/domain/application/web-component-property.d.ts +3 -1
  240. package/dist/domain/application/web-component-property.js +1 -1
  241. package/dist/domain/domain-builder.d.ts +9 -3
  242. package/dist/domain/domain-builder.js +1 -1
  243. package/dist/domain/domain-runtime/application.d.ts +39 -0
  244. package/dist/domain/domain-runtime/application.js +1 -0
  245. package/dist/domain/domain-runtime/domain-context/selectors.d.ts +1 -0
  246. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  247. package/dist/domain/domain-runtime/domain-runtime.d.ts +40 -4
  248. package/dist/domain/domain-runtime/domain-runtime.js +1 -1
  249. package/dist/domain/domain-runtime/environment/initialize.d.ts +1 -1
  250. package/dist/domain/domain-runtime/errors/implementation-error-collector.d.ts +2 -0
  251. package/dist/domain/domain-runtime/errors/implementation-error-collector.js +1 -1
  252. package/dist/domain/domain-runtime/index.d.ts +2 -1
  253. package/dist/domain/domain-runtime/index.js +1 -1
  254. package/dist/domain/domain-runtime/spec/index.d.ts +1 -1
  255. package/dist/domain/domain-runtime/spec/index.js +1 -1
  256. package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +1 -0
  257. package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
  258. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.d.ts +23 -0
  259. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.js +1 -0
  260. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.d.ts +3 -4
  261. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.js +1 -1
  262. package/dist/domain/domain-runtime/web-component/actions.d.ts +3 -0
  263. package/dist/domain/domain-runtime/web-component/actions.js +1 -1
  264. package/dist/domain/domain-runtime/web-component/initialize.d.ts +1 -0
  265. package/dist/domain/domain-runtime/web-component/initialize.js +1 -1
  266. package/dist/domain/domain-runtime/web-component/selectors.d.ts +2 -0
  267. package/dist/domain/domain-runtime/web-component/selectors.js +1 -1
  268. package/dist/domain/domain-runtime/web-component/types.d.ts +6 -3
  269. package/dist/domain/index.d.ts +1 -0
  270. package/dist/domain/index.js +1 -1
  271. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +7 -0
  272. package/dist/domain/spec/application/index.d.ts +1 -0
  273. package/dist/domain/spec/application/index.js +1 -0
  274. package/dist/domain/spec/components/bindings/index.d.ts +2 -0
  275. package/dist/domain/spec/components/bindings/read-binding.d.ts +13 -0
  276. package/dist/domain/spec/components/bindings/write-binding.d.ts +32 -0
  277. package/dist/{application-spec/parse-application-files → domain}/spec/components/component-entry.d.ts +3 -3
  278. package/dist/{application-spec/core → domain/spec}/components/component-filter.d.ts +3 -2
  279. package/dist/domain/spec/components/component-filters.d.ts +10 -0
  280. package/dist/domain/spec/components/components.d.ts +4 -0
  281. package/dist/domain/spec/components/components.js +1 -0
  282. package/dist/domain/spec/components/index.d.ts +6 -0
  283. package/dist/domain/spec/enhanced-json-value.d.ts +30 -0
  284. package/dist/domain/spec/enhanced-json-value.js +1 -0
  285. package/dist/{application-spec/parse-application-files → domain}/spec/expressions/expression.d.ts +9 -3
  286. package/dist/domain/spec/expressions/expression.js +1 -0
  287. package/dist/domain/spec/expressions/expressions.d.ts +27 -0
  288. package/dist/domain/spec/expressions/expressions.js +1 -0
  289. package/dist/domain/spec/expressions/index.d.ts +5 -0
  290. package/dist/domain/spec/expressions/memo-eval-plan.d.ts +70 -0
  291. package/dist/domain/spec/expressions/memo-eval-plan.js +1 -0
  292. package/dist/domain/spec/expressions/relation-expression-params.js +1 -0
  293. package/dist/domain/spec/index.d.ts +7 -0
  294. package/dist/domain/spec/index.js +1 -0
  295. package/dist/domain/spec/json-schema.d.ts +52 -0
  296. package/dist/domain/spec/json-schema.js +1 -0
  297. package/dist/domain/spec/markers/index.d.ts +3 -0
  298. package/dist/domain/spec/markers/index.js +1 -0
  299. package/dist/domain/spec/markers/msg-marker.d.ts +28 -0
  300. package/dist/domain/spec/markers/msg-marker.js +1 -0
  301. package/dist/domain/spec/model/aliases.d.ts +9 -0
  302. package/dist/domain/spec/model/aliases.js +1 -0
  303. package/dist/domain/spec/model/common-types.d.ts +15 -0
  304. package/dist/domain/spec/model/common-types.js +1 -0
  305. package/dist/domain/spec/model/defaults.d.ts +33 -0
  306. package/dist/domain/spec/model/defaults.js +1 -0
  307. package/dist/domain/spec/model/entity-types.d.ts +8 -0
  308. package/dist/domain/spec/model/entity-types.js +1 -0
  309. package/dist/domain/spec/model/index.d.ts +7 -0
  310. package/dist/domain/spec/model/index.js +1 -0
  311. package/dist/domain/spec/model/model-version-key.d.ts +3 -0
  312. package/dist/domain/spec/model/model-version-key.js +1 -0
  313. package/dist/domain/spec/model/names/action-name.d.ts +7 -0
  314. package/dist/domain/spec/model/names/action-name.js +1 -0
  315. package/dist/domain/spec/model/names/alias-name.d.ts +7 -0
  316. package/dist/domain/spec/model/names/alias-name.js +1 -0
  317. package/dist/domain/spec/model/names/entity-or-alias-name.d.ts +8 -0
  318. package/dist/domain/spec/model/names/entity-or-alias-name.js +1 -0
  319. package/dist/domain/spec/model/names/entity-type-name.d.ts +8 -0
  320. package/dist/domain/spec/model/names/entity-type-name.js +1 -0
  321. package/dist/domain/spec/model/names/expression-name.d.ts +6 -0
  322. package/dist/domain/spec/model/names/expression-name.js +1 -0
  323. package/dist/domain/spec/model/names/index.d.ts +9 -0
  324. package/dist/domain/spec/model/names/index.js +1 -0
  325. package/dist/domain/spec/model/names/instance-name.d.ts +7 -0
  326. package/dist/domain/spec/model/names/instance-name.js +1 -0
  327. package/dist/domain/spec/model/names/invariant-name.d.ts +3 -0
  328. package/dist/domain/spec/model/names/invariant-name.js +1 -0
  329. package/dist/domain/spec/model/names/shape-property-name.d.ts +11 -0
  330. package/dist/domain/spec/model/names/shape-property-name.js +1 -0
  331. package/dist/domain/spec/model/names/violation-type-name.d.ts +3 -0
  332. package/dist/domain/spec/model/names/violation-type-name.js +1 -0
  333. package/dist/domain/spec/model/presets.d.ts +30 -0
  334. package/dist/domain/spec/model/presets.js +1 -0
  335. package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
  336. package/dist/editor/domain-editors/apply-spec-update.d.ts +2 -1
  337. package/dist/editor/domain-editors/apply-spec-update.js +1 -1
  338. package/dist/editor/domain-editors/use-implementation-files.d.ts +6 -14
  339. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  340. package/dist/editor/graphql/GraphQLPanel.js +1 -1
  341. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  342. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  343. package/dist/legacy/domain-spec/spec/domain-spec.js +1 -1
  344. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
  345. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
  346. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
  347. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +11 -5
  348. package/dist/phoenix/application-spec/generate-application-spec-project.d.ts +1 -0
  349. package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
  350. package/dist/phoenix/application-spec/generate-project-files.d.ts +1 -0
  351. package/dist/phoenix/application-spec/index.d.ts +1 -0
  352. package/dist/phoenix/application-spec/index.js +1 -1
  353. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +11 -0
  354. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  355. package/dist/phoenix/bin.js +1 -1
  356. package/dist/phoenix/cli.js +1 -1
  357. package/dist/phoenix/commands/build.js +1 -1
  358. package/dist/phoenix/commands/clean.js +1 -1
  359. package/dist/phoenix/commands/deploy.js +1 -1
  360. package/dist/phoenix/commands/dev.js +5 -5
  361. package/dist/phoenix/commands/generated-env-markers.d.ts +1 -0
  362. package/dist/phoenix/commands/generated-env-markers.js +1 -1
  363. package/dist/phoenix/commands/index.d.ts +1 -1
  364. package/dist/phoenix/commands/index.js +1 -1
  365. package/dist/phoenix/commands/sync.js +1 -1
  366. package/dist/phoenix/lingui/index.d.ts +1 -0
  367. package/dist/phoenix/lingui/index.js +1 -0
  368. package/dist/phoenix/{services → lingui}/lingui.d.ts +5 -2
  369. package/dist/phoenix/lingui/lingui.js +1 -0
  370. package/dist/phoenix/services/application-spec-project-watcher.d.ts +3 -1
  371. package/dist/phoenix/services/application-spec-project-watcher.js +2 -2
  372. package/dist/phoenix/services/index.d.ts +1 -0
  373. package/dist/phoenix/services/index.js +1 -1
  374. package/dist/phoenix/services/lingui-watcher.js +1 -1
  375. package/dist/phoenix/services/prepare-development-environment.js +1 -1
  376. package/dist/phoenix/services/vite-config.js +1 -1
  377. package/dist/react-sdk/application-runtime/common-services/analytics/analytics-service.d.ts +1 -1
  378. package/dist/react-sdk/application-runtime/common-services/initialize.d.ts +2 -2
  379. package/dist/react-sdk/application-runtime/domain-application-context/chat-system.d.ts +1 -1
  380. package/dist/react-sdk/application-runtime/hooks/index.d.ts +2 -0
  381. package/dist/react-sdk/application-runtime/hooks/index.js +1 -1
  382. package/dist/react-sdk/application-runtime/hooks/loading/index.d.ts +5 -0
  383. package/dist/react-sdk/application-runtime/hooks/loading/index.js +1 -0
  384. package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.d.ts +11 -0
  385. package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.js +1 -0
  386. package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.d.ts +8 -0
  387. package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.js +1 -0
  388. package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.d.ts +7 -0
  389. package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.js +1 -0
  390. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.d.ts +9 -0
  391. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.js +1 -0
  392. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.d.ts +24 -0
  393. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.js +1 -0
  394. package/dist/react-sdk/application-runtime/hooks/responsive/index.d.ts +3 -0
  395. package/dist/react-sdk/application-runtime/hooks/responsive/index.js +1 -0
  396. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.d.ts +9 -0
  397. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.js +1 -0
  398. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.d.ts +26 -0
  399. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.js +1 -0
  400. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.d.ts +10 -0
  401. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.js +1 -0
  402. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.d.ts +24 -0
  403. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.js +1 -0
  404. package/dist/react-sdk/application-runtime/hooks/use-access-service.d.ts +5 -0
  405. package/dist/react-sdk/application-runtime/hooks/use-access-service.js +1 -1
  406. package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.d.ts +4 -11
  407. package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.js +1 -1
  408. package/dist/react-sdk/application-runtime/hooks/use-web-component.d.ts +5 -0
  409. package/dist/react-sdk/application-runtime/hooks/use-web-component.js +1 -1
  410. package/dist/react-sdk/application-runtime/host-properties/actions.d.ts +15 -0
  411. package/dist/react-sdk/application-runtime/host-properties/actions.js +1 -0
  412. package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.d.ts +30 -0
  413. package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.js +1 -0
  414. package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.d.ts +7 -0
  415. package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.js +1 -0
  416. package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.d.ts +21 -0
  417. package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.js +1 -0
  418. package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.d.ts +42 -0
  419. package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.js +1 -0
  420. package/dist/react-sdk/application-runtime/host-properties/index.d.ts +8 -0
  421. package/dist/react-sdk/application-runtime/host-properties/index.js +1 -0
  422. package/dist/react-sdk/application-runtime/host-properties/initialize.d.ts +7 -0
  423. package/dist/react-sdk/application-runtime/host-properties/initialize.js +1 -0
  424. package/dist/react-sdk/application-runtime/host-properties/selectors.d.ts +54 -0
  425. package/dist/react-sdk/application-runtime/host-properties/selectors.js +1 -0
  426. package/dist/react-sdk/application-runtime/host-properties/types.d.ts +18 -0
  427. package/dist/react-sdk/application-runtime/host-properties/types.js +1 -0
  428. package/dist/react-sdk/application-runtime/index.d.ts +3 -0
  429. package/dist/react-sdk/application-runtime/loading/actions.d.ts +45 -0
  430. package/dist/react-sdk/application-runtime/loading/actions.js +1 -0
  431. package/dist/react-sdk/application-runtime/loading/index.d.ts +4 -0
  432. package/dist/react-sdk/application-runtime/loading/index.js +1 -0
  433. package/dist/react-sdk/application-runtime/loading/initialize.d.ts +3 -0
  434. package/dist/react-sdk/application-runtime/loading/initialize.js +1 -0
  435. package/dist/react-sdk/application-runtime/loading/selectors.d.ts +18 -0
  436. package/dist/react-sdk/application-runtime/loading/selectors.js +1 -0
  437. package/dist/react-sdk/application-runtime/loading/types.d.ts +59 -0
  438. package/dist/react-sdk/application-runtime/loading/types.js +1 -0
  439. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  440. package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.d.ts +6 -0
  441. package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.js +1 -1
  442. package/dist/react-sdk/application-runtime/provider/ApplicationType.d.ts +7 -0
  443. package/dist/react-sdk/application-runtime/provider/ApplicationType.js +1 -1
  444. package/dist/react-sdk/application-runtime/responsive/actions.d.ts +47 -0
  445. package/dist/react-sdk/application-runtime/responsive/actions.js +1 -0
  446. package/dist/react-sdk/application-runtime/responsive/index.d.ts +4 -0
  447. package/dist/react-sdk/application-runtime/responsive/index.js +1 -0
  448. package/dist/react-sdk/application-runtime/responsive/initialize.d.ts +3 -0
  449. package/dist/react-sdk/application-runtime/responsive/initialize.js +1 -0
  450. package/dist/react-sdk/application-runtime/responsive/selectors.d.ts +20 -0
  451. package/dist/react-sdk/application-runtime/responsive/selectors.js +1 -0
  452. package/dist/react-sdk/application-runtime/responsive/types.d.ts +104 -0
  453. package/dist/react-sdk/application-runtime/responsive/types.js +1 -0
  454. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +309 -8
  455. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
  456. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/ConfiguratorRoutingProvider.d.ts +1 -1
  457. package/dist/react-sdk/configurator-routing/ConfiguratorRoutingProvider.js +1 -0
  458. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/OnGoToIndexHandler.d.ts +1 -2
  459. package/dist/react-sdk/configurator-routing/OnGoToIndexHandler.js +1 -0
  460. package/dist/react-sdk/configurator-routing/index.d.ts +3 -0
  461. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/index.js +1 -1
  462. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/use-power-routing-lifecycle.d.ts +2 -0
  463. package/dist/react-sdk/configurator-routing/use-power-routing-lifecycle.js +1 -0
  464. package/dist/react-sdk/domain-application-context/BackendDataProvider.js +1 -1
  465. package/dist/react-sdk/domain-application-context/FrontendDataProvider.js +1 -1
  466. package/dist/react-sdk/domain-application-context/OnPresetLoadedHandler.js +1 -0
  467. package/dist/react-sdk/domain-application-context/PublishedDataProvider.js +1 -1
  468. package/dist/react-sdk/domain-application-context/chat-hooks.d.ts +4 -0
  469. package/dist/react-sdk/domain-application-context/chat-hooks.js +1 -0
  470. package/dist/react-sdk/domain-application-context/index.d.ts +2 -0
  471. package/dist/react-sdk/domain-application-context/index.js +1 -1
  472. package/dist/react-sdk/domain-context/common-hooks/index.d.ts +1 -0
  473. package/dist/react-sdk/domain-context/common-hooks/index.js +1 -1
  474. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.d.ts +23 -0
  475. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.js +1 -0
  476. package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +1 -0
  477. package/dist/react-sdk/domain-context/index.d.ts +1 -0
  478. package/dist/react-sdk/domain-context/index.js +1 -1
  479. package/dist/react-sdk/elements/index.d.ts +0 -1
  480. package/dist/react-sdk/index.d.ts +4 -1
  481. package/dist/react-sdk/index.js +1 -1
  482. package/dist/react-sdk/integration/IntegrationSubscription.js +1 -0
  483. package/dist/react-sdk/integration/index.d.ts +1 -0
  484. package/dist/react-sdk/integration/index.js +1 -0
  485. package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.d.ts +8 -0
  486. package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.js +1 -0
  487. package/dist/react-sdk/lifecycle-providers/LifecycleProviders.js +1 -0
  488. package/dist/react-sdk/lifecycle-providers/index.d.ts +2 -0
  489. package/dist/react-sdk/lifecycle-providers/index.js +1 -0
  490. package/dist/react-sdk/loading-state/LoaderHost.d.ts +20 -0
  491. package/dist/react-sdk/loading-state/LoaderHost.js +1 -0
  492. package/dist/react-sdk/loading-state/built-in-loading-phase.d.ts +9 -0
  493. package/dist/react-sdk/loading-state/built-in-loading-phase.js +1 -0
  494. package/dist/react-sdk/loading-state/create-app-loader.d.ts +18 -0
  495. package/dist/react-sdk/loading-state/create-app-loader.js +1 -0
  496. package/dist/react-sdk/loading-state/index.d.ts +4 -2
  497. package/dist/react-sdk/loading-state/index.js +1 -1
  498. package/dist/react-sdk/loading-state/{LoadingStateProvider.d.ts → loading-state-hooks.d.ts} +3 -12
  499. package/dist/react-sdk/loading-state/loading-state-hooks.js +1 -0
  500. package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.d.ts +17 -0
  501. package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.js +1 -0
  502. package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.d.ts +17 -0
  503. package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.js +1 -0
  504. package/dist/react-sdk/page-elements/configurator-error-page-props.js +1 -0
  505. package/dist/{configurator/configuration-not-found-page → react-sdk/page-elements}/create-configuration-not-found-page.d.ts +7 -1
  506. package/dist/react-sdk/page-elements/create-configuration-not-found-page.js +1 -0
  507. package/dist/{configurator/configurator-error-page → react-sdk/page-elements}/create-configurator-error-page.d.ts +6 -1
  508. package/dist/react-sdk/page-elements/create-configurator-error-page.js +1 -0
  509. package/dist/react-sdk/page-elements/create-preset-ui.d.ts +9 -0
  510. package/dist/react-sdk/page-elements/create-preset-ui.js +1 -0
  511. package/dist/react-sdk/page-elements/index.d.ts +6 -0
  512. package/dist/react-sdk/page-elements/index.js +1 -0
  513. package/dist/react-sdk/session/SessionServiceProvider.js +1 -1
  514. package/dist/react-sdk/web-component/create-web-component.js +1 -1
  515. package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.d.ts +2 -2
  516. package/dist/ui-sdk/responsive-application/responsive-state-store.d.ts +11 -9
  517. package/dist/ui-sdk/responsive-application/use-store-responsive-info.js +1 -1
  518. package/package.json +3 -3
  519. package/dist/application-spec/core/components/index.d.ts +0 -2
  520. package/dist/application-spec/core/expressions/index.d.ts +0 -2
  521. package/dist/configurator/app-loader-content/app-loader-content-name.d.ts +0 -5
  522. package/dist/configurator/app-loader-content/app-loader-content-name.js +0 -1
  523. package/dist/configurator/configuration-not-found-page/create-configuration-not-found-page.js +0 -1
  524. package/dist/configurator/configurator-context/ConfiguratorDataProvider.d.ts +0 -2
  525. package/dist/configurator/configurator-context/ConfiguratorDataProvider.js +0 -1
  526. package/dist/configurator/configurator-context/IntegrationSubscription.js +0 -1
  527. package/dist/configurator/configurator-context/LifecycleProviders.js +0 -1
  528. package/dist/configurator/configurator-context/OnPresetLoadedHandler.js +0 -1
  529. package/dist/configurator/configurator-context/configurator-hooks/chat-hooks.d.ts +0 -1
  530. package/dist/configurator/configurator-context/configurator-hooks/chat-hooks.js +0 -1
  531. package/dist/configurator/configurator-context/configurator-routing/ConfiguratorRoutingProvider.js +0 -1
  532. package/dist/configurator/configurator-context/configurator-routing/OnGoToIndexHandler.js +0 -1
  533. package/dist/configurator/configurator-context/configurator-routing/index.d.ts +0 -2
  534. package/dist/configurator/configurator-context/configurator-routing/use-power-routing-lifecycle.js +0 -1
  535. package/dist/configurator/configurator-error-page/create-configurator-error-page.js +0 -1
  536. package/dist/phoenix/services/lingui.js +0 -1
  537. package/dist/react-sdk/loading-state/LoadingStateProvider.js +0 -1
  538. package/dist/react-sdk/loading-state/loading-state-manager.d.ts +0 -37
  539. package/dist/react-sdk/loading-state/loading-state-manager.js +0 -1
  540. package/dist/react-sdk/responsive-state/ResponsiveStateProvider.d.ts +0 -25
  541. package/dist/react-sdk/responsive-state/ResponsiveStateProvider.js +0 -1
  542. package/dist/react-sdk/responsive-state/canvas-padding.d.ts +0 -14
  543. package/dist/react-sdk/responsive-state/index.d.ts +0 -5
  544. package/dist/react-sdk/responsive-state/index.js +0 -1
  545. package/dist/react-sdk/responsive-state/responsive-state-manager.d.ts +0 -111
  546. package/dist/react-sdk/responsive-state/responsive-state-manager.js +0 -1
  547. package/dist/react-sdk/responsive-state/use-responsive-state-manager.d.ts +0 -10
  548. package/dist/react-sdk/responsive-state/use-responsive-state-manager.js +0 -1
  549. package/dist/react-sdk/responsive-state/use-responsive-state.d.ts +0 -11
  550. package/dist/react-sdk/responsive-state/use-responsive-state.js +0 -1
  551. /package/dist/{application-spec/core → domain/spec/application}/application-instance.d.ts +0 -0
  552. /package/dist/{application-spec/core → domain/spec/application}/application-instance.js +0 -0
  553. /package/dist/{application-spec/core/expressions/relation-expression-params.js → domain/spec/components/bindings/index.js} +0 -0
  554. /package/dist/{application-spec/parse-application-files/spec/components/component-entry.js → domain/spec/components/bindings/read-binding.js} +0 -0
  555. /package/dist/{application-spec/parse-application-files/spec/expressions/expression.js → domain/spec/components/bindings/write-binding.js} +0 -0
  556. /package/dist/{react-sdk/elements/configurator-error-page-props.js → domain/spec/components/component-entry.js} +0 -0
  557. /package/dist/{application-spec/core → domain/spec}/components/component-filter.js +0 -0
  558. /package/dist/{react-sdk/responsive-state/canvas-padding.js → domain/spec/components/component-filters.js} +0 -0
  559. /package/dist/{application-spec/core → domain/spec}/components/index.js +0 -0
  560. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.d.ts +0 -0
  561. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.js +0 -0
  562. /package/dist/{application-spec/core → domain/spec}/expressions/index.js +0 -0
  563. /package/dist/{application-spec/core → domain/spec}/expressions/relation-expression-params.d.ts +0 -0
  564. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.d.ts +0 -0
  565. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.js +0 -0
  566. /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.d.ts +0 -0
  567. /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.js +0 -0
  568. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.d.ts +0 -0
  569. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.js +0 -0
  570. /package/dist/{configurator/configurator-context → react-sdk/domain-application-context}/OnPresetLoadedHandler.d.ts +0 -0
  571. /package/dist/{configurator/configurator-context → react-sdk/integration}/IntegrationSubscription.d.ts +0 -0
  572. /package/dist/{configurator/configurator-context → react-sdk/lifecycle-providers}/LifecycleProviders.d.ts +0 -0
  573. /package/dist/react-sdk/{elements → page-elements}/configurator-error-page-props.d.ts +0 -0
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,7 @@
1
+ import type { Branded } from '@salsita-ai/common/utils';
2
+ /**
3
+ * Branded component instance name.
4
+ * User-declared names must start with a letter (e.g. "default", "body", "main").
5
+ * SDK-derived names may include `$` prefix and `.` separators (e.g. "$top", "Table.$top").
6
+ */
7
+ export type InstanceName = Branded<'InstanceName', string>;
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,3 @@
1
+ import type { Branded } from '@salsita-ai/common/utils';
2
+ /** A camelCase identifier for an invariant implementation declared in YAML. */
3
+ export type InvariantName = Branded<'InvariantName', string>;
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,11 @@
1
+ import type { Branded } from '@salsita-ai/common/utils';
2
+ /**
3
+ * Branded shape property name — the key under which an entity shape (or
4
+ * alias shape) declares a field, and the key under which `defaults:` attaches
5
+ * initial values. Must match /^[a-z]\w*$/: start with a lowercase letter,
6
+ * then word characters (letters, digits, underscore).
7
+ *
8
+ * Examples: `height`, `positionX`, `hoodId`. Rejected: `Height`, `$height`,
9
+ * `3D`, `height-px`.
10
+ */
11
+ export type ShapePropertyName = Branded<'ShapePropertyName', string>;
@@ -0,0 +1,3 @@
1
+ import type { Branded } from '@salsita-ai/common/utils';
2
+ /** A stable violation discriminator returned by an invariant. */
3
+ export type ViolationTypeName = Branded<'ViolationTypeName', string>;
@@ -0,0 +1,30 @@
1
+ import type { Branded } from '@salsita-ai/common/utils';
2
+ /**
3
+ * A single entity within a preset — id, type, and shape properties.
4
+ * Properties are validated against the entity's schema from ConfigurationSchema.
5
+ */
6
+ export type PresetEntity = Branded<'PresetEntity', {
7
+ readonly id: string;
8
+ readonly type: string;
9
+ readonly properties: Readonly<Record<string, unknown>>;
10
+ }>;
11
+ /**
12
+ * A single parsed preset — the root entity type, initial entities, and optional metadata.
13
+ * Represents one initial configuration state for a configurator deployment. `application-spec`
14
+ * exports it as `Preset`.
15
+ */
16
+ export type SpecPreset = Branded<'Preset', {
17
+ readonly rootEntityType: string;
18
+ readonly initialDomainEntities: readonly PresetEntity[];
19
+ readonly name?: string;
20
+ readonly description?: string;
21
+ readonly img?: string;
22
+ readonly imgAlt?: string;
23
+ readonly detailTitle?: string;
24
+ readonly detailDescription?: string;
25
+ readonly tags?: readonly string[];
26
+ }>;
27
+ /** All parsed presets for a parsed configurator or admin model. */
28
+ export type Presets = Branded<'Presets', {
29
+ readonly presets: readonly SpecPreset[];
30
+ }>;
@@ -0,0 +1 @@
1
+ export{};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import r from"lodash-es/debounce.js";import t from"promise-queue";import{createContext as o,useCallback as n,useContext as i,useEffect as s,useMemo as a,useRef as c,useState as m}from"react";import{match as l}from"ts-pattern";import{ApplicationRuntime as p,BinaryFile as u,RawProjectFiles as d,RuntimeReferenceStore as g,TextFile as f,buildPhoenixDefinitions as S,isConfiguratorModelSchemaCompatible as v,isTextFile as y,parseApplicationFiles as E}from"#package/application-spec";import{findActionImplementationConflicts as h,getAllPhxDefinitions as x}from"#package/domain";import{useApplicationRuntime as A,useMountGuard as C}from"#package/react-sdk";import{useEditorConnection as D}from"../services/EditorConnectionContext.js";import{trpc as I}from"../services/trpc.js";import{applyRuntimeReset as N,applySpecUpdate as w,prepareRuntimeRefresh as P,prepareRuntimeReset as _}from"./apply-spec-update.js";import{useDiagnostics as R}from"./use-diagnostics.js";import{useImplementationFiles as j}from"./use-implementation-files.js";import{getWasmSwcParsers as L}from"./wasm-swc-parsers.js";let k=o(null),T={debug:e=>console.debug(e)},M=e=>e instanceof Error?e.message:String(e);export const DomainSpecProvider=o=>{let{children:i,domainSpec:O,initialRawProjectFiles:b}=o,[$,F]=m(a(()=>O?[{fileName:"domain.yaml",content:O}]:b?b.files.filter(y).map(e=>({fileName:e.name,content:e.content})):[],[O,b])),[z,H]=m(null),q=a(()=>new g,[]),G=a(()=>S(x()),[]),U=c(null),Q=A(),{getImplementationFiles:B}=j(),{diagnostics:V,unreadDiagnosticCount:X,setDiagnostics:Y,pushDiagnostic:Z,clearDiagnostics:J,markDiagnosticsRead:K}=R(),W=a(()=>new t(1,1/0),[]),ee=c(0),er=c(null),{mutateAsync:et}=I.requestSpecFiles.useMutation(),{mutateAsync:eo}=I.save.useMutation(),en=C(),{localMode:ei,connectionStatus:es}=D(),{data:ea}=I.getEditorConfig.useQuery(void 0,{enabled:!ei&&"connected"===es}),ec=ei||ea?.specSync===!0,em=$.length>0?$:void 0,el=a(()=>$.map(e=>e.fileName),[$]),ep=a(()=>r(async e=>{if(!ei&&"connected"===es&&0!==e.length)try{await eo(e.map(e=>({fileName:e.fileName,content:e.content})))}catch(e){console.error("[DomainSpecContext] Failed to save files to disk:",e)}},1e3),[ei,es,eo]);s(()=>()=>{ep.cancel()},[ep]);let eu=n(()=>{H(null)},[]),ed=n(async(e,r)=>{F(t=>{let o=t.find(r=>r.fileName===e)?t.map(t=>t.fileName===e?{...t,content:r}:t):[...t,{fileName:e,content:r}];return ep(o),o})},[ep]),eg=n(async(e,r)=>{let t,o,n=()=>en()&&ee.current===r;if(!n())return;let i=d(e.rawProjectFiles.files.map(e=>l(e).with({kind:"text"},e=>f(e.name,e.content)).with({kind:"binary"},e=>u(e.name)).exhaustive()));F(i.files.filter(y).map(e=>({fileName:e.name,content:e.content})));try{t=await L()}catch(e){if(!n())return;Y([{code:"MODULE_ANALYZER_UNAVAILABLE",message:`The editor's module analyzer failed to load: ${e instanceof Error?e.message:String(e)}`,severity:"error",source:"spec",path:[]}]);return}if(!n())return;let s=E({rawProjectFiles:i,phxDefinitions:G},{analyzer:t.analyzer,evalExpressionParser:t.evalExpressionParser,referenceStore:q,logger:T});if(console.info(`[DomainSpecContext] Spec parsed: ${s.ok?"ok":"error"}, ${s.diagnostics.length} diagnostics`),!s.ok)return void Y([...s.errors,...s.diagnostics].map(e=>({...e,source:"spec"})));J();let{applicationSpec:a}=s.value,c=await B({application:s.value,projectRoot:e.projectRoot});if(!n())return;if(c.errors.length>0)return void Y(c.errors.map(e=>({code:e.code,message:e.message,severity:"error",source:"reload",path:[]})));let m=h([...a.configurator.actions.values()].map(e=>String(e.name)),c.actionImplementations??Q.getState().spec.configurator.actionImplementations);if(m.extra.length>0&&console.error(`[DomainSpecContext] Action implementations without a declaration: ${m.extra.join(", ")}`),m.missing.length>0){let e=`Missing action implementations: ${m.missing.join(", ")}. Add each to a default export of phx.domain.implementActions({ ... }) in src/actions/.`;console.error(`[DomainSpecContext] ${e}`),Z({code:"MISSING_ACTION_IMPLEMENTATIONS",message:e,severity:"error",source:"runtime"});return}let g=p(a,q,c.implementations,c.importedTransformers,c.invariantImplementations,c.adminImplementations);if(!g.ok){let e=`Missing expression implementations: ${g.missingExpressions.map(e=>`${e.entityType}.${e.exprName}`).join(", ")}`;console.error(`[DomainSpecContext] ${e}`),Z({code:"MISSING_EXPRESSION_IMPLEMENTATIONS",message:e,severity:"error",source:"runtime"});return}let{runtime:S}=g,x=null===U.current||v(U.current.configurator,a.configurator),A=Q.selectors.environment.getPersistenceConfig();if(!x){let e;if("server"===A.type)return void Z({code:"HOT_RELOAD_MODEL_CHANGE_REQUIRES_RESTART",message:"Domain model changes require an application restart and were not applied.",severity:"error",source:"runtime"});if(!Q.selectors.domainContext.configurator.getInitializationState().isCurrent)return void Q.selectors.domainServices.getLogger().debug("[DomainSpecContext] Skipping the model reset because no configurator session is initialized; the change applies once a session loads under the new spec.");try{e=_({runtime:S,implementationFiles:c,previousSpec:Q.getState().spec})}catch(e){Z({code:"HOT_RELOAD_PREPARE_FAILED",message:M(e),severity:"error",source:"runtime"});return}for(let r of(Q.selectors.domainServices.getLogger().debug("[DomainSpecContext] Reseeding the reset session directly from the spec preset; onPresetLoadedHandler and ProductSelected analytics are intentionally skipped."),N(Q,e,Q.selectors.domainApplicationContext.configurator.getConfigurationPersistSystem().revisionId$.value),U.current=a,e.implementationErrors))Z({code:r.code,message:r.message,severity:"error",source:"runtime"});return}try{o=P({runtime:S,implementationFiles:c,previousSpec:Q.getState().spec})}catch(e){Z({code:"HOT_RELOAD_PREPARE_FAILED",message:M(e),severity:"error",source:"runtime"});return}if(n())for(let e of(w(Q,o),U.current=a,o.implementationErrors))Z({code:e.code,message:e.message,severity:"error",source:"runtime"})},[Q,B,en,G,Z,q,Y,J]),ef=c(null),eS=n(e=>{let r=ee.current+1;ee.current=r,er.current={data:e,generation:r},W.add(async()=>{let e=er.current;e&&e.data!==ef.current&&(er.current=null,ef.current=e.data,await eg(e.data,e.generation))})},[eg,W]);I.onSpecChange.useSubscription(void 0,{enabled:!ei&&ec,onData:eS}),s(()=>{!ei&&ec&&et().catch(()=>{console.warn("[DomainSpecContext] Failed to request spec files")})},[et,ei,ec]);let ev=a(()=>({files:em,fileNames:el,updateFile:ed,parsing:!1,parseError:z,clearParseError:eu,diagnostics:V,clearDiagnostics:J,unreadDiagnosticCount:X,markDiagnosticsRead:K}),[em,el,ed,z,eu,V,J,X,K]);return e(k.Provider,{value:ev,children:i})};export const useDomainSpecContext=()=>{let e=i(k);if(null===e)throw Error("useDomainSpecContext must be used within DomainSpecProvider");return e};
1
+ import{jsx as e}from"react/jsx-runtime";import r from"lodash-es/debounce.js";import t from"promise-queue";import{createContext as o,useCallback as n,useContext as i,useEffect as s,useMemo as a,useRef as c,useState as l}from"react";import{match as m}from"ts-pattern";import{ApplicationRuntime as u,BinaryFile as p,RawProjectFiles as d,RuntimeReferenceStore as g,TextFile as f,buildPhoenixDefinitions as v,isConfiguratorModelSchemaCompatible as S,isTextFile as h,parseApplicationFiles as y}from"#package/application-spec";import{createImplementationErrorCollector as E,findActionImplementationConflicts as x,getAllPhxDefinitions as A}from"#package/domain";import{useApplicationRuntime as C,useMountGuard as D}from"#package/react-sdk";import{useEditorConnection as w}from"../services/EditorConnectionContext.js";import{trpc as N}from"../services/trpc.js";import{applyRuntimeReset as P,applySpecUpdate as R,prepareRuntimeRefresh as _,prepareRuntimeReset as j}from"./apply-spec-update.js";import{useDiagnostics as I}from"./use-diagnostics.js";import{useImplementationFiles as L}from"./use-implementation-files.js";import{getWasmSwcParsers as k}from"./wasm-swc-parsers.js";let b=o(null),M={debug:e=>console.debug(e)},O=e=>e instanceof Error?e.message:String(e);export const DomainSpecProvider=o=>{let{children:i,domainSpec:T,initialRawProjectFiles:$}=o,[F,z]=l(a(()=>T?[{fileName:"domain.yaml",content:T}]:$?$.files.filter(h).map(e=>({fileName:e.name,content:e.content})):[],[T,$])),[H,q]=l(null),U=a(()=>new g,[]),G=a(()=>v(A()),[]),Q=c(null),B=C(),{getImplementationFiles:V}=L(),{diagnostics:Y,unreadDiagnosticCount:Z,setDiagnostics:J,pushDiagnostic:K,clearDiagnostics:W,markDiagnosticsRead:X}=I(),ee=a(()=>new t(1,1/0),[]),er=c(0),et=c(null),{mutateAsync:eo}=N.requestSpecFiles.useMutation(),{mutateAsync:en}=N.save.useMutation(),ei=D(),{localMode:es,connectionStatus:ea}=w(),{data:ec}=N.getEditorConfig.useQuery(void 0,{enabled:!es&&"connected"===ea}),el=es||ec?.specSync===!0,em=F.length>0?F:void 0,eu=a(()=>F.map(e=>e.fileName),[F]),ep=a(()=>r(async e=>{if(!es&&"connected"===ea&&0!==e.length)try{await en(e.map(e=>({fileName:e.fileName,content:e.content})))}catch(e){console.error("[DomainSpecContext] Failed to save files to disk:",e)}},1e3),[es,ea,en]);s(()=>()=>{ep.cancel()},[ep]);let ed=n(()=>{q(null)},[]),eg=n(async(e,r)=>{z(t=>{let o=t.find(r=>r.fileName===e)?t.map(t=>t.fileName===e?{...t,content:r}:t):[...t,{fileName:e,content:r}];return ep(o),o})},[ep]),ef=n(async(e,r)=>{let t,o,n=()=>ei()&&er.current===r;if(!n())return;let i=d(e.rawProjectFiles.files.map(e=>m(e).with({kind:"text"},e=>f(e.name,e.content)).with({kind:"binary"},e=>p(e.name)).exhaustive()));z(i.files.filter(h).map(e=>({fileName:e.name,content:e.content})));try{t=await k()}catch(e){if(!n())return;J([{code:"MODULE_ANALYZER_UNAVAILABLE",message:`The editor's module analyzer failed to load: ${e instanceof Error?e.message:String(e)}`,severity:"error",source:"spec",path:[]}]);return}if(!n())return;let s=y({rawProjectFiles:i,phxDefinitions:G},{analyzer:t.analyzer,evalExpressionParser:t.evalExpressionParser,referenceStore:U,logger:M});if(console.info(`[DomainSpecContext] Spec parsed: ${s.ok?"ok":"error"}, ${s.diagnostics.length} diagnostics`),!s.ok)return void J([...s.errors,...s.diagnostics].map(e=>({...e,source:"spec"})));W();let{applicationSpec:a}=s.value,c=await V({application:s.value,projectRoot:e.projectRoot});if(!n())return;if(c.errors.length>0)return void J(c.errors.map(e=>({code:e.code,message:e.message,severity:"error",source:"reload",path:[]})));let l=x([...a.configurator.actions.values()].map(e=>String(e.name)),c.actionImplementations??B.getState().spec.configurator.actionImplementations);if(l.extra.length>0&&console.error(`[DomainSpecContext] Action implementations without a declaration: ${l.extra.join(", ")}`),l.missing.length>0){let e=`Missing action implementations: ${l.missing.join(", ")}. Add each to a default export of phx.domain.implementActions({ ... }) in src/actions/.`;console.error(`[DomainSpecContext] ${e}`),K({code:"MISSING_ACTION_IMPLEMENTATIONS",message:e,severity:"error",source:"runtime"});return}let g=E(),v=u(a,U,c.expressionModules,c.importedTransformers,c.invariantImplementations,c.adminExpressionModules,void 0,void 0,void 0,g);for(let e of g.recorded())console.error(`[DomainSpecContext] ${e.message}`),K({code:e.code,message:e.message,severity:"error",source:"runtime"});if(!v.ok)return void U.clear();let{runtime:A}=v,C=null===Q.current||S(Q.current.configurator,a.configurator),D=B.selectors.environment.getPersistenceConfig();if(!C){let e;if("server"===D.type)return void K({code:"HOT_RELOAD_MODEL_CHANGE_REQUIRES_RESTART",message:"Domain model changes require an application restart and were not applied.",severity:"error",source:"runtime"});if(!B.selectors.domainContext.configurator.getInitializationState().isCurrent)return void B.selectors.domainServices.getLogger().debug("[DomainSpecContext] Skipping the model reset because no configurator session is initialized; the change applies once a session loads under the new spec.");try{e=j({runtime:A,implementationFiles:c,previousSpec:B.getState().spec})}catch(e){K({code:"HOT_RELOAD_PREPARE_FAILED",message:O(e),severity:"error",source:"runtime"});return}for(let r of(B.selectors.domainServices.getLogger().debug("[DomainSpecContext] Reseeding the reset session directly from the spec preset; onPresetLoadedHandler and ProductSelected analytics are intentionally skipped."),P(B,e,B.selectors.domainApplicationContext.configurator.getConfigurationPersistSystem().revisionId$.value),Q.current=a,e.implementationErrors))K({code:r.code,message:r.message,severity:"error",source:"runtime"});return}try{o=_({runtime:A,implementationFiles:c,previousSpec:B.getState().spec})}catch(e){K({code:"HOT_RELOAD_PREPARE_FAILED",message:O(e),severity:"error",source:"runtime"});return}if(n())for(let e of(R(B,o),Q.current=a,o.implementationErrors))K({code:e.code,message:e.message,severity:"error",source:"runtime"})},[B,V,ei,G,K,U,J,W]),ev=c(null),eS=n(e=>{let r=er.current+1;er.current=r,et.current={data:e,generation:r},ee.add(async()=>{let e=et.current;e&&e.data!==ev.current&&(et.current=null,ev.current=e.data,await ef(e.data,e.generation))})},[ef,ee]);N.onSpecChange.useSubscription(void 0,{enabled:!es&&el,onData:eS}),s(()=>{!es&&el&&eo().catch(()=>{console.warn("[DomainSpecContext] Failed to request spec files")})},[eo,es,el]);let eh=a(()=>({files:em,fileNames:eu,updateFile:eg,parsing:!1,parseError:H,clearParseError:ed,diagnostics:Y,clearDiagnostics:W,unreadDiagnosticCount:Z,markDiagnosticsRead:X}),[em,eu,eg,H,ed,Y,W,Z,X]);return e(b.Provider,{value:eh,children:i})};export const useDomainSpecContext=()=>{let e=i(b);if(null===e)throw Error("useDomainSpecContext must be used within DomainSpecProvider");return e};
@@ -1,4 +1,4 @@
1
- import type { ApplicationRuntime as GeneratedApplicationRuntime } from '#package/application-spec';
1
+ import { type ApplicationRuntime as GeneratedApplicationRuntime } from '#package/application-spec';
2
2
  import { type ImplementationError, type ApplicationSpec as RuntimeApplicationSpec } from '#package/domain';
3
3
  import type { ApplicationRuntime } from '#package/react-sdk';
4
4
  import type { ImplementationFiles } from './use-implementation-files.js';
@@ -23,6 +23,7 @@ export interface PrepareRuntimeRefreshInput {
23
23
  readonly implementationFiles: ImplementationFiles;
24
24
  readonly previousSpec: RuntimeApplicationSpec;
25
25
  }
26
+ /** Refreshes the configurator sections of the live spec while the model's schema stays. */
26
27
  export declare const prepareRuntimeRefresh: (input: PrepareRuntimeRefreshInput) => PreparedRuntimeRefresh;
27
28
  /** Rebuilds every model-owned configurator field for an incompatible schema replacement. */
28
29
  export declare const prepareRuntimeReset: (input: PrepareRuntimeRefreshInput) => PreparedRuntimeReset;
@@ -1 +1 @@
1
- import{findAssistantFormElementErrors as e,resolveImportedTransformers as t}from"#package/domain";import{getPhoenixThemes as n}from"#package/ui-sdk";import{getCustomComponentOptics as s}from"./use-implementation-files.js";let o=e=>{var o;let i,a,{runtime:r,implementationFiles:m,previousSpec:c}=e,p=r.configurator,l=c.configurator,u=m.handlers?.handlers??l.handlers,f=m.handlers?((e,t,n)=>{let s={};for(let o of e)s[o.name]=t?.[o.name]??n?.[o.name]??o.name;return s})(u,m.handlers.nameHashes,l.handlerHashes):l.handlerHashes,d=m.elements?.elements??l.elements,h=m.elements?((e,t,n)=>{let s={},o=0;for(let i of e)if("assistantFormElement"!==i.type)if("entity"===i.type||"layout"===i.type)s[i.name]=t?.[i.name]??n?.[i.name]??i.name;else{let e=`icon:${o}`;s[e]=t?.[e]??n?.[e]??`${e}:${i.elements.length}`,o+=1}return s})(d,m.elements.nameHashes,l.elementHashes):l.elementHashes,g=null!==m.customComponentOptics,R=p.componentOptics.changed||g?[...p.componentOptics.optics.map(e=>e.optic),...m.customComponentOptics??s(l.componentOptics)]:l.componentOptics,x=p.transformersRuntime.changed?e=>t(p.transformersRuntime.importedTransformers,p.transformersRuntime.specTransformers,e):l.createTransformers;return{presets:p.presetRuntime.changed?p.presetRuntime.presets:l.presets,theme:p.themeRuntime.changed?(o=p.themeRuntime,i=n(),a=Object.entries(i).find(([e])=>e===o.preset)?.[1]??{},Object.keys(o.options).length>0?{...a,...o.options}:a):l.theme,assistant:p.assistantRuntime.changed?p.assistantRuntime.assistant:l.assistant,navigationStates:p.statesRuntime.changed?p.statesRuntime.navigationStates:l.navigationStates,viewStates:p.statesRuntime.changed?p.statesRuntime.viewStates:l.viewStates,toolStates:p.statesRuntime.changed?p.statesRuntime.toolStates:l.toolStates,exportStates:p.statesRuntime.changed?p.statesRuntime.exportStates:l.exportStates,componentOptics:R,createTransformers:x,handlers:u,handlerHashes:f,elements:d,elementHashes:h}},i=({assistant:t,elements:n})=>e(t?.formElements??[],n);export const prepareRuntimeRefresh=e=>{let{runtime:t,previousSpec:n}=e,s=n.configurator,a=o(e),r=t.configurator.expressionRuntime.changed?t.configurator.expressionRuntime.merged:s.expressions,m=t.configurator.actionsRuntime.changed?t.configurator.actionsRuntime.definitions:s.actions,c=e.implementationFiles.actionImplementations??s.actionImplementations;return{nextSpec:{...n,configurator:{...s,...a,expressions:r,actions:m,actionImplementations:c}},implementationErrors:i(a)}};export const prepareRuntimeReset=e=>{let{runtime:t,previousSpec:n}=e,s=n.configurator,a=o(e),r=t.configurator.expressionRuntime.merged,m=t.configurator.actionsRuntime.definitions,c=e.implementationFiles.actionImplementations??s.actionImplementations,p=t.configurator.modelRuntime.domainBuilder.withExpressions(r).withActions(Object.values(m)).withActionImplementations(c).build(),l=a.presets[0];if(void 0===l)throw Error("Cannot reset the configurator after a model change because the application spec has no presets.");return{firstPreset:l,nextSpec:{...n,configurator:{...s,...a,modelVersion:p.context.modelVersion,factory:p,aliasMap:p.context.aliasMap,entityReflections:p.context.entityReflections,$entityReflections:p.context.$entityReflections,expressions:r,actions:m,actionImplementations:c,allowedRootEntityTypes:p.context.allowedRootEntityTypes,migrate:p.context.migrate}},implementationErrors:i(a)}};let a=(e,t)=>{e.actions.spec.updateSpec(t)};export const applyRuntimeRefresh=(e,t)=>a(e,t.nextSpec);export const applyRuntimeReset=(e,t,n)=>{a(e,t.nextSpec),e.actions.loadedData.completeConfiguratorLoad({initialRevisionId:n,initialEntities:t.firstPreset.initialDomainEntities,modelVersion:t.nextSpec.configurator.modelVersion,rootEntityType:t.firstPreset.rootEntityType,schemaIdentity:t.nextSpec.configurator.factory})};export const applySpecUpdate=(e,t)=>a(e,t.nextSpec);
1
+ import{applicationSpecSlice as e}from"#package/application-spec";import{findAssistantFormElementErrors as t}from"#package/domain";import{getPhoenixThemes as o}from"#package/ui-sdk";let n=e=>({handlers:e.handlers,elements:e.elements,customComponentOptics:e.customComponentOptics,actionImplementations:e.actionImplementations}),r=({configurator:e})=>t(e.assistant?.formElements??[],e.elements);export const prepareRuntimeRefresh=t=>{let i=e({runtime:t.runtime,modules:n(t.implementationFiles),themePresets:o(),previous:t.previousSpec,model:"keep"});return{nextSpec:i,implementationErrors:r(i)}};export const prepareRuntimeReset=t=>{let i=e({runtime:t.runtime,modules:n(t.implementationFiles),themePresets:o(),previous:t.previousSpec,model:"rebuild"}),s=i.configurator.presets[0];if(void 0===s)throw Error("Cannot reset the configurator after a model change because the application spec has no presets.");return{firstPreset:s,nextSpec:i,implementationErrors:r(i)}};let i=(e,t)=>{e.actions.spec.updateSpec(t)};export const applyRuntimeRefresh=(e,t)=>i(e,t.nextSpec);export const applyRuntimeReset=(e,t,o)=>{i(e,t.nextSpec),e.actions.loadedData.completeConfiguratorLoad({initialRevisionId:o,initialEntities:t.firstPreset.initialDomainEntities,modelVersion:t.nextSpec.configurator.modelVersion,rootEntityType:t.firstPreset.rootEntityType,schemaIdentity:t.nextSpec.configurator.factory})};export const applySpecUpdate=(e,t)=>i(e,t.nextSpec);
@@ -1,4 +1,4 @@
1
- import type { Application, ExpressionImplementations, InvariantImplementations } from '#package/application-spec';
1
+ import type { Application, InvariantImplementations } from '#package/application-spec';
2
2
  import { type AnyActionImplementations, type DomainComponentOptic, type DomainEntity, type ElementRegistration, type HandlerRegistration, type ImportedTransformer, type ProjectModule, type SystemComponentTypeConstraint } from '#package/domain';
3
3
  type RuntimeData = Record<string, unknown>;
4
4
  type RuntimeEntity = DomainEntity<string>;
@@ -21,15 +21,17 @@ export interface ReloadError {
21
21
  /**
22
22
  * The freshly reloaded (or cached) implementation files needed to build an `ApplicationRuntime`.
23
23
  *
24
- * `implementations`, `adminImplementations`, `invariantImplementations`, `importedTransformers` and `customComponentOptics` always contain the latest
24
+ * `expressionModules` and `adminExpressionModules` are the expression files as imported, unchecked:
25
+ * `ApplicationRuntime` checks and merges them with the aliases of the spec being edited.
26
+ * `expressionModules`, `adminExpressionModules`, `invariantImplementations`, `importedTransformers` and `customComponentOptics` always contain the latest
25
27
  * successfully loaded values. So does `actionImplementations`, which is `null` only until the first successful load: a round
26
28
  * that loaded them may be dropped before it is applied, and the next round must still carry them.
27
29
  * `handlers`/`elements` are `null` when their category did not change this round.
28
30
  */
29
31
  export interface ImplementationFiles {
30
- readonly implementations: ExpressionImplementations;
32
+ readonly expressionModules: readonly ProjectModule[];
31
33
  readonly actionImplementations: AnyActionImplementations | null;
32
- readonly adminImplementations?: ExpressionImplementations;
34
+ readonly adminExpressionModules?: readonly ProjectModule[];
33
35
  readonly invariantImplementations: InvariantImplementations;
34
36
  readonly importedTransformers: readonly ImportedTransformer[];
35
37
  readonly customComponentOptics: readonly ReloadedComponentOptic[] | null;
@@ -41,17 +43,7 @@ export interface GetImplementationFilesProps {
41
43
  readonly application: Application;
42
44
  readonly projectRoot: string;
43
45
  }
44
- type ResolvedExpressions = ExpressionImplementations;
45
- /**
46
- * Validates the expression modules through the resolver the domain builder uses, then expands their
47
- * aliases. The expansion stays here because the editor rebuilds expressions against the alias map of
48
- * the spec being edited, where the built app's domain builder holds its own.
49
- */
50
- export declare const mergeExpressionModules: (modules: readonly ProjectModule[], aliasMap: Record<string, readonly string[]>) => ResolvedExpressions;
51
46
  export declare const mergeComponentOptics: <ComponentOptic>(generatedComponentOptics: readonly ComponentOptic[], customComponentOptics: readonly ComponentOptic[]) => readonly ComponentOptic[];
52
- export declare const getCustomComponentOptics: <ComponentOptic extends {
53
- readonly generated?: boolean;
54
- }>(componentOptics: readonly ComponentOptic[]) => readonly ComponentOptic[];
55
47
  /**
56
48
  * Owns the should-reload gating and cross-update caching for project implementation files
57
49
  * (expressions, actions, invariants, components, transformers, handlers, elements). Returns `getImplementationFiles`,
@@ -1 +1 @@
1
- import{useCallback as e,useRef as n}from"react";import{expandAlias as t,resolveActionModules as a,resolveComponentOpticModules as r,resolveElementModule as o,resolveExpressionModules as s,resolveHandlerModule as i,resolveInvariantModules as l,resolveTransformerModule as m}from"#package/domain";import{importImplementationFile as c}from"./import-implementation-file.js";let p=e=>e instanceof Error?e.message:String(e),f=async(e,n)=>{let t=Date.now();return Promise.all(e.map(async e=>({origin:e,exports:await c(`/@fs/${n}/${e}?t=${t}`)})))},d=async(e,n)=>a(await f(e,n));export const mergeExpressionModules=(e,n)=>{let a={};for(let{expressions:t}of s(e,n))for(let[e,n]of Object.entries(t))a[e]={...a[e],...n};let r={};for(let[e,o]of Object.entries(a))for(let a of t(n,e)){let n=r[a]??{};for(let[t,a]of Object.entries(o))n[t]={...a,origin:{name:t,typeOrAlias:e}};r[a]=n}return r};export const mergeComponentOptics=(e,n)=>e.concat(n);export const getCustomComponentOptics=e=>e.filter(e=>!0!==e.generated);let u=async(e,n,t)=>mergeExpressionModules(await f(e,t),n),g=async(e,n)=>r(await f(e,n)),h=async(e,n)=>l(await f(e,n)),E=async(e,n)=>(await f(e,n)).map(m),F=async(e,n)=>(await f(e,n)).map(e=>({filePath:e.origin,registrations:i(e)})),w=async(e,n)=>(await f(e,n)).map(e=>({filePath:e.origin,registrations:o(e)}));export const useImplementationFiles=()=>{let t=n({}),a=n(null),r=n({}),o=n(0),s=n(null),i=n({}),l=n(null),m=n(null),c=n(null),f=n([]),I=n(null),y=n(null),O=n(new Map),A=n(new Map);return{getImplementationFiles:e(async e=>{let{application:n,projectRoot:R}=e,C=++o.current,{applicationSpec:D,categorizedFiles:L}=n,S=[],x=t.current,M=r.current,_=i.current,$=c.current,b=f.current,v=L.expressionsChanged,N=L.actionsChanged,j=L.componentsChanged,P=L.transformersChanged,H=L.handlersChanged,T=L.elementsChanged,k=Object.fromEntries(L.invariants.map(e=>[e.file.name,e.depHash])),J=l.current,X=JSON.stringify(D.configurator.invariants.entries),V=null===J||m.current!==X||Object.keys(J).length!==L.invariants.length||L.invariants.some(e=>J[e.file.name]!==e.depHash);if(console.info(`[useImplementationFiles] Changed: spec=${L.specChanged}, expressions=${L.expressionsChanged}, actions=${L.actionsChanged}, adminExpressions=${L.adminExpressionsChanged}, transformers=${L.transformersChanged}, handlers=${L.handlersChanged}, elements=${L.elementsChanged}`),v){console.info("[useImplementationFiles] Reloading expression implementations");try{let e=Object.fromEntries(D.configurator.latestModel.aliases);t.current=x=await u(L.expressions.map(e=>e.file.name),e,R)}catch(e){console.warn("[useImplementationFiles] Failed to reload expressions:",e),S.push({code:"RELOAD_EXPRESSIONS_FAILED",message:p(e)})}}let q=a.current;if(N){console.info("[useImplementationFiles] Reloading action implementations");try{a.current=q=await d(L.actions.map(e=>e.file.name),R)}catch(e){console.warn("[useImplementationFiles] Failed to reload actions:",e),S.push({code:"RELOAD_ACTIONS_FAILED",message:p(e)})}}let z=JSON.stringify({projectRoot:R,files:L.adminExpressions.map(e=>[e.file.name,e.depHash]),aliases:[...D.admin.latestModel.aliases]});if(C===o.current&&s.current!==z)try{M=await u(L.adminExpressions.map(e=>e.file.name),Object.fromEntries(D.admin.latestModel.aliases),R),C===o.current&&(r.current=M,s.current=z)}catch(e){S.push({code:"RELOAD_ADMIN_EXPRESSIONS_FAILED",message:p(e)})}if(j){console.info("[useImplementationFiles] Reloading component optics");try{c.current=$=await g(L.components.map(e=>e.file.name),R)}catch(e){console.warn("[useImplementationFiles] Failed to reload components:",e),S.push({code:"RELOAD_COMPONENTS_FAILED",message:p(e)})}}if(V){console.info("[useImplementationFiles] Reloading invariant implementations");try{i.current=_=await h(L.invariants.map(e=>e.file.name),R),l.current=k,m.current=X}catch(e){console.warn("[useImplementationFiles] Failed to reload invariants:",e),S.push({code:"RELOAD_INVARIANTS_FAILED",message:p(e)})}}if(P){console.info("[useImplementationFiles] Reloading transformer implementations");try{f.current=b=await E(L.transformers.map(e=>e.file.name),R)}catch(e){console.warn("[useImplementationFiles] Failed to reload transformers:",e),S.push({code:"RELOAD_TRANSFORMERS_FAILED",message:p(e)})}}let B=null;if(H){console.info("[useImplementationFiles] Reloading handler implementations");try{let e=Object.fromEntries(L.handlers.map(e=>[e.file.name,e.depHash])),n=I.current,t=t=>null===n||n[t]!==e[t],a=A.current,r=L.handlers.map(e=>e.file.name),o=r.filter(e=>t(e)||!a.has(e)),s=await F(o,R),i=new Map(s.map(e=>[e.filePath,e])),l=r.map(e=>{let n=i.get(e)??a.get(e);if(!n)throw Error(`Handler file "${e}" was neither re-imported nor cached from a previous round. This is a hot-reload bookkeeping bug — reload the editor page to recover.`);return n}),m=l.flatMap(e=>e.registrations),c={};for(let{filePath:n,registrations:a}of l){let r=t(n)?e[n]:void 0;if(r)for(let e of a)c[e.name]=r}console.info(`[useImplementationFiles] Staged handlers for registry (${m.length} total)`),B={handlers:m,nameHashes:c},A.current=new Map(l.map(e=>[e.filePath,e])),I.current=e}catch(e){console.warn("[useImplementationFiles] Failed to reload handlers:",e),S.push({code:"RELOAD_HANDLERS_FAILED",message:p(e)})}}let G=null;if(T){console.info("[useImplementationFiles] Reloading element implementations");try{let e=Object.fromEntries(L.elements.map(e=>[e.file.name,e.depHash])),n=y.current,t=t=>null===n||n[t]!==e[t],a=O.current,r=L.elements.map(e=>e.file.name),o=r.filter(e=>t(e)||!a.has(e)),s=await w(o,R),i=new Map(s.map(e=>[e.filePath,e])),l=r.map(e=>{let n=i.get(e)??a.get(e);if(!n)throw Error(`Element file "${e}" was neither re-imported nor cached from a previous round. This is a hot-reload bookkeeping bug — reload the editor page to recover.`);return n}),m=l.flatMap(e=>e.registrations),c={},p=0;for(let{filePath:n,registrations:a}of l){let r=t(n)?e[n]:void 0;for(let e of a)if("assistantFormElement"!==e.type){if("entity"===e.type||"layout"===e.type){r&&(c[e.name]=r);continue}r&&(c[`icon:${p}`]=r),p+=1}}console.info(`[useImplementationFiles] Staged elements for registry (${m.length} total)`),G={elements:m,nameHashes:c},O.current=new Map(l.map(e=>[e.filePath,e])),y.current=e}catch(e){console.warn("[useImplementationFiles] Failed to reload elements:",e),S.push({code:"RELOAD_ELEMENTS_FAILED",message:p(e)})}}return{implementations:x,actionImplementations:q,adminImplementations:M,invariantImplementations:_,importedTransformers:b,customComponentOptics:$,handlers:B,elements:G,errors:S}},[])}};
1
+ import{useCallback as e,useRef as n}from"react";import{resolveActionModules as t,resolveComponentOpticModules as a,resolveElementModule as r,resolveHandlerModule as o,resolveInvariantModules as i,resolveTransformerModule as s}from"#package/domain";import{importImplementationFile as l}from"./import-implementation-file.js";let m=e=>e instanceof Error?e.message:String(e),c=async(e,n)=>{let t=Date.now();return Promise.all(e.map(async e=>({origin:e,exports:await l(`/@fs/${n}/${e}?t=${t}`)})))},p=async(e,n)=>t(await c(e,n));export const mergeComponentOptics=(e,n)=>e.concat(n);let u=async(e,n)=>a(await c(e,n)),d=async(e,n)=>i(await c(e,n)),f=async(e,n)=>(await c(e,n)).map(s),h=async(e,n)=>(await c(e,n)).map(e=>({filePath:e.origin,registrations:o(e)})),g=async(e,n)=>(await c(e,n)).map(e=>({filePath:e.origin,registrations:r(e)}));export const useImplementationFiles=()=>{let t=n([]),a=n(null),r=n([]),o=n(0),i=n(null),s=n({}),l=n(null),E=n(null),F=n(null),w=n([]),I=n(null),y=n(null),A=n(new Map),R=n(new Map);return{getImplementationFiles:e(async e=>{let{application:n,projectRoot:O}=e,D=++o.current,{applicationSpec:L,categorizedFiles:S}=n,C=[],_=t.current,$=r.current,v=s.current,x=F.current,N=w.current,M=S.expressionsChanged,P=S.actionsChanged,b=S.componentsChanged,H=S.transformersChanged,T=S.handlersChanged,k=S.elementsChanged,j=Object.fromEntries(S.invariants.map(e=>[e.file.name,e.depHash])),J=l.current,X=JSON.stringify(L.configurator.invariants.entries),V=null===J||E.current!==X||Object.keys(J).length!==S.invariants.length||S.invariants.some(e=>J[e.file.name]!==e.depHash);if(console.info(`[useImplementationFiles] Changed: spec=${S.specChanged}, expressions=${S.expressionsChanged}, actions=${S.actionsChanged}, adminExpressions=${S.adminExpressionsChanged}, transformers=${S.transformersChanged}, handlers=${S.handlersChanged}, elements=${S.elementsChanged}`),M){console.info("[useImplementationFiles] Reloading expression implementations");try{t.current=_=await c(S.expressions.map(e=>e.file.name),O)}catch(e){console.warn("[useImplementationFiles] Failed to reload expressions:",e),C.push({code:"RELOAD_EXPRESSIONS_FAILED",message:m(e)})}}let q=a.current;if(P){console.info("[useImplementationFiles] Reloading action implementations");try{a.current=q=await p(S.actions.map(e=>e.file.name),O)}catch(e){console.warn("[useImplementationFiles] Failed to reload actions:",e),C.push({code:"RELOAD_ACTIONS_FAILED",message:m(e)})}}let z=JSON.stringify({projectRoot:O,files:S.adminExpressions.map(e=>[e.file.name,e.depHash])});if(D===o.current&&i.current!==z)try{$=await c(S.adminExpressions.map(e=>e.file.name),O),D===o.current&&(r.current=$,i.current=z)}catch(e){C.push({code:"RELOAD_ADMIN_EXPRESSIONS_FAILED",message:m(e)})}if(b){console.info("[useImplementationFiles] Reloading component optics");try{F.current=x=await u(S.components.map(e=>e.file.name),O)}catch(e){console.warn("[useImplementationFiles] Failed to reload components:",e),C.push({code:"RELOAD_COMPONENTS_FAILED",message:m(e)})}}if(V){console.info("[useImplementationFiles] Reloading invariant implementations");try{s.current=v=await d(S.invariants.map(e=>e.file.name),O),l.current=j,E.current=X}catch(e){console.warn("[useImplementationFiles] Failed to reload invariants:",e),C.push({code:"RELOAD_INVARIANTS_FAILED",message:m(e)})}}if(H){console.info("[useImplementationFiles] Reloading transformer implementations");try{w.current=N=await f(S.transformers.map(e=>e.file.name),O)}catch(e){console.warn("[useImplementationFiles] Failed to reload transformers:",e),C.push({code:"RELOAD_TRANSFORMERS_FAILED",message:m(e)})}}let B=null;if(T){console.info("[useImplementationFiles] Reloading handler implementations");try{let e=Object.fromEntries(S.handlers.map(e=>[e.file.name,e.depHash])),n=I.current,t=t=>null===n||n[t]!==e[t],a=R.current,r=S.handlers.map(e=>e.file.name),o=r.filter(e=>t(e)||!a.has(e)),i=await h(o,O),s=new Map(i.map(e=>[e.filePath,e])),l=r.map(e=>{let n=s.get(e)??a.get(e);if(!n)throw Error(`Handler file "${e}" was neither re-imported nor cached from a previous round. This is a hot-reload bookkeeping bug — reload the editor page to recover.`);return n}),m=l.flatMap(e=>e.registrations),c={};for(let{filePath:n,registrations:a}of l){let r=t(n)?e[n]:void 0;if(r)for(let e of a)c[e.name]=r}console.info(`[useImplementationFiles] Staged handlers for registry (${m.length} total)`),B={handlers:m,nameHashes:c},R.current=new Map(l.map(e=>[e.filePath,e])),I.current=e}catch(e){console.warn("[useImplementationFiles] Failed to reload handlers:",e),C.push({code:"RELOAD_HANDLERS_FAILED",message:m(e)})}}let G=null;if(k){console.info("[useImplementationFiles] Reloading element implementations");try{let e=Object.fromEntries(S.elements.map(e=>[e.file.name,e.depHash])),n=y.current,t=t=>null===n||n[t]!==e[t],a=A.current,r=S.elements.map(e=>e.file.name),o=r.filter(e=>t(e)||!a.has(e)),i=await g(o,O),s=new Map(i.map(e=>[e.filePath,e])),l=r.map(e=>{let n=s.get(e)??a.get(e);if(!n)throw Error(`Element file "${e}" was neither re-imported nor cached from a previous round. This is a hot-reload bookkeeping bug — reload the editor page to recover.`);return n}),m=l.flatMap(e=>e.registrations),c={},p=0;for(let{filePath:n,registrations:a}of l){let r=t(n)?e[n]:void 0;for(let e of a)if("assistantFormElement"!==e.type){if("entity"===e.type||"layout"===e.type){r&&(c[e.name]=r);continue}r&&(c[`icon:${p}`]=r),p+=1}}console.info(`[useImplementationFiles] Staged elements for registry (${m.length} total)`),G={elements:m,nameHashes:c},A.current=new Map(l.map(e=>[e.filePath,e])),y.current=e}catch(e){console.warn("[useImplementationFiles] Failed to reload elements:",e),C.push({code:"RELOAD_ELEMENTS_FAILED",message:m(e)})}}return{expressionModules:_,actionImplementations:q,adminExpressionModules:$,invariantImplementations:v,importedTransformers:N,customComponentOptics:x,handlers:B,elements:G,errors:C}},[])}};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import o from"@monaco-editor/react";import{Box as r,Checkbox as i,FormControlLabel as a,Stack as n,Typography as s}from"@mui/material";import{useState as l}from"react";import{EditorButton as m}from"../common/EditorButton.js";import{jsonEditorOptions as d}from"../common/monaco-config.js";import{useOptionalConfigurator as c,useOptionalDomain as p}from"../hooks/use-optional-runtime.js";import{splitOperations as u}from"./split-operations.js";let h={fontSize:"12px",fontWeight:600,color:"text.secondary"};export const GraphQLPanel=()=>{let f=c()?.graphQLSystem,g=p()?.storeSystem,[x,y]=l("query { root { id type } }"),[b,v]=l(""),[S,k]=l(!1),[j,N]=l(null),[C,w]=l(null),[z,J]=l(!1),O=async()=>{let e=u(x),t=(e=>{if(""===e.trim())return{ok:!0,variables:void 0};try{let t=JSON.parse(e);return"object"!=typeof t||null===t||Array.isArray(t)?{ok:!1,message:"Variables must be a JSON object. Wrap them in {} or clear the field."}:{ok:!0,variables:t}}catch(e){return{ok:!1,message:`Variables are not valid JSON: ${e instanceof Error?e.message:String(e)}. Fix the JSON or clear the field.`}}})(b);if(f){if(w(null),!e.ok)return void N(e.message);if(!t.ok)return void N(t.message);if(S&&!g?.isInitialized)return void N("The configuration is not loaded yet, so there is no state to run against. Run again once the configurator has finished loading.");J(!0);try{let o=e.operations.map(e=>({...e,variables:t.variables})),r=S&&g?await f.prepare(g.stateSlices.committed.value.state,o):void 0,{results:i,committed:a,message:n,sideEffects:s}=r?{results:r.map(({result:e})=>e),committed:!1,message:"Dry run: nothing was committed.",sideEffects:f.readSideEffects(r)}:await f.execute(o),l=i.map((t,o)=>({operationName:e.operations[o]?.operationName??null,...t}));N(JSON.stringify(s.length>0?{results:l,sideEffects:s}:l,null,2)),w(a?"Committed as one undo step.":n??"Nothing was committed.")}finally{J(!1)}}};return t(n,{direction:"column",spacing:1.5,sx:{px:1.5,py:1},children:[e(s,{variant:"subtitle2",sx:h,children:"Query"}),e(r,{component:"div",sx:{height:160,border:"1px solid #dee2e6"},children:e(o,{language:"graphql",value:x,onChange:e=>y(e??""),options:d})}),e(s,{variant:"subtitle2",sx:h,children:"Variables (JSON)"}),e(r,{component:"div",sx:{height:80,border:"1px solid #dee2e6"},children:e(o,{language:"json",value:b,onChange:e=>v(e??""),options:d})}),e(a,{control:e(i,{size:"small",checked:S,onChange:e=>{k(e.target.checked)},sx:{p:.5}}),label:"Dry run",sx:{ml:-.5,mr:0,"& .MuiFormControlLabel-label":{fontSize:"12px",color:"#212529"}}}),e(m,{fullWidth:!0,disabled:!f||z,onClick:()=>void O(),children:f?"Run":"Configurator is not ready"}),null!==C&&e(s,{"data-testid":"graphql-status",sx:{fontSize:"12px",color:"text.secondary"},children:C}),null!==j&&e(r,{component:"pre","data-testid":"graphql-result",sx:{m:0,p:1,fontSize:"12px",backgroundColor:"#f8f9fa",overflow:"auto",whiteSpace:"pre-wrap"},children:j})]})};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import o from"@monaco-editor/react";import{Box as r,Checkbox as i,FormControlLabel as a,Stack as n,Typography as s}from"@mui/material";import{useState as l}from"react";import{EditorButton as m}from"../common/EditorButton.js";import{jsonEditorOptions as d}from"../common/monaco-config.js";import{useOptionalConfigurator as c,useOptionalDomain as p}from"../hooks/use-optional-runtime.js";import{splitOperations as u}from"./split-operations.js";let h={fontSize:"12px",fontWeight:600,color:"text.secondary"};export const GraphQLPanel=()=>{let g=c()?.graphQLSystem,f=p()?.storeSystem,[x,v]=l("query { root { id type } }"),[y,b]=l(""),[S,k]=l(!1),[j,N]=l(null),[w,C]=l(null),[z,J]=l(!1),O=async()=>{let e=u(x),t=(e=>{if(""===e.trim())return{ok:!0,variables:void 0};try{let t=JSON.parse(e);return"object"!=typeof t||null===t||Array.isArray(t)?{ok:!1,message:"Variables must be a JSON object. Wrap them in {} or clear the field."}:{ok:!0,variables:t}}catch(e){return{ok:!1,message:`Variables are not valid JSON: ${e instanceof Error?e.message:String(e)}. Fix the JSON or clear the field.`}}})(y);if(g){if(C(null),!e.ok)return void N(e.message);if(!t.ok)return void N(t.message);if(S&&!f?.isInitialized)return void N("The configuration is not loaded yet, so there is no state to run against. Run again once the configurator has finished loading.");J(!0);try{let o=e.operations.map(e=>({...e,variables:t.variables})),r=S?f?.stateSlices.committed.value.state:void 0,i=r?await g.prepare(r,o):void 0,{results:a,committed:n,message:s,sideEffects:l,warnings:m}=i&&r?{results:i.map(({result:e})=>e),committed:!1,message:"Dry run: nothing was committed.",sideEffects:g.readSideEffects(i),warnings:g.readWarnings(r,i)}:await g.execute(o),d=a.map((t,o)=>({operationName:e.operations[o]?.operationName??null,...t}));N(JSON.stringify(l.length>0||m.length>0?{results:d,...l.length>0?{sideEffects:l}:{},...m.length>0?{warnings:m}:{}}:d,null,2)),C(n?"Committed as one undo step.":s??"Nothing was committed.")}finally{J(!1)}}};return t(n,{direction:"column",spacing:1.5,sx:{px:1.5,py:1},children:[e(s,{variant:"subtitle2",sx:h,children:"Query"}),e(r,{component:"div",sx:{height:160,border:"1px solid #dee2e6"},children:e(o,{language:"graphql",value:x,onChange:e=>v(e??""),options:d})}),e(s,{variant:"subtitle2",sx:h,children:"Variables (JSON)"}),e(r,{component:"div",sx:{height:80,border:"1px solid #dee2e6"},children:e(o,{language:"json",value:y,onChange:e=>b(e??""),options:d})}),e(a,{control:e(i,{size:"small",checked:S,onChange:e=>{k(e.target.checked)},sx:{p:.5}}),label:"Dry run",sx:{ml:-.5,mr:0,"& .MuiFormControlLabel-label":{fontSize:"12px",color:"#212529"}}}),e(m,{fullWidth:!0,disabled:!g||z,onClick:()=>void O(),children:g?"Run":"Configurator is not ready"}),null!==w&&e(s,{"data-testid":"graphql-status",sx:{fontSize:"12px",color:"text.secondary"},children:w}),null!==j&&e(r,{component:"pre","data-testid":"graphql-result",sx:{m:0,p:1,fontSize:"12px",backgroundColor:"#f8f9fa",overflow:"auto",whiteSpace:"pre-wrap"},children:j})]})};
@@ -1,3 +1,3 @@
1
- export declare const cacheVersion = 772;
1
+ export declare const cacheVersion = 773;
2
2
  export declare const needsRebuild: (fileContents: string[], outputDirectory: string) => Promise<boolean>;
3
3
  export declare const writeCacheInfo: (fileContents: string[], outputDirectory: string) => Promise<void>;
@@ -1 +1 @@
1
- import{createHash as e}from"crypto";import{existsSync as r}from"fs";import{readFile as t}from"fs/promises";import{isEqualArray as o}from"@salsita-ai/common/utils";import{writeFormatted as i}from"../gen/write-formatted.js";export const cacheVersion=772;let s=r=>({version:772,files:r.map(r=>e("md5").update(r).digest("base64")).sort()});export const needsRebuild=async(e,i)=>{let a=`${i}/cache.json`;if(!r(a))return!0;try{let r=JSON.parse(await t(a,"utf-8")),i=s(e);return 772!==r.version||!o(r.files,i.files)}catch(e){return console.error("Failed to read cache file, forcing rebuild",e),!0}};export const writeCacheInfo=async(e,r)=>{let t=`${r}/cache.json`,o=s(e);await i(t,JSON.stringify(o,null,2))};
1
+ import{createHash as e}from"crypto";import{existsSync as r}from"fs";import{readFile as t}from"fs/promises";import{isEqualArray as o}from"@salsita-ai/common/utils";import{writeFormatted as i}from"../gen/write-formatted.js";export const cacheVersion=773;let s=r=>({version:773,files:r.map(r=>e("md5").update(r).digest("base64")).sort()});export const needsRebuild=async(e,i)=>{let a=`${i}/cache.json`;if(!r(a))return!0;try{let r=JSON.parse(await t(a,"utf-8")),i=s(e);return 773!==r.version||!o(r.files,i.files)}catch(e){return console.error("Failed to read cache file, forcing rebuild",e),!0}};export const writeCacheInfo=async(e,r)=>{let t=`${r}/cache.json`,o=s(e);await i(t,JSON.stringify(o,null,2))};
@@ -1 +1 @@
1
- import{dereference as e}from"@apidevtools/json-schema-ref-parser";import t from"lodash-es/cloneDeep.js";import r from"lodash-es/isEqual.js";import{P as i,match as n}from"ts-pattern";import{ComponentSystemFilterSchema as o,availableSystemComponents as a,getAllPhxDefinitions as s,getExtendedSchemaValidator as d}from"#package/domain";import{domainSpecTemplate as f,requiredSpecs as p}from"./domain-spec-template.js";let m={anyOf:[{$ref:"#/definitions/Read"},{$ref:"#/definitions/ImportRef"},{$ref:"#/definitions/CodeRef"},{$ref:"#/definitions/DataRef"},{$ref:"#/definitions/Eval"}]},c={anyOf:[{$ref:"#/definitions/ReadWrite"},{$ref:"#/definitions/ImportRef"},{$ref:"#/definitions/CodeRef"}]},l=[{readName:"EnhancedStringRead",readWriteName:"EnhancedStringReadWrite",schema:{type:"string"}},{readName:"EnhancedNumberRead",readWriteName:"EnhancedNumberReadWrite",schema:{type:"number"}},{readName:"EnhancedBooleanRead",readWriteName:"EnhancedBooleanReadWrite",schema:{type:"boolean"}}],h=(e,t)=>({anyOf:[$(e,[]),t?{$ref:"#/definitions/ReadWriteEnhancement"}:{$ref:"#/definitions/ReadEnhancement"}]}),y=(e,t)=>{let i=l.find(t=>r(e,t.schema));return i?{$ref:`#/definitions/${t?i.readWriteName:i.readName}`}:h(e,t)},$=(e,t)=>({...e,...n(e).with({type:"object",properties:i.not(i.nullish).select()},e=>({properties:Object.fromEntries(Object.entries(e).map(([e,r])=>[e,y(r,t.includes(e))]))})).with({type:"object",additionalProperties:i.not(i.nullish.or(i.boolean)).select()},e=>({additionalProperties:y(e,!1)})).with({type:"object",patternProperties:i.not(i.nullish).select()},e=>({patternProperties:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,y(t,!1)]))})).with({type:"array",items:i.not(i.nullish).select()},e=>({items:$(e,[])})).with({anyOf:i.array().select()},e=>({anyOf:e.map(e=>$(e,[]))})).with({oneOf:i.array().select()},e=>({oneOf:e.map(e=>$(e,[]))})).otherwise(()=>({}))}),u={anyOf:[...$(o,[]).anyOf,{$ref:"#/definitions/Read"}]},j=Object.fromEntries(l.flatMap(e=>[[e.readName,h(e.schema,!1)],[e.readWriteName,h(e.schema,!0)]])),b=e=>{let{definitions:t,...r}=$(e.schema,e.writableKeys);return{type:"object",additionalProperties:{anyOf:[{...r,properties:{...r.properties,$filter:{$ref:"#/definitions/ComponentSystemFilter"}}},{type:"object",properties:{$read:{type:"string",pattern:"^\\$?[a-z]\\w*$"},$filter:{$ref:"#/definitions/ComponentSystemFilter"}},required:["$read"],additionalProperties:!1}]}}},O=e=>{let t=a.find(t=>t.name===e);if(!t)throw Error(`Component ${e} not found!`);return b(t)},E=e=>{for(let t of Object.values(e))for(let[e,r]of Object.entries(t)){let t={...O(e).additionalProperties,definitions:{...f.definitions,...s(),...j,ComponentSystemFilter:u,ReadEnhancement:m,ReadWriteEnhancement:c}},i=d().compile(t);for(let[t,n]of Object.entries(r))if(!i(n))throw Error(`Component validation failed ${e} ${t}, ${JSON.stringify(i.errors,null,2)}`)}};export const getDomainSpec=(e=!0)=>t({$comment:"This schema is generated from the domain-spec-template.json file, do not modify it directly.",...f,properties:{...f.properties,components:{type:"object",patternProperties:{"^[A-Z]\\w*$":{type:"object",properties:e?Object.fromEntries(a.map(e=>{let t=b(e);return[e.name,t]})):{},additionalProperties:!e}},additionalProperties:!1}},definitions:{...f.definitions,...s(),...j,ComponentSystemFilter:u,ReadEnhancement:m,ReadWriteEnhancement:c}});let R=getDomainSpec(!1),w=d().compile(R),g=d().compile({...R,$id:"https://salsita.ai/phoenix/schemas/domain-spec.json!complete",required:[...p]});export const getValidatePartialSpecification=()=>e=>{let t=w(e);return(E(e.components??{}),t)?{success:!0,value:e}:{success:!1,errors:w.errors}};export const getValidateMergedSpecification=()=>e=>{let t=g(e);return(E(e.components??{}),t)?{success:!0,value:e}:{success:!1,errors:g.errors}};export const dereferenceDomainSpec=async r=>{var i;let n,o;return r.definitions={...t(s()),...r.definitions??{}},i=e=>{"object"==typeof e&&null!==e&&"$ref"in e&&"string"==typeof e.$ref&&(e.$ref=e.$ref.replace("https://salsita.ai/phoenix/schemas/types.json#","#"))},n=new Set,(o=e=>{if(!n.has(e)){if(n.add(e),i(e),Array.isArray(e))for(let t of e)o(t);else if("object"==typeof e&&null!==e)for(let t of Object.values(e))o(t)}})(r),await e(r,{resolve:{http:!1,file:!1,common:{order:2}}}),delete r.definitions,r};
1
+ import{dereference as e}from"@apidevtools/json-schema-ref-parser";import t from"lodash-es/cloneDeep.js";import r from"lodash-es/isEqual.js";import{P as i,match as n}from"ts-pattern";import{ComponentSystemFilterSchema as o,availableSystemComponents as a,getAllPhxDefinitions as s,getExtendedSchemaValidator as f}from"#package/domain";import{domainSpecTemplate as p,requiredSpecs as d}from"./domain-spec-template.js";let l={anyOf:[{$ref:"#/definitions/Read"},{$ref:"#/definitions/ImportRef"},{$ref:"#/definitions/CodeRef"},{$ref:"#/definitions/DataRef"},{$ref:"#/definitions/Eval"}]},m={anyOf:[{$ref:"#/definitions/ReadWrite"},{$ref:"#/definitions/ImportRef"},{$ref:"#/definitions/CodeRef"}]},c=[{readName:"EnhancedStringRead",readWriteName:"EnhancedStringReadWrite",schema:{type:"string"}},{readName:"EnhancedNumberRead",readWriteName:"EnhancedNumberReadWrite",schema:{type:"number"}},{readName:"EnhancedBooleanRead",readWriteName:"EnhancedBooleanReadWrite",schema:{type:"boolean"}}],h=(e,t)=>({anyOf:[$(e,[]),t?{$ref:"#/definitions/ReadWriteEnhancement"}:{$ref:"#/definitions/ReadEnhancement"}]}),y=(e,t)=>{let i=c.find(t=>r(e,t.schema));return i?{$ref:`#/definitions/${t?i.readWriteName:i.readName}`}:h(e,t)},$=(e,t)=>({...e,...n(e).with({type:"object",properties:i.not(i.nullish).select()},e=>({properties:Object.fromEntries(Object.entries(e).map(([e,r])=>[e,y(r,t.includes(e))]))})).with({type:"object",additionalProperties:i.not(i.nullish.or(i.boolean)).select()},e=>({additionalProperties:y(e,!1)})).with({type:"object",patternProperties:i.not(i.nullish).select()},e=>({patternProperties:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,y(t,!1)]))})).with({type:"array",items:i.not(i.nullish).select()},e=>({items:$(e,[])})).with({anyOf:i.array().select()},e=>({anyOf:e.map(e=>$(e,[]))})).with({oneOf:i.array().select()},e=>({oneOf:e.map(e=>$(e,[]))})).otherwise(()=>({}))}),u={anyOf:[...$(o,[]).anyOf,{$ref:"#/definitions/Read"}]},j=Object.fromEntries(c.flatMap(e=>[[e.readName,h(e.schema,!1)],[e.readWriteName,h(e.schema,!0)]])),b=e=>{let{definitions:t,...r}=$(e.schema,e.writableKeys);return{type:"object",additionalProperties:{anyOf:[{...r,properties:{...r.properties,$filter:{$ref:"#/definitions/ComponentSystemFilter"}}},{type:"object",properties:{$read:{type:"string",pattern:"^\\$?[a-z]\\w*$"},$filter:{$ref:"#/definitions/ComponentSystemFilter"}},required:["$read"],additionalProperties:!1}]}}},O=new Map,E=e=>{let t=`${globalThis.PHX_SCHEMA_VALIDATOR??"ajv"}:${e}`,r=O.get(t);if(r)return r;let i={...(e=>{let t=a.find(t=>t.name===e);if(!t)throw Error(`Component ${e} not found!`);return b(t)})(e).additionalProperties,definitions:{...p.definitions,...s(),...j,ComponentSystemFilter:u,ReadEnhancement:l,ReadWriteEnhancement:m}},n=f().compile(i);return O.set(t,n),n},R=e=>{for(let t of Object.values(e))for(let[e,r]of Object.entries(t)){let t=E(e);for(let[i,n]of Object.entries(r))if(!t(n))throw Error(`Component validation failed ${e} ${i}, ${JSON.stringify(t.errors,null,2)}`)}};export const getDomainSpec=(e=!0)=>t({$comment:"This schema is generated from the domain-spec-template.json file, do not modify it directly.",...p,properties:{...p.properties,components:{type:"object",patternProperties:{"^[A-Z]\\w*$":{type:"object",properties:e?Object.fromEntries(a.map(e=>{let t=b(e);return[e.name,t]})):{},additionalProperties:!e}},additionalProperties:!1}},definitions:{...p.definitions,...s(),...j,ComponentSystemFilter:u,ReadEnhancement:l,ReadWriteEnhancement:m}});let g=getDomainSpec(!1),w=f().compile(g),S=f().compile({...g,$id:"https://salsita.ai/phoenix/schemas/domain-spec.json!complete",required:[...d]});export const getValidatePartialSpecification=()=>e=>{let t=w(e);return(R(e.components??{}),t)?{success:!0,value:e}:{success:!1,errors:w.errors}};export const getValidateMergedSpecification=()=>e=>{let t=S(e);return(R(e.components??{}),t)?{success:!0,value:e}:{success:!1,errors:S.errors}};export const dereferenceDomainSpec=async r=>{var i;let n,o;return r.definitions={...t(s()),...r.definitions??{}},i=e=>{"object"==typeof e&&null!==e&&"$ref"in e&&"string"==typeof e.$ref&&(e.$ref=e.$ref.replace("https://salsita.ai/phoenix/schemas/types.json#","#"))},n=new Set,(o=e=>{if(!n.has(e)){if(n.add(e),i(e),Array.isArray(e))for(let t of e)o(t);else if("object"==typeof e&&null!==e)for(let t of Object.values(e))o(t)}})(r),await e(r,{resolve:{http:!1,file:!1,common:{order:2}}}),delete r.definitions,r};
@@ -1,2 +1,2 @@
1
1
  export declare const mergeClaudeMdContent: (existingContent: string | undefined) => string;
2
- export declare const claudeMdFile = "[PHOENIX-SDK-START]\n## Phoenix Configurator Project\n\nDeclarative 3D product configurator built with Phoenix SDK. Domain model defined in YAML, custom logic in TypeScript.\n\n## Build Commands\n- `pnpm phoenix build` \u2014 Full production build\n- `pnpm phoenix dev` \u2014 Development mode with hot reload\n- `pnpm phoenix sync` \u2014 Sync generated files without full build\n\n## Dev Logs\n- `pnpm phoenix dev` writes all logs to `.phoenix/phoenix-dev.log`\n- Contains: spec parse errors, build errors, browser runtime errors, file watcher events\n- After making changes, always check the log for errors: `tail -50 .phoenix/phoenix-dev.log` or `grep ERROR .phoenix/phoenix-dev.log`\n- Rotated automatically at 10MB (`.log.1`, `.log.2` are older rotations)\n\n## Project Structure\n- `spec/` \u2014 Domain YAML specs (entities, relations, expressions, invariants, components, application config)\n- `src/expressions/` \u2014 Computed/derived entity properties (`phx.domain.implementCustomExpressions()`)\n- `src/invariants/` \u2014 Business rule constraints (`phx.domain.implementCustomInvariants()`)\n- `src/transformers/` \u2014 Automatic state fixers (`phx.frontend.transformerBuilder`)\n- `src/components/` \u2014 ECS system components (`phx.domain.attachComponent.withEntity()`)\n- `src/elements/` \u2014 Page-level React components (`phx.frontend.createCustomPhoenixLayoutElement()`)\n - `ConfiguratorLayout`: a layout element with this name replaces everything the built-in layout renders for a loaded configuration, in owner and read mode, finalization included. Prefer arranging the spec's layout components; write one for shell-level changes, such as moving the sidebar or adding an area the built-in layout has no place for\n - Mount `LayoutSlots.SharedCanvas` (from `@salsita-ai/sdk/configurator`) in a positioned root covering the page, or the app loader stays on screen; put the UI above it, positioned and after it in the markup. Call `useSceneSafeArea()` (same import) and put `containerRef` on the element covering the whole canvas and `safeAreaRef` on the region the UI leaves free, with `pointerEvents: 'none'`, so the camera frames the scene there\n - Sidebar moved, contents as the spec configures them: mount `LayoutSlots.DesktopSidebar` in a positioned container that sets its size, with `side=\"start\"` on the left; `docs/layouts/sidebar/in-a-custom-layout.mdx` is the whole layout\n - Your own UI: \"Hooks for a Project Layout\" in `docs/phoenix/configurator-interface.mdx` lists the hooks with what each returns (`pnpm phoenix docs -r docs/phoenix/configurator-interface.mdx`), `docs/phoenix/layout-slots.mdx` the built-in pieces you can still mount, and `docs/layouts/custom-layout.mdx` is a worked example\n - Messages: mount `LayoutSlots.Services` for the built-in snackbars, or show violations, side-effect hints and errors yourself with `phx.frontend.useConfiguratorMessages(onMessage)`, not both. Either way mount a snackbar root (`LayoutSlots.DesktopSnackbarsRoot` or `LayoutSlots.MobileSnackbarsRoot`): save and built-in action errors are always snackbars\n - Finalize over the spec's `finalizeAction` components, each naming a handler registered with `phx.frontend.createPhoenixHandler`: run each with `phx.frontend.useFinalizeAction(handler)` in a component of its own wrapped in `PhoenixHandlerBoundary` (from `@salsita-ai/sdk/react`), or mount `FinalizeActions` (from `@salsita-ai/sdk/configurator`) for the built-in buttons. `finalizePage` and `finalizeButton` are legacy\n - Read mode and fullscreen are the layout's job, no hook enforces them: hide what a viewer must not change while `phx.frontend.useAccessService().accessInfo.viewMode` is `true`, and remove panels while `phx.frontend.useIsFullscreenActive()` is set; `phx.frontend.useSetFullscreen()` returns its setter\n- `src/handlers/` \u2014 Event & lifecycle handlers\n- `src/webhooks/` \u2014 Server-side webhook handlers (`phx.webhooks.*Builder`)\n- `src/migrations/` \u2014 Schema version migrations (v*.ts)\n- `src/locales/` \u2014 Locale catalogs (authored .po sources; compiled .ts, do not edit)\n- `src/admin/` \u2014 Admin interface (mirrors main src/ structure)\n- `src/_shared/` \u2014 Shared utilities (NOT auto-imported, requires explicit imports)\n- `.phoenix/` \u2014 Auto-generated files (DO NOT EDIT)\n- `public/` \u2014 Static assets (3D models, textures, images, HDRI maps, fonts)\n- `assets/` \u2014 Uploadable resources (PDF templates, email assets)\n\n## Architecture Principles\n- YAML-first: 99% of configuration in spec/*.yaml, custom code is last resort\n- ECS pattern: entities (domain objects) + components (behavior/UI) + systems (SDK runtime)\n- Reactive state: immutable domain state flows through RxJS pipelines\n- Data binding: `$read` (read-only), `$write` (write-only), `$bind` (bidirectional) connect components to domain\n- memoEval: all component implementations must use memoEval for stable object references\n\n## Key Patterns\n- Expressions = computed properties on entities (prefix: `$`), implemented per-entity in src/expressions/\n- Invariants = validation rules returning violations, static or dynamic\n- Transformers = auto-fixers maintaining consistency after state changes\n- Components defined in YAML with `$read`/`$bind` bindings, or custom in src/components/ using attachComponent builder\n- Webhooks = server-side finalization tasks (PDF, email, CSV, image rendering)\n- Filters = contextual component activation via navigationStates, viewStates, modes, selectedEntityIds\n\n## File Conventions\n- Components: PascalCase (.tsx)\n- Utilities: kebab-case (.ts)\n- Expressions: entity-name.ts\n- Migrations: v*.ts (sequential)\n- Specs: kebab-case.yaml\n- Underscore folders (_shared/, _utils/) are NOT auto-imported\n\n## Export Rules\nAll files in src/expressions/, src/invariants/, src/transformers/, src/components/, src/handlers/, src/webhooks/ MUST use default exports. Can be a single item or an array. Named exports are ignored by the SDK auto-import system.\n\n## Webhook Membership\n- User-authored components, admin components, and handlers are frontend-only by default.\n- A handler that registers `createMapPublishedRevisionDataHandler`, `createMapPublishedChunkedDataHandler`, `createDataRowValidatorHandler`, or `createSheetValidatorHandler` is included in the webhook automatically.\n- To include another component or handler in the webhook, put `'use webhook'` as its first statement (leading comments are allowed).\n- A webhook-included file and its runtime local-import closure must not import browser SDK entrypoints (`application`, `admin`, `configurator`, `editor`, `react`, `ui`) or style/font/image assets. Spec parsing reports the unsafe import and inclusion reason as a diagnostic.\n- Keep browser rendering in an unpinned file. Move shared server-safe logic into a separate module when both frontend and webhook code need it.\n\n## Do Not Edit\n- `.phoenix/` directory \u2014 completely regenerated on each build\n- `tsconfig.json`, `eslint.config.js`, `prettier.config.js`, `.prettierignore`, `.linguirc`, `.nvmrc`\n- `src/locales/` .ts files \u2014 compiled from .po files\n\n## Code Review\nUse `/review` command to review code changes before committing.\n\n## SDK Documentation\n\nAlways search SDK docs for relevant examples before implementing Phoenix features.\n\n### Commands\n- `pnpm phoenix docs` \u2014 Full documentation index with descriptions\n- `pnpm phoenix docs -s <term>` \u2014 Search all doc content and metadata (case-insensitive)\n- `pnpm phoenix docs --dir` \u2014 Print the absolute docs directory for grep or ripgrep\n- `pnpm phoenix docs -r <path>` \u2014 Read specific doc (raw text to stdout)\n- `pnpm phoenix docs -c <category>` \u2014 List docs in a category\n- `pnpm phoenix docs -l` \u2014 List all doc paths with titles\n\n### 3D Asset Inspection\n\nRun `pnpm phoenix inspect:assets` to discover all glTF/GLB files in `public/` and get a summary table. Use `--file <path>` for detailed single-file inspection.\n\n**When to use:** before writing YAML/code that references objectName, materialsToOverride, morphTargetInfluences, or object positioning.\n\n**What it shows per node:**\n- Name, type (Mesh/Light/Camera/Empty), children\n- Transform: `pos=`, `rot=`, `scale=` (only non-default values shown)\n- Per-node morph targets: `morphs=Width,Height`\n- Bounding box: `bounds=WxHxD` (width x height x depth in meters)\n- Origin placement: `origin=center`, `bottom-center`, `top-center`, `bottom-corner`, etc. with numerical offset\n\n**Use cases:**\n- Find exact node names for `objectName` in scene entity components\n- Find material names for `materialsToOverride`\n- Find morph target names for `morphTargetInfluences`\n- Check model dimensions (bounds) for positioning, dimension indicators, or invariants\n- Check origin placement to understand how models anchor (center vs bottom-center)\n- Use `--json` for programmatic access to all data\n\n**Flags:** `--objects`, `--materials`, `--morphs`, `--animations`, `--json`\n\n### Screenshot CLI\n\nCapture 3D canvas screenshots from a running dev server via `pnpm phoenix screenshot`.\n\n**Prerequisites:**\n1. `phoenix dev` must be running (starts the WebSocket server on port 3020)\n2. Configurator must be open in a browser (the browser does the actual rendering)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (default: `./screenshot.png`)\n- `--width, -w` \u2014 Width in pixels (default: 1920)\n- `--height` \u2014 Height in pixels (default: 1080)\n- `--format, -f` \u2014 Image format: PNG or JPEG (default: PNG)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Example workflow:**\n1. Start dev server: `pnpm phoenix dev`\n2. Open configurator in browser (or via Playwright MCP)\n3. Take screenshot: `pnpm phoenix screenshot -o ./render.png -w 2560 --height 1440`\n\n**Use cases:** visual regression testing, generating product images, debugging 3D renders\n\n### Inspect: State\n\nGet the current editor runtime state as JSON via `pnpm phoenix inspect:state`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (prints to stdout if omitted)\n- `--sections, -s` \u2014 Comma-separated: entities, navigation, validation (default: all)\n- `--pretty` \u2014 Pretty-print JSON (default: true)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Example:** `pnpm phoenix inspect:state -o ./state.json -s entities,navigation`\n\n**Lifecycle status:** Always included in response. Shows which systems are ready:\n- `domainLoaded` \u2014 domain data loaded\n- `domainContextReady` \u2014 domain context initialized (entities available)\n- `configuratorReady` \u2014 3D configurator initialized\n- `sessionAuthenticated` \u2014 session service active\n- `editorMode` \u2014 editor mode enabled\n\n**Tips:** Use `--sections` to limit payload size. Pipe through `head`/`tail` for partial output (e.g., `pnpm phoenix inspect:state | head -50`).\n\n**Use cases:** AI agent context, debugging entity state, inspecting navigation/validation\n\n### Inspect: Data\n\nGet the current editor context data as JSON via `pnpm phoenix inspect:data`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (prints to stdout if omitted)\n- `--pretty` \u2014 Pretty-print JSON (default: true)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Returns:** publishedData, frontendData, backendData, sessionData, accessData, webComponentProperties\n\n**Example:** `pnpm phoenix inspect:data -o ./data.json`\n\n**Tips:** Pipe through `head`/`tail` for partial output (e.g., `pnpm phoenix inspect:data | head -30`).\n\n**Use cases:** AI agent context, debugging published/session/access data\n\n### Inspect: Scene\n\nGet the current Three.js scene graph as JSON via `pnpm phoenix inspect:scene`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (prints to stdout if omitted)\n- `--pretty` \u2014 Pretty-print JSON (default: true)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Returns:** Recursive scene tree with per-node: name, type, visible, position, rotation, scale, userData (entityId), and for meshes: geometry name, bounding box, material properties (color, metalness, roughness, opacity, textures), morph target influences. Lights include color, intensity, and type-specific properties.\n\n**Example:** `pnpm phoenix inspect:scene -o ./scene.json`\n\n**Tips:** Scene graphs can be large. Pipe through `head`/`tail` for partial output.\n\n**Use cases:** AI agent context, debugging 3D scene layout, inspecting materials and lighting\n\n### Key Docs\n- `docs/phoenix/getting-started.mdx` \u2014 Setup, prerequisites, first project\n- `docs/phoenix/quickstart.mdx` \u2014 End-to-end tutorial building a configurator\n- `docs/phoenix/domain-model.mdx` \u2014 Entities, attributes, relations, specs\n- `docs/phoenix/components.mdx` \u2014 ECS pattern, YAML components, custom components\n- `docs/phoenix/project-structure.mdx` \u2014 Files, folders, conventions\n- `docs/phoenix/best-practices.mdx` \u2014 YAML-first, code patterns, common pitfalls\n- `docs/phoenix/state-management.mdx` \u2014 Reactive state, RxJS pipelines, data flow\n- `docs/phoenix/expression-context.mdx` \u2014 Expression API, context object, helpers\n- `docs/phoenix/webhooks.mdx` \u2014 Server-side finalization workflows\n- `docs/phoenix/finalization.mdx` \u2014 Finalization system, PDF/email/CSV generation\n- `docs/phoenix/migrations.mdx` \u2014 Schema versioning, migration files\n\n### Agent Workflow\n1. Find relevant docs by content: `pnpm phoenix docs -s \"camera\"`\n2. Read matching doc: `pnpm phoenix docs -r docs/3d-scene/cameras/transitions.mdx`\n3. Search within a doc: `pnpm phoenix docs -r <path> | grep \"example\"`\n4. Search titles only as a fallback: `pnpm phoenix docs -l | grep \"camera\"`\n5. Search generated files directly when needed: `grep -rn \"camera\" \"$(pnpm phoenix docs --dir)\"`\n6. Browse a topic area: `pnpm phoenix docs -c \"Layouts\"`\n\n### Playwright MCP Setup (for AI agents)\n\nTo interact with the 3D configurator in a browser, Playwright MCP needs GPU-enabled flags for WebGL rendering. Add to `~/.claude/.mcp.json`:\n\n```json\n{\n \"mcpServers\": {\n \"playwright\": {\n \"command\": \"npx\",\n \"args\": [\n \"@playwright/mcp@latest\",\n \"--headed\",\n \"--launch-options\",\n \"{\\\"args\\\":[\\\"--use-gl=swiftshader\\\",\\\"--enable-webgl\\\",\\\"--ignore-gpu-blocklist\\\"]}\"\n ]\n }\n }\n}\n```\n\nKey flags:\n- `--headed` \u2014 visible browser (required for GPU rendering)\n- `--use-gl=swiftshader` \u2014 software GPU fallback for environments without a physical GPU\n- `--enable-webgl` + `--ignore-gpu-blocklist` \u2014 ensure WebGL is available\n[PHOENIX-SDK-END]\n";
2
+ export declare const claudeMdFile = "[PHOENIX-SDK-START]\n## Phoenix Configurator Project\n\nDeclarative 3D product configurator built with Phoenix SDK. Domain model defined in YAML, custom logic in TypeScript.\n\n## Build Commands\n- `pnpm phoenix build` \u2014 Full production build\n- `pnpm phoenix dev` \u2014 Development mode with hot reload\n- `pnpm phoenix sync` \u2014 Sync generated files without full build\n\n## Dev Logs\n- `pnpm phoenix dev` writes all logs to `.phoenix/phoenix-dev.log`\n- Contains: spec parse errors, build errors, browser runtime errors, file watcher events\n- After making changes, always check the log for errors: `tail -50 .phoenix/phoenix-dev.log` or `grep ERROR .phoenix/phoenix-dev.log`\n- Rotated automatically at 10MB (`.log.1`, `.log.2` are older rotations)\n\n## Project Structure\n- `spec/` \u2014 Domain YAML specs (entities, relations, expressions, invariants, components, application config)\n- `src/expressions/` \u2014 Computed/derived entity properties (`phx.domain.implementCustomExpressions()`)\n- `src/invariants/` \u2014 Business rule constraints (`phx.domain.implementCustomInvariants()`)\n- `src/transformers/` \u2014 Automatic state fixers (`phx.frontend.transformerBuilder`)\n- `src/components/` \u2014 ECS system components (`phx.domain.attachComponent.withEntity()`)\n- `src/elements/` \u2014 Page-level React components (`phx.frontend.createCustomPhoenixLayoutElement()`)\n - `ConfiguratorLayout`: a layout element with this name replaces everything the built-in layout renders for a loaded configuration, in owner and read mode, finalization included. Prefer arranging the spec's layout components; write one for shell-level changes, such as moving the sidebar or adding an area the built-in layout has no place for\n - Mount `LayoutSlots.SharedCanvas` (from `@salsita-ai/sdk/configurator`) in a positioned root covering the page; put the UI above it, positioned and after it in the markup. With the canvas mounted the app loader waits until the scene has loaded; a layout without a canvas is not held by the loader. Call `phx.frontend.useSceneSafeArea()` and put `containerRef` on the element covering the whole canvas and `safeAreaRef` on the region the UI leaves free, with `pointerEvents: 'none'`, so the camera frames the scene there\n - Sidebar moved, contents as the spec configures them: mount `LayoutSlots.DesktopSidebar` in a positioned container that sets its size, with `side=\"start\"` on the left; `docs/layouts/sidebar/in-a-custom-layout.mdx` is the whole layout\n - Your own UI: \"Hooks for a Project Layout\" in `docs/phoenix/configurator-interface.mdx` lists the hooks with what each returns (`pnpm phoenix docs -r docs/phoenix/configurator-interface.mdx`), `docs/phoenix/layout-slots.mdx` the built-in pieces you can still mount, and `docs/layouts/custom-layout.mdx` is a worked example. Call the hooks as `phx.frontend.useX()`; besides those below, these are often needed: `usePreview()` (`isPreview` while the preview start screen shows), `useCloseAction()` (the host's close action or `null`), `useActiveViewports()` (the container's breakpoints, `null` until measured, `desktop` above 768 px: the desktop/phone switch), `useResolveLocalizable()` and `useLocalizable(text)` (spec texts to strings), `useIsCloningAllowed()` (a read-mode \"edit a copy\" action with `LayoutSlots.CloneToEditDialog`)\n - Undo and redo: `phx.frontend.useUndoRedo()` returns `{ canUndo, canRedo, undo, redo }`; disable each button from `canUndo`/`canRedo`\n - Tabs: `phx.frontend.useTabNavigation()` returns `{ source, tabs, activeTab, select }` for the spec's `sidebarTabs` (of the selected entity) or `horizontalTabs`; render `tabs` (each `{ index, label, icon, state, isActive }`, `icon` a PhxIcon name) and call `select(tab.index)` on click. Pass `{ source: 'sidebarTabs' }` or `{ source: 'horizontalTabs' }` when the layout shows one kind only. Not `LayoutSlots.useSidebarTabs()`: it serves the built-in sidebar and returns no tabs while its summary shows\n - Steps: `phx.frontend.useStepNavigation()` returns `{ steps, activeStep, activeIndex, isFirst, isLast, canGoNext, canGoPrevious, next, previous, goTo }` for the spec's `navigationSteps`; render `steps` (each `{ index, label, state, status }`, `status` `'complete' | 'active' | 'upcoming'`), call `next()`/`previous()` for Back and Next and `goTo(step.index)` from a stepper. It enforces no order and no validity: enable only `'complete'` steps for an \"earlier steps only\" stepper, and to block moving on while the configuration has a problem, require `phx.frontend.useStateValidity().severity !== 'warning'` besides `canGoNext`: a change with a `fixable` or `fatal` violation is rejected, so the configuration is never invalid, and a `warning` is the problem that stays (it blocks finalizing too). `useSteps` and `useHasSteps` from `@salsita-ai/sdk/configurator` are deprecated\n - Messages: mount `LayoutSlots.Services` for the built-in snackbars, or show violations, side-effect hints, errors and failed saves yourself with `phx.frontend.useConfiguratorMessages(onMessage)`, not both. A failed save arrives as `saveError`, the next successful save as `saveRecovery`; a layout that mounts neither shows no sign of a failed save. Either way mount a snackbar root (`LayoutSlots.DesktopSnackbarsRoot` or `LayoutSlots.MobileSnackbarsRoot`): errors of the built-in actions are always snackbars\n - Finalize over the spec's `finalizeAction` components, each naming a handler registered with `phx.frontend.createPhoenixHandler`: `phx.frontend.useFinalizeActions()` returns `{ actions, primary, secondary, disabled, hints }`; render `primary` (and `secondary` in a menu or list) in a loop, each action `{ key, label, title, icon, run, isPending, error, disabled }`, and call `action.run()` on click (its promise never rejects; show `action.error` on failure). The configurator runs the handlers itself, outside the layout, so a handler must not rely on a provider the layout adds. For one known handler, `phx.frontend.useFinalizeAction(handler)` in a component wrapped in `PhoenixHandlerBoundary` (from `@salsita-ai/sdk/react`) works too; `FinalizeActions` (from `@salsita-ai/sdk/configurator`) mounts the built-in buttons. `finalizePage` and `finalizeButton` are legacy\n - Read mode and fullscreen are the layout's job, no hook enforces them (`useUndoRedo`, `useFinalizeActions` and `useStepNavigation` included): hide undo, redo, finalization and whatever else a viewer must not change while `phx.frontend.useAccessService().accessInfo.viewMode` is `true` (tabs are navigation, so a viewer may switch them), and remove panels while `phx.frontend.useIsFullscreenActive()` is set; `phx.frontend.useSetFullscreen()` returns its setter\n - `ConfigurationNotFoundPage`: `phx.frontend.createConfigurationNotFoundPage(({ onBack }) => \u2026)` replaces the \"configuration not accessible\" page; show a way back only when the optional `onBack` is set. The not-authenticated page's default renders it too; only the admin's not-authorized page keeps the built-in page\n - `ConfiguratorErrorPage`: `phx.frontend.createConfiguratorErrorPage(({ reason, onRetry }) => \u2026)` replaces the production error page; `reason` is `uncaughtError` or `presetCreationFailed`. A page that throws falls back to the built-in one, and development keeps the detailed error pages, so the project page shows only in a production build. Register both pages with these helpers: `createCustomPhoenixLayoutElement` with the name works too, but types the component as taking only `children`, so the typed props do not compile there in a strict project\n - `AppLoaderContent`: `phx.frontend.createAppLoader(({ phases }) => \u2026)` replaces what the loading overlay shows (each phase `{ id, label?, progress? }`, the list possibly empty); Phoenix keeps the overlay itself\n- `src/handlers/` \u2014 Event & lifecycle handlers\n- `src/webhooks/` \u2014 Server-side webhook handlers (`phx.webhooks.*Builder`)\n- `src/migrations/` \u2014 Schema version migrations (v*.ts)\n- `src/locales/` \u2014 Locale catalogs (authored .po sources; compiled .ts, do not edit)\n- `src/admin/` \u2014 Admin interface (mirrors main src/ structure)\n- `src/_shared/` \u2014 Shared utilities (NOT auto-imported, requires explicit imports)\n- `.phoenix/` \u2014 Auto-generated files (DO NOT EDIT)\n- `public/` \u2014 Static assets (3D models, textures, images, HDRI maps, fonts)\n- `assets/` \u2014 Uploadable resources (PDF templates, email assets)\n\n## Architecture Principles\n- YAML-first: 99% of configuration in spec/*.yaml, custom code is last resort\n- ECS pattern: entities (domain objects) + components (behavior/UI) + systems (SDK runtime)\n- Reactive state: immutable domain state flows through RxJS pipelines\n- Data binding: `$read` (read-only), `$write` (write-only), `$bind` (bidirectional) connect components to domain\n- memoEval: all component implementations must use memoEval for stable object references\n\n## Key Patterns\n- Expressions = computed properties on entities (prefix: `$`), implemented per-entity in src/expressions/\n- Invariants = validation rules returning violations, static or dynamic\n- Transformers = auto-fixers maintaining consistency after state changes\n- Components defined in YAML with `$read`/`$bind` bindings, or custom in src/components/ using attachComponent builder\n- Webhooks = server-side finalization tasks (PDF, email, CSV, image rendering)\n- Filters = contextual component activation via navigationStates, viewStates, modes, selectedEntityIds\n\n## File Conventions\n- Components: PascalCase (.tsx)\n- Utilities: kebab-case (.ts)\n- Expressions: entity-name.ts\n- Migrations: v*.ts (sequential)\n- Specs: kebab-case.yaml\n- Underscore folders (_shared/, _utils/) are NOT auto-imported\n\n## Export Rules\nAll files in src/expressions/, src/invariants/, src/transformers/, src/components/, src/handlers/, src/webhooks/ MUST use default exports. Can be a single item or an array. Named exports are ignored by the SDK auto-import system.\n\n## Webhook Membership\n- User-authored components, admin components, and handlers are frontend-only by default.\n- A handler that registers `createMapPublishedRevisionDataHandler`, `createMapPublishedChunkedDataHandler`, `createDataRowValidatorHandler`, or `createSheetValidatorHandler` is included in the webhook automatically.\n- To include another component or handler in the webhook, put `'use webhook'` as its first statement (leading comments are allowed).\n- A webhook-included file and its runtime local-import closure must not import browser SDK entrypoints (`application`, `admin`, `configurator`, `editor`, `react`, `ui`) or style/font/image assets. Spec parsing reports the unsafe import and inclusion reason as a diagnostic.\n- Keep browser rendering in an unpinned file. Move shared server-safe logic into a separate module when both frontend and webhook code need it.\n\n## Do Not Edit\n- `.phoenix/` directory \u2014 completely regenerated on each build\n- `tsconfig.json`, `eslint.config.js`, `prettier.config.js`, `.prettierignore`, `.linguirc`, `.nvmrc`\n- `src/locales/` .ts files \u2014 compiled from .po files\n\n## Code Review\nUse `/review` command to review code changes before committing.\n\n## SDK Documentation\n\nAlways search SDK docs for relevant examples before implementing Phoenix features.\n\n### Commands\n- `pnpm phoenix docs` \u2014 Full documentation index with descriptions\n- `pnpm phoenix docs -s <term>` \u2014 Search all doc content and metadata (case-insensitive)\n- `pnpm phoenix docs --dir` \u2014 Print the absolute docs directory for grep or ripgrep\n- `pnpm phoenix docs -r <path>` \u2014 Read specific doc (raw text to stdout)\n- `pnpm phoenix docs -c <category>` \u2014 List docs in a category\n- `pnpm phoenix docs -l` \u2014 List all doc paths with titles\n\n### 3D Asset Inspection\n\nRun `pnpm phoenix inspect:assets` to discover all glTF/GLB files in `public/` and get a summary table. Use `--file <path>` for detailed single-file inspection.\n\n**When to use:** before writing YAML/code that references objectName, materialsToOverride, morphTargetInfluences, or object positioning.\n\n**What it shows per node:**\n- Name, type (Mesh/Light/Camera/Empty), children\n- Transform: `pos=`, `rot=`, `scale=` (only non-default values shown)\n- Per-node morph targets: `morphs=Width,Height`\n- Bounding box: `bounds=WxHxD` (width x height x depth in meters)\n- Origin placement: `origin=center`, `bottom-center`, `top-center`, `bottom-corner`, etc. with numerical offset\n\n**Use cases:**\n- Find exact node names for `objectName` in scene entity components\n- Find material names for `materialsToOverride`\n- Find morph target names for `morphTargetInfluences`\n- Check model dimensions (bounds) for positioning, dimension indicators, or invariants\n- Check origin placement to understand how models anchor (center vs bottom-center)\n- Use `--json` for programmatic access to all data\n\n**Flags:** `--objects`, `--materials`, `--morphs`, `--animations`, `--json`\n\n### Screenshot CLI\n\nCapture 3D canvas screenshots from a running dev server via `pnpm phoenix screenshot`.\n\n**Prerequisites:**\n1. `phoenix dev` must be running (starts the WebSocket server on port 3020)\n2. Configurator must be open in a browser (the browser does the actual rendering)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (default: `./screenshot.png`)\n- `--width, -w` \u2014 Width in pixels (default: 1920)\n- `--height` \u2014 Height in pixels (default: 1080)\n- `--format, -f` \u2014 Image format: PNG or JPEG (default: PNG)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Example workflow:**\n1. Start dev server: `pnpm phoenix dev`\n2. Open configurator in browser (or via Playwright MCP)\n3. Take screenshot: `pnpm phoenix screenshot -o ./render.png -w 2560 --height 1440`\n\n**Use cases:** visual regression testing, generating product images, debugging 3D renders\n\n### Inspect: State\n\nGet the current editor runtime state as JSON via `pnpm phoenix inspect:state`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (prints to stdout if omitted)\n- `--sections, -s` \u2014 Comma-separated: entities, navigation, validation (default: all)\n- `--pretty` \u2014 Pretty-print JSON (default: true)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Example:** `pnpm phoenix inspect:state -o ./state.json -s entities,navigation`\n\n**Lifecycle status:** Always included in response. Shows which systems are ready:\n- `domainLoaded` \u2014 domain data loaded\n- `domainContextReady` \u2014 domain context initialized (entities available)\n- `configuratorReady` \u2014 3D configurator initialized\n- `sessionAuthenticated` \u2014 session service active\n- `editorMode` \u2014 editor mode enabled\n\n**Tips:** Use `--sections` to limit payload size. Pipe through `head`/`tail` for partial output (e.g., `pnpm phoenix inspect:state | head -50`).\n\n**Use cases:** AI agent context, debugging entity state, inspecting navigation/validation\n\n### Inspect: Data\n\nGet the current editor context data as JSON via `pnpm phoenix inspect:data`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (prints to stdout if omitted)\n- `--pretty` \u2014 Pretty-print JSON (default: true)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Returns:** publishedData, frontendData, backendData, sessionData, accessData, webComponentProperties\n\n**Example:** `pnpm phoenix inspect:data -o ./data.json`\n\n**Tips:** Pipe through `head`/`tail` for partial output (e.g., `pnpm phoenix inspect:data | head -30`).\n\n**Use cases:** AI agent context, debugging published/session/access data\n\n### Inspect: Scene\n\nGet the current Three.js scene graph as JSON via `pnpm phoenix inspect:scene`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (prints to stdout if omitted)\n- `--pretty` \u2014 Pretty-print JSON (default: true)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Returns:** Recursive scene tree with per-node: name, type, visible, position, rotation, scale, userData (entityId), and for meshes: geometry name, bounding box, material properties (color, metalness, roughness, opacity, textures), morph target influences. Lights include color, intensity, and type-specific properties.\n\n**Example:** `pnpm phoenix inspect:scene -o ./scene.json`\n\n**Tips:** Scene graphs can be large. Pipe through `head`/`tail` for partial output.\n\n**Use cases:** AI agent context, debugging 3D scene layout, inspecting materials and lighting\n\n### Key Docs\n- `docs/phoenix/getting-started.mdx` \u2014 Setup, prerequisites, first project\n- `docs/phoenix/quickstart.mdx` \u2014 End-to-end tutorial building a configurator\n- `docs/phoenix/domain-model.mdx` \u2014 Entities, attributes, relations, specs\n- `docs/phoenix/components.mdx` \u2014 ECS pattern, YAML components, custom components\n- `docs/phoenix/project-structure.mdx` \u2014 Files, folders, conventions\n- `docs/phoenix/best-practices.mdx` \u2014 YAML-first, code patterns, common pitfalls\n- `docs/phoenix/state-management.mdx` \u2014 Reactive state, RxJS pipelines, data flow\n- `docs/phoenix/expression-context.mdx` \u2014 Expression API, context object, helpers\n- `docs/phoenix/webhooks.mdx` \u2014 Server-side finalization workflows\n- `docs/phoenix/finalization.mdx` \u2014 Finalization system, PDF/email/CSV generation\n- `docs/phoenix/migrations.mdx` \u2014 Schema versioning, migration files\n\n### Agent Workflow\n1. Find relevant docs by content: `pnpm phoenix docs -s \"camera\"`\n2. Read matching doc: `pnpm phoenix docs -r docs/3d-scene/cameras/transitions.mdx`\n3. Search within a doc: `pnpm phoenix docs -r <path> | grep \"example\"`\n4. Search titles only as a fallback: `pnpm phoenix docs -l | grep \"camera\"`\n5. Search generated files directly when needed: `grep -rn \"camera\" \"$(pnpm phoenix docs --dir)\"`\n6. Browse a topic area: `pnpm phoenix docs -c \"Layouts\"`\n\n### Playwright MCP Setup (for AI agents)\n\nTo interact with the 3D configurator in a browser, Playwright MCP needs GPU-enabled flags for WebGL rendering. Add to `~/.claude/.mcp.json`:\n\n```json\n{\n \"mcpServers\": {\n \"playwright\": {\n \"command\": \"npx\",\n \"args\": [\n \"@playwright/mcp@latest\",\n \"--headed\",\n \"--launch-options\",\n \"{\\\"args\\\":[\\\"--use-gl=swiftshader\\\",\\\"--enable-webgl\\\",\\\"--ignore-gpu-blocklist\\\"]}\"\n ]\n }\n }\n}\n```\n\nKey flags:\n- `--headed` \u2014 visible browser (required for GPU rendering)\n- `--use-gl=swiftshader` \u2014 software GPU fallback for environments without a physical GPU\n- `--enable-webgl` + `--ignore-gpu-blocklist` \u2014 ensure WebGL is available\n[PHOENIX-SDK-END]\n";
@@ -1,2 +1,2 @@
1
1
  export declare const mergeCursorRulesContent: (existingContent: string | undefined) => string;
2
- export declare const cursorRulesFile = "---\ndescription: Phoenix SDK project rules\nglobs:\nalwaysApply: true\n---\n\n[PHOENIX-SDK-START]\n## Phoenix Configurator Project\n\nDeclarative 3D product configurator built with Phoenix SDK. Domain model defined in YAML, custom logic in TypeScript.\n\n## Build Commands\n- `pnpm phoenix build` \u2014 Full production build\n- `pnpm phoenix dev` \u2014 Development mode with hot reload\n- `pnpm phoenix sync` \u2014 Sync generated files without full build\n\n## Dev Logs\n- `pnpm phoenix dev` writes all logs to `.phoenix/phoenix-dev.log`\n- Contains: spec parse errors, build errors, browser runtime errors, file watcher events\n- After making changes, always check the log for errors: `tail -50 .phoenix/phoenix-dev.log` or `grep ERROR .phoenix/phoenix-dev.log`\n- Rotated automatically at 10MB (`.log.1`, `.log.2` are older rotations)\n\n## Project Structure\n- `spec/` \u2014 Domain YAML specs (entities, relations, expressions, invariants, components, application config)\n- `src/expressions/` \u2014 Computed/derived entity properties (`phx.domain.implementCustomExpressions()`)\n- `src/invariants/` \u2014 Business rule constraints (`phx.domain.implementCustomInvariants()`)\n- `src/transformers/` \u2014 Automatic state fixers (`phx.frontend.transformerBuilder`)\n- `src/components/` \u2014 ECS system components (`phx.domain.attachComponent.withEntity()`)\n- `src/elements/` \u2014 Page-level React components (`phx.frontend.createCustomPhoenixLayoutElement()`)\n - `ConfiguratorLayout`: a layout element with this name replaces everything the built-in layout renders for a loaded configuration, in owner and read mode, finalization included. Prefer arranging the spec's layout components; write one for shell-level changes, such as moving the sidebar or adding an area the built-in layout has no place for\n - Mount `LayoutSlots.SharedCanvas` (from `@salsita-ai/sdk/configurator`) in a positioned root covering the page, or the app loader stays on screen; put the UI above it, positioned and after it in the markup. Call `useSceneSafeArea()` (same import) and put `containerRef` on the element covering the whole canvas and `safeAreaRef` on the region the UI leaves free, with `pointerEvents: 'none'`, so the camera frames the scene there\n - Sidebar moved, contents as the spec configures them: mount `LayoutSlots.DesktopSidebar` in a positioned container that sets its size, with `side=\"start\"` on the left; `docs/layouts/sidebar/in-a-custom-layout.mdx` is the whole layout\n - Your own UI: \"Hooks for a Project Layout\" in `docs/phoenix/configurator-interface.mdx` lists the hooks with what each returns (`pnpm phoenix docs -r docs/phoenix/configurator-interface.mdx`), `docs/phoenix/layout-slots.mdx` the built-in pieces you can still mount, and `docs/layouts/custom-layout.mdx` is a worked example\n - Messages: mount `LayoutSlots.Services` for the built-in snackbars, or show violations, side-effect hints and errors yourself with `phx.frontend.useConfiguratorMessages(onMessage)`, not both. Either way mount a snackbar root (`LayoutSlots.DesktopSnackbarsRoot` or `LayoutSlots.MobileSnackbarsRoot`): save and built-in action errors are always snackbars\n - Finalize over the spec's `finalizeAction` components, each naming a handler registered with `phx.frontend.createPhoenixHandler`: run each with `phx.frontend.useFinalizeAction(handler)` in a component of its own wrapped in `PhoenixHandlerBoundary` (from `@salsita-ai/sdk/react`), or mount `FinalizeActions` (from `@salsita-ai/sdk/configurator`) for the built-in buttons. `finalizePage` and `finalizeButton` are legacy\n - Read mode and fullscreen are the layout's job, no hook enforces them: hide what a viewer must not change while `phx.frontend.useAccessService().accessInfo.viewMode` is `true`, and remove panels while `phx.frontend.useIsFullscreenActive()` is set; `phx.frontend.useSetFullscreen()` returns its setter\n- `src/handlers/` \u2014 Event & lifecycle handlers\n- `src/webhooks/` \u2014 Server-side webhook handlers (`phx.webhooks.*Builder`)\n- `src/migrations/` \u2014 Schema version migrations (v*.ts)\n- `src/locales/` \u2014 Locale catalogs (authored .po sources; compiled .ts, do not edit)\n- `src/admin/` \u2014 Admin interface (mirrors main src/ structure)\n- `src/_shared/` \u2014 Shared utilities (NOT auto-imported, requires explicit imports)\n- `.phoenix/` \u2014 Auto-generated files (DO NOT EDIT)\n- `public/` \u2014 Static assets (3D models, textures, images, HDRI maps, fonts)\n- `assets/` \u2014 Uploadable resources (PDF templates, email assets)\n\n## Architecture Principles\n- YAML-first: 99% of configuration in spec/*.yaml, custom code is last resort\n- ECS pattern: entities (domain objects) + components (behavior/UI) + systems (SDK runtime)\n- Reactive state: immutable domain state flows through RxJS pipelines\n- Data binding: `$read` (read-only), `$write` (write-only), `$bind` (bidirectional) connect components to domain\n- memoEval: all component implementations must use memoEval for stable object references\n\n## Key Patterns\n- Expressions = computed properties on entities (prefix: `$`), implemented per-entity in src/expressions/\n- Invariants = validation rules returning violations, static or dynamic\n- Transformers = auto-fixers maintaining consistency after state changes\n- Components defined in YAML with `$read`/`$bind` bindings, or custom in src/components/ using attachComponent builder\n- Webhooks = server-side finalization tasks (PDF, email, CSV, image rendering)\n- Filters = contextual component activation via navigationStates, viewStates, modes, selectedEntityIds\n\n## File Conventions\n- Components: PascalCase (.tsx)\n- Utilities: kebab-case (.ts)\n- Expressions: entity-name.ts\n- Migrations: v*.ts (sequential)\n- Specs: kebab-case.yaml\n- Underscore folders (_shared/, _utils/) are NOT auto-imported\n\n## Export Rules\nAll files in src/expressions/, src/invariants/, src/transformers/, src/components/, src/handlers/, src/webhooks/ MUST use default exports. Can be a single item or an array. Named exports are ignored by the SDK auto-import system.\n\n## Webhook Membership\n- User-authored components, admin components, and handlers are frontend-only by default.\n- A handler that registers `createMapPublishedRevisionDataHandler`, `createMapPublishedChunkedDataHandler`, `createDataRowValidatorHandler`, or `createSheetValidatorHandler` is included in the webhook automatically.\n- To include another component or handler in the webhook, put `'use webhook'` as its first statement (leading comments are allowed).\n- A webhook-included file and its runtime local-import closure must not import browser SDK entrypoints (`application`, `admin`, `configurator`, `editor`, `react`, `ui`) or style/font/image assets. Spec parsing reports the unsafe import and inclusion reason as a diagnostic.\n- Keep browser rendering in an unpinned file. Move shared server-safe logic into a separate module when both frontend and webhook code need it.\n\n## Do Not Edit\n- `.phoenix/` directory \u2014 completely regenerated on each build\n- `tsconfig.json`, `eslint.config.js`, `prettier.config.js`, `.prettierignore`, `.linguirc`, `.nvmrc`\n- `src/locales/` .ts files \u2014 compiled from .po files\n\n## Code Review\nUse `/review` command to review code changes before committing.\n\n## SDK Documentation\n\nAlways search SDK docs for relevant examples before implementing Phoenix features.\n\n### Commands\n- `pnpm phoenix docs` \u2014 Full documentation index with descriptions\n- `pnpm phoenix docs -s <term>` \u2014 Search all doc content and metadata (case-insensitive)\n- `pnpm phoenix docs --dir` \u2014 Print the absolute docs directory for grep or ripgrep\n- `pnpm phoenix docs -r <path>` \u2014 Read specific doc (raw text to stdout)\n- `pnpm phoenix docs -c <category>` \u2014 List docs in a category\n- `pnpm phoenix docs -l` \u2014 List all doc paths with titles\n\n### 3D Asset Inspection\n\nRun `pnpm phoenix inspect:assets` to discover all glTF/GLB files in `public/` and get a summary table. Use `--file <path>` for detailed single-file inspection.\n\n**When to use:** before writing YAML/code that references objectName, materialsToOverride, morphTargetInfluences, or object positioning.\n\n**What it shows per node:**\n- Name, type (Mesh/Light/Camera/Empty), children\n- Transform: `pos=`, `rot=`, `scale=` (only non-default values shown)\n- Per-node morph targets: `morphs=Width,Height`\n- Bounding box: `bounds=WxHxD` (width x height x depth in meters)\n- Origin placement: `origin=center`, `bottom-center`, `top-center`, `bottom-corner`, etc. with numerical offset\n\n**Use cases:**\n- Find exact node names for `objectName` in scene entity components\n- Find material names for `materialsToOverride`\n- Find morph target names for `morphTargetInfluences`\n- Check model dimensions (bounds) for positioning, dimension indicators, or invariants\n- Check origin placement to understand how models anchor (center vs bottom-center)\n- Use `--json` for programmatic access to all data\n\n**Flags:** `--objects`, `--materials`, `--morphs`, `--animations`, `--json`\n\n### Screenshot CLI\n\nCapture 3D canvas screenshots from a running dev server via `pnpm phoenix screenshot`.\n\n**Prerequisites:**\n1. `phoenix dev` must be running (starts the WebSocket server on port 3020)\n2. Configurator must be open in a browser (the browser does the actual rendering)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (default: `./screenshot.png`)\n- `--width, -w` \u2014 Width in pixels (default: 1920)\n- `--height` \u2014 Height in pixels (default: 1080)\n- `--format, -f` \u2014 Image format: PNG or JPEG (default: PNG)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Example workflow:**\n1. Start dev server: `pnpm phoenix dev`\n2. Open configurator in browser (or via Playwright MCP)\n3. Take screenshot: `pnpm phoenix screenshot -o ./render.png -w 2560 --height 1440`\n\n**Use cases:** visual regression testing, generating product images, debugging 3D renders\n\n### Inspect: State\n\nGet the current editor runtime state as JSON via `pnpm phoenix inspect:state`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (prints to stdout if omitted)\n- `--sections, -s` \u2014 Comma-separated: entities, navigation, validation (default: all)\n- `--pretty` \u2014 Pretty-print JSON (default: true)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Example:** `pnpm phoenix inspect:state -o ./state.json -s entities,navigation`\n\n**Lifecycle status:** Always included in response. Shows which systems are ready:\n- `domainLoaded` \u2014 domain data loaded\n- `domainContextReady` \u2014 domain context initialized (entities available)\n- `configuratorReady` \u2014 3D configurator initialized\n- `sessionAuthenticated` \u2014 session service active\n- `editorMode` \u2014 editor mode enabled\n\n**Tips:** Use `--sections` to limit payload size. Pipe through `head`/`tail` for partial output (e.g., `pnpm phoenix inspect:state | head -50`).\n\n**Use cases:** AI agent context, debugging entity state, inspecting navigation/validation\n\n### Inspect: Data\n\nGet the current editor context data as JSON via `pnpm phoenix inspect:data`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (prints to stdout if omitted)\n- `--pretty` \u2014 Pretty-print JSON (default: true)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Returns:** publishedData, frontendData, backendData, sessionData, accessData, webComponentProperties\n\n**Example:** `pnpm phoenix inspect:data -o ./data.json`\n\n**Tips:** Pipe through `head`/`tail` for partial output (e.g., `pnpm phoenix inspect:data | head -30`).\n\n**Use cases:** AI agent context, debugging published/session/access data\n\n### Inspect: Scene\n\nGet the current Three.js scene graph as JSON via `pnpm phoenix inspect:scene`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (prints to stdout if omitted)\n- `--pretty` \u2014 Pretty-print JSON (default: true)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Returns:** Recursive scene tree with per-node: name, type, visible, position, rotation, scale, userData (entityId), and for meshes: geometry name, bounding box, material properties (color, metalness, roughness, opacity, textures), morph target influences. Lights include color, intensity, and type-specific properties.\n\n**Example:** `pnpm phoenix inspect:scene -o ./scene.json`\n\n**Tips:** Scene graphs can be large. Pipe through `head`/`tail` for partial output.\n\n**Use cases:** AI agent context, debugging 3D scene layout, inspecting materials and lighting\n\n### Key Docs\n- `docs/phoenix/getting-started.mdx` \u2014 Setup, prerequisites, first project\n- `docs/phoenix/quickstart.mdx` \u2014 End-to-end tutorial building a configurator\n- `docs/phoenix/domain-model.mdx` \u2014 Entities, attributes, relations, specs\n- `docs/phoenix/components.mdx` \u2014 ECS pattern, YAML components, custom components\n- `docs/phoenix/project-structure.mdx` \u2014 Files, folders, conventions\n- `docs/phoenix/best-practices.mdx` \u2014 YAML-first, code patterns, common pitfalls\n- `docs/phoenix/state-management.mdx` \u2014 Reactive state, RxJS pipelines, data flow\n- `docs/phoenix/expression-context.mdx` \u2014 Expression API, context object, helpers\n- `docs/phoenix/webhooks.mdx` \u2014 Server-side finalization workflows\n- `docs/phoenix/finalization.mdx` \u2014 Finalization system, PDF/email/CSV generation\n- `docs/phoenix/migrations.mdx` \u2014 Schema versioning, migration files\n\n### Agent Workflow\n1. Find relevant docs by content: `pnpm phoenix docs -s \"camera\"`\n2. Read matching doc: `pnpm phoenix docs -r docs/3d-scene/cameras/transitions.mdx`\n3. Search within a doc: `pnpm phoenix docs -r <path> | grep \"example\"`\n4. Search titles only as a fallback: `pnpm phoenix docs -l | grep \"camera\"`\n5. Search generated files directly when needed: `grep -rn \"camera\" \"$(pnpm phoenix docs --dir)\"`\n6. Browse a topic area: `pnpm phoenix docs -c \"Layouts\"`\n\n### Playwright MCP Setup (for AI agents)\n\nTo interact with the 3D configurator in a browser, Playwright MCP needs GPU-enabled flags for WebGL rendering. Add to `~/.claude/.mcp.json`:\n\n```json\n{\n \"mcpServers\": {\n \"playwright\": {\n \"command\": \"npx\",\n \"args\": [\n \"@playwright/mcp@latest\",\n \"--headed\",\n \"--launch-options\",\n \"{\\\"args\\\":[\\\"--use-gl=swiftshader\\\",\\\"--enable-webgl\\\",\\\"--ignore-gpu-blocklist\\\"]}\"\n ]\n }\n }\n}\n```\n\nKey flags:\n- `--headed` \u2014 visible browser (required for GPU rendering)\n- `--use-gl=swiftshader` \u2014 software GPU fallback for environments without a physical GPU\n- `--enable-webgl` + `--ignore-gpu-blocklist` \u2014 ensure WebGL is available\n[PHOENIX-SDK-END]\n";
2
+ export declare const cursorRulesFile = "---\ndescription: Phoenix SDK project rules\nglobs:\nalwaysApply: true\n---\n\n[PHOENIX-SDK-START]\n## Phoenix Configurator Project\n\nDeclarative 3D product configurator built with Phoenix SDK. Domain model defined in YAML, custom logic in TypeScript.\n\n## Build Commands\n- `pnpm phoenix build` \u2014 Full production build\n- `pnpm phoenix dev` \u2014 Development mode with hot reload\n- `pnpm phoenix sync` \u2014 Sync generated files without full build\n\n## Dev Logs\n- `pnpm phoenix dev` writes all logs to `.phoenix/phoenix-dev.log`\n- Contains: spec parse errors, build errors, browser runtime errors, file watcher events\n- After making changes, always check the log for errors: `tail -50 .phoenix/phoenix-dev.log` or `grep ERROR .phoenix/phoenix-dev.log`\n- Rotated automatically at 10MB (`.log.1`, `.log.2` are older rotations)\n\n## Project Structure\n- `spec/` \u2014 Domain YAML specs (entities, relations, expressions, invariants, components, application config)\n- `src/expressions/` \u2014 Computed/derived entity properties (`phx.domain.implementCustomExpressions()`)\n- `src/invariants/` \u2014 Business rule constraints (`phx.domain.implementCustomInvariants()`)\n- `src/transformers/` \u2014 Automatic state fixers (`phx.frontend.transformerBuilder`)\n- `src/components/` \u2014 ECS system components (`phx.domain.attachComponent.withEntity()`)\n- `src/elements/` \u2014 Page-level React components (`phx.frontend.createCustomPhoenixLayoutElement()`)\n - `ConfiguratorLayout`: a layout element with this name replaces everything the built-in layout renders for a loaded configuration, in owner and read mode, finalization included. Prefer arranging the spec's layout components; write one for shell-level changes, such as moving the sidebar or adding an area the built-in layout has no place for\n - Mount `LayoutSlots.SharedCanvas` (from `@salsita-ai/sdk/configurator`) in a positioned root covering the page; put the UI above it, positioned and after it in the markup. With the canvas mounted the app loader waits until the scene has loaded; a layout without a canvas is not held by the loader. Call `phx.frontend.useSceneSafeArea()` and put `containerRef` on the element covering the whole canvas and `safeAreaRef` on the region the UI leaves free, with `pointerEvents: 'none'`, so the camera frames the scene there\n - Sidebar moved, contents as the spec configures them: mount `LayoutSlots.DesktopSidebar` in a positioned container that sets its size, with `side=\"start\"` on the left; `docs/layouts/sidebar/in-a-custom-layout.mdx` is the whole layout\n - Your own UI: \"Hooks for a Project Layout\" in `docs/phoenix/configurator-interface.mdx` lists the hooks with what each returns (`pnpm phoenix docs -r docs/phoenix/configurator-interface.mdx`), `docs/phoenix/layout-slots.mdx` the built-in pieces you can still mount, and `docs/layouts/custom-layout.mdx` is a worked example. Call the hooks as `phx.frontend.useX()`; besides those below, these are often needed: `usePreview()` (`isPreview` while the preview start screen shows), `useCloseAction()` (the host's close action or `null`), `useActiveViewports()` (the container's breakpoints, `null` until measured, `desktop` above 768 px: the desktop/phone switch), `useResolveLocalizable()` and `useLocalizable(text)` (spec texts to strings), `useIsCloningAllowed()` (a read-mode \"edit a copy\" action with `LayoutSlots.CloneToEditDialog`)\n - Undo and redo: `phx.frontend.useUndoRedo()` returns `{ canUndo, canRedo, undo, redo }`; disable each button from `canUndo`/`canRedo`\n - Tabs: `phx.frontend.useTabNavigation()` returns `{ source, tabs, activeTab, select }` for the spec's `sidebarTabs` (of the selected entity) or `horizontalTabs`; render `tabs` (each `{ index, label, icon, state, isActive }`, `icon` a PhxIcon name) and call `select(tab.index)` on click. Pass `{ source: 'sidebarTabs' }` or `{ source: 'horizontalTabs' }` when the layout shows one kind only. Not `LayoutSlots.useSidebarTabs()`: it serves the built-in sidebar and returns no tabs while its summary shows\n - Steps: `phx.frontend.useStepNavigation()` returns `{ steps, activeStep, activeIndex, isFirst, isLast, canGoNext, canGoPrevious, next, previous, goTo }` for the spec's `navigationSteps`; render `steps` (each `{ index, label, state, status }`, `status` `'complete' | 'active' | 'upcoming'`), call `next()`/`previous()` for Back and Next and `goTo(step.index)` from a stepper. It enforces no order and no validity: enable only `'complete'` steps for an \"earlier steps only\" stepper, and to block moving on while the configuration has a problem, require `phx.frontend.useStateValidity().severity !== 'warning'` besides `canGoNext`: a change with a `fixable` or `fatal` violation is rejected, so the configuration is never invalid, and a `warning` is the problem that stays (it blocks finalizing too). `useSteps` and `useHasSteps` from `@salsita-ai/sdk/configurator` are deprecated\n - Messages: mount `LayoutSlots.Services` for the built-in snackbars, or show violations, side-effect hints, errors and failed saves yourself with `phx.frontend.useConfiguratorMessages(onMessage)`, not both. A failed save arrives as `saveError`, the next successful save as `saveRecovery`; a layout that mounts neither shows no sign of a failed save. Either way mount a snackbar root (`LayoutSlots.DesktopSnackbarsRoot` or `LayoutSlots.MobileSnackbarsRoot`): errors of the built-in actions are always snackbars\n - Finalize over the spec's `finalizeAction` components, each naming a handler registered with `phx.frontend.createPhoenixHandler`: `phx.frontend.useFinalizeActions()` returns `{ actions, primary, secondary, disabled, hints }`; render `primary` (and `secondary` in a menu or list) in a loop, each action `{ key, label, title, icon, run, isPending, error, disabled }`, and call `action.run()` on click (its promise never rejects; show `action.error` on failure). The configurator runs the handlers itself, outside the layout, so a handler must not rely on a provider the layout adds. For one known handler, `phx.frontend.useFinalizeAction(handler)` in a component wrapped in `PhoenixHandlerBoundary` (from `@salsita-ai/sdk/react`) works too; `FinalizeActions` (from `@salsita-ai/sdk/configurator`) mounts the built-in buttons. `finalizePage` and `finalizeButton` are legacy\n - Read mode and fullscreen are the layout's job, no hook enforces them (`useUndoRedo`, `useFinalizeActions` and `useStepNavigation` included): hide undo, redo, finalization and whatever else a viewer must not change while `phx.frontend.useAccessService().accessInfo.viewMode` is `true` (tabs are navigation, so a viewer may switch them), and remove panels while `phx.frontend.useIsFullscreenActive()` is set; `phx.frontend.useSetFullscreen()` returns its setter\n - `ConfigurationNotFoundPage`: `phx.frontend.createConfigurationNotFoundPage(({ onBack }) => \u2026)` replaces the \"configuration not accessible\" page; show a way back only when the optional `onBack` is set. The not-authenticated page's default renders it too; only the admin's not-authorized page keeps the built-in page\n - `ConfiguratorErrorPage`: `phx.frontend.createConfiguratorErrorPage(({ reason, onRetry }) => \u2026)` replaces the production error page; `reason` is `uncaughtError` or `presetCreationFailed`. A page that throws falls back to the built-in one, and development keeps the detailed error pages, so the project page shows only in a production build. Register both pages with these helpers: `createCustomPhoenixLayoutElement` with the name works too, but types the component as taking only `children`, so the typed props do not compile there in a strict project\n - `AppLoaderContent`: `phx.frontend.createAppLoader(({ phases }) => \u2026)` replaces what the loading overlay shows (each phase `{ id, label?, progress? }`, the list possibly empty); Phoenix keeps the overlay itself\n- `src/handlers/` \u2014 Event & lifecycle handlers\n- `src/webhooks/` \u2014 Server-side webhook handlers (`phx.webhooks.*Builder`)\n- `src/migrations/` \u2014 Schema version migrations (v*.ts)\n- `src/locales/` \u2014 Locale catalogs (authored .po sources; compiled .ts, do not edit)\n- `src/admin/` \u2014 Admin interface (mirrors main src/ structure)\n- `src/_shared/` \u2014 Shared utilities (NOT auto-imported, requires explicit imports)\n- `.phoenix/` \u2014 Auto-generated files (DO NOT EDIT)\n- `public/` \u2014 Static assets (3D models, textures, images, HDRI maps, fonts)\n- `assets/` \u2014 Uploadable resources (PDF templates, email assets)\n\n## Architecture Principles\n- YAML-first: 99% of configuration in spec/*.yaml, custom code is last resort\n- ECS pattern: entities (domain objects) + components (behavior/UI) + systems (SDK runtime)\n- Reactive state: immutable domain state flows through RxJS pipelines\n- Data binding: `$read` (read-only), `$write` (write-only), `$bind` (bidirectional) connect components to domain\n- memoEval: all component implementations must use memoEval for stable object references\n\n## Key Patterns\n- Expressions = computed properties on entities (prefix: `$`), implemented per-entity in src/expressions/\n- Invariants = validation rules returning violations, static or dynamic\n- Transformers = auto-fixers maintaining consistency after state changes\n- Components defined in YAML with `$read`/`$bind` bindings, or custom in src/components/ using attachComponent builder\n- Webhooks = server-side finalization tasks (PDF, email, CSV, image rendering)\n- Filters = contextual component activation via navigationStates, viewStates, modes, selectedEntityIds\n\n## File Conventions\n- Components: PascalCase (.tsx)\n- Utilities: kebab-case (.ts)\n- Expressions: entity-name.ts\n- Migrations: v*.ts (sequential)\n- Specs: kebab-case.yaml\n- Underscore folders (_shared/, _utils/) are NOT auto-imported\n\n## Export Rules\nAll files in src/expressions/, src/invariants/, src/transformers/, src/components/, src/handlers/, src/webhooks/ MUST use default exports. Can be a single item or an array. Named exports are ignored by the SDK auto-import system.\n\n## Webhook Membership\n- User-authored components, admin components, and handlers are frontend-only by default.\n- A handler that registers `createMapPublishedRevisionDataHandler`, `createMapPublishedChunkedDataHandler`, `createDataRowValidatorHandler`, or `createSheetValidatorHandler` is included in the webhook automatically.\n- To include another component or handler in the webhook, put `'use webhook'` as its first statement (leading comments are allowed).\n- A webhook-included file and its runtime local-import closure must not import browser SDK entrypoints (`application`, `admin`, `configurator`, `editor`, `react`, `ui`) or style/font/image assets. Spec parsing reports the unsafe import and inclusion reason as a diagnostic.\n- Keep browser rendering in an unpinned file. Move shared server-safe logic into a separate module when both frontend and webhook code need it.\n\n## Do Not Edit\n- `.phoenix/` directory \u2014 completely regenerated on each build\n- `tsconfig.json`, `eslint.config.js`, `prettier.config.js`, `.prettierignore`, `.linguirc`, `.nvmrc`\n- `src/locales/` .ts files \u2014 compiled from .po files\n\n## Code Review\nUse `/review` command to review code changes before committing.\n\n## SDK Documentation\n\nAlways search SDK docs for relevant examples before implementing Phoenix features.\n\n### Commands\n- `pnpm phoenix docs` \u2014 Full documentation index with descriptions\n- `pnpm phoenix docs -s <term>` \u2014 Search all doc content and metadata (case-insensitive)\n- `pnpm phoenix docs --dir` \u2014 Print the absolute docs directory for grep or ripgrep\n- `pnpm phoenix docs -r <path>` \u2014 Read specific doc (raw text to stdout)\n- `pnpm phoenix docs -c <category>` \u2014 List docs in a category\n- `pnpm phoenix docs -l` \u2014 List all doc paths with titles\n\n### 3D Asset Inspection\n\nRun `pnpm phoenix inspect:assets` to discover all glTF/GLB files in `public/` and get a summary table. Use `--file <path>` for detailed single-file inspection.\n\n**When to use:** before writing YAML/code that references objectName, materialsToOverride, morphTargetInfluences, or object positioning.\n\n**What it shows per node:**\n- Name, type (Mesh/Light/Camera/Empty), children\n- Transform: `pos=`, `rot=`, `scale=` (only non-default values shown)\n- Per-node morph targets: `morphs=Width,Height`\n- Bounding box: `bounds=WxHxD` (width x height x depth in meters)\n- Origin placement: `origin=center`, `bottom-center`, `top-center`, `bottom-corner`, etc. with numerical offset\n\n**Use cases:**\n- Find exact node names for `objectName` in scene entity components\n- Find material names for `materialsToOverride`\n- Find morph target names for `morphTargetInfluences`\n- Check model dimensions (bounds) for positioning, dimension indicators, or invariants\n- Check origin placement to understand how models anchor (center vs bottom-center)\n- Use `--json` for programmatic access to all data\n\n**Flags:** `--objects`, `--materials`, `--morphs`, `--animations`, `--json`\n\n### Screenshot CLI\n\nCapture 3D canvas screenshots from a running dev server via `pnpm phoenix screenshot`.\n\n**Prerequisites:**\n1. `phoenix dev` must be running (starts the WebSocket server on port 3020)\n2. Configurator must be open in a browser (the browser does the actual rendering)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (default: `./screenshot.png`)\n- `--width, -w` \u2014 Width in pixels (default: 1920)\n- `--height` \u2014 Height in pixels (default: 1080)\n- `--format, -f` \u2014 Image format: PNG or JPEG (default: PNG)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Example workflow:**\n1. Start dev server: `pnpm phoenix dev`\n2. Open configurator in browser (or via Playwright MCP)\n3. Take screenshot: `pnpm phoenix screenshot -o ./render.png -w 2560 --height 1440`\n\n**Use cases:** visual regression testing, generating product images, debugging 3D renders\n\n### Inspect: State\n\nGet the current editor runtime state as JSON via `pnpm phoenix inspect:state`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (prints to stdout if omitted)\n- `--sections, -s` \u2014 Comma-separated: entities, navigation, validation (default: all)\n- `--pretty` \u2014 Pretty-print JSON (default: true)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Example:** `pnpm phoenix inspect:state -o ./state.json -s entities,navigation`\n\n**Lifecycle status:** Always included in response. Shows which systems are ready:\n- `domainLoaded` \u2014 domain data loaded\n- `domainContextReady` \u2014 domain context initialized (entities available)\n- `configuratorReady` \u2014 3D configurator initialized\n- `sessionAuthenticated` \u2014 session service active\n- `editorMode` \u2014 editor mode enabled\n\n**Tips:** Use `--sections` to limit payload size. Pipe through `head`/`tail` for partial output (e.g., `pnpm phoenix inspect:state | head -50`).\n\n**Use cases:** AI agent context, debugging entity state, inspecting navigation/validation\n\n### Inspect: Data\n\nGet the current editor context data as JSON via `pnpm phoenix inspect:data`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (prints to stdout if omitted)\n- `--pretty` \u2014 Pretty-print JSON (default: true)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Returns:** publishedData, frontendData, backendData, sessionData, accessData, webComponentProperties\n\n**Example:** `pnpm phoenix inspect:data -o ./data.json`\n\n**Tips:** Pipe through `head`/`tail` for partial output (e.g., `pnpm phoenix inspect:data | head -30`).\n\n**Use cases:** AI agent context, debugging published/session/access data\n\n### Inspect: Scene\n\nGet the current Three.js scene graph as JSON via `pnpm phoenix inspect:scene`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (prints to stdout if omitted)\n- `--pretty` \u2014 Pretty-print JSON (default: true)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Returns:** Recursive scene tree with per-node: name, type, visible, position, rotation, scale, userData (entityId), and for meshes: geometry name, bounding box, material properties (color, metalness, roughness, opacity, textures), morph target influences. Lights include color, intensity, and type-specific properties.\n\n**Example:** `pnpm phoenix inspect:scene -o ./scene.json`\n\n**Tips:** Scene graphs can be large. Pipe through `head`/`tail` for partial output.\n\n**Use cases:** AI agent context, debugging 3D scene layout, inspecting materials and lighting\n\n### Key Docs\n- `docs/phoenix/getting-started.mdx` \u2014 Setup, prerequisites, first project\n- `docs/phoenix/quickstart.mdx` \u2014 End-to-end tutorial building a configurator\n- `docs/phoenix/domain-model.mdx` \u2014 Entities, attributes, relations, specs\n- `docs/phoenix/components.mdx` \u2014 ECS pattern, YAML components, custom components\n- `docs/phoenix/project-structure.mdx` \u2014 Files, folders, conventions\n- `docs/phoenix/best-practices.mdx` \u2014 YAML-first, code patterns, common pitfalls\n- `docs/phoenix/state-management.mdx` \u2014 Reactive state, RxJS pipelines, data flow\n- `docs/phoenix/expression-context.mdx` \u2014 Expression API, context object, helpers\n- `docs/phoenix/webhooks.mdx` \u2014 Server-side finalization workflows\n- `docs/phoenix/finalization.mdx` \u2014 Finalization system, PDF/email/CSV generation\n- `docs/phoenix/migrations.mdx` \u2014 Schema versioning, migration files\n\n### Agent Workflow\n1. Find relevant docs by content: `pnpm phoenix docs -s \"camera\"`\n2. Read matching doc: `pnpm phoenix docs -r docs/3d-scene/cameras/transitions.mdx`\n3. Search within a doc: `pnpm phoenix docs -r <path> | grep \"example\"`\n4. Search titles only as a fallback: `pnpm phoenix docs -l | grep \"camera\"`\n5. Search generated files directly when needed: `grep -rn \"camera\" \"$(pnpm phoenix docs --dir)\"`\n6. Browse a topic area: `pnpm phoenix docs -c \"Layouts\"`\n\n### Playwright MCP Setup (for AI agents)\n\nTo interact with the 3D configurator in a browser, Playwright MCP needs GPU-enabled flags for WebGL rendering. Add to `~/.claude/.mcp.json`:\n\n```json\n{\n \"mcpServers\": {\n \"playwright\": {\n \"command\": \"npx\",\n \"args\": [\n \"@playwright/mcp@latest\",\n \"--headed\",\n \"--launch-options\",\n \"{\\\"args\\\":[\\\"--use-gl=swiftshader\\\",\\\"--enable-webgl\\\",\\\"--ignore-gpu-blocklist\\\"]}\"\n ]\n }\n }\n}\n```\n\nKey flags:\n- `--headed` \u2014 visible browser (required for GPU rendering)\n- `--use-gl=swiftshader` \u2014 software GPU fallback for environments without a physical GPU\n- `--enable-webgl` + `--ignore-gpu-blocklist` \u2014 ensure WebGL is available\n[PHOENIX-SDK-END]\n";
@@ -1 +1 @@
1
- export declare const sdkContent = "[PHOENIX-SDK-START]\n## Phoenix Configurator Project\n\nDeclarative 3D product configurator built with Phoenix SDK. Domain model defined in YAML, custom logic in TypeScript.\n\n## Build Commands\n- `pnpm phoenix build` \u2014 Full production build\n- `pnpm phoenix dev` \u2014 Development mode with hot reload\n- `pnpm phoenix sync` \u2014 Sync generated files without full build\n\n## Dev Logs\n- `pnpm phoenix dev` writes all logs to `.phoenix/phoenix-dev.log`\n- Contains: spec parse errors, build errors, browser runtime errors, file watcher events\n- After making changes, always check the log for errors: `tail -50 .phoenix/phoenix-dev.log` or `grep ERROR .phoenix/phoenix-dev.log`\n- Rotated automatically at 10MB (`.log.1`, `.log.2` are older rotations)\n\n## Project Structure\n- `spec/` \u2014 Domain YAML specs (entities, relations, expressions, invariants, components, application config)\n- `src/expressions/` \u2014 Computed/derived entity properties (`phx.domain.implementCustomExpressions()`)\n- `src/invariants/` \u2014 Business rule constraints (`phx.domain.implementCustomInvariants()`)\n- `src/transformers/` \u2014 Automatic state fixers (`phx.frontend.transformerBuilder`)\n- `src/components/` \u2014 ECS system components (`phx.domain.attachComponent.withEntity()`)\n- `src/elements/` \u2014 Page-level React components (`phx.frontend.createCustomPhoenixLayoutElement()`)\n - `ConfiguratorLayout`: a layout element with this name replaces everything the built-in layout renders for a loaded configuration, in owner and read mode, finalization included. Prefer arranging the spec's layout components; write one for shell-level changes, such as moving the sidebar or adding an area the built-in layout has no place for\n - Mount `LayoutSlots.SharedCanvas` (from `@salsita-ai/sdk/configurator`) in a positioned root covering the page, or the app loader stays on screen; put the UI above it, positioned and after it in the markup. Call `useSceneSafeArea()` (same import) and put `containerRef` on the element covering the whole canvas and `safeAreaRef` on the region the UI leaves free, with `pointerEvents: 'none'`, so the camera frames the scene there\n - Sidebar moved, contents as the spec configures them: mount `LayoutSlots.DesktopSidebar` in a positioned container that sets its size, with `side=\"start\"` on the left; `docs/layouts/sidebar/in-a-custom-layout.mdx` is the whole layout\n - Your own UI: \"Hooks for a Project Layout\" in `docs/phoenix/configurator-interface.mdx` lists the hooks with what each returns (`pnpm phoenix docs -r docs/phoenix/configurator-interface.mdx`), `docs/phoenix/layout-slots.mdx` the built-in pieces you can still mount, and `docs/layouts/custom-layout.mdx` is a worked example\n - Messages: mount `LayoutSlots.Services` for the built-in snackbars, or show violations, side-effect hints and errors yourself with `phx.frontend.useConfiguratorMessages(onMessage)`, not both. Either way mount a snackbar root (`LayoutSlots.DesktopSnackbarsRoot` or `LayoutSlots.MobileSnackbarsRoot`): save and built-in action errors are always snackbars\n - Finalize over the spec's `finalizeAction` components, each naming a handler registered with `phx.frontend.createPhoenixHandler`: run each with `phx.frontend.useFinalizeAction(handler)` in a component of its own wrapped in `PhoenixHandlerBoundary` (from `@salsita-ai/sdk/react`), or mount `FinalizeActions` (from `@salsita-ai/sdk/configurator`) for the built-in buttons. `finalizePage` and `finalizeButton` are legacy\n - Read mode and fullscreen are the layout's job, no hook enforces them: hide what a viewer must not change while `phx.frontend.useAccessService().accessInfo.viewMode` is `true`, and remove panels while `phx.frontend.useIsFullscreenActive()` is set; `phx.frontend.useSetFullscreen()` returns its setter\n- `src/handlers/` \u2014 Event & lifecycle handlers\n- `src/webhooks/` \u2014 Server-side webhook handlers (`phx.webhooks.*Builder`)\n- `src/migrations/` \u2014 Schema version migrations (v*.ts)\n- `src/locales/` \u2014 Locale catalogs (authored .po sources; compiled .ts, do not edit)\n- `src/admin/` \u2014 Admin interface (mirrors main src/ structure)\n- `src/_shared/` \u2014 Shared utilities (NOT auto-imported, requires explicit imports)\n- `.phoenix/` \u2014 Auto-generated files (DO NOT EDIT)\n- `public/` \u2014 Static assets (3D models, textures, images, HDRI maps, fonts)\n- `assets/` \u2014 Uploadable resources (PDF templates, email assets)\n\n## Architecture Principles\n- YAML-first: 99% of configuration in spec/*.yaml, custom code is last resort\n- ECS pattern: entities (domain objects) + components (behavior/UI) + systems (SDK runtime)\n- Reactive state: immutable domain state flows through RxJS pipelines\n- Data binding: `$read` (read-only), `$write` (write-only), `$bind` (bidirectional) connect components to domain\n- memoEval: all component implementations must use memoEval for stable object references\n\n## Key Patterns\n- Expressions = computed properties on entities (prefix: `$`), implemented per-entity in src/expressions/\n- Invariants = validation rules returning violations, static or dynamic\n- Transformers = auto-fixers maintaining consistency after state changes\n- Components defined in YAML with `$read`/`$bind` bindings, or custom in src/components/ using attachComponent builder\n- Webhooks = server-side finalization tasks (PDF, email, CSV, image rendering)\n- Filters = contextual component activation via navigationStates, viewStates, modes, selectedEntityIds\n\n## File Conventions\n- Components: PascalCase (.tsx)\n- Utilities: kebab-case (.ts)\n- Expressions: entity-name.ts\n- Migrations: v*.ts (sequential)\n- Specs: kebab-case.yaml\n- Underscore folders (_shared/, _utils/) are NOT auto-imported\n\n## Export Rules\nAll files in src/expressions/, src/invariants/, src/transformers/, src/components/, src/handlers/, src/webhooks/ MUST use default exports. Can be a single item or an array. Named exports are ignored by the SDK auto-import system.\n\n## Webhook Membership\n- User-authored components, admin components, and handlers are frontend-only by default.\n- A handler that registers `createMapPublishedRevisionDataHandler`, `createMapPublishedChunkedDataHandler`, `createDataRowValidatorHandler`, or `createSheetValidatorHandler` is included in the webhook automatically.\n- To include another component or handler in the webhook, put `'use webhook'` as its first statement (leading comments are allowed).\n- A webhook-included file and its runtime local-import closure must not import browser SDK entrypoints (`application`, `admin`, `configurator`, `editor`, `react`, `ui`) or style/font/image assets. Spec parsing reports the unsafe import and inclusion reason as a diagnostic.\n- Keep browser rendering in an unpinned file. Move shared server-safe logic into a separate module when both frontend and webhook code need it.\n\n## Do Not Edit\n- `.phoenix/` directory \u2014 completely regenerated on each build\n- `tsconfig.json`, `eslint.config.js`, `prettier.config.js`, `.prettierignore`, `.linguirc`, `.nvmrc`\n- `src/locales/` .ts files \u2014 compiled from .po files\n\n## Code Review\nUse `/review` command to review code changes before committing.\n\n## SDK Documentation\n\nAlways search SDK docs for relevant examples before implementing Phoenix features.\n\n### Commands\n- `pnpm phoenix docs` \u2014 Full documentation index with descriptions\n- `pnpm phoenix docs -s <term>` \u2014 Search all doc content and metadata (case-insensitive)\n- `pnpm phoenix docs --dir` \u2014 Print the absolute docs directory for grep or ripgrep\n- `pnpm phoenix docs -r <path>` \u2014 Read specific doc (raw text to stdout)\n- `pnpm phoenix docs -c <category>` \u2014 List docs in a category\n- `pnpm phoenix docs -l` \u2014 List all doc paths with titles\n\n### 3D Asset Inspection\n\nRun `pnpm phoenix inspect:assets` to discover all glTF/GLB files in `public/` and get a summary table. Use `--file <path>` for detailed single-file inspection.\n\n**When to use:** before writing YAML/code that references objectName, materialsToOverride, morphTargetInfluences, or object positioning.\n\n**What it shows per node:**\n- Name, type (Mesh/Light/Camera/Empty), children\n- Transform: `pos=`, `rot=`, `scale=` (only non-default values shown)\n- Per-node morph targets: `morphs=Width,Height`\n- Bounding box: `bounds=WxHxD` (width x height x depth in meters)\n- Origin placement: `origin=center`, `bottom-center`, `top-center`, `bottom-corner`, etc. with numerical offset\n\n**Use cases:**\n- Find exact node names for `objectName` in scene entity components\n- Find material names for `materialsToOverride`\n- Find morph target names for `morphTargetInfluences`\n- Check model dimensions (bounds) for positioning, dimension indicators, or invariants\n- Check origin placement to understand how models anchor (center vs bottom-center)\n- Use `--json` for programmatic access to all data\n\n**Flags:** `--objects`, `--materials`, `--morphs`, `--animations`, `--json`\n\n### Screenshot CLI\n\nCapture 3D canvas screenshots from a running dev server via `pnpm phoenix screenshot`.\n\n**Prerequisites:**\n1. `phoenix dev` must be running (starts the WebSocket server on port 3020)\n2. Configurator must be open in a browser (the browser does the actual rendering)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (default: `./screenshot.png`)\n- `--width, -w` \u2014 Width in pixels (default: 1920)\n- `--height` \u2014 Height in pixels (default: 1080)\n- `--format, -f` \u2014 Image format: PNG or JPEG (default: PNG)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Example workflow:**\n1. Start dev server: `pnpm phoenix dev`\n2. Open configurator in browser (or via Playwright MCP)\n3. Take screenshot: `pnpm phoenix screenshot -o ./render.png -w 2560 --height 1440`\n\n**Use cases:** visual regression testing, generating product images, debugging 3D renders\n\n### Inspect: State\n\nGet the current editor runtime state as JSON via `pnpm phoenix inspect:state`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (prints to stdout if omitted)\n- `--sections, -s` \u2014 Comma-separated: entities, navigation, validation (default: all)\n- `--pretty` \u2014 Pretty-print JSON (default: true)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Example:** `pnpm phoenix inspect:state -o ./state.json -s entities,navigation`\n\n**Lifecycle status:** Always included in response. Shows which systems are ready:\n- `domainLoaded` \u2014 domain data loaded\n- `domainContextReady` \u2014 domain context initialized (entities available)\n- `configuratorReady` \u2014 3D configurator initialized\n- `sessionAuthenticated` \u2014 session service active\n- `editorMode` \u2014 editor mode enabled\n\n**Tips:** Use `--sections` to limit payload size. Pipe through `head`/`tail` for partial output (e.g., `pnpm phoenix inspect:state | head -50`).\n\n**Use cases:** AI agent context, debugging entity state, inspecting navigation/validation\n\n### Inspect: Data\n\nGet the current editor context data as JSON via `pnpm phoenix inspect:data`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (prints to stdout if omitted)\n- `--pretty` \u2014 Pretty-print JSON (default: true)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Returns:** publishedData, frontendData, backendData, sessionData, accessData, webComponentProperties\n\n**Example:** `pnpm phoenix inspect:data -o ./data.json`\n\n**Tips:** Pipe through `head`/`tail` for partial output (e.g., `pnpm phoenix inspect:data | head -30`).\n\n**Use cases:** AI agent context, debugging published/session/access data\n\n### Inspect: Scene\n\nGet the current Three.js scene graph as JSON via `pnpm phoenix inspect:scene`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (prints to stdout if omitted)\n- `--pretty` \u2014 Pretty-print JSON (default: true)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Returns:** Recursive scene tree with per-node: name, type, visible, position, rotation, scale, userData (entityId), and for meshes: geometry name, bounding box, material properties (color, metalness, roughness, opacity, textures), morph target influences. Lights include color, intensity, and type-specific properties.\n\n**Example:** `pnpm phoenix inspect:scene -o ./scene.json`\n\n**Tips:** Scene graphs can be large. Pipe through `head`/`tail` for partial output.\n\n**Use cases:** AI agent context, debugging 3D scene layout, inspecting materials and lighting\n\n### Key Docs\n- `docs/phoenix/getting-started.mdx` \u2014 Setup, prerequisites, first project\n- `docs/phoenix/quickstart.mdx` \u2014 End-to-end tutorial building a configurator\n- `docs/phoenix/domain-model.mdx` \u2014 Entities, attributes, relations, specs\n- `docs/phoenix/components.mdx` \u2014 ECS pattern, YAML components, custom components\n- `docs/phoenix/project-structure.mdx` \u2014 Files, folders, conventions\n- `docs/phoenix/best-practices.mdx` \u2014 YAML-first, code patterns, common pitfalls\n- `docs/phoenix/state-management.mdx` \u2014 Reactive state, RxJS pipelines, data flow\n- `docs/phoenix/expression-context.mdx` \u2014 Expression API, context object, helpers\n- `docs/phoenix/webhooks.mdx` \u2014 Server-side finalization workflows\n- `docs/phoenix/finalization.mdx` \u2014 Finalization system, PDF/email/CSV generation\n- `docs/phoenix/migrations.mdx` \u2014 Schema versioning, migration files\n\n### Agent Workflow\n1. Find relevant docs by content: `pnpm phoenix docs -s \"camera\"`\n2. Read matching doc: `pnpm phoenix docs -r docs/3d-scene/cameras/transitions.mdx`\n3. Search within a doc: `pnpm phoenix docs -r <path> | grep \"example\"`\n4. Search titles only as a fallback: `pnpm phoenix docs -l | grep \"camera\"`\n5. Search generated files directly when needed: `grep -rn \"camera\" \"$(pnpm phoenix docs --dir)\"`\n6. Browse a topic area: `pnpm phoenix docs -c \"Layouts\"`\n\n### Playwright MCP Setup (for AI agents)\n\nTo interact with the 3D configurator in a browser, Playwright MCP needs GPU-enabled flags for WebGL rendering. Add to `~/.claude/.mcp.json`:\n\n```json\n{\n \"mcpServers\": {\n \"playwright\": {\n \"command\": \"npx\",\n \"args\": [\n \"@playwright/mcp@latest\",\n \"--headed\",\n \"--launch-options\",\n \"{\\\"args\\\":[\\\"--use-gl=swiftshader\\\",\\\"--enable-webgl\\\",\\\"--ignore-gpu-blocklist\\\"]}\"\n ]\n }\n }\n}\n```\n\nKey flags:\n- `--headed` \u2014 visible browser (required for GPU rendering)\n- `--use-gl=swiftshader` \u2014 software GPU fallback for environments without a physical GPU\n- `--enable-webgl` + `--ignore-gpu-blocklist` \u2014 ensure WebGL is available\n[PHOENIX-SDK-END]";
1
+ export declare const sdkContent = "[PHOENIX-SDK-START]\n## Phoenix Configurator Project\n\nDeclarative 3D product configurator built with Phoenix SDK. Domain model defined in YAML, custom logic in TypeScript.\n\n## Build Commands\n- `pnpm phoenix build` \u2014 Full production build\n- `pnpm phoenix dev` \u2014 Development mode with hot reload\n- `pnpm phoenix sync` \u2014 Sync generated files without full build\n\n## Dev Logs\n- `pnpm phoenix dev` writes all logs to `.phoenix/phoenix-dev.log`\n- Contains: spec parse errors, build errors, browser runtime errors, file watcher events\n- After making changes, always check the log for errors: `tail -50 .phoenix/phoenix-dev.log` or `grep ERROR .phoenix/phoenix-dev.log`\n- Rotated automatically at 10MB (`.log.1`, `.log.2` are older rotations)\n\n## Project Structure\n- `spec/` \u2014 Domain YAML specs (entities, relations, expressions, invariants, components, application config)\n- `src/expressions/` \u2014 Computed/derived entity properties (`phx.domain.implementCustomExpressions()`)\n- `src/invariants/` \u2014 Business rule constraints (`phx.domain.implementCustomInvariants()`)\n- `src/transformers/` \u2014 Automatic state fixers (`phx.frontend.transformerBuilder`)\n- `src/components/` \u2014 ECS system components (`phx.domain.attachComponent.withEntity()`)\n- `src/elements/` \u2014 Page-level React components (`phx.frontend.createCustomPhoenixLayoutElement()`)\n - `ConfiguratorLayout`: a layout element with this name replaces everything the built-in layout renders for a loaded configuration, in owner and read mode, finalization included. Prefer arranging the spec's layout components; write one for shell-level changes, such as moving the sidebar or adding an area the built-in layout has no place for\n - Mount `LayoutSlots.SharedCanvas` (from `@salsita-ai/sdk/configurator`) in a positioned root covering the page; put the UI above it, positioned and after it in the markup. With the canvas mounted the app loader waits until the scene has loaded; a layout without a canvas is not held by the loader. Call `phx.frontend.useSceneSafeArea()` and put `containerRef` on the element covering the whole canvas and `safeAreaRef` on the region the UI leaves free, with `pointerEvents: 'none'`, so the camera frames the scene there\n - Sidebar moved, contents as the spec configures them: mount `LayoutSlots.DesktopSidebar` in a positioned container that sets its size, with `side=\"start\"` on the left; `docs/layouts/sidebar/in-a-custom-layout.mdx` is the whole layout\n - Your own UI: \"Hooks for a Project Layout\" in `docs/phoenix/configurator-interface.mdx` lists the hooks with what each returns (`pnpm phoenix docs -r docs/phoenix/configurator-interface.mdx`), `docs/phoenix/layout-slots.mdx` the built-in pieces you can still mount, and `docs/layouts/custom-layout.mdx` is a worked example. Call the hooks as `phx.frontend.useX()`; besides those below, these are often needed: `usePreview()` (`isPreview` while the preview start screen shows), `useCloseAction()` (the host's close action or `null`), `useActiveViewports()` (the container's breakpoints, `null` until measured, `desktop` above 768 px: the desktop/phone switch), `useResolveLocalizable()` and `useLocalizable(text)` (spec texts to strings), `useIsCloningAllowed()` (a read-mode \"edit a copy\" action with `LayoutSlots.CloneToEditDialog`)\n - Undo and redo: `phx.frontend.useUndoRedo()` returns `{ canUndo, canRedo, undo, redo }`; disable each button from `canUndo`/`canRedo`\n - Tabs: `phx.frontend.useTabNavigation()` returns `{ source, tabs, activeTab, select }` for the spec's `sidebarTabs` (of the selected entity) or `horizontalTabs`; render `tabs` (each `{ index, label, icon, state, isActive }`, `icon` a PhxIcon name) and call `select(tab.index)` on click. Pass `{ source: 'sidebarTabs' }` or `{ source: 'horizontalTabs' }` when the layout shows one kind only. Not `LayoutSlots.useSidebarTabs()`: it serves the built-in sidebar and returns no tabs while its summary shows\n - Steps: `phx.frontend.useStepNavigation()` returns `{ steps, activeStep, activeIndex, isFirst, isLast, canGoNext, canGoPrevious, next, previous, goTo }` for the spec's `navigationSteps`; render `steps` (each `{ index, label, state, status }`, `status` `'complete' | 'active' | 'upcoming'`), call `next()`/`previous()` for Back and Next and `goTo(step.index)` from a stepper. It enforces no order and no validity: enable only `'complete'` steps for an \"earlier steps only\" stepper, and to block moving on while the configuration has a problem, require `phx.frontend.useStateValidity().severity !== 'warning'` besides `canGoNext`: a change with a `fixable` or `fatal` violation is rejected, so the configuration is never invalid, and a `warning` is the problem that stays (it blocks finalizing too). `useSteps` and `useHasSteps` from `@salsita-ai/sdk/configurator` are deprecated\n - Messages: mount `LayoutSlots.Services` for the built-in snackbars, or show violations, side-effect hints, errors and failed saves yourself with `phx.frontend.useConfiguratorMessages(onMessage)`, not both. A failed save arrives as `saveError`, the next successful save as `saveRecovery`; a layout that mounts neither shows no sign of a failed save. Either way mount a snackbar root (`LayoutSlots.DesktopSnackbarsRoot` or `LayoutSlots.MobileSnackbarsRoot`): errors of the built-in actions are always snackbars\n - Finalize over the spec's `finalizeAction` components, each naming a handler registered with `phx.frontend.createPhoenixHandler`: `phx.frontend.useFinalizeActions()` returns `{ actions, primary, secondary, disabled, hints }`; render `primary` (and `secondary` in a menu or list) in a loop, each action `{ key, label, title, icon, run, isPending, error, disabled }`, and call `action.run()` on click (its promise never rejects; show `action.error` on failure). The configurator runs the handlers itself, outside the layout, so a handler must not rely on a provider the layout adds. For one known handler, `phx.frontend.useFinalizeAction(handler)` in a component wrapped in `PhoenixHandlerBoundary` (from `@salsita-ai/sdk/react`) works too; `FinalizeActions` (from `@salsita-ai/sdk/configurator`) mounts the built-in buttons. `finalizePage` and `finalizeButton` are legacy\n - Read mode and fullscreen are the layout's job, no hook enforces them (`useUndoRedo`, `useFinalizeActions` and `useStepNavigation` included): hide undo, redo, finalization and whatever else a viewer must not change while `phx.frontend.useAccessService().accessInfo.viewMode` is `true` (tabs are navigation, so a viewer may switch them), and remove panels while `phx.frontend.useIsFullscreenActive()` is set; `phx.frontend.useSetFullscreen()` returns its setter\n - `ConfigurationNotFoundPage`: `phx.frontend.createConfigurationNotFoundPage(({ onBack }) => \u2026)` replaces the \"configuration not accessible\" page; show a way back only when the optional `onBack` is set. The not-authenticated page's default renders it too; only the admin's not-authorized page keeps the built-in page\n - `ConfiguratorErrorPage`: `phx.frontend.createConfiguratorErrorPage(({ reason, onRetry }) => \u2026)` replaces the production error page; `reason` is `uncaughtError` or `presetCreationFailed`. A page that throws falls back to the built-in one, and development keeps the detailed error pages, so the project page shows only in a production build. Register both pages with these helpers: `createCustomPhoenixLayoutElement` with the name works too, but types the component as taking only `children`, so the typed props do not compile there in a strict project\n - `AppLoaderContent`: `phx.frontend.createAppLoader(({ phases }) => \u2026)` replaces what the loading overlay shows (each phase `{ id, label?, progress? }`, the list possibly empty); Phoenix keeps the overlay itself\n- `src/handlers/` \u2014 Event & lifecycle handlers\n- `src/webhooks/` \u2014 Server-side webhook handlers (`phx.webhooks.*Builder`)\n- `src/migrations/` \u2014 Schema version migrations (v*.ts)\n- `src/locales/` \u2014 Locale catalogs (authored .po sources; compiled .ts, do not edit)\n- `src/admin/` \u2014 Admin interface (mirrors main src/ structure)\n- `src/_shared/` \u2014 Shared utilities (NOT auto-imported, requires explicit imports)\n- `.phoenix/` \u2014 Auto-generated files (DO NOT EDIT)\n- `public/` \u2014 Static assets (3D models, textures, images, HDRI maps, fonts)\n- `assets/` \u2014 Uploadable resources (PDF templates, email assets)\n\n## Architecture Principles\n- YAML-first: 99% of configuration in spec/*.yaml, custom code is last resort\n- ECS pattern: entities (domain objects) + components (behavior/UI) + systems (SDK runtime)\n- Reactive state: immutable domain state flows through RxJS pipelines\n- Data binding: `$read` (read-only), `$write` (write-only), `$bind` (bidirectional) connect components to domain\n- memoEval: all component implementations must use memoEval for stable object references\n\n## Key Patterns\n- Expressions = computed properties on entities (prefix: `$`), implemented per-entity in src/expressions/\n- Invariants = validation rules returning violations, static or dynamic\n- Transformers = auto-fixers maintaining consistency after state changes\n- Components defined in YAML with `$read`/`$bind` bindings, or custom in src/components/ using attachComponent builder\n- Webhooks = server-side finalization tasks (PDF, email, CSV, image rendering)\n- Filters = contextual component activation via navigationStates, viewStates, modes, selectedEntityIds\n\n## File Conventions\n- Components: PascalCase (.tsx)\n- Utilities: kebab-case (.ts)\n- Expressions: entity-name.ts\n- Migrations: v*.ts (sequential)\n- Specs: kebab-case.yaml\n- Underscore folders (_shared/, _utils/) are NOT auto-imported\n\n## Export Rules\nAll files in src/expressions/, src/invariants/, src/transformers/, src/components/, src/handlers/, src/webhooks/ MUST use default exports. Can be a single item or an array. Named exports are ignored by the SDK auto-import system.\n\n## Webhook Membership\n- User-authored components, admin components, and handlers are frontend-only by default.\n- A handler that registers `createMapPublishedRevisionDataHandler`, `createMapPublishedChunkedDataHandler`, `createDataRowValidatorHandler`, or `createSheetValidatorHandler` is included in the webhook automatically.\n- To include another component or handler in the webhook, put `'use webhook'` as its first statement (leading comments are allowed).\n- A webhook-included file and its runtime local-import closure must not import browser SDK entrypoints (`application`, `admin`, `configurator`, `editor`, `react`, `ui`) or style/font/image assets. Spec parsing reports the unsafe import and inclusion reason as a diagnostic.\n- Keep browser rendering in an unpinned file. Move shared server-safe logic into a separate module when both frontend and webhook code need it.\n\n## Do Not Edit\n- `.phoenix/` directory \u2014 completely regenerated on each build\n- `tsconfig.json`, `eslint.config.js`, `prettier.config.js`, `.prettierignore`, `.linguirc`, `.nvmrc`\n- `src/locales/` .ts files \u2014 compiled from .po files\n\n## Code Review\nUse `/review` command to review code changes before committing.\n\n## SDK Documentation\n\nAlways search SDK docs for relevant examples before implementing Phoenix features.\n\n### Commands\n- `pnpm phoenix docs` \u2014 Full documentation index with descriptions\n- `pnpm phoenix docs -s <term>` \u2014 Search all doc content and metadata (case-insensitive)\n- `pnpm phoenix docs --dir` \u2014 Print the absolute docs directory for grep or ripgrep\n- `pnpm phoenix docs -r <path>` \u2014 Read specific doc (raw text to stdout)\n- `pnpm phoenix docs -c <category>` \u2014 List docs in a category\n- `pnpm phoenix docs -l` \u2014 List all doc paths with titles\n\n### 3D Asset Inspection\n\nRun `pnpm phoenix inspect:assets` to discover all glTF/GLB files in `public/` and get a summary table. Use `--file <path>` for detailed single-file inspection.\n\n**When to use:** before writing YAML/code that references objectName, materialsToOverride, morphTargetInfluences, or object positioning.\n\n**What it shows per node:**\n- Name, type (Mesh/Light/Camera/Empty), children\n- Transform: `pos=`, `rot=`, `scale=` (only non-default values shown)\n- Per-node morph targets: `morphs=Width,Height`\n- Bounding box: `bounds=WxHxD` (width x height x depth in meters)\n- Origin placement: `origin=center`, `bottom-center`, `top-center`, `bottom-corner`, etc. with numerical offset\n\n**Use cases:**\n- Find exact node names for `objectName` in scene entity components\n- Find material names for `materialsToOverride`\n- Find morph target names for `morphTargetInfluences`\n- Check model dimensions (bounds) for positioning, dimension indicators, or invariants\n- Check origin placement to understand how models anchor (center vs bottom-center)\n- Use `--json` for programmatic access to all data\n\n**Flags:** `--objects`, `--materials`, `--morphs`, `--animations`, `--json`\n\n### Screenshot CLI\n\nCapture 3D canvas screenshots from a running dev server via `pnpm phoenix screenshot`.\n\n**Prerequisites:**\n1. `phoenix dev` must be running (starts the WebSocket server on port 3020)\n2. Configurator must be open in a browser (the browser does the actual rendering)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (default: `./screenshot.png`)\n- `--width, -w` \u2014 Width in pixels (default: 1920)\n- `--height` \u2014 Height in pixels (default: 1080)\n- `--format, -f` \u2014 Image format: PNG or JPEG (default: PNG)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Example workflow:**\n1. Start dev server: `pnpm phoenix dev`\n2. Open configurator in browser (or via Playwright MCP)\n3. Take screenshot: `pnpm phoenix screenshot -o ./render.png -w 2560 --height 1440`\n\n**Use cases:** visual regression testing, generating product images, debugging 3D renders\n\n### Inspect: State\n\nGet the current editor runtime state as JSON via `pnpm phoenix inspect:state`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (prints to stdout if omitted)\n- `--sections, -s` \u2014 Comma-separated: entities, navigation, validation (default: all)\n- `--pretty` \u2014 Pretty-print JSON (default: true)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Example:** `pnpm phoenix inspect:state -o ./state.json -s entities,navigation`\n\n**Lifecycle status:** Always included in response. Shows which systems are ready:\n- `domainLoaded` \u2014 domain data loaded\n- `domainContextReady` \u2014 domain context initialized (entities available)\n- `configuratorReady` \u2014 3D configurator initialized\n- `sessionAuthenticated` \u2014 session service active\n- `editorMode` \u2014 editor mode enabled\n\n**Tips:** Use `--sections` to limit payload size. Pipe through `head`/`tail` for partial output (e.g., `pnpm phoenix inspect:state | head -50`).\n\n**Use cases:** AI agent context, debugging entity state, inspecting navigation/validation\n\n### Inspect: Data\n\nGet the current editor context data as JSON via `pnpm phoenix inspect:data`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (prints to stdout if omitted)\n- `--pretty` \u2014 Pretty-print JSON (default: true)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Returns:** publishedData, frontendData, backendData, sessionData, accessData, webComponentProperties\n\n**Example:** `pnpm phoenix inspect:data -o ./data.json`\n\n**Tips:** Pipe through `head`/`tail` for partial output (e.g., `pnpm phoenix inspect:data | head -30`).\n\n**Use cases:** AI agent context, debugging published/session/access data\n\n### Inspect: Scene\n\nGet the current Three.js scene graph as JSON via `pnpm phoenix inspect:scene`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` \u2014 Output file path (prints to stdout if omitted)\n- `--pretty` \u2014 Pretty-print JSON (default: true)\n- `--port` \u2014 WebSocket server port (default: 3020)\n\n**Returns:** Recursive scene tree with per-node: name, type, visible, position, rotation, scale, userData (entityId), and for meshes: geometry name, bounding box, material properties (color, metalness, roughness, opacity, textures), morph target influences. Lights include color, intensity, and type-specific properties.\n\n**Example:** `pnpm phoenix inspect:scene -o ./scene.json`\n\n**Tips:** Scene graphs can be large. Pipe through `head`/`tail` for partial output.\n\n**Use cases:** AI agent context, debugging 3D scene layout, inspecting materials and lighting\n\n### Key Docs\n- `docs/phoenix/getting-started.mdx` \u2014 Setup, prerequisites, first project\n- `docs/phoenix/quickstart.mdx` \u2014 End-to-end tutorial building a configurator\n- `docs/phoenix/domain-model.mdx` \u2014 Entities, attributes, relations, specs\n- `docs/phoenix/components.mdx` \u2014 ECS pattern, YAML components, custom components\n- `docs/phoenix/project-structure.mdx` \u2014 Files, folders, conventions\n- `docs/phoenix/best-practices.mdx` \u2014 YAML-first, code patterns, common pitfalls\n- `docs/phoenix/state-management.mdx` \u2014 Reactive state, RxJS pipelines, data flow\n- `docs/phoenix/expression-context.mdx` \u2014 Expression API, context object, helpers\n- `docs/phoenix/webhooks.mdx` \u2014 Server-side finalization workflows\n- `docs/phoenix/finalization.mdx` \u2014 Finalization system, PDF/email/CSV generation\n- `docs/phoenix/migrations.mdx` \u2014 Schema versioning, migration files\n\n### Agent Workflow\n1. Find relevant docs by content: `pnpm phoenix docs -s \"camera\"`\n2. Read matching doc: `pnpm phoenix docs -r docs/3d-scene/cameras/transitions.mdx`\n3. Search within a doc: `pnpm phoenix docs -r <path> | grep \"example\"`\n4. Search titles only as a fallback: `pnpm phoenix docs -l | grep \"camera\"`\n5. Search generated files directly when needed: `grep -rn \"camera\" \"$(pnpm phoenix docs --dir)\"`\n6. Browse a topic area: `pnpm phoenix docs -c \"Layouts\"`\n\n### Playwright MCP Setup (for AI agents)\n\nTo interact with the 3D configurator in a browser, Playwright MCP needs GPU-enabled flags for WebGL rendering. Add to `~/.claude/.mcp.json`:\n\n```json\n{\n \"mcpServers\": {\n \"playwright\": {\n \"command\": \"npx\",\n \"args\": [\n \"@playwright/mcp@latest\",\n \"--headed\",\n \"--launch-options\",\n \"{\\\"args\\\":[\\\"--use-gl=swiftshader\\\",\\\"--enable-webgl\\\",\\\"--ignore-gpu-blocklist\\\"]}\"\n ]\n }\n }\n}\n```\n\nKey flags:\n- `--headed` \u2014 visible browser (required for GPU rendering)\n- `--use-gl=swiftshader` \u2014 software GPU fallback for environments without a physical GPU\n- `--enable-webgl` + `--ignore-gpu-blocklist` \u2014 ensure WebGL is available\n[PHOENIX-SDK-END]";