@salsita-ai/sdk 0.50.0-develop.9267bdc12e → 0.50.0-develop.98166fe7c3

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 (554) hide show
  1. package/README.md +14 -13
  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/core/components/component-filter.d.ts +53 -0
  16. package/dist/application-spec/core/components/component-filter.js +1 -0
  17. package/dist/application-spec/core/components/index.d.ts +2 -0
  18. package/dist/application-spec/core/components/index.js +1 -0
  19. package/dist/application-spec/core/components/sdk-code-ref.d.ts +9 -0
  20. package/dist/application-spec/core/components/sdk-code-ref.js +1 -0
  21. package/dist/application-spec/core/enhanced-json-value.d.ts +0 -68
  22. package/dist/application-spec/core/enhanced-json-value.js +1 -1
  23. package/dist/application-spec/core/expressions/index.d.ts +2 -0
  24. package/dist/application-spec/core/expressions/index.js +1 -0
  25. package/dist/application-spec/core/expressions/relation-expression-params.d.ts +11 -0
  26. package/dist/application-spec/core/expressions/relation-expression-params.js +1 -0
  27. package/dist/application-spec/core/expressions/sdk-expression-implementation.d.ts +24 -0
  28. package/dist/application-spec/core/expressions/sdk-expression-implementation.js +1 -0
  29. package/dist/application-spec/core/index.d.ts +2 -0
  30. package/dist/application-spec/core/index.js +1 -1
  31. package/dist/application-spec/core/json-value.d.ts +1 -1
  32. package/dist/application-spec/{core → enhanced-json}/eval-to-constant.d.ts +1 -1
  33. package/dist/application-spec/enhanced-json/index.d.ts +4 -0
  34. package/dist/application-spec/enhanced-json/index.js +1 -0
  35. package/dist/application-spec/enhanced-json/is-enhanced-json-array.d.ts +2 -0
  36. package/dist/application-spec/enhanced-json/is-enhanced-json-array.js +1 -0
  37. package/dist/application-spec/enhanced-json/resolve-enhanced-json-value.d.ts +18 -0
  38. package/dist/application-spec/enhanced-json/resolve-enhanced-json-value.js +1 -0
  39. package/dist/application-spec/enhanced-json/schema-from-value.d.ts +24 -0
  40. package/dist/application-spec/enhanced-json/schema-from-value.js +1 -0
  41. package/dist/application-spec/enhanced-json/stringify-enhanced-json-value.d.ts +14 -0
  42. package/dist/application-spec/enhanced-json/stringify-enhanced-json-value.js +1 -0
  43. package/dist/application-spec/enhanced-json/validate-enhanced-json-value-caps.d.ts +12 -0
  44. package/dist/application-spec/enhanced-json/validate-enhanced-json-value-caps.js +1 -0
  45. package/dist/application-spec/enhanced-json/validate-no-legacy-code-ref.d.ts +13 -0
  46. package/dist/application-spec/enhanced-json/validate-no-legacy-code-ref.js +1 -0
  47. package/dist/application-spec/errors/diagnostic-codes.d.ts +9 -0
  48. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  49. package/dist/application-spec/errors/diagnostic-messages.d.ts +12 -0
  50. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  51. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  52. package/dist/application-spec/generate-application/code/generate-application-code.d.ts +3 -2
  53. package/dist/application-spec/generate-application/code/generate-application-code.js +1 -1
  54. package/dist/application-spec/generate-application/code/project-scaffolding.d.ts +11 -8
  55. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  56. package/dist/application-spec/generate-application/code/standalone-app-files.d.ts +2 -2
  57. package/dist/application-spec/generate-application/code/standalone-app-files.js +1 -1
  58. package/dist/application-spec/generate-application/code/templates/admin-config.js +3 -0
  59. package/dist/application-spec/generate-application/code/templates/configurator-config.js +6 -4
  60. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-component-optics.js +4 -4
  61. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-defaults.js +1 -1
  62. package/dist/application-spec/generate-application/code/templates/eslint-config.d.ts +5 -0
  63. package/dist/application-spec/generate-application/code/templates/eslint-config.js +4 -5
  64. package/dist/application-spec/generate-application/code/templates/frontend-config.js +3 -5
  65. package/dist/application-spec/generate-application/code/templates/gitignore.js +0 -3
  66. package/dist/application-spec/generate-application/code/templates/globals.js +7 -5
  67. package/dist/application-spec/generate-application/code/templates/index.d.ts +3 -1
  68. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  69. package/dist/application-spec/generate-application/code/templates/lingui-rc.d.ts +5 -0
  70. package/dist/application-spec/generate-application/code/templates/lingui-rc.js +4 -4
  71. package/dist/application-spec/generate-application/code/templates/package-json.js +1 -1
  72. package/dist/application-spec/generate-application/code/templates/prettier-config.d.ts +5 -0
  73. package/dist/application-spec/generate-application/code/templates/prettier-config.js +4 -5
  74. package/dist/application-spec/generate-application/code/templates/root-tsconfig.d.ts +6 -0
  75. package/dist/application-spec/generate-application/code/templates/root-tsconfig.js +2 -0
  76. package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -1
  77. package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +1 -1
  78. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  79. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +13 -6
  80. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
  81. package/dist/application-spec/generate-application/code/templates/spec-code/collect-spec-code.d.ts +58 -0
  82. package/dist/application-spec/generate-application/code/templates/spec-code/collect-spec-code.js +1 -0
  83. package/dist/application-spec/generate-application/code/templates/spec-code/index.d.ts +2 -0
  84. package/dist/application-spec/generate-application/code/templates/spec-code/index.js +1 -0
  85. package/dist/application-spec/generate-application/code/templates/spec-code/spec-code.d.ts +18 -0
  86. package/dist/application-spec/generate-application/code/templates/spec-code/spec-code.js +41 -0
  87. package/dist/application-spec/generate-application/code/templates/spec-messages/index.d.ts +1 -0
  88. package/dist/application-spec/generate-application/code/templates/spec-messages/index.js +1 -0
  89. package/dist/application-spec/generate-application/code/templates/spec-messages/spec-messages.d.ts +20 -0
  90. package/dist/application-spec/generate-application/code/templates/spec-messages/spec-messages.js +6 -0
  91. package/dist/application-spec/generate-application/code/templates/tsconfig.d.ts +5 -0
  92. package/dist/application-spec/generate-application/code/templates/tsconfig.js +1 -1
  93. package/dist/application-spec/generate-application/code/templates/webhook-index.d.ts +6 -1
  94. package/dist/application-spec/generate-application/code/templates/webhook-index.js +10 -1
  95. package/dist/application-spec/generate-application/code/templates/webhooks-config.js +2 -3
  96. package/dist/application-spec/generate-application/index.d.ts +2 -0
  97. package/dist/application-spec/generate-application/index.js +1 -1
  98. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +4 -3
  99. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +7 -3
  100. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
  101. package/dist/application-spec/generate-application/runtime/admin-runtime/states-runtime.d.ts +2 -2
  102. package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +13 -5
  103. package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
  104. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +4 -3
  105. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +6 -2
  106. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
  107. package/dist/application-spec/generate-application/runtime/configurator-runtime/states-runtime.d.ts +2 -2
  108. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +43 -0
  109. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.js +1 -0
  110. package/dist/application-spec/generate-application/runtime/factory-data/index.d.ts +3 -0
  111. package/dist/application-spec/generate-application/runtime/factory-data/index.js +1 -0
  112. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.d.ts +13 -0
  113. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +1 -0
  114. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +16 -0
  115. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +1 -0
  116. package/dist/application-spec/generate-application/runtime/migrations/index.d.ts +1 -0
  117. package/dist/application-spec/generate-application/runtime/migrations/index.js +1 -0
  118. package/dist/application-spec/generate-application/runtime/migrations/migration-runtime.d.ts +53 -0
  119. package/dist/application-spec/generate-application/runtime/migrations/migration-runtime.js +1 -0
  120. package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.d.ts +2 -2
  121. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +1 -1
  122. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
  123. package/dist/application-spec/generate-application/runtime/sections/data-runtime.d.ts +4 -4
  124. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +3 -2
  125. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
  126. package/dist/application-spec/generate-application/runtime/sections/theme-runtime.d.ts +2 -2
  127. package/dist/application-spec/generate-application/runtime/sections/transformers-runtime.d.ts +3 -3
  128. package/dist/application-spec/generate-application/runtime-spec/decode-runtime-spec.d.ts +9 -0
  129. package/dist/application-spec/generate-application/runtime-spec/decode-runtime-spec.js +1 -0
  130. package/dist/application-spec/generate-application/runtime-spec/encode-runtime-spec.d.ts +8 -0
  131. package/dist/application-spec/generate-application/runtime-spec/encode-runtime-spec.js +1 -0
  132. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.d.ts +27 -0
  133. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.js +1 -0
  134. package/dist/application-spec/generate-application/runtime-spec/index.d.ts +5 -0
  135. package/dist/application-spec/generate-application/runtime-spec/index.js +1 -0
  136. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +68 -0
  137. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.js +1 -0
  138. package/dist/application-spec/generate-application/runtime-spec/spec-code-id.d.ts +40 -0
  139. package/dist/application-spec/generate-application/runtime-spec/spec-code-id.js +1 -0
  140. package/dist/application-spec/index.d.ts +1 -0
  141. package/dist/application-spec/index.js +1 -1
  142. package/dist/application-spec/parse-application-files/categorize/categorize-files.d.ts +34 -0
  143. package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
  144. package/dist/application-spec/parse-application-files/categorize/earlier-generated-editor-configs.d.ts +16 -0
  145. package/dist/application-spec/parse-application-files/categorize/earlier-generated-editor-configs.js +9 -0
  146. package/dist/application-spec/parse-application-files/categorize/earlier-generated-tsconfig.d.ts +9 -0
  147. package/dist/application-spec/parse-application-files/categorize/earlier-generated-tsconfig.js +1 -0
  148. package/dist/application-spec/parse-application-files/raw-spec/parse-yaml-spec-file.js +1 -1
  149. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +15 -2
  150. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  151. package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
  152. package/dist/application-spec/parse-application-files/spec/application/admin-spec/admin-spec.js +1 -1
  153. package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.js +1 -1
  154. package/dist/application-spec/parse-application-files/spec/common/index.d.ts +1 -0
  155. package/dist/application-spec/parse-application-files/spec/common/index.js +1 -1
  156. package/dist/application-spec/parse-application-files/spec/common/value-type/format-value-type.d.ts +3 -0
  157. package/dist/application-spec/parse-application-files/spec/common/value-type/format-value-type.js +1 -0
  158. package/dist/application-spec/parse-application-files/spec/common/value-type/index.d.ts +5 -0
  159. package/dist/application-spec/parse-application-files/spec/common/value-type/index.js +1 -0
  160. package/dist/application-spec/parse-application-files/spec/common/value-type/intersect-value-types.d.ts +6 -0
  161. package/dist/application-spec/parse-application-files/spec/common/value-type/intersect-value-types.js +1 -0
  162. package/dist/application-spec/parse-application-files/spec/common/value-type/is-assignable-value-type.d.ts +8 -0
  163. package/dist/application-spec/parse-application-files/spec/common/value-type/is-assignable-value-type.js +1 -0
  164. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type-at.d.ts +10 -0
  165. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type-at.js +1 -0
  166. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type.d.ts +98 -0
  167. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type.js +1 -0
  168. package/dist/application-spec/parse-application-files/spec/components/bindings/component-path.d.ts +13 -0
  169. package/dist/application-spec/parse-application-files/spec/components/bindings/component-path.js +1 -0
  170. package/dist/application-spec/parse-application-files/spec/components/bindings/index.d.ts +2 -0
  171. package/dist/application-spec/parse-application-files/spec/components/bindings/index.js +1 -1
  172. package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding-type.d.ts +24 -0
  173. package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding-type.js +1 -0
  174. package/dist/application-spec/parse-application-files/spec/components/component-entry.d.ts +1 -9
  175. package/dist/application-spec/parse-application-files/spec/components/component-entry.js +1 -1
  176. package/dist/application-spec/parse-application-files/spec/components/component-filter.d.ts +1 -54
  177. package/dist/application-spec/parse-application-files/spec/components/component-filter.js +1 -1
  178. package/dist/application-spec/parse-application-files/spec/components/component-state-type.d.ts +8 -0
  179. package/dist/application-spec/parse-application-files/spec/components/component-state-type.js +1 -0
  180. package/dist/application-spec/parse-application-files/spec/components/filter-criterion-types.d.ts +13 -0
  181. package/dist/application-spec/parse-application-files/spec/components/filter-criterion-types.js +1 -0
  182. package/dist/application-spec/parse-application-files/spec/components/index.d.ts +1 -1
  183. package/dist/application-spec/parse-application-files/spec/components/index.js +1 -1
  184. package/dist/application-spec/parse-application-files/spec/components/static-entity-id.d.ts +14 -0
  185. package/dist/application-spec/parse-application-files/spec/components/static-entity-id.js +1 -0
  186. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.d.ts +6 -0
  187. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.js +1 -1
  188. package/dist/application-spec/parse-application-files/spec/components/user-components.d.ts +7 -4
  189. package/dist/application-spec/parse-application-files/spec/components/user-components.js +1 -1
  190. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +24 -0
  191. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.js +1 -0
  192. package/dist/application-spec/parse-application-files/spec/expressions/expression-read.d.ts +13 -0
  193. package/dist/application-spec/parse-application-files/spec/expressions/expression-read.js +1 -0
  194. package/dist/application-spec/parse-application-files/spec/expressions/expression-value-type.d.ts +9 -0
  195. package/dist/application-spec/parse-application-files/spec/expressions/expression-value-type.js +1 -0
  196. package/dist/application-spec/parse-application-files/spec/expressions/expression.d.ts +1 -28
  197. package/dist/application-spec/parse-application-files/spec/expressions/expression.js +1 -1
  198. package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +7 -3
  199. package/dist/application-spec/parse-application-files/spec/expressions/expressions.js +1 -1
  200. package/dist/application-spec/parse-application-files/spec/expressions/index.d.ts +0 -1
  201. package/dist/application-spec/parse-application-files/spec/expressions/index.js +1 -1
  202. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.js +1 -1
  203. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts +3 -1
  204. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.js +1 -1
  205. package/dist/application-spec/parse-application-files/spec/invariants/invariants.d.ts +2 -2
  206. package/dist/application-spec/parse-application-files/spec/invariants/invariants.js +1 -1
  207. package/dist/application-spec/parse-application-files/spec/model/defaults.js +1 -1
  208. package/dist/application-spec/parse-application-files/spec/model/index.d.ts +1 -0
  209. package/dist/application-spec/parse-application-files/spec/model/index.js +1 -1
  210. package/dist/application-spec/parse-application-files/spec/model/model-type-resolution.d.ts +10 -0
  211. package/dist/application-spec/parse-application-files/spec/model/model-type-resolution.js +1 -0
  212. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  213. package/dist/client/phoenix-api.d.ts +463 -0
  214. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +36 -1
  215. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  216. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +7 -1
  217. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  218. package/dist/configurator/application-runtime/extensions/systems/drag-and-drop-system/drag-and-drop-system.d.ts +3 -3
  219. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +17 -3
  220. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  221. package/dist/configurator/application-runtime/extensions/systems/graphql-system/inject-assistant-lenses.d.ts +11 -0
  222. package/dist/configurator/application-runtime/extensions/systems/graphql-system/inject-assistant-lenses.js +1 -0
  223. package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.d.ts +2 -2
  224. package/dist/configurator/common/configurator-interface.d.ts +22 -1
  225. package/dist/configurator/common/configurator-interface.js +1 -1
  226. package/dist/configurator/common/frontend-analytics.d.ts +2 -0
  227. package/dist/configurator/common/frontend-analytics.js +1 -1
  228. package/dist/configurator/common/index.d.ts +2 -0
  229. package/dist/configurator/common/index.js +1 -1
  230. package/dist/configurator/common/use-finalize-action.d.ts +31 -0
  231. package/dist/configurator/common/use-finalize-action.js +1 -0
  232. package/dist/configurator/common/use-reset-camera.d.ts +6 -0
  233. package/dist/configurator/common/use-reset-camera.js +1 -0
  234. package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.d.ts +1 -1
  235. package/dist/configurator/pages/DefaultConfiguratorLayout.d.ts +3 -2
  236. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  237. package/dist/configurator/pages/configurator-layout-name.d.ts +2 -0
  238. package/dist/configurator/pages/configurator-layout-name.js +1 -0
  239. package/dist/configurator/pages/default-configurator-elements.d.ts +8 -0
  240. package/dist/configurator/pages/default-configurator-elements.js +1 -0
  241. package/dist/configurator/pages/default-elements/built-in-entity-element.d.ts +10 -0
  242. package/dist/configurator/pages/default-elements/built-in-entity-element.js +1 -0
  243. package/dist/configurator/pages/default-elements/built-in-layout-element.d.ts +10 -0
  244. package/dist/configurator/pages/default-elements/built-in-layout-element.js +1 -0
  245. package/dist/configurator/pages/default-elements/domain-control-elements.d.ts +6 -0
  246. package/dist/configurator/pages/default-elements/domain-control-elements.js +1 -0
  247. package/dist/configurator/pages/default-elements/index.d.ts +4 -0
  248. package/dist/configurator/pages/default-elements/index.js +1 -0
  249. package/dist/configurator/pages/default-elements/recipe-panel-elements.d.ts +3 -0
  250. package/dist/configurator/pages/default-elements/recipe-panel-elements.js +1 -0
  251. package/dist/configurator/pages/default-elements/sidebar-footer-elements.d.ts +7 -0
  252. package/dist/configurator/pages/default-elements/sidebar-footer-elements.js +1 -0
  253. package/dist/configurator/pages/default-elements/toolbar-elements.d.ts +7 -0
  254. package/dist/configurator/pages/default-elements/toolbar-elements.js +1 -0
  255. package/dist/configurator/pages/index.d.ts +1 -0
  256. package/dist/configurator/pages/index.js +1 -1
  257. package/dist/configurator/scene/scene-controls/hotspot-drag-handle/HotspotDragHandle.d.ts +1 -1
  258. package/dist/configurator/scene/scene-controls/hotspot-drag-handle/HotspotDragSceneHandle.d.ts +1 -1
  259. package/dist/configurator/scene/scene-entity/dimension-indicators/DimensionIndicator.d.ts +1 -1
  260. package/dist/configurator/scene/scene-entity/dimension-indicators/DimensionIndicatorInternal.d.ts +1 -1
  261. package/dist/configurator/scene/scene-entity/drag-and-drop/shared.d.ts +2 -2
  262. package/dist/configurator/scene/scene-entity/drag-and-drop/use-drag-object.d.ts +1 -1
  263. package/dist/configurator/scene/scene-entity/materials/RemoteReplacedMaterial.js +1 -1
  264. package/dist/configurator/scene/scene-entity/objects/SceneEntityObjectTextDecal.d.ts +1 -1
  265. package/dist/configurator/ui/assistant/AssistantChips.d.ts +8 -2
  266. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  267. package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +7 -2
  268. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
  269. package/dist/configurator/ui/assistant/AssistantPanel.js +1 -1
  270. package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
  271. package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.d.ts +13 -0
  272. package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.js +1 -0
  273. package/dist/configurator/ui/assistant/entity-link/entity-link-selection.d.ts +22 -0
  274. package/dist/configurator/ui/assistant/entity-link/entity-link-selection.js +1 -0
  275. package/dist/configurator/ui/assistant/entity-link/entity-link-state.d.ts +27 -0
  276. package/dist/configurator/ui/assistant/entity-link/entity-link-state.js +1 -0
  277. package/dist/configurator/ui/assistant/entity-link/index.d.ts +2 -0
  278. package/dist/configurator/ui/assistant/entity-link/index.js +1 -0
  279. package/dist/configurator/ui/assistant/form/AssistantForm.d.ts +19 -0
  280. package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -0
  281. package/dist/configurator/ui/assistant/form/built-in-form-registry.d.ts +10 -0
  282. package/dist/configurator/ui/assistant/form/built-in-form-registry.js +1 -0
  283. package/dist/configurator/ui/assistant/form/compose-answer.d.ts +11 -0
  284. package/dist/configurator/ui/assistant/form/compose-answer.js +1 -0
  285. package/dist/configurator/ui/assistant/form/describe-build-errors.d.ts +6 -0
  286. package/dist/configurator/ui/assistant/form/describe-build-errors.js +1 -0
  287. package/dist/configurator/ui/assistant/form/form-element-definition.d.ts +14 -0
  288. package/dist/configurator/ui/assistant/form/form-element-definition.js +1 -0
  289. package/dist/configurator/ui/assistant/form/form-model.d.ts +38 -0
  290. package/dist/configurator/ui/assistant/form/form-model.js +1 -0
  291. package/dist/configurator/ui/assistant/form/form-registry.d.ts +31 -0
  292. package/dist/configurator/ui/assistant/form/form-registry.js +8 -0
  293. package/dist/configurator/ui/assistant/form/form-state.d.ts +4 -0
  294. package/dist/configurator/ui/assistant/form/form-state.js +1 -0
  295. package/dist/configurator/ui/assistant/form/index.d.ts +2 -0
  296. package/dist/configurator/ui/assistant/form/index.js +1 -0
  297. package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +9 -0
  298. package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -0
  299. package/dist/configurator/ui/assistant/form/read-form-attributes.d.ts +13 -0
  300. package/dist/configurator/ui/assistant/form/read-form-attributes.js +1 -0
  301. package/dist/configurator/ui/assistant/form-elements/FormGroup.d.ts +3 -0
  302. package/dist/configurator/ui/assistant/form-elements/FormGroup.js +1 -0
  303. package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +3 -0
  304. package/dist/configurator/ui/assistant/form-elements/FormOptions.js +1 -0
  305. package/dist/configurator/ui/assistant/form-elements/FormReply.d.ts +3 -0
  306. package/dist/configurator/ui/assistant/form-elements/FormReply.js +1 -0
  307. package/dist/configurator/ui/assistant/form-elements/FormText.d.ts +3 -0
  308. package/dist/configurator/ui/assistant/form-elements/FormText.js +1 -0
  309. package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +34 -0
  310. package/dist/configurator/ui/assistant/form-elements/form-element-props.js +1 -0
  311. package/dist/configurator/ui/assistant/form-elements/index.d.ts +5 -0
  312. package/dist/configurator/ui/assistant/form-elements/index.js +1 -0
  313. package/dist/configurator/ui/assistant/reference-link/AssistantReferenceLink.d.ts +16 -0
  314. package/dist/configurator/ui/assistant/reference-link/AssistantReferenceLink.js +1 -0
  315. package/dist/configurator/ui/assistant/reference-link/assistant-link-target.d.ts +34 -0
  316. package/dist/configurator/ui/assistant/reference-link/assistant-link-target.js +1 -0
  317. package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.d.ts +25 -0
  318. package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.js +1 -0
  319. package/dist/configurator/ui/assistant/reference-link/index.d.ts +3 -0
  320. package/dist/configurator/ui/assistant/reference-link/index.js +1 -0
  321. package/dist/configurator/ui/assistant/reference-link/reference-styles.d.ts +12 -0
  322. package/dist/configurator/ui/assistant/reference-link/reference-styles.js +1 -0
  323. package/dist/configurator/ui/assistant/reference-link/use-assistant-reference-details.d.ts +8 -0
  324. package/dist/configurator/ui/assistant/reference-link/use-assistant-reference-details.js +1 -0
  325. package/dist/configurator/ui/assistant/streamed-markdown.d.ts +2 -0
  326. package/dist/configurator/ui/assistant/streamed-markdown.js +2 -2
  327. package/dist/configurator/ui/assistant/thread-items.d.ts +8 -1
  328. package/dist/configurator/ui/assistant/thread-items.js +1 -1
  329. package/dist/configurator/ui/configurator-layout/sidebar-keys/index.d.ts +1 -0
  330. package/dist/configurator/ui/configurator-layout/sidebar-keys/index.js +1 -0
  331. package/dist/configurator/ui/configurator-layout/sidebar-keys/sidebar-keys.d.ts +11 -0
  332. package/dist/configurator/ui/configurator-layout/sidebar-keys/sidebar-keys.js +1 -0
  333. package/dist/configurator/ui/configurator-layout/{universal → slots/desktop-sidebar}/DesktopSidebar.d.ts +23 -14
  334. package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/DesktopSidebar.js +16 -0
  335. package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/index.d.ts +1 -0
  336. package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/index.js +1 -0
  337. package/dist/configurator/ui/configurator-layout/slots/services/InvariantViolations.d.ts +4 -4
  338. package/dist/configurator/ui/configurator-layout/slots/services/InvariantViolations.js +1 -1
  339. package/dist/configurator/ui/configurator-layout/slots/services/SideEffects.d.ts +3 -6
  340. package/dist/configurator/ui/configurator-layout/slots/services/SideEffects.js +1 -1
  341. package/dist/configurator/ui/configurator-layout/slots/slots.d.ts +1 -0
  342. package/dist/configurator/ui/configurator-layout/slots/slots.js +1 -1
  343. package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.d.ts +1 -1
  344. package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.js +2 -2
  345. package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.d.ts +2 -2
  346. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.d.ts +2 -2
  347. package/dist/docs/controls/select-child-entity/cardselect.mdx +1 -0
  348. package/dist/docs/dimensions/3d-scene-integration/dimension-indicators.mdx +2 -2
  349. package/dist/docs/dimensions/3d-scene-integration/editable-angle-indicator.mdx +1 -1
  350. package/dist/docs/dimensions/3d-scene-integration/editable-distance-dimension-indicator.mdx +1 -1
  351. package/dist/docs/dimensions/3d-scene-integration/list-selector-dimension-indicator.mdx +1 -1
  352. package/dist/docs/drag-and-drop/drag-handle.mdx +1 -1
  353. package/dist/docs/drag-and-drop/hotspot-handle.mdx +1 -1
  354. package/dist/docs/drag-and-drop/planes.mdx +1 -1
  355. package/dist/docs/drag-and-drop/rotatable.mdx +2 -2
  356. package/dist/docs/fabs/basic.mdx +2 -2
  357. package/dist/docs/index.json +32 -1
  358. package/dist/docs/layouts/custom-layout.mdx +1636 -183
  359. package/dist/docs/layouts/header/fixed.mdx +2 -2
  360. package/dist/docs/layouts/header/floating.mdx +2 -2
  361. package/dist/docs/layouts/sidebar/in-a-custom-layout.mdx +380 -0
  362. package/dist/docs/layouts/sidebar-footer/basic.mdx +32 -77
  363. package/dist/docs/other-features/client-side-rendering/declarative.mdx +1 -1
  364. package/dist/docs/other-features/transformers.mdx +4 -0
  365. package/dist/docs/phoenix/application-states.mdx +9 -7
  366. package/dist/docs/phoenix/components.mdx +6 -0
  367. package/dist/docs/phoenix/configurator-interface.mdx +135 -18
  368. package/dist/docs/phoenix/deployments.mdx +2 -6
  369. package/dist/docs/phoenix/domain-model.mdx +2 -0
  370. package/dist/docs/phoenix/finalization.mdx +1 -1
  371. package/dist/docs/phoenix/getting-started.mdx +2 -1
  372. package/dist/docs/phoenix/layout-slots.mdx +116 -0
  373. package/dist/docs/phoenix/localization.mdx +10 -6
  374. package/dist/docs/phoenix/migration-guide.mdx +21 -8
  375. package/dist/docs/phoenix/phoenix-cli.mdx +51 -11
  376. package/dist/docs/phoenix/project-structure.mdx +33 -13
  377. package/dist/docs/phoenix/sdk-builder-workflow.mdx +2 -2
  378. package/dist/docs/phoenix/testing.mdx +140 -0
  379. package/dist/docs/phoenix/webhooks.mdx +21 -4
  380. package/dist/domain/application/application-config.d.ts +3 -1
  381. package/dist/domain/application/assistant/assistant-fields.d.ts +8 -1
  382. package/dist/domain/application/assistant/assistant-fields.js +1 -1
  383. package/dist/domain/application/assistant/assistant-form-elements.d.ts +28 -0
  384. package/dist/domain/application/assistant/assistant-form-elements.js +1 -0
  385. package/dist/domain/application/assistant/assistant-manifest.d.ts +9 -1
  386. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +11 -1
  387. package/dist/domain/application/assistant/build-assistant-lenses.d.ts +14 -0
  388. package/dist/domain/application/assistant/build-assistant-lenses.js +5 -0
  389. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  390. package/dist/domain/application/assistant/create-assistant-execution-schema.d.ts +32 -0
  391. package/dist/domain/application/assistant/create-assistant-execution-schema.js +1 -0
  392. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  393. package/dist/domain/application/assistant/index.d.ts +5 -1
  394. package/dist/domain/application/assistant/index.js +1 -1
  395. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
  396. package/dist/domain/application/assistant-recipe-groups.d.ts +3 -1
  397. package/dist/domain/application/configurator-builder.d.ts +4 -1
  398. package/dist/domain/application/configurator-builder.js +1 -1
  399. package/dist/domain/core/invariant/violation.d.ts +50 -2
  400. package/dist/domain/core/invariant/violation.js +1 -1
  401. package/dist/domain/core/model/model.d.ts +1 -1
  402. package/dist/domain/core/schema/extended-schema-validator.js +1 -1
  403. package/dist/domain/domain-context/index.d.ts +1 -1
  404. package/dist/domain/domain-context/undo-system.d.ts +28 -1
  405. package/dist/domain/domain-context/undo-system.js +1 -1
  406. package/dist/domain/domain-runtime/spec/initialize.d.ts +11 -0
  407. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  408. package/dist/domain/domain-runtime/spec/selectors.js +1 -1
  409. package/dist/domain/domain-runtime/spec/types.d.ts +2 -0
  410. package/dist/domain/extensions/attribute-switch.d.ts +1 -1
  411. package/dist/domain/extensions/attribute-switch.js +1 -1
  412. package/dist/domain/extensions/canvas-config.d.ts +1 -1
  413. package/dist/domain/extensions/client-side-image.d.ts +2 -2
  414. package/dist/domain/extensions/client-side-image.js +1 -1
  415. package/dist/domain/extensions/common/angle-indicator-schema.d.ts +2 -2
  416. package/dist/domain/extensions/common/dimension-indicator-schema.d.ts +2 -2
  417. package/dist/domain/extensions/editable-angle-indicator.d.ts +1 -1
  418. package/dist/domain/extensions/editable-distance-dimension-indicator.d.ts +1 -1
  419. package/dist/domain/extensions/editable-offset-indicator.d.ts +1 -1
  420. package/dist/domain/extensions/editable-offset-indicator.js +1 -1
  421. package/dist/domain/extensions/fit-selection-orthographic-camera-component.js +1 -1
  422. package/dist/domain/extensions/fit-selection-perspective-camera-component.js +1 -1
  423. package/dist/domain/extensions/horizontal-tabs.d.ts +2 -2
  424. package/dist/domain/extensions/list-selector-dimension-indicator.d.ts +1 -1
  425. package/dist/domain/extensions/navigation-steps.d.ts +2 -2
  426. package/dist/domain/extensions/offset-indicator.js +1 -1
  427. package/dist/domain/extensions/rotation-handle.d.ts +2 -2
  428. package/dist/domain/extensions/save-template-thumbnail.d.ts +2 -2
  429. package/dist/domain/extensions/save-template-thumbnail.js +1 -1
  430. package/dist/domain/extensions/scene-entity-animation.js +1 -1
  431. package/dist/domain/mocks/create-test-application-config.d.ts +59 -0
  432. package/dist/domain/mocks/create-test-application-config.js +1 -0
  433. package/dist/domain/mocks/index.d.ts +1 -0
  434. package/dist/domain/mocks/index.js +1 -1
  435. package/dist/domain/system-components/application-config.d.ts +2 -2
  436. package/dist/domain/system-components/child-entity-selection.js +1 -1
  437. package/dist/domain/system-components/collision-box-geometry.d.ts +4 -2
  438. package/dist/domain/system-components/collision-geometry.d.ts +4 -2
  439. package/dist/domain/system-components/collision-point-geometry.d.ts +4 -2
  440. package/dist/domain/system-components/common/material-override-schema.d.ts +2 -2
  441. package/dist/domain/system-components/common/recipes.d.ts +21 -3
  442. package/dist/domain/system-components/common/recipes.js +1 -1
  443. package/dist/domain/system-components/common/scene-entity-control-schema.d.ts +3 -0
  444. package/dist/domain/system-components/common/scene-entity-control-schema.js +1 -1
  445. package/dist/domain/system-components/constraint.d.ts +10 -23
  446. package/dist/domain/system-components/drag-handle.d.ts +1 -1
  447. package/dist/domain/system-components/drag-handle.js +1 -1
  448. package/dist/domain/system-components/fit-entity-orthographic-camera-component.js +1 -1
  449. package/dist/domain/system-components/fit-entity-perspective-camera-component.js +1 -1
  450. package/dist/domain/system-components/fit-root-orthographic-camera-component.js +1 -1
  451. package/dist/domain/system-components/fit-root-perspective-camera-component.js +1 -1
  452. package/dist/domain/system-components/hotspot-drag-handle.d.ts +1 -1
  453. package/dist/domain/system-components/hotspot-drag-handle.js +1 -1
  454. package/dist/domain/system-components/material-swatch.js +1 -1
  455. package/dist/domain/system-components/scene-entity-material-override.d.ts +1 -1
  456. package/dist/domain/system-components/scene-entity-object-material-override.d.ts +1 -1
  457. package/dist/domain/system-components/scene-entity-object-text-decal.d.ts +1 -1
  458. package/dist/domain/system-components/scene-entity-object-transimissive-material-override.d.ts +1 -1
  459. package/dist/domain/system-components/scene-entity-transimissive-material-override.d.ts +1 -1
  460. package/dist/domain/system-components/static-orthographic-camera-component.js +1 -1
  461. package/dist/domain/system-components/static-perspective-camera-component.js +1 -1
  462. package/dist/globals/index.d.ts +2 -0
  463. package/dist/i18n/locales/cs/messages.js +1 -1
  464. package/dist/i18n/locales/da/messages.js +1 -1
  465. package/dist/i18n/locales/de/messages.js +1 -1
  466. package/dist/i18n/locales/de-AT/messages.js +1 -1
  467. package/dist/i18n/locales/en/messages.js +1 -1
  468. package/dist/i18n/locales/en-AU/messages.js +1 -1
  469. package/dist/i18n/locales/en-GB/messages.js +1 -1
  470. package/dist/i18n/locales/es/messages.js +1 -1
  471. package/dist/i18n/locales/fr/messages.js +1 -1
  472. package/dist/i18n/locales/hu/messages.js +1 -1
  473. package/dist/i18n/locales/it/messages.js +1 -1
  474. package/dist/i18n/locales/nl/messages.js +1 -1
  475. package/dist/i18n/locales/pl/messages.js +1 -1
  476. package/dist/i18n/locales/pt/messages.js +1 -1
  477. package/dist/i18n/locales/ro/messages.js +1 -1
  478. package/dist/i18n/locales/sk/messages.js +1 -1
  479. package/dist/i18n/locales/tr/messages.js +1 -1
  480. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  481. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  482. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +160 -148
  483. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
  484. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
  485. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
  486. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +7 -1
  487. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-admin.js +15 -14
  488. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-configurator.js +14 -12
  489. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +14 -13
  490. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-configurator.js +13 -11
  491. package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
  492. package/dist/phoenix/application-spec/generate-application-spec-story.js +2 -2
  493. package/dist/phoenix/application-spec/project-files.js +1 -1
  494. package/dist/phoenix/bin.d.ts +2 -0
  495. package/dist/phoenix/bin.js +2 -0
  496. package/dist/phoenix/check-configs/built-in-eslint-config.d.ts +9 -0
  497. package/dist/phoenix/check-configs/built-in-eslint-config.js +1 -0
  498. package/dist/phoenix/check-configs/eslint-config.d.ts +10 -0
  499. package/dist/phoenix/check-configs/eslint-config.js +1 -0
  500. package/dist/phoenix/check-configs/index.d.ts +8 -0
  501. package/dist/phoenix/check-configs/index.js +1 -0
  502. package/dist/phoenix/check-configs/typescript-project.d.ts +5 -0
  503. package/dist/phoenix/check-configs/typescript-project.js +1 -0
  504. package/dist/phoenix/cli.d.ts +0 -1
  505. package/dist/phoenix/cli.js +1 -2
  506. package/dist/phoenix/commands/check.js +1 -1
  507. package/dist/phoenix/commands/deploy.js +1 -1
  508. package/dist/phoenix/commands/deps/deps.d.ts +52 -0
  509. package/dist/phoenix/commands/deps/deps.js +3 -0
  510. package/dist/phoenix/commands/deps/index.d.ts +1 -0
  511. package/dist/phoenix/commands/deps/index.js +1 -0
  512. package/dist/phoenix/commands/deps/sdk-manifest.d.ts +12 -0
  513. package/dist/phoenix/commands/deps/sdk-manifest.js +1 -0
  514. package/dist/phoenix/commands/dev.js +5 -5
  515. package/dist/phoenix/commands/fix.js +1 -1
  516. package/dist/phoenix/commands/index.d.ts +1 -0
  517. package/dist/phoenix/commands/index.js +1 -1
  518. package/dist/phoenix/commands/prettier.js +1 -1
  519. package/dist/phoenix/services/application-spec-project-watcher.d.ts +2 -0
  520. package/dist/phoenix/services/application-spec-project-watcher.js +3 -3
  521. package/dist/phoenix/services/lingui.d.ts +8 -0
  522. package/dist/phoenix/services/lingui.js +1 -1
  523. package/dist/phoenix/services/source-archive.d.ts +1 -0
  524. package/dist/phoenix/services/source-archive.js +1 -1
  525. package/dist/phoenix/services/swc.js +1 -1
  526. package/dist/phoenix/services/vite-config.js +1 -1
  527. package/dist/phoenix/utils/index.d.ts +2 -1
  528. package/dist/phoenix/utils/index.js +1 -1
  529. package/dist/phoenix/utils/node-version/index.d.ts +1 -0
  530. package/dist/phoenix/utils/node-version/index.js +1 -0
  531. package/dist/phoenix/utils/node-version/supported-node-version.d.ts +12 -0
  532. package/dist/phoenix/utils/node-version/supported-node-version.js +4 -0
  533. package/dist/phoenix/utils/run-command.d.ts +11 -0
  534. package/dist/phoenix/utils/run-command.js +1 -1
  535. package/dist/phoenix/utils/sdk-tool/index.d.ts +1 -0
  536. package/dist/phoenix/utils/sdk-tool/index.js +1 -0
  537. package/dist/phoenix/utils/sdk-tool/resolve-sdk-tool-bin.d.ts +15 -0
  538. package/dist/phoenix/utils/sdk-tool/resolve-sdk-tool-bin.js +1 -0
  539. package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.d.ts +30 -0
  540. package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.js +1 -0
  541. package/dist/react-sdk/domain-context/index.d.ts +2 -1
  542. package/dist/react-sdk/domain-context/index.js +1 -1
  543. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.d.ts +5 -0
  544. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
  545. package/dist/react-sdk/domain-controls/hooks/use-angle-dimension.d.ts +1 -1
  546. package/dist/ui-sdk/theme/types.d.ts +1 -1
  547. package/package.json +46 -35
  548. package/schema/domain-spec.json +1201 -217
  549. package/dist/application-spec/generate-application/code/templates/webhook-implementation.d.ts +0 -1
  550. package/dist/application-spec/generate-application/code/templates/webhook-implementation.js +0 -7
  551. package/dist/configurator/ui/configurator-layout/universal/DesktopSidebar.js +0 -16
  552. /package/dist/application-spec/{core → enhanced-json}/eval-code-uses-self.d.ts +0 -0
  553. /package/dist/application-spec/{core → enhanced-json}/eval-code-uses-self.js +0 -0
  554. /package/dist/application-spec/{core → enhanced-json}/eval-to-constant.js +0 -0
