@salsita-ai/sdk 0.50.0-develop.bb1eefaada → 0.50.0-develop.bb71259564

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 (1033) 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 +15 -1
  25. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  26. package/dist/application-spec/errors/diagnostic-messages.d.ts +19 -2
  27. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  28. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  29. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  30. package/dist/application-spec/generate-application/code/story-files.js +1 -1
  31. package/dist/application-spec/generate-application/code/templates/application-types.js +6 -6
  32. package/dist/application-spec/generate-application/code/templates/common/doc-comment.d.ts +2 -0
  33. package/dist/application-spec/generate-application/code/templates/common/doc-comment.js +1 -0
  34. package/dist/application-spec/generate-application/code/templates/configurator-globals.d.ts +2 -1
  35. package/dist/application-spec/generate-application/code/templates/configurator-globals.js +19 -6
  36. package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.d.ts +35 -0
  37. package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.js +5 -0
  38. package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/index.d.ts +1 -0
  39. package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/index.js +1 -0
  40. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +59 -63
  41. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-invariants.d.ts +8 -0
  42. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-invariants.js +1 -1
  43. package/dist/application-spec/generate-application/code/templates/domain-spec/index.d.ts +2 -1
  44. package/dist/application-spec/generate-application/code/templates/domain-spec/index.js +1 -1
  45. package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.js +7 -7
  46. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.d.ts +12 -0
  47. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.js +7 -0
  48. package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.d.ts +43 -0
  49. package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +33 -0
  50. package/dist/application-spec/generate-application/code/templates/global-definition/index.d.ts +2 -0
  51. package/dist/application-spec/generate-application/code/templates/global-definition/index.js +1 -1
  52. package/dist/application-spec/generate-application/code/templates/globals.js +22 -44
  53. package/dist/application-spec/generate-application/code/templates/index.d.ts +2 -6
  54. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  55. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.d.ts +10 -0
  56. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +7 -0
  57. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  58. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +14 -7
  59. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
  60. package/dist/application-spec/generate-application/code/templates/story/phx-module.d.ts +8 -2
  61. package/dist/application-spec/generate-application/code/templates/story/phx-module.js +15 -3
  62. package/dist/application-spec/generate-application/code/templates/story/wrapper.d.ts +3 -0
  63. package/dist/application-spec/generate-application/code/templates/story/wrapper.js +2 -1
  64. package/dist/application-spec/generate-application/implementations/phx-application-types.d.ts +25 -0
  65. package/dist/application-spec/generate-application/implementations/phx-application-types.js +1 -0
  66. package/dist/application-spec/generate-application/implementations/phx-domain.d.ts +36 -0
  67. package/dist/application-spec/generate-application/implementations/phx-domain.js +1 -0
  68. package/dist/application-spec/generate-application/implementations/phx-model.d.ts +24 -0
  69. package/dist/application-spec/generate-application/implementations/phx-model.js +1 -0
  70. package/dist/application-spec/generate-application/implementations/phx.d.ts +22 -0
  71. package/dist/application-spec/generate-application/implementations/phx.js +1 -0
  72. package/dist/application-spec/generate-application/index.d.ts +2 -0
  73. package/dist/application-spec/generate-application/index.js +1 -1
  74. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +3 -4
  75. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +7 -4
  76. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
  77. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.d.ts +16 -0
  78. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.js +1 -0
  79. package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +17 -4
  80. package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
  81. package/dist/application-spec/generate-application/runtime/application-spec-slice.d.ts +71 -0
  82. package/dist/application-spec/generate-application/runtime/application-spec-slice.js +1 -0
  83. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +3 -4
  84. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +7 -5
  85. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
  86. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.d.ts +16 -0
  87. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.js +1 -0
  88. package/dist/application-spec/generate-application/runtime/create-application.d.ts +57 -0
  89. package/dist/application-spec/generate-application/runtime/create-application.js +1 -0
  90. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +1 -2
  91. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.d.ts +1 -1
  92. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +1 -1
  93. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +1 -2
  94. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +1 -1
  95. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.d.ts +1 -1
  96. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.js +1 -1
  97. package/dist/application-spec/generate-application/runtime/index.d.ts +8 -0
  98. package/dist/application-spec/generate-application/runtime/index.js +1 -0
  99. package/dist/application-spec/generate-application/runtime/sections/actions-runtime.d.ts +1 -2
  100. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +1 -1
  101. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
  102. package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.d.ts +1 -1
  103. package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +1 -2
  104. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +9 -4
  105. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
  106. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +1 -2
  107. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.js +1 -1
  108. package/dist/application-spec/generate-application/runtime/sections/preset-runtime.d.ts +2 -3
  109. package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +1 -1
  110. package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.d.ts +1 -1
  111. package/dist/application-spec/generate-application/runtime/spec-runtime.d.ts +21 -0
  112. package/dist/application-spec/generate-application/runtime/spec-runtime.js +1 -0
  113. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.d.ts +3 -2
  114. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +124 -24
  115. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.js +1 -1
  116. package/dist/application-spec/generate-application/runtime-spec/spec-code-id.d.ts +1 -1
  117. package/dist/application-spec/parse-application-files/merge/merged-assistant.d.ts +13 -4
  118. package/dist/application-spec/parse-application-files/merge/merged-assistant.js +1 -1
  119. package/dist/application-spec/parse-application-files/merge/merged-infra.d.ts +4 -11
  120. package/dist/application-spec/parse-application-files/merge/merged-transformers.d.ts +2 -4
  121. package/dist/application-spec/parse-application-files/parse-application-files.js +1 -1
  122. package/dist/application-spec/parse-application-files/raw-spec/raw-acl.d.ts +2 -2
  123. package/dist/application-spec/parse-application-files/raw-spec/raw-acl.js +1 -1
  124. package/dist/application-spec/parse-application-files/raw-spec/raw-admin-pages.d.ts +3 -24
  125. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +48 -10
  126. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  127. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.d.ts +1 -1
  128. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.js +1 -1
  129. package/dist/application-spec/parse-application-files/raw-spec/raw-resources.d.ts +19 -64
  130. package/dist/application-spec/parse-application-files/spec/application/admin-spec/admin-pages.d.ts +3 -20
  131. package/dist/application-spec/parse-application-files/spec/application/admin-spec/states.d.ts +3 -5
  132. package/dist/application-spec/parse-application-files/spec/application/configurator-spec/states.d.ts +3 -8
  133. package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding.d.ts +3 -13
  134. package/dist/application-spec/parse-application-files/spec/components/bindings/write-binding.d.ts +4 -32
  135. package/dist/application-spec/parse-application-files/spec/components/component-filter.d.ts +4 -10
  136. package/dist/application-spec/parse-application-files/spec/components/components.d.ts +3 -4
  137. package/dist/application-spec/parse-application-files/spec/components/index.d.ts +1 -2
  138. package/dist/application-spec/parse-application-files/spec/components/index.js +1 -1
  139. package/dist/application-spec/parse-application-files/spec/components/sdk-component-entry.d.ts +1 -1
  140. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.d.ts +2 -3
  141. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.js +1 -1
  142. package/dist/application-spec/parse-application-files/spec/components/user-components.d.ts +2 -3
  143. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +2 -2
  144. package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +7 -29
  145. package/dist/application-spec/parse-application-files/spec/expressions/index.d.ts +0 -1
  146. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.d.ts +4 -71
  147. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.js +1 -1
  148. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts +2 -2
  149. package/dist/application-spec/parse-application-files/spec/invariants/invariant.d.ts +5 -21
  150. package/dist/application-spec/parse-application-files/spec/invariants/invariants.d.ts +4 -14
  151. package/dist/application-spec/parse-application-files/spec/model/aliases.d.ts +3 -9
  152. package/dist/application-spec/parse-application-files/spec/model/common-types.d.ts +6 -14
  153. package/dist/application-spec/parse-application-files/spec/model/defaults.d.ts +6 -31
  154. package/dist/application-spec/parse-application-files/spec/model/entity-types.d.ts +3 -8
  155. package/dist/application-spec/parse-application-files/spec/model/model-version-key.d.ts +3 -3
  156. package/dist/application-spec/parse-application-files/spec/model/names/action-name.d.ts +3 -7
  157. package/dist/application-spec/parse-application-files/spec/model/names/alias-name.d.ts +3 -7
  158. package/dist/application-spec/parse-application-files/spec/model/names/entity-or-alias-name.d.ts +3 -8
  159. package/dist/application-spec/parse-application-files/spec/model/names/entity-type-name.d.ts +3 -8
  160. package/dist/application-spec/parse-application-files/spec/model/names/expression-name.d.ts +3 -6
  161. package/dist/application-spec/parse-application-files/spec/model/names/instance-name.d.ts +3 -7
  162. package/dist/application-spec/parse-application-files/spec/model/names/invariant-name.d.ts +3 -3
  163. package/dist/application-spec/parse-application-files/spec/model/names/shape-property-name.d.ts +3 -11
  164. package/dist/application-spec/parse-application-files/spec/model/names/violation-type-name.d.ts +3 -3
  165. package/dist/application-spec/parse-application-files/spec/model/presets.d.ts +6 -29
  166. package/dist/application-spec/parse-application-files/spec/sections/actions.d.ts +6 -23
  167. package/dist/application-spec/parse-application-files/spec/sections/app-metadata.d.ts +3 -18
  168. package/dist/application-spec/parse-application-files/spec/sections/application-version.d.ts +3 -7
  169. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.d.ts +9 -0
  170. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.js +1 -0
  171. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +4 -1
  172. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  173. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant.js +1 -1
  174. package/dist/application-spec/parse-application-files/spec/sections/data-spec/chunks.d.ts +6 -23
  175. package/dist/application-spec/parse-application-files/spec/sections/data-spec/custom-data-spec.d.ts +1 -16
  176. package/dist/application-spec/parse-application-files/spec/sections/data-spec/data-entry-key.d.ts +3 -9
  177. package/dist/application-spec/parse-application-files/spec/sections/data-spec/data-spec.d.ts +1 -10
  178. package/dist/application-spec/parse-application-files/spec/sections/data-spec/swatch-data-spec.d.ts +1 -14
  179. package/dist/application-spec/parse-application-files/spec/sections/state-value.d.ts +3 -7
  180. package/dist/application-spec/parse-application-files/spec/sections/theme.d.ts +3 -10
  181. package/dist/application-spec/parse-application-files/spec/sections/transformers.d.ts +4 -11
  182. package/dist/application-spec/parse-application-files/spec/sections/ui.d.ts +3 -12
  183. package/dist/client/authorized-client.d.ts +3 -1
  184. package/dist/client/authorized-client.js +1 -1
  185. package/dist/client/contract.d.ts +17 -0
  186. package/dist/client/index.d.ts +1 -1
  187. package/dist/client/local-authorized-client.d.ts +3 -1
  188. package/dist/client/local-authorized-client.js +1 -1
  189. package/dist/client/memory-authorized-client.d.ts +4 -1
  190. package/dist/client/memory-authorized-client.js +1 -1
  191. package/dist/client/phoenix-api.d.ts +228 -0
  192. package/dist/configurator/ConfiguratorApp.js +1 -1
  193. package/dist/configurator/app-loader-content/DefaultAppLoaderContent.d.ts +2 -0
  194. package/dist/configurator/app-loader-content/DefaultAppLoaderContent.js +5 -0
  195. package/dist/configurator/app-loader-content/index.d.ts +1 -0
  196. package/dist/configurator/app-loader-content/index.js +1 -0
  197. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  198. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +17 -3
  199. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  200. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +52 -9
  201. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  202. package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.d.ts +1 -1
  203. package/dist/configurator/application-runtime/extensions/systems/canvas-system.d.ts +8 -0
  204. package/dist/configurator/application-runtime/extensions/systems/canvas-system.js +1 -1
  205. package/dist/configurator/application-runtime/extensions/systems/export-system/export-busy-error.d.ts +8 -0
  206. package/dist/configurator/application-runtime/extensions/systems/export-system/export-busy-error.js +1 -0
  207. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.d.ts +23 -1
  208. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.js +1 -1
  209. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +28 -10
  210. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  211. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +66 -4
  212. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  213. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.d.ts +40 -0
  214. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.js +1 -0
  215. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.d.ts +14 -5
  216. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.js +1 -1
  217. package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -1
  218. package/dist/configurator/common/configurator-interface.d.ts +121 -6
  219. package/dist/configurator/common/configurator-interface.js +1 -1
  220. package/dist/configurator/common/index.d.ts +2 -2
  221. package/dist/configurator/common/index.js +1 -1
  222. package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.d.ts +5 -0
  223. package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.js +1 -0
  224. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.d.ts +0 -6
  225. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.js +1 -1
  226. package/dist/configurator/configuration-not-found-page/index.d.ts +2 -1
  227. package/dist/configurator/configuration-not-found-page/index.js +1 -1
  228. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.d.ts +12 -0
  229. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.js +1 -0
  230. package/dist/configurator/configurator-context/PresetSelectionProvider.js +1 -1
  231. package/dist/configurator/configurator-context/PreviewContextProvider.js +1 -1
  232. package/dist/configurator/configurator-context/ViewportStateSync.d.ts +2 -2
  233. package/dist/configurator/configurator-context/ViewportStateSync.js +1 -1
  234. package/dist/configurator/configurator-context/configurator-hooks/index.d.ts +0 -1
  235. package/dist/configurator/configurator-context/configurator-hooks/index.js +1 -1
  236. package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.d.ts +10 -0
  237. package/dist/configurator/configurator-context/index.d.ts +0 -4
  238. package/dist/configurator/configurator-context/index.js +1 -1
  239. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.d.ts +6 -0
  240. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.js +1 -0
  241. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.d.ts +7 -0
  242. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.js +1 -0
  243. package/dist/configurator/configurator-error-page/index.d.ts +2 -0
  244. package/dist/configurator/configurator-error-page/index.js +1 -0
  245. package/dist/configurator/index.d.ts +10 -0
  246. package/dist/configurator/index.js +1 -1
  247. package/dist/configurator/pages/ConfiguratorErrorPage.d.ts +0 -1
  248. package/dist/configurator/pages/ConfiguratorErrorPage.js +1 -1
  249. package/dist/configurator/pages/ConfiguratorNotFoundPage.js +1 -1
  250. package/dist/configurator/pages/DefaultNotAuthenticatedPage.d.ts +8 -0
  251. package/dist/configurator/pages/DefaultNotAuthenticatedPage.js +1 -0
  252. package/dist/configurator/pages/DefaultPresetUi.d.ts +7 -0
  253. package/dist/configurator/pages/DefaultPresetUi.js +1 -0
  254. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  255. package/dist/configurator/pages/NewConfiguratorPage.js +1 -1
  256. package/dist/configurator/pages/PresetCreationErrorPage.d.ts +1 -1
  257. package/dist/configurator/pages/PresetCreationErrorPage.js +1 -1
  258. package/dist/configurator/pages/default-configurator-elements.d.ts +6 -2
  259. package/dist/configurator/pages/default-configurator-elements.js +1 -1
  260. package/dist/configurator/pages/default-elements/index.d.ts +1 -0
  261. package/dist/configurator/pages/default-elements/index.js +1 -1
  262. package/dist/configurator/pages/default-elements/scene-controls/BuiltInAddEntityFab.d.ts +3 -0
  263. package/dist/configurator/pages/default-elements/scene-controls/BuiltInAddEntityFab.js +1 -0
  264. package/dist/configurator/pages/default-elements/scene-controls/BuiltInDeleteEntityFab.d.ts +3 -0
  265. package/dist/configurator/pages/default-elements/scene-controls/BuiltInDeleteEntityFab.js +1 -0
  266. package/dist/configurator/pages/default-elements/scene-controls/BuiltInNavigationHotspot.d.ts +3 -0
  267. package/dist/configurator/pages/default-elements/scene-controls/BuiltInNavigationHotspot.js +1 -0
  268. package/dist/configurator/pages/default-elements/scene-controls/BuiltInSelectionHotspot.d.ts +3 -0
  269. package/dist/configurator/pages/default-elements/scene-controls/BuiltInSelectionHotspot.js +1 -0
  270. package/dist/configurator/pages/default-elements/scene-controls/BuiltInToolMenuFab.d.ts +3 -0
  271. package/dist/configurator/pages/default-elements/scene-controls/BuiltInToolMenuFab.js +1 -0
  272. package/dist/configurator/pages/default-elements/scene-controls/index.d.ts +6 -0
  273. package/dist/configurator/pages/default-elements/scene-controls/index.js +1 -0
  274. package/dist/configurator/pages/default-elements/scene-controls/scene-control-elements.d.ts +6 -0
  275. package/dist/configurator/pages/default-elements/scene-controls/scene-control-elements.js +1 -0
  276. package/dist/configurator/pages/error-boundaries/DevContextFallback.js +1 -1
  277. package/dist/configurator/pages/error-boundaries/DevLoadingFallback.js +1 -1
  278. package/dist/configurator/pages/error-boundaries/GeneralErrorBoundary.js +1 -1
  279. package/dist/configurator/pages/error-boundaries/LoadingErrorBoundary.js +1 -1
  280. package/dist/configurator/preset-screen-elements/PresetDeviceNotSupportedElement.d.ts +4 -0
  281. package/dist/configurator/preset-screen-elements/PresetDeviceNotSupportedElement.js +1 -0
  282. package/dist/configurator/preset-screen-elements/PresetPageActionElement.d.ts +4 -0
  283. package/dist/configurator/preset-screen-elements/PresetPageActionElement.js +1 -0
  284. package/dist/configurator/preset-screen-elements/index.d.ts +2 -0
  285. package/dist/configurator/preset-screen-elements/index.js +1 -0
  286. package/dist/configurator/scene/index.d.ts +1 -0
  287. package/dist/configurator/scene/index.js +1 -1
  288. package/dist/configurator/scene/scene-controls/DeleteEntityFab.js +1 -1
  289. package/dist/configurator/scene/scene-controls/SelectionHotspot.js +1 -1
  290. package/dist/configurator/scene/scene-controls/ToolFab.d.ts +4 -0
  291. package/dist/configurator/scene/scene-controls/ToolFab.js +1 -1
  292. package/dist/configurator/scene/scene-controls/use-scene-control-tooltip.d.ts +2 -1
  293. package/dist/configurator/scene/scene-entity/scene-controls/SceneEntityHtmlHotspots.js +1 -1
  294. package/dist/configurator/toolbar-actions/index.d.ts +3 -0
  295. package/dist/configurator/toolbar-actions/index.js +1 -0
  296. package/dist/configurator/toolbar-actions/use-assistant-panel.d.ts +18 -0
  297. package/dist/configurator/toolbar-actions/use-assistant-panel.js +1 -0
  298. package/dist/configurator/toolbar-actions/use-measurements.d.ts +35 -0
  299. package/dist/configurator/toolbar-actions/use-measurements.js +1 -0
  300. package/dist/configurator/toolbar-actions/use-toolbar-actions.d.ts +100 -0
  301. package/dist/configurator/toolbar-actions/use-toolbar-actions.js +1 -0
  302. package/dist/configurator/toolbar-actions/use-toolbar-help.d.ts +7 -0
  303. package/dist/configurator/toolbar-actions/use-toolbar-help.js +1 -0
  304. package/dist/configurator/ui/assistant/AssistantChips.d.ts +3 -2
  305. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  306. package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +1 -1
  307. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
  308. package/dist/configurator/ui/assistant/alert/AssistantAlert.d.ts +8 -0
  309. package/dist/configurator/ui/assistant/alert/AssistantAlert.js +1 -0
  310. package/dist/configurator/ui/assistant/alert/index.d.ts +2 -0
  311. package/dist/configurator/ui/assistant/alert/index.js +1 -0
  312. package/dist/configurator/ui/assistant/alert/remark-alerts.d.ts +10 -0
  313. package/dist/configurator/ui/assistant/alert/remark-alerts.js +1 -0
  314. package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.js +1 -1
  315. package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -1
  316. package/dist/configurator/ui/assistant/form/compose-answer.d.ts +1 -1
  317. package/dist/configurator/ui/assistant/form/compose-answer.js +1 -1
  318. package/dist/configurator/ui/assistant/form/form-model.d.ts +3 -4
  319. package/dist/configurator/ui/assistant/form/form-state.d.ts +1 -1
  320. package/dist/configurator/ui/assistant/form/index.d.ts +2 -0
  321. package/dist/configurator/ui/assistant/form/index.js +1 -1
  322. package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +3 -2
  323. package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -1
  324. package/dist/configurator/ui/assistant/form/read-form-attributes.d.ts +1 -1
  325. package/dist/configurator/ui/assistant/form/read-form-attributes.js +1 -1
  326. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.d.ts +3 -0
  327. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.js +1 -0
  328. package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.d.ts +31 -0
  329. package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.js +1 -0
  330. package/dist/configurator/ui/assistant/form/{form-element-definition.d.ts → registry/form-element-definition.d.ts} +3 -1
  331. package/dist/configurator/ui/assistant/form/registry/form-element-definition.js +1 -0
  332. package/dist/configurator/ui/assistant/form/{form-registry.d.ts → registry/form-registry.d.ts} +2 -2
  333. package/dist/configurator/ui/assistant/form/registry/form-registry.js +1 -0
  334. package/dist/configurator/ui/assistant/form/registry/index.d.ts +6 -0
  335. package/dist/configurator/ui/assistant/form/registry/index.js +1 -0
  336. package/dist/configurator/ui/assistant/form/registry/use-form-registry.d.ts +8 -0
  337. package/dist/configurator/ui/assistant/form/registry/use-form-registry.js +1 -0
  338. package/dist/configurator/ui/assistant/form-elements/FormCard.d.ts +9 -0
  339. package/dist/configurator/ui/assistant/form-elements/FormCard.js +1 -0
  340. package/dist/configurator/ui/assistant/form-elements/FormConfirm.d.ts +9 -0
  341. package/dist/configurator/ui/assistant/form-elements/FormConfirm.js +1 -0
  342. package/dist/configurator/ui/assistant/form-elements/FormGroup.d.ts +4 -1
  343. package/dist/configurator/ui/assistant/form-elements/FormNumber.d.ts +9 -0
  344. package/dist/configurator/ui/assistant/form-elements/FormNumber.js +1 -0
  345. package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +4 -1
  346. package/dist/configurator/ui/assistant/form-elements/FormReply.d.ts +4 -1
  347. package/dist/configurator/ui/assistant/form-elements/FormReply.js +1 -1
  348. package/dist/configurator/ui/assistant/form-elements/FormSwatch.d.ts +10 -0
  349. package/dist/configurator/ui/assistant/form-elements/FormSwatch.js +1 -0
  350. package/dist/configurator/ui/assistant/form-elements/FormText.d.ts +4 -1
  351. package/dist/configurator/ui/assistant/form-elements/FormText.js +1 -1
  352. package/dist/configurator/ui/assistant/form-elements/clamp-form-number.d.ts +10 -0
  353. package/dist/configurator/ui/assistant/form-elements/clamp-form-number.js +1 -0
  354. package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +20 -16
  355. package/dist/configurator/ui/assistant/form-elements/index.d.ts +4 -0
  356. package/dist/configurator/ui/assistant/form-elements/index.js +1 -1
  357. package/dist/configurator/ui/assistant/index.d.ts +3 -0
  358. package/dist/configurator/ui/assistant/index.js +1 -1
  359. package/dist/configurator/ui/assistant/resource-image/index.d.ts +1 -1
  360. package/dist/configurator/ui/assistant/resource-image/index.js +1 -1
  361. package/dist/configurator/ui/assistant/resource-image/resource-path.d.ts +0 -9
  362. package/dist/configurator/ui/assistant/resource-image/resource-path.js +1 -1
  363. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.d.ts +9 -0
  364. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -0
  365. package/dist/configurator/ui/assistant/screenshots/index.d.ts +2 -0
  366. package/dist/configurator/ui/assistant/screenshots/index.js +1 -0
  367. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +22 -0
  368. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -0
  369. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +8 -0
  370. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -0
  371. package/dist/configurator/ui/assistant/streamed-markdown.d.ts +2 -2
  372. package/dist/configurator/ui/assistant/streamed-markdown.js +2 -2
  373. package/dist/configurator/ui/assistant/tool-chip.d.ts +19 -9
  374. package/dist/configurator/ui/assistant/tool-chip.js +1 -1
  375. package/dist/configurator/ui/configurator-layout/slots/canvas/GPUAccelerationDisabled.js +1 -1
  376. package/dist/configurator/ui/configurator-layout/slots/canvas/LayoutCanvas.js +1 -1
  377. package/dist/configurator/ui/configurator-layout/slots/canvas/SharedCanvas.js +1 -1
  378. package/dist/configurator/ui/configurator-layout/slots/canvas/WebGLNotSupported.js +1 -1
  379. package/dist/configurator/ui/configurator-layout/slots/mobile-tabs/use-mobile-tabs.d.ts +1 -1
  380. package/dist/configurator/ui/configurator-layout/slots/mobile-tabs/use-mobile-tabs.js +1 -1
  381. package/dist/configurator/ui/configurator-layout/slots/readonly-banner/CloneToEditDialog.js +1 -1
  382. package/dist/configurator/ui/configurator-layout/slots/sidebar-tabs/use-sidebar-tabs.d.ts +1 -1
  383. package/dist/configurator/ui/configurator-layout/slots/sidebar-tabs/use-sidebar-tabs.js +1 -1
  384. package/dist/configurator/ui/configurator-layout/universal/ExportingOverlay.d.ts +5 -0
  385. package/dist/configurator/ui/configurator-layout/universal/ExportingOverlay.js +1 -0
  386. package/dist/configurator/ui/configurator-layout/universal/Layout.js +1 -1
  387. package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.d.ts +1 -1
  388. package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.js +1 -1
  389. package/dist/configurator/ui/configurator-layout/universal/use-scene-safe-area.d.ts +1 -1
  390. package/dist/configurator/ui/index.d.ts +1 -0
  391. package/dist/configurator/ui/index.js +1 -1
  392. package/dist/configurator/ui/legacy/chat/MobileChat.js +1 -1
  393. package/dist/configurator/ui/legacy/layout/common/CommonFinalizeButton.js +1 -1
  394. package/dist/configurator/ui/legacy/layout/common/CommonSummaryButton.js +1 -1
  395. package/dist/configurator/ui/legacy/layout/common/CommonTopNavigation.js +1 -1
  396. package/dist/configurator/ui/legacy/layout/common/ReactiveInterfaceLayout.js +1 -1
  397. package/dist/configurator/ui/legacy/layout/common/ResponsiveFinalizeButton.js +1 -1
  398. package/dist/configurator/ui/legacy/layout/simple/SimpleSidebar.js +1 -1
  399. package/dist/configurator/ui/legacy/layout/simple/SimpleTopNavigation.js +1 -1
  400. package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.js +1 -1
  401. package/dist/configurator/ui/legacy/layout/steps/StepsOwnerLayout.js +1 -1
  402. package/dist/configurator/ui/legacy/layout/steps/StepsSideBar.js +1 -1
  403. package/dist/configurator/ui/legacy/layout/steps/StepsSidebarFooter.js +1 -1
  404. package/dist/configurator/ui/legacy/layout/tabs/TabsSidebar.js +1 -1
  405. package/dist/configurator/ui/legacy/toolbar/common/DimensionUnitSelector.js +1 -1
  406. package/dist/configurator/ui/legacy/toolbar/common/MeasurementsIndicatorsSwitch.js +1 -1
  407. package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/FullscreenToolbarAction.js +1 -1
  408. package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/HelpToolbarAction.js +1 -1
  409. package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/MeasurementsToolbarAction.js +1 -1
  410. package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/UndoRedoToolbarGroup.js +1 -1
  411. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.d.ts +0 -7
  412. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.js +2 -6
  413. package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -1
  414. package/dist/configurator/ui/phoenix-layout-elements/EnterFullscreenToolbarButton.js +1 -1
  415. package/dist/configurator/ui/phoenix-layout-elements/ExitFullscreenToolbarButton.js +1 -1
  416. package/dist/configurator/ui/phoenix-layout-elements/HelpToolbarButton.js +1 -1
  417. package/dist/configurator/ui/phoenix-layout-elements/LanguageMenuAction.js +1 -1
  418. package/dist/configurator/ui/phoenix-layout-elements/LanguageToolbarButton.js +1 -1
  419. package/dist/configurator/ui/phoenix-layout-elements/MeasurementsMenuAction.js +1 -1
  420. package/dist/configurator/ui/phoenix-layout-elements/MeasurementsToolbarButton.js +1 -1
  421. package/dist/configurator/ui/phoenix-layout-elements/RedoToolbarButton.js +1 -1
  422. package/dist/configurator/ui/phoenix-layout-elements/ShareToolbarButton.js +1 -1
  423. package/dist/configurator/ui/phoenix-layout-elements/UndoToolbarButton.js +1 -1
  424. package/dist/configurator/ui/phoenix-layout-elements/header/common/back-button/use-go-back-action.js +1 -1
  425. package/dist/configurator/ui/phoenix-layout-elements/header/common/horizontal-tabs/DesktopHorizontalTabs.js +1 -1
  426. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/DesktopNavigationSteps.d.ts +1 -1
  427. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/DesktopNavigationSteps.js +1 -1
  428. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.d.ts +2 -8
  429. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.js +1 -1
  430. package/dist/configurator/ui/phoenix-layout-elements/index.d.ts +8 -1
  431. package/dist/configurator/ui/phoenix-layout-elements/index.js +1 -1
  432. package/dist/configurator/ui/phoenix-layout-elements/measurements/DimensionUnitSelector.js +1 -1
  433. package/dist/configurator/ui/phoenix-layout-elements/measurements/MeasurementsIndicatorsSwitch.js +1 -1
  434. package/dist/configurator/ui/phoenix-layout-elements/share/ShareModal.js +1 -1
  435. package/dist/configurator/ui/phoenix-layout-elements/share/use-share.d.ts +7 -8
  436. package/dist/configurator/ui/phoenix-layout-elements/share/use-share.js +1 -1
  437. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/basic/BasicFinalizeButton.js +1 -1
  438. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/CustomFinalizeButton.js +1 -1
  439. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/EnterSummaryButton.js +1 -1
  440. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/FinalizeActions.js +1 -1
  441. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/NextStepButton.js +1 -1
  442. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/PreviousStepButton.js +1 -1
  443. package/dist/configurator/ui/preset-layout/PresetUi.d.ts +4 -2
  444. package/dist/configurator/ui/preset-layout/PresetUi.js +1 -1
  445. package/dist/configurator/ui/preset-layout/index.d.ts +6 -1
  446. package/dist/configurator/ui/preset-layout/index.js +1 -1
  447. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -1
  448. package/dist/docs/3d-scene/cameras/custom.mdx +4 -2
  449. package/dist/docs/complex-use-cases/focus-mode.mdx +2 -0
  450. package/dist/docs/drag-and-drop/room-planner.mdx +1 -1
  451. package/dist/docs/fabs/basic.mdx +4 -0
  452. package/dist/docs/index.json +95 -1
  453. package/dist/docs/integrations/webcomponent-api/basics.mdx +2 -0
  454. package/dist/docs/layouts/custom-layout.mdx +321 -158
  455. package/dist/docs/layouts/gallery/ardent-compressor.mdx +3516 -0
  456. package/dist/docs/layouts/gallery/corvid-drone.mdx +3428 -0
  457. package/dist/docs/layouts/gallery/fenwick-window.mdx +2803 -0
  458. package/dist/docs/layouts/gallery/ferrule-bar-station.mdx +6567 -0
  459. package/dist/docs/layouts/gallery/kestrel-kettle.mdx +1858 -0
  460. package/dist/docs/layouts/gallery/nightjar-guitar.mdx +3698 -0
  461. package/dist/docs/layouts/gallery/sunfold-solar.mdx +2683 -0
  462. package/dist/docs/layouts/gallery/tidepool-aquascape.mdx +5203 -0
  463. package/dist/docs/other-features/client-side-rendering/declarative.mdx +1 -1
  464. package/dist/docs/other-features/error-5xx.mdx +1 -1
  465. package/dist/docs/other-features/navigation-hotspot.mdx +2 -0
  466. package/dist/docs/other-features/not-found-404.mdx +1 -1
  467. package/dist/docs/phoenix/configurator-interface.mdx +205 -65
  468. package/dist/docs/phoenix/domain-model.mdx +4 -1
  469. package/dist/docs/phoenix/finalization.mdx +1 -1
  470. package/dist/docs/phoenix/layout-slots.mdx +36 -15
  471. package/dist/docs/phoenix/phoenix-cli.mdx +14 -6
  472. package/dist/docs/phoenix/project-structure.mdx +21 -17
  473. package/dist/docs/phoenix/sdk-builder-workflow.mdx +7 -5
  474. package/dist/docs/phoenix/sessions-and-access.mdx +2 -0
  475. package/dist/docs/phoenix/testing.mdx +2 -2
  476. package/dist/docs/phoenix/webhooks.mdx +5 -1
  477. package/dist/docs/selection-and-highlight/hotspots.mdx +2 -0
  478. package/dist/domain/application/application-config.d.ts +6 -24
  479. package/dist/domain/application/assistant/assistant-manifest.d.ts +16 -1
  480. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +10 -1
  481. package/dist/domain/application/assistant/build-assistant-lenses.js +1 -1
  482. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  483. package/dist/domain/application/assistant/form/assistant-form-element-name.d.ts +11 -0
  484. package/dist/domain/application/assistant/form/assistant-form-element-name.js +8 -0
  485. package/dist/domain/application/assistant/form/assistant-form-elements.d.ts +174 -0
  486. package/dist/domain/application/assistant/form/assistant-form-elements.js +1 -0
  487. package/dist/domain/application/assistant/form/assistant-resource-path.d.ts +10 -0
  488. package/dist/domain/application/assistant/form/assistant-resource-path.js +1 -0
  489. package/dist/domain/application/assistant/form/index.d.ts +4 -0
  490. package/dist/domain/application/assistant/form/index.js +1 -0
  491. package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +3 -0
  492. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  493. package/dist/domain/application/assistant/index.d.ts +2 -3
  494. package/dist/domain/application/assistant/index.js +1 -1
  495. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
  496. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +2 -0
  497. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
  498. package/dist/domain/application/configurator-builder.d.ts +7 -1
  499. package/dist/domain/application/configurator-builder.js +1 -1
  500. package/dist/domain/application/index.d.ts +1 -1
  501. package/dist/domain/application/index.js +1 -1
  502. package/dist/domain/application/standard-properties.js +1 -1
  503. package/dist/domain/application/web-component-property.d.ts +3 -1
  504. package/dist/domain/application/web-component-property.js +1 -1
  505. package/dist/domain/available-system-components.d.ts +1 -1
  506. package/dist/domain/available-system-components.js +1 -1
  507. package/dist/domain/domain-builder.d.ts +9 -3
  508. package/dist/domain/domain-builder.js +1 -1
  509. package/dist/domain/domain-context/store-system/store-system.d.ts +5 -0
  510. package/dist/domain/domain-context/store-system/store-system.js +1 -1
  511. package/dist/domain/domain-runtime/application.d.ts +39 -0
  512. package/dist/domain/domain-runtime/application.js +1 -0
  513. package/dist/domain/domain-runtime/domain-context/selectors.d.ts +1 -0
  514. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  515. package/dist/domain/domain-runtime/domain-runtime.d.ts +44 -4
  516. package/dist/domain/domain-runtime/domain-runtime.js +1 -1
  517. package/dist/domain/domain-runtime/environment/initialize.d.ts +1 -1
  518. package/dist/domain/domain-runtime/environment/types.d.ts +1 -1
  519. package/dist/domain/domain-runtime/errors/implementation-error-collector.d.ts +2 -0
  520. package/dist/domain/domain-runtime/errors/implementation-error-collector.js +1 -1
  521. package/dist/domain/domain-runtime/index.d.ts +2 -1
  522. package/dist/domain/domain-runtime/index.js +1 -1
  523. package/dist/domain/domain-runtime/spec/index.d.ts +1 -1
  524. package/dist/domain/domain-runtime/spec/index.js +1 -1
  525. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  526. package/dist/domain/domain-runtime/spec/module-checks/element-registration.d.ts +15 -1
  527. package/dist/domain/domain-runtime/spec/module-checks/element-registration.js +1 -1
  528. package/dist/domain/domain-runtime/spec/module-checks/find-assistant-form-element-errors.d.ts +12 -0
  529. package/dist/domain/domain-runtime/spec/module-checks/find-assistant-form-element-errors.js +1 -0
  530. package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +3 -1
  531. package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
  532. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.d.ts +23 -0
  533. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.js +1 -0
  534. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.d.ts +3 -4
  535. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.js +1 -1
  536. package/dist/domain/domain-runtime/spec/selectors.d.ts +3 -1
  537. package/dist/domain/domain-runtime/spec/selectors.js +1 -1
  538. package/dist/domain/domain-runtime/web-component/actions.d.ts +3 -0
  539. package/dist/domain/domain-runtime/web-component/actions.js +1 -1
  540. package/dist/domain/domain-runtime/web-component/initialize.d.ts +1 -0
  541. package/dist/domain/domain-runtime/web-component/initialize.js +1 -1
  542. package/dist/domain/domain-runtime/web-component/selectors.d.ts +2 -0
  543. package/dist/domain/domain-runtime/web-component/selectors.js +1 -1
  544. package/dist/domain/domain-runtime/web-component/types.d.ts +6 -3
  545. package/dist/domain/extensions/export-images/agent-screenshot.d.ts +24 -0
  546. package/dist/domain/extensions/export-images/agent-screenshot.js +1 -0
  547. package/dist/domain/extensions/{client-side-image.d.ts → export-images/client-side-image.d.ts} +2 -2
  548. package/dist/domain/extensions/export-images/client-side-image.js +1 -0
  549. package/dist/domain/extensions/export-images/index.d.ts +3 -0
  550. package/dist/domain/extensions/export-images/index.js +1 -0
  551. package/dist/domain/extensions/{save-template-thumbnail.d.ts → export-images/save-template-thumbnail.d.ts} +2 -2
  552. package/dist/domain/extensions/export-images/save-template-thumbnail.js +1 -0
  553. package/dist/domain/extensions/index.d.ts +1 -2
  554. package/dist/domain/extensions/index.js +1 -1
  555. package/dist/domain/index.d.ts +1 -0
  556. package/dist/domain/index.js +1 -1
  557. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +9 -0
  558. package/dist/domain/spec/application/admin-pages-section.d.ts +29 -0
  559. package/dist/domain/spec/application/admin-pages.d.ts +26 -0
  560. package/dist/domain/spec/application/admin-states.d.ts +5 -0
  561. package/dist/domain/spec/application/configurator-states.d.ts +8 -0
  562. package/dist/domain/spec/application/index.d.ts +5 -0
  563. package/dist/domain/spec/application/index.js +1 -0
  564. package/dist/domain/spec/components/bindings/index.d.ts +2 -0
  565. package/dist/domain/spec/components/bindings/index.js +1 -0
  566. package/dist/domain/spec/components/bindings/read-binding.d.ts +13 -0
  567. package/dist/domain/spec/components/bindings/read-binding.js +1 -0
  568. package/dist/domain/spec/components/bindings/write-binding.d.ts +32 -0
  569. package/dist/domain/spec/components/bindings/write-binding.js +1 -0
  570. package/dist/{application-spec/parse-application-files → domain}/spec/components/component-entry.d.ts +3 -3
  571. package/dist/domain/spec/components/component-entry.js +1 -0
  572. package/dist/{application-spec/core → domain/spec}/components/component-filter.d.ts +3 -2
  573. package/dist/domain/spec/components/component-filters.d.ts +10 -0
  574. package/dist/domain/spec/components/component-filters.js +1 -0
  575. package/dist/domain/spec/components/components.d.ts +4 -0
  576. package/dist/domain/spec/components/components.js +1 -0
  577. package/dist/domain/spec/components/index.d.ts +6 -0
  578. package/dist/domain/spec/enhanced-json-value.d.ts +30 -0
  579. package/dist/domain/spec/enhanced-json-value.js +1 -0
  580. package/dist/{application-spec/parse-application-files → domain}/spec/expressions/expression.d.ts +9 -3
  581. package/dist/domain/spec/expressions/expression.js +1 -0
  582. package/dist/domain/spec/expressions/expressions.d.ts +27 -0
  583. package/dist/domain/spec/expressions/expressions.js +1 -0
  584. package/dist/domain/spec/expressions/index.d.ts +5 -0
  585. package/dist/domain/spec/expressions/memo-eval-plan.d.ts +70 -0
  586. package/dist/domain/spec/expressions/memo-eval-plan.js +1 -0
  587. package/dist/domain/spec/expressions/relation-expression-params.js +1 -0
  588. package/dist/domain/spec/index.d.ts +9 -0
  589. package/dist/domain/spec/index.js +1 -0
  590. package/dist/domain/spec/invariants/index.d.ts +2 -0
  591. package/dist/domain/spec/invariants/index.js +1 -0
  592. package/dist/domain/spec/invariants/invariant.d.ts +24 -0
  593. package/dist/domain/spec/invariants/invariant.js +1 -0
  594. package/dist/domain/spec/invariants/invariants.d.ts +14 -0
  595. package/dist/domain/spec/invariants/invariants.js +1 -0
  596. package/dist/domain/spec/json-schema.d.ts +52 -0
  597. package/dist/domain/spec/json-schema.js +1 -0
  598. package/dist/domain/spec/markers/index.d.ts +3 -0
  599. package/dist/domain/spec/markers/index.js +1 -0
  600. package/dist/domain/spec/markers/msg-marker.d.ts +28 -0
  601. package/dist/domain/spec/markers/msg-marker.js +1 -0
  602. package/dist/domain/spec/model/aliases.d.ts +9 -0
  603. package/dist/domain/spec/model/aliases.js +1 -0
  604. package/dist/domain/spec/model/common-types.d.ts +15 -0
  605. package/dist/domain/spec/model/common-types.js +1 -0
  606. package/dist/domain/spec/model/defaults.d.ts +33 -0
  607. package/dist/domain/spec/model/defaults.js +1 -0
  608. package/dist/domain/spec/model/entity-types.d.ts +8 -0
  609. package/dist/domain/spec/model/entity-types.js +1 -0
  610. package/dist/domain/spec/model/index.d.ts +7 -0
  611. package/dist/domain/spec/model/index.js +1 -0
  612. package/dist/domain/spec/model/model-version-key.d.ts +3 -0
  613. package/dist/domain/spec/model/model-version-key.js +1 -0
  614. package/dist/domain/spec/model/names/action-name.d.ts +7 -0
  615. package/dist/domain/spec/model/names/action-name.js +1 -0
  616. package/dist/domain/spec/model/names/alias-name.d.ts +7 -0
  617. package/dist/domain/spec/model/names/alias-name.js +1 -0
  618. package/dist/domain/spec/model/names/entity-or-alias-name.d.ts +8 -0
  619. package/dist/domain/spec/model/names/entity-or-alias-name.js +1 -0
  620. package/dist/domain/spec/model/names/entity-type-name.d.ts +8 -0
  621. package/dist/domain/spec/model/names/entity-type-name.js +1 -0
  622. package/dist/domain/spec/model/names/expression-name.d.ts +6 -0
  623. package/dist/domain/spec/model/names/expression-name.js +1 -0
  624. package/dist/domain/spec/model/names/index.d.ts +9 -0
  625. package/dist/domain/spec/model/names/index.js +1 -0
  626. package/dist/domain/spec/model/names/instance-name.d.ts +7 -0
  627. package/dist/domain/spec/model/names/instance-name.js +1 -0
  628. package/dist/domain/spec/model/names/invariant-name.d.ts +3 -0
  629. package/dist/domain/spec/model/names/invariant-name.js +1 -0
  630. package/dist/domain/spec/model/names/shape-property-name.d.ts +11 -0
  631. package/dist/domain/spec/model/names/shape-property-name.js +1 -0
  632. package/dist/domain/spec/model/names/violation-type-name.d.ts +3 -0
  633. package/dist/domain/spec/model/names/violation-type-name.js +1 -0
  634. package/dist/domain/spec/model/presets.d.ts +30 -0
  635. package/dist/domain/spec/model/presets.js +1 -0
  636. package/dist/domain/spec/sections/actions.d.ts +23 -0
  637. package/dist/domain/spec/sections/actions.js +1 -0
  638. package/dist/domain/spec/sections/app-metadata.d.ts +18 -0
  639. package/dist/domain/spec/sections/app-metadata.js +1 -0
  640. package/dist/domain/spec/sections/application-version.d.ts +7 -0
  641. package/dist/domain/spec/sections/application-version.js +1 -0
  642. package/dist/domain/spec/sections/data-spec/chunks.d.ts +23 -0
  643. package/dist/domain/spec/sections/data-spec/chunks.js +1 -0
  644. package/dist/domain/spec/sections/data-spec/custom-data-spec-entry.d.ts +16 -0
  645. package/dist/domain/spec/sections/data-spec/custom-data-spec-entry.js +1 -0
  646. package/dist/domain/spec/sections/data-spec/data-entry-key.d.ts +9 -0
  647. package/dist/domain/spec/sections/data-spec/data-entry-key.js +1 -0
  648. package/dist/domain/spec/sections/data-spec/index.d.ts +5 -0
  649. package/dist/domain/spec/sections/data-spec/index.js +1 -0
  650. package/dist/domain/spec/sections/data-spec/parsed-data-spec-entries.d.ts +10 -0
  651. package/dist/domain/spec/sections/data-spec/parsed-data-spec-entries.js +1 -0
  652. package/dist/domain/spec/sections/data-spec/swatch-data-spec-entry.d.ts +14 -0
  653. package/dist/domain/spec/sections/data-spec/swatch-data-spec-entry.js +1 -0
  654. package/dist/domain/spec/sections/index.d.ts +9 -0
  655. package/dist/domain/spec/sections/index.js +1 -0
  656. package/dist/domain/spec/sections/infra/acl.d.ts +12 -0
  657. package/dist/domain/spec/sections/infra/acl.js +1 -0
  658. package/dist/domain/spec/sections/infra/index.d.ts +3 -0
  659. package/dist/domain/spec/sections/infra/index.js +1 -0
  660. package/dist/domain/spec/sections/infra/resource-entry.d.ts +46 -0
  661. package/dist/domain/spec/sections/infra/resource-entry.js +1 -0
  662. package/dist/domain/spec/sections/infra/resources-config.d.ts +10 -0
  663. package/dist/domain/spec/sections/infra/resources-config.js +1 -0
  664. package/dist/domain/spec/sections/state-value.d.ts +7 -0
  665. package/dist/domain/spec/sections/state-value.js +1 -0
  666. package/dist/domain/spec/sections/theme.d.ts +10 -0
  667. package/dist/domain/spec/sections/theme.js +1 -0
  668. package/dist/domain/spec/sections/transformers.d.ts +15 -0
  669. package/dist/domain/spec/sections/transformers.js +1 -0
  670. package/dist/domain/spec/sections/ui.d.ts +12 -0
  671. package/dist/domain/spec/sections/ui.js +1 -0
  672. package/dist/editor/Editor.d.ts +7 -0
  673. package/dist/editor/Editor.js +1 -1
  674. package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
  675. package/dist/editor/domain-editors/apply-spec-update.d.ts +10 -2
  676. package/dist/editor/domain-editors/apply-spec-update.js +1 -1
  677. package/dist/editor/domain-editors/use-implementation-files.d.ts +6 -14
  678. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  679. package/dist/editor/graphql/GraphQLPanel.js +1 -1
  680. package/dist/editor/mocks/EditorMockContext.d.ts +2 -0
  681. package/dist/editor/mocks/EditorMockContext.js +1 -1
  682. package/dist/editor/screenshot/ScreenshotHandler.js +1 -1
  683. package/dist/i18n/locales/cs/messages.js +1 -1
  684. package/dist/i18n/locales/da/messages.js +1 -1
  685. package/dist/i18n/locales/de/messages.js +1 -1
  686. package/dist/i18n/locales/de-AT/messages.js +1 -1
  687. package/dist/i18n/locales/en/messages.js +1 -1
  688. package/dist/i18n/locales/en-AU/messages.js +1 -1
  689. package/dist/i18n/locales/en-GB/messages.js +1 -1
  690. package/dist/i18n/locales/es/messages.js +1 -1
  691. package/dist/i18n/locales/fr/messages.js +1 -1
  692. package/dist/i18n/locales/hu/messages.js +1 -1
  693. package/dist/i18n/locales/it/messages.js +1 -1
  694. package/dist/i18n/locales/nl/messages.js +1 -1
  695. package/dist/i18n/locales/pl/messages.js +1 -1
  696. package/dist/i18n/locales/pt/messages.js +1 -1
  697. package/dist/i18n/locales/ro/messages.js +1 -1
  698. package/dist/i18n/locales/sk/messages.js +1 -1
  699. package/dist/i18n/locales/tr/messages.js +1 -1
  700. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  701. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  702. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +16 -0
  703. package/dist/legacy/domain-spec/spec/domain-spec.js +1 -1
  704. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
  705. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
  706. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
  707. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +11 -5
  708. package/dist/phoenix/application-spec/generate-application-spec-project.d.ts +1 -0
  709. package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
  710. package/dist/phoenix/application-spec/generate-project-files.d.ts +1 -0
  711. package/dist/phoenix/application-spec/index.d.ts +1 -0
  712. package/dist/phoenix/application-spec/index.js +1 -1
  713. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +11 -0
  714. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  715. package/dist/phoenix/bin.js +1 -1
  716. package/dist/phoenix/cli.js +1 -1
  717. package/dist/phoenix/commands/build.js +1 -1
  718. package/dist/phoenix/commands/clean.js +1 -1
  719. package/dist/phoenix/commands/deploy.js +1 -1
  720. package/dist/phoenix/commands/dev.js +5 -5
  721. package/dist/phoenix/commands/generated-env-markers.d.ts +1 -0
  722. package/dist/phoenix/commands/generated-env-markers.js +1 -1
  723. package/dist/phoenix/commands/index.d.ts +1 -1
  724. package/dist/phoenix/commands/index.js +1 -1
  725. package/dist/phoenix/commands/sync.js +1 -1
  726. package/dist/phoenix/lingui/index.d.ts +1 -0
  727. package/dist/phoenix/lingui/index.js +1 -0
  728. package/dist/phoenix/{services → lingui}/lingui.d.ts +5 -2
  729. package/dist/phoenix/lingui/lingui.js +1 -0
  730. package/dist/phoenix/services/application-spec-project-watcher.d.ts +3 -1
  731. package/dist/phoenix/services/application-spec-project-watcher.js +2 -2
  732. package/dist/phoenix/services/index.d.ts +1 -0
  733. package/dist/phoenix/services/index.js +1 -1
  734. package/dist/phoenix/services/lingui-watcher.js +1 -1
  735. package/dist/phoenix/services/prepare-development-environment.js +1 -1
  736. package/dist/phoenix/services/swc.js +1 -1
  737. package/dist/phoenix/services/vite-config.js +1 -1
  738. package/dist/react-sdk/application-runtime/common-services/analytics/analytics-service.d.ts +1 -1
  739. package/dist/{configurator/common → react-sdk/application-runtime/common-services/analytics}/frontend-analytics.d.ts +4 -0
  740. package/dist/react-sdk/application-runtime/common-services/analytics/index.d.ts +1 -0
  741. package/dist/react-sdk/application-runtime/common-services/analytics/index.js +1 -1
  742. package/dist/react-sdk/application-runtime/common-services/initialize.d.ts +2 -2
  743. package/dist/react-sdk/application-runtime/domain-application-context/chat-system.d.ts +1 -1
  744. package/dist/react-sdk/application-runtime/hooks/index.d.ts +2 -0
  745. package/dist/react-sdk/application-runtime/hooks/index.js +1 -1
  746. package/dist/react-sdk/application-runtime/hooks/loading/index.d.ts +5 -0
  747. package/dist/react-sdk/application-runtime/hooks/loading/index.js +1 -0
  748. package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.d.ts +11 -0
  749. package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.js +1 -0
  750. package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.d.ts +8 -0
  751. package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.js +1 -0
  752. package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.d.ts +7 -0
  753. package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.js +1 -0
  754. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.d.ts +9 -0
  755. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.js +1 -0
  756. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.d.ts +24 -0
  757. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.js +1 -0
  758. package/dist/react-sdk/application-runtime/hooks/responsive/index.d.ts +3 -0
  759. package/dist/react-sdk/application-runtime/hooks/responsive/index.js +1 -0
  760. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.d.ts +9 -0
  761. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.js +1 -0
  762. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.d.ts +26 -0
  763. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.js +1 -0
  764. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.d.ts +10 -0
  765. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.js +1 -0
  766. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.d.ts +24 -0
  767. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.js +1 -0
  768. package/dist/react-sdk/application-runtime/hooks/use-access-service.d.ts +5 -0
  769. package/dist/react-sdk/application-runtime/hooks/use-access-service.js +1 -1
  770. package/dist/react-sdk/application-runtime/hooks/use-phoenix-element-slots.d.ts +2 -1
  771. package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.d.ts +4 -11
  772. package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.js +1 -1
  773. package/dist/react-sdk/application-runtime/hooks/use-web-component.d.ts +5 -0
  774. package/dist/react-sdk/application-runtime/hooks/use-web-component.js +1 -1
  775. package/dist/react-sdk/application-runtime/host-properties/actions.d.ts +15 -0
  776. package/dist/react-sdk/application-runtime/host-properties/actions.js +1 -0
  777. package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.d.ts +30 -0
  778. package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.js +1 -0
  779. package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.d.ts +7 -0
  780. package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.js +1 -0
  781. package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.d.ts +21 -0
  782. package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.js +1 -0
  783. package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.d.ts +42 -0
  784. package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.js +1 -0
  785. package/dist/react-sdk/application-runtime/host-properties/index.d.ts +8 -0
  786. package/dist/react-sdk/application-runtime/host-properties/index.js +1 -0
  787. package/dist/react-sdk/application-runtime/host-properties/initialize.d.ts +7 -0
  788. package/dist/react-sdk/application-runtime/host-properties/initialize.js +1 -0
  789. package/dist/react-sdk/application-runtime/host-properties/selectors.d.ts +54 -0
  790. package/dist/react-sdk/application-runtime/host-properties/selectors.js +1 -0
  791. package/dist/react-sdk/application-runtime/host-properties/types.d.ts +18 -0
  792. package/dist/react-sdk/application-runtime/host-properties/types.js +1 -0
  793. package/dist/react-sdk/application-runtime/index.d.ts +3 -0
  794. package/dist/react-sdk/application-runtime/integration/initialize.d.ts +7 -6
  795. package/dist/react-sdk/application-runtime/integration/initialize.js +1 -1
  796. package/dist/react-sdk/application-runtime/integration/selectors.d.ts +11 -2
  797. package/dist/react-sdk/application-runtime/integration/selectors.js +1 -1
  798. package/dist/react-sdk/application-runtime/integration/types.d.ts +5 -2
  799. package/dist/react-sdk/application-runtime/loading/actions.d.ts +45 -0
  800. package/dist/react-sdk/application-runtime/loading/actions.js +1 -0
  801. package/dist/react-sdk/application-runtime/loading/index.d.ts +4 -0
  802. package/dist/react-sdk/application-runtime/loading/index.js +1 -0
  803. package/dist/react-sdk/application-runtime/loading/initialize.d.ts +3 -0
  804. package/dist/react-sdk/application-runtime/loading/initialize.js +1 -0
  805. package/dist/react-sdk/application-runtime/loading/selectors.d.ts +18 -0
  806. package/dist/react-sdk/application-runtime/loading/selectors.js +1 -0
  807. package/dist/react-sdk/application-runtime/loading/types.d.ts +59 -0
  808. package/dist/react-sdk/application-runtime/loading/types.js +1 -0
  809. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  810. package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.d.ts +6 -0
  811. package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.js +1 -1
  812. package/dist/react-sdk/application-runtime/provider/ApplicationType.d.ts +7 -0
  813. package/dist/react-sdk/application-runtime/provider/ApplicationType.js +1 -1
  814. package/dist/react-sdk/application-runtime/responsive/actions.d.ts +47 -0
  815. package/dist/react-sdk/application-runtime/responsive/actions.js +1 -0
  816. package/dist/react-sdk/application-runtime/responsive/index.d.ts +4 -0
  817. package/dist/react-sdk/application-runtime/responsive/index.js +1 -0
  818. package/dist/react-sdk/application-runtime/responsive/initialize.d.ts +3 -0
  819. package/dist/react-sdk/application-runtime/responsive/initialize.js +1 -0
  820. package/dist/react-sdk/application-runtime/responsive/selectors.d.ts +20 -0
  821. package/dist/react-sdk/application-runtime/responsive/selectors.js +1 -0
  822. package/dist/react-sdk/application-runtime/responsive/types.d.ts +104 -0
  823. package/dist/react-sdk/application-runtime/responsive/types.js +1 -0
  824. package/dist/react-sdk/application-runtime/routing/routing-service.d.ts +34 -2
  825. package/dist/react-sdk/application-runtime/routing/routing-service.js +1 -1
  826. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +313 -10
  827. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
  828. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/ConfiguratorRoutingProvider.d.ts +1 -1
  829. package/dist/react-sdk/configurator-routing/ConfiguratorRoutingProvider.js +1 -0
  830. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/OnGoToIndexHandler.d.ts +1 -2
  831. package/dist/react-sdk/configurator-routing/OnGoToIndexHandler.js +1 -0
  832. package/dist/react-sdk/configurator-routing/index.d.ts +3 -0
  833. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/index.js +1 -1
  834. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/use-power-routing-lifecycle.d.ts +2 -0
  835. package/dist/react-sdk/configurator-routing/use-power-routing-lifecycle.js +1 -0
  836. package/dist/react-sdk/domain-application-context/BackendDataProvider.js +1 -1
  837. package/dist/react-sdk/domain-application-context/ConfigurationPersistSystemFailureHandler.js +1 -1
  838. package/dist/react-sdk/domain-application-context/FrontendDataProvider.js +1 -1
  839. package/dist/react-sdk/domain-application-context/OnPresetLoadedHandler.js +1 -0
  840. package/dist/react-sdk/domain-application-context/PublishedDataProvider.js +1 -1
  841. package/dist/react-sdk/domain-application-context/chat-hooks.d.ts +4 -0
  842. package/dist/react-sdk/domain-application-context/chat-hooks.js +1 -0
  843. package/dist/react-sdk/domain-application-context/index.d.ts +2 -0
  844. package/dist/react-sdk/domain-application-context/index.js +1 -1
  845. package/dist/react-sdk/domain-context/common-hooks/index.d.ts +9 -0
  846. package/dist/react-sdk/domain-context/common-hooks/index.js +1 -0
  847. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.d.ts +23 -0
  848. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.js +1 -0
  849. package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +1 -0
  850. package/dist/react-sdk/domain-context/component-hooks/index.d.ts +1 -0
  851. package/dist/react-sdk/domain-context/component-hooks/index.js +1 -0
  852. package/dist/react-sdk/domain-context/component-hooks/use-component.js +1 -1
  853. package/dist/react-sdk/domain-context/entity-hooks/use-domain-entity-state.js +1 -1
  854. package/dist/react-sdk/domain-context/entity-hooks/use-entity-price.js +1 -1
  855. package/dist/react-sdk/domain-context/entity-hooks/use-root-entity-id.js +1 -1
  856. package/dist/react-sdk/domain-context/entity-hooks/use-root-entity-state.js +1 -1
  857. package/dist/react-sdk/domain-context/index.d.ts +7 -0
  858. package/dist/react-sdk/domain-context/index.js +1 -1
  859. package/dist/react-sdk/domain-context/system-hooks/composition-hooks.js +1 -1
  860. package/dist/react-sdk/domain-context/system-hooks/dimension-hooks.js +1 -1
  861. package/dist/react-sdk/domain-context/system-hooks/generate-share-link-hooks.d.ts +8 -0
  862. package/dist/react-sdk/domain-context/system-hooks/generate-share-link-hooks.js +1 -0
  863. package/dist/react-sdk/domain-context/system-hooks/hover-hooks.js +1 -1
  864. package/dist/react-sdk/domain-context/system-hooks/locale-switch-hooks.d.ts +24 -0
  865. package/dist/react-sdk/domain-context/system-hooks/locale-switch-hooks.js +1 -0
  866. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
  867. package/dist/react-sdk/domain-context/system-hooks/selection-hooks.js +1 -1
  868. package/dist/react-sdk/domain-context/system-hooks/share-links-hooks.d.ts +32 -0
  869. package/dist/react-sdk/domain-context/system-hooks/share-links-hooks.js +1 -0
  870. package/dist/react-sdk/domain-context/system-hooks/step-navigation-hooks.d.ts +57 -0
  871. package/dist/react-sdk/domain-context/system-hooks/step-navigation-hooks.js +1 -0
  872. package/dist/react-sdk/domain-context/system-hooks/tab-navigation-hooks.d.ts +61 -0
  873. package/dist/react-sdk/domain-context/system-hooks/tab-navigation-hooks.js +1 -0
  874. package/dist/react-sdk/domain-context/system-hooks/undo-redo-hooks.d.ts +20 -0
  875. package/dist/react-sdk/domain-context/system-hooks/undo-redo-hooks.js +1 -0
  876. package/dist/react-sdk/handlers/FinalizeActionRunner.d.ts +13 -0
  877. package/dist/react-sdk/handlers/FinalizeActionRunner.js +1 -0
  878. package/dist/react-sdk/handlers/FinalizeActionsHost.d.ts +10 -0
  879. package/dist/react-sdk/handlers/FinalizeActionsHost.js +1 -0
  880. package/dist/react-sdk/handlers/FinalizeActionsProvider.d.ts +11 -0
  881. package/dist/react-sdk/handlers/FinalizeActionsProvider.js +1 -0
  882. package/dist/react-sdk/handlers/finalize-actions-context.d.ts +6 -0
  883. package/dist/react-sdk/handlers/finalize-actions-context.js +1 -0
  884. package/dist/react-sdk/handlers/finalize-actions-store.d.ts +23 -0
  885. package/dist/react-sdk/handlers/finalize-actions-store.js +1 -0
  886. package/dist/react-sdk/handlers/index.d.ts +6 -0
  887. package/dist/react-sdk/handlers/index.js +1 -1
  888. package/dist/{configurator/common → react-sdk/handlers}/use-finalize-action.d.ts +3 -2
  889. package/dist/react-sdk/handlers/use-finalize-action.js +1 -0
  890. package/dist/react-sdk/handlers/use-finalize-actions.d.ts +53 -0
  891. package/dist/react-sdk/handlers/use-finalize-actions.js +1 -0
  892. package/dist/react-sdk/index.d.ts +6 -0
  893. package/dist/react-sdk/index.js +1 -1
  894. package/dist/react-sdk/integration/IntegrationSubscription.js +1 -0
  895. package/dist/react-sdk/integration/index.d.ts +1 -0
  896. package/dist/react-sdk/integration/index.js +1 -0
  897. package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.d.ts +8 -0
  898. package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.js +1 -0
  899. package/dist/react-sdk/lifecycle-providers/LifecycleProviders.js +1 -0
  900. package/dist/react-sdk/lifecycle-providers/index.d.ts +2 -0
  901. package/dist/react-sdk/lifecycle-providers/index.js +1 -0
  902. package/dist/react-sdk/loading-state/LoaderHost.d.ts +20 -0
  903. package/dist/react-sdk/loading-state/LoaderHost.js +1 -0
  904. package/dist/react-sdk/loading-state/built-in-loading-phase.d.ts +9 -0
  905. package/dist/react-sdk/loading-state/built-in-loading-phase.js +1 -0
  906. package/dist/react-sdk/loading-state/create-app-loader.d.ts +18 -0
  907. package/dist/react-sdk/loading-state/create-app-loader.js +1 -0
  908. package/dist/react-sdk/loading-state/index.d.ts +4 -2
  909. package/dist/react-sdk/loading-state/index.js +1 -1
  910. package/dist/react-sdk/loading-state/{LoadingStateProvider.d.ts → loading-state-hooks.d.ts} +3 -12
  911. package/dist/react-sdk/loading-state/loading-state-hooks.js +1 -0
  912. package/dist/react-sdk/notifications/index.d.ts +1 -0
  913. package/dist/react-sdk/notifications/index.js +1 -0
  914. package/dist/react-sdk/notifications/snackbar-action-button.d.ts +30 -0
  915. package/dist/react-sdk/notifications/snackbar-action-button.js +1 -0
  916. package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.d.ts +17 -0
  917. package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.js +1 -0
  918. package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.d.ts +17 -0
  919. package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.js +1 -0
  920. package/dist/react-sdk/page-elements/configurator-error-page-props.d.ts +20 -0
  921. package/dist/react-sdk/page-elements/configurator-error-page-props.js +1 -0
  922. package/dist/react-sdk/page-elements/create-configuration-not-found-page.d.ts +15 -0
  923. package/dist/react-sdk/page-elements/create-configuration-not-found-page.js +1 -0
  924. package/dist/react-sdk/page-elements/create-configurator-error-page.d.ts +14 -0
  925. package/dist/react-sdk/page-elements/create-configurator-error-page.js +1 -0
  926. package/dist/react-sdk/page-elements/create-preset-ui.d.ts +9 -0
  927. package/dist/react-sdk/page-elements/create-preset-ui.js +1 -0
  928. package/dist/react-sdk/page-elements/index.d.ts +6 -0
  929. package/dist/react-sdk/page-elements/index.js +1 -0
  930. package/dist/react-sdk/scene-control-elements/AddEntityFabElement.d.ts +36 -0
  931. package/dist/react-sdk/scene-control-elements/AddEntityFabElement.js +1 -0
  932. package/dist/react-sdk/scene-control-elements/DeleteEntityFabElement.d.ts +44 -0
  933. package/dist/react-sdk/scene-control-elements/DeleteEntityFabElement.js +1 -0
  934. package/dist/react-sdk/scene-control-elements/NavigationHotspotElement.d.ts +38 -0
  935. package/dist/react-sdk/scene-control-elements/NavigationHotspotElement.js +1 -0
  936. package/dist/react-sdk/scene-control-elements/SelectionHotspotElement.d.ts +30 -0
  937. package/dist/react-sdk/scene-control-elements/SelectionHotspotElement.js +1 -0
  938. package/dist/react-sdk/scene-control-elements/ToolMenuFabElement.d.ts +30 -0
  939. package/dist/react-sdk/scene-control-elements/ToolMenuFabElement.js +1 -0
  940. package/dist/react-sdk/scene-control-elements/create-add-entity-fab.d.ts +9 -0
  941. package/dist/react-sdk/scene-control-elements/create-add-entity-fab.js +1 -0
  942. package/dist/react-sdk/scene-control-elements/create-delete-entity-fab.d.ts +9 -0
  943. package/dist/react-sdk/scene-control-elements/create-delete-entity-fab.js +1 -0
  944. package/dist/react-sdk/scene-control-elements/create-navigation-hotspot.d.ts +10 -0
  945. package/dist/react-sdk/scene-control-elements/create-navigation-hotspot.js +1 -0
  946. package/dist/react-sdk/scene-control-elements/create-selection-hotspot.d.ts +9 -0
  947. package/dist/react-sdk/scene-control-elements/create-selection-hotspot.js +1 -0
  948. package/dist/react-sdk/scene-control-elements/create-tool-menu-fab.d.ts +9 -0
  949. package/dist/react-sdk/scene-control-elements/create-tool-menu-fab.js +1 -0
  950. package/dist/react-sdk/scene-control-elements/index.d.ts +11 -0
  951. package/dist/react-sdk/scene-control-elements/index.js +1 -0
  952. package/dist/react-sdk/scene-control-elements/scene-control-tooltip-visibility.d.ts +5 -0
  953. package/dist/react-sdk/scene-control-elements/scene-control-tooltip-visibility.js +1 -0
  954. package/dist/react-sdk/session/NotAuthenticatedPage.d.ts +4 -0
  955. package/dist/react-sdk/session/NotAuthenticatedPage.js +1 -1
  956. package/dist/react-sdk/session/SessionServiceProvider.js +1 -1
  957. package/dist/react-sdk/web-component/create-web-component.js +1 -1
  958. package/dist/react-sdk/web-component/god-mode/god-mode-registry.d.ts +30 -0
  959. package/dist/react-sdk/web-component/god-mode/god-mode-registry.js +1 -0
  960. package/dist/react-sdk/web-component/god-mode/index.d.ts +1 -0
  961. package/dist/react-sdk/web-component/god-mode/index.js +1 -0
  962. package/dist/ui-sdk/components/snackbar/Snackbar.d.ts +24 -3
  963. package/dist/ui-sdk/components/snackbar/Snackbar.js +1 -1
  964. package/dist/ui-sdk/icons/__generated/Lightbulb.d.ts +3 -0
  965. package/dist/ui-sdk/icons/__generated/Lightbulb.js +1 -0
  966. package/dist/ui-sdk/icons/__generated/XCircle.d.ts +3 -0
  967. package/dist/ui-sdk/icons/__generated/XCircle.js +1 -0
  968. package/dist/ui-sdk/icons/__generated/index.d.ts +4 -0
  969. package/dist/ui-sdk/icons/__generated/index.js +1 -1
  970. package/dist/ui-sdk/icons/icons-registry.js +1 -1
  971. package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.d.ts +9 -0
  972. package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.js +1 -1
  973. package/dist/ui-sdk/responsive-application/index.d.ts +1 -0
  974. package/dist/ui-sdk/responsive-application/responsive-state-store.d.ts +59 -0
  975. package/dist/ui-sdk/responsive-application/responsive-state-store.js +1 -0
  976. package/dist/ui-sdk/responsive-application/use-store-responsive-info.d.ts +7 -0
  977. package/dist/ui-sdk/responsive-application/use-store-responsive-info.js +1 -0
  978. package/dist/ui-sdk/theme/types.d.ts +5 -1
  979. package/package.json +17 -6
  980. package/schema/domain-spec.json +140 -0
  981. package/dist/application-spec/core/components/index.d.ts +0 -2
  982. package/dist/application-spec/core/expressions/index.d.ts +0 -2
  983. package/dist/configurator/common/use-finalize-action.js +0 -1
  984. package/dist/configurator/configurator-context/ConfiguratorDataProvider.d.ts +0 -2
  985. package/dist/configurator/configurator-context/ConfiguratorDataProvider.js +0 -1
  986. package/dist/configurator/configurator-context/IntegrationSubscription.js +0 -1
  987. package/dist/configurator/configurator-context/LifecycleProviders.js +0 -1
  988. package/dist/configurator/configurator-context/OnPresetLoadedHandler.js +0 -1
  989. package/dist/configurator/configurator-context/configurator-hooks/chat-hooks.d.ts +0 -1
  990. package/dist/configurator/configurator-context/configurator-hooks/chat-hooks.js +0 -1
  991. package/dist/configurator/configurator-context/configurator-routing/ConfiguratorRoutingProvider.js +0 -1
  992. package/dist/configurator/configurator-context/configurator-routing/OnGoToIndexHandler.js +0 -1
  993. package/dist/configurator/configurator-context/configurator-routing/index.d.ts +0 -2
  994. package/dist/configurator/configurator-context/configurator-routing/use-power-routing-lifecycle.js +0 -1
  995. package/dist/configurator/ui/assistant/form/built-in-form-registry.d.ts +0 -10
  996. package/dist/configurator/ui/assistant/form/built-in-form-registry.js +0 -1
  997. package/dist/configurator/ui/assistant/form/form-registry.js +0 -8
  998. package/dist/configurator/ui/phoenix-layout-elements/language/use-locale-options.d.ts +0 -4
  999. package/dist/configurator/ui/phoenix-layout-elements/language/use-locale-options.js +0 -1
  1000. package/dist/configurator/ui/phoenix-layout-elements/measurements/use-measurements-visibility.d.ts +0 -4
  1001. package/dist/configurator/ui/phoenix-layout-elements/measurements/use-measurements-visibility.js +0 -1
  1002. package/dist/domain/application/assistant/assistant-form-elements.d.ts +0 -28
  1003. package/dist/domain/application/assistant/assistant-form-elements.js +0 -1
  1004. package/dist/domain/extensions/client-side-image.js +0 -1
  1005. package/dist/domain/extensions/save-template-thumbnail.js +0 -1
  1006. package/dist/phoenix/services/lingui.js +0 -1
  1007. package/dist/react-sdk/application-runtime/runtime/god-mode.d.ts +0 -19
  1008. package/dist/react-sdk/application-runtime/runtime/god-mode.js +0 -1
  1009. package/dist/react-sdk/loading-state/LoadingStateProvider.js +0 -1
  1010. package/dist/react-sdk/loading-state/loading-state-manager.d.ts +0 -32
  1011. package/dist/react-sdk/loading-state/loading-state-manager.js +0 -1
  1012. /package/dist/{application-spec/core/expressions/relation-expression-params.js → domain/spec/application/admin-pages-section.js} +0 -0
  1013. /package/dist/{application-spec/parse-application-files/spec/components/component-entry.js → domain/spec/application/admin-pages.js} +0 -0
  1014. /package/dist/{application-spec/parse-application-files/spec/expressions/expression.js → domain/spec/application/admin-states.js} +0 -0
  1015. /package/dist/{application-spec/core → domain/spec/application}/application-instance.d.ts +0 -0
  1016. /package/dist/{application-spec/core → domain/spec/application}/application-instance.js +0 -0
  1017. /package/dist/{configurator/ui/assistant/form/form-element-definition.js → domain/spec/application/configurator-states.js} +0 -0
  1018. /package/dist/{application-spec/core → domain/spec}/components/component-filter.js +0 -0
  1019. /package/dist/{application-spec/core → domain/spec}/components/index.js +0 -0
  1020. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.d.ts +0 -0
  1021. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.js +0 -0
  1022. /package/dist/{application-spec/core → domain/spec}/expressions/index.js +0 -0
  1023. /package/dist/{application-spec/core → domain/spec}/expressions/relation-expression-params.d.ts +0 -0
  1024. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.d.ts +0 -0
  1025. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.js +0 -0
  1026. /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.d.ts +0 -0
  1027. /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.js +0 -0
  1028. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.d.ts +0 -0
  1029. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.js +0 -0
  1030. /package/dist/{configurator/common → react-sdk/application-runtime/common-services/analytics}/frontend-analytics.js +0 -0
  1031. /package/dist/{configurator/configurator-context → react-sdk/domain-application-context}/OnPresetLoadedHandler.d.ts +0 -0
  1032. /package/dist/{configurator/configurator-context → react-sdk/integration}/IntegrationSubscription.d.ts +0 -0
  1033. /package/dist/{configurator/configurator-context → react-sdk/lifecycle-providers}/LifecycleProviders.d.ts +0 -0
