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

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 (411) hide show
  1. package/README.md +13 -12
  2. package/dist/application-spec/core/components/component-filter.d.ts +53 -0
  3. package/dist/application-spec/core/components/component-filter.js +1 -0
  4. package/dist/application-spec/core/components/index.d.ts +2 -0
  5. package/dist/application-spec/core/components/index.js +1 -0
  6. package/dist/application-spec/core/components/sdk-code-ref.d.ts +9 -0
  7. package/dist/application-spec/core/components/sdk-code-ref.js +1 -0
  8. package/dist/application-spec/core/enhanced-json-value.d.ts +0 -68
  9. package/dist/application-spec/core/enhanced-json-value.js +1 -1
  10. package/dist/application-spec/core/expressions/index.d.ts +2 -0
  11. package/dist/application-spec/core/expressions/index.js +1 -0
  12. package/dist/application-spec/core/expressions/relation-expression-params.d.ts +11 -0
  13. package/dist/application-spec/core/expressions/relation-expression-params.js +1 -0
  14. package/dist/application-spec/core/expressions/sdk-expression-implementation.d.ts +24 -0
  15. package/dist/application-spec/core/expressions/sdk-expression-implementation.js +1 -0
  16. package/dist/application-spec/core/index.d.ts +2 -0
  17. package/dist/application-spec/core/index.js +1 -1
  18. package/dist/application-spec/core/json-value.d.ts +1 -1
  19. package/dist/application-spec/{core → enhanced-json}/eval-to-constant.d.ts +1 -1
  20. package/dist/application-spec/enhanced-json/index.d.ts +4 -0
  21. package/dist/application-spec/enhanced-json/index.js +1 -0
  22. package/dist/application-spec/enhanced-json/is-enhanced-json-array.d.ts +2 -0
  23. package/dist/application-spec/enhanced-json/is-enhanced-json-array.js +1 -0
  24. package/dist/application-spec/enhanced-json/resolve-enhanced-json-value.d.ts +18 -0
  25. package/dist/application-spec/enhanced-json/resolve-enhanced-json-value.js +1 -0
  26. package/dist/application-spec/enhanced-json/schema-from-value.d.ts +24 -0
  27. package/dist/application-spec/enhanced-json/schema-from-value.js +1 -0
  28. package/dist/application-spec/enhanced-json/stringify-enhanced-json-value.d.ts +14 -0
  29. package/dist/application-spec/enhanced-json/stringify-enhanced-json-value.js +1 -0
  30. package/dist/application-spec/enhanced-json/validate-enhanced-json-value-caps.d.ts +12 -0
  31. package/dist/application-spec/enhanced-json/validate-enhanced-json-value-caps.js +1 -0
  32. package/dist/application-spec/enhanced-json/validate-no-legacy-code-ref.d.ts +13 -0
  33. package/dist/application-spec/enhanced-json/validate-no-legacy-code-ref.js +1 -0
  34. package/dist/application-spec/errors/diagnostic-codes.d.ts +4 -0
  35. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  36. package/dist/application-spec/errors/diagnostic-messages.d.ts +7 -0
  37. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  38. package/dist/application-spec/generate-application/code/generate-application-code.d.ts +3 -2
  39. package/dist/application-spec/generate-application/code/generate-application-code.js +1 -1
  40. package/dist/application-spec/generate-application/code/project-scaffolding.d.ts +9 -4
  41. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  42. package/dist/application-spec/generate-application/code/standalone-app-files.d.ts +2 -2
  43. package/dist/application-spec/generate-application/code/standalone-app-files.js +1 -1
  44. package/dist/application-spec/generate-application/code/templates/configurator-config.js +6 -4
  45. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-component-optics.js +4 -4
  46. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-defaults.js +1 -1
  47. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +41 -40
  48. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +3 -0
  49. package/dist/application-spec/generate-application/code/templates/frontend-config.js +3 -5
  50. package/dist/application-spec/generate-application/code/templates/gitignore.js +1 -2
  51. package/dist/application-spec/generate-application/code/templates/globals.js +3 -3
  52. package/dist/application-spec/generate-application/code/templates/index.d.ts +1 -1
  53. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  54. package/dist/application-spec/generate-application/code/templates/package-json.js +1 -1
  55. package/dist/application-spec/generate-application/code/templates/root-tsconfig.d.ts +6 -0
  56. package/dist/application-spec/generate-application/code/templates/root-tsconfig.js +2 -0
  57. package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -1
  58. package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +9 -3
  59. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  60. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +15 -7
  61. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
  62. package/dist/application-spec/generate-application/code/templates/tsconfig.d.ts +5 -0
  63. package/dist/application-spec/generate-application/code/templates/tsconfig.js +1 -1
  64. package/dist/application-spec/generate-application/code/templates/webhook-index.d.ts +6 -1
  65. package/dist/application-spec/generate-application/code/templates/webhook-index.js +10 -1
  66. package/dist/application-spec/generate-application/code/templates/webhooks-config.js +2 -3
  67. package/dist/application-spec/generate-application/index.d.ts +2 -0
  68. package/dist/application-spec/generate-application/index.js +1 -1
  69. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +6 -2
  70. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
  71. package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +8 -1
  72. package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
  73. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +5 -1
  74. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
  75. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +43 -0
  76. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.js +1 -0
  77. package/dist/application-spec/generate-application/runtime/factory-data/index.d.ts +3 -0
  78. package/dist/application-spec/generate-application/runtime/factory-data/index.js +1 -0
  79. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.d.ts +13 -0
  80. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +1 -0
  81. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +16 -0
  82. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +1 -0
  83. package/dist/application-spec/generate-application/runtime/migrations/index.d.ts +1 -0
  84. package/dist/application-spec/generate-application/runtime/migrations/index.js +1 -0
  85. package/dist/application-spec/generate-application/runtime/migrations/migration-runtime.d.ts +53 -0
  86. package/dist/application-spec/generate-application/runtime/migrations/migration-runtime.js +1 -0
  87. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +1 -1
  88. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
  89. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
  90. package/dist/application-spec/index.d.ts +1 -0
  91. package/dist/application-spec/index.js +1 -1
  92. package/dist/application-spec/parse-application-files/categorize/categorize-files.d.ts +16 -0
  93. package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
  94. package/dist/application-spec/parse-application-files/categorize/earlier-generated-tsconfig.d.ts +9 -0
  95. package/dist/application-spec/parse-application-files/categorize/earlier-generated-tsconfig.js +1 -0
  96. package/dist/application-spec/parse-application-files/categorize/module-analysis.d.ts +1 -1
  97. package/dist/application-spec/parse-application-files/categorize/module-analysis.js +1 -1
  98. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +16 -3
  99. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  100. package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
  101. package/dist/application-spec/parse-application-files/spec/components/component-entry.d.ts +1 -9
  102. package/dist/application-spec/parse-application-files/spec/components/component-entry.js +1 -1
  103. package/dist/application-spec/parse-application-files/spec/components/component-filter.d.ts +1 -54
  104. package/dist/application-spec/parse-application-files/spec/components/component-filter.js +1 -1
  105. package/dist/application-spec/parse-application-files/spec/components/index.d.ts +1 -1
  106. package/dist/application-spec/parse-application-files/spec/components/index.js +1 -1
  107. package/dist/application-spec/parse-application-files/spec/expressions/expression.d.ts +1 -28
  108. package/dist/application-spec/parse-application-files/spec/expressions/expression.js +1 -1
  109. package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +1 -1
  110. package/dist/application-spec/parse-application-files/spec/expressions/expressions.js +1 -1
  111. package/dist/application-spec/parse-application-files/spec/expressions/index.d.ts +0 -1
  112. package/dist/application-spec/parse-application-files/spec/expressions/index.js +1 -1
  113. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.js +1 -1
  114. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.js +1 -1
  115. package/dist/application-spec/parse-application-files/spec/model/defaults.js +1 -1
  116. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  117. package/dist/client/phoenix-api.d.ts +463 -0
  118. package/dist/configurator/application-runtime/extensions/create-configurator-extensions.js +1 -1
  119. package/dist/configurator/application-runtime/extensions/selectors.d.ts +3 -1
  120. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  121. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +32 -1
  122. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  123. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +7 -1
  124. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  125. package/dist/configurator/application-runtime/extensions/systems/drag-and-drop-system/drag-and-drop-system.d.ts +3 -3
  126. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +20 -4
  127. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  128. package/dist/configurator/application-runtime/extensions/systems/graphql-system/inject-assistant-lenses.d.ts +11 -0
  129. package/dist/configurator/application-runtime/extensions/systems/graphql-system/inject-assistant-lenses.js +1 -0
  130. package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.d.ts +2 -2
  131. package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.js +1 -1
  132. package/dist/configurator/common/configurator-interface.d.ts +22 -1
  133. package/dist/configurator/common/configurator-interface.js +1 -1
  134. package/dist/configurator/common/frontend-analytics.d.ts +2 -0
  135. package/dist/configurator/common/frontend-analytics.js +1 -1
  136. package/dist/configurator/common/index.d.ts +2 -0
  137. package/dist/configurator/common/index.js +1 -1
  138. package/dist/configurator/common/use-finalize-action.d.ts +31 -0
  139. package/dist/configurator/common/use-finalize-action.js +1 -0
  140. package/dist/configurator/common/use-reset-camera.d.ts +6 -0
  141. package/dist/configurator/common/use-reset-camera.js +1 -0
  142. package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.d.ts +1 -1
  143. package/dist/configurator/pages/DefaultConfiguratorLayout.d.ts +2 -2
  144. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  145. package/dist/configurator/pages/configurator-layout-name.d.ts +2 -0
  146. package/dist/configurator/pages/configurator-layout-name.js +1 -0
  147. package/dist/configurator/pages/default-configurator-elements.d.ts +7 -0
  148. package/dist/configurator/pages/default-configurator-elements.js +1 -0
  149. package/dist/configurator/pages/index.d.ts +1 -0
  150. package/dist/configurator/pages/index.js +1 -1
  151. package/dist/configurator/scene/scene-controls/hotspot-drag-handle/HotspotDragHandle.d.ts +1 -1
  152. package/dist/configurator/scene/scene-controls/hotspot-drag-handle/HotspotDragSceneHandle.d.ts +1 -1
  153. package/dist/configurator/scene/scene-entity/dimension-indicators/DimensionIndicator.d.ts +1 -1
  154. package/dist/configurator/scene/scene-entity/dimension-indicators/DimensionIndicatorInternal.d.ts +1 -1
  155. package/dist/configurator/scene/scene-entity/drag-and-drop/shared.d.ts +2 -2
  156. package/dist/configurator/scene/scene-entity/drag-and-drop/use-drag-object.d.ts +1 -1
  157. package/dist/configurator/scene/scene-entity/materials/RemoteReplacedMaterial.js +1 -1
  158. package/dist/configurator/scene/scene-entity/objects/SceneEntityObjectTextDecal.d.ts +1 -1
  159. package/dist/configurator/ui/assistant/AssistantChips.d.ts +8 -2
  160. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  161. package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +1 -1
  162. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
  163. package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
  164. package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.d.ts +13 -0
  165. package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.js +1 -0
  166. package/dist/configurator/ui/assistant/entity-link/entity-link-selection.d.ts +22 -0
  167. package/dist/configurator/ui/assistant/entity-link/entity-link-selection.js +1 -0
  168. package/dist/configurator/ui/assistant/entity-link/entity-link-state.d.ts +27 -0
  169. package/dist/configurator/ui/assistant/entity-link/entity-link-state.js +1 -0
  170. package/dist/configurator/ui/assistant/entity-link/entity-link-target.d.ts +5 -0
  171. package/dist/configurator/ui/assistant/entity-link/entity-link-target.js +1 -0
  172. package/dist/configurator/ui/assistant/entity-link/index.d.ts +3 -0
  173. package/dist/configurator/ui/assistant/entity-link/index.js +1 -0
  174. package/dist/configurator/ui/configurator-layout/sidebar-keys/index.d.ts +1 -0
  175. package/dist/configurator/ui/configurator-layout/sidebar-keys/index.js +1 -0
  176. package/dist/configurator/ui/configurator-layout/sidebar-keys/sidebar-keys.d.ts +11 -0
  177. package/dist/configurator/ui/configurator-layout/sidebar-keys/sidebar-keys.js +1 -0
  178. package/dist/configurator/ui/configurator-layout/{universal → slots/desktop-sidebar}/DesktopSidebar.d.ts +23 -14
  179. package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/DesktopSidebar.js +16 -0
  180. package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/index.d.ts +1 -0
  181. package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/index.js +1 -0
  182. package/dist/configurator/ui/configurator-layout/slots/services/InvariantViolations.d.ts +4 -4
  183. package/dist/configurator/ui/configurator-layout/slots/services/InvariantViolations.js +1 -1
  184. package/dist/configurator/ui/configurator-layout/slots/services/SideEffects.d.ts +3 -6
  185. package/dist/configurator/ui/configurator-layout/slots/services/SideEffects.js +1 -1
  186. package/dist/configurator/ui/configurator-layout/slots/slots.d.ts +1 -0
  187. package/dist/configurator/ui/configurator-layout/slots/slots.js +1 -1
  188. package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.d.ts +1 -1
  189. package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.js +2 -2
  190. package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.d.ts +2 -2
  191. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.d.ts +2 -2
  192. package/dist/docs/dimensions/3d-scene-integration/dimension-indicators.mdx +2 -2
  193. package/dist/docs/dimensions/3d-scene-integration/editable-angle-indicator.mdx +1 -1
  194. package/dist/docs/dimensions/3d-scene-integration/editable-distance-dimension-indicator.mdx +1 -1
  195. package/dist/docs/dimensions/3d-scene-integration/list-selector-dimension-indicator.mdx +1 -1
  196. package/dist/docs/drag-and-drop/drag-handle.mdx +1 -1
  197. package/dist/docs/drag-and-drop/hotspot-handle.mdx +1 -1
  198. package/dist/docs/drag-and-drop/planes.mdx +1 -1
  199. package/dist/docs/drag-and-drop/rotatable.mdx +2 -2
  200. package/dist/docs/index.json +42 -1
  201. package/dist/docs/layouts/custom-layout.mdx +2125 -0
  202. package/dist/docs/layouts/header/fixed.mdx +2 -2
  203. package/dist/docs/layouts/header/floating.mdx +2 -2
  204. package/dist/docs/layouts/sidebar/in-a-custom-layout.mdx +380 -0
  205. package/dist/docs/layouts/sidebar-footer/basic.mdx +32 -77
  206. package/dist/docs/other-features/client-side-rendering/declarative.mdx +1 -1
  207. package/dist/docs/other-features/transformers.mdx +4 -0
  208. package/dist/docs/phoenix/application-states.mdx +9 -7
  209. package/dist/docs/phoenix/configurator-interface.mdx +136 -18
  210. package/dist/docs/phoenix/deployments.mdx +2 -6
  211. package/dist/docs/phoenix/finalization.mdx +1 -1
  212. package/dist/docs/phoenix/getting-started.mdx +1 -0
  213. package/dist/docs/phoenix/layout-slots.mdx +116 -0
  214. package/dist/docs/phoenix/localization.mdx +4 -4
  215. package/dist/docs/phoenix/migration-guide.mdx +19 -8
  216. package/dist/docs/phoenix/phoenix-cli.mdx +44 -8
  217. package/dist/docs/phoenix/project-structure.mdx +23 -7
  218. package/dist/docs/phoenix/sdk-builder-workflow.mdx +2 -2
  219. package/dist/docs/phoenix/testing.mdx +140 -0
  220. package/dist/docs/phoenix/webhook-membership.mdx +10 -9
  221. package/dist/docs/phoenix/webhooks.mdx +21 -4
  222. package/dist/domain/application/application-config.d.ts +3 -1
  223. package/dist/domain/application/assistant/assistant-fields.d.ts +12 -0
  224. package/dist/domain/application/assistant/assistant-fields.js +1 -0
  225. package/dist/domain/application/assistant/assistant-manifest.d.ts +9 -1
  226. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +38 -2
  227. package/dist/domain/application/assistant/assistant-resolved-manifest.js +1 -1
  228. package/dist/domain/application/assistant/build-assistant-lenses.d.ts +14 -0
  229. package/dist/domain/application/assistant/build-assistant-lenses.js +5 -0
  230. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  231. package/dist/domain/application/assistant/create-assistant-execution-schema.d.ts +32 -0
  232. package/dist/domain/application/assistant/create-assistant-execution-schema.js +1 -0
  233. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  234. package/dist/domain/application/assistant/index.d.ts +6 -1
  235. package/dist/domain/application/assistant/index.js +1 -1
  236. package/dist/domain/application/assistant/session-setup/AssistantSetupHandler.d.ts +20 -0
  237. package/dist/domain/application/assistant/session-setup/AssistantSetupHandler.js +1 -0
  238. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.d.ts +10 -0
  239. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -0
  240. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +48 -0
  241. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -0
  242. package/dist/domain/application/assistant/session-setup/create-session-assistant.d.ts +15 -0
  243. package/dist/domain/application/assistant/session-setup/create-session-assistant.js +1 -0
  244. package/dist/domain/application/assistant/session-setup/index.d.ts +4 -0
  245. package/dist/domain/application/assistant/session-setup/index.js +1 -0
  246. package/dist/domain/application/configurator-builder.d.ts +5 -2
  247. package/dist/domain/application/configurator-builder.js +1 -1
  248. package/dist/domain/core/expression/constant-expressions.d.ts +16 -8
  249. package/dist/domain/core/invariant/violation.d.ts +50 -2
  250. package/dist/domain/core/invariant/violation.js +1 -1
  251. package/dist/domain/core/model/model.d.ts +1 -1
  252. package/dist/domain/domain-context/index.d.ts +1 -1
  253. package/dist/domain/domain-context/undo-system.d.ts +28 -1
  254. package/dist/domain/domain-context/undo-system.js +1 -1
  255. package/dist/domain/domain-runtime/access/selectors.d.ts +9 -0
  256. package/dist/domain/domain-runtime/access/selectors.js +1 -1
  257. package/dist/domain/domain-runtime/access/types.d.ts +2 -0
  258. package/dist/domain/domain-runtime/access/types.js +1 -1
  259. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  260. package/dist/domain/domain-runtime/domain-context/types.d.ts +4 -1
  261. package/dist/domain/domain-runtime/domain-runtime.d.ts +16 -0
  262. package/dist/domain/domain-runtime/errors/implementation-error-collector.d.ts +19 -0
  263. package/dist/domain/domain-runtime/errors/implementation-error-collector.js +1 -0
  264. package/dist/domain/domain-runtime/errors/implementation-error.d.ts +46 -0
  265. package/dist/domain/domain-runtime/errors/implementation-error.js +1 -0
  266. package/dist/domain/domain-runtime/errors/implementation-errors.d.ts +13 -0
  267. package/dist/domain/domain-runtime/errors/implementation-errors.js +1 -0
  268. package/dist/domain/domain-runtime/errors/index.d.ts +4 -0
  269. package/dist/domain/domain-runtime/errors/index.js +1 -0
  270. package/dist/domain/domain-runtime/errors/to-implementation-errors.d.ts +10 -0
  271. package/dist/domain/domain-runtime/errors/to-implementation-errors.js +1 -0
  272. package/dist/domain/domain-runtime/index.d.ts +1 -0
  273. package/dist/domain/domain-runtime/index.js +1 -1
  274. package/dist/domain/domain-runtime/spec/initialize.d.ts +11 -0
  275. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  276. package/dist/domain/domain-runtime/spec/module-checks/project-modules.d.ts +8 -1
  277. package/dist/domain/domain-runtime/spec/module-checks/project-modules.js +1 -1
  278. package/dist/domain/domain-runtime/spec/module-checks/resolve-action-modules.js +1 -1
  279. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.js +1 -1
  280. package/dist/domain/domain-runtime/spec/module-checks/resolve-imported-transformers.js +1 -1
  281. package/dist/domain/domain-runtime/spec/module-checks/resolve-invariant-modules.js +1 -1
  282. package/dist/domain/domain-runtime/spec/selectors.js +1 -1
  283. package/dist/domain/domain-runtime/spec/types.d.ts +2 -0
  284. package/dist/domain/extensions/attribute-switch.d.ts +1 -1
  285. package/dist/domain/extensions/attribute-switch.js +1 -1
  286. package/dist/domain/extensions/canvas-config.d.ts +1 -1
  287. package/dist/domain/extensions/client-side-image.d.ts +2 -2
  288. package/dist/domain/extensions/client-side-image.js +1 -1
  289. package/dist/domain/extensions/common/angle-indicator-schema.d.ts +2 -2
  290. package/dist/domain/extensions/common/dimension-indicator-schema.d.ts +2 -2
  291. package/dist/domain/extensions/editable-angle-indicator.d.ts +1 -1
  292. package/dist/domain/extensions/editable-distance-dimension-indicator.d.ts +1 -1
  293. package/dist/domain/extensions/editable-offset-indicator.d.ts +1 -1
  294. package/dist/domain/extensions/editable-offset-indicator.js +1 -1
  295. package/dist/domain/extensions/fit-selection-orthographic-camera-component.js +1 -1
  296. package/dist/domain/extensions/fit-selection-perspective-camera-component.js +1 -1
  297. package/dist/domain/extensions/horizontal-tabs.d.ts +2 -2
  298. package/dist/domain/extensions/list-selector-dimension-indicator.d.ts +1 -1
  299. package/dist/domain/extensions/navigation-steps.d.ts +2 -2
  300. package/dist/domain/extensions/offset-indicator.js +1 -1
  301. package/dist/domain/extensions/rotation-handle.d.ts +2 -2
  302. package/dist/domain/extensions/save-template-thumbnail.d.ts +2 -2
  303. package/dist/domain/extensions/save-template-thumbnail.js +1 -1
  304. package/dist/domain/extensions/scene-entity-animation.js +1 -1
  305. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +9 -0
  306. package/dist/domain/mocks/create-mock-domain-runtime.js +1 -1
  307. package/dist/domain/mocks/create-mock-domain.js +1 -1
  308. package/dist/domain/mocks/create-test-application-config.d.ts +59 -0
  309. package/dist/domain/mocks/create-test-application-config.js +1 -0
  310. package/dist/domain/mocks/index.d.ts +1 -0
  311. package/dist/domain/mocks/index.js +1 -1
  312. package/dist/domain/system-components/application-config.d.ts +2 -2
  313. package/dist/domain/system-components/child-entity-selection.js +1 -1
  314. package/dist/domain/system-components/collision-box-geometry.d.ts +4 -2
  315. package/dist/domain/system-components/collision-geometry.d.ts +4 -2
  316. package/dist/domain/system-components/collision-point-geometry.d.ts +4 -2
  317. package/dist/domain/system-components/common/material-override-schema.d.ts +2 -2
  318. package/dist/domain/system-components/common/recipes.d.ts +21 -3
  319. package/dist/domain/system-components/common/recipes.js +1 -1
  320. package/dist/domain/system-components/constraint.d.ts +10 -23
  321. package/dist/domain/system-components/drag-handle.d.ts +1 -1
  322. package/dist/domain/system-components/drag-handle.js +1 -1
  323. package/dist/domain/system-components/fit-entity-orthographic-camera-component.js +1 -1
  324. package/dist/domain/system-components/fit-entity-perspective-camera-component.js +1 -1
  325. package/dist/domain/system-components/fit-root-orthographic-camera-component.js +1 -1
  326. package/dist/domain/system-components/fit-root-perspective-camera-component.js +1 -1
  327. package/dist/domain/system-components/hotspot-drag-handle.d.ts +1 -1
  328. package/dist/domain/system-components/hotspot-drag-handle.js +1 -1
  329. package/dist/domain/system-components/material-swatch.js +1 -1
  330. package/dist/domain/system-components/scene-entity-material-override.d.ts +1 -1
  331. package/dist/domain/system-components/scene-entity-object-material-override.d.ts +1 -1
  332. package/dist/domain/system-components/scene-entity-object-text-decal.d.ts +1 -1
  333. package/dist/domain/system-components/scene-entity-object-transimissive-material-override.d.ts +1 -1
  334. package/dist/domain/system-components/scene-entity-transimissive-material-override.d.ts +1 -1
  335. package/dist/domain/system-components/static-orthographic-camera-component.js +1 -1
  336. package/dist/domain/system-components/static-perspective-camera-component.js +1 -1
  337. package/dist/editor/mocks/EditorMockContext.js +1 -1
  338. package/dist/globals/index.d.ts +2 -0
  339. package/dist/i18n/locales/cs/messages.js +1 -1
  340. package/dist/i18n/locales/da/messages.js +1 -1
  341. package/dist/i18n/locales/de/messages.js +1 -1
  342. package/dist/i18n/locales/de-AT/messages.js +1 -1
  343. package/dist/i18n/locales/en/messages.js +1 -1
  344. package/dist/i18n/locales/en-AU/messages.js +1 -1
  345. package/dist/i18n/locales/en-GB/messages.js +1 -1
  346. package/dist/i18n/locales/es/messages.js +1 -1
  347. package/dist/i18n/locales/fr/messages.js +1 -1
  348. package/dist/i18n/locales/hu/messages.js +1 -1
  349. package/dist/i18n/locales/it/messages.js +1 -1
  350. package/dist/i18n/locales/nl/messages.js +1 -1
  351. package/dist/i18n/locales/pl/messages.js +1 -1
  352. package/dist/i18n/locales/pt/messages.js +1 -1
  353. package/dist/i18n/locales/ro/messages.js +1 -1
  354. package/dist/i18n/locales/sk/messages.js +1 -1
  355. package/dist/i18n/locales/tr/messages.js +1 -1
  356. package/dist/legacy/domain-cli/gen/constant-expressions.js +1 -1
  357. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  358. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  359. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +81 -68
  360. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
  361. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
  362. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
  363. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +7 -1
  364. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-admin.js +18 -16
  365. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-configurator.js +14 -12
  366. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +13 -11
  367. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-configurator.js +13 -11
  368. package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
  369. package/dist/phoenix/application-spec/project-files.js +1 -1
  370. package/dist/phoenix/cli.js +1 -1
  371. package/dist/phoenix/commands/check.js +1 -1
  372. package/dist/phoenix/commands/deploy.js +1 -1
  373. package/dist/phoenix/commands/deps/deps.d.ts +52 -0
  374. package/dist/phoenix/commands/deps/deps.js +3 -0
  375. package/dist/phoenix/commands/deps/index.d.ts +1 -0
  376. package/dist/phoenix/commands/deps/index.js +1 -0
  377. package/dist/phoenix/commands/deps/sdk-manifest.d.ts +12 -0
  378. package/dist/phoenix/commands/deps/sdk-manifest.js +1 -0
  379. package/dist/phoenix/commands/dev.js +5 -5
  380. package/dist/phoenix/commands/fix.js +1 -1
  381. package/dist/phoenix/commands/index.d.ts +1 -0
  382. package/dist/phoenix/commands/index.js +1 -1
  383. package/dist/phoenix/services/application-spec-project-watcher.d.ts +2 -0
  384. package/dist/phoenix/services/application-spec-project-watcher.js +3 -3
  385. package/dist/phoenix/services/source-archive.d.ts +1 -0
  386. package/dist/phoenix/services/source-archive.js +1 -1
  387. package/dist/phoenix/services/swc.js +1 -1
  388. package/dist/phoenix/utils/index.d.ts +1 -0
  389. package/dist/phoenix/utils/index.js +1 -1
  390. package/dist/react-sdk/application-runtime/hooks/use-access-service.d.ts +2 -0
  391. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  392. package/dist/react-sdk/application-runtime/routing/access-service.d.ts +1 -0
  393. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +17 -0
  394. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
  395. package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.d.ts +30 -0
  396. package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.js +1 -0
  397. package/dist/react-sdk/domain-context/index.d.ts +2 -1
  398. package/dist/react-sdk/domain-context/index.js +1 -1
  399. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.d.ts +5 -0
  400. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
  401. package/dist/react-sdk/domain-controls/hooks/use-angle-dimension.d.ts +1 -1
  402. package/dist/ui-sdk/theme/types.d.ts +1 -1
  403. package/dist/webhook/builders/webhook-builder.js +1 -1
  404. package/package.json +33 -29
  405. package/schema/domain-spec.json +1115 -209
  406. package/dist/application-spec/generate-application/code/templates/webhook-implementation.d.ts +0 -1
  407. package/dist/application-spec/generate-application/code/templates/webhook-implementation.js +0 -7
  408. package/dist/configurator/ui/configurator-layout/universal/DesktopSidebar.js +0 -16
  409. /package/dist/application-spec/{core → enhanced-json}/eval-code-uses-self.d.ts +0 -0
  410. /package/dist/application-spec/{core → enhanced-json}/eval-code-uses-self.js +0 -0
  411. /package/dist/application-spec/{core → enhanced-json}/eval-to-constant.js +0 -0
