@salsita-ai/sdk 0.50.0-develop.ca72986c39 → 0.50.0-develop.d0eaeed131

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 (361) hide show
  1. package/README.md +8 -4
  2. package/dist/admin/default-admin-elements.d.ts +9 -0
  3. package/dist/admin/default-admin-elements.js +1 -0
  4. package/dist/admin/default-elements/built-in-entity-element.d.ts +10 -0
  5. package/dist/admin/default-elements/built-in-entity-element.js +1 -0
  6. package/dist/admin/default-elements/built-in-layout-element.d.ts +10 -0
  7. package/dist/admin/default-elements/built-in-layout-element.js +1 -0
  8. package/dist/admin/default-elements/index.d.ts +2 -0
  9. package/dist/admin/default-elements/index.js +1 -0
  10. package/dist/admin/index.d.ts +1 -0
  11. package/dist/admin/index.js +1 -1
  12. package/dist/application-spec/caching/content-diff.js +1 -1
  13. package/dist/application-spec/core/application-file.d.ts +0 -2
  14. package/dist/application-spec/core/application-file.js +1 -1
  15. package/dist/application-spec/errors/diagnostic-codes.d.ts +5 -0
  16. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  17. package/dist/application-spec/errors/diagnostic-messages.d.ts +5 -0
  18. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  19. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  20. package/dist/application-spec/generate-application/code/project-scaffolding.d.ts +10 -14
  21. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  22. package/dist/application-spec/generate-application/code/templates/admin-config.js +3 -0
  23. package/dist/application-spec/generate-application/code/templates/common/format-property-key.d.ts +7 -0
  24. package/dist/application-spec/generate-application/code/templates/common/format-property-key.js +1 -0
  25. package/dist/application-spec/generate-application/code/templates/common/schema-to-type-string.js +3 -3
  26. package/dist/application-spec/generate-application/code/templates/eslint-config.d.ts +5 -0
  27. package/dist/application-spec/generate-application/code/templates/eslint-config.js +4 -5
  28. package/dist/application-spec/generate-application/code/templates/gitignore.js +1 -3
  29. package/dist/application-spec/generate-application/code/templates/globals.js +7 -4
  30. package/dist/application-spec/generate-application/code/templates/index.d.ts +2 -2
  31. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  32. package/dist/application-spec/generate-application/code/templates/lingui-rc.d.ts +5 -0
  33. package/dist/application-spec/generate-application/code/templates/lingui-rc.js +4 -4
  34. package/dist/application-spec/generate-application/code/templates/prettier-config.d.ts +5 -0
  35. package/dist/application-spec/generate-application/code/templates/prettier-config.js +4 -5
  36. package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -1
  37. package/dist/application-spec/generate-application/code/templates/skills/phoenix-create-configurator-skill.js +1 -1
  38. package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +5 -5
  39. package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +3 -3
  40. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  41. package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.js +2 -2
  42. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +13 -2
  43. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
  44. package/dist/application-spec/generate-application/code/templates/spec-code/collect-spec-code.d.ts +58 -0
  45. package/dist/application-spec/generate-application/code/templates/spec-code/collect-spec-code.js +1 -0
  46. package/dist/application-spec/generate-application/code/templates/spec-code/index.d.ts +2 -0
  47. package/dist/application-spec/generate-application/code/templates/spec-code/index.js +1 -0
  48. package/dist/application-spec/generate-application/code/templates/spec-code/spec-code.d.ts +18 -0
  49. package/dist/application-spec/generate-application/code/templates/spec-code/spec-code.js +41 -0
  50. package/dist/application-spec/generate-application/code/templates/spec-messages/index.d.ts +1 -0
  51. package/dist/application-spec/generate-application/code/templates/spec-messages/index.js +1 -0
  52. package/dist/application-spec/generate-application/code/templates/spec-messages/spec-messages.d.ts +20 -0
  53. package/dist/application-spec/generate-application/code/templates/spec-messages/spec-messages.js +6 -0
  54. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +4 -3
  55. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +2 -2
  56. package/dist/application-spec/generate-application/runtime/admin-runtime/states-runtime.d.ts +2 -2
  57. package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +6 -5
  58. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +4 -3
  59. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +2 -2
  60. package/dist/application-spec/generate-application/runtime/configurator-runtime/states-runtime.d.ts +2 -2
  61. package/dist/application-spec/generate-application/runtime/migrations/migration-runtime.d.ts +2 -2
  62. package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.d.ts +2 -2
  63. package/dist/application-spec/generate-application/runtime/sections/data-runtime.d.ts +4 -4
  64. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +3 -2
  65. package/dist/application-spec/generate-application/runtime/sections/theme-runtime.d.ts +2 -2
  66. package/dist/application-spec/generate-application/runtime/sections/transformers-runtime.d.ts +3 -3
  67. package/dist/application-spec/generate-application/runtime-spec/decode-runtime-spec.d.ts +9 -0
  68. package/dist/application-spec/generate-application/runtime-spec/decode-runtime-spec.js +1 -0
  69. package/dist/application-spec/generate-application/runtime-spec/encode-runtime-spec.d.ts +8 -0
  70. package/dist/application-spec/generate-application/runtime-spec/encode-runtime-spec.js +1 -0
  71. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.d.ts +27 -0
  72. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.js +1 -0
  73. package/dist/application-spec/generate-application/runtime-spec/index.d.ts +5 -0
  74. package/dist/application-spec/generate-application/runtime-spec/index.js +1 -0
  75. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +68 -0
  76. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.js +1 -0
  77. package/dist/application-spec/generate-application/runtime-spec/spec-code-id.d.ts +40 -0
  78. package/dist/application-spec/generate-application/runtime-spec/spec-code-id.js +1 -0
  79. package/dist/application-spec/parse-application-files/categorize/categorize-files.d.ts +18 -0
  80. package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
  81. package/dist/application-spec/parse-application-files/categorize/earlier-generated-editor-configs.d.ts +16 -0
  82. package/dist/application-spec/parse-application-files/categorize/earlier-generated-editor-configs.js +9 -0
  83. package/dist/application-spec/parse-application-files/raw-spec/parse-yaml-spec-file.js +1 -1
  84. package/dist/application-spec/parse-application-files/spec/application/admin-spec/admin-spec.js +1 -1
  85. package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.js +1 -1
  86. package/dist/application-spec/parse-application-files/spec/common/index.d.ts +1 -0
  87. package/dist/application-spec/parse-application-files/spec/common/index.js +1 -1
  88. package/dist/application-spec/parse-application-files/spec/common/value-type/format-value-type.d.ts +3 -0
  89. package/dist/application-spec/parse-application-files/spec/common/value-type/format-value-type.js +1 -0
  90. package/dist/application-spec/parse-application-files/spec/common/value-type/index.d.ts +5 -0
  91. package/dist/application-spec/parse-application-files/spec/common/value-type/index.js +1 -0
  92. package/dist/application-spec/parse-application-files/spec/common/value-type/intersect-value-types.d.ts +6 -0
  93. package/dist/application-spec/parse-application-files/spec/common/value-type/intersect-value-types.js +1 -0
  94. package/dist/application-spec/parse-application-files/spec/common/value-type/is-assignable-value-type.d.ts +8 -0
  95. package/dist/application-spec/parse-application-files/spec/common/value-type/is-assignable-value-type.js +1 -0
  96. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type-at.d.ts +10 -0
  97. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type-at.js +1 -0
  98. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type.d.ts +98 -0
  99. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type.js +1 -0
  100. package/dist/application-spec/parse-application-files/spec/components/bindings/component-path.d.ts +13 -0
  101. package/dist/application-spec/parse-application-files/spec/components/bindings/component-path.js +1 -0
  102. package/dist/application-spec/parse-application-files/spec/components/bindings/index.d.ts +2 -0
  103. package/dist/application-spec/parse-application-files/spec/components/bindings/index.js +1 -1
  104. package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding-type.d.ts +24 -0
  105. package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding-type.js +1 -0
  106. package/dist/application-spec/parse-application-files/spec/components/component-state-type.d.ts +8 -0
  107. package/dist/application-spec/parse-application-files/spec/components/component-state-type.js +1 -0
  108. package/dist/application-spec/parse-application-files/spec/components/filter-criterion-types.d.ts +13 -0
  109. package/dist/application-spec/parse-application-files/spec/components/filter-criterion-types.js +1 -0
  110. package/dist/application-spec/parse-application-files/spec/components/static-entity-id.d.ts +14 -0
  111. package/dist/application-spec/parse-application-files/spec/components/static-entity-id.js +1 -0
  112. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.d.ts +6 -0
  113. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.js +1 -1
  114. package/dist/application-spec/parse-application-files/spec/components/user-components.d.ts +7 -4
  115. package/dist/application-spec/parse-application-files/spec/components/user-components.js +1 -1
  116. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +24 -0
  117. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.js +1 -0
  118. package/dist/application-spec/parse-application-files/spec/expressions/expression-read.d.ts +13 -0
  119. package/dist/application-spec/parse-application-files/spec/expressions/expression-read.js +1 -0
  120. package/dist/application-spec/parse-application-files/spec/expressions/expression-value-type.d.ts +9 -0
  121. package/dist/application-spec/parse-application-files/spec/expressions/expression-value-type.js +1 -0
  122. package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +6 -2
  123. package/dist/application-spec/parse-application-files/spec/expressions/expressions.js +1 -1
  124. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts +3 -1
  125. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.js +1 -1
  126. package/dist/application-spec/parse-application-files/spec/invariants/invariants.d.ts +2 -2
  127. package/dist/application-spec/parse-application-files/spec/invariants/invariants.js +1 -1
  128. package/dist/application-spec/parse-application-files/spec/model/index.d.ts +1 -0
  129. package/dist/application-spec/parse-application-files/spec/model/index.js +1 -1
  130. package/dist/application-spec/parse-application-files/spec/model/model-type-resolution.d.ts +10 -0
  131. package/dist/application-spec/parse-application-files/spec/model/model-type-resolution.js +1 -0
  132. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +7 -1
  133. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  134. package/dist/configurator/pages/DefaultConfiguratorLayout.d.ts +3 -2
  135. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  136. package/dist/configurator/pages/default-configurator-elements.d.ts +2 -1
  137. package/dist/configurator/pages/default-configurator-elements.js +1 -1
  138. package/dist/configurator/pages/default-elements/built-in-entity-element.d.ts +10 -0
  139. package/dist/configurator/pages/default-elements/built-in-entity-element.js +1 -0
  140. package/dist/configurator/pages/default-elements/built-in-layout-element.d.ts +10 -0
  141. package/dist/configurator/pages/default-elements/built-in-layout-element.js +1 -0
  142. package/dist/configurator/pages/default-elements/domain-control-elements.d.ts +6 -0
  143. package/dist/configurator/pages/default-elements/domain-control-elements.js +1 -0
  144. package/dist/configurator/pages/default-elements/index.d.ts +4 -0
  145. package/dist/configurator/pages/default-elements/index.js +1 -0
  146. package/dist/configurator/pages/default-elements/recipe-panel-elements.d.ts +3 -0
  147. package/dist/configurator/pages/default-elements/recipe-panel-elements.js +1 -0
  148. package/dist/configurator/pages/default-elements/sidebar-footer-elements.d.ts +7 -0
  149. package/dist/configurator/pages/default-elements/sidebar-footer-elements.js +1 -0
  150. package/dist/configurator/pages/default-elements/toolbar-elements.d.ts +7 -0
  151. package/dist/configurator/pages/default-elements/toolbar-elements.js +1 -0
  152. package/dist/configurator/ui/SaveMessageSnackbars.d.ts +10 -0
  153. package/dist/configurator/ui/SaveMessageSnackbars.js +1 -0
  154. package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +7 -2
  155. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
  156. package/dist/configurator/ui/assistant/AssistantPanel.js +1 -1
  157. package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
  158. package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.d.ts +1 -1
  159. package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.js +1 -1
  160. package/dist/configurator/ui/assistant/entity-link/entity-link-state.d.ts +1 -1
  161. package/dist/configurator/ui/assistant/entity-link/index.d.ts +0 -1
  162. package/dist/configurator/ui/assistant/entity-link/index.js +1 -1
  163. package/dist/configurator/ui/assistant/form/AssistantForm.d.ts +19 -0
  164. package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -0
  165. package/dist/configurator/ui/assistant/form/built-in-form-registry.d.ts +10 -0
  166. package/dist/configurator/ui/assistant/form/built-in-form-registry.js +1 -0
  167. package/dist/configurator/ui/assistant/form/compose-answer.d.ts +11 -0
  168. package/dist/configurator/ui/assistant/form/compose-answer.js +1 -0
  169. package/dist/configurator/ui/assistant/form/describe-build-errors.d.ts +6 -0
  170. package/dist/configurator/ui/assistant/form/describe-build-errors.js +1 -0
  171. package/dist/configurator/ui/assistant/form/form-element-definition.d.ts +14 -0
  172. package/dist/configurator/ui/assistant/form/form-element-definition.js +1 -0
  173. package/dist/configurator/ui/assistant/form/form-model.d.ts +38 -0
  174. package/dist/configurator/ui/assistant/form/form-model.js +1 -0
  175. package/dist/configurator/ui/assistant/form/form-registry.d.ts +31 -0
  176. package/dist/configurator/ui/assistant/form/form-registry.js +8 -0
  177. package/dist/configurator/ui/assistant/form/form-state.d.ts +4 -0
  178. package/dist/configurator/ui/assistant/form/form-state.js +1 -0
  179. package/dist/configurator/ui/assistant/form/index.d.ts +2 -0
  180. package/dist/configurator/ui/assistant/form/index.js +1 -0
  181. package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +9 -0
  182. package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -0
  183. package/dist/configurator/ui/assistant/form/read-form-attributes.d.ts +13 -0
  184. package/dist/configurator/ui/assistant/form/read-form-attributes.js +1 -0
  185. package/dist/configurator/ui/assistant/form-elements/FormGroup.d.ts +3 -0
  186. package/dist/configurator/ui/assistant/form-elements/FormGroup.js +1 -0
  187. package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +3 -0
  188. package/dist/configurator/ui/assistant/form-elements/FormOptions.js +1 -0
  189. package/dist/configurator/ui/assistant/form-elements/FormReply.d.ts +3 -0
  190. package/dist/configurator/ui/assistant/form-elements/FormReply.js +1 -0
  191. package/dist/configurator/ui/assistant/form-elements/FormText.d.ts +3 -0
  192. package/dist/configurator/ui/assistant/form-elements/FormText.js +1 -0
  193. package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +34 -0
  194. package/dist/configurator/ui/assistant/form-elements/form-element-props.js +1 -0
  195. package/dist/configurator/ui/assistant/form-elements/index.d.ts +5 -0
  196. package/dist/configurator/ui/assistant/form-elements/index.js +1 -0
  197. package/dist/configurator/ui/assistant/reference-link/AssistantReferenceLink.d.ts +16 -0
  198. package/dist/configurator/ui/assistant/reference-link/AssistantReferenceLink.js +1 -0
  199. package/dist/configurator/ui/assistant/reference-link/assistant-link-target.d.ts +34 -0
  200. package/dist/configurator/ui/assistant/reference-link/assistant-link-target.js +1 -0
  201. package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.d.ts +25 -0
  202. package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.js +1 -0
  203. package/dist/configurator/ui/assistant/reference-link/index.d.ts +3 -0
  204. package/dist/configurator/ui/assistant/reference-link/index.js +1 -0
  205. package/dist/configurator/ui/assistant/reference-link/reference-styles.d.ts +12 -0
  206. package/dist/configurator/ui/assistant/reference-link/reference-styles.js +1 -0
  207. package/dist/configurator/ui/assistant/reference-link/use-assistant-reference-details.d.ts +8 -0
  208. package/dist/configurator/ui/assistant/reference-link/use-assistant-reference-details.js +1 -0
  209. package/dist/configurator/ui/assistant/resource-image/AssistantImage.d.ts +9 -0
  210. package/dist/configurator/ui/assistant/resource-image/AssistantImage.js +1 -0
  211. package/dist/configurator/ui/assistant/resource-image/index.d.ts +3 -0
  212. package/dist/configurator/ui/assistant/resource-image/index.js +1 -0
  213. package/dist/configurator/ui/assistant/resource-image/resource-path.d.ts +11 -0
  214. package/dist/configurator/ui/assistant/resource-image/resource-path.js +1 -0
  215. package/dist/configurator/ui/assistant/resource-image/use-resource-image-url.d.ts +5 -0
  216. package/dist/configurator/ui/assistant/resource-image/use-resource-image-url.js +1 -0
  217. package/dist/configurator/ui/assistant/streamed-markdown.d.ts +2 -0
  218. package/dist/configurator/ui/assistant/streamed-markdown.js +2 -2
  219. package/dist/configurator/ui/assistant/thread-items.d.ts +8 -1
  220. package/dist/configurator/ui/assistant/thread-items.js +1 -1
  221. package/dist/configurator/ui/assistant/use-follow-stream.js +1 -1
  222. package/dist/configurator/ui/configurator-layout/slots/services/InvariantViolations.js +1 -1
  223. package/dist/configurator/ui/configurator-layout/slots/services/Services.js +1 -1
  224. package/dist/configurator/ui/legacy/layout/common/SummaryReadLayout.js +1 -1
  225. package/dist/configurator/ui/legacy/layout/simple/SimpleOwnerLayout.js +1 -1
  226. package/dist/configurator/ui/legacy/layout/steps/StepsOwnerLayout.js +1 -1
  227. package/dist/configurator/ui/legacy/layout/tabs/TabsOwnerLayout.js +1 -1
  228. package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomOwnerUi.d.ts +1 -0
  229. package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomOwnerUi.js +1 -1
  230. package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomReadUi.d.ts +1 -0
  231. package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomReadUi.js +1 -1
  232. package/dist/docs/controls/select-child-entity/cardselect.mdx +1 -0
  233. package/dist/docs/fabs/basic.mdx +2 -2
  234. package/dist/docs/index.json +1 -1
  235. package/dist/docs/layouts/custom-layout.mdx +324 -15
  236. package/dist/docs/phoenix/clerk-sign-in.mdx +1 -1
  237. package/dist/docs/phoenix/components.mdx +6 -0
  238. package/dist/docs/phoenix/configurator-interface.mdx +10 -10
  239. package/dist/docs/phoenix/domain-model.mdx +2 -0
  240. package/dist/docs/phoenix/getting-started.mdx +5 -3
  241. package/dist/docs/phoenix/layout-slots.mdx +9 -9
  242. package/dist/docs/phoenix/localization.mdx +6 -2
  243. package/dist/docs/phoenix/migration-guide.mdx +12 -10
  244. package/dist/docs/phoenix/phoenix-cli.mdx +31 -16
  245. package/dist/docs/phoenix/project-structure.mdx +52 -30
  246. package/dist/docs/phoenix/quickstart.mdx +7 -7
  247. package/dist/docs/phoenix/sdk-builder-workflow.mdx +6 -6
  248. package/dist/docs/phoenix/testing.mdx +8 -0
  249. package/dist/domain/application/assistant/assistant-form-elements.d.ts +28 -0
  250. package/dist/domain/application/assistant/assistant-form-elements.js +1 -0
  251. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  252. package/dist/domain/application/assistant/index.d.ts +2 -0
  253. package/dist/domain/application/assistant/index.js +1 -1
  254. package/dist/domain/application/assistant-recipe-groups.d.ts +3 -1
  255. package/dist/domain/core/schema/extended-schema-validator.js +1 -1
  256. package/dist/domain/domain-runtime/spec/module-checks/element-registration.d.ts +12 -11
  257. package/dist/domain/domain-runtime/spec/module-checks/element-registration.js +1 -1
  258. package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +1 -1
  259. package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
  260. package/dist/domain/domain-runtime/spec/selectors.js +1 -1
  261. package/dist/domain/system-components/child-entity-selection.js +1 -1
  262. package/dist/domain/system-components/common/scene-entity-control-schema.d.ts +3 -0
  263. package/dist/domain/system-components/common/scene-entity-control-schema.js +1 -1
  264. package/dist/i18n/locales/cs/messages.js +1 -1
  265. package/dist/i18n/locales/da/messages.js +1 -1
  266. package/dist/i18n/locales/de/messages.js +1 -1
  267. package/dist/i18n/locales/de-AT/messages.js +1 -1
  268. package/dist/i18n/locales/en/messages.js +1 -1
  269. package/dist/i18n/locales/en-AU/messages.js +1 -1
  270. package/dist/i18n/locales/en-GB/messages.js +1 -1
  271. package/dist/i18n/locales/es/messages.js +1 -1
  272. package/dist/i18n/locales/fr/messages.js +1 -1
  273. package/dist/i18n/locales/hu/messages.js +1 -1
  274. package/dist/i18n/locales/it/messages.js +1 -1
  275. package/dist/i18n/locales/nl/messages.js +1 -1
  276. package/dist/i18n/locales/pl/messages.js +1 -1
  277. package/dist/i18n/locales/pt/messages.js +1 -1
  278. package/dist/i18n/locales/ro/messages.js +1 -1
  279. package/dist/i18n/locales/sk/messages.js +1 -1
  280. package/dist/i18n/locales/tr/messages.js +1 -1
  281. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  282. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  283. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +79 -80
  284. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-admin.js +10 -11
  285. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +9 -10
  286. package/dist/phoenix/application-spec/application-spec-builder.d.ts +0 -2
  287. package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
  288. package/dist/phoenix/application-spec/generate-application-spec-project.d.ts +0 -2
  289. package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
  290. package/dist/phoenix/application-spec/generate-application-spec-story.js +2 -2
  291. package/dist/phoenix/application-spec/generate-project-files.d.ts +0 -2
  292. package/dist/phoenix/application-spec/project-files.js +1 -1
  293. package/dist/phoenix/bin.d.ts +2 -0
  294. package/dist/phoenix/bin.js +2 -0
  295. package/dist/phoenix/check-configs/built-in-eslint-config.d.ts +9 -0
  296. package/dist/phoenix/check-configs/built-in-eslint-config.js +1 -0
  297. package/dist/phoenix/check-configs/eslint-config.d.ts +10 -0
  298. package/dist/phoenix/check-configs/eslint-config.js +1 -0
  299. package/dist/phoenix/check-configs/index.d.ts +8 -0
  300. package/dist/phoenix/check-configs/index.js +1 -0
  301. package/dist/phoenix/check-configs/typescript-project.d.ts +5 -0
  302. package/dist/phoenix/check-configs/typescript-project.js +1 -0
  303. package/dist/phoenix/cli.d.ts +0 -1
  304. package/dist/phoenix/cli.js +1 -2
  305. package/dist/phoenix/commands/build.js +1 -1
  306. package/dist/phoenix/commands/check.js +1 -1
  307. package/dist/phoenix/commands/clean.js +1 -1
  308. package/dist/phoenix/commands/deploy.js +2 -2
  309. package/dist/phoenix/commands/deps/deps.d.ts +22 -1
  310. package/dist/phoenix/commands/deps/deps.js +2 -2
  311. package/dist/phoenix/commands/deps/index.d.ts +1 -1
  312. package/dist/phoenix/commands/deps/index.js +1 -1
  313. package/dist/phoenix/commands/deps/sdk-manifest.js +1 -1
  314. package/dist/phoenix/commands/dev.js +4 -4
  315. package/dist/phoenix/commands/fix.js +1 -1
  316. package/dist/phoenix/commands/init.d.ts +17 -5
  317. package/dist/phoenix/commands/init.js +1 -1
  318. package/dist/phoenix/commands/link.js +1 -1
  319. package/dist/phoenix/commands/prettier.js +1 -1
  320. package/dist/phoenix/commands/sync.js +1 -1
  321. package/dist/phoenix/commands/unlink.js +1 -1
  322. package/dist/phoenix/services/application-spec-project-watcher.d.ts +0 -2
  323. package/dist/phoenix/services/application-spec-project-watcher.js +2 -2
  324. package/dist/phoenix/services/lingui.d.ts +8 -0
  325. package/dist/phoenix/services/lingui.js +1 -1
  326. package/dist/phoenix/services/swc.js +1 -1
  327. package/dist/phoenix/services/vite-config.js +1 -1
  328. package/dist/phoenix/utils/index.d.ts +3 -2
  329. package/dist/phoenix/utils/index.js +1 -1
  330. package/dist/phoenix/utils/node-version/index.d.ts +1 -0
  331. package/dist/phoenix/utils/node-version/index.js +1 -0
  332. package/dist/phoenix/utils/node-version/supported-node-version.d.ts +12 -0
  333. package/dist/phoenix/utils/node-version/supported-node-version.js +4 -0
  334. package/dist/phoenix/utils/package-info.d.ts +0 -9
  335. package/dist/phoenix/utils/package-info.js +1 -1
  336. package/dist/phoenix/utils/package-manager/index.d.ts +2 -0
  337. package/dist/phoenix/utils/package-manager/index.js +1 -0
  338. package/dist/phoenix/utils/package-manager/package-manager-commands.d.ts +19 -0
  339. package/dist/phoenix/utils/package-manager/package-manager-commands.js +1 -0
  340. package/dist/phoenix/utils/package-manager/pnpm-project.d.ts +9 -0
  341. package/dist/phoenix/utils/package-manager/pnpm-project.js +1 -0
  342. package/dist/phoenix/utils/run-command.d.ts +11 -0
  343. package/dist/phoenix/utils/run-command.js +1 -1
  344. package/dist/phoenix/utils/sdk-tool/index.d.ts +1 -0
  345. package/dist/phoenix/utils/sdk-tool/index.js +1 -0
  346. package/dist/phoenix/utils/sdk-tool/resolve-sdk-tool-bin.d.ts +15 -0
  347. package/dist/phoenix/utils/sdk-tool/resolve-sdk-tool-bin.js +1 -0
  348. package/dist/react-sdk/domain-application-context/DomainLifecycleBoundary.js +1 -1
  349. package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.d.ts +15 -4
  350. package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.js +1 -1
  351. package/dist/ui-sdk/theme/types.d.ts +1 -1
  352. package/package.json +16 -9
  353. package/schema/domain-spec.json +86 -8
  354. package/dist/application-spec/generate-application/code/templates/nvmrc.d.ts +0 -1
  355. package/dist/application-spec/generate-application/code/templates/nvmrc.js +0 -2
  356. package/dist/application-spec/generate-application/code/templates/package-json.d.ts +0 -10
  357. package/dist/application-spec/generate-application/code/templates/package-json.js +0 -1
  358. package/dist/configurator/ui/assistant/entity-link/entity-link-target.d.ts +0 -5
  359. package/dist/configurator/ui/assistant/entity-link/entity-link-target.js +0 -1
  360. package/dist/phoenix/commands/generate-project-files.d.ts +0 -6
  361. package/dist/phoenix/commands/generate-project-files.js +0 -1
