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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (573) hide show
  1. package/README.md +1 -1
  2. package/dist/application/index.d.ts +1 -0
  3. package/dist/application/index.js +1 -1
  4. package/dist/application/mount-application.d.ts +1 -1
  5. package/dist/application/mount-application.js +1 -1
  6. package/dist/application/mount-configurator.d.ts +19 -0
  7. package/dist/application/mount-configurator.js +1 -0
  8. package/dist/application/mounted-application-runtime.d.ts +4 -0
  9. package/dist/application/mounted-application-runtime.js +1 -0
  10. package/dist/application/register-web-component.d.ts +2 -0
  11. package/dist/application/register-web-component.js +1 -0
  12. package/dist/application-spec/core/enhanced-json-value.d.ts +2 -31
  13. package/dist/application-spec/core/enhanced-json-value.js +1 -1
  14. package/dist/application-spec/core/index.d.ts +1 -3
  15. package/dist/application-spec/core/index.js +1 -1
  16. package/dist/application-spec/core/json-schema.d.ts +2 -52
  17. package/dist/application-spec/core/markers/index.d.ts +1 -1
  18. package/dist/application-spec/core/markers/index.js +1 -1
  19. package/dist/application-spec/core/markers/msg-marker.d.ts +2 -28
  20. package/dist/application-spec/core/markers/msg-marker.js +1 -1
  21. package/dist/application-spec/core/markers/raw-eval-write-marker.d.ts +1 -1
  22. package/dist/application-spec/core/markers/raw-eval-write-marker.js +1 -1
  23. package/dist/application-spec/core/markers/raw-read-write-marker.js +1 -1
  24. package/dist/application-spec/errors/diagnostic-codes.d.ts +1 -0
  25. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  26. package/dist/application-spec/errors/diagnostic-messages.d.ts +1 -0
  27. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  28. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  29. package/dist/application-spec/generate-application/code/templates/index.d.ts +2 -6
  30. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  31. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.d.ts +10 -0
  32. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +7 -0
  33. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  34. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +12 -6
  35. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +1 -1
  36. package/dist/application-spec/generate-application/implementations/phx-application-types.d.ts +25 -0
  37. package/dist/application-spec/generate-application/implementations/phx-application-types.js +1 -0
  38. package/dist/application-spec/generate-application/implementations/phx-domain.d.ts +36 -0
  39. package/dist/application-spec/generate-application/implementations/phx-domain.js +1 -0
  40. package/dist/application-spec/generate-application/implementations/phx-model.d.ts +24 -0
  41. package/dist/application-spec/generate-application/implementations/phx-model.js +1 -0
  42. package/dist/application-spec/generate-application/implementations/phx.d.ts +22 -0
  43. package/dist/application-spec/generate-application/implementations/phx.js +1 -0
  44. package/dist/application-spec/generate-application/index.d.ts +2 -0
  45. package/dist/application-spec/generate-application/index.js +1 -1
  46. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +3 -4
  47. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +7 -4
  48. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
  49. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.d.ts +16 -0
  50. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.js +1 -0
  51. package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +17 -4
  52. package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
  53. package/dist/application-spec/generate-application/runtime/application-spec-slice.d.ts +71 -0
  54. package/dist/application-spec/generate-application/runtime/application-spec-slice.js +1 -0
  55. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +3 -4
  56. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +7 -5
  57. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
  58. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.d.ts +16 -0
  59. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.js +1 -0
  60. package/dist/application-spec/generate-application/runtime/create-application.d.ts +57 -0
  61. package/dist/application-spec/generate-application/runtime/create-application.js +1 -0
  62. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +2 -2
  63. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.d.ts +1 -1
  64. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +1 -1
  65. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +1 -1
  66. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +1 -1
  67. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.d.ts +1 -1
  68. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.js +1 -1
  69. package/dist/application-spec/generate-application/runtime/index.d.ts +8 -0
  70. package/dist/application-spec/generate-application/runtime/index.js +1 -0
  71. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +1 -1
  72. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
  73. package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.d.ts +1 -1
  74. package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +1 -2
  75. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +9 -4
  76. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
  77. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +1 -2
  78. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.js +1 -1
  79. package/dist/application-spec/generate-application/runtime/sections/preset-runtime.d.ts +2 -3
  80. package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +1 -1
  81. package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.d.ts +1 -1
  82. package/dist/application-spec/generate-application/runtime/spec-runtime.d.ts +21 -0
  83. package/dist/application-spec/generate-application/runtime/spec-runtime.js +1 -0
  84. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.d.ts +3 -2
  85. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +44 -9
  86. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.js +1 -1
  87. package/dist/application-spec/generate-application/runtime-spec/spec-code-id.d.ts +1 -1
  88. package/dist/application-spec/parse-application-files/parse-application-files.js +1 -1
  89. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.d.ts +1 -1
  90. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.js +1 -1
  91. package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding.d.ts +3 -13
  92. package/dist/application-spec/parse-application-files/spec/components/bindings/write-binding.d.ts +4 -32
  93. package/dist/application-spec/parse-application-files/spec/components/component-filter.d.ts +4 -10
  94. package/dist/application-spec/parse-application-files/spec/components/components.d.ts +3 -4
  95. package/dist/application-spec/parse-application-files/spec/components/index.d.ts +1 -2
  96. package/dist/application-spec/parse-application-files/spec/components/index.js +1 -1
  97. package/dist/application-spec/parse-application-files/spec/components/sdk-component-entry.d.ts +1 -1
  98. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.d.ts +2 -3
  99. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.js +1 -1
  100. package/dist/application-spec/parse-application-files/spec/components/user-components.d.ts +2 -3
  101. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +2 -2
  102. package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +7 -29
  103. package/dist/application-spec/parse-application-files/spec/expressions/index.d.ts +0 -1
  104. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.d.ts +4 -71
  105. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.js +1 -1
  106. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts +2 -2
  107. package/dist/application-spec/parse-application-files/spec/model/aliases.d.ts +3 -9
  108. package/dist/application-spec/parse-application-files/spec/model/common-types.d.ts +6 -14
  109. package/dist/application-spec/parse-application-files/spec/model/defaults.d.ts +6 -31
  110. package/dist/application-spec/parse-application-files/spec/model/entity-types.d.ts +3 -8
  111. package/dist/application-spec/parse-application-files/spec/model/model-version-key.d.ts +3 -3
  112. package/dist/application-spec/parse-application-files/spec/model/names/action-name.d.ts +3 -7
  113. package/dist/application-spec/parse-application-files/spec/model/names/alias-name.d.ts +3 -7
  114. package/dist/application-spec/parse-application-files/spec/model/names/entity-or-alias-name.d.ts +3 -8
  115. package/dist/application-spec/parse-application-files/spec/model/names/entity-type-name.d.ts +3 -8
  116. package/dist/application-spec/parse-application-files/spec/model/names/expression-name.d.ts +3 -6
  117. package/dist/application-spec/parse-application-files/spec/model/names/instance-name.d.ts +3 -7
  118. package/dist/application-spec/parse-application-files/spec/model/names/invariant-name.d.ts +3 -3
  119. package/dist/application-spec/parse-application-files/spec/model/names/shape-property-name.d.ts +3 -11
  120. package/dist/application-spec/parse-application-files/spec/model/names/violation-type-name.d.ts +3 -3
  121. package/dist/application-spec/parse-application-files/spec/model/presets.d.ts +6 -29
  122. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  123. package/dist/client/authorized-client.d.ts +3 -1
  124. package/dist/client/authorized-client.js +1 -1
  125. package/dist/client/contract.d.ts +17 -0
  126. package/dist/client/index.d.ts +1 -1
  127. package/dist/client/local-authorized-client.d.ts +3 -1
  128. package/dist/client/local-authorized-client.js +1 -1
  129. package/dist/client/memory-authorized-client.d.ts +4 -1
  130. package/dist/client/memory-authorized-client.js +1 -1
  131. package/dist/client/phoenix-api.d.ts +228 -0
  132. package/dist/configurator/ConfiguratorApp.js +1 -1
  133. package/dist/configurator/app-loader-content/index.d.ts +0 -1
  134. package/dist/configurator/app-loader-content/index.js +1 -1
  135. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  136. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +17 -3
  137. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  138. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +42 -9
  139. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  140. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +15 -10
  141. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  142. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +30 -9
  143. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  144. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.d.ts +40 -0
  145. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.js +1 -0
  146. package/dist/configurator/common/configurator-interface.d.ts +9 -6
  147. package/dist/configurator/common/configurator-interface.js +1 -1
  148. package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.d.ts +5 -0
  149. package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.js +1 -0
  150. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.d.ts +0 -6
  151. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.js +1 -1
  152. package/dist/configurator/configuration-not-found-page/index.d.ts +2 -2
  153. package/dist/configurator/configuration-not-found-page/index.js +1 -1
  154. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.d.ts +3 -3
  155. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.js +1 -1
  156. package/dist/configurator/configurator-context/PresetSelectionProvider.js +1 -1
  157. package/dist/configurator/configurator-context/PreviewContextProvider.js +1 -1
  158. package/dist/configurator/configurator-context/configurator-hooks/index.d.ts +0 -1
  159. package/dist/configurator/configurator-context/configurator-hooks/index.js +1 -1
  160. package/dist/configurator/configurator-context/index.d.ts +0 -4
  161. package/dist/configurator/configurator-context/index.js +1 -1
  162. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.d.ts +3 -3
  163. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.js +1 -1
  164. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.d.ts +0 -5
  165. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.js +1 -1
  166. package/dist/configurator/configurator-error-page/index.d.ts +1 -2
  167. package/dist/configurator/configurator-error-page/index.js +1 -1
  168. package/dist/configurator/index.d.ts +9 -2
  169. package/dist/configurator/index.js +1 -1
  170. package/dist/configurator/pages/ConfiguratorNotFoundPage.js +1 -1
  171. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  172. package/dist/configurator/pages/default-configurator-elements.js +1 -1
  173. package/dist/configurator/pages/error-boundaries/DevContextFallback.js +1 -1
  174. package/dist/configurator/pages/error-boundaries/DevLoadingFallback.js +1 -1
  175. package/dist/configurator/pages/error-boundaries/LoadingErrorBoundary.js +1 -1
  176. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  177. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.d.ts +1 -1
  178. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -1
  179. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +12 -4
  180. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -1
  181. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +8 -0
  182. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -0
  183. package/dist/configurator/ui/assistant/tool-chip.d.ts +15 -5
  184. package/dist/configurator/ui/assistant/tool-chip.js +1 -1
  185. package/dist/configurator/ui/configurator-layout/slots/canvas/GPUAccelerationDisabled.js +1 -1
  186. package/dist/configurator/ui/configurator-layout/slots/canvas/LayoutCanvas.js +1 -1
  187. package/dist/configurator/ui/configurator-layout/slots/canvas/SharedCanvas.js +1 -1
  188. package/dist/configurator/ui/configurator-layout/slots/canvas/WebGLNotSupported.js +1 -1
  189. package/dist/configurator/ui/configurator-layout/slots/readonly-banner/CloneToEditDialog.js +1 -1
  190. package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.js +1 -1
  191. package/dist/configurator/ui/legacy/chat/MobileChat.js +1 -1
  192. package/dist/configurator/ui/legacy/layout/common/CommonTopNavigation.js +1 -1
  193. package/dist/configurator/ui/legacy/layout/common/ReactiveInterfaceLayout.js +1 -1
  194. package/dist/configurator/ui/legacy/layout/simple/SimpleSidebar.js +1 -1
  195. package/dist/configurator/ui/legacy/layout/simple/SimpleTopNavigation.js +1 -1
  196. package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.js +1 -1
  197. package/dist/configurator/ui/legacy/layout/steps/StepsOwnerLayout.js +1 -1
  198. package/dist/configurator/ui/legacy/layout/steps/StepsSideBar.js +1 -1
  199. package/dist/configurator/ui/legacy/layout/tabs/TabsSidebar.js +1 -1
  200. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.d.ts +0 -7
  201. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.js +2 -2
  202. package/dist/configurator/ui/phoenix-layout-elements/header/common/back-button/use-go-back-action.js +1 -1
  203. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.js +1 -1
  204. package/dist/configurator/ui/phoenix-layout-elements/index.d.ts +8 -1
  205. package/dist/configurator/ui/phoenix-layout-elements/index.js +1 -1
  206. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/PreviousStepButton.js +1 -1
  207. package/dist/configurator/ui/preset-layout/PresetUi.d.ts +0 -2
  208. package/dist/configurator/ui/preset-layout/PresetUi.js +1 -1
  209. package/dist/configurator/ui/preset-layout/index.d.ts +6 -1
  210. package/dist/configurator/ui/preset-layout/index.js +1 -1
  211. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -1
  212. package/dist/docs/3d-scene/cameras/custom.mdx +4 -2
  213. package/dist/docs/index.json +78 -1
  214. package/dist/docs/integrations/webcomponent-api/basics.mdx +2 -0
  215. package/dist/docs/layouts/custom-layout.mdx +318 -158
  216. package/dist/docs/layouts/gallery/ardent-compressor.mdx +3516 -0
  217. package/dist/docs/layouts/gallery/corvid-drone.mdx +3428 -0
  218. package/dist/docs/layouts/gallery/fenwick-window.mdx +2803 -0
  219. package/dist/docs/layouts/gallery/ferrule-bar-station.mdx +6567 -0
  220. package/dist/docs/layouts/gallery/nightjar-guitar.mdx +3698 -0
  221. package/dist/docs/layouts/gallery/sunfold-solar.mdx +2683 -0
  222. package/dist/docs/layouts/gallery/tidepool-aquascape.mdx +5203 -0
  223. package/dist/docs/phoenix/configurator-interface.mdx +8 -6
  224. package/dist/docs/phoenix/domain-model.mdx +4 -1
  225. package/dist/docs/phoenix/phoenix-cli.mdx +14 -6
  226. package/dist/docs/phoenix/project-structure.mdx +21 -17
  227. package/dist/docs/phoenix/sdk-builder-workflow.mdx +6 -4
  228. package/dist/docs/phoenix/sessions-and-access.mdx +2 -0
  229. package/dist/docs/phoenix/webhooks.mdx +5 -1
  230. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +2 -0
  231. package/dist/domain/application/assistant/build-assistant-lenses.js +3 -3
  232. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  233. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  234. package/dist/domain/application/configurator-builder.d.ts +7 -1
  235. package/dist/domain/application/configurator-builder.js +1 -1
  236. package/dist/domain/application/index.d.ts +1 -1
  237. package/dist/domain/application/index.js +1 -1
  238. package/dist/domain/application/standard-properties.js +1 -1
  239. package/dist/domain/application/web-component-property.d.ts +3 -1
  240. package/dist/domain/application/web-component-property.js +1 -1
  241. package/dist/domain/domain-builder.d.ts +9 -3
  242. package/dist/domain/domain-builder.js +1 -1
  243. package/dist/domain/domain-runtime/application.d.ts +39 -0
  244. package/dist/domain/domain-runtime/application.js +1 -0
  245. package/dist/domain/domain-runtime/domain-context/selectors.d.ts +1 -0
  246. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  247. package/dist/domain/domain-runtime/domain-runtime.d.ts +40 -4
  248. package/dist/domain/domain-runtime/domain-runtime.js +1 -1
  249. package/dist/domain/domain-runtime/environment/initialize.d.ts +1 -1
  250. package/dist/domain/domain-runtime/errors/implementation-error-collector.d.ts +2 -0
  251. package/dist/domain/domain-runtime/errors/implementation-error-collector.js +1 -1
  252. package/dist/domain/domain-runtime/index.d.ts +2 -1
  253. package/dist/domain/domain-runtime/index.js +1 -1
  254. package/dist/domain/domain-runtime/spec/index.d.ts +1 -1
  255. package/dist/domain/domain-runtime/spec/index.js +1 -1
  256. package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +1 -0
  257. package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
  258. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.d.ts +23 -0
  259. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.js +1 -0
  260. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.d.ts +3 -4
  261. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.js +1 -1
  262. package/dist/domain/domain-runtime/web-component/actions.d.ts +3 -0
  263. package/dist/domain/domain-runtime/web-component/actions.js +1 -1
  264. package/dist/domain/domain-runtime/web-component/initialize.d.ts +1 -0
  265. package/dist/domain/domain-runtime/web-component/initialize.js +1 -1
  266. package/dist/domain/domain-runtime/web-component/selectors.d.ts +2 -0
  267. package/dist/domain/domain-runtime/web-component/selectors.js +1 -1
  268. package/dist/domain/domain-runtime/web-component/types.d.ts +6 -3
  269. package/dist/domain/index.d.ts +1 -0
  270. package/dist/domain/index.js +1 -1
  271. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +7 -0
  272. package/dist/domain/spec/application/index.d.ts +1 -0
  273. package/dist/domain/spec/application/index.js +1 -0
  274. package/dist/domain/spec/components/bindings/index.d.ts +2 -0
  275. package/dist/domain/spec/components/bindings/read-binding.d.ts +13 -0
  276. package/dist/domain/spec/components/bindings/write-binding.d.ts +32 -0
  277. package/dist/{application-spec/parse-application-files → domain}/spec/components/component-entry.d.ts +3 -3
  278. package/dist/{application-spec/core → domain/spec}/components/component-filter.d.ts +3 -2
  279. package/dist/domain/spec/components/component-filters.d.ts +10 -0
  280. package/dist/domain/spec/components/components.d.ts +4 -0
  281. package/dist/domain/spec/components/components.js +1 -0
  282. package/dist/domain/spec/components/index.d.ts +6 -0
  283. package/dist/domain/spec/enhanced-json-value.d.ts +30 -0
  284. package/dist/domain/spec/enhanced-json-value.js +1 -0
  285. package/dist/{application-spec/parse-application-files → domain}/spec/expressions/expression.d.ts +9 -3
  286. package/dist/domain/spec/expressions/expression.js +1 -0
  287. package/dist/domain/spec/expressions/expressions.d.ts +27 -0
  288. package/dist/domain/spec/expressions/expressions.js +1 -0
  289. package/dist/domain/spec/expressions/index.d.ts +5 -0
  290. package/dist/domain/spec/expressions/memo-eval-plan.d.ts +70 -0
  291. package/dist/domain/spec/expressions/memo-eval-plan.js +1 -0
  292. package/dist/domain/spec/expressions/relation-expression-params.js +1 -0
  293. package/dist/domain/spec/index.d.ts +7 -0
  294. package/dist/domain/spec/index.js +1 -0
  295. package/dist/domain/spec/json-schema.d.ts +52 -0
  296. package/dist/domain/spec/json-schema.js +1 -0
  297. package/dist/domain/spec/markers/index.d.ts +3 -0
  298. package/dist/domain/spec/markers/index.js +1 -0
  299. package/dist/domain/spec/markers/msg-marker.d.ts +28 -0
  300. package/dist/domain/spec/markers/msg-marker.js +1 -0
  301. package/dist/domain/spec/model/aliases.d.ts +9 -0
  302. package/dist/domain/spec/model/aliases.js +1 -0
  303. package/dist/domain/spec/model/common-types.d.ts +15 -0
  304. package/dist/domain/spec/model/common-types.js +1 -0
  305. package/dist/domain/spec/model/defaults.d.ts +33 -0
  306. package/dist/domain/spec/model/defaults.js +1 -0
  307. package/dist/domain/spec/model/entity-types.d.ts +8 -0
  308. package/dist/domain/spec/model/entity-types.js +1 -0
  309. package/dist/domain/spec/model/index.d.ts +7 -0
  310. package/dist/domain/spec/model/index.js +1 -0
  311. package/dist/domain/spec/model/model-version-key.d.ts +3 -0
  312. package/dist/domain/spec/model/model-version-key.js +1 -0
  313. package/dist/domain/spec/model/names/action-name.d.ts +7 -0
  314. package/dist/domain/spec/model/names/action-name.js +1 -0
  315. package/dist/domain/spec/model/names/alias-name.d.ts +7 -0
  316. package/dist/domain/spec/model/names/alias-name.js +1 -0
  317. package/dist/domain/spec/model/names/entity-or-alias-name.d.ts +8 -0
  318. package/dist/domain/spec/model/names/entity-or-alias-name.js +1 -0
  319. package/dist/domain/spec/model/names/entity-type-name.d.ts +8 -0
  320. package/dist/domain/spec/model/names/entity-type-name.js +1 -0
  321. package/dist/domain/spec/model/names/expression-name.d.ts +6 -0
  322. package/dist/domain/spec/model/names/expression-name.js +1 -0
  323. package/dist/domain/spec/model/names/index.d.ts +9 -0
  324. package/dist/domain/spec/model/names/index.js +1 -0
  325. package/dist/domain/spec/model/names/instance-name.d.ts +7 -0
  326. package/dist/domain/spec/model/names/instance-name.js +1 -0
  327. package/dist/domain/spec/model/names/invariant-name.d.ts +3 -0
  328. package/dist/domain/spec/model/names/invariant-name.js +1 -0
  329. package/dist/domain/spec/model/names/shape-property-name.d.ts +11 -0
  330. package/dist/domain/spec/model/names/shape-property-name.js +1 -0
  331. package/dist/domain/spec/model/names/violation-type-name.d.ts +3 -0
  332. package/dist/domain/spec/model/names/violation-type-name.js +1 -0
  333. package/dist/domain/spec/model/presets.d.ts +30 -0
  334. package/dist/domain/spec/model/presets.js +1 -0
  335. package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
  336. package/dist/editor/domain-editors/apply-spec-update.d.ts +2 -1
  337. package/dist/editor/domain-editors/apply-spec-update.js +1 -1
  338. package/dist/editor/domain-editors/use-implementation-files.d.ts +6 -14
  339. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  340. package/dist/editor/graphql/GraphQLPanel.js +1 -1
  341. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  342. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  343. package/dist/legacy/domain-spec/spec/domain-spec.js +1 -1
  344. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
  345. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
  346. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
  347. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +11 -5
  348. package/dist/phoenix/application-spec/generate-application-spec-project.d.ts +1 -0
  349. package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
  350. package/dist/phoenix/application-spec/generate-project-files.d.ts +1 -0
  351. package/dist/phoenix/application-spec/index.d.ts +1 -0
  352. package/dist/phoenix/application-spec/index.js +1 -1
  353. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +11 -0
  354. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  355. package/dist/phoenix/bin.js +1 -1
  356. package/dist/phoenix/cli.js +1 -1
  357. package/dist/phoenix/commands/build.js +1 -1
  358. package/dist/phoenix/commands/clean.js +1 -1
  359. package/dist/phoenix/commands/deploy.js +1 -1
  360. package/dist/phoenix/commands/dev.js +5 -5
  361. package/dist/phoenix/commands/generated-env-markers.d.ts +1 -0
  362. package/dist/phoenix/commands/generated-env-markers.js +1 -1
  363. package/dist/phoenix/commands/index.d.ts +1 -1
  364. package/dist/phoenix/commands/index.js +1 -1
  365. package/dist/phoenix/commands/sync.js +1 -1
  366. package/dist/phoenix/lingui/index.d.ts +1 -0
  367. package/dist/phoenix/lingui/index.js +1 -0
  368. package/dist/phoenix/{services → lingui}/lingui.d.ts +5 -2
  369. package/dist/phoenix/lingui/lingui.js +1 -0
  370. package/dist/phoenix/services/application-spec-project-watcher.d.ts +3 -1
  371. package/dist/phoenix/services/application-spec-project-watcher.js +2 -2
  372. package/dist/phoenix/services/index.d.ts +1 -0
  373. package/dist/phoenix/services/index.js +1 -1
  374. package/dist/phoenix/services/lingui-watcher.js +1 -1
  375. package/dist/phoenix/services/prepare-development-environment.js +1 -1
  376. package/dist/phoenix/services/vite-config.js +1 -1
  377. package/dist/react-sdk/application-runtime/common-services/analytics/analytics-service.d.ts +1 -1
  378. package/dist/react-sdk/application-runtime/common-services/initialize.d.ts +2 -2
  379. package/dist/react-sdk/application-runtime/domain-application-context/chat-system.d.ts +1 -1
  380. package/dist/react-sdk/application-runtime/hooks/index.d.ts +2 -0
  381. package/dist/react-sdk/application-runtime/hooks/index.js +1 -1
  382. package/dist/react-sdk/application-runtime/hooks/loading/index.d.ts +5 -0
  383. package/dist/react-sdk/application-runtime/hooks/loading/index.js +1 -0
  384. package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.d.ts +11 -0
  385. package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.js +1 -0
  386. package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.d.ts +8 -0
  387. package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.js +1 -0
  388. package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.d.ts +7 -0
  389. package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.js +1 -0
  390. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.d.ts +9 -0
  391. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.js +1 -0
  392. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.d.ts +24 -0
  393. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.js +1 -0
  394. package/dist/react-sdk/application-runtime/hooks/responsive/index.d.ts +3 -0
  395. package/dist/react-sdk/application-runtime/hooks/responsive/index.js +1 -0
  396. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.d.ts +9 -0
  397. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.js +1 -0
  398. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.d.ts +26 -0
  399. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.js +1 -0
  400. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.d.ts +10 -0
  401. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.js +1 -0
  402. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.d.ts +24 -0
  403. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.js +1 -0
  404. package/dist/react-sdk/application-runtime/hooks/use-access-service.d.ts +5 -0
  405. package/dist/react-sdk/application-runtime/hooks/use-access-service.js +1 -1
  406. package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.d.ts +4 -11
  407. package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.js +1 -1
  408. package/dist/react-sdk/application-runtime/hooks/use-web-component.d.ts +5 -0
  409. package/dist/react-sdk/application-runtime/hooks/use-web-component.js +1 -1
  410. package/dist/react-sdk/application-runtime/host-properties/actions.d.ts +15 -0
  411. package/dist/react-sdk/application-runtime/host-properties/actions.js +1 -0
  412. package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.d.ts +30 -0
  413. package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.js +1 -0
  414. package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.d.ts +7 -0
  415. package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.js +1 -0
  416. package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.d.ts +21 -0
  417. package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.js +1 -0
  418. package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.d.ts +42 -0
  419. package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.js +1 -0
  420. package/dist/react-sdk/application-runtime/host-properties/index.d.ts +8 -0
  421. package/dist/react-sdk/application-runtime/host-properties/index.js +1 -0
  422. package/dist/react-sdk/application-runtime/host-properties/initialize.d.ts +7 -0
  423. package/dist/react-sdk/application-runtime/host-properties/initialize.js +1 -0
  424. package/dist/react-sdk/application-runtime/host-properties/selectors.d.ts +54 -0
  425. package/dist/react-sdk/application-runtime/host-properties/selectors.js +1 -0
  426. package/dist/react-sdk/application-runtime/host-properties/types.d.ts +18 -0
  427. package/dist/react-sdk/application-runtime/host-properties/types.js +1 -0
  428. package/dist/react-sdk/application-runtime/index.d.ts +3 -0
  429. package/dist/react-sdk/application-runtime/loading/actions.d.ts +45 -0
  430. package/dist/react-sdk/application-runtime/loading/actions.js +1 -0
  431. package/dist/react-sdk/application-runtime/loading/index.d.ts +4 -0
  432. package/dist/react-sdk/application-runtime/loading/index.js +1 -0
  433. package/dist/react-sdk/application-runtime/loading/initialize.d.ts +3 -0
  434. package/dist/react-sdk/application-runtime/loading/initialize.js +1 -0
  435. package/dist/react-sdk/application-runtime/loading/selectors.d.ts +18 -0
  436. package/dist/react-sdk/application-runtime/loading/selectors.js +1 -0
  437. package/dist/react-sdk/application-runtime/loading/types.d.ts +59 -0
  438. package/dist/react-sdk/application-runtime/loading/types.js +1 -0
  439. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  440. package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.d.ts +6 -0
  441. package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.js +1 -1
  442. package/dist/react-sdk/application-runtime/provider/ApplicationType.d.ts +7 -0
  443. package/dist/react-sdk/application-runtime/provider/ApplicationType.js +1 -1
  444. package/dist/react-sdk/application-runtime/responsive/actions.d.ts +47 -0
  445. package/dist/react-sdk/application-runtime/responsive/actions.js +1 -0
  446. package/dist/react-sdk/application-runtime/responsive/index.d.ts +4 -0
  447. package/dist/react-sdk/application-runtime/responsive/index.js +1 -0
  448. package/dist/react-sdk/application-runtime/responsive/initialize.d.ts +3 -0
  449. package/dist/react-sdk/application-runtime/responsive/initialize.js +1 -0
  450. package/dist/react-sdk/application-runtime/responsive/selectors.d.ts +20 -0
  451. package/dist/react-sdk/application-runtime/responsive/selectors.js +1 -0
  452. package/dist/react-sdk/application-runtime/responsive/types.d.ts +104 -0
  453. package/dist/react-sdk/application-runtime/responsive/types.js +1 -0
  454. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +309 -8
  455. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
  456. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/ConfiguratorRoutingProvider.d.ts +1 -1
  457. package/dist/react-sdk/configurator-routing/ConfiguratorRoutingProvider.js +1 -0
  458. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/OnGoToIndexHandler.d.ts +1 -2
  459. package/dist/react-sdk/configurator-routing/OnGoToIndexHandler.js +1 -0
  460. package/dist/react-sdk/configurator-routing/index.d.ts +3 -0
  461. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/index.js +1 -1
  462. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/use-power-routing-lifecycle.d.ts +2 -0
  463. package/dist/react-sdk/configurator-routing/use-power-routing-lifecycle.js +1 -0
  464. package/dist/react-sdk/domain-application-context/BackendDataProvider.js +1 -1
  465. package/dist/react-sdk/domain-application-context/FrontendDataProvider.js +1 -1
  466. package/dist/react-sdk/domain-application-context/OnPresetLoadedHandler.js +1 -0
  467. package/dist/react-sdk/domain-application-context/PublishedDataProvider.js +1 -1
  468. package/dist/react-sdk/domain-application-context/chat-hooks.d.ts +4 -0
  469. package/dist/react-sdk/domain-application-context/chat-hooks.js +1 -0
  470. package/dist/react-sdk/domain-application-context/index.d.ts +2 -0
  471. package/dist/react-sdk/domain-application-context/index.js +1 -1
  472. package/dist/react-sdk/domain-context/common-hooks/index.d.ts +1 -0
  473. package/dist/react-sdk/domain-context/common-hooks/index.js +1 -1
  474. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.d.ts +23 -0
  475. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.js +1 -0
  476. package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +1 -0
  477. package/dist/react-sdk/domain-context/index.d.ts +1 -0
  478. package/dist/react-sdk/domain-context/index.js +1 -1
  479. package/dist/react-sdk/elements/index.d.ts +0 -1
  480. package/dist/react-sdk/index.d.ts +4 -1
  481. package/dist/react-sdk/index.js +1 -1
  482. package/dist/react-sdk/integration/IntegrationSubscription.js +1 -0
  483. package/dist/react-sdk/integration/index.d.ts +1 -0
  484. package/dist/react-sdk/integration/index.js +1 -0
  485. package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.d.ts +8 -0
  486. package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.js +1 -0
  487. package/dist/react-sdk/lifecycle-providers/LifecycleProviders.js +1 -0
  488. package/dist/react-sdk/lifecycle-providers/index.d.ts +2 -0
  489. package/dist/react-sdk/lifecycle-providers/index.js +1 -0
  490. package/dist/react-sdk/loading-state/LoaderHost.d.ts +20 -0
  491. package/dist/react-sdk/loading-state/LoaderHost.js +1 -0
  492. package/dist/react-sdk/loading-state/built-in-loading-phase.d.ts +9 -0
  493. package/dist/react-sdk/loading-state/built-in-loading-phase.js +1 -0
  494. package/dist/react-sdk/loading-state/create-app-loader.d.ts +18 -0
  495. package/dist/react-sdk/loading-state/create-app-loader.js +1 -0
  496. package/dist/react-sdk/loading-state/index.d.ts +4 -2
  497. package/dist/react-sdk/loading-state/index.js +1 -1
  498. package/dist/react-sdk/loading-state/{LoadingStateProvider.d.ts → loading-state-hooks.d.ts} +3 -12
  499. package/dist/react-sdk/loading-state/loading-state-hooks.js +1 -0
  500. package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.d.ts +17 -0
  501. package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.js +1 -0
  502. package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.d.ts +17 -0
  503. package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.js +1 -0
  504. package/dist/react-sdk/page-elements/configurator-error-page-props.js +1 -0
  505. package/dist/{configurator/configuration-not-found-page → react-sdk/page-elements}/create-configuration-not-found-page.d.ts +7 -1
  506. package/dist/react-sdk/page-elements/create-configuration-not-found-page.js +1 -0
  507. package/dist/{configurator/configurator-error-page → react-sdk/page-elements}/create-configurator-error-page.d.ts +6 -1
  508. package/dist/react-sdk/page-elements/create-configurator-error-page.js +1 -0
  509. package/dist/react-sdk/page-elements/create-preset-ui.d.ts +9 -0
  510. package/dist/react-sdk/page-elements/create-preset-ui.js +1 -0
  511. package/dist/react-sdk/page-elements/index.d.ts +6 -0
  512. package/dist/react-sdk/page-elements/index.js +1 -0
  513. package/dist/react-sdk/session/SessionServiceProvider.js +1 -1
  514. package/dist/react-sdk/web-component/create-web-component.js +1 -1
  515. package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.d.ts +2 -2
  516. package/dist/ui-sdk/responsive-application/responsive-state-store.d.ts +11 -9
  517. package/dist/ui-sdk/responsive-application/use-store-responsive-info.js +1 -1
  518. package/package.json +3 -3
  519. package/dist/application-spec/core/components/index.d.ts +0 -2
  520. package/dist/application-spec/core/expressions/index.d.ts +0 -2
  521. package/dist/configurator/app-loader-content/app-loader-content-name.d.ts +0 -5
  522. package/dist/configurator/app-loader-content/app-loader-content-name.js +0 -1
  523. package/dist/configurator/configuration-not-found-page/create-configuration-not-found-page.js +0 -1
  524. package/dist/configurator/configurator-context/ConfiguratorDataProvider.d.ts +0 -2
  525. package/dist/configurator/configurator-context/ConfiguratorDataProvider.js +0 -1
  526. package/dist/configurator/configurator-context/IntegrationSubscription.js +0 -1
  527. package/dist/configurator/configurator-context/LifecycleProviders.js +0 -1
  528. package/dist/configurator/configurator-context/OnPresetLoadedHandler.js +0 -1
  529. package/dist/configurator/configurator-context/configurator-hooks/chat-hooks.d.ts +0 -1
  530. package/dist/configurator/configurator-context/configurator-hooks/chat-hooks.js +0 -1
  531. package/dist/configurator/configurator-context/configurator-routing/ConfiguratorRoutingProvider.js +0 -1
  532. package/dist/configurator/configurator-context/configurator-routing/OnGoToIndexHandler.js +0 -1
  533. package/dist/configurator/configurator-context/configurator-routing/index.d.ts +0 -2
  534. package/dist/configurator/configurator-context/configurator-routing/use-power-routing-lifecycle.js +0 -1
  535. package/dist/configurator/configurator-error-page/create-configurator-error-page.js +0 -1
  536. package/dist/phoenix/services/lingui.js +0 -1
  537. package/dist/react-sdk/loading-state/LoadingStateProvider.js +0 -1
  538. package/dist/react-sdk/loading-state/loading-state-manager.d.ts +0 -37
  539. package/dist/react-sdk/loading-state/loading-state-manager.js +0 -1
  540. package/dist/react-sdk/responsive-state/ResponsiveStateProvider.d.ts +0 -25
  541. package/dist/react-sdk/responsive-state/ResponsiveStateProvider.js +0 -1
  542. package/dist/react-sdk/responsive-state/canvas-padding.d.ts +0 -14
  543. package/dist/react-sdk/responsive-state/index.d.ts +0 -5
  544. package/dist/react-sdk/responsive-state/index.js +0 -1
  545. package/dist/react-sdk/responsive-state/responsive-state-manager.d.ts +0 -111
  546. package/dist/react-sdk/responsive-state/responsive-state-manager.js +0 -1
  547. package/dist/react-sdk/responsive-state/use-responsive-state-manager.d.ts +0 -10
  548. package/dist/react-sdk/responsive-state/use-responsive-state-manager.js +0 -1
  549. package/dist/react-sdk/responsive-state/use-responsive-state.d.ts +0 -11
  550. package/dist/react-sdk/responsive-state/use-responsive-state.js +0 -1
  551. /package/dist/{application-spec/core → domain/spec/application}/application-instance.d.ts +0 -0
  552. /package/dist/{application-spec/core → domain/spec/application}/application-instance.js +0 -0
  553. /package/dist/{application-spec/core/expressions/relation-expression-params.js → domain/spec/components/bindings/index.js} +0 -0
  554. /package/dist/{application-spec/parse-application-files/spec/components/component-entry.js → domain/spec/components/bindings/read-binding.js} +0 -0
  555. /package/dist/{application-spec/parse-application-files/spec/expressions/expression.js → domain/spec/components/bindings/write-binding.js} +0 -0
  556. /package/dist/{react-sdk/elements/configurator-error-page-props.js → domain/spec/components/component-entry.js} +0 -0
  557. /package/dist/{application-spec/core → domain/spec}/components/component-filter.js +0 -0
  558. /package/dist/{react-sdk/responsive-state/canvas-padding.js → domain/spec/components/component-filters.js} +0 -0
  559. /package/dist/{application-spec/core → domain/spec}/components/index.js +0 -0
  560. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.d.ts +0 -0
  561. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.js +0 -0
  562. /package/dist/{application-spec/core → domain/spec}/expressions/index.js +0 -0
  563. /package/dist/{application-spec/core → domain/spec}/expressions/relation-expression-params.d.ts +0 -0
  564. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.d.ts +0 -0
  565. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.js +0 -0
  566. /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.d.ts +0 -0
  567. /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.js +0 -0
  568. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.d.ts +0 -0
  569. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.js +0 -0
  570. /package/dist/{configurator/configurator-context → react-sdk/domain-application-context}/OnPresetLoadedHandler.d.ts +0 -0
  571. /package/dist/{configurator/configurator-context → react-sdk/integration}/IntegrationSubscription.d.ts +0 -0
  572. /package/dist/{configurator/configurator-context → react-sdk/lifecycle-providers}/LifecycleProviders.d.ts +0 -0
  573. /package/dist/react-sdk/{elements → page-elements}/configurator-error-page-props.d.ts +0 -0
