@salsita-ai/sdk 0.49.0-develop.fc391028c9 → 0.50.0-develop.03ef51a292

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 (798) hide show
  1. package/CHANGELOG.md +479 -0
  2. package/README.md +20 -12
  3. package/dist/admin/create-admin-pages-from-spec.d.ts +1 -1
  4. package/dist/application-spec/errors/diagnostic-codes.d.ts +6 -0
  5. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  6. package/dist/application-spec/errors/diagnostic-messages.d.ts +6 -0
  7. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  8. package/dist/application-spec/generate-application/code/common/index.d.ts +1 -0
  9. package/dist/application-spec/generate-application/code/common/index.js +1 -1
  10. package/dist/application-spec/generate-application/code/common/project-module-list.d.ts +8 -0
  11. package/dist/application-spec/generate-application/code/common/project-module-list.js +3 -0
  12. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  13. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  14. package/dist/application-spec/generate-application/code/templates/admin-domain-code.d.ts +1 -2
  15. package/dist/application-spec/generate-application/code/templates/admin-domain-code.js +6 -14
  16. package/dist/application-spec/generate-application/code/templates/admin-frontend-code.d.ts +1 -2
  17. package/dist/application-spec/generate-application/code/templates/admin-frontend-code.js +4 -4
  18. package/dist/application-spec/generate-application/code/templates/application-types.js +6 -6
  19. package/dist/application-spec/generate-application/code/templates/configurator-domain-code.d.ts +2 -2
  20. package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js +7 -13
  21. package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.d.ts +1 -2
  22. package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.js +7 -9
  23. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.d.ts +2 -2
  24. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.js +1 -1
  25. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.d.ts +3 -1
  26. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +70 -66
  27. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +3 -0
  28. package/dist/application-spec/generate-application/code/templates/domain-spec.js +7 -7
  29. package/dist/application-spec/generate-application/code/templates/domain.js +4 -4
  30. package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.d.ts +11 -0
  31. package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.js +8 -0
  32. package/dist/application-spec/generate-application/code/templates/global-definition/index.d.ts +1 -0
  33. package/dist/application-spec/generate-application/code/templates/global-definition/index.js +1 -1
  34. package/dist/application-spec/generate-application/code/templates/globals.js +1 -0
  35. package/dist/application-spec/generate-application/code/templates/index.d.ts +7 -6
  36. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  37. package/dist/application-spec/generate-application/code/templates/skills/agents-md.js +2 -0
  38. package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -0
  39. package/dist/application-spec/generate-application/code/templates/{phoenix-create-configurator-skill.d.ts → skills/phoenix-create-configurator-skill.d.ts} +1 -1
  40. package/dist/application-spec/generate-application/code/templates/{phoenix-create-configurator-skill.js → skills/phoenix-create-configurator-skill.js} +43 -13
  41. package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +54 -0
  42. package/dist/application-spec/generate-application/code/templates/{phoenix-review-skill.js → skills/phoenix-review-skill.js} +7 -5
  43. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -0
  44. package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.d.ts +1 -0
  45. package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.js +6 -0
  46. package/dist/application-spec/generate-application/code/templates/{common → skills}/sdk-content.d.ts +53 -3
  47. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +81 -0
  48. package/dist/application-spec/generate-application/code/templates/webhook-builders.js +8 -4
  49. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +2 -0
  50. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
  51. package/dist/application-spec/generate-application/runtime/sections/actions-runtime.d.ts +14 -0
  52. package/dist/application-spec/generate-application/runtime/sections/actions-runtime.js +1 -0
  53. package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.d.ts +4 -3
  54. package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.js +1 -1
  55. package/dist/application-spec/generate-application/runtime/sections/index.d.ts +1 -0
  56. package/dist/application-spec/generate-application/runtime/sections/index.js +1 -1
  57. package/dist/application-spec/parse-application-files/categorize/categorize-files.d.ts +3 -1
  58. package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
  59. package/dist/application-spec/parse-application-files/merge/index.d.ts +1 -0
  60. package/dist/application-spec/parse-application-files/merge/index.js +1 -1
  61. package/dist/application-spec/parse-application-files/merge/merged-actions.d.ts +11 -0
  62. package/dist/application-spec/parse-application-files/merge/merged-actions.js +1 -0
  63. package/dist/application-spec/parse-application-files/merge/merged-spec.d.ts +2 -0
  64. package/dist/application-spec/parse-application-files/merge/merged-spec.js +1 -1
  65. package/dist/application-spec/parse-application-files/raw-spec/index.d.ts +1 -0
  66. package/dist/application-spec/parse-application-files/raw-spec/index.js +1 -1
  67. package/dist/application-spec/parse-application-files/raw-spec/raw-actions.d.ts +18 -0
  68. package/dist/application-spec/parse-application-files/raw-spec/raw-actions.js +1 -0
  69. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +14 -2
  70. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  71. package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.d.ts +2 -0
  72. package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
  73. package/dist/application-spec/parse-application-files/resolve/resolve-import-modules.js +1 -1
  74. package/dist/application-spec/parse-application-files/spec/application/application-spec.js +1 -1
  75. package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.d.ts +4 -2
  76. package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.js +1 -1
  77. package/dist/application-spec/parse-application-files/spec/common/index.d.ts +1 -0
  78. package/dist/application-spec/parse-application-files/spec/common/index.js +1 -1
  79. package/dist/application-spec/parse-application-files/spec/common/schema-ref-resolver.d.ts +23 -0
  80. package/dist/application-spec/parse-application-files/spec/common/schema-ref-resolver.js +1 -0
  81. package/dist/application-spec/parse-application-files/spec/model/names/action-name.d.ts +10 -0
  82. package/dist/application-spec/parse-application-files/spec/model/names/action-name.js +1 -0
  83. package/dist/application-spec/parse-application-files/spec/model/names/index.d.ts +1 -0
  84. package/dist/application-spec/parse-application-files/spec/model/names/index.js +1 -1
  85. package/dist/application-spec/parse-application-files/spec/sections/actions.d.ts +35 -0
  86. package/dist/application-spec/parse-application-files/spec/sections/actions.js +1 -0
  87. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.d.ts +5 -21
  88. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.js +1 -1
  89. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +14 -39
  90. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  91. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-server-settings.d.ts +2 -2
  92. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant.d.ts +5 -19
  93. package/dist/application-spec/parse-application-files/spec/sections/index.d.ts +1 -0
  94. package/dist/application-spec/parse-application-files/spec/sections/index.js +1 -1
  95. package/dist/client/phoenix-api.d.ts +63 -31
  96. package/dist/configurator/application-runtime/extensions/configurator-extension-systems.d.ts +2 -1
  97. package/dist/configurator/application-runtime/extensions/configurator-extension-systems.js +1 -1
  98. package/dist/configurator/application-runtime/extensions/selectors.d.ts +2 -1
  99. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  100. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +180 -0
  101. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -0
  102. package/dist/configurator/{assistant → application-runtime/extensions/systems/assistant-system}/browser-details.d.ts +1 -1
  103. package/dist/configurator/application-runtime/extensions/systems/assistant-system/browser-details.js +1 -0
  104. package/dist/configurator/application-runtime/extensions/systems/assistant-system/change-recorder.d.ts +85 -0
  105. package/dist/configurator/application-runtime/extensions/systems/assistant-system/change-recorder.js +1 -0
  106. package/dist/configurator/{assistant → application-runtime/extensions/systems/assistant-system}/graphql-tools.d.ts +20 -16
  107. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -0
  108. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +4 -0
  109. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  110. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +16 -1
  111. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  112. package/dist/configurator/application-runtime/extensions/systems/graphql-system/side-effects.d.ts +9 -0
  113. package/dist/configurator/application-runtime/extensions/systems/graphql-system/side-effects.js +1 -0
  114. package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -0
  115. package/dist/configurator/application-runtime/extensions/systems/index.js +1 -1
  116. package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.d.ts +2 -0
  117. package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.js +1 -1
  118. package/dist/configurator/common/frontend-analytics.d.ts +21 -21
  119. package/dist/configurator/index.d.ts +0 -1
  120. package/dist/configurator/index.js +1 -1
  121. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  122. package/dist/configurator/scene/scene-analytics/scene-analytics.d.ts +2 -2
  123. package/dist/configurator/ui/assistant/AssistantChips.d.ts +11 -0
  124. package/dist/configurator/ui/assistant/AssistantChips.js +1 -0
  125. package/dist/configurator/ui/assistant/AssistantComposer.d.ts +6 -0
  126. package/dist/configurator/ui/assistant/AssistantComposer.js +1 -0
  127. package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +7 -0
  128. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -0
  129. package/dist/configurator/ui/assistant/AssistantPanel.d.ts +11 -0
  130. package/dist/configurator/ui/assistant/AssistantPanel.js +1 -0
  131. package/dist/configurator/ui/assistant/AssistantThread.d.ts +6 -0
  132. package/dist/configurator/ui/assistant/AssistantThread.js +1 -0
  133. package/dist/configurator/ui/assistant/assistant-failure.d.ts +18 -0
  134. package/dist/configurator/ui/assistant/assistant-failure.js +1 -0
  135. package/dist/configurator/ui/assistant/index.d.ts +2 -0
  136. package/dist/configurator/ui/assistant/index.js +1 -0
  137. package/dist/configurator/ui/assistant/streamed-markdown.d.ts +6 -0
  138. package/dist/configurator/ui/assistant/streamed-markdown.js +2 -0
  139. package/dist/configurator/ui/assistant/theme.d.ts +2 -0
  140. package/dist/configurator/ui/assistant/theme.js +1 -0
  141. package/dist/configurator/ui/assistant/thread-items.d.ts +37 -0
  142. package/dist/configurator/ui/assistant/thread-items.js +1 -0
  143. package/dist/configurator/ui/assistant/tool-chip.d.ts +44 -0
  144. package/dist/configurator/ui/assistant/tool-chip.js +1 -0
  145. package/dist/configurator/ui/assistant/use-follow-stream.d.ts +17 -0
  146. package/dist/configurator/ui/assistant/use-follow-stream.js +1 -0
  147. package/dist/configurator/ui/assistant/use-is-assistant-panel-open.d.ts +5 -0
  148. package/dist/configurator/ui/assistant/use-is-assistant-panel-open.js +1 -0
  149. package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.js +5 -5
  150. package/dist/configurator/ui/configurator-layout/universal/MobileLayout.d.ts +2 -0
  151. package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +4 -4
  152. package/dist/configurator/ui/legacy/mobile-controls/MobileControls.d.ts +1 -1
  153. package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.d.ts +10 -0
  154. package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -0
  155. package/dist/configurator/ui/phoenix-layout-elements/index.d.ts +1 -0
  156. package/dist/configurator/ui/phoenix-layout-elements/index.js +1 -1
  157. package/dist/docs/complex-use-cases/filtered-controls-with-fix-dialog.mdx +84 -98
  158. package/dist/docs/complex-use-cases/navigation-reset-selection.mdx +18 -12
  159. package/dist/docs/index.json +12 -2
  160. package/dist/docs/layouts/custom-price.mdx +14 -16
  161. package/dist/docs/layouts/sidebar/tabs.mdx +24 -21
  162. package/dist/docs/layouts/toolbar.mdx +6 -0
  163. package/dist/docs/other-features/domain-actions.mdx +418 -0
  164. package/dist/docs/other-features/side-effects.mdx +68 -34
  165. package/dist/docs/other-features/transformers.mdx +1 -1
  166. package/dist/docs/phoenix/admin.mdx +11 -26
  167. package/dist/docs/phoenix/best-practices.mdx +1 -0
  168. package/dist/docs/phoenix/finalization.mdx +1 -1
  169. package/dist/docs/phoenix/integration/headless-mode-external.mdx +5 -5
  170. package/dist/docs/phoenix/integration/widget-mode-external.mdx +5 -5
  171. package/dist/docs/phoenix/localization.mdx +3 -22
  172. package/dist/docs/phoenix/migrations.mdx +45 -5
  173. package/dist/docs/phoenix/phoenix-cli.mdx +139 -20
  174. package/dist/docs/phoenix/project-structure.mdx +13 -3
  175. package/dist/docs/phoenix/sdk-builder-workflow.mdx +12 -8
  176. package/dist/docs/phoenix/state-management.mdx +1 -1
  177. package/dist/docs/recipes-and-delete/recipe-hierarchy-selection.mdx +15 -13
  178. package/dist/docs/relations/hierarchy.mdx +13 -2
  179. package/dist/domain/admin-domain/__generated/enhanced-model.d.ts +1 -2
  180. package/dist/domain/admin-domain/__generated/model/versions/v1.d.ts +1 -1
  181. package/dist/domain/admin-domain/__generated/model/versions/v2.d.ts +1 -1
  182. package/dist/domain/admin-domain/__generated/model/versions/v3.d.ts +1 -1
  183. package/dist/domain/admin-domain/__generated/model/versions/v4.d.ts +1 -1
  184. package/dist/domain/admin-domain/__generated/model/versions/v5.d.ts +1 -1
  185. package/dist/domain/admin-domain/__generated/model/versions/v6.d.ts +2 -2
  186. package/dist/domain/admin-domain/__generated/model/versions/v6.js +1 -1
  187. package/dist/domain/admin-domain/implementation/common-admin-expressions.d.ts +1 -4
  188. package/dist/domain/admin-domain/implementation/common-admin-migrations.d.ts +1 -1
  189. package/dist/domain/admin-domain/index.d.ts +2 -3
  190. package/dist/domain/admin-domain/index.js +1 -1
  191. package/dist/domain/application/admin-page-factories.d.ts +1 -1
  192. package/dist/domain/application/application-config.d.ts +25 -73
  193. package/dist/domain/application/assistant/assistant-manifest.d.ts +63 -0
  194. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +95 -0
  195. package/dist/domain/application/assistant/assistant-value-type.d.ts +9 -0
  196. package/dist/domain/application/assistant/assistant-value-type.js +1 -0
  197. package/dist/domain/application/assistant/build-assistant-manifest.d.ts +4 -0
  198. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -0
  199. package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +3 -0
  200. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -0
  201. package/dist/domain/application/assistant/index.d.ts +4 -0
  202. package/dist/domain/application/assistant/index.js +1 -0
  203. package/dist/domain/application/assistant-field-options.d.ts +2 -3
  204. package/dist/domain/application/assistant-mutations.d.ts +15 -17
  205. package/dist/domain/application/assistant-mutations.js +1 -1
  206. package/dist/domain/application/assistant-recipe-groups.d.ts +2 -6
  207. package/dist/domain/application/configurator-builder.d.ts +33 -18
  208. package/dist/domain/application/configurator-builder.js +1 -1
  209. package/dist/domain/application/element-registration.d.ts +5 -0
  210. package/dist/domain/application/element-registration.js +1 -1
  211. package/dist/domain/application/handler-registration.d.ts +5 -0
  212. package/dist/domain/application/handler-registration.js +1 -1
  213. package/dist/domain/application/index.d.ts +5 -4
  214. package/dist/domain/application/index.js +1 -1
  215. package/dist/domain/application/published-data/create-finalize-admin-domain.d.ts +1 -2
  216. package/dist/domain/application/published-data/map-published-chunked-data.d.ts +1 -1
  217. package/dist/domain/application/published-data/map-published-data.d.ts +1 -2
  218. package/dist/domain/application/resolve-imported-transformers.d.ts +12 -2
  219. package/dist/domain/application/resolve-imported-transformers.js +1 -1
  220. package/dist/domain/available-system-components.js +1 -1
  221. package/dist/domain/core/action/action-factory.d.ts +11 -0
  222. package/dist/domain/core/action/action-factory.js +1 -0
  223. package/dist/domain/core/action/action.d.ts +66 -0
  224. package/dist/domain/core/action/index.d.ts +3 -0
  225. package/dist/domain/core/action/index.js +1 -0
  226. package/dist/domain/core/action/prepare-action-implementations.d.ts +15 -0
  227. package/dist/domain/core/action/prepare-action-implementations.js +5 -0
  228. package/dist/domain/{components → core/component}/component-reader-types.d.ts +1 -2
  229. package/dist/domain/{components → core/component}/debug-state-component.d.ts +1 -1
  230. package/dist/domain/core/component/debug-state-component.js +1 -0
  231. package/dist/domain/{components → core/component}/domain-component-optic.d.ts +6 -6
  232. package/dist/domain/core/component/domain-component-optic.js +16 -0
  233. package/dist/domain/{components → core/component}/drag-state-component.d.ts +1 -1
  234. package/dist/domain/core/component/drag-state-component.js +1 -0
  235. package/dist/domain/{components → core/component}/export-state-component.d.ts +1 -1
  236. package/dist/domain/core/component/export-state-component.js +1 -0
  237. package/dist/domain/{components → core/component}/fullscreen-state-component.d.ts +1 -1
  238. package/dist/domain/core/component/fullscreen-state-component.js +1 -0
  239. package/dist/domain/{components → core/component}/group-components-by-entity-id-and-name.d.ts +1 -2
  240. package/dist/domain/core/component/group-components-by-entity-id-and-name.js +1 -0
  241. package/dist/domain/{components → core/component}/hover-state-component.d.ts +1 -1
  242. package/dist/domain/core/component/hover-state-component.js +1 -0
  243. package/dist/domain/core/component/index.d.ts +18 -0
  244. package/dist/domain/core/component/index.js +1 -0
  245. package/dist/domain/{components → core/component}/legacy-filter.d.ts +2 -2
  246. package/dist/domain/{components → core/component}/navigation-state-component.d.ts +1 -1
  247. package/dist/domain/core/component/navigation-state-component.js +1 -0
  248. package/dist/domain/{components → core/component}/selection-state-component.d.ts +1 -1
  249. package/dist/domain/core/component/selection-state-component.js +1 -0
  250. package/dist/domain/{components → core/component}/system-component-builder.d.ts +1 -2
  251. package/dist/domain/core/component/system-component-builder.js +1 -0
  252. package/dist/domain/{components → core/component}/system-component-filter.d.ts +3 -3
  253. package/dist/domain/core/component/system-virtual-entity.js +1 -0
  254. package/dist/domain/{components → core/component}/tool-state-component.d.ts +1 -1
  255. package/dist/domain/core/component/tool-state-component.js +1 -0
  256. package/dist/domain/{components → core/component}/updates.d.ts +17 -2
  257. package/dist/domain/{components → core/component}/view-state-component.d.ts +1 -1
  258. package/dist/domain/core/component/view-state-component.js +1 -0
  259. package/dist/domain/{components → core/component}/viewport-state-component.d.ts +1 -1
  260. package/dist/domain/core/component/viewport-state-component.js +1 -0
  261. package/dist/domain/core/decoder/create-decoder.d.ts +6 -0
  262. package/dist/domain/core/decoder/create-decoder.js +1 -0
  263. package/dist/domain/core/decoder/decoder.d.ts +6 -0
  264. package/dist/domain/core/decoder/decoder.js +1 -0
  265. package/dist/domain/core/decoder/index.d.ts +2 -0
  266. package/dist/domain/core/decoder/index.js +1 -0
  267. package/dist/domain/core/domain-factory.d.ts +7 -4
  268. package/dist/domain/core/domain-factory.js +1 -1
  269. package/dist/domain/core/domain.d.ts +3 -4
  270. package/dist/domain/core/domain.js +1 -1
  271. package/dist/domain/{expressions → core/expression}/constant-expressions.d.ts +2 -3
  272. package/dist/domain/core/expression/constant-expressions.js +1 -0
  273. package/dist/domain/{expressions → core/expression}/custom-expression.d.ts +4 -5
  274. package/dist/domain/core/expression/custom-expression.js +1 -0
  275. package/dist/domain/core/{expression.d.ts → expression/expression.d.ts} +6 -8
  276. package/dist/domain/core/expression/expression.js +1 -0
  277. package/dist/domain/core/expression/index.d.ts +5 -0
  278. package/dist/domain/core/expression/index.js +1 -0
  279. package/dist/domain/{expressions → core/expression}/memoize-expression.d.ts +2 -2
  280. package/dist/domain/{expressions → core/expression}/prepare-domain-expressions.d.ts +1 -1
  281. package/dist/domain/core/index.d.ts +9 -16
  282. package/dist/domain/core/index.js +1 -1
  283. package/dist/domain/{invariants → core/invariant}/builtin-invariant.d.ts +2 -2
  284. package/dist/domain/{invariants → core/invariant}/custom-invariants.d.ts +2 -3
  285. package/dist/domain/core/invariant/custom-invariants.js +1 -0
  286. package/dist/domain/core/invariant/index.d.ts +5 -0
  287. package/dist/domain/core/invariant/index.js +1 -0
  288. package/dist/domain/{invariants → core/invariant}/invariants.d.ts +12 -4
  289. package/dist/domain/core/invariant/invariants.js +1 -0
  290. package/dist/domain/core/invariant/violation-component.js +1 -0
  291. package/dist/domain/{invariants → core/invariant}/violation.d.ts +2 -2
  292. package/dist/domain/core/{component.d.ts → model/component.d.ts} +1 -1
  293. package/dist/domain/core/model/index.d.ts +6 -0
  294. package/dist/domain/core/model/index.js +1 -0
  295. package/dist/domain/core/{reflection.d.ts → model/reflection.d.ts} +1 -1
  296. package/dist/domain/core/model/reflection.js +1 -0
  297. package/dist/domain/core/schema/enhanced-json-schema.js +1 -0
  298. package/dist/domain/core/schema/extended-schema-validator.js +1 -0
  299. package/dist/domain/core/schema/index.d.ts +3 -0
  300. package/dist/domain/core/schema/index.js +1 -0
  301. package/dist/domain/core/schema/schema-validator.js +1 -0
  302. package/dist/domain/core/state/id-sequence.d.ts +15 -0
  303. package/dist/domain/core/state/id-sequence.js +1 -0
  304. package/dist/domain/core/state/index.d.ts +3 -0
  305. package/dist/domain/core/state/index.js +1 -0
  306. package/dist/domain/core/{migrations.d.ts → state/migrations.d.ts} +1 -2
  307. package/dist/domain/core/{state.d.ts → state/state.d.ts} +1 -2
  308. package/dist/domain/domain-builder.d.ts +16 -6
  309. package/dist/domain/domain-builder.js +1 -1
  310. package/dist/domain/domain-context/action-system/action-system.d.ts +38 -0
  311. package/dist/domain/domain-context/action-system/action-system.js +1 -0
  312. package/dist/domain/domain-context/create-transformer.d.ts +1 -1
  313. package/dist/domain/domain-context/dimension-system/dimension-state.js +1 -1
  314. package/dist/domain/domain-context/dimension-system/dimension-system.d.ts +1 -2
  315. package/dist/domain/domain-context/domain-context-systems.d.ts +5 -4
  316. package/dist/domain/domain-context/index.d.ts +3 -2
  317. package/dist/domain/domain-context/index.js +1 -1
  318. package/dist/domain/domain-context/navigation-system/navigation-system.d.ts +3 -5
  319. package/dist/domain/domain-context/navigation-system/navigation-system.js +1 -1
  320. package/dist/domain/domain-context/navigation-system/navigation-updates.d.ts +1 -12
  321. package/dist/domain/domain-context/navigation-system/navigation-updates.js +1 -1
  322. package/dist/domain/domain-context/navigation-system/selection-transformers.d.ts +1 -1
  323. package/dist/domain/domain-context/navigation-system/selection-transformers.js +1 -1
  324. package/dist/domain/domain-context/recipe-system/recipe-cooker-system.d.ts +1 -2
  325. package/dist/domain/domain-context/recipe-system/recipe-cooker-system.js +1 -1
  326. package/dist/domain/domain-context/recipe-system/recipes.d.ts +1 -3
  327. package/dist/domain/domain-context/recipe-system/recipes.js +1 -1
  328. package/dist/domain/domain-context/relation-transformers/cascade-deletes.d.ts +1 -1
  329. package/dist/domain/domain-context/relation-transformers/cascade-deletes.js +1 -1
  330. package/dist/domain/domain-context/relation-transformers/cascade-ref-pruning.d.ts +1 -1
  331. package/dist/domain/domain-context/relation-transformers/cascade-ref-pruning.js +1 -1
  332. package/dist/domain/domain-context/relation-transformers/create-entity-refs.d.ts +1 -1
  333. package/dist/domain/domain-context/relation-transformers/create-entity-refs.js +2 -2
  334. package/dist/domain/domain-context/relation-transformers/replace-refs.d.ts +1 -1
  335. package/dist/domain/domain-context/relation-transformers/replace-refs.js +1 -1
  336. package/dist/domain/domain-context/store-system/apply-updates.d.ts +1 -3
  337. package/dist/domain/domain-context/store-system/apply-updates.js +1 -1
  338. package/dist/domain/domain-context/store-system/next-domain-entity-id.d.ts +1 -13
  339. package/dist/domain/domain-context/store-system/next-domain-entity-id.js +1 -1
  340. package/dist/domain/domain-context/store-system/reconcile-projected-entities.d.ts +1 -2
  341. package/dist/domain/domain-context/store-system/reconcile-projected-entities.js +1 -1
  342. package/dist/domain/domain-context/store-system/store-system.d.ts +1 -5
  343. package/dist/domain/domain-context/store-system/store-system.js +2 -2
  344. package/dist/domain/domain-context/store-system/system-state.d.ts +1 -3
  345. package/dist/domain/domain-context/store-system/system-state.js +1 -1
  346. package/dist/domain/domain-context/transformers/actions-builder.d.ts +1 -2
  347. package/dist/domain/domain-context/transformers/actions-builder.js +1 -1
  348. package/dist/domain/domain-context/transformers/auto-snap-transformer.d.ts +1 -3
  349. package/dist/domain/domain-context/transformers/chain-builder.d.ts +2 -2
  350. package/dist/domain/domain-context/transformers/context.d.ts +1 -5
  351. package/dist/domain/domain-context/transformers/entity-builder.d.ts +1 -5
  352. package/dist/domain/domain-context/transformers/entity-builder.js +1 -1
  353. package/dist/domain/domain-context/transformers/then-builder.d.ts +1 -2
  354. package/dist/domain/domain-context/transformers/then-builder.js +1 -1
  355. package/dist/domain/domain-context/transformers/when-builder.d.ts +1 -6
  356. package/dist/domain/domain-context/transformers/when-builder.js +1 -1
  357. package/dist/domain/domain-context/undo-system.d.ts +1 -1
  358. package/dist/domain/domain-runtime/domain-context/component-reader.d.ts +1 -4
  359. package/dist/domain/domain-runtime/domain-context/component-reader.js +1 -1
  360. package/dist/domain/domain-runtime/domain-context/domain-context.js +1 -1
  361. package/dist/domain/domain-runtime/domain-context/selectors.d.ts +5 -3
  362. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  363. package/dist/domain/domain-runtime/domain-runtime.d.ts +16 -4
  364. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  365. package/dist/domain/domain-runtime/spec/selectors.d.ts +2 -2
  366. package/dist/domain/domain-runtime/spec/selectors.js +1 -1
  367. package/dist/domain/domain-runtime/spec/types.d.ts +18 -5
  368. package/dist/domain/index.d.ts +1 -25
  369. package/dist/domain/index.js +1 -1
  370. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +9 -3
  371. package/dist/domain/mocks/create-mock-domain-runtime.js +1 -1
  372. package/dist/domain/project-modules/index.d.ts +1 -0
  373. package/dist/domain/project-modules/index.js +1 -0
  374. package/dist/domain/project-modules/project-modules.d.ts +41 -0
  375. package/dist/domain/project-modules/project-modules.js +1 -0
  376. package/dist/domain/projections/blender-projections/blender-projections.d.ts +1 -1
  377. package/dist/domain/projections/blender-projections/blender-projections.js +1 -1
  378. package/dist/domain/projections/composition-projections.js +1 -1
  379. package/dist/domain/projections/projected-entities-projections.d.ts +1 -2
  380. package/dist/domain/projections/snap-matching.d.ts +1 -2
  381. package/dist/domain/projections/snap-utils.d.ts +1 -2
  382. package/dist/domain/projections/validation-projections.d.ts +1 -2
  383. package/dist/domain/projections/validation-projections.js +1 -1
  384. package/dist/domain/relations/all-of-type-relation.d.ts +1 -4
  385. package/dist/domain/relations/all-of-type-relation.js +1 -1
  386. package/dist/domain/relations/component-factories.d.ts +1 -2
  387. package/dist/domain/relations/composed-of.d.ts +1 -1
  388. package/dist/domain/relations/composed-of.js +1 -1
  389. package/dist/domain/relations/direct-relation.d.ts +1 -3
  390. package/dist/domain/relations/indirect-relation.d.ts +1 -4
  391. package/dist/domain/relations/indirect-relation.js +1 -1
  392. package/dist/domain/relations/reference-component.d.ts +3 -5
  393. package/dist/domain/relations/reference-component.js +1 -1
  394. package/dist/domain/relations/reference-field.d.ts +1 -1
  395. package/dist/domain/relations/relation-factory.d.ts +1 -3
  396. package/dist/domain/relations/relation-implementation.d.ts +1 -4
  397. package/dist/domain/system-components/admin-sidebar.d.ts +1 -1
  398. package/dist/domain/system-components/admin-sidebar.js +1 -1
  399. package/dist/domain/system-components/angle-dimension.js +1 -1
  400. package/dist/domain/system-components/angle-indicator.d.ts +1 -1
  401. package/dist/domain/system-components/angle-indicator.js +1 -1
  402. package/dist/domain/system-components/application-config.d.ts +1 -1
  403. package/dist/domain/system-components/application-config.js +1 -1
  404. package/dist/domain/system-components/attribute-selection.js +1 -1
  405. package/dist/domain/system-components/attribute-switch.js +1 -1
  406. package/dist/domain/system-components/autorotate-camera-component.d.ts +1 -1
  407. package/dist/domain/system-components/autorotate-camera-component.js +1 -1
  408. package/dist/domain/system-components/basic-sidebar-footer.d.ts +1 -1
  409. package/dist/domain/system-components/basic-sidebar-footer.js +1 -1
  410. package/dist/domain/system-components/bounding-box-component.d.ts +1 -1
  411. package/dist/domain/system-components/bounding-box-component.js +1 -1
  412. package/dist/domain/system-components/bounding-sphere-component.d.ts +1 -1
  413. package/dist/domain/system-components/bounding-sphere-component.js +1 -1
  414. package/dist/domain/system-components/camera-based-hidden-entity-object.js +1 -1
  415. package/dist/domain/system-components/camera-based-hidden-entity.js +1 -1
  416. package/dist/domain/system-components/canvas-config.d.ts +1 -1
  417. package/dist/domain/system-components/canvas-config.js +1 -1
  418. package/dist/domain/system-components/canvas-custom-environment.js +1 -1
  419. package/dist/domain/system-components/canvas-padding.d.ts +1 -1
  420. package/dist/domain/system-components/canvas-padding.js +1 -1
  421. package/dist/domain/system-components/canvas-preset-environment.d.ts +1 -1
  422. package/dist/domain/system-components/canvas-preset-environment.js +1 -1
  423. package/dist/domain/system-components/child-entity-recipe-hierarchy.d.ts +1 -1
  424. package/dist/domain/system-components/child-entity-recipe-hierarchy.js +1 -1
  425. package/dist/domain/system-components/child-entity-recipes.d.ts +1 -1
  426. package/dist/domain/system-components/child-entity-recipes.js +1 -1
  427. package/dist/domain/system-components/child-entity-selection.d.ts +1 -1
  428. package/dist/domain/system-components/child-entity-selection.js +1 -1
  429. package/dist/domain/system-components/client-side-image.js +1 -1
  430. package/dist/domain/system-components/collision-box-geometry.d.ts +1 -1
  431. package/dist/domain/system-components/collision-box-geometry.js +1 -1
  432. package/dist/domain/system-components/collision-geometries.d.ts +1 -1
  433. package/dist/domain/system-components/collision-geometry.d.ts +1 -1
  434. package/dist/domain/system-components/collision-geometry.js +1 -1
  435. package/dist/domain/system-components/collision-point-geometry.d.ts +1 -1
  436. package/dist/domain/system-components/collision-point-geometry.js +1 -1
  437. package/dist/domain/system-components/color-value.js +1 -1
  438. package/dist/domain/system-components/common/dimension-indicator-schema.d.ts +1 -1
  439. package/dist/domain/system-components/common/dimension-indicator-schema.js +1 -1
  440. package/dist/domain/system-components/constraint.d.ts +1 -1
  441. package/dist/domain/system-components/constraint.js +1 -1
  442. package/dist/domain/system-components/create-blueprint.d.ts +1 -1
  443. package/dist/domain/system-components/custom-header.d.ts +1 -1
  444. package/dist/domain/system-components/custom-header.js +1 -1
  445. package/dist/domain/system-components/custom-price-footer.js +1 -1
  446. package/dist/domain/system-components/custom-scene-entity.d.ts +1 -1
  447. package/dist/domain/system-components/custom-scene-entity.js +1 -1
  448. package/dist/domain/system-components/custom-sidebar-footer.d.ts +1 -1
  449. package/dist/domain/system-components/custom-sidebar-footer.js +1 -1
  450. package/dist/domain/system-components/detail.js +1 -1
  451. package/dist/domain/system-components/dimension-indicator.d.ts +1 -1
  452. package/dist/domain/system-components/dimension-indicator.js +1 -1
  453. package/dist/domain/system-components/distance-dimension-select.d.ts +1 -1
  454. package/dist/domain/system-components/distance-dimension-select.js +1 -1
  455. package/dist/domain/system-components/distance-dimension.d.ts +1 -1
  456. package/dist/domain/system-components/distance-dimension.js +1 -1
  457. package/dist/domain/system-components/drag-handle.d.ts +1 -1
  458. package/dist/domain/system-components/drag-handle.js +1 -1
  459. package/dist/domain/system-components/editable-angle-indicator.d.ts +1 -1
  460. package/dist/domain/system-components/editable-angle-indicator.js +1 -1
  461. package/dist/domain/system-components/editable-distance-dimension-indicator.d.ts +1 -1
  462. package/dist/domain/system-components/editable-distance-dimension-indicator.js +1 -1
  463. package/dist/domain/system-components/editable-offset-indicator.d.ts +1 -1
  464. package/dist/domain/system-components/editable-offset-indicator.js +1 -1
  465. package/dist/domain/system-components/editable-size-indicator.d.ts +1 -1
  466. package/dist/domain/system-components/editable-size-indicator.js +1 -1
  467. package/dist/domain/system-components/entity-header.js +1 -1
  468. package/dist/domain/system-components/exit-tool-mode-fab.d.ts +1 -1
  469. package/dist/domain/system-components/exit-tool-mode-fab.js +1 -1
  470. package/dist/domain/system-components/finalize-action.d.ts +1 -1
  471. package/dist/domain/system-components/finalize-action.js +1 -1
  472. package/dist/domain/system-components/finalize-component.js +1 -1
  473. package/dist/domain/system-components/fit-entity-orthographic-camera-component.js +1 -1
  474. package/dist/domain/system-components/fit-entity-perspective-camera-component.js +1 -1
  475. package/dist/domain/system-components/fit-root-orthographic-camera-component.js +1 -1
  476. package/dist/domain/system-components/fit-root-perspective-camera-component.js +1 -1
  477. package/dist/domain/system-components/fit-selection-orthographic-camera-component.js +1 -1
  478. package/dist/domain/system-components/fit-selection-perspective-camera-component.js +1 -1
  479. package/dist/domain/system-components/fixed-header.d.ts +1 -1
  480. package/dist/domain/system-components/fixed-header.js +1 -1
  481. package/dist/domain/system-components/floating-header.d.ts +1 -1
  482. package/dist/domain/system-components/floating-header.js +1 -1
  483. package/dist/domain/system-components/generic-dimension.d.ts +1 -1
  484. package/dist/domain/system-components/generic-dimension.js +1 -1
  485. package/dist/domain/system-components/hidden-entity.js +1 -1
  486. package/dist/domain/system-components/hidden-header.d.ts +1 -1
  487. package/dist/domain/system-components/hidden-header.js +1 -1
  488. package/dist/domain/system-components/hidden-sidebar-footer.d.ts +1 -1
  489. package/dist/domain/system-components/hidden-sidebar-footer.js +1 -1
  490. package/dist/domain/system-components/horizontal-tabs.d.ts +1 -1
  491. package/dist/domain/system-components/horizontal-tabs.js +1 -1
  492. package/dist/domain/system-components/hotspot-drag-handle.d.ts +1 -2
  493. package/dist/domain/system-components/hotspot-drag-handle.js +1 -1
  494. package/dist/domain/system-components/list-selector-dimension-indicator.d.ts +1 -1
  495. package/dist/domain/system-components/list-selector-dimension-indicator.js +1 -1
  496. package/dist/domain/system-components/material-override-property-transition.js +1 -1
  497. package/dist/domain/system-components/material-override-transformer.js +1 -1
  498. package/dist/domain/system-components/material-swatch.js +1 -1
  499. package/dist/domain/system-components/multilingual-text-value.js +1 -1
  500. package/dist/domain/system-components/navigation-page.js +1 -1
  501. package/dist/domain/system-components/navigation-panel-list.js +1 -1
  502. package/dist/domain/system-components/navigation-steps.js +1 -1
  503. package/dist/domain/system-components/offset-anchors.d.ts +1 -1
  504. package/dist/domain/system-components/offset-anchors.js +1 -1
  505. package/dist/domain/system-components/offset-indicator.d.ts +1 -2
  506. package/dist/domain/system-components/offset-indicator.js +1 -1
  507. package/dist/domain/system-components/offset.d.ts +1 -1
  508. package/dist/domain/system-components/offset.js +1 -1
  509. package/dist/domain/system-components/other-action.d.ts +1 -1
  510. package/dist/domain/system-components/other-action.js +1 -1
  511. package/dist/domain/system-components/phoenix-layout-elements/assistant-toolbar-button.d.ts +44 -0
  512. package/dist/domain/system-components/phoenix-layout-elements/assistant-toolbar-button.js +1 -0
  513. package/dist/domain/system-components/phoenix-layout-elements/index.d.ts +1 -0
  514. package/dist/domain/system-components/phoenix-layout-elements/index.js +1 -1
  515. package/dist/domain/system-components/phoenix-layout-elements/phoenix-layout-element.d.ts +2 -1
  516. package/dist/domain/system-components/phoenix-layout-elements/phoenix-layout-element.js +1 -1
  517. package/dist/domain/system-components/pivot-point.d.ts +1 -1
  518. package/dist/domain/system-components/pivot-point.js +1 -1
  519. package/dist/domain/system-components/price.js +1 -1
  520. package/dist/domain/system-components/projected-entities.d.ts +1 -1
  521. package/dist/domain/system-components/projected-entities.js +1 -1
  522. package/dist/domain/system-components/property-page.d.ts +1 -1
  523. package/dist/domain/system-components/property-page.js +1 -1
  524. package/dist/domain/system-components/read-sidebar-footer.d.ts +1 -1
  525. package/dist/domain/system-components/read-sidebar-footer.js +1 -1
  526. package/dist/domain/system-components/replace-entity-recipe-hierarchy.d.ts +1 -1
  527. package/dist/domain/system-components/replace-entity-recipe-hierarchy.js +1 -1
  528. package/dist/domain/system-components/replace-entity-recipes.d.ts +1 -1
  529. package/dist/domain/system-components/replace-entity-recipes.js +1 -1
  530. package/dist/domain/system-components/rotatable.js +1 -1
  531. package/dist/domain/system-components/rotation-handle.js +1 -1
  532. package/dist/domain/system-components/save-template-thumbnail.js +1 -1
  533. package/dist/domain/system-components/scene-entity-add-fab.js +1 -1
  534. package/dist/domain/system-components/scene-entity-ambient-light.js +1 -1
  535. package/dist/domain/system-components/scene-entity-animation.js +1 -1
  536. package/dist/domain/system-components/scene-entity-box-object.js +1 -1
  537. package/dist/domain/system-components/scene-entity-control.js +1 -1
  538. package/dist/domain/system-components/scene-entity-delete-fab.js +1 -1
  539. package/dist/domain/system-components/scene-entity-directional-light.js +1 -1
  540. package/dist/domain/system-components/scene-entity-floor-object.js +1 -1
  541. package/dist/domain/system-components/scene-entity-html-hotspot.js +1 -1
  542. package/dist/domain/system-components/scene-entity-local-material-override.js +1 -1
  543. package/dist/domain/system-components/scene-entity-material-override.js +1 -1
  544. package/dist/domain/system-components/scene-entity-navigation-hotspot.js +1 -1
  545. package/dist/domain/system-components/scene-entity-object-clip.js +1 -1
  546. package/dist/domain/system-components/scene-entity-object-decal.js +1 -1
  547. package/dist/domain/system-components/scene-entity-object-group.js +1 -1
  548. package/dist/domain/system-components/scene-entity-object-html-hotspot.js +1 -1
  549. package/dist/domain/system-components/scene-entity-object-local-material-override.js +1 -1
  550. package/dist/domain/system-components/scene-entity-object-material-override.js +1 -1
  551. package/dist/domain/system-components/scene-entity-object-properties.js +1 -1
  552. package/dist/domain/system-components/scene-entity-object-remote-material-override.js +1 -1
  553. package/dist/domain/system-components/scene-entity-object-text-decal.js +1 -1
  554. package/dist/domain/system-components/scene-entity-object-transformer.js +1 -1
  555. package/dist/domain/system-components/scene-entity-object-transimissive-material-override.js +1 -1
  556. package/dist/domain/system-components/scene-entity-object.js +1 -1
  557. package/dist/domain/system-components/scene-entity-point-light.js +1 -1
  558. package/dist/domain/system-components/scene-entity-properties.js +1 -1
  559. package/dist/domain/system-components/scene-entity-rect-area-light.js +1 -1
  560. package/dist/domain/system-components/scene-entity-remote-material-override.js +1 -1
  561. package/dist/domain/system-components/scene-entity-remote-object.js +1 -1
  562. package/dist/domain/system-components/scene-entity-select-hotspot.js +1 -1
  563. package/dist/domain/system-components/scene-entity-spot-light.js +1 -1
  564. package/dist/domain/system-components/scene-entity-transimissive-material-override.js +1 -1
  565. package/dist/domain/system-components/scene-entity-wall-object.js +1 -1
  566. package/dist/domain/system-components/selectable-component.js +1 -1
  567. package/dist/domain/system-components/sidebar-tabs.d.ts +1 -1
  568. package/dist/domain/system-components/sidebar-tabs.js +1 -1
  569. package/dist/domain/system-components/simple-summary.js +1 -1
  570. package/dist/domain/system-components/size.d.ts +1 -1
  571. package/dist/domain/system-components/size.js +1 -1
  572. package/dist/domain/system-components/sketching-draw.d.ts +1 -1
  573. package/dist/domain/system-components/sketching-draw.js +1 -1
  574. package/dist/domain/system-components/sketching-edit.d.ts +1 -1
  575. package/dist/domain/system-components/sketching-edit.js +1 -1
  576. package/dist/domain/system-components/sketching-line.d.ts +1 -1
  577. package/dist/domain/system-components/sketching-line.js +1 -1
  578. package/dist/domain/system-components/sketching-rectangle.d.ts +1 -1
  579. package/dist/domain/system-components/sketching-rectangle.js +1 -1
  580. package/dist/domain/system-components/sketching.d.ts +1 -1
  581. package/dist/domain/system-components/sketching.js +1 -1
  582. package/dist/domain/system-components/snap-axis.d.ts +1 -1
  583. package/dist/domain/system-components/snap-axis.js +1 -1
  584. package/dist/domain/system-components/snap-edge.d.ts +1 -1
  585. package/dist/domain/system-components/snap-edge.js +1 -1
  586. package/dist/domain/system-components/snap-plane.d.ts +1 -1
  587. package/dist/domain/system-components/snap-plane.js +1 -1
  588. package/dist/domain/system-components/snap-point.d.ts +1 -1
  589. package/dist/domain/system-components/snap-point.js +1 -1
  590. package/dist/domain/system-components/static-orthographic-camera-component.d.ts +1 -1
  591. package/dist/domain/system-components/static-orthographic-camera-component.js +1 -1
  592. package/dist/domain/system-components/static-perspective-camera-component.d.ts +1 -1
  593. package/dist/domain/system-components/static-perspective-camera-component.js +1 -1
  594. package/dist/domain/system-components/summary-component.js +1 -1
  595. package/dist/domain/system-components/text-value.js +1 -1
  596. package/dist/domain/system-components/tool-controls.js +1 -1
  597. package/dist/domain/system-components/tool-menu-fab.d.ts +1 -1
  598. package/dist/domain/system-components/tool-menu-fab.js +1 -1
  599. package/dist/domain/system-components/toolbar.d.ts +1 -1
  600. package/dist/domain/system-components/toolbar.js +1 -1
  601. package/dist/domain/system-components/universal-sidebar-footer.d.ts +1 -1
  602. package/dist/domain/system-components/universal-sidebar-footer.js +1 -1
  603. package/dist/domain/system-components/view-controls.js +1 -1
  604. package/dist/domain/utils/eval-cache.d.ts +1 -2
  605. package/dist/domain/utils/memo-eval.d.ts +1 -3
  606. package/dist/editor/Editor.js +1 -1
  607. package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
  608. package/dist/editor/domain-editors/apply-spec-update.js +1 -1
  609. package/dist/editor/domain-editors/use-implementation-files.d.ts +11 -6
  610. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  611. package/dist/editor/graphql/GraphQLPanel.js +1 -1
  612. package/dist/editor/variants/VariantAnswerFooter.d.ts +17 -0
  613. package/dist/editor/variants/VariantAnswerFooter.js +1 -0
  614. package/dist/editor/variants/VariantPreviewHandler.d.ts +6 -0
  615. package/dist/editor/variants/VariantPreviewHandler.js +1 -0
  616. package/dist/editor/variants/variant-preview-styles.d.ts +49 -0
  617. package/dist/editor/variants/variant-preview-styles.js +1 -0
  618. package/dist/i18n/locales/cs/messages.js +1 -1
  619. package/dist/i18n/locales/da/messages.js +1 -1
  620. package/dist/i18n/locales/de/messages.js +1 -1
  621. package/dist/i18n/locales/de-AT/messages.js +1 -1
  622. package/dist/i18n/locales/en/messages.js +1 -1
  623. package/dist/i18n/locales/en-AU/messages.js +1 -1
  624. package/dist/i18n/locales/en-GB/messages.js +1 -1
  625. package/dist/i18n/locales/es/messages.js +1 -1
  626. package/dist/i18n/locales/fr/messages.js +1 -1
  627. package/dist/i18n/locales/hu/messages.js +1 -1
  628. package/dist/i18n/locales/it/messages.js +1 -1
  629. package/dist/i18n/locales/nl/messages.js +1 -1
  630. package/dist/i18n/locales/pl/messages.js +1 -1
  631. package/dist/i18n/locales/pt/messages.js +1 -1
  632. package/dist/i18n/locales/ro/messages.js +1 -1
  633. package/dist/i18n/locales/sk/messages.js +1 -1
  634. package/dist/i18n/locales/tr/messages.js +1 -1
  635. package/dist/legacy/domain-cli/gen/configurator-builder.js +21 -8
  636. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  637. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  638. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +6 -0
  639. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-admin.js +18 -19
  640. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-configurator.js +15 -16
  641. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +22 -23
  642. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-configurator.js +15 -16
  643. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/generator-shared.d.ts +7 -2
  644. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/generator-shared.js +8 -12
  645. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/index.d.ts +1 -1
  646. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/index.js +1 -1
  647. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/webhook-builders.js +7 -7
  648. package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
  649. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +4 -3
  650. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  651. package/dist/phoenix/cli.js +1 -1
  652. package/dist/phoenix/commands/build.d.ts +5 -0
  653. package/dist/phoenix/commands/build.js +1 -1
  654. package/dist/phoenix/commands/deploy.js +2 -2
  655. package/dist/phoenix/commands/dev.js +5 -5
  656. package/dist/phoenix/commands/feedback.d.ts +2 -1
  657. package/dist/phoenix/commands/feedback.js +1 -1
  658. package/dist/phoenix/commands/index.d.ts +1 -0
  659. package/dist/phoenix/commands/index.js +1 -1
  660. package/dist/phoenix/commands/login.d.ts +24 -6
  661. package/dist/phoenix/commands/login.js +2 -2
  662. package/dist/phoenix/commands/prepare-deployment-command.js +2 -2
  663. package/dist/phoenix/commands/prepare-local-environment-command.js +1 -1
  664. package/dist/phoenix/commands/story-dev.js +2 -2
  665. package/dist/phoenix/commands/variants.d.ts +35 -0
  666. package/dist/phoenix/commands/variants.js +1 -0
  667. package/dist/phoenix/editor-server/commands-router.d.ts +68 -1
  668. package/dist/phoenix/editor-server/commands-router.js +1 -1
  669. package/dist/phoenix/editor-server/editor-router.d.ts +65 -0
  670. package/dist/phoenix/editor-server/editor-server.d.ts +3 -3
  671. package/dist/phoenix/editor-server/editor-server.js +1 -1
  672. package/dist/phoenix/editor-server/protocol.d.ts +1 -0
  673. package/dist/phoenix/editor-server/spec-router.js +1 -1
  674. package/dist/phoenix/editor-server/trpc.d.ts +3 -0
  675. package/dist/phoenix/scripts/build-admin.js +1 -1
  676. package/dist/phoenix/services/application-spec-project-watcher.d.ts +13 -2
  677. package/dist/phoenix/services/application-spec-project-watcher.js +3 -3
  678. package/dist/phoenix/services/index.d.ts +5 -0
  679. package/dist/phoenix/services/index.js +1 -1
  680. package/dist/phoenix/services/phoenix-application.d.ts +21 -0
  681. package/dist/phoenix/services/phoenix-application.js +1 -0
  682. package/dist/phoenix/services/phoenix-store.d.ts +48 -0
  683. package/dist/phoenix/services/phoenix-store.js +1 -0
  684. package/dist/phoenix/services/phx-banner-plugin.d.ts +32 -0
  685. package/dist/phoenix/services/phx-banner-plugin.js +1 -0
  686. package/dist/phoenix/services/phx-licenses-plugin.d.ts +55 -0
  687. package/dist/phoenix/services/phx-licenses-plugin.js +8 -0
  688. package/dist/phoenix/services/phx-variant-previews-plugin.d.ts +9 -0
  689. package/dist/phoenix/services/phx-variant-previews-plugin.js +1 -0
  690. package/dist/phoenix/services/prepare-development-environment.js +1 -1
  691. package/dist/phoenix/services/variant-file-session.d.ts +36 -0
  692. package/dist/phoenix/services/variant-file-session.js +1 -0
  693. package/dist/phoenix/services/variant-preview-service.d.ts +80 -0
  694. package/dist/phoenix/services/variant-preview-service.js +1 -0
  695. package/dist/phoenix/services/vite-config.d.ts +2 -0
  696. package/dist/phoenix/services/vite-config.js +1 -1
  697. package/dist/phoenix/utils/index.d.ts +1 -0
  698. package/dist/phoenix/utils/index.js +1 -1
  699. package/dist/phoenix/utils/read-git-commit.d.ts +14 -0
  700. package/dist/phoenix/utils/read-git-commit.js +1 -0
  701. package/dist/react-sdk/application-runtime/common-services/analytics/analytics-service.d.ts +2 -2
  702. package/dist/react-sdk/application-runtime/common-services/analytics/domain-controls-analytics.d.ts +21 -21
  703. package/dist/react-sdk/application-runtime/hooks/data/use-published-data.d.ts +1 -1
  704. package/dist/react-sdk/application-runtime/hooks/use-domain-application-props.d.ts +5 -2
  705. package/dist/react-sdk/application-runtime/hooks/use-spec.d.ts +1 -1
  706. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.d.ts +1 -1
  707. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  708. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +16 -4
  709. package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +3 -0
  710. package/dist/ui-sdk/common/use-viewport-size.d.ts +4 -1
  711. package/dist/ui-sdk/common/use-viewport-size.js +1 -1
  712. package/dist/ui-sdk/components/mobile-controls/index.d.ts +1 -1
  713. package/dist/ui-sdk/theme/types.d.ts +4 -0
  714. package/dist/webhook/builders/common.d.ts +3 -0
  715. package/dist/webhook/builders/webhook-builder.d.ts +1 -1
  716. package/dist/webhook/builders/webhook-builder.js +1 -1
  717. package/package.json +5 -8
  718. package/schema/domain-spec.json +24 -0
  719. package/dist/application-spec/generate-application/code/templates/agents-md.js +0 -2
  720. package/dist/application-spec/generate-application/code/templates/common/sdk-content.js +0 -67
  721. package/dist/application-spec/generate-application/code/templates/phoenix-cli-skill.js +0 -1
  722. package/dist/application-spec/generate-application/code/templates/phoenix-feedback-skill.js +0 -31
  723. package/dist/application-spec/generate-application/code/templates/phoenix-skill.js +0 -1
  724. package/dist/configurator/assistant/browser-details.js +0 -1
  725. package/dist/configurator/assistant/graphql-tools.js +0 -1
  726. package/dist/configurator/assistant/index.d.ts +0 -1
  727. package/dist/configurator/assistant/index.js +0 -1
  728. package/dist/configurator/assistant/use-assistant-chat.d.ts +0 -20
  729. package/dist/configurator/assistant/use-assistant-chat.js +0 -1
  730. package/dist/domain/components/debug-state-component.js +0 -1
  731. package/dist/domain/components/domain-component-optic.js +0 -16
  732. package/dist/domain/components/drag-state-component.js +0 -1
  733. package/dist/domain/components/export-state-component.js +0 -1
  734. package/dist/domain/components/fullscreen-state-component.js +0 -1
  735. package/dist/domain/components/group-components-by-entity-id-and-name.js +0 -1
  736. package/dist/domain/components/hover-state-component.js +0 -1
  737. package/dist/domain/components/index.d.ts +0 -2
  738. package/dist/domain/components/index.js +0 -1
  739. package/dist/domain/components/navigation-state-component.js +0 -1
  740. package/dist/domain/components/selection-state-component.js +0 -1
  741. package/dist/domain/components/system-component-builder.js +0 -1
  742. package/dist/domain/components/system-virtual-entity.js +0 -1
  743. package/dist/domain/components/tool-state-component.js +0 -1
  744. package/dist/domain/components/view-state-component.js +0 -1
  745. package/dist/domain/components/viewport-state-component.js +0 -1
  746. package/dist/domain/core/json-schema.js +0 -1
  747. package/dist/domain/core/reflection.js +0 -1
  748. package/dist/domain/expressions/constant-expressions.js +0 -1
  749. package/dist/domain/expressions/custom-expression.js +0 -1
  750. package/dist/domain/expressions/index.d.ts +0 -1
  751. package/dist/domain/expressions/index.js +0 -1
  752. package/dist/domain/invariants/custom-invariants.js +0 -1
  753. package/dist/domain/invariants/invariants.js +0 -1
  754. package/dist/domain/invariants/violation-component.js +0 -1
  755. package/dist/extras/assistant/AssistantChat.d.ts +0 -6
  756. package/dist/extras/assistant/AssistantChat.js +0 -1
  757. package/dist/extras/assistant/index.d.ts +0 -1
  758. package/dist/extras/assistant/index.js +0 -1
  759. package/dist/phoenix/application-spec/generate-assistant-prompt.d.ts +0 -12
  760. package/dist/phoenix/application-spec/generate-assistant-prompt.js +0 -1
  761. /package/dist/application-spec/generate-application/code/templates/{common → skills}/agent-skill.d.ts +0 -0
  762. /package/dist/application-spec/generate-application/code/templates/{common → skills}/agent-skill.js +0 -0
  763. /package/dist/application-spec/generate-application/code/templates/{agents-md.d.ts → skills/agents-md.d.ts} +0 -0
  764. /package/dist/application-spec/generate-application/code/templates/{phoenix-cli-skill.d.ts → skills/phoenix-cli-skill.d.ts} +0 -0
  765. /package/dist/application-spec/generate-application/code/templates/{phoenix-feedback-skill.d.ts → skills/phoenix-feedback-skill.d.ts} +0 -0
  766. /package/dist/application-spec/generate-application/code/templates/{phoenix-review-skill.d.ts → skills/phoenix-review-skill.d.ts} +0 -0
  767. /package/dist/application-spec/generate-application/code/templates/{phoenix-skill.d.ts → skills/phoenix-skill.d.ts} +0 -0
  768. /package/dist/domain/{components/component-reader-types.js → application/assistant/assistant-manifest.js} +0 -0
  769. /package/dist/domain/{core/enhanced-json-schema.js → application/assistant/assistant-resolved-manifest.js} +0 -0
  770. /package/dist/domain/core/{expression.js → action/action.js} +0 -0
  771. /package/dist/domain/core/{schema-validator.js → component/component-reader-types.js} +0 -0
  772. /package/dist/domain/{components → core/component}/legacy-filter.js +0 -0
  773. /package/dist/domain/{components → core/component}/system-component-filter.js +0 -0
  774. /package/dist/domain/{components → core/component}/system-virtual-entity.d.ts +0 -0
  775. /package/dist/domain/{components → core/component}/updates.js +0 -0
  776. /package/dist/domain/{expressions → core/expression}/memoize-expression.js +0 -0
  777. /package/dist/domain/{expressions → core/expression}/prepare-domain-expressions.js +0 -0
  778. /package/dist/domain/{invariants → core/invariant}/builtin-invariant.js +0 -0
  779. /package/dist/domain/{invariants → core/invariant}/violation-component.d.ts +0 -0
  780. /package/dist/domain/{invariants → core/invariant}/violation.js +0 -0
  781. /package/dist/domain/core/{alias.d.ts → model/alias.d.ts} +0 -0
  782. /package/dist/domain/core/{alias.js → model/alias.js} +0 -0
  783. /package/dist/domain/core/{common-definitions.d.ts → model/common-definitions.d.ts} +0 -0
  784. /package/dist/domain/core/{common-definitions.js → model/common-definitions.js} +0 -0
  785. /package/dist/domain/core/{component.js → model/component.js} +0 -0
  786. /package/dist/domain/core/{model.d.ts → model/model.d.ts} +0 -0
  787. /package/dist/domain/core/{model.js → model/model.js} +0 -0
  788. /package/dist/domain/core/{preset.d.ts → model/preset.d.ts} +0 -0
  789. /package/dist/domain/core/{preset.js → model/preset.js} +0 -0
  790. /package/dist/domain/core/{schema-validator-ajv.d.ts → schema/create-ajv-schema-validator.d.ts} +0 -0
  791. /package/dist/domain/core/{schema-validator-ajv.js → schema/create-ajv-schema-validator.js} +0 -0
  792. /package/dist/domain/core/{schema-validator-csp.d.ts → schema/create-csp-schema-validator.d.ts} +0 -0
  793. /package/dist/domain/core/{schema-validator-csp.js → schema/create-csp-schema-validator.js} +0 -0
  794. /package/dist/domain/core/{enhanced-json-schema.d.ts → schema/enhanced-json-schema.d.ts} +0 -0
  795. /package/dist/domain/core/{json-schema.d.ts → schema/extended-schema-validator.d.ts} +0 -0
  796. /package/dist/domain/core/{schema-validator.d.ts → schema/schema-validator.d.ts} +0 -0
  797. /package/dist/domain/core/{migrations.js → state/migrations.js} +0 -0
  798. /package/dist/domain/core/{state.js → state/state.js} +0 -0
