@salsita-ai/sdk 0.50.0-develop.9241bcf09e → 0.50.0-develop.927e2414eb

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 (527) hide show
  1. package/README.md +3 -3
  2. package/dist/admin/common/admin-interface.d.ts +11 -1
  3. package/dist/admin/common/admin-interface.js +1 -1
  4. package/dist/admin/ui/layout/UserProfile.d.ts +1 -1
  5. package/dist/admin/ui/layout/UserProfile.js +1 -1
  6. package/dist/admin/ui/maintenance/ImportPresets.js +1 -1
  7. package/dist/application/mount-application.js +1 -1
  8. package/dist/application/mount-configurator.js +1 -1
  9. package/dist/application/studio-embedding.d.ts +6 -0
  10. package/dist/application/studio-embedding.js +1 -0
  11. package/dist/application-spec/core/enhanced-json-schema.d.ts +5 -6
  12. package/dist/application-spec/core/enhanced-json-schema.js +1 -1
  13. package/dist/application-spec/core/markers/index.d.ts +1 -0
  14. package/dist/application-spec/core/markers/index.js +1 -1
  15. package/dist/application-spec/core/markers/set-in-studio-marker.d.ts +15 -0
  16. package/dist/application-spec/core/markers/set-in-studio-marker.js +1 -0
  17. package/dist/application-spec/errors/diagnostic-codes.d.ts +16 -0
  18. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  19. package/dist/application-spec/errors/diagnostic-messages.d.ts +16 -0
  20. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  21. package/dist/application-spec/generate-application/code/domain-runtime-files.d.ts +3 -3
  22. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  23. package/dist/application-spec/generate-application/code/standalone-app-files.d.ts +0 -12
  24. package/dist/application-spec/generate-application/code/standalone-app-files.js +1 -1
  25. package/dist/application-spec/generate-application/code/templates/admin-config.d.ts +5 -1
  26. package/dist/application-spec/generate-application/code/templates/admin-config.js +4 -4
  27. package/dist/application-spec/generate-application/code/templates/application-types.js +5 -5
  28. package/dist/application-spec/generate-application/code/templates/configurator-config.js +6 -6
  29. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.d.ts +1 -1
  30. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +19 -0
  31. package/dist/application-spec/generate-application/code/templates/domain-spec.js +12 -12
  32. package/dist/application-spec/generate-application/code/templates/frontend-config.js +7 -3
  33. package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.d.ts +3 -3
  34. package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.js +3 -3
  35. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.d.ts +10 -6
  36. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.js +7 -7
  37. package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +12 -12
  38. package/dist/application-spec/generate-application/code/templates/globals.js +21 -12
  39. package/dist/application-spec/generate-application/code/templates/index.d.ts +1 -1
  40. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  41. package/dist/application-spec/generate-application/code/templates/sign-in-page-options.d.ts +5 -0
  42. package/dist/application-spec/generate-application/code/templates/sign-in-page-options.js +1 -0
  43. package/dist/application-spec/generate-application/code/templates/skills/core/cli.d.ts +2 -1
  44. package/dist/application-spec/generate-application/code/templates/skills/core/cli.js +1 -1
  45. package/dist/application-spec/generate-application/code/templates/skills/core/sdk.js +2 -1
  46. package/dist/application-spec/generate-application/code/templates/skills/features/application-states/presets.js +1 -1
  47. package/dist/application-spec/generate-application/code/templates/skills/features/application-states/views-and-tools.js +1 -1
  48. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/index.d.ts +3 -0
  49. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/index.js +1 -0
  50. package/dist/application-spec/generate-application/code/templates/skills/features/{custom-layout/assistant.d.ts → assistant/panel.d.ts} +1 -1
  51. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/panel.js +42 -0
  52. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/reading-and-changing.d.ts +3 -0
  53. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/reading-and-changing.js +55 -0
  54. package/dist/application-spec/generate-application/code/templates/skills/features/{webhooks/assistant-setup.d.ts → assistant/session-setup.d.ts} +1 -1
  55. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/session-setup.js +16 -0
  56. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/custom-layout.js +2 -2
  57. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/sign-in.d.ts +3 -0
  58. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/sign-in.js +19 -0
  59. package/dist/application-spec/generate-application/code/templates/skills/features/domain-model/actions.js +1 -1
  60. package/dist/application-spec/generate-application/code/templates/skills/features/embedding.d.ts +2 -0
  61. package/dist/application-spec/generate-application/code/templates/skills/features/embedding.js +1 -0
  62. package/dist/application-spec/generate-application/code/templates/skills/features/features.js +1 -1
  63. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/authentication.d.ts +1 -1
  64. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/authentication.js +32 -26
  65. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/entry-and-environment.js +1 -3
  66. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/publishing.js +1 -1
  67. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/session-fields.d.ts +3 -0
  68. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/session-fields.js +1 -0
  69. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/webhooks.js +1 -1
  70. package/dist/application-spec/generate-application/code/templates/skills/guide.d.ts +1 -1
  71. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.d.ts +1 -1
  72. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +3 -3
  73. package/dist/application-spec/generate-application/code/templates/skills/processes/asset-conversion.js +3 -3
  74. package/dist/application-spec/generate-application/code/templates/skills/processes/assistant-configuration.d.ts +3 -0
  75. package/dist/application-spec/generate-application/code/templates/skills/processes/assistant-configuration.js +3 -0
  76. package/dist/application-spec/generate-application/code/templates/skills/processes/feedback/report.js +2 -2
  77. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/handoff.js +1 -1
  78. package/dist/application-spec/generate-application/code/templates/skills/processes/index.d.ts +2 -1
  79. package/dist/application-spec/generate-application/code/templates/skills/processes/index.js +1 -1
  80. package/dist/application-spec/generate-application/code/templates/skills/processes/model-migration.js +1 -1
  81. package/dist/application-spec/generate-application/code/templates/skills/processes/review/appearance.js +1 -1
  82. package/dist/application-spec/generate-application/code/templates/skills/processes/review/code.js +1 -1
  83. package/dist/application-spec/generate-application/code/templates/skills/processes/scene-realism.d.ts +2 -0
  84. package/dist/application-spec/generate-application/code/templates/skills/processes/scene-realism.js +29 -0
  85. package/dist/application-spec/generate-application/code/templates/skills/sdk-channel.d.ts +17 -0
  86. package/dist/application-spec/generate-application/code/templates/skills/sdk-channel.js +1 -0
  87. package/dist/application-spec/generate-application/code/templates/skills/sdk-subpath-imports.js +1 -1
  88. package/dist/application-spec/generate-application/code/templates/webhook-builders.js +3 -2
  89. package/dist/application-spec/generate-application/code/templates/webhook-index.d.ts +1 -2
  90. package/dist/application-spec/generate-application/code/templates/webhook-index.js +3 -7
  91. package/dist/application-spec/generate-application/code/webhook-safe-files.d.ts +3 -1
  92. package/dist/application-spec/generate-application/code/webhook-safe-files.js +1 -1
  93. package/dist/application-spec/parse-application-files/access/access-handler-kinds.d.ts +18 -0
  94. package/dist/application-spec/parse-application-files/access/access-handler-kinds.js +1 -0
  95. package/dist/application-spec/parse-application-files/access/analyzed-file.d.ts +7 -0
  96. package/dist/application-spec/parse-application-files/access/analyzed-file.js +1 -0
  97. package/dist/application-spec/parse-application-files/access/check-access-handler-files.d.ts +20 -0
  98. package/dist/application-spec/parse-application-files/access/check-access-handler-files.js +1 -0
  99. package/dist/application-spec/parse-application-files/access/check-auth-hook-files.d.ts +17 -0
  100. package/dist/application-spec/parse-application-files/access/check-auth-hook-files.js +1 -0
  101. package/dist/application-spec/parse-application-files/access/index.d.ts +5 -0
  102. package/dist/application-spec/parse-application-files/access/index.js +1 -0
  103. package/dist/application-spec/parse-application-files/access/sign-in-control.d.ts +7 -0
  104. package/dist/application-spec/parse-application-files/access/sign-in-control.js +1 -0
  105. package/dist/application-spec/parse-application-files/categorize/categorize-files.d.ts +2 -1
  106. package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
  107. package/dist/application-spec/parse-application-files/categorize/module-analysis.d.ts +30 -4
  108. package/dist/application-spec/parse-application-files/categorize/module-analysis.js +1 -1
  109. package/dist/application-spec/parse-application-files/categorize/webhook-safety.js +1 -1
  110. package/dist/application-spec/parse-application-files/merge/merged-app-metadata.d.ts +16 -1
  111. package/dist/application-spec/parse-application-files/merge/merged-app-metadata.js +1 -1
  112. package/dist/application-spec/parse-application-files/merge/merged-assistant.js +1 -1
  113. package/dist/application-spec/parse-application-files/merge/merged-spec.d.ts +7 -1
  114. package/dist/application-spec/parse-application-files/merge/merged-spec.js +1 -1
  115. package/dist/application-spec/parse-application-files/parse-application-files.js +1 -1
  116. package/dist/application-spec/parse-application-files/parse-common-admin-spec.js +1 -1
  117. package/dist/application-spec/parse-application-files/raw-spec/raw-actions.d.ts +3 -2
  118. package/dist/application-spec/parse-application-files/raw-spec/raw-actions.js +1 -1
  119. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +29 -6
  120. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  121. package/dist/application-spec/parse-application-files/raw-spec/raw-components.js +1 -1
  122. package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.d.ts +11 -3
  123. package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
  124. package/dist/application-spec/parse-application-files/resolve/resolve-import-modules.js +1 -1
  125. package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.d.ts +6 -0
  126. package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.js +1 -1
  127. package/dist/application-spec/parse-application-files/spec/model/index.d.ts +2 -1
  128. package/dist/application-spec/parse-application-files/spec/model/index.js +1 -1
  129. package/dist/application-spec/parse-application-files/spec/model/session-data-schema.d.ts +5 -2
  130. package/dist/application-spec/parse-application-files/spec/model/session-data-schema.js +1 -1
  131. package/dist/application-spec/parse-application-files/spec/model/session-fields/index.d.ts +1 -0
  132. package/dist/application-spec/parse-application-files/spec/model/session-fields/index.js +1 -0
  133. package/dist/application-spec/parse-application-files/spec/model/session-fields/session-fields.d.ts +15 -0
  134. package/dist/application-spec/parse-application-files/spec/model/session-fields/session-fields.js +1 -0
  135. package/dist/application-spec/parse-application-files/spec/relations/relations.js +1 -1
  136. package/dist/application-spec/parse-application-files/spec/sections/actions.js +1 -1
  137. package/dist/application-spec/parse-application-files/spec/sections/app-metadata.js +1 -1
  138. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.d.ts +14 -2
  139. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.js +1 -1
  140. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +6 -9
  141. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  142. package/dist/application-spec/parse-application-files/spec/sections/assistant/index.d.ts +0 -1
  143. package/dist/client/authenticated-client.d.ts +5 -1
  144. package/dist/client/authenticated-client.js +1 -1
  145. package/dist/client/authorized-client.d.ts +3 -1
  146. package/dist/client/authorized-client.js +1 -1
  147. package/dist/client/base-client.d.ts +15 -1
  148. package/dist/client/base-client.js +1 -1
  149. package/dist/client/cli-client/cli-api-client.d.ts +17 -0
  150. package/dist/client/cli-client/cli-api-client.js +1 -0
  151. package/dist/client/cli-client/index.d.ts +2 -0
  152. package/dist/client/cli-client/index.js +1 -0
  153. package/dist/client/cli-client/unsupported-api-version-error.d.ts +11 -0
  154. package/dist/client/cli-client/unsupported-api-version-error.js +1 -0
  155. package/dist/client/contract.d.ts +39 -4
  156. package/dist/client/contract.js +1 -1
  157. package/dist/client/index.d.ts +3 -1
  158. package/dist/client/index.js +1 -1
  159. package/dist/client/phoenix-api.d.ts +7834 -2378
  160. package/dist/client/unauthenticated-client.d.ts +2 -1
  161. package/dist/client/unauthenticated-client.js +1 -1
  162. package/dist/client/version.d.ts +11 -0
  163. package/dist/client/version.js +1 -1
  164. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  165. package/dist/configurator/application-runtime/extensions/systems/action-system/action.d.ts +16 -4
  166. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +25 -10
  167. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  168. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +15 -5
  169. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/index.d.ts +1 -0
  170. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/index.js +1 -1
  171. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/register-webmcp-tools.d.ts +7 -3
  172. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/register-webmcp-tools.js +6 -2
  173. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/share-link.d.ts +14 -0
  174. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/share-link.js +2 -0
  175. package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.d.ts +41 -35
  176. package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.js +1 -1
  177. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.d.ts +4 -2
  178. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  179. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +9 -3
  180. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  181. package/dist/configurator/application-runtime/extensions/systems/graphql-system/read-offered-navigation.d.ts +6 -3
  182. package/dist/configurator/application-runtime/extensions/systems/graphql-system/read-offered-navigation.js +1 -1
  183. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/export-image-capture.d.ts +15 -4
  184. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/export-image-capture.js +3 -3
  185. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.d.ts +15 -7
  186. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.js +1 -1
  187. package/dist/configurator/common/configurator-interface.d.ts +13 -1
  188. package/dist/configurator/common/configurator-interface.js +1 -1
  189. package/dist/configurator/scene/animations/Animations.js +1 -1
  190. package/dist/configurator/scene/cameras/CameraPadding.d.ts +5 -0
  191. package/dist/configurator/scene/cameras/CameraPadding.js +1 -1
  192. package/dist/configurator/scene/resources/use-phx-gltf.js +1 -1
  193. package/dist/configurator/scene/scene-entity/materials/LocalCreatedMaterial.js +1 -1
  194. package/dist/configurator/scene/scene-entity/materials/RemoteReplacedMaterial.d.ts +5 -0
  195. package/dist/configurator/scene/scene-entity/materials/RemoteReplacedMaterial.js +1 -1
  196. package/dist/configurator/scene/scene-entity/materials/use-dispose-replaced.d.ts +27 -0
  197. package/dist/configurator/scene/scene-entity/materials/use-dispose-replaced.js +1 -0
  198. package/dist/configurator/toolbar-actions/use-toolbar-actions.js +1 -1
  199. package/dist/configurator/ui/assistant/AssistantComposer.js +1 -1
  200. package/dist/configurator/ui/assistant/AssistantPanel.js +1 -1
  201. package/dist/configurator/ui/assistant/annotation/editor/AnnotationComment.d.ts +6 -5
  202. package/dist/configurator/ui/assistant/annotation/editor/AnnotationComment.js +1 -1
  203. package/dist/configurator/ui/assistant/annotation/editor/AnnotationEditor.d.ts +4 -3
  204. package/dist/configurator/ui/assistant/annotation/editor/AnnotationEditor.js +1 -1
  205. package/dist/configurator/ui/assistant/annotation/editor/annotation-pins.d.ts +5 -0
  206. package/dist/configurator/ui/assistant/annotation/editor/annotation-pins.js +1 -1
  207. package/dist/configurator/ui/assistant/disclaimer/AssistantDisclaimerDialog.d.ts +10 -0
  208. package/dist/configurator/ui/assistant/disclaimer/AssistantDisclaimerDialog.js +1 -0
  209. package/dist/configurator/ui/assistant/disclaimer/AssistantDisclaimerLine.d.ts +10 -0
  210. package/dist/configurator/ui/assistant/disclaimer/AssistantDisclaimerLine.js +1 -0
  211. package/dist/configurator/ui/assistant/disclaimer/index.d.ts +2 -0
  212. package/dist/configurator/ui/assistant/disclaimer/index.js +1 -0
  213. package/dist/configurator/ui/assistant/drawing/AssistantDrawing.d.ts +2 -3
  214. package/dist/configurator/ui/assistant/drawing/AssistantDrawing.js +1 -1
  215. package/dist/configurator/ui/assistant/drawing/index.d.ts +1 -1
  216. package/dist/configurator/ui/assistant/drawing/index.js +1 -1
  217. package/dist/configurator/ui/assistant/drawing/use-drawing-url.d.ts +6 -12
  218. package/dist/configurator/ui/assistant/drawing/use-drawing-url.js +1 -1
  219. package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.d.ts +11 -7
  220. package/dist/configurator/ui/assistant/form-elements/FormTile.js +1 -1
  221. package/dist/configurator/ui/assistant/image-view/ImageView.js +1 -1
  222. package/dist/configurator/ui/assistant/panel/AssistantPanelHeader.js +1 -1
  223. package/dist/configurator/ui/assistant/use-assistant-composer.d.ts +5 -0
  224. package/dist/configurator/ui/assistant/use-assistant-composer.js +2 -2
  225. package/dist/configurator/ui/configurator-layout/index.d.ts +1 -1
  226. package/dist/configurator/ui/configurator-layout/index.js +1 -1
  227. package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/DesktopSidebar.js +4 -4
  228. package/dist/configurator/ui/configurator-layout/slots/index.d.ts +2 -0
  229. package/dist/configurator/ui/configurator-layout/slots/index.js +1 -1
  230. package/dist/configurator/ui/configurator-layout/slots/view-controls/DesktopViewControls.js +1 -1
  231. package/dist/configurator/ui/configurator-layout/slots/view-controls/MobileViewControls.js +1 -1
  232. package/dist/configurator/ui/configurator-layout/slots/view-controls/NestedViewControls.d.ts +7 -0
  233. package/dist/configurator/ui/configurator-layout/slots/view-controls/NestedViewControls.js +1 -0
  234. package/dist/configurator/ui/configurator-layout/slots/view-controls/use-view-control-items.d.ts +6 -0
  235. package/dist/configurator/ui/configurator-layout/slots/view-controls/use-view-control-items.js +1 -0
  236. package/dist/configurator/ui/configurator-layout/universal/DesktopPreview.js +1 -1
  237. package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +3 -3
  238. package/dist/configurator/ui/configurator-layout/universal/MobilePreview.js +1 -1
  239. package/dist/configurator/ui/configurator-layout/universal/use-preview-description.d.ts +1 -0
  240. package/dist/configurator/ui/configurator-layout/universal/use-preview-description.js +1 -0
  241. package/dist/configurator/ui/index.d.ts +1 -1
  242. package/dist/configurator/ui/legacy/layout/common/ViewControls.js +1 -1
  243. package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -1
  244. package/dist/docs/index.json +117 -2
  245. package/dist/docs/layouts/nested-view-controls.mdx +223 -0
  246. package/dist/docs/layouts/preview/always.mdx +22 -0
  247. package/dist/docs/layouts/view-controls.mdx +2 -0
  248. package/dist/docs/other-features/domain-actions.mdx +53 -56
  249. package/dist/docs/phoenix/admin.mdx +5 -40
  250. package/dist/docs/phoenix/application-states.mdx +1 -1
  251. package/dist/docs/phoenix/assistant/actions.mdx +183 -0
  252. package/dist/docs/phoenix/assistant/changing-the-configuration.mdx +333 -0
  253. package/dist/docs/phoenix/assistant/instructions-and-ai-settings.mdx +221 -0
  254. package/dist/docs/phoenix/assistant/overview.mdx +137 -0
  255. package/dist/docs/phoenix/assistant/per-session-setup.mdx +166 -0
  256. package/dist/docs/phoenix/assistant/reading-the-configuration.mdx +349 -0
  257. package/dist/docs/phoenix/assistant/screenshots.mdx +135 -0
  258. package/dist/docs/phoenix/assistant/security-and-limits.mdx +151 -0
  259. package/dist/docs/phoenix/assistant/the-panel.mdx +298 -0
  260. package/dist/docs/phoenix/clerk-sign-in.mdx +9 -5
  261. package/dist/docs/phoenix/configurator-interface.mdx +18 -33
  262. package/dist/docs/phoenix/csp.mdx +3 -1
  263. package/dist/docs/phoenix/data-sources.mdx +26 -30
  264. package/dist/docs/phoenix/deployments.mdx +3 -3
  265. package/dist/docs/phoenix/finalization.mdx +0 -1
  266. package/dist/docs/phoenix/integration/authentication-external.mdx +17 -15
  267. package/dist/docs/phoenix/integration/authentication-internal.mdx +1 -1
  268. package/dist/docs/phoenix/integration/finalization-internal.mdx +1 -4
  269. package/dist/docs/phoenix/integration/integration-modes-external.mdx +2 -2
  270. package/dist/docs/phoenix/integration/integration-modes-internal.mdx +9 -0
  271. package/dist/docs/phoenix/layout-slots.mdx +1 -1
  272. package/dist/docs/phoenix/migrations.mdx +1 -1
  273. package/dist/docs/phoenix/phoenix-cli.mdx +90 -57
  274. package/dist/docs/phoenix/project-structure.mdx +30 -15
  275. package/dist/docs/phoenix/publishing.mdx +21 -28
  276. package/dist/docs/phoenix/sdk-builder-workflow.mdx +51 -34
  277. package/dist/docs/phoenix/sessions-and-access.mdx +171 -164
  278. package/dist/docs/phoenix/webhook-membership.mdx +4 -1
  279. package/dist/docs/phoenix/webhooks.mdx +93 -116
  280. package/dist/docs/ux-guidelines/interaction-modes.mdx +2 -2
  281. package/dist/domain/application/access/access-handlers.d.ts +19 -0
  282. package/dist/domain/application/access/access-handlers.js +1 -0
  283. package/dist/domain/application/access/anonymous-handler.d.ts +16 -0
  284. package/dist/domain/application/access/anonymous-handler.js +1 -0
  285. package/dist/domain/application/access/chunk-scopes-handler.d.ts +27 -0
  286. package/dist/domain/application/access/chunk-scopes-handler.js +1 -0
  287. package/dist/domain/application/access/code-handler.d.ts +16 -0
  288. package/dist/domain/application/access/code-handler.js +1 -0
  289. package/dist/domain/application/access/index.d.ts +7 -0
  290. package/dist/domain/application/access/index.js +1 -0
  291. package/dist/domain/application/access/refresh-handler.d.ts +16 -0
  292. package/dist/domain/application/access/refresh-handler.js +1 -0
  293. package/dist/domain/application/access/signed-in-handler.d.ts +44 -0
  294. package/dist/domain/application/access/signed-in-handler.js +1 -0
  295. package/dist/domain/application/access/visitor-handler.d.ts +23 -0
  296. package/dist/domain/application/access/visitor-handler.js +1 -0
  297. package/dist/domain/application/application-config.d.ts +36 -1
  298. package/dist/domain/application/assistant/assistant-exposure.d.ts +22 -0
  299. package/dist/domain/application/assistant/assistant-exposure.js +1 -0
  300. package/dist/domain/application/assistant/build-assistant-lenses.js +3 -3
  301. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  302. package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +6 -2
  303. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  304. package/dist/domain/application/assistant/index.d.ts +1 -0
  305. package/dist/domain/application/assistant/index.js +1 -1
  306. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
  307. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +14 -2
  308. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
  309. package/dist/domain/application/assistant/session-setup/assistant-takes-images.d.ts +7 -0
  310. package/dist/domain/application/assistant/session-setup/assistant-takes-images.js +1 -0
  311. package/dist/domain/application/assistant/session-setup/index.d.ts +1 -0
  312. package/dist/domain/application/assistant/session-setup/index.js +1 -1
  313. package/dist/domain/application/assistant-mutations.js +1 -1
  314. package/dist/domain/application/assistant-recipe-groups.d.ts +4 -3
  315. package/dist/domain/application/assistant-recipe-groups.js +1 -1
  316. package/dist/domain/application/configurator-builder.d.ts +2 -0
  317. package/dist/domain/application/configurator-builder.js +1 -1
  318. package/dist/domain/application/index.d.ts +2 -1
  319. package/dist/domain/application/index.js +1 -1
  320. package/dist/domain/application/standard-properties.d.ts +1 -1
  321. package/dist/domain/application/standard-properties.js +1 -1
  322. package/dist/domain/available-system-components/available-system-components.js +1 -1
  323. package/dist/domain/core/component/system-component-filter.d.ts +1 -0
  324. package/dist/domain/core/component/system-component-filter.js +1 -1
  325. package/dist/domain/core/component/view-state-component.d.ts +4 -3
  326. package/dist/domain/core/component/view-state-component.js +1 -1
  327. package/dist/domain/core/domain-factory.d.ts +6 -0
  328. package/dist/domain/core/domain-factory.js +1 -1
  329. package/dist/domain/core/fit-session-data.d.ts +16 -0
  330. package/dist/domain/core/fit-session-data.js +1 -0
  331. package/dist/domain/domain-context/navigation-system/navigation-system.d.ts +2 -2
  332. package/dist/domain/domain-context/navigation-system/navigation-system.js +1 -1
  333. package/dist/domain/domain-context/transformers/when-builder.js +1 -1
  334. package/dist/domain/domain-runtime/domain-context/actions.d.ts +4 -0
  335. package/dist/domain/domain-runtime/domain-context/actions.js +1 -1
  336. package/dist/domain/domain-runtime/domain-context/domain-context.d.ts +8 -0
  337. package/dist/domain/domain-runtime/domain-context/domain-context.js +1 -1
  338. package/dist/domain/domain-runtime/domain-context/selectors.d.ts +1 -0
  339. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  340. package/dist/domain/domain-runtime/domain-context/types.d.ts +8 -4
  341. package/dist/domain/domain-runtime/domain-runtime.d.ts +8 -0
  342. package/dist/domain/extensions/export-images/agent-screenshot.d.ts +5 -4
  343. package/dist/domain/extensions/export-images/agent-screenshot.js +1 -1
  344. package/dist/domain/extensions/index.d.ts +0 -1
  345. package/dist/domain/extensions/index.js +1 -1
  346. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +4 -0
  347. package/dist/domain/spec/sections/actions.d.ts +3 -2
  348. package/dist/domain/spec/sections/app-metadata.d.ts +12 -0
  349. package/dist/domain/spec/sections/assistant/assistant-features.d.ts +13 -0
  350. package/dist/domain/spec/sections/assistant/assistant-features.js +1 -0
  351. package/dist/domain/spec/sections/assistant/assistant-manifest.d.ts +17 -6
  352. package/dist/domain/spec/sections/assistant/assistant-resolved-manifest.d.ts +28 -5
  353. package/dist/domain/spec/sections/assistant/index.d.ts +1 -0
  354. package/dist/domain/system-components/index.d.ts +1 -0
  355. package/dist/domain/system-components/index.js +1 -1
  356. package/dist/domain/system-components/navigation/index.d.ts +1 -0
  357. package/dist/domain/system-components/navigation/index.js +1 -0
  358. package/dist/domain/system-components/navigation/view-controls.d.ts +24 -0
  359. package/dist/domain/system-components/navigation/view-controls.js +1 -0
  360. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  361. package/dist/extras/clerk/index.d.ts +6 -0
  362. package/dist/extras/cognito/AccountAvatar.d.ts +7 -0
  363. package/dist/extras/cognito/AccountAvatar.js +1 -0
  364. package/dist/extras/cognito/AccountControl.d.ts +14 -0
  365. package/dist/extras/cognito/AccountControl.js +1 -0
  366. package/dist/extras/cognito/AdminSignInPage.d.ts +26 -0
  367. package/dist/extras/cognito/AdminSignInPage.js +1 -0
  368. package/dist/extras/cognito/CognitoSignInPage.d.ts +8 -2
  369. package/dist/extras/cognito/CognitoSignInPage.js +1 -1
  370. package/dist/extras/cognito/ConfiguratorSignInPage.d.ts +19 -0
  371. package/dist/extras/cognito/ConfiguratorSignInPage.js +1 -0
  372. package/dist/extras/cognito/SignInFailurePage.d.ts +11 -0
  373. package/dist/extras/cognito/SignInFailurePage.js +1 -0
  374. package/dist/extras/cognito/SignInGateLayout.d.ts +25 -0
  375. package/dist/extras/cognito/SignInGateLayout.js +1 -0
  376. package/dist/extras/cognito/SignInNotice.d.ts +9 -0
  377. package/dist/extras/cognito/SignInNotice.js +1 -0
  378. package/dist/extras/cognito/index.d.ts +4 -0
  379. package/dist/extras/cognito/index.js +1 -1
  380. package/dist/globals/index.d.ts +5 -0
  381. package/dist/i18n/locales/cs/messages.js +1 -1
  382. package/dist/i18n/locales/da/messages.js +1 -1
  383. package/dist/i18n/locales/de/messages.js +1 -1
  384. package/dist/i18n/locales/de-AT/messages.js +1 -1
  385. package/dist/i18n/locales/en/messages.js +1 -1
  386. package/dist/i18n/locales/en-AU/messages.js +1 -1
  387. package/dist/i18n/locales/en-GB/messages.js +1 -1
  388. package/dist/i18n/locales/es/messages.js +1 -1
  389. package/dist/i18n/locales/fr/messages.js +1 -1
  390. package/dist/i18n/locales/hu/messages.js +1 -1
  391. package/dist/i18n/locales/it/messages.js +1 -1
  392. package/dist/i18n/locales/nl/messages.js +1 -1
  393. package/dist/i18n/locales/pl/messages.js +1 -1
  394. package/dist/i18n/locales/pt/messages.js +1 -1
  395. package/dist/i18n/locales/ro/messages.js +1 -1
  396. package/dist/i18n/locales/sk/messages.js +1 -1
  397. package/dist/i18n/locales/tr/messages.js +1 -1
  398. package/dist/legacy/deployment-cli/commands/create-environment.js +1 -1
  399. package/dist/legacy/deployment-cli/commands/list-environments.js +1 -1
  400. package/dist/legacy/deployment-cli/commands/register-deployment.js +1 -1
  401. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +12 -3
  402. package/dist/legacy/phoenix-cli/commands/prepare-deployment-command.js +1 -1
  403. package/dist/legacy/phoenix-cli/commands/prepare-local-environment-command.js +1 -1
  404. package/dist/legacy/phoenix-cli/services/prepare-development-environment.js +1 -1
  405. package/dist/legacy/phoenix-cli/services/webhook-service/transport.js +1 -1
  406. package/dist/phoenix/application-spec/index.d.ts +1 -1
  407. package/dist/phoenix/application-spec/index.js +1 -1
  408. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +10 -3
  409. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  410. package/dist/phoenix/cli.js +1 -1
  411. package/dist/phoenix/commands/account/whoami.d.ts +8 -2
  412. package/dist/phoenix/commands/account/whoami.js +4 -3
  413. package/dist/phoenix/commands/cleanup-environment.js +1 -1
  414. package/dist/phoenix/commands/deploy.d.ts +7 -2
  415. package/dist/phoenix/commands/deploy.js +9 -3
  416. package/dist/phoenix/commands/deployment-build-envs-command.js +1 -1
  417. package/dist/phoenix/commands/deps/deps.js +2 -2
  418. package/dist/phoenix/commands/feedback.d.ts +2 -2
  419. package/dist/phoenix/commands/feedback.js +1 -1
  420. package/dist/phoenix/commands/finish-deployment-command.js +1 -1
  421. package/dist/phoenix/commands/init-starter-spec.js +3 -4
  422. package/dist/phoenix/commands/init.d.ts +2 -2
  423. package/dist/phoenix/commands/init.js +1 -1
  424. package/dist/phoenix/commands/login.d.ts +1 -1
  425. package/dist/phoenix/commands/login.js +2 -2
  426. package/dist/phoenix/commands/logout.js +1 -1
  427. package/dist/phoenix/commands/prepare-deployment-command.js +2 -2
  428. package/dist/phoenix/commands/prepare-local-environment-command.js +1 -1
  429. package/dist/phoenix/services/cli-credentials.d.ts +13 -2
  430. package/dist/phoenix/services/cli-credentials.js +2 -2
  431. package/dist/phoenix/services/cli-server/describe-saved-logins.d.ts +5 -0
  432. package/dist/phoenix/services/cli-server/describe-saved-logins.js +1 -0
  433. package/dist/phoenix/services/cli-server/index.d.ts +2 -0
  434. package/dist/phoenix/services/cli-server/index.js +1 -0
  435. package/dist/phoenix/services/cli-server/resolve-cli-server-url.d.ts +25 -0
  436. package/dist/phoenix/services/cli-server/resolve-cli-server-url.js +1 -0
  437. package/dist/phoenix/services/development-credential.js +1 -1
  438. package/dist/phoenix/services/frontend-config.d.ts +2 -0
  439. package/dist/phoenix/services/index.d.ts +4 -2
  440. package/dist/phoenix/services/index.js +1 -1
  441. package/dist/phoenix/services/phoenix-regions.d.ts +15 -5
  442. package/dist/phoenix/services/phoenix-regions.js +1 -1
  443. package/dist/phoenix/services/prepare-development-environment.js +2 -2
  444. package/dist/phoenix/services/session/phoenix-application.js +1 -1
  445. package/dist/phoenix/services/signed-in-development-environment.d.ts +15 -4
  446. package/dist/phoenix/services/signed-in-development-environment.js +1 -1
  447. package/dist/phoenix/services/spec-project/describe-workspace-projects.d.ts +11 -0
  448. package/dist/phoenix/services/spec-project/describe-workspace-projects.js +1 -0
  449. package/dist/phoenix/services/spec-project/index.d.ts +3 -0
  450. package/dist/phoenix/services/spec-project/index.js +1 -0
  451. package/dist/phoenix/services/spec-project/resolve-deploy-target.d.ts +47 -0
  452. package/dist/phoenix/services/spec-project/resolve-deploy-target.js +1 -0
  453. package/dist/phoenix/services/spec-project/resolve-target-project.d.ts +34 -0
  454. package/dist/phoenix/services/spec-project/resolve-target-project.js +2 -0
  455. package/dist/phoenix/services/spec-project/write-spec-project.d.ts +7 -0
  456. package/dist/phoenix/services/spec-project/write-spec-project.js +1 -0
  457. package/dist/phoenix/services/variant-file-session.js +1 -1
  458. package/dist/phoenix/services/vite-config.js +1 -1
  459. package/dist/phoenix/services/webhook-service/transport.js +1 -1
  460. package/dist/react-sdk/application-runtime/common-services/selectors.js +1 -1
  461. package/dist/react-sdk/application-runtime/domain-application-context/configuration-persist-system.d.ts +6 -0
  462. package/dist/react-sdk/application-runtime/domain-application-context/configuration-persist-system.js +1 -1
  463. package/dist/react-sdk/application-runtime/host-properties/selectors.d.ts +2 -2
  464. package/dist/react-sdk/application-runtime/integration/integration-mode.d.ts +30 -0
  465. package/dist/react-sdk/application-runtime/integration/integration-mode.js +1 -1
  466. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +20 -6
  467. package/dist/react-sdk/application-runtime/session/actions.d.ts +2 -1
  468. package/dist/react-sdk/application-runtime/session/actions.js +1 -1
  469. package/dist/react-sdk/application-runtime/session/initialize.js +1 -1
  470. package/dist/react-sdk/application-runtime/session/selectors.d.ts +2 -0
  471. package/dist/react-sdk/application-runtime/session/selectors.js +1 -1
  472. package/dist/react-sdk/application-runtime/session/session-service.d.ts +64 -2
  473. package/dist/react-sdk/application-runtime/session/session-service.js +1 -1
  474. package/dist/react-sdk/application-runtime/session/session-token.d.ts +8 -0
  475. package/dist/react-sdk/application-runtime/session/session-token.js +1 -1
  476. package/dist/react-sdk/application-runtime/session/types.d.ts +6 -1
  477. package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +1 -0
  478. package/dist/react-sdk/domain-context/index.d.ts +3 -2
  479. package/dist/react-sdk/domain-context/index.js +1 -1
  480. package/dist/react-sdk/domain-context/system-hooks/generate-share-link-hooks.d.ts +1 -5
  481. package/dist/react-sdk/domain-context/system-hooks/generate-share-link-hooks.js +1 -1
  482. package/dist/react-sdk/domain-context/system-hooks/generate-share-link.d.ts +25 -0
  483. package/dist/react-sdk/domain-context/system-hooks/generate-share-link.js +1 -0
  484. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.d.ts +5 -3
  485. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
  486. package/dist/react-sdk/preset-selection/PresetSelectionProvider.js +1 -1
  487. package/dist/react-sdk/session/AccessDeniedAdminPage.d.ts +13 -0
  488. package/dist/react-sdk/session/AccessDeniedAdminPage.js +1 -0
  489. package/dist/react-sdk/session/AccessDeniedPage.d.ts +20 -0
  490. package/dist/react-sdk/session/AccessDeniedPage.js +1 -0
  491. package/dist/react-sdk/session/ConfiguratorUnavailablePage.d.ts +5 -0
  492. package/dist/react-sdk/session/ConfiguratorUnavailablePage.js +1 -0
  493. package/dist/react-sdk/session/SessionServiceProvider.d.ts +5 -0
  494. package/dist/react-sdk/session/SessionServiceProvider.js +1 -1
  495. package/dist/react-sdk/session/index.d.ts +3 -0
  496. package/dist/react-sdk/session/index.js +1 -1
  497. package/dist/react-sdk/session/server-sign-in-support.d.ts +16 -0
  498. package/dist/react-sdk/session/server-sign-in-support.js +1 -0
  499. package/dist/react-sdk/session/sign-in-address.d.ts +18 -0
  500. package/dist/react-sdk/session/sign-in-address.js +1 -0
  501. package/dist/react-sdk/session/studio-frame.d.ts +14 -0
  502. package/dist/react-sdk/session/studio-frame.js +1 -0
  503. package/dist/react-sdk/session/use-sign-in.d.ts +51 -0
  504. package/dist/react-sdk/session/use-sign-in.js +1 -0
  505. package/dist/ui-sdk/components/preview/Preview.d.ts +12 -4
  506. package/dist/ui-sdk/components/preview/Preview.js +2 -2
  507. package/dist/ui-sdk/components/snackbar/Snackbar.d.ts +3 -2
  508. package/dist/ui-sdk/components/snackbar/Snackbar.js +1 -1
  509. package/dist/ui-sdk/components/toolbar/desktop-toolbar/ToolbarPopper.d.ts +2 -0
  510. package/dist/ui-sdk/components/toolbar/desktop-toolbar/ToolbarPopper.js +1 -1
  511. package/dist/ui-sdk/components/view-controls/ViewControlsContext.d.ts +3 -1
  512. package/dist/ui-sdk/components/view-controls/ViewControlsItem.js +1 -1
  513. package/dist/ui-sdk/components/view-controls/ViewControlsRoot.d.ts +6 -1
  514. package/dist/ui-sdk/components/view-controls/ViewControlsRoot.js +1 -1
  515. package/dist/webhook/builders/auth-handler-builder.d.ts +21 -1
  516. package/dist/webhook/builders/auth-handler-builder.js +1 -1
  517. package/dist/webhook/builders/common.d.ts +9 -0
  518. package/dist/webhook/builders/webhook-builder.d.ts +18 -0
  519. package/dist/webhook/builders/webhook-builder.js +1 -1
  520. package/package.json +5 -4
  521. package/schema/domain-spec.json +224 -65
  522. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/assistant.js +0 -43
  523. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/assistant-setup.js +0 -32
  524. package/dist/application-spec/generate-application/code/templates/skills/processes/beta.d.ts +0 -14
  525. package/dist/application-spec/generate-application/code/templates/skills/processes/beta.js +0 -4
  526. package/dist/domain/extensions/view-controls.d.ts +0 -25
  527. package/dist/domain/extensions/view-controls.js +0 -1
