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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (573) hide show
  1. package/README.md +1 -1
  2. package/dist/application/index.d.ts +1 -0
  3. package/dist/application/index.js +1 -1
  4. package/dist/application/mount-application.d.ts +1 -1
  5. package/dist/application/mount-application.js +1 -1
  6. package/dist/application/mount-configurator.d.ts +19 -0
  7. package/dist/application/mount-configurator.js +1 -0
  8. package/dist/application/mounted-application-runtime.d.ts +4 -0
  9. package/dist/application/mounted-application-runtime.js +1 -0
  10. package/dist/application/register-web-component.d.ts +2 -0
  11. package/dist/application/register-web-component.js +1 -0
  12. package/dist/application-spec/core/enhanced-json-value.d.ts +2 -31
  13. package/dist/application-spec/core/enhanced-json-value.js +1 -1
  14. package/dist/application-spec/core/index.d.ts +1 -3
  15. package/dist/application-spec/core/index.js +1 -1
  16. package/dist/application-spec/core/json-schema.d.ts +2 -52
  17. package/dist/application-spec/core/markers/index.d.ts +1 -1
  18. package/dist/application-spec/core/markers/index.js +1 -1
  19. package/dist/application-spec/core/markers/msg-marker.d.ts +2 -28
  20. package/dist/application-spec/core/markers/msg-marker.js +1 -1
  21. package/dist/application-spec/core/markers/raw-eval-write-marker.d.ts +1 -1
  22. package/dist/application-spec/core/markers/raw-eval-write-marker.js +1 -1
  23. package/dist/application-spec/core/markers/raw-read-write-marker.js +1 -1
  24. package/dist/application-spec/errors/diagnostic-codes.d.ts +1 -0
  25. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  26. package/dist/application-spec/errors/diagnostic-messages.d.ts +1 -0
  27. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  28. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  29. package/dist/application-spec/generate-application/code/templates/index.d.ts +2 -6
  30. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  31. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.d.ts +10 -0
  32. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +7 -0
  33. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  34. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +12 -6
  35. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +1 -1
  36. package/dist/application-spec/generate-application/implementations/phx-application-types.d.ts +25 -0
  37. package/dist/application-spec/generate-application/implementations/phx-application-types.js +1 -0
  38. package/dist/application-spec/generate-application/implementations/phx-domain.d.ts +36 -0
  39. package/dist/application-spec/generate-application/implementations/phx-domain.js +1 -0
  40. package/dist/application-spec/generate-application/implementations/phx-model.d.ts +24 -0
  41. package/dist/application-spec/generate-application/implementations/phx-model.js +1 -0
  42. package/dist/application-spec/generate-application/implementations/phx.d.ts +22 -0
  43. package/dist/application-spec/generate-application/implementations/phx.js +1 -0
  44. package/dist/application-spec/generate-application/index.d.ts +2 -0
  45. package/dist/application-spec/generate-application/index.js +1 -1
  46. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +3 -4
  47. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +7 -4
  48. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
  49. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.d.ts +16 -0
  50. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.js +1 -0
  51. package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +17 -4
  52. package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
  53. package/dist/application-spec/generate-application/runtime/application-spec-slice.d.ts +71 -0
  54. package/dist/application-spec/generate-application/runtime/application-spec-slice.js +1 -0
  55. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +3 -4
  56. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +7 -5
  57. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
  58. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.d.ts +16 -0
  59. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.js +1 -0
  60. package/dist/application-spec/generate-application/runtime/create-application.d.ts +57 -0
  61. package/dist/application-spec/generate-application/runtime/create-application.js +1 -0
  62. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +2 -2
  63. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.d.ts +1 -1
  64. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +1 -1
  65. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +1 -1
  66. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +1 -1
  67. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.d.ts +1 -1
  68. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.js +1 -1
  69. package/dist/application-spec/generate-application/runtime/index.d.ts +8 -0
  70. package/dist/application-spec/generate-application/runtime/index.js +1 -0
  71. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +1 -1
  72. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
  73. package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.d.ts +1 -1
  74. package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +1 -2
  75. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +9 -4
  76. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
  77. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +1 -2
  78. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.js +1 -1
  79. package/dist/application-spec/generate-application/runtime/sections/preset-runtime.d.ts +2 -3
  80. package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +1 -1
  81. package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.d.ts +1 -1
  82. package/dist/application-spec/generate-application/runtime/spec-runtime.d.ts +21 -0
  83. package/dist/application-spec/generate-application/runtime/spec-runtime.js +1 -0
  84. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.d.ts +3 -2
  85. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +44 -9
  86. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.js +1 -1
  87. package/dist/application-spec/generate-application/runtime-spec/spec-code-id.d.ts +1 -1
  88. package/dist/application-spec/parse-application-files/parse-application-files.js +1 -1
  89. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.d.ts +1 -1
  90. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.js +1 -1
  91. package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding.d.ts +3 -13
  92. package/dist/application-spec/parse-application-files/spec/components/bindings/write-binding.d.ts +4 -32
  93. package/dist/application-spec/parse-application-files/spec/components/component-filter.d.ts +4 -10
  94. package/dist/application-spec/parse-application-files/spec/components/components.d.ts +3 -4
  95. package/dist/application-spec/parse-application-files/spec/components/index.d.ts +1 -2
  96. package/dist/application-spec/parse-application-files/spec/components/index.js +1 -1
  97. package/dist/application-spec/parse-application-files/spec/components/sdk-component-entry.d.ts +1 -1
  98. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.d.ts +2 -3
  99. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.js +1 -1
  100. package/dist/application-spec/parse-application-files/spec/components/user-components.d.ts +2 -3
  101. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +2 -2
  102. package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +7 -29
  103. package/dist/application-spec/parse-application-files/spec/expressions/index.d.ts +0 -1
  104. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.d.ts +4 -71
  105. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.js +1 -1
  106. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts +2 -2
  107. package/dist/application-spec/parse-application-files/spec/model/aliases.d.ts +3 -9
  108. package/dist/application-spec/parse-application-files/spec/model/common-types.d.ts +6 -14
  109. package/dist/application-spec/parse-application-files/spec/model/defaults.d.ts +6 -31
  110. package/dist/application-spec/parse-application-files/spec/model/entity-types.d.ts +3 -8
  111. package/dist/application-spec/parse-application-files/spec/model/model-version-key.d.ts +3 -3
  112. package/dist/application-spec/parse-application-files/spec/model/names/action-name.d.ts +3 -7
  113. package/dist/application-spec/parse-application-files/spec/model/names/alias-name.d.ts +3 -7
  114. package/dist/application-spec/parse-application-files/spec/model/names/entity-or-alias-name.d.ts +3 -8
  115. package/dist/application-spec/parse-application-files/spec/model/names/entity-type-name.d.ts +3 -8
  116. package/dist/application-spec/parse-application-files/spec/model/names/expression-name.d.ts +3 -6
  117. package/dist/application-spec/parse-application-files/spec/model/names/instance-name.d.ts +3 -7
  118. package/dist/application-spec/parse-application-files/spec/model/names/invariant-name.d.ts +3 -3
  119. package/dist/application-spec/parse-application-files/spec/model/names/shape-property-name.d.ts +3 -11
  120. package/dist/application-spec/parse-application-files/spec/model/names/violation-type-name.d.ts +3 -3
  121. package/dist/application-spec/parse-application-files/spec/model/presets.d.ts +6 -29
  122. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  123. package/dist/client/authorized-client.d.ts +3 -1
  124. package/dist/client/authorized-client.js +1 -1
  125. package/dist/client/contract.d.ts +17 -0
  126. package/dist/client/index.d.ts +1 -1
  127. package/dist/client/local-authorized-client.d.ts +3 -1
  128. package/dist/client/local-authorized-client.js +1 -1
  129. package/dist/client/memory-authorized-client.d.ts +4 -1
  130. package/dist/client/memory-authorized-client.js +1 -1
  131. package/dist/client/phoenix-api.d.ts +228 -0
  132. package/dist/configurator/ConfiguratorApp.js +1 -1
  133. package/dist/configurator/app-loader-content/index.d.ts +0 -1
  134. package/dist/configurator/app-loader-content/index.js +1 -1
  135. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  136. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +17 -3
  137. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  138. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +42 -9
  139. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  140. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +15 -10
  141. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  142. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +30 -9
  143. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  144. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.d.ts +40 -0
  145. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.js +1 -0
  146. package/dist/configurator/common/configurator-interface.d.ts +9 -6
  147. package/dist/configurator/common/configurator-interface.js +1 -1
  148. package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.d.ts +5 -0
  149. package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.js +1 -0
  150. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.d.ts +0 -6
  151. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.js +1 -1
  152. package/dist/configurator/configuration-not-found-page/index.d.ts +2 -2
  153. package/dist/configurator/configuration-not-found-page/index.js +1 -1
  154. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.d.ts +3 -3
  155. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.js +1 -1
  156. package/dist/configurator/configurator-context/PresetSelectionProvider.js +1 -1
  157. package/dist/configurator/configurator-context/PreviewContextProvider.js +1 -1
  158. package/dist/configurator/configurator-context/configurator-hooks/index.d.ts +0 -1
  159. package/dist/configurator/configurator-context/configurator-hooks/index.js +1 -1
  160. package/dist/configurator/configurator-context/index.d.ts +0 -4
  161. package/dist/configurator/configurator-context/index.js +1 -1
  162. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.d.ts +3 -3
  163. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.js +1 -1
  164. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.d.ts +0 -5
  165. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.js +1 -1
  166. package/dist/configurator/configurator-error-page/index.d.ts +1 -2
  167. package/dist/configurator/configurator-error-page/index.js +1 -1
  168. package/dist/configurator/index.d.ts +9 -2
  169. package/dist/configurator/index.js +1 -1
  170. package/dist/configurator/pages/ConfiguratorNotFoundPage.js +1 -1
  171. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  172. package/dist/configurator/pages/default-configurator-elements.js +1 -1
  173. package/dist/configurator/pages/error-boundaries/DevContextFallback.js +1 -1
  174. package/dist/configurator/pages/error-boundaries/DevLoadingFallback.js +1 -1
  175. package/dist/configurator/pages/error-boundaries/LoadingErrorBoundary.js +1 -1
  176. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  177. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.d.ts +1 -1
  178. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -1
  179. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +12 -4
  180. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -1
  181. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +8 -0
  182. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -0
  183. package/dist/configurator/ui/assistant/tool-chip.d.ts +15 -5
  184. package/dist/configurator/ui/assistant/tool-chip.js +1 -1
  185. package/dist/configurator/ui/configurator-layout/slots/canvas/GPUAccelerationDisabled.js +1 -1
  186. package/dist/configurator/ui/configurator-layout/slots/canvas/LayoutCanvas.js +1 -1
  187. package/dist/configurator/ui/configurator-layout/slots/canvas/SharedCanvas.js +1 -1
  188. package/dist/configurator/ui/configurator-layout/slots/canvas/WebGLNotSupported.js +1 -1
  189. package/dist/configurator/ui/configurator-layout/slots/readonly-banner/CloneToEditDialog.js +1 -1
  190. package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.js +1 -1
  191. package/dist/configurator/ui/legacy/chat/MobileChat.js +1 -1
  192. package/dist/configurator/ui/legacy/layout/common/CommonTopNavigation.js +1 -1
  193. package/dist/configurator/ui/legacy/layout/common/ReactiveInterfaceLayout.js +1 -1
  194. package/dist/configurator/ui/legacy/layout/simple/SimpleSidebar.js +1 -1
  195. package/dist/configurator/ui/legacy/layout/simple/SimpleTopNavigation.js +1 -1
  196. package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.js +1 -1
  197. package/dist/configurator/ui/legacy/layout/steps/StepsOwnerLayout.js +1 -1
  198. package/dist/configurator/ui/legacy/layout/steps/StepsSideBar.js +1 -1
  199. package/dist/configurator/ui/legacy/layout/tabs/TabsSidebar.js +1 -1
  200. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.d.ts +0 -7
  201. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.js +2 -2
  202. package/dist/configurator/ui/phoenix-layout-elements/header/common/back-button/use-go-back-action.js +1 -1
  203. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.js +1 -1
  204. package/dist/configurator/ui/phoenix-layout-elements/index.d.ts +8 -1
  205. package/dist/configurator/ui/phoenix-layout-elements/index.js +1 -1
  206. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/PreviousStepButton.js +1 -1
  207. package/dist/configurator/ui/preset-layout/PresetUi.d.ts +0 -2
  208. package/dist/configurator/ui/preset-layout/PresetUi.js +1 -1
  209. package/dist/configurator/ui/preset-layout/index.d.ts +6 -1
  210. package/dist/configurator/ui/preset-layout/index.js +1 -1
  211. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -1
  212. package/dist/docs/3d-scene/cameras/custom.mdx +4 -2
  213. package/dist/docs/index.json +78 -1
  214. package/dist/docs/integrations/webcomponent-api/basics.mdx +2 -0
  215. package/dist/docs/layouts/custom-layout.mdx +318 -158
  216. package/dist/docs/layouts/gallery/ardent-compressor.mdx +3516 -0
  217. package/dist/docs/layouts/gallery/corvid-drone.mdx +3428 -0
  218. package/dist/docs/layouts/gallery/fenwick-window.mdx +2803 -0
  219. package/dist/docs/layouts/gallery/ferrule-bar-station.mdx +6567 -0
  220. package/dist/docs/layouts/gallery/nightjar-guitar.mdx +3698 -0
  221. package/dist/docs/layouts/gallery/sunfold-solar.mdx +2683 -0
  222. package/dist/docs/layouts/gallery/tidepool-aquascape.mdx +5203 -0
  223. package/dist/docs/phoenix/configurator-interface.mdx +8 -6
  224. package/dist/docs/phoenix/domain-model.mdx +4 -1
  225. package/dist/docs/phoenix/phoenix-cli.mdx +14 -6
  226. package/dist/docs/phoenix/project-structure.mdx +21 -17
  227. package/dist/docs/phoenix/sdk-builder-workflow.mdx +6 -4
  228. package/dist/docs/phoenix/sessions-and-access.mdx +2 -0
  229. package/dist/docs/phoenix/webhooks.mdx +5 -1
  230. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +2 -0
  231. package/dist/domain/application/assistant/build-assistant-lenses.js +3 -3
  232. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  233. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  234. package/dist/domain/application/configurator-builder.d.ts +7 -1
  235. package/dist/domain/application/configurator-builder.js +1 -1
  236. package/dist/domain/application/index.d.ts +1 -1
  237. package/dist/domain/application/index.js +1 -1
  238. package/dist/domain/application/standard-properties.js +1 -1
  239. package/dist/domain/application/web-component-property.d.ts +3 -1
  240. package/dist/domain/application/web-component-property.js +1 -1
  241. package/dist/domain/domain-builder.d.ts +9 -3
  242. package/dist/domain/domain-builder.js +1 -1
  243. package/dist/domain/domain-runtime/application.d.ts +39 -0
  244. package/dist/domain/domain-runtime/application.js +1 -0
  245. package/dist/domain/domain-runtime/domain-context/selectors.d.ts +1 -0
  246. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  247. package/dist/domain/domain-runtime/domain-runtime.d.ts +40 -4
  248. package/dist/domain/domain-runtime/domain-runtime.js +1 -1
  249. package/dist/domain/domain-runtime/environment/initialize.d.ts +1 -1
  250. package/dist/domain/domain-runtime/errors/implementation-error-collector.d.ts +2 -0
  251. package/dist/domain/domain-runtime/errors/implementation-error-collector.js +1 -1
  252. package/dist/domain/domain-runtime/index.d.ts +2 -1
  253. package/dist/domain/domain-runtime/index.js +1 -1
  254. package/dist/domain/domain-runtime/spec/index.d.ts +1 -1
  255. package/dist/domain/domain-runtime/spec/index.js +1 -1
  256. package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +1 -0
  257. package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
  258. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.d.ts +23 -0
  259. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.js +1 -0
  260. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.d.ts +3 -4
  261. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.js +1 -1
  262. package/dist/domain/domain-runtime/web-component/actions.d.ts +3 -0
  263. package/dist/domain/domain-runtime/web-component/actions.js +1 -1
  264. package/dist/domain/domain-runtime/web-component/initialize.d.ts +1 -0
  265. package/dist/domain/domain-runtime/web-component/initialize.js +1 -1
  266. package/dist/domain/domain-runtime/web-component/selectors.d.ts +2 -0
  267. package/dist/domain/domain-runtime/web-component/selectors.js +1 -1
  268. package/dist/domain/domain-runtime/web-component/types.d.ts +6 -3
  269. package/dist/domain/index.d.ts +1 -0
  270. package/dist/domain/index.js +1 -1
  271. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +7 -0
  272. package/dist/domain/spec/application/index.d.ts +1 -0
  273. package/dist/domain/spec/application/index.js +1 -0
  274. package/dist/domain/spec/components/bindings/index.d.ts +2 -0
  275. package/dist/domain/spec/components/bindings/read-binding.d.ts +13 -0
  276. package/dist/domain/spec/components/bindings/write-binding.d.ts +32 -0
  277. package/dist/{application-spec/parse-application-files → domain}/spec/components/component-entry.d.ts +3 -3
  278. package/dist/{application-spec/core → domain/spec}/components/component-filter.d.ts +3 -2
  279. package/dist/domain/spec/components/component-filters.d.ts +10 -0
  280. package/dist/domain/spec/components/components.d.ts +4 -0
  281. package/dist/domain/spec/components/components.js +1 -0
  282. package/dist/domain/spec/components/index.d.ts +6 -0
  283. package/dist/domain/spec/enhanced-json-value.d.ts +30 -0
  284. package/dist/domain/spec/enhanced-json-value.js +1 -0
  285. package/dist/{application-spec/parse-application-files → domain}/spec/expressions/expression.d.ts +9 -3
  286. package/dist/domain/spec/expressions/expression.js +1 -0
  287. package/dist/domain/spec/expressions/expressions.d.ts +27 -0
  288. package/dist/domain/spec/expressions/expressions.js +1 -0
  289. package/dist/domain/spec/expressions/index.d.ts +5 -0
  290. package/dist/domain/spec/expressions/memo-eval-plan.d.ts +70 -0
  291. package/dist/domain/spec/expressions/memo-eval-plan.js +1 -0
  292. package/dist/domain/spec/expressions/relation-expression-params.js +1 -0
  293. package/dist/domain/spec/index.d.ts +7 -0
  294. package/dist/domain/spec/index.js +1 -0
  295. package/dist/domain/spec/json-schema.d.ts +52 -0
  296. package/dist/domain/spec/json-schema.js +1 -0
  297. package/dist/domain/spec/markers/index.d.ts +3 -0
  298. package/dist/domain/spec/markers/index.js +1 -0
  299. package/dist/domain/spec/markers/msg-marker.d.ts +28 -0
  300. package/dist/domain/spec/markers/msg-marker.js +1 -0
  301. package/dist/domain/spec/model/aliases.d.ts +9 -0
  302. package/dist/domain/spec/model/aliases.js +1 -0
  303. package/dist/domain/spec/model/common-types.d.ts +15 -0
  304. package/dist/domain/spec/model/common-types.js +1 -0
  305. package/dist/domain/spec/model/defaults.d.ts +33 -0
  306. package/dist/domain/spec/model/defaults.js +1 -0
  307. package/dist/domain/spec/model/entity-types.d.ts +8 -0
  308. package/dist/domain/spec/model/entity-types.js +1 -0
  309. package/dist/domain/spec/model/index.d.ts +7 -0
  310. package/dist/domain/spec/model/index.js +1 -0
  311. package/dist/domain/spec/model/model-version-key.d.ts +3 -0
  312. package/dist/domain/spec/model/model-version-key.js +1 -0
  313. package/dist/domain/spec/model/names/action-name.d.ts +7 -0
  314. package/dist/domain/spec/model/names/action-name.js +1 -0
  315. package/dist/domain/spec/model/names/alias-name.d.ts +7 -0
  316. package/dist/domain/spec/model/names/alias-name.js +1 -0
  317. package/dist/domain/spec/model/names/entity-or-alias-name.d.ts +8 -0
  318. package/dist/domain/spec/model/names/entity-or-alias-name.js +1 -0
  319. package/dist/domain/spec/model/names/entity-type-name.d.ts +8 -0
  320. package/dist/domain/spec/model/names/entity-type-name.js +1 -0
  321. package/dist/domain/spec/model/names/expression-name.d.ts +6 -0
  322. package/dist/domain/spec/model/names/expression-name.js +1 -0
  323. package/dist/domain/spec/model/names/index.d.ts +9 -0
  324. package/dist/domain/spec/model/names/index.js +1 -0
  325. package/dist/domain/spec/model/names/instance-name.d.ts +7 -0
  326. package/dist/domain/spec/model/names/instance-name.js +1 -0
  327. package/dist/domain/spec/model/names/invariant-name.d.ts +3 -0
  328. package/dist/domain/spec/model/names/invariant-name.js +1 -0
  329. package/dist/domain/spec/model/names/shape-property-name.d.ts +11 -0
  330. package/dist/domain/spec/model/names/shape-property-name.js +1 -0
  331. package/dist/domain/spec/model/names/violation-type-name.d.ts +3 -0
  332. package/dist/domain/spec/model/names/violation-type-name.js +1 -0
  333. package/dist/domain/spec/model/presets.d.ts +30 -0
  334. package/dist/domain/spec/model/presets.js +1 -0
  335. package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
  336. package/dist/editor/domain-editors/apply-spec-update.d.ts +2 -1
  337. package/dist/editor/domain-editors/apply-spec-update.js +1 -1
  338. package/dist/editor/domain-editors/use-implementation-files.d.ts +6 -14
  339. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  340. package/dist/editor/graphql/GraphQLPanel.js +1 -1
  341. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  342. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  343. package/dist/legacy/domain-spec/spec/domain-spec.js +1 -1
  344. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
  345. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
  346. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
  347. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +11 -5
  348. package/dist/phoenix/application-spec/generate-application-spec-project.d.ts +1 -0
  349. package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
  350. package/dist/phoenix/application-spec/generate-project-files.d.ts +1 -0
  351. package/dist/phoenix/application-spec/index.d.ts +1 -0
  352. package/dist/phoenix/application-spec/index.js +1 -1
  353. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +11 -0
  354. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  355. package/dist/phoenix/bin.js +1 -1
  356. package/dist/phoenix/cli.js +1 -1
  357. package/dist/phoenix/commands/build.js +1 -1
  358. package/dist/phoenix/commands/clean.js +1 -1
  359. package/dist/phoenix/commands/deploy.js +1 -1
  360. package/dist/phoenix/commands/dev.js +5 -5
  361. package/dist/phoenix/commands/generated-env-markers.d.ts +1 -0
  362. package/dist/phoenix/commands/generated-env-markers.js +1 -1
  363. package/dist/phoenix/commands/index.d.ts +1 -1
  364. package/dist/phoenix/commands/index.js +1 -1
  365. package/dist/phoenix/commands/sync.js +1 -1
  366. package/dist/phoenix/lingui/index.d.ts +1 -0
  367. package/dist/phoenix/lingui/index.js +1 -0
  368. package/dist/phoenix/{services → lingui}/lingui.d.ts +5 -2
  369. package/dist/phoenix/lingui/lingui.js +1 -0
  370. package/dist/phoenix/services/application-spec-project-watcher.d.ts +3 -1
  371. package/dist/phoenix/services/application-spec-project-watcher.js +2 -2
  372. package/dist/phoenix/services/index.d.ts +1 -0
  373. package/dist/phoenix/services/index.js +1 -1
  374. package/dist/phoenix/services/lingui-watcher.js +1 -1
  375. package/dist/phoenix/services/prepare-development-environment.js +1 -1
  376. package/dist/phoenix/services/vite-config.js +1 -1
  377. package/dist/react-sdk/application-runtime/common-services/analytics/analytics-service.d.ts +1 -1
  378. package/dist/react-sdk/application-runtime/common-services/initialize.d.ts +2 -2
  379. package/dist/react-sdk/application-runtime/domain-application-context/chat-system.d.ts +1 -1
  380. package/dist/react-sdk/application-runtime/hooks/index.d.ts +2 -0
  381. package/dist/react-sdk/application-runtime/hooks/index.js +1 -1
  382. package/dist/react-sdk/application-runtime/hooks/loading/index.d.ts +5 -0
  383. package/dist/react-sdk/application-runtime/hooks/loading/index.js +1 -0
  384. package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.d.ts +11 -0
  385. package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.js +1 -0
  386. package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.d.ts +8 -0
  387. package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.js +1 -0
  388. package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.d.ts +7 -0
  389. package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.js +1 -0
  390. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.d.ts +9 -0
  391. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.js +1 -0
  392. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.d.ts +24 -0
  393. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.js +1 -0
  394. package/dist/react-sdk/application-runtime/hooks/responsive/index.d.ts +3 -0
  395. package/dist/react-sdk/application-runtime/hooks/responsive/index.js +1 -0
  396. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.d.ts +9 -0
  397. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.js +1 -0
  398. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.d.ts +26 -0
  399. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.js +1 -0
  400. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.d.ts +10 -0
  401. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.js +1 -0
  402. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.d.ts +24 -0
  403. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.js +1 -0
  404. package/dist/react-sdk/application-runtime/hooks/use-access-service.d.ts +5 -0
  405. package/dist/react-sdk/application-runtime/hooks/use-access-service.js +1 -1
  406. package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.d.ts +4 -11
  407. package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.js +1 -1
  408. package/dist/react-sdk/application-runtime/hooks/use-web-component.d.ts +5 -0
  409. package/dist/react-sdk/application-runtime/hooks/use-web-component.js +1 -1
  410. package/dist/react-sdk/application-runtime/host-properties/actions.d.ts +15 -0
  411. package/dist/react-sdk/application-runtime/host-properties/actions.js +1 -0
  412. package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.d.ts +30 -0
  413. package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.js +1 -0
  414. package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.d.ts +7 -0
  415. package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.js +1 -0
  416. package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.d.ts +21 -0
  417. package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.js +1 -0
  418. package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.d.ts +42 -0
  419. package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.js +1 -0
  420. package/dist/react-sdk/application-runtime/host-properties/index.d.ts +8 -0
  421. package/dist/react-sdk/application-runtime/host-properties/index.js +1 -0
  422. package/dist/react-sdk/application-runtime/host-properties/initialize.d.ts +7 -0
  423. package/dist/react-sdk/application-runtime/host-properties/initialize.js +1 -0
  424. package/dist/react-sdk/application-runtime/host-properties/selectors.d.ts +54 -0
  425. package/dist/react-sdk/application-runtime/host-properties/selectors.js +1 -0
  426. package/dist/react-sdk/application-runtime/host-properties/types.d.ts +18 -0
  427. package/dist/react-sdk/application-runtime/host-properties/types.js +1 -0
  428. package/dist/react-sdk/application-runtime/index.d.ts +3 -0
  429. package/dist/react-sdk/application-runtime/loading/actions.d.ts +45 -0
  430. package/dist/react-sdk/application-runtime/loading/actions.js +1 -0
  431. package/dist/react-sdk/application-runtime/loading/index.d.ts +4 -0
  432. package/dist/react-sdk/application-runtime/loading/index.js +1 -0
  433. package/dist/react-sdk/application-runtime/loading/initialize.d.ts +3 -0
  434. package/dist/react-sdk/application-runtime/loading/initialize.js +1 -0
  435. package/dist/react-sdk/application-runtime/loading/selectors.d.ts +18 -0
  436. package/dist/react-sdk/application-runtime/loading/selectors.js +1 -0
  437. package/dist/react-sdk/application-runtime/loading/types.d.ts +59 -0
  438. package/dist/react-sdk/application-runtime/loading/types.js +1 -0
  439. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  440. package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.d.ts +6 -0
  441. package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.js +1 -1
  442. package/dist/react-sdk/application-runtime/provider/ApplicationType.d.ts +7 -0
  443. package/dist/react-sdk/application-runtime/provider/ApplicationType.js +1 -1
  444. package/dist/react-sdk/application-runtime/responsive/actions.d.ts +47 -0
  445. package/dist/react-sdk/application-runtime/responsive/actions.js +1 -0
  446. package/dist/react-sdk/application-runtime/responsive/index.d.ts +4 -0
  447. package/dist/react-sdk/application-runtime/responsive/index.js +1 -0
  448. package/dist/react-sdk/application-runtime/responsive/initialize.d.ts +3 -0
  449. package/dist/react-sdk/application-runtime/responsive/initialize.js +1 -0
  450. package/dist/react-sdk/application-runtime/responsive/selectors.d.ts +20 -0
  451. package/dist/react-sdk/application-runtime/responsive/selectors.js +1 -0
  452. package/dist/react-sdk/application-runtime/responsive/types.d.ts +104 -0
  453. package/dist/react-sdk/application-runtime/responsive/types.js +1 -0
  454. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +309 -8
  455. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
  456. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/ConfiguratorRoutingProvider.d.ts +1 -1
  457. package/dist/react-sdk/configurator-routing/ConfiguratorRoutingProvider.js +1 -0
  458. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/OnGoToIndexHandler.d.ts +1 -2
  459. package/dist/react-sdk/configurator-routing/OnGoToIndexHandler.js +1 -0
  460. package/dist/react-sdk/configurator-routing/index.d.ts +3 -0
  461. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/index.js +1 -1
  462. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/use-power-routing-lifecycle.d.ts +2 -0
  463. package/dist/react-sdk/configurator-routing/use-power-routing-lifecycle.js +1 -0
  464. package/dist/react-sdk/domain-application-context/BackendDataProvider.js +1 -1
  465. package/dist/react-sdk/domain-application-context/FrontendDataProvider.js +1 -1
  466. package/dist/react-sdk/domain-application-context/OnPresetLoadedHandler.js +1 -0
  467. package/dist/react-sdk/domain-application-context/PublishedDataProvider.js +1 -1
  468. package/dist/react-sdk/domain-application-context/chat-hooks.d.ts +4 -0
  469. package/dist/react-sdk/domain-application-context/chat-hooks.js +1 -0
  470. package/dist/react-sdk/domain-application-context/index.d.ts +2 -0
  471. package/dist/react-sdk/domain-application-context/index.js +1 -1
  472. package/dist/react-sdk/domain-context/common-hooks/index.d.ts +1 -0
  473. package/dist/react-sdk/domain-context/common-hooks/index.js +1 -1
  474. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.d.ts +23 -0
  475. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.js +1 -0
  476. package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +1 -0
  477. package/dist/react-sdk/domain-context/index.d.ts +1 -0
  478. package/dist/react-sdk/domain-context/index.js +1 -1
  479. package/dist/react-sdk/elements/index.d.ts +0 -1
  480. package/dist/react-sdk/index.d.ts +4 -1
  481. package/dist/react-sdk/index.js +1 -1
  482. package/dist/react-sdk/integration/IntegrationSubscription.js +1 -0
  483. package/dist/react-sdk/integration/index.d.ts +1 -0
  484. package/dist/react-sdk/integration/index.js +1 -0
  485. package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.d.ts +8 -0
  486. package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.js +1 -0
  487. package/dist/react-sdk/lifecycle-providers/LifecycleProviders.js +1 -0
  488. package/dist/react-sdk/lifecycle-providers/index.d.ts +2 -0
  489. package/dist/react-sdk/lifecycle-providers/index.js +1 -0
  490. package/dist/react-sdk/loading-state/LoaderHost.d.ts +20 -0
  491. package/dist/react-sdk/loading-state/LoaderHost.js +1 -0
  492. package/dist/react-sdk/loading-state/built-in-loading-phase.d.ts +9 -0
  493. package/dist/react-sdk/loading-state/built-in-loading-phase.js +1 -0
  494. package/dist/react-sdk/loading-state/create-app-loader.d.ts +18 -0
  495. package/dist/react-sdk/loading-state/create-app-loader.js +1 -0
  496. package/dist/react-sdk/loading-state/index.d.ts +4 -2
  497. package/dist/react-sdk/loading-state/index.js +1 -1
  498. package/dist/react-sdk/loading-state/{LoadingStateProvider.d.ts → loading-state-hooks.d.ts} +3 -12
  499. package/dist/react-sdk/loading-state/loading-state-hooks.js +1 -0
  500. package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.d.ts +17 -0
  501. package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.js +1 -0
  502. package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.d.ts +17 -0
  503. package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.js +1 -0
  504. package/dist/react-sdk/page-elements/configurator-error-page-props.js +1 -0
  505. package/dist/{configurator/configuration-not-found-page → react-sdk/page-elements}/create-configuration-not-found-page.d.ts +7 -1
  506. package/dist/react-sdk/page-elements/create-configuration-not-found-page.js +1 -0
  507. package/dist/{configurator/configurator-error-page → react-sdk/page-elements}/create-configurator-error-page.d.ts +6 -1
  508. package/dist/react-sdk/page-elements/create-configurator-error-page.js +1 -0
  509. package/dist/react-sdk/page-elements/create-preset-ui.d.ts +9 -0
  510. package/dist/react-sdk/page-elements/create-preset-ui.js +1 -0
  511. package/dist/react-sdk/page-elements/index.d.ts +6 -0
  512. package/dist/react-sdk/page-elements/index.js +1 -0
  513. package/dist/react-sdk/session/SessionServiceProvider.js +1 -1
  514. package/dist/react-sdk/web-component/create-web-component.js +1 -1
  515. package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.d.ts +2 -2
  516. package/dist/ui-sdk/responsive-application/responsive-state-store.d.ts +11 -9
  517. package/dist/ui-sdk/responsive-application/use-store-responsive-info.js +1 -1
  518. package/package.json +3 -3
  519. package/dist/application-spec/core/components/index.d.ts +0 -2
  520. package/dist/application-spec/core/expressions/index.d.ts +0 -2
  521. package/dist/configurator/app-loader-content/app-loader-content-name.d.ts +0 -5
  522. package/dist/configurator/app-loader-content/app-loader-content-name.js +0 -1
  523. package/dist/configurator/configuration-not-found-page/create-configuration-not-found-page.js +0 -1
  524. package/dist/configurator/configurator-context/ConfiguratorDataProvider.d.ts +0 -2
  525. package/dist/configurator/configurator-context/ConfiguratorDataProvider.js +0 -1
  526. package/dist/configurator/configurator-context/IntegrationSubscription.js +0 -1
  527. package/dist/configurator/configurator-context/LifecycleProviders.js +0 -1
  528. package/dist/configurator/configurator-context/OnPresetLoadedHandler.js +0 -1
  529. package/dist/configurator/configurator-context/configurator-hooks/chat-hooks.d.ts +0 -1
  530. package/dist/configurator/configurator-context/configurator-hooks/chat-hooks.js +0 -1
  531. package/dist/configurator/configurator-context/configurator-routing/ConfiguratorRoutingProvider.js +0 -1
  532. package/dist/configurator/configurator-context/configurator-routing/OnGoToIndexHandler.js +0 -1
  533. package/dist/configurator/configurator-context/configurator-routing/index.d.ts +0 -2
  534. package/dist/configurator/configurator-context/configurator-routing/use-power-routing-lifecycle.js +0 -1
  535. package/dist/configurator/configurator-error-page/create-configurator-error-page.js +0 -1
  536. package/dist/phoenix/services/lingui.js +0 -1
  537. package/dist/react-sdk/loading-state/LoadingStateProvider.js +0 -1
  538. package/dist/react-sdk/loading-state/loading-state-manager.d.ts +0 -37
  539. package/dist/react-sdk/loading-state/loading-state-manager.js +0 -1
  540. package/dist/react-sdk/responsive-state/ResponsiveStateProvider.d.ts +0 -25
  541. package/dist/react-sdk/responsive-state/ResponsiveStateProvider.js +0 -1
  542. package/dist/react-sdk/responsive-state/canvas-padding.d.ts +0 -14
  543. package/dist/react-sdk/responsive-state/index.d.ts +0 -5
  544. package/dist/react-sdk/responsive-state/index.js +0 -1
  545. package/dist/react-sdk/responsive-state/responsive-state-manager.d.ts +0 -111
  546. package/dist/react-sdk/responsive-state/responsive-state-manager.js +0 -1
  547. package/dist/react-sdk/responsive-state/use-responsive-state-manager.d.ts +0 -10
  548. package/dist/react-sdk/responsive-state/use-responsive-state-manager.js +0 -1
  549. package/dist/react-sdk/responsive-state/use-responsive-state.d.ts +0 -11
  550. package/dist/react-sdk/responsive-state/use-responsive-state.js +0 -1
  551. /package/dist/{application-spec/core → domain/spec/application}/application-instance.d.ts +0 -0
  552. /package/dist/{application-spec/core → domain/spec/application}/application-instance.js +0 -0
  553. /package/dist/{application-spec/core/expressions/relation-expression-params.js → domain/spec/components/bindings/index.js} +0 -0
  554. /package/dist/{application-spec/parse-application-files/spec/components/component-entry.js → domain/spec/components/bindings/read-binding.js} +0 -0
  555. /package/dist/{application-spec/parse-application-files/spec/expressions/expression.js → domain/spec/components/bindings/write-binding.js} +0 -0
  556. /package/dist/{react-sdk/elements/configurator-error-page-props.js → domain/spec/components/component-entry.js} +0 -0
  557. /package/dist/{application-spec/core → domain/spec}/components/component-filter.js +0 -0
  558. /package/dist/{react-sdk/responsive-state/canvas-padding.js → domain/spec/components/component-filters.js} +0 -0
  559. /package/dist/{application-spec/core → domain/spec}/components/index.js +0 -0
  560. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.d.ts +0 -0
  561. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.js +0 -0
  562. /package/dist/{application-spec/core → domain/spec}/expressions/index.js +0 -0
  563. /package/dist/{application-spec/core → domain/spec}/expressions/relation-expression-params.d.ts +0 -0
  564. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.d.ts +0 -0
  565. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.js +0 -0
  566. /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.d.ts +0 -0
  567. /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.js +0 -0
  568. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.d.ts +0 -0
  569. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.js +0 -0
  570. /package/dist/{configurator/configurator-context → react-sdk/domain-application-context}/OnPresetLoadedHandler.d.ts +0 -0
  571. /package/dist/{configurator/configurator-context → react-sdk/integration}/IntegrationSubscription.d.ts +0 -0
  572. /package/dist/{configurator/configurator-context → react-sdk/lifecycle-providers}/LifecycleProviders.d.ts +0 -0
  573. /package/dist/react-sdk/{elements → page-elements}/configurator-error-page-props.d.ts +0 -0
