@salsita-ai/sdk 0.50.0-develop.aec0f535bf → 0.50.0-develop.af031dec0f

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 (520) hide show
  1. package/README.md +10 -3
  2. package/dist/application-spec/errors/diagnostic-codes.d.ts +6 -0
  3. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  4. package/dist/application-spec/errors/diagnostic-messages.d.ts +7 -1
  5. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  6. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  7. package/dist/application-spec/generate-application/code/standalone-app-files.js +1 -1
  8. package/dist/application-spec/generate-application/code/templates/admin-config.d.ts +1 -1
  9. package/dist/application-spec/generate-application/code/templates/admin-config.js +3 -2
  10. package/dist/application-spec/generate-application/code/templates/configurator-config.js +4 -2
  11. package/dist/application-spec/generate-application/code/templates/configurator-domain-code.d.ts +0 -1
  12. package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js +6 -8
  13. package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.d.ts +1 -0
  14. package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.js +8 -6
  15. package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.d.ts +1 -4
  16. package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.js +2 -2
  17. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.d.ts +1 -1
  18. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +26 -29
  19. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +0 -3
  20. package/dist/application-spec/generate-application/code/templates/domain.js +3 -3
  21. package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +11 -12
  22. package/dist/application-spec/generate-application/code/templates/skills/core/cli.js +1 -1
  23. package/dist/application-spec/generate-application/code/templates/skills/core/sdk.js +3 -2
  24. package/dist/application-spec/generate-application/code/templates/skills/core/workflow.js +13 -11
  25. package/dist/application-spec/generate-application/code/templates/skills/features/application-states/views-and-tools.js +1 -1
  26. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/index.d.ts +3 -0
  27. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/index.js +1 -0
  28. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/panel.d.ts +3 -0
  29. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/panel.js +16 -0
  30. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/reading-and-changing.d.ts +3 -0
  31. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/reading-and-changing.js +47 -0
  32. package/dist/application-spec/generate-application/code/templates/skills/features/{webhooks/assistant-setup.d.ts → assistant/session-setup.d.ts} +1 -1
  33. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/session-setup.js +15 -0
  34. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/custom-layout.js +3 -3
  35. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/pages.d.ts +1 -1
  36. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/pages.js +1 -1
  37. package/dist/application-spec/generate-application/code/templates/skills/features/domain-controls/custom-controls.js +1 -1
  38. package/dist/application-spec/generate-application/code/templates/skills/features/domain-controls/scene-controls.js +4 -2
  39. package/dist/application-spec/generate-application/code/templates/skills/features/domain-model/actions.js +3 -3
  40. package/dist/application-spec/generate-application/code/templates/skills/features/domain-model/expressions.js +1 -1
  41. package/dist/application-spec/generate-application/code/templates/skills/features/features.js +1 -1
  42. package/dist/application-spec/generate-application/code/templates/skills/features/state/violations.js +2 -2
  43. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/authentication.js +1 -1
  44. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/entry-and-environment.js +1 -1
  45. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/webhooks.js +1 -1
  46. package/dist/application-spec/generate-application/code/templates/skills/guide.d.ts +1 -1
  47. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +3 -3
  48. package/dist/application-spec/generate-application/code/templates/skills/processes/asset-conversion.js +3 -3
  49. package/dist/application-spec/generate-application/code/templates/skills/processes/assistant-configuration.d.ts +3 -0
  50. package/dist/application-spec/generate-application/code/templates/skills/processes/assistant-configuration.js +23 -0
  51. package/dist/application-spec/generate-application/code/templates/skills/processes/feedback/report.js +29 -1
  52. package/dist/application-spec/generate-application/code/templates/skills/processes/finalization.js +2 -2
  53. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/build.js +29 -15
  54. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/direction.js +17 -14
  55. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/first-draft.js +2 -2
  56. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/handoff.js +3 -3
  57. package/dist/application-spec/generate-application/code/templates/skills/processes/index.d.ts +2 -0
  58. package/dist/application-spec/generate-application/code/templates/skills/processes/index.js +1 -1
  59. package/dist/application-spec/generate-application/code/templates/skills/processes/model-migration.js +1 -1
  60. package/dist/application-spec/generate-application/code/templates/skills/processes/review/appearance.js +2 -2
  61. package/dist/application-spec/generate-application/code/templates/skills/processes/review/code.js +1 -1
  62. package/dist/application-spec/generate-application/code/templates/skills/processes/review/review.js +1 -1
  63. package/dist/application-spec/generate-application/code/templates/skills/processes/review/visual-inspection.js +1 -1
  64. package/dist/application-spec/generate-application/code/templates/skills/processes/scene-realism.d.ts +2 -0
  65. package/dist/application-spec/generate-application/code/templates/skills/processes/scene-realism.js +29 -0
  66. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/product-definition.js +2 -0
  67. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/specification.js +1 -1
  68. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-specification.d.ts +2 -0
  69. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-specification.js +28 -0
  70. package/dist/application-spec/generate-application/code/templates/webhook-builders.js +7 -6
  71. package/dist/application-spec/generate-application/code/templates/webhook-index.d.ts +2 -1
  72. package/dist/application-spec/generate-application/code/templates/webhook-index.js +2 -2
  73. package/dist/application-spec/parse-application-files/merge/merged-app-metadata.d.ts +1 -0
  74. package/dist/application-spec/parse-application-files/merge/merged-app-metadata.js +1 -1
  75. package/dist/application-spec/parse-application-files/merge/merged-assistant.js +1 -1
  76. package/dist/application-spec/parse-application-files/parse-application-files.js +1 -1
  77. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +42 -5
  78. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  79. package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.d.ts +4 -3
  80. package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
  81. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.js +1 -1
  82. package/dist/application-spec/parse-application-files/spec/model/session-data-schema.js +1 -1
  83. package/dist/application-spec/parse-application-files/spec/sections/app-metadata.js +1 -1
  84. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +2 -2
  85. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  86. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-server-settings.d.ts +5 -6
  87. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-server-settings.js +1 -1
  88. package/dist/application-spec/webhook-boundary.js +1 -1
  89. package/dist/client/cli-client/cli-api-client.d.ts +17 -0
  90. package/dist/client/cli-client/cli-api-client.js +1 -0
  91. package/dist/client/cli-client/index.d.ts +2 -0
  92. package/dist/client/cli-client/index.js +1 -0
  93. package/dist/client/cli-client/unsupported-api-version-error.d.ts +11 -0
  94. package/dist/client/cli-client/unsupported-api-version-error.js +1 -0
  95. package/dist/client/index.d.ts +1 -0
  96. package/dist/client/index.js +1 -1
  97. package/dist/client/phoenix-api.d.ts +5290 -1754
  98. package/dist/configurator/ConfiguratorApp.js +1 -1
  99. package/dist/configurator/application-runtime/extensions/configurator-extension-systems.d.ts +5 -4
  100. package/dist/configurator/application-runtime/extensions/configurator-extension-systems.js +1 -1
  101. package/dist/configurator/application-runtime/extensions/create-configurator-extensions.js +1 -1
  102. package/dist/configurator/application-runtime/extensions/selectors.d.ts +4 -2
  103. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  104. package/dist/configurator/application-runtime/extensions/systems/action-system/action-context.d.ts +14 -0
  105. package/dist/configurator/application-runtime/extensions/systems/action-system/action-factory.d.ts +13 -0
  106. package/dist/configurator/application-runtime/extensions/systems/action-system/action-system.d.ts +55 -0
  107. package/dist/configurator/application-runtime/extensions/systems/action-system/action-system.js +1 -0
  108. package/dist/configurator/application-runtime/extensions/systems/action-system/action.d.ts +44 -0
  109. package/dist/configurator/application-runtime/extensions/systems/action-system/action.js +1 -0
  110. package/dist/configurator/application-runtime/extensions/systems/action-system/index.d.ts +6 -0
  111. package/dist/configurator/application-runtime/extensions/systems/action-system/index.js +1 -0
  112. package/dist/{domain/domain-runtime/spec → configurator/application-runtime/extensions/systems/action-system}/prepare-action-implementations.d.ts +4 -3
  113. package/dist/{domain/domain-runtime/spec → configurator/application-runtime/extensions/systems/action-system}/prepare-action-implementations.js +2 -2
  114. package/dist/{domain/spec/modules → configurator/application-runtime/extensions/systems/action-system}/resolve-action-modules.d.ts +2 -2
  115. package/dist/configurator/application-runtime/extensions/systems/action-system/resolve-action-modules.js +1 -0
  116. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-annotation.d.ts +7 -4
  117. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +91 -33
  118. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  119. package/dist/configurator/application-runtime/extensions/systems/assistant-system/composer-attachments.d.ts +12 -17
  120. package/dist/configurator/application-runtime/extensions/systems/assistant-system/composer-attachments.js +1 -1
  121. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +43 -37
  122. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  123. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/index.d.ts +2 -0
  124. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/index.js +1 -0
  125. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/register-webmcp-tools.d.ts +29 -0
  126. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/register-webmcp-tools.js +2 -0
  127. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/to-webmcp-result.d.ts +10 -0
  128. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/to-webmcp-result.js +1 -0
  129. package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.d.ts +41 -35
  130. package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.js +1 -1
  131. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.d.ts +14 -4
  132. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.js +1 -1
  133. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +8 -1
  134. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  135. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +38 -9
  136. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  137. package/dist/configurator/application-runtime/extensions/systems/graphql-system/is-offered-for-selection.d.ts +16 -0
  138. package/dist/configurator/application-runtime/extensions/systems/graphql-system/is-offered-for-selection.js +1 -0
  139. package/dist/configurator/application-runtime/extensions/systems/graphql-system/read-offered-navigation.d.ts +26 -0
  140. package/dist/configurator/application-runtime/extensions/systems/graphql-system/read-offered-navigation.js +1 -0
  141. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.d.ts +25 -8
  142. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.js +1 -1
  143. package/dist/configurator/application-runtime/extensions/systems/index.d.ts +5 -4
  144. package/dist/configurator/application-runtime/extensions/systems/index.js +1 -1
  145. package/dist/configurator/application-runtime/hooks/use-configurator.d.ts +3 -3
  146. package/dist/configurator/common/configurator-interface.d.ts +9 -7
  147. package/dist/configurator/common/configurator-interface.js +1 -1
  148. package/dist/configurator/scene/cameras/CameraPadding.d.ts +5 -0
  149. package/dist/configurator/scene/cameras/CameraPadding.js +1 -1
  150. package/dist/configurator/ui/assistant/AssistantChips.d.ts +5 -5
  151. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  152. package/dist/configurator/ui/assistant/AssistantComposer.d.ts +4 -3
  153. package/dist/configurator/ui/assistant/AssistantComposer.js +1 -1
  154. package/dist/configurator/ui/assistant/AssistantPanel.d.ts +6 -4
  155. package/dist/configurator/ui/assistant/AssistantThread.d.ts +10 -2
  156. package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
  157. package/dist/configurator/ui/assistant/annotation/AnnotationViewer.js +1 -1
  158. package/dist/configurator/ui/assistant/annotation/MessageAnnotations.js +1 -1
  159. package/dist/configurator/ui/assistant/annotation/editor/AnnotationComment.d.ts +6 -5
  160. package/dist/configurator/ui/assistant/annotation/editor/AnnotationComment.js +1 -1
  161. package/dist/configurator/ui/assistant/annotation/editor/AnnotationEditor.d.ts +6 -5
  162. package/dist/configurator/ui/assistant/annotation/editor/AnnotationEditor.js +1 -1
  163. package/dist/configurator/ui/assistant/annotation/editor/annotation-pins.d.ts +5 -0
  164. package/dist/configurator/ui/assistant/annotation/editor/annotation-pins.js +1 -1
  165. package/dist/configurator/ui/assistant/annotation/index.d.ts +0 -1
  166. package/dist/configurator/ui/assistant/annotation/index.js +1 -1
  167. package/dist/configurator/ui/assistant/assistant-failure.d.ts +6 -4
  168. package/dist/configurator/ui/assistant/assistant-failure.js +1 -1
  169. package/dist/configurator/ui/assistant/attachments/MessageImages.js +1 -1
  170. package/dist/configurator/ui/assistant/drawing/AssistantDrawing.d.ts +1 -1
  171. package/dist/configurator/ui/assistant/drawing/AssistantDrawing.js +1 -1
  172. package/dist/configurator/ui/assistant/drawing/index.d.ts +1 -1
  173. package/dist/configurator/ui/assistant/drawing/index.js +1 -1
  174. package/dist/configurator/ui/assistant/drawing/parse-drawing.js +1 -1
  175. package/dist/configurator/ui/assistant/drawing/use-drawing-url.d.ts +6 -12
  176. package/dist/configurator/ui/assistant/drawing/use-drawing-url.js +1 -1
  177. package/dist/configurator/ui/assistant/form/AssistantForm.d.ts +1 -1
  178. package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -1
  179. package/dist/configurator/ui/assistant/form/form-model.d.ts +9 -0
  180. package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +6 -5
  181. package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -1
  182. package/dist/configurator/ui/assistant/form/read-form-tile.d.ts +8 -0
  183. package/dist/configurator/ui/assistant/form/read-form-tile.js +1 -0
  184. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.d.ts +6 -3
  185. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.js +1 -1
  186. package/dist/configurator/ui/assistant/form/registry/form-registry.d.ts +1 -1
  187. package/dist/configurator/ui/assistant/form/registry/form-registry.js +1 -1
  188. package/dist/configurator/ui/assistant/form/split-form-rows.d.ts +7 -0
  189. package/dist/configurator/ui/assistant/form/split-form-rows.js +1 -0
  190. package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +7 -4
  191. package/dist/configurator/ui/assistant/form-elements/FormOptions.js +1 -1
  192. package/dist/configurator/ui/assistant/form-elements/FormTile.d.ts +72 -0
  193. package/dist/configurator/ui/assistant/form-elements/FormTile.js +1 -0
  194. package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +27 -0
  195. package/dist/configurator/ui/assistant/form-elements/index.d.ts +2 -3
  196. package/dist/configurator/ui/assistant/form-elements/index.js +1 -1
  197. package/dist/configurator/ui/assistant/image-view/ImageView.js +1 -1
  198. package/dist/configurator/ui/assistant/index.d.ts +2 -2
  199. package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.d.ts +4 -1
  200. package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.js +1 -1
  201. package/dist/configurator/ui/assistant/reference-link/index.d.ts +2 -1
  202. package/dist/configurator/ui/assistant/reference-link/index.js +1 -1
  203. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -1
  204. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +2 -6
  205. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -1
  206. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +5 -6
  207. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -1
  208. package/dist/configurator/ui/assistant/thread-items.d.ts +2 -2
  209. package/dist/configurator/ui/assistant/thread-items.js +1 -1
  210. package/dist/configurator/ui/assistant/use-assistant-composer.d.ts +2 -1
  211. package/dist/configurator/ui/assistant/use-assistant-composer.js +2 -2
  212. package/dist/configurator/ui/assistant/use-assistant-thread.d.ts +15 -1
  213. package/dist/configurator/ui/assistant/use-assistant-thread.js +1 -1
  214. package/dist/configurator/ui/assistant/use-load-older-on-top.d.ts +3 -3
  215. package/dist/configurator/ui/assistant/use-load-older-on-top.js +1 -1
  216. package/dist/configurator/ui/assistant/{annotation/use-end-on-unmount.d.ts → use-on-unmount.d.ts} +1 -1
  217. package/dist/configurator/ui/assistant/use-on-unmount.js +1 -0
  218. package/dist/configurator/ui/configurator-layout/index.d.ts +1 -1
  219. package/dist/configurator/ui/configurator-layout/index.js +1 -1
  220. package/dist/configurator/ui/configurator-layout/slots/canvas/LayoutCanvas.js +1 -1
  221. package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/DesktopSidebar.js +4 -4
  222. package/dist/configurator/ui/configurator-layout/slots/index.d.ts +2 -0
  223. package/dist/configurator/ui/configurator-layout/slots/index.js +1 -1
  224. package/dist/configurator/ui/configurator-layout/slots/view-controls/DesktopViewControls.js +1 -1
  225. package/dist/configurator/ui/configurator-layout/slots/view-controls/MobileViewControls.js +1 -1
  226. package/dist/configurator/ui/configurator-layout/slots/view-controls/NestedViewControls.d.ts +7 -0
  227. package/dist/configurator/ui/configurator-layout/slots/view-controls/NestedViewControls.js +1 -0
  228. package/dist/configurator/ui/configurator-layout/slots/view-controls/use-view-control-items.d.ts +6 -0
  229. package/dist/configurator/ui/configurator-layout/slots/view-controls/use-view-control-items.js +1 -0
  230. package/dist/configurator/ui/configurator-layout/universal/DesktopPreview.js +1 -1
  231. package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +3 -3
  232. package/dist/configurator/ui/configurator-layout/universal/MobilePreview.js +1 -1
  233. package/dist/configurator/ui/configurator-layout/universal/use-preview-description.d.ts +1 -0
  234. package/dist/configurator/ui/configurator-layout/universal/use-preview-description.js +1 -0
  235. package/dist/configurator/ui/index.d.ts +1 -1
  236. package/dist/configurator/ui/legacy/layout/common/ViewControls.js +1 -1
  237. package/dist/docs/index.json +22 -2
  238. package/dist/docs/layouts/nested-view-controls.mdx +223 -0
  239. package/dist/docs/layouts/presets/custom.mdx +1 -0
  240. package/dist/docs/layouts/preview/always.mdx +22 -0
  241. package/dist/docs/layouts/view-controls.mdx +2 -0
  242. package/dist/docs/other-features/domain-actions.mdx +10 -11
  243. package/dist/docs/other-features/violation-messages.mdx +3 -1
  244. package/dist/docs/phoenix/application-states.mdx +1 -1
  245. package/dist/docs/phoenix/configurator-interface.mdx +81 -35
  246. package/dist/docs/phoenix/data-sources.mdx +1 -1
  247. package/dist/docs/phoenix/getting-started.mdx +1 -1
  248. package/dist/docs/phoenix/layout-slots.mdx +1 -1
  249. package/dist/docs/phoenix/migrations.mdx +1 -1
  250. package/dist/docs/phoenix/phoenix-cli.mdx +89 -53
  251. package/dist/docs/phoenix/project-structure.mdx +7 -7
  252. package/dist/docs/phoenix/sdk-builder-workflow.mdx +56 -27
  253. package/dist/docs/phoenix/sessions-and-access.mdx +9 -6
  254. package/dist/docs/phoenix/theming.mdx +5 -9
  255. package/dist/docs/phoenix/webhooks.mdx +55 -3
  256. package/dist/docs/ux-guidelines/choosing-navigation.mdx +2 -0
  257. package/dist/docs/ux-guidelines/designing-the-configuration-journey.mdx +43 -0
  258. package/dist/docs/ux-guidelines/interaction-modes.mdx +2 -2
  259. package/dist/docs/ux-guidelines/overview.mdx +11 -9
  260. package/dist/domain/application/application-config.d.ts +5 -0
  261. package/dist/domain/application/assistant/assistant-exposure.d.ts +22 -0
  262. package/dist/domain/application/assistant/assistant-exposure.js +1 -0
  263. package/dist/domain/application/assistant/assistant-selection.d.ts +30 -0
  264. package/dist/domain/application/assistant/assistant-selection.js +1 -0
  265. package/dist/domain/application/assistant/build-assistant-lenses.js +4 -4
  266. package/dist/domain/application/assistant/build-assistant-manifest.d.ts +2 -2
  267. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  268. package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +14 -2
  269. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  270. package/dist/domain/application/assistant/index.d.ts +5 -1
  271. package/dist/domain/application/assistant/index.js +1 -1
  272. package/dist/domain/application/assistant/prepare-assistant-navigation-updates.d.ts +16 -0
  273. package/dist/domain/application/assistant/prepare-assistant-navigation-updates.js +1 -0
  274. package/dist/domain/application/assistant/read-assistant-navigation.d.ts +40 -0
  275. package/dist/domain/application/assistant/read-assistant-navigation.js +1 -0
  276. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
  277. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +17 -1
  278. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
  279. package/dist/domain/application/assistant-field-options.d.ts +2 -0
  280. package/dist/domain/application/assistant-field-options.js +1 -1
  281. package/dist/domain/application/assistant-mutations.d.ts +17 -11
  282. package/dist/domain/application/assistant-mutations.js +1 -1
  283. package/dist/domain/application/assistant-recipe-groups.d.ts +4 -3
  284. package/dist/domain/application/assistant-recipe-groups.js +1 -1
  285. package/dist/domain/application/configurator-builder.d.ts +8 -0
  286. package/dist/domain/application/configurator-builder.js +1 -1
  287. package/dist/domain/available-system-components/available-system-components.d.ts +1 -1
  288. package/dist/domain/available-system-components/available-system-components.js +1 -1
  289. package/dist/domain/core/action/action.d.ts +0 -49
  290. package/dist/domain/core/component/system-component-filter.d.ts +1 -0
  291. package/dist/domain/core/component/system-component-filter.js +1 -1
  292. package/dist/domain/core/component/view-state-component.d.ts +4 -3
  293. package/dist/domain/core/component/view-state-component.js +1 -1
  294. package/dist/domain/core/domain-factory.d.ts +2 -3
  295. package/dist/domain/core/invariant/control-violation-hints.d.ts +37 -0
  296. package/dist/domain/core/invariant/control-violation-hints.js +1 -0
  297. package/dist/domain/core/invariant/index.d.ts +1 -0
  298. package/dist/domain/core/invariant/index.js +1 -1
  299. package/dist/domain/domain-builder/domain-builder.d.ts +1 -6
  300. package/dist/domain/domain-builder/domain-builder.js +1 -1
  301. package/dist/domain/domain-context/domain-context-systems.d.ts +3 -5
  302. package/dist/domain/domain-context/index.d.ts +0 -1
  303. package/dist/domain/domain-context/index.js +1 -1
  304. package/dist/domain/domain-context/navigation-system/navigation-system.d.ts +2 -2
  305. package/dist/domain/domain-context/navigation-system/navigation-system.js +1 -1
  306. package/dist/domain/domain-context/transformers/when-builder.js +1 -1
  307. package/dist/domain/domain-runtime/domain-context/domain-context.d.ts +1 -1
  308. package/dist/domain/domain-runtime/domain-context/domain-context.js +1 -1
  309. package/dist/domain/domain-runtime/domain-context/index.d.ts +0 -1
  310. package/dist/domain/domain-runtime/domain-context/selectors.d.ts +5 -6
  311. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  312. package/dist/domain/domain-runtime/domain-runtime.d.ts +13 -19
  313. package/dist/domain/domain-runtime/domain-runtime.js +1 -1
  314. package/dist/domain/domain-runtime/index.d.ts +0 -1
  315. package/dist/domain/domain-runtime/index.js +1 -1
  316. package/dist/domain/domain-runtime/spec/index.d.ts +0 -1
  317. package/dist/domain/domain-runtime/spec/index.js +1 -1
  318. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  319. package/dist/domain/domain-runtime/spec/selectors.d.ts +2 -2
  320. package/dist/domain/domain-runtime/spec/types.d.ts +12 -10
  321. package/dist/domain/extensions/assistant/assistant-greeting.d.ts +30 -0
  322. package/dist/domain/extensions/assistant/assistant-greeting.js +1 -0
  323. package/dist/domain/extensions/assistant/index.d.ts +1 -0
  324. package/dist/domain/extensions/assistant/index.js +1 -0
  325. package/dist/domain/extensions/index.d.ts +1 -1
  326. package/dist/domain/extensions/index.js +1 -1
  327. package/dist/domain/index.d.ts +1 -1
  328. package/dist/domain/index.js +1 -1
  329. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +6 -8
  330. package/dist/domain/spec/modules/index.d.ts +0 -1
  331. package/dist/domain/spec/modules/index.js +1 -1
  332. package/dist/domain/spec/phx/phx-domain.d.ts +0 -1
  333. package/dist/domain/spec/phx/phx-domain.js +1 -1
  334. package/dist/domain/spec/runtime/application-spec-slice.d.ts +5 -5
  335. package/dist/domain/spec/runtime/application-spec-slice.js +1 -1
  336. package/dist/domain/spec/runtime/create-application.d.ts +5 -2
  337. package/dist/domain/spec/runtime/create-application.js +1 -1
  338. package/dist/domain/spec/runtime-spec/runtime-spec.d.ts +2 -2
  339. package/dist/domain/spec/sections/app-metadata.d.ts +1 -0
  340. package/dist/domain/spec/sections/assistant/assistant-manifest.d.ts +28 -1
  341. package/dist/domain/spec/sections/assistant/assistant-navigation.d.ts +21 -0
  342. package/dist/domain/spec/sections/assistant/assistant-navigation.js +1 -0
  343. package/dist/domain/spec/sections/assistant/assistant-resolved-manifest.d.ts +30 -2
  344. package/dist/domain/spec/sections/assistant/assistant-select.d.ts +12 -0
  345. package/dist/domain/spec/sections/assistant/assistant-select.js +1 -0
  346. package/dist/domain/spec/sections/assistant/form/assistant-form-elements.d.ts +10 -26
  347. package/dist/domain/spec/sections/assistant/form/assistant-form-elements.js +1 -1
  348. package/dist/domain/spec/sections/assistant/index.d.ts +3 -1
  349. package/dist/domain/system-components/index.d.ts +1 -0
  350. package/dist/domain/system-components/index.js +1 -1
  351. package/dist/domain/system-components/navigation/index.d.ts +1 -0
  352. package/dist/domain/system-components/navigation/index.js +1 -0
  353. package/dist/domain/system-components/navigation/view-controls.d.ts +24 -0
  354. package/dist/domain/system-components/navigation/view-controls.js +1 -0
  355. package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
  356. package/dist/editor/domain-editors/apply-spec-update.js +1 -1
  357. package/dist/editor/domain-editors/use-implementation-files.d.ts +4 -3
  358. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  359. package/dist/extras/cognito/CognitoSignInPage.d.ts +2 -0
  360. package/dist/extras/cognito/CognitoSignInPage.js +1 -0
  361. package/dist/extras/cognito/index.d.ts +1 -0
  362. package/dist/extras/cognito/index.js +1 -0
  363. package/dist/i18n/locales/cs/messages.js +1 -1
  364. package/dist/i18n/locales/da/messages.js +1 -1
  365. package/dist/i18n/locales/de/messages.js +1 -1
  366. package/dist/i18n/locales/de-AT/messages.js +1 -1
  367. package/dist/i18n/locales/en/messages.js +1 -1
  368. package/dist/i18n/locales/en-AU/messages.js +1 -1
  369. package/dist/i18n/locales/en-GB/messages.js +1 -1
  370. package/dist/i18n/locales/es/messages.js +1 -1
  371. package/dist/i18n/locales/fr/messages.js +1 -1
  372. package/dist/i18n/locales/hu/messages.js +1 -1
  373. package/dist/i18n/locales/it/messages.js +1 -1
  374. package/dist/i18n/locales/nl/messages.js +1 -1
  375. package/dist/i18n/locales/pl/messages.js +1 -1
  376. package/dist/i18n/locales/pt/messages.js +1 -1
  377. package/dist/i18n/locales/ro/messages.js +1 -1
  378. package/dist/i18n/locales/sk/messages.js +1 -1
  379. package/dist/i18n/locales/tr/messages.js +1 -1
  380. package/dist/legacy/deployment-cli/commands/create-environment.js +1 -1
  381. package/dist/legacy/deployment-cli/commands/list-environments.js +1 -1
  382. package/dist/legacy/deployment-cli/commands/register-deployment.js +1 -1
  383. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +24 -2
  384. package/dist/legacy/phoenix-cli/commands/prepare-deployment-command.js +1 -1
  385. package/dist/legacy/phoenix-cli/commands/prepare-local-environment-command.js +1 -1
  386. package/dist/legacy/phoenix-cli/services/prepare-development-environment.js +1 -1
  387. package/dist/legacy/phoenix-cli/services/webhook-service/transport.js +1 -1
  388. package/dist/legacy/webhook-cli/lib/webhook-boundary.js +1 -1
  389. package/dist/phoenix/application-spec/index.d.ts +1 -1
  390. package/dist/phoenix/application-spec/index.js +1 -1
  391. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +1 -0
  392. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  393. package/dist/phoenix/cli.js +1 -1
  394. package/dist/phoenix/commands/account/index.d.ts +1 -0
  395. package/dist/phoenix/commands/account/index.js +1 -0
  396. package/dist/phoenix/commands/account/whoami.d.ts +10 -0
  397. package/dist/phoenix/commands/account/whoami.js +4 -0
  398. package/dist/phoenix/commands/cleanup-environment.js +1 -1
  399. package/dist/phoenix/commands/deploy.d.ts +7 -2
  400. package/dist/phoenix/commands/deploy.js +8 -2
  401. package/dist/phoenix/commands/deployment-build-envs-command.js +1 -1
  402. package/dist/phoenix/commands/feedback.d.ts +2 -2
  403. package/dist/phoenix/commands/feedback.js +1 -1
  404. package/dist/phoenix/commands/finish-deployment-command.js +1 -1
  405. package/dist/phoenix/commands/index.d.ts +1 -0
  406. package/dist/phoenix/commands/index.js +1 -1
  407. package/dist/phoenix/commands/init-starter-spec.js +3 -4
  408. package/dist/phoenix/commands/init.d.ts +2 -2
  409. package/dist/phoenix/commands/init.js +1 -1
  410. package/dist/phoenix/commands/login.d.ts +6 -3
  411. package/dist/phoenix/commands/login.js +3 -3
  412. package/dist/phoenix/commands/logout.js +1 -1
  413. package/dist/phoenix/commands/prepare-deployment-command.js +2 -2
  414. package/dist/phoenix/commands/prepare-local-environment-command.js +1 -1
  415. package/dist/phoenix/services/cli-credentials.d.ts +26 -7
  416. package/dist/phoenix/services/cli-credentials.js +2 -2
  417. package/dist/phoenix/services/cli-server/describe-saved-logins.d.ts +5 -0
  418. package/dist/phoenix/services/cli-server/describe-saved-logins.js +1 -0
  419. package/dist/phoenix/services/cli-server/index.d.ts +2 -0
  420. package/dist/phoenix/services/cli-server/index.js +1 -0
  421. package/dist/phoenix/services/cli-server/resolve-cli-server-url.d.ts +19 -0
  422. package/dist/phoenix/services/cli-server/resolve-cli-server-url.js +1 -0
  423. package/dist/phoenix/services/development-credential.js +1 -1
  424. package/dist/phoenix/services/index.d.ts +4 -2
  425. package/dist/phoenix/services/index.js +1 -1
  426. package/dist/phoenix/services/phoenix-regions.d.ts +6 -1
  427. package/dist/phoenix/services/phoenix-regions.js +1 -1
  428. package/dist/phoenix/services/prepare-development-environment.js +1 -1
  429. package/dist/phoenix/services/session/phoenix-application.js +1 -1
  430. package/dist/phoenix/services/signed-in-development-environment.d.ts +15 -4
  431. package/dist/phoenix/services/signed-in-development-environment.js +1 -1
  432. package/dist/phoenix/services/spec-project/describe-workspace-projects.d.ts +11 -0
  433. package/dist/phoenix/services/spec-project/describe-workspace-projects.js +1 -0
  434. package/dist/phoenix/services/spec-project/index.d.ts +3 -0
  435. package/dist/phoenix/services/spec-project/index.js +1 -0
  436. package/dist/phoenix/services/spec-project/resolve-deploy-target.d.ts +47 -0
  437. package/dist/phoenix/services/spec-project/resolve-deploy-target.js +1 -0
  438. package/dist/phoenix/services/spec-project/resolve-target-project.d.ts +34 -0
  439. package/dist/phoenix/services/spec-project/resolve-target-project.js +2 -0
  440. package/dist/phoenix/services/spec-project/write-spec-project.d.ts +7 -0
  441. package/dist/phoenix/services/spec-project/write-spec-project.js +1 -0
  442. package/dist/phoenix/services/telemetry/telemetry-event.js +1 -1
  443. package/dist/phoenix/services/telemetry/telemetry-state.d.ts +1 -1
  444. package/dist/phoenix/services/telemetry/telemetry-state.js +1 -1
  445. package/dist/phoenix/services/variant-file-session.js +1 -1
  446. package/dist/phoenix/services/webhook-service/transport.js +1 -1
  447. package/dist/react-sdk/application-runtime/common-services/index.d.ts +1 -0
  448. package/dist/react-sdk/application-runtime/common-services/index.js +1 -1
  449. package/dist/react-sdk/application-runtime/common-services/selectors.d.ts +2 -0
  450. package/dist/react-sdk/application-runtime/common-services/selectors.js +1 -1
  451. package/dist/react-sdk/application-runtime/common-services/webmcp/index.d.ts +3 -0
  452. package/dist/react-sdk/application-runtime/common-services/webmcp/index.js +1 -0
  453. package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-host.d.ts +35 -0
  454. package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-host.js +1 -0
  455. package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-model-context.d.ts +44 -0
  456. package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-model-context.js +1 -0
  457. package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-tool-result.d.ts +24 -0
  458. package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-tool-result.js +1 -0
  459. package/dist/react-sdk/application-runtime/domain-application-context/application-runtime-extension.d.ts +7 -1
  460. package/dist/react-sdk/application-runtime/domain-application-context/application-runtime-extension.js +1 -1
  461. package/dist/react-sdk/application-runtime/domain-application-context/domain-application-systems.d.ts +2 -2
  462. package/dist/react-sdk/application-runtime/domain-application-context/selectors.d.ts +1 -3
  463. package/dist/react-sdk/application-runtime/domain-application-context/selectors.js +1 -1
  464. package/dist/react-sdk/application-runtime/hooks/index.d.ts +1 -0
  465. package/dist/react-sdk/application-runtime/hooks/index.js +1 -1
  466. package/dist/react-sdk/application-runtime/hooks/use-spec.d.ts +1 -1
  467. package/dist/react-sdk/application-runtime/hooks/use-webmcp-host.d.ts +7 -0
  468. package/dist/react-sdk/application-runtime/hooks/use-webmcp-host.js +1 -0
  469. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  470. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +14 -16
  471. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
  472. package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +5 -6
  473. package/dist/react-sdk/domain-context/common-hooks/use-state-validity.d.ts +1 -1
  474. package/dist/react-sdk/domain-context/common-hooks/use-state-validity.js +1 -1
  475. package/dist/react-sdk/domain-context/index.d.ts +1 -1
  476. package/dist/react-sdk/domain-context/index.js +1 -1
  477. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.d.ts +5 -3
  478. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
  479. package/dist/react-sdk/preset-selection/PresetSelectionProvider.d.ts +11 -0
  480. package/dist/react-sdk/preset-selection/PresetSelectionProvider.js +1 -1
  481. package/dist/react-sdk/preset-selection/PresetWebMcpTools.d.ts +14 -0
  482. package/dist/react-sdk/preset-selection/PresetWebMcpTools.js +1 -0
  483. package/dist/react-sdk/preset-selection/index.d.ts +2 -1
  484. package/dist/react-sdk/preset-selection/index.js +1 -1
  485. package/dist/react-sdk/preset-selection/register-preset-webmcp-tools.d.ts +31 -0
  486. package/dist/react-sdk/preset-selection/register-preset-webmcp-tools.js +1 -0
  487. package/dist/ui-sdk/components/preview/Preview.d.ts +12 -4
  488. package/dist/ui-sdk/components/preview/Preview.js +2 -2
  489. package/dist/ui-sdk/components/toolbar/desktop-toolbar/ToolbarPopper.d.ts +2 -0
  490. package/dist/ui-sdk/components/toolbar/desktop-toolbar/ToolbarPopper.js +1 -1
  491. package/dist/ui-sdk/components/view-controls/ViewControlsContext.d.ts +3 -1
  492. package/dist/ui-sdk/components/view-controls/ViewControlsItem.js +1 -1
  493. package/dist/ui-sdk/components/view-controls/ViewControlsRoot.d.ts +6 -1
  494. package/dist/ui-sdk/components/view-controls/ViewControlsRoot.js +1 -1
  495. package/dist/webhook/builders/auth-handler-builder.d.ts +3 -0
  496. package/dist/webhook/builders/auth-handler-builder.js +1 -1
  497. package/dist/webhook/builders/common.d.ts +3 -1
  498. package/dist/webhook/builders/webhook-builder.d.ts +5 -0
  499. package/dist/webhook/builders/webhook-builder.js +1 -1
  500. package/package.json +9 -4
  501. package/schema/domain-spec.json +440 -53
  502. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/assistant-setup.js +0 -32
  503. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-guidelines.d.ts +0 -2
  504. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-guidelines.js +0 -25
  505. package/dist/configurator/ui/assistant/annotation/use-end-on-unmount.js +0 -1
  506. package/dist/configurator/ui/assistant/form-elements/FormCard.d.ts +0 -68
  507. package/dist/configurator/ui/assistant/form-elements/FormCard.js +0 -1
  508. package/dist/configurator/ui/assistant/form-elements/FormSwatch.d.ts +0 -61
  509. package/dist/configurator/ui/assistant/form-elements/FormSwatch.js +0 -1
  510. package/dist/domain/domain-context/action-system/action-system.d.ts +0 -64
  511. package/dist/domain/domain-context/action-system/action-system.js +0 -1
  512. package/dist/domain/domain-context/action-system/index.d.ts +0 -1
  513. package/dist/domain/domain-context/action-system/index.js +0 -1
  514. package/dist/domain/domain-runtime/action-factory.d.ts +0 -11
  515. package/dist/domain/domain-runtime/domain-context/action-context.d.ts +0 -11
  516. package/dist/domain/extensions/view-controls.d.ts +0 -25
  517. package/dist/domain/extensions/view-controls.js +0 -1
  518. package/dist/domain/spec/modules/resolve-action-modules.js +0 -1
  519. /package/dist/{domain/domain-runtime/domain-context → configurator/application-runtime/extensions/systems/action-system}/action-context.js +0 -0
  520. /package/dist/{domain/domain-runtime → configurator/application-runtime/extensions/systems/action-system}/action-factory.js +0 -0
