@salsita-ai/sdk 0.50.0-develop.10b1931917 → 0.50.0-develop.1162eef277

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 (279) hide show
  1. package/README.md +11 -11
  2. package/dist/application-spec/generate-application/code/common/index.d.ts +1 -0
  3. package/dist/application-spec/generate-application/code/common/index.js +1 -1
  4. package/dist/application-spec/generate-application/code/common/project-module-list.d.ts +8 -0
  5. package/dist/application-spec/generate-application/code/common/project-module-list.js +3 -0
  6. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  7. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  8. package/dist/application-spec/generate-application/code/templates/admin-domain-code.d.ts +1 -2
  9. package/dist/application-spec/generate-application/code/templates/admin-domain-code.js +6 -14
  10. package/dist/application-spec/generate-application/code/templates/admin-frontend-code.d.ts +1 -2
  11. package/dist/application-spec/generate-application/code/templates/admin-frontend-code.js +4 -4
  12. package/dist/application-spec/generate-application/code/templates/configurator-domain-code.d.ts +1 -2
  13. package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js +7 -16
  14. package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.d.ts +1 -2
  15. package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.js +7 -9
  16. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.d.ts +2 -2
  17. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.js +1 -1
  18. package/dist/application-spec/generate-application/code/templates/domain-spec.js +4 -4
  19. package/dist/application-spec/generate-application/code/templates/domain.js +3 -3
  20. package/dist/application-spec/generate-application/code/templates/index.d.ts +1 -0
  21. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  22. package/dist/application-spec/generate-application/code/templates/skills/agents-md.js +1 -1
  23. package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -1
  24. package/dist/application-spec/generate-application/code/templates/skills/phoenix-create-configurator-skill.js +43 -13
  25. package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +39 -16
  26. package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +2 -2
  27. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  28. package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.d.ts +1 -0
  29. package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.js +6 -0
  30. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +30 -3
  31. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +19 -5
  32. package/dist/application-spec/generate-application/code/templates/webhook-builders.js +8 -4
  33. package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.d.ts +4 -3
  34. package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.js +1 -1
  35. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.d.ts +3 -8
  36. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.js +1 -1
  37. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +9 -43
  38. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  39. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-server-settings.d.ts +2 -2
  40. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant.d.ts +5 -21
  41. package/dist/client/phoenix-api.d.ts +58 -30
  42. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  43. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +158 -13
  44. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  45. package/dist/configurator/application-runtime/extensions/systems/assistant-system/change-recorder.d.ts +85 -0
  46. package/dist/configurator/application-runtime/extensions/systems/assistant-system/change-recorder.js +1 -0
  47. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +8 -3
  48. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  49. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +4 -0
  50. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  51. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +16 -1
  52. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  53. package/dist/configurator/application-runtime/extensions/systems/graphql-system/side-effects.d.ts +9 -0
  54. package/dist/configurator/application-runtime/extensions/systems/graphql-system/side-effects.js +1 -0
  55. package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -1
  56. package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.d.ts +2 -0
  57. package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.js +1 -1
  58. package/dist/configurator/common/frontend-analytics.d.ts +21 -21
  59. package/dist/configurator/index.d.ts +0 -1
  60. package/dist/configurator/index.js +1 -1
  61. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  62. package/dist/configurator/scene/scene-analytics/scene-analytics.d.ts +2 -2
  63. package/dist/configurator/ui/assistant/AssistantChips.d.ts +11 -0
  64. package/dist/configurator/ui/assistant/AssistantChips.js +1 -0
  65. package/dist/configurator/ui/assistant/AssistantComposer.d.ts +6 -0
  66. package/dist/configurator/ui/assistant/AssistantComposer.js +1 -0
  67. package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +7 -0
  68. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -0
  69. package/dist/configurator/ui/assistant/AssistantPanel.d.ts +11 -0
  70. package/dist/configurator/ui/assistant/AssistantPanel.js +1 -0
  71. package/dist/configurator/ui/assistant/AssistantThread.d.ts +6 -0
  72. package/dist/configurator/ui/assistant/AssistantThread.js +1 -0
  73. package/dist/configurator/ui/assistant/assistant-failure.d.ts +18 -0
  74. package/dist/configurator/ui/assistant/assistant-failure.js +1 -0
  75. package/dist/configurator/ui/assistant/index.d.ts +2 -0
  76. package/dist/configurator/ui/assistant/index.js +1 -0
  77. package/dist/configurator/ui/assistant/streamed-markdown.d.ts +6 -0
  78. package/dist/configurator/ui/assistant/streamed-markdown.js +2 -0
  79. package/dist/configurator/ui/assistant/theme.d.ts +2 -0
  80. package/dist/configurator/ui/assistant/theme.js +1 -0
  81. package/dist/configurator/ui/assistant/thread-items.d.ts +37 -0
  82. package/dist/configurator/ui/assistant/thread-items.js +1 -0
  83. package/dist/configurator/ui/assistant/tool-chip.d.ts +44 -0
  84. package/dist/configurator/ui/assistant/tool-chip.js +1 -0
  85. package/dist/configurator/ui/assistant/use-follow-stream.d.ts +17 -0
  86. package/dist/configurator/ui/assistant/use-follow-stream.js +1 -0
  87. package/dist/configurator/ui/assistant/use-is-assistant-panel-open.d.ts +5 -0
  88. package/dist/configurator/ui/assistant/use-is-assistant-panel-open.js +1 -0
  89. package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.js +5 -5
  90. package/dist/configurator/ui/configurator-layout/universal/MobileLayout.d.ts +2 -0
  91. package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +4 -4
  92. package/dist/configurator/ui/legacy/mobile-controls/MobileControls.d.ts +1 -1
  93. package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.d.ts +10 -0
  94. package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -0
  95. package/dist/configurator/ui/phoenix-layout-elements/index.d.ts +1 -0
  96. package/dist/configurator/ui/phoenix-layout-elements/index.js +1 -1
  97. package/dist/docs/complex-use-cases/filtered-controls-with-fix-dialog.mdx +84 -98
  98. package/dist/docs/complex-use-cases/navigation-reset-selection.mdx +18 -12
  99. package/dist/docs/index.json +1 -1
  100. package/dist/docs/layouts/custom-price.mdx +14 -16
  101. package/dist/docs/layouts/sidebar/tabs.mdx +24 -21
  102. package/dist/docs/layouts/toolbar.mdx +6 -0
  103. package/dist/docs/other-features/domain-actions.mdx +1 -1
  104. package/dist/docs/other-features/side-effects.mdx +68 -34
  105. package/dist/docs/other-features/transformers.mdx +1 -1
  106. package/dist/docs/phoenix/admin.mdx +11 -26
  107. package/dist/docs/phoenix/finalization.mdx +1 -1
  108. package/dist/docs/phoenix/integration/headless-mode-external.mdx +5 -5
  109. package/dist/docs/phoenix/integration/widget-mode-external.mdx +5 -5
  110. package/dist/docs/phoenix/localization.mdx +3 -22
  111. package/dist/docs/phoenix/phoenix-cli.mdx +96 -13
  112. package/dist/docs/phoenix/project-structure.mdx +9 -2
  113. package/dist/docs/phoenix/sdk-builder-workflow.mdx +7 -5
  114. package/dist/docs/recipes-and-delete/recipe-hierarchy-selection.mdx +15 -13
  115. package/dist/docs/relations/hierarchy.mdx +13 -2
  116. package/dist/domain/actions/action-factory.d.ts +3 -2
  117. package/dist/domain/application/application-config.d.ts +25 -75
  118. package/dist/domain/application/assistant/assistant-manifest.d.ts +61 -0
  119. package/dist/domain/application/assistant/assistant-manifest.js +1 -0
  120. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +95 -0
  121. package/dist/domain/application/assistant/assistant-resolved-manifest.js +1 -0
  122. package/dist/domain/application/assistant/assistant-value-type.d.ts +9 -0
  123. package/dist/domain/application/assistant/assistant-value-type.js +1 -0
  124. package/dist/domain/application/assistant/build-assistant-manifest.d.ts +4 -0
  125. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -0
  126. package/dist/{phoenix/application-spec → domain/application/assistant}/generate-assistant-prompt.d.ts +6 -5
  127. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -0
  128. package/dist/domain/application/assistant/index.d.ts +4 -0
  129. package/dist/domain/application/assistant/index.js +1 -0
  130. package/dist/domain/application/assistant-field-options.d.ts +1 -1
  131. package/dist/domain/application/assistant-mutations.d.ts +1 -1
  132. package/dist/domain/application/assistant-recipe-groups.d.ts +1 -1
  133. package/dist/domain/application/configurator-builder.d.ts +33 -18
  134. package/dist/domain/application/configurator-builder.js +1 -1
  135. package/dist/domain/application/element-registration.d.ts +5 -0
  136. package/dist/domain/application/element-registration.js +1 -1
  137. package/dist/domain/application/handler-registration.d.ts +5 -0
  138. package/dist/domain/application/handler-registration.js +1 -1
  139. package/dist/domain/application/index.d.ts +5 -4
  140. package/dist/domain/application/index.js +1 -1
  141. package/dist/domain/application/resolve-imported-transformers.d.ts +11 -1
  142. package/dist/domain/application/resolve-imported-transformers.js +1 -1
  143. package/dist/domain/components/domain-component-optic.d.ts +3 -0
  144. package/dist/domain/components/domain-component-optic.js +2 -2
  145. package/dist/domain/components/updates.d.ts +16 -0
  146. package/dist/domain/core/action.d.ts +1 -1
  147. package/dist/domain/domain-builder.d.ts +10 -1
  148. package/dist/domain/domain-builder.js +1 -1
  149. package/dist/domain/domain-context/index.d.ts +1 -1
  150. package/dist/domain/domain-context/store-system/store-system.js +1 -1
  151. package/dist/domain/domain-context/transformers/chain-builder.d.ts +1 -1
  152. package/dist/domain/domain-runtime/domain-runtime.d.ts +4 -4
  153. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  154. package/dist/domain/domain-runtime/spec/selectors.d.ts +2 -2
  155. package/dist/domain/domain-runtime/spec/selectors.js +1 -1
  156. package/dist/domain/domain-runtime/spec/types.d.ts +3 -3
  157. package/dist/domain/index.d.ts +3 -2
  158. package/dist/domain/index.js +1 -1
  159. package/dist/domain/invariants/invariants.d.ts +9 -0
  160. package/dist/domain/invariants/invariants.js +1 -1
  161. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +3 -3
  162. package/dist/domain/mocks/create-mock-domain-runtime.js +1 -1
  163. package/dist/domain/project-modules/index.d.ts +1 -0
  164. package/dist/domain/project-modules/index.js +1 -0
  165. package/dist/domain/project-modules/project-modules.d.ts +41 -0
  166. package/dist/domain/project-modules/project-modules.js +1 -0
  167. package/dist/domain/system-components/common/dimension-indicator-schema.d.ts +1 -1
  168. package/dist/domain/system-components/common/dimension-indicator-schema.js +1 -1
  169. package/dist/domain/system-components/phoenix-layout-elements/assistant-toolbar-button.d.ts +44 -0
  170. package/dist/domain/system-components/phoenix-layout-elements/assistant-toolbar-button.js +1 -0
  171. package/dist/domain/system-components/phoenix-layout-elements/index.d.ts +1 -0
  172. package/dist/domain/system-components/phoenix-layout-elements/index.js +1 -1
  173. package/dist/domain/system-components/phoenix-layout-elements/phoenix-layout-element.d.ts +2 -1
  174. package/dist/domain/system-components/phoenix-layout-elements/phoenix-layout-element.js +1 -1
  175. package/dist/editor/Editor.js +1 -1
  176. package/dist/editor/domain-editors/use-implementation-files.d.ts +7 -6
  177. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  178. package/dist/editor/graphql/GraphQLPanel.js +1 -1
  179. package/dist/editor/variants/VariantAnswerFooter.d.ts +17 -0
  180. package/dist/editor/variants/VariantAnswerFooter.js +1 -0
  181. package/dist/editor/variants/VariantPreviewHandler.d.ts +6 -0
  182. package/dist/editor/variants/VariantPreviewHandler.js +1 -0
  183. package/dist/editor/variants/variant-preview-styles.d.ts +49 -0
  184. package/dist/editor/variants/variant-preview-styles.js +1 -0
  185. package/dist/i18n/locales/cs/messages.js +1 -1
  186. package/dist/i18n/locales/da/messages.js +1 -1
  187. package/dist/i18n/locales/de/messages.js +1 -1
  188. package/dist/i18n/locales/de-AT/messages.js +1 -1
  189. package/dist/i18n/locales/en/messages.js +1 -1
  190. package/dist/i18n/locales/en-AU/messages.js +1 -1
  191. package/dist/i18n/locales/en-GB/messages.js +1 -1
  192. package/dist/i18n/locales/es/messages.js +1 -1
  193. package/dist/i18n/locales/fr/messages.js +1 -1
  194. package/dist/i18n/locales/hu/messages.js +1 -1
  195. package/dist/i18n/locales/it/messages.js +1 -1
  196. package/dist/i18n/locales/nl/messages.js +1 -1
  197. package/dist/i18n/locales/pl/messages.js +1 -1
  198. package/dist/i18n/locales/pt/messages.js +1 -1
  199. package/dist/i18n/locales/ro/messages.js +1 -1
  200. package/dist/i18n/locales/sk/messages.js +1 -1
  201. package/dist/i18n/locales/tr/messages.js +1 -1
  202. package/dist/legacy/domain-cli/gen/configurator-builder.js +21 -8
  203. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  204. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  205. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +6 -0
  206. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-admin.js +18 -19
  207. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-configurator.js +15 -16
  208. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +22 -23
  209. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-configurator.js +15 -16
  210. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/generator-shared.d.ts +7 -2
  211. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/generator-shared.js +8 -12
  212. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/index.d.ts +1 -1
  213. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/index.js +1 -1
  214. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/webhook-builders.js +7 -7
  215. package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
  216. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +4 -3
  217. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  218. package/dist/phoenix/cli.js +1 -1
  219. package/dist/phoenix/commands/deploy.js +2 -2
  220. package/dist/phoenix/commands/dev.js +5 -5
  221. package/dist/phoenix/commands/feedback.d.ts +2 -1
  222. package/dist/phoenix/commands/feedback.js +1 -1
  223. package/dist/phoenix/commands/index.d.ts +1 -0
  224. package/dist/phoenix/commands/index.js +1 -1
  225. package/dist/phoenix/commands/prepare-deployment-command.js +2 -2
  226. package/dist/phoenix/commands/prepare-local-environment-command.js +1 -1
  227. package/dist/phoenix/commands/story-dev.js +2 -2
  228. package/dist/phoenix/commands/variants.d.ts +35 -0
  229. package/dist/phoenix/commands/variants.js +1 -0
  230. package/dist/phoenix/editor-server/commands-router.d.ts +68 -1
  231. package/dist/phoenix/editor-server/commands-router.js +1 -1
  232. package/dist/phoenix/editor-server/editor-router.d.ts +65 -0
  233. package/dist/phoenix/editor-server/editor-server.d.ts +3 -3
  234. package/dist/phoenix/editor-server/editor-server.js +1 -1
  235. package/dist/phoenix/editor-server/protocol.d.ts +1 -0
  236. package/dist/phoenix/editor-server/spec-router.js +1 -1
  237. package/dist/phoenix/editor-server/trpc.d.ts +3 -0
  238. package/dist/phoenix/services/application-spec-project-watcher.d.ts +13 -2
  239. package/dist/phoenix/services/application-spec-project-watcher.js +3 -3
  240. package/dist/phoenix/services/index.d.ts +4 -0
  241. package/dist/phoenix/services/index.js +1 -1
  242. package/dist/phoenix/services/phoenix-application.d.ts +21 -0
  243. package/dist/phoenix/services/phoenix-application.js +1 -0
  244. package/dist/phoenix/services/phoenix-store.d.ts +48 -0
  245. package/dist/phoenix/services/phoenix-store.js +1 -0
  246. package/dist/phoenix/services/phx-variant-previews-plugin.d.ts +9 -0
  247. package/dist/phoenix/services/phx-variant-previews-plugin.js +1 -0
  248. package/dist/phoenix/services/prepare-development-environment.js +1 -1
  249. package/dist/phoenix/services/variant-file-session.d.ts +36 -0
  250. package/dist/phoenix/services/variant-file-session.js +1 -0
  251. package/dist/phoenix/services/variant-preview-service.d.ts +80 -0
  252. package/dist/phoenix/services/variant-preview-service.js +1 -0
  253. package/dist/phoenix/services/vite-config.js +1 -1
  254. package/dist/react-sdk/application-runtime/common-services/analytics/analytics-service.d.ts +2 -2
  255. package/dist/react-sdk/application-runtime/common-services/analytics/domain-controls-analytics.d.ts +21 -21
  256. package/dist/react-sdk/application-runtime/hooks/data/use-published-data.d.ts +1 -1
  257. package/dist/react-sdk/application-runtime/hooks/use-domain-application-props.d.ts +5 -2
  258. package/dist/react-sdk/application-runtime/hooks/use-spec.d.ts +1 -1
  259. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.d.ts +1 -1
  260. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  261. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +4 -4
  262. package/dist/ui-sdk/common/use-viewport-size.d.ts +4 -1
  263. package/dist/ui-sdk/common/use-viewport-size.js +1 -1
  264. package/dist/ui-sdk/components/mobile-controls/index.d.ts +1 -1
  265. package/dist/ui-sdk/theme/types.d.ts +4 -0
  266. package/dist/webhook/builders/common.d.ts +3 -0
  267. package/dist/webhook/builders/webhook-builder.d.ts +1 -1
  268. package/dist/webhook/builders/webhook-builder.js +1 -1
  269. package/package.json +5 -8
  270. package/schema/domain-spec.json +24 -0
  271. package/dist/configurator/assistant/index.d.ts +0 -1
  272. package/dist/configurator/assistant/index.js +0 -1
  273. package/dist/configurator/assistant/use-assistant-chat.d.ts +0 -20
  274. package/dist/configurator/assistant/use-assistant-chat.js +0 -1
  275. package/dist/extras/assistant/AssistantChat.d.ts +0 -6
  276. package/dist/extras/assistant/AssistantChat.js +0 -1
  277. package/dist/extras/assistant/index.d.ts +0 -1
  278. package/dist/extras/assistant/index.js +0 -1
  279. package/dist/phoenix/application-spec/generate-assistant-prompt.js +0 -1
