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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (520) hide show
  1. package/README.md +10 -3
  2. package/dist/application-spec/errors/diagnostic-codes.d.ts +6 -0
  3. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  4. package/dist/application-spec/errors/diagnostic-messages.d.ts +7 -1
  5. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  6. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  7. package/dist/application-spec/generate-application/code/standalone-app-files.js +1 -1
  8. package/dist/application-spec/generate-application/code/templates/admin-config.d.ts +1 -1
  9. package/dist/application-spec/generate-application/code/templates/admin-config.js +3 -2
  10. package/dist/application-spec/generate-application/code/templates/configurator-config.js +4 -2
  11. package/dist/application-spec/generate-application/code/templates/configurator-domain-code.d.ts +0 -1
  12. package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js +6 -8
  13. package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.d.ts +1 -0
  14. package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.js +8 -6
  15. package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.d.ts +1 -4
  16. package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.js +2 -2
  17. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.d.ts +1 -1
  18. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +26 -29
  19. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +0 -3
  20. package/dist/application-spec/generate-application/code/templates/domain.js +3 -3
  21. package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +11 -12
  22. package/dist/application-spec/generate-application/code/templates/skills/core/cli.js +1 -1
  23. package/dist/application-spec/generate-application/code/templates/skills/core/sdk.js +3 -2
  24. package/dist/application-spec/generate-application/code/templates/skills/core/workflow.js +13 -11
  25. package/dist/application-spec/generate-application/code/templates/skills/features/application-states/views-and-tools.js +1 -1
  26. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/index.d.ts +3 -0
  27. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/index.js +1 -0
  28. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/panel.d.ts +3 -0
  29. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/panel.js +16 -0
  30. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/reading-and-changing.d.ts +3 -0
  31. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/reading-and-changing.js +47 -0
  32. package/dist/application-spec/generate-application/code/templates/skills/features/{webhooks/assistant-setup.d.ts → assistant/session-setup.d.ts} +1 -1
  33. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/session-setup.js +15 -0
  34. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/custom-layout.js +3 -3
  35. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/pages.d.ts +1 -1
  36. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/pages.js +1 -1
  37. package/dist/application-spec/generate-application/code/templates/skills/features/domain-controls/custom-controls.js +1 -1
  38. package/dist/application-spec/generate-application/code/templates/skills/features/domain-controls/scene-controls.js +4 -2
  39. package/dist/application-spec/generate-application/code/templates/skills/features/domain-model/actions.js +3 -3
  40. package/dist/application-spec/generate-application/code/templates/skills/features/domain-model/expressions.js +1 -1
  41. package/dist/application-spec/generate-application/code/templates/skills/features/features.js +1 -1
  42. package/dist/application-spec/generate-application/code/templates/skills/features/state/violations.js +2 -2
  43. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/authentication.js +1 -1
  44. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/entry-and-environment.js +1 -1
  45. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/webhooks.js +1 -1
  46. package/dist/application-spec/generate-application/code/templates/skills/guide.d.ts +1 -1
  47. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +3 -3
  48. package/dist/application-spec/generate-application/code/templates/skills/processes/asset-conversion.js +3 -3
  49. package/dist/application-spec/generate-application/code/templates/skills/processes/assistant-configuration.d.ts +3 -0
  50. package/dist/application-spec/generate-application/code/templates/skills/processes/assistant-configuration.js +23 -0
  51. package/dist/application-spec/generate-application/code/templates/skills/processes/feedback/report.js +29 -1
  52. package/dist/application-spec/generate-application/code/templates/skills/processes/finalization.js +2 -2
  53. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/build.js +29 -15
  54. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/direction.js +17 -14
  55. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/first-draft.js +2 -2
  56. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/handoff.js +3 -3
  57. package/dist/application-spec/generate-application/code/templates/skills/processes/index.d.ts +2 -0
  58. package/dist/application-spec/generate-application/code/templates/skills/processes/index.js +1 -1
  59. package/dist/application-spec/generate-application/code/templates/skills/processes/model-migration.js +1 -1
  60. package/dist/application-spec/generate-application/code/templates/skills/processes/review/appearance.js +2 -2
  61. package/dist/application-spec/generate-application/code/templates/skills/processes/review/code.js +1 -1
  62. package/dist/application-spec/generate-application/code/templates/skills/processes/review/review.js +1 -1
  63. package/dist/application-spec/generate-application/code/templates/skills/processes/review/visual-inspection.js +1 -1
  64. package/dist/application-spec/generate-application/code/templates/skills/processes/scene-realism.d.ts +2 -0
  65. package/dist/application-spec/generate-application/code/templates/skills/processes/scene-realism.js +29 -0
  66. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/product-definition.js +2 -0
  67. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/specification.js +1 -1
  68. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-specification.d.ts +2 -0
  69. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-specification.js +28 -0
  70. package/dist/application-spec/generate-application/code/templates/webhook-builders.js +7 -6
  71. package/dist/application-spec/generate-application/code/templates/webhook-index.d.ts +2 -1
  72. package/dist/application-spec/generate-application/code/templates/webhook-index.js +2 -2
  73. package/dist/application-spec/parse-application-files/merge/merged-app-metadata.d.ts +1 -0
  74. package/dist/application-spec/parse-application-files/merge/merged-app-metadata.js +1 -1
  75. package/dist/application-spec/parse-application-files/merge/merged-assistant.js +1 -1
  76. package/dist/application-spec/parse-application-files/parse-application-files.js +1 -1
  77. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +42 -5
  78. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  79. package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.d.ts +4 -3
  80. package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
  81. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.js +1 -1
  82. package/dist/application-spec/parse-application-files/spec/model/session-data-schema.js +1 -1
  83. package/dist/application-spec/parse-application-files/spec/sections/app-metadata.js +1 -1
  84. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +2 -2
  85. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  86. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-server-settings.d.ts +5 -6
  87. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-server-settings.js +1 -1
  88. package/dist/application-spec/webhook-boundary.js +1 -1
  89. package/dist/client/cli-client/cli-api-client.d.ts +17 -0
  90. package/dist/client/cli-client/cli-api-client.js +1 -0
  91. package/dist/client/cli-client/index.d.ts +2 -0
  92. package/dist/client/cli-client/index.js +1 -0
  93. package/dist/client/cli-client/unsupported-api-version-error.d.ts +11 -0
  94. package/dist/client/cli-client/unsupported-api-version-error.js +1 -0
  95. package/dist/client/index.d.ts +1 -0
  96. package/dist/client/index.js +1 -1
  97. package/dist/client/phoenix-api.d.ts +5290 -1754
  98. package/dist/configurator/ConfiguratorApp.js +1 -1
  99. package/dist/configurator/application-runtime/extensions/configurator-extension-systems.d.ts +5 -4
  100. package/dist/configurator/application-runtime/extensions/configurator-extension-systems.js +1 -1
  101. package/dist/configurator/application-runtime/extensions/create-configurator-extensions.js +1 -1
  102. package/dist/configurator/application-runtime/extensions/selectors.d.ts +4 -2
  103. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  104. package/dist/configurator/application-runtime/extensions/systems/action-system/action-context.d.ts +14 -0
  105. package/dist/configurator/application-runtime/extensions/systems/action-system/action-factory.d.ts +13 -0
  106. package/dist/configurator/application-runtime/extensions/systems/action-system/action-system.d.ts +55 -0
  107. package/dist/configurator/application-runtime/extensions/systems/action-system/action-system.js +1 -0
  108. package/dist/configurator/application-runtime/extensions/systems/action-system/action.d.ts +44 -0
  109. package/dist/configurator/application-runtime/extensions/systems/action-system/action.js +1 -0
  110. package/dist/configurator/application-runtime/extensions/systems/action-system/index.d.ts +6 -0
  111. package/dist/configurator/application-runtime/extensions/systems/action-system/index.js +1 -0
  112. package/dist/{domain/domain-runtime/spec → configurator/application-runtime/extensions/systems/action-system}/prepare-action-implementations.d.ts +4 -3
  113. package/dist/{domain/domain-runtime/spec → configurator/application-runtime/extensions/systems/action-system}/prepare-action-implementations.js +2 -2
  114. package/dist/{domain/spec/modules → configurator/application-runtime/extensions/systems/action-system}/resolve-action-modules.d.ts +2 -2
  115. package/dist/configurator/application-runtime/extensions/systems/action-system/resolve-action-modules.js +1 -0
  116. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-annotation.d.ts +7 -4
  117. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +91 -33
  118. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  119. package/dist/configurator/application-runtime/extensions/systems/assistant-system/composer-attachments.d.ts +12 -17
  120. package/dist/configurator/application-runtime/extensions/systems/assistant-system/composer-attachments.js +1 -1
  121. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +43 -37
  122. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  123. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/index.d.ts +2 -0
  124. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/index.js +1 -0
  125. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/register-webmcp-tools.d.ts +29 -0
  126. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/register-webmcp-tools.js +2 -0
  127. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/to-webmcp-result.d.ts +10 -0
  128. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/to-webmcp-result.js +1 -0
  129. package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.d.ts +41 -35
  130. package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.js +1 -1
  131. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.d.ts +14 -4
  132. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.js +1 -1
  133. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +8 -1
  134. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  135. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +38 -9
  136. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  137. package/dist/configurator/application-runtime/extensions/systems/graphql-system/is-offered-for-selection.d.ts +16 -0
  138. package/dist/configurator/application-runtime/extensions/systems/graphql-system/is-offered-for-selection.js +1 -0
  139. package/dist/configurator/application-runtime/extensions/systems/graphql-system/read-offered-navigation.d.ts +26 -0
  140. package/dist/configurator/application-runtime/extensions/systems/graphql-system/read-offered-navigation.js +1 -0
  141. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.d.ts +25 -8
  142. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.js +1 -1
  143. package/dist/configurator/application-runtime/extensions/systems/index.d.ts +5 -4
  144. package/dist/configurator/application-runtime/extensions/systems/index.js +1 -1
  145. package/dist/configurator/application-runtime/hooks/use-configurator.d.ts +3 -3
  146. package/dist/configurator/common/configurator-interface.d.ts +9 -7
  147. package/dist/configurator/common/configurator-interface.js +1 -1
  148. package/dist/configurator/scene/cameras/CameraPadding.d.ts +5 -0
  149. package/dist/configurator/scene/cameras/CameraPadding.js +1 -1
  150. package/dist/configurator/ui/assistant/AssistantChips.d.ts +5 -5
  151. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  152. package/dist/configurator/ui/assistant/AssistantComposer.d.ts +4 -3
  153. package/dist/configurator/ui/assistant/AssistantComposer.js +1 -1
  154. package/dist/configurator/ui/assistant/AssistantPanel.d.ts +6 -4
  155. package/dist/configurator/ui/assistant/AssistantThread.d.ts +10 -2
  156. package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
  157. package/dist/configurator/ui/assistant/annotation/AnnotationViewer.js +1 -1
  158. package/dist/configurator/ui/assistant/annotation/MessageAnnotations.js +1 -1
  159. package/dist/configurator/ui/assistant/annotation/editor/AnnotationComment.d.ts +6 -5
  160. package/dist/configurator/ui/assistant/annotation/editor/AnnotationComment.js +1 -1
  161. package/dist/configurator/ui/assistant/annotation/editor/AnnotationEditor.d.ts +6 -5
  162. package/dist/configurator/ui/assistant/annotation/editor/AnnotationEditor.js +1 -1
  163. package/dist/configurator/ui/assistant/annotation/editor/annotation-pins.d.ts +5 -0
  164. package/dist/configurator/ui/assistant/annotation/editor/annotation-pins.js +1 -1
  165. package/dist/configurator/ui/assistant/annotation/index.d.ts +0 -1
  166. package/dist/configurator/ui/assistant/annotation/index.js +1 -1
  167. package/dist/configurator/ui/assistant/assistant-failure.d.ts +6 -4
  168. package/dist/configurator/ui/assistant/assistant-failure.js +1 -1
  169. package/dist/configurator/ui/assistant/attachments/MessageImages.js +1 -1
  170. package/dist/configurator/ui/assistant/drawing/AssistantDrawing.d.ts +1 -1
  171. package/dist/configurator/ui/assistant/drawing/AssistantDrawing.js +1 -1
  172. package/dist/configurator/ui/assistant/drawing/index.d.ts +1 -1
  173. package/dist/configurator/ui/assistant/drawing/index.js +1 -1
  174. package/dist/configurator/ui/assistant/drawing/parse-drawing.js +1 -1
  175. package/dist/configurator/ui/assistant/drawing/use-drawing-url.d.ts +6 -12
  176. package/dist/configurator/ui/assistant/drawing/use-drawing-url.js +1 -1
  177. package/dist/configurator/ui/assistant/form/AssistantForm.d.ts +1 -1
  178. package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -1
  179. package/dist/configurator/ui/assistant/form/form-model.d.ts +9 -0
  180. package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +6 -5
  181. package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -1
  182. package/dist/configurator/ui/assistant/form/read-form-tile.d.ts +8 -0
  183. package/dist/configurator/ui/assistant/form/read-form-tile.js +1 -0
  184. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.d.ts +6 -3
  185. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.js +1 -1
  186. package/dist/configurator/ui/assistant/form/registry/form-registry.d.ts +1 -1
  187. package/dist/configurator/ui/assistant/form/registry/form-registry.js +1 -1
  188. package/dist/configurator/ui/assistant/form/split-form-rows.d.ts +7 -0
  189. package/dist/configurator/ui/assistant/form/split-form-rows.js +1 -0
  190. package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +7 -4
  191. package/dist/configurator/ui/assistant/form-elements/FormOptions.js +1 -1
  192. package/dist/configurator/ui/assistant/form-elements/FormTile.d.ts +72 -0
  193. package/dist/configurator/ui/assistant/form-elements/FormTile.js +1 -0
  194. package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +27 -0
  195. package/dist/configurator/ui/assistant/form-elements/index.d.ts +2 -3
  196. package/dist/configurator/ui/assistant/form-elements/index.js +1 -1
  197. package/dist/configurator/ui/assistant/image-view/ImageView.js +1 -1
  198. package/dist/configurator/ui/assistant/index.d.ts +2 -2
  199. package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.d.ts +4 -1
  200. package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.js +1 -1
  201. package/dist/configurator/ui/assistant/reference-link/index.d.ts +2 -1
  202. package/dist/configurator/ui/assistant/reference-link/index.js +1 -1
  203. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -1
  204. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +2 -6
  205. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -1
  206. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +5 -6
  207. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -1
  208. package/dist/configurator/ui/assistant/thread-items.d.ts +2 -2
  209. package/dist/configurator/ui/assistant/thread-items.js +1 -1
  210. package/dist/configurator/ui/assistant/use-assistant-composer.d.ts +2 -1
  211. package/dist/configurator/ui/assistant/use-assistant-composer.js +2 -2
  212. package/dist/configurator/ui/assistant/use-assistant-thread.d.ts +15 -1
  213. package/dist/configurator/ui/assistant/use-assistant-thread.js +1 -1
  214. package/dist/configurator/ui/assistant/use-load-older-on-top.d.ts +3 -3
  215. package/dist/configurator/ui/assistant/use-load-older-on-top.js +1 -1
  216. package/dist/configurator/ui/assistant/{annotation/use-end-on-unmount.d.ts → use-on-unmount.d.ts} +1 -1
  217. package/dist/configurator/ui/assistant/use-on-unmount.js +1 -0
  218. package/dist/configurator/ui/configurator-layout/index.d.ts +1 -1
  219. package/dist/configurator/ui/configurator-layout/index.js +1 -1
  220. package/dist/configurator/ui/configurator-layout/slots/canvas/LayoutCanvas.js +1 -1
  221. package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/DesktopSidebar.js +4 -4
  222. package/dist/configurator/ui/configurator-layout/slots/index.d.ts +2 -0
  223. package/dist/configurator/ui/configurator-layout/slots/index.js +1 -1
  224. package/dist/configurator/ui/configurator-layout/slots/view-controls/DesktopViewControls.js +1 -1
  225. package/dist/configurator/ui/configurator-layout/slots/view-controls/MobileViewControls.js +1 -1
  226. package/dist/configurator/ui/configurator-layout/slots/view-controls/NestedViewControls.d.ts +7 -0
  227. package/dist/configurator/ui/configurator-layout/slots/view-controls/NestedViewControls.js +1 -0
  228. package/dist/configurator/ui/configurator-layout/slots/view-controls/use-view-control-items.d.ts +6 -0
  229. package/dist/configurator/ui/configurator-layout/slots/view-controls/use-view-control-items.js +1 -0
  230. package/dist/configurator/ui/configurator-layout/universal/DesktopPreview.js +1 -1
  231. package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +3 -3
  232. package/dist/configurator/ui/configurator-layout/universal/MobilePreview.js +1 -1
  233. package/dist/configurator/ui/configurator-layout/universal/use-preview-description.d.ts +1 -0
  234. package/dist/configurator/ui/configurator-layout/universal/use-preview-description.js +1 -0
  235. package/dist/configurator/ui/index.d.ts +1 -1
  236. package/dist/configurator/ui/legacy/layout/common/ViewControls.js +1 -1
  237. package/dist/docs/index.json +22 -2
  238. package/dist/docs/layouts/nested-view-controls.mdx +223 -0
  239. package/dist/docs/layouts/presets/custom.mdx +1 -0
  240. package/dist/docs/layouts/preview/always.mdx +22 -0
  241. package/dist/docs/layouts/view-controls.mdx +2 -0
  242. package/dist/docs/other-features/domain-actions.mdx +10 -11
  243. package/dist/docs/other-features/violation-messages.mdx +3 -1
  244. package/dist/docs/phoenix/application-states.mdx +1 -1
  245. package/dist/docs/phoenix/configurator-interface.mdx +81 -35
  246. package/dist/docs/phoenix/data-sources.mdx +1 -1
  247. package/dist/docs/phoenix/getting-started.mdx +1 -1
  248. package/dist/docs/phoenix/layout-slots.mdx +1 -1
  249. package/dist/docs/phoenix/migrations.mdx +1 -1
  250. package/dist/docs/phoenix/phoenix-cli.mdx +89 -53
  251. package/dist/docs/phoenix/project-structure.mdx +7 -7
  252. package/dist/docs/phoenix/sdk-builder-workflow.mdx +56 -27
  253. package/dist/docs/phoenix/sessions-and-access.mdx +9 -6
  254. package/dist/docs/phoenix/theming.mdx +5 -9
  255. package/dist/docs/phoenix/webhooks.mdx +55 -3
  256. package/dist/docs/ux-guidelines/choosing-navigation.mdx +2 -0
  257. package/dist/docs/ux-guidelines/designing-the-configuration-journey.mdx +43 -0
  258. package/dist/docs/ux-guidelines/interaction-modes.mdx +2 -2
  259. package/dist/docs/ux-guidelines/overview.mdx +11 -9
  260. package/dist/domain/application/application-config.d.ts +5 -0
  261. package/dist/domain/application/assistant/assistant-exposure.d.ts +22 -0
  262. package/dist/domain/application/assistant/assistant-exposure.js +1 -0
  263. package/dist/domain/application/assistant/assistant-selection.d.ts +30 -0
  264. package/dist/domain/application/assistant/assistant-selection.js +1 -0
  265. package/dist/domain/application/assistant/build-assistant-lenses.js +4 -4
  266. package/dist/domain/application/assistant/build-assistant-manifest.d.ts +2 -2
  267. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  268. package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +14 -2
  269. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  270. package/dist/domain/application/assistant/index.d.ts +5 -1
  271. package/dist/domain/application/assistant/index.js +1 -1
  272. package/dist/domain/application/assistant/prepare-assistant-navigation-updates.d.ts +16 -0
  273. package/dist/domain/application/assistant/prepare-assistant-navigation-updates.js +1 -0
  274. package/dist/domain/application/assistant/read-assistant-navigation.d.ts +40 -0
  275. package/dist/domain/application/assistant/read-assistant-navigation.js +1 -0
  276. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
  277. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +17 -1
  278. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
  279. package/dist/domain/application/assistant-field-options.d.ts +2 -0
  280. package/dist/domain/application/assistant-field-options.js +1 -1
  281. package/dist/domain/application/assistant-mutations.d.ts +17 -11
  282. package/dist/domain/application/assistant-mutations.js +1 -1
  283. package/dist/domain/application/assistant-recipe-groups.d.ts +4 -3
  284. package/dist/domain/application/assistant-recipe-groups.js +1 -1
  285. package/dist/domain/application/configurator-builder.d.ts +8 -0
  286. package/dist/domain/application/configurator-builder.js +1 -1
  287. package/dist/domain/available-system-components/available-system-components.d.ts +1 -1
  288. package/dist/domain/available-system-components/available-system-components.js +1 -1
  289. package/dist/domain/core/action/action.d.ts +0 -49
  290. package/dist/domain/core/component/system-component-filter.d.ts +1 -0
  291. package/dist/domain/core/component/system-component-filter.js +1 -1
  292. package/dist/domain/core/component/view-state-component.d.ts +4 -3
  293. package/dist/domain/core/component/view-state-component.js +1 -1
  294. package/dist/domain/core/domain-factory.d.ts +2 -3
  295. package/dist/domain/core/invariant/control-violation-hints.d.ts +37 -0
  296. package/dist/domain/core/invariant/control-violation-hints.js +1 -0
  297. package/dist/domain/core/invariant/index.d.ts +1 -0
  298. package/dist/domain/core/invariant/index.js +1 -1
  299. package/dist/domain/domain-builder/domain-builder.d.ts +1 -6
  300. package/dist/domain/domain-builder/domain-builder.js +1 -1
  301. package/dist/domain/domain-context/domain-context-systems.d.ts +3 -5
  302. package/dist/domain/domain-context/index.d.ts +0 -1
  303. package/dist/domain/domain-context/index.js +1 -1
  304. package/dist/domain/domain-context/navigation-system/navigation-system.d.ts +2 -2
  305. package/dist/domain/domain-context/navigation-system/navigation-system.js +1 -1
  306. package/dist/domain/domain-context/transformers/when-builder.js +1 -1
  307. package/dist/domain/domain-runtime/domain-context/domain-context.d.ts +1 -1
  308. package/dist/domain/domain-runtime/domain-context/domain-context.js +1 -1
  309. package/dist/domain/domain-runtime/domain-context/index.d.ts +0 -1
  310. package/dist/domain/domain-runtime/domain-context/selectors.d.ts +5 -6
  311. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  312. package/dist/domain/domain-runtime/domain-runtime.d.ts +13 -19
  313. package/dist/domain/domain-runtime/domain-runtime.js +1 -1
  314. package/dist/domain/domain-runtime/index.d.ts +0 -1
  315. package/dist/domain/domain-runtime/index.js +1 -1
  316. package/dist/domain/domain-runtime/spec/index.d.ts +0 -1
  317. package/dist/domain/domain-runtime/spec/index.js +1 -1
  318. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  319. package/dist/domain/domain-runtime/spec/selectors.d.ts +2 -2
  320. package/dist/domain/domain-runtime/spec/types.d.ts +12 -10
  321. package/dist/domain/extensions/assistant/assistant-greeting.d.ts +30 -0
  322. package/dist/domain/extensions/assistant/assistant-greeting.js +1 -0
  323. package/dist/domain/extensions/assistant/index.d.ts +1 -0
  324. package/dist/domain/extensions/assistant/index.js +1 -0
  325. package/dist/domain/extensions/index.d.ts +1 -1
  326. package/dist/domain/extensions/index.js +1 -1
  327. package/dist/domain/index.d.ts +1 -1
  328. package/dist/domain/index.js +1 -1
  329. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +6 -8
  330. package/dist/domain/spec/modules/index.d.ts +0 -1
  331. package/dist/domain/spec/modules/index.js +1 -1
  332. package/dist/domain/spec/phx/phx-domain.d.ts +0 -1
  333. package/dist/domain/spec/phx/phx-domain.js +1 -1
  334. package/dist/domain/spec/runtime/application-spec-slice.d.ts +5 -5
  335. package/dist/domain/spec/runtime/application-spec-slice.js +1 -1
  336. package/dist/domain/spec/runtime/create-application.d.ts +5 -2
  337. package/dist/domain/spec/runtime/create-application.js +1 -1
  338. package/dist/domain/spec/runtime-spec/runtime-spec.d.ts +2 -2
  339. package/dist/domain/spec/sections/app-metadata.d.ts +1 -0
  340. package/dist/domain/spec/sections/assistant/assistant-manifest.d.ts +28 -1
  341. package/dist/domain/spec/sections/assistant/assistant-navigation.d.ts +21 -0
  342. package/dist/domain/spec/sections/assistant/assistant-navigation.js +1 -0
  343. package/dist/domain/spec/sections/assistant/assistant-resolved-manifest.d.ts +30 -2
  344. package/dist/domain/spec/sections/assistant/assistant-select.d.ts +12 -0
  345. package/dist/domain/spec/sections/assistant/assistant-select.js +1 -0
  346. package/dist/domain/spec/sections/assistant/form/assistant-form-elements.d.ts +10 -26
  347. package/dist/domain/spec/sections/assistant/form/assistant-form-elements.js +1 -1
  348. package/dist/domain/spec/sections/assistant/index.d.ts +3 -1
  349. package/dist/domain/system-components/index.d.ts +1 -0
  350. package/dist/domain/system-components/index.js +1 -1
  351. package/dist/domain/system-components/navigation/index.d.ts +1 -0
  352. package/dist/domain/system-components/navigation/index.js +1 -0
  353. package/dist/domain/system-components/navigation/view-controls.d.ts +24 -0
  354. package/dist/domain/system-components/navigation/view-controls.js +1 -0
  355. package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
  356. package/dist/editor/domain-editors/apply-spec-update.js +1 -1
  357. package/dist/editor/domain-editors/use-implementation-files.d.ts +4 -3
  358. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  359. package/dist/extras/cognito/CognitoSignInPage.d.ts +2 -0
  360. package/dist/extras/cognito/CognitoSignInPage.js +1 -0
  361. package/dist/extras/cognito/index.d.ts +1 -0
  362. package/dist/extras/cognito/index.js +1 -0
  363. package/dist/i18n/locales/cs/messages.js +1 -1
  364. package/dist/i18n/locales/da/messages.js +1 -1
  365. package/dist/i18n/locales/de/messages.js +1 -1
  366. package/dist/i18n/locales/de-AT/messages.js +1 -1
  367. package/dist/i18n/locales/en/messages.js +1 -1
  368. package/dist/i18n/locales/en-AU/messages.js +1 -1
  369. package/dist/i18n/locales/en-GB/messages.js +1 -1
  370. package/dist/i18n/locales/es/messages.js +1 -1
  371. package/dist/i18n/locales/fr/messages.js +1 -1
  372. package/dist/i18n/locales/hu/messages.js +1 -1
  373. package/dist/i18n/locales/it/messages.js +1 -1
  374. package/dist/i18n/locales/nl/messages.js +1 -1
  375. package/dist/i18n/locales/pl/messages.js +1 -1
  376. package/dist/i18n/locales/pt/messages.js +1 -1
  377. package/dist/i18n/locales/ro/messages.js +1 -1
  378. package/dist/i18n/locales/sk/messages.js +1 -1
  379. package/dist/i18n/locales/tr/messages.js +1 -1
  380. package/dist/legacy/deployment-cli/commands/create-environment.js +1 -1
  381. package/dist/legacy/deployment-cli/commands/list-environments.js +1 -1
  382. package/dist/legacy/deployment-cli/commands/register-deployment.js +1 -1
  383. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +24 -2
  384. package/dist/legacy/phoenix-cli/commands/prepare-deployment-command.js +1 -1
  385. package/dist/legacy/phoenix-cli/commands/prepare-local-environment-command.js +1 -1
  386. package/dist/legacy/phoenix-cli/services/prepare-development-environment.js +1 -1
  387. package/dist/legacy/phoenix-cli/services/webhook-service/transport.js +1 -1
  388. package/dist/legacy/webhook-cli/lib/webhook-boundary.js +1 -1
  389. package/dist/phoenix/application-spec/index.d.ts +1 -1
  390. package/dist/phoenix/application-spec/index.js +1 -1
  391. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +1 -0
  392. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  393. package/dist/phoenix/cli.js +1 -1
  394. package/dist/phoenix/commands/account/index.d.ts +1 -0
  395. package/dist/phoenix/commands/account/index.js +1 -0
  396. package/dist/phoenix/commands/account/whoami.d.ts +10 -0
  397. package/dist/phoenix/commands/account/whoami.js +4 -0
  398. package/dist/phoenix/commands/cleanup-environment.js +1 -1
  399. package/dist/phoenix/commands/deploy.d.ts +7 -2
  400. package/dist/phoenix/commands/deploy.js +8 -2
  401. package/dist/phoenix/commands/deployment-build-envs-command.js +1 -1
  402. package/dist/phoenix/commands/feedback.d.ts +2 -2
  403. package/dist/phoenix/commands/feedback.js +1 -1
  404. package/dist/phoenix/commands/finish-deployment-command.js +1 -1
  405. package/dist/phoenix/commands/index.d.ts +1 -0
  406. package/dist/phoenix/commands/index.js +1 -1
  407. package/dist/phoenix/commands/init-starter-spec.js +3 -4
  408. package/dist/phoenix/commands/init.d.ts +2 -2
  409. package/dist/phoenix/commands/init.js +1 -1
  410. package/dist/phoenix/commands/login.d.ts +6 -3
  411. package/dist/phoenix/commands/login.js +3 -3
  412. package/dist/phoenix/commands/logout.js +1 -1
  413. package/dist/phoenix/commands/prepare-deployment-command.js +2 -2
  414. package/dist/phoenix/commands/prepare-local-environment-command.js +1 -1
  415. package/dist/phoenix/services/cli-credentials.d.ts +26 -7
  416. package/dist/phoenix/services/cli-credentials.js +2 -2
  417. package/dist/phoenix/services/cli-server/describe-saved-logins.d.ts +5 -0
  418. package/dist/phoenix/services/cli-server/describe-saved-logins.js +1 -0
  419. package/dist/phoenix/services/cli-server/index.d.ts +2 -0
  420. package/dist/phoenix/services/cli-server/index.js +1 -0
  421. package/dist/phoenix/services/cli-server/resolve-cli-server-url.d.ts +19 -0
  422. package/dist/phoenix/services/cli-server/resolve-cli-server-url.js +1 -0
  423. package/dist/phoenix/services/development-credential.js +1 -1
  424. package/dist/phoenix/services/index.d.ts +4 -2
  425. package/dist/phoenix/services/index.js +1 -1
  426. package/dist/phoenix/services/phoenix-regions.d.ts +6 -1
  427. package/dist/phoenix/services/phoenix-regions.js +1 -1
  428. package/dist/phoenix/services/prepare-development-environment.js +1 -1
  429. package/dist/phoenix/services/session/phoenix-application.js +1 -1
  430. package/dist/phoenix/services/signed-in-development-environment.d.ts +15 -4
  431. package/dist/phoenix/services/signed-in-development-environment.js +1 -1
  432. package/dist/phoenix/services/spec-project/describe-workspace-projects.d.ts +11 -0
  433. package/dist/phoenix/services/spec-project/describe-workspace-projects.js +1 -0
  434. package/dist/phoenix/services/spec-project/index.d.ts +3 -0
  435. package/dist/phoenix/services/spec-project/index.js +1 -0
  436. package/dist/phoenix/services/spec-project/resolve-deploy-target.d.ts +47 -0
  437. package/dist/phoenix/services/spec-project/resolve-deploy-target.js +1 -0
  438. package/dist/phoenix/services/spec-project/resolve-target-project.d.ts +34 -0
  439. package/dist/phoenix/services/spec-project/resolve-target-project.js +2 -0
  440. package/dist/phoenix/services/spec-project/write-spec-project.d.ts +7 -0
  441. package/dist/phoenix/services/spec-project/write-spec-project.js +1 -0
  442. package/dist/phoenix/services/telemetry/telemetry-event.js +1 -1
  443. package/dist/phoenix/services/telemetry/telemetry-state.d.ts +1 -1
  444. package/dist/phoenix/services/telemetry/telemetry-state.js +1 -1
  445. package/dist/phoenix/services/variant-file-session.js +1 -1
  446. package/dist/phoenix/services/webhook-service/transport.js +1 -1
  447. package/dist/react-sdk/application-runtime/common-services/index.d.ts +1 -0
  448. package/dist/react-sdk/application-runtime/common-services/index.js +1 -1
  449. package/dist/react-sdk/application-runtime/common-services/selectors.d.ts +2 -0
  450. package/dist/react-sdk/application-runtime/common-services/selectors.js +1 -1
  451. package/dist/react-sdk/application-runtime/common-services/webmcp/index.d.ts +3 -0
  452. package/dist/react-sdk/application-runtime/common-services/webmcp/index.js +1 -0
  453. package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-host.d.ts +35 -0
  454. package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-host.js +1 -0
  455. package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-model-context.d.ts +44 -0
  456. package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-model-context.js +1 -0
  457. package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-tool-result.d.ts +24 -0
  458. package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-tool-result.js +1 -0
  459. package/dist/react-sdk/application-runtime/domain-application-context/application-runtime-extension.d.ts +7 -1
  460. package/dist/react-sdk/application-runtime/domain-application-context/application-runtime-extension.js +1 -1
  461. package/dist/react-sdk/application-runtime/domain-application-context/domain-application-systems.d.ts +2 -2
  462. package/dist/react-sdk/application-runtime/domain-application-context/selectors.d.ts +1 -3
  463. package/dist/react-sdk/application-runtime/domain-application-context/selectors.js +1 -1
  464. package/dist/react-sdk/application-runtime/hooks/index.d.ts +1 -0
  465. package/dist/react-sdk/application-runtime/hooks/index.js +1 -1
  466. package/dist/react-sdk/application-runtime/hooks/use-spec.d.ts +1 -1
  467. package/dist/react-sdk/application-runtime/hooks/use-webmcp-host.d.ts +7 -0
  468. package/dist/react-sdk/application-runtime/hooks/use-webmcp-host.js +1 -0
  469. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  470. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +14 -16
  471. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
  472. package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +5 -6
  473. package/dist/react-sdk/domain-context/common-hooks/use-state-validity.d.ts +1 -1
  474. package/dist/react-sdk/domain-context/common-hooks/use-state-validity.js +1 -1
  475. package/dist/react-sdk/domain-context/index.d.ts +1 -1
  476. package/dist/react-sdk/domain-context/index.js +1 -1
  477. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.d.ts +5 -3
  478. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
  479. package/dist/react-sdk/preset-selection/PresetSelectionProvider.d.ts +11 -0
  480. package/dist/react-sdk/preset-selection/PresetSelectionProvider.js +1 -1
  481. package/dist/react-sdk/preset-selection/PresetWebMcpTools.d.ts +14 -0
  482. package/dist/react-sdk/preset-selection/PresetWebMcpTools.js +1 -0
  483. package/dist/react-sdk/preset-selection/index.d.ts +2 -1
  484. package/dist/react-sdk/preset-selection/index.js +1 -1
  485. package/dist/react-sdk/preset-selection/register-preset-webmcp-tools.d.ts +31 -0
  486. package/dist/react-sdk/preset-selection/register-preset-webmcp-tools.js +1 -0
  487. package/dist/ui-sdk/components/preview/Preview.d.ts +12 -4
  488. package/dist/ui-sdk/components/preview/Preview.js +2 -2
  489. package/dist/ui-sdk/components/toolbar/desktop-toolbar/ToolbarPopper.d.ts +2 -0
  490. package/dist/ui-sdk/components/toolbar/desktop-toolbar/ToolbarPopper.js +1 -1
  491. package/dist/ui-sdk/components/view-controls/ViewControlsContext.d.ts +3 -1
  492. package/dist/ui-sdk/components/view-controls/ViewControlsItem.js +1 -1
  493. package/dist/ui-sdk/components/view-controls/ViewControlsRoot.d.ts +6 -1
  494. package/dist/ui-sdk/components/view-controls/ViewControlsRoot.js +1 -1
  495. package/dist/webhook/builders/auth-handler-builder.d.ts +3 -0
  496. package/dist/webhook/builders/auth-handler-builder.js +1 -1
  497. package/dist/webhook/builders/common.d.ts +3 -1
  498. package/dist/webhook/builders/webhook-builder.d.ts +5 -0
  499. package/dist/webhook/builders/webhook-builder.js +1 -1
  500. package/package.json +9 -4
  501. package/schema/domain-spec.json +440 -53
  502. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/assistant-setup.js +0 -32
  503. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-guidelines.d.ts +0 -2
  504. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-guidelines.js +0 -25
  505. package/dist/configurator/ui/assistant/annotation/use-end-on-unmount.js +0 -1
  506. package/dist/configurator/ui/assistant/form-elements/FormCard.d.ts +0 -68
  507. package/dist/configurator/ui/assistant/form-elements/FormCard.js +0 -1
  508. package/dist/configurator/ui/assistant/form-elements/FormSwatch.d.ts +0 -61
  509. package/dist/configurator/ui/assistant/form-elements/FormSwatch.js +0 -1
  510. package/dist/domain/domain-context/action-system/action-system.d.ts +0 -64
  511. package/dist/domain/domain-context/action-system/action-system.js +0 -1
  512. package/dist/domain/domain-context/action-system/index.d.ts +0 -1
  513. package/dist/domain/domain-context/action-system/index.js +0 -1
  514. package/dist/domain/domain-runtime/action-factory.d.ts +0 -11
  515. package/dist/domain/domain-runtime/domain-context/action-context.d.ts +0 -11
  516. package/dist/domain/extensions/view-controls.d.ts +0 -25
  517. package/dist/domain/extensions/view-controls.js +0 -1
  518. package/dist/domain/spec/modules/resolve-action-modules.js +0 -1
  519. /package/dist/{domain/domain-runtime/domain-context → configurator/application-runtime/extensions/systems/action-system}/action-context.js +0 -0
  520. /package/dist/{domain/domain-runtime → configurator/application-runtime/extensions/systems/action-system}/action-factory.js +0 -0
