@salsita-ai/sdk 0.50.0-develop.fbe43b9a2d → 0.50.0-develop.fda84314a5

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 (306) hide show
  1. package/dist/application/index.d.ts +1 -0
  2. package/dist/application/index.js +1 -1
  3. package/dist/application/mount-application.d.ts +1 -1
  4. package/dist/application/mount-application.js +1 -1
  5. package/dist/application/mount-configurator.d.ts +19 -0
  6. package/dist/application/mount-configurator.js +1 -0
  7. package/dist/application/mounted-application-runtime.d.ts +4 -0
  8. package/dist/application/mounted-application-runtime.js +1 -0
  9. package/dist/application/register-web-component.d.ts +2 -0
  10. package/dist/application/register-web-component.js +1 -0
  11. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +11 -5
  12. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +1 -1
  13. package/dist/application-spec/generate-application/implementations/phx-application-types.d.ts +25 -0
  14. package/dist/application-spec/generate-application/implementations/phx-application-types.js +1 -0
  15. package/dist/application-spec/generate-application/implementations/phx-domain.d.ts +36 -0
  16. package/dist/application-spec/generate-application/implementations/phx-domain.js +1 -0
  17. package/dist/application-spec/generate-application/implementations/phx-model.d.ts +24 -0
  18. package/dist/application-spec/generate-application/implementations/phx-model.js +1 -0
  19. package/dist/application-spec/generate-application/implementations/phx.d.ts +22 -0
  20. package/dist/application-spec/generate-application/implementations/phx.js +1 -0
  21. package/dist/application-spec/generate-application/index.d.ts +2 -0
  22. package/dist/application-spec/generate-application/index.js +1 -1
  23. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +3 -3
  24. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +7 -4
  25. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
  26. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.d.ts +16 -0
  27. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.js +1 -0
  28. package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +17 -4
  29. package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
  30. package/dist/application-spec/generate-application/runtime/application-spec-slice.d.ts +71 -0
  31. package/dist/application-spec/generate-application/runtime/application-spec-slice.js +1 -0
  32. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +3 -3
  33. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +7 -5
  34. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
  35. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.d.ts +16 -0
  36. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.js +1 -0
  37. package/dist/application-spec/generate-application/runtime/create-application.d.ts +57 -0
  38. package/dist/application-spec/generate-application/runtime/create-application.js +1 -0
  39. package/dist/application-spec/generate-application/runtime/index.d.ts +8 -0
  40. package/dist/application-spec/generate-application/runtime/index.js +1 -0
  41. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +9 -3
  42. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
  43. package/dist/application-spec/generate-application/runtime/spec-runtime.d.ts +21 -0
  44. package/dist/application-spec/generate-application/runtime/spec-runtime.js +1 -0
  45. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.d.ts +3 -2
  46. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +44 -9
  47. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.js +1 -1
  48. package/dist/client/authorized-client.d.ts +3 -1
  49. package/dist/client/authorized-client.js +1 -1
  50. package/dist/client/contract.d.ts +17 -0
  51. package/dist/client/index.d.ts +1 -1
  52. package/dist/client/local-authorized-client.d.ts +3 -1
  53. package/dist/client/local-authorized-client.js +1 -1
  54. package/dist/client/memory-authorized-client.d.ts +4 -1
  55. package/dist/client/memory-authorized-client.js +1 -1
  56. package/dist/client/phoenix-api.d.ts +228 -0
  57. package/dist/configurator/ConfiguratorApp.js +1 -1
  58. package/dist/configurator/app-loader-content/index.d.ts +0 -1
  59. package/dist/configurator/app-loader-content/index.js +1 -1
  60. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  61. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +17 -3
  62. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  63. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +23 -6
  64. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  65. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +15 -9
  66. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  67. package/dist/configurator/common/configurator-interface.d.ts +8 -5
  68. package/dist/configurator/common/configurator-interface.js +1 -1
  69. package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.d.ts +5 -0
  70. package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.js +1 -0
  71. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.d.ts +0 -6
  72. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.js +1 -1
  73. package/dist/configurator/configuration-not-found-page/index.d.ts +2 -2
  74. package/dist/configurator/configuration-not-found-page/index.js +1 -1
  75. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.d.ts +3 -3
  76. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.js +1 -1
  77. package/dist/configurator/configurator-context/PreviewContextProvider.js +1 -1
  78. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.d.ts +3 -3
  79. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.js +1 -1
  80. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.d.ts +0 -5
  81. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.js +1 -1
  82. package/dist/configurator/configurator-error-page/index.d.ts +1 -2
  83. package/dist/configurator/configurator-error-page/index.js +1 -1
  84. package/dist/configurator/index.d.ts +9 -2
  85. package/dist/configurator/index.js +1 -1
  86. package/dist/configurator/pages/default-configurator-elements.js +1 -1
  87. package/dist/configurator/pages/error-boundaries/LoadingErrorBoundary.js +1 -1
  88. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.d.ts +1 -1
  89. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -1
  90. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +12 -4
  91. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -1
  92. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +8 -0
  93. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -0
  94. package/dist/configurator/ui/configurator-layout/slots/canvas/LayoutCanvas.js +1 -1
  95. package/dist/configurator/ui/configurator-layout/slots/canvas/SharedCanvas.js +1 -1
  96. package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.js +1 -1
  97. package/dist/configurator/ui/legacy/layout/common/ReactiveInterfaceLayout.js +1 -1
  98. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.d.ts +0 -7
  99. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.js +2 -2
  100. package/dist/configurator/ui/phoenix-layout-elements/index.d.ts +8 -1
  101. package/dist/configurator/ui/phoenix-layout-elements/index.js +1 -1
  102. package/dist/configurator/ui/preset-layout/PresetUi.d.ts +0 -2
  103. package/dist/configurator/ui/preset-layout/PresetUi.js +1 -1
  104. package/dist/configurator/ui/preset-layout/index.d.ts +6 -1
  105. package/dist/configurator/ui/preset-layout/index.js +1 -1
  106. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -1
  107. package/dist/docs/index.json +34 -1
  108. package/dist/docs/integrations/webcomponent-api/basics.mdx +2 -0
  109. package/dist/docs/layouts/custom-layout.mdx +318 -158
  110. package/dist/docs/layouts/gallery/ardent-compressor.mdx +1 -0
  111. package/dist/docs/layouts/gallery/corvid-drone.mdx +3428 -0
  112. package/dist/docs/layouts/gallery/fenwick-window.mdx +198 -127
  113. package/dist/docs/layouts/gallery/nightjar-guitar.mdx +3698 -0
  114. package/dist/docs/layouts/gallery/sunfold-solar.mdx +16 -4
  115. package/dist/docs/layouts/gallery/tidepool-aquascape.mdx +5203 -0
  116. package/dist/docs/phoenix/configurator-interface.mdx +8 -6
  117. package/dist/docs/phoenix/sdk-builder-workflow.mdx +4 -2
  118. package/dist/docs/phoenix/sessions-and-access.mdx +2 -0
  119. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  120. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  121. package/dist/domain/application/configurator-builder.d.ts +7 -1
  122. package/dist/domain/application/configurator-builder.js +1 -1
  123. package/dist/domain/application/index.d.ts +1 -1
  124. package/dist/domain/application/index.js +1 -1
  125. package/dist/domain/application/standard-properties.js +1 -1
  126. package/dist/domain/application/web-component-property.d.ts +3 -1
  127. package/dist/domain/application/web-component-property.js +1 -1
  128. package/dist/domain/domain-builder.d.ts +9 -3
  129. package/dist/domain/domain-builder.js +1 -1
  130. package/dist/domain/domain-runtime/application.d.ts +39 -0
  131. package/dist/domain/domain-runtime/application.js +1 -0
  132. package/dist/domain/domain-runtime/domain-context/selectors.d.ts +1 -0
  133. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  134. package/dist/domain/domain-runtime/domain-runtime.d.ts +40 -4
  135. package/dist/domain/domain-runtime/domain-runtime.js +1 -1
  136. package/dist/domain/domain-runtime/environment/initialize.d.ts +1 -1
  137. package/dist/domain/domain-runtime/errors/implementation-error-collector.d.ts +2 -0
  138. package/dist/domain/domain-runtime/errors/implementation-error-collector.js +1 -1
  139. package/dist/domain/domain-runtime/index.d.ts +2 -1
  140. package/dist/domain/domain-runtime/index.js +1 -1
  141. package/dist/domain/domain-runtime/spec/index.d.ts +1 -1
  142. package/dist/domain/domain-runtime/spec/index.js +1 -1
  143. package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +1 -0
  144. package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
  145. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.d.ts +23 -0
  146. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.js +1 -0
  147. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.d.ts +3 -4
  148. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.js +1 -1
  149. package/dist/domain/domain-runtime/web-component/actions.d.ts +3 -0
  150. package/dist/domain/domain-runtime/web-component/actions.js +1 -1
  151. package/dist/domain/domain-runtime/web-component/initialize.d.ts +1 -0
  152. package/dist/domain/domain-runtime/web-component/initialize.js +1 -1
  153. package/dist/domain/domain-runtime/web-component/selectors.d.ts +2 -0
  154. package/dist/domain/domain-runtime/web-component/selectors.js +1 -1
  155. package/dist/domain/domain-runtime/web-component/types.d.ts +6 -3
  156. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +7 -0
  157. package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
  158. package/dist/editor/domain-editors/apply-spec-update.d.ts +2 -1
  159. package/dist/editor/domain-editors/apply-spec-update.js +1 -1
  160. package/dist/editor/domain-editors/use-implementation-files.d.ts +6 -14
  161. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  162. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  163. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  164. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
  165. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
  166. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
  167. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +11 -5
  168. package/dist/react-sdk/application-runtime/common-services/analytics/analytics-service.d.ts +1 -1
  169. package/dist/react-sdk/application-runtime/common-services/initialize.d.ts +2 -2
  170. package/dist/react-sdk/application-runtime/hooks/index.d.ts +2 -0
  171. package/dist/react-sdk/application-runtime/hooks/index.js +1 -1
  172. package/dist/react-sdk/application-runtime/hooks/loading/index.d.ts +5 -0
  173. package/dist/react-sdk/application-runtime/hooks/loading/index.js +1 -0
  174. package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.d.ts +11 -0
  175. package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.js +1 -0
  176. package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.d.ts +8 -0
  177. package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.js +1 -0
  178. package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.d.ts +7 -0
  179. package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.js +1 -0
  180. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.d.ts +9 -0
  181. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.js +1 -0
  182. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.d.ts +24 -0
  183. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.js +1 -0
  184. package/dist/react-sdk/application-runtime/hooks/responsive/index.d.ts +3 -0
  185. package/dist/react-sdk/application-runtime/hooks/responsive/index.js +1 -0
  186. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.d.ts +9 -0
  187. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.js +1 -0
  188. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.d.ts +26 -0
  189. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.js +1 -0
  190. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.d.ts +10 -0
  191. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.js +1 -0
  192. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.d.ts +24 -0
  193. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.js +1 -0
  194. package/dist/react-sdk/application-runtime/hooks/use-access-service.d.ts +5 -0
  195. package/dist/react-sdk/application-runtime/hooks/use-access-service.js +1 -1
  196. package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.d.ts +4 -11
  197. package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.js +1 -1
  198. package/dist/react-sdk/application-runtime/hooks/use-web-component.d.ts +5 -0
  199. package/dist/react-sdk/application-runtime/hooks/use-web-component.js +1 -1
  200. package/dist/react-sdk/application-runtime/host-properties/actions.d.ts +15 -0
  201. package/dist/react-sdk/application-runtime/host-properties/actions.js +1 -0
  202. package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.d.ts +30 -0
  203. package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.js +1 -0
  204. package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.d.ts +7 -0
  205. package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.js +1 -0
  206. package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.d.ts +21 -0
  207. package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.js +1 -0
  208. package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.d.ts +42 -0
  209. package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.js +1 -0
  210. package/dist/react-sdk/application-runtime/host-properties/index.d.ts +8 -0
  211. package/dist/react-sdk/application-runtime/host-properties/index.js +1 -0
  212. package/dist/react-sdk/application-runtime/host-properties/initialize.d.ts +7 -0
  213. package/dist/react-sdk/application-runtime/host-properties/initialize.js +1 -0
  214. package/dist/react-sdk/application-runtime/host-properties/selectors.d.ts +54 -0
  215. package/dist/react-sdk/application-runtime/host-properties/selectors.js +1 -0
  216. package/dist/react-sdk/application-runtime/host-properties/types.d.ts +18 -0
  217. package/dist/react-sdk/application-runtime/index.d.ts +3 -0
  218. package/dist/react-sdk/application-runtime/loading/actions.d.ts +45 -0
  219. package/dist/react-sdk/application-runtime/loading/actions.js +1 -0
  220. package/dist/react-sdk/application-runtime/loading/index.d.ts +4 -0
  221. package/dist/react-sdk/application-runtime/loading/index.js +1 -0
  222. package/dist/react-sdk/application-runtime/loading/initialize.d.ts +3 -0
  223. package/dist/react-sdk/application-runtime/loading/initialize.js +1 -0
  224. package/dist/react-sdk/application-runtime/loading/selectors.d.ts +18 -0
  225. package/dist/react-sdk/application-runtime/loading/selectors.js +1 -0
  226. package/dist/react-sdk/application-runtime/loading/types.d.ts +59 -0
  227. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  228. package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.d.ts +6 -0
  229. package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.js +1 -1
  230. package/dist/react-sdk/application-runtime/provider/ApplicationType.d.ts +7 -0
  231. package/dist/react-sdk/application-runtime/provider/ApplicationType.js +1 -1
  232. package/dist/react-sdk/application-runtime/responsive/actions.d.ts +47 -0
  233. package/dist/react-sdk/application-runtime/responsive/actions.js +1 -0
  234. package/dist/react-sdk/application-runtime/responsive/index.d.ts +4 -0
  235. package/dist/react-sdk/application-runtime/responsive/index.js +1 -0
  236. package/dist/react-sdk/application-runtime/responsive/initialize.d.ts +3 -0
  237. package/dist/react-sdk/application-runtime/responsive/initialize.js +1 -0
  238. package/dist/react-sdk/application-runtime/responsive/selectors.d.ts +20 -0
  239. package/dist/react-sdk/application-runtime/responsive/selectors.js +1 -0
  240. package/dist/react-sdk/application-runtime/responsive/types.d.ts +104 -0
  241. package/dist/react-sdk/application-runtime/responsive/types.js +1 -0
  242. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +309 -8
  243. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
  244. package/dist/react-sdk/domain-application-context/BackendDataProvider.js +1 -1
  245. package/dist/react-sdk/domain-application-context/FrontendDataProvider.js +1 -1
  246. package/dist/react-sdk/domain-application-context/PublishedDataProvider.js +1 -1
  247. package/dist/react-sdk/domain-context/common-hooks/index.d.ts +1 -0
  248. package/dist/react-sdk/domain-context/common-hooks/index.js +1 -1
  249. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.d.ts +23 -0
  250. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.js +1 -0
  251. package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +1 -0
  252. package/dist/react-sdk/domain-context/index.d.ts +1 -0
  253. package/dist/react-sdk/domain-context/index.js +1 -1
  254. package/dist/react-sdk/elements/index.d.ts +0 -1
  255. package/dist/react-sdk/index.d.ts +1 -1
  256. package/dist/react-sdk/index.js +1 -1
  257. package/dist/react-sdk/loading-state/LoaderHost.d.ts +20 -0
  258. package/dist/react-sdk/loading-state/LoaderHost.js +1 -0
  259. package/dist/react-sdk/loading-state/built-in-loading-phase.d.ts +9 -0
  260. package/dist/react-sdk/loading-state/built-in-loading-phase.js +1 -0
  261. package/dist/react-sdk/loading-state/create-app-loader.d.ts +18 -0
  262. package/dist/react-sdk/loading-state/create-app-loader.js +1 -0
  263. package/dist/react-sdk/loading-state/index.d.ts +4 -2
  264. package/dist/react-sdk/loading-state/index.js +1 -1
  265. package/dist/react-sdk/loading-state/{LoadingStateProvider.d.ts → loading-state-hooks.d.ts} +3 -12
  266. package/dist/react-sdk/loading-state/loading-state-hooks.js +1 -0
  267. package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.d.ts +17 -0
  268. package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.js +1 -0
  269. package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.d.ts +17 -0
  270. package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.js +1 -0
  271. package/dist/react-sdk/page-elements/configurator-error-page-props.js +1 -0
  272. package/dist/{configurator/configuration-not-found-page → react-sdk/page-elements}/create-configuration-not-found-page.d.ts +7 -1
  273. package/dist/react-sdk/page-elements/create-configuration-not-found-page.js +1 -0
  274. package/dist/{configurator/configurator-error-page → react-sdk/page-elements}/create-configurator-error-page.d.ts +6 -1
  275. package/dist/react-sdk/page-elements/create-configurator-error-page.js +1 -0
  276. package/dist/react-sdk/page-elements/create-preset-ui.d.ts +9 -0
  277. package/dist/react-sdk/page-elements/create-preset-ui.js +1 -0
  278. package/dist/react-sdk/page-elements/index.d.ts +6 -0
  279. package/dist/react-sdk/page-elements/index.js +1 -0
  280. package/dist/react-sdk/session/SessionServiceProvider.js +1 -1
  281. package/dist/react-sdk/web-component/create-web-component.js +1 -1
  282. package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.d.ts +2 -2
  283. package/dist/ui-sdk/responsive-application/responsive-state-store.d.ts +11 -9
  284. package/dist/ui-sdk/responsive-application/use-store-responsive-info.js +1 -1
  285. package/package.json +3 -3
  286. package/dist/configurator/app-loader-content/app-loader-content-name.d.ts +0 -5
  287. package/dist/configurator/app-loader-content/app-loader-content-name.js +0 -1
  288. package/dist/configurator/configuration-not-found-page/create-configuration-not-found-page.js +0 -1
  289. package/dist/configurator/configurator-error-page/create-configurator-error-page.js +0 -1
  290. package/dist/react-sdk/loading-state/LoadingStateProvider.js +0 -1
  291. package/dist/react-sdk/loading-state/loading-state-manager.d.ts +0 -37
  292. package/dist/react-sdk/loading-state/loading-state-manager.js +0 -1
  293. package/dist/react-sdk/responsive-state/ResponsiveStateProvider.d.ts +0 -25
  294. package/dist/react-sdk/responsive-state/ResponsiveStateProvider.js +0 -1
  295. package/dist/react-sdk/responsive-state/canvas-padding.d.ts +0 -14
  296. package/dist/react-sdk/responsive-state/index.d.ts +0 -5
  297. package/dist/react-sdk/responsive-state/index.js +0 -1
  298. package/dist/react-sdk/responsive-state/responsive-state-manager.d.ts +0 -111
  299. package/dist/react-sdk/responsive-state/responsive-state-manager.js +0 -1
  300. package/dist/react-sdk/responsive-state/use-responsive-state-manager.d.ts +0 -10
  301. package/dist/react-sdk/responsive-state/use-responsive-state-manager.js +0 -1
  302. package/dist/react-sdk/responsive-state/use-responsive-state.d.ts +0 -11
  303. package/dist/react-sdk/responsive-state/use-responsive-state.js +0 -1
  304. /package/dist/react-sdk/{elements/configurator-error-page-props.js → application-runtime/host-properties/types.js} +0 -0
  305. /package/dist/react-sdk/{responsive-state/canvas-padding.js → application-runtime/loading/types.js} +0 -0
  306. /package/dist/react-sdk/{elements → page-elements}/configurator-error-page-props.d.ts +0 -0
