@salsita-ai/sdk 0.50.0-develop.0ef5d49cfb → 0.50.0-develop.1162eef277

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 (273) hide show
  1. package/dist/application-spec/generate-application/code/common/index.d.ts +1 -0
  2. package/dist/application-spec/generate-application/code/common/index.js +1 -1
  3. package/dist/application-spec/generate-application/code/common/project-module-list.d.ts +8 -0
  4. package/dist/application-spec/generate-application/code/common/project-module-list.js +3 -0
  5. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  6. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  7. package/dist/application-spec/generate-application/code/templates/admin-domain-code.d.ts +1 -2
  8. package/dist/application-spec/generate-application/code/templates/admin-domain-code.js +6 -14
  9. package/dist/application-spec/generate-application/code/templates/admin-frontend-code.d.ts +1 -2
  10. package/dist/application-spec/generate-application/code/templates/admin-frontend-code.js +4 -4
  11. package/dist/application-spec/generate-application/code/templates/configurator-domain-code.d.ts +1 -2
  12. package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js +7 -16
  13. package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.d.ts +1 -2
  14. package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.js +7 -9
  15. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.d.ts +2 -2
  16. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.js +1 -1
  17. package/dist/application-spec/generate-application/code/templates/domain-spec.js +4 -4
  18. package/dist/application-spec/generate-application/code/templates/domain.js +3 -3
  19. package/dist/application-spec/generate-application/code/templates/index.d.ts +1 -0
  20. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  21. package/dist/application-spec/generate-application/code/templates/skills/agents-md.js +1 -1
  22. package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -1
  23. package/dist/application-spec/generate-application/code/templates/skills/phoenix-create-configurator-skill.js +41 -13
  24. package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +1 -1
  25. package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +2 -2
  26. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  27. package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.d.ts +1 -0
  28. package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.js +6 -0
  29. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +30 -3
  30. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +19 -5
  31. package/dist/application-spec/generate-application/code/templates/webhook-builders.js +8 -4
  32. package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.d.ts +4 -3
  33. package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.js +1 -1
  34. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.d.ts +3 -8
  35. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.js +1 -1
  36. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +9 -43
  37. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  38. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-server-settings.d.ts +2 -2
  39. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant.d.ts +5 -21
  40. package/dist/client/phoenix-api.d.ts +58 -30
  41. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  42. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +158 -13
  43. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  44. package/dist/configurator/application-runtime/extensions/systems/assistant-system/change-recorder.d.ts +85 -0
  45. package/dist/configurator/application-runtime/extensions/systems/assistant-system/change-recorder.js +1 -0
  46. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +8 -3
  47. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  48. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +4 -0
  49. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  50. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +16 -1
  51. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  52. package/dist/configurator/application-runtime/extensions/systems/graphql-system/side-effects.d.ts +9 -0
  53. package/dist/configurator/application-runtime/extensions/systems/graphql-system/side-effects.js +1 -0
  54. package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -1
  55. package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.d.ts +2 -0
  56. package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.js +1 -1
  57. package/dist/configurator/common/frontend-analytics.d.ts +21 -21
  58. package/dist/configurator/index.d.ts +0 -1
  59. package/dist/configurator/index.js +1 -1
  60. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  61. package/dist/configurator/scene/scene-analytics/scene-analytics.d.ts +2 -2
  62. package/dist/configurator/ui/assistant/AssistantChips.d.ts +11 -0
  63. package/dist/configurator/ui/assistant/AssistantChips.js +1 -0
  64. package/dist/configurator/ui/assistant/AssistantComposer.d.ts +6 -0
  65. package/dist/configurator/ui/assistant/AssistantComposer.js +1 -0
  66. package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +7 -0
  67. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -0
  68. package/dist/configurator/ui/assistant/AssistantPanel.d.ts +11 -0
  69. package/dist/configurator/ui/assistant/AssistantPanel.js +1 -0
  70. package/dist/configurator/ui/assistant/AssistantThread.d.ts +6 -0
  71. package/dist/configurator/ui/assistant/AssistantThread.js +1 -0
  72. package/dist/configurator/ui/assistant/assistant-failure.d.ts +18 -0
  73. package/dist/configurator/ui/assistant/assistant-failure.js +1 -0
  74. package/dist/configurator/ui/assistant/index.d.ts +2 -0
  75. package/dist/configurator/ui/assistant/index.js +1 -0
  76. package/dist/configurator/ui/assistant/streamed-markdown.d.ts +6 -0
  77. package/dist/configurator/ui/assistant/streamed-markdown.js +2 -0
  78. package/dist/configurator/ui/assistant/theme.d.ts +2 -0
  79. package/dist/configurator/ui/assistant/theme.js +1 -0
  80. package/dist/configurator/ui/assistant/thread-items.d.ts +37 -0
  81. package/dist/configurator/ui/assistant/thread-items.js +1 -0
  82. package/dist/configurator/ui/assistant/tool-chip.d.ts +44 -0
  83. package/dist/configurator/ui/assistant/tool-chip.js +1 -0
  84. package/dist/configurator/ui/assistant/use-follow-stream.d.ts +17 -0
  85. package/dist/configurator/ui/assistant/use-follow-stream.js +1 -0
  86. package/dist/configurator/ui/assistant/use-is-assistant-panel-open.d.ts +5 -0
  87. package/dist/configurator/ui/assistant/use-is-assistant-panel-open.js +1 -0
  88. package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.js +5 -5
  89. package/dist/configurator/ui/configurator-layout/universal/MobileLayout.d.ts +2 -0
  90. package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +4 -4
  91. package/dist/configurator/ui/legacy/mobile-controls/MobileControls.d.ts +1 -1
  92. package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.d.ts +10 -0
  93. package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -0
  94. package/dist/configurator/ui/phoenix-layout-elements/index.d.ts +1 -0
  95. package/dist/configurator/ui/phoenix-layout-elements/index.js +1 -1
  96. package/dist/docs/complex-use-cases/filtered-controls-with-fix-dialog.mdx +84 -98
  97. package/dist/docs/complex-use-cases/navigation-reset-selection.mdx +18 -12
  98. package/dist/docs/index.json +1 -1
  99. package/dist/docs/layouts/custom-price.mdx +14 -16
  100. package/dist/docs/layouts/sidebar/tabs.mdx +24 -21
  101. package/dist/docs/layouts/toolbar.mdx +6 -0
  102. package/dist/docs/other-features/domain-actions.mdx +1 -1
  103. package/dist/docs/other-features/side-effects.mdx +68 -34
  104. package/dist/docs/other-features/transformers.mdx +1 -1
  105. package/dist/docs/phoenix/admin.mdx +9 -24
  106. package/dist/docs/phoenix/localization.mdx +3 -22
  107. package/dist/docs/phoenix/phoenix-cli.mdx +81 -2
  108. package/dist/docs/phoenix/project-structure.mdx +9 -2
  109. package/dist/docs/phoenix/sdk-builder-workflow.mdx +4 -3
  110. package/dist/docs/recipes-and-delete/recipe-hierarchy-selection.mdx +15 -13
  111. package/dist/docs/relations/hierarchy.mdx +13 -2
  112. package/dist/domain/actions/action-factory.d.ts +3 -2
  113. package/dist/domain/application/application-config.d.ts +25 -75
  114. package/dist/domain/application/assistant/assistant-manifest.d.ts +61 -0
  115. package/dist/domain/application/assistant/assistant-manifest.js +1 -0
  116. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +95 -0
  117. package/dist/domain/application/assistant/assistant-resolved-manifest.js +1 -0
  118. package/dist/domain/application/assistant/assistant-value-type.d.ts +9 -0
  119. package/dist/domain/application/assistant/assistant-value-type.js +1 -0
  120. package/dist/domain/application/assistant/build-assistant-manifest.d.ts +4 -0
  121. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -0
  122. package/dist/{phoenix/application-spec → domain/application/assistant}/generate-assistant-prompt.d.ts +6 -5
  123. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -0
  124. package/dist/domain/application/assistant/index.d.ts +4 -0
  125. package/dist/domain/application/assistant/index.js +1 -0
  126. package/dist/domain/application/assistant-field-options.d.ts +1 -1
  127. package/dist/domain/application/assistant-mutations.d.ts +1 -1
  128. package/dist/domain/application/assistant-recipe-groups.d.ts +1 -1
  129. package/dist/domain/application/configurator-builder.d.ts +33 -18
  130. package/dist/domain/application/configurator-builder.js +1 -1
  131. package/dist/domain/application/element-registration.d.ts +5 -0
  132. package/dist/domain/application/element-registration.js +1 -1
  133. package/dist/domain/application/handler-registration.d.ts +5 -0
  134. package/dist/domain/application/handler-registration.js +1 -1
  135. package/dist/domain/application/index.d.ts +5 -4
  136. package/dist/domain/application/index.js +1 -1
  137. package/dist/domain/application/resolve-imported-transformers.d.ts +11 -1
  138. package/dist/domain/application/resolve-imported-transformers.js +1 -1
  139. package/dist/domain/components/domain-component-optic.d.ts +3 -0
  140. package/dist/domain/components/domain-component-optic.js +2 -2
  141. package/dist/domain/components/updates.d.ts +16 -0
  142. package/dist/domain/core/action.d.ts +1 -1
  143. package/dist/domain/domain-builder.d.ts +10 -1
  144. package/dist/domain/domain-builder.js +1 -1
  145. package/dist/domain/domain-context/index.d.ts +1 -1
  146. package/dist/domain/domain-context/store-system/store-system.js +1 -1
  147. package/dist/domain/domain-context/transformers/chain-builder.d.ts +1 -1
  148. package/dist/domain/domain-runtime/domain-runtime.d.ts +4 -4
  149. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  150. package/dist/domain/domain-runtime/spec/selectors.d.ts +2 -2
  151. package/dist/domain/domain-runtime/spec/selectors.js +1 -1
  152. package/dist/domain/domain-runtime/spec/types.d.ts +3 -3
  153. package/dist/domain/index.d.ts +3 -2
  154. package/dist/domain/index.js +1 -1
  155. package/dist/domain/invariants/invariants.d.ts +9 -0
  156. package/dist/domain/invariants/invariants.js +1 -1
  157. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +3 -3
  158. package/dist/domain/mocks/create-mock-domain-runtime.js +1 -1
  159. package/dist/domain/project-modules/index.d.ts +1 -0
  160. package/dist/domain/project-modules/index.js +1 -0
  161. package/dist/domain/project-modules/project-modules.d.ts +41 -0
  162. package/dist/domain/project-modules/project-modules.js +1 -0
  163. package/dist/domain/system-components/common/dimension-indicator-schema.d.ts +1 -1
  164. package/dist/domain/system-components/common/dimension-indicator-schema.js +1 -1
  165. package/dist/domain/system-components/phoenix-layout-elements/assistant-toolbar-button.d.ts +44 -0
  166. package/dist/domain/system-components/phoenix-layout-elements/assistant-toolbar-button.js +1 -0
  167. package/dist/domain/system-components/phoenix-layout-elements/index.d.ts +1 -0
  168. package/dist/domain/system-components/phoenix-layout-elements/index.js +1 -1
  169. package/dist/domain/system-components/phoenix-layout-elements/phoenix-layout-element.d.ts +2 -1
  170. package/dist/domain/system-components/phoenix-layout-elements/phoenix-layout-element.js +1 -1
  171. package/dist/editor/Editor.js +1 -1
  172. package/dist/editor/domain-editors/use-implementation-files.d.ts +7 -6
  173. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  174. package/dist/editor/graphql/GraphQLPanel.js +1 -1
  175. package/dist/editor/variants/VariantAnswerFooter.d.ts +17 -0
  176. package/dist/editor/variants/VariantAnswerFooter.js +1 -0
  177. package/dist/editor/variants/VariantPreviewHandler.d.ts +6 -0
  178. package/dist/editor/variants/VariantPreviewHandler.js +1 -0
  179. package/dist/editor/variants/variant-preview-styles.d.ts +49 -0
  180. package/dist/editor/variants/variant-preview-styles.js +1 -0
  181. package/dist/i18n/locales/cs/messages.js +1 -1
  182. package/dist/i18n/locales/da/messages.js +1 -1
  183. package/dist/i18n/locales/de/messages.js +1 -1
  184. package/dist/i18n/locales/de-AT/messages.js +1 -1
  185. package/dist/i18n/locales/en/messages.js +1 -1
  186. package/dist/i18n/locales/en-AU/messages.js +1 -1
  187. package/dist/i18n/locales/en-GB/messages.js +1 -1
  188. package/dist/i18n/locales/es/messages.js +1 -1
  189. package/dist/i18n/locales/fr/messages.js +1 -1
  190. package/dist/i18n/locales/hu/messages.js +1 -1
  191. package/dist/i18n/locales/it/messages.js +1 -1
  192. package/dist/i18n/locales/nl/messages.js +1 -1
  193. package/dist/i18n/locales/pl/messages.js +1 -1
  194. package/dist/i18n/locales/pt/messages.js +1 -1
  195. package/dist/i18n/locales/ro/messages.js +1 -1
  196. package/dist/i18n/locales/sk/messages.js +1 -1
  197. package/dist/i18n/locales/tr/messages.js +1 -1
  198. package/dist/legacy/domain-cli/gen/configurator-builder.js +21 -8
  199. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  200. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  201. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +6 -0
  202. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-admin.js +18 -19
  203. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-configurator.js +15 -16
  204. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +22 -23
  205. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-configurator.js +15 -16
  206. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/generator-shared.d.ts +7 -2
  207. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/generator-shared.js +8 -12
  208. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/index.d.ts +1 -1
  209. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/index.js +1 -1
  210. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/webhook-builders.js +7 -7
  211. package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
  212. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +4 -3
  213. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  214. package/dist/phoenix/cli.js +1 -1
  215. package/dist/phoenix/commands/deploy.js +2 -2
  216. package/dist/phoenix/commands/dev.js +5 -5
  217. package/dist/phoenix/commands/index.d.ts +1 -0
  218. package/dist/phoenix/commands/index.js +1 -1
  219. package/dist/phoenix/commands/prepare-deployment-command.js +2 -2
  220. package/dist/phoenix/commands/prepare-local-environment-command.js +1 -1
  221. package/dist/phoenix/commands/story-dev.js +2 -2
  222. package/dist/phoenix/commands/variants.d.ts +35 -0
  223. package/dist/phoenix/commands/variants.js +1 -0
  224. package/dist/phoenix/editor-server/commands-router.d.ts +68 -1
  225. package/dist/phoenix/editor-server/commands-router.js +1 -1
  226. package/dist/phoenix/editor-server/editor-router.d.ts +65 -0
  227. package/dist/phoenix/editor-server/editor-server.d.ts +3 -3
  228. package/dist/phoenix/editor-server/editor-server.js +1 -1
  229. package/dist/phoenix/editor-server/protocol.d.ts +1 -0
  230. package/dist/phoenix/editor-server/spec-router.js +1 -1
  231. package/dist/phoenix/editor-server/trpc.d.ts +3 -0
  232. package/dist/phoenix/services/application-spec-project-watcher.d.ts +13 -2
  233. package/dist/phoenix/services/application-spec-project-watcher.js +3 -3
  234. package/dist/phoenix/services/index.d.ts +4 -0
  235. package/dist/phoenix/services/index.js +1 -1
  236. package/dist/phoenix/services/phoenix-application.d.ts +21 -0
  237. package/dist/phoenix/services/phoenix-application.js +1 -0
  238. package/dist/phoenix/services/phoenix-store.d.ts +48 -0
  239. package/dist/phoenix/services/phoenix-store.js +1 -0
  240. package/dist/phoenix/services/phx-variant-previews-plugin.d.ts +9 -0
  241. package/dist/phoenix/services/phx-variant-previews-plugin.js +1 -0
  242. package/dist/phoenix/services/prepare-development-environment.js +1 -1
  243. package/dist/phoenix/services/variant-file-session.d.ts +36 -0
  244. package/dist/phoenix/services/variant-file-session.js +1 -0
  245. package/dist/phoenix/services/variant-preview-service.d.ts +80 -0
  246. package/dist/phoenix/services/variant-preview-service.js +1 -0
  247. package/dist/phoenix/services/vite-config.js +1 -1
  248. package/dist/react-sdk/application-runtime/common-services/analytics/analytics-service.d.ts +2 -2
  249. package/dist/react-sdk/application-runtime/common-services/analytics/domain-controls-analytics.d.ts +21 -21
  250. package/dist/react-sdk/application-runtime/hooks/data/use-published-data.d.ts +1 -1
  251. package/dist/react-sdk/application-runtime/hooks/use-domain-application-props.d.ts +5 -2
  252. package/dist/react-sdk/application-runtime/hooks/use-spec.d.ts +1 -1
  253. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.d.ts +1 -1
  254. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  255. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +4 -4
  256. package/dist/ui-sdk/common/use-viewport-size.d.ts +4 -1
  257. package/dist/ui-sdk/common/use-viewport-size.js +1 -1
  258. package/dist/ui-sdk/components/mobile-controls/index.d.ts +1 -1
  259. package/dist/ui-sdk/theme/types.d.ts +4 -0
  260. package/dist/webhook/builders/common.d.ts +3 -0
  261. package/dist/webhook/builders/webhook-builder.d.ts +1 -1
  262. package/dist/webhook/builders/webhook-builder.js +1 -1
  263. package/package.json +5 -8
  264. package/schema/domain-spec.json +24 -0
  265. package/dist/configurator/assistant/index.d.ts +0 -1
  266. package/dist/configurator/assistant/index.js +0 -1
  267. package/dist/configurator/assistant/use-assistant-chat.d.ts +0 -20
  268. package/dist/configurator/assistant/use-assistant-chat.js +0 -1
  269. package/dist/extras/assistant/AssistantChat.d.ts +0 -6
  270. package/dist/extras/assistant/AssistantChat.js +0 -1
  271. package/dist/extras/assistant/index.d.ts +0 -1
  272. package/dist/extras/assistant/index.js +0 -1
  273. package/dist/phoenix/application-spec/generate-assistant-prompt.js +0 -1