@@ -61,7 +61,7 @@ export declare function createDomainRuntimeSlices<State extends DomainRuntimeSta
61
61
  selectAdminPreset: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("../index.js").AnyProductPreset>;
62
62
  selectAdminModelVersion: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, number>;
63
63
  selectThemeOptions: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("@mui/material").ThemeOptions>;
64
- selectAssistant: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("../index.js").AssistantManifest | null>;
64
+ selectAssistant: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, Required<import("../index.js").AssistantManifest> | null>;
65
65
  selectConfiguratorFactory: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("../index.js").AnyDomainFactory>;
66
66
  selectAdminFactory: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("../index.js").AnyDomainFactory>;
67
67
  selectConfiguratorComponentOptics: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, readonly import("../index.js").AnyDomainComponentOptic[]>;
@@ -104,7 +104,7 @@ export declare function createDomainRuntimeSlices<State extends DomainRuntimeSta
104
104
  getAdminPreset: () => import("../index.js").AnyProductPreset;
105
105
  getAdminModelVersion: () => number;
106
106
  getThemeOptions: () => import("@mui/material").ThemeOptions;
107
- getAssistant: () => import("../index.js").AssistantManifest | null;
107
+ getAssistant: () => Required<import("../index.js").AssistantManifest> | null;
108
108
  getConfiguratorFactory: () => import("../index.js").AnyDomainFactory;
109
109
  getAdminFactory: () => import("../index.js").AnyDomainFactory;
110
110
  getConfiguratorComponentOptics: () => readonly import("../index.js").AnyDomainComponentOptic[];