@@ -1,3 +1,4 @@
1
1
  export { mountApplication,
2
2
  /** @deprecated Use embedded admin in Editor instead */
3
3
  mountStandaloneAdminApplication, mountConfiguratorApplication, mountEmbeddedAdminApplication, mountEmbeddedConfiguratorApplication, embeddedModuleSchema, } from './mount-application.js';
4
+ export { mountConfigurator } from './mount-configurator.js';
@@ -1 +1 @@
1
- export{mountApplication,mountStandaloneAdminApplication,mountConfiguratorApplication,mountEmbeddedAdminApplication,mountEmbeddedConfiguratorApplication,embeddedModuleSchema}from"./mount-application.js";
1
+ export{mountApplication,mountStandaloneAdminApplication,mountConfiguratorApplication,mountEmbeddedAdminApplication,mountEmbeddedConfiguratorApplication,embeddedModuleSchema}from"./mount-application.js";export{mountConfigurator}from"./mount-configurator.js";
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import type { $DomainEntity, ApplicationConfig, DomainEntity } from '#package/domain';
2
+ import { type $DomainEntity, type ApplicationConfig, type DomainEntity } from '#package/domain';
3
3
  export declare const embeddedModuleSchema: z.ZodObject<{
4
4
  default: z.ZodObject<{
5
5
  mount: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodString>;
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{z as t}from"zod";import{Application as n,EmbeddedAdmin as e,StandaloneAdmin as i}from"#package/admin";import{ConfiguratorApp as p,createConfiguratorExtensions as a}from"#package/configurator";import{createApplicationRuntime as m,createWebComponent as r}from"#package/react-sdk";export const embeddedModuleSchema=t.object({default:t.object({mount:t.function().returns(t.string()),config:t.unknown()})});let c=(o,t)=>{customElements.get(o)?console.error(`Web component with tag name "${o}" is already registered.`):customElements.define(o,t)};export const mountApplication=t=>{let e=t.mount.Application?t.mount.Application(t):()=>o(n,{});c(t.mount.tag,r({RootComponent:e,webComponentOptions:t.mount.options,embeddedIntegration:!1,applicationRuntimeFactory:o=>m(t,o,a)}))};export const mountConfiguratorApplication=t=>{let n=t.mount.Application?t.mount.Application(t):()=>o(p,{});c(t.mount.tag,r({RootComponent:n,webComponentOptions:t.mount.options,embeddedIntegration:!1,applicationRuntimeFactory:o=>m(t,o,a)}))};export const mountStandaloneAdminApplication=t=>{c("salsita-admin",r({RootComponent:()=>o(i,{}),webComponentOptions:{},embeddedIntegration:!1,applicationRuntimeFactory:o=>m(t,o,a)}))};export const mountEmbeddedAdminApplication=(t,n,i)=>{c(`salsita-admin-${n}-${i}`,r({RootComponent:()=>o(e,{}),webComponentOptions:{},embeddedIntegration:!0,applicationRuntimeFactory:o=>m(t,o,a)}))};export const mountEmbeddedConfiguratorApplication=(t,n,e)=>{c(`salsita-configurator-${n}-${e}`,r({RootComponent:t.mount.Application?t.mount.Application(t):()=>o(p,{}),webComponentOptions:t.mount.options,embeddedIntegration:!0,applicationRuntimeFactory:o=>m(t,o,a)}))};
1
+ import{jsx as o}from"react/jsx-runtime";import{z as t}from"zod";import{Application as n,EmbeddedAdmin as i,StandaloneAdmin as e}from"#package/admin";import{ConfiguratorApp as p}from"#package/configurator";import{applicationFromConfig as m}from"#package/domain";import{createWebComponent as a}from"#package/react-sdk";import{createMountedApplicationRuntime as r}from"./mounted-application-runtime.js";import{registerWebComponent as c}from"./register-web-component.js";export const embeddedModuleSchema=t.object({default:t.object({mount:t.function().returns(t.string()),config:t.unknown()})});export const mountApplication=t=>{let i=t.mount.Application?t.mount.Application(t):()=>o(n,{});c(t.mount.tag,a({RootComponent:i,webComponentOptions:t.mount.options,embeddedIntegration:!1,applicationRuntimeFactory:o=>r(m(t),o)}))};export const mountConfiguratorApplication=t=>{let n=t.mount.Application?t.mount.Application(t):()=>o(p,{});c(t.mount.tag,a({RootComponent:n,webComponentOptions:t.mount.options,embeddedIntegration:!1,applicationRuntimeFactory:o=>r(m(t),o)}))};export const mountStandaloneAdminApplication=t=>{c("salsita-admin",a({RootComponent:()=>o(e,{}),webComponentOptions:{},embeddedIntegration:!1,applicationRuntimeFactory:o=>r(m(t),o)}))};export const mountEmbeddedAdminApplication=(t,n,e)=>{c(`salsita-admin-${n}-${e}`,a({RootComponent:()=>o(i,{}),webComponentOptions:{},embeddedIntegration:!0,applicationRuntimeFactory:o=>r(m(t),o)}))};export const mountEmbeddedConfiguratorApplication=(t,n,i)=>{c(`salsita-configurator-${n}-${i}`,a({RootComponent:t.mount.Application?t.mount.Application(t):()=>o(p,{}),webComponentOptions:t.mount.options,embeddedIntegration:!0,applicationRuntimeFactory:o=>r(m(t),o)}))};
@@ -0,0 +1,19 @@
1
+ import { type Application } from '#package/domain';
2
+ /**
3
+ * Declares the web component of a configurator application built from its runtime spec
4
+ * (`createApplication` of `@salsita-ai/sdk/application-spec`), with no `ApplicationConfig`.
5
+ *
6
+ * It registers `application.tag`; every `<tag></tag>` element in the DOM renders the configurator
7
+ * in a closed shadow DOM. The web component's properties and events and the wrapper of the
8
+ * application come from the project's `GetWebComponentOptions` and `GetApplicationWrapper` handlers.
9
+ * With `embedded`, the configurator integrates with the page that embeds it, as
10
+ * `mountEmbeddedConfiguratorApplication` does; the embedding host looks for the tag
11
+ * `salsita-configurator-<project slug>-<environment slug>`, which the caller passes to
12
+ * `createApplication` as `tag`.
13
+ *
14
+ * It runs the same runtime as `mountConfiguratorApplication`, which converts its config to an
15
+ * application first.
16
+ */
17
+ export declare const mountConfigurator: <TYPES>(application: Application<TYPES>, options?: {
18
+ readonly embedded?: boolean;
19
+ }) => void;
@@ -0,0 +1 @@
1
+ import{jsx as o}from"react/jsx-runtime";import{ConfiguratorApp as r}from"#package/configurator";import{isGetApplicationWrapperHandler as t,isGetWebComponentOptionsHandler as e}from"#package/domain";import{createWebComponent as n}from"#package/react-sdk";import{createMountedApplicationRuntime as a}from"./mounted-application-runtime.js";import{registerWebComponent as i}from"./register-web-component.js";export const mountConfigurator=(m,p={})=>{let{handlers:d}=m.spec.configurator,c=d.find(t)?.handler().handler,f=d.find(e)?.handler().handler(void 0),s=c?c(m):()=>o(r,{});i(m.tag,n({RootComponent:s,webComponentOptions:f??{},embeddedIntegration:p.embedded??!1,applicationRuntimeFactory:o=>a(m,o)}))};
@@ -0,0 +1,4 @@
1
+ import { type AnyConfiguratorExtensionSystems } from '#package/configurator';
2
+ import type { Application } from '#package/domain';
3
+ import { type ApplicationRuntime, type ApplicationRuntimeBootConfig } from '#package/react-sdk';
4
+ export declare const createMountedApplicationRuntime: (application: Application, bootConfig: ApplicationRuntimeBootConfig) => ApplicationRuntime<AnyConfiguratorExtensionSystems>;
@@ -0,0 +1 @@
1
+ import{createConfiguratorExtensions as o}from"#package/configurator";import{createApplicationRuntime as t}from"#package/react-sdk";export const createMountedApplicationRuntime=(r,a)=>t(r,a,o);
@@ -0,0 +1,2 @@
1
+ /** Defines the custom element of a mounted application, unless its tag is taken. */
2
+ export declare const registerWebComponent: (tag: string, element: CustomElementConstructor) => void;
@@ -0,0 +1 @@
1
+ export const registerWebComponent=(e,t)=>{customElements.get(e)?console.error(`Web component with tag name "${e}" is already registered.`):customElements.define(e,t)};
@@ -40,12 +40,18 @@ Without a lockfile, use the package manager the \`packageManager\` field of \`pa
40
40
  - \`src/components/\` — ECS system components (\`phx.domain.attachComponent.withEntity()\`)
41
41
  - \`src/elements/\` — Page-level React components (\`phx.frontend.createCustomPhoenixLayoutElement()\`)
42
42
  - \`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
43
- - 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
43
+ - 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
44
44
  - 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
45
- - 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
46
- - 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
47
- - 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
48
- - 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
45
+ - 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\`)
46
+ - Undo and redo: \`phx.frontend.useUndoRedo()\` returns \`{ canUndo, canRedo, undo, redo }\`; disable each button from \`canUndo\`/\`canRedo\`
47
+ - 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
48
+ - 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
49
+ - 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
50
+ - 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
51
+ - 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
52
+ - \`ConfigurationNotFoundPage\`: \`phx.frontend.createConfigurationNotFoundPage(({ onBack }) => …)\` 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
53
+ - \`ConfiguratorErrorPage\`: \`phx.frontend.createConfiguratorErrorPage(({ reason, onRetry }) => …)\` 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
54
+ - \`AppLoaderContent\`: \`phx.frontend.createAppLoader(({ phases }) => …)\` replaces what the loading overlay shows (each phase \`{ id, label?, progress? }\`, the list possibly empty); Phoenix keeps the overlay itself
49
55
  - Assistant form elements: an element declared under \`assistant.formElements\` (\`description\`, \`role\`, scalar \`attributes\` beside the built-in \`label\`, a \`value\` included, \`required\`) is the default export \`phx.frontend.createAssistantFormElement('name', Component)\` of one file; the name types the component's props by its role (\`AssistantFormElementProps<'name'>\`): an option reports its answer with \`onSelect(answer)\`, an input with \`onChange(state, answer)\`; and the application does not start while a declared element has no registration or a registration no declaration
50
56
  - \`src/handlers/\` — Event & lifecycle handlers
51
57
  - \`src/webhooks/\` — Server-side webhook handlers (\`phx.webhooks.*Builder\`); the webhook is the default export of \`src/webhooks/index.ts\`, which you create when the project needs its own handlers — without it the build uses a built-in inert webhook that answers only anonymous auth, so create the file before setting \`useAuthHook\` or \`useClerk\`
@@ -1,4 +1,4 @@
1
- export const sdkGuidanceSections={packageManager:"## Package Manager\nThe project installs with its own package manager, and the commands in this skill are written for pnpm. Run them through the package manager the project uses, which the lockfile in the project root names:\n- `pnpm-lock.yaml`: `pnpm phoenix <command>`, `pnpm install`, `pnpm add <package>`\n- `package-lock.json`: `npx phoenix <command>`, `npm install`, `npm install <package>`\n- `yarn.lock`: `yarn phoenix <command>`, `yarn install`, `yarn add <package>`\n- `bun.lock` or `bun.lockb`: `bunx phoenix <command>`, `bun install`, `bun add <package>`\n\nWithout a lockfile, use the package manager the `packageManager` field of `package.json` names, or ask the user.",buildCommands:"## Build Commands\n- `pnpm phoenix build` — Full production build\n- `pnpm phoenix dev` — Development mode with hot reload\n- `pnpm phoenix sync` — Sync generated files without full build\n- `pnpm phoenix deps` — Add the SDK's missing peer dependencies to `package.json` and move out-of-range ones into the SDK's range; it installs nothing, so install after it",devLogs:"## 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)",projectStructure:"## Project Structure\n- `spec/` — Domain YAML specs (entities, relations, expressions, invariants, components, application config)\n- `src/expressions/` — Computed/derived entity properties (`phx.domain.implementCustomExpressions()`)\n- `src/actions/` — Domain operations declared under `actions:` in the spec (`phx.domain.implementActions()`), run by controls and exposed to the assistant\n- `src/invariants/` — Business rule constraints (`phx.domain.implementCustomInvariants()`)\n- `src/transformers/` — Automatic state fixers (`phx.frontend.transformerBuilder`)\n- `src/components/` — ECS system components (`phx.domain.attachComponent.withEntity()`)\n- `src/elements/` — 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 - Assistant form elements: an element declared under `assistant.formElements` (`description`, `role`, scalar `attributes` beside the built-in `label`, a `value` included, `required`) is the default export `phx.frontend.createAssistantFormElement('name', Component)` of one file; the name types the component's props by its role (`AssistantFormElementProps<'name'>`): an option reports its answer with `onSelect(answer)`, an input with `onChange(state, answer)`; and the application does not start while a declared element has no registration or a registration no declaration\n- `src/handlers/` — Event & lifecycle handlers\n- `src/webhooks/` — Server-side webhook handlers (`phx.webhooks.*Builder`); the webhook is the default export of `src/webhooks/index.ts`, which you create when the project needs its own handlers — without it the build uses a built-in inert webhook that answers only anonymous auth, so create the file before setting `useAuthHook` or `useClerk`\n- `src/migrations/` — Schema version migrations (v*.ts)\n- `src/locales/` — Locale catalogs (authored .po sources; compiled .ts, do not edit)\n- `src/admin/` — Admin interface (mirrors main src/ structure)\n- `src/_shared/` — Shared utilities (NOT auto-imported, requires explicit imports)\n- `.phoenix/` — Auto-generated files (DO NOT EDIT, except the option files in `.phoenix/variants/`)\n- `public/` — Static assets (3D models, textures, images, HDRI maps, fonts)\n- `assets/` — Uploadable resources (PDF templates, email assets)",architecturePrinciples:"## 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",keyPatterns:"## Key Patterns\n- Expressions = computed properties on entities (prefix: `$`), implemented per-entity in src/expressions/\n- Actions = named domain operations (`actions:` in YAML with `params` and `result` schemas), implemented in src/actions/, prepared through `actionSystem.prepareAction()` and exposed as assistant mutations through `assistant.actions`\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",fileConventions:`## File Conventions
1
+ export const sdkGuidanceSections={packageManager:"## Package Manager\nThe project installs with its own package manager, and the commands in this skill are written for pnpm. Run them through the package manager the project uses, which the lockfile in the project root names:\n- `pnpm-lock.yaml`: `pnpm phoenix <command>`, `pnpm install`, `pnpm add <package>`\n- `package-lock.json`: `npx phoenix <command>`, `npm install`, `npm install <package>`\n- `yarn.lock`: `yarn phoenix <command>`, `yarn install`, `yarn add <package>`\n- `bun.lock` or `bun.lockb`: `bunx phoenix <command>`, `bun install`, `bun add <package>`\n\nWithout a lockfile, use the package manager the `packageManager` field of `package.json` names, or ask the user.",buildCommands:"## Build Commands\n- `pnpm phoenix build` — Full production build\n- `pnpm phoenix dev` — Development mode with hot reload\n- `pnpm phoenix sync` — Sync generated files without full build\n- `pnpm phoenix deps` — Add the SDK's missing peer dependencies to `package.json` and move out-of-range ones into the SDK's range; it installs nothing, so install after it",devLogs:"## 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)",projectStructure:"## Project Structure\n- `spec/` — Domain YAML specs (entities, relations, expressions, invariants, components, application config)\n- `src/expressions/` — Computed/derived entity properties (`phx.domain.implementCustomExpressions()`)\n- `src/actions/` — Domain operations declared under `actions:` in the spec (`phx.domain.implementActions()`), run by controls and exposed to the assistant\n- `src/invariants/` — Business rule constraints (`phx.domain.implementCustomInvariants()`)\n- `src/transformers/` — Automatic state fixers (`phx.frontend.transformerBuilder`)\n- `src/components/` — ECS system components (`phx.domain.attachComponent.withEntity()`)\n- `src/elements/` — 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 }) => …)` 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 }) => …)` 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 }) => …)` replaces what the loading overlay shows (each phase `{ id, label?, progress? }`, the list possibly empty); Phoenix keeps the overlay itself\n - Assistant form elements: an element declared under `assistant.formElements` (`description`, `role`, scalar `attributes` beside the built-in `label`, a `value` included, `required`) is the default export `phx.frontend.createAssistantFormElement('name', Component)` of one file; the name types the component's props by its role (`AssistantFormElementProps<'name'>`): an option reports its answer with `onSelect(answer)`, an input with `onChange(state, answer)`; and the application does not start while a declared element has no registration or a registration no declaration\n- `src/handlers/` — Event & lifecycle handlers\n- `src/webhooks/` — Server-side webhook handlers (`phx.webhooks.*Builder`); the webhook is the default export of `src/webhooks/index.ts`, which you create when the project needs its own handlers — without it the build uses a built-in inert webhook that answers only anonymous auth, so create the file before setting `useAuthHook` or `useClerk`\n- `src/migrations/` — Schema version migrations (v*.ts)\n- `src/locales/` — Locale catalogs (authored .po sources; compiled .ts, do not edit)\n- `src/admin/` — Admin interface (mirrors main src/ structure)\n- `src/_shared/` — Shared utilities (NOT auto-imported, requires explicit imports)\n- `.phoenix/` — Auto-generated files (DO NOT EDIT, except the option files in `.phoenix/variants/`)\n- `public/` — Static assets (3D models, textures, images, HDRI maps, fonts)\n- `assets/` — Uploadable resources (PDF templates, email assets)",architecturePrinciples:"## 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",keyPatterns:"## Key Patterns\n- Expressions = computed properties on entities (prefix: `$`), implemented per-entity in src/expressions/\n- Actions = named domain operations (`actions:` in YAML with `params` and `result` schemas), implemented in src/actions/, prepared through `actionSystem.prepareAction()` and exposed as assistant mutations through `assistant.actions`\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",fileConventions:`## File Conventions
2
2
  - Components: PascalCase (.tsx)
3
3
  - Utilities: kebab-case (.ts)
4
4
  - Expressions: entity-name.ts
@@ -0,0 +1,25 @@
1
+ import { type EnumLike } from '#package/domain';
2
+ import type { RuntimeSpec } from '../runtime-spec/index.js';
3
+ /**
4
+ * The value of `phx.applicationTypes`: the application's version and published data hash, the JSON
5
+ * schemas of its data (`undefined` for data the spec leaves out), and its state enums.
6
+ */
7
+ export interface PhxApplicationTypes {
8
+ readonly ApplicationVersion: string;
9
+ readonly PublishedDataHash: string;
10
+ readonly PublishedData: unknown;
11
+ readonly SessionData: unknown;
12
+ readonly FrontendData: unknown;
13
+ readonly BackendData: unknown;
14
+ readonly FinalizeData: unknown;
15
+ readonly PrefetchedFinalizeData: unknown;
16
+ readonly FinalizeResult: unknown;
17
+ readonly CallbackData: unknown;
18
+ readonly NavigationState: EnumLike<string>;
19
+ readonly ViewState: EnumLike<string>;
20
+ readonly ToolState: EnumLike<string>;
21
+ readonly ExportState: EnumLike<string>;
22
+ readonly AdminNavigationState: EnumLike<string>;
23
+ }
24
+ /** Builds `phx.applicationTypes` from the spec, with the values generated `domain-spec.ts` writes. */
25
+ export declare const createPhxApplicationTypes: (spec: RuntimeSpec) => PhxApplicationTypes;
@@ -0,0 +1 @@
1
+ import{EnumReflection as a}from"#package/domain";let t=(t,e)=>new a(t,{enum:[...e]});export const createPhxApplicationTypes=a=>{let{dataSchemas:e,states:i}=a.configurator;return{ApplicationVersion:a.appMetadata.applicationVersion,PublishedDataHash:e.publishedDataHash,PublishedData:e.publishedData.runtimeSchema,SessionData:e.sessionData.runtimeSchema,FrontendData:e.frontendData.runtimeSchema,BackendData:e.backendData?.runtimeSchema,FinalizeData:e.finalizeData.runtimeSchema,PrefetchedFinalizeData:e.prefetchedFinalizeData.runtimeSchema,FinalizeResult:e.finalizeResult.runtimeSchema,CallbackData:e.callbackData.runtimeSchema,NavigationState:t("NavigationState",i.navigationStates),ViewState:t("ViewState",i.viewStates),ToolState:t("ToolState",i.toolStates),ExportState:t("ExportState",i.exportStates),AdminNavigationState:t("AdminNavigationState",a.admin.states.navigationStates)}};
@@ -0,0 +1,36 @@
1
+ import type { FactoryDataRuntime } from '../runtime/index.js';
2
+ import type { PhxModel } from './phx-model.js';
3
+ /**
4
+ * The value of `phx.domain`: the reflections and the factories project code writes its expressions,
5
+ * invariants, actions, components and recipes with, and the same for the admin domain under `admin`.
6
+ * The factories carry only the data the spec gives them (aliases, static violations, defaults); their
7
+ * types come from the project's `globals.d.ts`, which declares every member.
8
+ */
9
+ export interface PhxDomain extends PhxModel {
10
+ readonly implementCustomExpressions: unknown;
11
+ readonly implementCustomInvariants: unknown;
12
+ readonly implementActions: unknown;
13
+ readonly createAssistantSetupHandler: unknown;
14
+ readonly attachComponent: unknown;
15
+ readonly createRecipe: unknown;
16
+ readonly admin: PhxModel & {
17
+ readonly implementCustomExpressions: unknown;
18
+ readonly implementCustomInvariants: unknown;
19
+ readonly attachComponent: unknown;
20
+ readonly createMapPublishedRevisionDataHandler: unknown;
21
+ readonly createMapPublishedChunkedDataHandler: unknown;
22
+ readonly createDataRowValidatorHandler: unknown;
23
+ readonly createSheetValidatorHandler: unknown;
24
+ readonly createRecipe: unknown;
25
+ };
26
+ }
27
+ interface PhxDomainInput {
28
+ readonly model: PhxModel;
29
+ readonly factoryData: FactoryDataRuntime;
30
+ }
31
+ /**
32
+ * Builds `phx.domain` from the reflections and the factory data of both domains, with the same
33
+ * factories and the same data generated `domain-spec.ts` passes them.
34
+ */
35
+ export declare const createPhxDomain: (configurator: PhxDomainInput, admin: PhxDomainInput) => PhxDomain;
36
+ export {};
@@ -0,0 +1 @@
1
+ import{DomainComponentOpticBuilder as a,createActionFactory as t,createAssistantSetupHandlerFactory as e,createCustomExpressionFactory as o,createCustomInvariantFactory as i,createDataRowValidatorHandler as s,createMapPublishedChunkedDataHandlerFactory as n,createMapPublishedRevisionDataHandlerFactory as m,createRecipeFactory as r,createSheetValidatorHandler as c}from"#package/domain";let l=a=>r(a.aliases,a.entityReflections,a.defaults);export const createPhxDomain=(r,p)=>({...r.model,implementCustomExpressions:o(),implementCustomInvariants:i()(r.factoryData.staticViolations),implementActions:t(),createAssistantSetupHandler:e(),attachComponent:a.from(r.factoryData.aliases),createRecipe:l(r.factoryData),admin:{...p.model,implementCustomExpressions:o(),implementCustomInvariants:i()(p.factoryData.staticViolations),attachComponent:a.from(p.factoryData.aliases),createMapPublishedRevisionDataHandler:m(),createMapPublishedChunkedDataHandler:n(),createDataRowValidatorHandler:s,createSheetValidatorHandler:c,createRecipe:l(p.factoryData)}});
@@ -0,0 +1,24 @@
1
+ import type { Expressions } from '../../parse-application-files/index.js';
2
+ import type { RuntimeLatestModelVersion } from '../runtime-spec/index.js';
3
+ import type { AdminModelRuntime, ConfiguratorModelRuntime, SpecCodeMap } from '../runtime/index.js';
4
+ /**
5
+ * The reflections of one domain that project code reads from `phx.domain` (or `phx.domain.admin`):
6
+ * `model` holds the entity, alias, common type and shape reflections, `enhancedModel` the enhanced
7
+ * reflection of every entity and alias, named `$<Name>`.
8
+ */
9
+ export interface PhxModel {
10
+ readonly model: Readonly<Record<string, unknown>>;
11
+ readonly enhancedModel: Readonly<Record<string, unknown>>;
12
+ }
13
+ interface PhxModelSpec {
14
+ readonly latestModel: RuntimeLatestModelVersion;
15
+ readonly expressions: Expressions;
16
+ }
17
+ /**
18
+ * Builds the reflections of one domain from its runtime spec and its model runtime. The entity and
19
+ * alias reflections and the enhanced entity reflections are the model runtime's own, so the domain
20
+ * built from the same model runtime validates with the same objects; common types, shapes and
21
+ * enhanced aliases are built here, in the order generated code lists them.
22
+ */
23
+ export declare const createPhxModel: (domainSpec: PhxModelSpec, modelRuntime: ConfiguratorModelRuntime | AdminModelRuntime, code: SpecCodeMap | undefined) => PhxModel;
24
+ export {};
@@ -0,0 +1 @@
1
+ import{EnhancedAliasReflection as e,EnumReflection as t,SchemaReflection as n}from"#package/domain";import{evaluateReflectionConstants as o}from"../runtime/index.js";let r=e=>e,i=(e,o,i)=>{let l,s=r(i);return void 0!==(l=o.enum)&&l.length>0&&l.every(e=>"string"==typeof e)?new t(e,{...s,enum:[...o.enum]}):new n(e,s)};export const createPhxModel=(t,l,s)=>{let a={...l.entities,...l.aliasReflections};for(let[e,n]of t.latestModel.commonTypes)a[String(e)]=i(String(e),n.schema,n.runtimeSchema);for(let e of t.latestModel.shapes.values()){let t=`${String(e.name)}Shape`;a[t]=new n(t,r(e.runtimeSchema))}let m={};for(let[e,t]of Object.entries(l.$entityReflections))m[`$${e}`]=t;for(let[n,r]of t.latestModel.aliases){let i=String(n);m[`$${i}`]=new e(`$${i}`,r.map(String),o(t.expressions,i,s))}return{model:a,enhancedModel:m}};
@@ -0,0 +1,22 @@
1
+ import type { RuntimeReferenceStore } from '../../caching/index.js';
2
+ import type { RuntimeSpec } from '../runtime-spec/index.js';
3
+ import { type SpecCodeModule } from '../runtime/index.js';
4
+ import { type PhxApplicationTypes } from './phx-application-types.js';
5
+ import { type PhxDomain } from './phx-domain.js';
6
+ /** The `phx` values an application's project modules read while they load. */
7
+ export interface Phx {
8
+ readonly domain: PhxDomain;
9
+ readonly applicationTypes: PhxApplicationTypes;
10
+ }
11
+ /**
12
+ * Builds the values of `phx.domain` and `phx.applicationTypes` from an application's runtime spec
13
+ * (`.phoenix/application-spec.json`, decoded with `decodeRuntimeSpec`) and its generated code module
14
+ * (`.phoenix/spec-code.ts`): the model reflections of both domains, and the factories with the
15
+ * static violations, aliases and defaults of the spec.
16
+ *
17
+ * It builds the spec's sections in `referenceStore`. The application's `ApplicationRuntime` is
18
+ * built later in the same store, so `phx.domain.model` holds the reflections the application's
19
+ * domain validates with. It assigns nothing: the generated entry assigns `phx` before it imports
20
+ * the project's modules, because a development server renames the global in project files only.
21
+ */
22
+ export declare const createPhx: (spec: RuntimeSpec, referenceStore: RuntimeReferenceStore, specCode?: SpecCodeModule) => Phx;
@@ -0,0 +1 @@
1
+ import{SpecRuntime as o}from"../runtime/index.js";import{createPhxApplicationTypes as t}from"./phx-application-types.js";import{createPhxDomain as a}from"./phx-domain.js";import{createPhxModel as m}from"./phx-model.js";export const createPhx=(r,i,e)=>{let{configurator:n,admin:p}=o(r,i,e);return{domain:a({model:m(r.configurator,n.modelRuntime,e?.configurator),factoryData:n.factoryDataRuntime},{model:m(r.admin,p.modelRuntime,e?.admin),factoryData:p.factoryDataRuntime}),applicationTypes:t(r)}};
@@ -1,5 +1,7 @@
1
1
  export * from './runtime/sections/index.js';
2
2
  export * from './runtime/application-runtime.js';
3
+ export { applicationSpecSlice, type ApplicationSpecSliceModules } from './runtime/application-spec-slice.js';
4
+ export { type ApplicationModules, createApplication } from './runtime/create-application.js';
3
5
  export * from './runtime/factory-data/index.js';
4
6
  export * from './runtime/migrations/index.js';
5
7
  export { isConfiguratorModelSchemaCompatible } from './runtime/configurator-runtime/configurator-model-runtime.js';
@@ -1 +1 @@
1
- export*from"./runtime/sections/index.js";export*from"./runtime/application-runtime.js";export*from"./runtime/factory-data/index.js";export*from"./runtime/migrations/index.js";export{isConfiguratorModelSchemaCompatible}from"./runtime/configurator-runtime/configurator-model-runtime.js";export*from"./code/index.js";export{generateRuntimeInstance}from"./runtime/generate-runtime-instance.js";
1
+ export*from"./runtime/sections/index.js";export*from"./runtime/application-runtime.js";export{applicationSpecSlice}from"./runtime/application-spec-slice.js";export{createApplication}from"./runtime/create-application.js";export*from"./runtime/factory-data/index.js";export*from"./runtime/migrations/index.js";export{isConfiguratorModelSchemaCompatible}from"./runtime/configurator-runtime/configurator-model-runtime.js";export*from"./code/index.js";export{generateRuntimeInstance}from"./runtime/generate-runtime-instance.js";
@@ -1,8 +1,8 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
2
  import { type $DomainEntity, $DomainEntityReflection, DomainBuilder, type DomainEntity, DomainEntityReflection, RawAliasReflection, SchemaReflection } from '#package/domain';
3
3
  import type { RuntimeReferenceStore } from '../../../caching/index.js';
4
- import type { DataSchemas, Expressions } from '../../../parse-application-files/index.js';
5
- import type { RuntimeModelVersion, RuntimeResolvedVersions } from '../../runtime-spec/index.js';
4
+ import type { Expressions } from '../../../parse-application-files/index.js';
5
+ import type { RuntimeDataSchemas, RuntimeModelVersion, RuntimeResolvedVersions } from '../../runtime-spec/index.js';
6
6
  import type { SpecCodeMap } from '../spec-code/index.js';
7
7
  type AnyEntity = DomainEntity<string>;
8
8
  type AnyAliases = Record<string, AnyEntity>;
@@ -26,5 +26,5 @@ interface AdminModelRuntimeFields {
26
26
  readonly schemaChanged: boolean;
27
27
  }
28
28
  export type AdminModelRuntime = Branded<'AdminModelRuntime', AdminModelRuntimeFields>;
29
- export declare const AdminModelRuntime: (domainSpec: AdminModelRuntimeSpec, dataSchemas: DataSchemas, referenceStore: RuntimeReferenceStore, code: SpecCodeMap | undefined) => AdminModelRuntime;
29
+ export declare const AdminModelRuntime: (domainSpec: AdminModelRuntimeSpec, dataSchemas: RuntimeDataSchemas, referenceStore: RuntimeReferenceStore, code: SpecCodeMap | undefined) => AdminModelRuntime;
30
30
  export {};
@@ -1,13 +1,14 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
+ import { type ImplementationErrorCollector, type ProjectModule } from '#package/domain';
2
3
  import type { RuntimeReferenceStore } from '../../../caching/index.js';
3
4
  import type { RuntimeSpec } from '../../runtime-spec/index.js';
4
- import { FactoryDataRuntime } from '../factory-data/index.js';
5
+ import type { FactoryDataRuntime } from '../factory-data/index.js';
5
6
  import { type MigrationModules, MigrationRuntime } from '../migrations/index.js';
6
7
  import { ComponentOptics } from '../sections/component-optic.js';
7
- import { type ExpressionImplementations, ExpressionRuntime, type InvariantImplementations, type MissingExpression } from '../sections/expression-runtime.js';
8
+ import { ExpressionRuntime, type InvariantImplementations, type MissingExpression } from '../sections/expression-runtime.js';
8
9
  import { PresetRuntime } from '../sections/preset-runtime.js';
9
10
  import type { SpecCodeMap } from '../spec-code/index.js';
10
- import { AdminModelRuntime } from './admin-model-runtime.js';
11
+ import type { AdminModelRuntime } from './admin-model-runtime.js';
11
12
  import { AdminStatesRuntime } from './states-runtime.js';
12
13
  export type AdminRuntime = Branded<'AdminRuntime', {
13
14
  readonly modelRuntime: AdminModelRuntime;
@@ -24,5 +25,7 @@ export type AdminRuntimeResult = {
24
25
  } | {
25
26
  readonly ok: false;
26
27
  readonly missingExpressions: readonly MissingExpression[];
28
+ /** The migrations the migration modules do not export, as `migrationRuntime.missingMigrations` lists them. */
29
+ readonly missingMigrations: readonly string[];
27
30
  };
28
- export declare const AdminRuntime: (spec: RuntimeSpec, referenceStore: RuntimeReferenceStore, implementations: ExpressionImplementations, invariantImplementations: InvariantImplementations, migrationModules: MigrationModules, code: SpecCodeMap | undefined) => AdminRuntimeResult;
31
+ export declare const AdminRuntime: (spec: RuntimeSpec, referenceStore: RuntimeReferenceStore, expressionModules: readonly ProjectModule[], invariantImplementations: InvariantImplementations, migrationModules: MigrationModules, code: SpecCodeMap | undefined, errors: ImplementationErrorCollector) => AdminRuntimeResult;
@@ -1 +1 @@
1
- import{Branded as e}from"@salsita-ai/common/utils";import{Preset as t,PresetCategory as i,commonAdminCustomExpressions as n,commonAdminViolationExpressions as r}from"#package/domain";import{FactoryDataRuntime as s}from"../factory-data/index.js";import{MigrationRuntime as o}from"../migrations/index.js";import{ComponentOptics as m}from"../sections/component-optic.js";import{ExpressionRuntime as a}from"../sections/expression-runtime.js";import{PresetRuntime as p}from"../sections/preset-runtime.js";import{AdminModelRuntime as f}from"./admin-model-runtime.js";import{AdminStatesRuntime as u}from"./states-runtime.js";let c={Preset:[{evaluate:(e,i,n)=>{let s=n.domain.get$Entity(e,i);return t.assert(s),r.Preset.nameNotEmpty(s)}}]},l={PresetCategory:{$isDraft:{origin:{name:"$isDraft",typeOrAlias:"PresetCategory"},evaluate:(e,t,r)=>{let s=r.domain.get$Entity(e,t);return i.assert(s),n.PresetCategory.$isDraft(s)},meta:{}}}},d=new WeakMap;export const AdminRuntime=(t,i,n,r,g,R)=>{let y={...l};for(let[e,t]of Object.entries(n))y[e]={...y[e],...t};let j=f(t.admin,t.configurator.dataSchemas,i,R),k=a(t.admin,i,y,"adminExpressionRuntime",((e,t)=>{if(0===Object.keys(e).length)return c;let i=d.get(t)??new WeakMap;d.set(t,i);let n=i.get(e);if(n)return n;let r={};for(let i of[c,e])for(let[e,n]of Object.entries(i))for(let i of t[e]??[e])r[i]=[...r[i]??[],...n];return i.set(e,r),r})(r,j.aliases),R);return k.ok?{ok:!0,runtime:e({modelRuntime:j,componentOptics:m(i,{components:t.admin.components,referenceScope:"adminRuntime/componentOptics",modelRuntime:j,code:R}),expressionRuntime:k.runtime,presetRuntime:p(i,{referenceScope:"adminRuntime/presetRuntime",presets:t.admin.presets.presets}),statesRuntime:u(t,i),migrationRuntime:o(i,{referenceScope:"adminRuntime/migrationRuntime",resolvedVersions:t.admin.resolvedVersions,latestEntities:j.entities,migrationModules:g}),factoryDataRuntime:s(i,{referenceScope:"adminRuntime/factoryDataRuntime",invariants:t.admin.invariants,defaults:t.admin.defaults,aliases:j.aliases,entities:j.entities})})}:{ok:!1,missingExpressions:k.missing}};
1
+ import{Branded as e}from"@salsita-ai/common/utils";import{Preset as t,PresetCategory as i,commonAdminCustomExpressions as s,commonAdminViolationExpressions as n}from"#package/domain";import{MigrationRuntime as r}from"../migrations/index.js";import{ComponentOptics as o}from"../sections/component-optic.js";import{ExpressionRuntime as m}from"../sections/expression-runtime.js";import{PresetRuntime as a}from"../sections/preset-runtime.js";import{AdminSpecRuntime as p}from"./admin-spec-runtime.js";import{AdminStatesRuntime as u}from"./states-runtime.js";let c={Preset:[{evaluate:(e,i,s)=>{let r=s.domain.get$Entity(e,i);return t.assert(r),n.Preset.nameNotEmpty(r)}}]},f={PresetCategory:{$isDraft:{origin:{name:"$isDraft",typeOrAlias:"PresetCategory"},evaluate:(e,t,n)=>{let r=n.domain.get$Entity(e,t);return i.assert(r),s.PresetCategory.$isDraft(r)},meta:{}}}},l=new WeakMap;export const AdminRuntime=(t,i,s,n,g,d,R)=>{let{modelRuntime:j,factoryDataRuntime:y}=p(t,i,d),k=m(t.admin,i,s,"adminExpressionRuntime",((e,t)=>{if(0===Object.keys(e).length)return c;let i=l.get(t)??new WeakMap;l.set(t,i);let s=i.get(e);if(s)return s;let n={};for(let i of[c,e])for(let[e,s]of Object.entries(i))for(let i of t[e]??[e])n[i]=[...n[i]??[],...s];return i.set(e,n),n})(n,j.aliases),d,R,f),x=r(i,{referenceScope:"adminRuntime/migrationRuntime",resolvedVersions:t.admin.resolvedVersions,latestEntities:j.entities,migrationModules:g});return k.ok?{ok:!0,runtime:e({modelRuntime:j,componentOptics:o(i,{components:t.admin.components,referenceScope:"adminRuntime/componentOptics",modelRuntime:j,code:d}),expressionRuntime:k.runtime,presetRuntime:a(i,{referenceScope:"adminRuntime/presetRuntime",presets:t.admin.presets.presets}),statesRuntime:u(t,i),migrationRuntime:x,factoryDataRuntime:y})}:{ok:!1,missingExpressions:k.missing,missingMigrations:x.missingMigrations}};
@@ -0,0 +1,16 @@
1
+ import { Branded } from '@salsita-ai/common/utils';
2
+ import type { RuntimeReferenceStore } from '../../../caching/index.js';
3
+ import type { RuntimeSpec } from '../../runtime-spec/index.js';
4
+ import { FactoryDataRuntime } from '../factory-data/index.js';
5
+ import type { SpecCodeMap } from '../spec-code/index.js';
6
+ import { AdminModelRuntime } from './admin-model-runtime.js';
7
+ /**
8
+ * The sections of the admin domain that the spec alone determines: its model and the data of its
9
+ * `phx.domain.admin` factories. `AdminRuntime` builds its own from this function, so a build of
10
+ * either in the same reference store returns the same objects.
11
+ */
12
+ export type AdminSpecRuntime = Branded<'AdminSpecRuntime', {
13
+ readonly modelRuntime: AdminModelRuntime;
14
+ readonly factoryDataRuntime: FactoryDataRuntime;
15
+ }>;
16
+ export declare const AdminSpecRuntime: (spec: RuntimeSpec, referenceStore: RuntimeReferenceStore, code: SpecCodeMap | undefined) => AdminSpecRuntime;
@@ -0,0 +1 @@
1
+ import{Branded as a}from"@salsita-ai/common/utils";import{FactoryDataRuntime as t}from"../factory-data/index.js";import{AdminModelRuntime as i}from"./admin-model-runtime.js";export const AdminSpecRuntime=(e,n,m)=>{let r=i(e.admin,e.configurator.dataSchemas,n,m);return a({modelRuntime:r,factoryDataRuntime:t(n,{referenceScope:"adminRuntime/factoryDataRuntime",invariants:e.admin.invariants,defaults:e.admin.defaults,aliases:r.aliases,entities:r.entities})})};
@@ -1,12 +1,12 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
- import type { ImportedTransformer } from '#package/domain';
2
+ import { type ImplementationErrorCollector, type ImportedTransformer, type ProjectModule } from '#package/domain';
3
3
  import type { RuntimeReferenceStore } from '../../caching/index.js';
4
4
  import type { RuntimeSpec } from '../runtime-spec/index.js';
5
5
  import { AdminRuntime } from './admin-runtime/admin-runtime.js';
6
6
  import { ConfiguratorRuntime } from './configurator-runtime/configurator-runtime.js';
7
7
  import type { MigrationModules } from './migrations/index.js';
8
8
  import { DataRuntime } from './sections/data-runtime.js';
9
- import type { ExpressionImplementations, InvariantImplementations, MissingExpression } from './sections/expression-runtime.js';
9
+ import type { InvariantImplementations, MissingExpression } from './sections/expression-runtime.js';
10
10
  import type { SpecCodeModule } from './spec-code/index.js';
11
11
  /**
12
12
  * Runtime objects built from a RuntimeSpec.
@@ -23,6 +23,11 @@ export type ApplicationRuntimeResult = {
23
23
  } | {
24
24
  readonly ok: false;
25
25
  readonly missingExpressions: readonly MissingExpression[];
26
+ /**
27
+ * The migrations of both domains the migration modules do not export, which a built
28
+ * runtime lists in `migrationRuntime.missingMigrations` of each domain.
29
+ */
30
+ readonly missingMigrations: readonly string[];
26
31
  };
27
32
  /**
28
33
  * Builds an ApplicationRuntime from a RuntimeSpec: the part of the parsed spec the runtime reads, which a
@@ -42,6 +47,14 @@ export type ApplicationRuntimeResult = {
42
47
  * same generation as `spec`; an id carries a hash of its code, so a module from another generation
43
48
  * misses the ids of changed code instead of running an old closure.
44
49
  *
45
- * Returns an error result when declared expressions are missing implementations.
50
+ * `expressionModules` and `adminExpressionModules` are the project's expression files
51
+ * (`src/expressions/`, `src/admin/expressions/`), as the generated barrels or the editor's reload
52
+ * hand them over; each domain merges them with the aliases of its spec (`mergeExpressionModules`).
53
+ *
54
+ * The mistakes of the project files are recorded in `errors` as `ImplementationError`s: a file with
55
+ * the wrong export, an expression two files define, or that a file defines although the spec or the
56
+ * SDK gives it a value (`DUPLICATE_DEFINITION`), and a declared expression no file implements
57
+ * (`MISSING_IMPLEMENTATION`), which also makes the result an error. Without `errors`, everything
58
+ * recorded is thrown together as one `ImplementationErrors` before the result is returned.
46
59
  */
47
- export declare const ApplicationRuntime: (spec: RuntimeSpec, referenceStore: RuntimeReferenceStore, implementations: ExpressionImplementations, importedTransformers: readonly ImportedTransformer[], invariantImplementations?: InvariantImplementations, adminImplementations?: ExpressionImplementations, adminInvariantImplementations?: InvariantImplementations, migrationModules?: MigrationModules, specCode?: SpecCodeModule) => ApplicationRuntimeResult;
60
+ export declare const ApplicationRuntime: (spec: RuntimeSpec, referenceStore: RuntimeReferenceStore, expressionModules: readonly ProjectModule[], importedTransformers: readonly ImportedTransformer[], invariantImplementations?: InvariantImplementations, adminExpressionModules?: readonly ProjectModule[], adminInvariantImplementations?: InvariantImplementations, migrationModules?: MigrationModules, specCode?: SpecCodeModule, errors?: ImplementationErrorCollector) => ApplicationRuntimeResult;
@@ -1 +1 @@
1
- import{Branded as i}from"@salsita-ai/common/utils";import{AdminRuntime as r}from"./admin-runtime/admin-runtime.js";import{ConfiguratorRuntime as n}from"./configurator-runtime/configurator-runtime.js";import{DataRuntime as o}from"./sections/data-runtime.js";export const ApplicationRuntime=(s,t,m,e,a,u={},p={},f={},c)=>{let g=n(s,t,m,e,a,f,c?.configurator);if(!g.ok)return{ok:!1,missingExpressions:g.missingExpressions};let d=r(s,t,u,p,f,c?.admin);return d.ok?{ok:!0,runtime:i({configurator:g.runtime,admin:d.runtime,data:o(s,t)})}:{ok:!1,missingExpressions:d.missingExpressions}};
1
+ import{Branded as i}from"@salsita-ai/common/utils";import{createImplementationErrorCollector as n}from"#package/domain";import{AdminRuntime as o}from"./admin-runtime/admin-runtime.js";import{ConfiguratorRuntime as r}from"./configurator-runtime/configurator-runtime.js";import{DataRuntime as m}from"./sections/data-runtime.js";export const ApplicationRuntime=(t,s,a,e,g,u=[],p={},f={},c,k)=>{let d=k??n(),M=r(t,s,a,e,g,f,c?.configurator,d),l=o(t,s,u,p,f,c?.admin,d);return(void 0===k&&d.throwIfAny(),M.ok&&l.ok)?{ok:!0,runtime:i({configurator:M.runtime,admin:l.runtime,data:m(t,s)})}:{ok:!1,missingExpressions:[...M.ok?[]:M.missingExpressions,...l.ok?[]:l.missingExpressions],missingMigrations:[...M.ok?M.runtime.migrationRuntime.missingMigrations:M.missingMigrations,...l.ok?l.runtime.migrationRuntime.missingMigrations:l.missingMigrations]}};
@@ -0,0 +1,71 @@
1
+ import { type AnyActionImplementations, type AnyDomainComponentOptic, type ApplicationConfiguratorSpec, type ElementRegistration, type HandlerRegistration, type ApplicationSpec as RuntimeApplicationSpec } from '#package/domain';
2
+ import type { RuntimeSpec } from '../runtime-spec/index.js';
3
+ import type { ApplicationRuntime } from './application-runtime.js';
4
+ type Theme = ApplicationConfiguratorSpec['theme'];
5
+ /**
6
+ * The theme presets of the SDK by name, as `getPhoenixThemes()` returns them. The caller passes
7
+ * them, because `application-spec` does not depend on the UI package that defines them.
8
+ */
9
+ export type ThemePresets = Readonly<Record<string, Theme>>;
10
+ /**
11
+ * The project modules of an application's spec slice, checked and flattened: `handlers` and
12
+ * `elements` with the content hash of each registration (the remount key of a registration whose
13
+ * file changed), the component optics of `src/components/` and the action implementations of
14
+ * `src/actions/`.
15
+ *
16
+ * A `null` keeps the previous spec's value: the editor passes it for a kind of file that did not
17
+ * change since the last update.
18
+ */
19
+ export interface ApplicationSpecSliceModules {
20
+ readonly handlers: {
21
+ readonly handlers: ReadonlyArray<HandlerRegistration<any, any>>;
22
+ readonly nameHashes?: Readonly<Record<string, string>>;
23
+ } | null;
24
+ readonly elements: {
25
+ readonly elements: readonly ElementRegistration[];
26
+ readonly nameHashes?: Readonly<Record<string, string>>;
27
+ } | null;
28
+ readonly customComponentOptics: readonly AnyDomainComponentOptic[] | null;
29
+ readonly actionImplementations: AnyActionImplementations | null;
30
+ }
31
+ interface SliceInput {
32
+ readonly runtime: ApplicationRuntime;
33
+ readonly modules: ApplicationSpecSliceModules;
34
+ readonly themePresets: ThemePresets;
35
+ }
36
+ /**
37
+ * The first spec slice of an application: every section is built from `runtime`, `spec` and the
38
+ * modules. `initialPublishedData` is empty; the caller computes it with a domain runtime of this
39
+ * slice and puts it in.
40
+ */
41
+ export interface ApplicationSpecStart extends SliceInput {
42
+ readonly previous?: undefined;
43
+ readonly spec: RuntimeSpec;
44
+ /** The component optics of `src/admin/components/`. */
45
+ readonly customAdminComponentOptics: readonly AnyDomainComponentOptic[];
46
+ /** The SDK's default elements of the application kind; a project element with the same name replaces one. */
47
+ readonly defaultElements: readonly ElementRegistration[];
48
+ /** The resources URL of the environment, used when the spec sets no `baseResourcesUrl`. */
49
+ readonly environmentResourcesUrl: string | undefined;
50
+ }
51
+ /**
52
+ * A rebuild of a running application's spec slice, as the editor makes it when the project
53
+ * changes. Only the configurator sections are rebuilt; a section whose runtime did not change, and
54
+ * a kind of module given as `null`, keeps its object from `previous`, so selectors over it stay
55
+ * memoized. With `model: 'keep'` the domain factory and the model-owned fields stay too (the
56
+ * schema of the model is unchanged); with `model: 'rebuild'` they are built from `runtime`.
57
+ */
58
+ export interface ApplicationSpecUpdate extends SliceInput {
59
+ readonly previous: RuntimeApplicationSpec;
60
+ readonly model: 'keep' | 'rebuild';
61
+ }
62
+ /** The component optics a project file contributes, as opposed to those the spec generates. */
63
+ export declare const customComponentOpticsOf: (componentOptics: readonly AnyDomainComponentOptic[]) => AnyDomainComponentOptic[];
64
+ /**
65
+ * Maps an application's runtime (`ApplicationRuntime`, built with the project's modules) and its
66
+ * checked modules onto the spec slice of the domain runtime, the one input of every mounted
67
+ * application: an application's first slice, which `createApplication` builds with it, or the
68
+ * editor's rebuild after a change of the project.
69
+ */
70
+ export declare const applicationSpecSlice: (input: ApplicationSpecStart | ApplicationSpecUpdate) => RuntimeApplicationSpec;
71
+ export {};
@@ -0,0 +1 @@
1
+ import{resolveImportedTransformers as e}from"#package/domain";export const customComponentOpticsOf=e=>e.filter(e=>!0!==e.generated);let t=(t,n)=>{let{runtime:s,modules:a,themePresets:i}=t,{configurator:o}=s,r=(e,t,s)=>e||void 0===n?t():s(n),l=a.handlers?.handlers??n?.handlers??[],m=a.handlers||void 0===n?((e,t,n)=>{let s={};for(let a of e)s[a.name]=t?.[a.name]??n?.[a.name]??a.name;return s})(l,a.handlers?.nameHashes,n?.handlerHashes):n.handlerHashes,c=a.elements?.elements??n?.elements??[],p=a.elements||void 0===n?((e,t,n)=>{let s={},a=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:${a}`;s[e]=t?.[e]??n?.[e]??`${e}:${i.elements.length}`,a+=1}return s})(c,a.elements?.nameHashes,n?.elementHashes):n.elementHashes,d=a.customComponentOptics??customComponentOpticsOf(n?.componentOptics??[]),u=r(o.componentOptics.changed||null!==a.customComponentOptics,()=>[...o.componentOptics.optics.map(e=>e.optic),...d],e=>e.componentOptics),{importedTransformers:h,specTransformers:g}=o.transformersRuntime;return{presets:r(o.presetRuntime.changed,()=>o.presetRuntime.presets,e=>e.presets),theme:r(o.themeRuntime.changed,()=>{var e;let t;return t=(Object.hasOwn(i,(e=o.themeRuntime).preset)?i[e.preset]:{})??{},Object.keys(e.options).length>0?{...t,...e.options}:t},e=>e.theme),assistant:r(o.assistantRuntime.changed,()=>o.assistantRuntime.assistant,e=>e.assistant),navigationStates:r(o.statesRuntime.changed,()=>o.statesRuntime.navigationStates,e=>e.navigationStates),viewStates:r(o.statesRuntime.changed,()=>o.statesRuntime.viewStates,e=>e.viewStates),toolStates:r(o.statesRuntime.changed,()=>o.statesRuntime.toolStates,e=>e.toolStates),exportStates:r(o.statesRuntime.changed,()=>o.statesRuntime.exportStates,e=>e.exportStates),componentOptics:u,createTransformers:r(o.transformersRuntime.changed,()=>t=>e(h,g,t),e=>e.createTransformers),handlers:l,handlerHashes:m,elements:c,elementHashes:p}},n=(e,t,n)=>{let{modelRuntime:s,expressionRuntime:a,actionsRuntime:i,migrationRuntime:o}=e.configurator,r=s.domainBuilder.withExpressions(a.merged).withActions(Object.values(i.definitions)).withActionImplementations(t),l=(n?r.withMigrate(o.migrate):r).build();return{modelVersion:l.context.modelVersion,factory:l,aliasMap:l.context.aliasMap,entityReflections:l.context.entityReflections,$entityReflections:l.context.$entityReflections,allowedRootEntityTypes:l.context.allowedRootEntityTypes,migrate:l.context.migrate}};export const applicationSpecSlice=e=>void 0===e.previous?(e=>{let{runtime:s,spec:a}=e,i=(e=>{let{runtime:s,modules:a,spec:i,defaultElements:o}=e,{expressionRuntime:r,actionsRuntime:l}=s.configurator,{ui:m}=i.configurator,c=i.infra.resourcesConfig,p=a.actionImplementations??{};return{...t(e,void 0),...n(s,p,!0),expressions:r.merged,actions:l.definitions,actionImplementations:p,defaultElements:o,appLoader:m.appLoader??"universal",preview:m.preview??"auto",alwaysExpand:m.alwaysExpand??!1,deploymentQueryDisabled:c?.deploymentQueryDisabled??!1,prefetchTextureUrls:c?.prefetchTextureUrls??[]}})(e),o=a.configurator.ui.textLanguages;return{version:a.appMetadata.applicationVersion,dataConfig:s.data.dataSpec,chunks:s.data.chunks,publishedDataHash:s.data.publishedDataHash,initialPublishedData:{},canCreate:[...a.infra.acl.canCreate],enableAdminRelease:a.appMetadata.enableAdminRelease,textLanguages:o&&o.length>0?o:["en"],baseResourcesUrl:a.infra.resourcesConfig?.baseResourcesUrl??e.environmentResourcesUrl??"",configurator:i,admin:((e,t)=>{let{modelRuntime:n,expressionRuntime:s,migrationRuntime:a,presetRuntime:i,componentOptics:o,statesRuntime:r}=e.runtime.admin,[l]=i.presets;if(void 0===l)throw Error("Cannot register application spec because admin preset is required.");let m=n.domainBuilder.withExpressions(s.merged).withMigrate(a.migrate).build();return{factory:m,modelVersion:m.modelVersion,aliasMap:m.context.aliasMap,entityReflections:m.context.entityReflections,$entityReflections:m.context.$entityReflections,expressions:m.context.expressions,actions:m.context.actions,actionImplementations:m.context.actionImplementations,allowedRootEntityTypes:m.context.allowedRootEntityTypes,migrate:m.context.migrate,preset:l,componentOptics:[...o.optics.map(e=>e.optic),...e.customAdminComponentOptics],navigationStates:r.navigationStates,viewStates:[],handlers:t.handlers,handlerHashes:t.handlerHashes,elements:t.elements,elementHashes:t.elementHashes}})(e,i)}})(e):{...e.previous,configurator:(e=>{let{runtime:s,modules:a,previous:i,model:o}=e,r=i.configurator,{expressionRuntime:l,actionsRuntime:m}=s.configurator,c=t(e,r),p=a.actionImplementations??r.actionImplementations;return"keep"===o?{...r,...c,expressions:l.changed?l.merged:r.expressions,actions:m.changed?m.definitions:r.actions,actionImplementations:p}:{...r,...c,...n(s,p,!1),expressions:l.merged,actions:m.definitions,actionImplementations:p}})(e)};
@@ -1,8 +1,8 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
2
  import { type $DomainEntity, $DomainEntityReflection, DomainBuilder, type DomainEntity, DomainEntityReflection, RawAliasReflection, SchemaReflection } from '#package/domain';