@@ -1,5 +1,5 @@
1
- export const getDomainFactoryTypes=(t,e)=>{let{typePrefix:n,isAdmin:a}=e,o=n?`${n}.`:"",{entityTypes:i}=t.latestModel,$=[...t.latestModel.aliases].map(([t])=>String(t)),s=[...t.latestModel.commonTypes],l=[...t.latestModel.shapes].map(([t])=>`${t}Shape`),r=new Map([...t.expressions.constants].map(([t,e])=>[String(t),e])),y=(t,e)=>{let n=[...r.get(e)?.keys()??[]],a=n.length>0?`, ${n.map(t=>`'${t}'`).join(" | ")}`:"";return`${t}<${o}$${e}${a}>`},m=[...i.map(t=>` readonly ${String(t)}: DomainEntityReflection<${o}${String(t)}>`),...$.map(t=>` readonly ${t}: RawAliasReflection<${o}${t}>`),...s.map(([t,e])=>{let n,a=(n=e.schema.enum,n?.length&&n.every(t=>"string"==typeof t))?"EnumLike":"SchemaReflection";return` readonly ${t}: ${a}<${o}${t}>`}),...l.map(t=>` readonly ${t}: SchemaReflection<unknown>`)].join("\n"),p=[...i.map(t=>` readonly $${String(t)}: ${y("$DomainEntityReflection",String(t))}`),...$.map(t=>` readonly $${t}: ${y("EnhancedAliasReflection",t)}`)].join("\n");return{typeArguments:`${o}AnyDomainEntity, ${o}RootEntity, ${o}$Map, PublishedData, SessionData, FrontendData, ${o}Aliases`,contextExtension:`RuntimeExpressionContext<${o}AnyDomainEntity>`,actionTypeArguments:`${o}AnyDomainEntity, ${o}RootEntity, ${o}$Map, NavigationState, ViewState, ToolState, ExportState, PublishedData, SessionData, FrontendData, ActionTypes${a?"":`, ConfiguratorExtensionSystems<${o}AnyDomainEntity, ${o}RootEntity, ${o}$Map, NavigationState, ViewState, ToolState, ExportState>`}`,modelType:`{
1
+ export const getDomainFactoryTypes=(e,n)=>{let{typePrefix:t}=n,a=t?`${t}.`:"",{entityTypes:o}=e.latestModel,i=[...e.latestModel.aliases].map(([e])=>String(e)),$=[...e.latestModel.commonTypes],l=[...e.latestModel.shapes].map(([e])=>`${e}Shape`),s=new Map([...e.expressions.constants].map(([e,n])=>[String(e),n])),r=(e,n)=>{let t=[...s.get(n)?.keys()??[]],o=t.length>0?`, ${t.map(e=>`'${e}'`).join(" | ")}`:"";return`${e}<${a}$${n}${o}>`},m=[...o.map(e=>` readonly ${String(e)}: DomainEntityReflection<${a}${String(e)}>`),...i.map(e=>` readonly ${e}: RawAliasReflection<${a}${e}>`),...$.map(([e,n])=>{let t,o=(t=n.schema.enum,t?.length&&t.every(e=>"string"==typeof e))?"EnumLike":"SchemaReflection";return` readonly ${e}: ${o}<${a}${e}>`}),...l.map(e=>` readonly ${e}: SchemaReflection<unknown>`)].join("\n"),p=[...o.map(e=>` readonly $${String(e)}: ${r("$DomainEntityReflection",String(e))}`),...i.map(e=>` readonly $${e}: ${r("EnhancedAliasReflection",e)}`)].join("\n");return{typeArguments:`${a}AnyDomainEntity, ${a}RootEntity, ${a}$Map, PublishedData, SessionData, FrontendData, ${a}Aliases`,contextExtension:`RuntimeExpressionContext<${a}AnyDomainEntity>`,modelType:`{
2
2
  ${m}
3
3
  }`,enhancedModelType:`{
4
4
  ${p}
5
- }`,enhancedReflectionType:y}};
5
+ }`,enhancedReflectionType:r}};
@@ -9,13 +9,13 @@ interface DomainBlockSpec {
9
9
  readonly resolvedVersions: ResolvedVersions;
10
10
  }