@@ -0,0 +1 @@
1
+ import{match as t}from"ts-pattern";export const FORM_PLACEHOLDER="—";let e=(t,e)=>`${" ".repeat(t)}${e}`,n=(t,e)=>null==t?e:`${t}: ${e}`,r=({value:t,label:e})=>t??e??"",i=({children:t},{state:e})=>t.filter(({id:t})=>!0===e.get(t)).map(r),o=(r,l,p)=>{let{label:h}=r;return t(r.definition.role).with("group",()=>{if(null==h)return r.children.flatMap(t=>o(t,l,p));let t=r.children.flatMap(t=>o(t,l+1,p));return t.length>0?[e(l,`${h}:`),...t]:[e(l,`${h}: —`)]}).with("choice",()=>[e(l,n(h,i(r,p)[0]??"—"))]).with("choices",()=>{let t=i(r,p);return 0===t.length?[e(l,n(h,"—"))]:null==h?t.map(t=>e(l,t)):[e(l,`${h}:`),...t.map(t=>e(l+1,t))]}).with("input",()=>[e(l,n(h,(({id:t,value:e},{answers:n})=>n.has(t)?n.get(t):""===e?void 0:e)(r,p)??"—"))]).with("option",()=>[]).exhaustive()};export const composeAnswer=(t,e,n)=>o(t.root,0,{state:e,answers:n}).join("\n");
@@ -0,0 +1,6 @@
1
+ import type { FormBuildError } from './form-model.js';
2
+ /**
3
+ * The message Fix it sends for a form that could not be built: every error, with the element named
4
+ * by its tag and its label or its position, then the request to write the form again.
5
+ */
6
+ export declare const describeBuildErrors: (errors: readonly FormBuildError[]) => string;
@@ -0,0 +1 @@
1
+ export const describeBuildErrors=e=>["Your form could not be built:",...e.map(e=>`- ${(({element:e,label:l,position:n})=>null==l?`<${e}> (element ${n})`:`<${e} label="${l}">`)(e)}: ${e.message}.`),"Send it again."].join("\n");
@@ -0,0 +1,14 @@
1
+ import type { ComponentType } from 'react';
2
+ import type { AssistantFormElementDescriptor } from '#package/domain';
3
+ import type { FormContainerProps, FormInputProps, FormOptionProps } from '../form-elements/index.js';
4
+ /** An element a form can render: what the prompt knows of it, and the component that renders it for its role. */
5
+ export type FormElementDefinition = (AssistantFormElementDescriptor & {
6
+ readonly role: 'group' | 'choice' | 'choices';
7
+ readonly component: ComponentType<FormContainerProps>;
8
+ }) | (AssistantFormElementDescriptor & {
9
+ readonly role: 'option';
10
+ readonly component: ComponentType<FormOptionProps>;
11
+ }) | (AssistantFormElementDescriptor & {
12
+ readonly role: 'input';
13
+ readonly component: ComponentType<FormInputProps>;
14
+ });
@@ -0,0 +1,38 @@
1
+ import type { FormElementDefinition } from './form-element-definition.js';
2
+ /**
3
+ * An element of a parsed form. Options outside a `choice` or `choices` are already wrapped in an
4
+ * implicit container, and the top level of the block is an implicit group without a label.
5
+ */
6
+ export interface FormNode {
7
+ /** Unique within its block: the element's position in the markup, or what an implicit container wraps. */
8
+ readonly id: string;
9
+ readonly definition: FormElementDefinition;
10
+ readonly label?: string;
11
+ readonly value?: string;
12
+ readonly attributes: Readonly<Record<string, unknown>>;
13
+ readonly children: readonly FormNode[];
14
+ }
15
+ /** Why an element made its block unbuildable, named by its tag and its label or its position in the block. */
16
+ export interface FormBuildError {
17
+ readonly element: string;
18
+ readonly label?: string;
19
+ /** The element's place in the block, counting elements in document order from 1. */
20
+ readonly position: number;
21
+ readonly message: string;
22
+ }
23
+ /**
24
+ * A form fence as the panel renders it, or every reason it cannot. A quick form asks one question:
25
+ * the first pick sends it, and it has no submit button.
26
+ */
27
+ export type FormModel = {
28
+ readonly ok: true;
29
+ readonly root: FormNode;
30
+ readonly isQuick: boolean;
31
+ } | {
32
+ readonly ok: false;
33
+ readonly errors: readonly FormBuildError[];
34
+ };
35
+ /** A form that could be built. */
36
+ export type BuiltFormModel = Extract<FormModel, {
37
+ readonly ok: true;
38
+ }>;
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,31 @@
1
+ import type { AssistantFormAttribute, PhxValidateFunction, SchemaValidator } from '#package/domain';
2
+ import type { FormElementDefinition } from './form-element-definition.js';
3
+ /** A declared attribute of a form element with the validator of its coerced value. */
4
+ export interface RegisteredFormAttribute {
5
+ readonly attribute: AssistantFormAttribute;
6
+ readonly validate: PhxValidateFunction;
7
+ }
8
+ /** A form element with its declared attributes, the built-in `label` and `value` included. */
9
+ export interface RegisteredFormElement {
10
+ readonly definition: FormElementDefinition;
11
+ readonly attributes: ReadonlyMap<string, RegisteredFormAttribute>;
12
+ }
13
+ /** The elements forms can use, and the containers a form puts around what the model left implicit. */
14
+ export interface FormRegistry {
15
+ /** The container of a block's top level. */
16
+ readonly group: RegisteredFormElement;
17
+ /** The container of options that are a block's only content. */
18
+ readonly choice: RegisteredFormElement;
19
+ /** The container of a run of options outside any choice. */
20
+ readonly choices: RegisteredFormElement;
21
+ get(name: string): RegisteredFormElement | undefined;
22
+ }
23
+ /** What a registry is built with: the shared validator, which follows the project's CSP switch. */
24
+ export interface FormRegistryContext {
25
+ readonly schemaValidator: SchemaValidator;
26
+ }
27
+ /**
28
+ * Compiles a validator for every declared attribute of the given elements, each its own small
29
+ * schema, so every failing attribute is reported whichever validator the project uses.
30
+ */
31
+ export declare const createFormRegistry: (definitions: readonly FormElementDefinition[], { schemaValidator }: FormRegistryContext) => FormRegistry;
@@ -0,0 +1,8 @@
1
+ let e=new Set(`a abbr acronym address applet area article aside audio b base basefont bdi bdo big blink blockquote body br
2
+ button canvas caption center cite code col colgroup data datalist dd del details dfn dialog dir div dl dt em
3
+ embed fieldset figcaption figure font footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html
4
+ i iframe image img input ins kbd keygen label legend li link main map mark marquee math menu menuitem meta
5
+ meter nav nobr noembed noframes noscript object ol optgroup option output p param picture plaintext pre
6
+ progress q rb rp rt rtc ruby s samp script search section select slot small source span strike strong style
7
+ sub summary sup svg table tbody td template textarea tfoot th thead time title tr track tt u ul var video wbr
8
+ xmp`.split(/\s+/)),t=/^[a-z][a-z0-9-]*$/,r={type:"string"},a=({role:e,attributes:t})=>Object.entries({label:r,..."option"===e||"input"===e?{value:r}:{},...t}),o=(e,t)=>{let r=e.get(t);if(r?.definition.role!==t)throw Error(`The form registry has no "${t}" element with the role "${t}". Forms wrap implicit content in it. Register the built-in "${t}".`);return r};export const createFormRegistry=(r,{schemaValidator:n})=>{let i=new Map;for(let o of r){if(!t.test(o.name)||e.has(o.name))throw Error(`The form element "${o.name}" cannot be registered: its name must be lowercase and must not be an HTML element name, so form markup is never read as HTML. Rename the element.`);if(i.has(o.name))throw Error(`The form element "${o.name}" is registered twice. Each tag names one element. Remove or rename one of them.`);let r=new Map(a(o).map(([e,t])=>[e,{attribute:t,validate:n.compile({type:t.type,...t.enum?{enum:t.enum}:{}})}]));i.set(o.name,{definition:o,attributes:r})}return{group:o(i,"group"),choice:o(i,"choice"),choices:o(i,"choices"),get:e=>i.get(e)}};
@@ -0,0 +1,4 @@
1
+ /** What the user did in a form, by node id: `true` for a picked option, the input's own state for an input. */
2
+ export type FormState = ReadonlyMap<string, unknown>;
3
+ /** The answer text each input reported, by node id; an input that never reported is missing. */
4
+ export type FormAnswers = ReadonlyMap<string, string | undefined>;
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,2 @@
1
+ export { AssistantForm } from './AssistantForm.js';
2
+ export type { AssistantFormStatus } from './AssistantForm.js';
@@ -0,0 +1 @@
1
+ export{AssistantForm}from"./AssistantForm.js";
@@ -0,0 +1,9 @@
1
+ import type { FormModel } from './form-model.js';
2
+ import type { FormRegistry } from './form-registry.js';
3
+ /**
4
+ * Builds a form from the markup of a ```` ```form ```` fence. A block whose only content is loose
5
+ * options asks one question, so they form an implicit `choice`; elsewhere loose options form an
6
+ * implicit `choices`. A block with any unknown element, invalid attribute or misplaced element is
7
+ * not built at all, and every such error is returned.
8
+ */
9
+ export declare const parseFormBlock: (source: string, registry: FormRegistry) => FormModel;
@@ -0,0 +1 @@
1
+ import{Parser as e}from"htmlparser2";import{readFormAttributes as o}from"./read-form-attributes.js";let r=({name:e,attributes:o,position:r})=>({element:e,label:o.label,position:r}),t=({definition:e},o,r)=>({id:o,definition:e,attributes:{},children:r}),i=(e,o)=>{let r=[],i=[],n=()=>{i.length>0&&(r.push(t(o.registry.choices,`choices-${i[0]?.id}`,i)),i=[])};for(let o of e)"option"===o.definition.role?i.push(o):(n(),r.push(o));return n(),r},n=(e,t,l)=>e.flatMap(e=>((e,t,l)=>{var s;let a=l.registry.get(e.name);if(!a){l.errors.push({...r(e),message:"not a form element"}),n(e.children,void 0,l);return}let{definition:h}=a,p=(s=h.role,t?.role==="option"||t?.role==="input"?`cannot be inside <${t.name}>, which holds no elements`:(t?.role==="choice"||t?.role==="choices")&&"option"!==s?`cannot be inside <${t.name}>, which holds only options`:void 0);p&&l.errors.push({...r(e),message:p});let{attributes:c,errors:u}=o(a,e.attributes);for(let o of u)l.errors.push({...r(e),message:o});let{label:d,value:g,...m}=c,f=n(e.children,{name:e.name,role:h.role},l);return{id:String(e.position),definition:h,label:"string"==typeof d?d:void 0,value:"string"==typeof g?g:void 0,attributes:m,children:"group"===h.role?i(f,l):f}})(e,t,l)??[]),l=e=>{if("choice"===e.definition.role)return!0;let[o,...r]=e.children;return"group"===e.definition.role&&null!=o&&0===r.length&&l(o)};export const parseFormBlock=(o,r)=>{let s,a,h,p,c={registry:r,errors:[]},u={name:r.group.definition.name,role:"group"},d=n((a=[s=[]],h=0,(p=new e({onopentag:(e,o)=>{let r={name:e,attributes:o,position:h+=1,children:[]};a.at(-1)?.push(r),a.push(r.children)},onclosetag:()=>{a.length>1&&a.pop()}},{xmlMode:!0,lowerCaseTags:!0,lowerCaseAttributeNames:!0,recognizeSelfClosing:!0})).write(o),p.end(),s),u,c);if(c.errors.length>0)return{ok:!1,errors:c.errors};let g=d.length>0&&d.every(e=>"option"===e.definition.role)?[t(r.choice,"choice",d)]:i(d,c),m=t(r.group,"root",g);return{ok:!0,root:m,isQuick:l(m)}};
@@ -0,0 +1,13 @@
1
+ import type { RegisteredFormElement } from './form-registry.js';
2
+ /** The attributes of an element converted to their declared types, and what was wrong with them. */
3
+ export interface FormAttributesReading {
4
+ readonly attributes: Readonly<Record<string, unknown>>;
5
+ /** Each problem worded to follow the element's tag, e.g. `the attribute "step" must be an integer`. */
6
+ readonly errors: readonly string[];
7
+ }
8
+ /**
9
+ * Reads the attributes of an element against its declarations. Undeclared and missing required
10
+ * attributes are found by name; each declared one is coerced and checked by its own validator, and
11
+ * the error is worded from the declaration, never from the validator, whose errors differ by mode.
12
+ */
13
+ export declare const readFormAttributes: ({ definition, attributes: declared }: RegisteredFormElement, markup: Readonly<Record<string, string>>) => FormAttributesReading;
@@ -0,0 +1 @@
1
+ import{match as t}from"ts-pattern";let e=t=>{if(""===t.trim())return;let e=Number(t);return Number.isFinite(e)?e:void 0},r=(r,{type:i})=>t(i).with("string",()=>r).with("number",()=>e(r)??r).with("integer",()=>{let t=e(r);return null!=t&&Number.isInteger(t)?t:r}).with("boolean",()=>""===r||"true"===r||"false"!==r&&r).exhaustive(),i={string:"a string",number:"a number",integer:"an integer",boolean:"true or false"},u=(t,{type:e,enum:r})=>r?`the attribute "${t}" must be one of ${r.map(t=>`"${t}"`).join(", ")}`:`the attribute "${t}" must be ${i[e]}`;export const readFormAttributes=({definition:t,attributes:e},i)=>{let n={},a=[];for(let[t,o]of Object.entries(i)){let i=e.get(t);if(!i){a.push(`the attribute "${t}" is not declared`);continue}let s=r(o,i.attribute);i.validate(s)?n[t]=s:a.push(u(t,i.attribute))}for(let e of t.required??[])e in i||a.push(`the attribute "${e}" is required`);return{attributes:n,errors:a}};
@@ -0,0 +1,3 @@
1
+ import type { FormContainerProps } from './form-element-props.js';
2
+ /** A `group`: its children stacked under its label, which heads them. */
3
+ export declare const FormGroup: ({ label, children }: FormContainerProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as r,jsxs as e}from"react/jsx-runtime";import{styled as o}from"@mui/material";import{AssistantPanelName as m}from"../theme.js";let t=o("div",{name:m,slot:"formGroup"})(({theme:{spacing:r}})=>({display:"flex",flexDirection:"column",gap:r(1.5)})),i=o("div",{name:m,slot:"formGroupLabel"})(({theme:{palette:r,typography:e}})=>({...e.subtitle2,color:r.text.primary}));export const FormGroup=({label:o,children:m})=>e(t,{role:"group","aria-label":o,children:[null!=o&&r(i,{"aria-hidden":!0,children:o}),m]});
@@ -0,0 +1,3 @@
1
+ import type { FormContainerProps } from './form-element-props.js';
2
+ /** A `choice` or `choices`: its options in a wrapping row under its label. */
3
+ export declare const FormOptions: ({ label, children }: FormContainerProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{styled as r}from"@mui/material";import{AssistantPanelName as i}from"../theme.js";let t=r("div",{name:i,slot:"formOptions"})(({theme:{spacing:e}})=>({display:"grid",gap:e(.75)})),a=r("div",{name:i,slot:"formOptionsLabel"})(({theme:{palette:e,typography:o}})=>({...o.caption,color:e.text.secondary})),m=r("div",{name:i,slot:"formOptionsRow"})(({theme:{spacing:e}})=>({display:"flex",flexWrap:"wrap",gap:e(.75)}));export const FormOptions=({label:r,children:i})=>o(t,{role:"group","aria-label":r,children:[null!=r&&e(a,{"aria-hidden":!0,children:r}),e(m,{children:i})]});
@@ -0,0 +1,3 @@
1
+ import type { FormOptionProps } from './form-element-props.js';
2
+ /** A `reply`: a short answer as a small pill, marked while it is picked. */
3
+ export declare const FormReply: ({ label, disabled, selected, onSelect }: FormOptionProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as r}from"react/jsx-runtime";import{alpha as e,styled as i}from"@mui/material";import{AssistantPanelName as o}from"../theme.js";let t=i("button",{name:o,slot:"formReply"})(({theme:{palette:r,spacing:i,typography:o}})=>({...o.body2,background:r.background.paper,border:`1px solid ${r.divider}`,borderRadius:"calc(infinity * 1px)",color:r.text.primary,cursor:"pointer",margin:0,paddingBlock:i(.25),paddingInline:i(1.25),textAlign:"start","&:hover:not(:disabled)":{background:r.action.hover},"&:focus-visible":{outline:`2px solid ${r.primary.main}`,outlineOffset:1},"&:disabled":{color:r.text.disabled,cursor:"default"},'&[aria-pressed="true"]':{background:e(r.primary.main,r.action.selectedOpacity),borderColor:r.primary.main}}));export const FormReply=({label:e,disabled:i,selected:o,onSelect:a})=>r(t,{type:"button",disabled:i,"aria-pressed":o,onClick:a,children:e});
@@ -0,0 +1,3 @@
1
+ import type { FormInputProps } from './form-element-props.js';
2
+ /** A `text`: a single line the user types, with its label above it. */
3
+ export declare const FormText: ({ attributes, label, value, disabled, state, onChange }: FormInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{InputBase as t,styled as o}from"@mui/material";import{useCallback as i}from"react";import{AssistantPanelName as a}from"../theme.js";let d=o("label",{name:a,slot:"formText"})(({theme:{palette:e,spacing:r,typography:t}})=>({alignSelf:"stretch",color:e.text.secondary,display:"grid",gap:r(.5),...t.caption})),m=o(t,{name:a,slot:"formTextInput"})(({theme:{palette:e,spacing:r,typography:t}})=>({...t.body2,border:`1px solid ${e.divider}`,borderRadius:12,color:e.text.primary,paddingBlock:r(.75),paddingInline:r(1.5),"&.Mui-focused":{borderColor:e.primary.main},"& .MuiInputBase-input":{padding:0}}));export const FormText=({attributes:t,label:o,value:a,disabled:l,state:n,onChange:p})=>{let{placeholder:s}=t;return r(d,{children:[o,e(m,{value:"string"==typeof n?n:a??"",placeholder:"string"==typeof s?s:void 0,disabled:l,onChange:i(e=>{let r=e.target.value;p(r,""===r.trim()?void 0:r.trim())},[p])})]})};
@@ -0,0 +1,34 @@
1
+ import type { ReactNode } from 'react';
2
+ /** Validated and coerced attributes of an element, without the built-in `label` and `value`. */
3
+ export type FormElementAttributes = Readonly<Record<string, unknown>>;
4
+ /** Props of a `group`, `choice` or `choices` element: it lays out the children the form renders for it. */
5
+ export interface FormContainerProps {
6
+ readonly attributes: FormElementAttributes;
7
+ readonly label?: string;
8
+ readonly disabled: boolean;
9
+ readonly children: ReactNode;
10
+ }
11
+ /**
12
+ * Props of an option. Its container decides what a pick does: in a `choice` it replaces the
13
+ * previous pick, in a `choices` it toggles, and in a form that asks one question it sends at once.
14
+ */
15
+ export interface FormOptionProps {
16
+ readonly attributes: FormElementAttributes;
17
+ readonly label?: string;
18
+ readonly disabled: boolean;
19
+ readonly selected: boolean;
20
+ onSelect(): void;
21
+ }
22
+ /**
23
+ * Props of an input. Its state is its own: the form stores it and hands it back. `answer` is the
24
+ * text the answer shows for it, or `undefined` while there is none.
25
+ */
26
+ export interface FormInputProps {
27
+ readonly attributes: FormElementAttributes;
28
+ readonly label?: string;
29
+ /** What the field starts with. */
30
+ readonly value?: string;
31
+ readonly disabled: boolean;
32
+ readonly state: unknown;
33
+ onChange(state: unknown, answer: string | undefined): void;
34
+ }
@@ -0,0 +1,5 @@
1
+ export type { FormContainerProps, FormElementAttributes, FormInputProps, FormOptionProps, } from './form-element-props.js';
2
+ export { FormGroup } from './FormGroup.js';
3
+ export { FormOptions } from './FormOptions.js';
4
+ export { FormReply } from './FormReply.js';
5
+ export { FormText } from './FormText.js';
@@ -0,0 +1 @@
1
+ export{FormGroup}from"./FormGroup.js";export{FormOptions}from"./FormOptions.js";export{FormReply}from"./FormReply.js";export{FormText}from"./FormText.js";
@@ -0,0 +1,16 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { AssistantReferenceTarget } from './assistant-link-target.js';
3
+ export interface AssistantReferenceLinkProps {
4
+ readonly target: AssistantReferenceTarget;
5
+ /** The text the assistant gave the link; the target itself is never shown. */
6
+ readonly children: ReactNode;
7
+ }
8
+ declare const ReferenceLinkView: ({ target, children }: AssistantReferenceLinkProps) => import("react/jsx-runtime").JSX.Element;
9
+ /**
10
+ * A recipe or an option the assistant named in a reply, shown as its label. Hovering, focusing or
11
+ * tapping it opens a popover with its picture or color, name and description, read from the
12
+ * current state at that moment; leaving it, tapping outside or Escape closes it. A click does
13
+ * nothing else.
14
+ */
15
+ export declare const AssistantReferenceLink: import("react").MemoExoticComponent<typeof ReferenceLinkView>;
16
+ export {};
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Trans as n}from"@lingui/react";import{ClickAwayListener as t,Tooltip as a,styled as i}from"@mui/material";import{memo as o,useCallback as l,useEffect as s,useRef as d,useState as c}from"react";import{isShallowEqual as p}from"@salsita-ai/common/utils";import{useResourceUrl as m}from"#package/react-sdk";import{AssistantPanelName as u}from"../theme.js";import{assistantReferenceStyles as f}from"./reference-styles.js";import{useAssistantReferenceDetails as h}from"./use-assistant-reference-details.js";let b=i("span",{name:u,slot:"referenceLink"})(f),x=i("span",{name:u,slot:"referenceDetails"})(({theme:{palette:e,shape:r,shadows:n,spacing:t,typography:a}})=>({...a.body2,background:e.background.paper,borderRadius:r.borderRadius,boxShadow:n[4],color:e.text.primary,display:"flex",gap:t(1.5),maxInlineSize:320,padding:t(1.5),'&[data-reference-details="unavailable"]':{color:e.text.secondary}})),g=i("img")(({theme:{shape:e}})=>({alignSelf:"flex-start",blockSize:"auto",borderRadius:e.borderRadius/2,flexShrink:0,inlineSize:64,maxBlockSize:96,objectFit:"contain"})),k=i("span")(({theme:{palette:e,shape:r}})=>({blockSize:32,borderRadius:r.borderRadius/2,boxShadow:`inset 0 0 0 1px ${e.divider}`,flexShrink:0,inlineSize:32})),y=i("span")(({theme:{palette:e,spacing:r}})=>({display:"flex",flexDirection:"column",gap:r(.5),minInlineSize:0,"& > :first-of-type":{fontWeight:600},"& > :not(:first-of-type)":{color:e.text.secondary}})),S=({target:t,onResolve:a,onImageLoad:i})=>{let o=h(t),{getResourceUrl:l}=m(),d=null!=o;if(s(()=>{a(d)},[d,a]),!o)return e(x,{"data-reference-details":"unavailable",children:e(n,{id:"sdk.assistant.reference.unavailable.message",message:"Not available right now"})});let{name:c,description:p,imageUrl:u,color:f}=o;return r(x,{children:[null!=u&&e(g,{src:l(u),alt:"",onLoad:i}),null==u&&null!=f&&e(k,{style:{background:f}}),r(y,{children:[e("span",{children:c}),null!=p&&e("span",{children:p})]})]})};export const AssistantReferenceLink=o(({target:r,children:n})=>{let[i,o]=c(!1),[s,p]=c(!1),m=l(()=>o(!0),[]),u=l(()=>o(!1),[]),f=l(e=>p(!e),[]),h=d(null),x=l(e=>{h.current=e},[]),g=l(()=>{h.current?.update()},[]),k=l(e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),o(!0))},[]);return e(t,{onClickAway:u,mouseEvent:!!i&&"onClick",touchEvent:!!i&&"onTouchEnd",children:e(a,{open:i,onOpen:m,onClose:u,title:e(S,{target:r,onResolve:f,onImageLoad:g}),placement:"top-start",describeChild:!0,disableTouchListener:!0,PopperProps:{popperRef:x},slotProps:{tooltip:{sx:{background:"none",maxInlineSize:"none",padding:0}}},children:e(b,{role:"button",tabIndex:0,"aria-expanded":i,"data-reference":s?"muted":void 0,onClick:m,onKeyDown:k,children:n})})})},(e,r)=>e.children===r.children&&p(e.target,r.target));
@@ -0,0 +1,34 @@
1
+ import { type DomainEntityId } from '#package/domain';
2
+ /** A recipe of a recipe group on an entity, as the assistant read it under `meta`: `recipe:<entityId>/<groupId>/<key>`. */
3
+ export interface AssistantRecipeTarget {
4
+ readonly kind: 'recipe';
5
+ readonly entityId: DomainEntityId<string>;
6
+ readonly groupId: string;
7
+ readonly key: string;
8
+ }
9
+ /**
10
+ * A choice of a writable field on an entity, as the assistant read it under `meta`:
11
+ * `option:<entityId>/<edgeName>/<value>`. The edge is the options field the assistant queried, such
12
+ * as `finishOptions`, and the value is the option's value in its string form.
13
+ */
14
+ export interface AssistantOptionTarget {
15
+ readonly kind: 'option';
16
+ readonly entityId: DomainEntityId<string>;
17
+ readonly edgeName: string;
18
+ readonly value: string;
19
+ }
20
+ /** What a reference points at: something the configurator offers, shown by its details rather than selected. */
21
+ export type AssistantReferenceTarget = AssistantRecipeTarget | AssistantOptionTarget;
22
+ /** Where a link the assistant wrote in a reply points: an entity of the configuration, or a reference. */
23
+ export type AssistantLinkTarget = {
24
+ readonly kind: 'entity';
25
+ readonly id: DomainEntityId<string>;
26
+ } | AssistantReferenceTarget;
27
+ /** True for the target of a link the assistant wrote with one of its schemes, whatever follows the scheme. */
28
+ export declare const isAssistantLinkHref: (href: string) => boolean;
29
+ /**
30
+ * What a link the assistant wrote points at, or `null` when what follows its scheme is not a
31
+ * well-formed target. An entity link holds the id as it is; the parts of a reference are decoded,
32
+ * so a key the model encoded as in a URL and one Markdown encoded from angle brackets read the same.
33
+ */
34
+ export declare const parseAssistantLinkTarget: (href: string) => AssistantLinkTarget | null;
@@ -0,0 +1 @@
1
+ import{DomainEntityIdSchema as t}from"#package/domain";let e="entity:",n="recipe:",i="option:",l=[e,n,i],r=new RegExp(t.pattern),s=t=>{try{let e=decodeURIComponent(t);return""===e?null:e}catch{return null}},u=t=>{let e=t.split("/").map(s);if(3!==e.length)return null;let[n,i,l]=e;return null!=n&&r.test(n)&&null!=i&&null!=l?{entityId:n,first:i,second:l}:null};export const isAssistantLinkHref=t=>l.some(e=>t.startsWith(e));export const parseAssistantLinkTarget=t=>{if(t.startsWith(e)){let n=t.slice(e.length);return r.test(n)?{kind:"entity",id:n}:null}if(t.startsWith(n)){let e=u(t.slice(n.length));return e&&{kind:"recipe",entityId:e.entityId,groupId:e.first,key:e.second}}if(t.startsWith(i)){let e=u(t.slice(i.length));return e&&{kind:"option",entityId:e.entityId,edgeName:e.first,value:e.second}}return null};
@@ -0,0 +1,25 @@
1
+ import { type AssistantManifest, type AssistantRecipeContext, type DomainEntity, type DomainState } from '#package/domain';
2
+ import type { AssistantReferenceTarget } from './assistant-link-target.js';
3
+ type AnyDomainState = DomainState<DomainEntity<string>>;
4
+ /** What the popover of a reference shows of the recipe or option it points at, texts in the current language. */
5
+ export interface AssistantReferenceDetails {
6
+ readonly name: string;
7
+ readonly description: string | null;
8
+ readonly imageUrl: string | null;
9
+ readonly color: string | null;
10
+ }
11
+ /**
12
+ * What reading a reference needs: the manifest of the session and the readers `meta` resolves
13
+ * through, so the popover shows what the agent read.
14
+ */
15
+ export interface AssistantReferenceContext extends Pick<AssistantRecipeContext, 'componentReader' | 'resolveLocalizable'> {
16
+ readonly manifest: AssistantManifest;
17
+ }
18
+ /**
19
+ * The details of what a reference points at on the given state, read the way `meta` reads them:
20
+ * only what the session's manifest exposes, from a component that is active on the entity there.
21
+ * `null` when the target does not resolve: the entity, the group or options edge, or the key or value is
22
+ * unknown, or the component is not active.
23
+ */
24
+ export declare const readAssistantReferenceDetails: (target: AssistantReferenceTarget, state: AnyDomainState, context: AssistantReferenceContext) => AssistantReferenceDetails | null;
25
+ export {};
@@ -0,0 +1 @@
1
+ import{match as e}from"ts-pattern";import{findAssistantFieldOptions as i,findAssistantRecipeGroups as t,readAssistantFieldOptions as n,readAssistantRecipeGroup as r}from"#package/domain";let l=["child","replace"];export const readAssistantReferenceDetails=(o,a,d)=>{let u=a.entities.find(e=>e.id===o.entityId);return u?e(o).with({kind:"recipe"},e=>((e,i,n,o)=>{let a=(({entityId:e,groupId:i,key:n},o,a,d)=>{for(let u of l)for(let l of t(d.manifest,u,o)){if(l.groupId!==i)continue;let t=r(u,l,e,a,d)?.recipes.find(e=>e.key===n);if(t)return t}return null})(e,i,n,o);if(!a)return null;let{title:d,description:u,thumbnailUrl:f}=a.item,{resolveLocalizable:m}=o;return{name:m(d),description:void 0===u?null:m(u),imageUrl:void 0===f?null:m(f),color:null}})(e,u.type,a,d)).with({kind:"option"},e=>(({entityId:e,edgeName:t,value:r},l,o,a)=>{let d=i(a.manifest,l).find(e=>e.edgeName===t),u=d?n(d,e,o,a)?.find(e=>String(e.value)===r):void 0;return u?{name:u.name??u.description??String(u.value),description:null==u.name?null:u.description,imageUrl:u.imageUrl,color:u.color}:null})(e,u.type,a,d)).exhaustive():null};
@@ -0,0 +1,3 @@
1
+ export { AssistantReferenceLink } from './AssistantReferenceLink.js';
2
+ export { isAssistantLinkHref, parseAssistantLinkTarget } from './assistant-link-target.js';
3
+ export { assistantReferenceStyles } from './reference-styles.js';
@@ -0,0 +1 @@
1
+ export{AssistantReferenceLink}from"./AssistantReferenceLink.js";export{isAssistantLinkHref,parseAssistantLinkTarget}from"./assistant-link-target.js";export{assistantReferenceStyles}from"./reference-styles.js";
@@ -0,0 +1,12 @@
1
+ import { type CSSObject, type Theme } from '@mui/material';
2
+ /**
3
+ * How a link in a reply reads: a glossary reference, text that flows with the sentence and wraps
4
+ * with it, in the reference color with a dashed underline. Entity links and the references to
5
+ * recipes and options share it, so every link of a reply looks alike.
6
+ *
7
+ * - `data-reference="plain"`: something that exists but does nothing on a click, in the text color;
8
+ * - `data-reference="muted"`: something that is gone or cannot be read right now.
9
+ */
10
+ export declare const assistantReferenceStyles: ({ theme: { palette, shape } }: {
11
+ readonly theme: Theme;
12
+ }) => CSSObject;
@@ -0,0 +1 @@
1
+ import{alpha as e}from"@mui/material";export const assistantReferenceStyles=({theme:{palette:r,shape:o}})=>({background:"none",border:"none",borderRadius:o.borderRadius/2,boxDecorationBreak:"clone",color:r.primary.main,cursor:"pointer",font:"inherit",margin:0,padding:0,textDecorationLine:"underline",textDecorationStyle:"dashed",textDecorationThickness:1,textUnderlineOffset:"0.2em",WebkitBoxDecorationBreak:"clone",'&:hover, &:focus-visible, &[data-hovered="true"], &[aria-expanded="true"]':{background:e(r.primary.main,r.action.hoverOpacity)},"&:focus-visible":{outline:`2px solid ${r.primary.main}`,outlineOffset:1},'&[data-reference="plain"]':{color:"inherit",cursor:"auto"},'&[data-reference="muted"]':{color:r.text.disabled}});
@@ -0,0 +1,8 @@
1
+ import type { AssistantReferenceTarget } from './assistant-link-target.js';
2
+ import { type AssistantReferenceDetails } from './assistant-reference-details.js';
3
+ /**
4
+ * The details of what a reference points at, read from the committed state and followed while the
5
+ * caller is mounted; `null` when it does not resolve there. Only the open popover of a reference
6
+ * calls it, so a reply full of references reads nothing until one is opened.
7
+ */
8
+ export declare const useAssistantReferenceDetails: (target: AssistantReferenceTarget) => AssistantReferenceDetails | null;
@@ -0,0 +1 @@
1
+ import{useDomain as e,useResolveLocalizable as t,useStoreSelector as r}from"#package/react-sdk";import{useConfigurator as s}from"../../../application-runtime/index.js";import{readAssistantReferenceDetails as i}from"./assistant-reference-details.js";export const useAssistantReferenceDetails=a=>{let{assistantSystem:n}=s(),{componentReader:o}=e(),l=t();return r(({state:e})=>{let t=n.getSessionManifest();return t?i(a,e,{manifest:t,componentReader:o,resolveLocalizable:e=>l(e)}):null},[n,o,l,a])};
@@ -0,0 +1,9 @@
1
+ export interface AssistantImageProps {
2
+ readonly src: string | undefined;
3
+ readonly alt: string | undefined;
4
+ }
5
+ /**
6
+ * An image in a reply, loaded from the project's resources. One the panel refuses to request or
7
+ * that fails to load shows its alt text instead, so the sentence around it still reads.
8
+ */
9
+ export declare const AssistantImage: import("react").MemoExoticComponent<({ src, alt }: AssistantImageProps) => import("react/jsx-runtime").JSX.Element>;
@@ -0,0 +1 @@
1
+ import{jsx as r,Fragment as e}from"react/jsx-runtime";import{styled as t}from"@mui/material";import{memo as m,useCallback as o,useState as a}from"react";import{AssistantPanelName as i}from"../theme.js";import{useResourceImageUrl as s}from"./use-resource-image-url.js";let l=t("img",{name:i,slot:"image"})(({theme:{shape:r,spacing:e}})=>({blockSize:"auto",borderRadius:r.borderRadius,display:"block",maxInlineSize:"100%","& + &":{marginBlockStart:e(1)}}));export const AssistantImage=m(({src:t,alt:m})=>{let i=s()(t),[n,u]=a(),c=o(()=>{u(i)},[i]);return null==i||i===n?r(e,{children:m}):r(l,{src:i,alt:m??"",loading:"lazy",onError:c})});
@@ -0,0 +1,3 @@
1
+ export { AssistantImage } from './AssistantImage.js';
2
+ export { RESOURCE_PATH_PATTERN, isResourcePath } from './resource-path.js';
3
+ export { useResourceImageUrl } from './use-resource-image-url.js';
@@ -0,0 +1 @@
1
+ export{AssistantImage}from"./AssistantImage.js";export{RESOURCE_PATH_PATTERN,isResourcePath}from"./resource-path.js";export{useResourceImageUrl}from"./use-resource-image-url.js";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * A path into the project's resources, the kind stored on `imageUrl` fields: no scheme and no host,
3
+ * so resolving it never leaves the resources origin. A backslash, a control character or leading
4
+ * whitespace is refused too, because the URL parser reads a backslash as a slash and strips the
5
+ * others, which would turn `\\host` or ` //host` into an address on another host.
6
+ *
7
+ * Written as a JSON Schema `pattern`, so attribute schemas can apply the same rule.
8
+ */
9
+ export declare const RESOURCE_PATH_PATTERN: string;
10
+ /** True when the image source the model wrote may be requested: a path into the project's resources. */
11
+ export declare const isResourcePath: (src: string | undefined) => src is string;
@@ -0,0 +1 @@
1
+ export const RESOURCE_PATH_PATTERN=String.raw`^(?![a-zA-Z][a-zA-Z0-9+.-]*:)(?!//)[^\s\\\x00-\x1f][^\\\x00-\x1f]*$`;let t=RegExp(RESOURCE_PATH_PATTERN,"u");export const isResourcePath=R=>null!=R&&t.test(R);
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Resolves an image source the model wrote the way the configurator resolves thumbnails, or returns
3
+ * `undefined` when it is not a path into the project's resources and must not be requested.
4
+ */
5
+ export declare const useResourceImageUrl: () => (src: string | undefined) => string | undefined;
@@ -0,0 +1 @@
1
+ import{useCallback as r}from"react";import{useResourceUrl as e}from"#package/react-sdk";import{isResourcePath as o}from"./resource-path.js";export const useResourceImageUrl=()=>{let{getResourceUrl:t}=e();return r(r=>o(r)?t(r):void 0,[t])};
@@ -1,3 +1,5 @@
1
+ /** True when the text has a code fence the model has not closed yet. */
2
+ export declare const hasOpenFence: (text: string) => boolean;
1
3
  /**
2
4
  * Makes the Markdown of a reply that is still streaming renderable as it stands, so half-written
3
5
  * markup does not flash as raw characters: an open code fence is closed, an inline code span, a link
@@ -1,2 +1,2 @@
1
- let e=(e,t)=>e.split(t).length-1,t=/^\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/;export const completeStreamedMarkdown=l=>{if(e(l,"```")%2==1)return`${l}
2
- \`\`\``;let n=l.lastIndexOf("```"),s=-1===n?"":l.slice(0,n+3),r=l.slice(s.length),i=(e=>{let l=e.split("\n"),n=l.length;for(;n>0&&l[n-1]?.trimStart().startsWith("|");)n-=1;let s=l.slice(n),r=s[1],i=null!=r&&s.length>2&&t.test(r);return 0===s.length||i?e:l.slice(0,n).join("\n")})((e(r,"`")%2==1?r.slice(0,r.lastIndexOf("`")):r).replace(/!?\[([^\]\n]*)\]\([^)\n]*$/,"$1").replace(/!?\[[^\]\n]*$/,"")),c=e(i,"**")%2==1?`${i}**`:i;return`${s}${c}`};
1
+ let e=(e,t)=>e.split(t).length-1,t=/^\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/;export const hasOpenFence=t=>e(t,"```")%2==1;export const completeStreamedMarkdown=n=>{if(hasOpenFence(n))return`${n}
2
+ \`\`\``;let l=n.lastIndexOf("```"),s=-1===l?"":n.slice(0,l+3),r=n.slice(s.length),c=(e=>{let n=e.split("\n"),l=n.length;for(;l>0&&n[l-1]?.trimStart().startsWith("|");)l-=1;let s=n.slice(l),r=s[1],c=null!=r&&s.length>2&&t.test(r);return 0===s.length||c?e:n.slice(0,l).join("\n")})((e(r,"`")%2==1?r.slice(0,r.lastIndexOf("`")):r).replace(/!?\[([^\]\n]*)\](?:\([^)\n]*)?$/,"$1").replace(/!?\[[^\]\n]*$/,"")),i=e(c,"**")%2==1?`${c}**`:c;return`${s}${i}`};
@@ -8,6 +8,12 @@ export interface AssistantToolItem {
8
8
  readonly input: unknown;
9
9
  readonly result: unknown;
10
10
  }
11
+ /**
12
+ * What the forms in a stretch of assistant text are: shown only in the last message of the thread,
13
+ * and usable only once its reply has ended. A form in any earlier message has been answered or
14
+ * passed over, so it is not shown at all.
15
+ */
16
+ export type AssistantFormsVisibility = 'hidden' | 'disabled' | 'enabled';
11
17
  /**
12
18
  * One block of the thread, in reading order: a user bubble, a stretch of assistant Markdown, a row
13
19
  * of chips for the tool calls that follow each other without text in between, or the line that
@@ -22,6 +28,7 @@ export type AssistantThreadItem = {
22
28
  readonly id: string;
23
29
  readonly markdown: string;
24
30
  readonly isStreaming: boolean;
31
+ readonly forms: AssistantFormsVisibility;
25
32
  } | {
26
33
  readonly kind: 'tools';
27
34
  readonly id: string;
@@ -39,7 +46,7 @@ export interface AssistantThreadView {
39
46
  * Lays the messages of the chat out as the blocks the thread renders. Reasoning is left out; tool
40
47
  * results are not shown on their own but decide the state of the chip of their call.
41
48
  */