3
3
  import type { RuntimeReferenceStore } from '../../../caching/index.js';
4
- import type { DataSchemas, Expressions } from '../../../parse-application-files/index.js';
5
- import type { RuntimeModelVersion, RuntimeResolvedVersions } from '../../runtime-spec/index.js';
4
+ import type { Expressions } from '../../../parse-application-files/index.js';
5
+ import type { RuntimeDataSchemas, RuntimeModelVersion, RuntimeResolvedVersions } from '../../runtime-spec/index.js';
6
6
  import type { SpecCodeMap } from '../spec-code/index.js';
7
7
  type AnyEntity = DomainEntity<string>;
8
8
  type AnyAliases = Record<string, AnyEntity>;
@@ -10,7 +10,7 @@ type AnyData = Record<string, unknown>;
10
10
  type Any$Map = Record<AnyEntity['type'], $DomainEntity<AnyEntity>>;
11
11
  type AnyDomainBuilder = DomainBuilder<AnyEntity, AnyEntity, AnyAliases, Any$Map, AnyData, AnyData, AnyData>;
12
12
  interface ConfiguratorModelRuntimeSpec {
13
- readonly dataSchemas: DataSchemas;
13
+ readonly dataSchemas: RuntimeDataSchemas;
14
14
  readonly expressions: Expressions;
15
15
  readonly latestModel: RuntimeModelVersion;
16
16
  readonly resolvedVersions: RuntimeResolvedVersions;