11
11
  export interface DomainBlockOptions {
12
+ readonly isAdmin: boolean;
12
13
  readonly domainSpec: DomainBlockSpec;
13
14
  readonly invariants: Invariants;
14
15
  /** The declared actions of the configurator domain; `undefined` for the admin domain, which has none. */
15
16
  readonly actions: Actions | undefined;
16
17
  readonly typePrefix: string;
17
18
  readonly versionNsPrefix: string;
18
- readonly isAdmin: boolean;
19
19
  readonly modelVersionsExportName: string;
20
20
  readonly relationExpressionsExportName: string;
21
21
  readonly componentOpticsExportName: string;
@@ -1,7 +1,7 @@
1
- import{skipApplicationTypeImports as e}from"../../common/index.js";import{getDomainFactoryTypes as n}from"./factory-types/index.js";import{generateComponentOpticsCode as t}from"./generate-component-optics.js";import{generateDefaultsBlock as a}from"./generate-defaults.js";import{generateInvariantsBlock as o}from"./generate-invariants.js";import{generateRelationExpressionsCode as i}from"./generate-relation-expressions.js";import{generateStaticValueCode as s}from"./generate-static-value-code.js";import{generateValueExpressionsCode as r}from"./generate-value-expressions.js";let m="@salsita-ai/sdk/domain",l=(e,n,t)=>{let a=[],o=[];for(let i of e.modelVersion.entitySchemas){let e=JSON.stringify(i.shapeSchema,null,2);a.push(`${t}const ${i.entityType} = new DomainEntityReflection<${n}${i.entityType}>('${i.entityType}', [${e}])`),o.push(String(i.entityType))}return{entityDecls:a.join("\n"),entityNames:o}};export const generateDomainBlock=p=>{let{domainSpec:c,invariants:$,actions:d,typePrefix:u,versionNsPrefix:y,isAdmin:h,modelVersionsExportName:f,relationExpressionsExportName:S,componentOpticsExportName:D,valueExpressionsExportName:E,createRecipeExportName:g,imports:A,registerApplicationTypeImports:x=e}=p;A.addImport(m,"$DomainEntityReflection"),A.addImport(m,"DomainBuilder"),A.addImport(m,"DomainComponentOpticBuilder"),A.addImport(m,"DomainEntityReflection"),A.addImport(m,"EnhancedAliasReflection"),A.addImport(m,"RawAliasReflection"),A.addImport(m,"SchemaReflection"),A.addImport(m,"createCustomExpressionFactory"),A.addImport(m,"createCustomInvariantFactory"),h&&(A.addImport(m,"commonAdminCustomExpressions"),A.addImport(m,"commonAdminViolationExpressions"),A.addImport(m,"createMapPublishedRevisionDataHandlerFactory"),A.addImport(m,"createMapPublishedChunkedDataHandlerFactory"),A.addImport(m,"createDataRowValidatorHandler"),A.addImport(m,"createSheetValidatorHandler")),h||A.addImport(m,"createAssistantSetupHandlerFactory"),A.addTypeImport(m,"RuntimeExpressionContext"),A.addTypeImport(m,"SchemaOfObject"),d&&(A.addImport(m,"createActionFactory"),A.addTypeImport(m,"ActionDefinition"),A.addTypeImport("@salsita-ai/sdk/configurator","ConfiguratorExtensionSystems"));let{entityTypes:R,entitySchemas:v}=c.latestModel,I=[...c.latestModel.aliases],j=I.map(([e])=>String(e)),C=j.includes("RootEntity")?"RootEntity":"AnyDomainEntity",{resolvedVersions:M}=c,H=M.latestVersion,F=u?`${u}.`:"",P=new Map([...c.expressions.constants].map(([e,n])=>[String(e),n])),b=n(c,{typePrefix:u,isAdmin:h}),{enhancedReflectionType:w}=b,T=e=>{let n=P.get(e);if(!n)return"{}";let t=[...n].map(([e,n])=>{let t=s(n,A).replaceAll("\n","\n ");return` ${e}: ${t},`});return`{
1
+ import{skipApplicationTypeImports as e}from"../../common/index.js";import{getDomainFactoryTypes as n}from"./factory-types/index.js";import{generateComponentOpticsCode as t}from"./generate-component-optics.js";import{generateDefaultsBlock as a}from"./generate-defaults.js";import{generateInvariantsBlock as o}from"./generate-invariants.js";import{generateRelationExpressionsCode as i}from"./generate-relation-expressions.js";import{generateStaticValueCode as s}from"./generate-static-value-code.js";import{generateValueExpressionsCode as r}from"./generate-value-expressions.js";let m="@salsita-ai/sdk/domain",l=(e,n,t)=>{let a=[],o=[];for(let i of e.modelVersion.entitySchemas){let e=JSON.stringify(i.shapeSchema,null,2);a.push(`${t}const ${i.entityType} = new DomainEntityReflection<${n}${i.entityType}>('${i.entityType}', [${e}])`),o.push(String(i.entityType))}return{entityDecls:a.join("\n"),entityNames:o}};export const generateDomainBlock=p=>{let{domainSpec:$,invariants:c,actions:d,typePrefix:u,versionNsPrefix:y,isAdmin:h,modelVersionsExportName:f,relationExpressionsExportName:S,componentOpticsExportName:D,valueExpressionsExportName:E,createRecipeExportName:R,imports:g,registerApplicationTypeImports:x=e}=p;g.addImport(m,"$DomainEntityReflection"),g.addImport(m,"DomainBuilder"),g.addImport(m,"DomainComponentOpticBuilder"),g.addImport(m,"DomainEntityReflection"),g.addImport(m,"EnhancedAliasReflection"),g.addImport(m,"RawAliasReflection"),g.addImport(m,"SchemaReflection"),g.addImport(m,"createCustomExpressionFactory"),g.addImport(m,"createCustomInvariantFactory"),h&&(g.addImport(m,"commonAdminCustomExpressions"),g.addImport(m,"commonAdminViolationExpressions"),g.addImport(m,"createMapPublishedRevisionDataHandlerFactory"),g.addImport(m,"createMapPublishedChunkedDataHandlerFactory"),g.addImport(m,"createDataRowValidatorHandler"),g.addImport(m,"createSheetValidatorHandler")),h||g.addImport(m,"createAssistantSetupHandlerFactory"),g.addTypeImport(m,"RuntimeExpressionContext"),g.addTypeImport(m,"SchemaOfObject"),d&&g.addTypeImport(m,"ActionDefinition");let{entityTypes:v,entitySchemas:A}=$.latestModel,j=[...$.latestModel.aliases],C=j.map(([e])=>String(e)),I=C.includes("RootEntity")?"RootEntity":"AnyDomainEntity",{resolvedVersions:M}=$,H=M.latestVersion,P=u?`${u}.`:"",b=new Map([...$.expressions.constants].map(([e,n])=>[String(e),n])),w=n($,{typePrefix:u}),{enhancedReflectionType:F}=w,k=e=>{let n=b.get(e);if(!n)return"{}";let t=[...n].map(([e,n])=>{let t=s(n,g).replaceAll("\n","\n ");return` ${e}: ${t},`});return`{
2
2
  ${t.join("\n")}
3
- }`},k=v.map(e=>{let n=JSON.stringify(e.shapeSchema,null,2);return` const ${e.entityType} = new DomainEntityReflection<${F}${e.entityType}>('${e.entityType}', [${n}])`}),O=I.map(([e,n])=>{let t=n.map(String).join(", ");return` const ${e} = new RawAliasReflection<${F}${e}>('${e}', [${t}])`}),V=[...c.latestModel.commonTypes],B=V.map(([e])=>String(e)),N=M.versionedModels.filter(e=>!e.isLatest).map(e=>`${y}${e.version}`);x(A,[...h?["Admin",...N]:[...R.map(String),...j,...B,...R.map(e=>`$${String(e)}`),...j.map(e=>`$${e}`),"Aliases","$Map",...N,...d?["ActionTypes","NavigationState","ViewState","ToolState","ExportState"]:[]],"PublishedData","SessionData","FrontendData",...h?[]:["BackendData"]]);let J=V.map(([e,n])=>{let t=JSON.stringify(n.runtimeSchema,null,2);return n.schema.enum?.length&&n.schema.enum.every(e=>"string"==typeof e)?` const ${e}: EnumLike<${F}${e}> = new EnumReflection('${e}', ${t}) as EnumLike<${F}${e}>`:` const ${e}: SchemaReflection<${F}${e}> = new SchemaReflection('${e}', ${t})`}),L=[...c.latestModel.shapes],_=L.map(([e,n])=>{let t=JSON.stringify(n.runtimeSchema,null,2);return` const ${e}Shape = new SchemaReflection('${e}Shape', ${t})`}),z=L.map(([e])=>`${e}Shape`),G=j.map(e=>` ${e}: ${e}.types,`).join("\n"),q=j.map(e=>` ${e},`).join("\n"),K=B.map(e=>` ${e},`).join("\n"),Q=z.map(e=>` ${e},`).join("\n"),U=R.map(e=>` ${e},`).join("\n"),W=[];for(let[e,n]of c.expressions.expressions)n.size>0&&W.push(` const ${e}Expressions = ${JSON.stringify([...n.keys()])}`);let X=R.map(e=>{let n=c.expressions.entityExpressions.get(e),t=(n?.shapeGroups??[]).map(e=>`${e}Expressions`),a=t.length>0?t.map(e=>`...${e}`).join(", "):"",o=w("$DomainEntityReflection",String(e));return` const $${e}: ${o} = new ${o}('${e}', [${a}], ${T(String(e))})`}).join("\n"),Y=R.map(e=>` ${e}: $${e},`).join("\n"),Z=I.map(([e,n])=>{let t=n.map(e=>JSON.stringify(String(e))).join(", "),a=w("EnhancedAliasReflection",String(e));return` const $${e}: ${a} = new ${a}('$${e}', [${t}], ${T(String(e))})`}).join("\n"),ee=[...R.map(String),...j].map(e=>` $${e},`).join("\n"),en=[],et=[];for(let e of M.versionedModels)if(e.isLatest)en.push(` ${e.version}: entities,`),et.push(` readonly ${e.version}: {
4
- ${R.map(e=>` readonly ${String(e)}: DomainEntityReflection<${F}${String(e)}>`).join("\n")}
3
+ }`},O=A.map(e=>{let n=JSON.stringify(e.shapeSchema,null,2);return` const ${e.entityType} = new DomainEntityReflection<${P}${e.entityType}>('${e.entityType}', [${n}])`}),T=j.map(([e,n])=>{let t=n.map(String).join(", ");return` const ${e} = new RawAliasReflection<${P}${e}>('${e}', [${t}])`}),V=[...$.latestModel.commonTypes],B=V.map(([e])=>String(e)),N=M.versionedModels.filter(e=>!e.isLatest).map(e=>`${y}${e.version}`);x(g,[...h?["Admin",...N]:[...v.map(String),...C,...B,...v.map(e=>`$${String(e)}`),...C.map(e=>`$${e}`),"Aliases","$Map",...N,...d?["ActionTypes","NavigationState","ViewState","ToolState","ExportState"]:[]],"PublishedData","SessionData","FrontendData",...h?[]:["BackendData"]]);let J=V.map(([e,n])=>{let t=JSON.stringify(n.runtimeSchema,null,2);return n.schema.enum?.length&&n.schema.enum.every(e=>"string"==typeof e)?` const ${e}: EnumLike<${P}${e}> = new EnumReflection('${e}', ${t}) as EnumLike<${P}${e}>`:` const ${e}: SchemaReflection<${P}${e}> = new SchemaReflection('${e}', ${t})`}),L=[...$.latestModel.shapes],_=L.map(([e,n])=>{let t=JSON.stringify(n.runtimeSchema,null,2);return` const ${e}Shape = new SchemaReflection('${e}Shape', ${t})`}),z=L.map(([e])=>`${e}Shape`),G=C.map(e=>` ${e}: ${e}.types,`).join("\n"),q=C.map(e=>` ${e},`).join("\n"),K=B.map(e=>` ${e},`).join("\n"),Q=z.map(e=>` ${e},`).join("\n"),U=v.map(e=>` ${e},`).join("\n"),W=[];for(let[e,n]of $.expressions.expressions)n.size>0&&W.push(` const ${e}Expressions = ${JSON.stringify([...n.keys()])}`);let X=v.map(e=>{let n=$.expressions.entityExpressions.get(e),t=(n?.shapeGroups??[]).map(e=>`${e}Expressions`),a=t.length>0?t.map(e=>`...${e}`).join(", "):"",o=F("$DomainEntityReflection",String(e));return` const $${e}: ${o} = new ${o}('${e}', [${a}], ${k(String(e))})`}).join("\n"),Y=v.map(e=>` ${e}: $${e},`).join("\n"),Z=j.map(([e,n])=>{let t=n.map(e=>JSON.stringify(String(e))).join(", "),a=F("EnhancedAliasReflection",String(e));return` const $${e}: ${a} = new ${a}('$${e}', [${t}], ${k(String(e))})`}).join("\n"),ee=[...v.map(String),...C].map(e=>` $${e},`).join("\n"),en=[],et=[];for(let e of M.versionedModels)if(e.isLatest)en.push(` ${e.version}: entities,`),et.push(` readonly ${e.version}: {
4
+ ${v.map(e=>` readonly ${String(e)}: DomainEntityReflection<${P}${String(e)}>`).join("\n")}
5
5
  }`);else{let n=`${y}${e.version}.`,{entityDecls:t,entityNames:a}=l(e,n," "),o=a.map(e=>` ${e},`).join("\n");en.push(` ${e.version}: (() => {
6
6
  ${t}
7
7
  return {
@@ -9,26 +9,24 @@ ${o}
9
9
  } as const
10
10
  })(),`),et.push(` readonly ${e.version}: {
11
11
  ${a.map(e=>` readonly ${e}: DomainEntityReflection<${n}${e}>`).join("\n")}
12
- }`)}let ea=h?"adminDomainBuilder":"domainBuilder",eo=h?"attachAdminComponent":"attachComponent",ei=h?"implementAdminCustomExpressions":"implementCustomExpressions",es=h?"implementCustomAdminInvariants":"implementCustomInvariants",er=h?"adminAliases":"aliases",em=h?"adminModel":"model",el=h?"adminEnhancedModel":"enhancedModel",ep=h?"implementAdminRelation":"implementRelation",ec=h?"__adminDomain":"__configuratorDomain",e$=b.typeArguments,ed=`<${e$}>`,{contextExtension:eu}=b,ey=`<${e$}, ${eu}>`,eh=o($,e$,eu,A),ef=(e,n)=>e===n?e:`${e}: ${n}`,eS=[...c.expressions.expressions.values()].some(e=>[...e.values()].some(e=>"relation"===e.implementation.kind));eS&&A.addImport(m,"createRelationFactory");let eD=eS?`
12
+ }`)}let ea=h?"adminDomainBuilder":"domainBuilder",eo=h?"attachAdminComponent":"attachComponent",ei=h?"implementAdminCustomExpressions":"implementCustomExpressions",es=h?"implementCustomAdminInvariants":"implementCustomInvariants",er=h?"adminAliases":"aliases",em=h?"adminModel":"model",el=h?"adminEnhancedModel":"enhancedModel",ep=h?"implementAdminRelation":"implementRelation",e$=h?"__adminDomain":"__configuratorDomain",ec=w.typeArguments,ed=`<${ec}>`,{contextExtension:eu}=w,ey=`<${ec}, ${eu}>`,eh=o(c,ec,eu,g),ef=(e,n)=>e===n?e:`${e}: ${n}`,eS=[...$.expressions.expressions.values()].some(e=>[...e.values()].some(e=>"relation"===e.implementation.kind));eS&&g.addImport(m,"createRelationFactory");let eD=eS?`
13
13
  const ${ep} = createRelationFactory(aliases)
14
14
 
15
- const relationExpressions = ${i(c.expressions,ep)}`:"\n const relationExpressions = {} as const",eE=`
16
- const componentOptics = ${t(c.components,A)}`,eg=`
17
- const valueExpressions = ${r(c.expressions,A,"implementCustomExpressions",h?{PresetCategory:"commonAdminCustomExpressions.PresetCategory"}:{})}`;A.addImport(m,"createRecipeFactory");let eA=a(c.defaults,A),ex=[...d?.values()??[]].map(e=>({name:String(e.name),...void 0===e.description?{}:{description:e.description},params:e.paramsSchema})),eR=d?`
18
- const actionDefinitions: readonly ActionDefinition[] = ${JSON.stringify(ex,null,2).replaceAll("\n","\n ")}
19
-
20
- const implementActions = createActionFactory<${b.actionTypeArguments}>()`:"",ev=`
21
- const createRecipe = createRecipeFactory<${F}AnyDomainEntity>(aliases, AnyDomainEntity.reflections, defaults)`,{modelType:eI,enhancedModelType:ej}=b,eC=`{
15
+ const relationExpressions = ${i($.expressions,ep)}`:"\n const relationExpressions = {} as const",eE=`
16
+ const componentOptics = ${t($.components,g)}`,eR=`
17
+ const valueExpressions = ${r($.expressions,g,"implementCustomExpressions",h?{PresetCategory:"commonAdminCustomExpressions.PresetCategory"}:{})}`;g.addImport(m,"createRecipeFactory");let eg=a($.defaults,g),ex=[...d?.values()??[]].map(e=>({name:String(e.name),...void 0===e.description?{}:{description:e.description},params:e.paramsSchema})),ev=d?`
18
+ const actionDefinitions: readonly ActionDefinition[] = ${JSON.stringify(ex,null,2).replaceAll("\n","\n ")}`:"",eA=`
19
+ const createRecipe = createRecipeFactory<${P}AnyDomainEntity>(aliases, AnyDomainEntity.reflections, defaults)`,{modelType:ej,enhancedModelType:eC}=w,eI=`{
22
20
  ${et.join("\n")}
23
- }`;return`const ${ec} = (() => {
21
+ }`;return`const ${e$} = (() => {
24
22
  const modelVersion = ${H}
25
23
 
26
- ${eA}
27
-
28
- ${k.join("\n")}
24
+ ${eg}
29
25
 
30
26
  ${O.join("\n")}
31
27
 
28
+ ${T.join("\n")}
29
+
32
30
  ${J.join("\n")}
33
31
 
34
32
  ${_.join("\n")}
@@ -60,8 +58,8 @@ ${ee}
60
58
  } as const
61
59
 
62
60
  const implementCustomExpressions = createCustomExpressionFactory${ey}()
63
- ${eR}${eD}
64
- ${eg}
61
+ ${ev}${eD}
62
+ ${eR}
65
63
 
66
64
  const modelVersions = {
67
65
  ${en.join("\n")}
@@ -71,17 +69,17 @@ ${en.join("\n")}
71
69
  ${eh}
72
70
  ${h?` const commonInvariants = implementCustomInvariants(commonAdminViolationExpressions)
73
71
 
74
- const createMapPublishedRevisionDataHandler = createMapPublishedRevisionDataHandlerFactory<${F}AnyDomainEntity, ${F}RootEntity, ${F}$Map, PublishedData>()
75
- const createMapPublishedChunkedDataHandler = createMapPublishedChunkedDataHandlerFactory<${F}AnyDomainEntity, ${F}RootEntity, ${F}$Map>()
72
+ const createMapPublishedRevisionDataHandler = createMapPublishedRevisionDataHandlerFactory<${P}AnyDomainEntity, ${P}RootEntity, ${P}$Map, PublishedData>()
73
+ const createMapPublishedChunkedDataHandler = createMapPublishedChunkedDataHandlerFactory<${P}AnyDomainEntity, ${P}RootEntity, ${P}$Map>()
76
74
  `:"\n const createAssistantSetupHandler = createAssistantSetupHandlerFactory<SessionData, AnyDomainEntity, $Map, ActionTypes>()\n"}${eE}
77
- ${ev}
75
+ ${eA}
78
76
 
79
77
  return {
80
78
  domainBuilder: DomainBuilder.from${ed}(
81
79
  entities,
82
80
  aliases,
83
81
  $entityReflections,
84
- ${C}.types,
82
+ ${I}.types,
85
83
  modelVersion,
86
84
  PublishedData,
87
85
  SessionData,
@@ -89,7 +87,7 @@ ${ev}
89
87
  ${h?"undefined":"BackendData"},
90
88
  ${h}
91
89
  ).withExpressions(valueExpressions)${d?".withActions(actionDefinitions)":""},
92
- attachComponent,${d?"\n implementActions,":""}
90
+ attachComponent,
93
91
  implementCustomExpressions,
94
92
  implementCustomInvariants,
95
93
  aliases,${h?`
@@ -115,15 +113,14 @@ const {
115
113
  commonInvariants: commonAdminInvariants,
116
114
  createMapPublishedRevisionDataHandler,
117
115
  createMapPublishedChunkedDataHandler,`:`
118
- implementActions,
119
116
  createAssistantSetupHandler,`}
120
117
  ${ef("relationExpressions",S)},
121
118
  ${ef("valueExpressions",E)},
122
119
  ${ef("componentOptics",D)},
123
- ${ef("createRecipe",g)},
124
- } = ${ec}
120
+ ${ef("createRecipe",R)},
121
+ } = ${e$}
125
122
 
126
- const ${em}: ${eI} = ${ec}.model
127
- const ${el}: ${ej} = ${ec}.enhancedModel
128
- const ${f}: ${eC} = ${ec}.modelVersions
129
- export { ${ea}, ${eo}, ${ei}, ${es}, ${er}, ${h?"commonAdminInvariants, ":""}${em}, ${el}, ${S}, ${E}, ${D}, ${f}, ${g}${h?", createMapPublishedRevisionDataHandler, createMapPublishedChunkedDataHandler, createDataRowValidatorHandler, createSheetValidatorHandler":", implementActions, createAssistantSetupHandler"} }`};
123
+ const ${em}: ${ej} = ${e$}.model
124
+ const ${el}: ${eC} = ${e$}.enhancedModel
125
+ const ${f}: ${eI} = ${e$}.modelVersions
126
+ export { ${ea}, ${eo}, ${ei}, ${es}, ${er}, ${h?"commonAdminInvariants, ":""}${em}, ${el}, ${S}, ${E}, ${D}, ${f}, ${R}${h?", createMapPublishedRevisionDataHandler, createMapPublishedChunkedDataHandler, createDataRowValidatorHandler, createSheetValidatorHandler":", createAssistantSetupHandler"} }`};
@@ -10,7 +10,6 @@ globalThis.phx.domain = {
10
10
  enhancedModel,
11
11
  implementCustomExpressions,
12
12
  implementCustomInvariants,
13
- implementActions,
14
13
  createAssistantSetupHandler,
15
14
  attachComponent,
16
15
  createRecipe,
@@ -52,7 +51,6 @@ globalThis.phx.applicationTypes = {
52
51
  readonly enhancedModel: typeof enhancedModel
53
52
  readonly implementCustomExpressions: typeof implementCustomExpressions
54
53
  readonly implementCustomInvariants: typeof implementCustomInvariants
55
- readonly implementActions: typeof implementActions
56
54
  readonly createAssistantSetupHandler: typeof createAssistantSetupHandler
57
55
  readonly attachComponent: typeof attachComponent
58
56
  readonly createRecipe: typeof createRecipe
@@ -73,7 +71,6 @@ globalThis.phx.applicationTypes = {
73
71
  enhancedModel,
74
72
  implementCustomExpressions,
75
73
  implementCustomInvariants,
76
- implementActions,
77
74
  createAssistantSetupHandler,
78
75
  attachComponent,
79
76
  createRecipe,
@@ -1,9 +1,9 @@
1
- import{CodeImports as o}from"../common/code-imports.js";import{autoHeader as i}from"../common/file-headers.js";let n=/v(\d+)\.ts$/,s=(o,i)=>o.versionedModels.filter(o=>void 0!==o.migrationFile).map(o=>({version:o.version,file:o.migrationFile,importName:i?`${i}MigrateToV${o.version}`:`migrateToV${o.version}`})),t=o=>o.map(o=>{let i=o.file.replace(n,`v${o.version}.js`),s=`migrateToV${o.version}`,t=o.importName!==s?` as ${o.importName}`:"";return`import { ${s}${t} } from '../${i}'`}).join("\n"),e=(o,i,n,s)=>[`const ${s}Migrations = {`,...o.map(o=>` ${o.version}: ${o.importName},`),"}","",`const ${s} = createMigrateFunction(${i}, ${n}, ${s}Migrations)`].join("\n");export const generateApplicationSpecDomainFile=n=>{let a=new o,r="./domain-spec.js",m="./configurator-domain-code.js",d="./admin-domain-code.js",p="@salsita-ai/sdk/domain",l=o=>[...o.expressions.values()].some(o=>[...o.values()].some(o=>"relation"===o.implementation.kind)),c=l(n.configurator.expressions),u=l(n.admin.expressions),x=s(n.configurator.resolvedVersions,""),I=s(n.admin.resolvedVersions,"admin"),g=x.length>0,h=I.length>0;a.addImport(r,"baseConfiguratorBuilder"),a.addImport(r,"domainBuilder"),a.addImport(r,"adminDomainBuilder"),a.addImport(r,"attachComponent"),a.addImport(r,"attachAdminComponent"),a.addImport(r,"implementCustomExpressions"),a.addImport(r,"implementAdminCustomExpressions"),a.addImport(r,"createI18n"),a.addImport(r,"componentOptics"),a.addImport(r,"adminComponentOptics"),a.addImport(r,"aliases"),a.addImport(r,"adminAliases"),a.addImport(r,"commonAdminInvariants"),a.addImport(p,"createViolationExpressions"),a.addImport(m,"customExpressions"),a.addImport(m,"customInvariants"),a.addImport(m,"customActions"),a.addImport(d,"customAdminExpressions"),a.addImport(d,"customAdminInvariants"),c&&a.addImport(r,"relationExpressions"),u&&a.addImport(r,"adminRelationExpressions"),(g||h)&&a.addImport(p,"createMigrateFunction"),g&&a.addImport(r,"modelVersions"),h&&a.addImport(r,"adminModelVersions");let $=[];g&&$.push(t(x)),h&&$.push(t(I));let v=$.length>0?"\n"+$.join("\n")+"\n":"",A=[];g&&A.push(e(x,"modelVersions",n.configurator.schemaVersion,"migrate")),h&&A.push(e(I,"adminModelVersions",n.admin.schemaVersion,"migrateAdmin"));let E=A.length>0?"\n"+A.join("\n\n")+"\n":"",f=["const domainFactory = domainBuilder",c?" .withExpressions(relationExpressions)":null," .withExpressions(createViolationExpressions(aliases, customInvariants))"," .withExpressionModules(customExpressions)"," .withActionModules(customActions)",g?" .withMigrate(migrate)":null," .build()"].filter(Boolean).join("\n"),w=["const adminDomainFactory = adminDomainBuilder",u?" .withExpressions(adminRelationExpressions)":null," .withExpressions(createViolationExpressions(adminAliases, customAdminInvariants, commonAdminInvariants))"," .withExpressionModules(customAdminExpressions)",h?" .withMigrate(migrateAdmin)":null," .build()"].filter(Boolean).join("\n");return`${i("domain.ts","Assembles domain and admin domain factories from builders, migrations, expressions and invariants.")}
1
+ import{CodeImports as o}from"../common/code-imports.js";import{autoHeader as i}from"../common/file-headers.js";let n=/v(\d+)\.ts$/,s=(o,i)=>o.versionedModels.filter(o=>void 0!==o.migrationFile).map(o=>({version:o.version,file:o.migrationFile,importName:i?`${i}MigrateToV${o.version}`:`migrateToV${o.version}`})),e=o=>o.map(o=>{let i=o.file.replace(n,`v${o.version}.js`),s=`migrateToV${o.version}`,e=o.importName!==s?` as ${o.importName}`:"";return`import { ${s}${e} } from '../${i}'`}).join("\n"),t=(o,i,n,s)=>[`const ${s}Migrations = {`,...o.map(o=>` ${o.version}: ${o.importName},`),"}","",`const ${s} = createMigrateFunction(${i}, ${n}, ${s}Migrations)`].join("\n");export const generateApplicationSpecDomainFile=n=>{let a=new o,r="./domain-spec.js",m="./configurator-domain-code.js",d="./admin-domain-code.js",p="@salsita-ai/sdk/domain",l=o=>[...o.expressions.values()].some(o=>[...o.values()].some(o=>"relation"===o.implementation.kind)),c=l(n.configurator.expressions),u=l(n.admin.expressions),x=s(n.configurator.resolvedVersions,""),g=s(n.admin.resolvedVersions,"admin"),I=x.length>0,h=g.length>0;a.addImport(r,"baseConfiguratorBuilder"),a.addImport(r,"domainBuilder"),a.addImport(r,"adminDomainBuilder"),a.addImport(r,"attachComponent"),a.addImport(r,"attachAdminComponent"),a.addImport(r,"implementCustomExpressions"),a.addImport(r,"implementAdminCustomExpressions"),a.addImport(r,"createI18n"),a.addImport(r,"componentOptics"),a.addImport(r,"adminComponentOptics"),a.addImport(r,"aliases"),a.addImport(r,"adminAliases"),a.addImport(r,"commonAdminInvariants"),a.addImport(p,"createViolationExpressions"),a.addImport(m,"customExpressions"),a.addImport(m,"customInvariants"),a.addImport(d,"customAdminExpressions"),a.addImport(d,"customAdminInvariants"),c&&a.addImport(r,"relationExpressions"),u&&a.addImport(r,"adminRelationExpressions"),(I||h)&&a.addImport(p,"createMigrateFunction"),I&&a.addImport(r,"modelVersions"),h&&a.addImport(r,"adminModelVersions");let $=[];I&&$.push(e(x)),h&&$.push(e(g));let v=$.length>0?"\n"+$.join("\n")+"\n":"",E=[];I&&E.push(t(x,"modelVersions",n.configurator.schemaVersion,"migrate")),h&&E.push(t(g,"adminModelVersions",n.admin.schemaVersion,"migrateAdmin"));let f=E.length>0?"\n"+E.join("\n\n")+"\n":"",A=["const domainFactory = domainBuilder",c?" .withExpressions(relationExpressions)":null," .withExpressions(createViolationExpressions(aliases, customInvariants))"," .withExpressionModules(customExpressions)",I?" .withMigrate(migrate)":null," .build()"].filter(Boolean).join("\n"),C=["const adminDomainFactory = adminDomainBuilder",u?" .withExpressions(adminRelationExpressions)":null," .withExpressions(createViolationExpressions(adminAliases, customAdminInvariants, commonAdminInvariants))"," .withExpressionModules(customAdminExpressions)",h?" .withMigrate(migrateAdmin)":null," .build()"].filter(Boolean).join("\n");return`${i("domain.ts","Assembles domain and admin domain factories from builders, migrations, expressions and invariants.")}
2
2
  ${a.toString()}
3
3
  ${v}export { attachComponent, attachAdminComponent, implementCustomExpressions, implementAdminCustomExpressions, createI18n }
4
- ${E}
5
4
  ${f}
6
- ${w}
5
+ ${A}
6
+ ${C}
7
7
 
8
8
  export const configuratorBuilder = baseConfiguratorBuilder
9
9
  .withDomainFactory(domainFactory)
@@ -1,14 +1,13 @@
1
1
  import{generateInvariantBlueprintMembers as e,getDomainFactoryTypes as t}from"../domain-spec/index.js";let a="@salsita-ai/sdk/configurator",n="CustomInvariantBlueprints",o="AdminCustomInvariantBlueprints",r=["authHandlerBuilder","webhookBuilder","taskFactory","finalizeHandlerBuilder","callbackBuilder","prefetchBuilder","dynamicResourcesFactory"],i=(e,t)=>e.replaceAll("\n",`
2
- ${t}`),s=(e,t)=>{let a=(e.infra.resources??[]).map(e=>JSON.stringify(e.name));return["AnyDomainEntity","RootEntity","$Map","NavigationState","ViewState","ToolState","ExportState","PublishedData","SessionData","FrontendData",...t?["ActionTypes"]:[],"Admin.AnyDomainEntity","Admin.RootEntity","Admin.$Map","AdminNavigationState","never","FinalizeData","PrefetchedFinalizeData","FinalizeResult","CallbackData",a.length>0?[...new Set(a)].join(" | "):"never"].join(", ")},d=()=>{let e=new Map;return{member:(t,a)=>(e.set(t,a),t),declarations:()=>[...e].map(([e,t])=>`type ${e} = ${t}`).join("\n")}},p=(r,d,p)=>{for(let e of["$DomainEntityReflection","DomainComponentOpticBuilder","DomainEntityReflection","EnhancedAliasReflection","EnumLike","RawAliasReflection","RuntimeExpressionContext","SchemaReflection","createActionFactory","createAssistantSetupHandlerFactory","createCustomExpressionFactory","createCustomInvariantFactory","createDataRowValidatorHandler","createMapPublishedChunkedDataHandlerFactory","createMapPublishedRevisionDataHandlerFactory","createRecipeFactory","createSheetValidatorHandler"])d.addTypeImport("@salsita-ai/sdk/domain",e);d.addTypeImport(a,"createConfiguratorInterface"),d.addTypeImport(a,"CreateAssistantFormElement"),d.addTypeImport(a,"ConfiguratorExtensionSystems");let l=t(r.configurator,{typePrefix:"",isAdmin:!1}),m=t(r.admin,{typePrefix:"Admin",isAdmin:!0}),y=s(r,!0),c=(e,t)=>t?`interface ${e} {
2
+ ${t}`),s=(e,t)=>{let a=(e.infra.resources??[]).map(e=>JSON.stringify(e.name));return["AnyDomainEntity","RootEntity","$Map","NavigationState","ViewState","ToolState","ExportState","PublishedData","SessionData","FrontendData",...t?["ActionTypes"]:[],"Admin.AnyDomainEntity","Admin.RootEntity","Admin.$Map","AdminNavigationState","never","FinalizeData","PrefetchedFinalizeData","FinalizeResult","CallbackData",a.length>0?[...new Set(a)].join(" | "):"never"].join(", ")},d=()=>{let e=new Map;return{member:(t,a)=>(e.set(t,a),t),declarations:()=>[...e].map(([e,t])=>`type ${e} = ${t}`).join("\n")}},l=(r,d,l)=>{for(let e of["$DomainEntityReflection","DomainComponentOpticBuilder","DomainEntityReflection","EnhancedAliasReflection","EnumLike","RawAliasReflection","RuntimeExpressionContext","SchemaReflection","createAssistantSetupHandlerFactory","createCustomExpressionFactory","createCustomInvariantFactory","createDataRowValidatorHandler","createMapPublishedChunkedDataHandlerFactory","createMapPublishedRevisionDataHandlerFactory","createRecipeFactory","createSheetValidatorHandler"])d.addTypeImport("@salsita-ai/sdk/domain",e);d.addTypeImport(a,"createConfiguratorInterface"),d.addTypeImport(a,"CreateAssistantFormElement");let p=t(r.configurator,{typePrefix:""}),m=t(r.admin,{typePrefix:"Admin"}),y=s(r,!0),c=(e,t)=>t?`interface ${e} {
3
3
  ${t}
4
- }`:`interface ${e} {}`,{member:u}=p,A=`{
5
- readonly model: ${i(l.modelType," ")}
6
- readonly enhancedModel: ${i(l.enhancedModelType," ")}
7
- readonly implementCustomExpressions: ${u("PhxImplementCustomExpressions",`ReturnType<typeof createCustomExpressionFactory<${l.typeArguments}, ${l.contextExtension}>>`)}
8
- readonly implementCustomInvariants: ${u("PhxImplementCustomInvariants",`ReturnType<ReturnType<typeof createCustomInvariantFactory<${l.typeArguments}, ${n}, ${l.contextExtension}>>>`)}
9
- readonly implementActions: ${u("PhxImplementActions",`ReturnType<typeof createActionFactory<${l.actionTypeArguments}>>`)}
4
+ }`:`interface ${e} {}`,{member:u}=l,$=`{
5
+ readonly model: ${i(p.modelType," ")}
6
+ readonly enhancedModel: ${i(p.enhancedModelType," ")}
7
+ readonly implementCustomExpressions: ${u("PhxImplementCustomExpressions",`ReturnType<typeof createCustomExpressionFactory<${p.typeArguments}, ${p.contextExtension}>>`)}
8
+ readonly implementCustomInvariants: ${u("PhxImplementCustomInvariants",`ReturnType<ReturnType<typeof createCustomInvariantFactory<${p.typeArguments}, ${n}, ${p.contextExtension}>>>`)}
10
9
  readonly createAssistantSetupHandler: ${u("PhxCreateAssistantSetupHandler","ReturnType<typeof createAssistantSetupHandlerFactory<SessionData, AnyDomainEntity, $Map, ActionTypes>>")}
11
- readonly attachComponent: ${u("PhxAttachComponent",`ReturnType<typeof DomainComponentOpticBuilder.from<${l.typeArguments}, ${l.contextExtension}>>`)}
10
+ readonly attachComponent: ${u("PhxAttachComponent",`ReturnType<typeof DomainComponentOpticBuilder.from<${p.typeArguments}, ${p.contextExtension}>>`)}
12
11
  readonly createRecipe: ${u("PhxCreateRecipe","ReturnType<typeof createRecipeFactory<AnyDomainEntity>>")}
13
12
  readonly admin: {
14
13
  readonly model: ${i(m.modelType," ")}
@@ -22,12 +21,12 @@ ${t}
22
21
  readonly createSheetValidatorHandler: typeof createSheetValidatorHandler
23
22
  readonly createRecipe: ${u("PhxAdminCreateRecipe","ReturnType<typeof createRecipeFactory<Admin.AnyDomainEntity>>")}
24
23
  }
25
- }`,$=u("PhxFrontend",`ReturnType<typeof createConfiguratorInterface<${y}>> & {
24
+ }`,h=u("PhxFrontend",`ReturnType<typeof createConfiguratorInterface<${y}>> & {
26
25
  readonly createAssistantFormElement: CreateAssistantFormElement<AssistantFormElementTypes>
27
- }`),{latestModel:h}=r.configurator;return{declarations:[c(n,e(r.configurator.invariants," ")),c(o,e(r.admin.invariants," "))].join("\n\n"),domainType:A,configuratorInterfaceType:$,applicationTypeNames:[...h.entityTypes.map(String),...[...h.aliases].map(([e])=>String(e)),...[...h.commonTypes].map(([e])=>String(e)),...h.entityTypes.map(e=>`$${String(e)}`),...[...h.aliases].map(([e])=>`$${String(e)}`),"Aliases","$Map","ActionTypes","AssistantFormElementTypes","Admin","PublishedData","SessionData","FrontendData","BackendData","FinalizeData","PrefetchedFinalizeData","FinalizeResult","CallbackData","NavigationState","ViewState","ToolState","ExportState","AdminNavigationState"]}};export const generatePhxTypes=(e,t)=>{let a=d(),n=p(e,t,a);return{...n,declarations:`${n.declarations}
26
+ }`),{latestModel:A}=r.configurator;return{declarations:[c(n,e(r.configurator.invariants," ")),c(o,e(r.admin.invariants," "))].join("\n\n"),domainType:$,configuratorInterfaceType:h,applicationTypeNames:[...A.entityTypes.map(String),...[...A.aliases].map(([e])=>String(e)),...[...A.commonTypes].map(([e])=>String(e)),...A.entityTypes.map(e=>`$${String(e)}`),...[...A.aliases].map(([e])=>`$${String(e)}`),"Aliases","$Map","ActionTypes","AssistantFormElementTypes","Admin","PublishedData","SessionData","FrontendData","BackendData","FinalizeData","PrefetchedFinalizeData","FinalizeResult","CallbackData","NavigationState","ViewState","ToolState","ExportState","AdminNavigationState"]}};export const generatePhxTypes=(e,t)=>{let a=d(),n=l(e,t,a);return{...n,declarations:`${n.declarations}
28
27
 
29
- ${a.declarations()}`}};export const generateGlobalPhxTypes=(e,t)=>{let a=d(),{member:n}=a,o=p(e,t,a);t.addTypeImport("@salsita-ai/sdk/admin","createAdminInterface"),t.addTypeImport("@salsita-ai/sdk/webhook","createDomainWebhook");let i=s(e,!1),l=n("PhxFrontendAdmin",`ReturnType<typeof createAdminInterface<${i}>>`),m=n("PhxWebhookBuilders",`ReturnType<typeof createDomainWebhook<${i}>>`),y=r.map(e=>` readonly ${e}: ${n(`PhxWebhooks${e.charAt(0).toUpperCase()}${e.slice(1)}`,`${m}['${e}']`)}`);return{...o,declarations:`${o.declarations}
28
+ ${a.declarations()}`}};export const generateGlobalPhxTypes=(e,t)=>{let a=d(),{member:n}=a,o=l(e,t,a);t.addTypeImport("@salsita-ai/sdk/admin","createAdminInterface"),t.addTypeImport("@salsita-ai/sdk/webhook","createDomainWebhook");let i=s(e,!1),p=n("PhxFrontendAdmin",`ReturnType<typeof createAdminInterface<${i}>>`),m=n("PhxWebhookBuilders",`ReturnType<typeof createDomainWebhook<${i}>>`),y=r.map(e=>` readonly ${e}: ${n(`PhxWebhooks${e.charAt(0).toUpperCase()}${e.slice(1)}`,`${m}['${e}']`)}`);return{...o,declarations:`${o.declarations}
30
29
 
31
- ${a.declarations()}`,adminInterfaceType:l,webhooksType:`{
30
+ ${a.declarations()}`,adminInterfaceType:p,webhooksType:`{
32
31
  ${y.join("\n")}
33
32
  }`}};
@@ -1 +1 @@
1
- import{createPhoenixTopicGuide as e}from"../guide.js";export const generatePhoenixCliCore=()=>e({path:"core/cli.md",title:"CLI",summary:"tooling, identity, project structure and ownership, local development and deployment",sections:["## Tooling and dependencies\n\nCommands use pnpm notation; use the project's package manager identified by its lockfile or `packageManager` in `package.json`, and ask when neither identifies it. Keep the SDK on its intended release channel: stable, PR beta and workspace-linked projects must not be moved to canary.\n\n`phoenix deps` aligns missing or out-of-range peer dependencies in `package.json` but installs nothing. Install with the project's package manager, then `phoenix sync` regenerates project files and guidance. Refresh changed guidance after sync. An install with pnpm 11 that skips build scripts leaves placeholder entries under `allowBuilds` in `pnpm-workspace.yaml`; decide them, `true` for `@swc/core` and `esbuild` and `false` for `es5-ext`, because the platform build stops on a placeholder and `phoenix deploy` refuses one. [CLI and setup documentation](../features/index.md#cli-access-and-deployment) owns flags and installation details.\n\n## Identity and authentication\n\nA workspace contains projects, and a project has target environments and deployments. Confirm ambiguous identity before mutations or deploys. `phoenix login <workspace>` authorizes the CLI; local dev and deploy use that identity. Consult [project and authentication documentation](../features/index.md#cli-access-and-deployment) for local versus remote setup.\n\n## Project structure\n\n- `spec/` — domain, relations, expressions, invariants, components and application YAML.\n- `src/expressions/`, `actions/`, `invariants/`, `transformers/` — typed implementations of domain behavior and consistency rules.\n- `src/components/`, `elements/`, `handlers/` — runtime components, custom UI and layout elements, event and lifecycle handlers. See [Custom project layout](../features/custom-layout/index.md) and [Domain controls](../features/domain-controls/index.md).\n- `src/webhooks/` — the server side. The entry is the default export of `index.ts`, the only file imported; it imports the others. Without it the SDK supplies anonymous auth only, and enabling custom or Clerk auth reports `AUTH_WITHOUT_PROJECT_WEBHOOK`. See [Webhooks](../features/webhooks/index.md).\n- `src/migrations/` — versioned model migrations; `src/admin/` mirrors the main source structure for Admin.\n- `src/locales/` — authored PO catalogs and generated TS catalogs.\n- `src/_shared/`, `src/_utils/` and other `_`-prefixed folders — helpers and supporting modules. Phoenix skips these folders during auto-import; import their modules explicitly.\n- `public/` — static models, textures, images and fonts; `assets/` — uploadable resources such as templates and email assets.\n- `docs/` — rendered specification PDFs for the client.\n- `tools/` — reproducible project scripts, such as model conversion or rendering the specification PDFs. One-off scripts, screenshots and downloads stay in the agent's scratch space outside the project.\n- `.phoenix/` — generated files, with the project-owned exceptions below. The root `tsconfig.json` belongs to the project and extends `.phoenix/tsconfig.json`.\n\nDo not edit generated output or compiled locale TS. `.phoenix/workspace/` holds the specification sources and project records; application-spec sync, build and clean preserve it, and the generated Git ignore rules leave it available for version control. Deploy includes `.phoenix/workspace/` and `docs/` in the private deployment sources, outside application inputs and public assets. `.phoenix/variants/` option files survive rebuilds. Legacy tooling has a separate lifecycle.\n\nSync rewrites and prunes Phoenix's `phoenix` and `phoenix-*` skill folders under `.claude/skills/` and `.agents/skills/`; keep custom skills under another name. Root `AGENTS.md` and client source documents are client-owned. Components use PascalCase TSX, utilities kebab-case TS, expressions entity-name TS, migrations sequential `v*.ts` and specs kebab-case YAML. `docs/phoenix/project-structure.mdx` has the full reference; the [capability index](../features/index.md#project-and-customization) lists it.\n\n### Source conventions\n\n- Auto-imported expressions, actions, invariants, transformers, components, handlers and elements must default-export their folder's phx factory result, as one item or an array. Named exports are ignored.\n- `phx` is a global in every project: use it without importing it.\n- Keep plain helpers in underscore folders and import them explicitly.\n- Use relative imports: dev, build and webhook bundling do not resolve tsconfig `paths` aliases.\n\n## Local development\n\n`phoenix dev` runs the live preview, `sync` regenerates without bundling, `build` produces the production build, and `check` checks project quality.\n\n### Keep the preview in front of the client\n\nThe client should see the configurator change while it is built. Before the first change in a conversation, make sure `pnpm phoenix dev` is running, starting it in the background when it is not, and wait for the `Preview: <url>` line it prints and writes to `.phoenix/phoenix-dev.log`. The log keeps the lines of earlier runs, so use the last one written after the start.\n\nFor a new project, start by understanding the client’s product and what they want to configure before asking them to sign in; then make the preview reflect that before showing it, rather than presenting the generated starter scene.\n\nOpen the address where the client can see it: in the agent application's built-in browser when it has one the client sees, otherwise in the client's browser with `open '<url>'` on macOS, `xdg-open '<url>'` on Linux or `Start-Process '<url>'` in PowerShell. Keep the quotes; the shell would otherwise read a `?` in the address as a pattern. Then tell the client in one line where the preview is and that it updates by itself as the work goes on. Variant comparisons open in the same preview, so say there what to compare and how to choose.\n\nOpen it once: the preview reloads on every change. A domain model change is the exception. Dev registers the model with the server only when it starts and logs an error asking for a restart; restart it, wait for the new `Preview:` line and open that address in place of the old tab, whose `?cid=` names a configuration of the earlier model.\n\n### Logs and inspection\n\nLogs in `.phoenix/phoenix-dev.log` contain spec, build and runtime errors and watcher events; check them after changes. Signed in, `phoenix dev` runs in agent mode: the preview hides the editor, a corner badge shows when the latest change didn't build, and any dev error shows an \"Agent at work\" screen with no details, so the client never sees them. The details are only in the log; the page recovers by itself after the next successful rebuild. `--editor` shows the editor and the detailed error pages. [Inspection tools](../features/inspection.md) cover assets, state, data, scene and screenshots. Runtime inspection needs dev running and the preview open in a browser; a screenshot of the canvas does not verify the surrounding interface.\n\n## Deployment\n\n`pnpm phoenix deploy` sends the project sources for a server build and waits for the target environment to go live. Run it so its output can be read while it runs: right after `Build <id> started` it prints `Follow the build in Studio: <url>`. Open that link where the client sees it, as with the preview, so they can follow the build. When the line is missing, the sign-in predates the link: the build is listed under Deployments in Studio, and `pnpm phoenix login <workspace>` brings the link back.\n\nA successful local preview does not establish deployed model compatibility. The deploy is refused before the upload when the domain model changed under a version that is already deployed, such as a starter deployed before the first draft; [Model migration](../processes/model-migration.md) handles that. When the build fails, tell the client the cause and the next step. Record each deploy and its outcome in the project record. [Deployment documentation](../features/index.md#cli-access-and-deployment) covers status and environment details.\n\n## Internal beta\n\nPhoenix is in an internal beta. Read [Beta](../processes/beta.md) before each deploy and when a deploy goes live; a project on the `canary` SDK build also reads it once per conversation before changing anything.\n\n## Interactive and support tools\n\n[Variants](../features/variants.md) compares frontend alternatives over the live preview and applies the choice. [Feedback](../processes/feedback/index.md) submits an approved issue or evaluation. The [workflow](workflow.md) owns when either is useful and how much client interaction fits the task."]});
1
+ import{createPhoenixTopicGuide as e}from"../guide.js";export const generatePhoenixCliCore=()=>e({path:"core/cli.md",title:"CLI",summary:"tooling, identity, project structure and ownership, local development and deployment",sections:["## Tooling and dependencies\n\nCommands use pnpm notation; use the project's package manager identified by its lockfile or `packageManager` in `package.json`, and ask when neither identifies it. Keep the SDK on its intended release channel: stable, PR beta and workspace-linked projects must not be moved to canary.\n\n`phoenix deps` aligns missing or out-of-range peer dependencies in `package.json` but installs nothing. Install with the project's package manager, then `phoenix sync` regenerates project files and guidance. Refresh changed guidance after sync. An install with pnpm 11 that skips build scripts leaves placeholder entries under `allowBuilds` in `pnpm-workspace.yaml`; decide them, `true` for `@swc/core` and `esbuild` and `false` for `es5-ext`, because the platform build stops on a placeholder and `phoenix deploy` refuses one. [CLI and setup documentation](../features/index.md#cli-access-and-deployment) owns flags and installation details.\n\n## Identity and authentication\n\nA workspace contains projects, and a project has target environments and deployments. Confirm ambiguous identity before mutations or deploys. `phoenix login` authorizes the CLI across currently permitted Builder projects. `phoenix dev` and `phoenix deploy` work in the project that `--project <slug>` names, else the one `project` in `spec/application.yaml` names; the starter spec names none. With neither, a run without a terminal uses the only project the sign-in can reach and prints the `project: <slug>` line to add, so add it; when it can reach several, the command stops and lists them, and the client chooses the slug to set as `project` or to pass as `--project`. `project: default` no longer names a project: replace it with a slug from the list. `phoenix whoami` shows current access. The legacy `phoenix login <workspace>` form keeps workspace-bound credentials. For CI deploys, a superadmin creates a deploy-only token in Studio for one project they manage, or a workspace superadmin for the whole workspace, and supplies `PHOENIX_API_TOKEN` through the process environment. It overrides saved login only for deploy and whoami; never print it, write it into project files, or load it from dotenv. The token belongs to that project or workspace, not to the person who created it, and keeps deploying after that person leaves, until someone who manages the scope revokes it. Consult [project and authentication documentation](../features/index.md#cli-access-and-deployment) for local versus remote setup.\n\n## Project structure\n\n- `spec/` — domain, relations, expressions, invariants, components and application YAML.\n- `src/expressions/`, `actions/`, `invariants/`, `transformers/` — typed implementations of domain behavior and consistency rules.\n- `src/components/`, `elements/`, `handlers/` — runtime components, custom UI and layout elements, event and lifecycle handlers. See [Custom project layout](../features/custom-layout/index.md) and [Domain controls](../features/domain-controls/index.md).\n- `src/webhooks/` — the server side. The entry is the default export of `index.ts`, the only file imported; it imports the others. Without it the SDK supplies anonymous auth, or invitation-only Phoenix auth when `useCognito: true`; enabling custom or Clerk auth without it reports `AUTH_WITHOUT_PROJECT_WEBHOOK`. See [Webhooks](../features/webhooks/index.md).\n- `src/migrations/` — versioned model migrations; `src/admin/` mirrors the main source structure for Admin.\n- `src/locales/` — authored PO catalogs and generated TS catalogs.\n- `src/_shared/`, `src/_utils/` and other `_`-prefixed folders — helpers and supporting modules. Phoenix skips these folders during auto-import; import their modules explicitly.\n- `public/` — static models, textures, images and fonts; `assets/` — uploadable resources such as templates and email assets.\n- `docs/` — rendered specification PDFs for the client.\n- `tools/` — reproducible project scripts, such as model conversion or rendering the specification PDFs. One-off scripts, screenshots and downloads stay in the agent's scratch space outside the project.\n- `.phoenix/` — generated files, with the project-owned exceptions below. The root `tsconfig.json` belongs to the project and extends `.phoenix/tsconfig.json`.\n\nDo not edit generated output or compiled locale TS. `.phoenix/workspace/` holds the specification sources and project records; application-spec sync, build and clean preserve it, and the generated Git ignore rules leave it available for version control. Deploy includes `.phoenix/workspace/` and `docs/` in the private deployment sources, outside application inputs and public assets. `.phoenix/variants/` option files survive rebuilds. Legacy tooling has a separate lifecycle.\n\nSync rewrites and prunes Phoenix's `phoenix` and `phoenix-*` skill folders under `.claude/skills/` and `.agents/skills/`; keep custom skills under another name. Root `AGENTS.md` and client source documents are client-owned. Components use PascalCase TSX, utilities kebab-case TS, expressions entity-name TS, migrations sequential `v*.ts` and specs kebab-case YAML. `docs/phoenix/project-structure.mdx` has the full reference; the [capability index](../features/index.md#project-and-customization) lists it.\n\n### Source conventions\n\n- Auto-imported expressions, actions, invariants, transformers, components, handlers and elements must default-export their folder's phx factory result, as one item or an array. Named exports are ignored.\n- `phx` is a global in every project: use it without importing it.\n- Keep plain helpers in underscore folders and import them explicitly.\n- Use relative imports: dev, build and webhook bundling do not resolve tsconfig `paths` aliases.\n\n## Local development\n\n`phoenix dev` runs the live preview, `sync` regenerates without bundling, `build` produces the production build, and `check` checks project quality.\n\n### Keep the preview in front of the client\n\nThe client should see the configurator change while it is built. Before the first change in a conversation, make sure `pnpm phoenix dev` is running, starting it in the background when it is not, and wait for the `Preview: <url>` line it prints and writes to `.phoenix/phoenix-dev.log`. The log keeps the lines of earlier runs, so use the last one written after the start.\n\nFor a new project, start by understanding the client’s product and what they want to configure before asking them to sign in; then make the preview reflect that before showing it, rather than presenting the generated starter scene.\n\nOpen the address where the client can see it: in the agent application's built-in browser when it has one the client sees, otherwise in the client's browser with `open '<url>'` on macOS, `xdg-open '<url>'` on Linux or `Start-Process '<url>'` in PowerShell. Keep the quotes; the shell would otherwise read a `?` in the address as a pattern. Then tell the client in one line where the preview is and that it updates by itself as the work goes on. Variant comparisons open in the same preview, so say there what to compare and how to choose.\n\nOpen it once: the preview reloads on every change. A domain model change is the exception. Dev registers the model with the server only when it starts and logs an error asking for a restart; restart it, wait for the new `Preview:` line and open that address in place of the old tab, whose `?cid=` names a configuration of the earlier model.\n\n### Logs and inspection\n\nLogs in `.phoenix/phoenix-dev.log` contain spec, build and runtime errors and watcher events; check them after changes. Signed in, `phoenix dev` runs in agent mode: the preview hides the editor, a corner badge shows when the latest change didn't build, and any dev error shows an \"Agent at work\" screen with no details, so the client never sees them. The details are only in the log; the page recovers by itself after the next successful rebuild. `--editor` shows the editor and the detailed error pages. [Inspection tools](../features/inspection.md) cover assets, state, data, scene and screenshots. Runtime inspection needs dev running and the preview open in a browser; a screenshot of the canvas does not verify the surrounding interface.\n\n## Deployment\n\n`pnpm phoenix deploy` builds the project on the server into a hosted preview (not the local preview of `phoenix dev`) and waits until it is live. Without `--env` it uses `preview`, created when missing; `--env <name>` needs an existing preview. It never deploys to production: the client promotes a checked build in Studio. Watch its output: after `Build #<n> started in <preview>` it prints `Follow the build in Studio: <url>`; open that link where the client sees it. If that line is missing, run `pnpm phoenix login` again. `Build #<n> is queued behind build #<m>` means wait: it starts after the build ahead.\n\nA successful local preview does not establish deployed model compatibility. A new project starts empty, so the model of its first deploy becomes v1. A hosted preview replaces a changed schema, but promotion is refused when the model changed under a version production serves, as is the hello-world starter that the production of some early beta projects was first deployed as; [Model migration](../processes/model-migration.md) handles that. `pnpm phoenix deploy` and `pnpm phoenix dev` are both refused while the project is being set up (its first minute) or after its setup failed: wait a minute and retry, or ask the client to choose **Retry setup** on the project's overview in Studio. When the build fails, tell the client why and what next. Record each deploy and its outcome in the project record. [Deployment documentation](../features/index.md#cli-access-and-deployment) covers status and environment details.\n\n## Internal beta\n\nPhoenix is in an internal beta. Read [Beta](../processes/beta.md) before each deploy and when a deploy goes live; a project on the `canary` SDK build also reads it once per conversation before changing anything.\n\n## Interactive and support tools\n\n[Variants](../features/variants.md) compares frontend alternatives over the live preview and applies the choice. [Feedback](../processes/feedback/index.md) submits an approved issue or evaluation. The [workflow](workflow.md) owns when either is useful and how much client interaction fits the task."]});
@@ -8,7 +8,7 @@ Phoenix turns YAML in \`spec/\` into a typed domain, configured components and a
8
8
 
9
9
  ### The \`phx\` global
10
10
 
11
- Project code reaches the SDK through the \`phx\` global: \`phx.domain\` for model reflections and the implementations of expressions, invariants and actions, \`phx.frontend\` for elements, handlers, hooks, updates and transformers, and \`phx.webhooks\` for server builders and tasks. Each [feature guide](../features/index.md) teaches its part as \`phx.<namespace>.<member>\`; a few things \`phx\` does not carry, such as \`memoEval\`, are SDK subpath imports.
11
+ Project code reaches the SDK through the \`phx\` global: \`phx.domain\` for model reflections and the implementations of expressions and invariants, \`phx.frontend\` for actions, elements, handlers, hooks, updates and transformers, and \`phx.webhooks\` for server builders and tasks. Each [feature guide](../features/index.md) teaches its part as \`phx.<namespace>.<member>\`; a few things \`phx\` does not carry, such as \`memoEval\`, are SDK subpath imports.
12
12
 
13
13
  ### Entity-component-system model
14
14
 
@@ -43,11 +43,12 @@ Build the interface from elements and handlers, connected through \`phx.frontend
43
43
 
44
44
  | Surface | Use for | Guide |
45
45
  | --- | --- | --- |
46
- | Layout elements | The project layout, loading and error pages, preset screen, assistant forms | [Custom project layout](../features/custom-layout/index.md) |
46
+ | Layout elements | The project layout, loading and error pages, preset screen | [Custom project layout](../features/custom-layout/index.md) |
47
47
  | Entity elements and control hooks | Controls the layout renders or anchors in the scene | [Domain controls](../features/domain-controls/index.md) |
48
48
  | Handlers | Event and lifecycle behavior, registered finalization actions | [Finalization actions](../features/custom-layout/finalization-actions.md) |
49
49
  | Spec texts | Translated texts and the language switch | [Localization](../features/localization.md) |
50
50
  | Scene objects built in code | Geometry a loaded model cannot express, such as a worktop with cut-outs | [Scene objects built in code](../features/scene-objects.md) |
51
+ | Assistant | What the AI assistant reads and changes, its panel and per-session setup | [Assistant](../features/assistant/index.md) |
51
52
 
52
53
  Prefer a custom \`ConfiguratorLayout\` composed from Phoenix controls, slots and hooks; it owns the canvas, messages, read mode and finalization. Register the React component with the supported factory:
53
54
 
@@ -7,13 +7,13 @@ These practices usually lead there; adapt them to the client, the product and th
7
7
 
8
8
  A request to complete a project does not waive the workflow’s client-choice checkpoints. Present the choices and wait for feedback before continuing with work that depends on them, unless the client explicitly asks to skip those checkpoints.
9
9
 
10
- The client can always redirect; follow their lead without nagging or repeated approval requests.`,a=`## Working with the client
10
+ The client can always redirect; follow their lead without nagging or repeated approval requests.`,i=`## Working with the client
11
11
 
12
12
  Be a warm, direct expert who listens, recommends an approach and takes responsibility for SDK and tooling choices. Look at supplied materials before asking, and keep the conversation about the product rather than setup questionnaires or jargon. When uncertainty affects the next result, such as a blocking ambiguity, a business decision needed now or a departure from accepted design, ask with a recommendation; otherwise state reversible defaults and keep going. Keep facts, explicit preferences and provisional assumptions distinct.
13
13
 
14
14
  Talk about the client's product: what they can try, see or decide. Modes, processes, stages, records and guide names are internal and mean nothing to the client. Say "next, I'll add the desk range", not "switching to normal mode and starting an increment".
15
15
 
16
- Small problems met along the way, such as a type error, a misaligned part or a font that did not load, are usually best fixed quietly; mention one only when it changes what the client sees or decides. Messages land better when they stay light: one decision at a time is easier to answer than a list of questions, and a long list, such as provisional defaults, reads better as a link to the document that holds it. When you create or change a client document, open it or link it in the message that announces it.`,i=`## Preferences
16
+ Small problems met along the way, such as a type error, a misaligned part or a font that did not load, are usually best fixed quietly; mention one only when it changes what the client sees or decides. Messages land better when they stay light: one decision at a time is easier to answer than a list of questions, and a long list, such as provisional defaults, reads better as a link to the document that holds it. When you create or change a client document, open it or link it in the message that announces it.`,a=`## Preferences
17
17
 
18
18
  Preferences shape how much effort and autonomy fit the work; note them in the project record as they emerge:
19
19
 
@@ -23,24 +23,26 @@ Preferences shape how much effort and autonomy fit the work; note them in the pr
23
23
  - **Quality bar** — demo grade or ready for real users; it sets review depth.
24
24
  - **Communication** — detail, technical depth and update frequency.
25
25
 
26
- A first draft runs no reviews or parallel agents, so it needs none of these answers. Ask once, briefly and with a recommendation, at a natural pause after the first draft or when work on an existing project starts without them. With a cost- or time-sensitive client, offer an expensive action with what it would add and wait for a yes rather than starting it.`,s=`## Keeping the client oriented
26
+ Neither the initial working slice nor the core journey needs a preferences questionnaire; the [review strategy](#review-strategy) sets their review scope. Ask once, briefly and with a recommendation, at a natural pause after the first draft or when work on an existing project starts without them. With a cost- or time-sensitive client, offer an expensive action with what it would add and wait for a yes rather than starting it.`,s=`## Keeping the client oriented
27
27
 
28
28
  Clients do best when they know what is happening, what comes next and whether anything is blocked. Share the next steps before longer work, update briefly during long builds, and when stuck, name the dependency and what can continue. Records do not replace these updates.
29
29
 
30
- Reports work best at a high level: what the client can now try, what is still open and what comes next. The details of what was changed belong in the changelog. A good handoff separates what is done, what is unverified and what remains, and usually ends with a recommended next step, sometimes with an alternative such as a [Phoenix capability](../features/index.md) the client may not know about. Note declined suggestions so they do not come back.`,r=`## Building in increments
30
+ Reports work best at a high level: what the client can now try, what is still open and what comes next. The details of what was changed belong in the changelog. A good handoff separates what is done, what is unverified and what remains, and usually ends with a recommended next step, sometimes with an alternative such as a [Phoenix capability](../features/index.md) the client may not know about. Note declined suggestions so they do not come back.`,o=`## Building in increments
31
31
 
32
- After the first draft, a short **Next increments** list in the project record keeps the way ahead visible: one line per increment saying what the client will be able to do and what it waits on, such as a model, a price list or a business answer, with postponed scope below it. Ordering by what users decide first and by real product dependencies usually works, with core interactions before more options and finalization once the configuration it submits is stable. Present it in product language with a recommended next increment; the client agrees on the next step, not on the whole list. Keep it current as increments land or the scope changes; an existing project without one writes it when its work goes beyond a single fix.
32
+ After the core journey is reviewed, a short **Next increments** list in the project record keeps the way ahead visible: one line per increment saying what the client will be able to do and what it waits on, such as a model, a price list or a business answer, with postponed scope below it. Ordering by what users decide first and by real product dependencies usually works, with core interactions before more options and finalization once the configuration it submits is stable. Present it in product language with a recommended next increment; the client agrees on the next step, not on the whole list. Keep it current as increments land or the scope changes; an existing project without one writes it when its work goes beyond a single fix.
33
33
 
34
- Work then goes best in small, useful increments: choose an outcome with observable checks; extend the [specification](../processes/specification/index.md) only as far as the increment needs; build it within the branding and UX guidelines, where they exist, using the [SDK guidance](sdk.md); exercise the changed interaction and what it affects, such as control targets, selection context and global versus per-part behavior; review it as the [review strategy](#review-strategy) suggests; then show the client what to try and fold their feedback into the specification and the next increments.
34
+ Work then goes best in small, useful increments: choose an outcome with observable checks; extend the [specification](../processes/specification/index.md) only as far as the increment needs; build it within the branding and UX specification, where they exist, using the [SDK guidance](sdk.md); exercise the changed interaction and what it affects, such as control targets, selection context and global versus per-part behavior; review it as the [review strategy](#review-strategy) suggests; then show the client what to try and fold their feedback into the specification and the next increments.
35
35
 
36
- Habits that help: wait for feedback before expanding an increment unless the client asked for a larger batch; settle core interactions before multiplying options; keep agreed scope visible until it is built or deferred; preserve selections and accepted behavior; and when rules change, keep model, scene, controls, dimensions, pricing and checks consistent.`,o=`## Visual choices
36
+ Habits that help: wait for feedback before expanding an increment unless the client asked for a larger batch; settle core interactions before multiplying options; keep agreed scope visible until it is built or deferred; preserve selections and accepted behavior; and when rules change, keep model, scene, controls, dimensions, pricing and checks consistent.`,r=`## Visual choices
37
37
 
38
- When taste, branding or interaction has several reasonable answers that the client's materials do not settle, alternatives usually help: explain the tradeoffs and recommend one. They help most when they really differ and each is finished as well as it can be, so the client chooses between good options rather than between variations. Accepted choices stay settled, facts are not the client's to pick, and routine reversible details need no approval. [Variants](../features/variants.md) shows alternatives in the live preview.`,c=`## Review strategy
38
+ When a choice has significant visual impact, show it in a form the client can judge before asking them to choose. Use the working preview when behavior matters, or a visual comparison when appearance alone is being decided. Explain the tradeoffs alongside it; one visible recommendation may be enough.
39
39
 
40
- The first draft skips review processes; a quick look at the running preview before showing each result keeps broken work away from the client.
40
+ When taste, branding or interaction has several reasonable answers that the client's materials do not settle, compare two or three approaches when they expose a meaningful tradeoff: explain it and recommend one. Otherwise develop one recommendation. Comparisons can help at any stage; they are not a required checkpoint. They help most when they really differ and each is finished as well as it can be, so the client chooses between good options rather than between variations. Accepted choices stay settled, facts are not the client's to pick, and routine reversible details need no approval. [Variants](../features/variants.md) shows alternatives in the live preview.`,c=`## Review strategy
41
41
 
42
- Later, review changed work before committing or handing it over with the [review processes](../processes/review/index.md), scaled to impact, uncertainty, the quality bar and the cost preference. A self-review is usually enough; an independent subagent adds a fresh view of visual fidelity, complex rules or broad interactions when the preferences allow it. Note whether review was independent and what remains unverified; a passing build does not prove product quality.`,d=`## Feedback and completion
42
+ The initial working slice needs scoped interaction testing, not a formal review. For the core journey, follow [Build’s review before recommending](../processes/first-draft/build.md#review-before-recommending).
43
+
44
+ Later, review changed work before committing or handing it over with the [review processes](../processes/review/index.md), scaled to impact, uncertainty, the quality bar and the cost preference. A self-review is usually enough; an independent subagent adds a fresh view of visual fidelity, complex rules or broad interactions when the preferences allow it. Note whether review was independent and what remains unverified; a passing build does not prove product quality.`,h=`## Feedback and completion
43
45
 
44
46
  Client feedback shapes the direction and the records; confirm material departures. Phoenix feedback is a separate, external report: [Feedback](../processes/feedback/index.md) covers SDK problems and the client's evaluation of the run, and only approved content is sent.
45
47
 
46
- Some lines stay firm: publishing, real orders, real messages and connecting live systems need the client's authorization against the concrete result. [Deployment](cli.md#deployment) covers running a deploy.`;export const generatePhoenixWorkflowCore=()=>e({path:"core/workflow.md",title:"Workflow",summary:"where to start, working with the client, preferences, increments, records and review strategy",sections:[t,n,a,i,s,r,o,"## Records\n\n- **Specification** — client-facing documents: branding, UX guidelines, product definition and catalogs, with sources in `.phoenix/workspace/specification/` and rendered PDFs in `docs/`. [Specification](../processes/specification/index.md) describes them; later work follows them, and changing an accepted rule is the client's call.\n- **Project record** — `.phoenix/workspace/project.md` is the current snapshot: preferences, approach, decisions with rationale, declined suggestions, progress, deploys and their outcome, next increments, open questions and SDK problems worth reporting, rewritten as they change. `.phoenix/workspace/changelog/` keeps the history: append a dated entry for each meaningful change, decision, verification, deploy or piece of client feedback, and continue in a new numbered file when the current one gets long.\n\nReuse records when resuming; they are not a client task or an approval gate. Leave out secrets, unrelated personal information and raw transcripts; [project structure](cli.md#project-structure) describes how records are kept and deployed.",c,d]});
48
+ Some lines stay firm: publishing, real orders, real messages and connecting live systems need the client's authorization against the concrete result. [Deployment](cli.md#deployment) covers running a deploy.`;export const generatePhoenixWorkflowCore=()=>e({path:"core/workflow.md",title:"Workflow",summary:"where to start, working with the client, preferences, increments, records and review strategy",sections:[t,n,i,a,s,o,r,"## Records\n\n- **Specification** — client-facing documents: branding, UX specification, product definition and catalogs, with sources in `.phoenix/workspace/specification/` and rendered PDFs in `docs/`. [Specification](../processes/specification/index.md) describes them; later work follows them, and changing an accepted rule is the client's call.\n- **Project record** — `.phoenix/workspace/project.md` is the current snapshot: preferences, approach, decisions with rationale, declined suggestions, progress, deploys and their outcome, next increments, open questions and SDK problems worth reporting, rewritten as they change. `.phoenix/workspace/changelog/` keeps the history: append a dated entry for each meaningful change, decision, verification, deploy or piece of client feedback, and continue in a new numbered file when the current one gets long.\n\nReuse records when resuming; they are not a client task or an approval gate. Leave out secrets, unrelated personal information and raw transcripts; [project structure](cli.md#project-structure) describes how records are kept and deployed.",c,h]});
@@ -58,4 +58,4 @@ export const ViewSwitch = () => {
58
58
  </>
59
59
  )
60
60
  }
61
- \`\`\``;export const generatePhoenixViewsAndToolsFeature=()=>e({path:"features/application-states/views-and-tools.md",title:"View and tool states",summary:"View states for how the scene is shown, tool states for interaction modes, switching each and the cameras and filters keyed to them; read when adding camera views, scene presentations or modes such as dimensions, sketching or focus.",whenToUse:"Read when users switch how the scene is shown (a front or top view, a close-up, a room style) or which mode it is in (dimensions, sketching, editing one part), independently of the stage of the flow.",capabilities:"### Choose the kind of state\n\n- **Navigation state** — where users are in the flow; it changes controls and pages: [Navigation states](navigation.md).\n- **View state** — how the scene is presented: a camera, an environment, a close-up. The controls stay as they are.\n- **Tool state** — what users are doing in the scene: setting dimensions, sketching, a focus mode for editing one part. It swaps the in-scene controls.\n- The three lists are independent: one value of each is active, and a filter can combine them. A tool state does not change the selection, nor the selection the tool.\n\n### Declare them\n\n- `viewStates:` and `toolStates:` follow the rules of navigation states: identifier values, each list in one file, the first value active when a configuration opens, a single `Default` when undeclared.\n- `phx.applicationTypes.ViewState` and `phx.applicationTypes.ToolState` are their runtime enums (`ToolState.Dimensions === 'Dimensions'`, `.values()`, `.is(value)`); the global types `ViewState` and `ToolState` are the unions.\n\n### Switch the view\n\n- `phx.frontend.useActiveViewState()` returns the active view; `phx.frontend.useSetViewState()` returns `(state) => void`, which commits immediately.\n- Built-in switch: a `viewControls` component on the root entity, `items: [{ label, value, icon }]` with a view state as `value` and a PhxIcon name as `icon`. The built-in layout shows the first one. A project layout mounts `LayoutSlots.DesktopViewControls` or `MobileViewControls` ([Layout slots](../custom-layout/slots.md)), or draws its own buttons with the two hooks, which need no component.\n- Cameras: filter camera components with `viewStates`. Of the cameras whose filters pass, the highest `priority` (default 1) wins, so keep an unfiltered camera with the lowest priority as the default.\n- Transformers: `when.viewChanged({ from, to })` reacts to a switch, and `.then.changeView(state)` switches as a side effect.\n\n### Switch the tool\n\n- `phx.frontend.useActiveToolState()` returns the active tool. No hook sets it; switch tools with:\n - a `toolControls` component on the root entity (`items: [{ label, value, icon }]`, `value` a tool state), shown by the built-in layout, or by `LayoutSlots.DesktopToolControls` and `MobileToolControls` in a project layout;\n - the tool menu `toolMenuFab` in the scene ([Scene controls](../domain-controls/scene-controls.md)) and the exit button `exitToolModeFab` with `exitTo` in the call-to-action slot ([Layout slots](../custom-layout/slots.md));\n - own UI: take `storeSystem` and `navigationSystem` from `phx.frontend.useDomain()` and call `storeSystem.stageAndCommit([navigationSystem.getToolUpdate(phx.applicationTypes.ToolState.Dimensions)])`, as the SDK's own controls do.\n- Filter each tool's controls with `toolStates`, and give the default tool controls of its own, so every mode offers something to do. A focus mode also hides navigation, tool and view controls and offers a labeled exit.\n- `when.toolChanged({ from, to })` reacts to a switch; the transformer builder has no action that changes the tool.",example:t,documentation:"Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/application-states.mdx`, sections View States and Tool States — the declarations, filters, `viewControls` and `toolControls`.\n- `docs/layouts/view-controls.mdx` — one camera per view and the built-in view switch.\n- `docs/complex-use-cases/focus-mode.mdx` — a tool state entered from `toolMenuFab` and left with `exitToolModeFab`.\n- `docs/complex-use-cases/sketching.mdx` — tool states switching between drawing and selecting.\n- `docs/ux-guidelines/interaction-modes.mdx` — what each mode shows and hides.\n- `docs/phoenix/layout-slots.mdx` — the view and tool control slots.",phxMembers:["applicationTypes.ViewState","applicationTypes.ToolState","frontend.useActiveViewState","frontend.useSetViewState","frontend.useActiveToolState"]});
61
+ \`\`\``;export const generatePhoenixViewsAndToolsFeature=()=>e({path:"features/application-states/views-and-tools.md",title:"View and tool states",summary:"View states for how the scene is shown, tool states for interaction modes, switching each and the cameras and filters keyed to them; read when adding camera views, scene presentations or modes such as dimensions, sketching or focus.",whenToUse:"Read when users switch how the scene is shown (a front or top view, a close-up, a room style) or which mode it is in (dimensions, sketching, editing one part), independently of the stage of the flow.",capabilities:"### Choose the kind of state\n\n- **Navigation state** — where users are in the flow; it changes controls and pages: [Navigation states](navigation.md).\n- **View state** — how the scene is presented: a camera, an environment, a close-up. The controls stay as they are.\n- **Tool state** — what users are doing in the scene: setting dimensions, sketching, a focus mode for editing one part. It swaps the in-scene controls.\n- The three lists are independent: one value of each is active, and a filter can combine them. A tool state does not change the selection, nor the selection the tool.\n\n### Declare them\n\n- `viewStates:` and `toolStates:` follow the rules of navigation states: identifier values, each list in one file, the first value active when a configuration opens, a single `Default` when undeclared.\n- `phx.applicationTypes.ViewState` and `phx.applicationTypes.ToolState` are their runtime enums (`ToolState.Dimensions === 'Dimensions'`, `.values()`, `.is(value)`); the global types `ViewState` and `ToolState` are the unions.\n\n### Switch the view\n\n- `phx.frontend.useActiveViewState()` returns the active view; `phx.frontend.useSetViewState()` returns `(state, viewChildState?) => void`. Omitting the child clears the previous choice.\n- Built-in switch: a `viewControls` component on the root entity, `items: [{ label, value, icon }]` with a view state as `value` and a PhxIcon name as `icon`. The built-in layout shows the first one. A project layout mounts `LayoutSlots.DesktopViewControls` or `MobileViewControls` ([Layout slots](../custom-layout/slots.md)), or draws its own buttons with the two hooks, which need no component.\n- Nested view controls add child `items`. With a group value, selecting a leaf sets that view and its runtime `viewChildState`; without one, the leaf selects a declared view. Read the child with `phx.frontend.useActiveViewChildState()` or, in an expression, `getComponentSystemFilterState(state).viewChildState`.\n- Cameras: filter camera components with `viewStates`. Of the cameras whose filters pass, the highest `priority` (default 1) wins, so keep an unfiltered camera with the lowest priority as the default.\n- Transformers: `when.viewChanged({ from, to })` reacts to a switch, and `.then.changeView(state)` switches as a side effect.\n\n### Switch the tool\n\n- `phx.frontend.useActiveToolState()` returns the active tool. No hook sets it; switch tools with:\n - a `toolControls` component on the root entity (`items: [{ label, value, icon }]`, `value` a tool state), shown by the built-in layout, or by `LayoutSlots.DesktopToolControls` and `MobileToolControls` in a project layout;\n - the tool menu `toolMenuFab` in the scene ([Scene controls](../domain-controls/scene-controls.md)) and the exit button `exitToolModeFab` with `exitTo` in the call-to-action slot ([Layout slots](../custom-layout/slots.md));\n - own UI: take `storeSystem` and `navigationSystem` from `phx.frontend.useDomain()` and call `storeSystem.stageAndCommit([navigationSystem.getToolUpdate(phx.applicationTypes.ToolState.Dimensions)])`, as the SDK's own controls do.\n- Filter each tool's controls with `toolStates`, and give the default tool controls of its own, so every mode offers something to do. A focus mode also hides navigation, tool and view controls and offers a labeled exit.\n- `when.toolChanged({ from, to })` reacts to a switch; the transformer builder has no action that changes the tool.",example:t,documentation:"Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/application-states.mdx`, sections View States and Tool States — the declarations, filters, `viewControls` and `toolControls`.\n- `docs/layouts/view-controls.mdx` — one camera per view and the built-in view switch.\n- `docs/complex-use-cases/focus-mode.mdx` — a tool state entered from `toolMenuFab` and left with `exitToolModeFab`.\n- `docs/complex-use-cases/sketching.mdx` — tool states switching between drawing and selecting.\n- `docs/ux-guidelines/interaction-modes.mdx` — what each mode shows and hides.\n- `docs/phoenix/layout-slots.mdx` — the view and tool control slots.",phxMembers:["applicationTypes.ViewState","applicationTypes.ToolState","frontend.useActiveViewState","frontend.useActiveViewChildState","frontend.useSetViewState","frontend.useActiveToolState"]});
@@ -0,0 +1,3 @@
1
+ import { type PhoenixGuide } from '../../guide.js';
2
+ /** The assistant index followed by its guides: what it reads and changes, its panel and its per-session setup. */
3
+ export declare const generatePhoenixAssistantGuides: () => readonly PhoenixGuide[];
@@ -0,0 +1 @@
1
+ import{createPhoenixIndexGuide as s}from"../../guide.js";import{generatePhoenixAssistantPanelFeature as t}from"./panel.js";import{generatePhoenixAssistantReadingAndChangingFeature as e}from"./reading-and-changing.js";import{generatePhoenixAssistantSessionSetupFeature as a}from"./session-setup.js";export const generatePhoenixAssistantGuides=()=>{let n=[e(),t(),a()];return[s({path:"features/assistant/index.md",title:"Assistant",summary:"What the AI assistant reads and changes, its panel and its setup per session; read for any assistant work.",intro:"The AI assistant talks with configurator users in a panel beside the configurator and changes the configuration for them. The spec's `assistant` section becomes the GraphQL schema the assistant reads and changes the configuration through. Nothing is exposed without an entry, and every change goes through the same validation as a change from the controls. The section can be split across spec files.\n\nMost of the work is deciding how each change the UI offers reaches the assistant: through the recipes, options and deletions the controls already use, or through an action. To set up the assistant or extend what it can do, follow [assistant configuration](../../processes/assistant-configuration.md).",guides:n,notes:[]}),...n]};
@@ -0,0 +1,3 @@
1
+ import { type PhoenixGuide } from '../../guide.js';
2
+ /** What a project adds to the assistant panel: its form elements, its greeting and starters, and drawings. */
3
+ export declare const generatePhoenixAssistantPanelFeature: () => PhoenixGuide;
@@ -0,0 +1,16 @@
1
+ import{createPhoenixFeatureGuide as e}from"../../guide.js";let t=`\`\`\`yaml
2
+ # spec/controls.yaml
3
+ components:
4
+ KitchenRange:
5
+ assistantGreeting:
6
+ main:
7
+ message:
8
+ $msg: Hi! I can help you design this range. Ask me about its parts, colours and price.
9
+ starters:
10
+ - title:
11
+ $msg: Add a griddle
12
+ - title:
13
+ $msg: Show me the colours
14
+ reply:
15
+ $msg: Which colours can the range have?
16
+ \`\`\``;export const generatePhoenixAssistantPanelFeature=()=>e({path:"features/assistant/panel.md",title:"Panel",summary:"The project's form elements, the greeting and starters of an empty thread, and drawings; read when the assistant should ask, greet or draw in the project's own way.",whenToUse:"Read when the assistant needs a form element of the project, should greet configurator users in their words, or should draw for them.",capabilities:"The panel is the SDK's. A project adds its own form elements and greeting, and asks for drawings where they help.\n\nThe panel renders only inside the built-in sidebar, `LayoutSlots.DesktopSidebar`, which a project layout leaves out. A project layout reaches the assistant only through that slot or a thread of its own built on `useAssistantThread` and `useAssistantComposer` ([Toolbar actions](../custom-layout/toolbar-actions.md)).\n\n- **Form elements** — the assistant asks with forms, and offers recipes and options as built-in tiles with their picture or color. Add a project element only for a question the tiles cannot ask, such as a searchable palette. Declare it under `assistant.formElements.<name>` with a `description` for the model and a `role`, and register it in one file with `export default phx.frontend.createAssistantFormElement('name', Component)`. The global `AssistantFormElementProps<'name', STATE>` types its props by role. A declaration without a registration, or the reverse, stops the application at start.\n- **Greeting and starters** — a root `assistantGreeting` component sets the message of an empty thread and `starters`, chips that send a first message. The model never reads the greeting, so keep it a statement of what the assistant can do, and put concrete asks in the starters. A project thread reads both through `useAssistantThread` ([Toolbar actions](../custom-layout/toolbar-actions.md)).\n- **Drawings** — the assistant draws SVG schematics in its replies when they explain better than words, never the result of a change. Ask for particular drawings in `assistant.instructions`, such as a layout deduced from a photo.",example:t,documentation:'Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/configurator-interface.mdx` — "Assistant" and "Assistant theme names and slots": the thread and composer hooks, the greeting, and the theme slots of the panel.',phxMembers:["frontend.createAssistantFormElement"]});
@@ -0,0 +1,3 @@
1
+ import { type PhoenixGuide } from '../../guide.js';
2
+ /** What the assistant reads and changes through the spec's `assistant` section, the standard ways first. */
3
+ export declare const generatePhoenixAssistantReadingAndChangingFeature: () => PhoenixGuide;
@@ -0,0 +1,47 @@
1
+ import{createPhoenixFeatureGuide as e}from"../../guide.js";let t=`A desk whose leg finish is set by a custom control and whose drawers come from a recipe group:
2
+
3
+ \`\`\`yaml
4
+ # spec/assistant.yaml
5
+ assistant:
6
+ instructions: After a change, read _warnings of the desk.
7
+ ai:
8
+ provider: openai
9
+ model: balanced
10
+ reasoning: low
11
+ entities:
12
+ Desk:
13
+ width:
14
+ description: Width of the desk in millimeters, along X
15
+ $assistantWarnings:
16
+ as: _warnings
17
+ description: What configurator users should fix, as text
18
+ writable:
19
+ Desk:
20
+ width:
21
+ legFinish:
22
+ options:
23
+ componentType: attributeSelection
24
+ instanceName: assistantLegFinish
25
+ childRecipes:
26
+ Desk:
27
+ drawers:
28
+ description: Drawers that fit under the desk top
29
+ deletable:
30
+ Drawer:
31
+
32
+ expressions:
33
+ Desk:
34
+ $assistantWarnings: # a projection of the UI's typed $warnings
35
+ type: array
36
+ items:
37
+ $ref: phx:Localizable
38
+
39
+ components:
40
+ Desk:
41
+ attributeSelection:
42
+ assistantLegFinish: # read by the assistant only; the UI uses a custom control
43
+ value:
44
+ $bind: legFinish
45
+ options:
46
+ $read: $legFinishOptions
47
+ \`\`\``;export const generatePhoenixAssistantReadingAndChangingFeature=()=>e({path:"features/assistant/reading-and-changing.md",title:"Reading and changing",summary:"What the assistant reads and how it changes the configuration: writes, recipes and deletions before actions, readable values, options, screenshots and instructions; read when deciding what the assistant may do.",whenToUse:"Read when exposing part of the configuration to the assistant, choosing between a standard change and an action, or fixing what the assistant misreads.",capabilities:"### Prefer the standard ways\n\nField writes, recipes and deletions run through the same options, validation, dry runs and hints as the controls configurator users see, so the assistant can preview and compare them before it applies one. An action is a custom mutation the model learns from its description alone.\n\n- **Read** — list fields and expressions under `entities`. A computed read, such as a catalog summary, a review or a price, is an expression, not an action.\n- **Write** — list the field under `writable`.\n- **Add or replace** — expose the `childEntityRecipes` and `replaceEntityRecipes` instances the UI offers under `childRecipes` and `replaceRecipes`.\n- **Delete** — list the type or alias under `deletable`.\n\nA UI path that is not a recipe or a plain write needs a closer look. Examples are a creation in custom code, a placement that follows the camera, snapping that runs only while dragging, or entities that come from a sketch tool. First look for a small refactor that keeps the product's behavior and lets the standard way work, and suggest it to the client. A custom creation can become a recipe group, with its placement moved to a transformer on `.created()` ([Transformers](../domain-model/transformers.md)). Recipe dry runs run that transformer too, so keep it pure and cheap.\n\nUse an [action](../domain-model/actions.md) when no such refactor fits, or when the standard way would make the assistant's work hard:\n\n- **Reuse the UI's update** — when constraints run only on a tool's updates, an action can emit the same update with the same tag, and the existing transformers do the rest. A move becomes a `ComponentModification` with the drag handle's update tag on the `dragHandle` instance, so snapping applies without any tab or selection. Sketched entities become the creations the sketch tool commits. Rework the constraints only when the client wants every write constrained.\n- **Large catalogs** — hundreds of products fit better as a compact catalog expression and one action with a catalog id than as recipe groups whose descriptions flood the schema.\n- **Whole-configuration work** — a builder over the whole configuration, or one request that would otherwise take many ordered writes.\n\nShape an action as the model and the client think, such as `splitRoom(roomId, divisions)` rather than a cut across a module. Name params the way a model would guess them, and say what each means and in which unit. Return the changed entities read after the transformers, with their final positions and warnings, so the assistant sees what snapping or repair did without another query.\n\n### Make values readable\n\n- An expression `$name` is exposed as `_name` unless `as` renames it, and only when it is declared in YAML. It is exposed by its declared type: a `tsType` becomes opaque `JSON`. Declare `$ref: phx:Localizable` for text in the current locale, and `$ref: phx:$DomainEntity` with `references` for an entity the assistant can follow, in `oneOf` with `type: 'null'` when it may be absent. For values the UI keeps as typed objects, add a separate projection for the assistant. Relations are exposed by their `$name` too.\n- Describe fields in the client's product terms, with unit and axis. Take axes from the placement code, not from field names.\n- With several root types, `root` is the `RootEntity` interface with only `id` and `type`. Other fields are read through a fragment on the alias or type that exposes them, or a lens, and writes go through `modify<Type>` of each concrete type, not of an alias. Name them in `instructions`.\n- `lenses` name selections of tagged fields, so one query reads a coherent part of the configuration. Keep `maxDepth` low, since nested relations multiply what a read returns.\n\n### Options, screenshots, navigation and the model\n\n- An empty `writable` entry takes its choices from the one `materialSwatch`, `attributeSelection` or `distanceDimensionSelect` instance that writes the field. For a field that a custom control writes, add an instance no layout shows, and name it with `componentType` and `instanceName`. `validate: false` accepts values outside the choices, for values that depend on each other. Mark lists that never change with `hints: [sameForAllInstances, constantDuringSession]`, so the assistant reads them once.\n- An `agentScreenshot` instance renders one view, at most 2048 px per side, and `screenshots` lists it with what it shows. Give the assistant its own camera, a camera component filtered on the screenshot's `exportState`, framing the product. Compute `width` and `height` from the product's extent so the image follows its shape, and hide what covers the parts it must check, such as a roof.\n- `navigation` lets the assistant take configurator users to a state the UI offers. List states under `navigationStates`, `viewStates` and `toolStates` by their names in the spec, each with a `description` of what users see and an optional `as`. Under `select`, list the types or aliases whose entities it may select, with an optional `description` of what selecting one opens.\n- `instructions` join the assistant's prompt, and visitors can read them. Use them for what the schema cannot say: rules across entities, values written together, what to read after a change.\n- `ai` is required, in exactly one spec file; without it the configurator has no assistant. It names `provider: openai`, a `model` tier (`frontier`, `advanced`, `balanced` or `fast`) and a `reasoning` level (`low`, `medium` or `high`). They set cost and quality, so let the client choose them. Raise `ai.maxThreadSize` for long design conversations. Each user message allows 8 tool calls by default, after which the assistant summarizes and asks to continue; for requests that take many steps, raise `ai.maxToolCallsPerMessage`, up to 100.",example:t,documentation:'The shipped SDK docs do not cover the entries of the `assistant` section yet; its diagnostics name the key at fault and how to fix it. Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/configurator-interface.mdx` — "Assistant" for `ai.voice`, and "Assistant tools for agents in the browser (WebMCP)" for `webmcp: false` and the tools agents in the visitor\'s browser get.',phxMembers:[]});
@@ -1,3 +1,3 @@
1
1
  import { type PhoenixGuide } from '../../guide.js';
2
2
  /** The assistant setup handler that narrows the assistant per session. */
3
- export declare const generatePhoenixAssistantSetupFeature: () => PhoenixGuide;
3
+ export declare const generatePhoenixAssistantSessionSetupFeature: () => PhoenixGuide;