@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
@@ -61,4 +61,4 @@ const move = (delta: number) => {
61
61
  }
62
62
  }
63
63
  const left = move(-1) // <Button disabled={left.disabled} title={left.hints} onClick={left.update}>
64
- \`\`\``;export const generatePhoenixActionsFeature=()=>e({path:"features/domain-model/actions.md",title:"Actions",summary:"Named domain operations declared in YAML, prepared in `src/actions/` and run by controls or the assistant; read when one change touches several entities or the UI and the assistant must share it.",whenToUse:"Read when a change is more than writing one field — a move among siblings, a swap, a change to several entities at once — or when the UI and the assistant must make the same change under the same rule. A single bound field needs no action: bind it in YAML ([Components](components.md)).",capabilities:"### Declare\n\n- Declare actions under the top-level `actions:`, each with a `description`, `params` and `result`. Both maps are required; write `params: {}` for an action without parameters. Names are identifiers.\n- Each param and result member is a JSON schema with the shape syntax: `$ref: phx:...`, `references`, `tsType` and `import`. A param whose schema admits `null` is optional; the others are required.\n- `phx:DomainEntityId` with `references` types an id param; `phx:$DomainEntity` with `references` types a result member as the `$` entity after the change.\n- The descriptions become the doc comments of the generated `ActionParams<'name'>` and `ActionResult<'name'>` types and what the assistant reads about the action, so write them for both readers.\n- Only the configurator domain has actions; the admin domain has none.\n\n### Implement\n\n- Default-export `phx.frontend.implementActions({ name: (params, state, ctx) => ... })` from a file in `src/actions/`. A file may implement any subset of the declared actions.\n- `params` arrive validated against the declared schema; `state` is the state the action runs on.\n- `ctx.systems` holds the domain systems and the registered systems for this browser application slot (`systems.domain.get$Entity(id, state)`, `systems.domain.getRoot$Entity(state)`); `ctx.updates` is the typed update factory, `ctx.getIdSequence()` gives ids for created entities, and `ctx.expressionContext` is the expression context.\n- Return `{ updates, readResult }`: the updates to apply, and `readResult({ previousState, state })`, which reads the declared result from the state those updates produced, transformer changes included.\n- An action only prepares. It never stages or commits; its caller does.\n- Throw to reject a call, with a message that says what was wrong and what to send instead: users see it as the control's hint and the assistant as the failed mutation's error.\n- `references` types an id but any entity id passes validation, so check what the id names, for example with `phx.domain.model.Drawer.isId(id)` or by finding it in the parent's list.\n- A declared action without an implementation stops the application at start: `.phoenix/phoenix-dev.log` shows `Missing actions: <names>`, and the editor (`--editor`) the `MISSING_ACTION_IMPLEMENTATIONS` diagnostic; implementing an undeclared name is a type error. Nothing validates what `readResult` returns at runtime.\n- Actions currently execute in the browser, including assistant custom mutations. Built-in extensions such as `ctx.systems.sketchingSystem` are optional: check the value before using it and throw a clear message when the slot does not provide it. For a custom system, check its name with `in` and narrow its value with a local type guard.\n- Action implementations are registered only by the browser assembly. They may import browser systems; the webhook reads their declarations for the assistant schema without loading their implementation modules.\n- Read sketching projections from the supplied `state` and call `getLineLengthUpdates`, `getRectangleWidthUpdates`, `getRectangleDepthUpdates`, `getConnectionAngleUpdate` or `getMoveSketchingPointUpdates`. Do not use methods that read committed state, such as `prepareInitialDrawingUpdates`. Never stage, commit, roll back, or change drawing/camera state in an action: assistant operations can use a hypothetical working state.\n\n### Run from the UI\n\n- `phx.frontend.useConfigurator().actionSystem.prepareAction(name, args, state)` returns the prepared action for the committed state from `phx.frontend.useCommittedState()`.\n- Pass its `updates` to a function from `phx.frontend.useUpdateControl()`: it dry-runs them for `disabled` and `hints` and commits them on `update()`. [Custom controls](../domain-controls/custom-controls.md) owns that hook and the control around it.\n- `prepareAction` throws for an unknown name, arguments that do not fit and every rejection; catch it and show the message as the disabled control's hint.\n- The generated `useConfigurator().actionSystem` checks action names and arguments and preserves each action result type.\n\n### Expose to the assistant\n\n- List the action under `assistant.actions` to add it as a custom mutation; `as` renames the field and `description` replaces the action's. The mutation runs the same `prepareAction` and applies its updates with the same validation as every other change.",example:t,documentation:"Read `docs/other-features/domain-actions.mdx` with `pnpm phoenix docs -r docs/other-features/domain-actions.mdx`: declaring, implementing and running an action, with a complete control and the assistant schema. `docs/phoenix/domain-model.mdx` has no actions section.",phxMembers:["frontend.implementActions"]});
64
+ \`\`\``;export const generatePhoenixActionsFeature=()=>e({path:"features/domain-model/actions.md",title:"Actions",summary:"Named domain operations declared in YAML, prepared in `src/actions/` and run by controls or the assistant; read when one change touches several entities or the UI and the assistant must share it.",whenToUse:"Read when a change is more than writing one field — a move among siblings, a swap, a change to several entities at once — or when the UI and the assistant must make the same change under the same rule. A single bound field needs no action: bind it in YAML ([Components](components.md)).",capabilities:"### Declare\n\n- Declare actions under the top-level `actions:`, each with a `description`, `params` and an optional `result`. `params` is required; write `params: {}` for an action without parameters. Leave `result` out, or set it to `null`, when the action reports nothing: its `ActionResult<'name'>` is `void`. An empty `result: {}` is a spec error. Names are identifiers.\n- Each param and result member is a JSON schema with the shape syntax: `$ref: phx:...`, `references`, `tsType` and `import`. A param whose schema admits `null` is optional; the others are required.\n- `phx:DomainEntityId` with `references` types an id param; `phx:$DomainEntity` with `references` types a result member as the `$` entity after the change.\n- The descriptions become the doc comments of the generated `ActionParams<'name'>` and `ActionResult<'name'>` types and what the assistant reads about the action, so write them for both readers.\n- Only the configurator domain has actions; the admin domain has none.\n\n### Implement\n\n- Default-export `phx.frontend.implementActions({ name: (params, state, ctx) => ... })` from a file in `src/actions/`. A file may implement any subset of the declared actions.\n- `params` arrive validated against the declared schema; `state` is the state the action runs on.\n- `ctx.systems` holds the domain systems and the registered systems for this browser application slot (`systems.domain.get$Entity(id, state)`, `systems.domain.getRoot$Entity(state)`); `ctx.updates` is the typed update factory, `ctx.getIdSequence()` gives ids for created entities, and `ctx.expressionContext` is the expression context.\n- Return `{ updates, readResult }`: the updates to apply, and `readResult({ previousState, state })`, which reads the declared result from the state those updates produced, transformer changes included. An action without a `result` returns `{ updates }` only; a `readResult` there is a type error.\n- An action only prepares. It never stages or commits; its caller does.\n- Throw to reject a call, with a message that says what was wrong and what to send instead: users see it as the control's hint and the assistant as the failed mutation's error.\n- `references` types an id but any entity id passes validation, so check what the id names, for example with `phx.domain.model.Drawer.isId(id)` or by finding it in the parent's list.\n- A declared action without an implementation stops the application at start: `.phoenix/phoenix-dev.log` shows `Missing actions: <names>`, and the editor (`--editor`) the `MISSING_ACTION_IMPLEMENTATIONS` diagnostic; implementing an undeclared name is a type error. Nothing validates what `readResult` returns at runtime.\n- Actions currently execute in the browser, including assistant custom mutations. Built-in extensions such as `ctx.systems.sketchingSystem` are optional: check the value before using it and throw a clear message when the slot does not provide it. For a custom system, check its name with `in` and narrow its value with a local type guard.\n- Action implementations are registered only by the browser assembly. They may import browser systems; the webhook reads their declarations for the assistant schema without loading their implementation modules.\n- Read sketching projections from the supplied `state` and call `getLineLengthUpdates`, `getRectangleWidthUpdates`, `getRectangleDepthUpdates`, `getConnectionAngleUpdate` or `getMoveSketchingPointUpdates`. Do not use methods that read committed state, such as `prepareInitialDrawingUpdates`. Never stage, commit, roll back, or change drawing/camera state in an action: assistant operations can use a hypothetical working state.\n\n### Run from the UI\n\n- `phx.frontend.useConfigurator().actionSystem.prepareAction(name, args, state)` returns the prepared action for the committed state from `phx.frontend.useCommittedState()`.\n- Pass its `updates` to a function from `phx.frontend.useUpdateControl()`: it dry-runs them for `disabled` and `hints` and commits them on `update()`. [Custom controls](../domain-controls/custom-controls.md) owns that hook and the control around it.\n- `prepareAction` throws for an unknown name, arguments that do not fit and every rejection; catch it and show the message as the disabled control's hint.\n- The generated `useConfigurator().actionSystem` checks action names and arguments and preserves each action result type.\n\n### Expose to the assistant\n\n- List the action under `assistant.actions` to add it as a custom mutation; `as` renames the field and `description` replaces the action's. An action without a `result` becomes a mutation returning `Boolean!`, which is `true` once its changes apply; a failure is an error, never `false`. The mutation runs the same `prepareAction` and applies its updates with the same validation as every other change.",example:t,documentation:"Read `docs/other-features/domain-actions.mdx` with `pnpm phoenix docs -r docs/other-features/domain-actions.mdx`: declaring, implementing and running an action, with a complete control and the assistant schema. `docs/phoenix/domain-model.mdx` has no actions section.",phxMembers:["frontend.implementActions"]});
@@ -0,0 +1,2 @@
1
+ import { type PhoenixGuide } from '../guide.js';
2
+ export declare const generatePhoenixEmbeddingFeature: () => PhoenixGuide;
@@ -0,0 +1 @@
1
+ import{createPhoenixFeatureGuide as e}from"../guide.js";export const generatePhoenixEmbeddingFeature=()=>e({path:"features/embedding.md",title:"Embedding",summary:"Public files and origins of an embedded configurator; read when code loads from `public/` or before embedding.",whenToUse:"Read when project code loads a model, texture, environment, image or font from `public/`, when the client’s site sends a Content Security Policy, or before telling the client a project is ready to embed.",capabilities:"### Public files go through `getResourceUrl`\n\nAn embedded configurator runs inside the client's page, so a root-relative path such as `/models/chair.glb` resolves against that page's site, not the configurator's address, and the request fails. Every public file the project's own code loads goes through `useResourceUrl().getResourceUrl(path)` from `@salsita-ai/sdk/react`: it adds the configurator's address and the deployment, and returns the path unchanged in `phoenix dev`.\n\n```tsx\nimport { Environment, useGLTF, useTexture } from '@react-three/drei'\nimport { useResourceUrl } from '@salsita-ai/sdk/react'\n\nconst Showroom = () => {\n const { getResourceUrl } = useResourceUrl()\n const model = useGLTF(getResourceUrl('/models/chair.glb'))\n const wood = useTexture(getResourceUrl('/textures/oak.jpg'))\n const font = new FontFace('Brand', `url(${getResourceUrl('/fonts/brand.woff2')})`)\n\n return <Environment files={getResourceUrl('/hdri/studio.hdr')} />\n}\n\nconst Logo = () => <img src={useResourceUrl().getResourceUrl('/brand/logo.svg')} alt=\"Acme\" />\n```\n\n- Call the hook in a component, then pass the resolved URL to the loader. A path built by hand, or a full URL to the configurator's address, breaks in previews and after a custom domain is set.\n- Paths in the specification, such as a preset's `img` or a scene object's model, stay bare: the SDK resolves them itself. Only code that loads a file needs the call.\n\n### Origins an embedded configurator loads from\n\nA site with a Content Security Policy must allow each of these, or the configurator fails without a visible error:\n\n- the configurator's own address, its server and its storage, which differ per environment;\n- `https://www.gstatic.com/draco/` for the model decoder, `https://unpkg.com/detect-gpu@5.0.70/` for device detection, `https://fonts.gstatic.com` for fonts and `https://browser-intake-datadoghq.eu` for error reports;\n- `https://raw.githack.com` for the lighting of a preset canvas environment, the default one included. A scene with its own environment files (`<Environment files>` through `getResourceUrl`) does not need it.\n\nThe Embed page in Studio shows each environment's complete policy, filled in, under Content Security Policy. A strict policy also needs `jsonSchemaValidator: csp-compatible` and `gltfDecoder: js` in `spec/application.yaml`. `gltfDecoder` reaches only the SDK's own model loader: drei's `useGLTF` decodes Draco and Meshopt with WebAssembly, which a strict policy blocks, so load a compressed model through the specification instead.\n\n### Check it embedded before shipping\n\n`phoenix dev` serves the configurator from its own address, so a root-relative path works there and breaks only when embedded. Before telling the client the project is ready to embed:\n\n1. Deploy a hosted preview with `pnpm phoenix deploy`.\n2. Ask the client to add a local address, such as `http://localhost:5173`, to the preview's allowed sites on its Embed page in Studio.\n3. Serve a page with the preview's inline snippet from that address, for example from a folder in the scratch space with `npx serve -l 5173`.\n4. Open it and check the browser's network log: no request may go to `localhost:5173` for a project file, and the console shows no 404 or Content Security Policy error.",example:"A custom element shows the brand logo from `public/brand/logo.svg`. It renders `<img src={getResourceUrl('/brand/logo.svg')} />`, so the logo loads from the configurator’s address both on the hosted page and embedded on the client’s shop.",documentation:"Read `docs/phoenix/csp.mdx` with `pnpm phoenix docs -r docs/phoenix/csp.mdx` for a host page with a strict Content Security Policy, and `docs/phoenix/deployments.mdx` for environments and their addresses.",phxMembers:[]});
@@ -1 +1 @@
1
- import{createPhoenixIndexGuide as e}from"../guide.js";import{generatePhoenixApplicationStatesGuides as n}from"./application-states/index.js";import{generatePhoenixCustomLayoutGuides as o}from"./custom-layout/index.js";import{generatePhoenixDomainControlsGuides as t}from"./domain-controls/index.js";import{generatePhoenixDomainModelGuides as s}from"./domain-model/index.js";import{generatePhoenixInspectionFeature as i}from"./inspection.js";import{generatePhoenixLocalizationFeature as a}from"./localization.js";import{generatePhoenixSceneObjectsFeature as d}from"./scene-objects.js";import{generatePhoenixStateGuides as r}from"./state/index.js";import{generatePhoenixVariantsFeature as c}from"./variants.js";import{generatePhoenixWebhooksGuides as p}from"./webhooks/index.js";export const generatePhoenixFeatureGuides=()=>{let m=[s(),r(),n(),t(),o(),[a()],[d()],p(),[i()],[c()]];return[e({path:"features/index.md",title:"Features",summary:"What Phoenix capabilities support, their constraints and the canonical SDK documentation.",intro:"Read only the guide the task needs. Each guide teaches its part of the `phx` global and names the SDK documents to read with `pnpm phoenix docs -r <path>`; a link does not make its destination required reading.",guides:m.flatMap(e=>e.slice(0,1)),notes:["## Browse the SDK docs\n\n`pnpm phoenix docs` lists every category with its document count, `-c '<Category>'` shows one category's documents with descriptions and `-l` lists every path with its title. `-s '<text>'` matches literal text line by line, so search for one distinctive term, such as an API or YAML key, rather than a phrase.","## Topic map\n\nTopics no guide covers yet point straight to the canonical SDK docs.\n\n### Project and customization\n\n- `docs/phoenix/getting-started.mdx`, `docs/phoenix/quickstart.mdx` — setup and a complete worked configurator.\n- `docs/phoenix/best-practices.mdx` — supported composition and extension patterns.\n- `docs/phoenix/project-structure.mdx` — authored folders, generated files and naming rules.\n- `docs/phoenix/theming.mdx`, `docs/ux-guidelines/overview.mdx` — theme, branding and interaction principles.\n- The **3d scene**, **Drag & Drop**, **Performance** and **Complex Use Cases** categories — materials, lights, cameras, dragging and snapping, and worked combinations.\n\n### Data sources\n\n- `docs/phoenix/data-sources.mdx`, `docs/phoenix/connected-data-sources.mdx` — published, frontend, session and backend data, and connected sheets.\n\n### Admin and Studio\n\n- `docs/phoenix/admin.mdx`, `docs/phoenix/publishing.mdx` — project content administration and published revisions.\n- `docs/phoenix/sdk-builder-workflow.mdx` — Studio workspaces, projects, environments and builds.\n\n### CLI, access and deployment\n\n- `docs/phoenix/phoenix-cli.mdx` — login, dependencies, sync, dev, build and check.\n- `docs/phoenix/sessions-and-access.mdx`, `docs/phoenix/clerk-sign-in.mdx` — configurator access and project authentication.\n- `docs/phoenix/deployments.mdx` — environments and server builds."]}),...m.flat()]};
1
+ import{createPhoenixIndexGuide as e}from"../guide.js";import{generatePhoenixApplicationStatesGuides as n}from"./application-states/index.js";import{generatePhoenixAssistantGuides as o}from"./assistant/index.js";import{generatePhoenixCustomLayoutGuides as t}from"./custom-layout/index.js";import{generatePhoenixDomainControlsGuides as s}from"./domain-controls/index.js";import{generatePhoenixDomainModelGuides as i}from"./domain-model/index.js";import{generatePhoenixEmbeddingFeature as d}from"./embedding.js";import{generatePhoenixInspectionFeature as a}from"./inspection.js";import{generatePhoenixLocalizationFeature as r}from"./localization.js";import{generatePhoenixSceneObjectsFeature as c}from"./scene-objects.js";import{generatePhoenixStateGuides as m}from"./state/index.js";import{generatePhoenixVariantsFeature as p}from"./variants.js";import{generatePhoenixWebhooksGuides as h}from"./webhooks/index.js";export const generatePhoenixFeatureGuides=()=>{let x=[i(),m(),n(),s(),t(),o(),[r()],[c()],[d()],h(),[a()],[p()]];return[e({path:"features/index.md",title:"Features",summary:"What Phoenix capabilities support, their constraints and the canonical SDK documentation.",intro:"Read only the guide the task needs. Each guide teaches its part of the `phx` global and names the SDK documents to read with `pnpm phoenix docs -r <path>`.",guides:x.flatMap(e=>e.slice(0,1)),notes:["## Browse the SDK docs\n\n`pnpm phoenix docs` lists every category with its document count, `-c '<Category>'` shows one category's documents with descriptions and `-l` lists every path with its title. `-s '<text>'` matches literal text line by line, so search for one distinctive term rather than a phrase.","## Topic map\n\nTopics no guide covers point to the SDK docs.\n\n### Project and customization\n\n- `docs/phoenix/getting-started.mdx`, `docs/phoenix/quickstart.mdx` — setup and a complete worked configurator.\n- `docs/phoenix/best-practices.mdx` — supported composition and extension patterns.\n- `docs/phoenix/project-structure.mdx` — authored folders, generated files and naming rules.\n- `docs/phoenix/theming.mdx`, `docs/ux-guidelines/overview.mdx` — theme, branding and interaction principles.\n- The **3d scene**, **Drag & Drop**, **Performance** and **Complex Use Cases** categories — materials, lights, cameras, dragging and snapping, and worked combinations.\n\n### Data sources\n\n- `docs/phoenix/data-sources.mdx`, `docs/phoenix/connected-data-sources.mdx` — published, frontend, session and backend data, and connected sheets.\n\n### Admin and Studio\n\n- `docs/phoenix/admin.mdx`, `docs/phoenix/publishing.mdx` — project content administration and published revisions.\n- `docs/phoenix/sdk-builder-workflow.mdx` — Studio workspaces, projects, environments and builds.\n\n### CLI, access and deployment\n\n- `docs/phoenix/phoenix-cli.mdx` — login, dependencies, sync, dev, build and check.\n- `docs/phoenix/sessions-and-access.mdx`, `docs/phoenix/clerk-sign-in.mdx` — configurator access and project authentication.\n- `docs/phoenix/deployments.mdx` — environments and server builds."]}),...x.flat()]};
@@ -1,3 +1,3 @@
1
1
  import { type PhoenixGuide } from '../../guide.js';