@@ -47,7 +47,11 @@ export interface AssistantFieldOptions {
47
47
  * means none; `replaceRecipes` lists the same for `meta { replaceRecipes }` and `replaceEntity`;
48
48
  * `fieldOptions` lists, per entity type, the options edges `meta` exposes for its
49
49
  * writable fields, and absent means none; `actions` maps each custom `Mutation` field to the
50
- * declared action it runs, and absent means none. Consumed by the configurator GraphQL system.
50
+ * declared action it runs, and absent means none; `lenses` holds the generated lens fragments, and
51
+ * absent means none: `declarations` is the text the prompt shows, each lens once with its relations
52
+ * spreading the lens itself, and `definitions` the valid GraphQL injected into an operation that
53
+ * spreads a lens, with the copies that unroll each lens to its depth. Consumed by the configurator
54
+ * GraphQL system.
51
55
  */
52
56
  export interface AssistantManifest {
53
57
  readonly sdl: string;
@@ -60,4 +64,8 @@ export interface AssistantManifest {
60
64
  readonly replaceRecipes?: Readonly<Record<string, readonly AssistantRecipeGroup[]>>;
61
65
  readonly fieldOptions?: Readonly<Record<string, readonly AssistantFieldOptions[]>>;
62
66
  readonly actions?: Readonly<Record<string, string>>;
67
+ readonly lenses?: {
68
+ readonly declarations: string;
69
+ readonly definitions: string;
70
+ };
63
71
  }
@@ -15,7 +15,11 @@ export interface AssistantRelationType {
15
15
  readonly target: string;
16
16
  readonly cardinality: '1-1' | '0-1' | '0-N' | '1-N';
17
17
  }
18
- /** A field's source and resolved type, carried in the application bundle without GraphQL instances. */
18
+ /**
19
+ * A field's source and resolved type, carried in the application bundle without GraphQL instances.
20
+ * `lenses` names the lenses the field's own declaration on this alias or type tags it with; a field
21
+ * only inherited from an alias carries none here, since the alias already selects it.
22
+ */
19
23
  export interface AssistantResolvedField {
20
24
  readonly name: string;
21
25
  readonly source: string;
@@ -25,6 +29,7 @@ export interface AssistantResolvedField {
25
29
  } | AssistantRelationType;
26
30
  readonly localized: boolean;
27
31
  readonly description?: string;
32
+ readonly lenses?: readonly string[];
28
33
  }
29
34
  /** Declared UI state values used to describe the navigation query. */
30
35
  export interface AssistantStates {
@@ -46,6 +51,11 @@ export interface AssistantResolvedManifest {
46
51
  readonly replaceRecipes: Readonly<Record<string, AssistantResolvedRecipes>>;
47
52
  readonly optionsEdges: Readonly<Record<string, readonly AssistantResolvedOptionsEdge[]>>;
48
53
  readonly actionFields: readonly AssistantResolvedAction[];
54
+ /** The declared lenses by name: when to use each, and how many levels its tagged relations nest. */
55
+ readonly lenses: Readonly<Record<string, {
56
+ readonly description: string;
57
+ readonly maxDepth: number;
58
+ }>>;
49
59
  }
50
60
  /** Optional mutation input for one stored field, using its exposed name. */
51
61
  export interface AssistantWritableField {
@@ -0,0 +1,14 @@
1
+ import { type GraphQLSchema } from 'graphql';
2
+ import type { AssistantManifest } from './assistant-manifest.js';
3
+ import type { AssistantResolvedManifest } from './assistant-resolved-manifest.js';
4
+ /**
5
+ * Generates the lens fragments of a resolved manifest for the execution schema compiled from it. A
6
+ * declared lens becomes one fragment on `AnyDomainEntity`; one that session narrowing left without a
7
+ * tagged field is dropped, so the agent is never offered a lens that selects nothing. A built-in lens
8
+ * is present only when the schema has its type. A tagged relation spreads the lens itself in the
9
+ * declarations, which GraphQL forbids, so the definitions unroll it into copies down to `maxDepth`,
10
+ * where relations select only `id`. The definitions are checked here against the execution schema,
11
+ * with every declared lens spread on one entity, so a fault in them fails the build and not the
12
+ * operations that spread them.
13
+ */
14
+ export declare const buildAssistantLenses: (resolved: AssistantResolvedManifest, schema: GraphQLSchema) => NonNullable<AssistantManifest['lenses']>;
@@ -0,0 +1,5 @@
1
+ import{NoUnusedFragmentsRule as e,parse as t,specifiedRules as i,validate as n}from"graphql";let s="AnyDomainEntity",r=[{name:"RecipeGroup",description:"A recipe group with its recipes, without their dry-runs.",selections:["groupId","name","description","recipes { ...Recipe }"]},{name:"Recipe",description:"A recipe without its dry-run.",selections:["key","name","description","imageUrl"]},{name:"FieldOption",description:"A value a field accepts, without its dry-run.",selections:["value","name","description","imageUrl","color"]},{name:"DryRun",description:"What a dry-run would do, with the ids of the entities it would change instead of the entities.",selections:["ok","deletedEntityIds","sideEffects","errors { type entityId message }","changedEntities { id }"]}],a=(e,t)=>0===t?e:`${e}__${t}`,l=e=>e.split("\n").map(e=>`# ${e}`.trimEnd()).join("\n"),o=(e,t,i)=>[`fragment ${e} on ${t} {`,...i.map(e=>` ${e}`),"}"].join("\n"),p=(e,t,i)=>{let n=e=>"edge"===e.type.kind?`${e.name} { ${i} }`:e.name;return o(e,s,["id",...t.flatMap(({typeName:e,fields:t})=>e===s?t.map(n):[`... on ${e} {`,...t.map(e=>` ${n(e)}`),"}"])])};export const buildAssistantLenses=(d,m)=>{let c=Object.entries(d.lenses).flatMap(([e,t])=>{let i=[s,...Object.keys(d.aliases).filter(e=>e!==s),...d.entityTypes].flatMap(t=>{let i=(d.fields[t]??[]).filter(t=>t.lenses?.includes(e));return i.length>0?[{typeName:t,fields:i}]:[]});return i.length>0?[{name:e,...t,conditions:i}]:[]}),$=r.filter(({name:e})=>void 0!==m.getType(e)),h=[...c.map(({name:e,description:t,maxDepth:i,conditions:n})=>{let s=n.some(({fields:e})=>e.some(e=>"edge"===e.type.kind));return`${l(s?`${t} ${`Nested relations carry the same selection up to ${i} ${1===i?"level":"levels"}, below that only \`id\`.`}`:t)}
2
+ ${p(e,n,`...${e}`)}`}),...$.map(({name:e,description:t,selections:i})=>`${l(t)}
3
+ ${o(e,e,i)}`)].join("\n\n"),u=[...c.flatMap(({name:e,maxDepth:t,conditions:i})=>Array.from({length:t+1},(n,s)=>p(a(e,s),i,s<t?`...${a(e,s+1)}`:"id"))),...$.map(({name:e,selections:t})=>o(e,e,t))].join("\n\n");if(""!==u){let s=c.length>0?`entities { ${c.map(({name:e})=>`...${e}`).join(" ")} }`:"__typename",r=n(m,t(`${u}
4
+
5
+ { ${s} }`),i.filter(t=>t!==e));if(r.length>0)throw Error(`The lens fragments generated from "assistant.lenses" are not valid GraphQL: ${[...new Set(r.map(e=>e.message))].join(" ")}`)}return{declarations:h,definitions:u}};
@@ -1 +1 @@
1
- import{GraphQLBoolean as e,GraphQLID as t,GraphQLInputObjectType as n,GraphQLInterfaceType as i,GraphQLList as r,GraphQLNonNull as s,GraphQLObjectType as o,GraphQLSchema as a,GraphQLString as p,printSchema as d,validateSchema as c}from"graphql";import{GraphQLJSON as l,createAssistantValueType as h}from"./assistant-value-type.js";let y="AnyDomainEntity",w="RootEntity",u=[["navigationState","Active navigation state.","navigationStates"],["viewState","Active view state.","viewStates"],["toolState","Active tool state.","toolStates"]],g={section:"childRecipes",mutation:"addChild"},f={section:"replaceRecipes",mutation:"replaceEntity"},m=(e,t)=>Object.entries(e).find(([e])=>e===t)?.[1],b=(e,t)=>{if(!t||0===t.length)return e;let n=`One of: ${t.map(e=>`"${e}"`).join(", ")}.`;return e?/[.!?]$/.test(e)?`${e} ${n}`:`${e}. ${n}`:n},v=({target:e,cardinality:t},n)=>{let i=n(e);switch(t){case"1-1":return new s(i);case"0-1":return i;case"0-N":case"1-N":return new s(new r(new s(i)))}},j=(e,n,i)=>{let r={id:{type:new s(t),description:i?`Unique id of the entity, assigned by the configurator, e.g. "${i}-1".`:void 0},type:{type:new s(p),description:i?`Entity type name, e.g. "${i}".`:void 0}};for(let t of e)r[t.name]={type:"edge"===t.type.kind?v(t.type,n):h(t.type.type),description:t.description};return r},$=e=>Object.fromEntries(e.map(({name:e,source:t,localized:n})=>[e,n?{source:t,localized:!0}:{source:t}])),O={sameForAllInstances:e=>`Same recipe groups and recipes for every ${e}.`,constantDuringSession:()=>"Fixed for the session."},E={sameForAllInstances:e=>`Same for every ${e}.`,constantDuringSession:()=>"Fixed for the session."},R=(e,t,n)=>e.map(e=>` ${t[e](n)}`).join(""),k=({section:e},{groups:t,hints:n},{entityType:i,purpose:o,recipeGroup:a})=>{let p=t.filter(({dryRuns:e})=>!e).map(({groupId:e})=>e);return 0===t.length?{}:{[e]:{type:new s(new r(new s(a))),description:`The recipe groups for ${o} this ${i}: ${t.map(({groupId:e})=>e).join(", ")}. A group is listed only while the configurator offers it on the entity.${p.length>0?` Recipes of these groups cannot be dry-run: ${p.join(", ")}.`:""}${R(n,O,i)}`}}},I=({entityType:e,childRecipes:t,replaceRecipes:n,optionsEdges:i},{recipeGroup:a,fieldOption:p})=>new o({name:`${e}Meta`,fields:Object.assign(k(g,t,{entityType:e,purpose:"adding children to",recipeGroup:a}),k(f,n,{entityType:e,purpose:"replacing",recipeGroup:a}),...i.map(({options:{edgeName:t,field:n,validate:i,dryRuns:o},hints:a})=>({[t]:{type:new r(new s(p)),description:`Values "${n}" accepts on this ${e}. Null when there is no choice to make.${i?"":" Not checked on write."}${o?"":" Cannot be dry-run."}${R(a,E,e)}`}})))}),T=e=>Object.entries(e).map(([e,t])=>`${e} (${t.map(({groupId:e})=>e).join(", ")})`);export const buildAssistantManifest=v=>{var O,E,R,k,N;let A,S,D,M,{entityTypes:F,aliases:W,exampleType:C,fields:q,states:x,deletableTypes:G,writableTypes:U,actionFields:K,optionsEdges:P}=v,V=Object.fromEntries(Object.entries(v.childRecipes).map(([e,t])=>[e,t.groups])),z=Object.fromEntries(Object.entries(v.replaceRecipes).map(([e,t])=>[e,t.groups])),Q=new Map,B=new Map,H=new Map,J=e=>{let[t,...n]=Object.entries(W).find(([t])=>t===e)?.[1]??[];return(t&&0===n.length?B.get(t):void 0)??H.get(e)??X},L=e=>B.get(e)??J(e),X=new i({name:y,description:"Every entity of the configuration.",fields:()=>j(q[y]??[],L,C)});for(let e of(H.set(y,X),Object.keys(W)))e!==y&&H.set(e,new i({name:e,interfaces:[X],fields:()=>j(q[e]??[],L)}));let Y={};for(let e of F){let t=[y,...Object.entries(W).filter(([t,n])=>t!==y&&n.includes(e)).map(([e])=>e)],n=q[e]??[];Y[e]=$(n),B.set(e,new o({name:e,interfaces:t.flatMap(e=>H.get(e)??[]),fields:()=>{let t=Q.get(e);return{...j(n,L),...t?{meta:{type:new s(t),description:"What can be done to this entity right now."}}:{}}}}))}let Z=(O=()=>J(H.has(w)?w:y),E=()=>J(y),A=new o({name:"DryRunError",description:"One reason a change cannot be made right now.",fields:{type:{type:new s(p),description:"Kind of the problem."},entityId:{type:t,description:"The entity the problem is on, when it is on one."},message:{type:p,description:"The problem as the user would be told it."}}}),new o({name:"DryRun",description:"What using a recipe or writing an option would do, tried out on the configuration the query reads. Nothing is changed.",fields:()=>({ok:{type:new s(e),description:"Whether the change would succeed on the configuration the query reads."},root:{type:O(),description:"The root entity of the configuration as it would be after the change; null when ok is false. Everything selected under it reads that configuration."},changedEntities:{type:new s(new r(new s(E()))),description:"Entities the change would add or modify; empty when ok is false. One whose id is not in the configuration would be added, and its real id may differ. An entity written to is listed even when its values stay the same."},deletedEntityIds:{type:new s(new r(new s(t))),description:"The ids of the entities the change would remove; empty when ok is false."},sideEffects:{type:new s(new r(new s(p))),description:"The major or unexpected things the configurator would change along with it; empty when ok is false."},errors:{type:new s(new r(new s(A))),description:"Why the change cannot be made; empty when ok is true."}})})),_={recipeGroup:(R=[...Object.keys(V).length>0?[g.mutation]:[],...Object.keys(z).length>0?[f.mutation]:[]],S=R.join(" or "),D=new o({name:"Recipe",description:`${R.includes("addChild")?"One thing that can be added to the entity (under childRecipes)":"One thing the entity can be replaced with (under replaceRecipes)"}${R.length>1?" or that it can be replaced with (under replaceRecipes)":""}.`,fields:{key:{type:new s(p),description:`Pass to ${S} as recipeKey. Valid only for the listing it came from.`},name:{type:new s(p),description:"Name shown to the user."},description:{type:p},imageUrl:{type:p,description:"Thumbnail shown to the user."},dryRun:{type:Z,description:"What using this recipe would do. Null when it cannot be tried."}}}),new o({name:"RecipeGroup",description:"A group of recipes for this entity.",fields:{groupId:{type:new s(p),description:`Pass to ${S} as recipeGroupId.`},name:{type:new s(p),description:"Name shown to the user."},description:{type:p},recipes:{type:new s(new r(new s(D)))}}})),fieldOption:new o({name:"FieldOption",description:"One value a field accepts. Writing a value outside the list is rejected unless the field description says it is not checked.",fields:{value:{type:new s(l),description:"The value to write to the field."},name:{type:p,description:"Name shown to the user."},description:{type:p},imageUrl:{type:p,description:"Image shown to the user."},color:{type:p,description:'Color shown to the user, as "#rrggbb".'},dryRun:{type:Z,description:"What writing this value would do. Null when it cannot be tried."}}})};for(let e of F){let t=m(v.childRecipes,e)??{groups:[],hints:[]},n=m(v.replaceRecipes,e)??{groups:[],hints:[]},i=m(P,e)??[];(t.groups.length>0||n.groups.length>0||i.length>0)&&Q.set(e,I({entityType:e,childRecipes:t,replaceRecipes:n,optionsEdges:i.map(t=>({...t,hints:(W[w]??[]).includes(e)?t.hints.filter(e=>"sameForAllInstances"!==e):t.hints}))},_))}let ee=new a({query:(k=J(H.has(w)?w:y),N=J(y),M=(e=>{let t={};for(let[n,i,r]of u){let o=e[r];o.length>1&&(t[n]={type:new s(p),description:b(i,o)})}if(0!==Object.keys(t).length)return new o({name:"Navigation",description:"The active UI states of the configurator.",fields:t})})(x),new o({name:"Query",fields:{root:{type:new s(k),description:"The root entity of the configuration."},entities:{type:new s(new r(N)),args:{ids:{type:new r(new s(t))}},description:"Every entity, or the given ids in order with null for an unknown id."},selectedEntity:{type:new s(N),description:"The selected entity, or the root entity when nothing is selected."},...M?{navigation:{type:new s(M)}}:{}}})),mutation:(({deletableTypes:e,writableTypes:i,childRecipes:a,replaceRecipes:d,actionFields:c,objectTypes:l,anyDomainEntity:y,targetOutputType:w})=>{let u,g;if(0!==e.length||0!==i.length||0!==Object.keys(a).length||0!==Object.keys(d).length||0!==c.length)return new o({name:"Mutation",fields:Object.assign(0===e.length?{}:{deleteEntity:{type:new s(new r(new s(t))),args:{id:{type:new s(t)}},description:`Deletes the entity and everything composed into it. Deletable types: ${e.join(", ")}. Returns the ids removed, the given one first.`}},0===(u=T(a)).length?{}:{addChild:{type:new s(new r(new s(y))),args:{parentId:{type:new s(t)},recipeGroupId:{type:new s(p)},recipeKey:{type:new s(p)}},description:`Adds a child to the entity parentId from a recipe listed under its meta { childRecipes }. Types with child recipes: ${u.join("; ")}. Returns the entities added, the recipe's own first; empty when they were removed again.`}},0===(g=T(d)).length?{}:{replaceEntity:{type:new s(new r(new s(y))),args:{entityId:{type:new s(t)},recipeGroupId:{type:new s(p)},recipeKey:{type:new s(p)}},description:`Replaces the entity entityId from a recipe listed under its meta { replaceRecipes }. Types with replace recipes: ${g.join("; ")}. The replacement is a new entity: it has a new id and the field values of its recipe, and entityId no longer exists. Returns the entities added, the replacement first; empty when they were removed again.`}},...i.flatMap(e=>{let i=l.get(e.entityType);return i?[(({entityType:e,fields:i},r)=>{let o=Object.fromEntries(i.map(({name:e,type:t,description:n})=>[e,{type:h(t),description:n}]));return{[`modify${e}`]:{type:r,args:{id:{type:new s(t)},delta:{type:new s(new n({name:`${e}Delta`,fields:o}))}},description:`Sets the fields named in delta on one ${e}. Returns the entity after the change, or null when the change removed it.`}}})(e,i)]:[]}),Object.fromEntries(c.map(e=>{var t;return[e.fieldName,{type:new s(new o({name:(t=e.fieldName,`${t.charAt(0).toUpperCase()+t.slice(1)}Result`),description:`What ${e.fieldName} returns, read from the configuration after the change.`,fields:()=>Object.fromEntries(Object.entries(e.result).map(([e,t])=>[e,{type:"edge"===t.kind?(({target:e,list:t,nullable:n},i)=>{let o=t?new r(new s(i(e))):i(e);return n?o:new s(o)})(t,w):h(t.type),description:t.description}]))})),args:Object.fromEntries(Object.entries(e.args).map(([e,t])=>[e,{type:h(t.type),description:t.description}])),description:e.description}]})))})})({deletableTypes:G,writableTypes:U,childRecipes:V,replaceRecipes:z,actionFields:K,objectTypes:B,anyDomainEntity:J(y),targetOutputType:L}),types:[...H.values(),...B.values()]}),et=c(ee);if(et.length>0)throw Error(et.map(e=>e.message).join(" "));return{sdl:d(ee),navigationFields:u.filter(([,,e])=>x[e].length>1).map(([e])=>e),fields:Y,deletableTypes:G,writableFields:Object.fromEntries(U.map(({entityType:e,fields:t})=>[e,Object.fromEntries(t.map(({name:e,property:t})=>[e,t]))])),childRecipes:V,replaceRecipes:z,fieldOptions:Object.fromEntries(F.flatMap(e=>{let t=m(P,e);return t?[[e,t.map(({options:e})=>e)]]:[]})),actions:Object.fromEntries(K.map(({fieldName:e,actionName:t})=>[e,t]))}};
1
+ import{GraphQLBoolean as e,GraphQLID as t,GraphQLInputObjectType as n,GraphQLInterfaceType as i,GraphQLList as r,GraphQLNonNull as s,GraphQLObjectType as o,GraphQLSchema as a,GraphQLString as p,printSchema as d,validateSchema as c}from"graphql";import{GraphQLJSON as l,createAssistantValueType as h}from"./assistant-value-type.js";import{buildAssistantLenses as y}from"./build-assistant-lenses.js";import{createAssistantExecutionSchema as w}from"./create-assistant-execution-schema.js";let u="AnyDomainEntity",m="RootEntity",f=[["navigationState","Active navigation state.","navigationStates"],["viewState","Active view state.","viewStates"],["toolState","Active tool state.","toolStates"]],g={section:"childRecipes",mutation:"addChild"},b={section:"replaceRecipes",mutation:"replaceEntity"},j=(e,t)=>Object.entries(e).find(([e])=>e===t)?.[1],v=(e,t)=>{if(!t||0===t.length)return e;let n=`One of: ${t.map(e=>`"${e}"`).join(", ")}.`;return e?/[.!?]$/.test(e)?`${e} ${n}`:`${e}. ${n}`:n},$=({target:e,cardinality:t},n)=>{let i=n(e);switch(t){case"1-1":return new s(i);case"0-1":return i;case"0-N":case"1-N":return new s(new r(new s(i)))}},O=(e,n,i)=>{let r={id:{type:new s(t),description:i?`Unique id of the entity, assigned by the configurator, e.g. "${i}-1".`:void 0},type:{type:new s(p),description:i?`Entity type name, e.g. "${i}".`:void 0}};for(let t of e)r[t.name]={type:"edge"===t.type.kind?$(t.type,n):h(t.type.type),description:t.description};return r},E=e=>Object.fromEntries(e.map(({name:e,source:t,localized:n})=>[e,n?{source:t,localized:!0}:{source:t}])),R={sameForAllInstances:e=>`Same recipe groups and recipes for every ${e}.`,constantDuringSession:()=>"Fixed for the session."},k={sameForAllInstances:e=>`Same for every ${e}.`,constantDuringSession:()=>"Fixed for the session."},I=(e,t,n)=>e.map(e=>` ${t[e](n)}`).join(""),T=({section:e},{groups:t,hints:n},{entityType:i,purpose:o,recipeGroup:a})=>{let p=t.filter(({dryRuns:e})=>!e).map(({groupId:e})=>e);return 0===t.length?{}:{[e]:{type:new s(new r(new s(a))),description:`The recipe groups for ${o} this ${i}: ${t.map(({groupId:e})=>e).join(", ")}. A group is listed only while the configurator offers it on the entity.${p.length>0?` Recipes of these groups cannot be dry-run: ${p.join(", ")}.`:""}${I(n,R,i)}`}}},N=({entityType:e,childRecipes:t,replaceRecipes:n,optionsEdges:i},{recipeGroup:a,fieldOption:p})=>new o({name:`${e}Meta`,fields:Object.assign(T(g,t,{entityType:e,purpose:"adding children to",recipeGroup:a}),T(b,n,{entityType:e,purpose:"replacing",recipeGroup:a}),...i.map(({options:{edgeName:t,field:n,validate:i,dryRuns:o},hints:a})=>({[t]:{type:new r(new s(p)),description:`Values "${n}" accepts on this ${e}. Null when there is no choice to make.${i?"":" Not checked on write."}${o?"":" Cannot be dry-run."}${I(a,k,e)}`}})))}),A=e=>Object.entries(e).map(([e,t])=>`${e} (${t.map(({groupId:e})=>e).join(", ")})`);export const buildAssistantManifest=$=>{var R,k,I,T,S;let D,M,F,W,{entityTypes:x,aliases:C,exampleType:q,fields:G,states:U,deletableTypes:K,writableTypes:P,actionFields:V,optionsEdges:z}=$,Q=Object.fromEntries(Object.entries($.childRecipes).map(([e,t])=>[e,t.groups])),B=Object.fromEntries(Object.entries($.replaceRecipes).map(([e,t])=>[e,t.groups])),H=new Map,J=new Map,L=new Map,X=e=>{let[t,...n]=Object.entries(C).find(([t])=>t===e)?.[1]??[];return(t&&0===n.length?J.get(t):void 0)??L.get(e)??Z},Y=e=>J.get(e)??X(e),Z=new i({name:u,description:"Every entity of the configuration.",fields:()=>O(G[u]??[],Y,q)});for(let e of(L.set(u,Z),Object.keys(C)))e!==u&&L.set(e,new i({name:e,interfaces:[Z],fields:()=>O(G[e]??[],Y)}));let _={};for(let e of x){let t=[u,...Object.entries(C).filter(([t,n])=>t!==u&&n.includes(e)).map(([e])=>e)],n=G[e]??[];_[e]=E(n),J.set(e,new o({name:e,interfaces:t.flatMap(e=>L.get(e)??[]),fields:()=>{let t=H.get(e);return{...O(n,Y),...t?{meta:{type:new s(t),description:"What can be done to this entity right now."}}:{}}}}))}let ee=(R=()=>X(L.has(m)?m:u),k=()=>X(u),D=new o({name:"DryRunError",description:"One reason a change cannot be made right now.",fields:{type:{type:new s(p),description:"Kind of the problem."},entityId:{type:t,description:"The entity the problem is on, when it is on one."},message:{type:p,description:"The problem as the user would be told it."}}}),new o({name:"DryRun",description:"What using a recipe or writing an option would do, tried out on the configuration the query reads. Nothing is changed.",fields:()=>({ok:{type:new s(e),description:"Whether the change would succeed on the configuration the query reads."},root:{type:R(),description:"The root entity of the configuration as it would be after the change; null when ok is false. Everything selected under it reads that configuration."},changedEntities:{type:new s(new r(new s(k()))),description:"Entities the change would add or modify; empty when ok is false. One whose id is not in the configuration would be added, and its real id may differ. An entity written to is listed even when its values stay the same."},deletedEntityIds:{type:new s(new r(new s(t))),description:"The ids of the entities the change would remove; empty when ok is false."},sideEffects:{type:new s(new r(new s(p))),description:"The major or unexpected things the configurator would change along with it; empty when ok is false."},errors:{type:new s(new r(new s(D))),description:"Why the change cannot be made; empty when ok is true."}})})),et={recipeGroup:(I=[...Object.keys(Q).length>0?[g.mutation]:[],...Object.keys(B).length>0?[b.mutation]:[]],M=I.join(" or "),F=new o({name:"Recipe",description:`${I.includes("addChild")?"One thing that can be added to the entity (under childRecipes)":"One thing the entity can be replaced with (under replaceRecipes)"}${I.length>1?" or that it can be replaced with (under replaceRecipes)":""}.`,fields:{key:{type:new s(p),description:`Pass to ${M} as recipeKey. Valid only for the listing it came from.`},name:{type:new s(p),description:"Name shown to the user."},description:{type:p},imageUrl:{type:p,description:"Thumbnail shown to the user."},dryRun:{type:ee,description:"What using this recipe would do. Null when it cannot be tried."}}}),new o({name:"RecipeGroup",description:"A group of recipes for this entity.",fields:{groupId:{type:new s(p),description:`Pass to ${M} as recipeGroupId.`},name:{type:new s(p),description:"Name shown to the user."},description:{type:p},recipes:{type:new s(new r(new s(F)))}}})),fieldOption:new o({name:"FieldOption",description:"One value a field accepts. Writing a value outside the list is rejected unless the field description says it is not checked.",fields:{value:{type:new s(l),description:"The value to write to the field."},name:{type:p,description:"Name shown to the user."},description:{type:p},imageUrl:{type:p,description:"Image shown to the user."},color:{type:p,description:'Color shown to the user, as "#rrggbb".'},dryRun:{type:ee,description:"What writing this value would do. Null when it cannot be tried."}}})};for(let e of x){let t=j($.childRecipes,e)??{groups:[],hints:[]},n=j($.replaceRecipes,e)??{groups:[],hints:[]},i=j(z,e)??[];(t.groups.length>0||n.groups.length>0||i.length>0)&&H.set(e,N({entityType:e,childRecipes:t,replaceRecipes:n,optionsEdges:i.map(t=>({...t,hints:(C[m]??[]).includes(e)?t.hints.filter(e=>"sameForAllInstances"!==e):t.hints}))},et))}let en=new a({query:(T=X(L.has(m)?m:u),S=X(u),W=(e=>{let t={};for(let[n,i,r]of f){let o=e[r];o.length>1&&(t[n]={type:new s(p),description:v(i,o)})}if(0!==Object.keys(t).length)return new o({name:"Navigation",description:"The active UI states of the configurator.",fields:t})})(U),new o({name:"Query",fields:{root:{type:new s(T),description:"The root entity of the configuration."},entities:{type:new s(new r(S)),args:{ids:{type:new r(new s(t))}},description:"Every entity, or the given ids in order with null for an unknown id."},selectedEntity:{type:new s(S),description:"The selected entity, or the root entity when nothing is selected."},...W?{navigation:{type:new s(W)}}:{}}})),mutation:(({deletableTypes:e,writableTypes:i,childRecipes:a,replaceRecipes:d,actionFields:c,objectTypes:l,anyDomainEntity:y,targetOutputType:w})=>{let u,m;if(0!==e.length||0!==i.length||0!==Object.keys(a).length||0!==Object.keys(d).length||0!==c.length)return new o({name:"Mutation",fields:Object.assign(0===e.length?{}:{deleteEntity:{type:new s(new r(new s(t))),args:{id:{type:new s(t)}},description:`Deletes the entity and everything composed into it. Deletable types: ${e.join(", ")}. Returns the ids removed, the given one first.`}},0===(u=A(a)).length?{}:{addChild:{type:new s(new r(new s(y))),args:{parentId:{type:new s(t)},recipeGroupId:{type:new s(p)},recipeKey:{type:new s(p)}},description:`Adds a child to the entity parentId from a recipe listed under its meta { childRecipes }. Types with child recipes: ${u.join("; ")}. Returns the entities added, the recipe's own first; empty when they were removed again.`}},0===(m=A(d)).length?{}:{replaceEntity:{type:new s(new r(new s(y))),args:{entityId:{type:new s(t)},recipeGroupId:{type:new s(p)},recipeKey:{type:new s(p)}},description:`Replaces the entity entityId from a recipe listed under its meta { replaceRecipes }. Types with replace recipes: ${m.join("; ")}. The replacement is a new entity: it has a new id and the field values of its recipe, and entityId no longer exists. Returns the entities added, the replacement first; empty when they were removed again.`}},...i.flatMap(e=>{let i=l.get(e.entityType);return i?[(({entityType:e,fields:i},r)=>{let o=Object.fromEntries(i.map(({name:e,type:t,description:n})=>[e,{type:h(t),description:n}]));return{[`modify${e}`]:{type:r,args:{id:{type:new s(t)},delta:{type:new s(new n({name:`${e}Delta`,fields:o}))}},description:`Sets the fields named in delta on one ${e}. Returns the entity after the change, or null when the change removed it.`}}})(e,i)]:[]}),Object.fromEntries(c.map(e=>{var t;return[e.fieldName,{type:new s(new o({name:(t=e.fieldName,`${t.charAt(0).toUpperCase()+t.slice(1)}Result`),description:`What ${e.fieldName} returns, read from the configuration after the change.`,fields:()=>Object.fromEntries(Object.entries(e.result).map(([e,t])=>[e,{type:"edge"===t.kind?(({target:e,list:t,nullable:n},i)=>{let o=t?new r(new s(i(e))):i(e);return n?o:new s(o)})(t,w):h(t.type),description:t.description}]))})),args:Object.fromEntries(Object.entries(e.args).map(([e,t])=>[e,{type:h(t.type),description:t.description}])),description:e.description}]})))})})({deletableTypes:K,writableTypes:P,childRecipes:Q,replaceRecipes:B,actionFields:V,objectTypes:J,anyDomainEntity:X(u),targetOutputType:Y}),types:[...L.values(),...J.values()]}),ei=c(en);if(ei.length>0)throw Error(ei.map(e=>e.message).join(" "));let er=d(en);return{sdl:er,navigationFields:f.filter(([,,e])=>U[e].length>1).map(([e])=>e),fields:_,deletableTypes:K,writableFields:Object.fromEntries(P.map(({entityType:e,fields:t})=>[e,Object.fromEntries(t.map(({name:e,property:t})=>[e,t]))])),childRecipes:Q,replaceRecipes:B,fieldOptions:Object.fromEntries(x.flatMap(e=>{let t=j(z,e);return t?[[e,t.map(({options:e})=>e)]]:[]})),actions:Object.fromEntries(V.map(({fieldName:e,actionName:t})=>[e,t])),lenses:y($,w(er))}};
@@ -0,0 +1,32 @@
1
+ import { type GraphQLSchema } from 'graphql';
2
+ /** One entity type or alias exposing a field, with the field's type as the assistant schema prints it. */
3
+ export interface AssistantFieldExposure {
4
+ readonly typeName: string;
5
+ readonly type: string;
6
+ }
7
+ /**
8
+ * Entity types or aliases expose one field name in shapes no selection can hold together: a single
9
+ * entity, a list of entities and a plain value cannot share a name. GraphQL rejects every operation
10
+ * that selects the field on both, and no common type exists to widen them to. `exposures` lists the
11
+ * aliases and types that declare the field, without the members that only repeat an alias's field.
12
+ */
13
+ export declare class AssistantFieldClashError extends Error {
14
+ readonly fieldName: string;
15
+ readonly exposures: readonly AssistantFieldExposure[];
16
+ constructor(fieldName: string, exposures: readonly AssistantFieldExposure[]);
17
+ }
18
+ /**
19
+ * Compiles the schema operations are validated and executed against from the assistant SDL the agent
20
+ * reads. GraphQL requires fields selected under one name to have the same type, nullability included,
21
+ * even on entity types that can never be the same entity, so a lens or a hand-written selection that
22
+ * reaches such a field on two types would be rejected although its result is unambiguous. The
23
+ * execution schema therefore widens the type of every field name that entity types and aliases
24
+ * expose with different types, and leaves everything else as it is. It accepts every operation the
25
+ * SDL accepts and some the SDL would reject; the SDL stays the precise description of the data.
26
+ * Accepted: a widened field no longer enforces its SDL type on the value it resolves to. A null in a
27
+ * field the SDL declares non-null is returned as null instead of failing the operation, and a field
28
+ * widened to `JSON` is returned as it is, without the coercion of its scalar. Values that match their
29
+ * SDL type, which is every value a valid configuration holds, give the same result. Throws
30
+ * {@link AssistantFieldClashError} for the shapes nothing can widen.
31
+ */
32
+ export declare const createAssistantExecutionSchema: (sdl: string) => GraphQLSchema;
@@ -0,0 +1 @@
1
+ import{Kind as e,buildASTSchema as t,parse as n,print as a}from"graphql";let i="AnyDomainEntity",l="JSON",s=new Set(["Int","Float","String","Boolean","ID",l]);export class AssistantFieldClashError extends Error{fieldName;exposures;constructor(e,t){super(`The field "${e}" cannot be selected on every entity type that has it: ${t.map(({typeName:t,type:n})=>`${t}.${e} is ${n}`).join(", ")}.`),this.fieldName=e,this.exposures=t,this.name="AssistantFieldClashError"}}let r=t=>(t.kind===e.OBJECT_TYPE_DEFINITION||t.kind===e.INTERFACE_TYPE_DEFINITION)&&(t.name.value===i||(t.interfaces??[]).some(({name:e})=>e.value===i)),o=t=>t.kind===e.NON_NULL_TYPE?t.type:t,m=t=>t.kind===e.NAMED_TYPE?t.name.value:m(t.type),u=e=>a(e).replace(m(e),""),p={kind:e.NAMED_TYPE,name:{kind:e.NAME,value:l}},d=(t,n)=>{let i=n.map(({type:e})=>e);if(1===new Set(i.map(e=>a(e))).size)return;let l=i.map(e=>s.has(m(e)));if(l.every(Boolean))return 1===new Set(i.map(e=>a(o(e)))).size?"nullable":"json";if(!l.some(Boolean)){if(1===new Set(i.map(u)).size)return;if(i.every(t=>o(t).kind===e.NAMED_TYPE))return"nullable"}throw new AssistantFieldClashError(t,n.filter(({inherited:e})=>!e).map(({typeName:e,type:t})=>({typeName:e,type:a(t)})))};export const createAssistantExecutionSchema=a=>t((t=>{let n=t.definitions.filter(r),a=(e,t)=>n.some(n=>n.name.value===e&&(n.fields??[]).some(e=>e.name.value===t)),i=new Map;for(let e of n)for(let t of e.fields??[])i.set(t.name.value,[...i.get(t.name.value)??[],{typeName:e.name.value,type:t.type,inherited:(e.interfaces??[]).some(({name:e})=>a(e.value,t.name.value))}]);let s=new Map;for(let[e,t]of i){let n=d(e,t);n&&s.set(e,n)}let m=e=>{let t=s.get(e.name.value);return t?{...e,type:"json"===t?p:o(e.type)}:e},u=t.definitions.map(e=>r(e)?{...e,fields:e.fields?.map(m)}:e),f=u.some(t=>t.kind===e.SCALAR_TYPE_DEFINITION&&t.name.value===l),E=[...s.values()].includes("json");return{...t,definitions:E&&!f?[...u,{kind:e.SCALAR_TYPE_DEFINITION,name:{kind:e.NAME,value:l}}]:u}})(n(a)));
@@ -1 +1 @@
1
- export const generateAssistantPrompt=e=>{let t=Object.values(e.childRecipes??{}).some(e=>e.length>0),a=Object.values(e.replaceRecipes??{}).some(e=>e.length>0),n=Object.values(e.fieldOptions??{}).some(e=>e.length>0),s=Object.keys(e.actions??{}).length>0,i=(e.deletableTypes?.length??0)>0||Object.values(e.writableFields??{}).some(e=>Object.keys(e).length>0)||t||a||s,o=t||a||n,h=[...t?["`childRecipes` is what can be added to it"]:[],...a?["`replaceRecipes` what it can be replaced with"]:[],...n?["`<field>Options` the values a field accepts"]:[]],r=["`selected`",...(e.navigationFields??[]).map(e=>`\`${e}\``)].join(", ");return[["Tools","- Put related operations in one call and select only the fields you need.",...i?[`- Use a mutation inside \`query\` to answer a what-if about a change ${o?"the lists under `meta` do not show":"before making it"}.`,"- Use `apply` only for what the user asked for."]:["- Nothing in this configurator can be changed through you. Say so when the user asks for a change."],"- When an operation fails, its `errors` say why and what to send instead."],...i?[["After a change","- A change is made only when the `apply` result has `committed: true`. Otherwise `errors` or `message` says what happened; without either, nothing changed. Never say a change was made when it was not.","- `sideEffects` names the major or unexpected things the configurator changed along with your change. Tell the user about them when committed; otherwise they describe what would happen. Smaller adjustments are not listed.","- A mutation returns the state after the change: use the ids and values it returned, not the ones you sent.",...s?["- When one mutation does the whole of what the user asked, use it instead of building the same change from several others."]:[]]]:[],...o?[["What can be done to an entity",`- \`meta\` lists what is possible right now: ${h.join(", ")}. Read the list before such a change and before telling the user what is available.`,`- You can select \`dryRun\` on ${[...t||a?["recipes"]:[],...n?["options"]:[]].join(" or ")} to look ahead and pick one that meets what the user asked for. It is optional before a change.`,"- Read the lists again after a change, unless their descriptions say they stay the same."]]:[],["The `[changes]` block","- Every user message starts with it: a glimpse of what the user did in the configurator since your last turn.",`- \`[changes: none]\`, or only ${r} lines: what you know still holds. Do not query it again.`,"- Other lines are a hint at what to read again: `A` added, `D` deleted, `M` modified with the fields. Text after `#` says what caused the line; `reset: undo/redo` says the user undid or redid changes.","- Read computed fields again when a listed change may affect them.","- `[changes: unavailable]` and `[changes: too many (n)]`: read again before relying on anything you read earlier.",...i?["- Your applied changes are not listed, except those waiting for user approval: they appear once approved."]:[]],["Reading the schema","- Take ids from results.",...(e.deletableTypes?.length??0)>0||a?["- The id of a deleted or replaced entity is gone and may later be given to another entity."]:[],`- A field whose name starts with \`_\` is computed: read it${i?", never write it":""}.`,"- Numbers are in the unit the field description names. Convert when the user uses another unit."]].map(e=>e.join("\n")).join("\n\n")};
1
+ import{ASSISTANT_BUILT_IN_FORM_ELEMENTS as e}from"./assistant-form-elements.js";let t=[["Containers",["group","choice","choices"]],["Options",["option"]],["Inputs",["input"]]];export const generateAssistantPrompt=a=>{let n=Object.values(a.childRecipes??{}).some(e=>e.length>0),i=Object.values(a.replaceRecipes??{}).some(e=>e.length>0),s=Object.values(a.fieldOptions??{}).some(e=>e.length>0),o=Object.keys(a.actions??{}).length>0,r=(a.deletableTypes?.length??0)>0||Object.values(a.writableFields??{}).some(e=>Object.keys(e).length>0)||n||i||o,h=n||i||s,l=[...n?["`childRecipes` is what can be added to it"]:[],...i?["`replaceRecipes` what it can be replaced with"]:[],...s?["`<field>Options` the values a field accepts"]:[]],d=["`selected`",...(a.navigationFields??[]).map(e=>`\`${e}\``)].join(", ");return[["Tools","- Put related operations in one call and select only the fields you need.",...r?[`- Use a mutation inside \`query\` to answer a what-if about a change ${h?"the lists under `meta` do not show":"before making it"}.`,"- Use `apply` only for what the user asked for."]:["- Nothing in this configurator can be changed through you. Say so when the user asks for a change."],"- When an operation fails, its `errors` say why and what to send instead."],...r?[["After a change","- A change is made only when the `apply` result has `committed: true`. Otherwise `errors` or `message` says what happened; without either, nothing changed. Never say a change was made when it was not.","- `sideEffects` names the major or unexpected things the configurator changed along with your change. Tell the user about them when committed; otherwise they describe what would happen. Smaller adjustments are not listed.","- A mutation returns the state after the change: use the ids and values it returned, not the ones you sent.",...o?["- When one mutation does the whole of what the user asked, use it instead of building the same change from several others."]:[]]]:[],...h?[["What can be done to an entity",`- \`meta\` lists what is possible right now: ${l.join(", ")}. Read the list before such a change and before telling the user what is available.`,`- You can select \`dryRun\` on ${[...n||i?["recipes"]:[],...s?["options"]:[]].join(" or ")} to look ahead and pick one that meets what the user asked for. It is optional before a change.`,"- Read the lists again after a change, unless their descriptions say they stay the same."]]:[],["The `[changes]` block","- Every user message starts with it: a glimpse of what the user did in the configurator since your last turn.",`- \`[changes: none]\`, or only ${d} lines: what you know still holds. Do not query it again.`,"- Other lines are a hint at what to read again: `A` added, `D` deleted, `M` modified with the fields. Text after `#` says what caused the line; `reset: undo/redo` says the user undid or redid changes.","- Read computed fields again when a listed change may affect them.","- `[changes: unavailable]` and `[changes: too many (n)]`: read again before relying on anything you read earlier.",...r?["- Your applied changes are not listed, except those waiting for user approval: they appear once approved."]:[]],["Reading the schema","- Take ids from results.",...(a.deletableTypes?.length??0)>0||i?["- The id of a deleted or replaced entity is gone and may later be given to another entity."]:[],`- A field whose name starts with \`_\` is computed: read it${r?", never write it":""}.`,"- Numbers are in the unit the field description names. Convert when the user uses another unit."],["Links","- You may link an entity of the current configuration when you speak about that very entity: `[the left burner](entity:CookingTop-1)`. It helps the user find it in the configurator.",...h?["- Whenever you name recipes or options you read from `meta`, in a list, a table or a sentence, link each one: `[Single gas burner](recipe:KitchenRange-1/top/gas_single)` or `[Oak](option:Cabinet-2/finishOptions/oak)`. The link shows the user its picture or color and its description, so never draw previews yourself. The target is the entity id, the recipe group id or the options field you read, and the key or value, each encoded as in a URL."]:[]],["Replies","- Write Markdown only, never HTML: the panel does not render it."],["Forms","- To ask the user something they answer by picking or typing, end your reply with a form: a fenced code block with the language `form`. It holds only elements, written as lowercase tags with string attributes, without Markdown or text.","- Every element takes `label`, the text the user sees; on a container or an input it also names the answer. Options and inputs take `value`: an option sends it instead of its label, and an input starts with it.","- Options can also stand on their own, outside a `choice` or `choices`.","- An element or attribute not listed here, or an element other than an option inside a `choice` or `choices`, makes the whole form fail.","- The answer is the user's next message. Each container or input gives a line `Label: value`, or the bare value without a label; the lines of a labelled container are indented by two spaces under it, a `choices` lists each picked option on its own line, and `—` marks what was left unanswered.",'- Example: `<choice label="Plinth"><reply label="Black" /><reply label="Oak" /></choice>` is answered with `Plinth: Oak`.',...t.flatMap(([t,a])=>{let n=e.filter(({role:e})=>a.includes(e));return 0===n.length?[]:[`- ${t}:`,...n.map(e=>` - \`${(({name:e,role:t,attributes:a})=>{let n=["label",..."option"===t||"input"===t?["value"]:[],...Object.keys(a)];return"option"===t||"input"===t?`<${e} ${n.join(" ")} />`:`<${e} ${n.join(" ")}>…</${e}>`})(e)}\`: ${e.description}`)]})],...a.lenses?.declarations?[["Built-in fragments","- These fragments are already defined for every operation. Spread one by name on a field of its type, as in `field { ...FragmentName }`, instead of listing its fields.","- A fragment is a starting selection: add the other fields you need next to the spread, by name from the schema.","- Never define a fragment with one of these names.","",a.lenses.declarations]]:[]].map(e=>e.join("\n")).join("\n\n")};
@@ -1,7 +1,11 @@
1
1
  export { ASSISTANT_HINTS } from './assistant-resolved-manifest.js';
2
2
  export type { AssistantResolvedManifest, AssistantDeclaredField, AssistantDeclarations, AssistantDeclaredWrite, AssistantResolvedField, AssistantValueType, AssistantRelationType, AssistantStates, AssistantWritableType, AssistantWritableField, AssistantResolvedHint, AssistantResolvedRecipes, AssistantResolvedOptionsEdge, AssistantResolvedAction, AssistantResolvedActionResult, } from './assistant-resolved-manifest.js';
3
3
  export { buildAssistantManifest } from './build-assistant-manifest.js';
4
+ export type { AssistantFieldExposure } from './create-assistant-execution-schema.js';
5
+ export { AssistantFieldClashError, createAssistantExecutionSchema } from './create-assistant-execution-schema.js';
4
6
  export type { AssistantFieldSource, AssistantRecipeGroup, AssistantFieldOptions, AssistantManifest, } from './assistant-manifest.js';
5
7
  export { generateAssistantPrompt } from './generate-assistant-prompt.js';
6
8
  export * from './session-setup/index.js';
7
- export { describeAssistantValues, mergeAssistantFields } from './assistant-fields.js';
9
+ export { describeAssistantValues, mergeAssistantFields, resolveAssistantField } from './assistant-fields.js';
10
+ export { ASSISTANT_BUILT_IN_FORM_ELEMENTS } from './assistant-form-elements.js';
11
+ export type { AssistantFormAttribute, AssistantFormElementDescriptor, AssistantFormRole, } from './assistant-form-elements.js';
@@ -1 +1 @@
1
- export{ASSISTANT_HINTS}from"./assistant-resolved-manifest.js";export{buildAssistantManifest}from"./build-assistant-manifest.js";export{generateAssistantPrompt}from"./generate-assistant-prompt.js";export*from"./session-setup/index.js";export{describeAssistantValues,mergeAssistantFields}from"./assistant-fields.js";
1
+ export{ASSISTANT_HINTS}from"./assistant-resolved-manifest.js";export{buildAssistantManifest}from"./build-assistant-manifest.js";export{AssistantFieldClashError,createAssistantExecutionSchema}from"./create-assistant-execution-schema.js";export{generateAssistantPrompt}from"./generate-assistant-prompt.js";export*from"./session-setup/index.js";export{describeAssistantValues,mergeAssistantFields,resolveAssistantField}from"./assistant-fields.js";export{ASSISTANT_BUILT_IN_FORM_ELEMENTS}from"./assistant-form-elements.js";
@@ -1 +1 @@
1
- import{ASSISTANT_AI_PROVIDERS as e,ASSISTANT_MODEL_TIERS as t,ASSISTANT_REASONING_LEVELS as i}from"@salsita-ai/contracts/assistant";import{describeAssistantValues as s,mergeAssistantFields as n}from"../assistant-fields.js";import{ASSISTANT_HINTS as o}from"../assistant-resolved-manifest.js";import{projectAssistantSetupManifest as a}from"./assistant-setup-manifest.js";export class AssistantSetupError extends Error{constructor(e,t){super(`${e}: ${t}`),this.name="AssistantSetupError"}}let r=(e,t)=>{throw new AssistantSetupError(e,t)},l=(e,t,i)=>{for(let s of((null===t||"object"!=typeof t||Array.isArray(t))&&r(i,"expected an object; omit an entry to remove it"),Object.keys(t)))Object.hasOwn(e,s)||r(`${i}.${s}`,"not declared in the spec; remove this key")},p=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0,d=(e,t,i)=>(void 0!==e&&"string"!=typeof e&&r(`${i}.description`,"expected a string"),e??t),c=(e,t,i)=>(void 0!==e&&!1!==e&&r(`${i}.allowDryRuns`,"can only disable dry-runs; omit this flag or set false"),!1!==e&&t);export const applyAssistantSetup=(u,f,m)=>{if(null===m)return null;let b=a(u,f),y=u.declarations;l({entities:{},deletable:{},writable:{},childRecipes:{},replaceRecipes:{},actions:{},instructions:"",ai:{}},m,"assistant"),l(b.entities,m.entities,"assistant.entities"),l(b.deletable,m.deletable,"assistant.deletable"),l(b.writable,m.writable,"assistant.writable"),l(b.actions,m.actions,"assistant.actions");let g=Object.fromEntries(Object.entries(m.entities).map(([e,t])=>{let i=`assistant.entities.${e}`;l(b.entities[e],t,i);let n=y.entities[e];return[e,Object.entries(t).map(([e,t])=>{l({description:""},t,`${i}.${e}`);let o=n.find(t=>t.source===e),a=d(t.description,o.valueDescription,`${i}.${e}`);return{...o,valueDescription:a,description:s(a,o.enumValues),describedByManifest:void 0!==t.description||o.describedByManifest}})]})),v=(e,t,i)=>r(`assistant.entities.${e}`,`conflicting sources ${t} and ${i}`),w=n([],p(g,"AnyDomainEntity")??[],()=>void 0,v),$=new Map([["AnyDomainEntity",w]]);for(let e of Object.keys(u.aliases))"AnyDomainEntity"!==e&&$.set(e,n([w],p(g,e)??[],()=>void 0,v));for(let e of u.entityTypes){let t=Object.entries(u.aliases).filter(([t,i])=>"AnyDomainEntity"!==t&&i.includes(e));$.set(e,n([w,...t.map(([e])=>$.get(e)??[])],p(g,e)??[],t=>y.enumValues[e]?.[t],v))}let h=Object.fromEntries([...$].map(([e,t])=>[e,t.map(e=>({name:e.name,source:e.source,localized:e.localized,type:e.type,...void 0===e.description?{}:{description:e.description}}))])),j=new Map,O=new Map;for(let[e,t]of Object.entries(m.writable)){let i=`assistant.writable.${e}`;for(let[s,n]of(l(b.writable[e],t,i),Object.entries(t))){let t=`${i}.${s}`,o=y.writable[e][s];for(let[e,{field:i,options:a,exposedDescription:d}]of(l(Object.values(o.members).some(e=>e.options)?{options:{}}:{},n,t),void 0!==n.options&&(l({validate:!0,allowDryRuns:!1},n.options,`${t}.options`),void 0!==n.options.validate&&!0!==n.options.validate&&r(`${t}.options.validate`,"can only enable validation; omit this flag or set true"),c(n.options.allowDryRuns,!0,`${t}.options`)),Object.entries(o.members))){let l=p(g,e)?.find(e=>e.source===s)?.name??$.get(e)?.find(e=>e.source===s)?.name,u=l??s;void 0===l&&$.get(e)?.some(e=>e.name===s&&e.source!==s)&&r(t,`narrowing leaves ${e}.${s} bound to another read field; retain its original exposure or remove this writable property`);let f=j.get(e)??new Map;if([...f.values()].some(e=>e.name===u&&e.property!==s)&&r(t,`narrowing maps multiple writable properties to ${e}.${u}; retain their original exposures or remove the conflicting property`),f.has(s)||f.set(s,{...i,name:u,...void 0===l?{}:{description:d}}),j.set(e,f),a){let i=o.defaultOptionsName?`${u}Options`:a.options.edgeName;O.get(e)?.some(e=>e.options.edgeName===i||e.options.field===u)&&r(`${t}.options`,`narrowing duplicates options edge ${e}.${i}; retain the original field exposures or remove the conflicting writable declaration`),O.set(e,[...O.get(e)??[],{hints:a.hints,options:{...a.options,field:u,edgeName:i,validate:n.options?.validate??a.options.validate,dryRuns:c(n.options?.allowDryRuns,a.options.dryRuns,`${t}.options`)}}])}}}}for(let[e,t]of Object.entries(u.optionsEdges))for(let i of t){let t=u.writableTypes.find(t=>t.entityType===e)?.fields.find(e=>e.name===i.options.field)?.property;if(i.options.validate&&t&&j.get(e)?.has(t)&&!O.get(e)?.some(i=>i.options.field===j.get(e)?.get(t)?.name&&i.options.validate)){let i=Object.keys(m.writable).find(i=>Object.hasOwn(m.writable[i],t)&&y.writable[i]?.[t]?.members[e]);r(`assistant.writable.${i}.${t}`,`cannot remove declared validation while another declaration keeps ${e}.${t} writable; remove all writable declarations for it`)}}let x=e=>{l(b[e],m[e],`assistant.${e}`);let t=new Map;for(let[i,s]of Object.entries(m[e])){let n=`assistant.${e}.${i}`;l({groups:{}},s,n),l(b[e][i].groups,s.groups,`${n}.groups`);let a=y[e][i],r=Object.entries(s.groups).map(([e,t])=>{let i=`${n}.groups.${e}`;l({description:"",allowDryRuns:!1},t,i);let s=a.groups.find(t=>t.instanceName===e);return{...s,description:d(t.description,s.description,i),dryRuns:c(t.allowDryRuns,s.dryRuns,i)}});for(let e of u.entityTypes.includes(i)?[i]:u.aliases[i]??[]){let i=t.get(e);t.set(e,{groups:[...i?.groups??[],...r],hints:o.filter(e=>a.hints.includes(e)||i?.hints.includes(e))})}}return Object.fromEntries(u.entityTypes.flatMap(e=>{let i=t.get(e);return i?.groups.length?[[e,i]]:[]}))};for(let[e,t]of Object.entries(m.deletable))l({},t,`assistant.deletable.${e}`);let R=new Set(Object.keys(m.deletable).flatMap(e=>u.entityTypes.includes(e)?[e]:u.aliases[e]??[])),E=u.actionFields.flatMap(e=>{let t=p(m.actions,e.actionName);if(void 0===t)return[];let i=`assistant.actions.${e.actionName}`;return l({description:""},t,i),[{...e,description:d(t.description,e.description,i)}]}),T=f;if(f){void 0!==m.ai&&l({...f.ai,maxThreadSize:void 0},m.ai,"assistant.ai");let s={...f.ai,...Object.fromEntries(Object.entries(m.ai??{}).filter(([,e])=>void 0!==e))};e.includes(s.provider)&&t.includes(s.model)&&i.includes(s.reasoning)||r("assistant.ai","expected a supported provider, model and reasoning level"),void 0!==s.maxThreadSize&&(!Number.isInteger(s.maxThreadSize)||s.maxThreadSize<=0)&&r("assistant.ai.maxThreadSize","expected a positive whole number of input tokens"),void 0!==m.instructions&&"string"!=typeof m.instructions&&r("assistant.instructions","expected a string"),T={instructions:""===m.instructions?null:m.instructions??f.instructions,ai:s}}return{resolved:{...u,fields:h,deletableTypes:u.entityTypes.filter(e=>R.has(e)),writableTypes:u.entityTypes.flatMap(e=>{let t=[...j.get(e)?.values()??[]];return t.length?[{entityType:e,fields:t}]:[]}),optionsEdges:Object.fromEntries(O),childRecipes:x("childRecipes"),replaceRecipes:x("replaceRecipes"),actionFields:E},settings:T}};
1
+ import{ASSISTANT_AI_PROVIDERS as e,ASSISTANT_MODEL_TIERS as t,ASSISTANT_REASONING_LEVELS as i}from"@salsita-ai/contracts/assistant";import{describeAssistantValues as s,mergeAssistantFields as n,resolveAssistantField as o}from"../assistant-fields.js";import{ASSISTANT_HINTS as a}from"../assistant-resolved-manifest.js";import{projectAssistantSetupManifest as r}from"./assistant-setup-manifest.js";export class AssistantSetupError extends Error{constructor(e,t){super(`${e}: ${t}`),this.name="AssistantSetupError"}}let l=(e,t)=>{throw new AssistantSetupError(e,t)},p=(e,t,i)=>{for(let s of((null===t||"object"!=typeof t||Array.isArray(t))&&l(i,"expected an object; omit an entry to remove it"),Object.keys(t)))Object.hasOwn(e,s)||l(`${i}.${s}`,"not declared in the spec; remove this key")},d=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0,c=(e,t,i)=>(void 0!==e&&"string"!=typeof e&&l(`${i}.description`,"expected a string"),e??t),u=(e,t,i)=>(void 0!==e&&!1!==e&&l(`${i}.allowDryRuns`,"can only disable dry-runs; omit this flag or set false"),!1!==e&&t);export const applyAssistantSetup=(f,m,b)=>{if(null===b)return null;let y=r(f,m),g=f.declarations;p({entities:{},deletable:{},writable:{},childRecipes:{},replaceRecipes:{},actions:{},instructions:"",ai:{}},b,"assistant"),p(y.entities,b.entities,"assistant.entities"),p(y.deletable,b.deletable,"assistant.deletable"),p(y.writable,b.writable,"assistant.writable"),p(y.actions,b.actions,"assistant.actions");let v=Object.fromEntries(Object.entries(b.entities).map(([e,t])=>{let i=`assistant.entities.${e}`;p(y.entities[e],t,i);let n=g.entities[e];return[e,Object.entries(t).map(([e,t])=>{p({description:""},t,`${i}.${e}`);let o=n.find(t=>t.source===e),a=c(t.description,o.valueDescription,`${i}.${e}`);return{...o,valueDescription:a,description:s(a,o.enumValues),describedByManifest:void 0!==t.description||o.describedByManifest}})]})),w=(e,t,i)=>l(`assistant.entities.${e}`,`conflicting sources ${t} and ${i}`),$=n([],d(v,"AnyDomainEntity")??[],()=>void 0,w),h=new Map([["AnyDomainEntity",$]]);for(let e of Object.keys(f.aliases))"AnyDomainEntity"!==e&&h.set(e,n([$],d(v,e)??[],()=>void 0,w));for(let e of f.entityTypes){let t=Object.entries(f.aliases).filter(([t,i])=>"AnyDomainEntity"!==t&&i.includes(e));h.set(e,n([$,...t.map(([e])=>h.get(e)??[])],d(v,e)??[],t=>g.enumValues[e]?.[t],w))}let j=Object.fromEntries([...h].map(([e,t])=>[e,t.map(t=>o(t,d(v,e)??[]))])),O=new Map,x=new Map;for(let[e,t]of Object.entries(b.writable)){let i=`assistant.writable.${e}`;for(let[s,n]of(p(y.writable[e],t,i),Object.entries(t))){let t=`${i}.${s}`,o=g.writable[e][s];for(let[e,{field:i,options:a,exposedDescription:r}]of(p(Object.values(o.members).some(e=>e.options)?{options:{}}:{},n,t),void 0!==n.options&&(p({validate:!0,allowDryRuns:!1},n.options,`${t}.options`),void 0!==n.options.validate&&!0!==n.options.validate&&l(`${t}.options.validate`,"can only enable validation; omit this flag or set true"),u(n.options.allowDryRuns,!0,`${t}.options`)),Object.entries(o.members))){let p=d(v,e)?.find(e=>e.source===s)?.name??h.get(e)?.find(e=>e.source===s)?.name,c=p??s;void 0===p&&h.get(e)?.some(e=>e.name===s&&e.source!==s)&&l(t,`narrowing leaves ${e}.${s} bound to another read field; retain its original exposure or remove this writable property`);let f=O.get(e)??new Map;if([...f.values()].some(e=>e.name===c&&e.property!==s)&&l(t,`narrowing maps multiple writable properties to ${e}.${c}; retain their original exposures or remove the conflicting property`),f.has(s)||f.set(s,{...i,name:c,...void 0===p?{}:{description:r}}),O.set(e,f),a){let i=o.defaultOptionsName?`${c}Options`:a.options.edgeName;x.get(e)?.some(e=>e.options.edgeName===i||e.options.field===c)&&l(`${t}.options`,`narrowing duplicates options edge ${e}.${i}; retain the original field exposures or remove the conflicting writable declaration`),x.set(e,[...x.get(e)??[],{hints:a.hints,options:{...a.options,field:c,edgeName:i,validate:n.options?.validate??a.options.validate,dryRuns:u(n.options?.allowDryRuns,a.options.dryRuns,`${t}.options`)}}])}}}}for(let[e,t]of Object.entries(f.optionsEdges))for(let i of t){let t=f.writableTypes.find(t=>t.entityType===e)?.fields.find(e=>e.name===i.options.field)?.property;if(i.options.validate&&t&&O.get(e)?.has(t)&&!x.get(e)?.some(i=>i.options.field===O.get(e)?.get(t)?.name&&i.options.validate)){let i=Object.keys(b.writable).find(i=>Object.hasOwn(b.writable[i],t)&&g.writable[i]?.[t]?.members[e]);l(`assistant.writable.${i}.${t}`,`cannot remove declared validation while another declaration keeps ${e}.${t} writable; remove all writable declarations for it`)}}let R=e=>{p(y[e],b[e],`assistant.${e}`);let t=new Map;for(let[i,s]of Object.entries(b[e])){let n=`assistant.${e}.${i}`;p({groups:{}},s,n),p(y[e][i].groups,s.groups,`${n}.groups`);let o=g[e][i],r=Object.entries(s.groups).map(([e,t])=>{let i=`${n}.groups.${e}`;p({description:"",allowDryRuns:!1},t,i);let s=o.groups.find(t=>t.instanceName===e);return{...s,description:c(t.description,s.description,i),dryRuns:u(t.allowDryRuns,s.dryRuns,i)}});for(let e of f.entityTypes.includes(i)?[i]:f.aliases[i]??[]){let i=t.get(e);t.set(e,{groups:[...i?.groups??[],...r],hints:a.filter(e=>o.hints.includes(e)||i?.hints.includes(e))})}}return Object.fromEntries(f.entityTypes.flatMap(e=>{let i=t.get(e);return i?.groups.length?[[e,i]]:[]}))};for(let[e,t]of Object.entries(b.deletable))p({},t,`assistant.deletable.${e}`);let E=new Set(Object.keys(b.deletable).flatMap(e=>f.entityTypes.includes(e)?[e]:f.aliases[e]??[])),T=f.actionFields.flatMap(e=>{let t=d(b.actions,e.actionName);if(void 0===t)return[];let i=`assistant.actions.${e.actionName}`;return p({description:""},t,i),[{...e,description:c(t.description,e.description,i)}]}),D=m;if(m){void 0!==b.ai&&p({...m.ai,maxThreadSize:void 0},b.ai,"assistant.ai");let s={...m.ai,...Object.fromEntries(Object.entries(b.ai??{}).filter(([,e])=>void 0!==e))};e.includes(s.provider)&&t.includes(s.model)&&i.includes(s.reasoning)||l("assistant.ai","expected a supported provider, model and reasoning level"),void 0!==s.maxThreadSize&&(!Number.isInteger(s.maxThreadSize)||s.maxThreadSize<=0)&&l("assistant.ai.maxThreadSize","expected a positive whole number of input tokens"),void 0!==b.instructions&&"string"!=typeof b.instructions&&l("assistant.instructions","expected a string"),D={instructions:""===b.instructions?null:b.instructions??m.instructions,ai:s}}return{resolved:{...f,fields:j,deletableTypes:f.entityTypes.filter(e=>E.has(e)),writableTypes:f.entityTypes.flatMap(e=>{let t=[...O.get(e)?.values()??[]];return t.length?[{entityType:e,fields:t}]:[]}),optionsEdges:Object.fromEntries(x),childRecipes:R("childRecipes"),replaceRecipes:R("replaceRecipes"),actionFields:T},settings:D}};
@@ -41,6 +41,8 @@ export interface AssistantRecipeContext {
41
41
  /** Resolves a title in the current language, for the key of a recipe that declares none. */
42
42
  readonly resolveLocalizable: (message: Localizable) => string;
43
43
  }
44
+ /** What reading a recipe group needs: listing never cooks, so the panel can read a group without a cooker. */
45
+ type AssistantRecipeReadContext = Pick<AssistantRecipeContext, 'componentReader' | 'resolveLocalizable'>;
44
46
  /** One recipe of a group as the assistant addresses it: the list item and its key, unique within the group. */
45
47
  export interface AssistantRecipe {
46
48
  readonly key: string;
@@ -73,7 +75,7 @@ export declare const findAssistantRecipeGroups: (manifest: AssistantManifest, ki
73
75
  * assistant sees the groups the configurator's own controls would offer. A list item without recipes
74
76
  * adds nothing and is left out.
75
77
  */
76
- export declare const readAssistantRecipeGroup: (kind: AssistantRecipeKind, group: AssistantRecipeGroup, entityId: DomainEntityId<string>, state: AnyDomainState, context: AssistantRecipeContext) => AssistantRecipeGroupSnapshot | null;
78
+ export declare const readAssistantRecipeGroup: (kind: AssistantRecipeKind, group: AssistantRecipeGroup, entityId: DomainEntityId<string>, state: AnyDomainState, context: AssistantRecipeReadContext) => AssistantRecipeGroupSnapshot | null;
77
79
  /**
78
80
  * The updates of one recipe of a group for the entity `entityId`, computed from `state`: the same
79
81
  * updates, with the same tag, the configurator's own controls make. A recipe of a child group is
@@ -3,7 +3,7 @@ import type { ThemeOptions } from '@mui/material';
3
3
  import type { z } from 'zod';
4
4
  import type { FinalizeTaskResource } from '@salsita-ai/contracts/webhook';
5
5
  import { type $DomainEntity, type DomainEntity, type DomainFactory, type EnumLike, type ProductPreset, type SchemaOfObject } from '../core/index.js';
6
- import { type ProjectModule } from '../domain-runtime/index.js';
6
+ import { type ElementRegistration, type ProjectModule } from '../domain-runtime/index.js';
7
7
  import type { AclConfig, ApplicationConfig, DataSpec, DefaultEnvs, ResourcesConfig, SpecTransformer, TransformersConfig, UserInterfaceConfig } from './application-config.js';
8
8
  import { type AssistantResolvedManifest } from './assistant/index.js';
9
9
  interface ConfiguratorBuilderContext<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> {
@@ -44,6 +44,7 @@ interface ConfiguratorBuilderContext<ENTITIES extends DomainEntity<string> = nev
44
44
  tagName?: string;
45
45
  handlers?: readonly ProjectModule[];
46
46
  elements?: readonly ProjectModule[];
47
+ defaultElements?: readonly ElementRegistration[];
47
48
  }
48
49
  export declare class ConfiguratorBuilder<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> {
49
50
  private readonly _context;
@@ -87,6 +88,8 @@ export declare class ConfiguratorBuilder<ENTITIES extends DomainEntity<string> =
87
88
  withHandlers(handlers: readonly ProjectModule[]): 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>;
88
89
  /** Sets the elements as project modules, one per `src/elements/` file, for the runtime spec to validate. */
89
90
  withElements(elements: readonly ProjectModule[]): 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>;
91
+ /** Sets the SDK's default element registrations; a project element with the same name replaces one. */
92
+ withDefaultElements(defaultElements: readonly ElementRegistration[]): 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>;
90
93
  withResources<NEW_RESOURCE extends string>(resources: ReadonlyArray<FinalizeTaskResource<NEW_RESOURCE>>): 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, NEW_RESOURCE>;
91
94
  withWebComponentTag(tagName: string): 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>;
92
95
  /**
@@ -1 +1 @@
1
- import{initConsoleLogger as t}from"@salsita-ai/common/utils";import{defaultI18n as e}from"#package/i18n";import{extendedSchemaValidator as i}from"../core/index.js";import{NoopAnalyticsSystem as r}from"../domain-context/index.js";import{createDomainRuntime as n}from"../domain-runtime/index.js";import{isGetApplicationWrapperHandler as o}from"./GetApplicationWrapperHandler.js";import{isGetWebComponentOptionsHandler as a}from"./GetWebComponentOptions.js";import{isAssistantSetupHandler as s}from"./assistant/index.js";import{createInitialPublishedData as l}from"./create-initial-published-data.js";import{isDataRowValidatorHandler as h}from"./published-data/DataRowValidatorHandler.js";import{isFilterPublishedChunksHandler as u}from"./published-data/FilterPublishedChunksHandler.js";import{isMapPublishedChunkedDataHandler as d}from"./published-data/MapPublishedChunkedDataHandler.js";import{isMapPublishedRevisionDataHandler as c}from"./published-data/MapPublishedRevisionDataHandler.js";import{isSheetValidatorHandler as f}from"./published-data/SheetValidatorHandler.js";export class ConfiguratorBuilder{_context;constructor(t){this._context=t}withDefaultEnvs(t){return new ConfiguratorBuilder({...this._context,defaultEnvs:t})}withVersion(t){return new ConfiguratorBuilder({...this._context,version:t})}withTextLanguages(t){return new ConfiguratorBuilder({...this._context,textLanguages:t})}withAcl(t){return new ConfiguratorBuilder({...this._context,acl:t})}withAdminRelease(t){return new ConfiguratorBuilder({...this._context,enableAdminRelease:t})}withUi(t){return new ConfiguratorBuilder({...this._context,ui:t})}withResourcesConfig(t){return new ConfiguratorBuilder({...this._context,resourcesConfig:t})}withChunks(t){return new ConfiguratorBuilder({...this._context,chunks:t})}withPublishedDataHash(t){return new ConfiguratorBuilder({...this._context,publishedDataHash:t})}withAssistant(t){return new ConfiguratorBuilder({...this._context,assistant:t})}withTheme(t){return new ConfiguratorBuilder({...this._context,theme:t})}withDomainFactory(t){return new ConfiguratorBuilder({...this._context,domainFactory:t})}withAdminDomainFactory(t){return new ConfiguratorBuilder({...this._context,adminDomainFactory:t})}withI18n=t=>new ConfiguratorBuilder({...this._context,i18n:t});withPrefetchedFinalizeData(t){return new ConfiguratorBuilder({...this._context,prefetchedFinalizeData:t})}withFinalizeData(t){return new ConfiguratorBuilder({...this._context,finalizeData:t})}withFinalizeResult(t){return new ConfiguratorBuilder({...this._context,finalizeResult:t})}withCallbackData(t){return new ConfiguratorBuilder({...this._context,callbackData:t})}withNavigationState(t){return new ConfiguratorBuilder({...this._context,navigationState:t})}withViewState(t){return new ConfiguratorBuilder({...this._context,viewState:t})}withToolState(t){return new ConfiguratorBuilder({...this._context,toolState:t})}withExportState(t){return new ConfiguratorBuilder({...this._context,exportState:t})}withAdminNavigationState(t){return new ConfiguratorBuilder({...this._context,adminNavigationState:t})}withAdminViewState(t){return new ConfiguratorBuilder({...this._context,adminViewState:t})}withPresets(t){return new ConfiguratorBuilder({...this._context,presets:t})}withAdminPresets(t){return new ConfiguratorBuilder({...this._context,adminPresets:t})}withComponentOptics(t){return new ConfiguratorBuilder({...this._context,componentOptics:[...this._context.componentOptics,...t]})}withAdminComponentOptics(t){return new ConfiguratorBuilder({...this._context,adminComponentOptics:[...this._context.adminComponentOptics??[],...t]})}withHandlers(t){return new ConfiguratorBuilder({...this._context,handlers:t})}withElements(t){return new ConfiguratorBuilder({...this._context,elements:t})}withResources(t){return new ConfiguratorBuilder({...this._context,resources:t})}withWebComponentTag(t){return new ConfiguratorBuilder({...this._context,tagName:t})}withTransformers(t,e){return new ConfiguratorBuilder({...this._context,transformers:{importedTransformers:t,specTransformers:e}})}withInterface(t){return this}withDataSpec=t=>new ConfiguratorBuilder({...this._context,dataSpec:t});_computeInitialPublishedData(t,e,i){if(!this._context.adminDomainFactory)throw Error("adminDomainFactory is required!");return l({adminDomainFactory:this._context.adminDomainFactory,domainRuntime:e,adminPresets:this._context.adminPresets??[],handlers:i,dataSpec:this._context.dataSpec,chunks:this._context.chunks,logger:t})}buildConfig(){return this._buildConfigWithHandlers().config}_buildConfigWithHandlers(){if(!this._context.domainFactory)throw Error("Can not create application config, domainFactory is required! Is it registered with the ConfiguratorBuilder?");if(!this._context.presets)throw Error("Can not create application config, presets are required! Is it registered with the ConfiguratorBuilder?");if(!this._context.adminDomainFactory)throw Error("Can not create application config, adminDomainFactory is required! Is it registered with the ConfiguratorBuilder?");if(!this._context.adminPresets)throw Error("Can not create application config, adminPresets are required! Is it registered with the ConfiguratorBuilder?");if(!this._context.version)throw Error("Can not create application config, version is required!");let i=this._context.tagName??"salsita-configurator",l={defaultEnvs:this._context.defaultEnvs,services:{i18n:this._context.i18n},version:this._context.version,initialPublishedData:{},domain:{textLanguages:this._context.textLanguages,componentOptics:this._context.componentOptics,presets:this._context.presets,domainFactory:this._context.domainFactory},navigation:{navigationStates:this._context.navigationState?.values(),viewStates:this._context.viewState?.values(),toolStates:this._context.toolState?.values(),exportStates:this._context.exportState?.values()},adminNavigation:{navigationStates:this._context.adminNavigationState?.values(),viewStates:this._context.adminViewState?.values()},adminDomain:{textLanguages:this._context.textLanguages,componentOptics:this._context.adminComponentOptics??[],presets:this._context.adminPresets,domainFactory:this._context.adminDomainFactory},mount:{tag:i,options:{}},handlers:this._context.handlers??[],elements:this._context.elements??[],transformers:this._context.transformers,features:{acl:this._context.acl,enableAdminRelease:this._context.enableAdminRelease},ui:{preview:this._context.ui?.preview,alwaysExpand:this._context.ui?.alwaysExpand,theme:this._context.theme},resources:this._context.resourcesConfig,chunks:this._context.chunks,publishedDataHash:this._context.publishedDataHash,assistant:this._context.assistant,dataSpec:this._context.dataSpec},d=t(),c=n({config:l,services:{analyticsService:new r,i18n:e,logger:d}}),m=c.getState().spec.configurator.handlers;if(m.filter(s).length>1)throw Error("Multiple createAssistantSetupHandler handlers found. Only one handler is allowed.");if(m.filter(t=>u(t)).length>1)throw Error("Multiple createFilterPublishedChunksHandler handlers found. Only one handler is allowed.");if(m.filter(t=>h(t)).length>1)throw Error("Multiple createDataRowValidatorHandler handlers found. Only one handler is allowed.");if(m.filter(t=>f(t)).length>1)throw Error("Multiple createSheetValidatorHandler handlers found. Only one handler is allowed.");let w=m.find(o)?.handler().handler,x=m.find(a)?.handler().handler(void 0),p=this._computeInitialPublishedData(d,c,m);return{config:{...l,mount:{tag:i,options:x??{},Application:w},initialPublishedData:p},handlers:m}}buildWebhookContext(){if(!this._context.domainFactory)throw Error("domainFactory is required!");if(!this._context.adminDomainFactory)throw Error("adminDomainFactory is required!");if(!this._context.adminPresets)throw Error("adminPresets are required!");let{config:t,handlers:e}=this._buildConfigWithHandlers(),r=t=>{if(null==this._context.finalizeData)return{};let e=i.compile(this._context.finalizeData);if(!e(t))throw console.error("Finalize data validation errors:",e.errors),Error("Invalid finalize data!");return t},n=t=>{if(null==this._context.finalizeResult)return{};let e=i.compile(this._context.finalizeResult);if(!e(t))throw console.error("Finalize result validation errors:",e.errors),Error("Invalid finalize result!");return t},o=t=>{if(null==this._context.callbackData)return{};let e=i.compile(this._context.callbackData);if(!e(t))throw console.error("Callback data validation errors:",e.errors),Error("Invalid callback data!");return t},a=e.find(c)?.handler().handler,s=e.find(d)?.handler().handler,l=e.find(h)?.handler().handler,u=e.find(f)?.handler().handler;return{config:t,parseFinalizeData:r,parseFinalizeResult:n,resources:this._context.resources??[],parseCallbackData:o,mapPublishedRevisionData:a,mapPublishedChunkedData:s,dataRowValidator:l,sheetValidator:u}}}
1
+ import{initConsoleLogger as t}from"@salsita-ai/common/utils";import{defaultI18n as e}from"#package/i18n";import{extendedSchemaValidator as i}from"../core/index.js";import{NoopAnalyticsSystem as r}from"../domain-context/index.js";import{createDomainRuntime as n}from"../domain-runtime/index.js";import{isGetApplicationWrapperHandler as o}from"./GetApplicationWrapperHandler.js";import{isGetWebComponentOptionsHandler as a}from"./GetWebComponentOptions.js";import{isAssistantSetupHandler as s}from"./assistant/index.js";import{createInitialPublishedData as l}from"./create-initial-published-data.js";import{isDataRowValidatorHandler as h}from"./published-data/DataRowValidatorHandler.js";import{isFilterPublishedChunksHandler as u}from"./published-data/FilterPublishedChunksHandler.js";import{isMapPublishedChunkedDataHandler as d}from"./published-data/MapPublishedChunkedDataHandler.js";import{isMapPublishedRevisionDataHandler as c}from"./published-data/MapPublishedRevisionDataHandler.js";import{isSheetValidatorHandler as f}from"./published-data/SheetValidatorHandler.js";export class ConfiguratorBuilder{_context;constructor(t){this._context=t}withDefaultEnvs(t){return new ConfiguratorBuilder({...this._context,defaultEnvs:t})}withVersion(t){return new ConfiguratorBuilder({...this._context,version:t})}withTextLanguages(t){return new ConfiguratorBuilder({...this._context,textLanguages:t})}withAcl(t){return new ConfiguratorBuilder({...this._context,acl:t})}withAdminRelease(t){return new ConfiguratorBuilder({...this._context,enableAdminRelease:t})}withUi(t){return new ConfiguratorBuilder({...this._context,ui:t})}withResourcesConfig(t){return new ConfiguratorBuilder({...this._context,resourcesConfig:t})}withChunks(t){return new ConfiguratorBuilder({...this._context,chunks:t})}withPublishedDataHash(t){return new ConfiguratorBuilder({...this._context,publishedDataHash:t})}withAssistant(t){return new ConfiguratorBuilder({...this._context,assistant:t})}withTheme(t){return new ConfiguratorBuilder({...this._context,theme:t})}withDomainFactory(t){return new ConfiguratorBuilder({...this._context,domainFactory:t})}withAdminDomainFactory(t){return new ConfiguratorBuilder({...this._context,adminDomainFactory:t})}withI18n=t=>new ConfiguratorBuilder({...this._context,i18n:t});withPrefetchedFinalizeData(t){return new ConfiguratorBuilder({...this._context,prefetchedFinalizeData:t})}withFinalizeData(t){return new ConfiguratorBuilder({...this._context,finalizeData:t})}withFinalizeResult(t){return new ConfiguratorBuilder({...this._context,finalizeResult:t})}withCallbackData(t){return new ConfiguratorBuilder({...this._context,callbackData:t})}withNavigationState(t){return new ConfiguratorBuilder({...this._context,navigationState:t})}withViewState(t){return new ConfiguratorBuilder({...this._context,viewState:t})}withToolState(t){return new ConfiguratorBuilder({...this._context,toolState:t})}withExportState(t){return new ConfiguratorBuilder({...this._context,exportState:t})}withAdminNavigationState(t){return new ConfiguratorBuilder({...this._context,adminNavigationState:t})}withAdminViewState(t){return new ConfiguratorBuilder({...this._context,adminViewState:t})}withPresets(t){return new ConfiguratorBuilder({...this._context,presets:t})}withAdminPresets(t){return new ConfiguratorBuilder({...this._context,adminPresets:t})}withComponentOptics(t){return new ConfiguratorBuilder({...this._context,componentOptics:[...this._context.componentOptics,...t]})}withAdminComponentOptics(t){return new ConfiguratorBuilder({...this._context,adminComponentOptics:[...this._context.adminComponentOptics??[],...t]})}withHandlers(t){return new ConfiguratorBuilder({...this._context,handlers:t})}withElements(t){return new ConfiguratorBuilder({...this._context,elements:t})}withDefaultElements(t){return new ConfiguratorBuilder({...this._context,defaultElements:t})}withResources(t){return new ConfiguratorBuilder({...this._context,resources:t})}withWebComponentTag(t){return new ConfiguratorBuilder({...this._context,tagName:t})}withTransformers(t,e){return new ConfiguratorBuilder({...this._context,transformers:{importedTransformers:t,specTransformers:e}})}withInterface(t){return this}withDataSpec=t=>new ConfiguratorBuilder({...this._context,dataSpec:t});_computeInitialPublishedData(t,e,i){if(!this._context.adminDomainFactory)throw Error("adminDomainFactory is required!");return l({adminDomainFactory:this._context.adminDomainFactory,domainRuntime:e,adminPresets:this._context.adminPresets??[],handlers:i,dataSpec:this._context.dataSpec,chunks:this._context.chunks,logger:t})}buildConfig(){return this._buildConfigWithHandlers().config}_buildConfigWithHandlers(){if(!this._context.domainFactory)throw Error("Can not create application config, domainFactory is required! Is it registered with the ConfiguratorBuilder?");if(!this._context.presets)throw Error("Can not create application config, presets are required! Is it registered with the ConfiguratorBuilder?");if(!this._context.adminDomainFactory)throw Error("Can not create application config, adminDomainFactory is required! Is it registered with the ConfiguratorBuilder?");if(!this._context.adminPresets)throw Error("Can not create application config, adminPresets are required! Is it registered with the ConfiguratorBuilder?");if(!this._context.version)throw Error("Can not create application config, version is required!");let i=this._context.tagName??"salsita-configurator",l={defaultEnvs:this._context.defaultEnvs,services:{i18n:this._context.i18n},version:this._context.version,initialPublishedData:{},domain:{textLanguages:this._context.textLanguages,componentOptics:this._context.componentOptics,presets:this._context.presets,domainFactory:this._context.domainFactory},navigation:{navigationStates:this._context.navigationState?.values(),viewStates:this._context.viewState?.values(),toolStates:this._context.toolState?.values(),exportStates:this._context.exportState?.values()},adminNavigation:{navigationStates:this._context.adminNavigationState?.values(),viewStates:this._context.adminViewState?.values()},adminDomain:{textLanguages:this._context.textLanguages,componentOptics:this._context.adminComponentOptics??[],presets:this._context.adminPresets,domainFactory:this._context.adminDomainFactory},mount:{tag:i,options:{}},handlers:this._context.handlers??[],elements:this._context.elements??[],defaultElements:this._context.defaultElements??[],transformers:this._context.transformers,features:{acl:this._context.acl,enableAdminRelease:this._context.enableAdminRelease},ui:{preview:this._context.ui?.preview,alwaysExpand:this._context.ui?.alwaysExpand,theme:this._context.theme},resources:this._context.resourcesConfig,chunks:this._context.chunks,publishedDataHash:this._context.publishedDataHash,assistant:this._context.assistant,dataSpec:this._context.dataSpec},d=t(),c=n({config:l,services:{analyticsService:new r,i18n:e,logger:d}}),m=c.getState().spec.configurator.handlers;if(m.filter(s).length>1)throw Error("Multiple createAssistantSetupHandler handlers found. Only one handler is allowed.");if(m.filter(t=>u(t)).length>1)throw Error("Multiple createFilterPublishedChunksHandler handlers found. Only one handler is allowed.");if(m.filter(t=>h(t)).length>1)throw Error("Multiple createDataRowValidatorHandler handlers found. Only one handler is allowed.");if(m.filter(t=>f(t)).length>1)throw Error("Multiple createSheetValidatorHandler handlers found. Only one handler is allowed.");let w=m.find(o)?.handler().handler,x=m.find(a)?.handler().handler(void 0),_=this._computeInitialPublishedData(d,c,m);return{config:{...l,mount:{tag:i,options:x??{},Application:w},initialPublishedData:_},handlers:m}}buildWebhookContext(){if(!this._context.domainFactory)throw Error("domainFactory is required!");if(!this._context.adminDomainFactory)throw Error("adminDomainFactory is required!");if(!this._context.adminPresets)throw Error("adminPresets are required!");let{config:t,handlers:e}=this._buildConfigWithHandlers(),r=t=>{if(null==this._context.finalizeData)return{};let e=i.compile(this._context.finalizeData);if(!e(t))throw console.error("Finalize data validation errors:",e.errors),Error("Invalid finalize data!");return t},n=t=>{if(null==this._context.finalizeResult)return{};let e=i.compile(this._context.finalizeResult);if(!e(t))throw console.error("Finalize result validation errors:",e.errors),Error("Invalid finalize result!");return t},o=t=>{if(null==this._context.callbackData)return{};let e=i.compile(this._context.callbackData);if(!e(t))throw console.error("Callback data validation errors:",e.errors),Error("Invalid callback data!");return t},a=e.find(c)?.handler().handler,s=e.find(d)?.handler().handler,l=e.find(h)?.handler().handler,u=e.find(f)?.handler().handler;return{config:t,parseFinalizeData:r,parseFinalizeResult:n,resources:this._context.resources??[],parseCallbackData:o,mapPublishedRevisionData:a,mapPublishedChunkedData:s,dataRowValidator:l,sheetValidator:u}}}
@@ -1,5 +1,5 @@
1
1
  import type { I18n } from '@lingui/core';
2
- import type { Localizable } from '@salsita-ai/common/utils';
2
+ import { type Localizable } from '@salsita-ai/common/utils';
3
3
  import type { StateEmission } from '../emission/index.js';
4
4
  import type { $DomainEntity, DomainEntity, EntityId } from '../model/index.js';
5
5
  /**
@@ -66,7 +66,55 @@ export declare const ViolationSchema: {
66
66
  readonly enum: ("fatal" | "fixable" | "notice" | "warning")[];
67
67
  };
68
68
  readonly message: {
69
- readonly type: 'string';
69
+ readonly anyOf: [{
70
+ readonly type: 'string';
71
+ }, {
72
+ readonly type: 'object';
73
+ readonly properties: {
74
+ readonly id: {
75
+ readonly type: 'string';
76
+ };
77
+ readonly comment: {
78
+ readonly type: 'string';
79
+ };
80
+ readonly message: {
81
+ readonly type: 'string';
82
+ };
83
+ readonly values: {
84
+ readonly type: 'object';
85
+ readonly additionalProperties: true;
86
+ };
87
+ };
88
+ readonly required: ["id"];
89
+ readonly additionalProperties: false;
90
+ readonly import: [{
91
+ readonly module: '@lingui/core';
92
+ readonly member: 'MessageDescriptor';
93
+ }];
94
+ readonly tsType: 'MessageDescriptor';
95
+ }, {
96
+ readonly import: [{
97
+ readonly module: '@salsita-ai/sdk/common/utils';
98
+ readonly member: 'MultilingualString';
99
+ }];
100
+ readonly tsType: 'MultilingualString';
101
+ readonly type: 'object';
102
+ readonly properties: {
103
+ readonly $lang: {
104
+ readonly type: 'object';
105
+ readonly additionalProperties: {
106
+ readonly type: 'string';
107
+ };
108
+ };
109
+ };
110
+ readonly required: ["$lang"];
111
+ readonly additionalProperties: false;
112
+ }];
113
+ readonly tsType: 'Localizable';
114
+ readonly import: [{
115
+ readonly module: '@salsita-ai/sdk/common/utils';
116
+ readonly member: 'Localizable';
117
+ }];
70
118
  };
71
119
  readonly controlViolationPriority: {
72
120
  readonly type: 'number';
@@ -1 +1 @@
1
- let e=["fatal","fixable","warning","notice"];export const compareSeverity=(t,i)=>e.indexOf(t)-e.indexOf(i);export const ViolationSchema={type:"object",properties:{type:{type:"string"},severity:{enum:e.slice()},message:{type:"string"},controlViolationPriority:{type:"number"}},required:["type","severity"],additionalProperties:!1};
1
+ import{MessageDescriptorSchema as e,MultilingualStringSchema as t}from"@salsita-ai/common/utils";let i=["fatal","fixable","warning","notice"];export const compareSeverity=(e,t)=>i.indexOf(e)-i.indexOf(t);export const ViolationSchema={type:"object",properties:{type:{type:"string"},severity:{enum:i.slice()},message:{anyOf:[{type:"string"},e,t],tsType:"Localizable",import:[{module:"@salsita-ai/sdk/common/utils",member:"Localizable"}]},controlViolationPriority:{type:"number"}},required:["type","severity"],additionalProperties:!1};
@@ -25,7 +25,7 @@ export declare const VirtualEntityIdSchema: {
25
25
  };
26
26
  export declare const createVirtualEntityId: (name: string) => VirtualEntityId;
27
27
  export declare const isVirtualEntityId: (value: EntityId<any>) => value is VirtualEntityId;
28
- export type DomainEntityId<TYPE extends string> = `${TYPE}-${number}` & {
28
+ export type DomainEntityId<TYPE extends string = string> = `${TYPE}-${number}` & {
29
29
  __brand: TYPE;
30
30
  };
31
31
  /**
@@ -1 +1 @@
1
- import{createAjvSchemaValidator as e}from"./create-ajv-schema-validator.js";import{createCspSchemaValidator as a}from"./create-csp-schema-validator.js";let t="csp-compatible"===globalThis.PHX_SCHEMA_VALIDATOR?a:e;export const getExtendedSchemaValidator=()=>{let e=t();return e.addKeyword("tsType"),e.addKeyword("import"),e.addKeyword("declared"),e};export const extendedSchemaValidator=getExtendedSchemaValidator();
1
+ import{createAjvSchemaValidator as e}from"./create-ajv-schema-validator.js";import{createCspSchemaValidator as a}from"./create-csp-schema-validator.js";export const getExtendedSchemaValidator=()=>{let t="csp-compatible"===globalThis.PHX_SCHEMA_VALIDATOR?a():e();return t.addKeyword("tsType"),t.addKeyword("import"),t.addKeyword("declared"),t};export const extendedSchemaValidator=getExtendedSchemaValidator();
@@ -2,7 +2,7 @@ export { type AnalyticsSystem, NoopAnalyticsSystem, type AnalyticsEvent, Analyti
2
2
  export { NavigationUpdateTag, isInitialNavigationUpdate, isNavigationUpdate, isInitialViewUpdate, isViewUpdate, isInitialSelectionUpdate, isSelectUpdate, isDeselectUpdate, isInitialFullscreenUpdate, isToggleFullscreenUpdate, isInitialDebugUpdate, isInitialViewportUpdate, isSetViewportUpdate, isInitialDragUpdate, isDragStartUpdate, isDragEndUpdate, isInitialToolUpdate, isToolUpdate, isExportUpdate, createAutoSelectionTransformer, NavigationSystem, type NavigationSystemContext, createResetSelectionOnNavigationTransformer, createNavigationOnSelectionTransformer, createNavigationOnDeselectTransformer, createSelectParentOnDeselectionTransformer, createNavigationOnSelectionChangeTransformer, type AnyNavigationSystem, } from './navigation-system/index.js';
3
3
  export { StoreSystem, type TransformerRegistration, type UpdateTransformer, type TransformerLogFunction, type Transformers, type StateSliceName, type StateEmissionKind, type CommitPreparedOutcome, nextDomainEntityId, getIdSequence, applyUpdates, SystemState, SystemStateInitialUpdateTag, SystemStateUpdateTag, type SystemStateContext, type AnyCreateTransformersFactory, type AnyStoreSystem, type Unregister, } from './store-system/index.js';
4
4
  export { createRefReplaceTransformer, createCascadeDeletesTransformer, createCascadeRefPruningTransformer, createCreateEntityRefsTransformer, } from './relation-transformers/index.js';
5
- export { type CanBeUndonePredicate, type CanBeUndoneContext, type UndoCapabilities, UndoSystem, UNDO_REDO_RESET_TAG, isUndoRedoReset, type AnyUndoSystem, } from './undo-system.js';
5
+ export { type CanBeUndonePredicate, type CanBeUndoneContext, type UndoCapabilities, type UndoStep, UndoSystem, UNDO_REDO_RESET_TAG, isUndoRedoReset, type AnyUndoSystem, } from './undo-system.js';
6
6
  export { DimensionSystem, type AnyDimensionSystem, type DimensionSystemContext, type AngleDimensionViolation, type DistanceDimensionViolation, type GenericDimensionViolation, } from './dimension-system/index.js';
7
7
  export { ActionSystem, type AnyActionSystem, type ActionSystemContext } from './action-system/index.js';
8
8
  export { RecipeCookerSystem, type AnyRecipeCookerSystem, type RecipeCookerSystemContext, ReplaceRecipeUpdateTag, isReplaceEntityUpdate, type IsReplaceRecipeUpdate, CreateRecipeUpdateTag, isCreateEntityUpdate, type IsCreateRecipeUpdate, } from './recipe-system/index.js';
@@ -1,10 +1,31 @@
1
1
  import type { ObservableWithLastValue } from '@salsita-ai/common/utils';
2
- import type { $DomainEntity, DomainEntity, ResetStateEmission, StateEmission } from '../core/index.js';
2
+ import type { $DomainEntity, DomainEntity, DomainState, ResetStateEmission, StateEmission } from '../core/index.js';
3
3
  import type { DomainContextSelectors } from '../domain-runtime/index.js';
4
4
  export interface UndoCapabilities {
5
5
  readonly canUndo: boolean;
6
6
  readonly canRedo: boolean;
7
7
  }
8
+ /**
9
+ * One step of the undo history: a state that undo and redo return to.
10
+ *
11
+ * A step is made by an undoable change. The non-undoable commits made on top of it afterwards, such
12
+ * as a selection or a navigation, do not make steps of their own; returning to the step keeps them,
13
+ * so undoing a later change does not also take back what the user selected since. A step therefore
14
+ * holds two states: the one that identifies it and the one it returns to.
15
+ */
16
+ export interface UndoStep<ENTITIES extends DomainEntity<string>> {
17
+ /**
18
+ * The state the undoable change committed. It identifies the step and never changes, so a caller
19
+ * that knows which state its own change committed can tell whether that change is the step the
20
+ * configuration is at.
21
+ */
22
+ readonly committedState: DomainState<ENTITIES>;
23
+ /**
24
+ * What undo or redo resets the store to: `committedState` plus the non-undoable commits made on
25
+ * top of it before the next undoable change.
26
+ */
27
+ readonly restoreState: DomainState<ENTITIES>;
28
+ }
8
29
  export interface CanBeUndoneContext<ENTITIES extends DomainEntity<string>, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>> {
9
30
  oldEmission: StateEmission<ENTITIES, $MAP>;
10
31
  newEmission: StateEmission<ENTITIES, $MAP>;
@@ -39,6 +60,12 @@ export declare class UndoSystem<ENTITIES extends DomainEntity<string>, $MAP exte
39
60
  private _activeIsUndoable;
40
61
  private readonly _canSubject;
41
62
  readonly can$: ObservableWithLastValue<UndoCapabilities>;
63
+ private readonly _tipSubject;
64
+ /**
65
+ * The step the configuration is at: the top of the stack, or the step an undo or redo returned to.
66
+ * Nothing while the stack is empty, before the first undoable change and after a reset.
67
+ */
68
+ readonly tip$: ObservableWithLastValue<UndoStep<ENTITIES> | undefined>;
42
69
  constructor(_context: UndoSystemContext);
43
70
  initialize: () => void;
44
71
  /**
@@ -1 +1 @@
1
- import{BehaviorSubject as t,pairwise as e}from"rxjs";let s=t=>t.oldEmission.state.entities!==t.newEmission.state.entities;export const UNDO_REDO_RESET_TAG={};export const isUndoRedoReset=t=>"reset"===t.kind&&t.tag===UNDO_REDO_RESET_TAG;export class UndoSystem{_context;_stack=[];_currentIndex=-1;_activeIsUndoable;_canSubject=new t({canUndo:!1,canRedo:!1});can$=this._canSubject;constructor(t){this._context=t,this._context.selectors.getStoreSystem().stateSlices.committed.pipe(e()).subscribe(([t,e])=>{if("reset"===e.kind&&e.tag!==UNDO_REDO_RESET_TAG)return void this.resetStack();let n=this._activeIsUndoable?.handler??s;("reset"!==e.kind||e.tag!==UNDO_REDO_RESET_TAG)&&n({oldEmission:t,newEmission:e})&&(this._stack=[...this._stack.slice(0,this._currentIndex),t.state,e.state],this._currentIndex=this._stack.length-1,this._refresh())})}initialize=()=>{this.resetStack()};registerIsUndoable(t){let e={handler:t};return this._activeIsUndoable=e,()=>{this._activeIsUndoable===e&&(this._activeIsUndoable=void 0)}}resetStack(){this._stack=[],this._currentIndex=-1,this._refresh()}_refresh(){this._canSubject.next({canUndo:this.canUndo(),canRedo:this.canRedo()})}canUndo(){return this._currentIndex>0}canRedo(){return this._currentIndex<this._stack.length-1}undo(){let t=this._stack[this._currentIndex-1];void 0!==t&&(this._currentIndex--,this._context.selectors.getStoreSystem().reset(t,UNDO_REDO_RESET_TAG),this._refresh())}redo(){let t=this._stack[this._currentIndex+1];void 0!==t&&(this._currentIndex++,this._context.selectors.getStoreSystem().reset(t,UNDO_REDO_RESET_TAG),this._refresh())}}
1
+ import{BehaviorSubject as t,pairwise as e}from"rxjs";let s=t=>t.oldEmission.state.entities!==t.newEmission.state.entities;export const UNDO_REDO_RESET_TAG={};export const isUndoRedoReset=t=>"reset"===t.kind&&t.tag===UNDO_REDO_RESET_TAG;export class UndoSystem{_context;_stack=[];_currentIndex=-1;_activeIsUndoable;_canSubject=new t({canUndo:!1,canRedo:!1});can$=this._canSubject;_tipSubject=new t(void 0);tip$=this._tipSubject;constructor(t){this._context=t,this._context.selectors.getStoreSystem().stateSlices.committed.pipe(e()).subscribe(([t,e])=>{if("reset"===e.kind&&e.tag!==UNDO_REDO_RESET_TAG)return void this.resetStack();let i=this._activeIsUndoable?.handler??s;if("reset"===e.kind&&e.tag===UNDO_REDO_RESET_TAG||!i({oldEmission:t,newEmission:e}))return;let r=this._stack[this._currentIndex],n={committedState:r?.committedState??t.state,restoreState:t.state},c={committedState:e.state,restoreState:e.state};this._stack=[...this._stack.slice(0,this._currentIndex),n,c],this._currentIndex=this._stack.length-1,this._refresh()})}initialize=()=>{this.resetStack()};registerIsUndoable(t){let e={handler:t};return this._activeIsUndoable=e,()=>{this._activeIsUndoable===e&&(this._activeIsUndoable=void 0)}}resetStack(){this._stack=[],this._currentIndex=-1,this._refresh()}_refresh(){this._canSubject.next({canUndo:this.canUndo(),canRedo:this.canRedo()}),this._tipSubject.next(this._stack[this._currentIndex])}canUndo(){return this._currentIndex>0}canRedo(){return this._currentIndex<this._stack.length-1}undo(){let t=this._stack[this._currentIndex-1];void 0!==t&&(this._currentIndex--,this._context.selectors.getStoreSystem().reset(t.restoreState,UNDO_REDO_RESET_TAG),this._refresh())}redo(){let t=this._stack[this._currentIndex+1];void 0!==t&&(this._currentIndex++,this._context.selectors.getStoreSystem().reset(t.restoreState,UNDO_REDO_RESET_TAG),this._refresh())}}
@@ -1,3 +1,14 @@
1
1
  import type { AnyApplicationConfig } from '../../application/index.js';
2
2
  import type { ApplicationSpec } from './types.js';
3
+ /**
4
+ * Builds the runtime spec of an application from its config.
5
+ *
6
+ * Project files reach the config unchecked; this is where each one is held to its folder's
7
+ * contract. Every file is checked on its own, and all the files that break their contract are
8
+ * thrown together as one `ImplementationErrors`. Its errors are ordered by folder (handlers,
9
+ * elements, transformers, configurator components, admin components) and inside a folder by the
10
+ * order of the config's list. No spec is returned when a file is wrong, so nothing that reads the
11
+ * spec, such as the transformer selection, runs on a list with a file missing and reports the
12
+ * mistake a second time.
13
+ */
3
14
  export declare const initializeSpec: (config: AnyApplicationConfig) => ApplicationSpec;
@@ -1 +1 @@
1
- import{SessionRole as e}from"@salsita-ai/contracts/api";import{resolveComponentOpticModules as t,resolveElementModules as a,resolveHandlerModules as n,resolveImportedTransformers as o,resolveTransformerModules as i}from"./module-checks/index.js";export const initializeSpec=s=>{let r=s.adminDomain.presets[0];if(!r)throw Error("Cannot register application spec because admin preset is required.");let m=n(s.handlers),c=a(s.elements),d=(e=>{let t={};for(let a of e)t[a.name]=(void 0)??a.name;return t})(m),l=(e=>{let t={},a=0;for(let n of e)if("entity"===n.type||"layout"===n.type)t[n.name]=(void 0)??n.name;else{let e=`icon:${a}`;t[e]=(void 0)??`${e}:${n.elements.length}`,a+=1}return t})(c),p=i(s.transformers?.importedTransformers??[]),y=s.transformers?.specTransformers??[];return{version:s.version,dataConfig:s.dataSpec??null,chunks:s.chunks,publishedDataHash:s.publishedDataHash,initialPublishedData:s.initialPublishedData,canCreate:s.features?.acl?.canCreate??Object.values(e),enableAdminRelease:s.features?.enableAdminRelease??!1,textLanguages:s.domain.textLanguages??s.adminDomain.textLanguages??["en"],baseResourcesUrl:s.resources?.baseResourcesUrl??s.defaultEnvs?.resourcesUrl??"",configurator:{factory:s.domain.domainFactory,presets:s.domain.presets,aliasMap:s.domain.domainFactory.context.aliasMap,entityReflections:s.domain.domainFactory.context.entityReflections,$entityReflections:s.domain.domainFactory.context.$entityReflections,expressions:s.domain.domainFactory.context.expressions,actions:s.domain.domainFactory.context.actions,actionImplementations:s.domain.domainFactory.context.actionImplementations,allowedRootEntityTypes:s.domain.domainFactory.context.allowedRootEntityTypes,migrate:s.domain.domainFactory.context.migrate,componentOptics:t(s.domain.componentOptics),createTransformers:e=>o(p,y,e),navigationStates:s.navigation?.navigationStates??[],viewStates:s.navigation?.viewStates??[],toolStates:s.navigation?.toolStates??[],exportStates:s.navigation?.exportStates??[],handlers:m,handlerHashes:d,elements:c,elementHashes:l,appLoader:s.ui?.appLoader??"universal",preview:s.ui?.preview??"auto",alwaysExpand:s.ui?.alwaysExpand??!1,theme:s.ui?.theme??{},assistant:s.assistant??null,deploymentQueryDisabled:s.resources?.deploymentQueryDisabled??!1,prefetchTextureUrls:s.resources?.prefetchTextureUrls??[],modelVersion:s.domain.domainFactory.modelVersion},admin:{factory:s.adminDomain.domainFactory,modelVersion:s.adminDomain.domainFactory.modelVersion,aliasMap:s.adminDomain.domainFactory.context.aliasMap,entityReflections:s.adminDomain.domainFactory.context.entityReflections,$entityReflections:s.adminDomain.domainFactory.context.$entityReflections,expressions:s.adminDomain.domainFactory.context.expressions,actions:s.adminDomain.domainFactory.context.actions,actionImplementations:s.adminDomain.domainFactory.context.actionImplementations,allowedRootEntityTypes:s.adminDomain.domainFactory.context.allowedRootEntityTypes,migrate:s.adminDomain.domainFactory.context.migrate,preset:r,componentOptics:t(s.adminDomain.componentOptics),navigationStates:s.adminNavigation?.navigationStates??[],viewStates:s.adminNavigation?.viewStates??[],handlers:m,handlerHashes:d,elements:c,elementHashes:l}}};
1
+ import{SessionRole as e}from"@salsita-ai/contracts/api";import{createImplementationErrorCollector as t}from"../errors/index.js";import{resolveComponentOpticModules as a,resolveElementModule as n,resolveHandlerModule as o,resolveImportedTransformers as i,resolveTransformerModule as s}from"./module-checks/index.js";let r=(e,t,a)=>e.flatMap(e=>a.attempt(()=>t(e),[]));export const initializeSpec=m=>{let c=m.adminDomain.presets[0];if(!c)throw Error("Cannot register application spec because admin preset is required.");let d=t(),l=r(m.handlers,o,d),p=r(m.elements,n,d),y=r(m.transformers?.importedTransformers??[],e=>[s(e)],d),u=r(m.domain.componentOptics,e=>a([e]),d),f=r(m.adminDomain.componentOptics,e=>a([e]),d);d.throwIfAny();let x=(e=>{let t={};for(let a of e)t[a.name]=(void 0)??a.name;return t})(l),g=(e=>{let t={},a=0;for(let n of e)if("entity"===n.type||"layout"===n.type)t[n.name]=(void 0)??n.name;else{let e=`icon:${a}`;t[e]=(void 0)??`${e}:${n.elements.length}`,a+=1}return t})(p),v=m.transformers?.specTransformers??[];return{version:m.version,dataConfig:m.dataSpec??null,chunks:m.chunks,publishedDataHash:m.publishedDataHash,initialPublishedData:m.initialPublishedData,canCreate:m.features?.acl?.canCreate??Object.values(e),enableAdminRelease:m.features?.enableAdminRelease??!1,textLanguages:m.domain.textLanguages??m.adminDomain.textLanguages??["en"],baseResourcesUrl:m.resources?.baseResourcesUrl??m.defaultEnvs?.resourcesUrl??"",configurator:{factory:m.domain.domainFactory,presets:m.domain.presets,aliasMap:m.domain.domainFactory.context.aliasMap,entityReflections:m.domain.domainFactory.context.entityReflections,$entityReflections:m.domain.domainFactory.context.$entityReflections,expressions:m.domain.domainFactory.context.expressions,actions:m.domain.domainFactory.context.actions,actionImplementations:m.domain.domainFactory.context.actionImplementations,allowedRootEntityTypes:m.domain.domainFactory.context.allowedRootEntityTypes,migrate:m.domain.domainFactory.context.migrate,componentOptics:u,createTransformers:e=>i(y,v,e),navigationStates:m.navigation?.navigationStates??[],viewStates:m.navigation?.viewStates??[],toolStates:m.navigation?.toolStates??[],exportStates:m.navigation?.exportStates??[],handlers:l,handlerHashes:x,elements:p,defaultElements:m.defaultElements??[],elementHashes:g,appLoader:m.ui?.appLoader??"universal",preview:m.ui?.preview??"auto",alwaysExpand:m.ui?.alwaysExpand??!1,theme:m.ui?.theme??{},assistant:m.assistant??null,deploymentQueryDisabled:m.resources?.deploymentQueryDisabled??!1,prefetchTextureUrls:m.resources?.prefetchTextureUrls??[],modelVersion:m.domain.domainFactory.modelVersion},admin:{factory:m.adminDomain.domainFactory,modelVersion:m.adminDomain.domainFactory.modelVersion,aliasMap:m.adminDomain.domainFactory.context.aliasMap,entityReflections:m.adminDomain.domainFactory.context.entityReflections,$entityReflections:m.adminDomain.domainFactory.context.$entityReflections,expressions:m.adminDomain.domainFactory.context.expressions,actions:m.adminDomain.domainFactory.context.actions,actionImplementations:m.adminDomain.domainFactory.context.actionImplementations,allowedRootEntityTypes:m.adminDomain.domainFactory.context.allowedRootEntityTypes,migrate:m.adminDomain.domainFactory.context.migrate,preset:c,componentOptics:f,navigationStates:m.adminNavigation?.navigationStates??[],viewStates:m.adminNavigation?.viewStates??[],handlers:l,handlerHashes:x,elements:p,elementHashes:g}}};
@@ -1 +1 @@
1
- import{createSelector as e}from"@salsita-ai/common/utils";import{buildAssistantManifest as t}from"../../application/assistant/index.js";import{systemElementRegistry as n}from"./module-checks/index.js";export const createSpecSelectors=a=>{let{getState:s}=a,r=e.withTypes(),o=r([r.leaf(e=>e.spec)],e=>e),l=r([o],e=>e.version),i=r([o],e=>e.baseResourcesUrl),m=r([o],e=>e.configurator),g=r([o],e=>e.dataConfig),p=r([o],e=>e.chunks),d=r([o],e=>e.publishedDataHash),c=r([o],e=>e.initialPublishedData),u=r([o],e=>e.canCreate),h=r([o],e=>e.enableAdminRelease),y=r([o],e=>e.textLanguages),f=r([m],e=>e.modelVersion),C=r([o],e=>e.admin),x=r([C],e=>e.preset),A=r([C],e=>e.modelVersion),E=r([m],e=>e.theme),b=r([m],e=>e.assistant),H=r([b],e=>e?t(e):null),D=r([m],e=>e.factory),P=r([C],e=>e.factory),S=r([m],e=>e.componentOptics),w=r([C],e=>e.componentOptics),O=r([m],e=>e.appLoader),T=r([m],e=>e.preview),V=r([m],e=>e.alwaysExpand),L=r([m],e=>e.presets),R=r([m],e=>e.deploymentQueryDisabled),U=r([m],e=>e.prefetchTextureUrls),k=r([m],e=>e.handlerHashes),v=r([m],e=>e.handlers),j=r([v,k],(e,t)=>({...(e=>{let t={},n={},a={};for(let s of e)"phoenix"===s.type&&(t[s.name]=s.handler),"system"===s.type&&(n[s.name]=s.handler),"system-async"===s.type&&(a[s.name]=s.handler);return{handlers:t,systemHandlers:n,systemAsyncHandlers:a}})(e),hashes:t})),F=r([m],e=>e.elementHashes),M=r([m],e=>e.elements),Q=r([M,F],(e,t)=>({...(e=>{let t={},a={};for(let n of e)"layout"===n.type&&(t[n.name]=n.element),"entity"===n.type&&(a[n.name]=n.element);return{entityElements:{...n.entityElements,...a},layoutElements:{...n.layoutElements,...t}}})(e),hashes:t}));return{selectSpec:o,selectVersion:l,selectBaseResourcesUrl:i,selectConfiguratorSpec:m,selectConfiguratorModelVersion:f,selectAdminSpec:C,selectAdminPreset:x,selectAdminModelVersion:A,selectThemeOptions:E,selectAssistant:H,selectConfiguratorFactory:D,selectAdminFactory:P,selectConfiguratorComponentOptics:S,selectAdminComponentOptics:w,selectAppLoader:O,selectPreview:T,selectAlwaysExpand:V,selectPresetSeed:L,selectDeploymentQueryDisabled:R,selectPrefetchTextureUrls:U,selectTextLanguages:y,selectHandlerHashes:k,selectHandlers:v,selectHandlerSlots:j,selectElementHashes:F,selectElements:M,selectElementSlots:Q,selectDataConfig:g,selectChunks:p,selectPublishedDataHash:d,selectInitialPublishedData:c,selectCanCreate:u,selectEnableAdminRelease:h,getVersion:()=>l(s()),getBaseResourcesUrl:()=>i(s()),getConfiguratorSpec:()=>m(s()),getConfiguratorModelVersion:()=>f(s()),getAdminSpec:()=>C(s()),getAdminPreset:()=>x(s()),getAdminModelVersion:()=>A(s()),getThemeOptions:()=>E(s()),getAssistant:()=>H(s()),getConfiguratorFactory:()=>D(s()),getAdminFactory:()=>P(s()),getConfiguratorComponentOptics:()=>S(s()),getAdminComponentOptics:()=>w(s()),getAppLoader:()=>O(s()),getPreview:()=>T(s()),getAlwaysExpand:()=>V(s()),getPresetSeed:()=>L(s()),getDeploymentQueryDisabled:()=>R(s()),getPrefetchTextureUrls:()=>U(s()),getTextLanguages:()=>y(s()),getHandlerHashes:()=>k(s()),getHandlers:()=>v(s()),getHandlerSlots:()=>j(s()),getElementHashes:()=>F(s()),getElements:()=>M(s()),getElementSlots:()=>Q(s()),getDataConfig:()=>g(s()),getChunks:()=>p(s()),getPublishedDataHash:()=>d(s()),getInitialPublishedData:()=>c(s()),getCanCreate:()=>u(s()),getEnableAdminRelease:()=>h(s())}};
1
+ import{createSelector as e}from"@salsita-ai/common/utils";import{buildAssistantManifest as t}from"../../application/assistant/index.js";import{systemElementRegistry as n}from"./module-checks/index.js";export const createSpecSelectors=a=>{let{getState:s}=a,r=e.withTypes(),l=r([r.leaf(e=>e.spec)],e=>e),o=r([l],e=>e.version),i=r([l],e=>e.baseResourcesUrl),m=r([l],e=>e.configurator),g=r([l],e=>e.dataConfig),p=r([l],e=>e.chunks),d=r([l],e=>e.publishedDataHash),c=r([l],e=>e.initialPublishedData),u=r([l],e=>e.canCreate),h=r([l],e=>e.enableAdminRelease),y=r([l],e=>e.textLanguages),f=r([m],e=>e.modelVersion),C=r([l],e=>e.admin),E=r([C],e=>e.preset),x=r([C],e=>e.modelVersion),A=r([m],e=>e.theme),b=r([m],e=>e.assistant),H=r([b],e=>e?t(e):null),D=r([m],e=>e.factory),P=r([C],e=>e.factory),S=r([m],e=>e.componentOptics),w=r([C],e=>e.componentOptics),O=r([m],e=>e.appLoader),T=r([m],e=>e.preview),V=r([m],e=>e.alwaysExpand),L=r([m],e=>e.presets),R=r([m],e=>e.deploymentQueryDisabled),U=r([m],e=>e.prefetchTextureUrls),k=r([m],e=>e.handlerHashes),v=r([m],e=>e.handlers),j=r([v,k],(e,t)=>({...(e=>{let t={},n={},a={};for(let s of e)"phoenix"===s.type&&(t[s.name]=s.handler),"system"===s.type&&(n[s.name]=s.handler),"system-async"===s.type&&(a[s.name]=s.handler);return{handlers:t,systemHandlers:n,systemAsyncHandlers:a}})(e),hashes:t})),F=r([m],e=>e.elementHashes),M=r([m],e=>e.elements),Q=r([m],e=>e.defaultElements),B=r([Q,M,F],(e,t,a)=>({...(e=>{let t={},a={};for(let n of e)"layout"===n.type&&(t[n.name]=n.element),"entity"===n.type&&(a[n.name]=n.element);return{entityElements:{...n.entityElements,...a},layoutElements:{...n.layoutElements,...t}}})([...e,...t]),hashes:a}));return{selectSpec:l,selectVersion:o,selectBaseResourcesUrl:i,selectConfiguratorSpec:m,selectConfiguratorModelVersion:f,selectAdminSpec:C,selectAdminPreset:E,selectAdminModelVersion:x,selectThemeOptions:A,selectAssistant:H,selectConfiguratorFactory:D,selectAdminFactory:P,selectConfiguratorComponentOptics:S,selectAdminComponentOptics:w,selectAppLoader:O,selectPreview:T,selectAlwaysExpand:V,selectPresetSeed:L,selectDeploymentQueryDisabled:R,selectPrefetchTextureUrls:U,selectTextLanguages:y,selectHandlerHashes:k,selectHandlers:v,selectHandlerSlots:j,selectElementHashes:F,selectElements:M,selectElementSlots:B,selectDataConfig:g,selectChunks:p,selectPublishedDataHash:d,selectInitialPublishedData:c,selectCanCreate:u,selectEnableAdminRelease:h,getVersion:()=>o(s()),getBaseResourcesUrl:()=>i(s()),getConfiguratorSpec:()=>m(s()),getConfiguratorModelVersion:()=>f(s()),getAdminSpec:()=>C(s()),getAdminPreset:()=>E(s()),getAdminModelVersion:()=>x(s()),getThemeOptions:()=>A(s()),getAssistant:()=>H(s()),getConfiguratorFactory:()=>D(s()),getAdminFactory:()=>P(s()),getConfiguratorComponentOptics:()=>S(s()),getAdminComponentOptics:()=>w(s()),getAppLoader:()=>O(s()),getPreview:()=>T(s()),getAlwaysExpand:()=>V(s()),getPresetSeed:()=>L(s()),getDeploymentQueryDisabled:()=>R(s()),getPrefetchTextureUrls:()=>U(s()),getTextLanguages:()=>y(s()),getHandlerHashes:()=>k(s()),getHandlers:()=>v(s()),getHandlerSlots:()=>j(s()),getElementHashes:()=>F(s()),getElements:()=>M(s()),getElementSlots:()=>B(s()),getDataConfig:()=>g(s()),getChunks:()=>p(s()),getPublishedDataHash:()=>d(s()),getInitialPublishedData:()=>c(s()),getCanCreate:()=>u(s()),getEnableAdminRelease:()=>h(s())}};