@@ -1,12 +1,13 @@
1
+ import type { ContentPart } from '@tanstack/ai';
1
2
  import type { DomainEntity, DomainMode, DomainState } from '#package/domain';
2
- import type { GraphQLSystem } from '../graphql-system/graphql-system.js';
3
+ import type { GraphQLExecution, GraphQLSystem } from '../graphql-system/graphql-system.js';
3
4
  /**
4
5
  * What the assistant's client tools need from the running configurator, as accessors they call when
5
- * the model calls them: a tool call always runs against the systems and the session mode current at
6
- * that moment, never against ones captured when its reply began streaming.
6
+ * the model calls them: a tool call always runs against the systems, the session mode and the view
7
+ * mode current at that moment, never against ones captured when its reply began streaming.
7
8
  */
8
9
  export interface AssistantToolDependencies {
9
- readonly getGraphQLSystem: () => Pick<GraphQLSystem, 'prepare' | 'execute' | 'readSideEffects'>;
10
+ readonly getGraphQLSystem: () => Pick<GraphQLSystem, 'prepare' | 'execute' | 'readSideEffects' | 'readWarnings' | 'readScreenshots'>;
10
11
  readonly getStoreSystem: () => {
11
12
  readonly isInitialized: boolean;
12
13
  readonly stateSlices: {
@@ -18,6 +19,11 @@ export interface AssistantToolDependencies {
18
19
  };
19
20
  };
20
21
  readonly getActiveMode: () => DomainMode;
22
+ /**
23
+ * Whether the configuration is read-only for the user now, by the rule the UI follows: the
24
+ * domain-context selector `getIsViewMode`, which `useAccessService().accessInfo.viewMode` returns.
25
+ */
26
+ readonly getIsViewMode: () => boolean;
21
27
  /** Forgets the changes recorded for the next change record, so it never lists what the agent itself changed. */
22
28
  readonly clearChanges: () => void;
23
29
  /**
@@ -26,15 +32,29 @@ export interface AssistantToolDependencies {
26
32
  */
27
33
  readonly rememberCommit: (toolCallId: string, state: DomainState<DomainEntity<string>>) => void;
28
34
  }
35
+ /**
36
+ * A tool result as the chat client accepts it: content parts, the execution's JSON as a text part
37
+ * followed, per screenshot, by its label as a text part and its picture as an image part, so the
38
+ * model reads each picture under the label its `image` field returned; the image part references the picture the browser uploaded, which the server
39
+ * inlines only for the model. The client deep-clones a
40
+ * result and rejects anything that is not plain JSON, so the `GraphQLError` instances of a result
41
+ * are formatted through their `toJSON` and `undefined` members are dropped. The prepared state stays
42
+ * in the browser.
43
+ */
44
+ export declare const toToolResult: ({ preparedState, screenshots, ...execution }: GraphQLExecution) => ContentPart[];
29
45
  /**
30
46
  * Browser implementation of the assistant's `query` tool: prepares the operations from the
31
47
  * committed state and drops their emissions, so mutations in the list show a hypothetical state and
32
- * the configuration, the undo stack and the saved revision stay as they were. The side effects of
33
- * the dropped emissions are still reported, as what the changes would do.
48
+ * the configuration, the undo stack and the saved revision stay as they were. The side effects and
49
+ * the new warnings of the dropped emissions are still reported, as what the changes would do.
34
50
  */
35
51
  export declare const createQueryClientTool: (dependencies: AssistantToolDependencies) => import("@tanstack/ai").ClientTool<{
36
52
  type: string;
37
53
  properties: {
54
+ title: {
55
+ type: string;
56
+ description: string;
57
+ };
38
58
  operations: {
39
59
  type: string;
40
60
  minItems: number;
@@ -64,6 +84,10 @@ export declare const createQueryClientTool: (dependencies: AssistantToolDependen
64
84
  inputSchema: {
65
85
  type: string;
66
86
  properties: {
87
+ title: {
88
+ type: string;
89
+ description: string;
90
+ };
67
91
  operations: {
68
92
  type: string;
69
93
  minItems: number;
@@ -99,13 +123,28 @@ export declare const createQueryClientTool: (dependencies: AssistantToolDependen
99
123
  * including why nothing was committed when a commit was held or lost to a conflict. A commit clears
100
124
  * the recorded changes; a held one does not, so it shows in the next change record once the user
101
125
  * approves it. The state it committed or held is remembered under the id of the call, so the chip
102
- * row of the call can undo it. Only an owner
103
- * session may change the configuration; the check lives here and not in the `GraphQLSystem`, whose
104
- * other caller, the editor panel, has its own rules.
126
+ * row of the call can undo it.
127
+ *
128
+ * The assistant changes the configuration exactly when the UI lets the user change it: while the
129
+ * view mode is off, which the host can switch both ways while the configurator runs. A finalize run
130
+ * never changes it. The checks live here and not in the `GraphQLSystem`, whose other caller, the
131
+ * editor panel, has its own rules.
132
+ *
133
+ * Accepted: the view mode is read live, while saving follows the mode captured at initialization
134
+ * (the named exception in `docs/architecture/application-runtime.md`). When the configuration turns
135
+ * editable, because the host cleared `readonly` or the access changed, for example from a
136
+ * read-revision to an owner token, a change applied before the configuration is initialized again
137
+ * is committed and reported to the model as committed, but it is not saved, and that initialization
138
+ * replaces it. The configurator page loads the configuration again on either switch, so the window
139
+ * lasts one load.
105
140
  */
106
141
  export declare const createApplyClientTool: (dependencies: AssistantToolDependencies) => import("@tanstack/ai").ClientTool<{
107
142
  type: string;
108
143
  properties: {
144
+ title: {
145
+ type: string;
146
+ description: string;
147
+ };
109
148
  operations: {
110
149
  type: string;
111
150
  minItems: number;
@@ -135,6 +174,10 @@ export declare const createApplyClientTool: (dependencies: AssistantToolDependen
135
174
  inputSchema: {
136
175
  type: string;
137
176
  properties: {
177
+ title: {
178
+ type: string;
179
+ description: string;
180
+ };
138
181
  operations: {
139
182
  type: string;
140
183
  minItems: number;
@@ -1 +1 @@
1
- import{AssistantGraphQLToolInput as e,applyTool as t,queryTool as o}from"@salsita-ai/contracts/assistant";let a=e=>({results:[],committed:!1,message:e,sideEffects:[]}),i=({preparedState:e,...t})=>JSON.parse(JSON.stringify(t)),s=t=>{let o=e.safeParse(t);if(!o.success){let e=o.error.issues.map(e=>`${e.path.join(".")}: ${e.message}`).join("; ");return{ok:!1,refusal:a(`Nothing was run, because the tool input is not a list of operations (${e}). Send { "operations": [{ "query": "<one GraphQL operation>" }] } with at least one item.`)}}return{ok:!0,operations:o.data.operations.map(({query:e,variables:t,operationName:o})=>({document:e,variables:t??void 0,operationName:o??void 0}))}};export const createQueryClientTool=e=>o.client(async t=>{let o=s(t);if(!o.ok)return o.refusal;let r=e.getStoreSystem();if(!r.isInitialized)return a("Nothing was run, because the configuration is not loaded yet, so there is no state to query. Call the tool again once the configurator has finished loading.");let n=e.getGraphQLSystem(),l=await n.prepare(r.stateSlices.committed.value.state,o.operations);return i({results:l.map(({result:e})=>e),committed:!1,sideEffects:n.readSideEffects(l)})});export const createApplyClientTool=e=>t.client(async(t,o)=>{if("owner"!==e.getActiveMode())return a("Nothing was run, because changes cannot be applied in this session: the user may view this configuration but not change it. The query tool still works here, including mutations, to show what a change would do without keeping it.");let r=s(t);if(!r.ok)return r.refusal;let n=await e.getGraphQLSystem().execute(r.operations),l=o?.toolCallId;return void 0!==l&&void 0!==n.preparedState&&e.rememberCommit(l,n.preparedState),n.committed&&e.clearChanges(),i(n)});
1
+ import{AssistantGraphQLToolInput as e,applyTool as t,assistantImageReference as o,queryTool as a}from"@salsita-ai/contracts/assistant";let i=e=>({results:[],committed:!1,message:e,sideEffects:[],screenshots:new Map,warnings:[]});export const toToolResult=({preparedState:e,screenshots:t,...a})=>[{type:"text",content:JSON.stringify(a)},...[...t].flatMap(([e,{imageId:t}])=>[{type:"text",content:e},{type:"image",source:{type:"url",value:o(t)}}])];let s=t=>{let o=e.safeParse(t);if(!o.success){let e=o.error.issues.map(e=>`${e.path.join(".")}: ${e.message}`).join("; ");return{ok:!1,refusal:i(`Nothing was run, because the tool input is not a list of operations (${e}). Send { "operations": [{ "query": "<one GraphQL operation>" }] } with at least one item.`)}}return{ok:!0,operations:o.data.operations.map(({query:e,variables:t,operationName:o})=>({document:e,variables:t??void 0,operationName:o??void 0}))}};export const createQueryClientTool=e=>a.client(async t=>{let o=s(t);if(!o.ok)return toToolResult(o.refusal);let a=e.getStoreSystem();if(!a.isInitialized)return toToolResult(i("Nothing was run, because the configuration is not loaded yet, so there is no state to query. Call the tool again once the configurator has finished loading."));let n=e.getGraphQLSystem(),r=a.stateSlices.committed.value.state,l=await n.prepare(r,o.operations);return toToolResult({results:l.map(({result:e})=>e),committed:!1,sideEffects:n.readSideEffects(l),screenshots:n.readScreenshots(l),warnings:n.readWarnings(r,l)})});export const createApplyClientTool=e=>t.client(async(t,o)=>{if("finalize"===e.getActiveMode())return toToolResult(i("Nothing was run, because changes cannot be applied in this session: the user may view this configuration but not change it. The query tool still works here, including mutations, to show what a change would do without keeping it."));if(e.getIsViewMode())return toToolResult(i("Nothing was run, because the configuration is read-only right now: the user may view it but not change it. The query tool still works here, including mutations, to show what a change would do without keeping it. Call apply again only once the configuration is editable."));let a=s(t);if(!a.ok)return toToolResult(a.refusal);let n=await e.getGraphQLSystem().execute(a.operations),r=o?.toolCallId;return void 0!==r&&void 0!==n.preparedState&&e.rememberCommit(r,n.preparedState),n.committed&&e.clearChanges(),toToolResult(n)});
@@ -3,7 +3,7 @@ import type { Observable } from 'rxjs';
3
3
  import { OrthographicCamera, PerspectiveCamera } from 'three';
4
4
  import type { ObservableWithLastValue, ValueOf } from '@salsita-ai/common/utils';
5
5
  import { type DomainEntityId } from '#package/domain';
6
- import type { CanvasPadding } from '#package/ui-sdk';
6
+ import type { CanvasPadding } from '#package/react-sdk';
7
7
  import type { ConfiguratorExtensionSelectors } from '../../selectors.js';
8
8
  export declare const CameraControlType: {
9
9
  readonly Perspective: 'perspective';
@@ -94,6 +94,14 @@ export declare class CanvasSystem<ENTITIES extends DomainEntity<string>> {
94
94
  readonly getCanvasEnvironment: (state: DomainState<ENTITIES>) => import("#package/domain").ComponentSnapshot<import("#package/domain").SystemComponentType<"canvasCustomEnvironment", import("#package/domain").CanvasCustomEnvironmentComponentState, never> | import("#package/domain").SystemComponentType<"canvasPresetEnvironment", import("#package/domain").CanvasPresetEnvironmentComponentState, never>> | undefined;
95
95
  readonly getCanvasConfig: (state: DomainState<ENTITIES>) => import("#package/domain").CanvasConfigComponentState | undefined;
96
96
  readonly register: (scene: Scene, gl: WebGLRenderer, r3fHandle: R3FHandle, loadingProgress$: Observable<LoadingProgress>) => () => void;
97
+ /**
98
+ * Resolves with the handle of the mounted canvas, waiting for a canvas to register when none is
99
+ * mounted yet. Work that needs the canvas and can be started by the user before the first mount
100
+ * (an image capture started from the summary) awaits this instead of failing on an empty handle.
101
+ *
102
+ * @internal
103
+ */
104
+ readonly waitForCanvas: (timeoutMs?: number) => Promise<R3FHandle>;
97
105
  readonly reportFlush: (token: FlushToken) => void;
98
106
  readonly registerForceFlush: (trigger: (token: FlushToken) => void) => () => void;
99
107
  private _forceFlush;
@@ -1 +1 @@
1
- import{BehaviorSubject as e,Subject as t,debounceTime as i,delay as n,filter as s,firstValueFrom as r,map as o,merge as a,of as h,switchMap as l,tap as c}from"rxjs";import{applicationConfigComponent as d,canvasConfigComponent as u,canvasCustomEnvironmentComponent as g,canvasPresetEnvironmentComponent as _}from"#package/domain";export const resolveInteractiveViewport=(e,t)=>!Number.isFinite(t.width)||!Number.isFinite(t.height)||t.width<=0||t.height<=0||e?.width===t.width&&e.height===t.height?e:t;export class CanvasInitializationCancellationError extends Error{constructor(){super("Canvas generation ended while waiting for a flush!"),this.name="CanvasInitializationCancellationError"}}export class CanvasSystem{_context;_dimensionIndicatorShown;_meshChanged$=new e(!0);_firstLoadFinished=new e(!1);dimensionIndicatorShown$;meshChanged$=this._meshChanged$;firstLoadFinished$=this._firstLoadFinished;onCanvasClick$=new t;onCanvasPointerMove$=new t;_ready$=new e(null);ready$=this._ready$;_r3fHandle$=new e(null);r3fHandle$=this._r3fHandle$;_interactiveViewport$=new e(null);interactiveViewport$=this._interactiveViewport$;_flushed$=new t;_flushSequence=0;_lastReportedFlushSequence=0;_triggerForceFlush=null;_registration=null;_progress$=new e({type:"finished"});_generation=null;constructor(t){this._context=t,this._dimensionIndicatorShown=new e(!1),this.dimensionIndicatorShown$=this._dimensionIndicatorShown}getCanvasEnvironment=e=>{let t=this._context.domainContextSelectors.getComponentReader().readManyComponents({componentTypes:[g,_]},e);return t.length>1&&this._context.domainServicesSelectors.getLogger().warn("Multiple canvas environments found, using the first one!",{environments:t}),t.at(0)};getCanvasConfig=e=>{let t=this._context.domainContextSelectors.getComponentReader().readManyComponents({componentTypes:[u]},e);return t.length>1&&this._context.domainServicesSelectors.getLogger().warn("Multiple canvas configs found, using the first one!",{configs:t}),t.at(0)?.state};register=(e,t,i,n)=>{let s={scene:e,gl:t,r3fHandle:i};this._registration=s,this._ready$.next({scene:e,gl:t}),this._r3fHandle$.next(i),this._interactiveViewport$.next(null);let r=n.subscribe(e=>{this._progress$.next(e)}),o=e=>{if(this._registration!==s)return;let t=resolveInteractiveViewport(this._interactiveViewport$.value,e);t!==this._interactiveViewport$.value&&(this._interactiveViewport$.next(t),i.get().invalidate())},a=t.domElement,h=a.getBoundingClientRect();o({width:h.width,height:h.height});let l=new ResizeObserver(([e])=>{e&&o({width:e.contentRect.width,height:e.contentRect.height})});return l.observe(a),()=>{r.unsubscribe(),l.disconnect(),this._registration===s&&(this._registration=null,this._ready$.next(null),this._r3fHandle$.next(null),this._interactiveViewport$.next(null),this._progress$.next({type:"finished"}),this._firstLoadFinished.next(!1))}};reportFlush=e=>{this._lastReportedFlushSequence=Math.max(this._lastReportedFlushSequence,e.sequence),this._flushed$.next(e)};registerForceFlush=e=>(this._triggerForceFlush=e,()=>{this._triggerForceFlush===e&&(this._triggerForceFlush=null)});_forceFlush(){if(!this._triggerForceFlush)throw this._context.domainServicesSelectors.getLogger().debug("Force flush skipped: canvas not ready"),new CanvasInitializationCancellationError;let e={sequence:++this._flushSequence},t=r(a(this._flushed$.pipe(s(t=>t.sequence>=e.sequence),o(()=>void 0)),h(void 0).pipe(n(1e4),c(()=>{this._context.domainServicesSelectors.getLogger().error("Force flush timeout",{requestedSequence:e.sequence,lastReportedSequence:this._lastReportedFlushSequence,timeoutMs:1e4,detectorRegistered:null!==this._triggerForceFlush})}))));return this._triggerForceFlush(e),t}toggleDimensionIndicator=()=>{this._dimensionIndicatorShown.next(!this._dimensionIndicatorShown.value)};setDimensionIndicatorShown=e=>{this._dimensionIndicatorShown.value!==e&&this._dimensionIndicatorShown.next(e)};reportMeshChanged=()=>{this._meshChanged$.next(!0)};reportFirstLoadFinished=()=>{this._firstLoadFinished.next(!0)};_findEntity3d(e,t){let i=[];if(e.entityIds?.length===0)return i;if(t.traverse(t=>{let n=t.userData;"entityRoot"===n.type&&(void 0===e.entityIds||e.entityIds.includes(n.entityId))&&i.push(t)}),e.descendantEntities){let e=[...i];for(;e.length>0;){let t=e.shift();t&&t.children.forEach(t=>{"entityRoot"===t.userData.type&&(i.push(t),e.push(t))})}}let n=e.entityRoots?[...i]:[];if(e.entityObjects){let t=i=>{i.children.forEach(i=>{let s=i.userData;"entityObjectGroup"===s.type?t(i):"entityObject"!==s.type||(void 0===e.objectInstanceNames||e.objectInstanceNames.includes(s.objectInstanceName))&&(e.recursiveObjects?i.traverse(e=>{n.push(e)}):n.push(i))})};i.forEach(e=>t(e))}return n}findEntity3d=e=>this.ready$.value?.scene?this._findEntity3d(e,this.ready$.value.scene):[];findEntity3d$=e=>this.ready$.pipe(s(e=>null!=e),l(({scene:t})=>this.meshChanged$.pipe(i(0),o(()=>this._findEntity3d(e,t)))));initialize=()=>{let e=this._context.domainContextSelectors.getComponentReader().readFirstRootComponent({componentTypes:[d]},this._context.domainContextSelectors.getStoreSystem().stateSlices.committed.value.state);null!==this._generation&&(this._generation.active=!1);let t=e?.state.initialIndicatorShown??!1;this._generation={active:!0},this._dimensionIndicatorShown.next(t),this._meshChanged$.next(!0)};waitForFlush=async()=>{let e=this._generation,t=()=>{if(!e?.active)throw new CanvasInitializationCancellationError};for(t(),await this._forceFlush(),t(),await this._forceFlush(),t();"finished"!==this._progress$.value.type;)await r(this._progress$.pipe(s(e=>"finished"===e.type))),t(),await this._forceFlush(),t(),await this._forceFlush(),t()}}
1
+ import{BehaviorSubject as e,Subject as t,debounceTime as i,delay as n,filter as s,firstValueFrom as r,map as o,merge as a,of as h,switchMap as l,tap as c,throwError as d,timeout as u}from"rxjs";import{isNonNullish as g}from"@salsita-ai/common/utils";import{applicationConfigComponent as _,canvasConfigComponent as p,canvasCustomEnvironmentComponent as m,canvasPresetEnvironmentComponent as w}from"#package/domain";export const resolveInteractiveViewport=(e,t)=>!Number.isFinite(t.width)||!Number.isFinite(t.height)||t.width<=0||t.height<=0||e?.width===t.width&&e.height===t.height?e:t;export class CanvasInitializationCancellationError extends Error{constructor(){super("Canvas generation ended while waiting for a flush!"),this.name="CanvasInitializationCancellationError"}}let v=1e4;export class CanvasSystem{_context;_dimensionIndicatorShown;_meshChanged$=new e(!0);_firstLoadFinished=new e(!1);dimensionIndicatorShown$;meshChanged$=this._meshChanged$;firstLoadFinished$=this._firstLoadFinished;onCanvasClick$=new t;onCanvasPointerMove$=new t;_ready$=new e(null);ready$=this._ready$;_r3fHandle$=new e(null);r3fHandle$=this._r3fHandle$;_interactiveViewport$=new e(null);interactiveViewport$=this._interactiveViewport$;_flushed$=new t;_flushSequence=0;_lastReportedFlushSequence=0;_triggerForceFlush=null;_registration=null;_progress$=new e({type:"finished"});_generation=null;constructor(t){this._context=t,this._dimensionIndicatorShown=new e(!1),this.dimensionIndicatorShown$=this._dimensionIndicatorShown}getCanvasEnvironment=e=>{let t=this._context.domainContextSelectors.getComponentReader().readManyComponents({componentTypes:[m,w]},e);return t.length>1&&this._context.domainServicesSelectors.getLogger().warn("Multiple canvas environments found, using the first one!",{environments:t}),t.at(0)};getCanvasConfig=e=>{let t=this._context.domainContextSelectors.getComponentReader().readManyComponents({componentTypes:[p]},e);return t.length>1&&this._context.domainServicesSelectors.getLogger().warn("Multiple canvas configs found, using the first one!",{configs:t}),t.at(0)?.state};register=(e,t,i,n)=>{let s={scene:e,gl:t,r3fHandle:i};this._registration=s,this._ready$.next({scene:e,gl:t}),this._r3fHandle$.next(i),this._interactiveViewport$.next(null);let r=n.subscribe(e=>{this._progress$.next(e)}),o=e=>{if(this._registration!==s)return;let t=resolveInteractiveViewport(this._interactiveViewport$.value,e);t!==this._interactiveViewport$.value&&(this._interactiveViewport$.next(t),i.get().invalidate())},a=t.domElement,h=a.getBoundingClientRect();o({width:h.width,height:h.height});let l=new ResizeObserver(([e])=>{e&&o({width:e.contentRect.width,height:e.contentRect.height})});return l.observe(a),()=>{r.unsubscribe(),l.disconnect(),this._registration===s&&(this._registration=null,this._ready$.next(null),this._r3fHandle$.next(null),this._interactiveViewport$.next(null),this._progress$.next({type:"finished"}),this._firstLoadFinished.next(!1))}};waitForCanvas=(e=v)=>r(this._r3fHandle$.pipe(s(g),u({first:e,with:()=>d(()=>Error(`The 3D canvas did not mount within ${e} ms, so the canvas work that waited for it (an image capture or an export) cannot run. The canvas mounts when the configurator layout renders it; make sure the current layout shows the canvas, then retry once the scene is visible.`))})));reportFlush=e=>{this._lastReportedFlushSequence=Math.max(this._lastReportedFlushSequence,e.sequence),this._flushed$.next(e)};registerForceFlush=e=>(this._triggerForceFlush=e,()=>{this._triggerForceFlush===e&&(this._triggerForceFlush=null)});_forceFlush(){if(!this._triggerForceFlush)throw this._context.domainServicesSelectors.getLogger().debug("Force flush skipped: canvas not ready"),new CanvasInitializationCancellationError;let e={sequence:++this._flushSequence},t=r(a(this._flushed$.pipe(s(t=>t.sequence>=e.sequence),o(()=>void 0)),h(void 0).pipe(n(1e4),c(()=>{this._context.domainServicesSelectors.getLogger().error("Force flush timeout",{requestedSequence:e.sequence,lastReportedSequence:this._lastReportedFlushSequence,timeoutMs:1e4,detectorRegistered:null!==this._triggerForceFlush})}))));return this._triggerForceFlush(e),t}toggleDimensionIndicator=()=>{this._dimensionIndicatorShown.next(!this._dimensionIndicatorShown.value)};setDimensionIndicatorShown=e=>{this._dimensionIndicatorShown.value!==e&&this._dimensionIndicatorShown.next(e)};reportMeshChanged=()=>{this._meshChanged$.next(!0)};reportFirstLoadFinished=()=>{this._firstLoadFinished.next(!0)};_findEntity3d(e,t){let i=[];if(e.entityIds?.length===0)return i;if(t.traverse(t=>{let n=t.userData;"entityRoot"===n.type&&(void 0===e.entityIds||e.entityIds.includes(n.entityId))&&i.push(t)}),e.descendantEntities){let e=[...i];for(;e.length>0;){let t=e.shift();t&&t.children.forEach(t=>{"entityRoot"===t.userData.type&&(i.push(t),e.push(t))})}}let n=e.entityRoots?[...i]:[];if(e.entityObjects){let t=i=>{i.children.forEach(i=>{let s=i.userData;"entityObjectGroup"===s.type?t(i):"entityObject"!==s.type||(void 0===e.objectInstanceNames||e.objectInstanceNames.includes(s.objectInstanceName))&&(e.recursiveObjects?i.traverse(e=>{n.push(e)}):n.push(i))})};i.forEach(e=>t(e))}return n}findEntity3d=e=>this.ready$.value?.scene?this._findEntity3d(e,this.ready$.value.scene):[];findEntity3d$=e=>this.ready$.pipe(s(e=>null!=e),l(({scene:t})=>this.meshChanged$.pipe(i(0),o(()=>this._findEntity3d(e,t)))));initialize=()=>{let e=this._context.domainContextSelectors.getComponentReader().readFirstRootComponent({componentTypes:[_]},this._context.domainContextSelectors.getStoreSystem().stateSlices.committed.value.state);null!==this._generation&&(this._generation.active=!1);let t=e?.state.initialIndicatorShown??!1;this._generation={active:!0},this._dimensionIndicatorShown.next(t),this._meshChanged$.next(!0)};waitForFlush=async()=>{let e=this._generation,t=()=>{if(!e?.active)throw new CanvasInitializationCancellationError};for(t(),await this._forceFlush(),t(),await this._forceFlush(),t();"finished"!==this._progress$.value.type;)await r(this._progress$.pipe(s(e=>"finished"===e.type))),t(),await this._forceFlush(),t(),await this._forceFlush(),t()}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * An export run that waited for the configuration to settle gave up: the user kept changing what
3
+ * the configurator shows (a drag in progress, for instance), and exporting over it would have thrown
4
+ * the change away.
5
+ */
6
+ export declare class ExportBusyError extends Error {
7
+ constructor();
8
+ }
@@ -0,0 +1 @@
1
+ export class ExportBusyError extends Error{constructor(){super("The export did not start, because the user kept changing the configuration while it waited, and exporting would have discarded the change. Run the export again once the user has finished."),this.name="ExportBusyError"}}
@@ -1,4 +1,5 @@
1
1
  import type { Scene } from 'three';
2
+ import { type ObservableWithLastValue } from '@salsita-ai/common/utils';
2
3
  import type { $DomainEntity, DomainContextSelectors, DomainEntity, DomainEntityId, DomainServicesSelectors, DomainState } from '#package/domain';
3
4
  import type { ConfiguratorExtensionSelectors } from '../../selectors.js';
4
5
  import type { R3FHandle } from '../canvas-system.js';
@@ -29,12 +30,26 @@ export interface ExportJob<EXPORT_STATES extends string, ENTITIES extends Domain
29
30
  selectedEntityId?: ENTITIES['id'];
30
31
  execute: (props: ExportJobArguments<ENTITIES, any, any>) => Promise<R>;
31
32
  }
33
+ /** How one export run starts. */
34
+ export interface ExportRunOptions {
35
+ /**
36
+ * Waits for the user to finish a change they are making, such as a drag, before the first job, for
37
+ * up to {@link SETTLE_TIMEOUT_MS}, and rejects with an {@link ExportBusyError} when they do not. A run
38
+ * the user did not start themselves, such as the assistant's screenshot, must not export over it. A
39
+ * hover is no such change: the run's restore drops it, as it always did.
40
+ */
41
+ readonly awaitSettledState?: boolean;
42
+ }
32
43
  /** ExportSystem with its entity types erased — how the runtime selectors expose the instance. */
33
44
  export type AnyExportSystem = ExportSystem<any, any, any, any, any, any, any>;
34
45
  export declare class ExportSystem<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string> {
35
46
  private readonly _context;
36
47
  private _generation;
37
48
  private _frameloopPause;
49
+ private _queue;
50
+ private readonly _exporting;
51
+ /** True while an export run is queued or running; the configurator UI is inert meanwhile. */
52
+ readonly exporting$: ObservableWithLastValue<boolean>;
38
53
  constructor(_context: ExportSystemContext);
39
54
  /**
40
55
  * Pauses the frameloop of the given canvas mount until the returned release has been called as
@@ -55,6 +70,13 @@ export declare class ExportSystem<ENTITIES extends DomainEntity<string>, ALLOWED
55
70
  navigationState?: NAVIGATION_STATES;
56
71
  selectedEntityId?: DomainEntityId<ENTITY_TYPE>;
57
72
  }, job: (props: ExportJobArguments<ENTITIES, $MAP[ENTITY_TYPE], $MAP[ALLOWED_ROOT_ENTITIES['type']]>) => Promise<R>) => ExportJob<EXPORT_STATES, ENTITIES, TOOL_STATES, VIEW_STATES, NAVIGATION_STATES, R>;
58
- runExportJobs: <R>(jobs: ReadonlyArray<ExportJob<EXPORT_STATES, ENTITIES, TOOL_STATES, VIEW_STATES, NAVIGATION_STATES, R>>) => Promise<R[]>;
73
+ /**
74
+ * Queues the jobs as one export run behind every run already queued and resolves with their
75
+ * results in order. While the run is queued or running, `exporting$` is true. Afterwards the store
76
+ * shows the committed state current at that moment, not the one the run started from.
77
+ */
78
+ runExportJobs: <R>(jobs: ReadonlyArray<ExportJob<EXPORT_STATES, ENTITIES, TOOL_STATES, VIEW_STATES, NAVIGATION_STATES, R>>, options?: ExportRunOptions) => Promise<R[]>;
79
+ private readonly _awaitSettledState;
80
+ private readonly _runExportJobs;
59
81
  initialize: () => void;
60
82
  }
@@ -1 +1 @@
1
- import{isNonNullish as t}from"@salsita-ai/common/utils";export class ExportSystem{_context;_generation=null;_frameloopPause=null;constructor(t){this._context=t}pauseFrameloop=t=>{if(this._frameloopPause?.handle===t)this._frameloopPause.holders+=1;else{let{frameloop:e,internal:o}=t.get();this._frameloopPause={handle:t,frameloop:e,priority:o.priority,holders:1},t.set(t=>({...t,frameloop:"never",internal:{...t.internal,priority:1/0}}))}let e=this._frameloopPause,o=!1;return()=>{o||(o=!0,e.holders-=1,e.holders>0||this._frameloopPause!==e||(this._frameloopPause=null,this._context.configuratorExtensionSelectors.getCanvasSystem().r3fHandle$.value===t&&t.set(t=>({...t,frameloop:e.frameloop,internal:{...t.internal,priority:e.priority}}))))}};createExportJob=(t,e,o)=>({sourceState:t,exportState:e.exportState,exportedEntityId:e.exportedEntityId,execute:o,toolState:e.toolState,viewState:e.viewState,navigationState:e.navigationState,selectedEntityId:e.selectedEntityId});runExportJobs=async e=>{let o=this._generation,i=()=>{if(!o?.active)throw Error("Export generation ended while jobs were running! The configurator context was reinitialized mid-export, so the remaining jobs would drive a state that is no longer theirs. Await the export before leaving the configuration, or discard the rejection.")};i();let a=this._context.configuratorExtensionSelectors.getCanvasSystem().r3fHandle$.value;if(!a)throw Error("Canvas is not ready");let n=this._context.domainContextSelectors.getStoreSystem().stateSlices.committed.value,r=this.pauseFrameloop(a);try{let o=[];for(let n of e){i();let e=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission([this._context.domainContextSelectors.getNavigationSystem().getExportUpdate(n.exportState,n.exportedEntityId),null!=n.toolState?this._context.domainContextSelectors.getNavigationSystem().getToolUpdate(n.toolState):void 0,null!=n.viewState?this._context.domainContextSelectors.getNavigationSystem().getViewUpdate(n.viewState):void 0,null!=n.navigationState?this._context.domainContextSelectors.getNavigationSystem().getNavigationUpdate(n.navigationState):void 0,null!=n.selectedEntityId?this._context.domainContextSelectors.getNavigationSystem().getSelectUpdate(n.selectedEntityId):void 0,this._context.domainContextSelectors.getNavigationSystem().getHoverOutUpdate()].filter(t),n.sourceState,"staged");if(this._context.domainContextSelectors.getStoreSystem().emit(e),await this._context.configuratorExtensionSelectors.getCanvasSystem().waitForFlush(),i(),!e.validity.valid)throw this._context.domainServicesSelectors.getLogger().error(`Setting an export state to ${n.exportState} for entity ${n.exportedEntityId} resulted in an invalid state! Check if there isn't a transformer corrupting the state as a reaction to setting the export state.`,e),Error("Exported state is invalid!");let r=e.state,s=this._context.domainContextSelectors.getDomain().get$Entity(n.exportedEntityId,r),l=this._context.domainContextSelectors.getDomain().getRoot$Entity(r),c=await n.execute({$entity:s,$root:l,state:r,scene:a.get().scene});i(),o.push(c)}return o}finally{o?.active&&this._context.domainContextSelectors.getStoreSystem().emit(n),r()}};initialize=()=>{null!==this._generation&&(this._generation.active=!1),this._generation={active:!0}}}
1
+ import{BehaviorSubject as t}from"rxjs";import{isNonNullish as e}from"@salsita-ai/common/utils";import{ExportBusyError as o}from"./export-busy-error.js";export class ExportSystem{_context;_generation=null;_frameloopPause=null;_queue=null;_exporting=new t(!1);exporting$=this._exporting;constructor(t){this._context=t}pauseFrameloop=t=>{if(this._frameloopPause?.handle===t)this._frameloopPause.holders+=1;else{let{frameloop:e,internal:o}=t.get();this._frameloopPause={handle:t,frameloop:e,priority:o.priority,holders:1},t.set(t=>({...t,frameloop:"never",internal:{...t.internal,priority:1/0}}))}let e=this._frameloopPause,o=!1;return()=>{o||(o=!0,e.holders-=1,e.holders>0||this._frameloopPause!==e||(this._frameloopPause=null,this._context.configuratorExtensionSelectors.getCanvasSystem().r3fHandle$.value===t&&t.set(t=>({...t,frameloop:e.frameloop,internal:{...t.internal,priority:e.priority}}))))}};createExportJob=(t,e,o)=>({sourceState:t,exportState:e.exportState,exportedEntityId:e.exportedEntityId,execute:o,toolState:e.toolState,viewState:e.viewState,navigationState:e.navigationState,selectedEntityId:e.selectedEntityId});runExportJobs=(t,e={})=>{let o=this._generation,i=(this._queue??Promise.resolve()).then(()=>this._runExportJobs(t,e,o)),a=i.catch(()=>void 0);return this._queue=a,this._exporting.value||this._exporting.next(!0),a.then(()=>{this._queue===a&&(this._queue=null,this._exporting.next(!1))}),i};_awaitSettledState=async t=>{let e=this._context.domainContextSelectors.getStoreSystem(),i=Date.now()+2e3;for(;e.hasStagedUpdates;){if(Date.now()>=i)throw new o;await new Promise(t=>setTimeout(t,200)),t()}};_runExportJobs=async(t,{awaitSettledState:o=!1},i)=>{let a=()=>{if(!i?.active)throw Error("Export generation ended while jobs were running! The configurator context was reinitialized mid-export, so the remaining jobs would drive a state that is no longer theirs. Await the export before leaving the configuration, or discard the rejection.")};a(),o&&await this._awaitSettledState(a);let n=this._context.configuratorExtensionSelectors.getCanvasSystem(),r=n.r3fHandle$.value??await n.waitForCanvas().catch(t=>{throw a(),t});a();let s=this.pauseFrameloop(r);try{let o=[];for(let i of t){a();let t=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission([this._context.domainContextSelectors.getNavigationSystem().getExportUpdate(i.exportState,i.exportedEntityId),null!=i.toolState?this._context.domainContextSelectors.getNavigationSystem().getToolUpdate(i.toolState):void 0,null!=i.viewState?this._context.domainContextSelectors.getNavigationSystem().getViewUpdate(i.viewState):void 0,null!=i.navigationState?this._context.domainContextSelectors.getNavigationSystem().getNavigationUpdate(i.navigationState):void 0,null!=i.selectedEntityId?this._context.domainContextSelectors.getNavigationSystem().getSelectUpdate(i.selectedEntityId):void 0,this._context.domainContextSelectors.getNavigationSystem().getHoverOutUpdate()].filter(e),i.sourceState,"staged");if(this._context.domainContextSelectors.getStoreSystem().emit(t),await this._context.configuratorExtensionSelectors.getCanvasSystem().waitForFlush(),a(),!t.validity.valid)throw this._context.domainServicesSelectors.getLogger().error(`Setting an export state to ${i.exportState} for entity ${i.exportedEntityId} resulted in an invalid state! Check if there isn't a transformer corrupting the state as a reaction to setting the export state.`,t),Error("Exported state is invalid!");let n=t.state,s=this._context.domainContextSelectors.getDomain().get$Entity(i.exportedEntityId,n),l=this._context.domainContextSelectors.getDomain().getRoot$Entity(n),c=await i.execute({$entity:s,$root:l,state:n,scene:r.get().scene});a(),o.push(c)}return o}finally{if(i?.active){let t=this._context.domainContextSelectors.getStoreSystem();t.emit(t.stateSlices.committed.value)}s()}};initialize=()=>{null!==this._generation&&(this._generation.active=!1),this._generation={active:!0},this._queue=null,this._exporting.value&&this._exporting.next(!1)}}
@@ -1,4 +1,5 @@
1
- import { type $DomainEntity, type AssistantManifest, type AssistantRecipeContext, type DomainEntity, type DomainEntityId, type DomainState, type EntityId, type StateUpdate, type StateUpdateEmission } from '#package/domain';
1
+ import { type $DomainEntity, type AssistantManifest, type AssistantRecipeContext, type DomainEntity, type DomainEntityId, type DomainState, type StateUpdate, type StateUpdateEmission, type StateValidationResult } from '#package/domain';
2
+ import { type ViolationEntry } from './violations.js';
2
3
  type AnyDomainState = DomainState<DomainEntity<string>>;
3
4
  type AnyStateUpdate = StateUpdate<DomainEntity<string>, DomainEntity<string>>;
4
5
  /** An entity and the state it was read on, which everything under its `meta` field resolves against. */
@@ -20,17 +21,24 @@ export interface EntityMetaContext {
20
21
  readonly success: false;
21
22
  readonly errors: readonly string[];
22
23
  };
23
- }
24
- /** One reason a dry-run reports for a change that cannot be made; a violation can sit on a virtual entity. */
25
- interface DryRunError {
26
- readonly type: string;
27
- readonly entityId: EntityId<DomainEntity<string>> | null;
28
- readonly message: string | null;
24
+ /**
25
+ * Takes a screenshot of the entity from one of its views on the state it was read on and returns
26
+ * the label of the image; `null` when the view does not apply to the entity there.
27
+ */
28
+ readonly takeScreenshot: (source: EntityMetaSource, view: string) => Promise<{
29
+ readonly image: string;
30
+ } | null>;
31
+ /**
32
+ * Validates a state: the one an entity was read on, for its warnings, or the one a dry-run ran on,
33
+ * whose warnings the dry-run's own are compared with.
34
+ */
35
+ readonly validateState: (state: AnyDomainState) => StateValidationResult<DomainEntity<string>, string>;
29
36
  }
30
37
  /**
31
38
  * The value of an entity's `meta` field: its built-ins, resolved lazily against the state the entity
32
39
  * was read on. `childRecipes` and `replaceRecipes` list the manifest's recipe groups of their kind
33
- * that are active on the entity there; each options edge lists the choices of its field there, or `null` when its component is not active.
40
+ * that are active on the entity there; each options edge lists the choices of its field there, or `null` when its component is not active;
41
+ * `screenshot` renders the entity there, and `warnings` lists the warnings and notices the entity holds there.
34
42
  */
35
43
  export declare const createEntityMeta: (source: EntityMetaSource, context: EntityMetaContext) => {
36
44
  childRecipes: () => {
@@ -48,13 +56,15 @@ export declare const createEntityMeta: (source: EntityMetaSource, context: Entit
48
56
  changedEntities: never[];
49
57
  deletedEntityIds: never[];
50
58
  sideEffects: never[];
51
- errors: readonly DryRunError[];
59
+ warnings: never[];
60
+ errors: readonly ViolationEntry[];
52
61
  } | {
53
62
  ok: boolean;
54
63
  root: unknown;
55
64
  changedEntities: {}[];
56
65
  deletedEntityIds: DomainEntityId<string>[];
57
66
  sideEffects: readonly string[];
67
+ warnings: () => readonly import("./violations.js").AssistantWarning[];
58
68
  errors: never[];
59
69
  } | null;
60
70
  }[];
@@ -74,16 +84,24 @@ export declare const createEntityMeta: (source: EntityMetaSource, context: Entit
74
84
  changedEntities: never[];
75
85
  deletedEntityIds: never[];
76
86
  sideEffects: never[];
77
- errors: readonly DryRunError[];
87
+ warnings: never[];
88
+ errors: readonly ViolationEntry[];
78
89
  } | {
79
90
  ok: boolean;
80
91
  root: unknown;
81
92
  changedEntities: {}[];
82
93
  deletedEntityIds: DomainEntityId<string>[];
83
94
  sideEffects: readonly string[];
95
+ warnings: () => readonly import("./violations.js").AssistantWarning[];
84
96
  errors: never[];
85
97
  } | null;
86
98
  }[];
87
99
  }[];
100
+ screenshot: ({ view }: {
101
+ readonly view: string;
102
+ }) => Promise<{
103
+ readonly image: string;
104
+ } | null>;
105
+ warnings: () => readonly import("./violations.js").AssistantWarning[];
88
106
  };
89
107
  export {};
@@ -1 +1 @@
1
- import{findAssistantFieldOptions as e,findAssistantRecipeGroups as t,modifyEntityUpdateTag as i,prepareAssistantRecipeUpdates as r,readAssistantFieldOptions as n,readAssistantRecipeGroup as o,systemUpdateFactory as s}from"#package/domain";import{readSideEffects as a}from"./side-effects.js";let d=e=>({ok:!1,root:null,changedEntities:[],deletedEntityIds:[],sideEffects:[],errors:e}),l=(e,{state:t},{recipes:i,prepareStateEmission:r,find$Entity:n})=>{let{validity:o,state:s,updates:l}=r(e,t,"committed");if(o.valid){let e=new Map(t.entities.map(e=>[e.id,e])),r=new Set(s.entities.map(e=>e.id));return{ok:!0,root:n(s.rootEntityId,s),changedEntities:s.entities.filter(t=>e.get(t.id)!==t).flatMap(e=>n(e.id,s)??[]),deletedEntityIds:t.entities.map(e=>e.id).filter(e=>!r.has(e)),sideEffects:a(l,i.resolveLocalizable),errors:[]}}return d("uncaught"===o.severity?[{type:"uncaught",entityId:null,message:o.error.message}]:o.entityViolations.filter(({violation:e})=>e.severity===o.severity).map(({entityId:e,violation:t})=>({type:t.type,entityId:e,message:void 0===t.message?null:i.resolveLocalizable(t.message)})))};export const createEntityMeta=(a,u)=>{let c=e=>()=>t(u.manifest,e,a.entity.type).flatMap(t=>{let i=o(e,t,a.entity.id,a.state,u.recipes);return i?[((e,t,i)=>{let{group:n,label:o,description:s,recipes:a}=e,{resolveLocalizable:u}=i.recipes;return{groupId:n.groupId,name:void 0===o?n.instanceName:u(o),description:n.description??(void 0===s?null:u(s)),recipes:a.map(n=>((e,t,i,n)=>{let{key:o,item:s}=e,{resolveLocalizable:a}=n.recipes;return{key:o,name:a(s.title),description:void 0===s.description?null:a(s.description),imageUrl:void 0===s.thumbnailUrl?null:a(s.thumbnailUrl),dryRun:()=>t.group.dryRuns?((e,t,i,n)=>{let{updates:o,error:s}=((e,t,{entity:i,state:n},{recipes:o})=>{try{return{updates:r(e,t,i.id,n,o),error:void 0}}catch(e){if("child"===t.target.kind)throw e;return{updates:void 0,error:e instanceof Error?e.message:String(e)}}})(e,t,i,n);return void 0===o?d([{type:"uncaught",entityId:null,message:s}]):l(o,i,n)})(e,t,i,n):null}})(n,e,t,i))}})(i,a,u)]:[]});return{...Object.fromEntries(e(u.manifest,a.entity.type).map(e=>[e.edgeName,()=>n(e,a.entity.id,a.state,u.recipes)?.map(t=>({...t,dryRun:()=>e.dryRuns?(({field:e},{value:t},r,n)=>{let{entity:o}=r,a=Object.entries(Object.entries(n.manifest.writableFields??{}).find(([e])=>e===o.type)?.[1]??{}).find(([t])=>t===e)?.[1];if(void 0===a)throw Error(`The options of "${e}" on "${o.id}" cannot be dry-run: the schema lists them, but the configurator has no writable field "${e}" on ${o.type}. This is a fault in the configurator, not in your request. Tell the user this is not available.`);let u=r.state.entities.find(e=>e.id===o.id);if(!u)throw Error(`The options of "${e}" on "${o.id}" cannot be dry-run: entity "${o.id}" does not exist. It may have been deleted by an earlier operation or field. Query the current entities and use an id they return.`);let c={[a]:t},p=n.validateEntity({...u,...c});return p.success?l([s.DomainEntityModification({entityId:o.id,stateDelta:c,updateTag:i})],r,n):d([{type:"uncaught",entityId:o.id,message:`Writing ${JSON.stringify(t)} to "${e}" would make "${o.id}" an invalid ${o.type}: ${p.errors.join("; ")}. The option comes from the configurator and cannot be corrected from here, so do not write it.`}])})(e,t,a,u):null}))??null])),childRecipes:c("child"),replaceRecipes:c("replace")}};
1
+ import{findAssistantFieldOptions as e,findAssistantRecipeGroups as t,modifyEntityUpdateTag as i,prepareAssistantRecipeUpdates as r,readAssistantFieldOptions as n,readAssistantRecipeGroup as o,systemUpdateFactory as a}from"#package/domain";import{readSideEffects as s}from"./side-effects.js";import{readEntityWarnings as d,readStateWarnings as l,readViolationEntries as c}from"./violations.js";let u=e=>({ok:!1,root:null,changedEntities:[],deletedEntityIds:[],sideEffects:[],warnings:[],errors:e}),p=(e,{state:t},{recipes:i,prepareStateEmission:r,find$Entity:n,validateState:o})=>{let{validity:a,state:d,updates:p}=r(e,t,"committed");if(a.valid){let e=new Map(t.entities.map(e=>[e.id,e])),r=new Set(d.entities.map(e=>e.id));return{ok:!0,root:n(d.rootEntityId,d),changedEntities:d.entities.filter(t=>e.get(t.id)!==t).flatMap(e=>n(e.id,d)??[]),deletedEntityIds:t.entities.map(e=>e.id).filter(e=>!r.has(e)),sideEffects:s(p,i.resolveLocalizable),warnings:()=>l(a,o(t),i.resolveLocalizable),errors:[]}}return u(c(a,i.resolveLocalizable))};export const createEntityMeta=(s,l)=>{let c=e=>()=>t(l.manifest,e,s.entity.type).flatMap(t=>{let i=o(e,t,s.entity.id,s.state,l.recipes);return i?[((e,t,i)=>{let{group:n,label:o,description:a,recipes:s}=e,{resolveLocalizable:d}=i.recipes;return{groupId:n.groupId,name:void 0===o?n.instanceName:d(o),description:n.description??(void 0===a?null:d(a)),recipes:s.map(n=>((e,t,i,n)=>{let{key:o,item:a}=e,{resolveLocalizable:s}=n.recipes;return{key:o,name:s(a.title),description:void 0===a.description?null:s(a.description),imageUrl:void 0===a.thumbnailUrl?null:s(a.thumbnailUrl),dryRun:()=>t.group.dryRuns?((e,t,i,n)=>{let{updates:o,error:a}=((e,t,{entity:i,state:n},{recipes:o})=>{try{return{updates:r(e,t,i.id,n,o),error:void 0}}catch(e){if("child"===t.target.kind)throw e;return{updates:void 0,error:e instanceof Error?e.message:String(e)}}})(e,t,i,n);return void 0===o?u([{type:"uncaught",entityId:null,message:a}]):p(o,i,n)})(e,t,i,n):null}})(n,e,t,i))}})(i,s,l)]:[]});return{...Object.fromEntries(e(l.manifest,s.entity.type).map(e=>[e.edgeName,()=>n(e,s.entity.id,s.state,l.recipes)?.map(t=>({...t,dryRun:()=>e.dryRuns?(({field:e},{value:t},r,n)=>{let{entity:o}=r,s=Object.entries(Object.entries(n.manifest.writableFields??{}).find(([e])=>e===o.type)?.[1]??{}).find(([t])=>t===e)?.[1];if(void 0===s)throw Error(`The options of "${e}" on "${o.id}" cannot be dry-run: the schema lists them, but the configurator has no writable field "${e}" on ${o.type}. This is a fault in the configurator, not in your request. Tell the user this is not available.`);let d=r.state.entities.find(e=>e.id===o.id);if(!d)throw Error(`The options of "${e}" on "${o.id}" cannot be dry-run: entity "${o.id}" does not exist. It may have been deleted by an earlier operation or field. Query the current entities and use an id they return.`);let l={[s]:t},c=n.validateEntity({...d,...l});return c.success?p([a.DomainEntityModification({entityId:o.id,stateDelta:l,updateTag:i})],r,n):u([{type:"uncaught",entityId:o.id,message:`Writing ${JSON.stringify(t)} to "${e}" would make "${o.id}" an invalid ${o.type}: ${c.errors.join("; ")}. The option comes from the configurator and cannot be corrected from here, so do not write it.`}])})(e,t,s,l):null}))??null])),childRecipes:c("child"),replaceRecipes:c("replace"),screenshot:({view:e})=>l.takeScreenshot(s,e),warnings:()=>d(s.entity.id,l.validateState(s.state),l.recipes.resolveLocalizable)}};
@@ -1,15 +1,36 @@
1
1
  import { type ExecutionResult } from 'graphql';
2
2
  import { type Localizable } from '@salsita-ai/common/utils';
3
- import { type $DomainEntity, type DomainContextSelectors, type DomainEntity, type DomainServicesSelectors, type DomainState, type SessionAssistantSetup, type SpecSelectors, type StateUpdateEmission } from '#package/domain';
3
+ import { type $DomainEntity, type AgentScreenshotComponent, type ComponentSnapshot, type DomainContextSelectors, type DomainEntity, type DomainServicesSelectors, type DomainState, type InitializationGeneration, type SessionAssistantSetup, type SpecSelectors, type StateUpdateEmission } from '#package/domain';
4
+ import { type AssistantWarning } from './violations.js';
4
5
  /** One single-operation GraphQL document with its own variables, as executed by {@link GraphQLSystem}. */
5
6
  export interface GraphQLOperation {
6
7
  readonly document: string;
7
8
  readonly variables?: Readonly<Record<string, unknown>>;
8
9
  readonly operationName?: string;
9
10
  }
11
+ /** A screenshot an operation took, under the label its `image` field returned. */
12
+ export interface GraphQLScreenshot {
13
+ readonly entityId: string;
14
+ readonly view: string;
15
+ /** The id the server stored the picture under, which the tool result references it by. */
16
+ readonly imageId: string;
17
+ }
10
18
  export interface GraphQLSystemContext {
11
19
  /** The assistant the initialized session runs: the operations are validated and executed against its schema. */
12
20
  readonly getAssistantSetup: () => SessionAssistantSetup;
21
+ /**
22
+ * Renders the picture an `agentScreenshot` component of a state declares, behind every export
23
+ * already queued, as a JPEG or PNG blob; `null` from an executor that renders no pictures. One of
24
+ * the two async steps of an execution, and the only one that needs a canvas.
25
+ */
26
+ readonly renderScreenshot: (component: ComponentSnapshot<AgentScreenshotComponent>, state: AnyDomainState) => Promise<Blob | null>;
27
+ /**
28
+ * Stores a rendered screenshot in the assistant thread on the server and resolves with the id the
29
+ * tool result references it by. The other async step of an execution, run right after each render.
30
+ */
31
+ readonly uploadScreenshot: (image: Blob) => Promise<{
32
+ readonly imageId: string;
33
+ }>;
13
34
  readonly specSelectors: SpecSelectors;
14
35
  readonly domainContextSelectors: DomainContextSelectors;
15
36
  readonly domainServicesSelectors: DomainServicesSelectors;
@@ -25,6 +46,8 @@ type AnyStateUpdateEmission = StateUpdateEmission<DomainEntity<string>, Record<s
25
46
  export interface PreparedOperation {
26
47
  readonly result: ExecutionResult;
27
48
  readonly emissions: readonly AnyStateUpdateEmission[];
49
+ /** The screenshots the operation took, by label, in the order they were taken. */
50
+ readonly screenshots: ReadonlyMap<string, GraphQLScreenshot>;
28
51
  }
29
52
  /**
30
53
  * What {@link GraphQLSystem.execute} returns: the results of the operations as prepared from the
@@ -39,12 +62,20 @@ export interface GraphQLExecution {
39
62
  readonly message?: string;
40
63
  /** What the configurator did, or would do, beyond what the operations asked for, in applied order. */
41
64
  readonly sideEffects: readonly string[];
65
+ /**
66
+ * The warnings and notices the prepared changes newly cause, whether or not they were committed:
67
+ * those of the prepared state that the state the operations started from did not have. Empty when
68
+ * nothing changed or an operation failed.
69
+ */
70
+ readonly warnings: readonly AssistantWarning[];
42
71
  /**
43
72
  * The state the operations prepared, when it was committed or held for the user's approval; a
44
73
  * held state is the one committed if the user approves. A caller can recognize its own change in
45
74
  * the undo history by it. It stays in the browser: nothing that leaves it may carry the state.
46
75
  */
47
76
  readonly preparedState?: AnyDomainState;
77
+ /** The screenshots the operations took, by the label their `image` field returned, in the order they were taken. */
78
+ readonly screenshots: ReadonlyMap<string, GraphQLScreenshot>;
48
79
  }
49
80
  /**
50
81
  * Resolves a localizable value, or each item of a list of them, to a string in the current locale.
@@ -73,10 +104,23 @@ export declare class GraphQLSystem {
73
104
  constructor(_context: GraphQLSystemContext);
74
105
  private readonly _get$Entity;
75
106
  private readonly _find$Entity;
107
+ private readonly _validateState;
108
+ private readonly _validateCached;
76
109
  private readonly _recipeContext;
77
110
  /** Root field resolvers, called by the executor with the field arguments and the operation context. */
78
111
  private readonly _rootValue;
79
112
  private readonly _resolveType;
113
+ private _generation;
114
+ /**
115
+ * The picture of an entity of a state from one `agentScreenshot` view, as a blob of the view's
116
+ * file format; `null` when the view is not attached to the entity there or nothing renders it.
117
+ */
118
+ private readonly _renderScreenshot;
119
+ /**
120
+ * Starts a new generation for a new configuration load. Screenshots wait on renders that take
121
+ * seconds, so an execution can outlive its configuration: one started under the ended generation
122
+ * renders no more screenshots and commits nothing, not even on a conflict retry.
123
+ */
80
124
  initialize: () => void;
81
125
  /**
82
126
  * Runs one mutation field against the working state: its implementation computes updates from the
@@ -87,6 +131,13 @@ export declare class GraphQLSystem {
87
131
  */
88
132
  private readonly _resolveMutation;
89
133
  private readonly _runMutation;
134
+ /**
135
+ * Takes a screenshot once every one asked for before it in the execution has been taken, so they
136
+ * render in document order, and uploads it as soon as it has rendered. A failure nulls only its
137
+ * own field and fails nothing else: the user kept changing the configuration, rendering failed,
138
+ * or the server did not store the picture.
139
+ */
140
+ private readonly _takeScreenshot;
90
141
  private readonly _setup;
91
142
  /**
92
143
  * Parses, validates and executes one operation document. Validation adds the rule against
@@ -98,21 +149,32 @@ export declare class GraphQLSystem {
98
149
  * Runs the operations in order through one working state that starts at `originalState`: a query
99
150
  * reads the current working state, and each mutation field advances it with its own emission.
100
151
  * The closing braces an operation's document left off are added, then the lenses it spreads are injected into it. Nothing is committed. The first operation that fails stops the list; every later one gets a
101
- * "not run" error instead.
152
+ * "not run" error instead. Screenshots render only while `generation`, the current one by
153
+ * default, is active.
102
154
  */
103
- prepare: (originalState: AnyDomainState, operations: readonly GraphQLOperation[]) => Promise<readonly PreparedOperation[]>;
155
+ prepare: (originalState: AnyDomainState, operations: readonly GraphQLOperation[], generation?: InitializationGeneration) => Promise<readonly PreparedOperation[]>;
104
156
  /**
105
157
  * The side effects of prepared operations: the hints of every update of their emissions, as the
106
158
  * agent is told them, in applied order.
107
159
  */
108
160
  readSideEffects: (prepared: readonly PreparedOperation[]) => readonly string[];
161
+ /** The screenshots of prepared operations, by label, in the order they were taken. */
162
+ readScreenshots: (prepared: readonly PreparedOperation[]) => ReadonlyMap<string, GraphQLScreenshot>;
163
+ /**
164
+ * The warnings and notices prepared operations newly cause: those of the state their last emission
165
+ * left that `originalState`, the state they were prepared from, did not have. Empty when nothing
166
+ * changed or an operation failed, so the original state is validated only for a change.
167
+ */
168
+ readWarnings: (originalState: AnyDomainState, prepared: readonly PreparedOperation[]) => readonly AssistantWarning[];
109
169
  private readonly _prepareAndCommit;
110
170
  /**
111
171
  * Prepares the operations from the committed state and commits their changes as one emission,
112
172
  * synthesized from every field emission of the list: one undo step, `onBeforeCommit` hooks run once. Nothing is committed when an operation fails or
113
173
  * none changes anything. When the committed state changed meanwhile, the operations are prepared
114
174
  * once more from the new committed state; their earlier updates are never replayed, since they
115
- * were computed from a state that is gone.
175
+ * were computed from a state that is gone. When another configuration was loaded meanwhile,
176
+ * nothing is committed or prepared again: the operations were written for the configuration
177
+ * that was left.
116
178
  */
117
179
  execute: (operations: readonly GraphQLOperation[]) => Promise<GraphQLExecution>;
118
180
  }
@@ -1 +1 @@
1
- import{GraphQLError as e,NoSchemaIntrospectionCustomRule as t,defaultFieldResolver as i,execute as o,getNamedType as n,parse as r,specifiedRules as a,validate as s,validateSchema as l}from"graphql";import{assertExistence as c,createSelector as d,isMessageDescriptor as h,isMultilingualString as u}from"@salsita-ai/common/utils";import{DomainEntityIdSchema as m,createAssistantExecutionSchema as f,findAssistantMutation as p}from"#package/domain";import{closeUnclosedBraces as g}from"./close-unclosed-braces.js";import{createEntityMeta as y}from"./entity-meta.js";import{injectAssistantLenses as v}from"./inject-assistant-lenses.js";import{readSideEffects as S}from"./side-effects.js";let _={errors:[new e("The configurator does not provide this request. This is a fault in the configurator, not in your request. Tell the user this is not available.")]},x={errors:[new e("The configuration is not loaded yet, so there is no state to query. Run the query again once the configurator has finished loading.")]},w=new RegExp(m.pattern),E=[...a,t],$=e=>"object"==typeof e&&null!==e&&"type"in e&&"string"==typeof e.type&&"id"in e&&"string"==typeof e.id,b=(e,t)=>"object"==typeof e&&null!==e?Reflect.get(e,t):void 0,T=e=>e instanceof Error?e.message:String(e),C=e=>/[.!?]$/.test(e)?e:`${e}.`,R=e=>"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.prototype,j=(e,t)=>{let i=R(e)?e._raw:void 0;if($(i))return i;if(!Array.isArray(e)&&!R(e))return e;if(t.has(e))throw Error("The value contains itself.");let o=new Set([...t,e]);return Array.isArray(e)?e.map(e=>j(e,o)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,j(t,o)]))};export const localize=(e,t)=>Array.isArray(e)?e.map(e=>localize(e,t)):"string"==typeof e||h(e)||u(e)?t(e):e;let A=t=>new e(`The configurator cannot handle this request: ${C(t)} This is a fault in the configurator, not in your request. Tell the user this is not available.`),M=e=>(e.errors?.length??0)>0,z=t=>({errors:[new e(`Not run: operation ${t+1} failed, so the operations after it were skipped and no change of the list takes effect. Fix the failing operation and send the whole list again.`)]});export class GraphQLSystem{_context;_selectSchema=d([d.leaf(e=>e)],e=>{try{let t=f(e),i=l(t);return i.length>0?A(i.map(e=>e.message).join(" ")):t}catch(e){return A(T(e))}});_selectLenses=d([d.leaf(e=>e)],e=>r(e));_selectFieldResolver=d([d.leaf(e=>e)],t=>(o,r,a,s)=>{if(s.parentType===s.schema.getQueryType())return i(o,r,a,s);if(s.parentType===s.schema.getMutationType())return this._resolveMutation(s.fieldName,String(s.path.key),r,a);if(!$(o))return i(o,r,a,s);if("meta"===s.fieldName){let e;return y({entity:o,state:("object"==typeof(e=b(o,"_state"))&&null!==e&&"entities"in e&&"rootEntityId"in e?e:void 0)??a.state},{manifest:a.manifest,recipes:this._recipeContext(),prepareStateEmission:(e,t,i)=>this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(e,t,i),find$Entity:(e,t)=>this._find$Entity(e,t),validateEntity:e=>this._context.domainContextSelectors.getDomain().validateEntity(e)})}let{source:l,localized:c}=t[s.parentType.name]?.[s.fieldName]??{source:s.fieldName},d=((t,i)=>{try{return b(t,i)}catch(o){throw new e(`Expression "${i}" failed on ${$(t)?t.id:"an entity"}: ${C(T(o))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:o instanceof Error?o:void 0})}})(o,l);return c?localize(d,this._context.domainServicesSelectors.getResolveLocalizable()):l.startsWith("$")&&"JSON"===n(s.returnType).name?((t,i,o)=>{try{return j(o,new Set)}catch(o){throw new e(`Expression "${i}" returned a value that is not plain serializable data on ${$(t)?t.id:"an entity"}: ${C(T(o))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:o instanceof Error?o:void 0})}})(o,l,d):d});constructor(e){this._context=e}_get$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().get$Entity(e,t);_find$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().getEntity(e,t)?this._get$Entity(e,t):null;_recipeContext=()=>({componentReader:this._context.domainContextSelectors.getComponentReader(),recipeCooker:this._context.domainContextSelectors.getRecipeCookerSystem(),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});_rootValue={root:(e,{state:t})=>this._get$Entity(t.rootEntityId,t),entities:({ids:t},{state:i})=>{if(null==t)return i.entities.map(e=>this._get$Entity(e.id,i));var o=i.rootEntityId;let n=t.filter(e=>!w.test(e));if(n.length>0)throw new e(`${n.map(e=>`"${e}"`).join(", ")} ${1===n.length?"is not an entity id":"are not entity ids"}. Entity ids have the form "<Type>-<number>", e.g. "${o}". Use ids as returned by the "id" field.`);return t.map(e=>w.test(e)?this._find$Entity(e,i):null)},selectedEntity:(e,{state:t})=>this._find$Entity(this._context.domainContextSelectors.getNavigationSystem().getActiveSelectionState(t),t),navigation:(e,{state:t})=>{let i=this._context.domainContextSelectors.getNavigationSystem();return{navigationState:i.getActiveNavigationState(t),viewState:i.getActiveViewState(t),toolState:i.getActiveToolState(t)}}};_resolveType=e=>$(e)?e.type:void 0;initialize=()=>{};_resolveMutation=(t,i,o,n)=>{if(void 0!==n.failedMutationField)throw new e(`Not run: the earlier field "${n.failedMutationField}" of this operation failed, so "${i}" was skipped and no change of the operation takes effect. Fix the failing field and send the operation again.`);try{return this._runMutation(t,o,n)}catch(e){throw n.failedMutationField=i,e}};_runMutation=(t,i,o)=>{let n=p(t,o.manifest);if(!n)throw new e(`The schema declares the mutation "${t}", but the configurator has no implementation for it. This is a fault in the configurator, not in your request. Tell the user this is not available.`);let r=o.state,a=n.implementation(i,r,{manifest:o.manifest,action:this._context.domainContextSelectors.getActionSystem().createContext(r),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});if(a.updates.length>0){let i=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(a.updates,r,"committed");if(!i.validity.valid)throw new e(`The changes of "${t}" were not applied, because the resulting configuration is invalid: ${(e=>{if("uncaught"===e.severity)return`validating it threw: ${C(T(e.error))}`;let t=[...new Set(e.entityViolations.filter(({violation:t})=>t.severity===e.severity).map(({entityId:e})=>e))];return`it has ${e.severity} violations on ${t.join(", ")}.`})(i.validity)} Change the request so the configuration stays valid.`);o.emissions.push(i),o.state=i.state}return a.readResult({previousState:r,state:o.state})};_setup=()=>{let{manifest:t,error:i}=this._context.getAssistantSetup();if(i)return{ready:!1,result:{errors:[new e(i.message,{originalError:i})]}};if(!t)return{ready:!1,result:_};let o=this._selectSchema(t.sdl);return o instanceof e?{ready:!1,result:{errors:[o]}}:{ready:!0,assistant:t,schema:o,lenses:t.lenses?.definitions?this._selectLenses(t.lenses.definitions):void 0,fieldResolver:this._selectFieldResolver(t.fields)}};_run=(t,i,n,a)=>{let l;try{l=r(t)}catch(t){return{errors:[t instanceof e?t:new e(T(t))]}}let c=s(n.schema,l,E);return c.length>0?{errors:c}:o({schema:n.schema,document:l,rootValue:this._rootValue,contextValue:a,variableValues:i.variables,operationName:i.operationName,fieldResolver:n.fieldResolver,typeResolver:this._resolveType})};prepare=async(t,i)=>{let o,n=this._setup();if(!n.ready)return i.map(()=>({result:n.result,emissions:[]}));let r={manifest:n.assistant,state:t,emissions:[],failedMutationField:void 0},a=[];for(let[t,s]of i.entries())if(void 0===o){let i=r.emissions.length;r.failedMutationField=void 0;let l=g(s.document),c=n.lenses?v(l,n.lenses):l,d=c instanceof e?{errors:[c]}:await this._run(c,s,n,r);a.push({result:d,emissions:r.emissions.slice(i)}),M(d)&&(o=t)}else a.push({result:z(o),emissions:[]});return a};readSideEffects=e=>{let t=this._context.domainServicesSelectors.getResolveLocalizable();return e.flatMap(({emissions:e})=>e.flatMap(e=>S(e.updates,t)))};_prepareAndCommit=async e=>{let t,i,o,n=this._context.domainContextSelectors.getStoreSystem(),r=await this.prepare(n.stateSlices.committed.value.state,e),a=r.map(({result:e})=>e),s=this.readSideEffects(r),l=r.flatMap(e=>e.emissions);if(a.some(M)||0===l.length)return{results:a,sideEffects:s,outcome:"none"};let d=(t=c(l[0]),i=c(l[l.length-1]),o=l.some(e=>void 0!==e.transformationLog),{kind:"committed",previousState:t.previousState,state:i.state,updates:l.flatMap(e=>e.updates),validity:i.validity,transformationLog:o?l.flatMap(e=>e.transformationLog??[]):void 0});return{results:a,sideEffects:s,outcome:n.commitPrepared(d),preparedState:d.state}};execute=async e=>{if(!this._context.domainContextSelectors.getStoreSystem().isInitialized)return{results:e.map(()=>x),committed:!1,sideEffects:[]};let t=await this._prepareAndCommit(e),{results:i,sideEffects:o,outcome:n,preparedState:r}="conflict"===t.outcome?await this._prepareAndCommit(e):t;return"committed"===n?{results:i,committed:!0,sideEffects:o,preparedState:r}:"held"===n?{results:i,committed:!1,message:"The changes wait for the user's approval and are not applied yet. Do not send them again; the next `[changes]` block lists them once approved.",sideEffects:o,preparedState:r}:"conflict"===n?{results:i,committed:!1,message:"The changes were not committed, because the configuration changed while they were being applied. The results describe a state that was discarded. Query the current configuration and send the operations again if they still make sense.",sideEffects:o}:{results:i,committed:!1,sideEffects:o}}}
1
+ import{GraphQLError as e,NoSchemaIntrospectionCustomRule as t,defaultFieldResolver as i,execute as n,getNamedType as o,parse as r,specifiedRules as a,validate as s,validateSchema as l}from"graphql";import{assertExistence as c,createSelector as h,isMessageDescriptor as d,isMultilingualString as u}from"@salsita-ai/common/utils";import{DomainEntityIdSchema as m,agentScreenshotComponent as f,createAssistantExecutionSchema as p,findAssistantMutation as g}from"#package/domain";import{ExportBusyError as v}from"../export-system/export-busy-error.js";import{closeUnclosedBraces as y}from"./close-unclosed-braces.js";import{createEntityMeta as S}from"./entity-meta.js";import{injectAssistantLenses as _}from"./inject-assistant-lenses.js";import{readSideEffects as w}from"./side-effects.js";import{ViolationsError as x,readStateWarnings as b,readViolationEntries as E}from"./violations.js";let $={errors:[new e("The configurator does not provide this request. This is a fault in the configurator, not in your request. Tell the user this is not available.")]},T={errors:[new e("The configuration is not loaded yet, so there is no state to query. Run the query again once the configurator has finished loading.")]},C="Not taken: another configuration was loaded while this request ran. Query the current configuration before asking for screenshots again.",M=new RegExp(m.pattern),R=[...a,t],j=e=>"object"==typeof e&&null!==e&&"type"in e&&"string"==typeof e.type&&"id"in e&&"string"==typeof e.id,k=(e,t)=>"object"==typeof e&&null!==e?Reflect.get(e,t):void 0,N=e=>e instanceof Error?e.message:String(e),A=e=>/[.!?]$/.test(e)?e:`${e}.`,z=e=>"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.prototype,L=(e,t)=>{let i=z(e)?e._raw:void 0;if(j(i))return i;if(!Array.isArray(e)&&!z(e))return e;if(t.has(e))throw Error("The value contains itself.");let n=new Set([...t,e]);return Array.isArray(e)?e.map(e=>L(e,n)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,L(t,n)]))};export const localize=(e,t)=>Array.isArray(e)?e.map(e=>localize(e,t)):"string"==typeof e||d(e)||u(e)?t(e):e;let q=t=>new e(`The configurator cannot handle this request: ${A(t)} This is a fault in the configurator, not in your request. Tell the user this is not available.`),O="SCREENSHOT_NOT_TAKEN",F=(t,i)=>new e(t,{originalError:i,extensions:{code:O}}),I=e=>(e.errors??[]).some(e=>e.extensions.code!==O),V=t=>({errors:[new e(`Not run: operation ${t+1} failed, so the operations after it were skipped and no change of the list takes effect. Fix the failing operation and send the whole list again.`)]});export class GraphQLSystem{_context;_selectSchema=h([h.leaf(e=>e)],e=>{try{let t=p(e),i=l(t);return i.length>0?q(i.map(e=>e.message).join(" ")):t}catch(e){return q(N(e))}});_selectLenses=h([h.leaf(e=>e)],e=>r(e));_selectFieldResolver=h([h.leaf(e=>e)],t=>(n,r,a,s)=>{if(s.parentType===s.schema.getQueryType())return i(n,r,a,s);if(s.parentType===s.schema.getMutationType())return this._resolveMutation(s.fieldName,String(s.path.key),r,a);if(!j(n))return i(n,r,a,s);if("meta"===s.fieldName){let e;return S({entity:n,state:("object"==typeof(e=k(n,"_state"))&&null!==e&&"entities"in e&&"rootEntityId"in e?e:void 0)??a.state},{manifest:a.manifest,recipes:this._recipeContext(),prepareStateEmission:(e,t,i)=>{let n=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(e,t,i);return a.validities.set(n.state,n.validity),n},find$Entity:(e,t)=>this._find$Entity(e,t),validateEntity:e=>this._context.domainContextSelectors.getDomain().validateEntity(e),takeScreenshot:(e,t)=>this._takeScreenshot(e,t,a),validateState:e=>this._validateCached(e,a)})}let{source:l,localized:c}=t[s.parentType.name]?.[s.fieldName]??{source:s.fieldName},h=((t,i)=>{try{return k(t,i)}catch(n){throw new e(`Expression "${i}" failed on ${j(t)?t.id:"an entity"}: ${A(N(n))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:n instanceof Error?n:void 0})}})(n,l);return c?localize(h,this._context.domainServicesSelectors.getResolveLocalizable()):l.startsWith("$")&&"JSON"===o(s.returnType).name?((t,i,n)=>{try{return L(n,new Set)}catch(n){throw new e(`Expression "${i}" returned a value that is not plain serializable data on ${j(t)?t.id:"an entity"}: ${A(N(n))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:n instanceof Error?n:void 0})}})(n,l,h):h});constructor(e){this._context=e}_get$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().get$Entity(e,t);_find$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().getEntity(e,t)?this._get$Entity(e,t):null;_validateState=e=>this._context.domainContextSelectors.getValidationProjections().validateState(e);_validateCached=(e,{validities:t})=>{let i=t.get(e);if(i)return i;let n=this._validateState(e);return t.set(e,n),n};_recipeContext=()=>({componentReader:this._context.domainContextSelectors.getComponentReader(),recipeCooker:this._context.domainContextSelectors.getRecipeCookerSystem(),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});_rootValue={warnings:(e,t)=>b(this._validateCached(t.state,t),void 0,this._context.domainServicesSelectors.getResolveLocalizable()),root:(e,{state:t})=>this._get$Entity(t.rootEntityId,t),entities:({ids:t},{state:i})=>{if(null==t)return i.entities.map(e=>this._get$Entity(e.id,i));var n=i.rootEntityId;let o=t.filter(e=>!M.test(e));if(o.length>0)throw new e(`${o.map(e=>`"${e}"`).join(", ")} ${1===o.length?"is not an entity id":"are not entity ids"}. Entity ids have the form "<Type>-<number>", e.g. "${n}". Use ids as returned by the "id" field.`);return t.map(e=>M.test(e)?this._find$Entity(e,i):null)},selectedEntity:(e,{state:t})=>this._find$Entity(this._context.domainContextSelectors.getNavigationSystem().getActiveSelectionState(t),t),navigation:(e,{state:t})=>{let i=this._context.domainContextSelectors.getNavigationSystem();return{navigationState:i.getActiveNavigationState(t),viewState:i.getActiveViewState(t),toolState:i.getActiveToolState(t)}}};_resolveType=e=>j(e)?e.type:void 0;_generation={active:!0};_renderScreenshot=async(e,t,i)=>{let n=this._context.domainContextSelectors.getComponentReader().readOneComponent({entityId:e,componentType:f,instanceName:t},i);if(!n)return null;let o=await this._context.renderScreenshot(n,i);return null===o?null:new Blob([o],{type:"JPEG"===n.state.fileFormat?"image/jpeg":"image/png"})};initialize=()=>{this._generation.active=!1,this._generation={active:!0}};_resolveMutation=(t,i,n,o)=>{if(void 0!==o.failedMutationField)throw new e(`Not run: the earlier field "${o.failedMutationField}" of this operation failed, so "${i}" was skipped and no change of the operation takes effect. Fix the failing field and send the operation again.`);try{return this._runMutation(t,n,o)}catch(e){throw o.failedMutationField=i,e}};_runMutation=(t,i,n)=>{let o=g(t,n.manifest);if(!o)throw new e(`The schema declares the mutation "${t}", but the configurator has no implementation for it. This is a fault in the configurator, not in your request. Tell the user this is not available.`);let r=n.state,a=o.implementation(i,r,{manifest:n.manifest,action:this._context.domainContextSelectors.getActionSystem().createContext(r),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});if(a.updates.length>0){let i=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(a.updates,r,"committed"),{validity:o}=i;if("uncaught"===o.severity)throw new e(`The changes of "${t}" were not applied, because the resulting configuration is invalid: validating it threw: ${A(N(o.error))} Change the request so the configuration stays valid.`,{originalError:o.error});if(!o.valid)throw new x(`The changes of "${t}" were not applied, because the resulting configuration has ${o.severity} violations.`,E(o,this._context.domainServicesSelectors.getResolveLocalizable()));n.emissions.push(i),n.validities.set(i.state,o),n.state=i.state}return a.readResult({previousState:r,state:n.state})};_takeScreenshot=({entity:t,state:i},n,o)=>{let r=o.manifest.screenshots?.[t.type]?.find(e=>e.view===n);if(!r)return Promise.reject(new e(`The schema declares the screenshot view "${n}" on ${t.type}, but the configurator has no view of that name. This is a fault in the configurator, not in your request. Tell the user this is not available.`));let a=o.lastScreenshot.then(async()=>{if(!o.generation.active)throw F(C);let e=await this._renderScreenshot(t.id,r.instanceName,i).catch(e=>{throw F(e instanceof v?"User made concurrent actions that prevented the screenshot from being taken, try again":`The screenshot of ${t.id} from "${n}" could not be taken: ${A(N(e))} Try again; if it fails again, tell the user the screenshot is not available.`,e instanceof Error?e:void 0)});if(!o.generation.active)throw F(C);if(null===e)return null;let{imageId:a}=await this._context.uploadScreenshot(e).catch(e=>{throw F(`The screenshot of ${t.id} from "${n}" was taken but could not be stored: ${A(N(e))} Try again; if it fails again, tell the user the screenshot is not available.`,e instanceof Error?e:void 0)}),s=`${t.id}/${n}`,l=[...o.screenshots.values()].filter(e=>e.entityId===t.id&&e.view===n).length,c=0===l?s:`${s}#${l+1}`;return o.screenshots.set(c,{entityId:t.id,view:n,imageId:a}),{image:c}});return o.lastScreenshot=a.catch(()=>void 0),a};_setup=()=>{let{manifest:t,error:i}=this._context.getAssistantSetup();if(i)return{ready:!1,result:{errors:[new e(i.message,{originalError:i})]}};if(!t)return{ready:!1,result:$};let n=this._selectSchema(t.sdl);return n instanceof e?{ready:!1,result:{errors:[n]}}:{ready:!0,assistant:t,schema:n,lenses:t.lenses?.definitions?this._selectLenses(t.lenses.definitions):void 0,fieldResolver:this._selectFieldResolver(t.fields)}};_run=async(t,i,o,a)=>{var l;let c;try{c=r(t)}catch(t){return{errors:[t instanceof e?t:new e(N(t))]}}let h=s(o.schema,c,R);return h.length>0?{errors:h}:(l=await n({schema:o.schema,document:c,rootValue:this._rootValue,contextValue:a,variableValues:i.variables,operationName:i.operationName,fieldResolver:o.fieldResolver,typeResolver:this._resolveType}),l.errors?.some(e=>e.originalError instanceof x)?{...l,errors:l.errors.flatMap(t=>t.originalError instanceof x?t.originalError.entries.map(({type:i,entityId:n,message:o})=>new e(o??i,{nodes:t.nodes,source:t.source,positions:t.positions,path:t.path,extensions:{code:"VIOLATION",type:i,entityId:n}})):[t])}:l)};prepare=async(t,i,n=this._generation)=>{let o,r=this._setup();if(!r.ready)return i.map(()=>({result:r.result,emissions:[],screenshots:new Map}));let a={manifest:r.assistant,state:t,emissions:[],failedMutationField:void 0,screenshots:new Map,lastScreenshot:Promise.resolve(),generation:n,validities:new WeakMap},s=[];for(let[t,n]of i.entries())if(void 0===o){let i=a.emissions.length,l=a.screenshots.size;a.failedMutationField=void 0;let c=y(n.document),h=r.lenses?_(c,r.lenses):c,d=h instanceof e?{errors:[h]}:await this._run(h,n,r,a);await a.lastScreenshot,s.push({result:d,emissions:a.emissions.slice(i),screenshots:new Map([...a.screenshots].slice(l))}),I(d)&&(o=t)}else s.push({result:V(o),emissions:[],screenshots:new Map});return s};readSideEffects=e=>{let t=this._context.domainServicesSelectors.getResolveLocalizable();return e.flatMap(({emissions:e})=>e.flatMap(e=>w(e.updates,t)))};readScreenshots=e=>new Map(e.flatMap(({screenshots:e})=>[...e]));readWarnings=(e,t)=>{let i=t.flatMap(({emissions:e})=>e).at(-1);return void 0===i||t.some(({result:e})=>I(e))?[]:b(i.validity,this._validateState(e),this._context.domainServicesSelectors.getResolveLocalizable())};_prepareAndCommit=async(e,t)=>{let i,n,o,r=this._context.domainContextSelectors.getStoreSystem(),a=r.stateSlices.committed.value.state,s=await this.prepare(a,e,t),l=s.map(({result:e})=>e),h=this.readSideEffects(s),d=this.readScreenshots(s),u=s.flatMap(e=>e.emissions);if(!t.active)return{results:l,sideEffects:h,screenshots:d,warnings:[],outcome:"conflict"};if(l.some(I)||0===u.length)return{results:l,sideEffects:h,screenshots:d,warnings:[],outcome:"none"};let m=(i=c(u[0]),n=c(u[u.length-1]),o=u.some(e=>void 0!==e.transformationLog),{kind:"committed",previousState:i.previousState,state:n.state,updates:u.flatMap(e=>e.updates),validity:n.validity,transformationLog:o?u.flatMap(e=>e.transformationLog??[]):void 0});return{results:l,sideEffects:h,screenshots:d,warnings:this.readWarnings(a,s),outcome:r.commitPrepared(m),preparedState:m.state}};execute=async e=>{let t=this._generation;if(!this._context.domainContextSelectors.getStoreSystem().isInitialized)return{results:e.map(()=>T),committed:!1,sideEffects:[],warnings:[],screenshots:new Map};let i=await this._prepareAndCommit(e,t),{results:n,sideEffects:o,warnings:r,screenshots:a,outcome:s,preparedState:l}="conflict"===i.outcome&&t.active?await this._prepareAndCommit(e,t):i;return"committed"===s?{results:n,committed:!0,sideEffects:o,warnings:r,screenshots:a,preparedState:l}:"held"===s?{results:n,committed:!1,message:"The changes wait for the user's approval and are not applied yet. Do not send them again; the next `[changes]` block lists them once approved.",sideEffects:o,warnings:r,screenshots:a,preparedState:l}:"conflict"===s?{results:n,committed:!1,message:"The changes were not committed, because the configuration changed while they were being applied. The results describe a state that was discarded. Query the current configuration and send the operations again if they still make sense.",sideEffects:o,warnings:r,screenshots:a}:{results:n,committed:!1,sideEffects:o,warnings:r,screenshots:a}}}
@@ -0,0 +1,40 @@
1
+ import type { Localizable } from '@salsita-ai/common/utils';
2
+ import type { DomainEntity, EntityId, StateValidationResult } from '#package/domain';
3
+ type AnyStateValidationResult = StateValidationResult<DomainEntity<string>, string>;
4
+ /** One violation that makes a change fail, as the agent reads it; a violation can sit on a virtual entity. */
5
+ export interface ViolationEntry {
6
+ readonly type: string;
7
+ readonly entityId: EntityId | null;
8
+ readonly message: string | null;
9
+ }
10
+ /** One warning or notice, which never makes a change fail. */
11
+ export interface AssistantWarning {
12
+ readonly type: string;
13
+ readonly severity: 'warning' | 'notice';
14
+ readonly entityId: EntityId | null;
15
+ readonly message: string | null;
16
+ }
17
+ /**
18
+ * Thrown by a mutation field whose changes would leave the configuration invalid. graphql-js reports
19
+ * one error per failed field, so the field throws this one error and the executor's caller replaces
20
+ * it with one GraphQL error per violation.
21
+ */
22
+ export declare class ViolationsError extends Error {
23
+ readonly entries: readonly ViolationEntry[];
24
+ constructor(message: string, entries: readonly ViolationEntry[]);
25
+ }
26
+ /**
27
+ * The violations an invalid validity fails on: those of its failing severity, or the one error that
28
+ * validation threw.
29
+ */
30
+ export declare const readViolationEntries: (validity: Extract<AnyStateValidationResult, {
31
+ readonly valid: false;
32
+ }>, resolveLocalizable: (message: Localizable) => string) => readonly ViolationEntry[];
33
+ /**
34
+ * The warnings and notices of `after` that `before` did not have, in the order of `after`; every one
35
+ * of `after` when there is no `before`.
36
+ */
37
+ export declare const readStateWarnings: (after: AnyStateValidationResult, before: AnyStateValidationResult | undefined, resolveLocalizable: (message: Localizable) => string) => readonly AssistantWarning[];
38
+ /** The warnings and notices of a validity that are on one entity, in the order of the validity. */
39
+ export declare const readEntityWarnings: (entityId: EntityId, validity: AnyStateValidationResult, resolveLocalizable: (message: Localizable) => string) => readonly AssistantWarning[];
40
+ export {};