@@ -1,3 +1,4 @@
1
+ import type { I18n } from '@lingui/core';
1
2
  import { type $DomainEntity, type AssistantManifest, type AssistantRecipeContext, type DomainEntity, type DomainEntityId, type DomainState, type StateUpdate, type StateUpdateEmission, type StateValidationResult } from '#package/domain';
2
3
  import { type ViolationEntry } from './violations.js';
3
4
  type AnyDomainState = DomainState<DomainEntity<string>>;
@@ -28,18 +29,23 @@ export interface EntityMetaContext {
28
29
  readonly takeScreenshot: (source: EntityMetaSource, view: string) => Promise<{
29
30
  readonly image: string;
30
31
  } | null>;
32
+ /** Whether the configurator's UI lets the user select an entity in a state, for `selectable`. */
33
+ readonly isOfferedForSelection: (entityId: DomainEntityId<string>, state: AnyDomainState) => boolean;
31
34
  /**
32
35
  * Validates a state: the one an entity was read on, for its warnings, or the one a dry-run ran on,
33
36
  * whose warnings the dry-run's own are compared with.
34
37
  */
35
38
  readonly validateState: (state: AnyDomainState) => StateValidationResult<DomainEntity<string>, string>;
39
+ /** The language a failed dry-run's violations are formatted in, as the controls format them. */
40
+ readonly i18n: I18n;
36
41
  }