@@ -391,7 +391,7 @@ Use these factories to customize the preset-selection screen without changing ho
391
391
  - `createPresetPageAction` adds project-specific content below the default preset cards.
392
392
  - `createPresetDeviceNotSupported` adds project-specific overlay content above the default preset cards.
393
393
 
394
- Without `createPresetUi`, Phoenix renders its built-in preset screen, which is the default `PresetUi` registration in `defaultConfiguratorElements`. The action and the overlay are parts of that built-in screen and render nothing until the project registers them.
394
+ Without `createPresetUi`, Phoenix renders its built-in preset screen, which is the default `PresetUi` registration in `defaultConfiguratorElements`. The action and the overlay are parts of that built-in screen and render nothing until the project registers them. `createPresetUi` and the element's name, `PresetUiName`, are also exported from `@salsita-ai/sdk/react`.
395
395
 
396
396
  ```typescript
397
397
  const PresetScreen = phx.frontend.createPresetUi(CustomPresetScreen)
@@ -413,7 +413,7 @@ export default phx.frontend.createConfigurationNotFoundPage(({ onBack }) => (
413
413
  ))
414
414
  ```
415
415
 
416
- The helper types the page's props as `ConfigurationNotFoundPageProps` from `@salsita-ai/sdk/react`. A layout element registered under the name `ConfigurationNotFoundPage` with `createCustomPhoenixLayoutElement` replaces the page too, but its component is typed as taking only `children`.
416
+ The helper types the page's props as `ConfigurationNotFoundPageProps` from `@salsita-ai/sdk/react`, which also exports the helper and the element's name, `ConfigurationNotFoundPageName`. A layout element registered under the name `ConfigurationNotFoundPage` with `createCustomPhoenixLayoutElement` replaces the page too, but its component is typed as taking only `children`.
417
417
 