@@ -1,26 +1,26 @@
1
1
  import type { MultilingualString } from '@salsita-ai/common/utils';
2
2
  import { type DomainEntity, type DomainEntityId, type EntityId, type EntityRecipe } from '#package/domain';
3
- declare const EntityChildrenListActionButtonClicked: (id: string) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
4
- declare const EntityChildrenListItemClicked: (id: string) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
5
- declare const AngleDimensionInputChanged: (instanceName: string, id: EntityId, value: number) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
6
- declare const AngleDimensionSliderDragged: (instanceName: string, id: EntityId, value: number) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
7
- declare const GenericDimensionInputChanged: (instanceName: string, id: EntityId, value: number) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
8
- declare const GenericDimensionSliderDragged: (instanceName: string, id: EntityId, value: number) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
9
- declare const DistanceDimensionInputChanged: (instanceName: string, id: EntityId, value: number) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
10
- declare const DistanceDimensionSliderDragged: (instanceName: string, id: EntityId, value: number) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
11
- declare const SizeDimensionInputChanged: (instanceName: string, id: EntityId, value: number) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
12
- declare const OffsetDimensionInputChanged: (instanceName: string, id: EntityId, value: number) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
13
- declare const AttributeSelected: (selectorType: string) => (instanceName: string, id: EntityId, value: string | number | boolean) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
14
- declare const DimensionSelected: (selectorType: string) => (instanceName: string, id: EntityId, value: number) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
15
- declare const SwatchSelected: (instanceName: string, id: EntityId, value: string) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
16
- declare const ColorPickerChanged: (instanceName: string, id: EntityId, value: string) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
17
- declare const TextValueChanged: (instanceName: string, id: EntityId, value: string) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
18
- declare const MultilingualTextValueChanged: (instanceName: string, id: EntityId, value: MultilingualString) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
19
- declare const RecipesSelected: (recipes: ReadonlyArray<DomainEntity<string>>) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
20
- declare const RecipeReplacementSelected: (oldId: DomainEntityId<string>, recipes: ReadonlyArray<DomainEntity<string>>) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
21
- declare const ChildEntitySelected: (selectorType: string) => (id: EntityId, recipes: ReadonlyArray<EntityRecipe<DomainEntity<string>>>) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
22
- declare const EntityChildrenListDeleteButtonClicked: (id: EntityId) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
23
- declare const EntityDeleteButtonClicked: (id: EntityId) => import("../../../../domain/domain-context/analytics-system/analytics-contracts").UserActionEvent;
3
+ declare const EntityChildrenListActionButtonClicked: (id: string) => import("#package/domain").UserActionEvent;
4
+ declare const EntityChildrenListItemClicked: (id: string) => import("#package/domain").UserActionEvent;
5
+ declare const AngleDimensionInputChanged: (instanceName: string, id: EntityId, value: number) => import("#package/domain").UserActionEvent;
6
+ declare const AngleDimensionSliderDragged: (instanceName: string, id: EntityId, value: number) => import("#package/domain").UserActionEvent;
7
+ declare const GenericDimensionInputChanged: (instanceName: string, id: EntityId, value: number) => import("#package/domain").UserActionEvent;
8
+ declare const GenericDimensionSliderDragged: (instanceName: string, id: EntityId, value: number) => import("#package/domain").UserActionEvent;
9
+ declare const DistanceDimensionInputChanged: (instanceName: string, id: EntityId, value: number) => import("#package/domain").UserActionEvent;
10
+ declare const DistanceDimensionSliderDragged: (instanceName: string, id: EntityId, value: number) => import("#package/domain").UserActionEvent;
11
+ declare const SizeDimensionInputChanged: (instanceName: string, id: EntityId, value: number) => import("#package/domain").UserActionEvent;
12
+ declare const OffsetDimensionInputChanged: (instanceName: string, id: EntityId, value: number) => import("#package/domain").UserActionEvent;
13
+ declare const AttributeSelected: (selectorType: string) => (instanceName: string, id: EntityId, value: string | number | boolean) => import("#package/domain").UserActionEvent;
14
+ declare const DimensionSelected: (selectorType: string) => (instanceName: string, id: EntityId, value: number) => import("#package/domain").UserActionEvent;
15
+ declare const SwatchSelected: (instanceName: string, id: EntityId, value: string) => import("#package/domain").UserActionEvent;
16
+ declare const ColorPickerChanged: (instanceName: string, id: EntityId, value: string) => import("#package/domain").UserActionEvent;
17
+ declare const TextValueChanged: (instanceName: string, id: EntityId, value: string) => import("#package/domain").UserActionEvent;
18
+ declare const MultilingualTextValueChanged: (instanceName: string, id: EntityId, value: MultilingualString) => import("#package/domain").UserActionEvent;
19
+ declare const RecipesSelected: (recipes: ReadonlyArray<DomainEntity<string>>) => import("#package/domain").UserActionEvent;
20
+ declare const RecipeReplacementSelected: (oldId: DomainEntityId<string>, recipes: ReadonlyArray<DomainEntity<string>>) => import("#package/domain").UserActionEvent;
21
+ declare const ChildEntitySelected: (selectorType: string) => (id: EntityId, recipes: ReadonlyArray<EntityRecipe<DomainEntity<string>>>) => import("#package/domain").UserActionEvent;
22
+ declare const EntityChildrenListDeleteButtonClicked: (id: EntityId) => import("#package/domain").UserActionEvent;
23
+ declare const EntityDeleteButtonClicked: (id: EntityId) => import("#package/domain").UserActionEvent;
24
24
  export declare const DomainControlsAnalytics: {
25
25
  ColorPickerChanged: typeof ColorPickerChanged;
26
26
  EntityChildrenListActionButtonClicked: typeof EntityChildrenListActionButtonClicked;
@@ -9,6 +9,6 @@ interface PublishedDataValueProviderProps extends PublishedDataValue {
9
9
  }
10
10
  export declare const PublishedDataValueProvider: (props: PublishedDataValueProviderProps) => import("react/jsx-runtime").JSX.Element;
11
11
  export declare const useProvidedPublishedData: () => PublishedDataValue;
12
- export declare const usePublishedData: () => Record<string, unknown> & import("../../../../domain/admin-domain/__generated/application-types").PublishedData;
12
+ export declare const usePublishedData: () => PublishedDataValue['publishedData'];
13
13
  export type UsePublishedData<PUBLISHED_DATA extends CommonAdminPublishedData> = () => PUBLISHED_DATA;
14
14
  export {};
@@ -1,8 +1,11 @@
1
- import type { AclConfig, DomainConfig, PersistenceConfig } from '#package/domain';
1
+ import type { AclConfig, AnyDomainComponentOptic, DomainConfig, PersistenceConfig } from '#package/domain';
2
2
  interface DomainApplicationProps {
3
3
  readonly deploymentId: string;
4
4
  readonly persistenceConfig: PersistenceConfig;
5
- readonly domainConfig: DomainConfig<any, any, any, any, any, any>;
5
+ /** The domain config as the runtime spec holds it: component optics already validated, never project modules. */
6
+ readonly domainConfig: Omit<DomainConfig<any, any, any, any, any, any>, 'componentOptics'> & {
7
+ readonly componentOptics: readonly AnyDomainComponentOptic[];
8
+ };
6
9
  readonly canCreate: AclConfig['canCreate'];
7
10
  readonly enableAdminRelease: boolean;
8
11
  }
@@ -1,6 +1,6 @@
1
1
  export declare const useConfiguratorSpec: () => import("../../../domain/index.js").ApplicationConfiguratorSpec;
2
2
  /** The application spec's `assistant` manifest, or nothing when the spec has no `assistant` section. */
3
- export declare const useSpecAssistant: () => import("../../../domain/index.js").AssistantManifest | null;
3
+ export declare const useSpecAssistant: () => Required<import("../../../domain/index.js").AssistantManifest> | null;
4
4
  export declare const useSpecTextLanguages: () => readonly string[];
5
5
  export declare const useSpecHandlerHashes: () => Record<string, string>;
6
6
  export declare const useSpecHandlers: () => readonly import("../../../domain/index.js").HandlerRegistration<any, any>[];
@@ -1,7 +1,7 @@
1
1
  import type { $DomainEntity, ApplicationConfig, DomainEntity, RegistrableTransformer, WebComponentOptions } from '#package/domain';
2
2
  import type { ApplicationRuntime } from '../runtime/react-runtime.js';
3
3
  import { type WebComponentApi } from '../web-component/index.js';
4
- export declare const createMockApplicationRuntime: <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, CHAT_CONTEXT extends Record<string, unknown>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ADMIN_ENTITIES extends DomainEntity<string>, ADMIN_ALLOWED_ROOT_ENTITIES extends ADMIN_ENTITIES, ADMIN_$MAP extends Record<ADMIN_ENTITIES['type'], $DomainEntity<ADMIN_ENTITIES>>, ADMIN_NAVIGATION_STATES extends string, ADMIN_VIEW_STATES extends string>(_cfg: ApplicationConfig<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, CHAT_CONTEXT, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES>, mocks: {
4
+ export declare const createMockApplicationRuntime: <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, CHAT_CONTEXT extends Record<string, unknown>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ADMIN_ENTITIES extends DomainEntity<string>, ADMIN_ALLOWED_ROOT_ENTITIES extends ADMIN_ENTITIES, ADMIN_$MAP extends Record<ADMIN_ENTITIES['type'], $DomainEntity<ADMIN_ENTITIES>>, ADMIN_NAVIGATION_STATES extends string, ADMIN_VIEW_STATES extends string>(config: ApplicationConfig<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, CHAT_CONTEXT, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES>, mocks: {
5
5
  frontendData: FRONTEND_DATA;
6
6
  publishedData: PUBLISHED_DATA;
7
7
  sessionData: SESSION_DATA;
@@ -1 +1 @@
1
- import{memoOnce as e}from"@salsita-ai/common/utils";import{createDomainRuntime as t,createMockDomainRuntimeServices as o,createMockSessionContext as n}from"#package/domain";import{createCommonServicesSelectors as s}from"../common-services/index.js";import{createDomainApplicationContextSelectors as i}from"../domain-application-context/index.js";import{createIntegrationActions as a,createIntegrationSelectors as r,initializeIntegration as c}from"../integration/index.js";import{createRoutingActions as m,createRoutingSelectors as d,initializeRouting as l}from"../routing/index.js";import{SessionService as p,createSessionRuntimeActions as S,createSessionRuntimeSelectors as g,initializeSessionRuntime as v}from"../session/index.js";import{createMockWebComponentApi as u}from"../web-component/index.js";export const createMockApplicationRuntime=(C,x)=>{var f;let b,y,w,A,D,k,E,I,h,j,R,T,O,L,F,{sessionData:M,mode:U,role:V}=x,z={...C,createTransformers:e=>x.transformers.map(t=>t.transformer.register(e,t.priority??1/0))},q=o(),B=(f={webComponentOptions:x.webComponentOptions??z.mount.options,webComponentApi:x.webComponentApi??u()},w=v(),A=t({config:z,services:q,getExtensionSystems:e=>F[e].getInitializableSystems()}),D=new Set,k=()=>{D.forEach(e=>{e()})},b=c({actions:E=a({setIntegration:e=>{b=e(b),k()}})}),I=r({getState:()=>({integration:b})}),h=m({setRouting:e=>{y=e(y),k()}}),y=l(),j=d({getState:()=>({...A.getState(),routing:y}),actions:h,accessActions:A.actions.access,loadedDataActions:A.actions.loadedData,domainServicesSelectors:A.selectors.domainServices,overridesSelectors:A.selectors.overrides}),R=s({getState:()=>({...A.getState(),session:w}),environmentSelectors:A.selectors.environment,specSelectors:A.selectors.spec,accessSelectors:A.selectors.access,domainServicesSelectors:A.selectors.domainServices,webComponentOptions:f.webComponentOptions,webComponentApi:f.webComponentApi,getSessionService:()=>L(),routingSelectors:j}),T=S({setSessionRuntime:e=>{w=e(w),k()}}),O=g({getState:()=>({...A.getState(),session:w}),sessionContextSelectors:A.selectors.sessionContext}),L=e(()=>new p({getLogger:()=>A.selectors.domainServices.getLogger(),getAnalyticsService:()=>A.selectors.domainServices.getAnalyticsService(),getUnauthenticatedClient:R.getUnauthenticatedClient,environmentSelectors:A.selectors.environment,sessionActions:T,setSessionContext:A.actions.sessionContext.setSessionContext,sessionSelectors:O,specSelectors:A.selectors.spec})),F={configurator:i({applicationType:"configurator",commonServicesSelectors:R,domainServicesSelectors:A.selectors.domainServices,domainContextSelectors:A.selectors.domainContext.configurator,getApplicationRuntimeExtensions:()=>[]}),admin:i({applicationType:"admin",commonServicesSelectors:R,domainServicesSelectors:A.selectors.domainServices,domainContextSelectors:A.selectors.domainContext.admin,getApplicationRuntimeExtensions:()=>[]})},{subscribe:e=>{D.add(e);let t=A.subscribe(e);return()=>{D.delete(e),t()}},getState:()=>({...A.getState(),integration:b,routing:y,session:w}),selectors:{...A.selectors,commonServices:R,integration:I,routing:j,session:O,domainApplicationContext:F},actions:{...A.actions,integration:E,routing:h,session:T}});return B.actions.sessionContext.setSessionContext(n(V,M)),B.actions.access.setConfiguratorAccessInfo({raw:"mock-access-token",viewMode:"read"===U,revisionId:void 0,configurationId:"mock"}),B.actions.domainData.setDomainData({publishedData:x.publishedData,frontendData:x.frontendData,backendData:x.backendData}),B.actions.loadedData.completeConfiguratorLoad({initialRevisionId:"mock-revision",initialEntities:x.entities,modelVersion:z.domain.domainFactory.modelVersion,rootEntityType:x.rootEntityType,schemaIdentity:z.domain.domainFactory}),B};
1
+ import{memoOnce as e}from"@salsita-ai/common/utils";import{createDomainRuntime as t,createMockDomainRuntimeServices as o,createMockSessionContext as n}from"#package/domain";import{createCommonServicesSelectors as s}from"../common-services/index.js";import{createDomainApplicationContextSelectors as i}from"../domain-application-context/index.js";import{createIntegrationActions as a,createIntegrationSelectors as r,initializeIntegration as c}from"../integration/index.js";import{createRoutingActions as m,createRoutingSelectors as d,initializeRouting as p}from"../routing/index.js";import{SessionService as l,createSessionRuntimeActions as S,createSessionRuntimeSelectors as g,initializeSessionRuntime as v}from"../session/index.js";import{createMockWebComponentApi as u}from"../web-component/index.js";export const createMockApplicationRuntime=(f,C)=>{var x;let b,y,w,A,D,k,E,I,h,j,R,T,O,L,F,{sessionData:M,mode:U,role:V}=C,z=o(),q=(x={webComponentOptions:C.webComponentOptions??f.mount.options,webComponentApi:C.webComponentApi??u()},w=v(),A=t({config:f,services:z,getExtensionSystems:e=>F[e].getInitializableSystems()}),D=new Set,k=()=>{D.forEach(e=>{e()})},b=c({actions:E=a({setIntegration:e=>{b=e(b),k()}})}),I=r({getState:()=>({integration:b})}),h=m({setRouting:e=>{y=e(y),k()}}),y=p(),j=d({getState:()=>({...A.getState(),routing:y}),actions:h,accessActions:A.actions.access,loadedDataActions:A.actions.loadedData,domainServicesSelectors:A.selectors.domainServices,overridesSelectors:A.selectors.overrides}),R=s({getState:()=>({...A.getState(),session:w}),environmentSelectors:A.selectors.environment,specSelectors:A.selectors.spec,accessSelectors:A.selectors.access,domainServicesSelectors:A.selectors.domainServices,webComponentOptions:x.webComponentOptions,webComponentApi:x.webComponentApi,getSessionService:()=>L(),routingSelectors:j}),T=S({setSessionRuntime:e=>{w=e(w),k()}}),O=g({getState:()=>({...A.getState(),session:w}),sessionContextSelectors:A.selectors.sessionContext}),L=e(()=>new l({getLogger:()=>A.selectors.domainServices.getLogger(),getAnalyticsService:()=>A.selectors.domainServices.getAnalyticsService(),getUnauthenticatedClient:R.getUnauthenticatedClient,environmentSelectors:A.selectors.environment,sessionActions:T,setSessionContext:A.actions.sessionContext.setSessionContext,sessionSelectors:O,specSelectors:A.selectors.spec})),F={configurator:i({applicationType:"configurator",commonServicesSelectors:R,domainServicesSelectors:A.selectors.domainServices,domainContextSelectors:A.selectors.domainContext.configurator,getApplicationRuntimeExtensions:()=>[]}),admin:i({applicationType:"admin",commonServicesSelectors:R,domainServicesSelectors:A.selectors.domainServices,domainContextSelectors:A.selectors.domainContext.admin,getApplicationRuntimeExtensions:()=>[]})},{subscribe:e=>{D.add(e);let t=A.subscribe(e);return()=>{D.delete(e),t()}},getState:()=>({...A.getState(),integration:b,routing:y,session:w}),selectors:{...A.selectors,commonServices:R,integration:I,routing:j,session:O,domainApplicationContext:F},actions:{...A.actions,integration:E,routing:h,session:T}}),B=q.getState().spec;return q.actions.spec.updateSpec({...B,configurator:{...B.configurator,createTransformers:e=>C.transformers.map(t=>t.transformer.register(e,t.priority??1/0))}}),q.actions.sessionContext.setSessionContext(n(V,M)),q.actions.access.setConfiguratorAccessInfo({raw:"mock-access-token",viewMode:"read"===U,revisionId:void 0,configurationId:"mock"}),q.actions.domainData.setDomainData({publishedData:C.publishedData,frontendData:C.frontendData,backendData:C.backendData}),q.actions.loadedData.completeConfiguratorLoad({initialRevisionId:"mock-revision",initialEntities:C.entities,modelVersion:f.domain.domainFactory.modelVersion,rootEntityType:C.rootEntityType,schemaIdentity:f.domain.domainFactory}),q};
@@ -67,7 +67,7 @@ export declare function createApplicationRuntimeSlices<State extends Application
67
67
  selectAdminPreset: import("@salsita-ai/common/utils").Selector<import("#package/domain").SpecSelectorState, import("#package/domain").AnyProductPreset>;
68
68
  selectAdminModelVersion: import("@salsita-ai/common/utils").Selector<import("#package/domain").SpecSelectorState, number>;
69
69
  selectThemeOptions: import("@salsita-ai/common/utils").Selector<import("#package/domain").SpecSelectorState, import("@mui/material").ThemeOptions>;
70
- selectAssistant: import("@salsita-ai/common/utils").Selector<import("#package/domain").SpecSelectorState, import("#package/domain").AssistantManifest | null>;
70
+ selectAssistant: import("@salsita-ai/common/utils").Selector<import("#package/domain").SpecSelectorState, Required<import("#package/domain").AssistantManifest> | null>;
71
71
  selectConfiguratorFactory: import("@salsita-ai/common/utils").Selector<import("#package/domain").SpecSelectorState, import("#package/domain").AnyDomainFactory>;
72
72
  selectAdminFactory: import("@salsita-ai/common/utils").Selector<import("#package/domain").SpecSelectorState, import("#package/domain").AnyDomainFactory>;
73
73
  selectConfiguratorComponentOptics: import("@salsita-ai/common/utils").Selector<import("#package/domain").SpecSelectorState, readonly import("#package/domain").AnyDomainComponentOptic[]>;
@@ -110,7 +110,7 @@ export declare function createApplicationRuntimeSlices<State extends Application
110
110
  getAdminPreset: () => import("#package/domain").AnyProductPreset;
111
111
  getAdminModelVersion: () => number;
112
112
  getThemeOptions: () => import("@mui/material").ThemeOptions;
113
- getAssistant: () => import("#package/domain").AssistantManifest | null;
113
+ getAssistant: () => Required<import("#package/domain").AssistantManifest> | null;
114
114
  getConfiguratorFactory: () => import("#package/domain").AnyDomainFactory;
115
115
  getAdminFactory: () => import("#package/domain").AnyDomainFactory;
116
116
  getConfiguratorComponentOptics: () => readonly import("#package/domain").AnyDomainComponentOptic[];
@@ -727,7 +727,7 @@ declare const createApplicationRuntimeImpl: <EXTENSIONS extends readonly AnyAppl
727
727
  selectAdminPreset: import("@salsita-ai/common/utils").Selector<import("#package/domain").SpecSelectorState, import("#package/domain").AnyProductPreset>;
728
728
  selectAdminModelVersion: import("@salsita-ai/common/utils").Selector<import("#package/domain").SpecSelectorState, number>;
729
729
  selectThemeOptions: import("@salsita-ai/common/utils").Selector<import("#package/domain").SpecSelectorState, import("@mui/material").ThemeOptions>;
730
- selectAssistant: import("@salsita-ai/common/utils").Selector<import("#package/domain").SpecSelectorState, import("#package/domain").AssistantManifest | null>;
730
+ selectAssistant: import("@salsita-ai/common/utils").Selector<import("#package/domain").SpecSelectorState, Required<import("#package/domain").AssistantManifest> | null>;
731
731
  selectConfiguratorFactory: import("@salsita-ai/common/utils").Selector<import("#package/domain").SpecSelectorState, import("#package/domain").AnyDomainFactory>;
732
732
  selectAdminFactory: import("@salsita-ai/common/utils").Selector<import("#package/domain").SpecSelectorState, import("#package/domain").AnyDomainFactory>;
733
733
  selectConfiguratorComponentOptics: import("@salsita-ai/common/utils").Selector<import("#package/domain").SpecSelectorState, readonly import("#package/domain").AnyDomainComponentOptic[]>;
@@ -770,7 +770,7 @@ declare const createApplicationRuntimeImpl: <EXTENSIONS extends readonly AnyAppl
770
770
  getAdminPreset: () => import("#package/domain").AnyProductPreset;
771
771
  getAdminModelVersion: () => number;
772
772
  getThemeOptions: () => import("@mui/material").ThemeOptions;
773
- getAssistant: () => import("#package/domain").AssistantManifest | null;
773
+ getAssistant: () => Required<import("#package/domain").AssistantManifest> | null;
774
774
  getConfiguratorFactory: () => import("#package/domain").AnyDomainFactory;
775
775
  getAdminFactory: () => import("#package/domain").AnyDomainFactory;
776
776
  getConfiguratorComponentOptics: () => readonly import("#package/domain").AnyDomainComponentOptic[];
@@ -13,8 +13,11 @@ export declare const getViewportSize: () => Size;
13
13
  * Returns the viewport size. This can also be used as a dependency in a
14
14
  * useEffect to trigger an update when the browser resizes.
15
15
  *
16
+ * @param subscriptionActive if `false`, the viewport is neither measured nor followed, and the size
17
+ * returned is the last one measured, if any (useful for optimization)
18
+ *
16
19
  * @see https://martijnhols.nl/gists/how-to-get-document-height-ios-safari-osk
17
20
  * @todo: investigate if this can use `viewport$`
18
21
  */
19
- export declare const useViewportSize: () => Size | undefined;
22
+ export declare const useViewportSize: (subscriptionActive?: boolean) => Size | undefined;
20
23
  export {};
@@ -1 +1 @@
1
- import{useCallback as e,useEffect as i,useLayoutEffect as t,useState as n}from"react";let o="u">typeof window?t:()=>{};export const getViewportSize=()=>window.visualViewport?[window.visualViewport.width,window.visualViewport.height]:[window.innerWidth,window.innerHeight];export const useViewportSize=()=>{let[t,r]=n(),w=e(()=>{let e=getViewportSize();r(i=>i&&i[0]===e[0]&&i[1]===e[1]?i:e)},[]);return o(w,[w]),i(()=>{let e=()=>{w(),setTimeout(w,1e3)};return window.addEventListener("resize",e),window.addEventListener("orientationchange",e),window.visualViewport?.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e),window.visualViewport?.removeEventListener("resize",e)}},[w]),t};
1
+ import{useCallback as e,useEffect as i,useLayoutEffect as t,useState as n}from"react";let r="u">typeof window?t:()=>{};export const getViewportSize=()=>window.visualViewport?[window.visualViewport.width,window.visualViewport.height]:[window.innerWidth,window.innerHeight];export const useViewportSize=(t=!0)=>{let[o,w]=n(),d=e(()=>{let e=getViewportSize();w(i=>i&&i[0]===e[0]&&i[1]===e[1]?i:e)},[]);return r(()=>{t&&d()},[t,d]),i(()=>{if(!t)return;let e=()=>{d(),setTimeout(d,1e3)};return window.addEventListener("resize",e),window.addEventListener("orientationchange",e),window.visualViewport?.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e),window.visualViewport?.removeEventListener("resize",e)}},[t,d]),o};
@@ -1 +1 @@
1
- export { MobileControls, type MobileControlsLayoutProps, type MobileControlsThemeableProps } from './MobileControls.js';
1
+ export { MobileControls, type MobileControlsLayoutProps, type MobileControlsThemeableProps, type ViewOnlyModeProps, } from './MobileControls.js';
@@ -44,6 +44,7 @@ declare module '@mui/material/styles' {
44
44
  PhxChat: 'root';
45
45
  PhxChatFooter: 'root' | 'formLayout' | 'input';
46
46
  PhxChatMessage: 'base' | 'assistant' | 'user' | 'widget' | 'error' | 'helper';
47
+ PhxAssistantPanel: 'root' | 'header' | 'title' | 'closeButton' | 'thread' | 'greeting' | 'messages' | 'userMessage' | 'assistantMessage' | 'chips' | 'activity' | 'activityIcon' | 'chip' | 'status' | 'notice' | 'newReplyButton' | 'composer' | 'inputFrame' | 'input' | 'sendButton' | 'stopButton' | 'hint';
47
48
  PhxTopNavigation: 'root' | 'stepper' | 'step';
48
49
  PhxListSelector: 'root';
49
50
  PhxListSelectorItem: 'root' | 'radio' | 'title' | 'description' | 'formControlLabel';
@@ -109,6 +110,9 @@ declare module '@mui/material/styles' {
109
110
  PhxChatMessage?: {
110
111
  styleOverrides?: ComponentsOverrides<Theme>['PhxChatMessage'];
111
112
  };
113
+ PhxAssistantPanel?: {
114
+ styleOverrides?: ComponentsOverrides<Theme>['PhxAssistantPanel'];
115
+ };
112
116
  PhxPreviewLayout?: {
113
117
  styleOverrides?: ComponentsOverrides<Theme>['PhxPreviewLayout'];
114
118
  };
@@ -1,4 +1,5 @@
1
1
  import type { I18n } from '@lingui/core';
2
+ import type { DeploymentAssistant } from '@salsita-ai/contracts/assistant';
2
3
  import type { $DomainEntity, ConfiguratorBuilder, DomainEntity } from '#package/domain';
3
4
  export interface ClerkConfig {
4
5
  apiKey: string;
@@ -11,6 +12,8 @@ export interface ClerkConfig {
11
12
  }
12
13
  export interface BuilderDomainContext<ENTITIES extends DomainEntity<string> = never, ALLOWED_ROOT_ENTITIES extends ENTITIES = never, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>> = never, NAVIGATION_STATES extends string = never, VIEW_STATES extends string = never, TOOL_STATES extends string = never, EXPORT_STATES extends string = never, PUBLISHED_DATA extends Record<string, unknown> = never, SESSION_DATA extends Record<string, unknown> = never, FRONTEND_DATA extends Record<string, unknown> = never, ADMIN_ENTITIES extends DomainEntity<string> = never, ADMIN_ALLOWED_ROOT_ENTITIES extends ADMIN_ENTITIES = never, ADMIN_$MAP extends Record<ADMIN_ENTITIES['type'], $DomainEntity<ADMIN_ENTITIES>> = never, ADMIN_NAVIGATION_STATES extends string = never, ADMIN_VIEW_STATES extends string = never, FINALIZE_DATA extends Record<string, unknown> = never, PREFETCHED_FINALIZE_DATA extends Record<string, unknown> = never, FINALIZE_RESULT extends Record<string, unknown> = never, CALLBACK_DATA extends Record<string, unknown> = never, RESOURCE extends string = never> {
13
14
  configuratorBuilder: ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
15
+ /** Server-only settings supplied by the generated webhook bundle. */
16
+ assistantServerSettings?: Pick<DeploymentAssistant, 'instructions' | 'ai'> | null;
14
17
  createI18n: () => I18n;
15
18
  clerk?: ClerkConfig;
16
19
  }
@@ -1,4 +1,4 @@
1
- import type { $DomainEntity, DomainEntity } from '#package/domain';
1
+ import { type $DomainEntity, type DomainEntity } from '#package/domain';
2
2
  import type { FetchBackendDataHandler } from '../backend-data-handler.js';
3
3
  import { type AuthHandler, AuthHandlerBuilder } from './auth-handler-builder.js';
4
4
  import { CallbackBuilder } from './callback-builder.js';
@@ -1 +1 @@
1
- import{initConsoleLogger as e}from"@salsita-ai/common/utils";import{routeWebhookRequests as n}from"@salsita-ai/contracts/webhook";import{AdminFinalizeHandlerBuilder as o}from"./admin-finalize-handler-builder.js";import{AuthHandlerBuilder as t}from"./auth-handler-builder.js";import{CallbackBuilder as i}from"./callback-builder.js";import{ConfiguratorFinalizeHandlerBuilder as a}from"./configurator-finalize-handler-builder.js";import{DynamicResourcesFactory as r}from"./dynamic-resources-factory.js";import{PrefetchBuilder as s}from"./prefetch-builder.js";import{TaskFactory as l}from"./task-factory.js";export class WebhookBuilder{_context;_handlers;constructor(e,n){this._context=e,this._handlers=n}withAuthHook(e){return new WebhookBuilder(this._context,{...this._handlers,onAuth:e})}withConfiguratorFinalize(e){return new WebhookBuilder(this._context,{...this._handlers,...e})}withFetchBackendData(e){return new WebhookBuilder(this._context,{...this._handlers,onFetchBackendData:e})}build(){if(!this._handlers)throw Error("Can not build webhook without any handlers! It would be very dumb!");let t=e(),i=new o(this._context).build();return n({onAuth:void 0!==this._handlers.onAuth?(e,n)=>this._handlers.onAuth(e,{logger:t},n):void 0,admin:{onFinalize:(e,n)=>i(e,{logger:t},n)},configurator:{onFetchBackendData:this._handlers.onFetchBackendData?(e,n)=>this._handlers.onFetchBackendData(e,{logger:t},n):void 0,onFinalize:this._handlers.onFinalize?async(e,n)=>{let o=await this._handlers?.onFetchBackendData?.({deploymentId:e.deploymentId,frontendUrl:e.frontendUrl,frontendData:e.frontendData,sessionRole:e.sessionRole,sessionPayload:e.sessionPayload,publishedAdminRevisionPath:e.publishedAdminRevisionPath,publishedChunkUrls:e.publishedChunkUrls},{logger:t},n);return this._handlers.onFinalize({deploymentId:e.deploymentId,frontendUrl:e.frontendUrl,frontendData:e.frontendData,sessionRole:e.sessionRole,sessionPayload:e.sessionPayload,publishedAdminRevisionPath:e.publishedAdminRevisionPath,publishedChunkUrls:e.publishedChunkUrls,data:e.data,locale:e.locale,configurationId:e.configurationId,entities:e.entities,modelVersion:e.modelVersion,revisionId:e.revisionId,rootEntityType:e.rootEntityType,backendData:o?.backendData},{logger:t},n)}:void 0,onCallback:this._handlers.onCallback?(e,n)=>this._handlers.onCallback(e,{logger:t},n):void 0}},t)}}export const createDomainWebhook=e=>{let n=new t(e),o=new WebhookBuilder(e),d=new l(e),h=new r(e),u=new a(e,[]);return{authHandlerBuilder:n,webhookBuilder:o,taskFactory:d,finalizeHandlerBuilder:u,callbackBuilder:new i(e),dynamicResourcesFactory:h,prefetchBuilder:new s(e)}};
1
+ import{initConsoleLogger as e}from"@salsita-ai/common/utils";import{routeWebhookRequests as t}from"@salsita-ai/contracts/webhook";import{buildAssistantManifest as n,generateAssistantPrompt as o}from"#package/domain";import{AdminFinalizeHandlerBuilder as i}from"./admin-finalize-handler-builder.js";import{AuthHandlerBuilder as s}from"./auth-handler-builder.js";import{CallbackBuilder as a}from"./callback-builder.js";import{ConfiguratorFinalizeHandlerBuilder as r}from"./configurator-finalize-handler-builder.js";import{DynamicResourcesFactory as d}from"./dynamic-resources-factory.js";import{PrefetchBuilder as l}from"./prefetch-builder.js";import{TaskFactory as h}from"./task-factory.js";export class WebhookBuilder{_context;_handlers;constructor(e,t){this._context=e,this._handlers=t}withAuthHook(e){return new WebhookBuilder(this._context,{...this._handlers,onAuth:e})}withConfiguratorFinalize(e){return new WebhookBuilder(this._context,{...this._handlers,...e})}withFetchBackendData(e){return new WebhookBuilder(this._context,{...this._handlers,onFetchBackendData:e})}build(){if(!this._handlers&&!this._context.assistantServerSettings)throw Error("Can not build webhook without any handlers! It would be very dumb!");let s=e(),a=new i(this._context).build();return t({onAuth:this._handlers?.onAuth!==void 0?(e,t)=>this._handlers.onAuth(e,{logger:s},t):void 0,admin:{onFinalize:(e,t)=>a(e,{logger:s},t)},configurator:{onAssistantSetup:this._context.assistantServerSettings?async()=>{let e=this._context.configuratorBuilder.buildConfig().assistant;if(!e)throw Error("Assistant setup operation is not configured for this webhook!");let t=n(e),i=this._context.assistantServerSettings;return{setup:{sdl:t.sdl,prompt:o(t),...i}}}:void 0,onFetchBackendData:this._handlers?.onFetchBackendData?(e,t)=>this._handlers.onFetchBackendData(e,{logger:s},t):void 0,onFinalize:this._handlers?.onFinalize?async(e,t)=>{let n=await this._handlers?.onFetchBackendData?.({deploymentId:e.deploymentId,frontendUrl:e.frontendUrl,frontendData:e.frontendData,sessionRole:e.sessionRole,sessionPayload:e.sessionPayload,publishedAdminRevisionPath:e.publishedAdminRevisionPath,publishedChunkUrls:e.publishedChunkUrls},{logger:s},t);return this._handlers.onFinalize({deploymentId:e.deploymentId,frontendUrl:e.frontendUrl,frontendData:e.frontendData,sessionRole:e.sessionRole,sessionPayload:e.sessionPayload,publishedAdminRevisionPath:e.publishedAdminRevisionPath,publishedChunkUrls:e.publishedChunkUrls,data:e.data,locale:e.locale,configurationId:e.configurationId,entities:e.entities,modelVersion:e.modelVersion,revisionId:e.revisionId,rootEntityType:e.rootEntityType,backendData:n?.backendData},{logger:s},t)}:void 0,onCallback:this._handlers?.onCallback?(e,t)=>this._handlers.onCallback(e,{logger:s},t):void 0}},s)}}export const createDomainWebhook=e=>{let t=new s(e),n=new WebhookBuilder(e),o=new h(e),i=new d(e),u=new r(e,[]);return{authHandlerBuilder:t,webhookBuilder:n,taskFactory:o,finalizeHandlerBuilder:u,callbackBuilder:new a(e),dynamicResourcesFactory:i,prefetchBuilder:new l(e)}};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salsita-ai/sdk",
3
- "version": "0.50.0-develop.0ef5d49cfb",
3
+ "version": "0.50.0-develop.1162eef277",
4
4
  "description": "TypeScript SDK and CLI for building, running, and deploying Phoenix configurator applications.",
5
5
  "keywords": [
6
6
  "salsita",
@@ -149,10 +149,6 @@
149
149
  "import": "./dist/extras/ai-preview/index.js",
150
150
  "types": "./dist/extras/ai-preview/index.d.ts"
151
151
  },
152
- "./extras/assistant": {
153
- "import": "./dist/extras/assistant/index.js",
154
- "types": "./dist/extras/assistant/index.d.ts"
155
- },
156
152
  "./common/utils": {
157
153
  "import": "./dist/common/utils.js",
158
154
  "types": "./dist/common/utils.d.ts"
@@ -225,7 +221,7 @@
225
221
  "@swc/core": "1.15.40",
226
222
  "@swc/wasm-web": "1.15.40",
227
223
  "@tanstack/ai": "0.64.0",
228
- "@tanstack/ai-react": "0.29.4",
224
+ "@tanstack/ai-client": "0.36.1",
229
225
  "@trpc/client": "11.17.0",
230
226
  "@trpc/react-query": "11.17.0",
231
227
  "@trpc/server": "11.17.0",
@@ -275,6 +271,7 @@
275
271
  "react-json-tree": "0.20.0",
276
272
  "react-markdown": "9.0.1",
277
273
  "remark": "15.0.1",
274
+ "remark-gfm": "4.0.0",
278
275
  "rxjs": "7.8.2",
279
276
  "semver": "7.6.3",
280
277
  "spark-md5": "3.0.2",
@@ -295,8 +292,8 @@
295
292
  "yaml": "2.9.0",
296
293
  "yargs": "17.7.2",
297
294
  "zod": "3.25.76",
298
- "@salsita-ai/common": "0.50.0-develop.0ef5d49cfb",
299
- "@salsita-ai/contracts": "0.50.0-develop.0ef5d49cfb"
295
+ "@salsita-ai/common": "0.50.0-develop.1162eef277",
296
+ "@salsita-ai/contracts": "0.50.0-develop.1162eef277"
300
297
  },
301
298
  "devDependencies": {
302
299
  "@clerk/clerk-react": "5.61.8",
@@ -18586,6 +18586,30 @@
18586
18586
  "required": ["kind"],
18587
18587
  "additionalProperties": false
18588
18588
  },
18589
+ {
18590
+ "type": "object",
18591
+ "properties": {
18592
+ "kind": {
18593
+ "type": "string",
18594
+ "enum": ["assistantToolbarButton"]
18595
+ },
18596
+ "props": {
18597
+ "type": "object",
18598
+ "properties": {
18599
+ "showTitle": {
18600
+ "type": "boolean"
18601
+ },
18602
+ "icon": {
18603
+ "type": "string"
18604
+ }
18605
+ },
18606
+ "required": [],
18607
+ "additionalProperties": false
18608
+ }
18609
+ },
18610
+ "required": ["kind"],
18611
+ "additionalProperties": false
18612
+ },
18589
18613
  {
18590
18614
  "type": "object",
18591
18615
  "properties": {
@@ -1 +0,0 @@
1
- export { useAssistantChat, type AssistantChatState } from './use-assistant-chat.js';
@@ -1 +0,0 @@
1
- export{useAssistantChat}from"./use-assistant-chat.js";
@@ -1,20 +0,0 @@
1
- import { type UIMessage } from '@tanstack/ai-react';
2
- /** Experimental assistant chat state and actions of the current configuration. */
3
- export interface AssistantChatState {
4
- /** The thread as painted: hydrated from the server, then streamed. */
5
- readonly messages: ReadonlyArray<UIMessage>;
6
- /** True while a reply streams or a browser tool runs. */
7
- readonly isLoading: boolean;
8
- readonly error: Error | undefined;
9
- /** Sends a user message stamped with its send time. */
10
- readonly send: (content: string) => Promise<void>;
11
- /** Stops the current reply in the browser and on the server. */
12
- readonly stop: () => Promise<void>;
13
- }
14
- /**
15
- * Experimental: the conversational assistant of the current configuration. The server owns the
16
- * thread — the chat hydrates from it on mount and rejoins a reply still streaming — so the hook
17
- * keeps nothing in browser storage. Each message carries its send time for the model. The model's
18
- * `query` and `apply` calls run here, in the browser, against the configurator this hook is rendered in.
19
- */
20
- export declare const useAssistantChat: () => AssistantChatState;
@@ -1 +0,0 @@
1
- import{fetchServerSentEvents as t,useChat as e}from"@tanstack/ai-react";import{useCallback as a,useMemo as n}from"react";import{useApplicationRuntimeSelector as s,useAuthorizedClient as r,useConfigurationId as o}from"#package/react-sdk";import{useConfigurator as i}from"../application-runtime/index.js";export const useAssistantChat=()=>{let c=o(),p=r(),l=n(()=>p.getAssistantChatConnection(c),[p,c]),u=n(()=>{let e=async()=>({headers:await l.headers()}),a=t(l.url,e),n=t(`${l.url}/runs`,e);return{...a,joinRun:n.joinRun}},[l]),{assistantSystem:d}=i(),{messages:m,isLoading:h,error:f,sendMessage:g,stop:w,runId:y}=e({threadId:`assistant:${c}`,connection:u,persistence:!0,history:{pageSize:50},tools:s(d.getTools)});return{messages:m,isLoading:h,error:f,send:a(async t=>{let e={sentAt:new Date().toISOString()};await g({content:t,metadata:e})},[g]),stop:a(async()=>{w(),null!=y&&await fetch(`${l.url}/runs/${encodeURIComponent(y)}/cancel`,{method:"POST",headers:await l.headers()})},[l,y,w])}};
@@ -1,6 +0,0 @@
1
- /**
2
- * Experimental, unstyled assistant chat for the current configuration: streamed replies, reasoning
3
- * summaries, tool calls with their payloads, a pending indicator and a stop button. It renders
4
- * nothing, and contacts no server, when the application spec has no `assistant` section.
5
- */
6
- export declare const AssistantChat: () => import("react/jsx-runtime").JSX.Element | null;
@@ -1 +0,0 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Alert as r,Box as a,Button as i,LinearProgress as n,Stack as o,TextField as l,Typography as s}from"@mui/material";import{useState as c}from"react";import{useAssistantChat as p}from"#package/configurator";import{useSpecAssistant as m}from"#package/react-sdk";let d=({part:t})=>{switch(t.type){case"text":return e(s,{sx:{whiteSpace:"pre-wrap"},children:t.content});case"thinking":return e(s,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic",whiteSpace:"pre-wrap"},children:t.content});case"tool-call":return e(s,{variant:"caption",component:"pre",sx:{m:0,whiteSpace:"pre-wrap"},children:`${t.name}(${JSON.stringify(t.input??t.arguments)}) \xb7 ${t.state}`});case"tool-result":{let r=(e=>{if("string"!=typeof e){for(let t of e)if("image"===t.type&&"data"===t.source.type)return`data:${t.source.mimeType};base64,${t.source.value}`}})(t.content);return r?e(a,{component:"img",src:r,alt:"Tool result",sx:{maxWidth:"100%",border:1}}):e(s,{variant:"caption",children:`Tool result \xb7 ${t.state}`})}default:return null}},u=()=>{let{messages:m,send:u,stop:h,isLoading:f,error:x}=p(),[g,v]=c("");return t(o,{spacing:1.5,sx:{p:2},children:[m.map(r=>t(a,{component:"div",sx:{alignSelf:"user"===r.role?"flex-end":"flex-start",maxWidth:"85%"},children:[e(s,{variant:"overline",children:r.role}),r.parts.map((t,r)=>e(d,{part:t},r))]},r.id)),f&&e(n,{"aria-label":"Assistant is responding"}),x&&e(r,{severity:"warning",children:x.message}),e("form",{onSubmit:e=>{e.preventDefault();let t=g.trim();t&&(v(""),u(t))},children:t(o,{direction:"row",spacing:1,children:[e(l,{size:"small",fullWidth:!0,placeholder:"Ask the assistant…",value:g,onChange:e=>v(e.target.value)}),f?e(i,{onClick:()=>void h(),children:"Stop"}):e(i,{type:"submit",variant:"contained",disabled:!g.trim(),children:"Send"})]})})]})};export const AssistantChat=()=>m()?e(u,{}):null;
@@ -1 +0,0 @@
1
- export { AssistantChat } from './AssistantChat.js';
@@ -1 +0,0 @@
1
- export{AssistantChat}from"./AssistantChat.js";
@@ -1 +0,0 @@
1
- let e=["How to read the GraphQL schema of this configurator:","- A configuration is a set of entities. `root` is the root entity, `entities` lists every entity or the ones with the given ids, and `selectedEntity` is the entity the user has selected, or the root entity when nothing is selected.","- Every entity has an `id` of the form `<Type>-<number>`, for example `Table-1`, and a `type` with its entity type name. Ids are assigned by the configurator: read them from the configuration and never make one up.","- A field whose name starts with `_` is computed by the configurator from other values. It can be read like any other field and never written.","- Numbers are in the units the configuration stores them in. A field description names the unit when the product defines one.",'- A text field that only takes fixed values lists them in its description as "One of: ...". Use exactly those values.',"- A field typed as another entity type or as a list of one is a relation: select fields on it to read the related entities.","- Field and type descriptions come from the team that built the configurator and say what a value means for the product."],t=["How changes work:","- Every field of the `Mutation` type is one change. Its description says what it changes and what it returns.","- The configurator checks the whole configuration after each change. A change that would leave it invalid fails with an error that names the entities at fault, and it is not applied. Later changes of the same request are then not run.","- The configurator may adjust other values in response to a change, so read what a mutation returns instead of assuming the values you sent."],a=["How to add entities:","- Entities are added from recipes, the same ones the configurator offers the user. An entity type that can take children has a `meta` field; `meta { childRecipes }` lists its recipe groups and their recipes.","- List the recipes of the group first, pick one by its `key`, then call `addChild` with the id of the parent, the `groupId` and the `key`. Keys change with the configuration and the language, so never reuse one from memory.","- `dryRun` on a recipe shows what adding it would do without adding it: whether it is `ok`, the `changedEntities` it would add or modify, the `deletedEntityIds` it would remove, and the `errors` when it cannot be added. An entity whose id the configuration does not have yet is new. It is costly, so select it only on the recipes you are deciding between.","- Put each `addChild` in its own operation. The recipes of a group and what they add depend on the configuration before them, so after adding something, list the group again before adding from it once more."],n=["How to replace entities:","- An entity is replaced from recipes, the same ones the configurator offers the user. An entity type that can be replaced has a `meta` field; `meta { replaceRecipes }` lists its replace recipe groups and what the entity can be replaced with.","- List the recipes of the group first, pick one by its `key`, then call `replaceEntity` with the id of the entity, the `groupId` and the `key`. `dryRun` on a replace recipe shows what replacing would do without doing it: the replacement and everything else that changes are under `changedEntities`, and the replaced entity is among the `deletedEntityIds`.","- The replacement is a new entity with a new id, and its field values come from the recipe, so they can differ from those of the entity it replaces. Read the ids and values `replaceEntity` returns, and never use the old id again.","- Put each `replaceEntity` in its own operation. The recipes of a group and what they do depend on the configuration before them, so after replacing something, list the group of the replacement again before replacing once more."],i=["How to find the values a field can take:","- Some fields store a key whose choices the configurator holds elsewhere. Such a field has an edge under `meta` named after it: `meta { <field>Options }` lists its choices, each with the `value` to write and the `name` the user sees.","- Read the choices before you write such a field or name a choice to the user, and write the `value`, not the `name`. A value outside the list is rejected unless the edge description says the field is not checked.","- `dryRun` on an option shows what writing its value would do without writing it: whether it is `ok`, the `changedEntities` it would add or modify, the `deletedEntityIds` it would remove, and the `errors` when the value cannot be written. It is costly, so select it only on the options you are deciding between. It is null when the edge description says the options cannot be dry-run.","- The choices can depend on the entity and on its current state. Read them again after a change, unless the edge description says they are the same for all instances or do not change."],o=["How the custom changes of this configurator work:","- Besides the generic changes, the `Mutation` type has fields the team built for this product. Each runs one domain operation the configurator itself uses, so prefer it over composing the same change from generic mutations. Its description says what it does and what its arguments mean.","- Its arguments are checked against what the operation declares; an argument that does not fit, or a change the product does not allow, fails the field with a message that says what to send instead.","- It returns an object whose fields the description names; a field typed as an entity reads that entity after the change."],s=["How to use the `query` and `apply` tools:","- Both take `operations`, a list of GraphQL documents that run in order. Each document holds exactly one operation. To do several things, send several items in one call instead of several calls.","- Write values into the document as literals. Use `variables` only for a value that cannot be written as a literal.","- Select only the fields you need: results are returned whole.","- The result has one GraphQL result per operation, in the order sent. When an operation fails, its `errors` say why and the operations after it are not run.","- `query` reads the configuration the user has open and never changes it. Call it before you say anything about the configuration."],r=["- This configurator exposes no changes, so there is nothing for `apply` to run. Say so when the user asks you to change the configuration."],h=['- Mutations inside `query` answer "what if" questions. Each operation sees the changes of the ones before it, so a mutation followed by a query shows the configuration as it would be. Nothing is kept and the user sees no change.',"- `apply` makes the changes the user asked for. It is all or nothing: when any operation fails, nothing is changed; when all succeed, the user gets them as one undo step.","- `committed` in the result says whether the changes were kept. When it is false although no operation failed, `message` says why: the changes may be waiting for the approval of the user, the user may have changed the configuration meanwhile, or this session may not change the configuration at all. Without a `message`, the operations changed nothing. Never tell the user a change was made unless `committed` is true."];export const generateAssistantPrompt=d=>{let c=/^type Mutation\b/m.test(d.sdl);return[e,...c?[t]:[],.../^\s+addChild\(/m.test(d.sdl)?[a]:[],.../^\s+replaceEntity\(/m.test(d.sdl)?[n]:[],.../^type FieldOption\b/m.test(d.sdl)?[i]:[],...Object.keys(d.actions).length>0?[o]:[],[...s,...c?h:r]].map(e=>e.join("\n")).join("\n\n")};