@@ -137,8 +137,8 @@ The same streams are available in the editor's **Logs** sidebar panel with per-s
137
137
 
138
138
  Runs all code quality checks in sequence:
139
139
 
140
- 1. **TypeScript** — Type checking with `tsc`
141
- 2. **ESLint** — Linting rules
140
+ 1. **TypeScript** — Type checking with `tsc`, with the project's root `tsconfig.json`, or with `.phoenix/tsconfig.json` when the project has none (see [Project Structure](?path=/docs/phoenix-project-structure--docs#root-level-files))
141
+ 2. **ESLint** — Linting rules, over `src/`; a project with no files there passes
142
142
  3. **Prettier** — Code formatting
143
143
 
144
144
  ### `phoenix fix`
@@ -147,12 +147,23 @@ Auto-fixes ESLint and Prettier issues. Equivalent to running `eslint --fix` and
147
147
 
148
148
  ## Environment Variables
149
149
 
150
- When you run `deployment:prepare-local` or `deployment:prepare`, the CLI communicates with the Phoenix server, which generates environment variables and writes them to `.env.generated`.
150
+ When you run `deployment:prepare-local` or `deployment:prepare`, the CLI communicates with the Phoenix server, which generates environment variables and writes them to `.env.generated`. `phoenix dev` does the same for its development deployment when it starts.
151
+
152
+ ### The generated env file
153
+
154
+ A project has one generated env file. Phoenix keeps it in `.phoenix/`, as `.phoenix/.env.generated`, unless the project has a `.env.generated` in its root, which then is the one that counts.
155
+
156
+ - `phoenix dev` reads and writes `.phoenix/.env.generated` in a project without a root `.env.generated`, and creates no file in the project root. In a project that has a root `.env.generated`, it reads and writes that file and `.phoenix/.env.generated` is not used.
157
+ - The deployment and environment commands (`deployment:prepare`, `deployment:prepare-dev`, `deployment:prepare-local`, `deployment:build-envs` and the others with an `--outFile` option) write `.env.generated` in the project root unless `--outFile` or `OUT_FILE` names another file. Deploy pipelines read it there. Once one of them has written it, `phoenix dev` and `phoenix build` use it.
158
+ - Everything that reads environment variables follows the same rule: the root `.env.generated` when it exists, otherwise `.phoenix/.env.generated`. The two files are never merged.
159
+ - `phoenix clean` removes `.phoenix/` and with it `.phoenix/.env.generated`; the next `phoenix dev` prepares the development deployment again. A root `.env.generated` stays.
160
+
161
+ This holds for a project on the application-spec pipeline. In a project on the legacy pipeline (see [Current and legacy project tooling](#current-and-legacy-project-tooling)), `phoenix dev` always reads and writes `.env.generated` in the project root.
151
162
 
152
163
  ### Data Flow
153
164
 
154
165
  ```
155
- spec/application.yaml → Server prepares environment → CLI writes .env.generated → Frontend/Webhooks read it
166
+ spec/application.yaml → Server prepares environment → CLI writes the generated env file → Frontend/Webhooks read it
156
167
  ```
157
168
 
158
169
  ### Project Scripts
@@ -173,7 +184,7 @@ A project may have other scripts than these five, such as `sync`, `test` or `ver
173
184
 
174
185
  ### Server-Generated Variables
175
186
 
176
- These are automatically computed by the server and written to `.env.generated`:
187
+ These are automatically computed by the server and written to the generated env file:
177
188
 
178
189
  | Variable | Purpose |
179
190
  | -------------------------------- | ------------------------------------------------------- |
@@ -222,7 +233,7 @@ A build pipeline that receives the source archive of a [`phoenix deploy`](#phoen
222
233
  - it refuses an archive over 200 MB, one that extracts to more than 1 GB, or one with more than 100,000 files;
223
234
  - it refuses links, special files, absolute paths, paths that leave the folder, names with control characters, and entries that repeat or collide with an earlier one;
224
235
  - it refuses an archive it cannot read to the end, such as a truncated upload;
225
- - it extracts only project files, the same set `phoenix deploy` packs, and reports the entries it left out.
236
+ - it extracts only project files and reports the entries it left out, including the optional `conversation.log` that deploy keeps in the private archive for review.
226
237
 
227
238
  `<folder>` must be new or empty. When the command refuses an archive, it removes the folder, so a partly extracted project is never built.
228
239
 
@@ -261,7 +272,7 @@ A development environment keeps the AI assistant's conversation when the assista
261
272
  Environment variables are resolved in this order (highest to lowest priority):
262
273
 
263
274
  1. Process environment variables (shell)
264
- 2. `.env.generated` (created by deployment commands)
275
+ 2. [The generated env file](#the-generated-env-file): `.env.generated` in the project root when the project has one, otherwise `.phoenix/.env.generated`
265
276
  3. `.env` (manual overrides)
266
277
 
267
278
  ### Generated Config Files
@@ -292,13 +303,16 @@ Starts the full development environment: Vite dev server, development webhook tu
292
303
  | `--region` | `PHOENIX_REGION` | `eu` | Region of the signed-in workspace, used when no server URL is set |
293
304
  | `--skipUpload` / `--su` | `SKIP_UPLOAD` | `false` | Skip the S3 asset upload when the development deployment is prepared at startup |
294
305
 
306
+ With the application-spec pipeline, `phoenix dev` creates an empty `src/` folder when the project has none, so that it rebuilds when the first source file, such as `src/webhooks/index.ts`, is added.
307
+
295
308
  In `server` persistence mode the project comes from `--projectSlug`, `PROJECT_SLUG` or `project` in the spec, and the credential from `DEVELOPMENT_KEY` or the `phoenix login` sign-in; see [Starting a New Project](#starting-a-new-project). When signed in, the environment is always your own development environment and `--environmentSlug` is ignored.
296
309
 
297
310
  The dev server watches for changes in:
298
311
 
299
312
  - `spec/**/*.yaml` — Domain specification files
300
313
  - `src/**/*.{ts,tsx,yaml,yml,json,html,css}` — Source files
301
- - `.env`, `.env.generated` — Environment files (triggers full Vite restart)
314
+ - `.env` — Environment file; a change restarts the Vite dev server
315
+ - `.env.generated`, `.phoenix/.env.generated` — Generated env files; a change rebuilds the project files. Only a file that exists when `phoenix dev` starts is watched: a root `.env.generated` that a deployment command creates while dev runs is not watched; restart `phoenix dev` to use it.
302
316
 
303
317
  When linked SDK packages are detected (`phoenix link`), changes to SDK dist files are also watched.
304
318
 
@@ -396,6 +410,24 @@ With the application-spec pipeline (see [Current and legacy project tooling](#cu
396
410
  | ---------------- | --------------- | ------- | ------------------------------ |
397
411
  | `--force` / `-f` | `FORCE_REBUILD` | `false` | Force full rebuild, skip cache |
398
412
 
413
+ ### `phoenix deps`
414
+
415
+ Brings `package.json` in line with the SDK's peer dependencies: the packages the SDK's code imports and the project installs next to it, so the project and the SDK share one copy. The `peerDependencies` of the installed `@salsita-ai/sdk` decide which packages and which versions. `@clerk/clerk-react` is needed only when the spec sets `useClerk`.
416
+
417
+ ```bash
418
+ pnpm phoenix deps
419
+ pnpm install
420
+ ```
421
+
422
+ - A missing peer is added at the lowest version of the SDK's range, as an exact version, in alphabetical order: type packages (`@types/*`) to `devDependencies`, the others to `dependencies`.
423
+ - A peer declared with a version range whose lowest version falls outside the SDK's range is set to the lowest version of the SDK's range, in the field that declares it. The output says when that is a downgrade.
424
+ - A peer declared with a specifier that is not a version range, such as `workspace:`, `npm:`, `catalog:`, `file:`, `link:` or a git URL, stays as it is.
425
+ - `@salsita-ai/common`, `@salsita-ai/contracts`, `@salsita-ai/platform-project-sdk`, `@salsita-ai/platform-common` and `@salsita-ai/platform-contracts` are removed, because `@salsita-ai/sdk` replaces them. No other entry is removed.
426
+
427
+ Every other part of `package.json` keeps its order and formatting. `phoenix deps` installs nothing: it lists each change and names `pnpm install` as the next step, or says that nothing needed to change. Running it again changes nothing. It reads the spec to learn whether the project uses Clerk, so it stops with the spec's errors when the spec does not parse.
428
+
429
+ This holds for a project on the application-spec pipeline. In a project on the legacy pipeline (see [Current and legacy project tooling](#current-and-legacy-project-tooling)), `phoenix deps` changes nothing and says that `phoenix sync` manages the dependencies.
430
+
399
431
  ### Current and legacy project tooling
400
432
 
401
433
  Use the `phoenix` binary for projects that still use domain-spec generation. The CLI selects a
@@ -705,6 +737,10 @@ Revokes the token on the server and removes it from the credentials file. `--reg
705
737
 
706
738
  Validates the spec, adds the pnpm settings `phoenix init` writes to `pnpm-workspace.yaml` when they are missing, packs and uploads the project, starts its build on the server and follows it until the configurator is live. Before the upload the server compares the domain model with the deployed one: a model that changed under an already deployed model version is refused with the reason, and needs a new model version and a [migration](?path=/docs/phoenix-migrations--docs). Once the build starts it prints `Follow the build in Studio: <url>`, the build's page in the Studio you signed in through; a sign-in stored by an older CLI has no Studio URL, so sign in again to get the link. After `Your configurator is live at <url>` it prints one line for coding agents, which tells them to offer the run evaluation of the `phoenix-feedback` skill once you have nothing more to build; you can ignore it when you run the command yourself. `--region` or `--serverUrl` selects the server, as for `login`; `--no-wait` returns as soon as the build starts.
707
739
 
740
+ To keep the conversation that led to a build, place a reviewed UTF-8 transcript in `conversation.log` at the project root before deploying. Deploy automatically includes it in the private source archive. Download the build's sources from Studio to read it; access is the same as for the rest of that build's sources. The build extractor skips the log, so it is not an application build input or a public asset. Missing logs produce a warning and deployment continues. Directories, links and special files at that path are rejected.
741
+
742
+ The Phoenix agent skill explains how to prepare the transcript: prefer a native session export; otherwise mark a reconstruction as incomplete. Preserve available user/assistant messages and tool calls, cap individual tool results at 16 KiB with explicit truncation markers, and reference images rather than embedding them. Include the agent, export time, source and known omissions. Review and redact credentials or unrelated sensitive content before approving upload. The CLI uploads the file as supplied; it does not collect agent history, redact content, check freshness or verify completeness. Remove the file from the project root to deploy without it. The log counts toward the source archive's existing size limits; there is no separate conversation upload or viewer.
743
+
708
744
  ### `phoenix feedback [message]`
709
745
 
710
746
  Sends feedback about the SDK, the CLI, the documentation or Studio to the Phoenix team. It needs `phoenix login`: the server records the workspace, user and API token of the sign-in, so the message itself needs no introduction.
@@ -44,7 +44,7 @@ project-root/
44
44
  | `invariants/` | Domain constraints |
45
45
  | `transformers/` | Data transformation logic |
46
46
  | `handlers/` | Event & lifecycle handlers |
47
- | `webhooks/` | Webhook implementations |
47
+ | `webhooks/` | Webhook implementations, entered through `index.ts` |
48
48
  | `migrations/` | Data schema migrations (v\*.ts) - auto-created based on model versions |
49
49
  | `locales/` | Locale catalogs (`.po` sources; compiled `.ts`, do not edit) |
50
50
  | `_*` | Shared code folders at any depth (not auto-imported) |
@@ -53,7 +53,11 @@ Every file in `components/`, `elements/`, `expressions/`, `actions/`, `invariant
53
53
  (and their `admin/` counterparts) is imported by its location, so its default export must be what that folder's `phx`
54
54
  factory returns, or an array of those. A file that exports anything else, such as a plain React component in
55
55
  `elements/`, stops the application at start with an `Invalid default export in <file>` error that names the expected
56
- shape. Keep plain components and helpers in a `_*` folder.
56
+ shape. When several files in `handlers/`, `elements/`, `transformers/`, `components/`, `admin/elements/` and
57
+ `admin/components/` are wrong, the error lists all of them, one numbered line per file. Keep plain components and helpers in a `_*` folder.
58
+
59
+ With the application-spec pipeline, sync does not write `src/webhooks/index.ts`, and a project without it gets a
60
+ built-in webhook; see [Webhook Entry Point](?path=/docs/phoenix-webhooks--docs#webhook-entry-point).
57
61
 
58
62
  ### Admin Folders (src/admin/)
59
63
 
@@ -179,7 +183,7 @@ type CustomMaterial = Phx['AdminModel']['CustomMaterial']
179
183
  | File | Auto-Generated? | Notes |
180
184
  | ------------------------------------------------------ | --------------- | -------------------------------------- |
181
185
  | `package.json` | Partially | Dependencies merged, scripts untouched |
182
- | `tsconfig.json` | Yes | Managed by Phoenix |
186
+ | `tsconfig.json` | Once | Yours; see below |
183
187
  | `eslint.config.js` | Yes | Managed by Phoenix |
184
188
  | `prettier.config.js` | Yes | Managed by Phoenix |
185
189
  | `.prettierignore` | No | Optional and your own; see below |
@@ -188,19 +192,29 @@ type CustomMaterial = Phx['AdminModel']['CustomMaterial']
188
192
  | `.gitignore` | Partially | Only in a git repository; see Markers |
189
193
  | `.env` | No | Git-ignored, local config |
190
194
  | `.env.example` | No | Template for env vars |
191
- | `.env.generated` | Yes | Auto-generated IDs, git-ignored |
195
+ | `.env.generated` | Yes | Optional, git-ignored; see below |
192
196
  | `README.md` | No | Project documentation |
193
197
  | `AGENTS.md` | No | Your own coding-agent instructions |
194
198
  | `.claude/skills/phoenix*/`, `.agents/skills/phoenix*/` | Yes | Phoenix agent skills |
195
199
 
196
200
  Sync does not write `README.md`, `AGENTS.md`, `.env.example`, `.env.ci` or the `README.md` files in `assets/public/` and `assets/private/`. Earlier SDK versions wrote them once; a project that has them keeps them, and they are yours to edit.
197
201
 
202
+ Phoenix keeps the generated env file, with the IDs and values of the prepared deployment, in `.phoenix/` unless the project has a `.env.generated` in its root, which then is the one that counts. `phoenix dev` creates no `.env.generated` in the project root; the deployment and environment commands write it there. See [The generated env file](?path=/docs/phoenix-phoenix-cli--docs#the-generated-env-file).
203
+
198
204
  With the application-spec pipeline (see [Current and legacy project tooling](?path=/docs/phoenix-phoenix-cli--docs#current-and-legacy-project-tooling)), Phoenix does not write a `.prettierignore`, and a fresh clone or CI checkout of a project has none. `phoenix check` and `phoenix fix` do not read one: they skip `.phoenix/`, `dist/`, the compiled catalogs in `src/locales/`, `pnpm-lock.yaml` and `.linguirc` on their own. A project that runs Prettier directly, as `prettier --check .` or from an editor, can add its own `.prettierignore`. To commit it, add a `!.prettierignore` line after the Phoenix block of `.gitignore`, because that block lists the file. The legacy pipeline writes `.prettierignore` on every sync.
199
205
 
206
+ With the application-spec pipeline, the project's TypeScript settings are in `.phoenix/tsconfig.json`, which sync rewrites with the rest of `.phoenix/`. The root `tsconfig.json` is the one editors and tools find: sync writes it only when the project has none, as a single line that extends the generated settings, and it is yours to commit and to add to:
207
+
208
+ ```json
209
+ { "extends": "./.phoenix/tsconfig.json" }
210
+ ```
211
+
212
+ The only root `tsconfig.json` sync replaces is the full file earlier SDK versions generated there, recognised by its settings; any other stays as it is. `phoenix dev`, `phoenix build` and the webhook bundle do not resolve `paths` aliases, so an alias added to the root file passes `phoenix check` and fails the build. `phoenix check` type-checks with the root `tsconfig.json`, or with `.phoenix/tsconfig.json` when the project has none. The legacy pipeline writes the full `tsconfig.json` on every sync.
213
+
200
214
  ### DO NOT EDIT (Fully Auto-Generated)
201
215
 
202
- - **Everything in `.phoenix/`** - Completely regenerated on each build. The one exception is `.phoenix/variants/`, where a coding agent writes the option files for `phoenix variants`; a rebuild keeps it
203
- - `tsconfig.json`, `eslint.config.js`, `prettier.config.js`
216
+ - **Everything in `.phoenix/`** - Completely regenerated on each build. The exceptions are `.phoenix/variants/`, where a coding agent writes the option files for `phoenix variants`, and `.phoenix/.env.generated`, the generated env file of `phoenix dev`; a rebuild keeps both
217
+ - `eslint.config.js`, `prettier.config.js`
204
218
  - `.linguirc`, `.nvmrc`
205
219
  - `src/locales/**/*.ts` - Compiled from `.po` catalogs
206
220
  - `.env.generated`
@@ -238,6 +252,7 @@ With the application-spec pipeline (see [Current and legacy project tooling](?pa
238
252
  - `templates/`
239
253
  - `package.json` (scripts section, custom dependencies)
240
254
  - `.env`, `.env.example`, `.env.ci`
255
+ - `tsconfig.json` (application-spec pipeline; keep it extending `.phoenix/tsconfig.json`)
241
256
  - `README.md`, `AGENTS.md`
242
257
 
243
258
  ## File Naming Conventions
@@ -345,6 +360,7 @@ project-root/
345
360
  │ ├── admin-interface.ts # Admin interface types
346
361
  │ ├── i18n.ts # i18n initialization
347
362
  │ ├── globals.d.ts # Global type definitions
363
+ │ ├── tsconfig.json # TypeScript settings, extended by the root tsconfig.json
348
364
  │ ├── index.html # Configurator HTML entry
349
365
  │ └── admin.html # Admin HTML entry
350
366
  │
@@ -508,7 +524,7 @@ Assets are split between two locations with different deployment strategies:
508
524
 
509
525
  Localization files enable multi-language support in your configurator.
510
526
 
511
- Translatable messages are authored in TypeScript and TSX source files using `@lingui/macro`.
527
+ Translatable messages are authored in TypeScript and TSX source files using Lingui's macros: `msg` from `@lingui/core/macro` and `<Trans>` from `@lingui/react/macro`.
512
528
 
513
529
  Locale catalogs live in `src/locales/<lang>/`. Phoenix creates and updates the `messages.po` source catalogs; edit their `msgstr` values to provide translations. The `messages.ts` files are compiled from those catalogs and must not be edited directly.
514
530
 
@@ -22,7 +22,7 @@ pnpm install
22
22
  pnpm phoenix sync
23
23
  ```
24
24
 
25
- `phoenix init [folder]` writes the starter project: `package.json`, `pnpm-workspace.yaml` and the starter spec, `spec/application.yaml` and `spec/configurator.yaml`, which describe one box you can resize and recolour. The starter depends on the same SDK version as the CLI that created it, and its `package.json` has the `dev`, `build`, `deploy`, `check` and `fix` scripts, which are yours to change. `phoenix sync` then adds the rest of the project: webhooks and lint config. It writes a `.gitignore` only when the folder is inside a git repository; run `git init` before the first sync, or sync again after it, to get the file.
25
+ `phoenix init [folder]` writes the starter project: `package.json`, `pnpm-workspace.yaml` and the starter spec, `spec/application.yaml` and `spec/configurator.yaml`, which describe one box you can resize and recolour. The starter depends on the same SDK version as the CLI that created it, and its `package.json` has the `dev`, `build`, `deploy`, `check` and `fix` scripts, which are yours to change. `phoenix sync` then adds the rest of the project: the TypeScript, lint and formatting config and the agent skills. It writes no webhook code: a project without `src/webhooks/index.ts` gets a built-in webhook (see [Webhook Entry Point](?path=/docs/phoenix-webhooks--docs#webhook-entry-point)). It writes a `.gitignore` only when the folder is inside a git repository; run `git init` before the first sync, or sync again after it, to get the file.
26
26
 
27
27
  `init` only writes these files: it asks nothing and contacts no server. It refuses a folder that already has a `spec/` folder. A `package.json` already in the folder is kept, as long as it depends on the SDK.
28
28
 
@@ -76,7 +76,7 @@ pnpm phoenix deploy
76
76
  `phoenix deploy` goes through these steps:
77
77
 
78
78
  1. It validates the application spec.
79
- 2. It packs the project files: the `.yaml` files in `spec`, everything in `src`, `mocks`, `assets`, `public` and `templates`, and `package.json`, `pnpm-lock.yaml`, `pnpm-workspace.yaml`, `.gitignore`, `CLAUDE.md` and `.cursor/rules/phoenix.mdc`. Every `node_modules`, `.phoenix` and `__generated` folder, every `.DS_Store` and `._*` file and every `.env` and `.env.*` file are left out, at any depth.
79
+ 2. It packs the project files: the `.yaml` files in `spec`, everything in `src`, `mocks`, `assets`, `public` and `templates`, and `package.json`, `tsconfig.json`, `pnpm-lock.yaml`, `pnpm-workspace.yaml`, `.gitignore`, `CLAUDE.md` and `.cursor/rules/phoenix.mdc`. Every `node_modules`, `.phoenix` and `__generated` folder, every `.DS_Store` and `._*` file and every `.env` and `.env.*` file are left out, at any depth.
80
80
  3. It asks the server for a build. The server compares your domain model with the deployed one and refuses, before anything is uploaded, a model that changed under an already deployed model version; see [Migrations](?path=/docs/phoenix-migrations--docs).
81
81
  4. It uploads the archive, which may be up to 200 MB.
82
82
  5. It starts the build, prints a link to the build's page in Studio and follows the build until your configurator is live, then prints its URL.
@@ -0,0 +1,140 @@
1
+ # Testing
2
+
3
+ - [Your application in a test](#your-application-in-a-test)
4
+ - [Run the domain on a preset](#run-the-domain-on-a-preset)
5
+ - [Test a transformer](#test-a-transformer)
6
+ - [Mock a domain context](#mock-a-domain-context)
7
+ - [Options](#options)
8
+
9
+ A project's tests check its own logic, such as an expression on a preset, a transformer that completes an
10
+ edit, a Blender projection or a migration, against the application the project ships. They run with
11
+ Vitest in Node, without a browser or a server.
12
+
13
+ ## Your application in a test
14
+
15
+ `createTestApplicationConfig` from `@salsita-ai/sdk/domain` is the way a test builds the project's
16
+ application. It takes the generated application the test imports and returns its application config,
17
+ typed with the project's entities, states and data, with no type argument at the call:
18
+
19
+ ```ts
20
+ import { createTestApplicationConfig } from '@salsita-ai/sdk/domain'
21
+
22
+ import { configuratorBuilder } from '../../.phoenix/domain.js'
23
+
24
+ const config = createTestApplicationConfig(configuratorBuilder)
25
+
26
+ config.domain.presets // the presets of spec/presets
27
+ config.initialPublishedData // the published data the application starts with
28
+ ```
29
+
30
+ `configuratorBuilder` from `.phoenix/domain.js` is the domain of the configurator: the model, expressions,
31
+ invariants, actions, migrations, presets and the components declared in YAML. `configuratorConfig` from
32
+ `.phoenix/configurator-config.js` is the whole configurator as the browser runs it, with every component,
33
+ handler, element and transformer; it reads the frontend environment when it is imported, so a test that
34
+ uses it stubs `phx.frontendEnv` first.
35
+
36
+ A test passes the generated export to the helper and does not call the export's methods: they are how the
37
+ SDK assembles an application, not an interface for tests, while the helper's call does not depend on that
38
+ assembly.
39
+
40
+ ## Run the domain on a preset
41
+
42
+ The config goes into `createDomainRuntime`, which runs the same systems as the configurator:
43
+
44
+ ```ts
45
+ import { vi } from 'vitest'
46
+
47
+ import { NoopAnalyticsSystem, createDomainRuntime, createTestApplicationConfig } from '@salsita-ai/sdk/domain'
48
+
49
+ import { configuratorBuilder, createI18n } from '../../.phoenix/domain.js'
50
+
51
+ const logger = {
52
+ info: vi.fn(),
53
+ error: vi.fn(),
54
+ warn: vi.fn(),
55
+ debug: vi.fn(),
56
+ verbose: vi.fn(),
57
+ appendToGlobalContext: vi.fn(),
58
+ }
59
+ const config = createTestApplicationConfig(configuratorBuilder)
60
+ const runtime = createDomainRuntime({
61
+ config,
62
+ services: { analyticsService: new NoopAnalyticsSystem(), i18n: createI18n(), logger },
63
+ })
64
+
65
+ runtime.actions.domainContext.configurator.setExecutionMode('finalize')
66
+ runtime.actions.domainData.setDomainData({
67
+ publishedData: config.initialPublishedData,
68
+ backendData: undefined,
69
+ frontendData: {},
70
+ })
71
+ runtime.actions.sessionContext.setSessionContext({ role: 'anonymous', data: {} })
72
+
73
+ const preset = config.domain.presets[0]!
74
+ runtime.actions.loadedData.completeConfiguratorLoad({
75
+ initialRevisionId: 'test',
76
+ initialEntities: preset.initialDomainEntities,
77
+ modelVersion: config.domain.domainFactory.modelVersion,
78
+ rootEntityType: preset.rootEntityType,
79
+ schemaIdentity: runtime.selectors.spec.getConfiguratorFactory(),
80
+ })
81
+ runtime.selectors.domainContext.configurator.getDomainContext().initialize()
82
+ ```
83
+
84
+ ## Test a transformer
85
+
86
+ The domain of `configuratorBuilder` has no code-attached components and no transformers. A test adds the
87
+ ones it needs, the way the configurator and the webhooks add them:
88
+
89
+ ```ts
90
+ // Files that read `phx.domain` at module scope are imported after `.phoenix/domain.js`.
91
+ const { customComponentOptics } = await import('../../.phoenix/configurator-domain-code.js')
92
+ const { default: addCookingTop } = await import('../transformers/add-cooking-top.js')
93
+
94
+ const config = createTestApplicationConfig(configuratorBuilder, {
95
+ componentModules: customComponentOptics,
96
+ transformers: {
97
+ importedTransformers: [{ origin: 'src/transformers/add-cooking-top.ts', exports: addCookingTop }],
98
+ specTransformers: [{ name: 'addCookingTop', priority: 30 }],
99
+ },
100
+ })
101
+ ```
102
+
103
+ `specTransformers` are the entries of the `transformers` section of `spec/application.yaml` that the test
104
+ runs, with the priorities the spec gives them.
105
+
106
+ ## Mock a domain context
107
+
108
+ `createMockState`, `createMockDomain` and `createMockDomainContext` take the same config and check the
109
+ mock data against the project's types:
110
+
111
+ ```ts
112
+ import { createMockDomainContext, createTestApplicationConfig } from '@salsita-ai/sdk/domain'
113
+
114
+ const config = createTestApplicationConfig(configuratorBuilder)
115
+ const preset = config.domain.presets[0]!
116
+ const { domainContext, destroy } = createMockDomainContext(config, {
117
+ entities: preset.initialDomainEntities,
118
+ rootEntityType: preset.rootEntityType,
119
+ publishedData: config.initialPublishedData,
120
+ frontendData: {},
121
+ sessionData: {},
122
+ backendData: undefined,
123
+ mode: 'owner',
124
+ role: 'anonymous',
125
+ transformers: [],
126
+ })
127
+ ```
128
+
129
+ ## Options
130
+
131
+ | Option | What it does |
132
+ | ------------------ | ------------------------------------------------------------------------------------------------------------------ |
133
+ | `componentModules` | Component files added after the components the application already has, each `{ origin, exports }` |
134
+ | `transformers` | Replaces the application's transformers: files (`importedTransformers`) and spec entries (`specTransformers`) |
135
+ | `tag` | The tag of the custom element the application mounts as; without it the application's own (`salsita-configurator`) |
136
+
137
+ ## See Also
138
+
139
+ - [Best Practices](?path=/docs/phoenix-best-practices--docs) - Where custom code lives
140
+ - [Transformers](?path=/docs/other-features-transformers--docs) - Writing transformers
@@ -4,21 +4,22 @@ Build component controls with React and browser SDKs without pulling them into t
4
4
 
5
5
  ## Choose Where Each File Runs
6
6
 
7
- | User file | Frontend | Webhook |
8
- | ------------------------------------------------- | -------- | ------- |
9
- | Component or admin component without a directive | Yes | No |
10
- | Component or admin component with `'use webhook'` | Yes | Yes |
11
- | Ordinary handler | Yes | No |
12
- | Published-data or validator handler | Yes | Yes |
13
- | Any other handler with `'use webhook'` | Yes | Yes |
14
- | File under `src/webhooks/` | No | Yes |
7
+ | User file | Frontend | Webhook |
8
+ | ---------------------------------------------------- | -------- | ------- |
9
+ | Component or admin component without a directive | Yes | No |
10
+ | Component or admin component with `'use webhook'` | Yes | Yes |
11
+ | Ordinary handler | Yes | No |
12
+ | Published-data, validator or assistant setup handler | Yes | Yes |
13
+ | Any other handler with `'use webhook'` | Yes | Yes |
14
+ | File under `src/webhooks/` | No | Yes |
15
15
 
16
- Published-data and validator handlers are detected when they register one of these APIs:
16
+ Published-data, validator and assistant setup handlers are detected when they register one of these APIs:
17
17
 
18
18
  - `createMapPublishedRevisionDataHandler`
19
19
  - `createMapPublishedChunkedDataHandler`
20
20
  - `createDataRowValidatorHandler`
21
21
  - `createSheetValidatorHandler`
22
+ - `phx.domain.createAssistantSetupHandler`
22
23
 
23
24
  ## Pin a Server-Safe Component
24
25
 
@@ -34,6 +34,23 @@ Phoenix provides domain-aware builders through the global `phx.webhooks` namespa
34
34
 
35
35
  ### Webhook Entry Point
36
36
 
37
+ Your webhook is the default export of `src/webhooks/index.ts`. With the application-spec pipeline (see [Current and legacy project tooling](?path=/docs/phoenix-phoenix-cli--docs#current-and-legacy-project-tooling)), the file is yours to create; sync does not write it. A project without it gets a built-in webhook, so it builds and deploys with no webhook code. The built-in webhook has one handler, an anonymous auth handler, which the platform calls only when `spec/application.yaml` sets `useAuthHook`. The legacy pipeline writes the file with that webhook on the first sync.
38
+
39
+ Create `src/webhooks/index.ts` when the project needs its own handlers: finalization, backend data, or an auth handler that does more than start an anonymous session. A project that sets `useAuthHook` or `useClerk` needs its own auth handler, because the built-in one answers only anonymous requests. The smallest file is the built-in webhook itself:
40
+
41
+ ```ts
42
+ // src/webhooks/index.ts
43
+ const authHandler = phx.webhooks.authHandlerBuilder
44
+ .withAnonymousHandler(async () => ({ success: true, data: {}, role: 'anonymous' }))
45
+ .build()
46
+
47
+ export default phx.webhooks.webhookBuilder.withAuthHook(authHandler).build()
48
+ ```
49
+
50
+ The next `phoenix sync` or `phoenix build`, or the rebuild of a running `phoenix dev`, uses the file; deleting it brings the built-in webhook back. A webhook needs at least one handler, and a project with any other file in `src/webhooks/` must have `index.ts`.
51
+
52
+ A webhook with more handlers:
53
+
37
54
  ```ts
38
55
  // src/webhooks/index.ts
39
56
  import { authHandler } from './handlers/auth-handler.js'
@@ -391,7 +408,7 @@ ctx.emailTaskBuilder.withSubject(msg`Your configuration`)
391
408
  In React templates, use `<Trans>` for inline strings and `<HtmlHelpers.Localized>` to render message descriptors:
392
409
 
393
410
  ```tsx
394
- import { Trans } from '@lingui/macro'
411
+ import { Trans } from '@lingui/react/macro'
395
412
 
396
413
  import { HtmlHelpers } from '@salsita-ai/sdk/webhook'
397
414
 
@@ -456,7 +473,7 @@ The template file:
456
473
 
457
474
  ```tsx
458
475
  // src/webhooks/handlers/configurator-finalize-handler/tasks/pdf-template.tsx
459
- import { Trans } from '@lingui/macro'
476
+ import { Trans } from '@lingui/react/macro'
460
477
 
461
478
  import { HtmlHelpers, PdfHelpers, ResourceHelpers } from '@salsita-ai/sdk/webhook'
462
479
 
@@ -578,7 +595,7 @@ except for resource reference interpolation.
578
595
 
579
596
  ```tsx
580
597
  // src/webhooks/handlers/configurator-finalize-handler/tasks/email-task.tsx
581
- import { msg } from '@lingui/macro'
598
+ import { msg } from '@lingui/core/macro'
582
599
 
583
600
  import { EmailTemplate } from './email-template.js'
584
601
 
@@ -603,7 +620,7 @@ export const simpleEmailTask = phx.webhooks.taskFactory.createSendEmailTask((res
603
620
 
604
621
  ```tsx
605
622
  // src/webhooks/handlers/configurator-finalize-handler/tasks/email-template.tsx
606
- import { Trans } from '@lingui/macro'
623
+ import { Trans } from '@lingui/react/macro'
607
624
 
608
625
  import { EmailHelpers, ResourceHelpers } from '@salsita-ai/sdk/webhook'
609
626
 
@@ -8,7 +8,7 @@ import type { CellValue } from '@salsita-ai/contracts/webhook';
8
8
  import type { AdminIntegrationService } from '#package/react-sdk';
9
9
  import type { $DomainEntity, DataCellValue, DataSchema, DomainEntity, DomainFactory, ProductPreset } from '../core/index.js';
10
10
  import type { AnalyticsSystem, RegistrableTransformer, TransformerFactory } from '../domain-context/index.js';
11
- import type { ProjectModule } from '../domain-runtime/index.js';
11
+ import type { ElementRegistration, ProjectModule } from '../domain-runtime/index.js';
12
12
  import type { AssistantResolvedManifest } from './assistant/index.js';
13
13
  import type { WebComponentEventDescriptor } from './web-component-event.js';
14
14
  import type { WebComponentPropertyDescriptor } from './web-component-property.js';
@@ -292,6 +292,8 @@ export interface ApplicationConfig<ENTITIES extends DomainEntity<string>, ALLOWE
292
292
  /** The `src/handlers/` and `src/elements/` files as project modules; the runtime spec validates and flattens both. */
293
293
  readonly handlers: readonly ProjectModule[];
294
294
  readonly elements: readonly ProjectModule[];
295
+ /** The SDK's default element registrations; a project element with the same name replaces one. */
296
+ readonly defaultElements?: readonly ElementRegistration[];
295
297
  readonly mount: MountConfig<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, CHAT_CONTEXT, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES>;
296
298
  }
297
299
  export {};
@@ -0,0 +1,12 @@
1
+ import type { AssistantDeclaredField, AssistantResolvedField } from './assistant-resolved-manifest.js';
2
+ /** Combines the effective description with allowed string values. */
3
+ export declare const describeAssistantValues: (description: string | undefined, values: readonly string[] | undefined) => string | undefined;
4
+ /** Applies GraphQL field inheritance identically at parse time and after session narrowing. */
5
+ export declare const mergeAssistantFields: (inherited: ReadonlyArray<readonly AssistantDeclaredField[]>, own: readonly AssistantDeclaredField[], ownEnumValues: (source: string) => readonly string[] | undefined, conflict: (name: string, first: string, second: string) => void) => readonly AssistantDeclaredField[];
6
+ /**
7
+ * The serializable form of a merged field of one alias or type. Merging keeps the inherited entry of
8
+ * a field declared twice, so the lens tags are taken from `own`, the declarations of that alias or
9
+ * type itself: each lens condition then comes from its own declaration, at parse time and after
10
+ * session narrowing alike.
11
+ */
12
+ export declare const resolveAssistantField: (field: AssistantDeclaredField, own: readonly AssistantDeclaredField[]) => AssistantResolvedField;
@@ -0,0 +1 @@
1
+ export const describeAssistantValues=(e,s)=>{if(!s?.length)return e;let t=`One of: ${s.map(e=>`"${e}"`).join(", ")}.`;return e?`${e}${/[.!?]$/.test(e)?"":"."} ${t}`:t};export const mergeAssistantFields=(e,s,t,n)=>{let r=new Map,i=new Set(s);for(let t of[...e.flat(),...s]){let e=r.get(t.name);e?e.source!==t.source?n(t.name,e.source,t.source):r.set(t.name,{...e,...i.has(t)&&t.describedByManifest?{description:t.description,describedByManifest:!0,valueDescription:t.valueDescription}:{}}):r.set(t.name,t)}return[...r.values()].map(e=>{let s=e.enumValues&&t(e.source);return s?{...e,enumValues:s,description:describeAssistantValues(e.valueDescription,s)}:e})};export const resolveAssistantField=(e,s)=>{let t=s.find(s=>s.name===e.name&&s.source===e.source)?.lenses;return{name:e.name,source:e.source,localized:e.localized,type:e.type,...void 0===e.description?{}:{description:e.description},...t?.length?{lenses:t}:{}}};
@@ -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 {
@@ -34,6 +39,7 @@ export interface AssistantStates {
34
39
  }
35
40
  /** Serializable resolved whitelist from which the browser or backend constructs the assistant schema. */
36
41
  export interface AssistantResolvedManifest {
42
+ readonly declarations: AssistantDeclarations;
37
43
  readonly entityTypes: readonly string[];
38
44
  readonly aliases: Readonly<Record<string, readonly string[]>>;
39
45
  readonly exampleType?: string;
@@ -45,6 +51,11 @@ export interface AssistantResolvedManifest {
45
51
  readonly replaceRecipes: Readonly<Record<string, AssistantResolvedRecipes>>;
46
52
  readonly optionsEdges: Readonly<Record<string, readonly AssistantResolvedOptionsEdge[]>>;
47
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
+ }>>;
48
59
  }
49
60
  /** Optional mutation input for one stored field, using its exposed name. */
50
61
  export interface AssistantWritableField {
@@ -59,7 +70,8 @@ export interface AssistantWritableType {
59
70
  readonly fields: readonly AssistantWritableField[];
60
71
  }
61
72
  /** Description hints resolved from recipe/option entries; no parse context is retained. */
62
- export type AssistantResolvedHint = 'sameForAllInstances' | 'constantDuringSession';
73
+ export declare const ASSISTANT_HINTS: readonly ['sameForAllInstances', 'constantDuringSession'];
74
+ export type AssistantResolvedHint = (typeof ASSISTANT_HINTS)[number];
63
75
  /** Recipe groups and their description hints for one entity type. */
64
76
  export interface AssistantResolvedRecipes {
65
77
  readonly groups: readonly AssistantRecipeGroup[];
@@ -93,3 +105,27 @@ export interface AssistantResolvedAction {
93
105
  }>>;
94
106
  readonly result: Readonly<Record<string, AssistantResolvedActionResult>>;
95
107
  }
108
+ /** Immutable, validated declaration bindings retained before alias expansion for session narrowing. */
109
+ export interface AssistantDeclarations {
110
+ readonly entities: Readonly<Record<string, readonly AssistantDeclaredField[]>>;
111
+ readonly enumValues: Readonly<Record<string, Readonly<Record<string, readonly string[]>>>>;
112
+ readonly deletable: readonly string[];
113
+ readonly writable: Readonly<Record<string, Readonly<Record<string, AssistantDeclaredWrite>>>>;
114
+ readonly childRecipes: Readonly<Record<string, AssistantResolvedRecipes>>;
115
+ readonly replaceRecipes: Readonly<Record<string, AssistantResolvedRecipes>>;
116
+ }
117
+ /** An original field declaration, including metadata needed to reapply inheritance and enum descriptions. */
118
+ export interface AssistantDeclaredField extends AssistantResolvedField {
119
+ readonly describedByManifest: boolean;
120
+ readonly enumValues?: readonly string[];
121
+ readonly valueDescription?: string;
122
+ }
123
+ /** Stored-property types and component bindings, resolved separately for each concrete member. */
124
+ export interface AssistantDeclaredWrite {
125
+ readonly members: Readonly<Record<string, {
126
+ readonly exposedDescription?: string;
127
+ readonly field: AssistantWritableField;
128
+ readonly options?: AssistantResolvedOptionsEdge;
129
+ }>>;
130
+ readonly defaultOptionsName: boolean;
131
+ }
@@ -1 +1 @@
1
- export{};
1
+ export const ASSISTANT_HINTS=["sameForAllInstances","constantDuringSession"];
@@ -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']>;