@@ -379,6 +379,40 @@ export interface paths {
379
379
  readonly patch?: never
380
380
  readonly trace?: never
381
381
  }
382
+ readonly '/configurations/{configurationId}/assistant/images': {
383
+ readonly parameters: {
384
+ readonly query?: never
385
+ readonly header?: never
386
+ readonly path?: never
387
+ readonly cookie?: never
388
+ }
389
+ readonly get?: never
390
+ readonly put?: never
391
+ /** @description Store a screenshot the browser took for the assistant in the caller's open thread on the configuration, while a run of the assistant answers there. The body is the raw JPEG or PNG image, with its type as the content type. The answer carries the id that tool results reference the image by, as `assistant-image:<imageId>`. Answers 409 when the caller has no open thread on the configuration or the thread is not in the middle of a reply (no run running and no client tool call waiting), and 415 for any other content type. */
392
+ readonly post: operations['uploadAssistantImage']
393
+ readonly delete?: never
394
+ readonly options?: never
395
+ readonly head?: never
396
+ readonly patch?: never
397
+ readonly trace?: never
398
+ }
399
+ readonly '/configurations/{configurationId}/assistant/images/{imageId}': {
400
+ readonly parameters: {
401
+ readonly query?: never
402
+ readonly header?: never
403
+ readonly path?: never
404
+ readonly cookie?: never
405
+ }
406
+ /** @description Load a screenshot of one of the caller's assistant threads on the configuration, the earlier threads of the chain included. The bytes never change, so the answer may be cached for good. Answers 404 for an image that is not in one of the caller's threads on this configuration. */
407
+ readonly get: operations['getAssistantImage']
408
+ readonly put?: never
409
+ readonly post?: never
410
+ readonly delete?: never
411
+ readonly options?: never
412
+ readonly head?: never
413
+ readonly patch?: never
414
+ readonly trace?: never
415
+ }
382
416
  readonly '/configurations/{configurationId}/chat': {
383
417
  readonly parameters: {
384
418
  readonly query?: never
@@ -1503,6 +1537,13 @@ export interface components {
1503
1537
  /** @enum {number} */
1504
1538
  readonly statusCode: 401
1505
1539
  }
1540
+ /** @description Unsupported Media Type: The request body is of a content type the route does not accept. */
1541
+ readonly UnsupportedMediaTypeError: {
1542
+ /** @example Unsupported Media Type! */
1543
+ readonly message: string
1544
+ /** @enum {number} */
1545
+ readonly statusCode: 415
1546
+ }
1506
1547
  /** @description A webhook resource to which the deployment can send requests. */
1507
1548
  readonly Webhook: {
1508
1549
  /**
@@ -3397,6 +3438,193 @@ export interface operations {
3397
3438
  }
3398
3439
  }
3399
3440
  }
3441
+ readonly uploadAssistantImage: {
3442
+ readonly parameters: {
3443
+ readonly query?: never
3444
+ readonly header?: never
3445
+ readonly path: {
3446
+ /** @description The configuration on which the caller's assistant thread is used. */
3447
+ readonly configurationId: components['schemas']['ConfigurationUuid']
3448
+ }
3449
+ readonly cookie?: never
3450
+ }
3451
+ /** @description The JPEG or PNG image. */
3452
+ readonly requestBody: {
3453
+ readonly content: {
3454
+ readonly 'image/jpeg': string
3455
+ readonly 'image/png': string
3456
+ }
3457
+ }
3458
+ readonly responses: {
3459
+ /** @description The image was stored in the thread. */
3460
+ readonly 200: {
3461
+ headers: {
3462
+ readonly [name: string]: unknown
3463
+ }
3464
+ content: {
3465
+ readonly 'application/json': {
3466
+ /**
3467
+ * Format: uuid
3468
+ * @description The id tool results reference the image by.
3469
+ */
3470
+ readonly imageId: string
3471
+ }
3472
+ }
3473
+ }
3474
+ /** @description Bad Request! */
3475
+ readonly 400: {
3476
+ headers: {
3477
+ readonly [name: string]: unknown
3478
+ }
3479
+ content: {
3480
+ readonly 'application/json': components['schemas']['BadRequestError']
3481
+ }
3482
+ }
3483
+ /** @description Unauthorized! */
3484
+ readonly 401: {
3485
+ headers: {
3486
+ readonly [name: string]: unknown
3487
+ }
3488
+ content: {
3489
+ readonly 'application/json': components['schemas']['UnauthorizedError']
3490
+ }
3491
+ }
3492
+ /** @description Forbidden! */
3493
+ readonly 403: {
3494
+ headers: {
3495
+ readonly [name: string]: unknown
3496
+ }
3497
+ content: {
3498
+ readonly 'application/json': components['schemas']['ForbiddenError']
3499
+ }
3500
+ }
3501
+ /** @description Not Found! */
3502
+ readonly 404: {
3503
+ headers: {
3504
+ readonly [name: string]: unknown
3505
+ }
3506
+ content: {
3507
+ readonly 'application/json': components['schemas']['NotFoundError']
3508
+ }
3509
+ }
3510
+ /** @description Conflict! */
3511
+ readonly 409: {
3512
+ headers: {
3513
+ readonly [name: string]: unknown
3514
+ }
3515
+ content: {
3516
+ readonly 'application/json': components['schemas']['ConflictError']
3517
+ }
3518
+ }
3519
+ /** @description Unsupported Media Type! */
3520
+ readonly 415: {
3521
+ headers: {
3522
+ readonly [name: string]: unknown
3523
+ }
3524
+ content: {
3525
+ readonly 'application/json': components['schemas']['UnsupportedMediaTypeError']
3526
+ }
3527
+ }
3528
+ /** @description Bad Gateway! */
3529
+ readonly 502: {
3530
+ headers: {
3531
+ readonly [name: string]: unknown
3532
+ }
3533
+ content: {
3534
+ readonly 'application/json': components['schemas']['BadGatewayError']
3535
+ }
3536
+ }
3537
+ /** @description An unexpected error occurred! */
3538
+ readonly default: {
3539
+ headers: {
3540
+ readonly [name: string]: unknown
3541
+ }
3542
+ content: {
3543
+ readonly 'application/json': components['schemas']['DefaultResponse']
3544
+ }
3545
+ }
3546
+ }
3547
+ }
3548
+ readonly getAssistantImage: {
3549
+ readonly parameters: {
3550
+ readonly query?: never
3551
+ readonly header?: never
3552
+ readonly path: {
3553
+ /** @description The configuration on which the caller's assistant thread is used. */
3554
+ readonly configurationId: components['schemas']['ConfigurationUuid']
3555
+ /** @description The image, as a tool result references it. */
3556
+ readonly imageId: string
3557
+ }
3558
+ readonly cookie?: never
3559
+ }
3560
+ readonly requestBody?: never
3561
+ readonly responses: {
3562
+ /** @description The image. */
3563
+ readonly 200: {
3564
+ headers: {
3565
+ readonly [name: string]: unknown
3566
+ }
3567
+ content: {
3568
+ readonly 'image/jpeg': unknown
3569
+ readonly 'image/png': unknown
3570
+ }
3571
+ }
3572
+ /** @description Bad Request! */
3573
+ readonly 400: {
3574
+ headers: {
3575
+ readonly [name: string]: unknown
3576
+ }
3577
+ content: {
3578
+ readonly 'application/json': components['schemas']['BadRequestError']
3579
+ }
3580
+ }
3581
+ /** @description Unauthorized! */
3582
+ readonly 401: {
3583
+ headers: {
3584
+ readonly [name: string]: unknown
3585
+ }
3586
+ content: {
3587
+ readonly 'application/json': components['schemas']['UnauthorizedError']
3588
+ }
3589
+ }
3590
+ /** @description Forbidden! */
3591
+ readonly 403: {
3592
+ headers: {
3593
+ readonly [name: string]: unknown
3594
+ }
3595
+ content: {
3596
+ readonly 'application/json': components['schemas']['ForbiddenError']
3597
+ }
3598
+ }
3599
+ /** @description Not Found! */
3600
+ readonly 404: {
3601
+ headers: {
3602
+ readonly [name: string]: unknown
3603
+ }
3604
+ content: {
3605
+ readonly 'application/json': components['schemas']['NotFoundError']
3606
+ }
3607
+ }
3608
+ /** @description Bad Gateway! */
3609
+ readonly 502: {
3610
+ headers: {
3611
+ readonly [name: string]: unknown
3612
+ }
3613
+ content: {
3614
+ readonly 'application/json': components['schemas']['BadGatewayError']
3615
+ }
3616
+ }
3617
+ /** @description An unexpected error occurred! */
3618
+ readonly default: {
3619
+ headers: {
3620
+ readonly [name: string]: unknown
3621
+ }
3622
+ content: {
3623
+ readonly 'application/json': components['schemas']['DefaultResponse']
3624
+ }
3625
+ }
3626
+ }
3627
+ }
3400
3628
  readonly getChatConversation: {
3401
3629
  readonly parameters: {
3402
3630
  readonly query?: never
@@ -1 +1 @@
1
- import{jsx as r,jsxs as e}from"react/jsx-runtime";import{I18nProvider as o}from"@lingui/react";import{QueryClientProvider as i}from"@tanstack/react-query";import n from"mui-modal-provider";import{useEffect as t}from"react";import{standardWebComponentProperties as c}from"#package/domain";import{getAvailableLocales as a,resolveLocale as m}from"#package/i18n";import{ApplicationType as l,ApplicationTypeProvider as d,InvalidDeploymentReload as p,LoadingStateProvider as s,SessionServiceProvider as f,useApplicationQueryClient as u,useI18n as h,useSpecAlwaysExpand as g,useSpecAppLoader as x,useSpecPrefetchTextureUrls as j,useSpecPreview as k,useWebComponentProperty$ as v,useWebComponentPropertySetter as b,useWebComponentPropertyValue as y,useWebComponentReadonlySync as C}from"#package/react-sdk";import{SnackbarProvider as w}from"#package/ui-sdk";import{ConfiguratorDataProvider as E}from"./configurator-context/ConfiguratorDataProvider.js";import{ConfiguratorResponsiveProvider as I}from"./configurator-context/ConfiguratorResponsiveProvider.js";import{usePowerRoutingLifecycle as L}from"./configurator-context/configurator-routing/use-power-routing-lifecycle.js";import{ConfiguratorRoutingProvider as P,OnApplicationStartProvider as Z,OnRoutingReadyProvider as q,OnSessionReadyProvider as A,PresetSelectionProvider as B,PreviewApplicationProvider as D}from"./configurator-context/index.js";import{LoadingErrorBoundary as F}from"./pages/error-boundaries/LoadingErrorBoundary.js";import{GeneralErrorFallback as R,RootPage as S}from"./pages/index.js";import{SceneResourcesProvider as T}from"./scene/index.js";import{EncapsulatedConfiguratorTheme as U}from"./ui/index.js";import{AppLoader as z}from"./ui/phoenix-layout-elements/index.js";export const ConfiguratorApp=()=>{let G=u(),H=h(),J=x(),K=k(),M=g(),N=j(),O=b(c.locale),Q=v(c.locale);C(),t(()=>{let r=Q.subscribe(r=>{let e=m(r,a(H));H.activate(e)}),e=()=>{O(H.locale)};return H.on("change",e),()=>{r.unsubscribe(),H.removeListener("change",e)}},[Q,H,O]);let V=y(c.containerZIndex),W=y(c.power);return(L(),"off"===W)?null:r(d,{type:l.Configurator,children:r(i,{client:G,children:r(U,{children:r(s,{children:r(I,{containerZIndex:V,children:r(z,{mode:J,children:r(D,{alwaysExpand:M,preview:K,children:r(o,{i18n:H,children:r(w,{maxSnack:5,children:r(F,{FallbackComponent:R,children:r(T,{prefetchTextureUrls:N,children:r(Z,{children:r(f,{children:r(A,{children:"on"===W&&r(P,{children:r(E,{children:r(B,{children:r(q,{children:e(n,{children:[r(p,{}),r(S,{})]})})})})})})})})})})})})})})})})})})})};
1
+ import{jsx as r,jsxs as e}from"react/jsx-runtime";import{I18nProvider as o}from"@lingui/react";import{QueryClientProvider as i}from"@tanstack/react-query";import n from"mui-modal-provider";import{useEffect as t}from"react";import{standardWebComponentProperties as c}from"#package/domain";import{getAvailableLocales as a,resolveLocale as m}from"#package/i18n";import{ApplicationType as l,ApplicationTypeProvider as d,ConfiguratorDataProvider as p,ConfiguratorRoutingProvider as s,InvalidDeploymentReload as f,LoaderHost as h,OnApplicationStartProvider as u,OnRoutingReadyProvider as x,OnSessionReadyProvider as g,SessionServiceProvider as j,useApplicationQueryClient as k,useI18n as b,usePowerRoutingLifecycle as v,useSpecAlwaysExpand as y,useSpecAppLoader as C,useSpecPrefetchTextureUrls as w,useSpecPreview as E,useWebComponentProperty$ as I,useWebComponentPropertySetter as L,useWebComponentPropertyValue as Z}from"#package/react-sdk";import{SnackbarProvider as q}from"#package/ui-sdk";import{ConfiguratorResponsiveProvider as A}from"./configurator-context/ConfiguratorResponsiveProvider.js";import{PresetSelectionProvider as B,PreviewApplicationProvider as F}from"./configurator-context/index.js";import{LoadingErrorBoundary as P}from"./pages/error-boundaries/LoadingErrorBoundary.js";import{GeneralErrorFallback as R,RootPage as S}from"./pages/index.js";import{SceneResourcesProvider as T}from"./scene/index.js";import{EncapsulatedConfiguratorTheme as U}from"./ui/index.js";import{AppLoader as z}from"./ui/phoenix-layout-elements/index.js";export const ConfiguratorApp=()=>{let D=k(),G=b(),H=C(),J=E(),K=y(),M=w(),N=L(c.locale),O=I(c.locale);t(()=>{let r=O.subscribe(r=>{let e=m(r,a(G));G.activate(e)}),e=()=>{N(G.locale)};return G.on("change",e),()=>{r.unsubscribe(),G.removeListener("change",e)}},[O,G,N]);let Q=Z(c.containerZIndex),V=Z(c.power);return(v(),"off"===V)?null:r(d,{type:l.Configurator,children:r(i,{client:D,children:r(U,{children:r(h,{children:r(A,{containerZIndex:Q,children:r(z,{mode:H,children:r(F,{alwaysExpand:K,preview:J,children:r(o,{i18n:G,children:r(q,{maxSnack:5,children:r(P,{FallbackComponent:R,children:r(T,{prefetchTextureUrls:M,children:r(u,{children:r(j,{children:r(g,{children:"on"===V&&r(s,{children:r(p,{children:r(B,{children:r(x,{children:e(n,{children:[r(f,{}),r(S,{})]})})})})})})})})})})})})})})})})})})})};
@@ -1,2 +1 @@
1
- export { AppLoaderContentName } from './app-loader-content-name.js';
2
1
  export { DefaultAppLoaderContent } from './DefaultAppLoaderContent.js';
@@ -1 +1 @@
1
- export{AppLoaderContentName}from"./app-loader-content-name.js";export{DefaultAppLoaderContent}from"./DefaultAppLoaderContent.js";
1
+ export{DefaultAppLoaderContent}from"./DefaultAppLoaderContent.js";
@@ -1 +1 @@
1
- import{createSelector as e}from"@salsita-ai/common/utils";import{createSessionAssistant as t,isAssistantSetupHandler as n}from"#package/domain";import{AnimationSystem as s,AssistantSystem as o,CameraControlSystem as r,CameraSystem as a,CanvasSystem as i,DragAndDropSystem as g,ExportSystem as m,GraphQLSystem as c,ImageRenderingSystem as l,LayoutSystem as S,SketchingSystem as d}from"./systems/index.js";export const createConfiguratorExtensionSelectors=u=>{let{getState:y,domainContextSelectors:w,specSelectors:C,domainServicesSelectors:f,accessSelectors:p,commonServicesSelectors:h}=u,x=e.withTypes()([C.selectConfiguratorSpec,w.selectInitializationContext],(e,s)=>t({resolved:e.assistant,handler:e.handlers.find(n),inputs:s&&s.access?{role:s.role,sessionData:s.sessionData,access:s.access}:null})),A={getConfigurationId:()=>p.getConfiguratorConfigurationId(),getAuthorizedClient:()=>h.getConfiguratorAuthorizedClient(),getAssistantSetup:()=>x(y()),domainContextSelectors:w,domainServicesSelectors:f,specSelectors:C},I={getSystems:()=>Q,getCanvasSystem:()=>D,getCameraControlSystem:()=>v,getAnimationSystem:()=>b,getDragAndDropSystem:()=>z,getImageRenderingSystem:()=>G,getLayoutSystem:()=>T,getSketchingSystem:()=>j,getExportSystem:()=>k,getCameraSystem:()=>F,getGraphQLSystem:()=>L,getAssistantSystem:()=>R},E={...A,configuratorExtensionSelectors:I},D=new i(A),v=new r({configuratorExtensionSelectors:I}),z=new g(E),b=new s(A),k=new m(E),L=new c({...A,renderScreenshot:async(e,t)=>{let[n]=await I.getImageRenderingSystem().generateImagesFromComponents([e],t,{},{awaitSettledState:!0});if(!n)throw Error("The canvas rendered no image.");return n.blob}}),R=new o(E),T=new S(A),j=new d(E),F=new a(E),G=new l(E),Q={cameraControlSystem:v,layoutSystem:T,sketchingSystem:j,dragAndDropSystem:z,canvasSystem:D,cameraSystem:F,exportSystem:k,imageRenderingSystem:G,animationSystem:b,graphQLSystem:L,assistantSystem:R};return I};
1
+ import{createSelector as e}from"@salsita-ai/common/utils";import{createSessionAssistant as t,isAssistantSetupHandler as n}from"#package/domain";import{AnimationSystem as s,AssistantSystem as o,CameraControlSystem as r,CameraSystem as a,CanvasSystem as i,DragAndDropSystem as g,ExportSystem as m,GraphQLSystem as l,ImageRenderingSystem as c,LayoutSystem as S,SketchingSystem as d}from"./systems/index.js";export const createConfiguratorExtensionSelectors=u=>{let{getState:y,domainContextSelectors:C,specSelectors:p,domainServicesSelectors:w,accessSelectors:f,commonServicesSelectors:h}=u,A=e.withTypes()([p.selectConfiguratorSpec,C.selectInitializationContext],(e,s)=>t({resolved:e.assistant,handler:e.handlers.find(n),inputs:s&&s.access?{role:s.role,sessionData:s.sessionData,access:s.access}:null})),I={getConfigurationId:()=>f.getConfiguratorConfigurationId(),getAuthorizedClient:()=>h.getConfiguratorAuthorizedClient(),getAssistantSetup:()=>A(y()),domainContextSelectors:C,domainServicesSelectors:w,specSelectors:p},x={getSystems:()=>Q,getCanvasSystem:()=>z,getCameraControlSystem:()=>D,getAnimationSystem:()=>b,getDragAndDropSystem:()=>v,getImageRenderingSystem:()=>G,getLayoutSystem:()=>T,getSketchingSystem:()=>j,getExportSystem:()=>k,getCameraSystem:()=>F,getGraphQLSystem:()=>L,getAssistantSystem:()=>R},E={...I,configuratorExtensionSelectors:x},z=new i(I),D=new r({configuratorExtensionSelectors:x}),v=new g(E),b=new s(I),k=new m(E),L=new l({...I,renderScreenshot:async(e,t)=>{let[n]=await x.getImageRenderingSystem().generateImagesFromComponents([e],t,{},{awaitSettledState:!0});if(!n)throw Error("The canvas rendered no image.");return n.blob},uploadScreenshot:e=>I.getAuthorizedClient().uploadAssistantImage(I.getConfigurationId(),e)}),R=new o(E),T=new S(I),j=new d(E),F=new a(E),G=new c(E),Q={cameraControlSystem:D,layoutSystem:T,sketchingSystem:j,dragAndDropSystem:v,canvasSystem:z,cameraSystem:F,exportSystem:k,imageRenderingSystem:G,animationSystem:b,graphQLSystem:L,assistantSystem:R};return x};
@@ -8,8 +8,8 @@ import type { ConfiguratorExtensionSelectors } from '../../selectors.js';
8
8
  export type AssistantClientTool = AnyClientTool;
9
9
  /**
10
10
  * Constructor context of an `AssistantSystem`: whole selector objects, like its peers take them, so
11
- * the tools reach the store, the session mode and the `GraphQLSystem` when they are called, and the
12
- * chat reaches the server of the current session when it sends a request.
11
+ * the tools reach the store, the session mode, the view mode and the `GraphQLSystem` when they are
12
+ * called, and the chat reaches the server of the current session when it sends a request.
13
13
  */
14
14
  export interface AssistantSystemContext {
15
15
  readonly configuratorExtensionSelectors: ConfiguratorExtensionSelectors;
@@ -136,6 +136,11 @@ export declare class AssistantSystem implements InitializableSystem {
136
136
  */
137
137
  private readonly _applyToolCallIds;
138
138
  private readonly _undoTipToolCallId;
139
+ /**
140
+ * Object URLs of the screenshots read so far, by image id. An uploaded image never changes, so
141
+ * each is read once and kept while the configuration stays loaded.
142
+ */
143
+ private _screenshotUrls;
139
144
  constructor(_context: AssistantSystemContext);
140
145
  /** The conversation. It never completes, and holds the empty chat whenever no chat is active. */
141
146
  readonly chat$: ObservableWithLastValue<AssistantChatSnapshot>;
@@ -231,6 +236,12 @@ export declare class AssistantSystem implements InitializableSystem {
231
236
  * refuses with a conflict is not a failure: the thread is read again and `false` is returned.
232
237
  */
233
238
  resume: () => Promise<boolean>;
239
+ /**
240
+ * An object URL of a screenshot of the conversation, by the id its tool result references it by.
241
+ * It is read from the server through the client of the current chat, once per image; a read that
242
+ * failed is forgotten, so it can be asked for again. Rejects without a chat or when the read fails.
243
+ */
244
+ loadScreenshotUrl: (imageId: string) => Promise<string>;
234
245
  /**
235
246
  * Loads the thread before the oldest painted one and paints it above. Does nothing when there is
236
247
  * none or one is being loaded. A load that fails is logged and can be asked for again.
@@ -253,7 +264,8 @@ export declare class AssistantSystem implements InitializableSystem {
253
264
  * taken back; the non-undoable commits made on top of an undone change go with it, as with the
254
265
  * toolbar's undo.
255
266
  *
256
- * Accepted: like the toolbar's undo, it does not check the session mode; only `apply` requires `owner`.
267
+ * Accepted: like the toolbar's undo, it checks neither the session mode nor the view mode; only
268
+ * `apply` follows the view mode and refuses a finalize run.
257
269
  */
258
270
  undoToolCalls: (toolCallIds: ReadonlySet<string>) => void;
259
271
  setOpen: (open: boolean) => void;
@@ -299,6 +311,8 @@ export declare class AssistantSystem implements InitializableSystem {
299
311
  * it is: whether it finishes its reply or is cut off is the caller's decision.
300
312
  */
301
313
  private _retireChat;
314
+ /** Revokes the object URLs of the screenshots read for the configuration that was loaded, also those still being read. */
315
+ private _releaseScreenshotUrls;
302
316
  /** Ends the current chat without cutting its reply off. */
303
317
  private _endChat;
304
318
  }
@@ -1 +1 @@
1
- import{ChatClient as t,fetchServerSentEvents as e}from"@tanstack/ai-client";import{BehaviorSubject as i}from"rxjs";import{skip as s}from"rxjs/operators";import{isShallowEqual as a}from"@salsita-ai/common/utils";import{AssistantRequestError as r}from"#package/client";import{createBrowserDetailsClientTool as n}from"./browser-details.js";import{ChangeRecorder as o}from"./change-recorder.js";import{createApplyClientTool as l,createQueryClientTool as h,toToolResult as d}from"./graphql-tools.js";let c=Object.freeze({messages:Object.freeze([]),isLoading:!1,error:void 0,failedStatus:void 0,isContinuable:!0,isLoaded:!1,isResuming:!1,earlierThreads:Object.freeze([]),hasEarlierThread:!1,isLoadingEarlierThread:!1}),u=Object.freeze({open:!1,hasUnreadReply:!1,isInputFocused:!1}),_=Object.freeze({}),g=d({results:[],committed:!1,sideEffects:[],screenshots:new Map,message:"Nothing was run, because the user closed the configurator while this reply was being written. Do not call any more tools in this reply and end it now. The tools work again as soon as the user writes the next message."}),m=t=>{if(t.getError())return!0;let e=t.getMessages().at(-1)?.parts.at(-1);return e?.type!=="tool-call"&&e?.type!=="tool-result"};export class AssistantSystem{_context;_tools;_chat=new i(c);_panel=new i(u);_activation=null;_current=null;_finishing=new Set;_olderThreadId=null;_resuming=null;_refused=null;_firstAttempt=null;_chain={};_loadingThreadId=null;_recorder;_recording=null;_applyToolCallIds=new WeakMap;_undoTipToolCallId=new i(void 0);constructor(t){this._context=t;let{configuratorExtensionSelectors:e,domainContextSelectors:i,domainServicesSelectors:s,getAssistantSetup:a}=t;this._recorder=new o({maxEntities:30},{readers:{selectedEntityId:t=>i.getNavigationSystem().getActiveSelectionState(t),navigationState:t=>i.getNavigationSystem().getActiveNavigationState(t),viewState:t=>i.getNavigationSystem().getActiveViewState(t),toolState:t=>i.getNavigationSystem().getActiveToolState(t)},getExposedFields:()=>a().manifest?.fields??_,resolveLocalizable:t=>s.getResolveLocalizable()(t)});let r={getGraphQLSystem:()=>e.getGraphQLSystem(),getStoreSystem:()=>i.getStoreSystem(),getActiveMode:()=>i.getActiveMode(),clearChanges:()=>this._recorder.clear(this._committedState()),rememberCommit:(t,e)=>{this._applyToolCallIds.set(e,t),this._refreshUndoTip()}};this._tools=[n(),h(r),l(r)],i.getUndoSystem().tip$.subscribe(this._refreshUndoTip)}chat$=this._chat;panel$=this._panel;undoTipToolCallId$=this._undoTipToolCallId;getSessionManifest=()=>this._context.getAssistantSetup().manifest;initialize=()=>{let{committed:t}=this._context.domainContextSelectors.getStoreSystem().stateSlices;this._recording??=t.pipe(s(1)).subscribe(this._recorder.record),this._recorder.reset(t.value.state),this._endChat(),this._patchPanel(u),this._activation&&this._startClient()};activate=()=>{this._endChat();let t={};return this._activation=t,this._startClient(),()=>{this._activation===t&&(this._activation=null,this._endChat())}};send=async t=>{if(!this._chat.value.isContinuable&&!await this.resume())return;let e=this._current;if(!e)return;let i={changes:this._recorder.take(this._committedState())};this._firstAttempt=e;try{await this._sendOn(e,t,i);let s=this._findRefusedMessageIndex(e);if(-1===s)return;this._refused={chat:e,index:s}}finally{this._firstAttempt===e&&(this._firstAttempt=null)}if(!await this.resume())return;let s=this._current;s&&await this._sendOn(s,t,i)};resume=async()=>{let t=this._current;if(!t)return!1;if(this._chat.value.isContinuable)return!0;if(this._resuming)return this._resuming;let e=this._resume(t).finally(()=>{this._resuming===e&&(this._resuming=null)});return this._resuming=e,e};loadEarlierThread=async()=>{let t=this._current,e=this._olderThreadId;if(!t||null===e||this._loadingThreadId===e)return;let i=this._chain;this._loadingThreadId=e,this._chat.next({...this._chat.value,isLoadingEarlierThread:!0});try{let s=await t.authorizedClient.getAssistantEarlierThread(t.configurationId,e,50);if(this._chain!==i||this._olderThreadId!==e)return;this._olderThreadId=s.previousThreadId,this._chat.next({...this._chat.value,earlierThreads:[{threadId:e,messages:s.messages},...this._chat.value.earlierThreads],hasEarlierThread:null!==s.previousThreadId})}catch(t){this._context.domainServicesSelectors.getLogger().warn("Could not load the earlier assistant conversation",{error:t})}finally{this._chain===i&&this._loadingThreadId===e&&(this._loadingThreadId=null,this._chat.next({...this._chat.value,isLoadingEarlierThread:!1}))}};stop=async()=>{let t=this._current;if(!t)return;let e=t.client.getCurrentRunId();if(t.client.stop(),null!=e)try{let i=t.getConnection();await fetch(`${i.url}/runs/${encodeURIComponent(e)}/cancel`,{method:"POST",headers:await i.headers()})}catch(t){this._context.domainServicesSelectors.getLogger().warn("Could not cancel the assistant run on the server",{error:t})}};reloadThread=()=>{if(!this._activation)return;let t=this._retireChat();t?.client.stop(),t?.dispose(),this._recorder.reset(this._committedState()),this._startClient()};undoToolCalls=t=>{let e=this._context.domainContextSelectors.getUndoSystem(),i=()=>{let e=this._findTipToolCallId();return void 0!==e&&t.has(e)};for(;i();)e.undo()};setOpen=t=>{this._patchPanel(t?{open:t,hasUnreadReply:!1}:{open:t,isInputFocused:!1})};setInputFocused=t=>{this._patchPanel({isInputFocused:t})};_findRefusedMessageIndex=t=>{var e;let i,{failedStatus:s,isContinuable:a}=this._chat.value;return this._firstAttempt===t&&t.generation.active&&409===s&&!a?(i=(e=t.client.getMessages()).map(t=>t.role).lastIndexOf("user"),e.slice(i+1).every(t=>0===t.parts.length)?i:-1):-1};_sendOn=async(t,e,i)=>{let{client:s}=t;s.getIsLoading()||null===s.getResumeState()||s.stop();try{await s.sendMessage({content:e,metadata:i})}catch(i){let e=i instanceof Error?i:Error(String(i));t.generation.active&&this._chat.next({...this._chat.value,error:e}),this._context.domainServicesSelectors.getLogger().error("The assistant message could not be sent",{},e)}};_resume=async t=>{this._chat.next({...this._chat.value,isResuming:!0,error:void 0,failedStatus:void 0});try{let{previousThreadId:e}=await t.authorizedClient.compactAssistantThread(t.configurationId);if(!t.generation.active)return!1;let{messages:i,earlierThreads:s,hasEarlierThread:a}=this._chat.value,r=this._refused?.chat===t?i.slice(0,this._refused.index):i;return t.generation.active=!1,this._current=null,t.client.stop(),t.dispose(),this._chat.next({...c,earlierThreads:[...s,{threadId:e,messages:r}],hasEarlierThread:a,isLoadingEarlierThread:null!==this._loadingThreadId}),this._startClient(),!0}catch(i){let e=i instanceof Error?i:Error(String(i));if(e instanceof r&&409===e.status)return t.generation.active&&this.reloadThread(),!1;return t.generation.active&&this._chat.next({...this._chat.value,isResuming:!1,error:e,failedStatus:e instanceof r?e.status:void 0}),this._context.domainServicesSelectors.getLogger().error("The assistant thread could not be resumed",{},e),!1}};_findTipToolCallId=()=>{let t=this._context.domainContextSelectors.getUndoSystem(),e=t.tip$.value?.committedState;return void 0!==e&&t.canUndo()?this._applyToolCallIds.get(e):void 0};_refreshUndoTip=()=>{let t=this._findTipToolCallId();t!==this._undoTipToolCallId.value&&this._undoTipToolCallId.next(t)};_committedState=()=>this._context.domainContextSelectors.getStoreSystem().stateSlices.committed.value.state;_patchPanel=t=>{let e={...this._panel.value,...t};a(e,this._panel.value)||this._panel.next(e)};_takeOverThread=t=>{for(let e of this._finishing)e.configurationId===t&&(e.client.stop(),e.dispose())};_startClient=()=>{let i={active:!0},s=this._context.getConfigurationId();this._takeOverThread(s);let r=this._context.getAuthorizedClient(),n=()=>{if(i.active){let{manifest:t,error:e}=this._context.getAssistantSetup();if(e)throw e;if(!t)throw Error("The assistant is disabled for this session.")}return r.getAssistantChatConnection(s)},o=t=>{if(!i.active)return;let e={...this._chat.value,...t};a(e,this._chat.value)||this._chat.next(e)},l=async(t,e)=>{let s=await fetch(t,e).finally(()=>o({isLoaded:!0})),a=s.headers.get("x-assistant-thread-continuable");return null!=a&&s.ok&&i.active&&0===this._chat.value.earlierThreads.length&&(this._olderThreadId=s.headers.get("x-assistant-previous-thread")),o({failedStatus:s.ok?void 0:s.status,...null!=a&&{isContinuable:"false"!==a,hasEarlierThread:null!==this._olderThreadId}}),s},h=async()=>({headers:await n().headers(),fetchClient:l}),d=e(()=>n().url,h),c=e(()=>`${n().url}/runs`,h),u=this._tools.map(t=>({...t,execute:(e,s)=>{if(!i.active)return g;let{manifest:a,error:r}=this._context.getAssistantSetup();return r||!a?{error:r?.message??"The assistant is disabled for this session."}:t.execute?.(e,s)}})),_=new t({threadId:`assistant:${s}`,connection:{...d,joinRun:c.joinRun},persistence:!0,history:{pageSize:50},tools:u,onMessagesChange:t=>o({messages:t}),onLoadingChange:t=>{let e=i.active&&this._chat.value.isLoading;o({isLoading:t}),!t&&m(_)&&(i.active?e&&!this._panel.value.open&&this._patchPanel({hasUnreadReply:!0}):p())},onErrorChange:t=>{i.active&&t!==this._chat.value.error&&(!t||-1===this._findRefusedMessageIndex(v))&&(o({error:t}),t&&this._context.domainServicesSelectors.getLogger().error("The assistant request failed",{status:this._chat.value.failedStatus},t))}}),f=!1,p=()=>{f||(f=!0,this._finishing.delete(v),_.dispose())},v={client:_,configurationId:s,generation:i,authorizedClient:r,getConnection:n,dispose:p};this._current=v,_.attach()};_retireChat=()=>{let t=this._current;return this._current=null,t&&(t.generation.active=!1),this._chain={},this._olderThreadId=null,this._resuming=null,this._refused=null,this._loadingThreadId=null,this._chat.value!==c&&this._chat.next(c),t};_endChat=()=>{let t=this._retireChat();if(t){if(!t.client.getIsLoading()&&m(t.client))return void t.dispose();this._finishing.add(t)}}}
1
+ import{ChatClient as e,fetchServerSentEvents as t}from"@tanstack/ai-client";import{BehaviorSubject as s}from"rxjs";import{skip as i}from"rxjs/operators";import{isShallowEqual as a}from"@salsita-ai/common/utils";import{AssistantRequestError as r}from"#package/client";import{createBrowserDetailsClientTool as n}from"./browser-details.js";import{ChangeRecorder as o}from"./change-recorder.js";import{createApplyClientTool as l,createQueryClientTool as h,toToolResult as d}from"./graphql-tools.js";let c=Object.freeze({messages:Object.freeze([]),isLoading:!1,error:void 0,failedStatus:void 0,isContinuable:!0,isLoaded:!1,isResuming:!1,earlierThreads:Object.freeze([]),hasEarlierThread:!1,isLoadingEarlierThread:!1}),u=Object.freeze({open:!1,hasUnreadReply:!1,isInputFocused:!1}),_=Object.freeze({}),g=d({results:[],committed:!1,sideEffects:[],warnings:[],screenshots:new Map,message:"Nothing was run, because the user closed the configurator while this reply was being written. Do not call any more tools in this reply and end it now. The tools work again as soon as the user writes the next message."}),f=e=>{if(e.getError())return!0;let t=e.getMessages().at(-1)?.parts.at(-1);return t?.type!=="tool-call"&&t?.type!=="tool-result"};export class AssistantSystem{_context;_tools;_chat=new s(c);_panel=new s(u);_activation=null;_current=null;_finishing=new Set;_olderThreadId=null;_resuming=null;_refused=null;_firstAttempt=null;_chain={};_loadingThreadId=null;_recorder;_recording=null;_applyToolCallIds=new WeakMap;_undoTipToolCallId=new s(void 0);_screenshotUrls=new Map;constructor(e){this._context=e;let{configuratorExtensionSelectors:t,domainContextSelectors:s,domainServicesSelectors:i,getAssistantSetup:a}=e;this._recorder=new o({maxEntities:30},{readers:{selectedEntityId:e=>s.getNavigationSystem().getActiveSelectionState(e),navigationState:e=>s.getNavigationSystem().getActiveNavigationState(e),viewState:e=>s.getNavigationSystem().getActiveViewState(e),toolState:e=>s.getNavigationSystem().getActiveToolState(e)},getExposedFields:()=>a().manifest?.fields??_,resolveLocalizable:e=>i.getResolveLocalizable()(e)});let r={getGraphQLSystem:()=>t.getGraphQLSystem(),getStoreSystem:()=>s.getStoreSystem(),getActiveMode:()=>s.getActiveMode(),getIsViewMode:()=>s.getIsViewMode(),clearChanges:()=>this._recorder.clear(this._committedState()),rememberCommit:(e,t)=>{this._applyToolCallIds.set(t,e),this._refreshUndoTip()}};this._tools=[n(),h(r),l(r)],s.getUndoSystem().tip$.subscribe(this._refreshUndoTip)}chat$=this._chat;panel$=this._panel;undoTipToolCallId$=this._undoTipToolCallId;getSessionManifest=()=>this._context.getAssistantSetup().manifest;initialize=()=>{let{committed:e}=this._context.domainContextSelectors.getStoreSystem().stateSlices;this._recording??=e.pipe(i(1)).subscribe(this._recorder.record),this._recorder.reset(e.value.state),this._endChat(),this._patchPanel(u),this._releaseScreenshotUrls(),this._activation&&this._startClient()};activate=()=>{this._endChat();let e={};return this._activation=e,this._startClient(),()=>{this._activation===e&&(this._activation=null,this._endChat())}};send=async e=>{if(!this._chat.value.isContinuable&&!await this.resume())return;let t=this._current;if(!t)return;let s={changes:this._recorder.take(this._committedState())};this._firstAttempt=t;try{await this._sendOn(t,e,s);let i=this._findRefusedMessageIndex(t);if(-1===i)return;this._refused={chat:t,index:i}}finally{this._firstAttempt===t&&(this._firstAttempt=null)}if(!await this.resume())return;let i=this._current;i&&await this._sendOn(i,e,s)};resume=async()=>{let e=this._current;if(!e)return!1;if(this._chat.value.isContinuable)return!0;if(this._resuming)return this._resuming;let t=this._resume(e).finally(()=>{this._resuming===t&&(this._resuming=null)});return this._resuming=t,t};loadScreenshotUrl=e=>{let t=this._screenshotUrls.get(e);if(t)return t;let s=this._current;if(!s)return Promise.reject(Error(`The screenshot ${e} cannot be read, because the assistant chat is not active. Open the assistant panel of the configuration first.`));let i=this._screenshotUrls,a=s.authorizedClient.getAssistantImage(s.configurationId,e).then(e=>URL.createObjectURL(e));return i.set(e,a),a.catch(()=>{i.get(e)===a&&i.delete(e)}),a};loadEarlierThread=async()=>{let e=this._current,t=this._olderThreadId;if(!e||null===t||this._loadingThreadId===t)return;let s=this._chain;this._loadingThreadId=t,this._chat.next({...this._chat.value,isLoadingEarlierThread:!0});try{let i=await e.authorizedClient.getAssistantEarlierThread(e.configurationId,t,50);if(this._chain!==s||this._olderThreadId!==t)return;this._olderThreadId=i.previousThreadId,this._chat.next({...this._chat.value,earlierThreads:[{threadId:t,messages:i.messages},...this._chat.value.earlierThreads],hasEarlierThread:null!==i.previousThreadId})}catch(e){this._context.domainServicesSelectors.getLogger().warn("Could not load the earlier assistant conversation",{error:e})}finally{this._chain===s&&this._loadingThreadId===t&&(this._loadingThreadId=null,this._chat.next({...this._chat.value,isLoadingEarlierThread:!1}))}};stop=async()=>{let e=this._current;if(!e)return;let t=e.client.getCurrentRunId();if(e.client.stop(),null!=t)try{let s=e.getConnection();await fetch(`${s.url}/runs/${encodeURIComponent(t)}/cancel`,{method:"POST",headers:await s.headers()})}catch(e){this._context.domainServicesSelectors.getLogger().warn("Could not cancel the assistant run on the server",{error:e})}};reloadThread=()=>{if(!this._activation)return;let e=this._retireChat();e?.client.stop(),e?.dispose(),this._recorder.reset(this._committedState()),this._startClient()};undoToolCalls=e=>{let t=this._context.domainContextSelectors.getUndoSystem(),s=()=>{let t=this._findTipToolCallId();return void 0!==t&&e.has(t)};for(;s();)t.undo()};setOpen=e=>{this._patchPanel(e?{open:e,hasUnreadReply:!1}:{open:e,isInputFocused:!1})};setInputFocused=e=>{this._patchPanel({isInputFocused:e})};_findRefusedMessageIndex=e=>{var t;let s,{failedStatus:i,isContinuable:a}=this._chat.value;return this._firstAttempt===e&&e.generation.active&&409===i&&!a?(s=(t=e.client.getMessages()).map(e=>e.role).lastIndexOf("user"),t.slice(s+1).every(e=>0===e.parts.length)?s:-1):-1};_sendOn=async(e,t,s)=>{let{client:i}=e;i.getIsLoading()||null===i.getResumeState()||i.stop();try{await i.sendMessage({content:t,metadata:s})}catch(s){let t=s instanceof Error?s:Error(String(s));e.generation.active&&this._chat.next({...this._chat.value,error:t}),this._context.domainServicesSelectors.getLogger().error("The assistant message could not be sent",{},t)}};_resume=async e=>{this._chat.next({...this._chat.value,isResuming:!0,error:void 0,failedStatus:void 0});try{let{previousThreadId:t}=await e.authorizedClient.compactAssistantThread(e.configurationId);if(!e.generation.active)return!1;let{messages:s,earlierThreads:i,hasEarlierThread:a}=this._chat.value,r=this._refused?.chat===e?s.slice(0,this._refused.index):s;return e.generation.active=!1,this._current=null,e.client.stop(),e.dispose(),this._chat.next({...c,earlierThreads:[...i,{threadId:t,messages:r}],hasEarlierThread:a,isLoadingEarlierThread:null!==this._loadingThreadId}),this._startClient(),!0}catch(s){let t=s instanceof Error?s:Error(String(s));if(t instanceof r&&409===t.status)return e.generation.active&&this.reloadThread(),!1;return e.generation.active&&this._chat.next({...this._chat.value,isResuming:!1,error:t,failedStatus:t instanceof r?t.status:void 0}),this._context.domainServicesSelectors.getLogger().error("The assistant thread could not be resumed",{},t),!1}};_findTipToolCallId=()=>{let e=this._context.domainContextSelectors.getUndoSystem(),t=e.tip$.value?.committedState;return void 0!==t&&e.canUndo()?this._applyToolCallIds.get(t):void 0};_refreshUndoTip=()=>{let e=this._findTipToolCallId();e!==this._undoTipToolCallId.value&&this._undoTipToolCallId.next(e)};_committedState=()=>this._context.domainContextSelectors.getStoreSystem().stateSlices.committed.value.state;_patchPanel=e=>{let t={...this._panel.value,...e};a(t,this._panel.value)||this._panel.next(t)};_takeOverThread=e=>{for(let t of this._finishing)t.configurationId===e&&(t.client.stop(),t.dispose())};_startClient=()=>{let s={active:!0},i=this._context.getConfigurationId();this._takeOverThread(i);let r=this._context.getAuthorizedClient(),n=()=>{if(s.active){let{manifest:e,error:t}=this._context.getAssistantSetup();if(t)throw t;if(!e)throw Error("The assistant is disabled for this session.")}return r.getAssistantChatConnection(i)},o=e=>{if(!s.active)return;let t={...this._chat.value,...e};a(t,this._chat.value)||this._chat.next(t)},l=async(e,t)=>{let i=await fetch(e,t).finally(()=>o({isLoaded:!0})),a=i.headers.get("x-assistant-thread-continuable");return null!=a&&i.ok&&s.active&&0===this._chat.value.earlierThreads.length&&(this._olderThreadId=i.headers.get("x-assistant-previous-thread")),o({failedStatus:i.ok?void 0:i.status,...null!=a&&{isContinuable:"false"!==a,hasEarlierThread:null!==this._olderThreadId}}),i},h=async()=>({headers:await n().headers(),fetchClient:l}),d=t(()=>n().url,h),c=t(()=>`${n().url}/runs`,h),u=this._tools.map(e=>({...e,execute:(t,i)=>{if(!s.active)return g;let{manifest:a,error:r}=this._context.getAssistantSetup();return r||!a?{error:r?.message??"The assistant is disabled for this session."}:e.execute?.(t,i)}})),_=new e({threadId:`assistant:${i}`,connection:{...d,joinRun:c.joinRun},persistence:!0,history:{pageSize:50},tools:u,onMessagesChange:e=>o({messages:e}),onLoadingChange:e=>{let t=s.active&&this._chat.value.isLoading;o({isLoading:e}),!e&&f(_)&&(s.active?t&&!this._panel.value.open&&this._patchPanel({hasUnreadReply:!0}):p())},onErrorChange:e=>{s.active&&e!==this._chat.value.error&&(!e||-1===this._findRefusedMessageIndex(v))&&(o({error:e}),e&&this._context.domainServicesSelectors.getLogger().error("The assistant request failed",{status:this._chat.value.failedStatus},e))}}),m=!1,p=()=>{m||(m=!0,this._finishing.delete(v),_.dispose())},v={client:_,configurationId:i,generation:s,authorizedClient:r,getConnection:n,dispose:p};this._current=v,_.attach()};_retireChat=()=>{let e=this._current;return this._current=null,e&&(e.generation.active=!1),this._chain={},this._olderThreadId=null,this._resuming=null,this._refused=null,this._loadingThreadId=null,this._chat.value!==c&&this._chat.next(c),e};_releaseScreenshotUrls=()=>{for(let e of this._screenshotUrls.values())e.then(URL.revokeObjectURL,()=>void 0);this._screenshotUrls=new Map};_endChat=()=>{let e=this._retireChat();if(e){if(!e.client.getIsLoading()&&f(e.client))return void e.dispose();this._finishing.add(e)}}}
@@ -3,11 +3,11 @@ import type { DomainEntity, DomainMode, DomainState } from '#package/domain';
3
3
  import type { GraphQLExecution, GraphQLSystem } from '../graphql-system/graphql-system.js';
4
4
  /**
5
5
  * What the assistant's client tools need from the running configurator, as accessors they call when
6
- * the model calls them: a tool call always runs against the systems and the session mode current at
7
- * 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.
8
8
  */
9
9
  export interface AssistantToolDependencies {
10
- readonly getGraphQLSystem: () => Pick<GraphQLSystem, 'prepare' | 'execute' | 'readSideEffects' | 'readScreenshots'>;
10
+ readonly getGraphQLSystem: () => Pick<GraphQLSystem, 'prepare' | 'execute' | 'readSideEffects' | 'readWarnings' | 'readScreenshots'>;
11
11
  readonly getStoreSystem: () => {
12
12
  readonly isInitialized: boolean;
13
13
  readonly stateSlices: {
@@ -19,6 +19,11 @@ export interface AssistantToolDependencies {
19
19
  };
20
20
  };
21
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;
22
27
  /** Forgets the changes recorded for the next change record, so it never lists what the agent itself changed. */
23
28
  readonly clearChanges: () => void;
24
29
  /**
@@ -30,7 +35,8 @@ export interface AssistantToolDependencies {
30
35
  /**
31
36
  * A tool result as the chat client accepts it: content parts, the execution's JSON as a text part
32
37
  * followed, per screenshot, by its label as a text part and its picture as an image part, so the
33
- * model reads each picture under the label its `image` field returned. The client deep-clones a
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
34
40
  * result and rejects anything that is not plain JSON, so the `GraphQLError` instances of a result
35
41
  * are formatted through their `toJSON` and `undefined` members are dropped. The prepared state stays
36
42
  * in the browser.
@@ -39,12 +45,16 @@ export declare const toToolResult: ({ preparedState, screenshots, ...execution }
39
45
  /**
40
46
  * Browser implementation of the assistant's `query` tool: prepares the operations from the
41
47
  * committed state and drops their emissions, so mutations in the list show a hypothetical state and
42
- * the configuration, the undo stack and the saved revision stay as they were. The side effects of
43
- * 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.
44
50
  */
45
51
  export declare const createQueryClientTool: (dependencies: AssistantToolDependencies) => import("@tanstack/ai").ClientTool<{
46
52
  type: string;
47
53
  properties: {
54
+ title: {
55
+ type: string;
56
+ description: string;
57
+ };
48
58
  operations: {
49
59
  type: string;
50
60
  minItems: number;
@@ -74,6 +84,10 @@ export declare const createQueryClientTool: (dependencies: AssistantToolDependen
74
84
  inputSchema: {
75
85
  type: string;
76
86
  properties: {
87
+ title: {
88
+ type: string;
89
+ description: string;
90
+ };
77
91
  operations: {
78
92
  type: string;
79
93
  minItems: number;
@@ -109,13 +123,28 @@ export declare const createQueryClientTool: (dependencies: AssistantToolDependen
109
123
  * including why nothing was committed when a commit was held or lost to a conflict. A commit clears
110
124
  * the recorded changes; a held one does not, so it shows in the next change record once the user
111
125
  * approves it. The state it committed or held is remembered under the id of the call, so the chip
112
- * row of the call can undo it. Only an owner
113
- * session may change the configuration; the check lives here and not in the `GraphQLSystem`, whose
114
- * 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.
115
140
  */
116
141
  export declare const createApplyClientTool: (dependencies: AssistantToolDependencies) => import("@tanstack/ai").ClientTool<{
117
142
  type: string;
118
143
  properties: {
144
+ title: {
145
+ type: string;
146
+ description: string;
147
+ };
119
148
  operations: {
120
149
  type: string;
121
150
  minItems: number;
@@ -145,6 +174,10 @@ export declare const createApplyClientTool: (dependencies: AssistantToolDependen
145
174
  inputSchema: {
146
175
  type: string;
147
176
  properties: {
177
+ title: {
178
+ type: string;
179
+ description: string;
180
+ };
148
181
  operations: {
149
182
  type: string;
150
183
  minItems: number;
@@ -1 +1 @@
1
- import{AssistantGraphQLToolInput as e,applyTool as t,queryTool as o}from"@salsita-ai/contracts/assistant";let s=e=>({results:[],committed:!1,message:e,sideEffects:[],screenshots:new Map});export const toToolResult=({preparedState:e,screenshots:t,...o})=>[{type:"text",content:JSON.stringify(o)},...[...t].flatMap(([e,{data:t,mimeType:o}])=>[{type:"text",content:e},{type:"image",source:{type:"data",value:t,mimeType:o}}])];let a=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:s(`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=a(t);if(!o.ok)return toToolResult(o.refusal);let i=e.getStoreSystem();if(!i.isInitialized)return toToolResult(s("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 r=e.getGraphQLSystem(),n=await r.prepare(i.stateSlices.committed.value.state,o.operations);return toToolResult({results:n.map(({result:e})=>e),committed:!1,sideEffects:r.readSideEffects(n),screenshots:r.readScreenshots(n)})});export const createApplyClientTool=e=>t.client(async(t,o)=>{if("owner"!==e.getActiveMode())return toToolResult(s("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 i=a(t);if(!i.ok)return toToolResult(i.refusal);let r=await e.getGraphQLSystem().execute(i.operations),n=o?.toolCallId;return void 0!==n&&void 0!==r.preparedState&&e.rememberCommit(n,r.preparedState),r.committed&&e.clearChanges(),toToolResult(r)});
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)});
@@ -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. */
@@ -27,18 +28,17 @@ export interface EntityMetaContext {
27
28
  readonly takeScreenshot: (source: EntityMetaSource, view: string) => Promise<{
28
29
  readonly image: string;
29
30
  } | null>;
30
- }
31
- /** One reason a dry-run reports for a change that cannot be made; a violation can sit on a virtual entity. */
32
- interface DryRunError {
33
- readonly type: string;
34
- readonly entityId: EntityId<DomainEntity<string>> | null;
35
- readonly message: string | 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>;
36
36
  }
37
37
  /**
38
38
  * The value of an entity's `meta` field: its built-ins, resolved lazily against the state the entity
39
39
  * was read on. `childRecipes` and `replaceRecipes` list the manifest's recipe groups of their kind
40
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.
41
+ * `screenshot` renders the entity there, and `warnings` lists the warnings and notices the entity holds there.
42
42
  */
43
43
  export declare const createEntityMeta: (source: EntityMetaSource, context: EntityMetaContext) => {
44
44
  childRecipes: () => {
@@ -56,13 +56,15 @@ export declare const createEntityMeta: (source: EntityMetaSource, context: Entit
56
56
  changedEntities: never[];
57
57
  deletedEntityIds: never[];
58
58
  sideEffects: never[];
59
- errors: readonly DryRunError[];
59
+ warnings: never[];
60
+ errors: readonly ViolationEntry[];
60
61
  } | {
61
62
  ok: boolean;
62
63
  root: unknown;
63
64
  changedEntities: {}[];
64
65
  deletedEntityIds: DomainEntityId<string>[];
65
66
  sideEffects: readonly string[];
67
+ warnings: () => readonly import("./violations.js").AssistantWarning[];
66
68
  errors: never[];
67
69
  } | null;
68
70
  }[];
@@ -82,13 +84,15 @@ export declare const createEntityMeta: (source: EntityMetaSource, context: Entit
82
84
  changedEntities: never[];
83
85
  deletedEntityIds: never[];
84
86
  sideEffects: never[];
85
- errors: readonly DryRunError[];
87
+ warnings: never[];
88
+ errors: readonly ViolationEntry[];
86
89
  } | {
87
90
  ok: boolean;
88
91
  root: unknown;
89
92
  changedEntities: {}[];
90
93
  deletedEntityIds: DomainEntityId<string>[];
91
94
  sideEffects: readonly string[];
95
+ warnings: () => readonly import("./violations.js").AssistantWarning[];
92
96
  errors: never[];
93
97
  } | null;
94
98
  }[];
@@ -98,5 +102,6 @@ export declare const createEntityMeta: (source: EntityMetaSource, context: Entit
98
102
  }) => Promise<{
99
103
  readonly image: string;
100
104
  } | null>;
105
+ warnings: () => readonly import("./violations.js").AssistantWarning[];
101
106
  };
102
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"),screenshot:({view:e})=>u.takeScreenshot(a,e)}};
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)}};