2
- /** The auth hook: its flows, what a handler returns and how the session reaches the rest of the project. */
2
+ /** Access modes and the handler files that customise their sign-in: what each allows and what a handler returns. */
3
3
  export declare const generatePhoenixWebhookAuthenticationFeature: () => PhoenixGuide;
@@ -1,8 +1,8 @@
1
- import{createPhoenixFeatureGuide as e}from"../../guide.js";let s=`Dealers arrive from a portal with a code; everyone else browses with retail prices:
1
+ import{createPhoenixFeatureGuide as e}from"../../guide.js";let s=`Dealers arrive from a portal with a code and read dealer prices; everyone else browses with retail prices:
2
2
 
3
3
  \`\`\`yaml
4
4
  # spec/session.yaml
5
- useAuthHook: true
5
+ access: custom
6
6
  sessionData:
7
7
  type: object
8
8
  properties:
@@ -15,28 +15,34 @@ sessionData:
15
15
  \`\`\`
16
16
 
17
17
  \`\`\`ts
18
- // src/webhooks/auth.ts
19
- export const authHandler = phx.webhooks.authHandlerBuilder
20
- .withCodeHandler(async ({ accessToken }, { logger }) => {
21
- const response = await fetch(\`\${phx.webhooksEnv.CRM_API_URL}/dealers/me\`, {
22
- headers: { authorization: \`Bearer \${accessToken}\` },
23
- })
24
-
25
- if (!response.ok) {
26
- logger.warn(\`The CRM refused the dealer token with status \${response.status}.\`)
27
-
28
- return { success: false }
29
- }
30
-
31
- const dealer: { readonly id: string } = await response.json()
32
-
33
- return {
34
- success: true,
35
- role: 'user',
36
- data: { customerGroup: 'dealer' },
37
- userId: dealer.id,
38
- }
18
+ // src/handlers/dealer-sign-in.ts
19
+ export default phx.access.createCodeHandler(async ({ accessToken }) => {
20
+ const response = await fetch(\`\${phx.webhooksEnv.CRM_API_URL}/dealers/me\`, {
21
+ headers: { authorization: \`Bearer \${accessToken}\` },
39
22
  })
40
- .withAnonymousHandler(async () => ({ success: true, role: 'anonymous', data: { customerGroup: 'retail' } }))
41
- .build()
42
- \`\`\``;export const generatePhoenixWebhookAuthenticationFeature=()=>e({path:"features/webhooks/authentication.md",title:"Authentication",summary:"The auth hook: code, refresh, anonymous and Clerk flows, roles, session data and expiry; read when the configurator signs users in or treats some of them differently.",whenToUse:"Read when configurator users sign in, arrive from a host application, need different roles or prices, or when anonymous access must be refused.",capabilities:"### When the hook runs\n\n- With `useAuthHook: true` every configurator session starts with a call to the hook. Without it every configurator user gets an anonymous session and the hook never runs. Clerk sign-in needs `useClerk: true` as well, which adds the Clerk credentials to the webhook.\n- Build the hook with `phx.webhooks.authHandlerBuilder` and register it with `withAuthHook` in the [entry](entry-and-environment.md). What the browser sends picks the flow:\n - **Code** — a host application's backend deposited its token with the platform and handed the configurator a one-time code. `withCodeHandler` receives `{ accessToken, refreshToken?, idToken? }` and decides who the configurator user is.\n - **Refresh** — the session expired and the browser holds a refresh token an earlier answer returned. `withRefreshHandler` receives `{ refreshToken }`.\n - **Anonymous** — neither. `withAnonymousHandler` grants or refuses a session to configurator users who are not signed in; without it their sessions fail.\n- `withClerkCodeHandler()`, `withClerkSessionHandler()` and `withClerkRefreshHandler()` add the Clerk flows, which are tried before the custom handlers. The session handler rejects banned Clerk users.\n- `useCognito: true` selects shared Phoenix sign-in for Cognito SDK Builder workspaces, enables generated redirect pages and the auth hook, and accepts current project grant roles and membership tags. It conflicts with `useClerk`. Without a project webhook it refuses anonymous sessions; custom hooks can add `withAnonymousHandler`. `withCognitoHandlers()` enables this flow on a manually assembled builder. See the Cognito section of `docs/phoenix/webhooks.mdx` for its session schema and fifteen-minute authentication limit.\n- Under `phoenix dev` the hook has 15 seconds to answer.\n\n### What a handler returns\n\n- `{ success: false }` refuses the session. `{ success: true, role, data }` grants it:\n - `role` — `anonymous`, `user`, `admin` or `superadmin`. The admin roles also open Project Admin.\n - `data` — the session data, validated strictly against the spec's `sessionData` schema. The schema declares no required properties, because Admin and preset sessions carry no custom session data, so code reading it handles a missing field. Later webhook calls read it as `data.sessionPayload`, and the configurator reads it as session data. It is readable in the browser, so it never holds a credential configurator users must not see, such as an API key.\n - `userId` — the stable id of the person, so their configurations and assistant threads follow them.\n - `refreshToken` — returned to the browser for the refresh flow; return one only together with a refresh handler.\n - `expirationTime` — when the session ends, as a Unix timestamp in seconds, not a duration. Leave it out: the three-hour default is what the platform's session tracking assumes, so change it only when the client needs other session lengths.\n- `withPublishedChunkScopes(({ role, data }) => [...])` grants the published-data chunk scopes a session may read; `public` is always granted. Read `docs/phoenix/publishing.mdx` before scoping chunks.",example:s,documentation:"Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/sessions-and-access.mdx` — sessions, roles, the session user and access to configurations.\n- `docs/phoenix/clerk-sign-in.mdx` — Clerk sign-in, its handlers and pages.\n- `docs/phoenix/integration/authentication-internal.mdx` and `authentication-external.mdx` — a host application signing its users in with a code.",phxMembers:["webhooks.authHandlerBuilder"]});
23
+
24
+ if (!response.ok) {
25
+ console.warn(\`The CRM refused the dealer token with status \${response.status}.\`)
26
+
27
+ return { success: false }
28
+ }
29
+
30
+ const dealer: { readonly id: string } = await response.json()
31
+
32
+ return { success: true, role: 'user', data: { customerGroup: 'dealer' }, userId: dealer.id }
33
+ })
34
+ \`\`\`
35
+
36
+ \`\`\`ts
37
+ // src/handlers/retail-visitors.ts
38
+ export default phx.access.createAnonymousHandler(async () => ({
39
+ success: true,
40
+ role: 'anonymous',
41
+ data: { customerGroup: 'retail' },
42
+ }))
43
+ \`\`\`
44
+
45
+ \`\`\`ts
46
+ // src/handlers/chunk-scopes.ts
47
+ export default phx.access.createChunkScopesHandler(({ data }) => (data.customerGroup === 'dealer' ? ['dealer'] : []))
48
+ \`\`\``;export const generatePhoenixWebhookAuthenticationFeature=()=>e({path:"features/webhooks/authentication.md",title:"Authentication",summary:"Access modes and the `phx.access` handler files: who signs in, chunk scopes, visitors, Studio-account sign-ins, a project's own code, refresh and anonymous sign-in, roles and session data; read when the configurator signs users in or treats some of them differently.",whenToUse:"Read when configurator users sign in, arrive from a host application, need different roles or prices, or when anonymous access must be refused.",capabilities:"### Choosing the mode\n\n- `access` in `spec/application.yaml` says who can open the configurator and who signs its users in; only `custom` needs sign-in code of its own:\n - `public` — the default; everyone opens it as a visitor.\n - `invited` — only people invited to the project open it, signed in with a Studio account.\n - `public-with-sign-in` — visitors open it, and invited people can sign in with a Studio account; place the account control ([Sign-in pages and account control](../custom-layout/sign-in.md)).\n - `custom` — the project's own handlers sign people in and decide every role, admin included.\n - `legacy-clerk` — the workspace's Clerk signs people in and visitors get in.\n- In `public`, `invited` and `public-with-sign-in` a Studio-account sign-in with the project's Admin or Superadmin role gets Project Admin. Project code cannot grant a role there: a visitor is always anonymous, and the server refuses a project's own code and refresh sign-in. A sign-in lasts up to 30 days and ends at the next deploy, its sessions three hours (see the Studio-account sign-in section of `docs/phoenix/webhooks.mdx`). In `invited` and `public-with-sign-in` the other `sessionData` properties are set per person in Studio ([Session fields set in Studio](session-fields.md)). These modes need Studio accounts; a Clerk workspace gets a warning and uses `legacy-clerk` or `custom`.\n- In the three Studio-account modes the session data holds the person's `id`, `emailAddress`, `fullName`, `tags` and `accessToken` undeclared; declaring one with another type fails with `COGNITO_SESSION_DATA_INCOMPATIBLE`. Visitors carry none.\n- `useAuthHook`, `useClerk` and `useCognito` are deprecated: parsing reports `ACCESS_FLAGS_DEPRECATED` with the mode they map to, or fails with `ACCESS_WITH_DEPRECATED_FLAGS` beside `access`.\n\n### Customising the sign-in with handler files\n\n- Customise the sign-in with a file in `src/handlers/` that default-exports one `phx.access` handler. Parsing finds the call (use the factory's full name) and bundles the file into the webhook only, so it may import server-only modules. Parsing fails with `ACCESS_HANDLER_DUPLICATE` for a second file of a kind, `ACCESS_HANDLER_NOT_EXPORTED` for a handler not default-exported, `ACCESS_HANDLER_NOT_ALONE` for other handlers beside it, and `ACCESS_HANDLER_NOT_ALLOWED` for a kind the mode does not allow:\n - `phx.access.createChunkScopesHandler(({ role, data }) => [...])` — every mode. It returns the published-data chunk scopes a session may read; `public` is always added. Read `docs/phoenix/publishing.mdx` before scoping chunks.\n - `phx.access.createVisitorHandler(async ({ data }) => ({ data }))` — `public` and `public-with-sign-in`. It adds session data for visitors (people not signed in) and cannot refuse one.\n - `phx.access.createSignedInHandler(async ({ user, role, data }) => ({ data: { ... } }))` — `invited` and `public-with-sign-in`. It runs at each Studio-account sign-in and refresh, about every three hours per person, and so does any outside call it makes. It receives `user` (`id`, `email`, `name` or `null`), the `role` and the session data with the Studio values:\n - `{ data }` merges over that data, property by property; one `sessionData` does not declare or that does not fit is left out with a warning in the logs.\n - `{ allow: false }` refuses the person, admins included, so also out of Project Admin: `403` with `code: 'access-refused'`.\n - A throw, any other answer, or none within ten seconds fails the sign-in with `503` and `code: 'sign-in-unavailable'`; it never lets the person in.\n - A changed `id`, `emailAddress`, `fullName`, `tags` or `accessToken` is refused, and the role cannot change.\n - `phx.access.createCodeHandler`, `phx.access.createRefreshHandler` and `phx.access.createAnonymousHandler` — `custom` only. They answer the three flows of the project's own sign-in, picked by what the browser sends:\n - **Code** — a host application's backend deposited its token and handed the configurator a one-time code; the handler receives `{ accessToken, refreshToken?, idToken? }` and decides who signs in.\n - **Refresh** — the browser holds a refresh token an earlier answer returned; the handler receives `{ refreshToken }`.\n - **Anonymous** — neither; the handler grants or refuses a session to users who are not signed in, and without it their sessions fail.\n- `custom` with neither `src/webhooks/index.ts` nor a code, refresh or anonymous handler reports `AUTH_WITHOUT_PROJECT_WEBHOOK`.\n- An auth hook assembled in `src/webhooks/` is deprecated and reports `AUTH_HOOK_DEPRECATED`; with `access` set to `public`, `invited` or `public-with-sign-in` it fails with `AUTH_HOOK_NOT_ALLOWED`. Move its handlers to handler files.\n- Under `phoenix dev` the sign-in has 15 seconds to answer.\n\n### What a sign-in handler returns\n\n- `{ success: false }` refuses the session. `{ success: true, role, data }` grants it:\n - `role` — `anonymous`, `user`, `admin` or `superadmin`. The admin roles also open Project Admin.\n - `data` — the session data, validated strictly against the spec's `sessionData` schema. The schema declares no required properties, because Admin and preset sessions carry none, so readers handle a missing field. Webhook calls read it as `data.sessionPayload`. It is readable in the browser, so it never holds a credential such as an API key.\n - `userId` — the person's stable id, which their configurations and assistant threads follow.\n - `refreshToken` — returned to the browser for the refresh flow; return one only together with a refresh handler.\n - `expirationTime` — when the session ends, as a Unix timestamp in seconds, not a duration. Leave it out unless the client needs other session lengths: the platform's session tracking assumes the three-hour default.",example:s,documentation:"Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/sessions-and-access.mdx` — sessions, roles, the session user and access to configurations.\n- `docs/phoenix/clerk-sign-in.mdx` — Clerk sign-in, its handlers and pages.\n- `docs/phoenix/integration/authentication-internal.mdx` and `authentication-external.mdx` — a host application signing its users in with a code.",phxMembers:["access.createChunkScopesHandler","access.createVisitorHandler","access.createSignedInHandler","access.createCodeHandler","access.createRefreshHandler","access.createAnonymousHandler"]});
@@ -26,13 +26,11 @@ env:
26
26
 
27
27
  \`\`\`ts
28
28
  // src/webhooks/index.ts
29
- import { authHandler } from './auth.js'
30
29
  import { fetchBackendData } from './backend-data.js'
31
30
  import { quoteFinalization } from './finalization.js'
32
31
 
33
32
  export default phx.webhooks.webhookBuilder
34
- .withAuthHook(authHandler)
35
33
  .withFetchBackendData(fetchBackendData)
36
34
  .withConfiguratorFinalize(quoteFinalization)
37
35
  .build()
38
- \`\`\``;export const generatePhoenixWebhookEntryFeature=()=>e({path:"features/webhooks/entry-and-environment.md",title:"Webhook entry and environment",summary:"`src/webhooks/index.ts`, which project code runs on the server, browser-import limits and `env.webhook` variables; read when creating the webhook, adding server code or a secret, or fixing a webhook parse or build error.",whenToUse:"Read when the project needs server-side code — sign-in, backend data, finalization — or a credential, or when parsing or the build names a webhook file.",capabilities:"### The entry\n\n- The webhook is the project's server side: one bundle the platform calls for sign-in, backend data, finalization and its callback, Admin publishing and assistant setup. A deployed environment runs it as a cloud function; `phoenix dev` runs it on the developer's machine through the development tunnel.\n- `src/webhooks/index.ts` is the entry and default-exports `phx.webhooks.webhookBuilder` with its hooks, then `.build()`. Only that file is imported; other files in `src/webhooks/` run when it imports them. Files in `src/webhooks/` without an `index.ts` fail with `MISSING_WEBHOOK_INDEX`.\n- The builder takes `withAuthHook` ([Authentication](authentication.md)), `withFetchBackendData` ([Backend data](backend-data.md)) and `withConfiguratorFinalize` ([Finalization](finalization.md)). Register only what the project uses. The SDK adds [Admin publishing](publishing.md) itself, and [assistant setup](assistant-setup.md) when the spec configures the assistant.\n- With `useCognito: true`, the built-in webhook authenticates invited Phoenix accounts and refuses anonymous sessions. Otherwise, without an entry the SDK builds a webhook that signs every configurator user in anonymously. `useAuthHook: true` or `useClerk: true` without an entry reports `AUTH_WITHOUT_PROJECT_WEBHOOK`.\n- A hook that throws answers with an error: the sign-in, the finalization or the publish fails. Its message reaches the server log, not the configurator user, so log what went wrong with the `logger` each hook receives.\n\n### Project code in the webhook\n\n- The spec's domain, expressions and invariants also run in the webhook. Action implementation modules load and execute only in the browser, including assistant custom mutations; assistant setup uses their shared schemas. Components, admin components and handlers are frontend-only by default.\n- A handler module that calls `phx.domain.createAssistantSetupHandler` or one of the `phx.domain.admin` publishing and validation factories joins the webhook automatically. The call is detected literally, so do not alias it.\n- Make `'use webhook'` the first statement of another component or handler the server needs, such as one that prepares the scene for server rendering. Leading comments may precede it.\n- An included file and every local file it imports must not import the browser SDK entry points (`admin`, `application`, `configurator`, `editor`, `react`, `ui`, `extras/clerk`, `extras/cognito`) or style, font and image files. Type-only imports are allowed. For files included by `'use webhook'` or a detected handler registration, parsing reports `WEBHOOK_UNSAFE_IMPORT` with the import chain. Action implementations load only in the browser and are not part of webhook assembly. Move logic both sides need into a module without them, and keep rendering in a frontend-only file.\n\n### Environment variables and secrets\n\n- Declare variables under `env.webhook`: `type` is `bool`, `str`, `num` or `url`, with an optional `default`, `devDefault` (the value under `phoenix dev`) and `required`. A variable that is neither required nor defaulted is `undefined` when unset. Read them as `phx.webhooksEnv.NAME`.\n- Values are fixed when the webhook is built: a changed value needs a restart of `phoenix dev` locally and a new deploy on an environment. Deployed builds take values from the environment variables a workspace or project Superadmin sets in Studio; `phoenix dev` takes them from `.env`, which is not committed.\n- Keep credentials in the webhook. Session data, backend data and the finalization result all reach the browser, and `env.frontend` values are public.\n- `budgets.webhookGzipMb` fails the build when the compressed webhook grows past it; `phoenix build --onlyWebhook` builds the webhook alone.",example:t,documentation:"Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/webhooks.mdx` — the entry, the built-in webhook and environment variables.\n- `docs/phoenix/webhook-membership.mdx` — which files join the webhook and the server-safe import rule.\n- `docs/phoenix/sdk-builder-workflow.mdx` — setting environment variables in Studio.",phxMembers:["webhooks.webhookBuilder"]});
36
+ \`\`\``;export const generatePhoenixWebhookEntryFeature=()=>e({path:"features/webhooks/entry-and-environment.md",title:"Webhook entry and environment",summary:"`src/webhooks/index.ts`, which project code runs on the server, browser-import limits and `env.webhook` variables; read when creating the webhook, adding server code or a secret, or fixing a webhook parse or build error.",whenToUse:"Read when the project needs server-side code — sign-in, backend data, finalization — or a credential, or when parsing or the build names a webhook file.",capabilities:"### The entry\n\n- The webhook is the project's server side: one bundle the platform calls for sign-in, backend data, finalization and its callback, configuration insights evaluation, Admin publishing and assistant setup. A deployed environment runs it as a cloud function; `phoenix dev` runs it on the developer's machine through the development tunnel.\n- `src/webhooks/index.ts` is the entry and default-exports `phx.webhooks.webhookBuilder` with its hooks, then `.build()`. Only that file is imported; other files in `src/webhooks/` run when it imports them. Files in `src/webhooks/` without an `index.ts` fail with `MISSING_WEBHOOK_INDEX`.\n- The builder takes `withFetchBackendData` ([Backend data](backend-data.md)) and `withConfiguratorFinalize` ([Finalization](finalization.md)). Register only what the project uses. The SDK adds sign-in for the access mode itself, customised by handler files ([Authentication](authentication.md)), [Admin publishing](publishing.md), and [assistant setup](../assistant/session-setup.md) when the spec configures the assistant.\n- `withConfigurationInsights(fields)` publishes explicitly selected scalar expressions for Studio. Each field supplies `id`, `label`, `description`, `expression` (such as `$price`), `version` and `type` (`number`, `category` or `boolean`); money also supplies `currency` and `taxBasis`. Use only deterministic expressions over saved entities and published catalog data. Session, frontend and live backend dependencies are unsupported. Ask the Phoenix team to enable Configuration insights for the project in System Studio before finalizing. It defaults off. Enabling it does not backfill older finalizations. The server evaluates against the deployment and catalog versions captured when finalization is accepted, outside the finalization request. Mutable development tunnels and historical finalizations without provenance cannot produce verified values. Do not expose personal data through these fields.\n- Without an entry the SDK builds a webhook with the sign-in of the access mode alone. `access: custom` without an entry or a sign-in handler file reports `AUTH_WITHOUT_PROJECT_WEBHOOK`.\n- A hook that throws answers with an error: the sign-in, the finalization or the publish fails. Its message reaches the server log, not the configurator user, so log what went wrong with the `logger` each hook receives.\n\n### Project code in the webhook\n\n- The spec's domain, expressions and invariants also run in the webhook. Action implementation modules load and execute only in the browser, including assistant custom mutations; assistant setup uses their shared schemas. Components, admin components and handlers are frontend-only by default.\n- A handler module that calls `phx.domain.createAssistantSetupHandler`, one of the `phx.domain.admin` publishing and validation factories or one of the `phx.access` factories joins the webhook automatically. The call is detected literally, so do not alias it.\n- Make `'use webhook'` the first statement of another component or handler the server needs, such as one that prepares the scene for server rendering. Leading comments may precede it.\n- An included file and every local file it imports must not import the browser SDK entry points (`admin`, `application`, `configurator`, `editor`, `react`, `ui`, `extras/clerk`, `extras/cognito`) or style, font and image files. Type-only imports are allowed. For files included by `'use webhook'` or a detected handler registration, parsing reports `WEBHOOK_UNSAFE_IMPORT` with the import chain. Action implementations load only in the browser and are not part of webhook assembly. Move logic both sides need into a module without them, and keep rendering in a frontend-only file.\n\n### Environment variables and secrets\n\n- Declare variables under `env.webhook`: `type` is `bool`, `str`, `num` or `url`, with an optional `default`, `devDefault` (the value under `phoenix dev`) and `required`. A variable that is neither required nor defaulted is `undefined` when unset. Read them as `phx.webhooksEnv.NAME`.\n- Values are fixed when the webhook is built: a changed value needs a restart of `phoenix dev` locally and a new deploy on an environment. Deployed builds take values from the environment variables a workspace or project Superadmin sets in Studio; `phoenix dev` takes them from `.env`, which is not committed.\n- Keep credentials in the webhook. Session data, backend data and the finalization result all reach the browser, and `env.frontend` values are public.\n- `budgets.webhookGzipMb` fails the build when the compressed webhook grows past it; `phoenix build --onlyWebhook` builds the webhook alone.",example:t,documentation:"Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/webhooks.mdx` — the entry, the built-in webhook and environment variables.\n- `docs/phoenix/webhook-membership.mdx` — which files join the webhook and the server-safe import rule.\n- `docs/phoenix/sdk-builder-workflow.mdx` — setting environment variables in Studio.",phxMembers:["webhooks.webhookBuilder"]});
@@ -1 +1 @@
1
- import{createPhoenixFeatureGuide as e}from"../../guide.js";export const generatePhoenixPublishingFeature=()=>e({path:"features/webhooks/publishing.md",title:"Admin publishing",summary:"What publishing in Project Admin runs in the webhook: the `PublishRevision` tasks, mapping admin entities to published data and validating data rows and sheets; read when admin content has to reach the configurator.",whenToUse:"Read when the project has Project Admin content to publish, maps its own admin entities into published data, or validates manual or connected data before publishing.",capabilities:"### What publishing runs\n\n- Publishing in Project Admin runs the webhook's Admin finalization, which the SDK builds itself: `phx.webhooks` has no builder for it and the [entry](entry-and-environment.md) registers nothing.\n- Without published-data chunks it produces one `PublishRevision` task with the whole published data. With chunks it produces `PublishRevisionChunksStaged`, which uploads the chunks first and takes up to 100 MiB, or `PublishRevisionChunks` with the chunks inline where the platform offers no upload.\n- Presets, preset categories, recipes and swatch options are published without project code. A project maps its own admin entities with a handler.\n\n### Project handlers\n\nDefault-export each from a file in `src/handlers/`. These files join the webhook automatically, so they import only server-safe modules. Only the first handler of each kind counts.\n\n- `phx.domain.admin.createMapPublishedRevisionDataHandler(({ entities, adminEntity }) => data)` — the published data, without chunks.\n- `phx.domain.admin.createMapPublishedChunkedDataHandler(({ entities, adminEntity, connectedSheetData }) => chunks)` — per-chunk data spread over what the SDK generates; `connectedSheetData` holds the rows of connected spreadsheets during publishing.\n- `phx.domain.admin.createDataRowValidatorHandler` and `createSheetValidatorHandler` — business rules for manual and connected data, returning messages with `severity` `error` or `warning`. They run in Admin's verify dialog and again when publishing, where an `error` stops the publish and a `warning` does not. Keep them synchronous and pure.\n\n### Reaching the configurator\n\n- The configurator reads published data as `publishedData` in expressions and tasks. A session reads the `public` chunk and the scopes [authentication](authentication.md) grants with `withPublishedChunkScopes`.\n- Published data belongs to the environment and outlives deploys. Check the configurator against freshly published data after a deploy that changes the published-data schema.",example:'A catalogue maps its visible custom materials into the `catalog` chunk, and a row validator rejects a material without a price before it is published. The complete handler is the "Custom Mapping Handler" of `docs/phoenix/publishing.mdx`, and the validators are under "Custom Validation Handlers" in `docs/phoenix/connected-data-sources.mdx`; both depend on the project\'s admin model and data entries, so start from them rather than a copy.',documentation:"Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/publishing.mdx` — chunks, scopes, the publish flow and the mapping handler.\n- `docs/phoenix/connected-data-sources.mdx` — connected spreadsheets and the validators.\n- `docs/phoenix/admin.mdx` — Project Admin and its model.",phxMembers:[]});
1
+ import{createPhoenixFeatureGuide as e}from"../../guide.js";export const generatePhoenixPublishingFeature=()=>e({path:"features/webhooks/publishing.md",title:"Admin publishing",summary:"What publishing in Project Admin runs in the webhook: the `PublishRevision` tasks, mapping admin entities to published data and validating data rows and sheets; read when admin content has to reach the configurator.",whenToUse:"Read when the project has Project Admin content to publish, maps its own admin entities into published data, or validates manual or connected data before publishing.",capabilities:"### What publishing runs\n\n- Publishing in Project Admin runs the webhook's Admin finalization, which the SDK builds itself: `phx.webhooks` has no builder for it and the [entry](entry-and-environment.md) registers nothing.\n- Without published-data chunks it produces one `PublishRevision` task with the whole published data. With chunks it produces `PublishRevisionChunksStaged`, which uploads the chunks first and takes up to 100 MiB, or `PublishRevisionChunks` with the chunks inline where the platform offers no upload.\n- Presets, preset categories, recipes and swatch options are published without project code. A project maps its own admin entities with a handler.\n\n### Project handlers\n\nDefault-export each from a file in `src/handlers/`. These files join the webhook automatically, so they import only server-safe modules. Only the first handler of each kind counts.\n\n- `phx.domain.admin.createMapPublishedRevisionDataHandler(({ entities, adminEntity }) => data)` — the published data, without chunks.\n- `phx.domain.admin.createMapPublishedChunkedDataHandler(({ entities, adminEntity, connectedSheetData }) => chunks)` — per-chunk data spread over what the SDK generates; `connectedSheetData` holds the rows of connected spreadsheets during publishing.\n- `phx.domain.admin.createDataRowValidatorHandler` and `createSheetValidatorHandler` — business rules for manual and connected data, returning messages with `severity` `error` or `warning`. They run in Admin's verify dialog and again when publishing, where an `error` stops the publish and a `warning` does not. Keep them synchronous and pure.\n\n### Reaching the configurator\n\n- The configurator reads published data as `publishedData` in expressions and tasks. A session reads the `public` chunk and the scopes its chunk scopes handler grants, a `phx.access.createChunkScopesHandler` file described in [authentication](authentication.md).\n- Published data belongs to the environment and outlives deploys. Check the configurator against freshly published data after a deploy that changes the published-data schema.",example:'A catalogue maps its visible custom materials into the `catalog` chunk, and a row validator rejects a material without a price before it is published. The complete handler is the "Custom Mapping Handler" of `docs/phoenix/publishing.mdx`, and the validators are under "Custom Validation Handlers" in `docs/phoenix/connected-data-sources.mdx`; both depend on the project\'s admin model and data entries, so start from them rather than a copy.',documentation:"Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/publishing.mdx` — chunks, scopes, the publish flow and the mapping handler.\n- `docs/phoenix/connected-data-sources.mdx` — connected spreadsheets and the validators.\n- `docs/phoenix/admin.mdx` — Project Admin and its model.",phxMembers:[]});
@@ -0,0 +1,3 @@
1
+ import { type PhoenixGuide } from '../../guide.js';
2
+ /** Session fields: the \`sessionData\` properties whose values Studio sets per person in the Studio-account modes. */
3
+ export declare const generatePhoenixWebhookSessionFieldsFeature: () => PhoenixGuide;
@@ -0,0 +1 @@
1
+ import{createPhoenixFeatureGuide as e}from"../../guide.js";export const generatePhoenixWebhookSessionFieldsFeature=()=>e({path:"features/webhooks/session-fields.md",title:"Session fields set in Studio",summary:"Session fields: the `sessionData` properties whose values Studio sets per person and project in `invited` and `public-with-sign-in`, their shapes, limits and diagnostics, and what a deploy that changes them does; read when people need their own prices, categories or other values.",whenToUse:"Read when signed-in people should see different prices, categories or options, or when `sessionData` changes in a project that signs people in with Studio accounts.",capabilities:"- In `invited` and `public-with-sign-in` ([Authentication](authentication.md)), every top-level `sessionData` property except the identity fields (`id`, `emailAddress`, `fullName`, `tags`, `accessToken`) is a session field: workspace and project superadmins set its value per person and project in Studio, where it is a user setting, such as a dealer's price list.\n- `setInStudio: false` keeps a property out of Studio. A signed-in handler may fill it, and in `public-with-sign-in` a visitor handler fills it for visitors; otherwise it stays empty. `setInStudio: true` is the same as leaving the marker out.\n- In `public`, `custom` and `legacy-clerk` nothing is a session field: `setInStudio: false` has no effect and `setInStudio: true` fails with `SESSION_FIELD_ACCESS_MODE`.\n- A field is one of these, with only `title`, `description` and `default` besides; Studio shows each as the control in brackets:\n - `type: string`, at most 500 characters (text);\n - `type: number` or `type: integer` (number);\n - `type: boolean` (yes or no);\n - `type: string` with an `enum` of strings (one of);\n - `type: array` with `uniqueItems: true` and `items` a string `enum` (any of).\n- Limits: 30 fields per project, 100 values per list, 500 characters per text value, 4 KB of stored values per person and project.\n- Parsing fails with `SESSION_FIELD_UNSUPPORTED` for any other shape (an object, a nullable type, a reference, extra keywords), `SESSION_FIELD_DEFAULT` for a default the field does not allow, `SESSION_FIELD_IDENTITY_KEY` for an identity field marked `setInStudio: true` and `SESSION_FIELD_LIMIT` for more than 30 fields or 100 values in a list. Studio checks the text length and the 4 KB when it saves values.\n- The stored value arrives in the session data of every Studio-account sign-in and refresh, next to the identity fields. A person with no stored value gets the `default`, or no property, so code reading one handles it missing; visitors carry none.\n- Nothing is migrated when a deploy changes a field. A stored value the field no longer allows gets the `default` instead, or is left out; an any-of value keeps the choices still allowed. Studio marks the person Needs review until a superadmin sets it again. Values of a renamed or removed field are ignored and flag nobody; a renamed field starts at its `default`, or empty, for everyone.\n- A change in Studio applies on the next request: the configurator refreshes its session once by itself and sends the request again.",example:"The guides' example project signs dealers in with its own code in `custom`, where nothing is a session field. In a project with `access: invited`, a dealer's price list is a property under `sessionData.properties` in `spec/session.yaml`: `priceList` with `title: Price list`, `type: string`, `enum: [retail, dealer]` and `default: retail`. Superadmins set it per dealer in Studio, and the configurator reads `priceList` from the session data, falling back to `retail` when it is missing. A `portalId` the signed-in handler fills says `setInStudio: false`.",documentation:'Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/sessions-and-access.mdx` — the "Session fields set in Studio" section.',phxMembers:[]});
@@ -1 +1 @@
1
- import{createPhoenixIndexGuide as e}from"../../guide.js";import{generatePhoenixAssistantSetupFeature as t}from"./assistant-setup.js";import{generatePhoenixWebhookAuthenticationFeature as n}from"./authentication.js";import{generatePhoenixWebhookBackendDataFeature as o}from"./backend-data.js";import{generatePhoenixWebhookEntryFeature as i}from"./entry-and-environment.js";import{generatePhoenixWebhookFinalizationFeature as a}from"./finalization.js";import{generatePhoenixPublishingFeature as r}from"./publishing.js";import{generatePhoenixTaskGuides as s}from"./tasks/index.js";export const generatePhoenixWebhooksGuides=()=>{let h=s(),d=[i(),n(),o(),a(),...h.slice(0,1),r(),t()];return[e({path:"features/webhooks/index.md",title:"Webhooks",summary:"Server-side project code: the webhook entry and environment, sign-in, backend data, finalization and its tasks, Admin publishing and assistant setup; read when the configurator needs the server.",intro:"The webhook is the project's server side: `src/webhooks/index.ts` and the handler modules that join it run on the platform and hold the project's credentials, which never reach the browser. The platform calls it to sign configurator users in, to fetch backend data, to finalize a configuration and return its result, to publish Admin content and to set up the assistant. Start from [Webhook entry and environment](entry-and-environment.md), then read only the guide for the hook at hand.",guides:d,notes:["## The examples\n\nThe guides build one quote configurator for a `Chair` with a `label`, a `finish` and a `width`: each example is a file of that project, and the files fit together. Take the pattern, not the names."]}),...d,...h.slice(1)]};
1
+ import{createPhoenixIndexGuide as e}from"../../guide.js";import{generatePhoenixWebhookAuthenticationFeature as t}from"./authentication.js";import{generatePhoenixWebhookBackendDataFeature as n}from"./backend-data.js";import{generatePhoenixWebhookEntryFeature as o}from"./entry-and-environment.js";import{generatePhoenixWebhookFinalizationFeature as i}from"./finalization.js";import{generatePhoenixPublishingFeature as r}from"./publishing.js";import{generatePhoenixWebhookSessionFieldsFeature as s}from"./session-fields.js";import{generatePhoenixTaskGuides as a}from"./tasks/index.js";export const generatePhoenixWebhooksGuides=()=>{let h=a(),d=[o(),t(),s(),n(),i(),...h.slice(0,1),r()];return[e({path:"features/webhooks/index.md",title:"Webhooks",summary:"Server-side project code: the webhook entry and environment, sign-in, backend data, finalization and its tasks and Admin publishing; read when the configurator needs the server.",intro:"The webhook is the project's server side: `src/webhooks/index.ts` and the handler modules that join it run on the platform and hold the project's credentials, which never reach the browser. The platform calls it to sign configurator users in, to fetch backend data, to finalize a configuration and return its result, to publish Admin content and to set up the assistant ([Session setup](../assistant/session-setup.md)). Start from [Webhook entry and environment](entry-and-environment.md), then read only the guide for the hook at hand.",guides:d,notes:["## The examples\n\nThe guides build one quote configurator for a `Chair` with a `label`, a `finish` and a `width`: each example is a file of that project, and the files fit together. Take the pattern, not the names."]}),...d,...h.slice(1)]};
@@ -25,7 +25,7 @@ export interface PhoenixGuide {
25
25
  */
26
26
  export type PhxMemberName = `${PhxNamespace}.${string}`;
27
27
  /** The namespaces of the `phx` global. */
28
- export type PhxNamespace = 'frontend' | 'domain' | 'webhooks' | 'applicationTypes';
28
+ export type PhxNamespace = 'frontend' | 'domain' | 'access' | 'webhooks' | 'applicationTypes';
29
29
  interface PhoenixGuideHeader {
30
30
  readonly path: string;
31
31
  readonly title: string;
@@ -1,5 +1,5 @@
1
1
  import { type AgentSkillReference } from './agent-skill.js';
2
- import { type PhoenixSkillOptions } from './processes/index.js';
2
+ import type { PhoenixSkillOptions } from './sdk-channel.js';
3
3
  /** The discoverable entry point and the documents it ships beside it. */
4
4
  interface PhoenixSkillBundle {
5
5
  readonly content: string;
@@ -1,14 +1,14 @@
1
- import{renderAgentSkill as e}from"./agent-skill.js";import{generatePhoenixCliCore as o,generatePhoenixSdkCore as t,generatePhoenixWorkflowCore as r}from"./core/index.js";import{generatePhoenixFeatureGuides as n}from"./features/index.js";import{createPhoenixIndexGuide as s}from"./guide.js";import{generatePhoenixAssetConversion as i,generatePhoenixBeta as a,generatePhoenixFeedbackGuides as d,generatePhoenixFinalization as c,generatePhoenixFirstDraftGuides as h,generatePhoenixModelMigration as l,generatePhoenixReviewGuides as u,generatePhoenixSpecificationGuides as p}from"./processes/index.js";export const generatePhoenixSkillBundle=m=>{let f=[r(),t(),o()],w=[h(),p(),[c()],[i()],[l()],u(),d(),[a(m)]],g=s({path:"processes/index.md",title:"Processes",summary:"Procedures summarized by outcome and when to use them.",intro:"Read the procedure or section whose outcome the task needs. The [workflow](../core/workflow.md) owns strategy, preferences and effort; processes supply the execution.",guides:w.flatMap(e=>e.slice(0,1)),notes:[]}),x=n();return{content:e({name:"phoenix",description:"Build, change, inspect, deploy or review a Phoenix configurator project. Use for all Phoenix project work, including a first draft of a new project, visual alternatives and platform feedback.",sections:[`# Phoenix
1
+ import{renderAgentSkill as e}from"./agent-skill.js";import{generatePhoenixCliCore as o,generatePhoenixSdkCore as t,generatePhoenixWorkflowCore as r}from"./core/index.js";import{generatePhoenixFeatureGuides as n}from"./features/index.js";import{createPhoenixIndexGuide as s}from"./guide.js";import{generatePhoenixAssetConversion as i,generatePhoenixAssistantConfiguration as a,generatePhoenixFeedbackGuides as d,generatePhoenixFinalization as c,generatePhoenixFirstDraftGuides as h,generatePhoenixModelMigration as l,generatePhoenixReviewGuides as u,generatePhoenixSceneRealism as p,generatePhoenixSpecificationGuides as m}from"./processes/index.js";export const generatePhoenixSkillBundle=f=>{let w=[r(),t(),o(f)],g=[h(),m(),[c()],[i()],[p()],[a()],[l()],u(),d()],x=s({path:"processes/index.md",title:"Processes",summary:"Procedures summarized by outcome and when to use them.",intro:"Read the procedure or section whose outcome the task needs. The [workflow](../core/workflow.md) owns strategy, preferences and effort; processes supply the execution.",guides:g.flatMap(e=>e.slice(0,1)),notes:[]}),k=n();return{content:e({name:"phoenix",description:"Build, change, inspect, deploy or review a Phoenix configurator project. Use for all Phoenix project work, including a first draft of a new project, visual alternatives and platform feedback.",sections:[`# Phoenix
2
2
 
3
3
  Use the required core to choose how to work, then load task details only when they apply.`,`## Required reading
4
4
 
5
5
  Before Phoenix work, read these three core guides in order:
6
6
 
7
- ${f.map((e,o)=>`${o+1}. [${e.title}](${e.path}) — ${e.summary}.`).join("\n")}
7
+ ${w.map((e,o)=>`${o+1}. [${e.title}](${e.path}) — ${e.summary}.`).join("\n")}
8
8
 
9
9
  The core governs every task; reading the workflow does not mean executing every stage. Reuse the core while it remains in context and unchanged, and read it again when context is lost or sync or an SDK update changes it.`,`## Optional guidance
10
10
 
11
11
  - [Processes](processes/index.md) — procedures summarized by outcome and when to use them.
12
12
  - [Features](features/index.md) — what Phoenix capabilities support, their constraints and canonical SDK documentation.
13
13
 
14
- Follow only the destinations the task needs; a link does not require reading its whole subtree.`]}),references:[...f,g,...w.flat(),...x].map(({path:e,content:o})=>({path:e,content:o}))}};
14
+ Follow only the destinations the task needs; a link does not require reading its whole subtree.`]}),references:[...w,x,...g.flat(),...k].map(({path:e,content:o})=>({path:e,content:o}))}};
@@ -1,4 +1,4 @@
1
- import{createPhoenixProcessGuide as e}from"../guide.js";let t=`Conversion is part of the product's appearance, not a preliminary chore: a converted model that is misplaced, incomplete or stripped of its detail is a visible defect, and the client sees it before anything else.
1
+ import{createPhoenixProcessGuide as e}from"../guide.js";let t=`Conversion is part of the product's appearance, not a preliminary chore: a converted model that is misplaced, incomplete or stripped of its detail is a visible defect, and the client sees it before anything else. If a requested realism improvement or a specific material/contact defect remains within scope, [scene realism](scene-realism.md) offers optional refinement guidance; conversion alone does not call for that pass.
2
2
 
3
3
  ### Write a script, not a sequence of one-off fixes
4
4
 
@@ -19,5 +19,5 @@ Reduce geometry per part, never uniformly across a model. A single ratio removes
19
19
 
20
20
  ### Verify every model, not the first one
21
21
 
22
- Inspect each converted model with the [asset inspection](../features/inspection.md) tooling, and check every requirement above for every model in the set. A batch that reuses a script verified on one file still needs each result looked at: source files in one delivery frequently differ in origin, scale and structure.`,r=`- Every model in scope is converted by the committed script and inspected against each requirement.
23
- - Divergences from published figures are reported to the client, not silently adopted.`;export const generatePhoenixAssetConversion=()=>e({path:"processes/asset-conversion.md",title:"Asset conversion",summary:"Convert and verify supplied 3D models with a reproducible script; read when supplied models need conversion or repair before configuration.",whenToUse:"When supplied models need conversion or repair before they can be configured. A [first draft](first-draft/direction.md) converts only its representative model, or builds a labeled stand-in when no model is supplied.",steps:t,doneWhen:r,example:"For a set of chairs, parameterize the conversion for the source units, the ground contact and separately configurable upholstery and frame materials. Run the same script for every supplied chair and inspect each output; a valid first model does not validate the rest."});
22
+ Inspect each converted model with the [asset inspection](../features/inspection.md) tooling, and check every requirement above for every model in the set. A batch that reuses a script verified on one file still needs each result looked at: source files in one delivery frequently differ in origin, scale and structure.`,a=`- Every model in scope is converted by the committed script and inspected against each requirement.
23
+ - Divergences from published figures are reported to the client, not silently adopted.`;export const generatePhoenixAssetConversion=()=>e({path:"processes/asset-conversion.md",title:"Asset conversion",summary:"Convert and verify supplied 3D models with a reproducible script; read when supplied models need conversion or repair before configuration.",whenToUse:"When supplied models need conversion or repair before they can be configured. A [first draft](first-draft/direction.md) converts only its representative model, or builds a labeled stand-in when no model is supplied.",steps:t,doneWhen:a,example:"For a set of chairs, parameterize the conversion for the source units, the ground contact and separately configurable upholstery and frame materials. Run the same script for every supplied chair and inspect each output; a valid first model does not validate the rest."});
@@ -0,0 +1,3 @@
1
+ import { type PhoenixGuide } from '../guide.js';
2
+ /** Setting up the assistant for a configurator: survey, the standard ways first, build and check. */
3
+ export declare const generatePhoenixAssistantConfiguration: () => PhoenixGuide;
@@ -0,0 +1,3 @@
1
+ import{createPhoenixProcessGuide as e}from"../guide.js";let t=`- Each way the UI changes the configuration that the assistant should support maps to a write, a recipe, a deletion or an action, and each action has a stated reason a standard way does not fit.
2
+ - Refactors that would make the standard way work were suggested to the client, and their decision is recorded.
3
+ - The client's typical requests run in the assistant's thread without failed changes, and each screenshot view shows what the assistant needs to check.`;export const generatePhoenixAssistantConfiguration=()=>e({path:"processes/assistant-configuration.md",title:"Assistant configuration",summary:"Survey how the configurator changes, choose standard ways before actions, build the `assistant` section and check it as the assistant sees it; read when setting up the assistant or extending what it can do.",whenToUse:"Use when the client wants the AI assistant in their configurator, or wants it to read or change more. A wording fix in a description or in `instructions` needs only [reading and changing](../features/assistant/reading-and-changing.md).",steps:"### Survey how the configurator changes\n\nRead `docs/phoenix/assistant/overview.mdx` with `pnpm phoenix docs -r <path>` for how the section, the assistant's schema and the panel connect. Then, before you write the `assistant` section, read the model, its relations and controls. List every way the UI creates, replaces, moves or deletes entities, and note how each one works: a recipe control, a plain field write, a creation in custom code, a drag handle, a sketch tool or a builder behind a button. Note also where the assistant would read its facts, such as catalog data or a price. This survey usually takes longer than the section itself, and it decides most of it.\n\nTake axes, units and placement from the code that places parts, not from field names. A field called `length` can run along any axis.\n\n### Choose and agree the approach\n\nFor each path, choose a standard write, a recipe or an action as [reading and changing](../features/assistant/reading-and-changing.md) describes. When a small refactor would let a recipe or a plain write replace an action, suggest it to the client. Explain what changes for them, usually nothing visible, and what it saves: the assistant previews and compares standard changes, while it has to learn an action from its description alone. Keep the client's decision. A refactor that would change how users work, such as placement that follows the camera, stays theirs to choose.\n\nAgree with the client what the assistant should be able to do first. A small useful assistant that reads the configuration and makes the common changes is a better first step than complete coverage.\n\n### Build in layers\n\nStart with `ai`, which the client chooses, and `instructions` that say in a few sentences what the product is and how the assistant should behave. Then add what the assistant reads and the standard changes. Then add the option lists, screenshots and navigation, and finally the actions the survey called for. Run `pnpm phoenix dev` after each layer: section diagnostics name the key to fix. Write descriptions in the client's product terms, with units and axes, and keep rules that span entities in `instructions`.\n\n### Check it as the assistant sees it\n\nLook at each screenshot view's image as the assistant receives it, not only its spec; the panel never shows it. Development browsers rarely offer WebMCP, so install a stub right after the page navigates, before the configuration loads: `document.modelContext = { registerTool: tool => { window.tools[tool.name] = tool } }` with `window.tools = {}`. Then `await window.tools.configurator_query.execute({ operations: [{ query }] })` with a query of `meta { screenshot(view: …) { image } }` returns the image as base64. Check that the product fills the frame and that nothing hides the parts the assistant must check.\n\nThen try the client's typical requests in the assistant panel, from a first message to a finished design. A project layout has no panel unless it keeps the built-in sidebar, so use its own thread, or ask the client to add one first ([Panel](../features/assistant/panel.md)). Read the conversation for failed tool rounds, parameter names the model guessed wrong on first use, values the assistant reads as opaque JSON, and repeated reads of lists that never change. Fix the section or a description rather than adding instructions that work around it.",doneWhen:t,example:'A desk configurator adds drawers from a recipe control, sets the leg finish with a custom control, and places lamps from a catalog page with a creation in custom code, at the point the camera looks at. The survey maps drawers to `childRecipes` and the leg finish to `writable`, with an assistant-only `attributeSelection` list. For the lamps, suggest a recipe group per lamp category, with placement moved to a transformer that finds a free spot on the desk. If the client keeps the camera placement for mouse users, add an `addLamp` action that computes the spot itself. Then check the top view\'s image, and run "add two drawers and a lamp on the left" in the panel.'});
@@ -26,8 +26,8 @@ Conversation log:
26
26
  <the conversation condensed to the turns that matter: what the client asked, what you tried, what failed>
27
27
  \`\`\`
28
28
 
29
- - **Build** is the latest build of this project, whose sources show the problem. \`pnpm phoenix deploy\` prints its id as \`Build <id> started\` and its page as \`Follow the build in Studio: <url>\`. When that line is missing, use the build page URL from Studio for the project shown by \`phoenix whoami\`; do not infer a workspace from a personal login. Never invent a build id: when the project was not deployed, write \`not deployed yet\`.
30
- - **Configurator** is the live address \`pnpm phoenix deploy\` prints once the build is live.
29
+ - **Build** is the latest build of this project, whose sources show the problem. \`pnpm phoenix deploy\` prints it as \`Build #<n> started in <preview>\` and its page, whose address carries the build id, as \`Follow the build in Studio: <url>\`. When that line is missing, use the build page URL from Studio for the project shown by \`phoenix whoami\`; do not infer a workspace from a personal login. Never invent a build id: when the project was not deployed, write \`not deployed yet\`.
30
+ - **Configurator** is the preview's live address \`pnpm phoenix deploy\` prints once the build is live.
31
31
  - The team downloads the build's sources from its Studio page, so do not paste whole files; quote only the lines that show the problem.
32
32
  - Quote errors and output exactly. A report that paraphrases an error cannot be searched for.
33
33
  - Condense the conversation log rather than dumping it: keep the client's requests, the decisions and the failures, and leave out tool output the other sections already carry.
@@ -2,7 +2,7 @@ import{createPhoenixProcessGuide as e}from"../../guide.js";let t=`The handoff is
2
2
 
3
3
  1. Render the product definition PDF from its current source, then present the draft in a few lines: what the client can try, with the preview and the documents in \`docs/\` opened or linked. Name what is provisional in a sentence, such as a stand-in model or prices, and point to the product definition for the rest rather than listing every default.
4
4
  2. Ask what they think and what they would change first. Fix small requests now; add larger ones to the next increments.
5
- 3. Once their reaction is in, offer to deploy the draft as a first live version, following [Deployment](../../core/cli.md#deployment), and deploy after a yes. When the deploy is refused because a model is already deployed, such as the starter, follow [Model migration](../model-migration.md).
5
+ 3. Once their reaction is in, offer to deploy the draft as a first live version, following [Deployment](../../core/cli.md#deployment), and deploy after a yes. A new project has nothing deployed, so the draft's model becomes v1. When the deploy is refused because a model is already deployed, such as the hello-world starter of an early beta project, follow [Model migration](../model-migration.md).
6
6
  4. At a natural pause, ask about the [preferences](../../core/workflow.md#preferences), with a recommendation, and record the answers.
7
7
  5. Refresh the [next increments](../../core/workflow.md#building-in-increments) in the project record, usually the rest of the range and its rules, and recommend the first in terms of the client's product.`,n=`- The client has seen the draft and answered whether to deploy; the deploy went live or was declined.
8
8
  - The client's reactions and preferences are recorded in the project record, which marks the first draft complete.
@@ -2,7 +2,8 @@ export * from './first-draft/index.js';
2
2
  export * from './specification/index.js';
3
3
  export * from './finalization.js';
4
4
  export * from './asset-conversion.js';
5
+ export * from './scene-realism.js';
6
+ export * from './assistant-configuration.js';
5
7
  export * from './model-migration.js';
6
8
  export * from './review/index.js';
7
9
  export * from './feedback/index.js';
8
- export * from './beta.js';
@@ -1 +1 @@
1
- export*from"./first-draft/index.js";export*from"./specification/index.js";export*from"./finalization.js";export*from"./asset-conversion.js";export*from"./model-migration.js";export*from"./review/index.js";export*from"./feedback/index.js";export*from"./beta.js";
1
+ export*from"./first-draft/index.js";export*from"./specification/index.js";export*from"./finalization.js";export*from"./asset-conversion.js";export*from"./scene-realism.js";export*from"./assistant-configuration.js";export*from"./model-migration.js";export*from"./review/index.js";export*from"./feedback/index.js";
@@ -1 +1 @@
1
- import{createPhoenixProcessGuide as e}from"../guide.js";export const generatePhoenixModelMigration=()=>e({path:"processes/model-migration.md",title:"Model migration",summary:"Preserve deployed model versions and migrate saved configurations; read when changing a domain model that has already been deployed.",whenToUse:"When changing a domain model that has already been deployed, including replacing a deployed starter model after a [first draft](first-draft/handoff.md); a deploy refused for a changed model leads here too.",steps:"A deployed model version cannot change, because saved configurations depend on it. `pnpm phoenix deploy` is refused, before anything is uploaded, when the model differs from the one already deployed under the same version. The version is not written anywhere: `model.latest` is always the highest numbered version plus one, so a spec with only `latest` is v1, and `applicationVersion` plays no part. `pnpm phoenix dev` accepts every model change, so a working preview does not show that the deploy will pass. Adding a version is a model change, so restart dev and open the new preview address, as [Local development](../core/cli.md#keep-the-preview-in-front-of-the-client) describes.\n\n### Change a deployed model\n\nTo change a model that has been deployed as v<N>:\n\n1. Keep the deployed model, unchanged, as `model.v<N>` in the spec. A file of its own, such as `spec/model-v<N>.yaml`, keeps `latest` readable.\n2. Make the change in `model.latest`, which is now v<N+1>.\n3. Add `src/migrations/v<N+1>.ts` exporting `migrateToV<N+1>`. It receives the saved entities of v<N> and returns entities that are valid in v<N+1>; `ModelV<N>` and `ModelV<N+1>` are generated global namespaces.\n\nThe admin model is versioned on its own, under `src/admin/migrations/`, with its types in `AdminV<N>`.\n\n### Replace the starter\n\nWhen the first deployment of the workspace was the starter, its `Box` model is v1 in production. When the real model replaces it, keep the starter's model as `model.v1` and define the real model in `latest`. Configurations saved from the starter are not worth converting, so the migration returns the starting state of the new model, the `initialDomainEntities` of its preset, and drops the boxes:\n\n```typescript\n// src/migrations/v2.ts\nimport type { Migration } from '@salsita-ai/sdk/domain'\n\nexport const migrateToV2: Migration<ModelV1.AnyDomainEntity, ModelV2.AnyDomainEntity> = () => [\n // the entities of the new model's preset\n]\n```\n\nAn entity of a type the new version no longer has must not stay in the returned state. An entity id starts with its type (`Box-1`), so an entity that keeps its data under a new type name needs a new id, and every relation pointing at it rewritten. Read `docs/phoenix/migrations.mdx` with `pnpm phoenix docs -r docs/phoenix/migrations.mdx` before writing any other migration.",doneWhen:"- The deployed model is kept unchanged under its version, the change is in `model.latest`, and a migration converts saved configurations.\n- A configuration saved with the previous version loads after the change.",example:"When a deployed starter `Box` model is replaced by a chair, keep the starter as `model.v1`, make the chair model `latest` (v2) and implement `migrateToV2` returning the chair preset's entities. Load a configuration saved from the starter to verify that it opens as the default chair."});
1
+ import{createPhoenixProcessGuide as e}from"../guide.js";export const generatePhoenixModelMigration=()=>e({path:"processes/model-migration.md",title:"Model migration",summary:"Preserve deployed model versions and migrate saved configurations; read when changing a domain model that has already been deployed.",whenToUse:"When changing a domain model that has already been deployed, including replacing the starter model an early project was first deployed with, after a [first draft](first-draft/handoff.md); a promotion refused for a changed model leads here too.",steps:"A model version that production serves cannot change, because buyers' saved configurations depend on it. `pnpm phoenix deploy` builds into a preview, which replaces a changed schema because its saved configurations are test data, so a deploy does not show it; promoting the build to production in Studio is refused when the model differs from the one production already has under the same version. The version is not written anywhere: `model.latest` is always the highest numbered version plus one, so a spec with only `latest` is v1, and `applicationVersion` plays no part. `pnpm phoenix dev` accepts every model change, so a working local preview, or a deployed preview, does not show that promoting to production will pass. Adding a version is a model change, so restart dev and open the new preview address, as [Local development](../core/cli.md#keep-the-preview-in-front-of-the-client) describes.\n\n### Change a deployed model\n\nTo change a model that has been deployed as v<N>:\n\n1. Keep the deployed model, unchanged, as `model.v<N>` in the spec. A file of its own, such as `spec/model-v<N>.yaml`, keeps `latest` readable.\n2. Make the change in `model.latest`, which is now v<N+1>.\n3. Add `src/migrations/v<N+1>.ts` exporting `migrateToV<N+1>`. It receives the saved entities of v<N> and returns entities that are valid in v<N+1>; `ModelV<N>` and `ModelV<N+1>` are generated global namespaces.\n\nThe admin model is versioned on its own, under `src/admin/migrations/`, with its types in `AdminV<N>`.\n\n### Replace the starter\n\nA new project starts empty, so the model of its first deploy is v1 and nothing needs replacing. Only a project whose production was first deployed as the hello-world starter, as some early projects were, has the starter's `Box` model as v1 in production. When the real model replaces it, keep the starter's model as `model.v1` and define the real model in `latest`. Configurations saved from the starter are not worth converting, so the migration returns the starting state of the new model, the `initialDomainEntities` of its preset, and drops the boxes:\n\n```typescript\n// src/migrations/v2.ts\nimport type { Migration } from '@salsita-ai/sdk/domain'\n\nexport const migrateToV2: Migration<ModelV1.AnyDomainEntity, ModelV2.AnyDomainEntity> = () => [\n // the entities of the new model's preset\n]\n```\n\nAn entity of a type the new version no longer has must not stay in the returned state. An entity id starts with its type (`Box-1`), so an entity that keeps its data under a new type name needs a new id, and every relation pointing at it rewritten. Read `docs/phoenix/migrations.mdx` with `pnpm phoenix docs -r docs/phoenix/migrations.mdx` before writing any other migration.",doneWhen:"- The deployed model is kept unchanged under its version, the change is in `model.latest`, and a migration converts saved configurations.\n- A configuration saved with the previous version loads after the change.",example:"When a deployed starter `Box` model is replaced by a chair, keep the starter as `model.v1`, make the chair model `latest` (v2) and implement `migrateToV2` returning the chair preset's entities. Load a configuration saved from the starter to verify that it opens as the default chair."});
@@ -1,4 +1,4 @@
1
- import{createPhoenixProcessGuide as e}from"../../guide.js";let t=`Review the running configurator against the product references and representative states, beyond the state used during implementation. [Visual inspection](visual-inspection.md) covers the state just changed; this pass checks fidelity and composition across the relevant states.
1
+ import{createPhoenixProcessGuide as e}from"../../guide.js";let t=`Review the running configurator against the product references and representative states, beyond the state used during implementation. [Visual inspection](visual-inspection.md) covers the state just changed; this pass checks fidelity and composition across the relevant states. For an evidenced material, contact or grounding defect selected for correction, [scene realism](../scene-realism.md) offers optional guidance; this review does not itself start a realism pass.
2
2
 
3
3
  ### Roles
4
4
 
@@ -1,2 +1,2 @@
1
1
  import{createPhoenixProcessGuide as e}from"../../guide.js";let n=`- Every checklist that concerns the change was applied, and the project checks and dev log were checked.
2
- - The findings are reported in the format above, or "No issues found" says what was checked.`;export const generatePhoenixCodeReview=()=>e({path:"processes/review/code.md",title:"Code review",summary:"Phoenix bindings, domain behavior, types and runtime checks with a findings report; read for changed specs or code before committing.",whenToUse:"Before committing changed specs or code, with scope, effort and reviewer chosen by the [review strategy](../../core/workflow.md#review-strategy).",steps:'Check the changed behavior for correctness, Phoenix pattern violations and security issues; apply only the checklists that concern the change.\n\n### Procedure\n\n1. Get the diff of the selected work, including its affected callers and generated output.\n2. Identify which spec and source areas changed.\n3. Run the relevant project checks, including `pnpm phoenix build` when the change affects production output.\n4. When `phoenix dev` is running, check `.phoenix/phoenix-dev.log` for runtime errors.\n5. Report the findings in the format below.\n\n### Domain model (`spec/*.yaml`)\n\n- [ ] Relations define parent-child ownership correctly (1-N, 0-1)\n- [ ] Expressions have matching implementations in `src/expressions/`\n- [ ] Invariants have matching implementations in `src/invariants/`\n- [ ] Actions declared under `actions:` have matching implementations in `src/actions/` (a missing one stops the application at start; it is not a type error)\n- [ ] Component bindings use correct entity types or aliases\n- [ ] `$read`, `$write` and `$bind` reference valid properties or expressions\n- [ ] A deployed model is unchanged under its version: the change is in `model.latest`, the deployed model is kept as `model.v<N>`, and `src/migrations/v<N+1>.ts` migrates saved configurations\n\n### Expressions, actions and invariants\n\n- [ ] Use `phx.domain.implementCustomExpressions()` and `implementCustomInvariants()` for domain code, and `phx.frontend.implementActions()` for actions\n- [ ] Actions only prepare: they return updates and a `readResult` reader, never stage or commit, and throw messages that say what to send instead\n- [ ] Expression names prefixed with `$` in YAML match the implementation\n- [ ] Expressions have no side effects; they are pure computed values\n- [ ] Invariant violations return proper severity and messages\n\n### Components (`src/components/`, `spec/components.yaml`)\n\n- [ ] Custom components use `memoEval` with correct dependency arrays\n- [ ] Scene objects built in code rebuild only when their shape changes and release the geometry, materials and textures a rebuild replaces ([Scene objects built in code](../../features/scene-objects.md))\n- [ ] Component attachment uses `withEntity()` or `withAlias()` correctly\n- [ ] Filters use `withGradualFilter()` with static criteria first for performance\n- [ ] No unnecessary React re-renders: stable object references through `memoEval`\n- [ ] Export pattern: a default export of a single component or an array\n\n### Assistant setup (`src/handlers/`)\n\n- [ ] At most one `phx.domain.createAssistantSetupHandler`, synchronous, pure and deterministic over manifest and session inputs\n- [ ] Only removes original declaration entries, exposes descriptions and restriction flags, and rejects immutable keys\n- [ ] Narrows fields on the declaring alias before expansion; runs in browser execution and the webhook; browser GraphQL, tools and change recording use session narrowing while UI keeps pure spec selectors; empty instructions clear the baseline in both runs\n\n### Webhooks (`src/webhooks/`)\n\n[Webhooks](../../features/webhooks/index.md) has the rules behind these checks.\n\n- [ ] `src/webhooks/index.ts` default-exports the `phx.webhooks.webhookBuilder` result; other webhook files are reached through its imports\n- [ ] Credentials come from `env.webhook` through `phx.webhooksEnv`; none is hard-coded or returned in session data, backend data or the finalization result\n- [ ] Webhook files and what they import use no browser SDK entry points or style, font and image files\n- [ ] Every declared resource has a task producing it, and every task includes only declared resources\n- [ ] A task that does not apply to a request returns `null`; a callback that misses a resource throws a message naming it\n- [ ] Emails, HTTP requests and orders go to test recipients and endpoints until the client authorizes real ones\n\n### TypeScript and React\n\n- [ ] No `any` type usage; use proper types or generics\n- [ ] No `as` type casts; use type guards or discriminated unions\n- [ ] `readonly` on type and interface fields\n- [ ] Exhaustive pattern matching where appropriate\n- [ ] `useEffect` cleanup for subscriptions, timers and listeners\n- [ ] Correct dependency arrays, without missing or unnecessary dependencies\n- [ ] Memoization (`useMemo`, `useCallback`) for expensive computations\n- [ ] No direct DOM manipulation (`innerHTML`, `document.querySelector`)\n- [ ] Newlines between logical sections; no commented-out code without an explanation\n- [ ] Error messages say what went wrong, why, and how to fix it\n\n### Generated files and runtime\n\n- [ ] No edits to generated files: `.phoenix/` outside the project-owned `.phoenix/workspace/` and `.phoenix/variants/`, and compiled `src/locales/*.ts`\n- [ ] No errors in `.phoenix/phoenix-dev.log` after the change (`grep ERROR .phoenix/phoenix-dev.log`), including `[browser]` console entries\n- [ ] Spec parsing succeeds without warnings\n\n### Report format\n\n```\n# Code review report\n\n**Files reviewed**: <count>\n\n## Findings\n\n### Critical\n- **[<file_path>:<line>]** <title>\n - **Issue**: <description>\n - **Rule**: <which rule or pattern is violated>\n - **Remediation**: <how to fix>\n\n### High\n...\n\n### Medium\n...\n\n### Low\n...\n\n## Summary\n- Critical: N | High: N | Medium: N | Low: N\n- **Overall assessment**: <one or two sentences>\n```\n\nOmit a severity section without findings. Without any findings, state "No issues found" with a brief note on what was checked.',doneWhen:n,example:"After adding a finish control to a repeated chair part, verify that its binding targets the selected part, that changing it preserves the other parts, and that the rendered material matches the selected value."});
2
+ - The findings are reported in the format above, or "No issues found" says what was checked.`;export const generatePhoenixCodeReview=()=>e({path:"processes/review/code.md",title:"Code review",summary:"Phoenix bindings, domain behavior, types and runtime checks with a findings report; read for changed specs or code before committing.",whenToUse:"Before committing changed specs or code, with scope, effort and reviewer chosen by the [review strategy](../../core/workflow.md#review-strategy).",steps:'Check the changed behavior for correctness, Phoenix pattern violations and security issues; apply only the checklists that concern the change.\n\n### Procedure\n\n1. Get the diff of the selected work, including its affected callers and generated output.\n2. Identify which spec and source areas changed.\n3. Run the relevant project checks, including `pnpm phoenix build` when the change affects production output.\n4. When `phoenix dev` is running, check `.phoenix/phoenix-dev.log` for runtime errors.\n5. Report the findings in the format below.\n\n### Domain model (`spec/*.yaml`)\n\n- [ ] Relations define parent-child ownership correctly (1-N, 0-1)\n- [ ] Expressions have matching implementations in `src/expressions/`\n- [ ] Invariants have matching implementations in `src/invariants/`\n- [ ] Actions declared under `actions:` have matching implementations in `src/actions/` (a missing one stops the application at start; it is not a type error)\n- [ ] Component bindings use correct entity types or aliases\n- [ ] `$read`, `$write` and `$bind` reference valid properties or expressions\n- [ ] A deployed model is unchanged under its version: the change is in `model.latest`, the deployed model is kept as `model.v<N>`, and `src/migrations/v<N+1>.ts` migrates saved configurations\n\n### Expressions, actions and invariants\n\n- [ ] Use `phx.domain.implementCustomExpressions()` and `implementCustomInvariants()` for domain code, and `phx.frontend.implementActions()` for actions\n- [ ] Actions only prepare: they return updates, plus a `readResult` reader when they declare a result, never stage or commit, and throw messages that say what to send instead\n- [ ] Expression names prefixed with `$` in YAML match the implementation\n- [ ] Expressions have no side effects; they are pure computed values\n- [ ] Invariant violations return proper severity and messages\n\n### Components (`src/components/`, `spec/components.yaml`)\n\n- [ ] Custom components use `memoEval` with correct dependency arrays\n- [ ] Scene objects built in code rebuild only when their shape changes and release the geometry, materials and textures a rebuild replaces ([Scene objects built in code](../../features/scene-objects.md))\n- [ ] Component attachment uses `withEntity()` or `withAlias()` correctly\n- [ ] Filters use `withGradualFilter()` with static criteria first for performance\n- [ ] No unnecessary React re-renders: stable object references through `memoEval`\n- [ ] Export pattern: a default export of a single component or an array\n\n### Assistant setup (`src/handlers/`)\n\n- [ ] At most one `phx.domain.createAssistantSetupHandler`, synchronous, pure and deterministic over manifest and session inputs\n- [ ] Only removes original declaration entries, exposes descriptions and restriction flags, and rejects immutable keys\n- [ ] Narrows fields on the declaring alias before expansion; runs in browser execution and the webhook; browser GraphQL, tools and change recording use session narrowing while UI keeps pure spec selectors; empty instructions clear the baseline in both runs\n\n### Webhooks (`src/webhooks/`)\n\n[Webhooks](../../features/webhooks/index.md) has the rules behind these checks.\n\n- [ ] `src/webhooks/index.ts` default-exports the `phx.webhooks.webhookBuilder` result; other webhook files are reached through its imports\n- [ ] Credentials come from `env.webhook` through `phx.webhooksEnv`; none is hard-coded or returned in session data, backend data or the finalization result\n- [ ] Webhook files and what they import use no browser SDK entry points or style, font and image files\n- [ ] Every declared resource has a task producing it, and every task includes only declared resources\n- [ ] A task that does not apply to a request returns `null`; a callback that misses a resource throws a message naming it\n- [ ] Emails, HTTP requests and orders go to test recipients and endpoints until the client authorizes real ones\n\n### TypeScript and React\n\n- [ ] No `any` type usage; use proper types or generics\n- [ ] No `as` type casts; use type guards or discriminated unions\n- [ ] `readonly` on type and interface fields\n- [ ] Exhaustive pattern matching where appropriate\n- [ ] `useEffect` cleanup for subscriptions, timers and listeners\n- [ ] Correct dependency arrays, without missing or unnecessary dependencies\n- [ ] Memoization (`useMemo`, `useCallback`) for expensive computations\n- [ ] No direct DOM manipulation (`innerHTML`, `document.querySelector`)\n- [ ] Newlines between logical sections; no commented-out code without an explanation\n- [ ] Error messages say what went wrong, why, and how to fix it\n\n### Generated files and runtime\n\n- [ ] No edits to generated files: `.phoenix/` outside the project-owned `.phoenix/workspace/` and `.phoenix/variants/`, and compiled `src/locales/*.ts`\n- [ ] No errors in `.phoenix/phoenix-dev.log` after the change (`grep ERROR .phoenix/phoenix-dev.log`), including `[browser]` console entries\n- [ ] Spec parsing succeeds without warnings\n\n### Report format\n\n```\n# Code review report\n\n**Files reviewed**: <count>\n\n## Findings\n\n### Critical\n- **[<file_path>:<line>]** <title>\n - **Issue**: <description>\n - **Rule**: <which rule or pattern is violated>\n - **Remediation**: <how to fix>\n\n### High\n...\n\n### Medium\n...\n\n### Low\n...\n\n## Summary\n- Critical: N | High: N | Medium: N | Low: N\n- **Overall assessment**: <one or two sentences>\n```\n\nOmit a severity section without findings. Without any findings, state "No issues found" with a brief note on what was checked.',doneWhen:n,example:"After adding a finish control to a repeated chair part, verify that its binding targets the selected part, that changing it preserves the other parts, and that the rendered material matches the selected value."});
@@ -0,0 +1,2 @@
1
+ import { type PhoenixGuide } from '../guide.js';
2
+ export declare const generatePhoenixSceneRealism: () => PhoenixGuide;
@@ -0,0 +1,29 @@
1
+ import{createPhoenixProcessGuide as e}from"../guide.js";let a=`### Find the visible problem
2
+
3
+ Compare a baseline view with the client's references. Prioritize the largest visible issue at the normal viewing distance. For a broad realism request, identify the main problems in lighting, materials and contact shading, and assess whether ambient occlusion (AO) would help. For a specific correction, stay with that problem. Preserve the chosen finish; reference photographs do not authorize new colours or textures.
4
+
5
+ Check geometry, normals, UVs and the material actually rendered, including overrides, before adding effects. Distinguish self-occlusion, grounding and directional cast shadows; AO cannot replace cast shadows or repair a silhouette or an unsuitable reflection. Use [asset inspection](../features/inspection.md) when those inputs are uncertain.
6
+
7
+ ### Choose a proportionate fix
8
+
9
+ Consider the plausible ways to improve the scene. Try the options suited to the areas with room for improvement, compare their results, and keep the changes that meaningfully improve the overall appearance relative to their cost and complexity. For baking, prefer reusable part bakes and contact profiles over whole-configuration bakes. Compare their download and memory cost with the rendering and maintenance cost of dynamic effects. Baking is an option to evaluate, not a required output. Trial costly techniques on one representative part before expanding.
10
+
11
+ Bake only relationships that stay valid during configuration. Keep contact widths in physical units as parts resize; attach optional-part shading to its placement and visibility. Rectangular masks fit rectangular contacts, not arbitrary curved surfaces. Avoid uniformly outlining panels or multiplying overlapping shadows. Prefer material occlusion inputs; a dark overlay also affects direct light and is a contact-darkening approximation, not material AO. Keep highlights and fixed lighting directions out of interchangeable finishes, and avoid opaque darkening on glass.
12
+
13
+ Keep source assets intact and bakes reproducible. An AO or UV addition should preserve geometry, normals, morphs and material assignments; avoid unnecessary model round-trips. Follow [asset conversion](asset-conversion.md) when an asset needs preparation.
14
+
15
+ ### Use supported Phoenix paths
16
+
17
+ Check the installed SDK before ruling out a capability. Read the material override documentation with \`pnpm phoenix docs -r 'docs/3d-scene/materials/override.mdx'\`; inspect the relevant schema and implementation if support remains unclear. A missing UV channel is an asset-preparation issue, not proof that Phoenix lacks AO.
18
+
19
+ - **Materials** — local and remote overrides support \`aoMapUrl\` and \`aoMapIntensity\`. Replacing a material can lose authored maps. Local overrides can select \`materialType: physical\`; remote overrides depend on the loaded material class.
20
+ - **Mapping** — override repeat, offset and rotation apply to each supplied map; there is no independent AO transform or UV-channel selector. Preserve authored glTF occlusion mapping or use a custom material when separate mapping is needed. Sample AO as non-color data.
21
+ - **Custom geometry** — [scene objects built in code](../features/scene-objects.md) covers geometry, updates and resource ownership. Contact patches and configuration-time baking are project techniques, not built-in baking services; use them when simpler supported paths are insufficient.
22
+
23
+ ### Compare and stop
24
+
25
+ Use [visual inspection](review/visual-inspection.md) for matching before/after views, changing one contributing factor at a time. Toggle AO separately when judging contact shading. Check affected configurations, especially size extremes and optional-part removal, for stretched shadows, outlines or artifacts. Confirm each test configuration actually applied before judging its render. Tests support these checks but do not establish visual quality. A full [appearance review](review/appearance.md) follows its own trigger.
26
+
27
+ Stop when the agreed visual target is met. Explain what is baked, approximated or rendered at runtime, and what remains unverified. Remove temporary tuning controls and replaced effects; retain reproducible assets.`,t=`- Matching views demonstrate the agreed improvement without new artifacts or an unintended finish change.
28
+ - Shading remains valid in the affected configurations checked; remaining issues and unverified states are disclosed.
29
+ - Any bakes used are reproducible and preserve the source asset's geometry and material contracts.`;export const generatePhoenixSceneRealism=()=>e({path:"processes/scene-realism.md",title:"Scene realism",summary:"Optional material, contact and grounding refinement; read for a requested realism improvement or a specific evidenced defect within the agreed scope.",whenToUse:"Make scenes convincing through resizing, finish changes and optional parts, with low runtime cost and complexity. Use this optional guide for requested realism work or an evidenced defect within scope. Routine scene work and hand-over do not trigger a pass. Keep satisfactory or deferred appearance settled, and use the scope and effort chosen by the [workflow](../core/workflow.md).",steps:a,doneWhen:t,example:"For a resizable cabinet with an optional bracket, first compare the lighting, finish and joint shading. If a lighting correction resolves the problem, stop. If contacts still look flat, assess reusable AO with the rendered material and its UVs. A tiling finish and separately unwrapped AO need independent mapping. Keep bracket shading tied to the bracket, then compare narrow and wide cabinets with the bracket present and absent. Removing it should remove its shadow, not the cabinet's own occlusion."});
@@ -0,0 +1,17 @@
1
+ export interface PhoenixSkillOptions {
2
+ readonly checkLatestCanary: boolean;
3
+ }
4
+ /**
5
+ * Whether a project follows the canary builds: it installs the SDK from npm, and the build it was generated by is
6
+ * itself a canary. A workspace project follows the local SDK, a stable release stays on releases, and a PR build
7
+ * (`<version>-pr-<n>.<sha>`) is the build under test, so none of them may be moved onto canary.
8
+ */
9
+ export declare const followsCanaryBuilds: (project: {
10
+ readonly useWorkspace: boolean;
11
+ readonly sdkVersion: string;
12
+ }) => boolean;
13
+ /**
14
+ * The CLI core's section that keeps a canary project on the newest SDK build. Left out of workspace projects, where
15
+ * `pnpm add` would replace the workspace link, and of stable releases, whose projects must not be moved onto canary.
16
+ */
17
+ export declare const LATEST_CANARY_SECTION = "## Stay on the latest canary\n\nThis project uses the SDK's `canary` build. Once per conversation, before changing anything, compare the `version` in `node_modules/@salsita-ai/sdk/package.json` with `npm view @salsita-ai/sdk@canary version`. When they differ, tell the client and install that exact version, not the `@canary` tag, which a stale registry cache may resolve: `pnpm add @salsita-ai/sdk@<version> && pnpm phoenix deps && pnpm install && pnpm phoenix sync`. Update a global `phoenix` with `npm install -g @salsita-ai/sdk@<version>`.";
@@ -0,0 +1 @@
1
+ export const followsCanaryBuilds=e=>!e.useWorkspace&&e.sdkVersion.includes("-develop.");export const LATEST_CANARY_SECTION="## Stay on the latest canary\n\nThis project uses the SDK's `canary` build. Once per conversation, before changing anything, compare the `version` in `node_modules/@salsita-ai/sdk/package.json` with `npm view @salsita-ai/sdk@canary version`. When they differ, tell the client and install that exact version, not the `@canary` tag, which a stale registry cache may resolve: `pnpm add @salsita-ai/sdk@<version> && pnpm phoenix deps && pnpm install && pnpm phoenix sync`. Update a global `phoenix` with `npm install -g @salsita-ai/sdk@<version>`.";
@@ -1 +1 @@
1
- export const sdkSubpathImportsInGuidance={"@salsita-ai/sdk/domain":["memoEval","Migration","attributeSelectionComponent","sceneEntityRemoteObjectComponent","sceneEntityObjectComponent"],"@salsita-ai/sdk/configurator":["LayoutSlots","FinalizeActions","LayoutDialog","DesktopPreview","MobilePreview","PresetPreviewLayout","PresetSnackbarsRoot","ResetUndoListener","Postprocessing","SelectionOutline","HoverOutline"],"@salsita-ai/sdk/react":["PhoenixHandlerBoundary","useResourceUrl","AttributeCardSelector","MaterialSwatchSelector","DistanceDimensionSlider","DimensionListSelector","TextValueInput","AngleDimensionSlider","ColorPickerInput","SimpleRecipePanel","DeleteEntityButton"],"@salsita-ai/sdk/ui":["PropertyContainer","SceneFab","PhxIcon","ListSelector"],"@salsita-ai/sdk/webhook":["HtmlHelpers","ResourceHelpers","PdfHelpers","EmailHelpers"]};
1
+ export const sdkSubpathImportsInGuidance={"@salsita-ai/sdk/domain":["memoEval","Migration","attributeSelectionComponent","sceneEntityRemoteObjectComponent","sceneEntityObjectComponent"],"@salsita-ai/sdk/configurator":["LayoutSlots","FinalizeActions","LayoutDialog","DesktopPreview","MobilePreview","PresetPreviewLayout","PresetSnackbarsRoot","ResetUndoListener","Postprocessing","SelectionOutline","HoverOutline"],"@salsita-ai/sdk/react":["PhoenixHandlerBoundary","useResourceUrl","AttributeCardSelector","MaterialSwatchSelector","DistanceDimensionSlider","DimensionListSelector","TextValueInput","AngleDimensionSlider","ColorPickerInput","SimpleRecipePanel","DeleteEntityButton"],"@salsita-ai/sdk/ui":["PropertyContainer","SceneFab","PhxIcon","ListSelector"],"@salsita-ai/sdk/webhook":["HtmlHelpers","ResourceHelpers","PdfHelpers","EmailHelpers"],"@salsita-ai/sdk/extras/cognito":["AccountControl","SignInNotice"]};
@@ -5,8 +5,8 @@ let e=e=>`webhookHandlers${e}`;export const generateApplicationSpecWebhookBuilde
5
5
  oauthClientId: phx.webhooksEnv.OAUTH_PROVIDER_CLIENT_ID,
6
6
  oauthClientSecret: phx.webhooksEnv.OAUTH_PROVIDER_CLIENT_SECRET,
7
7
  oauthProviderBaseUrl: phx.webhooksEnv.OAUTH_PROVIDER_BASE_URL,
8
- },`:"",a=o.map((t,o)=>{let i=e(o),a=t.replace(/\.tsx?$/,".js");return`import ${i} from '../${a}'`}).join("\n"),r=o.length>0,n=o.map((t,o)=>`{ origin: '${t}', exports: ${e(o)} }`),s=`[${n.join(", ")}]`,l=r?`
9
- .withHandlers(${s})`:"";return`// Auto-generated by application-spec pipeline. Do not edit.
8
+ },`:"",a=o.map((t,o)=>{let i=e(o),a=t.replace(/\.tsx?$/,".js");return`import ${i} from '../${a}'`}).join("\n"),s=o.length>0,r=o.map((t,o)=>`{ origin: '${t}', exports: ${e(o)} }`),n=`[${r.join(", ")}]`,l=s?`
9
+ .withHandlers(${n})`:"";return`// Auto-generated by application-spec pipeline. Do not edit.
10
10
  import { createDomainWebhook } from '@salsita-ai/sdk/webhook'
11
11
  import type { DeploymentAssistant } from '@salsita-ai/sdk/contracts/assistant'
12
12
 
@@ -40,6 +40,7 @@ export const {
40
40
  assistantStrictThreads: phx.webhooksEnv.ASSISTANT_STRICT_THREADS,
41
41
  ${i}
42
42
  ${t.appMetadata.useCognito?" useCognito: true,":""}
43
+ access: '${t.appMetadata.access}',
43
44
  })
44
45
 
45
46
  // @ts-ignore - Initialize the globals
@@ -2,6 +2,5 @@
2
2
  export interface WebhookIndexOptions {
3
3
  /** Whether the project has `src/webhooks/index.ts`; without it the entry holds the built-in webhook. */
4
4
  readonly hasWebhookEntry: boolean;
5
- readonly useCognito: boolean;
6
5
  }
7
- export declare const generateApplicationSpecWebhookIndex: ({ hasWebhookEntry, useCognito }: WebhookIndexOptions) => string;
6
+ export declare const generateApplicationSpecWebhookIndex: ({ hasWebhookEntry }: WebhookIndexOptions) => string;
@@ -1,4 +1,4 @@
1
- import{autoHeader as e}from"../common/file-headers.js";export const generateApplicationSpecWebhookIndex=({hasWebhookEntry:o,useCognito:s})=>o?`${e("webhook.ts","Webhook entry point — imports builders (sets globalThis.phx.webhooks) then re-exports user handler.")}
1
+ import{autoHeader as e}from"../common/file-headers.js";export const generateApplicationSpecWebhookIndex=({hasWebhookEntry:o})=>o?`${e("webhook.ts","Webhook entry point — imports builders (sets globalThis.phx.webhooks) then re-exports user handler.")}
2
2
  export * as builders from './webhook-builders.js'
3
3
 
4
4
  import implementation from '../src/webhooks/index.js'
@@ -7,10 +7,6 @@ export const handler = implementation
7
7
  `:`${e("webhook.ts","Webhook entry point — imports builders (sets globalThis.phx.webhooks) then exports the built-in handler, because the project has no src/webhooks/index.ts.")}
8
8
  export * as builders from './webhook-builders.js'
9
9
 
10
- // A webhook needs at least one handler; anonymous auth stays inert until spec/application.yaml sets useAuthHook
11
- const authHandler = phx.webhooks.authHandlerBuilder
12
- .withAnonymousHandler(async () => (${s?"{ success: false }":"{ success: true, data: {}, role: 'anonymous' }"}))
13
- .build()
14
-
15
- export const handler = phx.webhooks.webhookBuilder.withAuthHook(authHandler).build()
10
+ // The access mode in spec/application.yaml builds the auth hook, customised by the phx.access handlers in src/handlers/
11
+ export const handler = phx.webhooks.webhookBuilder.build()
16
12
  `;