37
42
  /**
38
43
  * The value of an entity's `meta` field: its built-ins, resolved lazily against the state the entity
39
44
  * was read on. `childRecipes` and `replaceRecipes` hold one field per manifest recipe group of their
40
45
  * kind, read only when selected, `null` when the group is not active on the entity there; each
41
46
  * options edge lists the choices of its field there, or `null` when its component is not active;
42
- * `screenshot` renders the entity there, and `warnings` lists the warnings and notices the entity holds there.
47
+ * `screenshot` renders the entity there, `selectable` says whether the agent can select it there, and
48
+ * `warnings` lists the warnings and notices the entity holds there.
43
49
  */
44
50
  export declare const createEntityMeta: (source: EntityMetaSource, context: EntityMetaContext) => {
45
51
  childRecipes: () => {
@@ -111,6 +117,7 @@ export declare const createEntityMeta: (source: EntityMetaSource, context: Entit
111
117
  }) => Promise<{
112
118
  readonly image: string;
113
119
  } | null>;
120
+ selectable: () => boolean;
114
121
  warnings: () => readonly import("./violations.js").AssistantWarning[];
115
122
  };
116
123
  export {};
@@ -1 +1 @@
1
- import e from"lodash-es/isEqual.js";import{findAssistantFieldOptions as t,findAssistantRecipeGroups as i,modifyEntityUpdateTag as r,prepareAssistantRecipeUpdates as n,readAssistantFieldOptions as o,readAssistantRecipeGroup as a,systemUpdateFactory as s}from"#package/domain";import{readSideEffects as d}from"./side-effects.js";import{readEntityWarnings as l,readStateWarnings as c,readViolationEntries as u}from"./violations.js";let p=e=>({ok:!1,root:null,changedEntities:[],deletedEntityIds:[],sideEffects:[],warnings:[],errors:e}),m=(e,{state:t},{recipes:i,prepareStateEmission:r,find$Entity:n,validateState:o})=>{let{validity:a,state:s,updates:l}=r(e,t,"committed");if(a.valid){let e=new Map(t.entities.map(e=>[e.id,e])),r=new Set(s.entities.map(e=>e.id));return{ok:!0,root:n(s.rootEntityId,s),changedEntities:s.entities.filter(t=>e.get(t.id)!==t).flatMap(e=>n(e.id,s)??[]),deletedEntityIds:t.entities.map(e=>e.id).filter(e=>!r.has(e)),sideEffects:d(l,i.resolveLocalizable),warnings:()=>c(a,o(t),i.resolveLocalizable),errors:[]}}return p(u(a,i.resolveLocalizable))};export const createEntityMeta=(d,c)=>{let u=e=>()=>Object.fromEntries(i(c.manifest,e,d.entity.type).map(t=>[t.groupId,()=>{let i=a(e,t,d.entity.id,d.state,c.recipes);return i?((e,t,i)=>{let{group:r,label:o,description:a,recipes:s}=e,{resolveLocalizable:d}=i.recipes;return{groupId:r.groupId,name:void 0===o?r.instanceName:d(o),description:void 0===a?null:d(a),recipes:({keys:r})=>s.filter(e=>!r||r.includes(e.key)).map(r=>((e,t,i,r)=>{let{key:o,item:a}=e,{resolveLocalizable:s}=r.recipes;return{key:o,name:s(a.title),description:void 0===a.description?null:s(a.description),imageUrl:void 0===a.thumbnailUrl?null:s(a.thumbnailUrl),dryRun:()=>t.group.dryRuns?((e,t,i,r)=>{let{updates:o,error:a}=((e,t,{entity:i,state:r},{recipes:o})=>{try{return{updates:n(e,t,i.id,r,o),error:void 0}}catch(e){if("child"===t.target.kind)throw e;return{updates:void 0,error:e instanceof Error?e.message:String(e)}}})(e,t,i,r);return void 0===o?p([{type:"uncaught",entityId:null,message:a}]):m(o,i,r)})(e,t,i,r):null}})(r,e,t,i))}})(i,d,c):null}]));return{...Object.fromEntries(t(c.manifest,d.entity.type).map(t=>[t.edgeName,({values:i})=>o(t,d.entity.id,d.state,c.recipes)?.filter(t=>!i||i.some(i=>e(i,t.value))).map(e=>({...e,dryRun:()=>t.dryRuns?(({field:e},{value:t},i,n)=>{let{entity:o}=i,a=Object.entries(Object.entries(n.manifest.writableFields??{}).find(([e])=>e===o.type)?.[1]??{}).find(([t])=>t===e)?.[1];if(void 0===a)throw Error(`The options of "${e}" on "${o.id}" cannot be dry-run: the schema lists them, but the configurator has no writable field "${e}" on ${o.type}. This is a fault in the configurator, not in your request. Tell the user this is not available.`);let d=i.state.entities.find(e=>e.id===o.id);if(!d)throw Error(`The options of "${e}" on "${o.id}" cannot be dry-run: entity "${o.id}" does not exist. It may have been deleted by an earlier operation or field. Query the current entities and use an id they return.`);let l={[a]:t},c=n.validateEntity({...d,...l});return c.success?m([s.DomainEntityModification({entityId:o.id,stateDelta:l,updateTag:r})],i,n):p([{type:"uncaught",entityId:o.id,message:`Writing ${JSON.stringify(t)} to "${e}" would make "${o.id}" an invalid ${o.type}: ${c.errors.join("; ")}. The option comes from the configurator and cannot be corrected from here, so do not write it.`}])})(t,e,d,c):null}))??null])),childRecipes:u("child"),replaceRecipes:u("replace"),screenshot:({view:e})=>c.takeScreenshot(d,e),warnings:()=>l(d.entity.id,c.validateState(d.state),c.recipes.resolveLocalizable)}};
1
+ import e from"lodash-es/isEqual.js";import{findAssistantFieldOptions as t,findAssistantRecipeGroups as i,isAssistantSelectable as r,isAssistantVisible as n,modifyEntityUpdateTag as a,prepareAssistantRecipeUpdates as o,readAssistantFieldOptions as s,readAssistantRecipeGroup as d,systemUpdateFactory as l}from"#package/domain";import{readSideEffects as c}from"./side-effects.js";import{readEntityWarnings as u,readStateWarnings as p,readViolationEntries as m}from"./violations.js";let y=e=>({ok:!1,root:null,changedEntities:[],deletedEntityIds:[],sideEffects:[],warnings:[],errors:e}),f=(e,{state:t},{manifest:i,recipes:r,prepareStateEmission:a,find$Entity:o,validateState:s,i18n:d})=>{let l=a(e,t,"committed"),{validity:u,state:f,updates:h}=l;if(u.valid){let a=new Map(t.entities.map(e=>[e.id,e])),d=new Set(f.entities.map(e=>e.id)),l=new Set(e.flatMap(e=>{switch(e.kind){case"replaceDomainEntity":return[e.entityId,e.replacementEntity.id];case"createDomainEntity":case"modifyDomainEntity":case"deleteEntity":return[e.entityId];default:return[]}})),m=e=>l.has(e.id)||n(e,i);return{ok:!0,root:o(f.rootEntityId,f),changedEntities:f.entities.filter(e=>a.get(e.id)!==e&&m(e)).flatMap(e=>o(e.id,f)??[]),deletedEntityIds:t.entities.filter(e=>!d.has(e.id)&&m(e)).map(e=>e.id),sideEffects:c(h,r.resolveLocalizable),warnings:()=>p(u,s(t),r.resolveLocalizable),errors:[]}}return y(m({validity:u,stateEmission:l},{i18n:d,resolveLocalizable:r.resolveLocalizable}))};export const createEntityMeta=(n,c)=>{let p=e=>()=>Object.fromEntries(i(c.manifest,e,n.entity.type).map(t=>[t.groupId,()=>{let i=d(e,t,n.entity.id,n.state,c.recipes);return i?((e,t,i)=>{let{group:r,label:n,description:a,recipes:s}=e,{resolveLocalizable:d}=i.recipes;return{groupId:r.groupId,name:void 0===n?r.instanceName:d(n),description:void 0===a?null:d(a),recipes:({keys:r})=>s.filter(e=>!r||r.includes(e.key)).map(r=>((e,t,i,r)=>{let{key:n,item:a}=e,{resolveLocalizable:s}=r.recipes;return{key:n,name:s(a.title),description:void 0===a.description?null:s(a.description),imageUrl:void 0===a.thumbnailUrl?null:s(a.thumbnailUrl),dryRun:()=>t.group.dryRuns?((e,t,i,r)=>{let{updates:n,error:a}=((e,t,{entity:i,state:r},{recipes:n})=>{try{return{updates:o(e,t,i.id,r,n),error:void 0}}catch(e){if("child"===t.target.kind)throw e;return{updates:void 0,error:e instanceof Error?e.message:String(e)}}})(e,t,i,r);return void 0===n?y([{type:"uncaught",entityId:null,message:a}]):f(n,i,r)})(e,t,i,r):null}})(r,e,t,i))}})(i,n,c):null}]));return{...Object.fromEntries(t(c.manifest,n.entity.type).map(t=>[t.edgeName,({values:i})=>s(t,n.entity.id,n.state,c.recipes)?.filter(t=>!i||i.some(i=>e(i,t.value))).map(e=>({...e,dryRun:()=>t.dryRuns?(({field:e},{value:t},i,r)=>{let{entity:n}=i,o=Object.entries(Object.entries(r.manifest.writableFields??{}).find(([e])=>e===n.type)?.[1]??{}).find(([t])=>t===e)?.[1];if(void 0===o)throw Error(`The options of "${e}" on "${n.id}" cannot be dry-run: the schema lists them, but the configurator has no writable field "${e}" on ${n.type}. This is a fault in the configurator, not in your request. Tell the user this is not available.`);let s=i.state.entities.find(e=>e.id===n.id);if(!s)throw Error(`The options of "${e}" on "${n.id}" cannot be dry-run: entity "${n.id}" does not exist. It may have been deleted by an earlier operation or field. Query the current entities and use an id they return.`);let d={[o]:t},c=r.validateEntity({...s,...d});return c.success?f([l.DomainEntityModification({entityId:n.id,stateDelta:d,updateTag:a})],i,r):y([{type:"uncaught",entityId:n.id,message:`Writing ${JSON.stringify(t)} to "${e}" would make "${n.id}" an invalid ${n.type}: ${c.errors.join("; ")}. The option comes from the configurator and cannot be corrected from here, so do not write it.`}])})(t,e,n,c):null}))??null])),childRecipes:p("child"),replaceRecipes:p("replace"),screenshot:({view:e})=>c.takeScreenshot(n,e),selectable:()=>r(n.entity,n.state,c,c.manifest.select??[]),warnings:()=>u(n.entity.id,c.validateState(n.state),c.recipes.resolveLocalizable)}};
@@ -1,6 +1,7 @@
1
1
  import { type ExecutionResult } from 'graphql';
2
2
  import { type Localizable } from '@salsita-ai/common/utils';
3
- import { type $DomainEntity, type AgentScreenshotComponent, type ComponentSnapshot, type DomainContextSelectors, type DomainEntity, type DomainServicesSelectors, type DomainState, type InitializationGeneration, type SessionAssistantSetup, type StateUpdateEmission } from '#package/domain';
3
+ import { type $DomainEntity, type AgentScreenshotComponent, type ComponentSnapshot, type DomainContextSelectors, type DomainEntity, type DomainServicesSelectors, type DomainState, type SessionAssistantSetup, type StateUpdateEmission } from '#package/domain';
4
+ import type { ConfiguratorExtensionSelectors } from '../../selectors.js';
4
5
  import { type AssistantWarning } from './violations.js';
5
6
  /** One single-operation GraphQL document with its own variables, as executed by {@link GraphQLSystem}. */