@@ -1,12 +1,16 @@
1
1
  import type { AssistantFormElementDescriptor } from '#package/domain';
2
+ import type { EnhancedJsonSchemaType } from '../../../../core/enhanced-json-schema.js';
2
3
  import type { PhoenixDefinitions } from '../../../../core/phoenix-definitions.js';
3
4
  import type { CodeImports } from '../../common/code-imports.js';
4
5
  /**
5
6
  * Generates the `AssistantFormElementTypes` map of the project's own assistant form elements (name →
6
- * `{ role, attributes }`), and the `AssistantFormElementName` and `AssistantFormElementProps<NAME>`
7
- * types derived from it, which `phx.frontend.createAssistantFormElement` is typed by. An attribute
8
- * outside `required` is optional and an enum is a union of its values. The `description` of an element becomes the doc
9
- * comment of its property. Without elements the map is empty, so `AssistantFormElementName` is
10
- * `never`.
7
+ * `{ role, attributes, state? }`), and the `AssistantFormElementName` and
8
+ * `AssistantFormElementProps<NAME>` types derived from it, which
9
+ * `phx.frontend.createAssistantFormElement` is typed by. An attribute outside `required` is optional
10
+ * and an enum is a union of its values. An input that declares a `state` schema in `states` gets it
11
+ * as its `state` type, with its `description` as the doc comment, whose `$ref`s resolve as in action params, `common:` ones among
12
+ * `commonTypeNames`; one without it has no `state`, so
13
+ * its component holds `unknown`. The `description` of an element becomes the doc comment of its
14
+ * property. Without elements the map is empty, so `AssistantFormElementName` is `never`.
11
15
  */