418
418
  - The page receives one optional prop, `onBack`, which returns to the start of the configurator. It is set when a configuration fails to load or is opened without a valid access key. It is not set on the start page itself, so a page that offers a way back shows it only when `onBack` is set.
419
419
  - The configurator renders the element in four cases: a configuration fails to load, for example because its ID does not exist or the server rejects its access key; a configuration is opened without an access key for it; a signed-in user whose role may not create configurations (`acl.canCreate`) opens the start page; the preset screen has no preset category to show, for example because the host's `presetTags` match no preset. The last case happens inside the built-in preset screen, so a project that replaces it with `createPresetUi` decides what to show itself.
@@ -434,7 +434,7 @@ export default phx.frontend.createConfiguratorErrorPage(({ reason, onRetry }) =>
434
434
  ))
435
435
  ```
436
436
 
437
- The helper types the page's props as `ConfiguratorErrorPageProps` from `@salsita-ai/sdk/react`. A layout element registered under the name `ConfiguratorErrorPage` with `createCustomPhoenixLayoutElement` replaces the page too, but its component is typed as taking only `children`.
437
+ The helper types the page's props as `ConfiguratorErrorPageProps` from `@salsita-ai/sdk/react`, which also exports the helper and the element's name, `ConfiguratorErrorPageName`. A layout element registered under the name `ConfiguratorErrorPage` with `createCustomPhoenixLayoutElement` replaces the page too, but its component is typed as taking only `children`.
438
438
 
439
439
  - The page receives two props. `reason` says what failed: `uncaughtError` when rendering the configurator failed with an error nothing else handled, `presetCreationFailed` when starting a configuration from the only preset failed. `onRetry` tries again: after `uncaughtError` it renders the configurator again, after `presetCreationFailed` it reloads the page. The error itself is not passed; it is logged to the console.
440
440
  - The configurator renders the element in two cases: an error reaches the configurator's error boundary, which wraps everything from the scene resources and the session down to the pages, including a failure while the application starts; and creating a configuration fails on a start screen with a single preset. The element is available in both, because the spec and its elements are part of the application before the configurator renders.
@@ -451,6 +451,7 @@ export default phx.frontend.createAppLoader(({ phases }) => <span>{phases[0]?.la
451
451
  ```
452
452
 
453
453
  - Phoenix keeps the overlay, its place over the safe area and its fade-in; the element is only what it shows.
454
+ - `createAppLoader`, the props type `AppLoaderContentProps` and the element's name, `AppLoaderContentName`, are also exported from `@salsita-ai/sdk/react`.
454
455
  - The overlay stays up while a loading phase runs: the session, the project's data, the configuration and the 3D scene. It waits for the scene only when the loaded configuration's layout mounts a canvas, as the built-in layouts and `LayoutSlots.SharedCanvas` do. A `ConfiguratorLayout` without a canvas is not held by the loader: the overlay leaves once the configuration is up.
455
456
  - The top-level `appLoader: legacy` key in the spec turns the overlay off.
456
457
  - The built-in content is the default `AppLoaderContent` registration in `defaultConfiguratorElements`, see below.
@@ -598,7 +599,7 @@ Texts from the spec, such as option titles and the `detail` fields, are `Localiz
598
599
 
599
600
  **Steps and tabs**
600
601
 
601
- A project layout builds its steps and tabs from the spec, so the structure stays in `navigationSteps`, `sidebarTabs` and `horizontalTabs`, where `$filter` switches it, and the layout decides how it looks. `phx.frontend.useStepNavigation()` gives a wizard its steps with a `status` each, and `next`, `previous` and `goTo`; `phx.frontend.useTabNavigation()` gives tabs with `isActive` each, and `select`. Both enter a navigation state, so controls, cameras and components filtered by `navigationStates` follow. Neither hides anything in read mode or blocks a step on violations: a layout that should not move on while the configuration is invalid combines `canGoNext` with `useStateValidity()`, and a stepper that offers only earlier steps enables the steps whose `status` is `'complete'`.
602
+ A project layout builds its steps and tabs from the spec, so the structure stays in `navigationSteps`, `sidebarTabs` and `horizontalTabs`, where `$filter` switches it, and the layout decides how it looks. `phx.frontend.useStepNavigation()` gives a wizard its steps with a `status` each, and `next`, `previous` and `goTo`; `phx.frontend.useTabNavigation()` gives tabs with `isActive` each, and `select`. Both enter a navigation state, so controls, cameras and components filtered by `navigationStates` follow. Neither hides anything in read mode or blocks a step on violations: a layout that should not move on while the configuration has a problem requires `phx.frontend.useStateValidity().severity !== 'warning'` besides `canGoNext`, because a change with a `fixable` or `fatal` violation is rejected and the committed configuration is never invalid, while a `warning` stays and blocks finalizing. A stepper that offers only earlier steps enables the steps whose `status` is `'complete'`.
602
603
 
603
604
  ```tsx