@@ -4,8 +4,8 @@ import type { MergedAssistant } from '../../../merge/index.js';
4
4
  /**
5
5
  * The part of the assistant manifest only the server reads: the integrator's instructions for the
6
6
  * assistant and the AI settings it runs with. It is kept beside `AssistantSpec`, never inside it,
7
- * because `AssistantSpec` is serialized into the application bundle and into hot reload, and these
8
- * must not reach the browser of a customer. Deployment registration uploads them. `null` when the
7
+ * because its resolved manifest is serialized into the application bundle and into hot reload, and these
8
+ * must not reach the browser of a customer. The generated webhook bundle carries them for server-side setup resolution. `null` when the
9
9
  * application declares no `assistant` section.
10
10
  */
11
11
  export type AssistantServerSettings = Branded<'AssistantServerSettings', {
@@ -1,25 +1,11 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
2
  import type { ParseContext } from '../../../../core/index.js';
3
3
  import type { MergedAssistant } from '../../../merge/index.js';
4
- import type { EntityTypeName } from '../../model/index.js';
5
- import { type AssistantFieldOptionsByType, type AssistantFieldSources, type AssistantRecipeGroups, type AssistantSchemaInput, type AssistantWritableFields } from './assistant-schema.js';
4
+ import { type AssistantSchema, type AssistantSchemaInput } from './assistant-schema.js';
6
5
  /**
7
- * The experimental assistant manifest with its GraphQL SDL, prepared once at parse time so the
8
- * `.phoenix` codegen, the in-browser hot-reload runtime and deployment registration all carry the
9
- * exact same schema text. `fields` maps exposed GraphQL fields back to the stored fields and
10
- * expressions the runtime resolvers read; `deletableTypes` lists the entity types `deleteEntity`
11
- * may delete; `writableFields` maps the delta fields of each `modify<Type>` mutation to the stored
12
- * properties they write; `childRecipes` and `replaceRecipes` list the recipe groups each entity type exposes; `fieldOptions` lists
13
- * the options edges of each entity type's writable fields. `null` when the application declares no
14
- * `assistant` section or it is invalid.
6
+ * The validated built assistant schema and its JSON-only resolved input. Parsing constructs the
7
+ * schema to retain diagnostics; code generation and hot reload carry `resolved`, while deployment
8
+ * registration consumes the built SDL and resolver metadata. Null without a valid assistant section.
15
9
  */
16
- export type AssistantSpec = Branded<'AssistantSpec', {
17
- readonly sdl: string;
18
- readonly fields: AssistantFieldSources;
19
- readonly deletableTypes: readonly EntityTypeName[];
20
- readonly writableFields: AssistantWritableFields;
21
- readonly childRecipes: AssistantRecipeGroups;
22
- readonly replaceRecipes: AssistantRecipeGroups;
23
- readonly fieldOptions: AssistantFieldOptionsByType;
24
- }> | null;
10
+ export type AssistantSpec = Branded<'AssistantSpec', AssistantSchema> | null;
25
11
  export declare const AssistantSpec: (merged: MergedAssistant, input: AssistantSchemaInput, ctx: ParseContext) => AssistantSpec;
@@ -1,3 +1,4 @@
1
+ export * from './actions.js';
1
2
  export * from './app-metadata.js';
2
3
  export * from './assistant/index.js';
3
4
  export * from './application-version.js';
@@ -1 +1 @@
1
- export*from"./app-metadata.js";export*from"./assistant/index.js";export*from"./application-version.js";export*from"./bundle-size-budgets.js";export*from"./data-spec/index.js";export*from"./env.js";export*from"./infra.js";export*from"./state-value.js";export*from"./theme.js";export*from"./transformers.js";export*from"./ui.js";
1
+ export*from"./actions.js";export*from"./app-metadata.js";export*from"./assistant/index.js";export*from"./application-version.js";export*from"./bundle-size-budgets.js";export*from"./data-spec/index.js";export*from"./env.js";export*from"./infra.js";export*from"./state-value.js";export*from"./theme.js";export*from"./transformers.js";export*from"./ui.js";
@@ -201,10 +201,10 @@ export interface paths {
201
201
  readonly path?: never
202
202
  readonly cookie?: never
203
203
  }
204
- /** @description Load the caller's latest assistant thread on the configuration with its active run, newest window first. The `x-assistant-thread-continuable` response header is `false` when the thread belongs to another deployment or is closed; a chat request then answers 409. */
204
+ /** @description Load the caller's latest assistant thread on the configuration with its active run, newest window first. The `x-assistant-thread-continuable` response header is `false` when the thread has a different setup or is closed; a chat request then answers 409. */
205
205
  readonly get: operations['getAssistantThread']
206
206
  readonly put?: never
207
- /** @description Run the experimental assistant on the caller's thread of the configuration, or replay the run when the request carries `Last-Event-ID`. Answers 409 when the thread cannot be continued from this deployment or another run is still answering, and 503 while the server shuts down; sent again, the message reaches another instance. Answers 403 unless the customer has the AI Assistant feature flag on. */
207
+ /** @description Run the experimental assistant on the caller's thread of the configuration, or replay the run when the request carries `Last-Event-ID`. Answers 409 when the thread cannot be continued with this setup or another run is still answering, and 503 while the server shuts down; sent again, the message reaches another instance. Answers 403 unless the customer has the AI Assistant feature flag on. */
208
208
  readonly post: operations['assistantChat']
209
209
  readonly delete?: never
210
210
  readonly options?: never
@@ -618,7 +618,7 @@ export interface paths {
618
618
  }
619
619
  readonly get?: never
620
620
  readonly put?: never
621
- /** @description Create a build for `phoenix deploy` and a presigned POST that uploads its source archive. S3 refuses uploads over `maxBytes`. */
621
+ /** @description Create a build for `phoenix deploy` and a presigned POST that uploads its source archive. S3 refuses uploads over `maxBytes`. A project whose domain model changed under an already deployed model version is refused before the upload. */
622
622
  readonly post: operations['createUploadBuild']
623
623
  readonly delete?: never
624
624
  readonly options?: never
@@ -993,6 +993,12 @@ export interface paths {
993
993
  export type webhooks = Record<string, never>
994
994
  export interface components {
995
995
  schemas: {
996
+ /** @description The deployment webhook failed or returned invalid assistant setup. */
997
+ readonly BadGatewayError: {
998
+ readonly message: string
999
+ /** @enum {number} */
1000
+ readonly statusCode: 502
1001
+ }
996
1002
  /** @description Bad Request: The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
997
1003
  readonly BadRequestError: {
998
1004
  /** @example Expected integer, received string! */
@@ -2443,6 +2449,15 @@ export interface operations {
2443
2449
  readonly 'application/json': components['schemas']['NotFoundError']
2444
2450
  }
2445
2451
  }
2452
+ /** @description Bad Gateway! */
2453
+ readonly 502: {
2454
+ headers: {
2455
+ readonly [name: string]: unknown
2456
+ }
2457
+ content: {
2458
+ readonly 'application/json': components['schemas']['BadGatewayError']
2459
+ }
2460
+ }
2446
2461
  /** @description An unexpected error occurred! */
2447
2462
  readonly default: {
2448
2463
  headers: {
@@ -2527,6 +2542,15 @@ export interface operations {
2527
2542
  readonly 'application/json': components['schemas']['ConflictError']
2528
2543
  }
2529
2544
  }
2545
+ /** @description Bad Gateway! */
2546
+ readonly 502: {
2547
+ headers: {
2548
+ readonly [name: string]: unknown
2549
+ }
2550
+ content: {
2551
+ readonly 'application/json': components['schemas']['BadGatewayError']
2552
+ }
2553
+ }
2530
2554
  /** @description Service Unavailable! */
2531
2555
  readonly 503: {
2532
2556
  headers: {
@@ -4433,6 +4457,10 @@ export interface operations {
4433
4457
  readonly requestBody: {
4434
4458
  readonly content: {
4435
4459
  readonly 'application/json': {
4460
+ /** @description The admin model schema of the project, checked like `configurationSchema`. */
4461
+ readonly adminConfigurationSchema?: components['schemas']['ConfigurationSchema']
4462
+ /** @description The configurator model schema of the project. When it differs from the schema deployed under the same model version, no build is created and the response is 400. */
4463
+ readonly configurationSchema?: components['schemas']['ConfigurationSchema']
4436
4464
  /** @description Version of the CLI that uploads the sources. */
4437
4465
  readonly sdkVersion: string
4438
4466
  /** @description Size of the source archive the CLI will upload. */
@@ -5366,20 +5394,22 @@ export interface operations {
5366
5394
  readonly adminConfigurationSchema?: components['schemas']['ConfigurationSchema']
5367
5395
  /** @description Semantic version (x.y.z) of the deployed application. */
5368
5396
  readonly applicationVersion?: string
5369
- /** @description What the deployment registers for its experimental assistant: the GraphQL SDL of the application spec, the prompt the SDK generates for its version, the instructions of the integrator and the AI settings. A deployment prepared without it has no assistant. */
5370
- readonly assistant?: {
5371
- readonly ai: {
5372
- /** @enum {string} */
5373
- readonly model: 'frontier' | 'advanced' | 'balanced' | 'fast'
5374
- /** @enum {string} */
5375
- readonly provider: 'openai'
5376
- /** @enum {string} */
5377
- readonly reasoning: 'low' | 'medium' | 'high'
5378
- }
5379
- readonly instructions?: string
5380
- readonly prompt: string
5381
- readonly sdl: string
5382
- }
5397
+ /** @description Whether the deployment webhook provides assistant setup. Omitted or legacy object registrations disable the assistant; prepare with a current SDK to enable it. */
5398
+ readonly assistant?:
5399
+ | boolean
5400
+ | {
5401
+ readonly ai: {
5402
+ /** @enum {string} */
5403
+ readonly model: 'frontier' | 'advanced' | 'balanced' | 'fast'
5404
+ /** @enum {string} */
5405
+ readonly provider: 'openai'
5406
+ /** @enum {string} */
5407
+ readonly reasoning: 'low' | 'medium' | 'high'
5408
+ }
5409
+ readonly instructions?: string
5410
+ readonly prompt: string
5411
+ readonly sdl: string
5412
+ }
5383
5413
  /** @description Configuration of the chat functionality. */
5384
5414
  readonly chat?: components['schemas']['ChatConfiguration']
5385
5415
  readonly configurationSchema: components['schemas']['ConfigurationSchema']
@@ -5586,20 +5616,22 @@ export interface operations {
5586
5616
  readonly adminConfigurationSchema?: components['schemas']['ConfigurationSchema']
5587
5617
  /** @description Semantic version (x.y.z) of the deployed application. */
5588
5618
  readonly applicationVersion?: string
5589
- /** @description What the deployment registers for its experimental assistant: the GraphQL SDL of the application spec, the prompt the SDK generates for its version, the instructions of the integrator and the AI settings. A deployment prepared without it has no assistant. */
5590
- readonly assistant?: {
5591
- readonly ai: {
5592
- /** @enum {string} */
5593
- readonly model: 'frontier' | 'advanced' | 'balanced' | 'fast'
5594
- /** @enum {string} */
5595
- readonly provider: 'openai'
5596
- /** @enum {string} */
5597
- readonly reasoning: 'low' | 'medium' | 'high'
5598
- }
5599
- readonly instructions?: string
5600
- readonly prompt: string
5601
- readonly sdl: string
5602
- }
5619
+ /** @description Whether the deployment webhook provides assistant setup. Omitted or legacy object registrations disable the assistant; prepare with a current SDK to enable it. */
5620
+ readonly assistant?:
5621
+ | boolean
5622
+ | {
5623
+ readonly ai: {
5624
+ /** @enum {string} */
5625
+ readonly model: 'frontier' | 'advanced' | 'balanced' | 'fast'
5626
+ /** @enum {string} */
5627
+ readonly provider: 'openai'
5628
+ /** @enum {string} */
5629
+ readonly reasoning: 'low' | 'medium' | 'high'
5630
+ }
5631
+ readonly instructions?: string
5632
+ readonly prompt: string
5633
+ readonly sdl: string
5634
+ }
5603
5635
  /** @description Configuration of the chat functionality. */
5604
5636
  readonly chat?: components['schemas']['ChatConfiguration']
5605
5637
  readonly configurationSchema: components['schemas']['ConfigurationSchema']
@@ -1,5 +1,5 @@
1
1
  import type { $DomainEntity, DomainEntity } from '#package/domain';
2
- import type { AnimationSystem, CameraControlSystem, CameraSystem, CanvasSystem, DragAndDropSystem, ExportSystem, GraphQLSystem, ImageRenderingSystem, LayoutSystem, SketchingSystem } from './systems/index.js';
2
+ import type { AnimationSystem, AssistantSystem, CameraControlSystem, CameraSystem, CanvasSystem, DragAndDropSystem, ExportSystem, GraphQLSystem, ImageRenderingSystem, LayoutSystem, SketchingSystem } from './systems/index.js';
3
3
  /**
4
4
  * The configurator systems of one slot. Every system reaches the domain through runtime selectors,
5
5
  * so its own entity types are all it needs and the erased aliases are what the runtime hands around.
@@ -18,6 +18,7 @@ export interface ConfiguratorExtensionSystems<ENTITIES extends DomainEntity<stri
18
18
  readonly exportSystem: ExportSystem<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>;
19
19
  readonly cameraSystem: CameraSystem<ENTITIES>;
20
20
  readonly graphQLSystem: GraphQLSystem;
21
+ readonly assistantSystem: AssistantSystem;
21
22
  }
22
23
  /** The erased shape the runtime slice constructs; consumers that know their entities narrow on read. */
23
24
  export type AnyConfiguratorExtensionSystems = ConfiguratorExtensionSystems<any, any, any, any, any, any, any>;
@@ -1 +1 @@
1
- let e=["canvasSystem","cameraControlSystem","animationSystem","dragAndDropSystem","imageRenderingSystem","layoutSystem","sketchingSystem","exportSystem","cameraSystem","graphQLSystem"];export const isConfiguratorExtensionSystems=t=>e.every(e=>e in t);
1
+ let e=["canvasSystem","cameraControlSystem","animationSystem","dragAndDropSystem","imageRenderingSystem","layoutSystem","sketchingSystem","exportSystem","cameraSystem","graphQLSystem","assistantSystem"];export const isConfiguratorExtensionSystems=t=>e.every(e=>e in t);
@@ -1,7 +1,7 @@
1
1
  import type { AccessInfoSelectors, DomainContextSelectors, DomainServicesSelectors, SpecSelectors } from '#package/domain';
2
2
  import type { CommonServicesSelectors } from '#package/react-sdk';
3
3
  import type { AnyConfiguratorExtensionSystems } from './configurator-extension-systems.js';
4
- import { AnimationSystem, type AnyCameraSystem, type AnyCanvasSystem, type AnyDragAndDropSystem, type AnyExportSystem, type AnyImageRenderingSystem, type AnyLayoutSystem, type AnySketchingSystem, CameraControlSystem, GraphQLSystem } from './systems/index.js';
4
+ import { AnimationSystem, type AnyCameraSystem, type AnyCanvasSystem, type AnyDragAndDropSystem, type AnyExportSystem, type AnyImageRenderingSystem, type AnyLayoutSystem, type AnySketchingSystem, AssistantSystem, CameraControlSystem, GraphQLSystem } from './systems/index.js';
5
5
  interface Context {
6
6
  readonly domainContextSelectors: DomainContextSelectors;
7
7
  readonly specSelectors: SpecSelectors;
@@ -31,6 +31,7 @@ export declare const createConfiguratorExtensionSelectors: (context: Context) =>
31
31
  getExportSystem: () => AnyExportSystem;
32
32
  getCameraSystem: () => AnyCameraSystem;
33
33
  getGraphQLSystem: () => GraphQLSystem;
34
+ getAssistantSystem: () => AssistantSystem;
34
35
  };
35
36
  export type ConfiguratorExtensionSelectors = ReturnType<typeof createConfiguratorExtensionSelectors>;
36
37
  export {};
@@ -1 +1 @@
1
- import{AnimationSystem as e,CameraControlSystem as t,CameraSystem as n,CanvasSystem as o,DragAndDropSystem as r,ExportSystem as g,GraphQLSystem as s,ImageRenderingSystem as i,LayoutSystem as a,SketchingSystem as m}from"./systems/index.js";export const createConfiguratorExtensionSelectors=S=>{let{domainContextSelectors:y,specSelectors:u,domainServicesSelectors:C,accessSelectors:w,commonServicesSelectors:c}=S,f={getConfigurationId:()=>w.getConfiguratorConfigurationId(),getAuthorizedClient:()=>c.getConfiguratorAuthorizedClient(),domainContextSelectors:y,domainServicesSelectors:C,specSelectors:u},d={getSystems:()=>k,getCanvasSystem:()=>x,getCameraControlSystem:()=>p,getAnimationSystem:()=>A,getDragAndDropSystem:()=>h,getImageRenderingSystem:()=>j,getLayoutSystem:()=>z,getSketchingSystem:()=>D,getExportSystem:()=>E,getCameraSystem:()=>L,getGraphQLSystem:()=>I},l={...f,configuratorExtensionSelectors:d},x=new o(f),p=new t({configuratorExtensionSelectors:d}),h=new r(l),A=new e(f),E=new g(l),I=new s(f),z=new a(f),D=new m(l),L=new n(l),j=new i(l),k={cameraControlSystem:p,layoutSystem:z,sketchingSystem:D,dragAndDropSystem:h,canvasSystem:x,cameraSystem:L,exportSystem:E,imageRenderingSystem:j,animationSystem:A,graphQLSystem:I};return d};
1
+ import{AnimationSystem as e,AssistantSystem as t,CameraControlSystem as n,CameraSystem as o,CanvasSystem as r,DragAndDropSystem as s,ExportSystem as g,GraphQLSystem as i,ImageRenderingSystem as a,LayoutSystem as m,SketchingSystem as S}from"./systems/index.js";export const createConfiguratorExtensionSelectors=y=>{let{domainContextSelectors:u,specSelectors:w,domainServicesSelectors:C,accessSelectors:c,commonServicesSelectors:f}=y,d={getConfigurationId:()=>c.getConfiguratorConfigurationId(),getAuthorizedClient:()=>f.getConfiguratorAuthorizedClient(),domainContextSelectors:u,domainServicesSelectors:C,specSelectors:w},l={getSystems:()=>G,getCanvasSystem:()=>p,getCameraControlSystem:()=>A,getAnimationSystem:()=>E,getDragAndDropSystem:()=>h,getImageRenderingSystem:()=>v,getLayoutSystem:()=>L,getSketchingSystem:()=>j,getExportSystem:()=>I,getCameraSystem:()=>k,getGraphQLSystem:()=>z,getAssistantSystem:()=>D},x={...d,configuratorExtensionSelectors:l},p=new r(d),A=new n({configuratorExtensionSelectors:l}),h=new s(x),E=new e(d),I=new g(x),z=new i(d),D=new t(x),L=new m(d),j=new S(x),k=new o(x),v=new a(x),G={cameraControlSystem:A,layoutSystem:L,sketchingSystem:j,dragAndDropSystem:h,canvasSystem:p,cameraSystem:k,exportSystem:I,imageRenderingSystem:v,animationSystem:E,graphQLSystem:z,assistantSystem:D};return l};
@@ -0,0 +1,180 @@
1
+ import type { AnyClientTool } from '@tanstack/ai';
2
+ import { type UIMessage } from '@tanstack/ai-client';
3
+ import { type ObservableWithLastValue } from '@salsita-ai/common/utils';
4
+ import type { AuthorizedPhoenixApiClient } from '#package/client';
5
+ import type { DomainContextSelectors, DomainServicesSelectors, InitializableSystem, SpecSelectors } from '#package/domain';
6
+ import type { ConfiguratorExtensionSelectors } from '../../selectors.js';
7
+ /** A tool of the assistant that the model calls and the browser runs, as the chat client accepts it. */
8
+ export type AssistantClientTool = AnyClientTool;
9
+ /**
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.
13
+ */
14
+ export interface AssistantSystemContext {
15
+ readonly configuratorExtensionSelectors: ConfiguratorExtensionSelectors;
16
+ readonly domainContextSelectors: DomainContextSelectors;
17
+ readonly domainServicesSelectors: DomainServicesSelectors;
18
+ readonly specSelectors: SpecSelectors;
19
+ readonly getConfigurationId: () => string;
20
+ readonly getAuthorizedClient: () => AuthorizedPhoenixApiClient<any, any, any>;
21
+ }
22
+ /**
23
+ * The conversation with the assistant as the panel paints it. One value is published per change, so
24
+ * it changes with every chunk of a streaming reply.
25
+ */
26
+ export interface AssistantChatSnapshot {
27
+ /** The thread as painted: hydrated from the server, then streamed. */
28
+ readonly messages: ReadonlyArray<UIMessage>;
29
+ /** True while a round of a reply streams or its browser tools run; false in the pause before the next round. */
30
+ readonly isLoading: boolean;
31
+ readonly error: Error | undefined;
32
+ /**
33
+ * HTTP status of the latest request the server answered with a failure, for telling a refusal from
34
+ * a dropped connection when `error` is set. Nothing when the latest answered request succeeded or
35
+ * the server was never reached.
36
+ */
37
+ readonly failedStatus: number | undefined;
38
+ /** False when the server said this session may read the thread but not add to it. */
39
+ readonly isContinuable: boolean;
40
+ /** False until the first request of the chat, the thread read, was answered or failed. */
41
+ readonly isLoaded: boolean;
42
+ }
43
+ /**
44
+ * The built-in assistant panel as a layout and the toolbar button see it: whether it is open, and
45
+ * the few facts about it they render. It changes only when one of those does.
46
+ */
47
+ export interface AssistantPanelSnapshot {
48
+ readonly open: boolean;
49
+ /** True when a reply finished while the panel was closed and the panel was not opened since. */
50
+ readonly hasUnreadReply: boolean;
51
+ /** True while the message input has focus; a phone layout gives the panel the whole screen then. */
52
+ readonly isInputFocused: boolean;
53
+ }
54
+ /**
55
+ * Owns the conversational assistant of a configurator: its client tools (`getBrowserDetails`,
56
+ * `query` and `apply`), the chat with the server, the state of the built-in panel, and the record
57
+ * of what changed in the configuration since the agent last acted, which every user message carries.
58
+ *
59
+ * The server owns the thread, so the chat keeps nothing in browser storage: its client hydrates
60
+ * from the server and rejoins a reply that is still streaming.
61
+ *
62
+ * WORKAROUND: the runtime cannot tell a system that its configuration was left, and a system cannot
63
+ * observe the application spec. Until it can do both, the chat is started and ended from outside,
64
+ * through {@link AssistantSystem.activate}; see there for what that costs.
65
+ */
66
+ export declare class AssistantSystem implements InitializableSystem {
67
+ private readonly _context;
68
+ private readonly _tools;
69
+ private readonly _chat;
70
+ private readonly _panel;
71
+ /** Identity of the current `activate()` call; nothing while the chat is not active. */
72
+ private _activation;
73
+ /** The chat of the current activation; nothing while no chat is active. */
74
+ private _current;
75
+ /**
76
+ * Chats that have ended while their reply was still running and are finishing it in the
77
+ * background. Each leaves the set when its reply ends or when a new chat takes its thread over.
78
+ */
79
+ private readonly _finishing;
80
+ private readonly _recorder;
81
+ /** The recorder's subscription to the committed emissions of the store; made by the first `initialize()`. */
82
+ private _recording;
83
+ constructor(_context: AssistantSystemContext);
84
+ /** The conversation. It never completes, and holds the empty chat whenever no chat is active. */
85
+ readonly chat$: ObservableWithLastValue<AssistantChatSnapshot>;
86
+ /** The state of the built-in panel. It never completes. */
87
+ readonly panel$: ObservableWithLastValue<AssistantPanelSnapshot>;
88
+ /**
89
+ * A new configuration load: the chat of the previous one is deactivated and both observables go
90
+ * back to their empty values. An activation that is still held outlives it and gets the chat of
91
+ * the new load, because the page that holds it can be mounted before this runs: a configuration
92
+ * that is entered again renders its page at once and initializes from an effect after the page's.
93
+ *
94
+ * Accepted cost: on such a re-entry the thread is read twice. The page's `activate()` has already
95
+ * created a client and started its read when this runs, and that client is replaced here, because
96
+ * the system cannot tell that it was created for the load that is only now being initialized.
97
+ *
98
+ * The change recorder starts over from the loaded state, so the first message after a load says
99
+ * that the changes are unavailable. The store is retained across loads and has already emitted the
100
+ * loaded state when this runs, so one subscription serves every load.
101
+ */
102
+ initialize: () => void;
103
+ /**
104
+ * Starts the chat of the loaded configuration: creates the client, which reads the thread from the
105
+ * server and rejoins a reply that is still running. The returned function ends it.
106
+ *
107
+ * WORKAROUND, to be replaced once the runtime has teardown and spec observation for systems. Two
108
+ * things a system cannot learn by itself are decided by the caller, the loaded configurator page:
109
+ *
110
+ * - Whether the application spec has an `assistant` section, also after editor hot reload added or
111
+ * removed it. The page calls this only while the section is there; the system does not check.
112
+ * - That the user left the configuration. No `initialize()` follows a route change, so without the
113
+ * returned function the chat would go on working on a configuration nobody looks at.
114
+ *
115
+ * Ending the chat does not cut a running reply off: it finishes in the background, where every
116
+ * tool call it still makes is answered with a refusal that tells the model to stop, and it no
117
+ * longer reaches `chat$` or `panel$`. A tool call that is already running when the chat ends is
118
+ * not interrupted, so an `apply` that has started may still commit. The background reply keeps
119
+ * the configuration and the authorized client it started with.
120
+ *
121
+ * The background reply ends early when a new chat starts for the same configuration, which is
122
+ * what opening the configuration again does: see `_takeOverThread`.
123
+ */
124
+ activate: () => (() => void);
125
+ /**
126
+ * Sends a user message with the record of what changed in the configuration since the agent last
127
+ * acted, which the server puts in front of the message for the model. The record is taken only
128
+ * when there is a chat to send it on, because taking it moves its baseline.
129
+ *
130
+ * A thread can end in a tool call that nothing will answer: its reply parked while no page was
131
+ * open, or the page that ran the tool was left before the result was sent. The client refuses to
132
+ * send while it waits on such a call, so the wait is given up first, and the server records for
133
+ * the model that the call got no result.
134
+ *
135
+ * It never rejects: a message the client could not send is reported as the error of the chat.
136
+ */
137
+ send: (content: string) => Promise<void>;
138
+ /**
139
+ * Stops the reply on both sides. Closing the stream alone keeps the server run going, because a
140
+ * closed connection is also how a reload looks and a reload must be able to rejoin the run.
141
+ */
142
+ stop: () => Promise<void>;
143
+ /**
144
+ * Loads the thread from the server again, rejoining a reply that is still running there. It never
145
+ * sends a message again, because the server may already hold it; a message that did not reach the
146
+ * server is therefore gone from the thread and has to be written again.
147
+ */
148
+ reloadThread: () => void;
149
+ setOpen: (open: boolean) => void;
150
+ setInputFocused: (isInputFocused: boolean) => void;
151
+ private _committedState;
152
+ private _patchPanel;
153
+ /**
154
+ * Disconnects every chat that is still finishing a reply on the thread of the given configuration,
155
+ * so the chat that is about to start is the only one on it.
156
+ *
157
+ * Two clients on one thread would both follow the same server run: the new one rejoins it when it
158
+ * reads the thread. Both would then handle the run's next tool call, the old one with a refusal
159
+ * and the new one for real, and both would send the result back, of which the server accepts one.
160
+ * The model could be told that nothing was run about a change that was made.
161
+ *
162
+ * Stopping a client closes its stream in the browser and cancels nothing on the server: a run that
163
+ * is still producing goes on there and the new chat rejoins it. The stopped client also drops the
164
+ * result of a tool call that is still running in it, and any continuation it has not sent yet. Such
165
+ * a call still finishes, so an `apply` may commit, but the server never gets its result: the run is
166
+ * parked on the call with nothing running for the new chat to rejoin, and the thread waits on it
167
+ * until the user's next message gives the wait up; see `send`.
168
+ *
169
+ * A chat that finishes a reply for another configuration is on another thread and is left alone.
170
+ */
171
+ private _takeOverThread;
172
+ private _startClient;
173
+ /**
174
+ * Lets go of the current chat and puts the empty chat in its place. The client itself is left as
175
+ * it is: whether it finishes its reply or is cut off is the caller's decision.
176
+ */
177
+ private _retireChat;
178
+ /** Ends the current chat without cutting its reply off. */
179
+ private _endChat;
180
+ }
@@ -0,0 +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{createBrowserDetailsClientTool as r}from"./browser-details.js";import{ChangeRecorder as n}from"./change-recorder.js";import{createApplyClientTool as o,createQueryClientTool as c}from"./graphql-tools.js";let l=Object.freeze({messages:Object.freeze([]),isLoading:!1,error:void 0,failedStatus:void 0,isContinuable:!0,isLoaded:!1}),h=Object.freeze({open:!1,hasUnreadReply:!1,isInputFocused:!1}),d=Object.freeze({}),g=Object.freeze({results:Object.freeze([]),committed:!1,sideEffects:Object.freeze([]),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."}),u=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(l);_panel=new i(h);_activation=null;_current=null;_finishing=new Set;_recorder;_recording=null;constructor(t){this._context=t;let{configuratorExtensionSelectors:e,domainContextSelectors:i,domainServicesSelectors:s,specSelectors:a}=t;this._recorder=new n({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.getAssistant()?.fields??d,resolveLocalizable:t=>s.getResolveLocalizable()(t)});let l={getGraphQLSystem:()=>e.getGraphQLSystem(),getStoreSystem:()=>i.getStoreSystem(),getActiveMode:()=>i.getActiveMode(),clearChanges:()=>this._recorder.clear(this._committedState())};this._tools=[r(),c(l),o(l)]}chat$=this._chat;panel$=this._panel;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(h),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=>{let e=this._current;if(!e)return;let{client:i}=e;i.getIsLoading()||null===i.getResumeState()||i.stop();let s={changes:this._recorder.take(this._committedState())};try{await i.sendMessage({content:t,metadata:s})}catch(i){let t=i instanceof Error?i:Error(String(i));e.generation.active&&this._chat.next({...this._chat.value,error:t}),this._context.domainServicesSelectors.getLogger().error("The assistant message could not be sent",{},t)}};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()};setOpen=t=>{this._patchPanel(t?{open:t,hasUnreadReply:!1}:{open:t,isInputFocused:!1})};setInputFocused=t=>{this._patchPanel({isInputFocused: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=()=>r.getAssistantChatConnection(s),o=t=>{if(!i.active)return;let e={...this._chat.value,...t};a(e,this._chat.value)||this._chat.next(e)},c=async(t,e)=>{let i=await fetch(t,e).finally(()=>o({isLoaded:!0})),s=i.headers.get("x-assistant-thread-continuable");return o({failedStatus:i.ok?void 0:i.status,...null!=s&&{isContinuable:"false"!==s}}),i},l=async()=>({headers:await n().headers(),fetchClient:c}),h=e(()=>n().url,l),d=e(()=>`${n().url}/runs`,l),_=this._tools.map(t=>({...t,execute:(e,s)=>i.active?t.execute?.(e,s):g})),m=new t({threadId:`assistant:${s}`,connection:{...h,joinRun:d.joinRun},persistence:!0,history:{pageSize:50},tools:_,onMessagesChange:t=>o({messages:t}),onLoadingChange:t=>{let e=i.active&&this._chat.value.isLoading;o({isLoading:t}),!t&&u(m)&&(i.active?e&&!this._panel.value.open&&this._patchPanel({hasUnreadReply:!0}):v())},onErrorChange:t=>{i.active&&t!==this._chat.value.error&&(o({error:t}),t&&this._context.domainServicesSelectors.getLogger().error("The assistant request failed",{status:this._chat.value.failedStatus},t))}}),p=!1,v=()=>{p||(p=!0,this._finishing.delete(S),m.dispose())},S={client:m,configurationId:s,generation:i,getConnection:n,dispose:v};this._current=S,m.attach()};_retireChat=()=>{let t=this._current;return this._current=null,t&&(t.generation.active=!1),this._chat.value!==l&&this._chat.next(l),t};_endChat=()=>{let t=this._retireChat();if(t){if(!t.client.getIsLoading()&&u(t.client))return void t.dispose();this._finishing.add(t)}}}
@@ -2,7 +2,7 @@
2
2
  * Browser implementation of the assistant's `getBrowserDetails` tool: draws the browser details onto
3
3
  * a canvas and returns the capture as a PNG image part, so the model reads them from an image.
4
4
  */
5
- export declare const browserDetailsClientTool: import("@tanstack/ai").ClientTool<{
5
+ export declare const createBrowserDetailsClientTool: () => import("@tanstack/ai").ClientTool<{
6
6
  type: string;
7
7
  properties: {};
8
8
  required: never[];
@@ -0,0 +1 @@
1
+ import{browserDetailsTool as e}from"@salsita-ai/contracts/assistant";let t=e=>{let t=[];for(let i=0;i<e.length;i+=64)t.push(e.slice(i,i+64));return t};export const createBrowserDetailsClientTool=()=>e.client(()=>{let e=(()=>{let e=[`User agent: ${navigator.userAgent}`,`Viewport: ${window.innerWidth} x ${window.innerHeight} px`,`Screen: ${window.screen.width} x ${window.screen.height} px`,`Device pixel ratio: ${window.devicePixelRatio}`,`Language: ${navigator.language}`,`Time zone: ${Intl.DateTimeFormat().resolvedOptions().timeZone}`].flatMap(t),i=document.createElement("canvas");i.width=720,i.height=48+26*e.length;let n=i.getContext("2d");if(!n)throw Error("The browser details capture failed because the canvas has no 2D context. Retry in another browser.");return n.fillStyle="#ffffff",n.fillRect(0,0,i.width,i.height),n.fillStyle="#111111",n.font="16px monospace",n.textBaseline="top",e.forEach((e,t)=>n.fillText(e,24,24+26*t)),i.toDataURL("image/png")})();return[{type:"image",source:{type:"data",value:e.slice(e.indexOf(",")+1),mimeType:"image/png"}}]});
@@ -0,0 +1,85 @@
1
+ import type { Localizable } from '@salsita-ai/common/utils';
2
+ import { type $DomainEntity, type AssistantManifest, type DomainEntity, type DomainState, type StateEmission } from '#package/domain';
3
+ type AnyDomainEntity = DomainEntity<string>;
4
+ type AnyDomainState = DomainState<AnyDomainEntity>;
5
+ type AnyStateEmission = StateEmission<AnyDomainEntity, Record<string, $DomainEntity<AnyDomainEntity>>>;
6
+ /**
7
+ * What the change record compares besides the entities: the values the `Query` root of the
8
+ * assistant's schema exposes as `selectedEntity` and `navigation`, read off a state.
9
+ */
10
+ export interface ChangeRecorderStateReaders {
11
+ readonly selectedEntityId: (state: AnyDomainState) => string | undefined;
12
+ readonly navigationState: (state: AnyDomainState) => string | undefined;
13
+ readonly viewState: (state: AnyDomainState) => string | undefined;
14
+ readonly toolState: (state: AnyDomainState) => string | undefined;
15
+ }
16
+ /** What a {@link ChangeRecorder} reads from the running configurator. */
17
+ export interface ChangeRecorderContext {
18
+ readonly readers: ChangeRecorderStateReaders;
19
+ /**
20
+ * The field table of the assistant manifest: per entity type of the schema, each exposed field
21
+ * name with the stored field or expression it reads. The record lists nothing the table does not
22
+ * hold, so the agent is shown only what it could also query. Read at every take, because editor
23
+ * hot reload replaces the manifest.
24
+ */
25
+ readonly getExposedFields: () => AssistantManifest['fields'];
26
+ readonly resolveLocalizable: (message: Localizable) => string;
27
+ }
28
+ export interface ChangeRecorderProps {
29
+ /** More differing entities than this are counted and not listed. */
30
+ readonly maxEntities: number;
31
+ }
32
+ /**
33
+ * Records what changed in the committed configuration since the assistant agent last acted, and
34
+ * prints it as the change record a user message carries to the agent.
35
+ *
36
+ * The record is a net diff: the committed state at the last take or clear is kept as the baseline
37
+ * and compared with the current one, so a value that was changed and changed back is not listed.
38
+ * Of the emissions in between, only the last update that touched each entity and each entity field
39
+ * is kept, to say why a line is there. Selection and navigation are read off the two states and
40
+ * never from their updates.
41
+ *
42
+ * Only what the assistant manifest exposes is listed: entities of the types its schema has, and of
43
+ * their stored fields the exposed ones, under their exposed names and localized like the schema
44
+ * returns them. A change of anything else is not in the record.
45
+ */
46
+ export declare class ChangeRecorder {
47
+ private readonly _props;
48
+ private readonly _context;
49
+ private _baseline;
50
+ /** True from a reset until the first take: what happened before the baseline is not known. */
51
+ private _isUnavailable;
52
+ private readonly _touches;
53
+ private _lastReset;
54
+ private _wasUndoneOrRedone;
55
+ constructor(_props: ChangeRecorderProps, _context: ChangeRecorderContext);
56
+ /** Starts over from this committed state; the next take reports `unavailable`. */
57
+ reset: (state: AnyDomainState) => void;
58
+ /** Records one committed emission: the last update that touched each entity and field, or the reset. */
59
+ record: (emission: AnyStateEmission) => void;
60
+ /** The change record since the last take or clear, as the prompt describes it; moves the baseline. */
61
+ take: (state: AnyDomainState) => string;
62
+ /** Forgets what was recorded and makes this committed state the baseline. */
63
+ clear: (state: AnyDomainState) => void;
64
+ private _touchesOf;
65
+ private _touchFields;
66
+ private _print;
67
+ private _diffStates;
68
+ /** Added and modified entities in the order of the current state, then the deleted ones in the order they had. */
69
+ private _diffEntities;
70
+ /**
71
+ * The lines of the exposed stored fields that differ, in manifest order. A field no update
72
+ * touched since its entity was created or replaced under an id that existed before is explained
73
+ * by that creation.
74
+ */
75
+ private _diffFields;
76
+ /** Why a line is in the record; a line no recorded update explains was left by a reset. */
77
+ private _comment;
78
+ /**
79
+ * What the agent is told about an update, else what the user was told, else the update tag. As
80
+ * for `sideEffects`, an `agentHint` replaces the `hint` whatever it holds: `null` or empty text
81
+ * hides the wording from the agent, not the change, so the tag stands in.
82
+ */
83
+ private _explain;
84
+ }
85
+ export {};
@@ -0,0 +1 @@
1
+ import{match as e}from"ts-pattern";import{isUndoRedoReset as t}from"#package/domain";import{localize as i}from"../graphql-system/graphql-system.js";let s=[["selected","selectedEntityId"],["navigationState","navigationState"],["viewState","viewState"],["toolState","toolState"]],n=e=>e.length>80?`${e.slice(0,80)}…`:e,a=e=>void 0===e||""===e?"none":e,r=e=>new Map(Object.entries(e)),l=["id","type"];export class ChangeRecorder{_props;_context;_baseline;_isUnavailable=!0;_touches=new Map;_lastReset;_wasUndoneOrRedone=!1;constructor(e,t){this._props=e,this._context=t}reset=e=>{this.clear(e),this._isUnavailable=!0};record=i=>{if("reset"===i.kind){this._touches.clear(),this._lastReset=t(i)?"undo/redo":"reset",this._wasUndoneOrRedone||="undo/redo"===this._lastReset;return}for(let t of i.updates)e(t).with({kind:"createDomainEntity"},e=>{this._touchesOf(e.entityId).created=e}).with({kind:"deleteEntity"},e=>{let t=this._touchesOf(e.entityId);t.fields.clear(),t.deleted=e}).with({kind:"modifyDomainEntity"},e=>{this._touchFields(e.entityId,Object.keys(e.stateDelta),e)}).with({kind:"replaceDomainEntity"},e=>{let{replacementEntity:t}=e;this._touchesOf(e.entityId).fields.clear(),this._touchesOf(e.entityId).deleted=e,this._touchesOf(t.id).created=e}).with({kind:"createEphemeralRecord"},{kind:"modifyEphemeralRecord"},{kind:"deleteEphemeralRecord"},()=>{}).exhaustive()};take=e=>{let t=this._print(e);return this.clear(e),this._isUnavailable=!1,t};clear=e=>{this._baseline=e,this._touches.clear(),this._lastReset=void 0,this._wasUndoneOrRedone=!1};_touchesOf=e=>{let t=this._touches.get(e);if(t)return t;let i={created:void 0,deleted:void 0,fields:new Map};return this._touches.set(e,i),i};_touchFields=(e,t,i)=>{let s=this._touchesOf(e);for(let e of t)s.fields.set(e,i)};_print=e=>{let t=this._baseline;if(this._isUnavailable||!t)return"[changes: unavailable]";let{lines:i,count:s}=this._diffEntities(t,e);if(s>this._props.maxEntities)return`[changes: too many (${s})]`;let n=[...this._diffStates(t,e),...i];return 0===n.length?"[changes: none]":["[changes]",...this._wasUndoneOrRedone?["reset: undo/redo"]:[],...n].join("\n")};_diffStates=(e,t)=>s.flatMap(([i,s])=>{let n=a(this._context.readers[s](e)),r=a(this._context.readers[s](t));return n===r?[]:[`${i}: ${n} -> ${r}`]});_diffEntities=(e,t)=>{let i=this._context.getExposedFields(),s=new Map(e.entities.map(e=>[e.id,e])),n=new Set(t.entities.map(e=>e.id)),a=t.entities.flatMap(e=>{let t=i[e.type],n=s.get(e.id);if(!t)return[];if(!n)return[[`A ${e.id}${this._comment(this._touches.get(e.id)?.created)}`]];let a=n===e?[]:this._diffFields(n,e,t);return a.length>0?[[`M ${e.id}`,...a]]:[]}),r=e.entities.filter(e=>i[e.type]&&!n.has(e.id)).map(e=>[`D ${e.id}${this._comment(this._touches.get(e.id)?.deleted)}`]);return{lines:[...a,...r].flat(),count:a.length+r.length}};_diffFields=(e,t,s)=>{let a=r(e),d=r(t),o=this._touches.get(t.id);return Object.entries(s).flatMap(([e,{source:t,localized:s}])=>{if(!(!t.startsWith("$")&&!l.includes(t)))return[];let r=e=>{let t;return void 0===(t=s?i(e,this._context.resolveLocalizable):e)?"undefined":JSON.stringify(t)},h=r(a.get(t)),c=r(d.get(t));return h===c?[]:[` ${e}: ${n(h)} -> ${n(c)}${this._comment(o?.fields.get(t)??o?.created)}`]})};_comment=e=>e?` # ${this._explain(e).replace(/\s*\n\s*/g," ")}`:this._lastReset?` # ${this._lastReset}`:"";_explain=({agentHint:e,hint:t,updateTag:i})=>void 0!==e?null===e||""===e?i:e:t?this._context.resolveLocalizable(t):i}