12
- export declare const generateAssistantFormElementTypeDecls: (formElements: readonly AssistantFormElementDescriptor[], phxDefinitions: PhoenixDefinitions, imports: CodeImports, indent: number) => string;
16
+ export declare const generateAssistantFormElementTypeDecls: (formElements: readonly AssistantFormElementDescriptor[], states: Readonly<Record<string, EnhancedJsonSchemaType>>, commonTypeNames: ReadonlySet<string>, phxDefinitions: PhoenixDefinitions, imports: CodeImports, indent: number) => string;
@@ -1,7 +1,7 @@
1
- import{docComment as e}from"../common/doc-comment.js";import{formatPropertyKey as t}from"../common/format-property-key.js";import{schemaToTypeString as n}from"../common/schema-to-type-string.js";export const generateAssistantFormElementTypeDecls=(o,r,s,m)=>{let a=" ".repeat(m),p=" ".repeat(m+2),l=" ".repeat(m+4),i=" ".repeat(m+6),$={phxDefinitions:r,commonTypeNames:new Set,imports:s},y=o.map(({name:o,role:r,description:s,attributes:m,required:a=[]})=>{let y=Object.entries(m).map(([e,o])=>`${i}readonly ${t(e)}${a.includes(e)?"":"?"}: ${n({...o},$)}`);return[...e(s,p),`${p}readonly ${t(o)}: {`,`${l}readonly role: '${r}'`,`${l}readonly attributes: ${y.length>0?`{
2
- ${y.join("\n")}
3
- ${l}}`:"Record<never, never>"}`,`${p}}`].join("\n")});s.addTypeImport("@salsita-ai/sdk/configurator","AssistantFormElementRoleProps");let c=y.length>0?`{
4
- ${y.join("\n")}
5
- ${a}}`:"Record<never, never>";return`${a}type AssistantFormElementTypes = ${c}
6
- ${a}type AssistantFormElementName = keyof AssistantFormElementTypes
7
- ${a}type AssistantFormElementProps<NAME extends AssistantFormElementName, STATE = unknown> = AssistantFormElementRoleProps<AssistantFormElementTypes[NAME], STATE>`};
1
+ import{docComment as e}from"../common/doc-comment.js";import{formatPropertyKey as t}from"../common/format-property-key.js";import{schemaToTypeString as o}from"../common/schema-to-type-string.js";export const generateAssistantFormElementTypeDecls=(n,r,s,m,a,i)=>{let p=" ".repeat(i),l=" ".repeat(i+2),$=" ".repeat(i+4),y=" ".repeat(i+6),d={phxDefinitions:m,commonTypeNames:s,imports:a},c=n.map(({name:n,role:s,description:m,attributes:a,required:i=[]})=>{let p=Object.hasOwn(r,n)?r[n]:void 0,c=Object.entries(a).map(([e,n])=>`${y}readonly ${t(e)}${i.includes(e)?"":"?"}: ${o({...n},d)}`);return[...e(m,l),`${l}readonly ${t(n)}: {`,`${$}readonly role: '${s}'`,`${$}readonly attributes: ${c.length>0?`{
2
+ ${c.join("\n")}
3
+ ${$}}`:"Record<never, never>"}`,...void 0===p?[]:[...e(p.description,$),`${$}readonly state: ${o(p,d)}`],`${l}}`].join("\n")});a.addTypeImport("@salsita-ai/sdk/configurator","AssistantFormElementRoleProps");let A=c.length>0?`{
4
+ ${c.join("\n")}
5
+ ${p}}`:"Record<never, never>";return`${p}type AssistantFormElementTypes = ${A}
6
+ ${p}type AssistantFormElementName = keyof AssistantFormElementTypes
7
+ ${p}type AssistantFormElementProps<NAME extends AssistantFormElementName> = AssistantFormElementRoleProps<AssistantFormElementTypes[NAME]>`};
@@ -1,19 +1,19 @@
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")}},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} {
1
+ import{generateInvariantBlueprintMembers as e,getDomainFactoryTypes as t}from"../domain-spec/index.js";let a="@salsita-ai/sdk/configurator",n="CustomInvariantBlueprints",r="AdminCustomInvariantBlueprints",o=["authHandlerBuilder","webhookBuilder","taskFactory","finalizeHandlerBuilder","callbackBuilder","prefetchBuilder","dynamicResourcesFactory"],i={authHandlerBuilder:" /** @deprecated The access mode in the spec builds the auth hook; customise it with phx.access.create…Handler files in src/handlers/. This API will be removed in a future version. */\n"},s=(e,t)=>e.replaceAll("\n",`
2
+ ${t}`),d=(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(", ")},l=()=>{let e=new Map;return{member:(t,a)=>(e.set(t,a),t),declarations:()=>[...e].map(([e,t])=>`type ${e} = ${t}`).join("\n")}},p=(o,i,l)=>{for(let e of["$DomainEntityReflection","DomainComponentOpticBuilder","DomainEntityReflection","EnhancedAliasReflection","EnumLike","RawAliasReflection","RuntimeExpressionContext","SchemaReflection","createAssistantSetupHandlerFactory","createCustomExpressionFactory","createCustomInvariantFactory","createDataRowValidatorHandler","createMapPublishedChunkedDataHandlerFactory","createMapPublishedRevisionDataHandlerFactory","createRecipeFactory","createSheetValidatorHandler"])i.addTypeImport("@salsita-ai/sdk/domain",e);i.addTypeImport(a,"createConfiguratorInterface"),i.addTypeImport(a,"CreateAssistantFormElement");let p=t(o.configurator,{typePrefix:""}),m=t(o.admin,{typePrefix:"Admin"}),c=d(o,!0),y=(e,t)=>t?`interface ${e} {
3
3
  ${t}
4
- }`:`interface ${e} {}`,{member:u}=l,$=`{
5
- readonly model: ${i(p.modelType," ")}
6
- readonly enhancedModel: ${i(p.enhancedModelType," ")}
4
+ }`:`interface ${e} {}`,{member:u}=l,h=`{
5
+ readonly model: ${s(p.modelType," ")}
6
+ readonly enhancedModel: ${s(p.enhancedModelType," ")}
7
7
  readonly implementCustomExpressions: ${u("PhxImplementCustomExpressions",`ReturnType<typeof createCustomExpressionFactory<${p.typeArguments}, ${p.contextExtension}>>`)}
8
8
  readonly implementCustomInvariants: ${u("PhxImplementCustomInvariants",`ReturnType<ReturnType<typeof createCustomInvariantFactory<${p.typeArguments}, ${n}, ${p.contextExtension}>>>`)}
9
9
  readonly createAssistantSetupHandler: ${u("PhxCreateAssistantSetupHandler","ReturnType<typeof createAssistantSetupHandlerFactory<SessionData, AnyDomainEntity, $Map, ActionTypes>>")}
10
10
  readonly attachComponent: ${u("PhxAttachComponent",`ReturnType<typeof DomainComponentOpticBuilder.from<${p.typeArguments}, ${p.contextExtension}>>`)}
11
11
  readonly createRecipe: ${u("PhxCreateRecipe","ReturnType<typeof createRecipeFactory<AnyDomainEntity>>")}
12
12
  readonly admin: {
13
- readonly model: ${i(m.modelType," ")}
14
- readonly enhancedModel: ${i(m.enhancedModelType," ")}
13
+ readonly model: ${s(m.modelType," ")}
14
+ readonly enhancedModel: ${s(m.enhancedModelType," ")}
15
15
  readonly implementCustomExpressions: ${u("PhxAdminImplementCustomExpressions",`ReturnType<typeof createCustomExpressionFactory<${m.typeArguments}, ${m.contextExtension}>>`)}
16
- readonly implementCustomInvariants: ${u("PhxAdminImplementCustomInvariants",`ReturnType<ReturnType<typeof createCustomInvariantFactory<${m.typeArguments}, ${o}, ${m.contextExtension}>>>`)}
16
+ readonly implementCustomInvariants: ${u("PhxAdminImplementCustomInvariants",`ReturnType<ReturnType<typeof createCustomInvariantFactory<${m.typeArguments}, ${r}, ${m.contextExtension}>>>`)}
17
17
  readonly attachComponent: ${u("PhxAdminAttachComponent",`ReturnType<typeof DomainComponentOpticBuilder.from<${m.typeArguments}, ${m.contextExtension}>>`)}
18
18
  readonly createMapPublishedRevisionDataHandler: ${u("PhxAdminCreateMapPublishedRevisionDataHandler","ReturnType<typeof createMapPublishedRevisionDataHandlerFactory<Admin.AnyDomainEntity, Admin.RootEntity, Admin.$Map, PublishedData>>")}
19
19
  readonly createMapPublishedChunkedDataHandler: ${u("PhxAdminCreateMapPublishedChunkedDataHandler","ReturnType<typeof createMapPublishedChunkedDataHandlerFactory<Admin.AnyDomainEntity, Admin.RootEntity, Admin.$Map>>")}
@@ -21,12 +21,12 @@ ${t}
21
21
  readonly createSheetValidatorHandler: typeof createSheetValidatorHandler
22
22
  readonly createRecipe: ${u("PhxAdminCreateRecipe","ReturnType<typeof createRecipeFactory<Admin.AnyDomainEntity>>")}
23
23
  }
24
- }`,h=u("PhxFrontend",`ReturnType<typeof createConfiguratorInterface<${y}>> & {
24
+ }`,$=u("PhxFrontend",`ReturnType<typeof createConfiguratorInterface<${c}>> & {
25
25
  readonly createAssistantFormElement: CreateAssistantFormElement<AssistantFormElementTypes>
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}
26
+ }`),{latestModel:A}=o.configurator;return{declarations:[y(n,e(o.configurator.invariants," ")),y(r,e(o.admin.invariants," "))].join("\n\n"),domainType:h,configuratorInterfaceType:$,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=l(),n=p(e,t,a);return{...n,declarations:`${n.declarations}
27
27
 
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}
28
+ ${a.declarations()}`}};export const generateGlobalPhxTypes=(e,t)=>{let a=l(),{member:n}=a,r=p(e,t,a);t.addTypeImport("@salsita-ai/sdk/admin","createAdminInterface"),t.addTypeImport("@salsita-ai/sdk/webhook","createDomainWebhook");let s=d(e,!1),m=n("PhxFrontendAdmin",`ReturnType<typeof createAdminInterface<${s}>>`),c=n("PhxWebhookBuilders",`ReturnType<typeof createDomainWebhook<${s}>>`),y=o.map(e=>`${i[e]??""} readonly ${e}: ${n(`PhxWebhooks${e.charAt(0).toUpperCase()}${e.slice(1)}`,`${c}['${e}']`)}`);return{...r,declarations:`${r.declarations}
29
29
 
30
- ${a.declarations()}`,adminInterfaceType:p,webhooksType:`{
30
+ ${a.declarations()}`,adminInterfaceType:m,webhooksType:`{
31
31
  ${y.join("\n")}
32
32
  }`}};
@@ -1,17 +1,17 @@
1
- import{autoHeader as e}from"../common/file-headers.js";import{generateApplicationSpecTypeDeclarations as a}from"./application-types.js";import{generateGlobalPhxTypes as n}from"./global-definition/index.js";export const generateApplicationSpecGlobals=(t,o)=>{let i,l,d,r,s,p,c,y,m,{declarations:h,imports:f}=a(t,o,2);f.addTypeImport("@salsita-ai/sdk/domain","EnumLike");let g=n(t,f),S=[h,(i=t.configurator.latestModel,l=t.admin.latestModel,d=i.entityTypes.map(String),r=[...i.aliases].map(([e])=>String(e)),s=[...i.commonTypes].map(([e])=>String(e)),p=l.entityTypes.map(String),c=[...l.aliases].map(([e])=>String(e)),y=[...l.commonTypes].map(([e])=>String(e)),m=(e,a)=>e.map(e=>` ${a(e)}`).join("\n"),` interface Model {
2
- ${m([...d,...s,...r],e=>`readonly ${e}: ${e}`)}
1
+ import{autoHeader as e}from"../common/file-headers.js";import{generateApplicationSpecTypeDeclarations as a}from"./application-types.js";import{generateGlobalPhxTypes as n}from"./global-definition/index.js";export const generateApplicationSpecGlobals=(t,o)=>{let d,i,r,l,s,p,y,c,m,{declarations:h,imports:f}=a(t,o,2);f.addTypeImport("@salsita-ai/sdk/domain","EnumLike"),f.addTypeImport("@salsita-ai/sdk/domain","TypedCreateChunkScopesHandler"),f.addTypeImport("@salsita-ai/sdk/domain","TypedCreateVisitorHandler"),f.addTypeImport("@salsita-ai/sdk/domain","TypedCreateSignedInHandler"),f.addTypeImport("@salsita-ai/sdk/domain","TypedCreateCodeHandler"),f.addTypeImport("@salsita-ai/sdk/domain","TypedCreateRefreshHandler"),f.addTypeImport("@salsita-ai/sdk/domain","TypedCreateAnonymousHandler");let S=n(t,f),g=[h,(d=t.configurator.latestModel,i=t.admin.latestModel,r=d.entityTypes.map(String),l=[...d.aliases].map(([e])=>String(e)),s=[...d.commonTypes].map(([e])=>String(e)),p=i.entityTypes.map(String),y=[...i.aliases].map(([e])=>String(e)),c=[...i.commonTypes].map(([e])=>String(e)),m=(e,a)=>e.map(e=>` ${a(e)}`).join("\n"),` interface Model {
2
+ ${m([...r,...s,...l],e=>`readonly ${e}: ${e}`)}
3
3
  }
4
4
 
5
5
  interface EnhancedModel {
6
- ${m([...d,...r],e=>`readonly $${e}: $${e}`)}
6
+ ${m([...r,...l],e=>`readonly $${e}: $${e}`)}
7
7
  }
8
8
 
9
9
  interface AdminModel {
10
- ${m([...p,...y,...c],e=>`readonly ${e}: Admin.${e}`)}
10
+ ${m([...p,...c,...y],e=>`readonly ${e}: Admin.${e}`)}
11
11
  }
12
12
 
13
13
  interface AdminEnhancedModel {
14
- ${m([...p,...c],e=>`readonly $${e}: Admin.$${e}`)}
14
+ ${m([...p,...y],e=>`readonly $${e}: Admin.$${e}`)}
15
15
  }
16
16
 
17
17
  interface ApplicationTypes {
@@ -36,7 +36,7 @@ ${m([...p,...c],e=>`readonly $${e}: Admin.$${e}`)}
36
36
  readonly AdminModel: AdminModel
37
37
  readonly AdminEnhancedModel: AdminEnhancedModel
38
38
  readonly ApplicationTypes: ApplicationTypes
39
- }`)].filter(Boolean).join("\n\n"),D=(e,a)=>e.replaceAll("\n",`
39
+ }`)].filter(Boolean).join("\n\n"),T=(e,a)=>e.replaceAll("\n",`
40
40
  ${a}`);return`${e("globals.d.ts","Global type declarations for the phx namespace, env configs and domain types.")}
41
41
  /* eslint-disable @typescript-eslint/triple-slash-reference, @typescript-eslint/consistent-type-imports */
42
42
  /// <reference types="@salsita-ai/sdk/globals" />
@@ -51,10 +51,10 @@ ${a}`);return`${e("globals.d.ts","Global type declarations for the phx namespace
51
51
 
52
52
  ${f.toTypeOnlyString(".phoenix/globals.d.ts")}
53
53
 
54
- ${g.declarations}
54
+ ${S.declarations}
55
55
 
56
56
  declare global {
57
- ${S}
57
+ ${g}
58
58
 
59
59
  interface PhxGlobal {
60
60
  readonly frontendEnv: import('./frontend.config.js').RuntimeConfig
@@ -78,13 +78,22 @@ ${S}
78
78
  readonly AdminNavigationState: EnumLike<AdminNavigationState>
79
79
  }
80
80
 
81
- readonly domain: ${D(g.domainType," ")}
81
+ readonly domain: ${T(S.domainType," ")}
82
82
 
83
- readonly frontend: ${g.configuratorInterfaceType} & {
84
- readonly admin: ${g.adminInterfaceType}
83
+ readonly access: {
84
+ readonly createChunkScopesHandler: TypedCreateChunkScopesHandler<SessionData>
85
+ readonly createVisitorHandler: TypedCreateVisitorHandler<SessionData>
86
+ readonly createSignedInHandler: TypedCreateSignedInHandler<SessionData>
87
+ readonly createCodeHandler: TypedCreateCodeHandler<SessionData>
88
+ readonly createRefreshHandler: TypedCreateRefreshHandler<SessionData>
89
+ readonly createAnonymousHandler: TypedCreateAnonymousHandler<SessionData>
85
90
  }
86
91
 
87
- readonly webhooks: ${D(g.webhooksType," ")}
92
+ readonly frontend: ${S.configuratorInterfaceType} & {
93
+ readonly admin: ${S.adminInterfaceType}
94
+ }
95
+
96
+ readonly webhooks: ${T(S.webhooksType," ")}
88
97
  }
89
98
  }
90
99
  `};
@@ -38,7 +38,7 @@ export { generateApplicationSpecHtmlAdminIndex } from './html-admin-index.js';
38
38
  export { type PageExperience, generateApplicationSpecHtmlIndex } from './html-index.js';
39
39
  export { generateLinguiRcFile } from './lingui-rc.js';
40
40
  export { generatePhoenixSkillBundle } from './skills/phoenix-skill-bundle.js';
41
- export { type PhoenixSkillOptions, followsCanaryBuilds } from './skills/processes/index.js';
41
+ export { type PhoenixSkillOptions, followsCanaryBuilds } from './skills/sdk-channel.js';
42
42
  export { generateApplicationSpecPrettierConfig } from './prettier-config.js';
43
43
  export { generateApplicationSpecRobotsTxt } from './robots-txt.js';
44
44
  export { generateApplicationSpecRootTsconfig } from './root-tsconfig.js';
@@ -1 +1 @@
1
- export{stripSdkMarkerContent}from"./common/strip-sdk-marker-content.js";export{generateApplicationSpecAdminConfig}from"./admin-config.js";export{generateApplicationSpecAdminCode}from"./admin-domain-code.js";export{generateApplicationSpecAdminFrontendCode}from"./admin-frontend-code.js";export{generateAdminGlobalBindingBlock,generateApplicationSpecAdminGlobals}from"./admin-globals.js";export{generateApplicationSpecTypesModule}from"./application-types.js";export{generateApplicationSpecAdminFile}from"./admin.js";export{generateApplicationSpecConfiguratorConfig}from"./configurator-config.js";export{generateApplicationSpecConfiguratorCode}from"./configurator-domain-code.js";export{generateApplicationSpecConfiguratorFrontendCode}from"./configurator-frontend-code.js";export{generateApplicationSpecConfiguratorGlobals,generateConfiguratorGlobalBindingBlock}from"./configurator-globals.js";export{generateApplicationSpecConfiguratorFile}from"./configurator.js";export{generateApplicationSpecDomainSpecFile}from"./domain-spec.js";export{generateImportedStateConstants,generatePhxExportsBlock,generatePhxGlobalsBlock,generateStateConstants}from"./domain-spec/index.js";export{generateApplicationSpecDomainFile}from"./domain.js";export{generateApplicationSpecEditorFile}from"./editor.js";export{generateApplicationSpecEmbeddedAdmin}from"./embedded-admin.js";export{generateApplicationSpecEmbeddedConfigurator}from"./embedded-configurator.js";export{generateApplicationSpecEslintConfig}from"./eslint-config.js";export{generateApplicationSpecFavicon}from"./favicon.js";export{generateApplicationSpecFrontendConfig}from"./frontend-config.js";export{generateApplicationSpecGitignore}from"./gitignore.js";export{generateApplicationSpecGlobals}from"./globals.js";export{generateApplicationSpecHtmlAdminIndex}from"./html-admin-index.js";export{generateApplicationSpecHtmlIndex}from"./html-index.js";export{generateLinguiRcFile}from"./lingui-rc.js";export{generatePhoenixSkillBundle}from"./skills/phoenix-skill-bundle.js";export{followsCanaryBuilds}from"./skills/processes/index.js";export{generateApplicationSpecPrettierConfig}from"./prettier-config.js";export{generateApplicationSpecRobotsTxt}from"./robots-txt.js";export{generateApplicationSpecRootTsconfig}from"./root-tsconfig.js";export{generateApplicationSpecStoryDevDeclaration,generateApplicationSpecStoryPhxModule,generateApplicationSpecStoryRawProjectFiles,generateApplicationSpecStoryWrapper}from"./story/index.js";export{generateApplicationSpecCodeFile}from"./spec-code/index.js";export{generateApplicationSpecMessagesFile}from"./spec-messages/index.js";export{generateApplicationSpecTsconfig}from"./tsconfig.js";export{generateApplicationSpecWebhookBuilders}from"./webhook-builders.js";export{generateApplicationSpecWebhookIndex}from"./webhook-index.js";export{generateApplicationSpecWebhooksConfig}from"./webhooks-config.js";
1
+ export{stripSdkMarkerContent}from"./common/strip-sdk-marker-content.js";export{generateApplicationSpecAdminConfig}from"./admin-config.js";export{generateApplicationSpecAdminCode}from"./admin-domain-code.js";export{generateApplicationSpecAdminFrontendCode}from"./admin-frontend-code.js";export{generateAdminGlobalBindingBlock,generateApplicationSpecAdminGlobals}from"./admin-globals.js";export{generateApplicationSpecTypesModule}from"./application-types.js";export{generateApplicationSpecAdminFile}from"./admin.js";export{generateApplicationSpecConfiguratorConfig}from"./configurator-config.js";export{generateApplicationSpecConfiguratorCode}from"./configurator-domain-code.js";export{generateApplicationSpecConfiguratorFrontendCode}from"./configurator-frontend-code.js";export{generateApplicationSpecConfiguratorGlobals,generateConfiguratorGlobalBindingBlock}from"./configurator-globals.js";export{generateApplicationSpecConfiguratorFile}from"./configurator.js";export{generateApplicationSpecDomainSpecFile}from"./domain-spec.js";export{generateImportedStateConstants,generatePhxExportsBlock,generatePhxGlobalsBlock,generateStateConstants}from"./domain-spec/index.js";export{generateApplicationSpecDomainFile}from"./domain.js";export{generateApplicationSpecEditorFile}from"./editor.js";export{generateApplicationSpecEmbeddedAdmin}from"./embedded-admin.js";export{generateApplicationSpecEmbeddedConfigurator}from"./embedded-configurator.js";export{generateApplicationSpecEslintConfig}from"./eslint-config.js";export{generateApplicationSpecFavicon}from"./favicon.js";export{generateApplicationSpecFrontendConfig}from"./frontend-config.js";export{generateApplicationSpecGitignore}from"./gitignore.js";export{generateApplicationSpecGlobals}from"./globals.js";export{generateApplicationSpecHtmlAdminIndex}from"./html-admin-index.js";export{generateApplicationSpecHtmlIndex}from"./html-index.js";export{generateLinguiRcFile}from"./lingui-rc.js";export{generatePhoenixSkillBundle}from"./skills/phoenix-skill-bundle.js";export{followsCanaryBuilds}from"./skills/sdk-channel.js";export{generateApplicationSpecPrettierConfig}from"./prettier-config.js";export{generateApplicationSpecRobotsTxt}from"./robots-txt.js";export{generateApplicationSpecRootTsconfig}from"./root-tsconfig.js";export{generateApplicationSpecStoryDevDeclaration,generateApplicationSpecStoryPhxModule,generateApplicationSpecStoryRawProjectFiles,generateApplicationSpecStoryWrapper}from"./story/index.js";export{generateApplicationSpecCodeFile}from"./spec-code/index.js";export{generateApplicationSpecMessagesFile}from"./spec-messages/index.js";export{generateApplicationSpecTsconfig}from"./tsconfig.js";export{generateApplicationSpecWebhookBuilders}from"./webhook-builders.js";export{generateApplicationSpecWebhookIndex}from"./webhook-index.js";export{generateApplicationSpecWebhooksConfig}from"./webhooks-config.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The options the generated code passes to the Studio-account sign-in pages: the spec's page title names the project
3
+ * on them; without one they take none and say "this configurator".
4
+ */
5
+ export declare const generateSignInPageOptions: (pageTitle: string | undefined) => string;
@@ -0,0 +1 @@
1
+ export const generateSignInPageOptions=e=>e?`{ projectName: ${JSON.stringify(e)} }`:"";
@@ -1,2 +1,3 @@
1
1
  import { type PhoenixGuide } from '../guide.js';
2
- export declare const generatePhoenixCliCore: () => PhoenixGuide;
2
+ import { type PhoenixSkillOptions } from '../sdk-channel.js';
3
+ export declare const generatePhoenixCliCore: ({ checkLatestCanary }: PhoenixSkillOptions) => PhoenixGuide;
@@ -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` authorizes the CLI across currently permitted Builder projects; set an explicit project slug in the spec for dev and deploy. `phoenix whoami` shows current access. The legacy `phoenix login <workspace>` form keeps workspace-bound credentials. For CI deploys, the owner creates a deploy-only token in Studio for one project or 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. Token scope intersects current owner grants. 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` 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";import{LATEST_CANARY_SECTION as t}from"../sdk-channel.js";export const generatePhoenixCliCore=({checkLatestCanary:n})=>e({path:"core/cli.md",title:"CLI",summary:`${n?"keeping the SDK on the newest canary, ":""}tooling, identity, project structure and ownership, local development and deployment`,sections:[...n?[t]:[],"## 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-build 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. 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 the sign-in of the access mode alone; `access: custom` without it or a sign-in handler file 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, loaded through [`getResourceUrl`](../features/embedding.md#public-files-go-through-getresourceurl); `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 hosted preview replaces a changed schema, but promotion is refused when the model changed under a version production serves; [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## 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."]});
@@ -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
 
@@ -35,4 +35,4 @@ export default phx.frontend.createOnPresetLoadedHandler(() => {
35
35
  ),
36
36
  }
37
37
  })
38
- \`\`\``;export const generatePhoenixPresetsFeature=()=>e({path:"features/application-states/presets.md",title:"Presets",summary:"Starting configurations from the spec or Admin, keeping them valid, adjusting them at runtime and the route back to the preset screen; read when defining how a configuration starts.",whenToUse:"Read when defining the configurations users start from, changing a preset's entities at runtime before the configuration is created, or adding a way back to the preset screen. The preset screen itself, its cards and categories, belongs to [Project pages](../custom-layout/pages.md).",capabilities:"### Choose where presets come from\n\n- **Spec presets** — `presets:` in any configurator YAML file in `spec/`; the lists of several files are concatenated in file order. Use them for starting points that ship with the code.\n- **Admin presets** — `$adminPages: { presets: true }` in an Admin spec file (`$admin: true`) adds preset category pages to Project Admin. Once categories with presets are published, the preset screen shows them **instead of** the spec presets. Use them when the client's team curates starting points, with categories and thumbnails, without a deployment.\n- **How many** — with one preset, Phoenix creates the configuration at once and shows no preset screen; with several, users choose. The host can narrow the list to presets with matching `tags` through its `presetTags` property; a single match also skips the screen.\n- **Preset or recipe** — a preset is a whole starting configuration, created once; a recipe adds or replaces entities inside an open one. Offer the product variants users start from as presets and the parts they add while configuring as recipes.\n\n### Keep a preset valid\n\n- `rootEntityType` names a member of the `RootEntity` alias, and `initialDomainEntities` contains exactly one entity of that type.\n- Each entity has `id`, `type` and its attributes. Name ids `<Type>-<n>` (`Base-1`): an id whose text before the last dash is not the entity's type is an error.\n- Parsing the spec checks the types, the attribute schemas, references and relation cardinalities, and that every entity hangs from the root through `composedOf` relations, with one parent and no cycles.\n- Parsing does not check invariants. A configuration that opens with a `fatal` or `fixable` violation gets one repair pass from the transformers; if it is still invalid, it does not load. Open each preset in the preview; severities and repair are in [Validation and repair](../domain-model/validation-and-repair.md).\n- Display fields are optional plain strings (`$msg` is not accepted): `name`, `description`, `img` (a public path such as `/presets/compact.png` for `public/presets/compact.png`), `imgAlt`, `detailTitle`, `detailDescription`, plus the `tags` list. Without `name` the screen shows a generated label, so always set one.\n\n### Adjust the entities when a preset is chosen\n\n- Default-export `phx.frontend.createOnPresetLoadedHandler(() => ({ handler: async entities => entities }))` from a file in `src/handlers/`. After users pick a preset, spec or Admin, Phoenix migrates its entities to the current model, passes them to `handler` and creates the configuration from the list it returns. Return every entity, valid as a preset must be.\n- The outer function is a React hook that runs above the configuration: published, frontend and backend data and the session are available (`phx.frontend.useFrontendData()`, `phx.frontend.useSession()`), configuration hooks are not.\n- Use it for values known only at runtime, such as the host's region or the session's role. Differences known in advance belong in separate presets.\n\n### Route back to the preset screen\n\n- `phx.frontend.useConfiguratorRouting()` (beta) returns the routing service: `goToIndex()` leaves the configuration for the preset screen, `goToConfigurationDetail(configurationId, accessToken?)` opens another configuration.\n- A project layout's \"Start over\" or \"Other products\" action calls `goToIndex()`. Offer it only with more than one preset (the `presetCategories` of `phx.frontend.usePresetSelection()`). Saving is debounced by three seconds, so outside read mode save first, as the built-in back button does: take `configurationPersistSystem` from `phx.frontend.useDomainApplication()` and await its `save()`.\n- `phx.frontend.createOnGoToIndexHandler(() => ({ handler: ({ next }) => { … } }))`, default-exported from `src/handlers/`, intercepts every `goToIndex()`: the built-in back and previous-step buttons and a change of `presetTags` included. Call `next()` to continue; return without calling it to stay. Use it to confirm leaving or to send users to the host's product page instead. Its hook runs in the routing provider, outside the configuration.",example:t,documentation:'Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/application-states.mdx`, section Presets — the basic YAML shape and `tags`.\n- `docs/phoenix/integration/preset-tags-external.mdx` — narrowing presets from the host.\n- `docs/ux-guidelines/presets.mdx` — a flat gallery or categories, and thumbnails.\n- `docs/layouts/preview/auto-presets.mdx` — the preview start screen before the presets, set with the top-level `preview:` and `alwaysExpand:` keys.\n- `docs/phoenix/configurator-interface.mdx` — "Data Handlers": both handler factories.',phxMembers:["frontend.createOnPresetLoadedHandler","frontend.createOnGoToIndexHandler","frontend.useConfiguratorRouting"]});
38
+ \`\`\``;export const generatePhoenixPresetsFeature=()=>e({path:"features/application-states/presets.md",title:"Presets",summary:"Starting configurations from the spec or Admin, keeping them valid, adjusting them at runtime and the route back to the preset screen; read when defining how a configuration starts.",whenToUse:"Read when defining the configurations users start from, changing a preset's entities at runtime before the configuration is created, or adding a way back to the preset screen. The preset screen itself, its cards and categories, belongs to [Project pages](../custom-layout/pages.md).",capabilities:"### Choose where presets come from\n\n- **Spec presets** — `presets:` in any configurator YAML file in `spec/`; the lists of several files are concatenated in file order. Use them for starting points that ship with the code.\n- **Admin presets** — `$adminPages: { presets: true }` in an Admin spec file (`$admin: true`) adds preset category pages to Project Admin. Once categories with presets are published, the preset screen shows them **instead of** the spec presets. Use them when the client's team curates starting points, with categories and thumbnails, without a deployment.\n- **How many** — with one preset, Phoenix creates the configuration at once and shows no preset screen; with several, users choose. The host can narrow the list to presets with matching `tags` through its `presetTags` property; a single match also skips the screen.\n- **Preset or recipe** — a preset is a whole starting configuration, created once; a recipe adds or replaces entities inside an open one. Offer the product variants users start from as presets and the parts they add while configuring as recipes.\n\n### Keep a preset valid\n\n- `rootEntityType` names a member of the `RootEntity` alias, and `initialDomainEntities` contains exactly one entity of that type.\n- Each entity has `id`, `type` and its attributes. Name ids `<Type>-<n>` (`Base-1`): an id whose text before the last dash is not the entity's type is an error.\n- Parsing the spec checks the types, the attribute schemas, references and relation cardinalities, and that every entity hangs from the root through `composedOf` relations, with one parent and no cycles.\n- Parsing does not check invariants. A configuration that opens with a `fatal` or `fixable` violation gets one repair pass from the transformers; if it is still invalid, it does not load. Open each preset in the preview; severities and repair are in [Validation and repair](../domain-model/validation-and-repair.md).\n- Display fields are optional plain strings (`$msg` is not accepted): `name`, `description`, `img` (a public path such as `/presets/compact.png` for `public/presets/compact.png`; the SDK resolves it, while code that loads a public file itself goes through `getResourceUrl` as [Embedding](../embedding.md#public-files-go-through-getresourceurl) shows), `imgAlt`, `detailTitle`, `detailDescription`, plus the `tags` list. Without `name` the screen shows a generated label, so always set one.\n\n### Adjust the entities when a preset is chosen\n\n- Default-export `phx.frontend.createOnPresetLoadedHandler(() => ({ handler: async entities => entities }))` from a file in `src/handlers/`. After users pick a preset, spec or Admin, Phoenix migrates its entities to the current model, passes them to `handler` and creates the configuration from the list it returns. Return every entity, valid as a preset must be.\n- The outer function is a React hook that runs above the configuration: published, frontend and backend data and the session are available (`phx.frontend.useFrontendData()`, `phx.frontend.useSession()`), configuration hooks are not.\n- Use it for values known only at runtime, such as the host's region or the session's role. Differences known in advance belong in separate presets.\n\n### Route back to the preset screen\n\n- `phx.frontend.useConfiguratorRouting()` (beta) returns the routing service: `goToIndex()` leaves the configuration for the preset screen, `goToConfigurationDetail(configurationId, accessToken?)` opens another configuration.\n- A project layout's \"Start over\" or \"Other products\" action calls `goToIndex()`. Offer it only with more than one preset (the `presetCategories` of `phx.frontend.usePresetSelection()`). Saving is debounced by three seconds, so outside read mode save first, as the built-in back button does: take `configurationPersistSystem` from `phx.frontend.useDomainApplication()` and await its `save()`.\n- `phx.frontend.createOnGoToIndexHandler(() => ({ handler: ({ next }) => { … } }))`, default-exported from `src/handlers/`, intercepts every `goToIndex()`: the built-in back and previous-step buttons and a change of `presetTags` included. Call `next()` to continue; return without calling it to stay. Use it to confirm leaving or to send users to the host's product page instead. Its hook runs in the routing provider, outside the configuration.",example:t,documentation:'Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/application-states.mdx`, section Presets — the basic YAML shape and `tags`.\n- `docs/phoenix/integration/preset-tags-external.mdx` — narrowing presets from the host.\n- `docs/ux-guidelines/presets.mdx` — a flat gallery or categories, and thumbnails.\n- `docs/layouts/preview/auto-presets.mdx` — the preview start screen before the presets, set with the top-level `preview:` and `alwaysExpand:` keys.\n- `docs/phoenix/configurator-interface.mdx` — "Data Handlers": both handler factories.',phxMembers:["frontend.createOnPresetLoadedHandler","frontend.createOnGoToIndexHandler","frontend.useConfiguratorRouting"]});
@@ -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]};
@@ -1,3 +1,3 @@
1
1
  import { type PhoenixGuide } from '../../guide.js';
2
2
  /** What a project adds to the assistant panel: its form elements, its greeting and starters, and drawings. */
3
- export declare const generatePhoenixAssistantFeature: () => PhoenixGuide;
3
+ export declare const generatePhoenixAssistantPanelFeature: () => PhoenixGuide;
@@ -0,0 +1,42 @@
1
+ import{createPhoenixFeatureGuide as e}from"../../guide.js";let t=`The desk greets with what it can do and offers two requests. It asks for the delivery date with an element of its own, because no built-in element picks a date:
2
+
3
+ \`\`\`yaml
4
+ # spec/assistant-panel.yaml
5
+ components:
6
+ Desk:
7
+ assistantGreeting:
8
+ main:
9
+ message:
10
+ $msg: Hi! I can help you design this desk. Ask me about its size, finishes, drawers and price.
11
+ starters:
12
+ - title:
13
+ $msg: Add two drawers
14
+ - title:
15
+ $msg: Compare the finishes
16
+ reply:
17
+ $msg: Show me the desk in each leg finish and tell me what each costs.
18
+
19
+ assistant:
20
+ formElements:
21
+ deliverydate:
22
+ description: >-
23
+ A calendar from which the user picks the delivery date. Offer it when you need the date,
24
+ instead of asking the user to type it. It answers with the date as YYYY-MM-DD.
25
+ role: input
26
+ state:
27
+ type: string
28
+ \`\`\`
29
+
30
+ \`\`\`tsx
31
+ // src/elements/DeliveryDate.tsx
32
+ export default phx.frontend.createAssistantFormElement('deliverydate', ({ state, disabled, onChange }) => (
33
+ <input
34
+ type="date"
35
+ value={state ?? ''}
36
+ disabled={disabled}
37
+ onChange={event => onChange(event.target.value, event.target.value)}
38
+ />
39
+ ))
40
+ \`\`\`
41
+
42
+ The name types the props from the declaration, as does the global \`AssistantFormElementProps<'deliverydate'>\` for a component declared apart. \`onChange\` takes the value to keep and the words the answer shows in the chat.`;export const generatePhoenixAssistantPanelFeature=()=>e({path:"features/assistant/panel.md",title:"Panel",summary:"Where the panel shows, its greeting and starters, the project's own form elements, and drawings; read when the assistant should show, greet, ask or draw in the project's own way.",whenToUse:"Read when a project layout must show the assistant, when it should greet configurator users in their words, or when it needs a way of asking the built-in form elements lack.",capabilities:"The panel is the SDK's and works with nothing configured. A project decides where it shows and how it greets, and adds a form element only for a question the built-in ones cannot ask.\n\n- **Where it shows** — the 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)). A project that declares its own toolbar adds `assistantToolbarButton` to it; the default toolbar has it. Settle both first: without them nobody can open the assistant.\n- **Greeting and starters** — a root `assistantGreeting` component sets the message of an empty thread and its `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 make each starter a request the product's users really make. A project thread reads both through `useAssistantThread`.\n- **Form elements** — the assistant asks with forms: buttons, a number, a line of text, a yes or no, and tiles that show recipes and options with the picture or color the configurator has for them. Add a project element only for a way of choosing none of these fit, such as a date, a searchable palette or a picker on a floor plan. Declare it under `assistant.formElements.<name>` and register its component with `phx.frontend.createAssistantFormElement`; one without the other stops the application at start. The model knows the element only by its `description`, so say there what it is, when to offer it and what the answer looks like.\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.\n- **Leaving parts out** — `assistant.features` turns off `drawings`, `forms`, `images` (attaching photos) or `annotations`, each on by default. An off part loses its control in the panel and its lines in the assistant's prompt; `images` drops its lines only together with `annotations`. Turn off what the product has no use for.",example:t,documentation:'Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/assistant/the-panel.mdx` — where the panel shows, the greeting, the built-in and the project\'s form elements with their roles and attributes, pictures and annotations, voice, the theme names, and leaving parts of the panel out.\n- `docs/phoenix/configurator-interface.mdx` — "Assistant" for the thread, composer and panel hooks of a project layout.',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,55 @@
1
+ import{createPhoenixFeatureGuide as e}from"../../guide.js";let t=`A desk configurator, after the survey of how its UI changes the configuration. Each comment names the UI path the entry stands for:
2
+
3
+ \`\`\`yaml
4
+ # spec/assistant.yaml
5
+ assistant:
6
+ instructions: |
7
+ This configurator designs an office desk: its width, the finish of its legs and the drawers under its top.
8
+ Its users furnish their own office and are not furniture experts. Keep answers short and name parts as the UI does.
9
+ Before you remove a drawer, say which one and ask.
10
+ ai:
11
+ provider: openai
12
+ model: balanced
13
+ reasoning: low
14
+ entities:
15
+ Desk:
16
+ width:
17
+ description: Width of the desk top in millimeters, along X
18
+ legFinish:
19
+ description: Finish of the legs
20
+ $price: # computed, so an expression and not an action
21
+ description: Price of the desk as configured, in euros
22
+ $drawers:
23
+ description: The drawers under the top, left to right
24
+ Drawer:
25
+ height:
26
+ description: Height of the drawer front in millimeters
27
+ writable:
28
+ Desk:
29
+ width: # a plain field behind a slider
30
+ legFinish: # a custom control writes it, so the choices come from an instance no layout shows
31
+ options:
32
+ componentType: attributeSelection
33
+ instanceName: assistantLegFinish
34
+ childRecipes:
35
+ Desk:
36
+ drawers: # the recipe control the UI already has
37
+ description: Drawers that fit under the desk top
38
+ deletable:
39
+ Drawer: # the delete button of a selected drawer
40
+ actions:
41
+ moveDrawer: # the arrow buttons reorder drawers, which is neither a write nor a recipe
42
+ screenshots:
43
+ Desk:
44
+ front:
45
+ description: The whole desk from the front. Use it to check the order and the fit of the drawers.
46
+
47
+ components:
48
+ Desk:
49
+ attributeSelection:
50
+ assistantLegFinish:
51
+ value:
52
+ $bind: legFinish
53
+ options:
54
+ $read: $legFinishOptions
55
+ \`\`\``;export const generatePhoenixAssistantReadingAndChangingFeature=()=>e({path:"features/assistant/reading-and-changing.md",title:"Reading and changing",summary:"Which way each change takes, with writes, recipes and deletions before actions, and how to make the section easy for a model to use; 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:"The SDK docs at the end explain each key this guide touches and show the schema the assistant gets for it; [Panel](panel.md) and [Session setup](session-setup.md) name theirs. This guide covers what they leave to the project: which way each change takes, and how to make the section easy for a model to use.\n\n### 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\nThe standard ways are a read under `entities`, a write under `writable`, the UI's recipe instances under `childRecipes` and `replaceRecipes`, and a deletion under `deletable`. A computed read, such as a price or a catalog summary, is an expression, not an action.\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\n### When an action is right\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, 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. When transformers move or repair what the action changed, return those entities, so the assistant sees the outcome without another query. Leave `result` out when there is nothing to report.\n\n### Make the section easy to use\n\n- **Descriptions** — describe entries in the client's product terms, with unit and axis. Take axes from the placement code, not from field names.\n- **Typed values** — a `tsType` reaches the assistant as opaque `JSON`. First replace the `tsType` with a JSON Schema shape, when the schema can say the same without loss. Only when it cannot, add a second expression that projects the value for the assistant. 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.\n- **Option lists** — a writable field takes its choices from the control that writes it. For a field that a custom control writes, add a `materialSwatch`, `attributeSelection` or `distanceDimensionSelect` instance no layout shows, and name it under `options`. Mark lists that never change with `hints: [sameForAllInstances, constantDuringSession]`, so the assistant reads them once.\n- **Lenses** — add one for each part of the configuration the assistant often reads as a whole, and keep `maxDepth` low.\n- **Screenshots** — give the assistant its own camera, filtered on the screenshot's `exportState` and framing the product. Compute `width` and `height` from the product's extent, and hide what covers the parts it must check, such as a roof. Say in each `description` what the view is good for checking.\n- **Instructions** — say in a few sentences what the product is, who its users are and how the assistant should behave with them. Then add only the rules the schema cannot say, such as values written together. Do not use an instruction to patch a weak description or a missing expression. Visitors can read them.\n- **Model** — `ai` is required, in exactly one spec file. Its `model` tier and `reasoning` level set cost and quality, so let the client choose them. Raise `ai.maxToolCallsPerMessage` for requests that take many steps, and `ai.maxThreadSize` for long design conversations.",example:t,documentation:"Read with `pnpm phoenix docs -r <path>`. Each page shows the YAML and the schema the assistant gets for it:\n\n- `docs/phoenix/assistant/overview.mdx` — how the pieces connect, and the smallest working section. Read it first.\n- `docs/phoenix/assistant/reading-the-configuration.mdx` — fields, expressions and relations, several root types, lenses, and `navigation`.\n- `docs/phoenix/assistant/changing-the-configuration.mdx` — writable fields, option lists and their hints, recipes, deletions, and dry runs.\n- `docs/phoenix/assistant/actions.mdx` — exposing an action, its inputs, results and errors.\n- `docs/phoenix/assistant/screenshots.mdx` — the screenshot component, its limits and framing.\n- `docs/phoenix/assistant/instructions-and-ai-settings.mdx` — `instructions`, every `ai` key with its default and limit, and what happens when the setup changes.\n- `docs/phoenix/assistant/security-and-limits.mdx` — what visitors can read, bans and usage caps.",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;
@@ -0,0 +1,16 @@
1
+ import{createPhoenixFeatureGuide as e}from"../../guide.js";let s=`The assistant of an anonymous visitor cannot change the finish and runs on a cheaper model:
2
+
3
+ \`\`\`ts
4
+ // src/handlers/assistant-setup.ts
5
+ export default phx.domain.createAssistantSetupHandler((manifest, { role }) => {
6
+ if (role !== 'anonymous') {
7
+ return manifest
8
+ }
9
+
10
+ const { finish, ...chairWrites } = manifest.writable.Chair ?? {}
11
+ const narrowed = { ...manifest, writable: { ...manifest.writable, Chair: chairWrites } }
12
+
13
+ // The browser's manifest has no \`ai\`; only the webhook's run decides the model
14
+ return manifest.ai ? { ...narrowed, ai: { ...manifest.ai, model: 'fast' } } : narrowed
15
+ })
16
+ \`\`\``;export const generatePhoenixAssistantSessionSetupFeature=()=>e({path:"features/assistant/session-setup.md",title:"Session setup",summary:"Narrowing what the assistant may see and change per session, or switching it off; read when it must behave differently by role, session data or access.",whenToUse:"Read when the assistant must offer less to some sessions, such as anonymous visitors or a role that must not see prices, run on other AI settings for them, or be off.",capabilities:"- **Where it lives** — default-export `phx.domain.createAssistantSetupHandler((manifest, { role, sessionData, access }) => manifest)` from one file in `src/handlers/`. It joins the webhook automatically, so it imports only server-safe modules ([Webhook entry and environment](../webhooks/entry-and-environment.md)). `role` and `sessionData` come from [authentication](../webhooks/authentication.md); `access` is how the configuration was opened, such as `o` for its owner.\n- **It only takes away** — `manifest` is what the `assistant` section declares. Spread it and override what changes: leave out an entry to hide it, set a section to `{}` to clear it, change a `description`, replace `instructions`, or set `webmcp: false`. `ai.voice` and a `features` flag can only be set to `false`: a session gets voice or a part of the panel only when the spec has it on. Leave a project form element out of `formElements` together with the ability it serves. Return `null` to switch the assistant off. The buttons that open the panel follow the spec, not the handler, so hide them per session in the layout, for example with `$filter`.\n- **It runs in two places** — in the webhook and in the browser, and both must reach the same manifest, so keep it synchronous, pure and deterministic. It ships to the browser, where visitors can read its rules: keep secrets out of it. A handler that throws leaves the assistant unavailable for the session.\n- **AI settings** — the handler can set any `ai` key for the session, `voice` only to `false`, such as a stronger `model` for signed-in users. Only the webhook's run decides them. In the browser the manifest has no `ai` and a returned one is ignored, so guard with `if (!manifest.ai)` and decide nothing else from it.\n- **Not for read-only sessions** — a configuration opened for viewing already refuses every real change, while what-if questions such as \"what would it cost in oak?\" still work. Clearing `writable` for viewers takes those answers away too.\n- **Caching** — deployed environments reuse a session's setup for up to 15 minutes; under `phoenix dev` the handler runs on every request.",example:s,documentation:"Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/assistant/per-session-setup.mdx` — what the handler receives and may return, taking abilities away, AI settings per session, and switching the assistant off.\n- `docs/phoenix/assistant/security-and-limits.mdx` — what a visitor can read, and what the assistant can be talked into.",phxMembers:["domain.createAssistantSetupHandler"]});
@@ -1,7 +1,7 @@
1
- import{createPhoenixIndexGuide as e}from"../../guide.js";import{generatePhoenixAssistantFeature as t}from"./assistant.js";import{generatePhoenixFinalizationActionsFeature as o}from"./finalization-actions.js";import{generatePhoenixMessagesFeature as s}from"./messages.js";import{generatePhoenixProjectPagesFeature as a}from"./pages.js";import{generatePhoenixSceneAndSafeAreaFeature as n}from"./scene-and-safe-area.js";import{generatePhoenixLayoutSlotsFeature as r}from"./slots.js";import{generatePhoenixTabsAndStepsFeature as i}from"./tabs-and-steps.js";import{generatePhoenixToolbarActionsFeature as d}from"./toolbar-actions.js";import{generatePhoenixViewModeFeature as l}from"./view-mode.js";let m=`A layout element registered as \`ConfiguratorLayout\` replaces everything Phoenix renders for a loaded configuration, in owner and in read mode, finalization included. It shows only what it composes.
1
+ import{createPhoenixIndexGuide as e}from"../../guide.js";import{generatePhoenixFinalizationActionsFeature as o}from"./finalization-actions.js";import{generatePhoenixMessagesFeature as t}from"./messages.js";import{generatePhoenixProjectPagesFeature as s}from"./pages.js";import{generatePhoenixSceneAndSafeAreaFeature as a}from"./scene-and-safe-area.js";import{generatePhoenixSignInFeature as n}from"./sign-in.js";import{generatePhoenixLayoutSlotsFeature as r}from"./slots.js";import{generatePhoenixTabsAndStepsFeature as i}from"./tabs-and-steps.js";import{generatePhoenixToolbarActionsFeature as d}from"./toolbar-actions.js";import{generatePhoenixViewModeFeature as l}from"./view-mode.js";let m=`A layout element registered as \`ConfiguratorLayout\` replaces everything Phoenix renders for a loaded configuration, in owner and in read mode, finalization included. It shows only what it composes.
2
2
 
3
3
  - YAML keeps the domain and the structure the layout reads: control components, in-scene anchors, tabs, steps, toolbar entries and finalize actions. The layout reads them through \`phx.frontend\` hooks, or mounts a built-in slot that reads them.
4
4
  - The spec does not describe the page: the layout draws its own panels and renders the project's control elements in them.
5
5
  - Start every layout from the skeleton in [Scene and safe area](scene-and-safe-area.md). Before adding a feature, read its guide below and use its spec and hook contracts. In particular, custom tabs and steps use [Tabs and steps](tabs-and-steps.md), not a parallel React navigation state.
6
6
  - Each feature is either a built-in slot ([Layout slots](slots.md)) or the layout's own UI over hooks, which the other guides cover. No hook enforces read mode, so [View mode](view-mode.md) applies to all of them.
7
- - The controls inside the layout's panels and on the product, their YAML components and React elements, belong to [Domain controls](../domain-controls/index.md); use [Scene controls](../domain-controls/scene-controls.md) for actions placed at positions on the product.`;export const generatePhoenixCustomLayoutGuides=()=>{let c=[n(),r(),i(),d(),s(),o(),l(),a(),t()];return[e({path:"features/custom-layout/index.md",title:"Custom project layout",summary:"The project's page-level UI: the `ConfiguratorLayout` element with its canvas, built-in slots, tabs and steps, toolbar, messages, finalization and read mode, the preset screen, loader and error pages, and what a project adds to the assistant panel; read when creating or changing a project layout, one of these pages or the assistant's form elements, greeting or drawings.",intro:m,guides:c,notes:[]}),...c]};
7
+ - The controls inside the layout's panels and on the product, their YAML components and React elements, belong to [Domain controls](../domain-controls/index.md); use [Scene controls](../domain-controls/scene-controls.md) for actions placed at positions on the product.`;export const generatePhoenixCustomLayoutGuides=()=>{let c=[a(),r(),i(),d(),t(),o(),l(),s(),n()];return[e({path:"features/custom-layout/index.md",title:"Custom project layout",summary:"The project's page-level UI: the `ConfiguratorLayout` element with its canvas, built-in slots, tabs and steps, toolbar, messages, finalization and read mode, the preset screen, loader and error pages; read when creating or changing a project layout or one of these pages.",intro:m,guides:c,notes:[]}),...c]};
@@ -0,0 +1,3 @@
1
+ import { type PhoenixGuide } from '../../guide.js';
2
+ /** The Studio-account sign-in in the browser: its pages, the account control and the hook a project's own builds on. */
3
+ export declare const generatePhoenixSignInFeature: () => PhoenixGuide;
@@ -0,0 +1,19 @@
1
+ import{createPhoenixFeatureGuide as e}from"../../guide.js";let n=`A toolbar that offers sign-in to visitors and names the dealer signed in:
2
+
3
+ \`\`\`tsx
4
+ // src/elements/Toolbar.tsx
5
+ import { AccountControl } from '@salsita-ai/sdk/extras/cognito'
6
+
7
+ const Toolbar = () => {
8
+ const { person } = phx.frontend.useSignIn()
9
+
10
+ return (
11
+ <header style={{ display: 'flex', justifyContent: 'space-between', padding: 8 }}>
12
+ <span>{person ? 'Dealer prices' : 'Retail prices'}</span>
13
+ <AccountControl />
14
+ </header>
15
+ )
16
+ }
17
+
18
+ export default phx.frontend.createCustomPhoenixLayoutElement('Toolbar', Toolbar)
19
+ \`\`\``;export const generatePhoenixSignInFeature=()=>e({path:"features/custom-layout/sign-in.md",title:"Sign-in pages and account control",summary:"The Studio-account sign-in in the browser: the built-in sign-in and access-denied pages, the account control of Public with sign-in, and `useSignIn` for a project's own; read when people sign in to the configurator or its admin.",whenToUse:"Read when the configurator or its admin signs people in with Studio accounts, when visitors should be able to sign in, or when a sign-in or access-denied page should carry the brand.",capabilities:"This guide applies in the Studio-account access modes, `invited`, `public-with-sign-in` and `public` ([Authentication](../webhooks/authentication.md)).\n\n### Built-in pages\n\n- Generated code registers them by itself: the configurator's sign-in page in `invited` and `public-with-sign-in`, the admin's in all three. The spec's `pageTitle` names the project on them.\n- Sign-in is a redirect to Studio's form, never a password field on the configurator's address. The page leaves straight away and shows its button after a sign-out, after a sign-in that did not finish, and when the sign-in is unavailable right now. In Studio's frame the pages and the control render nothing.\n- A refused account sees the access-denied page with \"Sign in with another account\", and with the account when the person is a member of the project's workspace; anyone else is refused without being named. It is refused when it is not invited, or when the project's signed-in handler returned `{ allow: false }`. The admin's tells a person without the Admin role so and offers the configurator.\n- Replace a page by default-exporting a registration from `src/elements/`:\n - `phx.frontend.createAccessDeniedPage(({ projectName }) => …)` — the configurator's access-denied page.\n - `phx.frontend.admin.createAccessDeniedAdminPage(({ projectName }) => …)` — the admin's, from `src/admin/elements/`.\n - `phx.frontend.createNotAuthenticatedPage(Component)` — the configurator's whole sign-in page ([Project pages](pages.md)).\n\n### Account control\n\n- In `public-with-sign-in` visitors use the configurator and sign in only by choice, so place `<AccountControl />` from `@salsita-ai/sdk/extras/cognito` in the layout, such as in its toolbar. Without it, or a control built on `useSignIn`, parsing reports `SIGN_IN_CONTROL_NOT_PLACED`.\n- A visitor sees Sign in. A signed-in person sees their name, or their email when their Studio account has no name, with a menu holding the email and Sign out. Sign out ends this configurator's sign-in, and the person continues as a visitor.\n- A sign-in that did not finish, or a refused account, leaves the person a visitor, and the control says so under its button. So does a sign-in that ends while the configurator is open (a sign-out elsewhere, removed access, its 30 days): the person continues as a visitor with the configuration on screen, and the control says they were signed out, with Sign in again. To show that note in the page instead, place `<SignInNotice />` and set `<AccountControl notice={false} />`.\n- A visitor who signs in comes back to the same configuration: signing in saves its latest change first.\n\n### useSignIn\n\n`phx.frontend.useSignIn()` returns `{ state, person, refusedAccount, failure, signedOut, hidden, signIn, signOut }`:\n\n- `state` — `idle`, `signing-in`, `refused`, `failed` or `ended` (the sign-in ended while the page was signed in, and the page continues as a visitor).\n- `person` — `{ email, name }` of the person signed in, `null` for a visitor; `name` is `null` when the account has none.\n- `refusedAccount` — with `refused`, the account the server named, `null` when it named none.\n- `failure` — with `failed`, `{ reason, message }`: `not-completed` when the person came back without being signed in, `unavailable` when trying again may help.\n- `signedOut` — the person signed out here; a sign-in page waits for a click.\n- `hidden` — render nothing: Studio's frame, or no server.\n- `signIn()` — saves the latest change and leaves for the form; after a sign-out or a refusal the form asks which account continues. `signIn({ anotherAccount: true })` asks it too while the person is signed in, for a \"Sign in with another account\" button. `signOut()` ends the sign-in.",example:n,documentation:"Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/sessions-and-access.mdx` — sessions, roles and the Studio-account sign-in.",phxMembers:["frontend.useSignIn","frontend.createAccessDeniedPage"]});