604
605
  export const Wizard = () => {
@@ -647,6 +648,7 @@ A layout builds its toolbar from `phx.frontend.useToolbarActions()`, which retur
647
648
  | `phx.frontend.useStateValidity()` | The validity of the last committed state: `{ valid: true, severity: null }`, or `{ valid: true, severity: 'notice' \| 'warning', entityViolations }`. A change that leaves a `fixable` or `fatal` violation is rejected and never committed, and neither is a change during which an error was thrown, so neither is seen here. |
648
649
  | `phx.frontend.useFinalizeViolations()` | `{ disabled, hints, violations }`. `disabled` is `true` while a `warning`, `fixable` or `fatal` violation holds or the configuration failed to save; `hints` is the violations' text, or `undefined`. |
649
650
  | `phx.frontend.useConfiguratorMessages(onMessage)` | Nothing. It calls `onMessage(message)` once per message: `{ kind: 'violation', entityId, violation, text }` for each violation of the rejected state, including notices and warnings already present, so `violation.severity` tells the reason for the rejection (`fixable` or `fatal`) from them, `{ kind: 'sideEffect', text }` for each hint of a committed update, `{ kind: 'error', error, text }` when an error is thrown while a change is validated, with `text` the generic "Oops, something went wrong", `{ kind: 'saveError', error, text }` each time saving the configuration fails, with `error` what the save rejected with and `text` a generic message, and `{ kind: 'saveRecovery', text }` when a save succeeds after a failed one, with `text` "Configuration updated". `text` is resolved to the current language; a violation's is its `message`, or its `type` without one, and the built-in snackbar prefixes it with `entityId`. Hints committed before the layout mounted are not delivered, nor is a save that failed before it mounted; when the most recent change was rejected or threw, its messages are delivered again when the hook mounts. `onMessage` may be a new function on every render. On `phx.frontend` the message is typed by the project, so `violation.type` narrows to its violation types; from `@salsita-ai/sdk/react` the type is `ConfiguratorMessage`. |
651
+ | `phx.frontend.useConfigurationSaveState()` | `{ revisionId, isSaving, failure }`, the save status of the configuration. An editable configuration saves every committed change on its own, three seconds after the last one, and a read-only one never saves. `revisionId` is the revision the configuration is at: the loaded one, then the one the latest save created. `isSaving` is `true` while a save runs. `failure` is `{ error, timestamp }` of the latest failed save, with `timestamp` in milliseconds since the epoch, and `null` once a later save succeeds or another configuration loads. A layout shows a save indicator with it; the messages of a failed save and of its recovery come from `useConfiguratorMessages`. Besides `phx.frontend`, `@salsita-ai/sdk/react` exports it. |
650
652
  | `phx.frontend.useFinalizeAction(handler)` | `{ run, isPending, error, disabled, hints }` for the `finalizeAction` whose `handler` it is given; see the Finalize paragraph below for how to call it. `run()` records the finalize-button click for analytics and runs the project's handler, does nothing while `disabled` or `isPending`, and returns a promise that resolves once the handler has settled and never rejects; `error` is what the handler's last run rejected with, or `null`; `disabled` and `hints` are those of `useFinalizeViolations()`. The type of the result is `UseFinalizeActionResult` from `@salsita-ai/sdk/configurator`, which also exports the hook. |
651
653
  | `phx.frontend.useFinalizeActions()` | `{ actions, primary, secondary, disabled, hints }`: every active `finalizeAction` of the spec in spec order, `primary` the first `'primary'` one, or else the first, or `null`, and `secondary` the others; see the Finalize paragraph below. Each action is `{ key, handler, variant, label, title, icon, run, isPending, error, disabled }`, with `label` and `title` resolved; `run()` records the finalize-button click for analytics and runs the action's handler, does nothing while `disabled` or `isPending`, and returns a promise that never rejects. `disabled` and `hints` are those of `useFinalizeViolations()`. Besides `phx.frontend`, `@salsita-ai/sdk/react` exports it. |
652
654
 
@@ -654,7 +656,7 @@ A layout builds its toolbar from `phx.frontend.useToolbarActions()`, which retur
654
656
 
655
657
  **Finalize**
656
658
 
657
- A project layout finalizes over the spec's `finalizeAction` components, each `{ variant, label, title, icon, handler }`, where `variant` is `'primary'` or `'secondary'` and `handler` names the project's handler registered with `phx.frontend.createPhoenixHandler`. `phx.frontend.useFinalizeActions()` is the convenient way: it lists them with what a button needs, runs their handlers itself, and can be called anywhere in the layout, including a dialog the layout opens with `useModal`, as often as it likes. It returns:
659
+ A project layout finalizes over the spec's `finalizeAction` components, each `{ variant, label, title, icon, handler }`, where `variant` is `'primary'` or `'secondary'` and `handler` names the project's handler registered with `phx.frontend.createPhoenixHandler`. `phx.frontend.useFinalizeActions()` is the convenient way: it lists them with what a button needs, runs their handlers itself, and can be called anywhere in the layout, including a dialog the layout opens with `useModal`, as often as it likes; [Custom Layout](?path=/docs/layouts-custom-layout--docs#request-a-quote) offers its primary action this way in its review step. It returns:
658
660
 
659
661
  - `actions`, every active `finalizeAction` in spec order, and `primary` and `secondary`, the same actions split as the built-in footer splits them: `primary` is the first `'primary'` action, or else the first action, or `null` without any, and `secondary` the others in spec order.
660
662
  - `disabled` and `hints`, those of `useFinalizeViolations()`: finalizing is not possible while a `warning`, `fixable` or `fatal` violation holds or the configuration failed to save, and `hints` says why.
@@ -698,7 +700,7 @@ export const Finalize = () => {
698
700
 
699
701
  The configurator runs the handlers outside the layout, beside it, whenever a configuration is open, also in read mode and on every step. A handler can use what the configurator provides, such as `useModal`, but not a provider the layout itself adds; such a handler fails to load and shows as that action's `error`. An action's `isPending` and `error` are kept while the layout re-renders and while its components unmount and mount again.
700
702
 
701
- To run a single action the layout already knows, `phx.frontend.useFinalizeAction(handler)` runs it in the layout itself and returns `{ run, isPending, error, disabled, hints }`, with the same meaning. It runs the project's handler factory, which calls hooks, so the layout calls it once per component, never in a loop or conditionally, and wraps that component in `<PhoenixHandlerBoundary name={handler}>` from `@salsita-ai/sdk/react`, so an edited handler takes effect without a reload. Its `isPending` and `error` belong to the mounted component: when it unmounts during a run, the handler keeps running, and a component mounted afterwards starts with `isPending` false and no `error`. [Custom Layout](?path=/docs/layouts-custom-layout--docs#request-a-quote) runs a finalize action this way from its review step.
703
+ To run a single action the layout already knows, `phx.frontend.useFinalizeAction(handler)` runs it in the layout itself and returns `{ run, isPending, error, disabled, hints }`, with the same meaning. It runs the project's handler factory, which calls hooks, so the layout calls it once per component, never in a loop or conditionally, and wraps that component in `<PhoenixHandlerBoundary name={handler}>` from `@salsita-ai/sdk/react`, so an edited handler takes effect without a reload. Its `isPending` and `error` belong to the mounted component: when it unmounts during a run, the handler keeps running, and a component mounted afterwards starts with `isPending` false and no `error`.
702
704
 
703
705
  Neither hook checks read mode, so the layout hides finalizing while `accessInfo.viewMode` is `true`, as above.
704
706
 
@@ -842,7 +842,10 @@ Phoenix automatically:
842
842
  During `phoenix dev`, schema-compatible configurator changes can refresh the mounted application in
843
843
  place. Changes to the domain model itself are rejected from live application and require a restart;
844
844
  this preserves the last valid runtime and loaded configuration until migration and deployment can be
845
- coordinated atomically.
845
+ coordinated atomically. With server persistence, restart `phoenix dev` itself: it logs an error that
846
+ asks for the restart, and registers the changed model with its development deployment when it starts
847
+ again. Then open the preview address it prints rather than a tab whose address has `?cid=`, which
848
+ loads a configuration saved with the earlier model.
846
849
 
847
850
  ### The phx Global Namespace
848
851
 
@@ -164,6 +164,8 @@ A project has one generated env file. Phoenix keeps it in `.phoenix/`, as `.phoe
164
164
  - The deployment and environment commands (`deployment:prepare`, `deployment:prepare-dev`, `deployment:prepare-local`, `deployment:build-envs` and the others with an `--outFile` option) write `.env.generated` in the project root unless `--outFile` or `OUT_FILE` names another file. Deploy pipelines read it there. Once one of them has written it, `phoenix dev` and `phoenix build` use it.
165
165
  - Everything that reads environment variables follows the same rule: the root `.env.generated` when it exists, otherwise `.phoenix/.env.generated`. The two files are never merged.
166
166
  - `phoenix clean` removes `.phoenix/` and with it `.phoenix/.env.generated`; the next `phoenix dev` prepares the development deployment again. A root `.env.generated` stays.
167
+ - `phoenix dev` starts on the deployment the file names, and prepares a new one when the file was written for another project, environment or server, when the spec registers something on the server the deployment was not prepared with (the domain model, the published data schema, the auth hook, the roles that may create configurations, or the assistant), and on `--force`. A running `phoenix dev` does not prepare again after such a change: it logs an error that asks for a restart.
168
+ - Asset contents do not trigger preparation. After changing uploaded assets, restart with `phoenix dev --force` to prepare and upload them again.
167
169
 
168
170
  This holds for a project on the application-spec pipeline. In a project on the legacy pipeline (see [Current and legacy project tooling](#current-and-legacy-project-tooling)), `phoenix dev` always reads and writes `.env.generated` in the project root.
169
171
 
@@ -305,14 +307,16 @@ Starts the full development environment: Vite dev server, development webhook tu
305
307
  | `--environmentSlug` | `ENVIRONMENT_SLUG` | package.json name | Environment slug |
306
308
  | `--withLingui` | `WITH_LINGUI` | `false` | Enable i18n extraction/compilation and watch i18n sources during dev |
307
309
  | `--persistence` | `PERSISTENCE_MODE` | `server` | Persistence mode |
308
- | `--force` / `-f` | `FORCE_REBUILD` | `false` | Force full rebuild, skip cache |
310
+ | `--force` / `-f` | `FORCE_REBUILD` | `false` | Force full rebuild, skip cache, and prepare the development deployment again |
309
311
  | `--serverUrl` | `SERVER_URL` | the region's server | Phoenix server URL |
310
312
  | `--region` | `PHOENIX_REGION` | `eu` | Region of the signed-in workspace, used when no server URL is set |
311
313
  | `--skipUpload` / `--su` | `SKIP_UPLOAD` | `false` | Skip the S3 asset upload when the development deployment is prepared at startup |
312
314
 
313
315
  With the application-spec pipeline, `phoenix dev` creates an empty `src/` folder when the project has none, so that it rebuilds when the first source file, such as `src/webhooks/index.ts`, is added.
314
316
 
315
- With the application-spec pipeline, the SDK's own Lingui CLI runs with the configuration in `.phoenix/.linguirc`, both for `--withLingui` and when `phoenix sync` and `phoenix build` extract and compile the catalogs; see [Root Level Files](?path=/docs/phoenix-project-structure--docs#root-level-files). The dev server and `phoenix build` compile the Lingui macros (`msg`, `t`, `Trans` and the others, imported from `@lingui/core/macro`, `@lingui/react/macro` or `@lingui/macro`) with the SDK's own Lingui macro plugin and the same configuration, so the project needs neither `babel-plugin-macros` nor `@lingui/macro` for them. Babel macros of other packages are not compiled.
317
+ By default, with the application-spec pipeline, `phoenix dev` bootstraps missing compiled catalogs for every configured locale at startup, so a fresh project can start without a prior sync. It compiles existing `.po` translations as they are and extracts a locale only when its `.po` source is also missing. Existing compiled catalogs and `.po` sources stay unchanged. New or changed messages still need `phoenix sync` or continuous updates enabled by `--withLingui` or `WITH_LINGUI=true`.
318
+
319
+ The SDK's own Lingui CLI uses the configuration generated in `.phoenix/.linguirc`, both for `--withLingui` and when `phoenix sync` and `phoenix build` extract and compile the catalogs; see [Root Level Files](?path=/docs/phoenix-project-structure--docs#root-level-files). The dev server and `phoenix build` compile the Lingui macros (`msg`, `t`, `Trans` and the others, imported from `@lingui/core/macro`, `@lingui/react/macro` or `@lingui/macro`) with the SDK's own Lingui macro plugin and the same configuration, so the project needs neither `babel-plugin-macros` nor `@lingui/macro` for them. Babel macros of other packages are not compiled.
316
320
 
317
321
  In `server` persistence mode the project comes from `--projectSlug`, `PROJECT_SLUG` or `project` in the spec, and the credential from `DEVELOPMENT_KEY` or the `phoenix login` sign-in; see [Starting a New Project](#starting-a-new-project). When signed in, the environment is always your own development environment and `--environmentSlug` is ignored.
318
322
 
@@ -336,7 +340,11 @@ Restart the application after fixing either failure; a subscriber or generation
336
340
  observed the attempted update.
337
341
 
338
342
  Domain-model changes are not applied live yet. Phoenix rejects them with a restart-required
339
- diagnostic so the mounted application cannot observe a new model with old configuration data. Other
343
+ diagnostic so the mounted application cannot observe a new model with old configuration data. With
344
+ server persistence, `phoenix dev` logs an error that asks for its own restart, because the
345
+ development deployment keeps the schema it was prepared with until `phoenix dev` starts again and
346
+ prepares it. After the restart, open the preview address it prints: a tab whose address has `?cid=`
347
+ loads a configuration saved with the earlier model, which the new model rejects. Other
340
348
  generated bootstrap, admin, data, environment, and host-integration surfaces should also be treated
341
349
  as restart-required unless their feature documentation explicitly states live-update support.
342
350
 
@@ -609,7 +617,7 @@ Known limits:
609
617
  - Binary assets, CSS files, locale catalog changes, dependency changes and edits requiring a full application restart are unsupported.
610
618
  - Storybook `story-dev` has no variant previews. A project on the legacy pipeline has no variant previews; the command says so and exits.
611
619
 
612
- Generated projects carry the `phoenix-variants` agent skill, which tells coding agents when to offer options, how to write each kind and what to do with your answer.
620
+ Generated projects carry the `phoenix` agent skill, whose linked Variants guide tells coding agents when to offer options, how to write each kind and what to do with your answer.
613
621
 
614
622
  ## SDK Development
615
623
 
@@ -750,7 +758,7 @@ Revokes the token on the server and removes it from the credentials file. `--reg
750
758
 
751
759
  ### `phoenix deploy`
752
760
 
753
- Validates the spec, packs and uploads the project, starts its build on the server and follows it until the configurator is live. Before the upload the server compares the domain model with the deployed one: a model that changed under an already deployed model version is refused with the reason, and needs a new model version and a [migration](?path=/docs/phoenix-migrations--docs). Once the build starts it prints `Follow the build in Studio: <url>`, the build's page in the Studio you signed in through; a sign-in stored by an older CLI has no Studio URL, so sign in again to get the link. After `Your configurator is live at <url>` it prints one line for coding agents, which tells them to offer the run evaluation of the `phoenix-feedback` skill once you have nothing more to build; you can ignore it when you run the command yourself. `--region` or `--serverUrl` selects the server, as for `login`; `--no-wait` returns as soon as the build starts.
761
+ Validates the spec, packs and uploads the project, starts its build on the server and follows it until the configurator is live. Before the upload the server compares the domain model with the deployed one: a model that changed under an already deployed model version is refused with the reason, and needs a new model version and a [migration](?path=/docs/phoenix-migrations--docs). Once the build starts it prints `Follow the build in Studio: <url>`, the build's page in the Studio you signed in through; a sign-in stored by an older CLI has no Studio URL, so sign in again to get the link. After `Your configurator is live at <url>` it prints one line for coding agents, which tells them to offer the run evaluation in the Feedback guide linked from the `phoenix` skill once you have nothing more to build; you can ignore it when you run the command yourself. `--region` or `--serverUrl` selects the server, as for `login`; `--no-wait` returns as soon as the build starts.
754
762
 
755
763
  To keep the conversation that led to a build, place a reviewed UTF-8 transcript in `conversation.log` at the project root before deploying. Deploy automatically includes it in the private source archive. Download the build's sources from Studio to read it; access is the same as for the rest of that build's sources. The build extractor skips the log, so it is not an application build input or a public asset. Missing logs produce a warning and deployment continues. Directories, links and special files at that path are rejected.
756
764
 
@@ -779,7 +787,7 @@ Pass the message as the argument for a short note, or `--file` for a longer repo
779
787
 
780
788
  A message holds at most 100,000 characters, from the argument or from the file. Besides the message and the flags, the CLI sends only the SDK version, the operating system and the Node.js version; no file of the project is attached, and the Phoenix team reads a build's sources through the build's page in Studio. The project must belong to the signed-in workspace, otherwise the server refuses the feedback; without a project, the feedback is sent on its own.
781
789
 
782
- Generated projects carry the `phoenix-feedback` agent skill. It tells coding agents when to draft feedback, to show you the draft and send it only after you approve it, and how to write a report: the build id with its Studio page link, the live configurator link, what the agent was doing, what happened and what was expected, the exact error or output, the workaround and a condensed conversation log. When you say you are done, or a deploy went live and you confirm the run is finished, the agent asks you to evaluate the run, one question at a time: minutes spent, then a score from 0 to 10 for the agent's guidance, the configurator's functionality, its UX, the quality of the 3D, the UI visuals and the overall result, then your comments. It never picks a score for you and sends nothing when you decline. Secrets, credentials and personal data never go into a message; file paths, spec and code snippets and your own words may, once you approved the draft that contains them. The command needs a server with API 1.40.0 or newer; a message over 5000 characters needs API 1.43.0 or newer.
790
+ Generated projects carry the `phoenix` agent skill. Its linked Feedback guide tells coding agents when to draft feedback, to show you the draft and send it only after you approve it, and how to write a report: the build id with its Studio page link, the live configurator link, what the agent was doing, what happened and what was expected, the exact error or output, the workaround and a condensed conversation log. When you say you are done, or a deploy went live and you confirm the run is finished, the agent asks you to evaluate the run, one question at a time: minutes spent, then a score from 0 to 10 for the agent's guidance, the configurator's functionality, its UX, the quality of the 3D, the UI visuals and the overall result, then your comments. It never picks a score for you and sends nothing when you decline. Secrets, credentials and personal data never go into a message; file paths, spec and code snippets and your own words may, once you approved the draft that contains them. The command needs a server with API 1.40.0 or newer; a message over 5000 characters needs API 1.43.0 or newer.
783
791
 
784
792
  ## Next Steps
785
793
 
@@ -199,21 +199,21 @@ type CustomMaterial = Phx['AdminModel']['CustomMaterial']
199
199
 
200
200
  ### Root Level Files
201
201
 
202
- | File | Auto-Generated? | Notes |
203
- | ------------------------------------------------------ | --------------- | ------------------------------------- |
204
- | `package.json` | No | Yours; see Dependencies |
205
- | `tsconfig.json` | Once | Yours; see below |
206
- | `eslint.config.js` | Once | Yours; see below |
207
- | `prettier.config.js` | Once | Yours; see below |
208
- | `.prettierignore` | No | Optional and your own; see below |
209
- | `pnpm-workspace.yaml` | No | Only with pnpm; see Package manager |
210
- | `.gitignore` | Partially | Only in a git repository; see Markers |
211
- | `.env` | No | Git-ignored, local config |
212
- | `.env.example` | No | Template for env vars |
213
- | `.env.generated` | Yes | Optional, git-ignored; see below |
214
- | `README.md` | No | Project documentation |
215
- | `AGENTS.md` | No | Your own coding-agent instructions |
216
- | `.claude/skills/phoenix*/`, `.agents/skills/phoenix*/` | Yes | Phoenix agent skills |
202
+ | File | Auto-Generated? | Notes |
203
+ | ---------------------------------------------------- | --------------- | ------------------------------------- |
204
+ | `package.json` | No | Yours; see Dependencies |
205
+ | `tsconfig.json` | Once | Yours; see below |
206
+ | `eslint.config.js` | Once | Yours; see below |
207
+ | `prettier.config.js` | Once | Yours; see below |
208
+ | `.prettierignore` | No | Optional and your own; see below |
209
+ | `pnpm-workspace.yaml` | No | Only with pnpm; see Package manager |
210
+ | `.gitignore` | Partially | Only in a git repository; see Markers |
211
+ | `.env` | No | Git-ignored, local config |
212
+ | `.env.example` | No | Template for env vars |
213
+ | `.env.generated` | Yes | Optional, git-ignored; see below |
214
+ | `README.md` | No | Project documentation |
215
+ | `AGENTS.md` | No | Your own coding-agent instructions |
216
+ | `.claude/skills/phoenix/`, `.agents/skills/phoenix/` | Yes | Phoenix agent skills |
217
217
 
218
218
  Sync does not write `README.md`, `AGENTS.md`, `.env.example`, `.env.ci` or the `README.md` files in `assets/public/` and `assets/private/`. Earlier SDK versions wrote them once; a project that has them keeps them, and they are yours to edit.
219
219
 
@@ -242,9 +242,13 @@ With the application-spec pipeline, the Lingui configuration is `.phoenix/.lingu
242
242
 
243
243
  ### Agent Guidance
244
244
 
245
- Coding agents (Claude Code, Codex, Cursor) read the Phoenix agent skills. An `AGENTS.md` is yours to add for your own instructions; sync does not write one. The `phoenix`, `phoenix-cli`, `phoenix-feedback` and `phoenix-review` skills carry the SDK conventions, CLI tooling and review checklist, and the `phoenix-create-configurator` skill walks the agent from your product documents and assets to a reviewed configurator in five stages. The `phoenix-variants` skill has the agent show you several options over the dev preview when a decision is a matter of taste, and build the one you pick. Phoenix keeps them in step with the installed SDK, including the reference files inside a skill folder. During the internal beta, a project created from a canary build of the SDK gets one more section in the `phoenix` skill: once per conversation the agent checks for a newer canary and, after telling you, updates the project's SDK, runs `phoenix deps`, installs, then runs `phoenix sync`. Other skill folders are never touched.
245
+ Coding agents (Claude Code, Codex, Cursor) enter through the single `phoenix` skill under `.claude/skills/phoenix/` or `.agents/skills/phoenix/`. Its `SKILL.md` routes to the existing project, CLI, configurator workflow, code review, variants and feedback guides in `references/`. Agents read the guides for their task rather than the whole tree. The configurator workflow retains its five stages and supporting discovery, UX, asset-conversion and appearance-review references.
246
246
 
247
- Projects created by earlier SDK versions had this guidance in `CLAUDE.md`, `.cursor/rules/phoenix.mdc` and `commands/review.md`. Sync removes the SDK block from the first two, keeps your own text around it, deletes a file that held nothing else, and deletes the review commands; use the `phoenix-review` skill instead of `/review`.
247
+ Phoenix keeps this guidance in step with the installed SDK. During the internal beta, a project created from a canary build gets the canary-update instructions in the linked project guide: once per conversation the agent checks for a newer canary and, after telling you, updates the SDK, runs `phoenix deps`, installs, then runs `phoenix sync`.
248
+
249
+ An `AGENTS.md` is yours to add; sync does not write one. Sync removes retired `phoenix-*` skill folders but leaves unrelated skills alone. If your own instructions name an earlier separate skill such as `phoenix-review`, point them at `phoenix` and the same task instead.
250
+
251
+ Projects created by earlier SDK versions had this guidance in `CLAUDE.md`, `.cursor/rules/phoenix.mdc` and `commands/review.md`. Sync removes the SDK block from the first two, keeps your own text around it, deletes a file that held nothing else, and deletes the review commands; ask `phoenix` to review instead of using `/review`.
248
252
 
249
253
  ### Markers for Partial Auto-Generation
250
254
 
@@ -65,7 +65,7 @@ Every user who signs the CLI in gets their own development environment, so a tea
65
65
 
66
66
  Coding agents follow the generated `phoenix` skill: before their first change they start `phoenix dev` and open the preview in your browser, and after `phoenix deploy` starts a build they open its page in Studio.
67
67
 
68
- To build the configurator with your coding agent, give it your product documents, prices, pictures, drawings or models and ask it to create the configurator. The generated `phoenix-create-configurator` skill guides it through five stages: a representative first slice you can try early, a plan of the whole configuration experience, options and features added in small increments, finalization, and a complete review. It studies the SDK documentation before building, keeps a `configurator-spec.md` in the project as the record of what is decided and what remains open, and asks you only for decisions it cannot derive from your materials.
68
+ To build the configurator with your coding agent, give it your product documents, prices, pictures, drawings or models and ask it to create the configurator. The generated `phoenix` skill’s Configurator workflow guide takes it through five stages: a representative first slice you can try early, a plan of the whole configuration experience, options and features added in small increments, finalization, and a complete review. It studies the SDK documentation before building, keeps a `configurator-spec.md` in the project as the record of what is decided and what remains open, and asks you only for decisions it cannot derive from your materials.
69
69
 
70
70
  ## 4. Deploy
71
71
 
@@ -85,7 +85,9 @@ On the server, the install runs pnpm. It follows your `pnpm-lock.yaml` and `pnpm
85
85
 
86
86
  If the build fails, is cancelled or takes too long, `phoenix deploy` prints the end of the build log and exits with an error. `--no-wait` returns as soon as the build starts.
87
87
 
88
- Studio's **Builds & deployments** page lists your builds and shows which one your configurator serves. Each build shows its progress, its error and the full build log while it runs.
88
+ Studio's **Builds & deployments** page lists your builds, 20 to a page, and shows which one your configurator serves. Filter it to the live build or to the builds that failed. Each build shows its progress, its error and the full build log while it runs, and who deployed it with which CLI token.
89
+
90
+ **Rebuild** on a build's page builds the files uploaded with that build again, with your environment variables as they are now, without a new `phoenix deploy`. Use it after changing a variable, or when a build failed for a reason on our side. If the rebuild succeeds it goes live, so rebuilding an older build rolls production back to it.
89
91
 
90
92
  `phoenix deploy` refuses symlinks, hard-linked files and other special files among the project files, because builds only accept regular files. Packing uses the system `tar`, which macOS, Linux and Windows 10 or later all include. The build runner checks the uploaded archive again and keeps only project files, so a file outside the list above never reaches the build.
91
93
 
@@ -97,7 +99,7 @@ Tell us what is broken, confusing or missing, from wherever you are:
97
99
  - In the terminal, `pnpm phoenix feedback "<message>" --type bug|idea|other` sends it with your sign-in, and `--file <path>` sends a text file instead of the argument. See the [CLI reference](?path=/docs/phoenix-phoenix-cli--docs).
98
100
  - On a build's page in Studio, **Download** → **Sources** downloads the archive `phoenix deploy` uploaded for that build, so a report only needs to name the build.
99
101
 
100
- Coding agents working in your project use the same command, guided by the generated `phoenix-feedback` skill. They never send on their own: an agent shows you a draft, right away when the problem is crucial and otherwise at the end of the task, and sends it only after you approve it. A report names the build with its Studio page link and the live configurator, says what the agent was doing, what happened and what it expected, quotes the exact error and ends with a condensed conversation log. Agents are told never to include secrets, credentials or personal data; parts of your project and your own words go in only through a draft you approved. When you are done with the configurator, the agent also asks you, once per conversation, to evaluate the run: minutes spent, then scores from 0 to 10 for the agent's guidance, functionality, UX, 3D quality, UI visuals and the overall result, and your comments. It asks one question at a time, never picks a score for you, tells you the answers go to the Phoenix team, shows the message and sends it only after you approve it.
102
+ Coding agents working in your project use the same command, guided by the generated `phoenix` skill’s Feedback guide. They never send on their own: an agent shows you a draft, right away when the problem is crucial and otherwise at the end of the task, and sends it only after you approve it. A report names the build with its Studio page link and the live configurator, says what the agent was doing, what happened and what it expected, quotes the exact error and ends with a condensed conversation log. Agents are told never to include secrets, credentials or personal data; parts of your project and your own words go in only through a draft you approved. When you are done with the configurator, the agent also asks you, once per conversation, to evaluate the run: minutes spent, then scores from 0 to 10 for the agent's guidance, functionality, UX, 3D quality, UI visuals and the overall result, and your comments. It asks one question at a time, never picks a score for you, tells you the answers go to the Phoenix team, shows the message and sends it only after you approve it.
101
103
 
102
104
  ## Known limits
103
105
 
@@ -107,5 +109,5 @@ Coding agents working in your project use the same command, guided by the genera
107
109
  - `phoenix deploy` always deploys to the workspace's default project; it doesn't read `project` from the spec yet.
108
110
  - Only `phoenix dev` works from the sign-in. `phoenix deployment:prepare-dev` still needs the `.env` block of a Studio development environment.
109
111
  - Every deploy uploads the whole project; there are no incremental uploads.
110
- - Your own environment variables are set in Studio under Environment, by a super admin of the workspace, and apply from the next deploy. `phoenix dev` doesn't receive them: your development environment has its own variables. A build reads them from `process.env`; a webhook reads the ones the spec declares under `env.webhook`, through `phx.webhooksEnv` (see [Webhooks](?path=/docs/phoenix-webhooks--docs)). They can't use platform names such as `LAMBDA_FUNCTION_NAME`, the `AWS_` prefix, the identity provider settings such as `CLERK_API_KEY`, or names the CLI and the deploy tooling read themselves, such as `SERVER_URL` or `NODE_OPTIONS`; Studio refuses those names.
112
+ - Your own environment variables are set in Studio under Environment, by a super admin of the workspace, and apply from the next deploy. After a change, **Redeploy #N now** there rebuilds your live build with the new values, without a new `phoenix deploy`; it appears once your own build is live. `phoenix dev` doesn't receive them: your development environment has its own variables. A build reads them from `process.env`; a webhook reads the ones the spec declares under `env.webhook`, through `phx.webhooksEnv` (see [Webhooks](?path=/docs/phoenix-webhooks--docs)). They can't use platform names such as `LAMBDA_FUNCTION_NAME`, the `AWS_` prefix, the identity provider settings such as `CLERK_API_KEY`, or names the CLI and the deploy tooling read themselves, such as `SERVER_URL` or `NODE_OPTIONS`; Studio refuses those names.
111
113
  - Only super admins of a workspace can open its Studio. Admins and users see a page that says so.
@@ -427,6 +427,8 @@ The `readonly` web component property lets the host force view mode without chan
427
427
 
428
428
  Because an owner-token session can be forced read-only client-side while the server still accepts writes from that owner token, Phoenix skips persistence and logs a warning instead of updating the configuration. This guards against the configuration being silently overwritten by code paths that mutate state in read-only mode. UI that triggers significant changes (anything that produces a new revision) should still be disabled when `accessInfo.viewMode` is true — the warning is a backstop, not a substitute.
429
429
 
430
+ The assistant follows the same read-only rule as the UI: its `apply` tool refuses changes while `accessInfo.viewMode` is true, that is with a read-revision token or while `readonly` is set, and makes them again once it is false. A switch of `readonly` takes effect at once, in both directions, and the configurator loads the configuration again. A change applied after `readonly` is cleared and before the configuration has loaded again is not saved; saving resumes once it has loaded. The `query` tool keeps working, including its dry-run mutations.
431
+
430
432
  ```html
431
433
  <salsita-configurator readonly></salsita-configurator>
432
434
  ```
@@ -36,7 +36,11 @@ Phoenix provides domain-aware builders through the global `phx.webhooks` namespa
36
36
 
37
37
  Your webhook is the default export of `src/webhooks/index.ts`. With the application-spec pipeline (see [Current and legacy project tooling](?path=/docs/phoenix-phoenix-cli--docs#current-and-legacy-project-tooling)), the file is yours to create; sync does not write it. A project without it gets a built-in webhook, so it builds and deploys with no webhook code. The built-in webhook has one handler, an anonymous auth handler, which the platform calls only when `spec/application.yaml` sets `useAuthHook`. The legacy pipeline writes the file with that webhook on the first sync.
38
38
 
39
- Create `src/webhooks/index.ts` when the project needs its own handlers: finalization, backend data, or an auth handler that does more than start an anonymous session. A project that sets `useAuthHook` or `useClerk` needs its own auth handler, because the built-in one answers only anonymous requests. The smallest file is the built-in webhook itself:
39
+ Create `src/webhooks/index.ts` when the project needs its own handlers: finalization, backend data, or an auth handler that does more than start an anonymous session.
40
+
41
+ If `useAuthHook` or `useClerk` is enabled without this file, sync, build, clean and dev report `AUTH_WITHOUT_PROJECT_WEBHOOK` and generation continues with the anonymous-only built-in webhook. This warning also applies when `useAuthHook: false` is explicit alongside `useClerk: true`. Add a default-exported webhook with the required Clerk or custom auth handlers, or disable the settings if they are unintended.
42
+
43
+ The smallest file is the built-in webhook itself:
40
44
 
41
45
  ```ts
42
46
  // src/webhooks/index.ts
@@ -54,6 +54,8 @@ export interface AssistantResolvedManifest {
54
54
  /** The screenshot views of each entity type with at least one, aliases expanded, in manifest order. */
55
55
  readonly screenshots: Readonly<Record<string, readonly AssistantScreenshotView[]>>;
56
56
  readonly actionFields: readonly AssistantResolvedAction[];
57
+ /** The entity types that declare invariants, whose `meta` lists the warnings and notices they hold. */
58
+ readonly invariantTypes: readonly string[];
57
59
  /** The declared lenses by name: when to use each, and how many levels its tagged relations nest. */
58
60
  readonly lenses: Readonly<Record<string, {
59
61
  readonly description: string;
@@ -1,5 +1,5 @@
1
- import{NoUnusedFragmentsRule as e,parse as t,specifiedRules as i,validate as n}from"graphql";let s="AnyDomainEntity",r=[{name:"RecipeGroup",description:"A recipe group with its recipes, without their dry-runs.",selections:["groupId","name","description","recipes { ...Recipe }"]},{name:"Recipe",description:"A recipe without its dry-run.",selections:["key","name","description","imageUrl"]},{name:"FieldOption",description:"A value a field accepts, without its dry-run.",selections:["value","name","description","imageUrl","color"]},{name:"DryRun",description:"What a dry-run would do, with the ids of the entities it would change instead of the entities.",selections:["ok","deletedEntityIds","sideEffects","errors { type entityId message }","changedEntities { id }"]}],a=(e,t)=>0===t?e:`${e}__${t}`,l=e=>e.split("\n").map(e=>`# ${e}`.trimEnd()).join("\n"),o=(e,t,i)=>[`fragment ${e} on ${t} {`,...i.map(e=>` ${e}`),"}"].join("\n"),p=(e,t,i)=>{let n=e=>"edge"===e.type.kind?`${e.name} { ${i} }`:e.name;return o(e,s,["id",...t.flatMap(({typeName:e,fields:t})=>e===s?t.map(n):[`... on ${e} {`,...t.map(e=>` ${n(e)}`),"}"])])};export const buildAssistantLenses=(d,m)=>{let c=Object.entries(d.lenses).flatMap(([e,t])=>{let i=[s,...Object.keys(d.aliases).filter(e=>e!==s),...d.entityTypes].flatMap(t=>{let i=(d.fields[t]??[]).filter(t=>t.lenses?.includes(e));return i.length>0?[{typeName:t,fields:i}]:[]});return i.length>0?[{name:e,...t,conditions:i}]:[]}),$=r.filter(({name:e})=>void 0!==m.getType(e)),h=[...c.map(({name:e,description:t,maxDepth:i,conditions:n})=>{let s=n.some(({fields:e})=>e.some(e=>"edge"===e.type.kind));return`${l(s?`${t} ${`Nested relations carry the same selection up to ${i} ${1===i?"level":"levels"}, below that only \`id\`.`}`:t)}
1
+ import{NoUnusedFragmentsRule as e,parse as t,specifiedRules as i,validate as n}from"graphql";let s="AnyDomainEntity",r=[{name:"RecipeGroup",description:"A recipe group with its recipes, without their dry-runs.",selections:["groupId","name","description","recipes { ...Recipe }"]},{name:"Recipe",description:"A recipe without its dry-run.",selections:["key","name","description","imageUrl"]},{name:"FieldOption",description:"A value a field accepts, without its dry-run.",selections:["value","name","description","imageUrl","color"]},{name:"DryRun",description:"What a dry-run would do, with the ids of the entities it would change instead of the entities.",selections:["ok","deletedEntityIds","sideEffects","warnings { type severity entityId message }","errors { type entityId message }","changedEntities { id }"]}],a=(e,t)=>0===t?e:`${e}__${t}`,l=e=>e.split("\n").map(e=>`# ${e}`.trimEnd()).join("\n"),o=(e,t,i)=>[`fragment ${e} on ${t} {`,...i.map(e=>` ${e}`),"}"].join("\n"),p=(e,t,i)=>{let n=e=>"edge"===e.type.kind?`${e.name} { ${i} }`:e.name;return o(e,s,["id",...t.flatMap(({typeName:e,fields:t})=>e===s?t.map(n):[`... on ${e} {`,...t.map(e=>` ${n(e)}`),"}"])])};export const buildAssistantLenses=(d,m)=>{let c=Object.entries(d.lenses).flatMap(([e,t])=>{let i=[s,...Object.keys(d.aliases).filter(e=>e!==s),...d.entityTypes].flatMap(t=>{let i=(d.fields[t]??[]).filter(t=>t.lenses?.includes(e));return i.length>0?[{typeName:t,fields:i}]:[]});return i.length>0?[{name:e,...t,conditions:i}]:[]}),$=r.filter(({name:e})=>void 0!==m.getType(e)),y=[...c.map(({name:e,description:t,maxDepth:i,conditions:n})=>{let s=n.some(({fields:e})=>e.some(e=>"edge"===e.type.kind));return`${l(s?`${t} ${`Nested relations carry the same selection up to ${i} ${1===i?"level":"levels"}, below that only \`id\`.`}`:t)}
2
2
  ${p(e,n,`...${e}`)}`}),...$.map(({name:e,description:t,selections:i})=>`${l(t)}
3
- ${o(e,e,i)}`)].join("\n\n"),u=[...c.flatMap(({name:e,maxDepth:t,conditions:i})=>Array.from({length:t+1},(n,s)=>p(a(e,s),i,s<t?`...${a(e,s+1)}`:"id"))),...$.map(({name:e,selections:t})=>o(e,e,t))].join("\n\n");if(""!==u){let s=c.length>0?`entities { ${c.map(({name:e})=>`...${e}`).join(" ")} }`:"__typename",r=n(m,t(`${u}
3
+ ${o(e,e,i)}`)].join("\n\n"),h=[...c.flatMap(({name:e,maxDepth:t,conditions:i})=>Array.from({length:t+1},(n,s)=>p(a(e,s),i,s<t?`...${a(e,s+1)}`:"id"))),...$.map(({name:e,selections:t})=>o(e,e,t))].join("\n\n");if(""!==h){let s=c.length>0?`entities { ${c.map(({name:e})=>`...${e}`).join(" ")} }`:"__typename",r=n(m,t(`${h}
4
4
 
5
- { ${s} }`),i.filter(t=>t!==e));if(r.length>0)throw Error(`The lens fragments generated from "assistant.lenses" are not valid GraphQL: ${[...new Set(r.map(e=>e.message))].join(" ")}`)}return{declarations:h,definitions:u}};
5
+ { ${s} }`),i.filter(t=>t!==e));if(r.length>0)throw Error(`The lens fragments generated from "assistant.lenses" are not valid GraphQL: ${[...new Set(r.map(e=>e.message))].join(" ")}`)}return{declarations:y,definitions:h}};
@@ -1 +1 @@
1
- import{GraphQLBoolean as e,GraphQLEnumType as t,GraphQLID as n,GraphQLInputObjectType as i,GraphQLInterfaceType as s,GraphQLList as r,GraphQLNonNull as o,GraphQLObjectType as a,GraphQLSchema as p,GraphQLString as c,printSchema as d,validateSchema as l}from"graphql";import{GraphQLJSON as h,createAssistantValueType as w}from"./assistant-value-type.js";import{buildAssistantLenses as y}from"./build-assistant-lenses.js";import{createAssistantExecutionSchema as u}from"./create-assistant-execution-schema.js";let m="AnyDomainEntity",f="RootEntity",g=[["navigationState","Active navigation state.","navigationStates"],["viewState","Active view state.","viewStates"],["toolState","Active tool state.","toolStates"]],b={section:"childRecipes",mutation:"addChild"},v={section:"replaceRecipes",mutation:"replaceEntity"},j=(e,t)=>Object.entries(e).find(([e])=>e===t)?.[1],$=(e,t)=>{if(!t||0===t.length)return e;let n=`One of: ${t.map(e=>`"${e}"`).join(", ")}.`;return e?/[.!?]$/.test(e)?`${e} ${n}`:`${e}. ${n}`:n},O=({target:e,cardinality:t},n)=>{let i=n(e);switch(t){case"1-1":return new o(i);case"0-1":return i;case"0-N":case"1-N":return new o(new r(new o(i)))}},E=(e,t,i)=>{let s={id:{type:new o(n),description:i?`Unique id of the entity, assigned by the configurator, e.g. "${i}-1".`:void 0},type:{type:new o(c),description:i?`Entity type name, e.g. "${i}".`:void 0}};for(let n of e)s[n.name]={type:"edge"===n.type.kind?O(n.type,t):w(n.type.type),description:n.description};return s},R=e=>Object.fromEntries(e.map(({name:e,source:t,localized:n})=>[e,n?{source:t,localized:!0}:{source:t}])),k={sameForAllInstances:e=>`Same recipe groups and recipes for every ${e}.`,constantDuringSession:()=>"Fixed for the session."},T={sameForAllInstances:e=>`Same for every ${e}.`,constantDuringSession:()=>"Fixed for the session."},I=(e,t,n)=>e.map(e=>` ${t[e](n)}`).join(""),N=({section:e},{groups:t,hints:n},{entityType:i,purpose:s,recipeGroup:a})=>{let p=t.filter(({dryRuns:e})=>!e).map(({groupId:e})=>e);return 0===t.length?{}:{[e]:{type:new o(new r(new o(a))),description:`The recipe groups for ${s} this ${i}: ${t.map(({groupId:e})=>e).join(", ")}. A group is listed only while the configurator offers it on the entity.${p.length>0?` Recipes of these groups cannot be dry-run: ${p.join(", ")}.`:""}${I(n,k,i)}`}}},A=({entityType:e,childRecipes:n,replaceRecipes:i,optionsEdges:s,screenshots:p},{recipeGroup:c,fieldOption:d,screenshot:l})=>new a({name:`${e}Meta`,fields:Object.assign(N(b,n,{entityType:e,purpose:"adding children to",recipeGroup:c}),N(v,i,{entityType:e,purpose:"replacing",recipeGroup:c}),...s.map(({options:{edgeName:t,field:n,validate:i,dryRuns:s},hints:a})=>({[t]:{type:new r(new o(d)),description:`Values "${n}" accepts on this ${e}. Null when there is no choice to make.${i?"":" Not checked on write."}${s?"":" Cannot be dry-run."}${I(a,T,e)}`}})),0===p.length?{}:{screenshot:{type:l,args:{view:{type:new o(new t({name:`${e}ScreenshotView`,values:Object.fromEntries(p.map(({view:e,description:t})=>[e,{description:t}]))}))}},description:"Renders this entity from a predefined view. The picture follows the tool result as an image labelled with `image`. Each one costs tokens and blocks the user's configurator while it renders: ask only when seeing the design answers something the data cannot. The images of one call share a size budget; past it, further screenshots come back null. Null as well when the view does not apply to this entity right now."}})}),S=e=>Object.entries(e).map(([e,t])=>`${e} (${t.map(({groupId:e})=>e).join(", ")})`);export const buildAssistantManifest=t=>{var O,k,T,I,N;let M,D,F,W,{entityTypes:x,aliases:C,exampleType:q,fields:G,states:U,deletableTypes:K,writableTypes:V,actionFields:z,optionsEdges:P}=t,L=Object.fromEntries(Object.entries(t.childRecipes).map(([e,t])=>[e,t.groups])),Q=Object.fromEntries(Object.entries(t.replaceRecipes).map(([e,t])=>[e,t.groups])),B=new Map,H=new Map,J=new Map,X=e=>{let[t,...n]=Object.entries(C).find(([t])=>t===e)?.[1]??[];return(t&&0===n.length?H.get(t):void 0)??J.get(e)??Z},Y=e=>H.get(e)??X(e),Z=new s({name:m,description:"Every entity of the configuration.",fields:()=>E(G[m]??[],Y,q)});for(let e of(J.set(m,Z),Object.keys(C)))e!==m&&J.set(e,new s({name:e,interfaces:[Z],fields:()=>E(G[e]??[],Y)}));let _={};for(let e of x){let t=[m,...Object.entries(C).filter(([t,n])=>t!==m&&n.includes(e)).map(([e])=>e)],n=G[e]??[];_[e]=R(n),H.set(e,new a({name:e,interfaces:t.flatMap(e=>J.get(e)??[]),fields:()=>{let t=B.get(e);return{...E(n,Y),...t?{meta:{type:new o(t),description:"What can be done to this entity right now."}}:{}}}}))}let ee=(O=()=>X(J.has(f)?f:m),k=()=>X(m),M=new a({name:"DryRunError",description:"One reason a change cannot be made right now.",fields:{type:{type:new o(c),description:"Kind of the problem."},entityId:{type:n,description:"The entity the problem is on, when it is on one."},message:{type:c,description:"The problem as the user would be told it."}}}),new a({name:"DryRun",description:"What using a recipe or writing an option would do, tried out on the configuration the query reads. Nothing is changed.",fields:()=>({ok:{type:new o(e),description:"Whether the change would succeed on the configuration the query reads."},root:{type:O(),description:"The root entity of the configuration as it would be after the change; null when ok is false. Everything selected under it reads that configuration."},changedEntities:{type:new o(new r(new o(k()))),description:"Entities the change would add or modify; empty when ok is false. One whose id is not in the configuration would be added, and its real id may differ. An entity written to is listed even when its values stay the same."},deletedEntityIds:{type:new o(new r(new o(n))),description:"The ids of the entities the change would remove; empty when ok is false."},sideEffects:{type:new o(new r(new o(c))),description:"The major or unexpected things the configurator would change along with it; empty when ok is false."},errors:{type:new o(new r(new o(M))),description:"Why the change cannot be made; empty when ok is true."}})})),et={recipeGroup:(T=[...Object.keys(L).length>0?[b.mutation]:[],...Object.keys(Q).length>0?[v.mutation]:[]],D=T.join(" or "),F=new a({name:"Recipe",description:`${T.includes("addChild")?"One thing that can be added to the entity (under childRecipes)":"One thing the entity can be replaced with (under replaceRecipes)"}${T.length>1?" or that it can be replaced with (under replaceRecipes)":""}.`,fields:{key:{type:new o(c),description:`Pass to ${D} as recipeKey. Valid only for the listing it came from.`},name:{type:new o(c),description:"Name shown to the user."},description:{type:c},imageUrl:{type:c,description:"Thumbnail shown to the user."},dryRun:{type:ee,description:"What using this recipe would do. Null when it cannot be tried."}}}),new a({name:"RecipeGroup",description:"A group of recipes for this entity.",fields:{groupId:{type:new o(c),description:`Pass to ${D} as recipeGroupId.`},name:{type:new o(c),description:"Name shown to the user."},description:{type:c},recipes:{type:new o(new r(new o(F)))}}})),fieldOption:new a({name:"FieldOption",description:"One value a field accepts. Writing a value outside the list is rejected unless the field description says it is not checked.",fields:{value:{type:new o(h),description:"The value to write to the field."},name:{type:c,description:"Name shown to the user."},description:{type:c},imageUrl:{type:c,description:"Image shown to the user."},color:{type:c,description:'Color shown to the user, as "#rrggbb".'},dryRun:{type:ee,description:"What writing this value would do. Null when it cannot be tried."}}}),screenshot:new a({name:"Screenshot",description:"A screenshot of an entity. The picture itself follows the tool result.",fields:{image:{type:new o(n),description:"Label of the image that follows the tool result."}}})};for(let e of x){let n=j(t.childRecipes,e)??{groups:[],hints:[]},i=j(t.replaceRecipes,e)??{groups:[],hints:[]},s=j(P,e)??[],r=j(t.screenshots,e)??[];(n.groups.length>0||i.groups.length>0||s.length>0||r.length>0)&&B.set(e,A({entityType:e,childRecipes:n,replaceRecipes:i,optionsEdges:s.map(t=>({...t,hints:(C[f]??[]).includes(e)?t.hints.filter(e=>"sameForAllInstances"!==e):t.hints})),screenshots:r},et))}let en=new p({query:(I=X(J.has(f)?f:m),N=X(m),W=(e=>{let t={};for(let[n,i,s]of g){let r=e[s];r.length>1&&(t[n]={type:new o(c),description:$(i,r)})}if(0!==Object.keys(t).length)return new a({name:"Navigation",description:"The active UI states of the configurator.",fields:t})})(U),new a({name:"Query",fields:{root:{type:new o(I),description:"The root entity of the configuration."},entities:{type:new o(new r(N)),args:{ids:{type:new r(new o(n))}},description:"Every entity, or the given ids in order with null for an unknown id."},selectedEntity:{type:new o(N),description:"The selected entity, or the root entity when nothing is selected."},...W?{navigation:{type:new o(W)}}:{}}})),mutation:(({deletableTypes:e,writableTypes:t,childRecipes:s,replaceRecipes:p,actionFields:d,objectTypes:l,anyDomainEntity:h,targetOutputType:y})=>{let u,m;if(0!==e.length||0!==t.length||0!==Object.keys(s).length||0!==Object.keys(p).length||0!==d.length)return new a({name:"Mutation",fields:Object.assign(0===e.length?{}:{deleteEntity:{type:new o(new r(new o(n))),args:{id:{type:new o(n)}},description:`Deletes the entity and everything composed into it. Deletable types: ${e.join(", ")}. Returns the ids removed, the given one first.`}},0===(u=S(s)).length?{}:{addChild:{type:new o(new r(new o(h))),args:{parentId:{type:new o(n)},recipeGroupId:{type:new o(c)},recipeKey:{type:new o(c)}},description:`Adds a child to the entity parentId from a recipe listed under its meta { childRecipes }. Types with child recipes: ${u.join("; ")}. Returns the entities added, the recipe's own first; empty when they were removed again.`}},0===(m=S(p)).length?{}:{replaceEntity:{type:new o(new r(new o(h))),args:{entityId:{type:new o(n)},recipeGroupId:{type:new o(c)},recipeKey:{type:new o(c)}},description:`Replaces the entity entityId from a recipe listed under its meta { replaceRecipes }. Types with replace recipes: ${m.join("; ")}. The replacement is a new entity: it has a new id and the field values of its recipe, and entityId no longer exists. Returns the entities added, the replacement first; empty when they were removed again.`}},...t.flatMap(e=>{let t=l.get(e.entityType);return t?[(({entityType:e,fields:t},s)=>{let r=Object.fromEntries(t.map(({name:e,type:t,description:n})=>[e,{type:w(t),description:n}]));return{[`modify${e}`]:{type:s,args:{id:{type:new o(n)},delta:{type:new o(new i({name:`${e}Delta`,fields:r}))}},description:`Sets the fields named in delta on one ${e}. Returns the entity after the change, or null when the change removed it.`}}})(e,t)]:[]}),Object.fromEntries(d.map(e=>{var t;return[e.fieldName,{type:new o(new a({name:(t=e.fieldName,`${t.charAt(0).toUpperCase()+t.slice(1)}Result`),description:`What ${e.fieldName} returns, read from the configuration after the change.`,fields:()=>Object.fromEntries(Object.entries(e.result).map(([e,t])=>[e,{type:"edge"===t.kind?(({target:e,list:t,nullable:n},i)=>{let s=t?new r(new o(i(e))):i(e);return n?s:new o(s)})(t,y):w(t.type),description:t.description}]))})),args:Object.fromEntries(Object.entries(e.args).map(([e,t])=>[e,{type:w(t.type),description:t.description}])),description:e.description}]})))})})({deletableTypes:K,writableTypes:V,childRecipes:L,replaceRecipes:Q,actionFields:z,objectTypes:H,anyDomainEntity:X(m),targetOutputType:Y}),types:[...J.values(),...H.values()]}),ei=l(en);if(ei.length>0)throw Error(ei.map(e=>e.message).join(" "));let es=d(en);return{sdl:es,navigationFields:g.filter(([,,e])=>U[e].length>1).map(([e])=>e),fields:_,deletableTypes:K,writableFields:Object.fromEntries(V.map(({entityType:e,fields:t})=>[e,Object.fromEntries(t.map(({name:e,property:t})=>[e,t]))])),childRecipes:L,replaceRecipes:Q,fieldOptions:Object.fromEntries(x.flatMap(e=>{let t=j(P,e);return t?[[e,t.map(({options:e})=>e)]]:[]})),screenshots:Object.fromEntries(x.flatMap(e=>{let n=j(t.screenshots,e);return n?[[e,n]]:[]})),actions:Object.fromEntries(z.map(({fieldName:e,actionName:t})=>[e,t])),lenses:y(t,u(es)),formElements:t.formElements}};
1
+ import{GraphQLBoolean as e,GraphQLEnumType as t,GraphQLID as n,GraphQLInputObjectType as i,GraphQLInterfaceType as s,GraphQLList as r,GraphQLNonNull as o,GraphQLObjectType as a,GraphQLSchema as p,GraphQLString as d,printSchema as c,validateSchema as h}from"graphql";import{GraphQLJSON as l,createAssistantValueType as w}from"./assistant-value-type.js";import{buildAssistantLenses as y}from"./build-assistant-lenses.js";import{createAssistantExecutionSchema as u}from"./create-assistant-execution-schema.js";let g="AnyDomainEntity",f="RootEntity",m=[["navigationState","Active navigation state.","navigationStates"],["viewState","Active view state.","viewStates"],["toolState","Active tool state.","toolStates"]],b={section:"childRecipes",mutation:"addChild"},v={section:"replaceRecipes",mutation:"replaceEntity"},j=(e,t)=>Object.entries(e).find(([e])=>e===t)?.[1],$=(e,t)=>{if(!t||0===t.length)return e;let n=`One of: ${t.map(e=>`"${e}"`).join(", ")}.`;return e?/[.!?]$/.test(e)?`${e} ${n}`:`${e}. ${n}`:n},O=({target:e,cardinality:t},n)=>{let i=n(e);switch(t){case"1-1":return new o(i);case"0-1":return i;case"0-N":case"1-N":return new o(new r(new o(i)))}},E=(e,t,i)=>{let s={id:{type:new o(n),description:i?`Unique id of the entity, assigned by the configurator, e.g. "${i}-1".`:void 0},type:{type:new o(d),description:i?`Entity type name, e.g. "${i}".`:void 0}};for(let n of e)s[n.name]={type:"edge"===n.type.kind?O(n.type,t):w(n.type.type),description:n.description};return s},R=e=>Object.fromEntries(e.map(({name:e,source:t,localized:n})=>[e,n?{source:t,localized:!0}:{source:t}])),k=e=>new o(new r(new o(e))),T={sameForAllInstances:e=>`Same recipe groups and recipes for every ${e}.`,constantDuringSession:()=>"Fixed for the session."},I={sameForAllInstances:e=>`Same for every ${e}.`,constantDuringSession:()=>"Fixed for the session."},N=(e,t,n)=>e.map(e=>` ${t[e](n)}`).join(""),A=({section:e},{groups:t,hints:n},{entityType:i,purpose:s,recipeGroup:a})=>{let p=t.filter(({dryRuns:e})=>!e).map(({groupId:e})=>e);return 0===t.length?{}:{[e]:{type:new o(new r(new o(a))),description:`The recipe groups for ${s} this ${i}: ${t.map(({groupId:e})=>e).join(", ")}. A group is listed only while the configurator offers it on the entity.${p.length>0?` Recipes of these groups cannot be dry-run: ${p.join(", ")}.`:""}${N(n,T,i)}`}}},S=({entityType:e,childRecipes:n,replaceRecipes:i,optionsEdges:s,screenshots:p,hasInvariants:d},{recipeGroup:c,fieldOption:h,screenshot:l,warning:w})=>new a({name:`${e}Meta`,fields:Object.assign(A(b,n,{entityType:e,purpose:"adding children to",recipeGroup:c}),A(v,i,{entityType:e,purpose:"replacing",recipeGroup:c}),...s.map(({options:{edgeName:t,field:n,validate:i,dryRuns:s},hints:a})=>({[t]:{type:new r(new o(h)),description:`Values "${n}" accepts on this ${e}. Null when there is no choice to make.${i?"":" Not checked on write."}${s?"":" Cannot be dry-run."}${N(a,I,e)}`}})),0===p.length?{}:{screenshot:{type:l,args:{view:{type:new o(new t({name:`${e}ScreenshotView`,values:Object.fromEntries(p.map(({view:e,description:t})=>[e,{description:t}]))}))}},description:"Renders this entity from a predefined view. The picture follows the tool result as an image labelled with `image`. Null when the view does not apply to this entity right now."}},d?{warnings:{type:k(w),description:`The warnings and notices this ${e} has right now.`}}:{})}),M=(e,t)=>t?e?"What can be done to this entity right now, and its warnings.":"The warnings of this entity right now.":"What can be done to this entity right now.",W=e=>Object.entries(e).map(([e,t])=>`${e} (${t.map(({groupId:e})=>e).join(", ")})`);export const buildAssistantManifest=t=>{var O,T,I,N,A;let D,F,q,x,{entityTypes:C,aliases:G,exampleType:K,fields:U,states:V,deletableTypes:P,writableTypes:z,actionFields:H,optionsEdges:L,invariantTypes:Q}=t,B=Object.fromEntries(Object.entries(t.childRecipes).map(([e,t])=>[e,t.groups])),J=Object.fromEntries(Object.entries(t.replaceRecipes).map(([e,t])=>[e,t.groups])),X=new Map,Y=new Map,Z=new Map,_=e=>{let[t,...n]=Object.entries(G).find(([t])=>t===e)?.[1]??[];return(t&&0===n.length?Y.get(t):void 0)??Z.get(e)??et},ee=e=>Y.get(e)??_(e),et=new s({name:g,description:"Every entity of the configuration.",fields:()=>E(U[g]??[],ee,K)});for(let e of(Z.set(g,et),Object.keys(G)))e!==g&&Z.set(e,new s({name:e,interfaces:[et],fields:()=>E(U[e]??[],ee)}));let en={};for(let e of C){let t=[g,...Object.entries(G).filter(([t,n])=>t!==g&&n.includes(e)).map(([e])=>e)],n=U[e]??[];en[e]=R(n),Y.set(e,new a({name:e,interfaces:t.flatMap(e=>Z.get(e)??[]),fields:()=>{let t=X.get(e);return{...E(n,ee),...t?{meta:{type:new o(t.type),description:t.description}}:{}}}}))}let ei=new a({name:"Warning",description:"Something about the configuration the user should know. It never makes a change fail.",fields:{type:{type:new o(d),description:"Kind of the warning."},severity:{type:new o(d),description:$("How much it matters.",["warning","notice"])},entityId:{type:n,description:"The entity the warning is on, when it is on one."},message:{type:d,description:"The warning as the user would be told it."}}}),es=(O=()=>_(Z.has(f)?f:g),T=()=>_(g),D=new a({name:"DryRunError",description:"One reason a change cannot be made right now.",fields:{type:{type:new o(d),description:"Kind of the problem."},entityId:{type:n,description:"The entity the problem is on, when it is on one."},message:{type:d,description:"The problem as the user would be told it."}}}),new a({name:"DryRun",description:"What using a recipe or writing an option would do, tried out on the configuration the query reads. Nothing is changed.",fields:()=>({ok:{type:new o(e),description:"Whether the change would succeed on the configuration the query reads."},root:{type:O(),description:"The root entity of the configuration as it would be after the change; null when ok is false. Everything selected under it reads that configuration."},changedEntities:{type:new o(new r(new o(T()))),description:"Entities the change would add or modify; empty when ok is false. One whose id is not in the configuration would be added, and its real id may differ. An entity written to is listed even when its values stay the same."},deletedEntityIds:{type:new o(new r(new o(n))),description:"The ids of the entities the change would remove; empty when ok is false."},sideEffects:{type:new o(new r(new o(d))),description:"The major or unexpected things the configurator would change along with it; empty when ok is false."},warnings:{type:k(ei),description:"The warnings and notices the change would newly cause, which do not stop it; empty when ok is false."},errors:{type:new o(new r(new o(D))),description:"Why the change cannot be made; empty when ok is true."}})})),er={recipeGroup:(I=[...Object.keys(B).length>0?[b.mutation]:[],...Object.keys(J).length>0?[v.mutation]:[]],F=I.join(" or "),q=new a({name:"Recipe",description:`${I.includes("addChild")?"One thing that can be added to the entity (under childRecipes)":"One thing the entity can be replaced with (under replaceRecipes)"}${I.length>1?" or that it can be replaced with (under replaceRecipes)":""}.`,fields:{key:{type:new o(d),description:`Pass to ${F} as recipeKey. Valid only for the listing it came from.`},name:{type:new o(d),description:"Name shown to the user."},description:{type:d},imageUrl:{type:d,description:"Thumbnail shown to the user."},dryRun:{type:es,description:"What using this recipe would do. Null when it cannot be tried."}}}),new a({name:"RecipeGroup",description:"A group of recipes for this entity.",fields:{groupId:{type:new o(d),description:`Pass to ${F} as recipeGroupId.`},name:{type:new o(d),description:"Name shown to the user."},description:{type:d},recipes:{type:new o(new r(new o(q)))}}})),fieldOption:new a({name:"FieldOption",description:"One value a field accepts. Writing a value outside the list is rejected unless the field description says it is not checked.",fields:{value:{type:new o(l),description:"The value to write to the field."},name:{type:d,description:"Name shown to the user."},description:{type:d},imageUrl:{type:d,description:"Image shown to the user."},color:{type:d,description:'Color shown to the user, as "#rrggbb".'},dryRun:{type:es,description:"What writing this value would do. Null when it cannot be tried."}}}),screenshot:new a({name:"Screenshot",description:"A screenshot of an entity. The picture itself follows the tool result.",fields:{image:{type:new o(n),description:"Label of the image that follows the tool result."}}}),warning:ei};for(let e of C){let n=j(t.childRecipes,e)??{groups:[],hints:[]},i=j(t.replaceRecipes,e)??{groups:[],hints:[]},s=j(L,e)??[],r=j(t.screenshots,e)??[],o=Q.includes(e),a=n.groups.length>0||i.groups.length>0||s.length>0||r.length>0;(a||o)&&X.set(e,{description:M(a,o),type:S({entityType:e,childRecipes:n,replaceRecipes:i,optionsEdges:s.map(t=>({...t,hints:(G[f]??[]).includes(e)?t.hints.filter(e=>"sameForAllInstances"!==e):t.hints})),screenshots:r,hasInvariants:o},er)})}let eo=new p({query:(N=_(Z.has(f)?f:g),A=_(g),x=(e=>{let t={};for(let[n,i,s]of m){let r=e[s];r.length>1&&(t[n]={type:new o(d),description:$(i,r)})}if(0!==Object.keys(t).length)return new a({name:"Navigation",description:"The active UI states of the configurator.",fields:t})})(V),new a({name:"Query",fields:{root:{type:new o(N),description:"The root entity of the configuration."},entities:{type:new o(new r(A)),args:{ids:{type:new r(new o(n))}},description:"Every entity, or the given ids in order with null for an unknown id."},selectedEntity:{type:new o(A),description:"The selected entity, or the root entity when nothing is selected."},...x?{navigation:{type:new o(x)}}:{},warnings:{type:k(ei),description:"Every warning and notice of the configuration the query reads."}}})),mutation:(({deletableTypes:e,writableTypes:t,childRecipes:s,replaceRecipes:p,actionFields:c,objectTypes:h,anyDomainEntity:l,targetOutputType:y})=>{let u,g;if(0!==e.length||0!==t.length||0!==Object.keys(s).length||0!==Object.keys(p).length||0!==c.length)return new a({name:"Mutation",fields:Object.assign(0===e.length?{}:{deleteEntity:{type:new o(new r(new o(n))),args:{id:{type:new o(n)}},description:`Deletes the entity and everything composed into it. Deletable types: ${e.join(", ")}. Returns the ids removed, the given one first.`}},0===(u=W(s)).length?{}:{addChild:{type:new o(new r(new o(l))),args:{parentId:{type:new o(n)},recipeGroupId:{type:new o(d)},recipeKey:{type:new o(d)}},description:`Adds a child to the entity parentId from a recipe listed under its meta { childRecipes }. Types with child recipes: ${u.join("; ")}. Returns the entities added, the recipe's own first; empty when they were removed again.`}},0===(g=W(p)).length?{}:{replaceEntity:{type:new o(new r(new o(l))),args:{entityId:{type:new o(n)},recipeGroupId:{type:new o(d)},recipeKey:{type:new o(d)}},description:`Replaces the entity entityId from a recipe listed under its meta { replaceRecipes }. Types with replace recipes: ${g.join("; ")}. The replacement is a new entity: it has a new id and the field values of its recipe, and entityId no longer exists. Returns the entities added, the replacement first; empty when they were removed again.`}},...t.flatMap(e=>{let t=h.get(e.entityType);return t?[(({entityType:e,fields:t},s)=>{let r=Object.fromEntries(t.map(({name:e,type:t,description:n})=>[e,{type:w(t),description:n}]));return{[`modify${e}`]:{type:s,args:{id:{type:new o(n)},delta:{type:new o(new i({name:`${e}Delta`,fields:r}))}},description:`Sets the fields named in delta on one ${e}. Returns the entity after the change, or null when the change removed it.`}}})(e,t)]:[]}),Object.fromEntries(c.map(e=>{var t;return[e.fieldName,{type:new o(new a({name:(t=e.fieldName,`${t.charAt(0).toUpperCase()+t.slice(1)}Result`),description:`What ${e.fieldName} returns, read from the configuration after the change.`,fields:()=>Object.fromEntries(Object.entries(e.result).map(([e,t])=>[e,{type:"edge"===t.kind?(({target:e,list:t,nullable:n},i)=>{let s=t?new r(new o(i(e))):i(e);return n?s:new o(s)})(t,y):w(t.type),description:t.description}]))})),args:Object.fromEntries(Object.entries(e.args).map(([e,t])=>[e,{type:w(t.type),description:t.description}])),description:e.description}]})))})})({deletableTypes:P,writableTypes:z,childRecipes:B,replaceRecipes:J,actionFields:H,objectTypes:Y,anyDomainEntity:_(g),targetOutputType:ee}),types:[...Z.values(),...Y.values()]}),ea=h(eo);if(ea.length>0)throw Error(ea.map(e=>e.message).join(" "));let ep=c(eo);return{sdl:ep,navigationFields:m.filter(([,,e])=>V[e].length>1).map(([e])=>e),fields:en,deletableTypes:P,writableFields:Object.fromEntries(z.map(({entityType:e,fields:t})=>[e,Object.fromEntries(t.map(({name:e,property:t})=>[e,t]))])),childRecipes:B,replaceRecipes:J,fieldOptions:Object.fromEntries(C.flatMap(e=>{let t=j(L,e);return t?[[e,t.map(({options:e})=>e)]]:[]})),screenshots:Object.fromEntries(C.flatMap(e=>{let n=j(t.screenshots,e);return n?[[e,n]]:[]})),actions:Object.fromEntries(H.map(({fieldName:e,actionName:t})=>[e,t])),lenses:y(t,u(ep)),formElements:t.formElements}};
@@ -1 +1 @@
1
- import{ASSISTANT_BUILT_IN_FORM_ELEMENTS as e}from"./form/index.js";let t=[["Containers",["group","choice","choices"]],["Options",["option"]],["Inputs",["input"]]];export const formElementSignature=({name:e,role:t,attributes:a})=>{let n=["label",...Object.entries(a).map(([e,t])=>((e,{type:t,enum:a})=>a?`${e}="${a.join("|")}"`:"string"===t?e:`${e}="<${t}>"`)(e,t))];return"option"===t||"input"===t?`<${e} ${n.join(" ")} />`:`<${e} ${n.join(" ")}>…</${e}>`};export const generateAssistantPrompt=a=>{let n,s=Object.values(a.childRecipes??{}).some(e=>e.length>0),i=Object.values(a.replaceRecipes??{}).some(e=>e.length>0),o=Object.values(a.fieldOptions??{}).some(e=>e.length>0),r=Object.keys(a.actions??{}).length>0,h=(a.deletableTypes?.length??0)>0||Object.values(a.writableFields??{}).some(e=>Object.keys(e).length>0)||s||i||r,l=s||i||o,d=[...s?["`childRecipes` is what can be added to it"]:[],...i?["`replaceRecipes` what it can be replaced with"]:[],...o?["`<field>Options` the values a field accepts"]:[]],c=["`selected`",...(a.navigationFields??[]).map(e=>`\`${e}\``)].join(", ");return[["Tools","- Put related operations in one call and select only the fields you need.",...h?[`- Use a mutation inside \`query\` to answer a what-if about a change ${l?"the lists under `meta` do not show":"before making it"}.`,"- Use `apply` only for what the user asked for."]:["- Nothing in this configurator can be changed through you. Say so when the user asks for a change."],"- When an operation fails, its `errors` say why and what to send instead."],...h?[["After a change","- A change is made only when the `apply` result has `committed: true`. Otherwise `errors` or `message` says what happened; without either, nothing changed. Never say a change was made when it was not.","- `sideEffects` names the major or unexpected things the configurator changed along with your change. Tell the user about them when committed; otherwise they describe what would happen. Smaller adjustments are not listed.","- A mutation returns the state after the change: use the ids and values it returned, not the ones you sent.",...r?["- When one mutation does the whole of what the user asked, use it instead of building the same change from several others."]:[]]]:[],...l?[["What can be done to an entity",`- \`meta\` lists what is possible right now: ${d.join(", ")}. Read the list before such a change and before telling the user what is available.`,`- You can select \`dryRun\` on ${[...s||i?["recipes"]:[],...o?["options"]:[]].join(" or ")} to look ahead and pick one that meets what the user asked for. It is optional before a change.`,"- Read the lists again after a change, unless their descriptions say they stay the same."]]:[],["The `[changes]` block","- Every user message starts with it: a glimpse of what the user did in the configurator since your last turn.",`- \`[changes: none]\`, or only ${c} lines: what you know still holds. Do not query it again.`,"- Other lines are a hint at what to read again: `A` added, `D` deleted, `M` modified with the fields. Text after `#` says what caused the line; `reset: undo/redo` says the user undid or redid changes.","- Read computed fields again when a listed change may affect them.","- `[changes: unavailable]` and `[changes: too many (n)]`: read again before relying on anything you read earlier.",...h?["- Your applied changes are not listed, except those waiting for user approval: they appear once approved."]:[]],["Reading the schema","- Take ids from results.",...(a.deletableTypes?.length??0)>0||i?["- The id of a deleted or replaced entity is gone and may later be given to another entity."]:[],`- A field whose name starts with \`_\` is computed: read it${h?", never write it":""}.`,"- Numbers are in the unit the field description names. Convert when the user uses another unit."],["Links","- You may link an entity of the current configuration when you speak about that very entity: `[the left burner](entity:CookingTop-1)`. It helps the user find it in the configurator.",...l?["- Whenever you name recipes or options you read from `meta`, in a list, a table or a sentence, link each one: `[Single gas burner](recipe:KitchenRange-1/top/gas_single)` or `[Oak](option:Cabinet-2/finishOptions/oak)`. The link shows the user its picture or color and its description, so never draw previews yourself. The target is the entity id, the recipe group id or the options field you read, and the key or value, each encoded as in a URL."]:[]],["Replies","- Write Markdown only, never HTML: the panel does not render it.","- An image, `![alt](path)`, is shown only when its path is relative.","- To make a warning or a key note stand out, write a GitHub alert: a blockquote whose first line is only `[!WARNING]` or `[!NOTE]`. Use it sparingly."],["Forms","- To ask the user something they answer by picking or typing, end your reply with a form: a fenced code block with the language `form`. It holds only elements, written as lowercase tags with string attributes, without Markdown or text.","- Every element takes `label`, the text the user sees; on a container or an input it also names the answer. An option or an input whose signature lists `value` takes it: an option sends it instead of its label, and an input starts with it.",'- A bare attribute in a signature takes any text, `name="<type>"` takes a value of that type written as text, such as `min="<number>"`, and `name="a|b"` takes one of the words listed.',"- Options can also stand on their own, outside a `choice` or `choices`.","- An element or attribute not listed here, or an element other than an option inside a `choice` or `choices`, makes the whole form fail.","- The answer is the user's next message. Each container or input gives a line `Label: value`, or the bare value without a label; the lines of a labelled container are indented by two spaces under it, a `choices` lists each picked option on its own line, and `—` marks what was left unanswered.",'- Example: `<choice label="Plinth"><reply label="Black" /><reply label="Oak" /></choice>` is answered with `Plinth: Oak`.',"- The chat shows the answer as the user's own message, so a `value` reads as natural words, never as an id, key or code. Give `value` only when the label alone would be unclear as an answer, and map the answer's labels back to ids yourself.",...(n=[...e,...a.formElements??[]],t.flatMap(([e,t])=>{let a=n.filter(({role:e})=>t.includes(e));return 0===a.length?[]:[`- ${e}:`,...a.map(e=>` - \`${formElementSignature(e)}\`: ${(({description:e,required:t=[]})=>0===t.length?e:`${e} Requires ${t.map(e=>`\`${e}\``).join(", ")}.`)(e)}`)]}))],...a.lenses?.declarations?[["Built-in fragments","- These fragments are already defined for every operation. Spread one by name on a field of its type, as in `field { ...FragmentName }`, instead of listing its fields.","- A fragment is a starting selection: add the other fields you need next to the spread, by name from the schema.","- Never define a fragment with one of these names.","",a.lenses.declarations]]:[]].map(e=>e.join("\n")).join("\n\n")};
1
+ import{ASSISTANT_BUILT_IN_FORM_ELEMENTS as e}from"./form/index.js";let t=[["Containers",["group","choice","choices"]],["Options",["option"]],["Inputs",["input"]]];export const formElementSignature=({name:e,role:t,attributes:a})=>{let n=["label",...Object.entries(a).map(([e,t])=>((e,{type:t,enum:a})=>a?`${e}="${a.join("|")}"`:"string"===t?e:`${e}="<${t}>"`)(e,t))];return"option"===t||"input"===t?`<${e} ${n.join(" ")} />`:`<${e} ${n.join(" ")}>…</${e}>`};export const generateAssistantPrompt=a=>{let n,s=Object.values(a.childRecipes??{}).some(e=>e.length>0),o=Object.values(a.replaceRecipes??{}).some(e=>e.length>0),i=Object.values(a.fieldOptions??{}).some(e=>e.length>0),r=Object.keys(a.actions??{}).length>0,h=Object.values(a.screenshots??{}).some(e=>e.length>0),l=(a.deletableTypes?.length??0)>0||Object.values(a.writableFields??{}).some(e=>Object.keys(e).length>0)||s||o||r,d=s||o||i,u=[...s?["`childRecipes` is what can be added to it"]:[],...o?["`replaceRecipes` what it can be replaced with"]:[],...i?["`<field>Options` the values a field accepts"]:[]],c=["`selected`",...(a.navigationFields??[]).map(e=>`\`${e}\``)].join(", ");return[["Tools","- Put related operations in one call and select only the fields you need.",`- Give every ${l?"`query` and `apply` call":"`query` call"} a \`title\` of two to five words in the user's language that says what it does for them, e.g. ${l?'"Add two drawers"':'"Compare drawer prices"'}.`,...l?[`- Use a mutation inside \`query\` to answer a what-if about a change ${d?"the lists under `meta` do not show":"before making it"}.`,"- Use `apply` only for what the user asked for."]:["- Nothing in this configurator can be changed through you. Say so when the user asks for a change."],"- When an operation fails, its `errors` say why and what to send instead. A change the configuration does not allow fails with one error per reason, as the user would be told it.","- Warnings and notices never make anything fail. The root `warnings` field lists every current one, and `meta { warnings }` those of one entity, where its type has them."],...l?[["After a change","- A change is made only when the `apply` result has `committed: true`. Otherwise `errors` or `message` says what happened; without either, nothing changed. Never say a change was made when it was not.","- `sideEffects` names the major or unexpected things the configurator changed along with your change. Tell the user about them when committed; otherwise they describe what would happen. Smaller adjustments are not listed.","- `warnings` lists the warnings and notices your change newly causes. They do not block it: tell the user about them, and offer a fix when one is clear.","- A mutation returns the state after the change: use the ids and values it returned, not the ones you sent.",...r?["- When one mutation does the whole of what the user asked, use it instead of building the same change from several others."]:[]]]:[],...d?[["What can be done to an entity",`- \`meta\` lists what is possible right now: ${u.join(", ")}. Read the list before such a change and before telling the user what is available.`,`- You can select \`dryRun\` on ${[...s||o?["recipes"]:[],...i?["options"]:[]].join(" or ")} to look ahead and pick one that meets what the user asked for. It is optional before a change.`,"- Read the lists again after a change, unless their descriptions say they stay the same."]]:[],...h?[["Seeing the design","- `meta { screenshot(view: …) { image } }` renders an entity from one of the views its `<Type>ScreenshotView` lists. The picture follows the tool result.","- Take one when the user asks how the design looks, or when you are not sure something is laid out right: what sits where, what overlaps or lines up. Otherwise rely on the data.","- Each one costs tokens and blocks the user's configurator while it renders."]]:[],["The `[changes]` block","- Every user message starts with it: a glimpse of what the user did in the configurator since your last turn.",`- \`[changes: none]\`, or only ${c} lines: what you know still holds. Do not query it again.`,"- Other lines are a hint at what to read again: `A` added, `D` deleted, `M` modified with the fields. Text after `#` says what caused the line; `reset: undo/redo` says the user undid or redid changes.","- Read computed fields again when a listed change may affect them.","- `[changes: unavailable]` and `[changes: too many (n)]`: read again before relying on anything you read earlier.",...l?["- Your applied changes are not listed, except those waiting for user approval: they appear once approved."]:[]],["Reading the schema","- Take ids from results.",...(a.deletableTypes?.length??0)>0||o?["- The id of a deleted or replaced entity is gone and may later be given to another entity."]:[],`- A field whose name starts with \`_\` is computed: read it${l?", never write it":""}.`,"- Numbers are in the unit the field description names. Convert when the user uses another unit."],["Links","- You may link an entity of the current configuration when you speak about that very entity: `[the left burner](entity:CookingTop-1)`. It helps the user find it in the configurator.",...d?["- Whenever you name recipes or options you read from `meta`, in a list, a table or a sentence, link each one: `[Single gas burner](recipe:KitchenRange-1/top/gas_single)` or `[Oak](option:Cabinet-2/finishOptions/oak)`. The link shows the user its picture or color and its description, so never draw previews yourself. The target is the entity id, the recipe group id or the options field you read, and the key or value, each encoded as in a URL."]:[]],["Replies","- Write Markdown only, never HTML: the panel does not render it.","- An image, `![alt](path)`, is shown only when its path is relative.","- To make a warning or a key note stand out, write a GitHub alert: a blockquote whose first line is only `[!WARNING]` or `[!NOTE]`. Use it sparingly."],["Forms","- To ask the user something they answer by picking or typing, end your reply with a form: a fenced code block with the language `form`. It holds only elements, written as lowercase tags with string attributes, without Markdown or text.","- Every element takes `label`, the text the user sees; on a container or an input it also names the answer. An option or an input whose signature lists `value` takes it: an option sends it instead of its label, and an input starts with it.",'- A bare attribute in a signature takes any text, `name="<type>"` takes a value of that type written as text, such as `min="<number>"`, and `name="a|b"` takes one of the words listed.',"- Options can also stand on their own, outside a `choice` or `choices`.","- An element or attribute not listed here, or an element other than an option inside a `choice` or `choices`, makes the whole form fail.","- The answer is the user's next message. Each container or input gives a line `Label: value`, or the bare value without a label; the lines of a labelled container are indented by two spaces under it, a `choices` lists each picked option on its own line, and `—` marks what was left unanswered.",'- Example: `<choice label="Plinth"><reply label="Black" /><reply label="Oak" /></choice>` is answered with `Plinth: Oak`.',"- The chat shows the answer as the user's own message, so a `value` reads as natural words, never as an id, key or code. Give `value` only when the label alone would be unclear as an answer, and map the answer's labels back to ids yourself.",...(n=[...e,...a.formElements??[]],t.flatMap(([e,t])=>{let a=n.filter(({role:e})=>t.includes(e));return 0===a.length?[]:[`- ${e}:`,...a.map(e=>` - \`${formElementSignature(e)}\`: ${(({description:e,required:t=[]})=>0===t.length?e:`${e} Requires ${t.map(e=>`\`${e}\``).join(", ")}.`)(e)}`)]}))],...a.lenses?.declarations?[["Built-in fragments","- These fragments are already defined for every operation. Spread one by name on a field of its type, as in `field { ...FragmentName }`, instead of listing its fields.","- A fragment is a starting selection: add the other fields you need next to the spread, by name from the schema.","- Never define a fragment with one of these names.","",a.lenses.declarations]]:[]].map(e=>e.join("\n")).join("\n\n")};
@@ -3,7 +3,7 @@ import type { ThemeOptions } from '@mui/material';
3
3
  import type { z } from 'zod';
4
4
  import type { FinalizeTaskResource } from '@salsita-ai/contracts/webhook';
5
5
  import { type $DomainEntity, type DomainEntity, type DomainFactory, type EnumLike, type ProductPreset, type SchemaOfObject } from '../core/index.js';
6
- import { type ElementRegistration, type ProjectModule } from '../domain-runtime/index.js';
6
+ import { type ElementRegistration, type HandlerRegistration, type ProjectModule } from '../domain-runtime/index.js';
7
7
  import type { AclConfig, ApplicationConfig, DataSpec, DefaultEnvs, ResourcesConfig, SpecTransformer, TransformersConfig, UserInterfaceConfig } from './application-config.js';
8
8
  import { type AssistantResolvedManifest } from './assistant/index.js';
9
9
  interface ConfiguratorBuilderContext<ENTITIES extends DomainEntity<string> = never, ALLOWED_ROOT_ENTITIES extends ENTITIES = never, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>> = never, NAVIGATION_STATES extends string = never, VIEW_STATES extends string = never, TOOL_STATES extends string = never, EXPORT_STATES extends string = never, PUBLISHED_DATA extends Record<string, unknown> = never, SESSION_DATA extends Record<string, unknown> = never, FRONTEND_DATA extends Record<string, unknown> = never, ADMIN_ENTITIES extends DomainEntity<string> = never, ADMIN_ALLOWED_ROOT_ENTITIES extends ADMIN_ENTITIES = never, ADMIN_$MAP extends Record<ADMIN_ENTITIES['type'], $DomainEntity<ADMIN_ENTITIES>> = never, ADMIN_NAVIGATION_STATES extends string = never, ADMIN_VIEW_STATES extends string = never, FINALIZE_DATA extends Record<string, unknown> = never, PREFETCHED_FINALIZE_DATA extends Record<string, unknown> = never, FINALIZE_RESULT extends Record<string, unknown> = never, CALLBACK_DATA extends Record<string, unknown> = never, RESOURCE extends string = never> {
@@ -46,6 +46,12 @@ interface ConfiguratorBuilderContext<ENTITIES extends DomainEntity<string> = nev
46
46
  elements?: readonly ProjectModule[];
47
47
  defaultElements?: readonly ElementRegistration[];
48
48
  }
49
+ /**
50
+ * Rejects a second registration of a handler kind the application runs at most once: the assistant
51
+ * setup, the published-chunks filter, the data-row validator and the sheet validator. Both ways of
52
+ * building an application call it, `ConfiguratorBuilder.buildConfig` and `createApplication`.
53
+ */
54
+ export declare const checkSingleInstanceHandlers: (handlers: ReadonlyArray<HandlerRegistration<any, any>>) => void;
49
55
  export declare class ConfiguratorBuilder<ENTITIES extends DomainEntity<string> = never, ALLOWED_ROOT_ENTITIES extends ENTITIES = never, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>> = never, NAVIGATION_STATES extends string = never, VIEW_STATES extends string = never, TOOL_STATES extends string = never, EXPORT_STATES extends string = never, PUBLISHED_DATA extends Record<string, unknown> = never, SESSION_DATA extends Record<string, unknown> = never, FRONTEND_DATA extends Record<string, unknown> = never, ADMIN_ENTITIES extends DomainEntity<string> = never, ADMIN_ALLOWED_ROOT_ENTITIES extends ADMIN_ENTITIES = never, ADMIN_$MAP extends Record<ADMIN_ENTITIES['type'], $DomainEntity<ADMIN_ENTITIES>> = never, ADMIN_NAVIGATION_STATES extends string = never, ADMIN_VIEW_STATES extends string = never, FINALIZE_DATA extends Record<string, unknown> = never, PREFETCHED_FINALIZE_DATA extends Record<string, unknown> = never, FINALIZE_RESULT extends Record<string, unknown> = never, CALLBACK_DATA extends Record<string, unknown> = never, RESOURCE extends string = never> {
50
56
  private readonly _context;
51
57
  constructor(_context: ConfiguratorBuilderContext<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>);
@@ -1 +1 @@
1
- import{initConsoleLogger as t}from"@salsita-ai/common/utils";import{defaultI18n as e}from"#package/i18n";import{extendedSchemaValidator as i}from"../core/index.js";import{NoopAnalyticsSystem as r}from"../domain-context/index.js";import{createDomainRuntime as n}from"../domain-runtime/index.js";import{isGetApplicationWrapperHandler as o}from"./GetApplicationWrapperHandler.js";import{isGetWebComponentOptionsHandler as a}from"./GetWebComponentOptions.js";import{isAssistantSetupHandler as s}from"./assistant/index.js";import{createInitialPublishedData as l}from"./create-initial-published-data.js";import{isDataRowValidatorHandler as h}from"./published-data/DataRowValidatorHandler.js";import{isFilterPublishedChunksHandler as u}from"./published-data/FilterPublishedChunksHandler.js";import{isMapPublishedChunkedDataHandler as d}from"./published-data/MapPublishedChunkedDataHandler.js";import{isMapPublishedRevisionDataHandler as c}from"./published-data/MapPublishedRevisionDataHandler.js";import{isSheetValidatorHandler as f}from"./published-data/SheetValidatorHandler.js";export class ConfiguratorBuilder{_context;constructor(t){this._context=t}withDefaultEnvs(t){return new ConfiguratorBuilder({...this._context,defaultEnvs:t})}withVersion(t){return new ConfiguratorBuilder({...this._context,version:t})}withTextLanguages(t){return new ConfiguratorBuilder({...this._context,textLanguages:t})}withAcl(t){return new ConfiguratorBuilder({...this._context,acl:t})}withAdminRelease(t){return new ConfiguratorBuilder({...this._context,enableAdminRelease:t})}withUi(t){return new ConfiguratorBuilder({...this._context,ui:t})}withResourcesConfig(t){return new ConfiguratorBuilder({...this._context,resourcesConfig:t})}withChunks(t){return new ConfiguratorBuilder({...this._context,chunks:t})}withPublishedDataHash(t){return new ConfiguratorBuilder({...this._context,publishedDataHash:t})}withAssistant(t){return new ConfiguratorBuilder({...this._context,assistant:t})}withTheme(t){return new ConfiguratorBuilder({...this._context,theme:t})}withDomainFactory(t){return new ConfiguratorBuilder({...this._context,domainFactory:t})}withAdminDomainFactory(t){return new ConfiguratorBuilder({...this._context,adminDomainFactory:t})}withI18n=t=>new ConfiguratorBuilder({...this._context,i18n:t});withPrefetchedFinalizeData(t){return new ConfiguratorBuilder({...this._context,prefetchedFinalizeData:t})}withFinalizeData(t){return new ConfiguratorBuilder({...this._context,finalizeData:t})}withFinalizeResult(t){return new ConfiguratorBuilder({...this._context,finalizeResult:t})}withCallbackData(t){return new ConfiguratorBuilder({...this._context,callbackData:t})}withNavigationState(t){return new ConfiguratorBuilder({...this._context,navigationState:t})}withViewState(t){return new ConfiguratorBuilder({...this._context,viewState:t})}withToolState(t){return new ConfiguratorBuilder({...this._context,toolState:t})}withExportState(t){return new ConfiguratorBuilder({...this._context,exportState:t})}withAdminNavigationState(t){return new ConfiguratorBuilder({...this._context,adminNavigationState:t})}withAdminViewState(t){return new ConfiguratorBuilder({...this._context,adminViewState:t})}withPresets(t){return new ConfiguratorBuilder({...this._context,presets:t})}withAdminPresets(t){return new ConfiguratorBuilder({...this._context,adminPresets:t})}withComponentOptics(t){return new ConfiguratorBuilder({...this._context,componentOptics:[...this._context.componentOptics,...t]})}withAdminComponentOptics(t){return new ConfiguratorBuilder({...this._context,adminComponentOptics:[...this._context.adminComponentOptics??[],...t]})}withHandlers(t){return new ConfiguratorBuilder({...this._context,handlers:t})}withElements(t){return new ConfiguratorBuilder({...this._context,elements:t})}withDefaultElements(t){return new ConfiguratorBuilder({...this._context,defaultElements:t})}withResources(t){return new ConfiguratorBuilder({...this._context,resources:t})}withWebComponentTag(t){return new ConfiguratorBuilder({...this._context,tagName:t})}withTransformers(t,e){return new ConfiguratorBuilder({...this._context,transformers:{importedTransformers:t,specTransformers:e}})}withInterface(t){return this}withDataSpec=t=>new ConfiguratorBuilder({...this._context,dataSpec:t});_computeInitialPublishedData(t,e,i){if(!this._context.adminDomainFactory)throw Error("adminDomainFactory is required!");return l({adminDomainFactory:this._context.adminDomainFactory,domainRuntime:e,adminPresets:this._context.adminPresets??[],handlers:i,dataSpec:this._context.dataSpec,chunks:this._context.chunks,logger:t})}buildConfig(){return this._buildConfigWithHandlers().config}_buildConfigWithHandlers(){if(!this._context.domainFactory)throw Error("Can not create application config, domainFactory is required! Is it registered with the ConfiguratorBuilder?");if(!this._context.presets)throw Error("Can not create application config, presets are required! Is it registered with the ConfiguratorBuilder?");if(!this._context.adminDomainFactory)throw Error("Can not create application config, adminDomainFactory is required! Is it registered with the ConfiguratorBuilder?");if(!this._context.adminPresets)throw Error("Can not create application config, adminPresets are required! Is it registered with the ConfiguratorBuilder?");if(!this._context.version)throw Error("Can not create application config, version is required!");let i=this._context.tagName??"salsita-configurator",l={defaultEnvs:this._context.defaultEnvs,services:{i18n:this._context.i18n},version:this._context.version,initialPublishedData:{},domain:{textLanguages:this._context.textLanguages,componentOptics:this._context.componentOptics,presets:this._context.presets,domainFactory:this._context.domainFactory},navigation:{navigationStates:this._context.navigationState?.values(),viewStates:this._context.viewState?.values(),toolStates:this._context.toolState?.values(),exportStates:this._context.exportState?.values()},adminNavigation:{navigationStates:this._context.adminNavigationState?.values(),viewStates:this._context.adminViewState?.values()},adminDomain:{textLanguages:this._context.textLanguages,componentOptics:this._context.adminComponentOptics??[],presets:this._context.adminPresets,domainFactory:this._context.adminDomainFactory},mount:{tag:i,options:{}},handlers:this._context.handlers??[],elements:this._context.elements??[],defaultElements:this._context.defaultElements??[],transformers:this._context.transformers,features:{acl:this._context.acl,enableAdminRelease:this._context.enableAdminRelease},ui:{preview:this._context.ui?.preview,alwaysExpand:this._context.ui?.alwaysExpand,theme:this._context.theme},resources:this._context.resourcesConfig,chunks:this._context.chunks,publishedDataHash:this._context.publishedDataHash,assistant:this._context.assistant,dataSpec:this._context.dataSpec},d=t(),c=n({config:l,services:{analyticsService:new r,i18n:e,logger:d}}),m=c.getState().spec.configurator.handlers;if(m.filter(s).length>1)throw Error("Multiple createAssistantSetupHandler handlers found. Only one handler is allowed.");if(m.filter(t=>u(t)).length>1)throw Error("Multiple createFilterPublishedChunksHandler handlers found. Only one handler is allowed.");if(m.filter(t=>h(t)).length>1)throw Error("Multiple createDataRowValidatorHandler handlers found. Only one handler is allowed.");if(m.filter(t=>f(t)).length>1)throw Error("Multiple createSheetValidatorHandler handlers found. Only one handler is allowed.");let w=m.find(o)?.handler().handler,x=m.find(a)?.handler().handler(void 0),_=this._computeInitialPublishedData(d,c,m);return{config:{...l,mount:{tag:i,options:x??{},Application:w},initialPublishedData:_},handlers:m}}buildWebhookContext(){if(!this._context.domainFactory)throw Error("domainFactory is required!");if(!this._context.adminDomainFactory)throw Error("adminDomainFactory is required!");if(!this._context.adminPresets)throw Error("adminPresets are required!");let{config:t,handlers:e}=this._buildConfigWithHandlers(),r=t=>{if(null==this._context.finalizeData)return{};let e=i.compile(this._context.finalizeData);if(!e(t))throw console.error("Finalize data validation errors:",e.errors),Error("Invalid finalize data!");return t},n=t=>{if(null==this._context.finalizeResult)return{};let e=i.compile(this._context.finalizeResult);if(!e(t))throw console.error("Finalize result validation errors:",e.errors),Error("Invalid finalize result!");return t},o=t=>{if(null==this._context.callbackData)return{};let e=i.compile(this._context.callbackData);if(!e(t))throw console.error("Callback data validation errors:",e.errors),Error("Invalid callback data!");return t},a=e.find(c)?.handler().handler,s=e.find(d)?.handler().handler,l=e.find(h)?.handler().handler,u=e.find(f)?.handler().handler;return{config:t,parseFinalizeData:r,parseFinalizeResult:n,resources:this._context.resources??[],parseCallbackData:o,mapPublishedRevisionData:a,mapPublishedChunkedData:s,dataRowValidator:l,sheetValidator:u}}}
1
+ import{initConsoleLogger as t}from"@salsita-ai/common/utils";import{defaultI18n as e}from"#package/i18n";import{extendedSchemaValidator as i}from"../core/index.js";import{NoopAnalyticsSystem as r}from"../domain-context/index.js";import{createDomainRuntime as n}from"../domain-runtime/index.js";import{isGetApplicationWrapperHandler as o}from"./GetApplicationWrapperHandler.js";import{isGetWebComponentOptionsHandler as a}from"./GetWebComponentOptions.js";import{isAssistantSetupHandler as s}from"./assistant/index.js";import{createInitialPublishedData as u}from"./create-initial-published-data.js";import{isDataRowValidatorHandler as h}from"./published-data/DataRowValidatorHandler.js";import{isFilterPublishedChunksHandler as l}from"./published-data/FilterPublishedChunksHandler.js";import{isMapPublishedChunkedDataHandler as c}from"./published-data/MapPublishedChunkedDataHandler.js";import{isMapPublishedRevisionDataHandler as d}from"./published-data/MapPublishedRevisionDataHandler.js";import{isSheetValidatorHandler as m}from"./published-data/SheetValidatorHandler.js";let f=[[s,"createAssistantSetupHandler"],[l,"createFilterPublishedChunksHandler"],[h,"createDataRowValidatorHandler"],[m,"createSheetValidatorHandler"]];export const checkSingleInstanceHandlers=t=>{for(let[e,i]of f)if(t.filter(t=>e(t)).length>1)throw Error(`Multiple ${i} handlers found. Only one handler is allowed.`)};export class ConfiguratorBuilder{_context;constructor(t){this._context=t}withDefaultEnvs(t){return new ConfiguratorBuilder({...this._context,defaultEnvs:t})}withVersion(t){return new ConfiguratorBuilder({...this._context,version:t})}withTextLanguages(t){return new ConfiguratorBuilder({...this._context,textLanguages:t})}withAcl(t){return new ConfiguratorBuilder({...this._context,acl:t})}withAdminRelease(t){return new ConfiguratorBuilder({...this._context,enableAdminRelease:t})}withUi(t){return new ConfiguratorBuilder({...this._context,ui:t})}withResourcesConfig(t){return new ConfiguratorBuilder({...this._context,resourcesConfig:t})}withChunks(t){return new ConfiguratorBuilder({...this._context,chunks:t})}withPublishedDataHash(t){return new ConfiguratorBuilder({...this._context,publishedDataHash:t})}withAssistant(t){return new ConfiguratorBuilder({...this._context,assistant:t})}withTheme(t){return new ConfiguratorBuilder({...this._context,theme:t})}withDomainFactory(t){return new ConfiguratorBuilder({...this._context,domainFactory:t})}withAdminDomainFactory(t){return new ConfiguratorBuilder({...this._context,adminDomainFactory:t})}withI18n=t=>new ConfiguratorBuilder({...this._context,i18n:t});withPrefetchedFinalizeData(t){return new ConfiguratorBuilder({...this._context,prefetchedFinalizeData:t})}withFinalizeData(t){return new ConfiguratorBuilder({...this._context,finalizeData:t})}withFinalizeResult(t){return new ConfiguratorBuilder({...this._context,finalizeResult:t})}withCallbackData(t){return new ConfiguratorBuilder({...this._context,callbackData:t})}withNavigationState(t){return new ConfiguratorBuilder({...this._context,navigationState:t})}withViewState(t){return new ConfiguratorBuilder({...this._context,viewState:t})}withToolState(t){return new ConfiguratorBuilder({...this._context,toolState:t})}withExportState(t){return new ConfiguratorBuilder({...this._context,exportState:t})}withAdminNavigationState(t){return new ConfiguratorBuilder({...this._context,adminNavigationState:t})}withAdminViewState(t){return new ConfiguratorBuilder({...this._context,adminViewState:t})}withPresets(t){return new ConfiguratorBuilder({...this._context,presets:t})}withAdminPresets(t){return new ConfiguratorBuilder({...this._context,adminPresets:t})}withComponentOptics(t){return new ConfiguratorBuilder({...this._context,componentOptics:[...this._context.componentOptics,...t]})}withAdminComponentOptics(t){return new ConfiguratorBuilder({...this._context,adminComponentOptics:[...this._context.adminComponentOptics??[],...t]})}withHandlers(t){return new ConfiguratorBuilder({...this._context,handlers:t})}withElements(t){return new ConfiguratorBuilder({...this._context,elements:t})}withDefaultElements(t){return new ConfiguratorBuilder({...this._context,defaultElements:t})}withResources(t){return new ConfiguratorBuilder({...this._context,resources:t})}withWebComponentTag(t){return new ConfiguratorBuilder({...this._context,tagName:t})}withTransformers(t,e){return new ConfiguratorBuilder({...this._context,transformers:{importedTransformers:t,specTransformers:e}})}withInterface(t){return this}withDataSpec=t=>new ConfiguratorBuilder({...this._context,dataSpec:t});_computeInitialPublishedData(t,e,i){if(!this._context.adminDomainFactory)throw Error("adminDomainFactory is required!");return u({adminDomainFactory:this._context.adminDomainFactory,domainRuntime:e,adminPresets:this._context.adminPresets??[],handlers:i,dataSpec:this._context.dataSpec,chunks:this._context.chunks,logger:t})}buildConfig(){return this._buildConfigWithHandlers().config}_buildConfigWithHandlers(){if(!this._context.domainFactory)throw Error("Can not create application config, domainFactory is required! Is it registered with the ConfiguratorBuilder?");if(!this._context.presets)throw Error("Can not create application config, presets are required! Is it registered with the ConfiguratorBuilder?");if(!this._context.adminDomainFactory)throw Error("Can not create application config, adminDomainFactory is required! Is it registered with the ConfiguratorBuilder?");if(!this._context.adminPresets)throw Error("Can not create application config, adminPresets are required! Is it registered with the ConfiguratorBuilder?");if(!this._context.version)throw Error("Can not create application config, version is required!");let i=this._context.tagName??"salsita-configurator",s={defaultEnvs:this._context.defaultEnvs,services:{i18n:this._context.i18n},version:this._context.version,initialPublishedData:{},domain:{textLanguages:this._context.textLanguages,componentOptics:this._context.componentOptics,presets:this._context.presets,domainFactory:this._context.domainFactory},navigation:{navigationStates:this._context.navigationState?.values(),viewStates:this._context.viewState?.values(),toolStates:this._context.toolState?.values(),exportStates:this._context.exportState?.values()},adminNavigation:{navigationStates:this._context.adminNavigationState?.values(),viewStates:this._context.adminViewState?.values()},adminDomain:{textLanguages:this._context.textLanguages,componentOptics:this._context.adminComponentOptics??[],presets:this._context.adminPresets,domainFactory:this._context.adminDomainFactory},mount:{tag:i,options:{}},handlers:this._context.handlers??[],elements:this._context.elements??[],defaultElements:this._context.defaultElements??[],transformers:this._context.transformers,features:{acl:this._context.acl,enableAdminRelease:this._context.enableAdminRelease},ui:{preview:this._context.ui?.preview,alwaysExpand:this._context.ui?.alwaysExpand,theme:this._context.theme},resources:this._context.resourcesConfig,chunks:this._context.chunks,publishedDataHash:this._context.publishedDataHash,assistant:this._context.assistant,dataSpec:this._context.dataSpec},u=t(),h=n({config:s,services:{analyticsService:new r,i18n:e,logger:u}}),l=h.getState().spec.configurator.handlers;checkSingleInstanceHandlers(l);let c=l.find(o)?.handler().handler,d=l.find(a)?.handler().handler(void 0),m=this._computeInitialPublishedData(u,h,l);return{config:{...s,mount:{tag:i,options:d??{},Application:c},initialPublishedData:m},handlers:l}}buildWebhookContext(){if(!this._context.domainFactory)throw Error("domainFactory is required!");if(!this._context.adminDomainFactory)throw Error("adminDomainFactory is required!");if(!this._context.adminPresets)throw Error("adminPresets are required!");let{config:t,handlers:e}=this._buildConfigWithHandlers(),r=t=>{if(null==this._context.finalizeData)return{};let e=i.compile(this._context.finalizeData);if(!e(t))throw console.error("Finalize data validation errors:",e.errors),Error("Invalid finalize data!");return t},n=t=>{if(null==this._context.finalizeResult)return{};let e=i.compile(this._context.finalizeResult);if(!e(t))throw console.error("Finalize result validation errors:",e.errors),Error("Invalid finalize result!");return t},o=t=>{if(null==this._context.callbackData)return{};let e=i.compile(this._context.callbackData);if(!e(t))throw console.error("Callback data validation errors:",e.errors),Error("Invalid callback data!");return t},a=e.find(d)?.handler().handler,s=e.find(c)?.handler().handler,u=e.find(h)?.handler().handler,l=e.find(m)?.handler().handler;return{config:t,parseFinalizeData:r,parseFinalizeResult:n,resources:this._context.resources??[],parseCallbackData:o,mapPublishedRevisionData:a,mapPublishedChunkedData:s,dataRowValidator:u,sheetValidator:l}}}
@@ -2,7 +2,7 @@ export { type DomainConfig, type NavigationConfig, type ISessionService, type Se
2
2
  export { type AssistantFieldOption, findAssistantFieldOptions, readAssistantFieldOptions, } from './assistant-field-options.js';
3
3
  export { deleteEntityUpdateTag, findAssistantMutation, modifyEntityUpdateTag } from './assistant-mutations.js';
4
4
  export { type AssistantRecipe, type AssistantRecipeContext, type AssistantRecipeGroupSnapshot, type AssistantRecipeKind, findAssistantRecipeGroups, prepareAssistantRecipeUpdates, readAssistantRecipeGroup, } from './assistant-recipe-groups.js';
5
- export { ConfiguratorBuilder } from './configurator-builder.js';
5
+ export { ConfiguratorBuilder, checkSingleInstanceHandlers } from './configurator-builder.js';
6
6
  export * from './admin-page-factories.js';
7
7
  export { createInitialPublishedData, type CreateInitialPublishedDataProps } from './create-initial-published-data.js';
8
8
  export { webComponentAttributeParsers, createWebComponentPropertyDescriptor, type AttributeParser, type WebComponentPropertyDescriptor, } from './web-component-property.js';
@@ -1 +1 @@
1
- export{findAssistantFieldOptions,readAssistantFieldOptions}from"./assistant-field-options.js";export{deleteEntityUpdateTag,findAssistantMutation,modifyEntityUpdateTag}from"./assistant-mutations.js";export{findAssistantRecipeGroups,prepareAssistantRecipeUpdates,readAssistantRecipeGroup}from"./assistant-recipe-groups.js";export{ConfiguratorBuilder}from"./configurator-builder.js";export*from"./admin-page-factories.js";export{createInitialPublishedData}from"./create-initial-published-data.js";export{webComponentAttributeParsers,createWebComponentPropertyDescriptor}from"./web-component-property.js";export{createWebComponentEventDescriptor}from"./web-component-event.js";export{standardWebComponentProperties}from"./standard-properties.js";export{standardWebComponentEvents}from"./standard-events.js";export{createGetApplicationWrapperHandler,isGetApplicationWrapperHandler}from"./GetApplicationWrapperHandler.js";export{createGetThemeHandler,GetThemeHandlerName,isGetThemeHandler}from"./GetThemeHandler.js";export{createGetWebComponentOptionsHandler,isGetWebComponentOptionsHandler}from"./GetWebComponentOptions.js";export{createFinalizeAdminDomain}from"./published-data/create-finalize-admin-domain.js";export{FilterPublishedChunksHandlerName,isFilterPublishedChunksHandler}from"./published-data/FilterPublishedChunksHandler.js";export{mapPublishedData}from"./published-data/map-published-data.js";export{flattenTabData,mapDefaultValuesToRecords,mapPublishedChunkedData,SYSTEM_CHUNK_KEY,SYSTEM_CHUNK_SCOPE,SWATCH_DEFINITION}from"./published-data/map-published-chunked-data.js";export{buildLegendRows}from"./published-data/build-legend-data.js";export{formatFieldType,getFieldDescription}from"./published-data/format-field-type.js";export{mapDataToSheet}from"./published-data/map-data-to-sheet.js";export{validateRows}from"./published-data/validate-sheet-data.js";export{createDataRowValidatorHandler,DataRowValidatorHandlerName,isDataRowValidatorHandler}from"./published-data/DataRowValidatorHandler.js";export{createSheetValidatorHandler,SheetValidatorHandlerName,isSheetValidatorHandler}from"./published-data/SheetValidatorHandler.js";export{createMapPublishedRevisionDataHandler,createMapPublishedRevisionDataHandlerFactory,isMapPublishedRevisionDataHandler}from"./published-data/MapPublishedRevisionDataHandler.js";export{createMapPublishedChunkedDataHandler,createMapPublishedChunkedDataHandlerFactory,isMapPublishedChunkedDataHandler}from"./published-data/MapPublishedChunkedDataHandler.js";export*from"./assistant/index.js";
1
+ export{findAssistantFieldOptions,readAssistantFieldOptions}from"./assistant-field-options.js";export{deleteEntityUpdateTag,findAssistantMutation,modifyEntityUpdateTag}from"./assistant-mutations.js";export{findAssistantRecipeGroups,prepareAssistantRecipeUpdates,readAssistantRecipeGroup}from"./assistant-recipe-groups.js";export{ConfiguratorBuilder,checkSingleInstanceHandlers}from"./configurator-builder.js";export*from"./admin-page-factories.js";export{createInitialPublishedData}from"./create-initial-published-data.js";export{webComponentAttributeParsers,createWebComponentPropertyDescriptor}from"./web-component-property.js";export{createWebComponentEventDescriptor}from"./web-component-event.js";export{standardWebComponentProperties}from"./standard-properties.js";export{standardWebComponentEvents}from"./standard-events.js";export{createGetApplicationWrapperHandler,isGetApplicationWrapperHandler}from"./GetApplicationWrapperHandler.js";export{createGetThemeHandler,GetThemeHandlerName,isGetThemeHandler}from"./GetThemeHandler.js";export{createGetWebComponentOptionsHandler,isGetWebComponentOptionsHandler}from"./GetWebComponentOptions.js";export{createFinalizeAdminDomain}from"./published-data/create-finalize-admin-domain.js";export{FilterPublishedChunksHandlerName,isFilterPublishedChunksHandler}from"./published-data/FilterPublishedChunksHandler.js";export{mapPublishedData}from"./published-data/map-published-data.js";export{flattenTabData,mapDefaultValuesToRecords,mapPublishedChunkedData,SYSTEM_CHUNK_KEY,SYSTEM_CHUNK_SCOPE,SWATCH_DEFINITION}from"./published-data/map-published-chunked-data.js";export{buildLegendRows}from"./published-data/build-legend-data.js";export{formatFieldType,getFieldDescription}from"./published-data/format-field-type.js";export{mapDataToSheet}from"./published-data/map-data-to-sheet.js";export{validateRows}from"./published-data/validate-sheet-data.js";export{createDataRowValidatorHandler,DataRowValidatorHandlerName,isDataRowValidatorHandler}from"./published-data/DataRowValidatorHandler.js";export{createSheetValidatorHandler,SheetValidatorHandlerName,isSheetValidatorHandler}from"./published-data/SheetValidatorHandler.js";export{createMapPublishedRevisionDataHandler,createMapPublishedRevisionDataHandlerFactory,isMapPublishedRevisionDataHandler}from"./published-data/MapPublishedRevisionDataHandler.js";export{createMapPublishedChunkedDataHandler,createMapPublishedChunkedDataHandlerFactory,isMapPublishedChunkedDataHandler}from"./published-data/MapPublishedChunkedDataHandler.js";export*from"./assistant/index.js";