6
7
  export interface GraphQLOperation {
@@ -8,12 +9,36 @@ export interface GraphQLOperation {
8
9
  readonly variables?: Readonly<Record<string, unknown>>;
9
10
  readonly operationName?: string;
10
11
  }
11
- /** A screenshot an operation took, under the label its `image` field returned. */
12
- export interface GraphQLScreenshot {
12
+ /**
13
+ * A screenshot an operation took, under the label its `image` field returned: either the id the
14
+ * server stored the picture under, which the panel's tool result references it by, or the picture
15
+ * itself, kept in the browser for a caller that hands it on without the server (WebMCP).
16
+ */
17
+ export type GraphQLScreenshot = {
13
18
  readonly entityId: string;
14
19
  readonly view: string;
15
- /** The id the server stored the picture under, which the tool result references it by. */
20
+ } & ({
16
21
  readonly imageId: string;
22
+ } | {
23
+ readonly image: Blob;
24
+ });
25
+ /**
26
+ * Where the screenshots of an execution go: `upload` stores each one in the assistant thread on the
27
+ * server, which the panel's assistant needs; `inline` keeps the picture in the browser, for an
28
+ * outside agent that receives it in the tool result and has no thread to store it in.
29
+ */
30
+ export type GraphQLScreenshotStorage = 'upload' | 'inline';
31
+ /** How {@link GraphQLSystem.prepare} and {@link GraphQLSystem.execute} run their operations. */
32
+ export interface GraphQLExecutionOptions {
33
+ /** Where the screenshots go; `upload` when omitted. */
34
+ readonly screenshots?: GraphQLScreenshotStorage;
35
+ /**
36
+ * Runs only the mutations that move the user around the UI, for a caller that may not change the
37
+ * configuration right now: every other mutation field fails with `message`, which says why.
38
+ */
39
+ readonly navigationOnly?: {
40
+ readonly message: string;
41
+ };
17
42
  }
18
43
  export interface GraphQLSystemContext {
19
44
  /** The assistant the initialized session runs: the operations are validated and executed against its schema. */
@@ -31,6 +56,7 @@ export interface GraphQLSystemContext {
31
56
  readonly uploadScreenshot: (image: Blob) => Promise<{
32
57
  readonly imageId: string;
33
58
  }>;
59
+ readonly configuratorExtensionSelectors: Pick<ConfiguratorExtensionSelectors, 'getActionSystem'>;
34
60
  readonly domainContextSelectors: DomainContextSelectors;
35
61
  readonly domainServicesSelectors: DomainServicesSelectors;
36
62
  }
@@ -112,9 +138,12 @@ export declare class GraphQLSystem {
112
138
  private readonly _find$Entity;
113
139
  private readonly _validateState;
114
140
  private readonly _validateCached;
141
+ private readonly _readOfferedNavigation;
142
+ private readonly _isOfferedForSelection;
115
143
  private readonly _recipeContext;
116
144
  /** Root field resolvers, called by the executor with the field arguments and the operation context. */
117
145
  private readonly _rootValue;
146
+ /** An entity resolves to its own object type, or to `OtherEntity` when the active manifest does not expose its type. */
118
147
  private readonly _resolveType;
119
148
  private _generation;
120
149
  /**
@@ -139,7 +168,8 @@ export declare class GraphQLSystem {
139
168
  private readonly _runMutation;
140
169
  /**
141
170
  * Takes a screenshot once every one asked for before it in the execution has been taken, so they
142
- * render in document order, and uploads it as soon as it has rendered. A failure nulls only its
171
+ * render in document order, and stores it as the execution asks as soon as it has rendered:
172
+ * uploaded, or kept as the picture. A failure nulls only its
143
173
  * own field and fails nothing else: the user kept changing the configuration, rendering failed,
144
174
  * or the server did not store the picture.
145
175
  */
@@ -155,10 +185,9 @@ export declare class GraphQLSystem {
155
185
  * Runs the operations in order through one working state that starts at `originalState`: a query
156
186
  * reads the current working state, and each mutation field advances it with its own emission.
157
187
  * The closing braces an operation's document left off are added, then the lenses it spreads are injected into it. Nothing is committed. The first operation that fails stops the list; every later one gets a
158
- * "not run" error instead. Screenshots render only while `generation`, the current one by
159
- * default, is active.
188
+ * "not run" error instead. Screenshots render only while the current initialization is active.
160
189
  */
161
- prepare: (originalState: AnyDomainState, operations: readonly GraphQLOperation[], generation?: InitializationGeneration) => Promise<readonly PreparedOperation[]>;
190
+ prepare: (originalState: AnyDomainState, operations: readonly GraphQLOperation[], { screenshots: screenshotStorage, navigationOnly }?: GraphQLExecutionOptions) => Promise<readonly PreparedOperation[]>;
162
191
  /**
163
192
  * The side effects of prepared operations: the hints of every update of their emissions, as the
164
193
  * agent is told them, in applied order.
@@ -182,6 +211,6 @@ export declare class GraphQLSystem {
182
211
  * nothing is committed or prepared again: the operations were written for the configuration
183
212
  * that was left.
184
213
  */
185
- execute: (operations: readonly GraphQLOperation[]) => Promise<GraphQLExecution>;
214
+ execute: (operations: readonly GraphQLOperation[], options?: GraphQLExecutionOptions) => Promise<GraphQLExecution>;
186
215
  }
187
216
  export {};
@@ -1 +1 @@
1
- import{GraphQLError as e,NoSchemaIntrospectionCustomRule as t,defaultFieldResolver as i,execute as n,getNamedType as o,parse as r,specifiedRules as s,validate as a,validateSchema as l}from"graphql";import{assertExistence as c,createSelector as h,isMessageDescriptor as d,isMultilingualString as u}from"@salsita-ai/common/utils";import{AGENT_SCREENSHOT_MAX_SIDE as m,DomainEntityIdSchema as f,agentScreenshotComponent as p,createAssistantExecutionSchema as g,findAssistantMutation as v}from"#package/domain";import{ExportBusyError as y}from"../export-system/export-busy-error.js";import{closeUnclosedBraces as S}from"./close-unclosed-braces.js";import{createEntityMeta as _}from"./entity-meta.js";import{injectAssistantLenses as w}from"./inject-assistant-lenses.js";import{readSideEffects as x}from"./side-effects.js";import{ViolationsError as E,readStateWarnings as T,readViolationEntries as $}from"./violations.js";let b={errors:[new e("The configurator does not provide this request. This is a fault in the configurator, not in your request. Tell the user this is not available.")]},C={errors:[new e("The configuration is not loaded yet, so there is no state to query. Run the query again once the configurator has finished loading.")]},N="Not taken: another configuration was loaded while this request ran. Query the current configuration before asking for screenshots again.",M=class ScreenshotTooLargeError extends Error{constructor(e,t){super(`The view is configured at ${e} \xd7 ${t} px, more than the ${m} \xd7 ${m} px a screenshot may have.`),this.name="ScreenshotTooLargeError"}},R=new RegExp(f.pattern),k=[...s,t],j=e=>"object"==typeof e&&null!==e&&"type"in e&&"string"==typeof e.type&&"id"in e&&"string"==typeof e.id,A=(e,t)=>"object"==typeof e&&null!==e?Reflect.get(e,t):void 0,L=e=>e instanceof Error?e.message:String(e),O=e=>/[.!?]$/.test(e)?e:`${e}.`,z=e=>"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.prototype,q=(e,t)=>{let i=z(e)?e._raw:void 0;if(j(i))return i;if(!Array.isArray(e)&&!z(e))return e;if(t.has(e))throw Error("The value contains itself.");let n=new Set([...t,e]);return Array.isArray(e)?e.map(e=>q(e,n)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,q(t,n)]))};export const localize=(e,t)=>Array.isArray(e)?e.map(e=>localize(e,t)):"string"==typeof e||d(e)||u(e)?t(e):e;let F=t=>new e(`The configurator cannot handle this request: ${O(t)} This is a fault in the configurator, not in your request. Tell the user this is not available.`);export const SCREENSHOT_NOT_TAKEN="SCREENSHOT_NOT_TAKEN";let I=(t,i)=>new e(t,{originalError:i,extensions:{code:SCREENSHOT_NOT_TAKEN}}),V=e=>(e.errors??[]).some(e=>e.extensions.code!==SCREENSHOT_NOT_TAKEN),P=t=>({errors:[new e(`Not run: operation ${t+1} failed, so the operations after it were skipped and no change of the list takes effect. Fix the failing operation and send the whole list again.`)]});export class GraphQLSystem{_context;_selectSchema=h([h.leaf(e=>e)],e=>{try{let t=g(e),i=l(t);return i.length>0?F(i.map(e=>e.message).join(" ")):t}catch(e){return F(L(e))}});_selectLenses=h([h.leaf(e=>e)],e=>r(e));_selectFieldResolver=h([h.leaf(e=>e)],t=>(n,r,s,a)=>{if(a.parentType===a.schema.getQueryType())return i(n,r,s,a);if(a.parentType===a.schema.getMutationType())return this._resolveMutation(a.fieldName,String(a.path.key),r,s);if(!j(n))return i(n,r,s,a);if("meta"===a.fieldName){let e;return _({entity:n,state:("object"==typeof(e=A(n,"_state"))&&null!==e&&"entities"in e&&"rootEntityId"in e?e:void 0)??s.state},{manifest:s.manifest,recipes:this._recipeContext(),prepareStateEmission:(e,t,i)=>{let n=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(e,t,i);return s.validities.set(n.state,n.validity),n},find$Entity:(e,t)=>this._find$Entity(e,t),validateEntity:e=>this._context.domainContextSelectors.getDomain().validateEntity(e),takeScreenshot:(e,t)=>this._takeScreenshot(e,t,s),validateState:e=>this._validateCached(e,s)})}let{source:l,localized:c}=t[a.parentType.name]?.[a.fieldName]??{source:a.fieldName},h=((t,i)=>{try{return A(t,i)}catch(n){throw new e(`Expression "${i}" failed on ${j(t)?t.id:"an entity"}: ${O(L(n))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:n instanceof Error?n:void 0})}})(n,l);return c?localize(h,this._context.domainServicesSelectors.getResolveLocalizable()):l.startsWith("$")&&"JSON"===o(a.returnType).name?((t,i,n)=>{try{return q(n,new Set)}catch(n){throw new e(`Expression "${i}" returned a value that is not plain serializable data on ${j(t)?t.id:"an entity"}: ${O(L(n))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:n instanceof Error?n:void 0})}})(n,l,h):h});constructor(e){this._context=e}_get$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().get$Entity(e,t);_find$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().getEntity(e,t)?this._get$Entity(e,t):null;_validateState=e=>this._context.domainContextSelectors.getValidationProjections().validateState(e);_validateCached=(e,{validities:t})=>{let i=t.get(e);if(i)return i;let n=this._validateState(e);return t.set(e,n),n};_recipeContext=()=>({componentReader:this._context.domainContextSelectors.getComponentReader(),recipeCooker:this._context.domainContextSelectors.getRecipeCookerSystem(),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});_rootValue={warnings:(e,t)=>T(this._validateCached(t.state,t),void 0,this._context.domainServicesSelectors.getResolveLocalizable()),root:(e,{state:t})=>this._get$Entity(t.rootEntityId,t),entities:({ids:t},{state:i})=>{if(null==t)return i.entities.map(e=>this._get$Entity(e.id,i));var n=i.rootEntityId;let o=t.filter(e=>!R.test(e));if(o.length>0)throw new e(`${o.map(e=>`"${e}"`).join(", ")} ${1===o.length?"is not an entity id":"are not entity ids"}. Entity ids have the form "<Type>-<number>", e.g. "${n}". Use ids as returned by the "id" field.`);return t.map(e=>R.test(e)?this._find$Entity(e,i):null)},selectedEntity:(e,{state:t})=>this._find$Entity(this._context.domainContextSelectors.getNavigationSystem().getActiveSelectionState(t),t),navigation:(e,{state:t})=>{let i=this._context.domainContextSelectors.getNavigationSystem();return{navigationState:i.getActiveNavigationState(t),viewState:i.getActiveViewState(t),toolState:i.getActiveToolState(t)}}};_resolveType=e=>j(e)?e.type:void 0;_generation={active:!0};_renderScreenshot=async(e,t,i)=>{let n=this._context.domainContextSelectors.getComponentReader().readOneComponent({entityId:e,componentType:p,instanceName:t},i);if(!n)return null;let{width:o,height:r}=n.state;if(o>m||r>m)throw new M(o,r);let s=await this._context.renderScreenshot(n,i);return null===s?null:new Blob([s],{type:"JPEG"===n.state.fileFormat?"image/jpeg":"image/png"})};initialize=()=>{this._generation.active=!1,this._generation={active:!0}};_resolveMutation=(t,i,n,o)=>{if(void 0!==o.failedMutationField)throw new e(`Not run: the earlier field "${o.failedMutationField}" of this operation failed, so "${i}" was skipped and no change of the operation takes effect. Fix the failing field and send the operation again.`);try{return this._runMutation(t,n,o)}catch(e){throw o.failedMutationField=i,e}};_runMutation=(t,i,n)=>{let o=v(t,n.manifest);if(!o)throw new e(`The schema declares the mutation "${t}", but the configurator has no implementation for it. This is a fault in the configurator, not in your request. Tell the user this is not available.`);let r=n.state,s=o.implementation(i,r,{manifest:n.manifest,action:this._context.domainContextSelectors.getActionSystem().createContext(r),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});if(s.updates.length>0){let i=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(s.updates,r,"committed"),{validity:o}=i;if("uncaught"===o.severity)throw new e(`The changes of "${t}" were not applied, because the resulting configuration is invalid: validating it threw: ${O(L(o.error))} Change the request so the configuration stays valid.`,{originalError:o.error});if(!o.valid)throw new E(`The changes of "${t}" were not applied, because the resulting configuration has ${o.severity} violations.`,$(o,this._context.domainServicesSelectors.getResolveLocalizable()));n.emissions.push(i),n.validities.set(i.state,o),n.state=i.state}return s.readResult({previousState:r,state:n.state})};_takeScreenshot=({entity:t,state:i},n,o)=>{let r=o.manifest.screenshots?.[t.type]?.find(e=>e.view===n);if(!r)return Promise.reject(new e(`The schema declares the screenshot view "${n}" on ${t.type}, but the configurator has no view of that name. This is a fault in the configurator, not in your request. Tell the user this is not available.`));let s=o.lastScreenshot.then(async()=>{if(!o.generation.active)throw I(N);let e=await this._renderScreenshot(t.id,r.instanceName,i).catch(e=>{throw I(e instanceof y?"User made concurrent actions that prevented the screenshot from being taken, try again":e instanceof M?`The screenshot of ${t.id} from "${n}" cannot be taken: ${e.message} Tell the user the screenshot is not available.`:`The screenshot of ${t.id} from "${n}" could not be taken: ${O(L(e))} Try again; if it fails again, tell the user the screenshot is not available.`,e instanceof Error?e:void 0)});if(!o.generation.active)throw I(N);if(null===e)return null;let{imageId:s}=await this._context.uploadScreenshot(e).catch(e=>{throw I(`The screenshot of ${t.id} from "${n}" was taken but could not be stored: ${O(L(e))} Try again; if it fails again, tell the user the screenshot is not available.`,e instanceof Error?e:void 0)}),a=`${t.id}/${n}`,l=[...o.screenshots.values()].filter(e=>e.entityId===t.id&&e.view===n).length,c=0===l?a:`${a}#${l+1}`;return o.screenshots.set(c,{entityId:t.id,view:n,imageId:s}),{image:c}});return o.lastScreenshot=s.catch(()=>void 0),s};_setup=()=>{let{manifest:t,error:i}=this._context.getAssistantSetup();if(i)return{ready:!1,result:{errors:[new e(i.message,{originalError:i})]}};if(!t)return{ready:!1,result:b};let n=this._selectSchema(t.sdl);return n instanceof e?{ready:!1,result:{errors:[n]}}:{ready:!0,assistant:t,schema:n,lenses:t.lenses?.definitions?this._selectLenses(t.lenses.definitions):void 0,fieldResolver:this._selectFieldResolver(t.fields)}};_run=async(t,i,o,s)=>{var l;let c;try{c=r(t)}catch(t){return{errors:[t instanceof e?t:new e(L(t))]}}let h=a(o.schema,c,k);return h.length>0?{errors:h}:(l=await n({schema:o.schema,document:c,rootValue:this._rootValue,contextValue:s,variableValues:i.variables,operationName:i.operationName,fieldResolver:o.fieldResolver,typeResolver:this._resolveType}),l.errors?.some(e=>e.originalError instanceof E)?{...l,errors:l.errors.flatMap(t=>t.originalError instanceof E?t.originalError.entries.map(({type:i,entityId:n,message:o})=>new e(o??i,{nodes:t.nodes,source:t.source,positions:t.positions,path:t.path,extensions:{code:"VIOLATION",type:i,entityId:n}})):[t])}:l)};prepare=async(t,i,n=this._generation)=>{let o,r=this._setup();if(!r.ready)return i.map(()=>({result:r.result,emissions:[],screenshots:new Map}));let s={manifest:r.assistant,state:t,emissions:[],failedMutationField:void 0,screenshots:new Map,lastScreenshot:Promise.resolve(),generation:n,validities:new WeakMap},a=[];for(let[t,n]of i.entries())if(void 0===o){let i=s.emissions.length,l=s.screenshots.size;s.failedMutationField=void 0;let c=S(n.document),h=r.lenses?w(c,r.lenses):c,d=h instanceof e?{errors:[h]}:await this._run(h,n,r,s);await s.lastScreenshot,a.push({result:d,emissions:s.emissions.slice(i),screenshots:new Map([...s.screenshots].slice(l))}),V(d)&&(o=t)}else a.push({result:P(o),emissions:[],screenshots:new Map});return a};readSideEffects=e=>{let t=this._context.domainServicesSelectors.getResolveLocalizable();return e.flatMap(({emissions:e})=>e.flatMap(e=>x(e.updates,t)))};readScreenshots=e=>new Map(e.flatMap(({screenshots:e})=>[...e]));readWarnings=(e,t)=>{let i=t.flatMap(({emissions:e})=>e).at(-1);return void 0===i||t.some(({result:e})=>V(e))?[]:T(i.validity,this._validateState(e),this._context.domainServicesSelectors.getResolveLocalizable())};_prepareAndCommit=async(e,t)=>{let i,n,o,r=this._context.domainContextSelectors.getStoreSystem(),s=r.stateSlices.committed.value.state,a=await this.prepare(s,e,t),l=a.map(({result:e})=>e),h=this.readSideEffects(a),d=this.readScreenshots(a),u=a.flatMap(e=>e.emissions);if(!t.active)return{results:l,sideEffects:h,screenshots:d,warnings:[],outcome:"conflict"};if(l.some(V)||0===u.length)return{results:l,sideEffects:h,screenshots:d,warnings:[],outcome:"none"};let m=(i=c(u[0]),n=c(u[u.length-1]),o=u.some(e=>void 0!==e.transformationLog),{kind:"committed",previousState:i.previousState,state:n.state,updates:u.flatMap(e=>e.updates),validity:n.validity,transformationLog:o?u.flatMap(e=>e.transformationLog??[]):void 0});return{results:l,sideEffects:h,screenshots:d,warnings:this.readWarnings(s,a),outcome:r.commitPrepared(m),preparedState:m.state}};execute=async e=>{let t=this._generation;if(!this._context.domainContextSelectors.getStoreSystem().isInitialized)return{results:e.map(()=>C),committed:!1,sideEffects:[],warnings:[],screenshots:new Map};let i=await this._prepareAndCommit(e,t),{results:n,sideEffects:o,warnings:r,screenshots:s,outcome:a,preparedState:l}="conflict"===i.outcome&&t.active?await this._prepareAndCommit(e,t):i;return"committed"===a?{results:n,committed:!0,sideEffects:o,warnings:r,screenshots:s,preparedState:l}:"held"===a?{results:n,committed:!1,message:"The changes wait for the user's approval and are not applied yet. Do not send them again; the next `[changes]` block lists them once approved.",sideEffects:o,warnings:r,screenshots:s,preparedState:l}:"conflict"===a?{results:n,committed:!1,message:"The changes were not committed, because the configuration changed while they were being applied. The results describe a state that was discarded. Query the current configuration and send the operations again if they still make sense.",sideEffects:o,warnings:r,screenshots:s}:{results:n,committed:!1,sideEffects:o,warnings:r,screenshots:s}}}
1
+ import{GraphQLError as e,NoSchemaIntrospectionCustomRule as t,defaultFieldResolver as i,execute as n,getNamedType as o,parse as r,specifiedRules as s,validate as a,validateSchema as l}from"graphql";import{assertExistence as c,createSelector as h,isMessageDescriptor as d,isMultilingualString as f}from"@salsita-ai/common/utils";import{AGENT_SCREENSHOT_MAX_SIDE as m,ASSISTANT_OTHER_ENTITY as u,DomainEntityIdSchema as p,agentScreenshotComponent as g,createAssistantExecutionSchema as v,findAssistantMutation as y,isAssistantVisible as S,readAssistantNavigation as _}from"#package/domain";import{ExportBusyError as w}from"../export-system/export-busy-error.js";import{closeUnclosedBraces as x}from"./close-unclosed-braces.js";import{createEntityMeta as E}from"./entity-meta.js";import{injectAssistantLenses as T}from"./inject-assistant-lenses.js";import{isOfferedForSelection as b}from"./is-offered-for-selection.js";import{readOfferedNavigation as $}from"./read-offered-navigation.js";import{readSideEffects as C}from"./side-effects.js";import{ViolationsError as N,readStateWarnings as O,readViolationEntries as R}from"./violations.js";let j={errors:[new e("The configurator does not provide this request. This is a fault in the configurator, not in your request. Tell the user this is not available.")]},M={errors:[new e("The configuration is not loaded yet, so there is no state to query. Run the query again once the configurator has finished loading.")]},k="Not taken: another configuration was loaded while this request ran. Query the current configuration before asking for screenshots again.",A=class ScreenshotTooLargeError extends Error{constructor(e,t){super(`The view is configured at ${e} \xd7 ${t} px, more than the ${m} \xd7 ${m} px a screenshot may have.`),this.name="ScreenshotTooLargeError"}},L=new RegExp(p.pattern),z=[...s,t],F=e=>"object"==typeof e&&null!==e&&"type"in e&&"string"==typeof e.type&&"id"in e&&"string"==typeof e.id,q=(e,t)=>"object"==typeof e&&null!==e?Reflect.get(e,t):void 0,I=e=>e instanceof Error?e.message:String(e),V=e=>/[.!?]$/.test(e)?e:`${e}.`,P=e=>"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.prototype,D=(e,t)=>{let i=P(e)?e._raw:void 0;if(F(i))return i;if(!Array.isArray(e)&&!P(e))return e;if(t.has(e))throw Error("The value contains itself.");let n=new Set([...t,e]);return Array.isArray(e)?e.map(e=>D(e,n)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,D(t,n)]))};export const localize=(e,t)=>Array.isArray(e)?e.map(e=>localize(e,t)):"string"==typeof e||d(e)||f(e)?t(e):e;let H=t=>new e(`The configurator cannot handle this request: ${V(t)} This is a fault in the configurator, not in your request. Tell the user this is not available.`);export const SCREENSHOT_NOT_TAKEN="SCREENSHOT_NOT_TAKEN";let K=(t,i)=>new e(t,{originalError:i,extensions:{code:SCREENSHOT_NOT_TAKEN}}),Q=e=>(e.errors??[]).some(e=>e.extensions.code!==SCREENSHOT_NOT_TAKEN),W=t=>({errors:[new e(`Not run: operation ${t+1} failed, so the operations after it were skipped and no change of the list takes effect. Fix the failing operation and send the whole list again.`)]}),G=e=>Array.isArray(e)?e.map(G):"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,G(t)])):e;export class GraphQLSystem{_context;_selectSchema=h([h.leaf(e=>e)],e=>{try{let t=v(e),i=l(t);return i.length>0?H(i.map(e=>e.message).join(" ")):t}catch(e){return H(I(e))}});_selectLenses=h([h.leaf(e=>e)],e=>r(e));_selectFieldResolver=h([h.leaf(e=>e)],t=>(n,r,s,a)=>{if(a.parentType===a.schema.getQueryType())return i(n,r,s,a);if(a.parentType===a.schema.getMutationType())return this._resolveMutation(a.fieldName,String(a.path.key),r,s);if(!F(n))return i(n,r,s,a);if("meta"===a.fieldName){let e;return E({entity:n,state:("object"==typeof(e=q(n,"_state"))&&null!==e&&"entities"in e&&"rootEntityId"in e?e:void 0)??s.state},{manifest:s.manifest,recipes:this._recipeContext(),prepareStateEmission:(e,t,i)=>{let n=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(e,t,i);return s.validities.set(n.state,n.validity),n},find$Entity:(e,t)=>this._find$Entity(e,t),validateEntity:e=>this._context.domainContextSelectors.getDomain().validateEntity(e),takeScreenshot:(e,t)=>this._takeScreenshot(e,t,s),isOfferedForSelection:this._isOfferedForSelection,i18n:this._context.domainServicesSelectors.getI18n(),validateState:e=>this._validateCached(e,s)})}let{source:l,localized:c}=t[a.parentType.name]?.[a.fieldName]??{source:a.fieldName},h=((t,i)=>{try{return q(t,i)}catch(n){throw new e(`Expression "${i}" failed on ${F(t)?t.id:"an entity"}: ${V(I(n))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:n instanceof Error?n:void 0})}})(n,l);return c?localize(h,this._context.domainServicesSelectors.getResolveLocalizable()):l.startsWith("$")&&"JSON"===o(a.returnType).name?((t,i,n)=>{try{return D(n,new Set)}catch(n){throw new e(`Expression "${i}" returned a value that is not plain serializable data on ${F(t)?t.id:"an entity"}: ${V(I(n))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:n instanceof Error?n:void 0})}})(n,l,h):h});constructor(e){this._context=e}_get$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().get$Entity(e,t);_find$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().getEntity(e,t)?this._get$Entity(e,t):null;_validateState=e=>this._context.domainContextSelectors.getValidationProjections().validateState(e);_validateCached=(e,{validities:t})=>{let i=t.get(e);if(i)return i;let n=this._validateState(e);return t.set(e,n),n};_readOfferedNavigation=e=>$(e,{componentReader:this._context.domainContextSelectors.getComponentReader(),navigationSystem:this._context.domainContextSelectors.getNavigationSystem()});_isOfferedForSelection=(e,t)=>b(e,t,{componentReader:this._context.domainContextSelectors.getComponentReader()});_recipeContext=()=>({componentReader:this._context.domainContextSelectors.getComponentReader(),recipeCooker:this._context.domainContextSelectors.getRecipeCookerSystem(),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});_rootValue={warnings:(e,t)=>O(this._validateCached(t.state,t),void 0,this._context.domainServicesSelectors.getResolveLocalizable()),root:(e,{state:t})=>this._get$Entity(t.rootEntityId,t),entities:({ids:t},{state:i})=>{if(null==t)return i.entities.map(e=>this._get$Entity(e.id,i));var n=i.rootEntityId;let o=t.filter(e=>!L.test(e));if(o.length>0)throw new e(`${o.map(e=>`"${e}"`).join(", ")} ${1===o.length?"is not an entity id":"are not entity ids"}. Entity ids have the form "<Type>-<number>", e.g. "${n}". Use ids as returned by the "id" field.`);return t.map(e=>L.test(e)?this._find$Entity(e,i):null)},selectedEntity:(e,{state:t})=>this._find$Entity(this._context.domainContextSelectors.getNavigationSystem().getActiveSelectionState(t),t),navigation:(e,{state:t,manifest:i})=>_(t,{navigationSystem:this._context.domainContextSelectors.getNavigationSystem(),readOfferedNavigation:this._readOfferedNavigation},i.navigation??{navigationStates:[],viewStates:[],toolStates:[]})};_resolveType=(e,{manifest:t})=>{if(F(e))return S(e,t)?e.type:u};_generation={active:!0};_renderScreenshot=async(e,t,i)=>{let n=this._context.domainContextSelectors.getComponentReader().readOneComponent({entityId:e,componentType:g,instanceName:t},i);if(!n)return null;let{width:o,height:r}=n.state;if(o>m||r>m)throw new A(o,r);let s=await this._context.renderScreenshot(n,i);return null===s?null:new Blob([s],{type:"JPEG"===n.state.fileFormat?"image/jpeg":"image/png"})};initialize=()=>{this._generation.active=!1,this._generation={active:!0}};_resolveMutation=(t,i,n,o)=>{if(void 0!==o.failedMutationField)throw new e(`Not run: the earlier field "${o.failedMutationField}" of this operation failed, so "${i}" was skipped and no change of the operation takes effect. Fix the failing field and send the operation again.`);try{return this._runMutation(t,n,o)}catch(e){throw o.failedMutationField=i,e}};_runMutation=(t,i,n)=>{let o=y(t,n.manifest),r=Object.entries(n.manifest.actions??{}).find(([e])=>e===t)?.[1];if(!o&&void 0===r)throw new e(`The schema declares the mutation "${t}", but the configurator has no implementation for it. This is a fault in the configurator, not in your request. Tell the user this is not available.`);if(n.navigationOnly&&!o?.navigation)throw new e(n.navigationOnly.message);let s=n.state,a=o?o.implementation(i,s,{manifest:n.manifest,systems:this._context.domainContextSelectors.getDomainSystems(),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable(),readOfferedNavigation:this._readOfferedNavigation,isOfferedForSelection:this._isOfferedForSelection}):this._context.configuratorExtensionSelectors.getActionSystem().prepareAction(r,G(i),s);if(a.updates.length>0){let i=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(a.updates,s,"committed"),{validity:o}=i;if("uncaught"===o.severity)throw new e(`The changes of "${t}" were not applied, because the resulting configuration is invalid: validating it threw: ${V(I(o.error))} Change the request so the configuration stays valid.`,{originalError:o.error});if(!o.valid)throw new N(`The changes of "${t}" were not applied, because the resulting configuration has ${o.severity} violations.`,R({validity:o,stateEmission:i},{i18n:this._context.domainServicesSelectors.getI18n(),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()}));n.emissions.push(i),n.validities.set(i.state,o),n.state=i.state}return a.readResult({previousState:s,state:n.state})};_takeScreenshot=({entity:t,state:i},n,o)=>{let r=o.manifest.screenshots?.[t.type]?.find(e=>e.view===n);if(!r)return Promise.reject(new e(`The schema declares the screenshot view "${n}" on ${t.type}, but the configurator has no view of that name. This is a fault in the configurator, not in your request. Tell the user this is not available.`));let s=o.lastScreenshot.then(async()=>{if(!o.generation.active)throw K(k);let e=await this._renderScreenshot(t.id,r.instanceName,i).catch(e=>{throw K(e instanceof w?"User made concurrent actions that prevented the screenshot from being taken, try again":e instanceof A?`The screenshot of ${t.id} from "${n}" cannot be taken: ${e.message} Tell the user the screenshot is not available.`:`The screenshot of ${t.id} from "${n}" could not be taken: ${V(I(e))} Try again; if it fails again, tell the user the screenshot is not available.`,e instanceof Error?e:void 0)});if(!o.generation.active)throw K(k);if(null===e)return null;let s="inline"===o.screenshotStorage?{image:e}:await this._context.uploadScreenshot(e).catch(e=>{throw K(`The screenshot of ${t.id} from "${n}" was taken but could not be stored: ${V(I(e))} Try again; if it fails again, tell the user the screenshot is not available.`,e instanceof Error?e:void 0)}),a=`${t.id}/${n}`,l=[...o.screenshots.values()].filter(e=>e.entityId===t.id&&e.view===n).length,c=0===l?a:`${a}#${l+1}`;return o.screenshots.set(c,{entityId:t.id,view:n,...s}),{image:c}});return o.lastScreenshot=s.catch(()=>void 0),s};_setup=()=>{let{manifest:t,error:i}=this._context.getAssistantSetup();if(i)return{ready:!1,result:{errors:[new e(i.message,{originalError:i})]}};if(!t)return{ready:!1,result:j};let n=this._selectSchema(t.sdl);return n instanceof e?{ready:!1,result:{errors:[n]}}:{ready:!0,assistant:t,schema:n,lenses:t.lenses?.definitions?this._selectLenses(t.lenses.definitions):void 0,fieldResolver:this._selectFieldResolver(t.fields)}};_run=async(t,i,o,s)=>{var l;let c;try{c=r(t)}catch(t){return{errors:[t instanceof e?t:new e(I(t))]}}let h=a(o.schema,c,z);return h.length>0?{errors:h}:(l=await n({schema:o.schema,document:c,rootValue:this._rootValue,contextValue:s,variableValues:i.variables,operationName:i.operationName,fieldResolver:o.fieldResolver,typeResolver:this._resolveType}),l.errors?.some(e=>e.originalError instanceof N)?{...l,errors:l.errors.flatMap(t=>t.originalError instanceof N?t.originalError.entries.map(({type:i,entityId:n,message:o,details:r})=>new e(o,{nodes:t.nodes,source:t.source,positions:t.positions,path:t.path,extensions:{code:"VIOLATION",type:i,entityId:n,...void 0===r?{}:{details:r}}})):[t])}:l)};prepare=async(t,i,{screenshots:n="upload",navigationOnly:o}={})=>{let r,s=this._generation,a=this._setup();if(!a.ready)return i.map(()=>({result:a.result,emissions:[],screenshots:new Map}));let l={manifest:a.assistant,state:t,emissions:[],failedMutationField:void 0,screenshots:new Map,lastScreenshot:Promise.resolve(),generation:s,screenshotStorage:n,navigationOnly:o,validities:new WeakMap},c=[];for(let[t,n]of i.entries())if(void 0===r){let i=l.emissions.length,o=l.screenshots.size;l.failedMutationField=void 0;let s=x(n.document),h=a.lenses?T(s,a.lenses):s,d=h instanceof e?{errors:[h]}:await this._run(h,n,a,l);await l.lastScreenshot,c.push({result:d,emissions:l.emissions.slice(i),screenshots:new Map([...l.screenshots].slice(o))}),Q(d)&&(r=t)}else c.push({result:W(r),emissions:[],screenshots:new Map});return c};readSideEffects=e=>{let t=this._context.domainServicesSelectors.getResolveLocalizable();return e.flatMap(({emissions:e})=>e.flatMap(e=>C(e.updates,t)))};readScreenshots=e=>new Map(e.flatMap(({screenshots:e})=>[...e]));readWarnings=(e,t)=>{let i=t.flatMap(({emissions:e})=>e).at(-1);return void 0===i||t.some(({result:e})=>Q(e))?[]:O(i.validity,this._validateState(e),this._context.domainServicesSelectors.getResolveLocalizable())};_prepareAndCommit=async(e,t,i)=>{let n,o,r,s=this._context.domainContextSelectors.getStoreSystem(),a=s.stateSlices.committed.value.state,l=await this.prepare(a,e,i),h=l.map(({result:e})=>e),d=this.readSideEffects(l),f=this.readScreenshots(l),m=l.flatMap(e=>e.emissions);if(!t.active)return{results:h,sideEffects:d,screenshots:f,warnings:[],outcome:"conflict"};if(h.some(Q)||0===m.length)return{results:h,sideEffects:d,screenshots:f,warnings:[],outcome:"none"};let u=(n=c(m[0]),o=c(m[m.length-1]),r=m.some(e=>void 0!==e.transformationLog),{kind:"committed",previousState:n.previousState,state:o.state,updates:m.flatMap(e=>e.updates),validity:o.validity,transformationLog:r?m.flatMap(e=>e.transformationLog??[]):void 0});return{results:h,sideEffects:d,screenshots:f,warnings:this.readWarnings(a,l),outcome:s.commitPrepared(u),preparedState:u.state}};execute=async(e,t={})=>{let i=this._generation;if(!this._context.domainContextSelectors.getStoreSystem().isInitialized)return{results:e.map(()=>M),committed:!1,sideEffects:[],warnings:[],screenshots:new Map};let n=await this._prepareAndCommit(e,i,t),{results:o,sideEffects:r,warnings:s,screenshots:a,outcome:l,preparedState:c}="conflict"===n.outcome&&i.active?await this._prepareAndCommit(e,i,t):n;return"committed"===l?{results:o,committed:!0,sideEffects:r,warnings:s,screenshots:a,preparedState:c}:"held"===l?{results:o,committed:!1,message:"The changes wait for the user's approval and are not applied yet. Do not send them again; the next `[changes]` block lists them once approved.",sideEffects:r,warnings:s,screenshots:a,preparedState:c}:"conflict"===l?{results:o,committed:!1,message:"The changes were not committed, because the configuration changed while they were being applied. The results describe a state that was discarded. Query the current configuration and send the operations again if they still make sense.",sideEffects:r,warnings:s,screenshots:a}:{results:o,committed:!1,sideEffects:r,warnings:s,screenshots:a}}}
@@ -0,0 +1,16 @@
1
+ import { type AnyComponentReader, type DomainEntity, type DomainEntityId, type DomainState } from '#package/domain';
2
+ /** What whether an entity is offered for selection is read through: the UI components. */
3
+ export interface OfferedSelectionContext {
4
+ readonly componentReader: Pick<AnyComponentReader, 'readManyComponents'>;
5
+ }
6
+ /**
7
+ * Whether the UI lets the user select the entity `entityId` in `state`: the entity carries a
8
+ * `selectable` component, which makes it selectable by clicking it in the scene, or a
9
+ * `sceneEntitySelectHotspot`, whose hotspot selects it.
10
+ *
11
+ * Known gaps: a component counts while it is present in the state, whether or not it is on screen;
12
+ * and an entity the user can select only through an `entityChildrenList` item or its "Edit" action,
13
+ * or through controls of a custom layout that call `useSelectEntity` or `getSelectUpdate`, is not
14
+ * offered.
15
+ */
16
+ export declare const isOfferedForSelection: (entityId: DomainEntityId<string>, state: DomainState<DomainEntity<string>>, { componentReader }: OfferedSelectionContext) => boolean;
@@ -0,0 +1 @@
1
+ import{sceneEntitySelectHotspotComponent as e,selectableComponent as o}from"#package/domain";export const isOfferedForSelection=(n,t,{componentReader:p})=>p.readManyComponents({componentTypes:[o,e],entityIds:[n]},t).length>0;
@@ -0,0 +1,26 @@
1
+ import { type AnyComponentReader, type AnyNavigationSystem, type AssistantOfferedNavigation, type DomainEntity, type DomainState } from '#package/domain';
2
+ /** What the offered states are read through: the UI components, and the active navigation and selection. */
3
+ export interface OfferedNavigationContext {
4
+ readonly componentReader: Pick<AnyComponentReader, 'readFirstRootComponent' | 'readFirstComponent' | 'readManyComponents'>;
5
+ readonly navigationSystem: Pick<AnyNavigationSystem, 'getActiveNavigationState' | 'getActiveSelectionState'>;
6
+ }
7
+ /**
8
+ * The states the UI offers the user in `state`, read from the controls the built-in layout shows,
9
+ * one by one:
10
+ * - the first `navigationSteps` on the root: every step before the active one and the one after it
11
+ * (the first step while none is active), entered by its first navigation state;
12
+ * - the tabs of every `sidebarTabs` of the selected entity and of the first `horizontalTabs`, each
13
+ * entered by its first navigation state. Both kinds are read wherever they are declared, although
14
+ * of the desktop headers only the fixed one shows horizontal tabs; the floating and hidden headers show the
15
+ * sidebar tabs alone, and the mobile tabs show the one kind declared and fail when both are;
16
+ * - every `sceneEntityNavigationHotspot`; a state only a hotspot that pushes offers is entered by
17
+ * pushing it, as that hotspot does. When two pushing hotspots offer the same state, the last one's
18
+ * `canStackOnto` is used;
19
+ * - the items of the first `viewControls` on the root;
20
+ * - the items of the first `toolControls` on the root, the options of every `toolMenuFab` and the
21
+ * exit of every `exitToolModeFab`.
22
+ *
23
+ * A step or tab without navigation states is left out, as the UI leaves it out. A component offers
24
+ * its states while it is present in the state, whether or not it is on screen.
25
+ */
26
+ export declare const readOfferedNavigation: (state: DomainState<DomainEntity<string>>, { componentReader, navigationSystem }: OfferedNavigationContext) => AssistantOfferedNavigation;
@@ -0,0 +1 @@
1
+ import{exitToolModeFabComponent as t,horizontalTabsComponent as e,navigationStepsComponent as o,sceneEntityNavigationHotspotComponent as a,sidebarTabsComponent as n,toolControlsComponent as s,toolMenuFabComponent as i,viewControlsComponent as f}from"#package/domain";export const readOfferedNavigation=(d,{componentReader:r,navigationSystem:l})=>{let p=new Set,m=new Map,c=new Set,S=new Set,v=l.getActiveNavigationState(d),g=(r.readFirstRootComponent({componentTypes:[o]},d)?.state.steps??[]).filter(t=>t.navigationStates.length>0),y=g.findIndex(t=>t.navigationStates.includes(v));for(let[t,e]of g.entries())if(t<y||t===y+1)for(let t of e.navigationStates.slice(0,1))p.add(t);for(let t of r.readManyComponents({componentTypes:[n],entityIds:[l.getActiveSelectionState(d)]},d).flatMap(t=>t.state.tabs))for(let e of t.navigationStates.slice(0,1))p.add(e);let T=r.readFirstComponent({componentTypes:[e]},d);for(let t of T?.state.tabs??[])for(let e of t.navigationStates.slice(0,1))p.add(e);let u=r.readManyComponents({componentTypes:[a]},d);for(let{state:t}of u)t.pushToStack||p.add(t.navigationState);for(let{state:t}of u)t.pushToStack&&!p.has(t.navigationState)&&m.set(t.navigationState,t.canStackOnto);for(let t of m.keys())p.add(t);let C=r.readFirstRootComponent({componentTypes:[f]},d);for(let t of C?.state.items??[])if(void 0!==t.value)c.add(t.value);else for(let e of t.items)c.add(e.value);let M=r.readFirstRootComponent({componentTypes:[s]},d);for(let t of M?.state.items??[])S.add(t.value);for(let t of r.readManyComponents({componentTypes:[i]},d))for(let e of t.state.options)S.add(e.toolState);for(let e of r.readManyComponents({componentTypes:[t]},d))S.add(e.state.exitTo);return{navigationStates:p,pushedNavigationStates:m,viewStates:c,toolStates:S}};
@@ -1,11 +1,18 @@
1
+ import type { I18n } from '@lingui/core';
1
2
  import type { Localizable } from '@salsita-ai/common/utils';
2
- import type { DomainEntity, EntityId, StateValidationResult } from '#package/domain';
3
+ import { type $DomainEntity, type DomainEntity, type EntityId, type StateEmission, type StateValidationResult } from '#package/domain';
3
4
  type AnyStateValidationResult = StateValidationResult<DomainEntity<string>, string>;
4
- /** One violation that makes a change fail, as the agent reads it; a violation can sit on a virtual entity. */
5
+ type AnyStateEmission = StateEmission<DomainEntity<string>, Record<string, $DomainEntity<DomainEntity<string>>>>;
6
+ /**
7
+ * One reason a change fails, as the agent reads it; a violation can sit on a virtual entity.
8
+ * `message` is the violation's own message as the user would be told it, or its type when it has
9
+ * none; `details` is its message formatted for this change, present only when it says more.
10
+ */
5
11
  export interface ViolationEntry {
6
12
  readonly type: string;
7
13
  readonly entityId: EntityId | null;
8
- readonly message: string | null;
14
+ readonly message: string;
15
+ readonly details?: string;
9
16
  }
10
17
  /** One warning or notice, which never makes a change fail. */
11
18
  export interface AssistantWarning {
@@ -23,13 +30,23 @@ export declare class ViolationsError extends Error {
23
30
  readonly entries: readonly ViolationEntry[];
24
31
  constructor(message: string, entries: readonly ViolationEntry[]);
25
32
  }
33
+ /** The change whose validity failed: its emission, and its validity narrowed to the failure. */
34
+ export interface ReadViolationEntriesProps {
35
+ readonly validity: Extract<AnyStateValidationResult, {
36
+ readonly valid: false;
37
+ }>;
38
+ readonly stateEmission: AnyStateEmission;
39
+ }
40
+ /** The language the reasons are written in and how their messages are resolved to it. */
41
+ export interface ReadViolationEntriesContext {
42
+ readonly i18n: I18n;
43
+ readonly resolveLocalizable: (message: Localizable) => string;
44
+ }
26
45
  /**
27
- * The violations an invalid validity fails on: those of its failing severity, or the one error that
28
- * validation threw.
46
+ * The reasons a change fails, as the controls explain a refused change: its fatal and fixable
47
+ * violations selected by `selectControlViolationHints`, or the one error that validation threw.
29
48
  */
30
- export declare const readViolationEntries: (validity: Extract<AnyStateValidationResult, {
31
- readonly valid: false;
32
- }>, resolveLocalizable: (message: Localizable) => string) => readonly ViolationEntry[];
49
+ export declare const readViolationEntries: ({ validity, stateEmission }: ReadViolationEntriesProps, { i18n, resolveLocalizable }: ReadViolationEntriesContext) => readonly ViolationEntry[];
33
50
  /**
34
51
  * The warnings and notices of `after` that `before` did not have, in the order of `after`; every one
35
52
  * of `after` when there is no `before`.
@@ -1 +1 @@
1
- export class ViolationsError extends Error{entries;constructor(e,t){super(e),this.entries=t}}let e=(e,t)=>void 0===e?null:t(e);export const readViolationEntries=(t,r)=>"uncaught"===t.severity?[{type:"uncaught",entityId:null,message:t.error.message}]:t.entityViolations.filter(({violation:e})=>e.severity===t.severity).map(({entityId:t,violation:i})=>({type:i.type,entityId:t,message:e(i.message,r)}));let t=e=>null===e.severity||"uncaught"===e.severity?[]:e.entityViolations.filter(({violation:e})=>{let t;return"warning"===(t=e.severity)||"notice"===t}),r=({entityId:e,violation:{type:t,severity:r}})=>JSON.stringify([e,t,r]),i=(t,r,i)=>({type:r.type,severity:"notice"===r.severity?"notice":"warning",entityId:t,message:e(r.message,i)});export const readStateWarnings=(e,n,s)=>{let a=new Set(void 0===n?[]:t(n).map(r));return t(e).filter(e=>!a.has(r(e))).map(({entityId:e,violation:t})=>i(e,t,s))};export const readEntityWarnings=(e,r,n)=>t(r).filter(t=>t.entityId===e).map(({violation:t})=>i(e,t,n));
1
+ import{CONTROL_VIOLATION_SEVERITIES as e,selectControlViolationHints as t}from"#package/domain";export class ViolationsError extends Error{entries;constructor(e,t){super(e),this.entries=t}}let i=(e,t)=>void 0===e?null:t(e);export const readViolationEntries=({validity:n,stateEmission:r},{i18n:s,resolveLocalizable:o})=>"uncaught"===n.severity?[{type:"uncaught",entityId:null,message:n.error.message}]:t({violations:n.entityViolations.filter(({violation:t})=>e.includes(t.severity)),stateEmission:r,ignoreViolationTypes:[]},{i18n:s,resolveLocalizable:o}).map(({entityViolation:{entityId:e,violation:t},hint:n})=>{let r=i(t.message,o)??t.type;return{type:t.type,entityId:e,message:r,...void 0===n||n===r?{}:{details:n}}});let n=e=>null===e.severity||"uncaught"===e.severity?[]:e.entityViolations.filter(({violation:e})=>{let t;return"warning"===(t=e.severity)||"notice"===t}),r=({entityId:e,violation:{type:t,severity:i}})=>JSON.stringify([e,t,i]),s=(e,t,n)=>({type:t.type,severity:"notice"===t.severity?"notice":"warning",entityId:e,message:i(t.message,n)});export const readStateWarnings=(e,t,i)=>{let o=new Set(void 0===t?[]:n(t).map(r));return n(e).filter(e=>!o.has(r(e))).map(({entityId:e,violation:t})=>s(e,t,i))};export const readEntityWarnings=(e,t,i)=>n(t).filter(t=>t.entityId===e).map(({violation:t})=>s(e,t,i));
@@ -1,8 +1,8 @@
1
1
  export { AnimationSystem, type AnimationSystemContext } from './animation-system.js';
2
- export type { AssistantAnnotation, AssistantAnnotationOverlay } from './assistant-system/assistant-annotation.js';
2
+ export type { AssistantAnnotation, AssistantAnnotationDrawing, AssistantAnnotationOverlay, } from './assistant-system/assistant-annotation.js';
3
3
  export type { AssistantImageView } from './assistant-system/assistant-image-view.js';
4
- export { type AssistantDraftAttachment, MAX_COMPOSER_ATTACHMENTS } from './assistant-system/composer-attachments.js';
5
- export { type AssistantAnnotationAttachment, type AssistantAnnotationImage, type AssistantAttachment, type AssistantChatSnapshot, type AssistantEarlierThreadSnapshot, type AssistantClientTool, type AssistantPanelSnapshot, AssistantSystem, type AssistantSystemContext, } from './assistant-system/assistant-system.js';
4
+ export { type AssistantAttachment, type AssistantDraftAttachment, MAX_COMPOSER_ATTACHMENTS, } from './assistant-system/composer-attachments.js';
5
+ export { type AssistantAnnotationTarget, type AssistantChatSnapshot, type AssistantEarlierThreadSnapshot, type AssistantClientTool, type AssistantPanelSnapshot, AssistantSystem, type AssistantSystemContext, } from './assistant-system/assistant-system.js';
6
6
  export type { AssistantPlayback, AssistantPlaybackStatus } from './assistant-system/assistant-speech-player.js';
7
7
  export { isSpeakableReply } from './assistant-system/speakable-reply.js';
8
8
  export { CameraControlSystem, CameraControlType } from './camera-control-system/camera-control-system.js';
@@ -11,10 +11,11 @@ export { createCameraControls } from './camera-control-system/create-camera-cont
11
11
  export { type AnyCanvasSystem, CanvasSystem, type EntityObjectFilter, type FlushToken } from './canvas-system.js';
12
12
  export { type AnyDragAndDropSystem, DragAndDropSystem, type DragAndDropSystemContext, type DraggableState, type DraggingState, type RotationDraggingState, } from './drag-and-drop-system/drag-and-drop-system.js';
13
13
  export { type AnyExportSystem, ExportSystem, type ExportSystemContext } from './export-system/export-system.js';
14
- export { type GraphQLExecution, type GraphQLScreenshot, type GraphQLOperation, GraphQLSystem, type GraphQLSystemContext, type PreparedOperation, SCREENSHOT_NOT_TAKEN, } from './graphql-system/graphql-system.js';
14
+ export { type GraphQLExecution, type GraphQLExecutionOptions, type GraphQLScreenshot, type GraphQLScreenshotStorage, type GraphQLOperation, GraphQLSystem, type GraphQLSystemContext, type PreparedOperation, SCREENSHOT_NOT_TAKEN, } from './graphql-system/graphql-system.js';
15
15
  export type * from './image-rendering-system/image-renderer.js';
16
16
  export { type AnyImageRenderingSystem, ImageRenderingSystem, type ImageRenderingSystemContext, } from './image-rendering-system/image-rendering-system.js';
17
17
  export { type AnyLayoutSystem, LayoutSystem, type LayoutSystemContext } from './layout-system/layout-system.js';
18
18
  export { toolbarHelpElementName } from './layout-system/toolbar-help-element.js';
19
19
  export { type AnySketchingSystem, SketchingSystem } from './sketching-system/sketching-system.js';
20
20
  export { LineEndPointUpdateTag, LineLengthUpdateTag, LineLineConnectionUpdateTag, LineRectangleBottomLeftConnectionUpdateTag, LineRectangleBottomRightConnectionUpdateTag, LineRectangleTopLeftConnectionUpdateTag, LineRectangleTopRightConnectionUpdateTag, LineSketchingPointUpdateTag, LineStartPointUpdateTag, RectangleBottomLeftCornerUpdateTag, RectangleBottomRightCornerUpdateTag, RectangleDepthUpdateTag, RectangleSketchingPointUpdateTag, RectangleTopLeftCornerUpdateTag, RectangleTopRightCornerUpdateTag, RectangleWidthUpdateTag, SetInitialSketchingPointPositionTag, SketchingFixTransformationTag, isAnySketchingPointUpdate, isLineEndPointUpdate, isLineLengthUpdate, isLineLineConnectionUpdate, isLineRectangleBottomLeftConnectionUpdate, isLineRectangleBottomRightConnectionUpdate, isLineRectangleTopLeftConnectionUpdate, isLineRectangleTopRightConnectionUpdate, isLineSketchingPointUpdate, isLineStartPointUpdate, isRectangleBottomLeftCornerUpdate, isRectangleBottomRightCornerUpdate, isRectangleDepthUpdate, isRectangleSketchingPointUpdate, isRectangleTopLeftCornerUpdate, isRectangleTopRightCornerUpdate, isRectangleWidthUpdate, isSetInitialLinePositionUpdate, isSetInitialRectanglePositionUpdate, isSketchingFixTransformationUpdate, } from './sketching-system/sketching-updates.js';
21
+ export * from './action-system/index.js';
@@ -1 +1 @@
1
- export{AnimationSystem}from"./animation-system.js";export{MAX_COMPOSER_ATTACHMENTS}from"./assistant-system/composer-attachments.js";export{AssistantSystem}from"./assistant-system/assistant-system.js";export{isSpeakableReply}from"./assistant-system/speakable-reply.js";export{CameraControlSystem,CameraControlType}from"./camera-control-system/camera-control-system.js";export{CameraSystem}from"./camera-control-system/camera-system.js";export{createCameraControls}from"./camera-control-system/create-camera-controls.js";export{CanvasSystem}from"./canvas-system.js";export{DragAndDropSystem}from"./drag-and-drop-system/drag-and-drop-system.js";export{ExportSystem}from"./export-system/export-system.js";export{GraphQLSystem,SCREENSHOT_NOT_TAKEN}from"./graphql-system/graphql-system.js";export{ImageRenderingSystem}from"./image-rendering-system/image-rendering-system.js";export{LayoutSystem}from"./layout-system/layout-system.js";export{toolbarHelpElementName}from"./layout-system/toolbar-help-element.js";export{SketchingSystem}from"./sketching-system/sketching-system.js";export{LineEndPointUpdateTag,LineLengthUpdateTag,LineLineConnectionUpdateTag,LineRectangleBottomLeftConnectionUpdateTag,LineRectangleBottomRightConnectionUpdateTag,LineRectangleTopLeftConnectionUpdateTag,LineRectangleTopRightConnectionUpdateTag,LineSketchingPointUpdateTag,LineStartPointUpdateTag,RectangleBottomLeftCornerUpdateTag,RectangleBottomRightCornerUpdateTag,RectangleDepthUpdateTag,RectangleSketchingPointUpdateTag,RectangleTopLeftCornerUpdateTag,RectangleTopRightCornerUpdateTag,RectangleWidthUpdateTag,SetInitialSketchingPointPositionTag,SketchingFixTransformationTag,isAnySketchingPointUpdate,isLineEndPointUpdate,isLineLengthUpdate,isLineLineConnectionUpdate,isLineRectangleBottomLeftConnectionUpdate,isLineRectangleBottomRightConnectionUpdate,isLineRectangleTopLeftConnectionUpdate,isLineRectangleTopRightConnectionUpdate,isLineSketchingPointUpdate,isLineStartPointUpdate,isRectangleBottomLeftCornerUpdate,isRectangleBottomRightCornerUpdate,isRectangleDepthUpdate,isRectangleSketchingPointUpdate,isRectangleTopLeftCornerUpdate,isRectangleTopRightCornerUpdate,isRectangleWidthUpdate,isSetInitialLinePositionUpdate,isSetInitialRectanglePositionUpdate,isSketchingFixTransformationUpdate}from"./sketching-system/sketching-updates.js";
1
+ export{AnimationSystem}from"./animation-system.js";export{MAX_COMPOSER_ATTACHMENTS}from"./assistant-system/composer-attachments.js";export{AssistantSystem}from"./assistant-system/assistant-system.js";export{isSpeakableReply}from"./assistant-system/speakable-reply.js";export{CameraControlSystem,CameraControlType}from"./camera-control-system/camera-control-system.js";export{CameraSystem}from"./camera-control-system/camera-system.js";export{createCameraControls}from"./camera-control-system/create-camera-controls.js";export{CanvasSystem}from"./canvas-system.js";export{DragAndDropSystem}from"./drag-and-drop-system/drag-and-drop-system.js";export{ExportSystem}from"./export-system/export-system.js";export{GraphQLSystem,SCREENSHOT_NOT_TAKEN}from"./graphql-system/graphql-system.js";export{ImageRenderingSystem}from"./image-rendering-system/image-rendering-system.js";export{LayoutSystem}from"./layout-system/layout-system.js";export{toolbarHelpElementName}from"./layout-system/toolbar-help-element.js";export{SketchingSystem}from"./sketching-system/sketching-system.js";export{LineEndPointUpdateTag,LineLengthUpdateTag,LineLineConnectionUpdateTag,LineRectangleBottomLeftConnectionUpdateTag,LineRectangleBottomRightConnectionUpdateTag,LineRectangleTopLeftConnectionUpdateTag,LineRectangleTopRightConnectionUpdateTag,LineSketchingPointUpdateTag,LineStartPointUpdateTag,RectangleBottomLeftCornerUpdateTag,RectangleBottomRightCornerUpdateTag,RectangleDepthUpdateTag,RectangleSketchingPointUpdateTag,RectangleTopLeftCornerUpdateTag,RectangleTopRightCornerUpdateTag,RectangleWidthUpdateTag,SetInitialSketchingPointPositionTag,SketchingFixTransformationTag,isAnySketchingPointUpdate,isLineEndPointUpdate,isLineLengthUpdate,isLineLineConnectionUpdate,isLineRectangleBottomLeftConnectionUpdate,isLineRectangleBottomRightConnectionUpdate,isLineRectangleTopLeftConnectionUpdate,isLineRectangleTopRightConnectionUpdate,isLineSketchingPointUpdate,isLineStartPointUpdate,isRectangleBottomLeftCornerUpdate,isRectangleBottomRightCornerUpdate,isRectangleDepthUpdate,isRectangleSketchingPointUpdate,isRectangleTopLeftCornerUpdate,isRectangleTopRightCornerUpdate,isRectangleWidthUpdate,isSetInitialLinePositionUpdate,isSetInitialRectanglePositionUpdate,isSketchingFixTransformationUpdate}from"./sketching-system/sketching-updates.js";export*from"./action-system/index.js";
@@ -1,6 +1,6 @@
1
- import type { $DomainEntity, DomainEntity } from '#package/domain';
1
+ import type { $DomainEntity, ActionTypes, DomainEntity } from '#package/domain';
2
2
  import { type ConfiguratorExtensionSystems } from '../extensions/index.js';
3
- export type UseConfiguratorExtensions<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string> = () => ConfiguratorExtensionSystems<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>;
3
+ export type UseConfiguratorExtensions<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string, ACTION_TYPES extends ActionTypes = ActionTypes> = () => ConfiguratorExtensionSystems<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, ACTION_TYPES>;
4
4
  /**
5
5
  * Reads the runtime-owned configurator systems. The graph is available before a configuration
6
6
  * lifecycle so bootstrap flows such as preset selection can use it.
@@ -8,4 +8,4 @@ export type UseConfiguratorExtensions<ENTITIES extends DomainEntity<string>, ALL
8
8
  * The application runtime provider erases its generic system extension. This hook is the generated
9
9
  * configurator boundary that restores the application's entity-aware configurator system graph.
10
10
  */
11
- export declare const useConfigurator: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string>() => ConfiguratorExtensionSystems<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>;
11
+ export declare const useConfigurator: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string, ACTION_TYPES extends ActionTypes = ActionTypes>() => ConfiguratorExtensionSystems<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, ACTION_TYPES>;
@@ -1,7 +1,7 @@
1
1
  import { type $DomainEntity, type ActionTypes, type ConfiguratorBuilder, type CreateCustomPhoenixEntityElement, type CreateCustomPhoenixLayoutElement, type CreateGetThemeHandler, type CreateGetWebComponentOptionsHandler, type CreatePhoenixHandler, type DomainEntity, type IsCreateRecipeUpdate, type IsReplaceRecipeUpdate, type TransformerBuilder, type TransformerFactory, type UpdateFactory, getIdSequence } from '#package/domain';
2
- import { type CreateAddEntityFab, type CreateAppLoader, type CreateCollectFrontendDataHandler, type CreateConfigurationNotFoundPage, type CreateConfiguratorErrorPage, type CreateDeleteEntityFab, type CreateFilterPublishedChunksHandler, type CreateNavigationHotspot, type CreateNotAuthenticatedPage, type CreateOnApplicationStartProvider, type CreateOnBackendDataReadyProvider, type CreateOnConfiguratorReadyProvider, type CreateOnFrontendDataReadyProvider, type CreateOnGoToIndexHandler, type CreateOnPresetLoadedHandler, type CreateOnPublishedDataReadyProvider, type CreateOnRoutingReadyProvider, type CreateOnSessionReadyProvider, type CreatePresetUi, type CreateSelectionHotspot, type CreateToolMenuFab, type IsAngleDimensionUpdate, type IsAttributeSelectionUpdate, type IsAttributeSwitchUpdate, type IsDeleteEntityUpdate, type IsDistanceDimensionUpdate, type IsGenericDimensionUpdate, type IsSwatchSelectionUpdate, type IsTextValueUpdate, type UseAccessService, type UseActiveNavigationState, type UseActiveToolState, type UseActiveViewState, type UseActiveViewports, type UseAnalyticsService, type UseAngleDimension, type UseAttributeSelection, type UseAttributeSwitch, type UseAuthenticatedClient, type UseAuthorizedClient, type UseBackendData, type UseChildEntitySelection, type UseComponent, type UseComponents, type UseComposition, type UseConfigurationId, type UseConfigurationSaveState, type UseConfiguratorMessages, type UseConfiguratorRouting, type UseControlViolations, type UseCookRecipes, type UseCookReplaceRecipes, type UseCookedRecipes, type UseCookedReplaceRecipes, type UseCreateAuthorizedClient, type UseDeleteEntity, type UseDeletedEntity, type UseDeselect, type UseDistanceDimension, type UseDistanceDimensionSelection, type UseDomainApplicationContext, type UseDomainApplicationProps, type UseDomainContext, type UseDomainEntityState, type UseEntityPrice, type UseEntitySelector, type UseFinalizeAction, type UseFinalizeActions, type UseFinalizeViolations, type UseFirstComponent, type UseFirstRootComponent, type UseFrontendData, type UseGenericDimension, type UseGroupedRecipeOptions, type UseHoveredDomainEntityId, type UseHoveredEntity, type UseHoveredEntityId, type UseIntegrationService, type UseIntegrationState, type UseIsFullscreenActive, type UseLoadedData, type UseLoadingState, type UseLocaleSwitch, type UseMapViolationHints, type UseNavigate, type UsePopNavigate, type UsePresetEmbeddedState, type UsePresetSelection, type UsePublishedData, type UsePushNavigate, type UseRecipeEmbeddedState, type UseReplaceEntityRecipeOptions, type UseRootComponents, type UseRootEntityId, type UseRootEntityPrice, type UseRootEntitySelector, type UseRootEntityState, type UseSelectEntity, type UseSelectParent, type UseSelectedDomainEntityId, type UseSelectedEntity, type UseSelectedEntityId, type UseSession, type UseSessionRole, type UseSessionService, type UseSetFullscreen, type UseSetViewState, type UseShareLinks, type UseSlice, type UseState, type UseStateValidity, type UseStepNavigation, type UseSwatchSelection, type UseSynchronizedSelector, type UseSynchronizedSelector$, type UseTabNavigation, type UseTextValue, type UseUndoRedo, type UseUpdateControl, type UseUpdatedControl, useGenerateShareLink, useLoadingStateValue, useLocalizable, useResolveLocalizable } from '#package/react-sdk';
2
+ import { type CreateAddEntityFab, type CreateAppLoader, type CreateCollectFrontendDataHandler, type CreateConfigurationNotFoundPage, type CreateConfiguratorErrorPage, type CreateDeleteEntityFab, type CreateFilterPublishedChunksHandler, type CreateNavigationHotspot, type CreateNotAuthenticatedPage, type CreateOnApplicationStartProvider, type CreateOnBackendDataReadyProvider, type CreateOnConfiguratorReadyProvider, type CreateOnFrontendDataReadyProvider, type CreateOnGoToIndexHandler, type CreateOnPresetLoadedHandler, type CreateOnPublishedDataReadyProvider, type CreateOnRoutingReadyProvider, type CreateOnSessionReadyProvider, type CreatePresetUi, type CreateSelectionHotspot, type CreateToolMenuFab, type IsAngleDimensionUpdate, type IsAttributeSelectionUpdate, type IsAttributeSwitchUpdate, type IsDeleteEntityUpdate, type IsDistanceDimensionUpdate, type IsGenericDimensionUpdate, type IsSwatchSelectionUpdate, type IsTextValueUpdate, type UseAccessService, type UseActiveNavigationState, type UseActiveToolState, type UseActiveViewState, type UseActiveViewports, type UseAnalyticsService, type UseAngleDimension, type UseAttributeSelection, type UseAttributeSwitch, type UseAuthenticatedClient, type UseAuthorizedClient, type UseBackendData, type UseChildEntitySelection, type UseComponent, type UseComponents, type UseComposition, type UseConfigurationId, type UseConfigurationSaveState, type UseConfiguratorMessages, type UseConfiguratorRouting, type UseControlViolations, type UseCookRecipes, type UseCookReplaceRecipes, type UseCookedRecipes, type UseCookedReplaceRecipes, type UseCreateAuthorizedClient, type UseDeleteEntity, type UseDeletedEntity, type UseDeselect, type UseDistanceDimension, type UseDistanceDimensionSelection, type UseDomainApplicationContext, type UseDomainApplicationProps, type UseDomainContext, type UseDomainEntityState, type UseEntityPrice, type UseEntitySelector, type UseFinalizeAction, type UseFinalizeActions, type UseFinalizeViolations, type UseFirstComponent, type UseFirstRootComponent, type UseFrontendData, type UseGenericDimension, type UseGroupedRecipeOptions, type UseHoveredDomainEntityId, type UseHoveredEntity, type UseHoveredEntityId, type UseIntegrationService, type UseIntegrationState, type UseIsFullscreenActive, type UseLoadedData, type UseLoadingState, type UseLocaleSwitch, type UseMapViolationHints, type UseNavigate, type UsePopNavigate, type UsePresetEmbeddedState, type UsePresetSelection, type UsePublishedData, type UsePushNavigate, type UseRecipeEmbeddedState, type UseReplaceEntityRecipeOptions, type UseRootComponents, type UseRootEntityId, type UseRootEntityPrice, type UseRootEntitySelector, type UseRootEntityState, type UseSelectEntity, type UseSelectParent, type UseSelectedDomainEntityId, type UseSelectedEntity, type UseSelectedEntityId, type UseSession, type UseSessionRole, type UseSessionService, type UseSetFullscreen, type UseSetViewState, type UseShareLinks, type UseSlice, type UseState, type UseStateValidity, type UseStepNavigation, type UseSwatchSelection, type UseSynchronizedSelector, type UseSynchronizedSelector$, type UseTabNavigation, type UseTextValue, type UseUndoRedo, type UseUpdateControl, type UseUpdatedControl, useActiveViewChildState, useGenerateShareLink, useLoadingStateValue, useLocalizable, useResolveLocalizable } from '#package/react-sdk';
3
3
  import { type CreatePhoenixIconSet } from '#package/ui-sdk';
4
- import { type UseConfiguratorExtensions } from '../application-runtime/index.js';
4
+ import { type UseConfiguratorExtensions, createActionFactory } from '../application-runtime/index.js';
5
5
  import { usePreview, usePropertyPageStack, usePropertyPageState } from '../configurator-context/index.js';
6
6
  import { useCloseAction } from '../integration/index.js';
7
7
  import { type CreateGetTextureProcessingMapHandler } from '../scene/index.js';
@@ -264,16 +264,16 @@ export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, AL
264
264
  /**
265
265
  * Domain context with all typesd domain systems
266
266
  */
267
- useDomain: UseDomainContext<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, ACTION_TYPES>;
267
+ useDomain: UseDomainContext<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>;
268
268
  /**
269
269
  * Domain application context with all typed domain application systems
270
270
  */
271
271
  useDomainApplication: UseDomainApplicationContext;
272
272
  /** Configurator runtime extensions with all typed configurator systems. */
273
- useConfigurator: UseConfiguratorExtensions<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>;
274
- /**
275
- * Routing service used to navigate in the Configurator
276
- */
273
+ useConfigurator: UseConfiguratorExtensions<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, ACTION_TYPES>;
274
+ /** Implements configurator actions with project-typed parameters, results and systems. */
275
+ readonly implementActions: ReturnType<typeof createActionFactory<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ACTION_TYPES>>;
276
+ /** Routing service used to navigate in the configurator. */
277
277
  useConfiguratorRouting: UseConfiguratorRouting;
278
278
  /**
279
279
  * Preset selection service used to select a preset
@@ -517,6 +517,8 @@ export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, AL
517
517
  * Get the currently active view state
518
518
  */
519
519
  useActiveViewState: UseActiveViewState<VIEW_STATES>;
520
+ /** Current runtime choice within the declared view. */
521
+ useActiveViewChildState: typeof useActiveViewChildState;
520
522
  /**
521
523
  * Make the given view state the active one
522
524
  */
@@ -1 +1 @@
1
- import{createCustomPhoenixEntityElement as e,createCustomPhoenixLayoutElement as t,createGetThemeHandler as r,createGetWebComponentOptionsHandler as o,createPhoenixHandler as i,createTransformer as n,createTransformerBuilder as s,createUpdateFactory as a,getIdSequence as m,isCreateEntityUpdate as p,isReplaceEntityUpdate as d}from"#package/domain";import{createAddEntityFab as c,createAppLoader as u,createCollectFrontendDataHandler as f,createConfigurationNotFoundPage as l,createConfiguratorErrorPage as g,createDeleteEntityFab as j,createFilterPublishedChunksHandler as x,createNavigationHotspot as k,createNotAuthenticatedPage as y,createOnApplicationStartProvider as I,createOnBackendDataReadyProvider as A,createOnConfiguratorReadyProvider as C,createOnFrontendDataReadyProvider as S,createOnGoToIndexHandler as w,createOnPresetLoadedHandler as E,createOnPublishedDataReadyProvider as b,createOnRoutingReadyProvider as q,createOnSessionReadyProvider as B,createPresetUi as P,createSelectionHotspot as R,createToolMenuFab as U,isAngleDimensionUpdate as h,isAttributeSelectionUpdate as v,isAttributeSwitchUpdate as z,isDeleteEntityUpdate as D,isDistanceDimensionUpdate as F,isGenericDimensionUpdate as G,isSwatchSelectionUpdate as H,isTextValueUpdate as J,useAccessService as K,useActiveNavigationState as L,useActiveToolState as M,useActiveViewState as N,useActiveViewports as O,useAnalyticsService as Q,useAngleDimension as T,useAttributeSelection as V,useAttributeSwitch as W,useAuthenticatedClient as X,useAuthorizedClient as Y,useBackendData as Z,useChildEntitySelection as $,useCommittedSlice as _,useCommittedState as ee,useComponent as et,useComponents as er,useComposition as eo,useConfigurationId as ei,useConfigurationSaveState as en,useConfiguratorMessages as es,useConfiguratorRouting as ea,useControlViolations as em,useCookRecipes as ep,useCookReplaceRecipes as ed,useCookedRecipes as ec,useCookedReplaceRecipes as eu,useCreateAuthorizedClient as ef,useDeleteEntity as el,useDeletedEntity as eg,useDeselect as ej,useDistanceDimension as ex,useDistanceDimensionSelection as ek,useDomain as ey,useDomainApplication as eI,useDomainApplicationProps as eA,useDomainEntityRenderedState as eC,useDomainEntityState as eS,useEntityPrice as ew,useEntitySelector as eE,useFinalizeAction as eb,useFinalizeActions as eq,useFinalizeViolations as eB,useFirstComponent as eP,useFirstRenderedComponent as eR,useFirstRootComponent as eU,useFirstRootRenderedComponent as eh,useFrontendData as ev,useGenerateShareLink as ez,useGenericDimension as eD,useGroupedRecipeOptions as eF,useHoveredDomainEntityId as eG,useHoveredEntity as eH,useHoveredEntityId as eJ,useIntegrationService as eK,useIntegrationState as eL,useIsFullscreenActive as eM,useLoadedData as eN,useLoadingState as eO,useLoadingStateValue as eQ,useLocaleSwitch as eT,useLocalizable as eV,useMapViolationHints as eW,useNavigate as eX,usePopNavigate as eY,usePresetEmbeddedState as eZ,usePresetSelection as e$,usePublishedData as e_,usePushNavigate as e0,useRecipeEmbeddedState as e1,useRenderedComponent as e2,useRenderedComponents as e3,useRenderedEntitySelector as e4,useRenderedRootEntitySelector as e5,useRenderedSelector as e6,useRenderedSelector$ as e7,useRenderedSlice as e8,useRenderedState as e9,useReplaceEntityRecipeOptions as te,useResolveLocalizable as tt,useRootComponents as tr,useRootEntityId as to,useRootEntityPrice as ti,useRootEntityRenderedId as tn,useRootEntityRenderedState as ts,useRootEntitySelector as ta,useRootEntityState as tm,useRootRenderedComponents as tp,useSelectEntity as td,useSelectParent as tc,useSelectedDomainEntityId as tu,useSelectedEntity as tf,useSelectedEntityId as tl,useSession as tg,useSessionRole as tj,useSessionService as tx,useSetFullscreen as tk,useSetViewState as ty,useShareLinks as tI,useStateValidity as tA,useStepNavigation as tC,useStoreSelector as tS,useStoreSelector$ as tw,useSwatchSelection as tE,useTabNavigation as tb,useTextValue as tq,useUndoRedo as tB,useUpdateControl as tP,useUpdatedControl as tR}from"#package/react-sdk";import{createPhoenixIconSet as tU}from"#package/ui-sdk";import{useConfigurator as th}from"../application-runtime/index.js";import{usePreview as tv,usePropertyPageStack as tz,usePropertyPageState as tD}from"../configurator-context/index.js";import{useCloseAction as tF}from"../integration/index.js";import{createGetTextureProcessingMapHandler as tG}from"../scene/index.js";import{useUpdateEntityObjectSelection as tH}from"../scene/scene-entity/drag-and-drop/use-updated-selection.js";import{useAssistantPanel as tJ,useMeasurements as tK,useToolbarActions as tL}from"../toolbar-actions/index.js";import{LayoutSlots as tM,createCanvasLoader as tN,createLayoutAdminUi as tO,createLayoutCustomOwnerUi as tQ,createLayoutCustomReadUi as tT,createLayoutDialog as tV,createLayoutFooter as tW,createLayoutToolbarDesktop as tX,createLayoutToolbarDesktopFullScreen as tY,createLayoutToolbarReadDesktop as tZ,createLayoutToolbarReadDesktopFullScreen as t$,createLayoutUserUi as t_,createToolbarHelp as t0,useAssistantComposer as t1,useAssistantThread as t2,useSceneSafeArea as t3}from"../ui/index.js";import{createPresetDeviceNotSupported as t4,createPresetPageAction as t5}from"../ui/preset-layout/PresetUi.js";import{useResetCamera as t6}from"./use-reset-camera.js";export const createConfiguratorInterface=t7=>({updates:a(),getIdSequence:m,createGetWebComponentOptionsHandler:o,createGetThemeHandler:r,createPhoenixHandler:i,createCustomPhoenixEntityElement:e,createCustomPhoenixLayoutElement:t,createPhoenixIconSet:tU,createGetTextureProcessingMapHandler:tG,createCollectFrontendDataHandler:f,createFilterPublishedChunksHandler:x,createOnGoToIndexHandler:w,createOnApplicationStartProvider:I,createOnSessionReadyProvider:B,createOnPublishedDataReadyProvider:b,createOnFrontendDataReadyProvider:S,createOnBackendDataReadyProvider:A,createOnRoutingReadyProvider:q,createOnConfiguratorReadyProvider:C,createOnPresetLoadedHandler:E,createPresetUi:P,createPresetPageAction:t5,createPresetDeviceNotSupported:t4,createLayoutFooter:tW,createAppLoader:u,createCanvasLoader:tN,createLayoutDialog:tV,createLayoutToolbarDesktop:tX,createLayoutToolbarDesktopFullScreen:tY,createLayoutToolbarReadDesktop:tZ,createLayoutToolbarReadDesktopFullScreen:t$,createLayoutCustomOwnerUi:tQ,createLayoutCustomReadUi:tT,createLayoutAdminUi:tO,createLayoutUserUi:t_,createToolbarHelp:t0,createNotAuthenticatedPage:y,createConfigurationNotFoundPage:l,createConfiguratorErrorPage:g,createAddEntityFab:c,createDeleteEntityFab:j,createSelectionHotspot:R,createNavigationHotspot:k,createToolMenuFab:U,createTransformer:n,transformerBuilder:s(),useAnalytics:Q,useAuthenticatedClient:X,useAuthorizedClient:Y,useCreateAuthorizedClient:ef,useAccessService:K,useConfigurationId:ei,useSession:tg,useSessionRole:tj,useSessionService:tx,useDomain:ey,useDomainApplication:eI,useConfigurator:th,useConfiguratorRouting:ea,usePresetSelection:e$,usePublishedData:e_,useFrontendData:ev,useBackendData:Z,useDomainApplicationProps:eA,useLoadedData:eN,useIntegrationService:eK,useIntegrationState:eL,usePresetEmbeddedState:eZ,useRecipeEmbeddedState:e1,useCommittedSlice:_,useRenderedSlice:e8,useCommittedState:ee,useRenderedState:e9,useStoreSelector:tS,useRenderedSelector:e6,useStoreSelector$:tw,useRenderedSelector$:e7,useEntitySelector:eE,useRenderedEntitySelector:e4,useRootEntitySelector:ta,useRenderedRootEntitySelector:e5,useStateValidity:tA,useMapViolationHints:eW,useNavigate:eX,usePopNavigate:eY,usePushNavigate:e0,useControlViolations:em,useFinalizeViolations:eB,useConfiguratorMessages:es,useConfigurationSaveState:en,useFinalizeAction:eb,useFinalizeActions:eq,useComponent:et,useRenderedComponent:e2,useComponents:er,useRenderedComponents:e3,useFirstComponent:eP,useFirstRenderedComponent:eR,useRootComponents:tr,useRootRenderedComponents:tp,useFirstRootComponent:eU,useFirstRootRenderedComponent:eh,useEntityState:eS,useEntityRenderedState:eC,useRootEntityState:tm,useRootEntityRenderedState:ts,useRootEntityId:to,useRootEntityRenderedId:tn,useEntityPrice:ew,useRootEntityPrice:ti,useSelectedEntity:tf,useSelectedEntityId:tl,useSelectedDomainEntityId:tu,useSelectEntity:td,useDeselect:ej,useSelectParent:tc,useHoveredEntity:eH,useHoveredEntityId:eJ,useHoveredDomainEntityId:eG,useActiveNavigationState:L,useActiveViewState:N,useSetViewState:ty,useActiveToolState:M,useIsFullscreenActive:eM,useSetFullscreen:tk,useResetCamera:t6,useUndoRedo:tB,useTabNavigation:tb,useStepNavigation:tC,useSceneSafeArea:t3,useActiveViewports:O,usePreview:tv,useCloseAction:tF,useIsCloningAllowed:tM.useIsCloningAllowed,useResolveLocalizable:tt,useLocalizable:eV,useToolbarActions:tL,useMeasurements:tK,useLocaleSwitch:eT,useShareLinks:tI,useAssistantPanel:tJ,useAssistantThread:t2,useAssistantComposer:t1,useComposition:eo,useUpdateControl:tP,useUpdatedControl:tR,useCookRecipes:ep,useCookedRecipes:ec,useCookReplaceRecipes:ed,useCookedReplaceRecipes:eu,useDeleteEntity:el,useDeletedEntity:eg,useSwatchSelection:tE,useTextValue:tq,useAttributeSelection:V,useAttributeSwitch:W,useDistanceDimension:ex,useDistanceDimensionSelection:ek,useGenericDimension:eD,useAngleDimension:T,useChildEntitySelection:$,useGroupedRecipeOptions:eF,useReplaceEntityRecipeOptions:te,useUpdateEntityObjectSelection:tH,useGenerateShareLink:ez,useLoadingState:eO,useLoadingStateValue:eQ,usePropertyPageStack:tz,usePropertyPageState:tD,isCreateEntityUpdate:p,isReplaceEntityUpdate:d,isDeleteEntityUpdate:D,isAngleDimensionUpdate:h,isDistanceDimensionUpdate:F,isGenericDimensionUpdate:G,isAttributeSelectionUpdate:v,isAttributeSwitchUpdate:z,isTextValueUpdate:J,isSwatchSelectionUpdate:H});
1
+ import{createCustomPhoenixEntityElement as e,createCustomPhoenixLayoutElement as t,createGetThemeHandler as o,createGetWebComponentOptionsHandler as r,createPhoenixHandler as i,createTransformer as n,createTransformerBuilder as s,createUpdateFactory as m,getIdSequence as a,isCreateEntityUpdate as p,isReplaceEntityUpdate as d}from"#package/domain";import{createAddEntityFab as c,createAppLoader as u,createCollectFrontendDataHandler as f,createConfigurationNotFoundPage as l,createConfiguratorErrorPage as g,createDeleteEntityFab as j,createFilterPublishedChunksHandler as x,createNavigationHotspot as k,createNotAuthenticatedPage as y,createOnApplicationStartProvider as A,createOnBackendDataReadyProvider as I,createOnConfiguratorReadyProvider as C,createOnFrontendDataReadyProvider as S,createOnGoToIndexHandler as w,createOnPresetLoadedHandler as E,createOnPublishedDataReadyProvider as b,createOnRoutingReadyProvider as q,createOnSessionReadyProvider as B,createPresetUi as P,createSelectionHotspot as R,createToolMenuFab as U,isAngleDimensionUpdate as h,isAttributeSelectionUpdate as v,isAttributeSwitchUpdate as z,isDeleteEntityUpdate as D,isDistanceDimensionUpdate as F,isGenericDimensionUpdate as G,isSwatchSelectionUpdate as H,isTextValueUpdate as J,useAccessService as K,useActiveNavigationState as L,useActiveToolState as M,useActiveViewChildState as N,useActiveViewState as O,useActiveViewports as Q,useAnalyticsService as T,useAngleDimension as V,useAttributeSelection as W,useAttributeSwitch as X,useAuthenticatedClient as Y,useAuthorizedClient as Z,useBackendData as $,useChildEntitySelection as _,useCommittedSlice as ee,useCommittedState as et,useComponent as eo,useComponents as er,useComposition as ei,useConfigurationId as en,useConfigurationSaveState as es,useConfiguratorMessages as em,useConfiguratorRouting as ea,useControlViolations as ep,useCookRecipes as ed,useCookReplaceRecipes as ec,useCookedRecipes as eu,useCookedReplaceRecipes as ef,useCreateAuthorizedClient as el,useDeleteEntity as eg,useDeletedEntity as ej,useDeselect as ex,useDistanceDimension as ek,useDistanceDimensionSelection as ey,useDomain as eA,useDomainApplication as eI,useDomainApplicationProps as eC,useDomainEntityRenderedState as eS,useDomainEntityState as ew,useEntityPrice as eE,useEntitySelector as eb,useFinalizeAction as eq,useFinalizeActions as eB,useFinalizeViolations as eP,useFirstComponent as eR,useFirstRenderedComponent as eU,useFirstRootComponent as eh,useFirstRootRenderedComponent as ev,useFrontendData as ez,useGenerateShareLink as eD,useGenericDimension as eF,useGroupedRecipeOptions as eG,useHoveredDomainEntityId as eH,useHoveredEntity as eJ,useHoveredEntityId as eK,useIntegrationService as eL,useIntegrationState as eM,useIsFullscreenActive as eN,useLoadedData as eO,useLoadingState as eQ,useLoadingStateValue as eT,useLocaleSwitch as eV,useLocalizable as eW,useMapViolationHints as eX,useNavigate as eY,usePopNavigate as eZ,usePresetEmbeddedState as e$,usePresetSelection as e_,usePublishedData as e0,usePushNavigate as e1,useRecipeEmbeddedState as e2,useRenderedComponent as e3,useRenderedComponents as e4,useRenderedEntitySelector as e5,useRenderedRootEntitySelector as e6,useRenderedSelector as e7,useRenderedSelector$ as e8,useRenderedSlice as e9,useRenderedState as te,useReplaceEntityRecipeOptions as tt,useResolveLocalizable as to,useRootComponents as tr,useRootEntityId as ti,useRootEntityPrice as tn,useRootEntityRenderedId as ts,useRootEntityRenderedState as tm,useRootEntitySelector as ta,useRootEntityState as tp,useRootRenderedComponents as td,useSelectEntity as tc,useSelectParent as tu,useSelectedDomainEntityId as tf,useSelectedEntity as tl,useSelectedEntityId as tg,useSession as tj,useSessionRole as tx,useSessionService as tk,useSetFullscreen as ty,useSetViewState as tA,useShareLinks as tI,useStateValidity as tC,useStepNavigation as tS,useStoreSelector as tw,useStoreSelector$ as tE,useSwatchSelection as tb,useTabNavigation as tq,useTextValue as tB,useUndoRedo as tP,useUpdateControl as tR,useUpdatedControl as tU}from"#package/react-sdk";import{createPhoenixIconSet as th}from"#package/ui-sdk";import{createActionFactory as tv,useConfigurator as tz}from"../application-runtime/index.js";import{usePreview as tD,usePropertyPageStack as tF,usePropertyPageState as tG}from"../configurator-context/index.js";import{useCloseAction as tH}from"../integration/index.js";import{createGetTextureProcessingMapHandler as tJ}from"../scene/index.js";import{useUpdateEntityObjectSelection as tK}from"../scene/scene-entity/drag-and-drop/use-updated-selection.js";import{useAssistantPanel as tL,useMeasurements as tM,useToolbarActions as tN}from"../toolbar-actions/index.js";import{LayoutSlots as tO,createCanvasLoader as tQ,createLayoutAdminUi as tT,createLayoutCustomOwnerUi as tV,createLayoutCustomReadUi as tW,createLayoutDialog as tX,createLayoutFooter as tY,createLayoutToolbarDesktop as tZ,createLayoutToolbarDesktopFullScreen as t$,createLayoutToolbarReadDesktop as t_,createLayoutToolbarReadDesktopFullScreen as t0,createLayoutUserUi as t1,createToolbarHelp as t2,useAssistantComposer as t3,useAssistantThread as t4,useSceneSafeArea as t5}from"../ui/index.js";import{createPresetDeviceNotSupported as t6,createPresetPageAction as t7}from"../ui/preset-layout/PresetUi.js";import{useResetCamera as t8}from"./use-reset-camera.js";export const createConfiguratorInterface=t9=>({updates:m(),getIdSequence:a,createGetWebComponentOptionsHandler:r,createGetThemeHandler:o,createPhoenixHandler:i,createCustomPhoenixEntityElement:e,createCustomPhoenixLayoutElement:t,createPhoenixIconSet:th,createGetTextureProcessingMapHandler:tJ,createCollectFrontendDataHandler:f,createFilterPublishedChunksHandler:x,createOnGoToIndexHandler:w,createOnApplicationStartProvider:A,createOnSessionReadyProvider:B,createOnPublishedDataReadyProvider:b,createOnFrontendDataReadyProvider:S,createOnBackendDataReadyProvider:I,createOnRoutingReadyProvider:q,createOnConfiguratorReadyProvider:C,createOnPresetLoadedHandler:E,createPresetUi:P,createPresetPageAction:t7,createPresetDeviceNotSupported:t6,createLayoutFooter:tY,createAppLoader:u,createCanvasLoader:tQ,createLayoutDialog:tX,createLayoutToolbarDesktop:tZ,createLayoutToolbarDesktopFullScreen:t$,createLayoutToolbarReadDesktop:t_,createLayoutToolbarReadDesktopFullScreen:t0,createLayoutCustomOwnerUi:tV,createLayoutCustomReadUi:tW,createLayoutAdminUi:tT,createLayoutUserUi:t1,createToolbarHelp:t2,createNotAuthenticatedPage:y,createConfigurationNotFoundPage:l,createConfiguratorErrorPage:g,createAddEntityFab:c,createDeleteEntityFab:j,createSelectionHotspot:R,createNavigationHotspot:k,createToolMenuFab:U,createTransformer:n,transformerBuilder:s(),useAnalytics:T,useAuthenticatedClient:Y,useAuthorizedClient:Z,useCreateAuthorizedClient:el,useAccessService:K,useConfigurationId:en,useSession:tj,useSessionRole:tx,useSessionService:tk,useDomain:eA,useDomainApplication:eI,useConfigurator:tz,implementActions:tv(),useConfiguratorRouting:ea,usePresetSelection:e_,usePublishedData:e0,useFrontendData:ez,useBackendData:$,useDomainApplicationProps:eC,useLoadedData:eO,useIntegrationService:eL,useIntegrationState:eM,usePresetEmbeddedState:e$,useRecipeEmbeddedState:e2,useCommittedSlice:ee,useRenderedSlice:e9,useCommittedState:et,useRenderedState:te,useStoreSelector:tw,useRenderedSelector:e7,useStoreSelector$:tE,useRenderedSelector$:e8,useEntitySelector:eb,useRenderedEntitySelector:e5,useRootEntitySelector:ta,useRenderedRootEntitySelector:e6,useStateValidity:tC,useMapViolationHints:eX,useNavigate:eY,usePopNavigate:eZ,usePushNavigate:e1,useControlViolations:ep,useFinalizeViolations:eP,useConfiguratorMessages:em,useConfigurationSaveState:es,useFinalizeAction:eq,useFinalizeActions:eB,useComponent:eo,useRenderedComponent:e3,useComponents:er,useRenderedComponents:e4,useFirstComponent:eR,useFirstRenderedComponent:eU,useRootComponents:tr,useRootRenderedComponents:td,useFirstRootComponent:eh,useFirstRootRenderedComponent:ev,useEntityState:ew,useEntityRenderedState:eS,useRootEntityState:tp,useRootEntityRenderedState:tm,useRootEntityId:ti,useRootEntityRenderedId:ts,useEntityPrice:eE,useRootEntityPrice:tn,useSelectedEntity:tl,useSelectedEntityId:tg,useSelectedDomainEntityId:tf,useSelectEntity:tc,useDeselect:ex,useSelectParent:tu,useHoveredEntity:eJ,useHoveredEntityId:eK,useHoveredDomainEntityId:eH,useActiveNavigationState:L,useActiveViewState:O,useActiveViewChildState:N,useSetViewState:tA,useActiveToolState:M,useIsFullscreenActive:eN,useSetFullscreen:ty,useResetCamera:t8,useUndoRedo:tP,useTabNavigation:tq,useStepNavigation:tS,useSceneSafeArea:t5,useActiveViewports:Q,usePreview:tD,useCloseAction:tH,useIsCloningAllowed:tO.useIsCloningAllowed,useResolveLocalizable:to,useLocalizable:eW,useToolbarActions:tN,useMeasurements:tM,useLocaleSwitch:eV,useShareLinks:tI,useAssistantPanel:tL,useAssistantThread:t4,useAssistantComposer:t3,useComposition:ei,useUpdateControl:tR,useUpdatedControl:tU,useCookRecipes:ed,useCookedRecipes:eu,useCookReplaceRecipes:ec,useCookedReplaceRecipes:ef,useDeleteEntity:eg,useDeletedEntity:ej,useSwatchSelection:tb,useTextValue:tB,useAttributeSelection:W,useAttributeSwitch:X,useDistanceDimension:ek,useDistanceDimensionSelection:ey,useGenericDimension:eF,useAngleDimension:V,useChildEntitySelection:_,useGroupedRecipeOptions:eG,useReplaceEntityRecipeOptions:tt,useUpdateEntityObjectSelection:tK,useGenerateShareLink:eD,useLoadingState:eQ,useLoadingStateValue:eT,usePropertyPageStack:tF,usePropertyPageState:tG,isCreateEntityUpdate:p,isReplaceEntityUpdate:d,isDeleteEntityUpdate:D,isAngleDimensionUpdate:h,isDistanceDimensionUpdate:F,isGenericDimensionUpdate:G,isAttributeSelectionUpdate:v,isAttributeSwitchUpdate:z,isTextValueUpdate:J,isSwatchSelectionUpdate:H});
@@ -1 +1,6 @@
1
+ /**
2
+ * Pushes the layout's canvas padding into `CameraControlSystem`, which fits the camera against it and
3
+ * eases the view offset toward it, so the scene glides into a new framing (preview/layout transition,
4
+ * resize, sidebar toggle) instead of snapping.
5
+ */
1
6
  export declare const CameraPadding: () => null;
@@ -1 +1 @@
1
- import{useFrame as t,useThree as a}from"@react-three/fiber";import{useEffect as e,useRef as r}from"react";import{MathUtils as o}from"three";import{useResponsive as i}from"#package/ui-sdk";import{useConfigurator as m}from"../../application-runtime/index.js";let p=1/30;export const CameraPadding=()=>{let{cameraControlSystem:l,canvasSystem:f}=m(),{canvasPadding:n}=i(),h=a(t=>t.invalidate),s=r(!1);return e(()=>{l.setCanvasPadding(n),h()},[l,n,h]),t((t,a)=>{if(t.camera!==l.perspectiveCamera&&t.camera!==l.orthographicCamera||null===f.interactiveViewport$.value||l.isCameraOffsetHeld)return;let e=l.appliedCameraOffset,r=Math.min(a,p),i=s.current?{top:o.damp(e.top,n.top,8,r),right:o.damp(e.right,n.right,8,r),bottom:o.damp(e.bottom,n.bottom,8,r),left:o.damp(e.left,n.left,8,r)}:n;s.current=!0;let m=.5>Math.abs(i.top-n.top)&&.5>Math.abs(i.right-n.right)&&.5>Math.abs(i.bottom-n.bottom)&&.5>Math.abs(i.left-n.left);l.applyCameraOffset(m?n:i),m||h()}),null};
1
+ import{useEffect as r}from"react";import{useResponsive as a}from"#package/ui-sdk";import{useConfigurator as t}from"../../application-runtime/index.js";export const CameraPadding=()=>{let{cameraControlSystem:i}=t(),{canvasPadding:e}=a();return r(()=>{i.setCanvasPadding(e)},[i,e]),null};
@@ -35,12 +35,12 @@ export interface ThemeableAssistantToolChipsProps {
35
35
  * The components used for each slot inside a row of tool calls.
36
36
  *
37
37
  * - `root` — The row (`div`).
38
- * - `activity` — The frame of the turning icon (`span`).
38
+ * - `activity` — The frame of the turning icon, or of Undo in its place (`span`).
39
39
  * - `activityIcon` — The icon that turns while the assistant works on the row (`PhxIcon`).
40
40
  * - `chip` — The note of one call, or of its screenshots (`span`).
41
41
  * - `chipLabel` — The text of a call's note (`span`).
42
42
  * - `screenshotsLink` — The label that opens a call's screenshots (`span`).
43
- * - `undoButton` — The Undo control after the notes (`ButtonBase`).
43
+ * - `undoButton` — The Undo control in place of the resting icon, with its tooltip (`ButtonBase`).
44
44
  * - `violation` — A line of a failed call's tooltip, one per violation (`span`).
45
45
  * - `fullLabel` — The full text of a cut note, at the top of its tooltip (`span`).
46
46
  */
@@ -82,9 +82,9 @@ export interface AssistantToolChipsProps {
82
82
  /**
83
83
  * A row of notes on what the assistant did in a reply, one per tool call, and one for the
84
84
  * screenshots of a call that took any. A click on a call's note logs the input and the result of
85
- * its call to the console. While one of the row's changes is the step
86
- * of the undo history the configuration is at, an Undo after the notes takes the row's changes
87
- * back, up to a change the user made in between.
85
+ * its call to the console. While one of the row's changes is the step of the undo history the
86
+ * configuration is at, an Undo in place of the row's icon takes the row's changes back, up to a
87
+ * change the user made in between.
88
88
  */
89
89
  export declare const AssistantToolChips: import("react").MemoExoticComponent<(inProps: AssistantToolChipsProps & ThemeableAssistantToolChipsProps) => import("react/jsx-runtime").JSX.Element>;
90
90
  export interface AssistantActivityRowProps {