@@ -651,7 +651,7 @@ export declare const createDomainRuntime: (props: Omit<Props<DomainRuntimeState>
651
651
  selectAdminPreset: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("../index.js").AnyProductPreset>;
652
652
  selectAdminModelVersion: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, number>;
653
653
  selectThemeOptions: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("@mui/material").ThemeOptions>;
654
- selectAssistant: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("../index.js").AssistantManifest | null>;
654
+ selectAssistant: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, Required<import("../index.js").AssistantManifest> | null>;
655
655
  selectConfiguratorFactory: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("../index.js").AnyDomainFactory>;
656
656
  selectAdminFactory: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("../index.js").AnyDomainFactory>;
657
657
  selectConfiguratorComponentOptics: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, readonly import("../index.js").AnyDomainComponentOptic[]>;
@@ -694,7 +694,7 @@ export declare const createDomainRuntime: (props: Omit<Props<DomainRuntimeState>
694
694
  getAdminPreset: () => import("../index.js").AnyProductPreset;
695
695
  getAdminModelVersion: () => number;
696
696
  getThemeOptions: () => import("@mui/material").ThemeOptions;
697
- getAssistant: () => import("../index.js").AssistantManifest | null;
697
+ getAssistant: () => Required<import("../index.js").AssistantManifest> | null;
698
698
  getConfiguratorFactory: () => import("../index.js").AnyDomainFactory;
699
699
  getAdminFactory: () => import("../index.js").AnyDomainFactory;
700
700
  getConfiguratorComponentOptics: () => readonly import("../index.js").AnyDomainComponentOptic[];
@@ -1 +1 @@
1
- import{SessionRole as e}from"@salsita-ai/contracts/api";let a=(e,a)=>{let t={};for(let n of e)t[n.name]=a?.[n.name]??n.name;return t},t=(e,a)=>{let t={},n=0;for(let o of e)if("entity"===o.type||"layout"===o.type)t[o.name]=a?.[o.name]??o.name;else{let e=`icon:${n}`;t[e]=a?.[e]??`${e}:${o.elements.length}`,n+=1}return t};export const initializeSpec=n=>{let o=n.adminDomain.presets[0];if(!o)throw Error("Cannot register application spec because admin preset is required.");return{version:n.version,dataConfig:n.dataSpec??null,chunks:n.chunks,publishedDataHash:n.publishedDataHash,initialPublishedData:n.initialPublishedData,canCreate:n.features?.acl?.canCreate??Object.values(e),enableAdminRelease:n.features?.enableAdminRelease??!1,textLanguages:n.domain.textLanguages??n.adminDomain.textLanguages??["en"],baseResourcesUrl:n.resources?.baseResourcesUrl??n.defaultEnvs?.resourcesUrl??"",configurator:{factory:n.domain.domainFactory,presets:n.domain.presets,aliasMap:n.domain.domainFactory.context.aliasMap,entityReflections:n.domain.domainFactory.context.entityReflections,$entityReflections:n.domain.domainFactory.context.$entityReflections,expressions:n.domain.domainFactory.context.expressions,actions:n.domain.domainFactory.context.actions,actionImplementations:n.domain.domainFactory.context.actionImplementations,allowedRootEntityTypes:n.domain.domainFactory.context.allowedRootEntityTypes,migrate:n.domain.domainFactory.context.migrate,componentOptics:n.domain.componentOptics,createTransformers:n.createTransformers??(()=>[]),navigationStates:n.navigation?.navigationStates??[],viewStates:n.navigation?.viewStates??[],toolStates:n.navigation?.toolStates??[],exportStates:n.navigation?.exportStates??[],handlers:n.handlers,handlerHashes:a(n.handlers),elements:n.elements,elementHashes:t(n.elements),appLoader:n.ui?.appLoader??"universal",preview:n.ui?.preview??"auto",alwaysExpand:n.ui?.alwaysExpand??!1,theme:n.ui?.theme??{},assistant:n.assistant??null,deploymentQueryDisabled:n.resources?.deploymentQueryDisabled??!1,prefetchTextureUrls:n.resources?.prefetchTextureUrls??[],modelVersion:n.domain.domainFactory.modelVersion},admin:{factory:n.adminDomain.domainFactory,modelVersion:n.adminDomain.domainFactory.modelVersion,aliasMap:n.adminDomain.domainFactory.context.aliasMap,entityReflections:n.adminDomain.domainFactory.context.entityReflections,$entityReflections:n.adminDomain.domainFactory.context.$entityReflections,expressions:n.adminDomain.domainFactory.context.expressions,actions:n.adminDomain.domainFactory.context.actions,actionImplementations:n.adminDomain.domainFactory.context.actionImplementations,allowedRootEntityTypes:n.adminDomain.domainFactory.context.allowedRootEntityTypes,migrate:n.adminDomain.domainFactory.context.migrate,preset:o,componentOptics:n.adminDomain.componentOptics,navigationStates:n.adminNavigation?.navigationStates??[],viewStates:n.adminNavigation?.viewStates??[],handlers:n.handlers,handlerHashes:a(n.handlers),elements:n.elements,elementHashes:t(n.elements)}}};
1
+ import{SessionRole as t}from"@salsita-ai/contracts/api";import{resolveElementModules as e}from"../../application/element-registration.js";import{resolveHandlerModules as a}from"../../application/handler-registration.js";import{resolveImportedTransformers as n,resolveTransformerModules as o}from"../../application/resolve-imported-transformers.js";import{resolveComponentOpticModules as i}from"../../components/domain-component-optic.js";export const initializeSpec=s=>{let r=s.adminDomain.presets[0];if(!r)throw Error("Cannot register application spec because admin preset is required.");let m=a(s.handlers),c=e(s.elements),d=(t=>{let e={};for(let a of t)e[a.name]=(void 0)??a.name;return e})(m),l=(t=>{let e={},a=0;for(let n of t)if("entity"===n.type||"layout"===n.type)e[n.name]=(void 0)??n.name;else{let t=`icon:${a}`;e[t]=(void 0)??`${t}:${n.elements.length}`,a+=1}return e})(c),p=o(s.transformers?.importedTransformers??[]),y=s.transformers?.specTransformers??[];return{version:s.version,dataConfig:s.dataSpec??null,chunks:s.chunks,publishedDataHash:s.publishedDataHash,initialPublishedData:s.initialPublishedData,canCreate:s.features?.acl?.canCreate??Object.values(t),enableAdminRelease:s.features?.enableAdminRelease??!1,textLanguages:s.domain.textLanguages??s.adminDomain.textLanguages??["en"],baseResourcesUrl:s.resources?.baseResourcesUrl??s.defaultEnvs?.resourcesUrl??"",configurator:{factory:s.domain.domainFactory,presets:s.domain.presets,aliasMap:s.domain.domainFactory.context.aliasMap,entityReflections:s.domain.domainFactory.context.entityReflections,$entityReflections:s.domain.domainFactory.context.$entityReflections,expressions:s.domain.domainFactory.context.expressions,actions:s.domain.domainFactory.context.actions,actionImplementations:s.domain.domainFactory.context.actionImplementations,allowedRootEntityTypes:s.domain.domainFactory.context.allowedRootEntityTypes,migrate:s.domain.domainFactory.context.migrate,componentOptics:i(s.domain.componentOptics),createTransformers:t=>n(p,y,t),navigationStates:s.navigation?.navigationStates??[],viewStates:s.navigation?.viewStates??[],toolStates:s.navigation?.toolStates??[],exportStates:s.navigation?.exportStates??[],handlers:m,handlerHashes:d,elements:c,elementHashes:l,appLoader:s.ui?.appLoader??"universal",preview:s.ui?.preview??"auto",alwaysExpand:s.ui?.alwaysExpand??!1,theme:s.ui?.theme??{},assistant:s.assistant??null,deploymentQueryDisabled:s.resources?.deploymentQueryDisabled??!1,prefetchTextureUrls:s.resources?.prefetchTextureUrls??[],modelVersion:s.domain.domainFactory.modelVersion},admin:{factory:s.adminDomain.domainFactory,modelVersion:s.adminDomain.domainFactory.modelVersion,aliasMap:s.adminDomain.domainFactory.context.aliasMap,entityReflections:s.adminDomain.domainFactory.context.entityReflections,$entityReflections:s.adminDomain.domainFactory.context.$entityReflections,expressions:s.adminDomain.domainFactory.context.expressions,actions:s.adminDomain.domainFactory.context.actions,actionImplementations:s.adminDomain.domainFactory.context.actionImplementations,allowedRootEntityTypes:s.adminDomain.domainFactory.context.allowedRootEntityTypes,migrate:s.adminDomain.domainFactory.context.migrate,preset:r,componentOptics:i(s.adminDomain.componentOptics),navigationStates:s.adminNavigation?.navigationStates??[],viewStates:s.adminNavigation?.viewStates??[],handlers:m,handlerHashes:d,elements:c,elementHashes:l}}};
@@ -22,7 +22,7 @@ export declare const createSpecSelectors: (context: Context) => {
22
22
  selectAdminPreset: import("@salsita-ai/common/utils").Selector<SpecSelectorState, import("../../index.js").AnyProductPreset>;
23
23
  selectAdminModelVersion: import("@salsita-ai/common/utils").Selector<SpecSelectorState, number>;
24
24
  selectThemeOptions: import("@salsita-ai/common/utils").Selector<SpecSelectorState, import("@mui/material").ThemeOptions>;
25
- selectAssistant: import("@salsita-ai/common/utils").Selector<SpecSelectorState, import("../../index.js").AssistantManifest | null>;
25
+ selectAssistant: import("@salsita-ai/common/utils").Selector<SpecSelectorState, Required<import("../../index.js").AssistantManifest> | null>;
26
26
  selectConfiguratorFactory: import("@salsita-ai/common/utils").Selector<SpecSelectorState, import("../../index.js").AnyDomainFactory>;
27
27
  selectAdminFactory: import("@salsita-ai/common/utils").Selector<SpecSelectorState, import("../../index.js").AnyDomainFactory>;
28
28
  selectConfiguratorComponentOptics: import("@salsita-ai/common/utils").Selector<SpecSelectorState, readonly import("../../index.js").AnyDomainComponentOptic[]>;
@@ -65,7 +65,7 @@ export declare const createSpecSelectors: (context: Context) => {
65
65
  getAdminPreset: () => import("../../index.js").AnyProductPreset;
66
66
  getAdminModelVersion: () => number;
67
67
  getThemeOptions: () => import("@mui/material").ThemeOptions;
68
- getAssistant: () => import("../../index.js").AssistantManifest | null;
68
+ getAssistant: () => Required<import("../../index.js").AssistantManifest> | null;
69
69
  getConfiguratorFactory: () => import("../../index.js").AnyDomainFactory;
70
70
  getAdminFactory: () => import("../../index.js").AnyDomainFactory;
71
71
  getConfiguratorComponentOptics: () => readonly import("../../index.js").AnyDomainComponentOptic[];
@@ -1 +1 @@
1
- import{createSelector as e}from"@salsita-ai/common/utils";import{systemElementRegistry as t}from"../../application/element-registration.js";export const createSpecSelectors=n=>{let{getState:a}=n,s=e.withTypes(),r=s([s.leaf(e=>e.spec)],e=>e),o=s([r],e=>e.version),l=s([r],e=>e.baseResourcesUrl),i=s([r],e=>e.configurator),g=s([r],e=>e.dataConfig),m=s([r],e=>e.chunks),p=s([r],e=>e.publishedDataHash),d=s([r],e=>e.initialPublishedData),c=s([r],e=>e.canCreate),u=s([r],e=>e.enableAdminRelease),y=s([r],e=>e.textLanguages),h=s([i],e=>e.modelVersion),f=s([r],e=>e.admin),C=s([f],e=>e.preset),A=s([f],e=>e.modelVersion),E=s([i],e=>e.theme),b=s([i],e=>e.assistant),H=s([i],e=>e.factory),x=s([f],e=>e.factory),D=s([i],e=>e.componentOptics),P=s([f],e=>e.componentOptics),S=s([i],e=>e.appLoader),w=s([i],e=>e.preview),O=s([i],e=>e.alwaysExpand),T=s([i],e=>e.presets),V=s([i],e=>e.deploymentQueryDisabled),L=s([i],e=>e.prefetchTextureUrls),R=s([i],e=>e.handlerHashes),U=s([i],e=>e.handlers),v=s([U,R],(e,t)=>({...(e=>{let t={},n={},a={};for(let s of e)"phoenix"===s.type&&(t[s.name]=s.handler),"system"===s.type&&(n[s.name]=s.handler),"system-async"===s.type&&(a[s.name]=s.handler);return{handlers:t,systemHandlers:n,systemAsyncHandlers:a}})(e),hashes:t})),k=s([i],e=>e.elementHashes),F=s([i],e=>e.elements),M=s([F,k],(e,n)=>({...(e=>{let n={},a={};for(let t of e)"layout"===t.type&&(n[t.name]=t.element),"entity"===t.type&&(a[t.name]=t.element);return{entityElements:{...t.entityElements,...a},layoutElements:{...t.layoutElements,...n}}})(e),hashes:n}));return{selectSpec:r,selectVersion:o,selectBaseResourcesUrl:l,selectConfiguratorSpec:i,selectConfiguratorModelVersion:h,selectAdminSpec:f,selectAdminPreset:C,selectAdminModelVersion:A,selectThemeOptions:E,selectAssistant:b,selectConfiguratorFactory:H,selectAdminFactory:x,selectConfiguratorComponentOptics:D,selectAdminComponentOptics:P,selectAppLoader:S,selectPreview:w,selectAlwaysExpand:O,selectPresetSeed:T,selectDeploymentQueryDisabled:V,selectPrefetchTextureUrls:L,selectTextLanguages:y,selectHandlerHashes:R,selectHandlers:U,selectHandlerSlots:v,selectElementHashes:k,selectElements:F,selectElementSlots:M,selectDataConfig:g,selectChunks:m,selectPublishedDataHash:p,selectInitialPublishedData:d,selectCanCreate:c,selectEnableAdminRelease:u,getVersion:()=>o(a()),getBaseResourcesUrl:()=>l(a()),getConfiguratorSpec:()=>i(a()),getConfiguratorModelVersion:()=>h(a()),getAdminSpec:()=>f(a()),getAdminPreset:()=>C(a()),getAdminModelVersion:()=>A(a()),getThemeOptions:()=>E(a()),getAssistant:()=>b(a()),getConfiguratorFactory:()=>H(a()),getAdminFactory:()=>x(a()),getConfiguratorComponentOptics:()=>D(a()),getAdminComponentOptics:()=>P(a()),getAppLoader:()=>S(a()),getPreview:()=>w(a()),getAlwaysExpand:()=>O(a()),getPresetSeed:()=>T(a()),getDeploymentQueryDisabled:()=>V(a()),getPrefetchTextureUrls:()=>L(a()),getTextLanguages:()=>y(a()),getHandlerHashes:()=>R(a()),getHandlers:()=>U(a()),getHandlerSlots:()=>v(a()),getElementHashes:()=>k(a()),getElements:()=>F(a()),getElementSlots:()=>M(a()),getDataConfig:()=>g(a()),getChunks:()=>m(a()),getPublishedDataHash:()=>p(a()),getInitialPublishedData:()=>d(a()),getCanCreate:()=>c(a()),getEnableAdminRelease:()=>u(a())}};
1
+ import{createSelector as e}from"@salsita-ai/common/utils";import{buildAssistantManifest as t}from"../../application/assistant/index.js";import{systemElementRegistry as n}from"../../application/element-registration.js";export const createSpecSelectors=a=>{let{getState:s}=a,r=e.withTypes(),o=r([r.leaf(e=>e.spec)],e=>e),l=r([o],e=>e.version),i=r([o],e=>e.baseResourcesUrl),m=r([o],e=>e.configurator),g=r([o],e=>e.dataConfig),p=r([o],e=>e.chunks),d=r([o],e=>e.publishedDataHash),c=r([o],e=>e.initialPublishedData),u=r([o],e=>e.canCreate),y=r([o],e=>e.enableAdminRelease),h=r([o],e=>e.textLanguages),f=r([m],e=>e.modelVersion),C=r([o],e=>e.admin),A=r([C],e=>e.preset),E=r([C],e=>e.modelVersion),b=r([m],e=>e.theme),x=r([m],e=>e.assistant),H=r([x],e=>e?t(e):null),D=r([m],e=>e.factory),P=r([C],e=>e.factory),S=r([m],e=>e.componentOptics),w=r([C],e=>e.componentOptics),O=r([m],e=>e.appLoader),T=r([m],e=>e.preview),V=r([m],e=>e.alwaysExpand),L=r([m],e=>e.presets),R=r([m],e=>e.deploymentQueryDisabled),U=r([m],e=>e.prefetchTextureUrls),v=r([m],e=>e.handlerHashes),j=r([m],e=>e.handlers),k=r([j,v],(e,t)=>({...(e=>{let t={},n={},a={};for(let s of e)"phoenix"===s.type&&(t[s.name]=s.handler),"system"===s.type&&(n[s.name]=s.handler),"system-async"===s.type&&(a[s.name]=s.handler);return{handlers:t,systemHandlers:n,systemAsyncHandlers:a}})(e),hashes:t})),F=r([m],e=>e.elementHashes),M=r([m],e=>e.elements),Q=r([M,F],(e,t)=>({...(e=>{let t={},a={};for(let n of e)"layout"===n.type&&(t[n.name]=n.element),"entity"===n.type&&(a[n.name]=n.element);return{entityElements:{...n.entityElements,...a},layoutElements:{...n.layoutElements,...t}}})(e),hashes:t}));return{selectSpec:o,selectVersion:l,selectBaseResourcesUrl:i,selectConfiguratorSpec:m,selectConfiguratorModelVersion:f,selectAdminSpec:C,selectAdminPreset:A,selectAdminModelVersion:E,selectThemeOptions:b,selectAssistant:H,selectConfiguratorFactory:D,selectAdminFactory:P,selectConfiguratorComponentOptics:S,selectAdminComponentOptics:w,selectAppLoader:O,selectPreview:T,selectAlwaysExpand:V,selectPresetSeed:L,selectDeploymentQueryDisabled:R,selectPrefetchTextureUrls:U,selectTextLanguages:h,selectHandlerHashes:v,selectHandlers:j,selectHandlerSlots:k,selectElementHashes:F,selectElements:M,selectElementSlots:Q,selectDataConfig:g,selectChunks:p,selectPublishedDataHash:d,selectInitialPublishedData:c,selectCanCreate:u,selectEnableAdminRelease:y,getVersion:()=>l(s()),getBaseResourcesUrl:()=>i(s()),getConfiguratorSpec:()=>m(s()),getConfiguratorModelVersion:()=>f(s()),getAdminSpec:()=>C(s()),getAdminPreset:()=>A(s()),getAdminModelVersion:()=>E(s()),getThemeOptions:()=>b(s()),getAssistant:()=>H(s()),getConfiguratorFactory:()=>D(s()),getAdminFactory:()=>P(s()),getConfiguratorComponentOptics:()=>S(s()),getAdminComponentOptics:()=>w(s()),getAppLoader:()=>O(s()),getPreview:()=>T(s()),getAlwaysExpand:()=>V(s()),getPresetSeed:()=>L(s()),getDeploymentQueryDisabled:()=>R(s()),getPrefetchTextureUrls:()=>U(s()),getTextLanguages:()=>h(s()),getHandlerHashes:()=>v(s()),getHandlers:()=>j(s()),getHandlerSlots:()=>k(s()),getElementHashes:()=>F(s()),getElements:()=>M(s()),getElementSlots:()=>Q(s()),getDataConfig:()=>g(s()),getChunks:()=>p(s()),getPublishedDataHash:()=>d(s()),getInitialPublishedData:()=>c(s()),getCanCreate:()=>u(s()),getEnableAdminRelease:()=>y(s())}};
@@ -1,6 +1,6 @@
1
1
  import type { ThemeOptions } from '@mui/material';
2
2
  import type { SessionRole } from '@salsita-ai/contracts/api';
3
- import type { AssistantManifest, ChunksSpec, DataSpec, ElementRegistration, HandlerRegistration } from '../../application/index.js';
3
+ import type { AssistantResolvedManifest, ChunksSpec, DataSpec, ElementRegistration, HandlerRegistration } from '../../application/index.js';
4
4
  import type { AnyDomainComponentOptic } from '../../components/index.js';
5
5
  import type { ActionDefinitions, Any$EntityReflections, AnyActionImplementations, AnyAliasMap, AnyAllowedRootEntityTypes, AnyDomainFactory, AnyEntityReflections, AnyExpressions, AnyProductPreset, DomainEntity, MigrateFunction } from '../../core/index.js';
6
6
  import type { AnyCreateTransformersFactory } from '../../domain-context/store-system/store-system.js';
@@ -46,10 +46,10 @@ export interface ApplicationConfiguratorSpec {
46
46
  readonly alwaysExpand: boolean;
47
47
  readonly theme: ThemeOptions;
48
48
  /**
49
- * Experimental assistant manifest with its generated GraphQL SDL, or `null` when the application
49
+ * Resolved assistant manifest used to rebuild GraphQL SDL, or `null` when the application
50
50
  * spec declares no `assistant` section. Replaced by editor hot reload when the section changes.
51
51
  */
52
- readonly assistant: AssistantManifest | null;
52
+ readonly assistant: AssistantResolvedManifest | null;
53
53
  /**
54
54
  * When true, resource urls are not suffixed with the `?did=<deploymentId>` cache-busting
55
55
  * query — useful for demos serving local blob urls.
@@ -4,7 +4,7 @@ export { type ActionImplementationConflicts, findActionImplementationConflicts,
4
4
  export { createConstantExpressionFactory } from './expressions/constant-expressions.js';
5
5
  export { createCustomExpressionFactory } from './expressions/custom-expression.js';
6
6
  export { createCustomInvariantFactory, type StaticallyDefinedViolations } from './invariants/custom-invariants.js';
7
- export { InvariantBuilder } from './invariants/invariants.js';
7
+ export { InvariantBuilder, resolveInvariantModules } from './invariants/invariants.js';
8
8
  export type { AliasedInvariants, Invariant } from './invariants/invariants.js';
9
9
  export type { Violation, ViolationSeverity, ViolationTypesOf$Entity, EntityViolation } from './invariants/violation.js';
10
10
  export { compareSeverity } from './invariants/violation.js';
@@ -26,7 +26,7 @@ export { viewportStateComponent, isViewportStateComponentSnapshot, isSystemViewp
26
26
  export { type ComponentSystemFilterState, type ComponentSystemFilterProps, ComponentSystemFilterPropsSchema, getComponentSystemFilterState, CombinedComponentFilterSchema, type GradualComponentSystemFilter, type FilterMismatchReason, type IdOrWithId, } from './components/system-component-filter.js';
27
27
  export { ComponentSystemFilterSchema, type ComponentSystemFilter, type DeclarativeComponentSystemFilter, } from './components/legacy-filter.js';
28
28
  export type { OneComponentFilter, ManyComponentFilter, ComponentFilter, FilteredOutComponentSnapshot, FilteredOutFilterContext, } from './components/component-reader-types.js';
29
- export { DomainComponentOpticBuilder, type AnyDomainComponentOptic, type DomainComponentOptic, } from './components/domain-component-optic.js';
29
+ export { DomainComponentOpticBuilder, type AnyDomainComponentOptic, type DomainComponentOptic, resolveComponentOpticModules, } from './components/domain-component-optic.js';
30
30
  export { groupComponentsByEntityIdAndName, isEqualGroupedComponentSnapshots, type GroupedComponentSnapshots, } from './components/group-components-by-entity-id-and-name.js';
31
31
  export { SystemComponentBuilder } from './components/system-component-builder.js';
32
32
  export { type DataUpdate, type StateUpdate, type ComponentModification, isComponentModificationOfType, type DomainEntityCreation, type EntityDeletion, type DomainEntityReplacement, type DomainEntityModification, type EphemeralRecordCreation, type EphemeralRecordDeletion, type EphemeralRecordModification, type DomainEntityStateDelta, systemUpdateFactory, type UpdateFactory, createUpdateFactory, } from './components/updates.js';
@@ -41,6 +41,7 @@ export * from './sketching/index.js';
41
41
  export * from './projections/index.js';
42
42
  export * from './admin-domain/index.js';
43
43
  export * from './application/index.js';
44
+ export { type ProjectModule, resolveActionModules, resolveExpressionModules } from './project-modules/index.js';
44
45
  export * from './scene/index.js';
45
46
  export { getAllPhxDefinitions } from './system-definitions.js';
46
47
  export { availableSystemComponents, componentsByName } from './available-system-components.js';
@@ -1 +1 @@
1
- export*from"./core/index.js";export{createActionFactory}from"./actions/action-factory.js";export{findActionImplementationConflicts}from"./actions/prepare-action-implementations.js";export{createConstantExpressionFactory}from"./expressions/constant-expressions.js";export{createCustomExpressionFactory}from"./expressions/custom-expression.js";export{createCustomInvariantFactory}from"./invariants/custom-invariants.js";export{InvariantBuilder}from"./invariants/invariants.js";export{compareSeverity}from"./invariants/violation.js";export{violationsComponent}from"./invariants/violation-component.js";export{createRelationFactory}from"./relations/relation-factory.js";export{attachMultipleReferenceComponent,attachSingleReferenceComponent,referenceComponent}from"./relations/reference-component.js";export{composedOfComponent}from"./relations/composed-of.js";export{createSingleReferenceRead,createSingleReferenceWrite,createMultipleReferenceRead,createMultipleReferenceWrite,createSingleCompositionRead,createMultipleCompositionRead,createEmptyWrite}from"./relations/component-factories.js";export{systemVirtualEntityId}from"./components/system-virtual-entity.js";export{navigationStateComponent,isNavigationComponentSnapshot,isSystemNavigationComponentSnapshot}from"./components/navigation-state-component.js";export{hoverStateComponent,isHoverStateComponentSnapshot,isSystemHoverStateComponentSnapshot}from"./components/hover-state-component.js";export{selectionStateComponent,isSelectionComponentSnapshot,isSystemSelectionComponentSnapshot}from"./components/selection-state-component.js";export{viewStateComponent,isViewComponentSnapshot,isSystemViewComponentSnapshot}from"./components/view-state-component.js";export{toolStateComponent,isToolStateComponentSnapshot,isSystemToolStateComponentSnapshot}from"./components/tool-state-component.js";export{debugStateComponent,isDebugStateComponentSnapshot,isSystemDebugStateComponentSnapshot}from"./components/debug-state-component.js";export{fullscreenStateComponent,isFullscreenStateComponentSnapshot,isSystemFullscreenStateComponentSnapshot}from"./components/fullscreen-state-component.js";export{dragStateComponent,isDragStateComponentSnapshot,isSystemDragStateComponentSnapshot}from"./components/drag-state-component.js";export{viewportStateComponent,isViewportStateComponentSnapshot,isSystemViewportStateComponentSnapshot,VIEWPORTS}from"./components/viewport-state-component.js";export{ComponentSystemFilterPropsSchema,getComponentSystemFilterState,CombinedComponentFilterSchema}from"./components/system-component-filter.js";export{ComponentSystemFilterSchema}from"./components/legacy-filter.js";export{DomainComponentOpticBuilder}from"./components/domain-component-optic.js";export{groupComponentsByEntityIdAndName,isEqualGroupedComponentSnapshots}from"./components/group-components-by-entity-id-and-name.js";export{SystemComponentBuilder}from"./components/system-component-builder.js";export{isComponentModificationOfType,systemUpdateFactory,createUpdateFactory}from"./components/updates.js";export{DomainBuilder}from"./domain-builder.js";export{memoEval,isMemoizedArray,isMemoizedObject}from"./utils/memo-eval.js";export{cloneEvalCache,getEvalCache,setEvalCache,createEvalCacheToken}from"./utils/eval-cache.js";export{areProfilerLabelsEnabled,setProfilerLabelsEnabled}from"./utils/profiler-label.js";export*from"./dimensions/index.js";export*from"./domain-context/index.js";export*from"./system-components/index.js";export*from"./sketching/index.js";export*from"./projections/index.js";export*from"./admin-domain/index.js";export*from"./application/index.js";export*from"./scene/index.js";export{getAllPhxDefinitions}from"./system-definitions.js";export{availableSystemComponents,componentsByName}from"./available-system-components.js";export*from"./mocks/index.js";export*from"./domain-runtime/index.js";
1
+ export*from"./core/index.js";export{createActionFactory}from"./actions/action-factory.js";export{findActionImplementationConflicts}from"./actions/prepare-action-implementations.js";export{createConstantExpressionFactory}from"./expressions/constant-expressions.js";export{createCustomExpressionFactory}from"./expressions/custom-expression.js";export{createCustomInvariantFactory}from"./invariants/custom-invariants.js";export{InvariantBuilder,resolveInvariantModules}from"./invariants/invariants.js";export{compareSeverity}from"./invariants/violation.js";export{violationsComponent}from"./invariants/violation-component.js";export{createRelationFactory}from"./relations/relation-factory.js";export{attachMultipleReferenceComponent,attachSingleReferenceComponent,referenceComponent}from"./relations/reference-component.js";export{composedOfComponent}from"./relations/composed-of.js";export{createSingleReferenceRead,createSingleReferenceWrite,createMultipleReferenceRead,createMultipleReferenceWrite,createSingleCompositionRead,createMultipleCompositionRead,createEmptyWrite}from"./relations/component-factories.js";export{systemVirtualEntityId}from"./components/system-virtual-entity.js";export{navigationStateComponent,isNavigationComponentSnapshot,isSystemNavigationComponentSnapshot}from"./components/navigation-state-component.js";export{hoverStateComponent,isHoverStateComponentSnapshot,isSystemHoverStateComponentSnapshot}from"./components/hover-state-component.js";export{selectionStateComponent,isSelectionComponentSnapshot,isSystemSelectionComponentSnapshot}from"./components/selection-state-component.js";export{viewStateComponent,isViewComponentSnapshot,isSystemViewComponentSnapshot}from"./components/view-state-component.js";export{toolStateComponent,isToolStateComponentSnapshot,isSystemToolStateComponentSnapshot}from"./components/tool-state-component.js";export{debugStateComponent,isDebugStateComponentSnapshot,isSystemDebugStateComponentSnapshot}from"./components/debug-state-component.js";export{fullscreenStateComponent,isFullscreenStateComponentSnapshot,isSystemFullscreenStateComponentSnapshot}from"./components/fullscreen-state-component.js";export{dragStateComponent,isDragStateComponentSnapshot,isSystemDragStateComponentSnapshot}from"./components/drag-state-component.js";export{viewportStateComponent,isViewportStateComponentSnapshot,isSystemViewportStateComponentSnapshot,VIEWPORTS}from"./components/viewport-state-component.js";export{ComponentSystemFilterPropsSchema,getComponentSystemFilterState,CombinedComponentFilterSchema}from"./components/system-component-filter.js";export{ComponentSystemFilterSchema}from"./components/legacy-filter.js";export{DomainComponentOpticBuilder,resolveComponentOpticModules}from"./components/domain-component-optic.js";export{groupComponentsByEntityIdAndName,isEqualGroupedComponentSnapshots}from"./components/group-components-by-entity-id-and-name.js";export{SystemComponentBuilder}from"./components/system-component-builder.js";export{isComponentModificationOfType,systemUpdateFactory,createUpdateFactory}from"./components/updates.js";export{DomainBuilder}from"./domain-builder.js";export{memoEval,isMemoizedArray,isMemoizedObject}from"./utils/memo-eval.js";export{cloneEvalCache,getEvalCache,setEvalCache,createEvalCacheToken}from"./utils/eval-cache.js";export{areProfilerLabelsEnabled,setProfilerLabelsEnabled}from"./utils/profiler-label.js";export*from"./dimensions/index.js";export*from"./domain-context/index.js";export*from"./system-components/index.js";export*from"./sketching/index.js";export*from"./projections/index.js";export*from"./admin-domain/index.js";export*from"./application/index.js";export{resolveActionModules,resolveExpressionModules}from"./project-modules/index.js";export*from"./scene/index.js";export{getAllPhxDefinitions}from"./system-definitions.js";export{availableSystemComponents,componentsByName}from"./available-system-components.js";export*from"./mocks/index.js";export*from"./domain-runtime/index.js";
@@ -3,6 +3,7 @@ import { type AliasMap, type EventualAlias, type ExpandAlias, type ExtractFromAl
3
3
  import type { AnonymousExpression, ExpressionContext } from '../core/expression.js';
4
4
  import type { $DomainEntity, DomainEntity, EntityByType } from '../core/model.js';
5
5
  import type { DomainState } from '../core/state.js';
6
+ import { type ProjectModule } from '../project-modules/index.js';
6
7
  import { type Violation } from './violation.js';
7
8
  export interface Invariant<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ENTITY extends ENTITIES, VIOLATION_TYPE extends string> {
8
9
  evaluate(selfId: ENTITY['id'], state: DomainState<ENTITIES>, ctx: ExpressionContext<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>): ReadonlyArray<Violation<VIOLATION_TYPE>>;
@@ -38,10 +39,18 @@ type ExpressionsFromInvariants<ENTITIES extends DomainEntity<string>, ALLOWED_RO
38
39
  };
39
40
  };
40
41
  type BuildViolationExpressions<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, INVARIANTS extends Partial<Record<ENTITIES['type'], ReadonlyArray<Invariant<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, string>>>>> = Record<never, never> extends ConflictingInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, DeclaredInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>, INVARIANTS> ? () => ExpressionsFromInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, INVARIANTS> : never;
42
+ type AnyInvariant = Invariant<any, any, any, any, any, any, string>;
43
+ /** Validates the `src/invariants/` files and concatenates their invariants per entity type or alias. */
44
+ export declare const resolveInvariantModules: (modules: readonly ProjectModule[]) => Readonly<Record<string, readonly AnyInvariant[]>>;
41
45
  export declare class InvariantBuilder<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Record<string, ENTITIES>, INVARIANTS extends Partial<Record<ENTITIES['type'], ReadonlyArray<Invariant<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, string>>>> = Record<never, never>> {
42
46
  private readonly aliasMap;
43
47
  private readonly invariants;
44
48
  constructor(aliasMap: AliasMap<ALIASES>, invariants?: INVARIANTS);
49
+ /**
50
+ * Adds the invariants of the `src/invariants/` files, as the generated barrel lists them, after
51
+ * checking each file against the folder's contract.
52
+ */
53
+ withInvariantModules(modules: readonly ProjectModule[]): InvariantBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, ExpandAndMergeInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, INVARIANTS, AliasedInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, string>>>;
45
54
  withInvariants<ALIASED_INVARIANTS extends AliasedInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, string>>(aliasedInvariants: ALIASED_INVARIANTS): InvariantBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, ExpandAndMergeInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, INVARIANTS, ALIASED_INVARIANTS>>;
46
55
  /**
47
56
  * DO NOT USE in runtime!
@@ -1 +1 @@
1
- import{expandAlias as a}from"../core/alias.js";export class InvariantBuilder{aliasMap;invariants;constructor(a,i={}){this.aliasMap=a,this.invariants=i}withInvariants(i){let t={...this.invariants};return Object.entries(i).forEach(([i,s])=>{a(this.aliasMap,i).forEach(a=>{t[a]=[...t[a]??[],...s]})}),new InvariantBuilder(this.aliasMap,t)}_conflicts={};buildViolationExpressions=()=>{let a={};return Object.entries(this.invariants).forEach(([i,t])=>{a[i]={$violations:{evaluate:(a,i,s)=>t.flatMap(t=>t.evaluate(a,i,s)),meta:{}}}}),a}}
1
+ import{expandAlias as t}from"../core/alias.js";import{SHARED_FOLDER_HINT as a,createContractError as e,isRecord as i}from"../project-modules/index.js";let r={expected:"an object of invariant lists keyed by entity type or alias",fix:`Create it with phx.domain.implementCustomInvariants({ ... }) (phx.domain.admin.implementCustomInvariants({ ... }) under src/admin/), ${a}.`},n=t=>i(t)&&"function"==typeof t.evaluate,s=t=>i(t)&&Object.values(t).every(t=>Array.isArray(t)&&t.every(n));export const resolveInvariantModules=t=>{let a={};for(let i of t){if(!s(i.exports))throw e(i.origin,r,i.exports);for(let[t,e]of Object.entries(i.exports))a[t]=[...a[t]??[],...e]}return a};export class InvariantBuilder{aliasMap;invariants;constructor(t,a={}){this.aliasMap=t,this.invariants=a}withInvariantModules(t){return this.withInvariants(resolveInvariantModules(t))}withInvariants(a){let e={...this.invariants};return Object.entries(a).forEach(([a,i])=>{t(this.aliasMap,a).forEach(t=>{e[t]=[...e[t]??[],...i]})}),new InvariantBuilder(this.aliasMap,e)}_conflicts={};buildViolationExpressions=()=>{let t={};return Object.entries(this.invariants).forEach(([a,e])=>{t[a]={$violations:{evaluate:(t,a,i)=>e.flatMap(e=>e.evaluate(t,a,i)),meta:{}}}}),t}}
@@ -15,7 +15,7 @@ import type { RegistrableTransformer } from '../domain-context/index.js';
15
15
  *
16
16
  * Contributing no extension systems is the same shape webhook and finalize hosts run in.
17
17
  */
18
- export declare const createMockDomainRuntime: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string, CHAT_CONTEXT extends Record<string, unknown>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ADMIN_ENTITIES extends DomainEntity<string>, ADMIN_ALLOWED_ROOT_ENTITIES extends ADMIN_ENTITIES, ADMIN_$MAP extends Record<ADMIN_ENTITIES['type'], $DomainEntity<ADMIN_ENTITIES>>, ADMIN_NAVIGATION_STATES extends string, ADMIN_VIEW_STATES extends string>(_cfg: ApplicationConfig<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, CHAT_CONTEXT, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES>, mocks: {
18
+ export declare const createMockDomainRuntime: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string, CHAT_CONTEXT extends Record<string, unknown>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ADMIN_ENTITIES extends DomainEntity<string>, ADMIN_ALLOWED_ROOT_ENTITIES extends ADMIN_ENTITIES, ADMIN_$MAP extends Record<ADMIN_ENTITIES['type'], $DomainEntity<ADMIN_ENTITIES>>, ADMIN_NAVIGATION_STATES extends string, ADMIN_VIEW_STATES extends string>(config: ApplicationConfig<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, CHAT_CONTEXT, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES>, mocks: {
19
19
  frontendData: FRONTEND_DATA;
20
20
  publishedData: PUBLISHED_DATA;
21
21
  sessionData: SESSION_DATA;
@@ -57,7 +57,7 @@ export declare const createMockDomainRuntime: <ENTITIES extends DomainEntity<str
57
57
  selectAdminPreset: import("@salsita-ai/common/utils").Selector<import("../index.js").SpecSelectorState, import("../index.js").AnyProductPreset>;
58
58
  selectAdminModelVersion: import("@salsita-ai/common/utils").Selector<import("../index.js").SpecSelectorState, number>;
59
59
  selectThemeOptions: import("@salsita-ai/common/utils").Selector<import("../index.js").SpecSelectorState, import("@mui/material").ThemeOptions>;
60
- selectAssistant: import("@salsita-ai/common/utils").Selector<import("../index.js").SpecSelectorState, import("../index.js").AssistantManifest | null>;
60
+ selectAssistant: import("@salsita-ai/common/utils").Selector<import("../index.js").SpecSelectorState, Required<import("../index.js").AssistantManifest> | null>;
61
61
  selectConfiguratorFactory: import("@salsita-ai/common/utils").Selector<import("../index.js").SpecSelectorState, import("../index.js").AnyDomainFactory>;
62
62
  selectAdminFactory: import("@salsita-ai/common/utils").Selector<import("../index.js").SpecSelectorState, import("../index.js").AnyDomainFactory>;
63
63
  selectConfiguratorComponentOptics: import("@salsita-ai/common/utils").Selector<import("../index.js").SpecSelectorState, readonly import("../index.js").AnyDomainComponentOptic[]>;
@@ -100,7 +100,7 @@ export declare const createMockDomainRuntime: <ENTITIES extends DomainEntity<str
100
100
  getAdminPreset: () => import("../index.js").AnyProductPreset;
101
101
  getAdminModelVersion: () => number;
102
102
  getThemeOptions: () => import("@mui/material").ThemeOptions;
103
- getAssistant: () => import("../index.js").AssistantManifest | null;
103
+ getAssistant: () => Required<import("../index.js").AssistantManifest> | null;
104
104
  getConfiguratorFactory: () => import("../index.js").AnyDomainFactory;
105
105
  getAdminFactory: () => import("../index.js").AnyDomainFactory;
106
106
  getConfiguratorComponentOptics: () => readonly import("../index.js").AnyDomainComponentOptic[];
@@ -1 +1 @@
1
- import{createDomainRuntime as o}from"../domain-runtime/index.js";import{createMockDomainRuntimeServices as e}from"./create-mock-domain-runtime-services.js";import{createMockSessionContext as t}from"./create-mock-session-context.js";export const createMockDomainRuntime=(i,a)=>{let{sessionData:n,mode:r,role:s}=a,c={...i,createTransformers:o=>a.transformers.map(e=>e.transformer.register(o,e.priority??1/0))},m=o({config:c,services:e()});return m.actions.sessionContext.setSessionContext(t(s,n)),m.actions.access.setConfiguratorAccessInfo({raw:"mock-access-token",viewMode:"read"===r,revisionId:void 0,configurationId:"mock"}),m.actions.domainData.setDomainData({publishedData:a.publishedData,frontendData:a.frontendData,backendData:a.backendData}),m.actions.loadedData.completeConfiguratorLoad({initialRevisionId:"mock-revision",initialEntities:a.entities,modelVersion:c.domain.domainFactory.modelVersion,rootEntityType:a.rootEntityType,schemaIdentity:c.domain.domainFactory}),m};
1
+ import{createDomainRuntime as o}from"../domain-runtime/index.js";import{createMockDomainRuntimeServices as t}from"./create-mock-domain-runtime-services.js";import{createMockSessionContext as e}from"./create-mock-session-context.js";export const createMockDomainRuntime=(a,i)=>{let{sessionData:n,mode:r,role:s}=i,c=o({config:a,services:t()}),m=c.getState().spec;return c.actions.spec.updateSpec({...m,configurator:{...m.configurator,createTransformers:o=>i.transformers.map(t=>t.transformer.register(o,t.priority??1/0))}}),c.actions.sessionContext.setSessionContext(e(s,n)),c.actions.access.setConfiguratorAccessInfo({raw:"mock-access-token",viewMode:"read"===r,revisionId:void 0,configurationId:"mock"}),c.actions.domainData.setDomainData({publishedData:i.publishedData,frontendData:i.frontendData,backendData:i.backendData}),c.actions.loadedData.completeConfiguratorLoad({initialRevisionId:"mock-revision",initialEntities:i.entities,modelVersion:a.domain.domainFactory.modelVersion,rootEntityType:i.rootEntityType,schemaIdentity:a.domain.domainFactory}),c};
@@ -0,0 +1 @@
1
+ export { type ExpressionModule, type ProjectModule, type ProjectModuleContract, SHARED_FOLDER_HINT, createContractError, isRecord, resolveActionModules, resolveExpressionModules, resolveListModule, } from './project-modules.js';
@@ -0,0 +1 @@
1
+ export{SHARED_FOLDER_HINT,createContractError,isRecord,resolveActionModules,resolveExpressionModules,resolveListModule}from"./project-modules.js";
@@ -0,0 +1,41 @@
1
+ import type { AnonymousExpression, AnyActionImplementations } from '../core/index.js';
2
+ /**
3
+ * The default export of one file in a project convention folder (`src/elements/`, `src/handlers/`,
4
+ * `src/expressions/`, …), paired with the project-relative path it was imported from.
5
+ *
6
+ * Generated barrels and the editor's hot reload hand project code to the SDK in this shape, without
7
+ * inspecting it. Each folder's resolver then checks the export against the folder's contract, so an
8
+ * invalid file fails with an error naming it instead of an unrelated crash later.
9
+ */
10
+ export interface ProjectModule {
11
+ readonly origin: string;
12
+ readonly exports: unknown;
13
+ }
14
+ /** The expressions of one validated expression file, keyed by entity type or alias, then by expression name. */
15
+ export interface ExpressionModule {
16
+ readonly origin: string;
17
+ readonly expressions: Readonly<Record<string, Readonly<Record<string, AnyAnonymousExpression>>>>;
18
+ }
19
+ type AnyAnonymousExpression = AnonymousExpression<any, any, any, any, any, any, unknown>;
20
+ /** What a convention folder requires of its files, in the words used by the contract error. */
21
+ export interface ProjectModuleContract {
22
+ readonly expected: string;
23
+ readonly fix: string;
24
+ }
25
+ export declare const SHARED_FOLDER_HINT = "or move the file to an underscore-prefixed folder such as src/_shared/ when it is shared code";
26
+ export declare const isRecord: (value: unknown) => value is Record<string, unknown>;
27
+ export declare const createContractError: (origin: string, contract: ProjectModuleContract, received: unknown) => Error;
28
+ /**
29
+ * Checks a file of a folder whose contract is one item or an array of them, and returns its items.
30
+ * The first item that fails the check is the value the error reports.
31
+ */
32
+ export declare const resolveListModule: <Item>(module: ProjectModule, contract: ProjectModuleContract, isItem: (value: unknown) => value is Item) => readonly Item[];
33
+ /**
34
+ * Validates the `src/expressions/` files and rejects an expression that two files define for the
35
+ * same entity type. Merging stays with the caller, because the domain builder and the editor expand
36
+ * aliases at different points; within one file the builder's own duplicate check applies.
37
+ */
38
+ export declare const resolveExpressionModules: (modules: readonly ProjectModule[], aliasMap: Readonly<Record<string, readonly string[]>>) => readonly ExpressionModule[];
39
+ /** Validates the `src/actions/` files and merges their implementations by action name; a later file wins. */
40
+ export declare const resolveActionModules: (modules: readonly ProjectModule[]) => AnyActionImplementations;
41
+ export {};
@@ -0,0 +1 @@
1
+ export const SHARED_FOLDER_HINT="or move the file to an underscore-prefixed folder such as src/_shared/ when it is shared code";let e={expected:"an object of expressions keyed by entity type or alias, then by expression name",fix:`Create it with phx.domain.implementCustomExpressions({ ... }) (phx.domain.admin.implementCustomExpressions({ ... }) under src/admin/), ${SHARED_FOLDER_HINT}.`},t={expected:"an object of action implementations keyed by action name",fix:`Create it with phx.domain.implementActions({ ... }), ${SHARED_FOLDER_HINT}.`};export const isRecord=e=>"object"==typeof e&&null!==e&&!Array.isArray(e);export const createContractError=(e,t,r)=>Error(`Invalid default export in ${e}: expected ${t.expected}, but got ${(e=>{if(void 0===e)return"nothing (the file has no default export)";if(null===e)return"null";if("function"==typeof e)return e.name?`the function "${e.name}"`:"an anonymous function";if(Array.isArray(e))return`an array of ${e.length} item(s)`;if(isRecord(e)){let t=Object.keys(e);return t.length>0?`an object with the keys ${t.join(", ")}`:"an empty object"}return`the ${typeof e} ${JSON.stringify(e)}`})(r)}. Every file in this folder is loaded by convention, so each one must default-export that shape. ${t.fix}`);export const resolveListModule=(e,t,r)=>{let o=Array.isArray(e.exports)?e.exports:[e.exports],n=[];for(let i of o){if(!r(i))throw createContractError(e.origin,t,i);n.push(i)}return n};let r=e=>isRecord(e)&&"function"==typeof e.evaluate,o=e=>isRecord(e)&&Object.values(e).every(r),n=e=>"function"==typeof e;export const resolveExpressionModules=(t,r)=>{let n=new Map;return t.map(t=>{let i;if(i=t.exports,!(isRecord(i)&&Object.values(i).every(o)))throw createContractError(t.origin,e,t.exports);for(let[e,o]of Object.entries(t.exports))for(let i of r[e]??[e])for(let e of Object.keys(o)){let r=`${i}.${e}`,o=n.get(r);if(void 0!==o&&o!==t.origin)throw Error(`Duplicate expression ${r}: it is defined in both ${o} and ${t.origin}, which would make its value depend on file order. Keep one definition and remove the other.`);n.set(r,t.origin)}return{origin:t.origin,expressions:t.exports}})};export const resolveActionModules=e=>e.reduce((e,r)=>{let o;if(o=r.exports,!(isRecord(o)&&Object.values(o).every(n)))throw createContractError(r.origin,t,r.exports);return{...e,...r.exports}},{});
@@ -1,6 +1,6 @@
1
1
  import { type Localizable } from '@salsita-ai/common/utils';
2
2
  import type { DeepWritable } from '../../utils/deep-writable.js';
3
- import { type ArrowHeadType } from './index.js';
3
+ import { type ArrowHeadType } from './dimension-indicators.js';
4
4
  export type DimensionIndicatorBaseState = {
5
5
  /**
6
6
  * Extrusion vector X coordinate. Determines where the indicator is shown in relation to the measured edge.
@@ -1 +1 @@
1
- import{EnhancedLocalizableSchema as e}from"@salsita-ai/common/utils";import{ArrowHeadTypeSchema as t}from"./index.js";export const DimensionIndicatorBaseProperties={extrusionX:{type:"number"},extrusionY:{type:"number"},extrusionZ:{type:"number"},labelFont:{type:"string"},labelFontSize:{type:"number"},labelAngle:{type:"number"},labelOffsetX:{type:"number"},labelOffsetY:{type:"number"},labelOffsetZ:{type:"number"},arrowHeadType:t,arrowHeadTypeStart:t,arrowHeadTypeEnd:t,arrowHeadSize:{type:"number"},arrowsMoveOutside:{type:"boolean"},indicatorLineDashed:{type:"boolean"},indicatorLineWidth:{type:"number"},extrusionLineDashed:{type:"boolean"},extrusionLineWidth:{type:"number"},dashScale:{type:"number"},indicatorAlwaysVisible:{type:"boolean"},renderOrder:{type:"number"},labelColor:{type:["string","number"]},indicatorLineColor:{type:["string","number"]},extrusionLineColor:{type:["string","number"]},labelDirection:{type:"string",enum:["auto","ltr","rtl"]},labelFillOpacity:{type:"number"},labelFontStyle:{type:"string",enum:["normal","italic"]},labelFontWeight:{type:["number","string"]},labelLetterSpacing:{type:"number"},labelLineHeight:{type:"number"},labelMaxWidth:{type:"number"},labelOutlineBlur:{type:["number","string"]},labelOutlineColor:{type:["string","number"]},labelOutlineOffsetX:{type:["number","string"]},labelOutlineOffsetY:{type:["number","string"]},labelOutlineOpacity:{type:"number"},labelOutlineWidth:{type:["number","string"]},labelOverflowWrap:{type:"string",enum:["normal","break-word"]},labelStrokeColor:{type:["string","number"]},labelStrokeOpacity:{type:"number"},labelStrokeWidth:{type:["number","string"]},labelWhiteSpace:{type:"string",enum:["normal","nowrap","pre-wrap"]},indicatorLineOutlineWidth:{type:"number"},indicatorLineOutlineColor:{type:["string","number"]},extrusionLineOutlineWidth:{type:"number"},extrusionLineOutlineColor:{type:["string","number"]},screenSized:{type:"boolean"},labelPrefix:e,labelPrefixFontColor:{type:["string","number"]}};export const DimensionIndicatorProperties={startX:{type:"number"},startY:{type:"number"},startZ:{type:"number"},endX:{type:"number"},endY:{type:"number"},endZ:{type:"number"},...DimensionIndicatorBaseProperties};
1
+ import{EnhancedLocalizableSchema as e}from"@salsita-ai/common/utils";import{ArrowHeadTypeSchema as t}from"./dimension-indicators.js";export const DimensionIndicatorBaseProperties={extrusionX:{type:"number"},extrusionY:{type:"number"},extrusionZ:{type:"number"},labelFont:{type:"string"},labelFontSize:{type:"number"},labelAngle:{type:"number"},labelOffsetX:{type:"number"},labelOffsetY:{type:"number"},labelOffsetZ:{type:"number"},arrowHeadType:t,arrowHeadTypeStart:t,arrowHeadTypeEnd:t,arrowHeadSize:{type:"number"},arrowsMoveOutside:{type:"boolean"},indicatorLineDashed:{type:"boolean"},indicatorLineWidth:{type:"number"},extrusionLineDashed:{type:"boolean"},extrusionLineWidth:{type:"number"},dashScale:{type:"number"},indicatorAlwaysVisible:{type:"boolean"},renderOrder:{type:"number"},labelColor:{type:["string","number"]},indicatorLineColor:{type:["string","number"]},extrusionLineColor:{type:["string","number"]},labelDirection:{type:"string",enum:["auto","ltr","rtl"]},labelFillOpacity:{type:"number"},labelFontStyle:{type:"string",enum:["normal","italic"]},labelFontWeight:{type:["number","string"]},labelLetterSpacing:{type:"number"},labelLineHeight:{type:"number"},labelMaxWidth:{type:"number"},labelOutlineBlur:{type:["number","string"]},labelOutlineColor:{type:["string","number"]},labelOutlineOffsetX:{type:["number","string"]},labelOutlineOffsetY:{type:["number","string"]},labelOutlineOpacity:{type:"number"},labelOutlineWidth:{type:["number","string"]},labelOverflowWrap:{type:"string",enum:["normal","break-word"]},labelStrokeColor:{type:["string","number"]},labelStrokeOpacity:{type:"number"},labelStrokeWidth:{type:["number","string"]},labelWhiteSpace:{type:"string",enum:["normal","nowrap","pre-wrap"]},indicatorLineOutlineWidth:{type:"number"},indicatorLineOutlineColor:{type:["string","number"]},extrusionLineOutlineWidth:{type:"number"},extrusionLineOutlineColor:{type:["string","number"]},screenSized:{type:"boolean"},labelPrefix:e,labelPrefixFontColor:{type:["string","number"]}};export const DimensionIndicatorProperties={startX:{type:"number"},startY:{type:"number"},startZ:{type:"number"},endX:{type:"number"},endY:{type:"number"},endZ:{type:"number"},...DimensionIndicatorBaseProperties};
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Toolbar button that opens and closes the built-in assistant panel. The default toolbar of the
3
+ * universal layout lists it, in a group of its own, when the application spec has an `assistant`
4
+ * section; a custom toolbar places it in a `toolbarButtonGroup` like any other button. It renders
5
+ * nothing in a project without an `assistant` section.
6
+ */
7
+ export interface AssistantToolbarButtonSchema {
8
+ readonly kind: 'assistantToolbarButton';
9
+ readonly props?: {
10
+ /**
11
+ * If true, the title is displayed on a desktop-sized layout; a phone or tablet-sized layout shows
12
+ * the icon only. By default true.
13
+ */
14
+ readonly showTitle?: boolean;
15
+ /**
16
+ * PHX icon name used instead of the default assistant icon.
17
+ */
18
+ readonly icon?: string;
19
+ };
20
+ }
21
+ export declare const assistantToolbarButtonSchema: {
22
+ readonly type: 'object';
23
+ readonly properties: {
24
+ readonly kind: {
25
+ readonly type: 'string';
26
+ readonly enum: ["assistantToolbarButton"];
27
+ };
28
+ readonly props: {
29
+ readonly type: 'object';
30
+ readonly properties: {
31
+ readonly showTitle: {
32
+ readonly type: 'boolean';
33
+ };
34
+ readonly icon: {
35
+ readonly type: 'string';
36
+ };
37
+ };
38
+ readonly required: [];
39
+ readonly additionalProperties: false;
40
+ };
41
+ };
42
+ readonly required: ["kind"];
43
+ readonly additionalProperties: false;
44
+ };
@@ -0,0 +1 @@
1
+ export const assistantToolbarButtonSchema={type:"object",properties:{kind:{type:"string",enum:["assistantToolbarButton"]},props:{type:"object",properties:{showTitle:{type:"boolean"},icon:{type:"string"}},required:[],additionalProperties:!1}},required:["kind"],additionalProperties:!1};
@@ -1,4 +1,5 @@
1
1
  export { type PhoenixLayoutElement, PhoenixLayoutElementSchema } from './phoenix-layout-element.js';
2
+ export { type AssistantToolbarButtonSchema, assistantToolbarButtonSchema } from './assistant-toolbar-button.js';
2
3
  export { type AdminConnectedResourcePageSchema, adminConnectedResourcePageSchema, } from './admin-connected-resource-page.js';
3
4
  export { type AdminDataTableActionsSchema, adminDataTableActionsSchema } from './admin-data-table-actions.js';
4
5
  export { type AdminDataTablePageSchema, adminDataTablePageSchema } from './admin-data-table-page.js';
@@ -1 +1 @@
1
- export{PhoenixLayoutElementSchema}from"./phoenix-layout-element.js";export{adminConnectedResourcePageSchema}from"./admin-connected-resource-page.js";export{adminDataTableActionsSchema}from"./admin-data-table-actions.js";export{adminDataTablePageSchema}from"./admin-data-table-page.js";export{adminPresetActionsSchema}from"./admin-preset-actions.js";export{adminPresetCategoryActionsSchema}from"./admin-preset-category-actions.js";export{adminPresetCategoryPageSchema}from"./admin-preset-category-page.js";export{adminPresetListPageSchema}from"./admin-preset-list-page.js";export{adminRecipeActionsSchema}from"./admin-recipe-actions.js";export{adminRecipeCollectionPageSchema}from"./admin-recipe-collection-page.js";export{customLayoutElementSchema}from"./custom-layout-element.js";export{enterSummaryButtonSchema}from"./enter-summary-button.js";export{enterFullscreenToolbarButtonSchema}from"./enter-fullscreen-toolbar-button.js";export{exitFullscreenToolbarButtonSchema}from"./exit-fullscreen-toolbar-button.js";export{footerPriceSchema}from"./footer-price.js";export{languageToolbarButtonSchema}from"./language-toolbar-button.js";export{mainFooterActionsSchema}from"./main-footer-actions.js";export{nextStepButtonSchema}from"./next-step-button.js";export{otherActionsSchema}from"./other-actions.js";export{previousStepButtonSchema}from"./previous-step-button.js";export{saveTemplateButtonSchema}from"./save-template-button.js";export{stepLabelSchema}from"./step-label.js";export{stepProgressSchema}from"./step-progress.js";export{shareToolbarButtonSchema}from"./share-toolbar-button.js";export{shareMenuActionSchema}from"./share-menu-action.js";export{toolbarButtonGroupSchema}from"./toolbar-button-group.js";export{undoToolbarButtonSchema}from"./undo-toolbar-button.js";export{redoToolbarButtonSchema}from"./redo-toolbar-button.js";export{resetCameraToolbarButtonSchema}from"./reset-camera-toolbar-button.js";export{measurementsToolbarButtonSchema}from"./measurements-toolbar-button.js";export{helpToolbarButtonSchema}from"./help-toolbar-button.js";export{measurementsMenuActionSchema}from"./measurements-menu-action.js";export{languageMenuActionSchema}from"./language-menu-action.js";export{helpMenuActionSchema}from"./help-menu-action.js";
1
+ export{PhoenixLayoutElementSchema}from"./phoenix-layout-element.js";export{assistantToolbarButtonSchema}from"./assistant-toolbar-button.js";export{adminConnectedResourcePageSchema}from"./admin-connected-resource-page.js";export{adminDataTableActionsSchema}from"./admin-data-table-actions.js";export{adminDataTablePageSchema}from"./admin-data-table-page.js";export{adminPresetActionsSchema}from"./admin-preset-actions.js";export{adminPresetCategoryActionsSchema}from"./admin-preset-category-actions.js";export{adminPresetCategoryPageSchema}from"./admin-preset-category-page.js";export{adminPresetListPageSchema}from"./admin-preset-list-page.js";export{adminRecipeActionsSchema}from"./admin-recipe-actions.js";export{adminRecipeCollectionPageSchema}from"./admin-recipe-collection-page.js";export{customLayoutElementSchema}from"./custom-layout-element.js";export{enterSummaryButtonSchema}from"./enter-summary-button.js";export{enterFullscreenToolbarButtonSchema}from"./enter-fullscreen-toolbar-button.js";export{exitFullscreenToolbarButtonSchema}from"./exit-fullscreen-toolbar-button.js";export{footerPriceSchema}from"./footer-price.js";export{languageToolbarButtonSchema}from"./language-toolbar-button.js";export{mainFooterActionsSchema}from"./main-footer-actions.js";export{nextStepButtonSchema}from"./next-step-button.js";export{otherActionsSchema}from"./other-actions.js";export{previousStepButtonSchema}from"./previous-step-button.js";export{saveTemplateButtonSchema}from"./save-template-button.js";export{stepLabelSchema}from"./step-label.js";export{stepProgressSchema}from"./step-progress.js";export{shareToolbarButtonSchema}from"./share-toolbar-button.js";export{shareMenuActionSchema}from"./share-menu-action.js";export{toolbarButtonGroupSchema}from"./toolbar-button-group.js";export{undoToolbarButtonSchema}from"./undo-toolbar-button.js";export{redoToolbarButtonSchema}from"./redo-toolbar-button.js";export{resetCameraToolbarButtonSchema}from"./reset-camera-toolbar-button.js";export{measurementsToolbarButtonSchema}from"./measurements-toolbar-button.js";export{helpToolbarButtonSchema}from"./help-toolbar-button.js";export{measurementsMenuActionSchema}from"./measurements-menu-action.js";export{languageMenuActionSchema}from"./language-menu-action.js";export{helpMenuActionSchema}from"./help-menu-action.js";
@@ -8,6 +8,7 @@ import { type AdminPresetCategoryPageSchema } from './admin-preset-category-page
8
8
  import { type AdminPresetListPageSchema } from './admin-preset-list-page.js';
9
9
  import { type AdminRecipeActionsSchema } from './admin-recipe-actions.js';
10
10
  import { type AdminRecipeCollectionPageSchema } from './admin-recipe-collection-page.js';
11
+ import { type AssistantToolbarButtonSchema } from './assistant-toolbar-button.js';
11
12
  import { type CustomLayoutElementSchema } from './custom-layout-element.js';
12
13
  import { type EnterFullscreenToolbarButtonSchema } from './enter-fullscreen-toolbar-button.js';
13
14
  import { type EnterSummaryButtonSchema } from './enter-summary-button.js';
@@ -32,5 +33,5 @@ import { type StepLabelSchema } from './step-label.js';
32
33
  import { type StepProgressSchema } from './step-progress.js';
33
34
  import { type ToolbarButtonGroupSchema } from './toolbar-button-group.js';
34
35
  import { type UndoToolbarButtonSchema } from './undo-toolbar-button.js';
35
- export type PhoenixLayoutElement = CustomLayoutElementSchema | AdminPresetCategoryPageSchema | AdminPresetCategoryActionsSchema | AdminPresetListPageSchema | AdminPresetActionsSchema | AdminRecipeCollectionPageSchema | AdminRecipeActionsSchema | AdminDataTablePageSchema | AdminDataTableActionsSchema | AdminConnectedResourcePageSchema | EnterSummaryButtonSchema | EnterFullscreenToolbarButtonSchema | ExitFullscreenToolbarButtonSchema | FooterPriceSchema | LanguageToolbarButtonSchema | MainFooterActionsSchema | NextStepButtonSchema | OtherActionsSchema | PreviousStepButtonSchema | SaveTemplateButtonSchema | StepLabelSchema | StepProgressSchema | ToolbarButtonGroupSchema | ShareMenuActionSchema | ShareToolbarButtonSchema | UndoToolbarButtonSchema | RedoToolbarButtonSchema | ResetCameraToolbarButtonSchema | MeasurementsToolbarButtonSchema | HelpToolbarButtonSchema | MeasurementsMenuActionSchema | LanguageMenuActionSchema | HelpMenuActionSchema;
36
+ export type PhoenixLayoutElement = CustomLayoutElementSchema | AdminPresetCategoryPageSchema | AdminPresetCategoryActionsSchema | AdminPresetListPageSchema | AdminPresetActionsSchema | AdminRecipeCollectionPageSchema | AdminRecipeActionsSchema | AdminDataTablePageSchema | AdminDataTableActionsSchema | AdminConnectedResourcePageSchema | EnterSummaryButtonSchema | EnterFullscreenToolbarButtonSchema | ExitFullscreenToolbarButtonSchema | FooterPriceSchema | LanguageToolbarButtonSchema | MainFooterActionsSchema | NextStepButtonSchema | OtherActionsSchema | PreviousStepButtonSchema | SaveTemplateButtonSchema | StepLabelSchema | StepProgressSchema | ToolbarButtonGroupSchema | ShareMenuActionSchema | ShareToolbarButtonSchema | UndoToolbarButtonSchema | RedoToolbarButtonSchema | ResetCameraToolbarButtonSchema | MeasurementsToolbarButtonSchema | AssistantToolbarButtonSchema | HelpToolbarButtonSchema | MeasurementsMenuActionSchema | LanguageMenuActionSchema | HelpMenuActionSchema;
36
37
  export declare const PhoenixLayoutElementSchema: ExtendedJsonSchema;
@@ -1 +1 @@
1
- import{adminConnectedResourcePageSchema as o}from"./admin-connected-resource-page.js";import{adminDataTableActionsSchema as t}from"./admin-data-table-actions.js";import{adminDataTablePageSchema as r}from"./admin-data-table-page.js";import{adminPresetActionsSchema as m}from"./admin-preset-actions.js";import{adminPresetCategoryActionsSchema as e}from"./admin-preset-category-actions.js";import{adminPresetCategoryPageSchema as s}from"./admin-preset-category-page.js";import{adminPresetListPageSchema as a}from"./admin-preset-list-page.js";import{adminRecipeActionsSchema as i}from"./admin-recipe-actions.js";import{adminRecipeCollectionPageSchema as n}from"./admin-recipe-collection-page.js";import{customLayoutElementSchema as p}from"./custom-layout-element.js";import{enterFullscreenToolbarButtonSchema as f}from"./enter-fullscreen-toolbar-button.js";import{enterSummaryButtonSchema as u}from"./enter-summary-button.js";import{exitFullscreenToolbarButtonSchema as j}from"./exit-fullscreen-toolbar-button.js";import{footerPriceSchema as l}from"./footer-price.js";import{helpMenuActionSchema as b}from"./help-menu-action.js";import{helpToolbarButtonSchema as c}from"./help-toolbar-button.js";import{languageMenuActionSchema as d}from"./language-menu-action.js";import{languageToolbarButtonSchema as g}from"./language-toolbar-button.js";import{mainFooterActionsSchema as h}from"./main-footer-actions.js";import{measurementsMenuActionSchema as y}from"./measurements-menu-action.js";import{measurementsToolbarButtonSchema as x}from"./measurements-toolbar-button.js";import{nextStepButtonSchema as E}from"./next-step-button.js";import{otherActionsSchema as L}from"./other-actions.js";import{previousStepButtonSchema as P}from"./previous-step-button.js";import{redoToolbarButtonSchema as v}from"./redo-toolbar-button.js";import{resetCameraToolbarButtonSchema as k}from"./reset-camera-toolbar-button.js";import{saveTemplateButtonSchema as O}from"./save-template-button.js";import{shareMenuActionSchema as S}from"./share-menu-action.js";import{shareToolbarButtonSchema as T}from"./share-toolbar-button.js";import{stepLabelSchema as q}from"./step-label.js";import{stepProgressSchema as w}from"./step-progress.js";import{toolbarButtonGroupSchema as z}from"./toolbar-button-group.js";import{undoToolbarButtonSchema as A}from"./undo-toolbar-button.js";export const PhoenixLayoutElementSchema={tsType:"PhoenixLayoutElement",import:[{module:"@salsita-ai/sdk/domain",member:"PhoenixLayoutElement"}],anyOf:[p,s,e,a,m,n,i,r,t,o,u,f,l,g,h,E,L,P,O,q,w,z,j,T,S,A,v,k,x,c,y,d,b]};
1
+ import{adminConnectedResourcePageSchema as o}from"./admin-connected-resource-page.js";import{adminDataTableActionsSchema as t}from"./admin-data-table-actions.js";import{adminDataTablePageSchema as r}from"./admin-data-table-page.js";import{adminPresetActionsSchema as m}from"./admin-preset-actions.js";import{adminPresetCategoryActionsSchema as e}from"./admin-preset-category-actions.js";import{adminPresetCategoryPageSchema as s}from"./admin-preset-category-page.js";import{adminPresetListPageSchema as a}from"./admin-preset-list-page.js";import{adminRecipeActionsSchema as i}from"./admin-recipe-actions.js";import{adminRecipeCollectionPageSchema as n}from"./admin-recipe-collection-page.js";import{assistantToolbarButtonSchema as p}from"./assistant-toolbar-button.js";import{customLayoutElementSchema as f}from"./custom-layout-element.js";import{enterFullscreenToolbarButtonSchema as u}from"./enter-fullscreen-toolbar-button.js";import{enterSummaryButtonSchema as j}from"./enter-summary-button.js";import{exitFullscreenToolbarButtonSchema as l}from"./exit-fullscreen-toolbar-button.js";import{footerPriceSchema as b}from"./footer-price.js";import{helpMenuActionSchema as c}from"./help-menu-action.js";import{helpToolbarButtonSchema as d}from"./help-toolbar-button.js";import{languageMenuActionSchema as g}from"./language-menu-action.js";import{languageToolbarButtonSchema as h}from"./language-toolbar-button.js";import{mainFooterActionsSchema as y}from"./main-footer-actions.js";import{measurementsMenuActionSchema as x}from"./measurements-menu-action.js";import{measurementsToolbarButtonSchema as E}from"./measurements-toolbar-button.js";import{nextStepButtonSchema as L}from"./next-step-button.js";import{otherActionsSchema as P}from"./other-actions.js";import{previousStepButtonSchema as v}from"./previous-step-button.js";import{redoToolbarButtonSchema as k}from"./redo-toolbar-button.js";import{resetCameraToolbarButtonSchema as O}from"./reset-camera-toolbar-button.js";import{saveTemplateButtonSchema as S}from"./save-template-button.js";import{shareMenuActionSchema as T}from"./share-menu-action.js";import{shareToolbarButtonSchema as q}from"./share-toolbar-button.js";import{stepLabelSchema as w}from"./step-label.js";import{stepProgressSchema as z}from"./step-progress.js";import{toolbarButtonGroupSchema as A}from"./toolbar-button-group.js";import{undoToolbarButtonSchema as B}from"./undo-toolbar-button.js";export const PhoenixLayoutElementSchema={tsType:"PhoenixLayoutElement",import:[{module:"@salsita-ai/sdk/domain",member:"PhoenixLayoutElement"}],anyOf:[f,s,e,a,m,n,i,r,t,o,j,u,b,h,y,L,P,v,S,w,z,A,l,q,T,B,k,O,E,p,d,x,g,c]};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as i,Fragment as t}from"react/jsx-runtime";import{Box as o,Chip as n,CssBaseline as r,IconButton as s,ThemeProvider as l,Tooltip as a,Typography as d,createTheme as c,useMediaQuery as m,useTheme as p}from"@mui/material";import{ModalProvider as f}from"mui-modal-provider";import{memo as h,useCallback as u,useEffect as g,useRef as w,useState as k}from"react";import{match as x}from"ts-pattern";import{useLocalStorage as y}from"usehooks-ts";import{PhxIcon as b,SnackbarProvider as v,createThemeWithPhoenixIcons as S}from"#package/ui-sdk";import{EditorMode as P}from"./EditorMode.js";import{EditorRuntimeProvider as j,useWebComponent as V}from"./EditorRuntimeProvider.js";import{EditorAdminContextProvider as E}from"./admin/EditorAdminContext.js";import{EditorAdminMainContent as D}from"./admin/EditorAdminMainContent.js";import{EditorAdminSidebar as C}from"./admin/EditorAdminSidebar.js";import{useEditorAdminState as T}from"./admin/use-editor-admin-state.js";import{Analytics as A}from"./analytics/Analytics.js";import{AnalyticsProvider as L}from"./analytics/AnalyticsContext.js";import{Logotype as M}from"./common/Logotype.js";import{PanelIconButton as W}from"./common/PanelIconButton.js";import{BrowserConsoleReporter as R}from"./console-reporter/BrowserConsoleReporter.js";import{DataHandler as I}from"./data/DataHandler.js";import{DebugFlags as F}from"./debug-flags/DebugFlags.js";import{DiagnosticsPanel as G}from"./diagnostics/DiagnosticsPanel.js";import{DomainEditors as z}from"./domain-editors/DomainEditors.js";import{DomainSpecProvider as B,useDomainSpecContext as Q}from"./domain-editors/DomainSpecContext.js";import{DomainReflection as H}from"./domain-reflection/DomainReflection.js";import{GraphQLPanel as U}from"./graphql/GraphQLPanel.js";import{LogsPanel as q}from"./logs/LogsPanel.js";import{EditorMockProvider as O}from"./mocks/EditorMockContext.js";import{Mocks as K}from"./mocks/Mocks.js";import{ProfilerPanel as N}from"./profiler/ProfilerPanel.js";import{RemoteFilesList as X}from"./remote-files/RemoteFilesList.js";import{SceneHandler as Y}from"./scene/SceneHandler.js";import{ScreenshotHandler as $}from"./screenshot/ScreenshotHandler.js";import{EditorConnectionProvider as J}from"./services/EditorConnectionContext.js";import{EditorActionButtons as Z}from"./sidebar/EditorActionButtons.js";import{StateInspector as _}from"./state-inspector/index.js";import{StateHandler as ee}from"./state/StateHandler.js";import{SpaTemplate as ei}from"./templates/SpaTemplate.js";import{Templates as et}from"./templates/Templates.js";import{TemplatesList as eo}from"./templates/TemplatesList.js";import{TunnelProvider as en,useTunnel as er}from"./tunnel/TunnelContext.js";import{TunnelPanel as es}from"./tunnel/TunnelPanel.js";import{hasTunnelProblem as el}from"./tunnel/tunnel-view-model.js";import{VideoStudio as ea}from"./video-studio/VideoStudio.js";import{WebSocketStatus as ed}from"./websocket-status/WebSocketStatus.js";let ec=h(()=>{let i=w(null),t=V();return g(()=>{let e=i.current;if(e&&t)return e.appendChild(t),()=>{e.contains(t)&&e.removeChild(t)}},[t]),e("div",{ref:i,style:{width:"100%",height:"100%"}})}),em=S(c());export const EditorPanelView={Files:"Files",Reflections:"Reflections",Domain:"Domain",Templates:"Templates",Mocks:"Mocks",Inspector:"Inspector",Debug:"Debug",Profiler:"Profiler",GraphQL:"GraphQL",VideoStudio:"VideoStudio",Analytics:"Analytics",Diagnostics:"Diagnostics",Logs:"Logs",Tunnel:"Tunnel",WebSocketStatus:"WebSocketStatus",Admin:"Admin"};let ep=[{key:EditorPanelView.Templates,icon:"GridFour",title:"Templates"},{key:EditorPanelView.Reflections,icon:"House",title:"Reflections"},{key:EditorPanelView.Files,icon:"List",title:"Files"},{key:EditorPanelView.Domain,icon:"Gear",title:"Domain"},{key:EditorPanelView.Mocks,icon:"TagBold",title:"Mocks"},{key:EditorPanelView.Inspector,icon:"CurrencyDollar",title:"Inspector"},{key:EditorPanelView.Debug,icon:"EyeBold",title:"Debug"},{key:EditorPanelView.Profiler,icon:"Alarm",title:"Profiler"},{key:EditorPanelView.GraphQL,icon:"MagnifyingGlassBold",title:"GraphQL"},{key:EditorPanelView.VideoStudio,icon:"CameraRotate",title:"Video Studio"},{key:EditorPanelView.Analytics,icon:"Flame",title:"Analytics"},{key:EditorPanelView.Diagnostics,icon:"WarningCircle",title:"Diagnostics"},{key:EditorPanelView.Logs,icon:"BracketsCurly",title:"Logs"},{key:EditorPanelView.Tunnel,icon:"ArrowsHorizontal",title:"Webhook Tunnel"}],ef=h(r=>{let{panelView:l,setPanelView:c,width:m,setWidth:p,selectedTemplate:f,setSelectedTemplate:h,isResizing:w,setIsResizing:y,onExit:v,enableAdmin:S}=r,P=T(S),{unreadDiagnosticCount:j,markDiagnosticsRead:V}=Q(),{state:E}=er(),L=l?Math.max(m,240):38,[R,I]=k(0),B=u(()=>I(e=>e+1),[]);return g(()=>{l===EditorPanelView.Diagnostics&&V()},[V,l]),i(o,{component:"div",sx:{display:"grid",gridTemplateColumns:`${L}px min-content auto`,gridTemplateRows:"minmax(0, 1fr)",width:"100vw",height:"100vh",backgroundColor:"#ffffff",overflow:"hidden"},onMouseMove:e=>{w&&p(e.clientX)},onMouseUp:()=>{y(!1)},children:[i(o,{component:"div",sx:{display:"grid",gridTemplateColumns:"36px auto",backgroundColor:"#f8f9fa",borderRight:"1px solid #dee2e6",boxShadow:"2px 0 8px rgba(0, 0, 0, 0.06)",overflow:"hidden",height:"100%"},children:[i("div",{style:{backgroundColor:"#f8f9fa",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",padding:"4px 0"},children:[e("div",{style:{marginBottom:"8px"},children:e(M,{variant:"icon-only"})}),i("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"2px"},children:[S&&i(t,{children:[e(W,{icon:"SlidersHorizontal",title:"Admin",active:l===EditorPanelView.Admin,onClick:()=>{l===EditorPanelView.Admin?c(null):c(EditorPanelView.Admin)}}),e("div",{style:{borderBottom:"1px solid #dee2e6",margin:"2px 0"}})]}),ep.map(i=>e(W,{icon:i.icon,title:i.title,active:l===i.key,badgeCount:i.key===EditorPanelView.Tunnel?+!!el(E):i.key===EditorPanelView.Diagnostics?j:0,onClick:()=>{l===i.key?c(null):c(i.key)}},i.key))]}),e(Z,{reload:B}),e("div",{style:{padding:"0 2px",paddingBottom:"4px"},children:e(W,{icon:"CloudArrowUp",title:"WebSocket Status",active:l===EditorPanelView.WebSocketStatus,onClick:()=>{l===EditorPanelView.WebSocketStatus?c(null):c(EditorPanelView.WebSocketStatus)}})}),v&&e("div",{style:{padding:"0 2px",paddingBottom:"8px"},children:e(W,{icon:"SignOut",title:"Exit Editor",variant:"danger",onClick:v})})]}),l&&i(o,{component:"div",sx:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden",backgroundColor:"#ffffff"},children:[e(o,{component:"div",sx:{p:1.5,borderBottom:"1px solid #e9ecef",backgroundColor:"#ffffff"},children:i(o,{component:"div",sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[i(o,{component:"div",sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e(d,{variant:"h6",sx:{fontSize:16,fontWeight:600,color:"#212529"},children:x(l).with("Files",()=>"Files").with("Reflections",()=>"Reflections").with("Domain",()=>"Domain").with("Templates",()=>"Templates").with("Mocks",()=>"Mocks").with("Inspector",()=>"State Inspector").with("Debug",()=>"Debug").with("Profiler",()=>"Profiler").with("GraphQL",()=>"GraphQL").with("VideoStudio",()=>"Video Studio").with("Analytics",()=>"Analytics").with("Diagnostics",()=>"Diagnostics").with("Logs",()=>"Dev Server Logs").with("Tunnel",()=>"Webhook Tunnel").with("WebSocketStatus",()=>"WebSocket Status").with("Admin",()=>"Admin").otherwise(e=>e)}),e(a,{title:x(l).with("Files",()=>"Browse and inspect loaded GLTF files and their contents").with("Reflections",()=>"Inspect internal Phoenix systems state and configuration").with("Domain",()=>"Edit YAML domain specifications and component configurations").with("Templates",()=>"Select different layout templates for the configurator interface").with("Mocks",()=>"Create and manage mock data for testing session and access configurations").with("Inspector",()=>"Walk the entity tree: fields, expressions, and children").with("Debug",()=>"Toggle scene debug visuals like offset anchors, snapping, and collision meshes").with("Profiler",()=>"Make domain expressions show up as named frames in browser CPU profiles").with("GraphQL",()=>"Run GraphQL queries against the schema generated from the assistant manifest").with("VideoStudio",()=>"Create video sequences by capturing keyframes and exporting as video").with("Analytics",()=>"View parse pipeline metrics, domain stats, and diagnostics").with("Diagnostics",()=>"View latest editor warnings and errors").with("Logs",()=>"View dev server logs: spec builds, webhooks, vite, and browser console").with("Tunnel",()=>"View webhook tunnel status and the requests routed through it").with("WebSocketStatus",()=>"View WebSocket connection status and editor mode information").with("Admin",()=>"Manage admin panel, publish data, and configure settings").otherwise(()=>"Panel information"),placement:"left",arrow:!0,children:e(s,{size:"small",sx:{ml:1,color:"#6c757d",fontSize:14,p:.25,"&:hover":{backgroundColor:"#f8f9fa",color:"#495057"}},children:e(b,{name:"Info",style:{fontSize:14}})})})]}),e(o,{component:"div",sx:{display:"flex",alignItems:"center",gap:1},children:"Templates"===l&&e(n,{label:f.charAt(0).toUpperCase()+f.slice(1),variant:"outlined",size:"small",sx:{backgroundColor:"#f8f9fa",borderColor:"#dee2e6",color:"#495057",fontWeight:500,fontSize:"0.75rem"}})})]})}),i(o,{component:"div",sx:{flex:1,backgroundColor:"#ffffff",overflow:"auto"},children:["Files"===l&&e(X,{}),"Reflections"===l&&e(H,{}),"Domain"===l&&e(z,{}),"Templates"===l&&e(eo,{selectedTemplate:f,onTemplateSelect:h}),"Mocks"===l&&e(K,{}),"Inspector"===l&&e(_,{}),"Debug"===l&&e(F,{}),"Profiler"===l&&e(N,{}),"GraphQL"===l&&e(U,{}),"VideoStudio"===l&&e(ea,{}),"Analytics"===l&&e(A,{}),"Diagnostics"===l&&e(G,{}),"Logs"===l&&e(q,{}),"Tunnel"===l&&e(es,{}),"WebSocketStatus"===l&&e(ed,{}),S&&"Admin"===l&&e(C,{...P})]})]})]}),e("div",{style:{width:"2px",backgroundColor:"#dee2e6",cursor:"ew-resize",boxShadow:"1px 0 3px rgba(0, 0, 0, 0.05)"},onMouseDown:()=>{y(!0)}}),i("div",{style:{position:"relative",overflow:"hidden"},children:[e("div",{style:{position:"absolute",inset:0,zIndex:+("Admin"!==l)},children:e(et,{selectedTemplate:f,children:e(ec,{},R)})}),S&&e("div",{style:{position:"absolute",inset:0,zIndex:+("Admin"===l)},children:e(D,{})})]})]})}),eh=h(()=>e(ei,{children:e(ec,{})})),eu=h(o=>{let{wsUrl:n="ws://localhost:3020",localMode:r=!1,domainSpec:s,initialRawProjectFiles:l,onExit:a,mockTemplates:d,autoApplyTemplate:c,environmentKey:h,tagName:u,enableAdmin:w=!0}=o,x=m(p().breakpoints.up("md")),[b,S]=y("editor-width",350),[V,D]=y("editor-view",null),[C,T]=y("editor-template","spa"),[A,M]=k(!1);return g(()=>{null===V||Object.values(EditorPanelView).some(e=>e===V)&&(w||V!==EditorPanelView.Admin)||D(null)},[w,V,D]),e(f,{children:e(v,{maxSnack:5,children:e(E,{children:e(j,{tagName:u,children:e(J,{initialWsUrl:n,localMode:r,children:e(en,{children:e(P,{children:e(L,{children:e(B,{domainSpec:s,initialRawProjectFiles:l,children:i(O,{mockTemplates:d,autoApplyTemplate:c,environmentKey:h,children:[!r&&i(t,{children:[e($,{}),e(ee,{}),e(I,{}),e(Y,{}),e(R,{})]}),x?e(ef,{panelView:V,setPanelView:D,width:b,setWidth:S,selectedTemplate:C,setSelectedTemplate:T,isResizing:A,setIsResizing:M,onExit:a,enableAdmin:w}):e(eh,{})]})})})})})})})})})})});export const Editor=h(t=>i(l,{theme:em,children:[e(r,{}),e(eu,{...t})]}));
1
+ import{jsx as e,jsxs as i,Fragment as t}from"react/jsx-runtime";import{Box as o,Chip as n,CssBaseline as r,IconButton as s,ThemeProvider as a,Tooltip as l,Typography as d,createTheme as c,useMediaQuery as m,useTheme as p}from"@mui/material";import{ModalProvider as f}from"mui-modal-provider";import{memo as h,useCallback as u,useEffect as g,useState as w}from"react";import{match as k}from"ts-pattern";import{useLocalStorage as y}from"usehooks-ts";import{PhxIcon as x,SnackbarProvider as b,createThemeWithPhoenixIcons as v}from"#package/ui-sdk";import{EditorMode as S}from"./EditorMode.js";import{EditorRuntimeProvider as P}from"./EditorRuntimeProvider.js";import{EditorAdminContextProvider as j}from"./admin/EditorAdminContext.js";import{EditorAdminMainContent as V}from"./admin/EditorAdminMainContent.js";import{EditorAdminSidebar as E}from"./admin/EditorAdminSidebar.js";import{useEditorAdminState as D}from"./admin/use-editor-admin-state.js";import{Analytics as T}from"./analytics/Analytics.js";import{AnalyticsProvider as A}from"./analytics/AnalyticsContext.js";import{Logotype as C}from"./common/Logotype.js";import{PanelIconButton as L}from"./common/PanelIconButton.js";import{BrowserConsoleReporter as M}from"./console-reporter/BrowserConsoleReporter.js";import{DataHandler as W}from"./data/DataHandler.js";import{DebugFlags as R}from"./debug-flags/DebugFlags.js";import{DiagnosticsPanel as I}from"./diagnostics/DiagnosticsPanel.js";import{DomainEditors as F}from"./domain-editors/DomainEditors.js";import{DomainSpecProvider as G,useDomainSpecContext as z}from"./domain-editors/DomainSpecContext.js";import{DomainReflection as B}from"./domain-reflection/DomainReflection.js";import{GraphQLPanel as Q}from"./graphql/GraphQLPanel.js";import{LogsPanel as H}from"./logs/LogsPanel.js";import{EditorMockProvider as U}from"./mocks/EditorMockContext.js";import{Mocks as q}from"./mocks/Mocks.js";import{ProfilerPanel as O}from"./profiler/ProfilerPanel.js";import{RemoteFilesList as K}from"./remote-files/RemoteFilesList.js";import{SceneHandler as N}from"./scene/SceneHandler.js";import{ScreenshotHandler as X}from"./screenshot/ScreenshotHandler.js";import{EditorConnectionProvider as Y}from"./services/EditorConnectionContext.js";import{EditorActionButtons as $}from"./sidebar/EditorActionButtons.js";import{StateInspector as J}from"./state-inspector/index.js";import{StateHandler as Z}from"./state/StateHandler.js";import{SpaTemplate as _}from"./templates/SpaTemplate.js";import{Templates as ee}from"./templates/Templates.js";import{TemplatesList as ei}from"./templates/TemplatesList.js";import{TunnelProvider as et,useTunnel as eo}from"./tunnel/TunnelContext.js";import{TunnelPanel as en}from"./tunnel/TunnelPanel.js";import{hasTunnelProblem as er}from"./tunnel/tunnel-view-model.js";import{HTML_VARIANT_FRAME_ATTRIBUTE as es,VariantPreviewHandler as ea,useConfiguratorContainerRef as el}from"./variants/VariantPreviewHandler.js";import{VideoStudio as ed}from"./video-studio/VideoStudio.js";import{WebSocketStatus as ec}from"./websocket-status/WebSocketStatus.js";let em=h(()=>e("div",{ref:el(),style:{width:"100%",height:"100%"}})),ep=v(c());export const EditorPanelView={Files:"Files",Reflections:"Reflections",Domain:"Domain",Templates:"Templates",Mocks:"Mocks",Inspector:"Inspector",Debug:"Debug",Profiler:"Profiler",GraphQL:"GraphQL",VideoStudio:"VideoStudio",Analytics:"Analytics",Diagnostics:"Diagnostics",Logs:"Logs",Tunnel:"Tunnel",WebSocketStatus:"WebSocketStatus",Admin:"Admin"};let ef=[{key:EditorPanelView.Templates,icon:"GridFour",title:"Templates"},{key:EditorPanelView.Reflections,icon:"House",title:"Reflections"},{key:EditorPanelView.Files,icon:"List",title:"Files"},{key:EditorPanelView.Domain,icon:"Gear",title:"Domain"},{key:EditorPanelView.Mocks,icon:"TagBold",title:"Mocks"},{key:EditorPanelView.Inspector,icon:"CurrencyDollar",title:"Inspector"},{key:EditorPanelView.Debug,icon:"EyeBold",title:"Debug"},{key:EditorPanelView.Profiler,icon:"Alarm",title:"Profiler"},{key:EditorPanelView.GraphQL,icon:"MagnifyingGlassBold",title:"GraphQL"},{key:EditorPanelView.VideoStudio,icon:"CameraRotate",title:"Video Studio"},{key:EditorPanelView.Analytics,icon:"Flame",title:"Analytics"},{key:EditorPanelView.Diagnostics,icon:"WarningCircle",title:"Diagnostics"},{key:EditorPanelView.Logs,icon:"BracketsCurly",title:"Logs"},{key:EditorPanelView.Tunnel,icon:"ArrowsHorizontal",title:"Webhook Tunnel"}],eh=h(r=>{let{panelView:a,setPanelView:c,width:m,setWidth:p,selectedTemplate:f,setSelectedTemplate:h,isResizing:y,setIsResizing:b,onExit:v,enableAdmin:S}=r,P=D(S),{unreadDiagnosticCount:j,markDiagnosticsRead:A}=z(),{state:M}=eo(),W=a?Math.max(m,240):38,[G,U]=w(0),N=u(()=>U(e=>e+1),[]);return g(()=>{a===EditorPanelView.Diagnostics&&A()},[A,a]),i(o,{component:"div",sx:{display:"grid",gridTemplateColumns:`${W}px min-content auto`,gridTemplateRows:"minmax(0, 1fr)",width:"100vw",height:"100vh",backgroundColor:"#ffffff",overflow:"hidden"},onMouseMove:e=>{y&&p(e.clientX)},onMouseUp:()=>{b(!1)},children:[i(o,{component:"div",sx:{display:"grid",gridTemplateColumns:"36px auto",backgroundColor:"#f8f9fa",borderRight:"1px solid #dee2e6",boxShadow:"2px 0 8px rgba(0, 0, 0, 0.06)",overflow:"hidden",height:"100%"},children:[i("div",{style:{backgroundColor:"#f8f9fa",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",padding:"4px 0"},children:[e("div",{style:{marginBottom:"8px"},children:e(C,{variant:"icon-only"})}),i("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"2px"},children:[S&&i(t,{children:[e(L,{icon:"SlidersHorizontal",title:"Admin",active:a===EditorPanelView.Admin,onClick:()=>{a===EditorPanelView.Admin?c(null):c(EditorPanelView.Admin)}}),e("div",{style:{borderBottom:"1px solid #dee2e6",margin:"2px 0"}})]}),ef.map(i=>e(L,{icon:i.icon,title:i.title,active:a===i.key,badgeCount:i.key===EditorPanelView.Tunnel?+!!er(M):i.key===EditorPanelView.Diagnostics?j:0,onClick:()=>{a===i.key?c(null):c(i.key)}},i.key))]}),e($,{reload:N}),e("div",{style:{padding:"0 2px",paddingBottom:"4px"},children:e(L,{icon:"CloudArrowUp",title:"WebSocket Status",active:a===EditorPanelView.WebSocketStatus,onClick:()=>{a===EditorPanelView.WebSocketStatus?c(null):c(EditorPanelView.WebSocketStatus)}})}),v&&e("div",{style:{padding:"0 2px",paddingBottom:"8px"},children:e(L,{icon:"SignOut",title:"Exit Editor",variant:"danger",onClick:v})})]}),a&&i(o,{component:"div",sx:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden",backgroundColor:"#ffffff"},children:[e(o,{component:"div",sx:{p:1.5,borderBottom:"1px solid #e9ecef",backgroundColor:"#ffffff"},children:i(o,{component:"div",sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[i(o,{component:"div",sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e(d,{variant:"h6",sx:{fontSize:16,fontWeight:600,color:"#212529"},children:k(a).with("Files",()=>"Files").with("Reflections",()=>"Reflections").with("Domain",()=>"Domain").with("Templates",()=>"Templates").with("Mocks",()=>"Mocks").with("Inspector",()=>"State Inspector").with("Debug",()=>"Debug").with("Profiler",()=>"Profiler").with("GraphQL",()=>"GraphQL").with("VideoStudio",()=>"Video Studio").with("Analytics",()=>"Analytics").with("Diagnostics",()=>"Diagnostics").with("Logs",()=>"Dev Server Logs").with("Tunnel",()=>"Webhook Tunnel").with("WebSocketStatus",()=>"WebSocket Status").with("Admin",()=>"Admin").otherwise(e=>e)}),e(l,{title:k(a).with("Files",()=>"Browse and inspect loaded GLTF files and their contents").with("Reflections",()=>"Inspect internal Phoenix systems state and configuration").with("Domain",()=>"Edit YAML domain specifications and component configurations").with("Templates",()=>"Select different layout templates for the configurator interface").with("Mocks",()=>"Create and manage mock data for testing session and access configurations").with("Inspector",()=>"Walk the entity tree: fields, expressions, and children").with("Debug",()=>"Toggle scene debug visuals like offset anchors, snapping, and collision meshes").with("Profiler",()=>"Make domain expressions show up as named frames in browser CPU profiles").with("GraphQL",()=>"Run GraphQL queries against the schema generated from the assistant manifest").with("VideoStudio",()=>"Create video sequences by capturing keyframes and exporting as video").with("Analytics",()=>"View parse pipeline metrics, domain stats, and diagnostics").with("Diagnostics",()=>"View latest editor warnings and errors").with("Logs",()=>"View dev server logs: spec builds, webhooks, vite, and browser console").with("Tunnel",()=>"View webhook tunnel status and the requests routed through it").with("WebSocketStatus",()=>"View WebSocket connection status and editor mode information").with("Admin",()=>"Manage admin panel, publish data, and configure settings").otherwise(()=>"Panel information"),placement:"left",arrow:!0,children:e(s,{size:"small",sx:{ml:1,color:"#6c757d",fontSize:14,p:.25,"&:hover":{backgroundColor:"#f8f9fa",color:"#495057"}},children:e(x,{name:"Info",style:{fontSize:14}})})})]}),e(o,{component:"div",sx:{display:"flex",alignItems:"center",gap:1},children:"Templates"===a&&e(n,{label:f.charAt(0).toUpperCase()+f.slice(1),variant:"outlined",size:"small",sx:{backgroundColor:"#f8f9fa",borderColor:"#dee2e6",color:"#495057",fontWeight:500,fontSize:"0.75rem"}})})]})}),i(o,{component:"div",sx:{flex:1,backgroundColor:"#ffffff",overflow:"auto"},children:["Files"===a&&e(K,{}),"Reflections"===a&&e(B,{}),"Domain"===a&&e(F,{}),"Templates"===a&&e(ei,{selectedTemplate:f,onTemplateSelect:h}),"Mocks"===a&&e(q,{}),"Inspector"===a&&e(J,{}),"Debug"===a&&e(R,{}),"Profiler"===a&&e(O,{}),"GraphQL"===a&&e(Q,{}),"VideoStudio"===a&&e(ed,{}),"Analytics"===a&&e(T,{}),"Diagnostics"===a&&e(I,{}),"Logs"===a&&e(H,{}),"Tunnel"===a&&e(en,{}),"WebSocketStatus"===a&&e(ec,{}),S&&"Admin"===a&&e(E,{...P})]})]})]}),e("div",{style:{width:"2px",backgroundColor:"#dee2e6",cursor:"ew-resize",boxShadow:"1px 0 3px rgba(0, 0, 0, 0.05)"},onMouseDown:()=>{b(!0)}}),i("div",{style:{position:"relative",overflow:"hidden"},children:[e("div",{style:{position:"absolute",inset:0,zIndex:+("Admin"!==a)},children:e(ee,{selectedTemplate:f,children:e(em,{},G)})}),S&&e("div",{style:{position:"absolute",inset:0,zIndex:+("Admin"===a)},children:e(V,{})})]})]})}),eu=h(()=>e(_,{children:e(em,{})})),eg=h(o=>{let{wsUrl:n="ws://localhost:3020",localMode:r=!1,domainSpec:s,initialRawProjectFiles:a,onExit:l,mockTemplates:d,autoApplyTemplate:c,environmentKey:h,tagName:u,enableAdmin:k=!0}=o,x=m(p().breakpoints.up("md")),[v,V]=y("editor-width",350),[E,D]=y("editor-view",null),[T,C]=y("editor-template","spa"),[L,R]=w(!1);return g(()=>{null===E||Object.values(EditorPanelView).some(e=>e===E)&&(k||E!==EditorPanelView.Admin)||D(null)},[k,E,D]),e(f,{children:e(b,{maxSnack:5,children:e(j,{children:e(P,{tagName:u,children:e(Y,{initialWsUrl:n,localMode:r,children:e(et,{children:e(S,{children:e(A,{children:e(G,{domainSpec:s,initialRawProjectFiles:a,children:i(U,{mockTemplates:d,autoApplyTemplate:c,environmentKey:h,children:[!r&&i(t,{children:[e(X,{}),e(Z,{}),e(W,{}),e(N,{}),e(M,{})]}),e(ea,{children:x?e(eh,{panelView:E,setPanelView:D,width:v,setWidth:V,selectedTemplate:T,setSelectedTemplate:C,isResizing:L,setIsResizing:R,onExit:l,enableAdmin:k}):e(eu,{})})]})})})})})})})})})})});export const Editor=h(t=>{try{if(window.frameElement?.hasAttribute(es))return e("div",{role:"alert","data-testid":"variant-page-unavailable",style:{padding:24,fontFamily:"sans-serif"},children:"This preview page is unavailable. Ask the agent to recreate it or close the comparison."})}catch{}return i(a,{theme:ep,children:[e(r,{}),e(eg,{...t})]})});
@@ -1,5 +1,5 @@
1
1
  import type { Application, ExpressionImplementations, InvariantImplementations } from '#package/application-spec';
2
- import { type AnyActionImplementations, type DomainComponentOptic, type DomainEntity, type ElementRegistration, type HandlerRegistration, type ImportedTransformer, type SystemComponentTypeConstraint } from '#package/domain';
2
+ import { type AnyActionImplementations, type DomainComponentOptic, type DomainEntity, type ElementRegistration, type HandlerRegistration, type ImportedTransformer, type ProjectModule, type SystemComponentTypeConstraint } from '#package/domain';
3
3
  type AnyImportedTransformer = ImportedTransformer<any, any, any, any, any, any, any>;
4
4
  type RuntimeData = Record<string, unknown>;
5
5
  type RuntimeEntity = DomainEntity<string>;
@@ -42,12 +42,13 @@ export interface GetImplementationFilesProps {
42
42
  readonly application: Application;
43
43
  readonly projectRoot: string;
44
44
  }
45
- /** Merges the default exports of the `src/actions/` modules by action name, as the generated barrel does. */
46
- export declare const resolveActionModules: (modules: readonly AnyActionImplementations[]) => AnyActionImplementations;
47
- type ExpressionModules = ReadonlyArray<Record<string, Record<string, unknown>>>;
48
45
  type ResolvedExpressions = ExpressionImplementations;
49
- export declare const resolveExpressionModules: (modules: ExpressionModules, aliasMap: Record<string, readonly string[]>) => ResolvedExpressions;
50
- export declare const resolveComponentModules: <ComponentOptic>(modules: ReadonlyArray<ComponentOptic | readonly ComponentOptic[]>) => readonly ComponentOptic[];
46
+ /**
47
+ * Validates the expression modules through the resolver the domain builder uses, then expands their
48
+ * aliases. The expansion stays here because the editor rebuilds expressions against the alias map of
49
+ * the spec being edited, where the built app's domain builder holds its own.
50
+ */
51
+ export declare const mergeExpressionModules: (modules: readonly ProjectModule[], aliasMap: Record<string, readonly string[]>) => ResolvedExpressions;
51
52
  export declare const mergeComponentOptics: <ComponentOptic>(generatedComponentOptics: readonly ComponentOptic[], customComponentOptics: readonly ComponentOptic[]) => readonly ComponentOptic[];
52
53
  export declare const getCustomComponentOptics: <ComponentOptic extends {
53
54
  readonly generated?: boolean;