42
- export declare const buildThreadView: (messages: ReadonlyArray<UIMessage>, isReplying: boolean) => AssistantThreadView;
49
+ export declare const buildThreadView: (messages: ReadonlyArray<UIMessage>, isReplying: boolean, isResuming: boolean) => AssistantThreadView;
43
50
  /**
44
51
  * Lays the closed threads of the conversation out above the thread that continues them, oldest
45
52
  * first, each ended by a separator: the assistant read on from a summary of it, not from the
@@ -1 +1 @@
1
- import{describeToolCall as t}from"./tool-chip.js";let e=t=>{try{return JSON.parse(t)}catch{return t}},r=t=>t.map(t=>"text"===t.type?t.content:"").join("").trim();export const buildThreadView=(o,i)=>{let l=(t=>{let r=new Map;for(let o of t)for(let t of o.parts)"tool-result"===t.type&&r.set(t.toolCallId,{result:"string"==typeof t.content?e(t.content):t.content,error:"error"===t.state?t.error??"The tool call failed.":void 0});return r})(o),n=[],a=o.at(-1),s=t=>{let e=n.at(-1);e?.kind==="tools"?n[n.length-1]={...e,tools:[...e.tools,t]}:n.push({kind:"tools",id:t.id,tools:[t]})};for(let e of o){if("user"===e.role){let t=r(e.parts);t&&n.push({kind:"user",id:e.id,text:t});continue}let o=i&&e===a;e.parts.forEach((r,i)=>{let a=`${e.id}:${i}`;if("text"===r.type){if(r.content.trim()){let t=o&&i===e.parts.length-1;n.push({kind:"text",id:a,markdown:r.content,isStreaming:t})}return}if("tool-call"!==r.type)return;let d=l.get(r.id),p=r.input,u=r.output??d?.result;s({id:r.id,input:p,result:u,chip:t({name:r.name,input:p,result:u,error:d?.error,isReplyRunning:o})})})}let d=n.at(-1),p=a?.role==="assistant"&&(d?.kind==="text"&&d.isStreaming||d?.kind==="tools");return{items:n,isThinking:i&&!p}};export const buildEarlierThreadItems=t=>t.flatMap(({threadId:t,messages:e})=>[...buildThreadView(e,!1).items.map(e=>({...e,id:`${t}:${e.id}`})),{kind:"separator",id:`${t}:separator`}]);
1
+ import{match as t}from"ts-pattern";import{describeToolCall as e}from"./tool-chip.js";let r=t=>{try{return JSON.parse(t)}catch{return t}},i=t=>t.map(t=>"text"===t.type?t.content:"").join("").trim();export const buildThreadView=(o,n,s)=>{let l=(t=>{let e=new Map;for(let i of t)for(let t of i.parts)"tool-result"===t.type&&e.set(t.toolCallId,{result:"string"==typeof t.content?r(t.content):t.content,error:"error"===t.state?t.error??"The tool call failed.":void 0});return e})(o),a=[],d=o.at(-1),p=t=>{let e=a.at(-1);e?.kind==="tools"?a[a.length-1]={...e,tools:[...e.tools,t]}:a.push({kind:"tools",id:t.id,tools:[t]})};for(let r of o){if("user"===r.role){let t=i(r.parts);t&&a.push({kind:"user",id:r.id,text:t});continue}let o=n&&r===d,u=t({isLast:r===d,isBusy:o||s}).with({isLast:!1},()=>"hidden").with({isBusy:!0},()=>"disabled").otherwise(()=>"enabled");r.parts.forEach((t,i)=>{let n=`${r.id}:${i}`;if("text"===t.type){if(t.content.trim()){let e=o&&i===r.parts.length-1;a.push({kind:"text",id:n,markdown:t.content,isStreaming:e,forms:u})}return}if("tool-call"!==t.type)return;let s=l.get(t.id),d=t.input,h=t.output??s?.result;p({id:t.id,input:d,result:h,chip:e({name:t.name,input:d,result:h,error:s?.error,isReplyRunning:o})})})}let u=a.at(-1),h=d?.role==="assistant"&&(u?.kind==="text"&&u.isStreaming||u?.kind==="tools");return{items:a,isThinking:n&&!h}};export const buildEarlierThreadItems=t=>t.flatMap(({threadId:t,messages:e})=>[...buildThreadView(e,!1,!1).items.map(e=>"text"===e.kind?{...e,id:`${t}:${e.id}`,forms:"hidden"}:{...e,id:`${t}:${e.id}`}),{kind:"separator",id:`${t}:separator`}]);
@@ -1 +1 @@
1
- import{useCallback as r,useEffect as e,useLayoutEffect as t,useRef as l,useState as c}from"react";export const useFollowStream=(o,n)=>{let s=l(null),u=l(!0),[i,g]=c(!1),h=r(()=>{let r=s.current;u.current=!0,g(!1),r&&(r.scrollTop=r.scrollHeight)},[]),H=r(()=>{let r=s.current;r&&(u.current=r.scrollHeight-r.scrollTop-r.clientHeight<=24,u.current&&g(!1))},[]);return t(()=>{h()},[n,h]),t(()=>{let r=s.current;r&&(u.current?r.scrollTop=r.scrollHeight:r.scrollHeight>r.clientHeight&&g(!0))},[o]),e(()=>{let r=s.current;if(!r)return;let e=new ResizeObserver(()=>{u.current&&(r.scrollTop=r.scrollHeight)});return e.observe(r),()=>{e.disconnect()}},[]),{scrollerRef:s,hasUnseenContent:i,handleScroll:H,scrollToEnd:h}};
1
+ import{useCallback as e,useEffect as r,useLayoutEffect as t,useRef as l,useState as c}from"react";export const useFollowStream=(o,n)=>{let s=l(null),i=l(!0),[u,g]=c(!1),h=e(()=>{let e=s.current;i.current=!0,g(!1),e&&(e.scrollTop=e.scrollHeight)},[]),H=e(()=>{let e=s.current;e&&(i.current=e.scrollHeight-e.scrollTop-e.clientHeight<=24,i.current&&g(!1))},[]);return t(()=>{h()},[n,h]),t(()=>{let e=s.current;e&&(i.current?e.scrollTop=e.scrollHeight:e.scrollHeight>e.clientHeight&&g(!0))},[o]),r(()=>{let e=s.current;if(!e)return;let r=()=>{i.current&&(e.scrollTop=e.scrollHeight)},t=new ResizeObserver(r);return t.observe(e),e.addEventListener("load",r,!0),()=>{t.disconnect(),e.removeEventListener("load",r,!0)}},[]),{scrollerRef:s,hasUnseenContent:u,handleScroll:H,scrollToEnd:h}};
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{Trans as t}from"@lingui/react";import{useSnackbar as i}from"notistack";import{match as e}from"ts-pattern";import{useConfiguratorMessages as a,useLogger as n}from"#package/react-sdk";export const InvariantViolations=()=>{let{enqueueSnackbar:o}=i(),s=n();return a(i=>{e(i).with({kind:"error"},({error:i})=>{s.error("Uncaught error",i),o(r(t,{id:"sdk.messages.validation.uncaughtError.message",message:"Oops, something went wrong"}),{variant:"error"})}).with({kind:"violation"},({entityId:r,violation:t,text:i})=>{o(`${String(r)}: ${i}`,{variant:e(t.severity).with("notice",()=>"info").with("warning",()=>"warning").with("fixable",()=>"error").with("fatal",()=>"error").exhaustive()})}).with({kind:"sideEffect"},()=>{}).exhaustive()}),null};
1
+ import{jsx as r}from"react/jsx-runtime";import{Trans as i}from"@lingui/react";import{useSnackbar as t}from"notistack";import{match as e}from"ts-pattern";import{useConfiguratorMessages as a,useLogger as n}from"#package/react-sdk";export const InvariantViolations=()=>{let{enqueueSnackbar:o}=t(),s=n();return a(t=>{e(t).with({kind:"error"},({error:t})=>{s.error("Uncaught error",t),o(r(i,{id:"sdk.messages.validation.uncaughtError.message",message:"Oops, something went wrong"}),{variant:"error"})}).with({kind:"violation"},({entityId:r,violation:i,text:t})=>{o(`${String(r)}: ${t}`,{variant:e(i.severity).with("notice",()=>"info").with("warning",()=>"warning").with("fixable",()=>"error").with("fatal",()=>"error").exhaustive()})}).with({kind:"sideEffect"},()=>{}).with({kind:"saveError"},{kind:"saveRecovery"},()=>{}).exhaustive()}),null};
@@ -1 +1 @@
1
- import{jsx as r,jsxs as s,Fragment as t}from"react/jsx-runtime";import{memo as o}from"react";import{InvariantViolations as i}from"./InvariantViolations.js";import{SideEffects as e}from"./SideEffects.js";export const Services=o(()=>s(t,{children:[r(i,{}),r(e,{})]}));
1
+ import{jsx as r,jsxs as s,Fragment as o}from"react/jsx-runtime";import{memo as t}from"react";import{SaveMessageSnackbars as a}from"../../../SaveMessageSnackbars.js";import{InvariantViolations as e}from"./InvariantViolations.js";import{SideEffects as i}from"./SideEffects.js";export const Services=t(()=>s(o,{children:[r(e,{}),r(i,{}),r(a,{})]}));
@@ -1 +1 @@
1
- import{jsx as o,jsxs as t}from"react/jsx-runtime";import{Stack as r,Typography as e}from"@mui/material";import{match as a}from"ts-pattern";import{isCustomSummaryComponentSnapshot as n,isSimpleSummaryComponentSnapshot as l}from"#package/domain";import{useIsFullscreenActive as i,useRootEntityPrice as m}from"#package/react-sdk";import{Sidebar as s,MobileControls as p}from"#package/ui-sdk";import{usePreview as u,useSidebarSummary as f}from"../../../../configurator-context/index.js";import{LayoutSlots as d}from"../../../configurator-layout/index.js";import{LayoutFooter as c,LayoutToolbarReadDesktop as b,LayoutToolbarReadDesktopFullScreen as C,SimpleSummary as j}from"../../../phoenix-layout-elements/index.js";import{FullscreenDesktopToolbar as g}from"../../toolbar/desktop-toolbar/FullscreenDesktopToolbar.js";import{CloseConfiguratorButton as h}from"./CloseConfiguratorButton.js";import{CommonDesktopToolbar as k}from"./CommonDesktopToolbar.js";import{CommonMobileToolbar as x}from"./CommonMobileToolbar.js";import{ReactiveInterfaceLayout as y}from"./ReactiveInterfaceLayout.js";import{ToolControls as v}from"./ToolControls.js";import{ViewControls as w}from"./ViewControls.js";export const SummaryReadLayout=()=>{let{page:T}=f(),B=a(T).with(null,()=>null).when(n,o=>o.state.page).when(l,t=>o(j,{summary:t.state.items})).otherwise(()=>null),L=i(),M=m(),{isPreview:S,isPreviewEnabled:D}=u(),R=!L&&!S&&D;return o(y,{canvas:o(d.Canvas,{}),sidebar:B&&o(s.Layout,{content:B,chat:null,footer:null}),topNavigation:R&&o(h,{}),branding:null,toolbar:o(b,{defaultSlot:()=>o(k,{readMode:!0})}),fullScreenToolbar:o(C,{defaultSlot:()=>o(g,{})}),viewControls:o(w,{}),toolControls:o(v,{}),overlay:null,mobileControls:o(p.OrientationContainer,{portraitComponent:o(p.Layout,{chat:null,toolbar:o(x,{readMode:!0}),navigation:null,drawer:!L&&B}),landscapeComponent:null}),mobileTopNavigation:R&&o(h,{}),mobileHeaderActionButton:null,mobileHeaderCenter:!L&&o(e,{variant:"h6",sx:{paddingBlock:1},children:M}),sideEffects:null,footer:t(r,{children:[o(d.DesktopReadonlyBanner,{}),o(c,{})]})})};
1
+ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{Stack as r,Typography as e}from"@mui/material";import{match as a}from"ts-pattern";import{isCustomSummaryComponentSnapshot as n,isSimpleSummaryComponentSnapshot as l}from"#package/domain";import{useIsFullscreenActive as i,useRootEntityPrice as m}from"#package/react-sdk";import{Sidebar as s,MobileControls as p}from"#package/ui-sdk";import{usePreview as u,useSidebarSummary as f}from"../../../../configurator-context/index.js";import{SaveMessageSnackbars as d}from"../../../SaveMessageSnackbars.js";import{LayoutSlots as c}from"../../../configurator-layout/index.js";import{LayoutFooter as b,LayoutToolbarReadDesktop as C,LayoutToolbarReadDesktopFullScreen as j,SimpleSummary as g}from"../../../phoenix-layout-elements/index.js";import{FullscreenDesktopToolbar as k}from"../../toolbar/desktop-toolbar/FullscreenDesktopToolbar.js";import{CloseConfiguratorButton as h}from"./CloseConfiguratorButton.js";import{CommonDesktopToolbar as v}from"./CommonDesktopToolbar.js";import{CommonMobileToolbar as x}from"./CommonMobileToolbar.js";import{ReactiveInterfaceLayout as y}from"./ReactiveInterfaceLayout.js";import{ToolControls as w}from"./ToolControls.js";import{ViewControls as S}from"./ViewControls.js";export const SummaryReadLayout=()=>{let{page:T}=f(),M=a(T).with(null,()=>null).when(n,o=>o.state.page).when(l,t=>o(g,{summary:t.state.items})).otherwise(()=>null),B=i(),L=m(),{isPreview:D,isPreviewEnabled:R}=u(),H=!B&&!D&&R;return o(y,{canvas:o(c.Canvas,{}),sidebar:M&&o(s.Layout,{content:M,chat:null,footer:null}),topNavigation:H&&o(h,{}),branding:null,toolbar:o(C,{defaultSlot:()=>o(v,{readMode:!0})}),fullScreenToolbar:o(j,{defaultSlot:()=>o(k,{})}),viewControls:o(S,{}),toolControls:o(w,{}),overlay:o(d,{}),mobileControls:o(p.OrientationContainer,{portraitComponent:o(p.Layout,{chat:null,toolbar:o(x,{readMode:!0}),navigation:null,drawer:!B&&M}),landscapeComponent:null}),mobileTopNavigation:H&&o(h,{}),mobileHeaderActionButton:null,mobileHeaderCenter:!B&&o(e,{variant:"h6",sx:{paddingBlock:1},children:L}),sideEffects:null,footer:t(r,{children:[o(c.DesktopReadonlyBanner,{}),o(b,{})]})})};
@@ -1 +1 @@
1
- import{jsx as o,jsxs as m,Fragment as r}from"react/jsx-runtime";import{Typography as t}from"@mui/material";import{match as e}from"ts-pattern";import{customPriceFooterComponent as a,isCustomSummaryComponentSnapshot as i,isSimpleSummaryComponentSnapshot as n}from"#package/domain";import{useFirstRootComponent as s,useIsFullscreenActive as l,useRootEntityPrice as p}from"#package/react-sdk";import{MobileControls as c,MobileControls as f}from"#package/ui-sdk";import{useEnterSidebarSummary as u,useHasSidebarSummary as d,useLeaveSidebarSummary as b,useSidebarSummary as g}from"../../../../configurator-context/index.js";import{LayoutSlots as j}from"../../../configurator-layout/index.js";import{LayoutDialog as y,LayoutFooter as C,SimpleSummary as S}from"../../../phoenix-layout-elements/index.js";import{MobileChat as v}from"../../chat/MobileChat.js";import{FullscreenDesktopToolbar as h}from"../../toolbar/desktop-toolbar/FullscreenDesktopToolbar.js";import{CommonDesktopToolbar as k}from"../common/CommonDesktopToolbar.js";import{CommonFinalizePage as w}from"../common/CommonFinalizePage.js";import{CommonMobileToolbar as x}from"../common/CommonMobileToolbar.js";import{CommonTopNavigation as A}from"../common/CommonTopNavigation.js";import{DefaultViewOnlyMessage as T}from"../common/DefaultViewOnlyMessage.js";import{InvariantViolations as M}from"../common/InvariantViolations.js";import{ReactiveInterfaceLayout as L}from"../common/ReactiveInterfaceLayout.js";import{SideEffects as N}from"../common/SideEffects.js";import{ToolControls as P}from"../common/ToolControls.js";import{ViewControls as E}from"../common/ViewControls.js";import{SimpleMobileHeaderAction as O}from"./SimpleMobileHeaderAction.js";import{SimpleSidebar as V}from"./SimpleSidebar.js";import{SimpleSidebarContent as B}from"./SimpleSidebarContent.js";import{SimpleMobileTopNavigation as D}from"./SimpleTopNavigation.js";export const SimpleOwnerLayout=()=>{let F=s(a),H=d(),{isSummaryActive:I,page:z}=g(),R=e(z).with(null,()=>null).when(i,o=>o.state.page).when(n,m=>o(S,{summary:m.state.items})).otherwise(()=>null),q=u(),G=b(),J=p(),K=l();return o(L,{canvas:o(j.Canvas,{}),sidebar:o(V,{hasSummary:H,isSummaryActive:I,summaryPage:R,price:J,onEnterSummary:q,onLeaveSummary:G,customPriceNode:F?.state.node}),topNavigation:o(A,{}),branding:null,toolbar:o(k,{}),fullScreenToolbar:o(h,{}),viewControls:o(E,{}),toolControls:o(P,{}),overlay:m(r,{children:[o(M,{}),o(w,{}),o(y,{})]}),mobileControls:o(f.OrientationContainer,{portraitComponent:o(f.Layout,{chat:!K&&o(v,{icon:"CustomBigAiAssistant",label:{id:"sdk.chat.mobile.assistant.label",message:"AI Assistant"}}),toolbar:o(x,{}),navigation:null,drawer:!K&&o(B,{summaryPage:R,isSummaryActive:I,onLeaveSummary:G})}),landscapeComponent:o(c.ViewOnlyMode,{message:o(T,{})})}),mobileTopNavigation:!K&&o(D,{}),mobileHeaderActionButton:!K&&o(O,{isSummaryPageActive:I,onEnterSummary:q,hasSummary:H}),mobileHeaderCenter:!K&&o(t,{variant:"h6",sx:{paddingBlock:1},children:J}),sideEffects:o(N,{}),footer:o(C,{})})};
1
+ import{jsx as o,jsxs as m,Fragment as r}from"react/jsx-runtime";import{Typography as t}from"@mui/material";import{match as e}from"ts-pattern";import{customPriceFooterComponent as a,isCustomSummaryComponentSnapshot as i,isSimpleSummaryComponentSnapshot as n}from"#package/domain";import{useFirstRootComponent as s,useIsFullscreenActive as l,useRootEntityPrice as p}from"#package/react-sdk";import{MobileControls as c,MobileControls as f}from"#package/ui-sdk";import{useEnterSidebarSummary as u,useHasSidebarSummary as d,useLeaveSidebarSummary as b,useSidebarSummary as g}from"../../../../configurator-context/index.js";import{SaveMessageSnackbars as j}from"../../../SaveMessageSnackbars.js";import{LayoutSlots as y}from"../../../configurator-layout/index.js";import{LayoutDialog as S,LayoutFooter as v,SimpleSummary as C}from"../../../phoenix-layout-elements/index.js";import{MobileChat as h}from"../../chat/MobileChat.js";import{FullscreenDesktopToolbar as k}from"../../toolbar/desktop-toolbar/FullscreenDesktopToolbar.js";import{CommonDesktopToolbar as w}from"../common/CommonDesktopToolbar.js";import{CommonFinalizePage as x}from"../common/CommonFinalizePage.js";import{CommonMobileToolbar as A}from"../common/CommonMobileToolbar.js";import{CommonTopNavigation as T}from"../common/CommonTopNavigation.js";import{DefaultViewOnlyMessage as M}from"../common/DefaultViewOnlyMessage.js";import{InvariantViolations as L}from"../common/InvariantViolations.js";import{ReactiveInterfaceLayout as N}from"../common/ReactiveInterfaceLayout.js";import{SideEffects as P}from"../common/SideEffects.js";import{ToolControls as E}from"../common/ToolControls.js";import{ViewControls as O}from"../common/ViewControls.js";import{SimpleMobileHeaderAction as V}from"./SimpleMobileHeaderAction.js";import{SimpleSidebar as B}from"./SimpleSidebar.js";import{SimpleSidebarContent as D}from"./SimpleSidebarContent.js";import{SimpleMobileTopNavigation as F}from"./SimpleTopNavigation.js";export const SimpleOwnerLayout=()=>{let H=s(a),I=d(),{isSummaryActive:z,page:R}=g(),q=e(R).with(null,()=>null).when(i,o=>o.state.page).when(n,m=>o(C,{summary:m.state.items})).otherwise(()=>null),G=u(),J=b(),K=p(),Q=l();return o(N,{canvas:o(y.Canvas,{}),sidebar:o(B,{hasSummary:I,isSummaryActive:z,summaryPage:q,price:K,onEnterSummary:G,onLeaveSummary:J,customPriceNode:H?.state.node}),topNavigation:o(T,{}),branding:null,toolbar:o(w,{}),fullScreenToolbar:o(k,{}),viewControls:o(O,{}),toolControls:o(E,{}),overlay:m(r,{children:[o(L,{}),o(j,{}),o(x,{}),o(S,{})]}),mobileControls:o(f.OrientationContainer,{portraitComponent:o(f.Layout,{chat:!Q&&o(h,{icon:"CustomBigAiAssistant",label:{id:"sdk.chat.mobile.assistant.label",message:"AI Assistant"}}),toolbar:o(A,{}),navigation:null,drawer:!Q&&o(D,{summaryPage:q,isSummaryActive:z,onLeaveSummary:J})}),landscapeComponent:o(c.ViewOnlyMode,{message:o(M,{})})}),mobileTopNavigation:!Q&&o(F,{}),mobileHeaderActionButton:!Q&&o(V,{isSummaryPageActive:z,onEnterSummary:G,hasSummary:I}),mobileHeaderCenter:!Q&&o(t,{variant:"h6",sx:{paddingBlock:1},children:K}),sideEffects:o(P,{}),footer:o(v,{})})};