@salsita-ai/sdk 0.50.0-develop.da8d27f5d7 → 0.50.0-develop.e5ed4a0b66

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 (298) hide show
  1. package/README.md +19 -11
  2. package/dist/application-spec/errors/diagnostic-codes.d.ts +6 -0
  3. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  4. package/dist/application-spec/errors/diagnostic-messages.d.ts +6 -0
  5. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  6. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  7. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  8. package/dist/application-spec/generate-application/code/templates/application-types.js +6 -6
  9. package/dist/application-spec/generate-application/code/templates/configurator-domain-code.d.ts +1 -0
  10. package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js +11 -8
  11. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.d.ts +3 -1
  12. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +70 -66
  13. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +3 -0
  14. package/dist/application-spec/generate-application/code/templates/domain-spec.js +5 -5
  15. package/dist/application-spec/generate-application/code/templates/domain.js +2 -2
  16. package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.d.ts +11 -0
  17. package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.js +8 -0
  18. package/dist/application-spec/generate-application/code/templates/global-definition/index.d.ts +1 -0
  19. package/dist/application-spec/generate-application/code/templates/global-definition/index.js +1 -1
  20. package/dist/application-spec/generate-application/code/templates/globals.js +1 -0
  21. package/dist/application-spec/generate-application/code/templates/index.d.ts +7 -6
  22. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  23. package/dist/application-spec/generate-application/code/templates/skills/agents-md.js +2 -0
  24. package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -0
  25. package/dist/application-spec/generate-application/code/templates/{phoenix-create-configurator-skill.d.ts → skills/phoenix-create-configurator-skill.d.ts} +1 -1
  26. package/dist/application-spec/generate-application/code/templates/{phoenix-create-configurator-skill.js → skills/phoenix-create-configurator-skill.js} +43 -13
  27. package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +54 -0
  28. package/dist/application-spec/generate-application/code/templates/{phoenix-review-skill.js → skills/phoenix-review-skill.js} +7 -5
  29. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -0
  30. package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.d.ts +1 -0
  31. package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.js +6 -0
  32. package/dist/application-spec/generate-application/code/templates/{common → skills}/sdk-content.d.ts +52 -3
  33. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +82 -0
  34. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +2 -0
  35. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
  36. package/dist/application-spec/generate-application/runtime/sections/actions-runtime.d.ts +14 -0
  37. package/dist/application-spec/generate-application/runtime/sections/actions-runtime.js +1 -0
  38. package/dist/application-spec/generate-application/runtime/sections/index.d.ts +1 -0
  39. package/dist/application-spec/generate-application/runtime/sections/index.js +1 -1
  40. package/dist/application-spec/parse-application-files/categorize/categorize-files.d.ts +3 -1
  41. package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
  42. package/dist/application-spec/parse-application-files/merge/index.d.ts +1 -0
  43. package/dist/application-spec/parse-application-files/merge/index.js +1 -1
  44. package/dist/application-spec/parse-application-files/merge/merged-actions.d.ts +11 -0
  45. package/dist/application-spec/parse-application-files/merge/merged-actions.js +1 -0
  46. package/dist/application-spec/parse-application-files/merge/merged-spec.d.ts +2 -0
  47. package/dist/application-spec/parse-application-files/merge/merged-spec.js +1 -1
  48. package/dist/application-spec/parse-application-files/raw-spec/index.d.ts +1 -0
  49. package/dist/application-spec/parse-application-files/raw-spec/index.js +1 -1
  50. package/dist/application-spec/parse-application-files/raw-spec/raw-actions.d.ts +18 -0
  51. package/dist/application-spec/parse-application-files/raw-spec/raw-actions.js +1 -0
  52. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +14 -2
  53. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  54. package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.d.ts +2 -0
  55. package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
  56. package/dist/application-spec/parse-application-files/resolve/resolve-import-modules.js +1 -1
  57. package/dist/application-spec/parse-application-files/spec/application/application-spec.js +1 -1
  58. package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.d.ts +4 -2
  59. package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.js +1 -1
  60. package/dist/application-spec/parse-application-files/spec/common/index.d.ts +1 -0
  61. package/dist/application-spec/parse-application-files/spec/common/index.js +1 -1
  62. package/dist/application-spec/parse-application-files/spec/common/schema-ref-resolver.d.ts +23 -0
  63. package/dist/application-spec/parse-application-files/spec/common/schema-ref-resolver.js +1 -0
  64. package/dist/application-spec/parse-application-files/spec/model/names/action-name.d.ts +10 -0
  65. package/dist/application-spec/parse-application-files/spec/model/names/action-name.js +1 -0
  66. package/dist/application-spec/parse-application-files/spec/model/names/index.d.ts +1 -0
  67. package/dist/application-spec/parse-application-files/spec/model/names/index.js +1 -1
  68. package/dist/application-spec/parse-application-files/spec/sections/actions.d.ts +35 -0
  69. package/dist/application-spec/parse-application-files/spec/sections/actions.js +1 -0
  70. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.d.ts +3 -14
  71. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.js +1 -1
  72. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +12 -3
  73. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  74. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant.d.ts +5 -3
  75. package/dist/application-spec/parse-application-files/spec/sections/index.d.ts +1 -0
  76. package/dist/application-spec/parse-application-files/spec/sections/index.js +1 -1
  77. package/dist/client/phoenix-api.d.ts +5 -1
  78. package/dist/configurator/application-runtime/extensions/configurator-extension-systems.d.ts +2 -1
  79. package/dist/configurator/application-runtime/extensions/configurator-extension-systems.js +1 -1
  80. package/dist/configurator/application-runtime/extensions/selectors.d.ts +2 -1
  81. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  82. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +168 -0
  83. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -0
  84. package/dist/configurator/{assistant → application-runtime/extensions/systems/assistant-system}/browser-details.d.ts +1 -1
  85. package/dist/configurator/application-runtime/extensions/systems/assistant-system/browser-details.js +1 -0
  86. package/dist/configurator/application-runtime/extensions/systems/assistant-system/change-recorder.d.ts +85 -0
  87. package/dist/configurator/application-runtime/extensions/systems/assistant-system/change-recorder.js +1 -0
  88. package/dist/configurator/{assistant → application-runtime/extensions/systems/assistant-system}/graphql-tools.d.ts +20 -16
  89. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -0
  90. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +4 -0
  91. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  92. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +16 -1
  93. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  94. package/dist/configurator/application-runtime/extensions/systems/graphql-system/side-effects.d.ts +9 -0
  95. package/dist/configurator/application-runtime/extensions/systems/graphql-system/side-effects.js +1 -0
  96. package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -0
  97. package/dist/configurator/application-runtime/extensions/systems/index.js +1 -1
  98. package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.d.ts +2 -0
  99. package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.js +1 -1
  100. package/dist/configurator/common/frontend-analytics.d.ts +21 -21
  101. package/dist/configurator/index.d.ts +0 -1
  102. package/dist/configurator/index.js +1 -1
  103. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  104. package/dist/configurator/scene/scene-analytics/scene-analytics.d.ts +2 -2
  105. package/dist/configurator/ui/assistant/AssistantChips.d.ts +11 -0
  106. package/dist/configurator/ui/assistant/AssistantChips.js +1 -0
  107. package/dist/configurator/ui/assistant/AssistantComposer.d.ts +6 -0
  108. package/dist/configurator/ui/assistant/AssistantComposer.js +1 -0
  109. package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +7 -0
  110. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -0
  111. package/dist/configurator/ui/assistant/AssistantPanel.d.ts +11 -0
  112. package/dist/configurator/ui/assistant/AssistantPanel.js +1 -0
  113. package/dist/configurator/ui/assistant/AssistantThread.d.ts +6 -0
  114. package/dist/configurator/ui/assistant/AssistantThread.js +1 -0
  115. package/dist/configurator/ui/assistant/assistant-failure.d.ts +18 -0
  116. package/dist/configurator/ui/assistant/assistant-failure.js +1 -0
  117. package/dist/configurator/ui/assistant/index.d.ts +2 -0
  118. package/dist/configurator/ui/assistant/index.js +1 -0
  119. package/dist/configurator/ui/assistant/streamed-markdown.d.ts +6 -0
  120. package/dist/configurator/ui/assistant/streamed-markdown.js +2 -0
  121. package/dist/configurator/ui/assistant/theme.d.ts +2 -0
  122. package/dist/configurator/ui/assistant/theme.js +1 -0
  123. package/dist/configurator/ui/assistant/thread-items.d.ts +37 -0
  124. package/dist/configurator/ui/assistant/thread-items.js +1 -0
  125. package/dist/configurator/ui/assistant/tool-chip.d.ts +37 -0
  126. package/dist/configurator/ui/assistant/tool-chip.js +1 -0
  127. package/dist/configurator/ui/assistant/use-follow-stream.d.ts +17 -0
  128. package/dist/configurator/ui/assistant/use-follow-stream.js +1 -0
  129. package/dist/configurator/ui/assistant/use-is-assistant-panel-open.d.ts +5 -0
  130. package/dist/configurator/ui/assistant/use-is-assistant-panel-open.js +1 -0
  131. package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.js +5 -5
  132. package/dist/configurator/ui/configurator-layout/universal/MobileLayout.d.ts +2 -0
  133. package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +4 -4
  134. package/dist/configurator/ui/legacy/mobile-controls/MobileControls.d.ts +1 -1
  135. package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.d.ts +10 -0
  136. package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -0
  137. package/dist/configurator/ui/phoenix-layout-elements/index.d.ts +1 -0
  138. package/dist/configurator/ui/phoenix-layout-elements/index.js +1 -1
  139. package/dist/docs/index.json +12 -2
  140. package/dist/docs/layouts/toolbar.mdx +6 -0
  141. package/dist/docs/other-features/domain-actions.mdx +418 -0
  142. package/dist/docs/other-features/side-effects.mdx +26 -0
  143. package/dist/docs/phoenix/admin.mdx +2 -2
  144. package/dist/docs/phoenix/best-practices.mdx +1 -0
  145. package/dist/docs/phoenix/finalization.mdx +1 -1
  146. package/dist/docs/phoenix/integration/headless-mode-external.mdx +5 -5
  147. package/dist/docs/phoenix/integration/widget-mode-external.mdx +5 -5
  148. package/dist/docs/phoenix/migrations.mdx +45 -5
  149. package/dist/docs/phoenix/phoenix-cli.mdx +139 -20
  150. package/dist/docs/phoenix/project-structure.mdx +7 -3
  151. package/dist/docs/phoenix/sdk-builder-workflow.mdx +12 -8
  152. package/dist/domain/actions/action-factory.d.ts +10 -0
  153. package/dist/domain/actions/action-factory.js +1 -0
  154. package/dist/domain/actions/prepare-action-implementations.d.ts +15 -0
  155. package/dist/domain/actions/prepare-action-implementations.js +5 -0
  156. package/dist/domain/application/application-config.d.ts +3 -1
  157. package/dist/domain/application/assistant-mutations.d.ts +15 -14
  158. package/dist/domain/application/assistant-mutations.js +1 -1
  159. package/dist/domain/components/updates.d.ts +16 -0
  160. package/dist/domain/core/action.d.ts +67 -0
  161. package/dist/domain/core/action.js +1 -0
  162. package/dist/domain/core/domain-factory.d.ts +4 -0
  163. package/dist/domain/core/index.d.ts +1 -0
  164. package/dist/domain/domain-builder.d.ts +7 -0
  165. package/dist/domain/domain-builder.js +1 -1
  166. package/dist/domain/domain-context/action-system/action-system.d.ts +40 -0
  167. package/dist/domain/domain-context/action-system/action-system.js +1 -0
  168. package/dist/domain/domain-context/domain-context-systems.d.ts +5 -2
  169. package/dist/domain/domain-context/index.d.ts +2 -1
  170. package/dist/domain/domain-context/index.js +1 -1
  171. package/dist/domain/domain-context/store-system/store-system.js +1 -1
  172. package/dist/domain/domain-runtime/domain-context/domain-context.js +1 -1
  173. package/dist/domain/domain-runtime/domain-context/selectors.d.ts +4 -0
  174. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  175. package/dist/domain/domain-runtime/domain-runtime.d.ts +12 -0
  176. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  177. package/dist/domain/domain-runtime/spec/types.d.ts +15 -1
  178. package/dist/domain/index.d.ts +2 -0
  179. package/dist/domain/index.js +1 -1
  180. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +6 -0
  181. package/dist/domain/system-components/phoenix-layout-elements/assistant-toolbar-button.d.ts +44 -0
  182. package/dist/domain/system-components/phoenix-layout-elements/assistant-toolbar-button.js +1 -0
  183. package/dist/domain/system-components/phoenix-layout-elements/index.d.ts +1 -0
  184. package/dist/domain/system-components/phoenix-layout-elements/index.js +1 -1
  185. package/dist/domain/system-components/phoenix-layout-elements/phoenix-layout-element.d.ts +2 -1
  186. package/dist/domain/system-components/phoenix-layout-elements/phoenix-layout-element.js +1 -1
  187. package/dist/editor/Editor.js +1 -1
  188. package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
  189. package/dist/editor/domain-editors/apply-spec-update.js +1 -1
  190. package/dist/editor/domain-editors/use-implementation-files.d.ts +7 -3
  191. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  192. package/dist/editor/graphql/GraphQLPanel.js +1 -1
  193. package/dist/editor/variants/VariantAnswerFooter.d.ts +17 -0
  194. package/dist/editor/variants/VariantAnswerFooter.js +1 -0
  195. package/dist/editor/variants/VariantPreviewHandler.d.ts +6 -0
  196. package/dist/editor/variants/VariantPreviewHandler.js +1 -0
  197. package/dist/editor/variants/variant-preview-styles.d.ts +49 -0
  198. package/dist/editor/variants/variant-preview-styles.js +1 -0
  199. package/dist/i18n/locales/cs/messages.js +1 -1
  200. package/dist/i18n/locales/da/messages.js +1 -1
  201. package/dist/i18n/locales/de/messages.js +1 -1
  202. package/dist/i18n/locales/de-AT/messages.js +1 -1
  203. package/dist/i18n/locales/en/messages.js +1 -1
  204. package/dist/i18n/locales/en-AU/messages.js +1 -1
  205. package/dist/i18n/locales/en-GB/messages.js +1 -1
  206. package/dist/i18n/locales/es/messages.js +1 -1
  207. package/dist/i18n/locales/fr/messages.js +1 -1
  208. package/dist/i18n/locales/hu/messages.js +1 -1
  209. package/dist/i18n/locales/it/messages.js +1 -1
  210. package/dist/i18n/locales/nl/messages.js +1 -1
  211. package/dist/i18n/locales/pl/messages.js +1 -1
  212. package/dist/i18n/locales/pt/messages.js +1 -1
  213. package/dist/i18n/locales/ro/messages.js +1 -1
  214. package/dist/i18n/locales/sk/messages.js +1 -1
  215. package/dist/i18n/locales/tr/messages.js +1 -1
  216. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +6 -0
  217. package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
  218. package/dist/phoenix/application-spec/generate-assistant-prompt.d.ts +4 -3
  219. package/dist/phoenix/application-spec/generate-assistant-prompt.js +1 -1
  220. package/dist/phoenix/cli.js +1 -1
  221. package/dist/phoenix/commands/build.d.ts +5 -0
  222. package/dist/phoenix/commands/build.js +1 -1
  223. package/dist/phoenix/commands/deploy.js +2 -2
  224. package/dist/phoenix/commands/dev.js +5 -5
  225. package/dist/phoenix/commands/feedback.d.ts +2 -1
  226. package/dist/phoenix/commands/feedback.js +1 -1
  227. package/dist/phoenix/commands/index.d.ts +1 -0
  228. package/dist/phoenix/commands/index.js +1 -1
  229. package/dist/phoenix/commands/login.d.ts +24 -6
  230. package/dist/phoenix/commands/login.js +2 -2
  231. package/dist/phoenix/commands/story-dev.js +2 -2
  232. package/dist/phoenix/commands/variants.d.ts +35 -0
  233. package/dist/phoenix/commands/variants.js +1 -0
  234. package/dist/phoenix/editor-server/commands-router.d.ts +68 -1
  235. package/dist/phoenix/editor-server/commands-router.js +1 -1
  236. package/dist/phoenix/editor-server/editor-router.d.ts +65 -0
  237. package/dist/phoenix/editor-server/editor-server.d.ts +3 -3
  238. package/dist/phoenix/editor-server/editor-server.js +1 -1
  239. package/dist/phoenix/editor-server/protocol.d.ts +1 -0
  240. package/dist/phoenix/editor-server/spec-router.js +1 -1
  241. package/dist/phoenix/editor-server/trpc.d.ts +3 -0
  242. package/dist/phoenix/services/application-spec-project-watcher.d.ts +13 -2
  243. package/dist/phoenix/services/application-spec-project-watcher.js +3 -3
  244. package/dist/phoenix/services/index.d.ts +5 -0
  245. package/dist/phoenix/services/index.js +1 -1
  246. package/dist/phoenix/services/phoenix-application.d.ts +21 -0
  247. package/dist/phoenix/services/phoenix-application.js +1 -0
  248. package/dist/phoenix/services/phoenix-store.d.ts +48 -0
  249. package/dist/phoenix/services/phoenix-store.js +1 -0
  250. package/dist/phoenix/services/phx-banner-plugin.d.ts +32 -0
  251. package/dist/phoenix/services/phx-banner-plugin.js +1 -0
  252. package/dist/phoenix/services/phx-licenses-plugin.d.ts +55 -0
  253. package/dist/phoenix/services/phx-licenses-plugin.js +8 -0
  254. package/dist/phoenix/services/phx-variant-previews-plugin.d.ts +9 -0
  255. package/dist/phoenix/services/phx-variant-previews-plugin.js +1 -0
  256. package/dist/phoenix/services/variant-file-session.d.ts +36 -0
  257. package/dist/phoenix/services/variant-file-session.js +1 -0
  258. package/dist/phoenix/services/variant-preview-service.d.ts +80 -0
  259. package/dist/phoenix/services/variant-preview-service.js +1 -0
  260. package/dist/phoenix/services/vite-config.d.ts +2 -0
  261. package/dist/phoenix/services/vite-config.js +1 -1
  262. package/dist/phoenix/utils/index.d.ts +1 -0
  263. package/dist/phoenix/utils/index.js +1 -1
  264. package/dist/phoenix/utils/read-git-commit.d.ts +14 -0
  265. package/dist/phoenix/utils/read-git-commit.js +1 -0
  266. package/dist/react-sdk/application-runtime/common-services/analytics/analytics-service.d.ts +2 -2
  267. package/dist/react-sdk/application-runtime/common-services/analytics/domain-controls-analytics.d.ts +21 -21
  268. package/dist/react-sdk/application-runtime/hooks/data/use-published-data.d.ts +1 -1
  269. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +12 -0
  270. package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +3 -0
  271. package/dist/ui-sdk/common/use-viewport-size.d.ts +4 -1
  272. package/dist/ui-sdk/common/use-viewport-size.js +1 -1
  273. package/dist/ui-sdk/components/mobile-controls/index.d.ts +1 -1
  274. package/dist/ui-sdk/theme/types.d.ts +4 -0
  275. package/package.json +5 -8
  276. package/schema/domain-spec.json +24 -0
  277. package/dist/application-spec/generate-application/code/templates/agents-md.js +0 -2
  278. package/dist/application-spec/generate-application/code/templates/common/sdk-content.js +0 -67
  279. package/dist/application-spec/generate-application/code/templates/phoenix-cli-skill.js +0 -1
  280. package/dist/application-spec/generate-application/code/templates/phoenix-feedback-skill.js +0 -31
  281. package/dist/application-spec/generate-application/code/templates/phoenix-skill.js +0 -1
  282. package/dist/configurator/assistant/browser-details.js +0 -1
  283. package/dist/configurator/assistant/graphql-tools.js +0 -1
  284. package/dist/configurator/assistant/index.d.ts +0 -1
  285. package/dist/configurator/assistant/index.js +0 -1
  286. package/dist/configurator/assistant/use-assistant-chat.d.ts +0 -20
  287. package/dist/configurator/assistant/use-assistant-chat.js +0 -1
  288. package/dist/extras/assistant/AssistantChat.d.ts +0 -6
  289. package/dist/extras/assistant/AssistantChat.js +0 -1
  290. package/dist/extras/assistant/index.d.ts +0 -1
  291. package/dist/extras/assistant/index.js +0 -1
  292. /package/dist/application-spec/generate-application/code/templates/{common → skills}/agent-skill.d.ts +0 -0
  293. /package/dist/application-spec/generate-application/code/templates/{common → skills}/agent-skill.js +0 -0
  294. /package/dist/application-spec/generate-application/code/templates/{agents-md.d.ts → skills/agents-md.d.ts} +0 -0
  295. /package/dist/application-spec/generate-application/code/templates/{phoenix-cli-skill.d.ts → skills/phoenix-cli-skill.d.ts} +0 -0
  296. /package/dist/application-spec/generate-application/code/templates/{phoenix-feedback-skill.d.ts → skills/phoenix-feedback-skill.d.ts} +0 -0
  297. /package/dist/application-spec/generate-application/code/templates/{phoenix-review-skill.d.ts → skills/phoenix-review-skill.d.ts} +0 -0
  298. /package/dist/application-spec/generate-application/code/templates/{phoenix-skill.d.ts → skills/phoenix-skill.d.ts} +0 -0
@@ -1,11 +1,11 @@
1
- import{jsx as t,jsxs as a,Fragment as e}from"react/jsx-runtime";import{snackbarClasses as o,styled as r,useTheme as i,useThemeProps as n}from"@mui/material";import d from"lodash/noop.js";import{AnimatePresence as s}from"motion/react";import{useRef as l}from"react";import{useAccessService as m,useIsFullscreenActive as p}from"#package/react-sdk";import{attrf as c,commonStyles as u,numToPx as b,useIsEmpty as h,useResponsive as g}from"#package/ui-sdk";import{usePreview as y}from"../../../configurator-context/index.js";import{LayoutSlots as f}from"../slots/index.js";import{MobileHeader as x}from"../slots/slots.js";import{MobilePreview as v}from"./MobilePreview.js";import{useSceneSafeArea as w}from"./use-scene-safe-area.js";let S="visible",k="hidden",C=r("div",{name:"PhxMobileHeader",slot:"root"})(({theme:{spacing:t}})=>({...u.transition.fadeInFrom,alignItems:"center",display:"flex",gap:t(1),justifyContent:"space-between",position:"relative","@container style(--inspect: on)":{background:"hsl(from tomato h s l / 50%)"},'[data-header*="slot"]':{display:"flex",gap:t(2),"& > *":{pointerEvents:"auto"}},'[data-header="slot[center]"]':{display:"grid",inset:0,placeItems:"center",position:"absolute"},[`&[data-header*="${S}"]`]:{opacity:1,transitionDuration:"200ms, 300ms",transitionTimingFunction:"linear, ease-out",translate:"0 0"},[`&[data-header*="${k}"]`]:{opacity:0,transitionDuration:"100ms, 100ms",transitionTimingFunction:"linear, ease-in",translate:"0 -60%"}})),$="visible",M="hidden",F=r("div",{name:"PhxMobileControls",slot:"root"})(({theme:{spacing:t}})=>({alignItems:"end",display:"flex",position:"relative","@container style(--inspect: on)":{background:"hsl(from tomato h s l / 50%)"},'[data-controls*="slot"]':{"& > *":{pointerEvents:"auto"}},'[data-controls="slot[toolControls]"]':{...u.transition.fadeInFrom,"&:not(:empty)":{marginInlineEnd:t(2)},"& > *":{...u.transition.fadeIn,transitionDelay:"300ms",transitionDuration:"300ms"}},'[data-controls="slot[viewControls]"]':{...u.transition.fadeInFrom,marginInlineStart:"auto"},'[data-controls="slot[toolbar]"]':{"&:not(:empty)":{marginInlineStart:t(2)}},[`&[data-controls*="${$}"]`]:{'[data-controls="slot[toolControls]"], [data-controls="slot[viewControls]"]':{opacity:1,transitionDuration:"200ms, 300ms",transitionTimingFunction:"linear, ease-out",translate:"0 0"}},[`&[data-controls*="${M}"]`]:{'[data-controls="slot[toolControls]"], [data-controls="slot[viewControls]"]':{opacity:0,transitionDuration:"100ms, 100ms",transitionTimingFunction:"linear, ease-in",translate:"0 60%"}}})),T="PhxMobileSidebar",I="visible",B="hidden",R={Root:r("div",{name:T,slot:"root",shouldForwardProp:t=>"ownerState"!==t})(({ownerState:t})=>[`
1
+ import{jsx as t,jsxs as a,Fragment as e}from"react/jsx-runtime";import{snackbarClasses as o,styled as i,useTheme as r,useThemeProps as n}from"@mui/material";import d from"lodash/noop.js";import{AnimatePresence as s}from"motion/react";import{useRef as l}from"react";import{useAccessService as m,useEagerObservableSelector as c,useIsFullscreenActive as p}from"#package/react-sdk";import{attrf as u,commonStyles as b,numToPx as h,useIsEmpty as g,useResponsive as f,useViewportSize as y}from"#package/ui-sdk";import{useConfigurator as x}from"../../../application-runtime/index.js";import{usePreview as v}from"../../../configurator-context/index.js";import{ASSISTANT_PANEL_SLOT as w,AssistantPanel as S,useIsAssistantPanelOpen as $}from"../../assistant/index.js";import{LayoutSlots as k}from"../slots/index.js";import{MobileHeader as C}from"../slots/slots.js";import{MobilePreview as F}from"./MobilePreview.js";import{useSceneSafeArea as M}from"./use-scene-safe-area.js";let T="visible",I="hidden",R=i("div",{name:"PhxMobileHeader",slot:"root"})(({theme:{spacing:t}})=>({...b.transition.fadeInFrom,alignItems:"center",display:"flex",gap:t(1),justifyContent:"space-between",position:"relative","@container style(--inspect: on)":{background:"hsl(from tomato h s l / 50%)"},'[data-header*="slot"]':{display:"flex",gap:t(2),"& > *":{pointerEvents:"auto"}},'[data-header="slot[center]"]':{display:"grid",inset:0,placeItems:"center",position:"absolute"},[`&[data-header*="${T}"]`]:{opacity:1,transitionDuration:"200ms, 300ms",transitionTimingFunction:"linear, ease-out",translate:"0 0"},[`&[data-header*="${I}"]`]:{opacity:0,transitionDuration:"100ms, 100ms",transitionTimingFunction:"linear, ease-in",translate:"0 -60%"}})),B="visible",E="hidden",P=i("div",{name:"PhxMobileControls",slot:"root"})(({theme:{spacing:t}})=>({alignItems:"end",display:"flex",position:"relative","@container style(--inspect: on)":{background:"hsl(from tomato h s l / 50%)"},'[data-controls*="slot"]':{"& > *":{pointerEvents:"auto"}},'[data-controls="slot[toolControls]"]':{...b.transition.fadeInFrom,"&:not(:empty)":{marginInlineEnd:t(2)},"& > *":{...b.transition.fadeIn,transitionDelay:"300ms",transitionDuration:"300ms"}},'[data-controls="slot[viewControls]"]':{...b.transition.fadeInFrom,marginInlineStart:"auto"},'[data-controls="slot[toolbar]"]':{"&:not(:empty)":{marginInlineStart:t(2)}},[`&[data-controls*="${B}"]`]:{'[data-controls="slot[toolControls]"], [data-controls="slot[viewControls]"]':{opacity:1,transitionDuration:"200ms, 300ms",transitionTimingFunction:"linear, ease-out",translate:"0 0"}},[`&[data-controls*="${E}"]`]:{'[data-controls="slot[toolControls]"], [data-controls="slot[viewControls]"]':{opacity:0,transitionDuration:"100ms, 100ms",transitionTimingFunction:"linear, ease-in",translate:"0 60%"}}})),D="PhxMobileSidebar",j="visible",A="hidden",z="assistant",H={Root:i("div",{name:D,slot:"root",shouldForwardProp:t=>"ownerState"!==t})(({ownerState:t})=>[`
2
2
  --phx-sidebar-background: ${t.background};
3
3
  --phx-sidebar-padding: ${t.padding};
4
4
  --phx-sidebar-radius: ${t.borderRadius}px;
5
- `,{...u.transition.fadeInFrom,background:"var(--phx-sidebar-background)",borderStartStartRadius:"var(--phx-sidebar-radius)",borderStartEndRadius:"var(--phx-sidebar-radius)",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"min-content minmax(0, 1fr) min-content","& > *":{pointerEvents:"auto"},"@container style(--inspect: on)":{background:"hsl(from gold h s l / 50%)"},'&:has([data-sidebar*="slot[content]"])':{...t.isContentEmpty&&{"--phx-sidebar-radius":0,'[data-sidebar*="slot[header]"]':{paddingBlock:0,"& > *":{display:"none"}}}},[`&[data-sidebar*="${I}"]`]:{opacity:1,transitionDuration:"200ms, 300ms",transitionTimingFunction:"linear, ease-out",translate:"0 0"},[`&[data-sidebar*="${B}"]`]:{opacity:0,transitionDuration:"100ms, 100ms",transitionTimingFunction:"linear, ease-in",translate:"0 60%"}}]),Header:r("header",{name:T,slot:"header",shouldForwardProp:t=>"ownerState"!==t})(({theme:{spacing:t}})=>({alignItems:"center",borderStartStartRadius:"inherit",borderStartEndRadius:"inherit",display:"grid",gap:t(1),gridTemplateColumns:"repeat(2, minmax(0, 1fr))",paddingBlock:"calc(var(--phx-sidebar-padding) * 0.5)",paddingInline:"var(--phx-sidebar-padding)","& > *":{...u.transition.fadeIn,transitionDelay:"100ms",transitionDuration:"300ms"},'[data-sidebar="slot[header.start]"]':{},'[data-sidebar="slot[header.end]"]':{justifySelf:"end"}})),Body:r("div",{name:T,slot:"body",shouldForwardProp:t=>"ownerState"!==t})({display:"grid",gridTemplateRows:"minmax(0, 1fr)"}),Content:r("div",{name:T,slot:"content",shouldForwardProp:t=>"ownerState"!==t})(({theme:{spacing:t}})=>({...u.layout.normalizeScrollableContainer,display:"grid",gap:t(2),gridAutoRows:"min-content",paddingBlock:"calc(var(--phx-sidebar-padding) * 0.5)",paddingInline:"var(--phx-sidebar-padding)","&:empty":{paddingBlock:0}})),Tabs:r("div",{name:T,slot:"tabs",shouldForwardProp:t=>"ownerState"!==t})(({theme:{palette:t}})=>({borderBlockStart:`1px solid ${t.divider}`,paddingBlock:"calc(var(--phx-sidebar-padding) * 0.5)",paddingInline:"calc(var(--phx-sidebar-padding) * 0.75)","&:is(:empty)":{border:0,padding:0}})),Footer:r("footer",{name:T,slot:"footer",shouldForwardProp:t=>"ownerState"!==t})(({theme:{palette:t}})=>({borderBlockStart:`1px solid ${t.divider}`,paddingBlock:"calc(var(--phx-sidebar-padding) * 0.5)",paddingInline:"var(--phx-sidebar-padding)","&:is(:empty)":{borderColor:"transparent",paddingBlock:0}}))};export const PhxMobileLayoutName="PhxMobileLayout";let E="initial",P="fullscreen",D=r("div",{name:"PhxMobileLayout",slot:"root",shouldForwardProp:t=>"ownerState"!==t})(({ownerState:t,theme:{spacing:a}})=>[`
5
+ `,{...b.transition.fadeInFrom,background:"var(--phx-sidebar-background)",borderStartStartRadius:"var(--phx-sidebar-radius)",borderStartEndRadius:"var(--phx-sidebar-radius)",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"min-content minmax(0, 1fr) min-content",position:"relative","& > *":{pointerEvents:"auto"},"@container style(--inspect: on)":{background:"hsl(from gold h s l / 50%)"},'&:has([data-sidebar*="slot[content]"])':{...t.isContentEmpty&&{"--phx-sidebar-radius":0,'[data-sidebar*="slot[header]"]':{paddingBlock:0,"& > *":{display:"none"}}}},[`&[data-sidebar*="${j}"]`]:{opacity:1,transitionDuration:"200ms, 300ms",transitionTimingFunction:"linear, ease-out",translate:"0 0"},[`&[data-sidebar*="${A}"]`]:{opacity:0,transitionDuration:"100ms, 100ms",transitionTimingFunction:"linear, ease-in",translate:"0 60%"},[`&[data-sidebar*="${z}"] > :not([data-sidebar="${w}"])`]:{visibility:"hidden"}}]),Header:i("header",{name:D,slot:"header",shouldForwardProp:t=>"ownerState"!==t})(({theme:{spacing:t}})=>({alignItems:"center",borderStartStartRadius:"inherit",borderStartEndRadius:"inherit",display:"grid",gap:t(1),gridTemplateColumns:"repeat(2, minmax(0, 1fr))",paddingBlock:"calc(var(--phx-sidebar-padding) * 0.5)",paddingInline:"var(--phx-sidebar-padding)","& > *":{...b.transition.fadeIn,transitionDelay:"100ms",transitionDuration:"300ms"},'[data-sidebar="slot[header.start]"]':{},'[data-sidebar="slot[header.end]"]':{justifySelf:"end"}})),Body:i("div",{name:D,slot:"body",shouldForwardProp:t=>"ownerState"!==t})({display:"grid",gridTemplateRows:"minmax(0, 1fr)"}),Content:i("div",{name:D,slot:"content",shouldForwardProp:t=>"ownerState"!==t})(({theme:{spacing:t}})=>({...b.layout.normalizeScrollableContainer,display:"grid",gap:t(2),gridAutoRows:"min-content",paddingBlock:"calc(var(--phx-sidebar-padding) * 0.5)",paddingInline:"var(--phx-sidebar-padding)","&:empty":{paddingBlock:0}})),Tabs:i("div",{name:D,slot:"tabs",shouldForwardProp:t=>"ownerState"!==t})(({theme:{palette:t}})=>({borderBlockStart:`1px solid ${t.divider}`,paddingBlock:"calc(var(--phx-sidebar-padding) * 0.5)",paddingInline:"calc(var(--phx-sidebar-padding) * 0.75)","&:is(:empty)":{border:0,padding:0}})),Footer:i("footer",{name:D,slot:"footer",shouldForwardProp:t=>"ownerState"!==t})(({theme:{palette:t}})=>({borderBlockStart:`1px solid ${t.divider}`,paddingBlock:"calc(var(--phx-sidebar-padding) * 0.5)",paddingInline:"var(--phx-sidebar-padding)","&:is(:empty)":{borderColor:"transparent",paddingBlock:0}}))};export const PhxMobileLayoutName="PhxMobileLayout";let L="initial",q="fullscreen",N="min(480px, 50cqb)",V=["auto","min-content","max-content","fit-content"],G=i("div",{name:"PhxMobileLayout",slot:"root",shouldForwardProp:t=>"ownerState"!==t})(({ownerState:t,theme:{spacing:a}})=>[`
6
6
  --inspect: off; // 🕹️ inspection mode toggle
7
7
 
8
- --phx-layout-sidebar-track-size: ${b(t.sidebarHeight)};
8
+ --phx-layout-sidebar-track-size: ${h(t.sidebarHeight)};
9
9
  --phx-layout-gutter: ${a(2)};
10
10
  `,{display:"grid",gridTemplateColumns:`
11
11
  [full-start]
@@ -39,4 +39,4 @@ import{jsx as t,jsxs as a,Fragment as e}from"react/jsx-runtime";import{snackbarC
39
39
  [footer-end]
40
40
  var(--phx-layout-gutter)
41
41
  [full-end]
42
- `},'[data-layout*="slot[body.header]"]':{gridArea:"header-start / main-start / header-end / main-end"},'[data-layout*="slot[body.footer]"]':{gridArea:"footer-start / main-start / footer-end / main-end",position:"relative"},'[data-layout*="slot[body.safeSceneArea]"]':{gridArea:"full","@container style(--inspect: on)":{background:"hsl(from lime h s l / 50%)"}},'[data-layout="slot[body.sideEffects]"]':{insetBlockEnd:`calc(100% + ${a(2)})`,position:"absolute"},'[data-layout*="slot[sidebar]"]':{display:"grid",gridArea:"sidebar-start / full-start / sidebar-end / full-end",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, auto)"},'[data-layout*="slot[footer]"]':{gridArea:"footer-start / full-start / footer-end / full-end",zIndex:1},'&:has([data-sidebar*="slot[content]"])':{...t.isContentEmpty&&{"--phx-layout-sidebar-track-size":"min-content"}},[`&[data-layout*="${E}"]`]:{transitionDelay:"200ms",transitionDuration:"300ms"},[`&[data-layout*="${P}"]`]:{transitionDelay:"0ms",transitionDuration:"300ms"},[`&:has([data-sidebar*="${B}"])[class]`]:{"--phx-layout-sidebar-track-size":0}}]),j=r("div")({gridArea:"1 / 1 / -1 / -1"}),A=t=>({inert:t?"":void 0});export const MobileLayout=()=>{let o=l(null),{palette:r,shape:u,spacing:b}=i(),{sidebarHeight:z="min(480px, 50cqb)"}=n({props:{},name:"PhxMobileLayout"}),{background:H=r.background.paper,borderRadius:L=u.sidebarBorderRadius??u.borderRadius,padding:q=b(2)}=n({props:{},name:T}),{accessInfo:N}=m(),V=p(),{isPreview:G,isHidden:J}=y(),K=!J&&!G,O=!V&&K,Q=!V&&K,U=!V,{setCanvasPadding:W}=g(),{containerRef:X,safeAreaRef:Y}=w(K?W:d,!1),Z=h(o,{disabled:!U}),_={background:H,borderRadius:L,padding:q,isContentEmpty:Z};return a(e,{children:[t(s,{initial:!1,children:!J&&G&&t(v,{})}),a(D,{ownerState:{isContentEmpty:Z,sidebarHeight:z},"data-layout":c({state:{[`${E}`]:!V,[`${P}`]:V}}),...A(!K),children:[t(j,{ref:X}),t("div",{"data-layout":"slot[sideEffects]",children:t(f.MobileSnackbarsRoot,{})}),a("main",{"data-layout":"slot[body]",children:[t("header",{"data-layout":"slot[body.header]",children:a(C,{"data-header":c({state:{[`${S}`]:O,[`${k}`]:!O}}),...A(!O),children:[t("div",{"data-header":"slot[start]",children:t(x,{})}),t("div",{"data-header":"slot[center]",children:t(f.MobileCallToAction,{})}),a("div",{"data-header":"slot[end]",children:[N.viewMode&&!V&&t(f.MobileReadonlyBanner,{}),t(f.MobileHamburgerMenu,{})]})]})}),t("div",{ref:Y,"data-layout":"slot[body.safeSceneArea]"}),t("div",{"data-layout":"slot[body.footer] interactive",children:a(F,{"data-controls":c({state:{[`${$}`]:Q,[`${M}`]:!Q}}),children:[t("div",{"data-controls":"slot[toolControls]",...A(!Q),children:t(f.MobileToolControls,{})}),t("div",{"data-controls":"slot[viewControls]",...A(!Q),children:t(f.MobileViewControls,{})}),t("div",{"data-controls":"slot[toolbar]",children:K&&t(f.MobileToolbar,{})})]})})]}),t("aside",{"data-layout":"slot[sidebar]",children:a(R.Root,{ownerState:_,"data-sidebar":c({state:{[`${I}`]:U,[`${B}`]:!U}}),...A(!U),children:[a(R.Header,{ownerState:_,"data-sidebar":"slot[header]",children:[t("div",{"data-sidebar":"slot[header.start]",children:t(f.MobileSidebarBackButton,{})}),t("div",{"data-sidebar":"slot[header.end]",children:t(f.MobilePoweredBy,{})})]}),t(R.Body,{ownerState:_,"data-sidebar":"slot[body]",children:t(R.Content,{ref:o,ownerState:_,"data-sidebar":"slot[content]",children:t(f.MobileSidebarContent,{})})}),t(R.Tabs,{ownerState:_,"data-sidebar":"slot[tabs]",children:t(f.MobileTabs,{})}),t(R.Footer,{ownerState:_,"data-sidebar":"slot[footer]",children:t(f.MobileSidebarFooter,{})})]})}),t("footer",{"data-layout":"slot[footer] interactive",children:t(f.MobileFooter,{})})]})]})};
42
+ `},'[data-layout*="slot[body.header]"]':{gridArea:"header-start / main-start / header-end / main-end"},'[data-layout*="slot[body.footer]"]':{gridArea:"footer-start / main-start / footer-end / main-end",position:"relative"},'[data-layout*="slot[body.safeSceneArea]"]':{gridArea:"full","@container style(--inspect: on)":{background:"hsl(from lime h s l / 50%)"}},'[data-layout="slot[body.sideEffects]"]':{insetBlockEnd:`calc(100% + ${a(2)})`,position:"absolute"},'[data-layout*="slot[sidebar]"]':{display:"grid",gridArea:"sidebar-start / full-start / sidebar-end / full-end",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, auto)"},'[data-layout*="slot[footer]"]':{gridArea:"footer-start / full-start / footer-end / full-end",zIndex:1},'&:has([data-sidebar*="slot[content]"])':{...t.isContentEmpty&&{"--phx-layout-sidebar-track-size":"min-content"}},[`&[data-layout*="${L}"]`]:{transitionDelay:"200ms",transitionDuration:"300ms"},[`&[data-layout*="${q}"]`]:{transitionDelay:"0ms",transitionDuration:"300ms"},[`&:has([data-sidebar*="${A}"])[class]`]:{"--phx-layout-sidebar-track-size":0}},null!=t.assistantFocusHeight&&{'[data-layout*="slot[sidebar]"]':{alignSelf:"start",blockSize:`min(100%, ${t.assistantFocusHeight}px)`,gridRow:"full-start / full-end",zIndex:2}}]),J=i("div")({gridArea:"1 / 1 / -1 / -1"}),K=t=>({inert:t?"":void 0});export const MobileLayout=()=>{let o=l(null),{palette:i,shape:b,spacing:h}=r(),{sidebarHeight:w=N}=n({props:{},name:"PhxMobileLayout"}),{background:O=i.background.paper,borderRadius:Q=b.sidebarBorderRadius??b.borderRadius,padding:U=h(2)}=n({props:{},name:D}),{accessInfo:W}=m(),X=p(),{isPreview:Y,isHidden:Z}=v(),_=!Z&&!Y,tt=!X&&_,ta=!X&&_,te=!X,{setCanvasPadding:to}=f(),{containerRef:ti,safeAreaRef:tr}=M(_?to:d,!1),tn=g(o,{disabled:!te}),{assistantSystem:td}=x(),ts=$(),tl=c(td.panel$,t=>t.isInputFocused,[]),tm=ts&&te&&tl,tc=y(tm),tp=tn&&!ts,tu={isContentEmpty:tp,sidebarHeight:ts?V.includes(w)?N:w:w,assistantFocusHeight:tm?tc?.[1]:void 0},tb={background:O,borderRadius:Q,padding:U,isContentEmpty:tp};return a(e,{children:[t(s,{initial:!1,children:!Z&&Y&&t(F,{})}),a(G,{ownerState:tu,"data-layout":u({state:{[`${L}`]:!X,[`${q}`]:X}}),...K(!_),children:[t(J,{ref:ti}),t("div",{"data-layout":"slot[sideEffects]",children:t(k.MobileSnackbarsRoot,{})}),a("main",{"data-layout":"slot[body]",children:[t("header",{"data-layout":"slot[body.header]",children:a(R,{"data-header":u({state:{[`${T}`]:tt,[`${I}`]:!tt}}),...K(!tt),children:[t("div",{"data-header":"slot[start]",children:t(C,{})}),t("div",{"data-header":"slot[center]",children:t(k.MobileCallToAction,{})}),a("div",{"data-header":"slot[end]",children:[W.viewMode&&!X&&t(k.MobileReadonlyBanner,{}),t(k.MobileHamburgerMenu,{})]})]})}),t("div",{ref:tr,"data-layout":"slot[body.safeSceneArea]"}),t("div",{"data-layout":"slot[body.footer] interactive",children:a(P,{"data-controls":u({state:{[`${B}`]:ta,[`${E}`]:!ta}}),children:[t("div",{"data-controls":"slot[toolControls]",...K(!ta),children:t(k.MobileToolControls,{})}),t("div",{"data-controls":"slot[viewControls]",...K(!ta),children:t(k.MobileViewControls,{})}),t("div",{"data-controls":"slot[toolbar]",children:_&&t(k.MobileToolbar,{})})]})})]}),t("aside",{"data-layout":"slot[sidebar]",children:a(H.Root,{ownerState:tb,"data-sidebar":u({state:{[`${j}`]:te,[`${A}`]:!te,[`${z}`]:ts}}),...K(!te),children:[a(H.Header,{ownerState:tb,"data-sidebar":"slot[header]",children:[t("div",{"data-sidebar":"slot[header.start]",children:t(k.MobileSidebarBackButton,{})}),t("div",{"data-sidebar":"slot[header.end]",children:t(k.MobilePoweredBy,{})})]}),t(H.Body,{ownerState:tb,"data-sidebar":"slot[body]",children:t(H.Content,{ref:o,ownerState:tb,"data-sidebar":"slot[content]",children:t(k.MobileSidebarContent,{})})}),t(H.Tabs,{ownerState:tb,"data-sidebar":"slot[tabs]",children:t(k.MobileTabs,{})}),t(H.Footer,{ownerState:tb,"data-sidebar":"slot[footer]",children:t(k.MobileSidebarFooter,{})}),t(S,{})]})}),t("footer",{"data-layout":"slot[footer] interactive",children:t(k.MobileFooter,{})})]})]})};
@@ -57,6 +57,6 @@ declare const ResponsiveNavigation: <VALUE extends string, ENTITY_ID extends Dom
57
57
  */
58
58
  export declare const MobileControls: {
59
59
  Navigation: typeof ResponsiveNavigation;
60
- ViewOnlyMode: (inProps: import("../../../../ui-sdk/components/mobile-controls/MobileControls").ViewOnlyModeProps & import("#package/ui-sdk").MobileControlsThemeableProps) => import("react/jsx-runtime").JSX.Element;
60
+ ViewOnlyMode: (inProps: import("#package/ui-sdk").ViewOnlyModeProps & import("#package/ui-sdk").MobileControlsThemeableProps) => import("react/jsx-runtime").JSX.Element;
61
61
  };
62
62
  export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Opens and closes the assistant panel. It renders nothing in a project without an assistant. A
3
+ * layout that lists the button is expected to carry the panel; the button does not check for it.
4
+ */
5
+ export declare const AssistantToolbarButton: import("react").FunctionComponent<{
6
+ readonly showTitle?: boolean;
7
+ readonly icon?: string;
8
+ } & {
9
+ children?: import("react").ReactNode;
10
+ }>;
@@ -0,0 +1 @@
1
+ import{jsx as t}from"react/jsx-runtime";import{Badge as r}from"@mui/material";import{memo as o,useCallback as a}from"react";import{assistantToolbarButtonSchema as i,createPhoenixLayoutElement as e}from"#package/domain";import{useEagerObservableValue as s,useLocalizable as n,useSpecAssistant as m}from"#package/react-sdk";import{DesktopToolbar as l,PhxIcon as p,useResponsive as c}from"#package/ui-sdk";import{useConfigurator as d}from"../../application-runtime/index.js";let u={id:"sdk.assistant.toolbarButton.label",message:"Assistant"};export const AssistantToolbarButton=e({schema:i,component:o(o=>{let{icon:i,showTitle:e=!0}=o,{assistantSystem:k}=d(),f=m(),{open:A,hasUnreadReply:b}=s(k.panel$),g=n(u),{isPhone:x,isTablet:h}=c(),B=a(()=>{k.setOpen(!A)},[k,A]);return f?t(l.Button,{title:g,onClick:B,showTitle:e&&!x&&!h,"aria-pressed":A,sx:{'&[aria-pressed="true"]':{backgroundColor:"action.selected"}},children:t(r,{color:"primary",variant:"dot",overlap:"circular",invisible:!b,children:t(p,{name:i??(A?"CustomAiAssistantBold":"CustomAiAssistant")})})}):null})});
@@ -14,6 +14,7 @@ export { UndoToolbarButton } from './UndoToolbarButton.js';
14
14
  export { RedoToolbarButton } from './RedoToolbarButton.js';
15
15
  export { MeasurementsToolbarButton } from './MeasurementsToolbarButton.js';
16
16
  export { HelpToolbarButton } from './HelpToolbarButton.js';
17
+ export { AssistantToolbarButton } from './AssistantToolbarButton.js';
17
18
  export { HelpMenuAction } from './HelpMenuAction.js';
18
19
  export { LanguageMenuAction } from './LanguageMenuAction.js';
19
20
  export { MeasurementsMenuAction } from './MeasurementsMenuAction.js';
@@ -1 +1 @@
1
- export*from"./sidebar-footer/index.js";export*from"./header/index.js";export{useShareData,useShareSettings}from"./share/use-share.js";export{MenuRoutingProvider,useMenuRouting}from"./menu-actions/MenuRoutingContext.js";export{MenuAction}from"./menu-actions/MenuAction.js";export{RoutingMenuAction}from"./menu-actions/RoutingMenuAction.js";export{EnterFullscreenToolbarButton}from"./EnterFullscreenToolbarButton.js";export{ExitFullscreenToolbarButton}from"./ExitFullscreenToolbarButton.js";export{LanguageToolbarButton}from"./LanguageToolbarButton.js";export{ToolbarButtonGroup}from"./ToolbarButtonGroup.js";export{ShareMenuAction}from"./ShareMenuAction.js";export{ShareToolbarButton}from"./ShareToolbarButton.js";export{UndoToolbarButton}from"./UndoToolbarButton.js";export{RedoToolbarButton}from"./RedoToolbarButton.js";export{MeasurementsToolbarButton}from"./MeasurementsToolbarButton.js";export{HelpToolbarButton}from"./HelpToolbarButton.js";export{HelpMenuAction}from"./HelpMenuAction.js";export{LanguageMenuAction}from"./LanguageMenuAction.js";export{MeasurementsMenuAction}from"./MeasurementsMenuAction.js";export{ResetCameraToolbarButton}from"./ResetCameraToolbarButton.js";export{SimpleSummary}from"./SimpleSummary.js";export{ResetUndoListener}from"./ResetUndoListener.js";export{SetAsRecipeButton}from"./SetAsRecipeButton.js";export{LayoutDialog,createLayoutDialog}from"./LayoutDialog.js";export{LayoutFooter,createLayoutFooter}from"./LayoutFooter.js";export{CanvasLoader,createCanvasLoader}from"./CanvasLoader.js";export{AppLoader,createAppLoader}from"./AppLoader.js";export{ToolbarHelp,createToolbarHelp,useToolbarHelpExists}from"./ToolbarHelp.js";export{LayoutToolbarDesktop,createLayoutToolbarDesktop}from"./LayoutToolbarDesktop.js";export{LayoutToolbarDesktopFullScreen,createLayoutToolbarDesktopFullScreen}from"./LayoutToolbarDesktopFullScreen.js";export{LayoutToolbarReadDesktop,createLayoutToolbarReadDesktop}from"./LayoutToolbarReadDesktop.js";export{LayoutToolbarReadDesktopFullScreen,createLayoutToolbarReadDesktopFullScreen}from"./LayoutToolbarReadDesktopFullScreen.js";export{LayoutCustomOwnerUi,createLayoutCustomOwnerUi}from"./LayoutCustomOwnerUi.js";export{LayoutCustomReadUi,createLayoutCustomReadUi}from"./LayoutCustomReadUi.js";export{LayoutAdminUi,createLayoutAdminUi}from"./LayoutAdminUi.js";export{LayoutUserUi,createLayoutUserUi}from"./LayoutUserUi.js";export{ExitToolModeFab}from"./call-to-action/ExitToolModeFab.js";export*from"./svg-throbber-3d/index.js";
1
+ export*from"./sidebar-footer/index.js";export*from"./header/index.js";export{useShareData,useShareSettings}from"./share/use-share.js";export{MenuRoutingProvider,useMenuRouting}from"./menu-actions/MenuRoutingContext.js";export{MenuAction}from"./menu-actions/MenuAction.js";export{RoutingMenuAction}from"./menu-actions/RoutingMenuAction.js";export{EnterFullscreenToolbarButton}from"./EnterFullscreenToolbarButton.js";export{ExitFullscreenToolbarButton}from"./ExitFullscreenToolbarButton.js";export{LanguageToolbarButton}from"./LanguageToolbarButton.js";export{ToolbarButtonGroup}from"./ToolbarButtonGroup.js";export{ShareMenuAction}from"./ShareMenuAction.js";export{ShareToolbarButton}from"./ShareToolbarButton.js";export{UndoToolbarButton}from"./UndoToolbarButton.js";export{RedoToolbarButton}from"./RedoToolbarButton.js";export{MeasurementsToolbarButton}from"./MeasurementsToolbarButton.js";export{HelpToolbarButton}from"./HelpToolbarButton.js";export{AssistantToolbarButton}from"./AssistantToolbarButton.js";export{HelpMenuAction}from"./HelpMenuAction.js";export{LanguageMenuAction}from"./LanguageMenuAction.js";export{MeasurementsMenuAction}from"./MeasurementsMenuAction.js";export{ResetCameraToolbarButton}from"./ResetCameraToolbarButton.js";export{SimpleSummary}from"./SimpleSummary.js";export{ResetUndoListener}from"./ResetUndoListener.js";export{SetAsRecipeButton}from"./SetAsRecipeButton.js";export{LayoutDialog,createLayoutDialog}from"./LayoutDialog.js";export{LayoutFooter,createLayoutFooter}from"./LayoutFooter.js";export{CanvasLoader,createCanvasLoader}from"./CanvasLoader.js";export{AppLoader,createAppLoader}from"./AppLoader.js";export{ToolbarHelp,createToolbarHelp,useToolbarHelpExists}from"./ToolbarHelp.js";export{LayoutToolbarDesktop,createLayoutToolbarDesktop}from"./LayoutToolbarDesktop.js";export{LayoutToolbarDesktopFullScreen,createLayoutToolbarDesktopFullScreen}from"./LayoutToolbarDesktopFullScreen.js";export{LayoutToolbarReadDesktop,createLayoutToolbarReadDesktop}from"./LayoutToolbarReadDesktop.js";export{LayoutToolbarReadDesktopFullScreen,createLayoutToolbarReadDesktopFullScreen}from"./LayoutToolbarReadDesktopFullScreen.js";export{LayoutCustomOwnerUi,createLayoutCustomOwnerUi}from"./LayoutCustomOwnerUi.js";export{LayoutCustomReadUi,createLayoutCustomReadUi}from"./LayoutCustomReadUi.js";export{LayoutAdminUi,createLayoutAdminUi}from"./LayoutAdminUi.js";export{LayoutUserUi,createLayoutUserUi}from"./LayoutUserUi.js";export{ExitToolModeFab}from"./call-to-action/ExitToolModeFab.js";export*from"./svg-throbber-3d/index.js";
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-10-08T09:21:48.882Z",
2
+ "generatedAt": "2026-10-12T12:38:07.169Z",
3
3
  "categories": [
4
4
  {
5
5
  "name": "Phoenix",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  {
28
28
  "title": "Best Practices",
29
- "description": "1. **YAML is king** - 99% of configuration should be in spec/\\*.yaml files 2. **Custom code locations** (in order of preference): - `src/expressions/` - Computed/derived properties -...",
29
+ "description": "1. **YAML is king** - 99% of configuration should be in spec/\\*.yaml files 2. **Custom code locations** (in order of preference): - `src/expressions/` - Computed/derived properties - `src/actions/` -...",
30
30
  "path": "docs/phoenix/best-practices.mdx",
31
31
  "category": [
32
32
  "Phoenix",
@@ -2479,6 +2479,16 @@
2479
2479
  ],
2480
2480
  "source": "storybook-example"
2481
2481
  },
2482
+ {
2483
+ "title": "Domain Actions",
2484
+ "description": "A plate carries holes, and a hole can be nudged by an offset as long as it stays on the plate. The arrow buttons of a selected hole and the AI assistant both make this change, so the rule (\"stay on...",
2485
+ "path": "docs/other-features/domain-actions.mdx",
2486
+ "category": [
2487
+ "Other features",
2488
+ "Domain Actions"
2489
+ ],
2490
+ "source": "storybook-example"
2491
+ },
2482
2492
  {
2483
2493
  "title": "Not Found (404)",
2484
2494
  "description": "Error page that is displayed when the configuration is not accesible.",
@@ -81,6 +81,12 @@ Phoenix provides built-in toolbar buttons for common operations:
81
81
  `props.showIndicatorSwitch: false` to hide the Dimension indicators switch. When omitted, the prop falls back to
82
82
  `applicationConfig.indicatorSwitch`, then `true`.
83
83
  - `helpToolbarButton` - Show help content (supports custom children)
84
+ - `assistantToolbarButton` - Open and close the built-in assistant panel. It renders only in a project whose
85
+ application spec has an `assistant` section. `props.showTitle` defaults to `true`; the label shows on a
86
+ desktop-sized layout only. The default toolbar includes it, in a group of its own, when the spec has an
87
+ `assistant` section. Only the universal layout carries the panel, and the button does not hide itself in a
88
+ layout without it. A custom layout that renders the toolbar therefore defines a `toolbar` component without the
89
+ button, because the default toolbar would add it.
84
90
 
85
91
  ### Mobile Toolbar Configuration
86
92
 
@@ -0,0 +1,418 @@
1
+ # Domain Actions
2
+
3
+ - [Use case](#use-case)
4
+ - [Declare the action](#declare-the-action)
5
+ - [Implement it](#implement-it)
6
+ - [Run it from the UI](#run-it-from-the-ui)
7
+ - [Expose it to the assistant](#expose-it-to-the-assistant)
8
+ - [Known gaps](#known-gaps)
9
+ - [Example](#example)
10
+
11
+ ## Use case
12
+
13
+ A plate carries holes, and a hole can be nudged by an offset as long as it stays on the plate. The arrow buttons of a selected hole and the AI assistant both make this change, so the rule ("stay on the plate") has to live in one place.
14
+
15
+ An **action** is that place: a named domain operation you declare once under `actions:`, implement in `src/actions/` with generated parameter and result types, and run from any control through `actionSystem.prepareAction()`. The same action is exposed to the assistant as a custom mutation by naming it under `assistant.actions`. Use an action whenever a change is more than writing one field: a swap, a move among siblings, a change that touches several entities at once.
16
+
17
+ ## Declare the action
18
+
19
+ `params` and `result` are maps of named JSON schemas, with the same `phx:` refs, `references`, `tsType` and `import` as entity shapes. A param whose schema allows `null` is optional; every other param is required. A result member typed `phx:$DomainEntity` is the enhanced entity after the change.
20
+
21
+ ```yaml
22
+ actions:
23
+ nudgeHole:
24
+ description: Moves a hole by an offset on the plate; the move fails when the hole would leave the plate
25
+ params:
26
+ holeId:
27
+ $ref: phx:DomainEntityId
28
+ references: Hole
29
+ description: The hole to move
30
+ dx:
31
+ type: integer
32
+ description: Offset along the x axis, in plate units
33
+ dy:
34
+ type: integer
35
+ description: Offset along the y axis, in plate units
36
+ result:
37
+ hole:
38
+ $ref: phx:$DomainEntity
39
+ references: Hole
40
+ description: The hole at its new position
41
+ plate:
42
+ $ref: phx:$DomainEntity
43
+ references: Plate
44
+ description: The plate after the move
45
+ ```
46
+
47
+ Generation derives the types `ActionTypes`, `ActionName`, `ActionParams<'nudgeHole'>` and `ActionResult<'nudgeHole'>` from it: here `ActionParams<'nudgeHole'>` is `{ holeId: Hole['id']; dx: number; dy: number }` and `ActionResult<'nudgeHole'>` is `{ hole: $Hole; plate: $Plate }`. The `description` of the action, of a param and of a result member becomes the doc comment of its generated property, so it shows in the editor wherever the action is implemented or called.
48
+
49
+ ## Implement it
50
+
51
+ A file in `src/actions/` default-exports `phx.domain.implementActions({...})` with any subset of the declared actions. The implementation receives the validated parameters, the state the action runs on, and a context with the `expressionContext`, the domain `systems`, `getIdSequence()` for entities it creates and the typed `updates` factory. It returns the updates it wants applied and `readResult`, which reads the result from the state those updates produced, including whatever the transformers added. It never stages or commits anything.
52
+
53
+ ```ts
54
+ // src/actions/nudge-hole.ts
55
+ export default phx.domain.implementActions({
56
+ nudgeHole: ({ holeId, dx, dy }, state, { systems: { domain }, updates }) => {
57
+ // `references: Hole` types the id, but any entity id passes the runtime check, so the entity is verified here.
58
+ const hole = state.entities.find(entity => entity.id === holeId)
59
+
60
+ if (hole?.type !== 'Hole') {
61
+ throw new Error(
62
+ `"${holeId}" is not a hole of the plate, so it cannot be nudged. Query the plate's holes and use an id they return.`
63
+ )
64
+ }
65
+
66
+ const x = hole.x + dx
67
+ const y = hole.y + dy
68
+
69
+ if (Math.abs(x) > 150 || Math.abs(y) > 150) {
70
+ throw new Error(
71
+ `Nudging "${holeId}" by (${dx}, ${dy}) would put it at (${x}, ${y}), outside the plate. Keep both coordinates between -150 and 150.`
72
+ )
73
+ }
74
+
75
+ return {
76
+ updates: [updates.DomainEntityModification({ entityId: hole.id, stateDelta: { x, y }, updateTag: 'nudgeHole' })],
77
+ readResult: ({ state: nudged }) => ({
78
+ hole: domain.get$Entity(holeId, nudged),
79
+ plate: domain.getRoot$Entity(nudged),
80
+ }),
81
+ }
82
+ },
83
+ })
84
+ ```
85
+
86
+ Throw to reject a call: the message reaches the user through the control's hint and the assistant through the failed mutation, so say what went wrong and what to send instead. An action declared without an implementation, or an implementation of a name the spec does not declare, is a type error. A declared action without an implementation also stops the domain from initializing, and under `phoenix dev` the editor reports it as a `MISSING_ACTION_IMPLEMENTATIONS` diagnostic and does not apply the change; an implementation of an undeclared name is logged.
87
+
88
+ ## Run it from the UI
89
+
90
+ `phx.frontend.useDomain().actionSystem.prepareAction(name, args, state)` validates `args` against the declared params and returns `{ updates, readResult }`. Hand the updates to `useUpdateControl()` like any other change: it dry-runs them for hints and commits them on click.
91
+
92
+ ```tsx
93
+ export default phx.frontend.createCustomPhoenixEntityElement('NudgeControl', ({ entityId }) => {
94
+ const { actionSystem } = phx.frontend.useDomain()
95
+ const state = phx.frontend.useCommittedState()
96
+ const prepare = phx.frontend.useUpdateControl()
97
+
98
+ const left = prepare(actionSystem.prepareAction('nudgeHole', { holeId: entityId, dx: -20, dy: 0 }, state).updates)
99
+
100
+ return (
101
+ <Button disabled={left.disabled} title={left.hints} onClick={left.update}>
102
+ ←
103
+ </Button>
104
+ )
105
+ })
106
+ ```
107
+
108
+ `prepareAction` throws for arguments that do not fit the params, for an unknown action and for whatever the implementation rejects, so a control that may ask for an impossible move catches the error and shows its message, as the example's control does.
109
+
110
+ ## Expose it to the assistant
111
+
112
+ Naming the action under `assistant.actions` adds a `Mutation` field with one argument per param and a `<Name>Result` type whose entity members are traversable edges. `as` renames the field, `description` replaces the action's.
113
+
114
+ ```yaml
115
+ assistant:
116
+ actions:
117
+ nudgeHole:
118
+ ```
119
+
120
+ ```graphql
121
+ type Mutation {
122
+ nudgeHole(holeId: ID!, dx: Int!, dy: Int!): NudgeHoleResult!
123
+ }
124
+
125
+ type NudgeHoleResult {
126
+ hole: Hole!
127
+ plate: Plate!
128
+ }
129
+ ```
130
+
131
+ The field runs the same `prepareAction`, applies the updates through the same validation as every other mutation, and fails with the action's message when the call is rejected.
132
+
133
+ ## Known gaps
134
+
135
+ - `references` on a `phx:DomainEntityId` param types the parameter and the GraphQL argument, but at runtime any entity id passes the params check: the implementation verifies that the id names an entity of the expected type, as the example does.
136
+ - Actions exist in the configurator domain only; the admin domain declares none.
137
+ - The result of `readResult` is not validated at runtime: the generated TypeScript type and the GraphQL coercion are the checks.
138
+ - The assistant cannot dry-run a custom mutation the way it dry-runs recipes and field options.
139
+ - `useDomain()` types `prepareAction` with the generic action map, so the name and the arguments are not checked against your `ActionTypes` at that call site; the implementation side is fully typed.
140
+
141
+ ## Example
142
+
143
+ Select a hole and nudge it with the arrows. A move that would leave the plate is disabled with the action's message.
144
+
145
+ ## Complete Implementation
146
+
147
+ {/* AUTO-GENERATED SECTION: This section is automatically updated by 'phoenix story build' */}
148
+
149
+ <details>
150
+ <summary>Click to view the complete implementation files</summary>
151
+
152
+ ### ./spec/domain.yaml
153
+
154
+ ```yaml
155
+ model:
156
+ latest:
157
+ entityTypes:
158
+ - Plate
159
+ - Hole
160
+ aliases:
161
+ RootEntity:
162
+ - Plate
163
+ shapes:
164
+ Hole:
165
+ x:
166
+ type: number
167
+ y:
168
+ type: number
169
+
170
+ relations:
171
+ Plate:
172
+ $holes:
173
+ kind: allOfType
174
+ target: Hole
175
+ cardinality: 0-N
176
+ composedOf: true
177
+ Hole:
178
+ $plate:
179
+ kind: allOfType
180
+ target: Plate
181
+ cardinality: 1-1
182
+ composedOf: false
183
+
184
+ expressions:
185
+ Hole:
186
+ $radius:
187
+ type: number
188
+
189
+ # A named domain operation: declared once, implemented in src/actions/, run by the NudgeControl
190
+ # element and by the assistant alike.
191
+ actions:
192
+ nudgeHole:
193
+ description: Moves a hole by an offset on the plate; the move fails when the hole would leave the plate
194
+ params:
195
+ holeId:
196
+ $ref: phx:DomainEntityId
197
+ references: Hole
198
+ description: The hole to move
199
+ dx:
200
+ type: integer
201
+ description: Offset along the x axis, in plate units
202
+ dy:
203
+ type: integer
204
+ description: Offset along the y axis, in plate units
205
+ result:
206
+ hole:
207
+ $ref: phx:$DomainEntity
208
+ references: Hole
209
+ description: The hole at its new position
210
+ plate:
211
+ $ref: phx:$DomainEntity
212
+ references: Plate
213
+ description: The plate after the move
214
+
215
+ assistant:
216
+ ai:
217
+ provider: openai
218
+ model: balanced
219
+ reasoning: low
220
+ entities:
221
+ Plate:
222
+ $holes:
223
+ description: The holes of the plate
224
+ Hole:
225
+ x:
226
+ y:
227
+ actions:
228
+ nudgeHole:
229
+
230
+ presets:
231
+ - rootEntityType: 'Plate'
232
+ initialDomainEntities:
233
+ - id: 'Plate-1'
234
+ type: 'Plate'
235
+ - id: 'Hole-1'
236
+ type: 'Hole'
237
+ x: -60
238
+ y: 40
239
+ - id: 'Hole-2'
240
+ type: 'Hole'
241
+ x: 70
242
+ y: -50
243
+
244
+ components:
245
+ Plate:
246
+ applicationConfig:
247
+ main:
248
+ layout: 'universal'
249
+ staticPerspectiveCamera:
250
+ main:
251
+ distance: 400
252
+ priority: 1
253
+ polarAngle: 1.2
254
+ azimuthAngle: -0.2
255
+ sceneEntityProperties:
256
+ main:
257
+ offsetX: -100
258
+ offsetY: -100
259
+ offsetZ: -10
260
+ sceneEntityObject:
261
+ Plate:
262
+ object:
263
+ $read: $render
264
+ detail:
265
+ main:
266
+ title: 'Plate'
267
+ subtitle: 'A plate with holes'
268
+ description: 'Select a hole to nudge it.'
269
+ Hole:
270
+ sceneEntityProperties:
271
+ main:
272
+ offsetX:
273
+ $read: x
274
+ offsetY:
275
+ $read: y
276
+ sceneEntitySelectHotspot:
277
+ main:
278
+ offsetX: 15
279
+ offsetY: 15
280
+ offsetZ: 30
281
+ detail:
282
+ main:
283
+ title: 'Hole'
284
+ subtitle: 'A hole in the plate'
285
+ description: 'Nudge it with the arrows; a hole cannot leave the plate.'
286
+ propertyPage:
287
+ main:
288
+ children:
289
+ - kind: propertyContainerGroup
290
+ props:
291
+ spacing: large
292
+ children:
293
+ - kind: customElement
294
+ props:
295
+ name: NudgeControl
296
+ ```
297
+
298
+ ### ./src/actions/nudge-hole.ts
299
+
300
+ ```ts
301
+ import { phx } from '../../.phoenix/phx.js'
302
+
303
+ /** How far a hole may sit from the plate's center on either axis, in plate units. */
304
+ const REACH = 150
305
+
306
+ export default phx.domain.implementActions({
307
+ nudgeHole: ({ holeId, dx, dy }, state, { systems: { domain }, updates }) => {
308
+ // `references: Hole` types the id, but any entity id passes the runtime check, so the entity is verified here.
309
+ const hole = state.entities.find(entity => entity.id === holeId)
310
+
311
+ if (hole?.type !== 'Hole') {
312
+ throw new Error(
313
+ `"${holeId}" is not a hole of the plate, so it cannot be nudged. Query the plate's holes and use an id they return.`
314
+ )
315
+ }
316
+
317
+ const x = hole.x + dx
318
+ const y = hole.y + dy
319
+
320
+ if (Math.abs(x) > REACH || Math.abs(y) > REACH) {
321
+ throw new Error(
322
+ `Nudging "${holeId}" by (${dx}, ${dy}) would put it at (${x}, ${y}), outside the plate. Keep both coordinates between ${-REACH} and ${REACH}.`
323
+ )
324
+ }
325
+
326
+ return {
327
+ updates: [updates.DomainEntityModification({ entityId: hole.id, stateDelta: { x, y }, updateTag: 'nudgeHole' })],
328
+ readResult: ({ state: nudged }) => ({
329
+ hole: domain.get$Entity(holeId, nudged),
330
+ plate: domain.getRoot$Entity(nudged),
331
+ }),
332
+ }
333
+ },
334
+ })
335
+ ```
336
+
337
+ ### ./src/elements/NudgeControl.tsx
338
+
339
+ ```tsx
340
+ import { Button, Stack } from '@mui/material'
341
+
342
+ import { PropertyContainer } from '@salsita-ai/sdk/ui'
343
+
344
+ import { phx } from '../../.phoenix/phx.js'
345
+
346
+ const STEP = 20
347
+
348
+ /** Nudges the selected hole with the same `nudgeHole` action the assistant calls, one step at a time. */
349
+ export default phx.frontend.createCustomPhoenixEntityElement('NudgeControl', ({ entityId }) => {
350
+ const { actionSystem } = phx.frontend.useDomain()
351
+ const state = phx.frontend.useCommittedState()
352
+ const prepare = phx.frontend.useUpdateControl()
353
+ const hole = state.entities.find(entity => entity.id === entityId)
354
+
355
+ if (hole?.type !== 'Hole') {
356
+ return <></>
357
+ }
358
+
359
+ // An action throws when the move leaves the plate; the button for that direction is then disabled with the message.
360
+ const nudge = (dx: number, dy: number) => {
361
+ try {
362
+ return prepare(actionSystem.prepareAction('nudgeHole', { holeId: hole.id, dx, dy }, state).updates)
363
+ } catch (error) {
364
+ return { disabled: true, hints: error instanceof Error ? error.message : String(error), update: () => {} }
365
+ }
366
+ }
367
+
368
+ const directions = [
369
+ { label: '←', dx: -STEP, dy: 0 },
370
+ { label: '→', dx: STEP, dy: 0 },
371
+ { label: '↑', dx: 0, dy: STEP },
372
+ { label: '↓', dx: 0, dy: -STEP },
373
+ ]
374
+
375
+ return (
376
+ <PropertyContainer.Item title="Nudge" description={`Moves the hole by ${STEP} units.`}>
377
+ <Stack direction="row" spacing={1}>
378
+ {directions.map(({ label, dx, dy }) => {
379
+ const control = nudge(dx, dy)
380
+
381
+ return (
382
+ <Button
383
+ key={label}
384
+ variant="outlined"
385
+ disabled={control.disabled}
386
+ title={control.hints ?? undefined}
387
+ onClick={event => {
388
+ event.stopPropagation()
389
+ control.update()
390
+ }}
391
+ >
392
+ {label}
393
+ </Button>
394
+ )
395
+ })}
396
+ </Stack>
397
+ </PropertyContainer.Item>
398
+ )
399
+ })
400
+ ```
401
+
402
+ ### ./src/expressions/plate.ts
403
+
404
+ ```ts
405
+ import { createPlate } from '../../../../common/plate-rendering.js'
406
+ import { phx } from '../../.phoenix/phx.js'
407
+
408
+ export default phx.domain.implementCustomExpressions({
409
+ Hole: {
410
+ $radius: () => 10,
411
+ },
412
+ Plate: {
413
+ $render: plate => createPlate({ features: plate.$holes }),
414
+ },
415
+ })
416
+ ```
417
+
418
+ </details>
@@ -102,6 +102,32 @@ configuratorBuilder
102
102
  .buildConfig()
103
103
  ```
104
104
 
105
+ ### Hints and the AI assistant
106
+
107
+ In a configurator with the AI assistant, the assistant is told the same hints: they arrive as
108
+ `sideEffects` with the result of its changes and in the dry-runs of recipes and options, so it can
109
+ tell the user what else happened. The hints also explain what the user changed between two messages:
110
+ every message carries a change record of the configuration, and each of its lines ends with the hint
111
+ of the last update that touched it, or with the `updateTag` when the update has none. Set `agentHint`
112
+ beside `hint` when the assistant needs different wording, for example with ids or values a snackbar
113
+ would not show:
114
+
115
+ ```ts
116
+ phx.frontend.updates.DomainEntityModification({
117
+ entityId: oldPlate.id,
118
+ stateDelta: { finish: validMaterial.finish },
119
+ updateTag: 'fix.finish',
120
+ hint: msg`Material finish was adjusted`,
121
+ agentHint: `The finish of ${oldPlate.id} was changed to ${validMaterial.finish}, the only one this material comes in.`,
122
+ })
123
+ ```
124
+
125
+ - `agentHint` is a plain string, never shown to the user and not localized.
126
+ - `agentHint: null` keeps the wording from the assistant while the user still gets the `hint`: the
127
+ update is left out of `sideEffects`, and the change record explains its line by the `updateTag`. It
128
+ does not hide the change itself, which the assistant can always read from the configuration.
129
+ - `agentHint` without a `hint` tells only the assistant.
130
+
105
131
  ## Example
106
132
 
107
133
  Here you can see the live example!
@@ -421,7 +421,7 @@ export const handler = webhookBuilder
421
421
 
422
422
  The publishing workflow validates admin state, transforms entities, and stores JSON to S3. Configurators access published data via `ctx.publishedData` in expressions.
423
423
 
424
- For implementation examples, see `packages/demos/demo-finalize/src/handlers/map-published-revision-data.ts`.
424
+ For implementation examples, see `packages/demos/demo-catalog-builder/src/handlers/map-published-chunked-data.ts`.
425
425
 
426
426
  For technical details about data transformation and storage, see [Data Sources - Published Data](?path=/docs/phoenix-data-sources--docs#published-data).
427
427
 
@@ -515,4 +515,4 @@ Ready to implement admin functionality in your Phoenix project? Here's what to e
515
515
  - **[Sessions and Access](?path=/docs/phoenix-sessions-and-access--docs)** - Understand admin authentication and permissions
516
516
  - **[Connected Data Sources](?path=/docs/phoenix-connected-data-sources--docs)** - Wire `$data` entries to Google Sheets or Excel; requires the embedded admin mode
517
517
 
518
- For hands-on examples, check out the finalize demo (`packages/demos/demo-finalize/`) which shows spec-driven admin using `createAdminPages` for presets and recipes. This demo demonstrates the YAML-based admin approach with publishing workflows rather than custom admin UI components.
518
+ For hands-on examples, check out the Catalog Builder demo (`packages/demos/demo-catalog-builder/`), which shows spec-driven admin pages over connected and generated data, custom catalog pages beside them, admin model migrations, and the publishing workflow.
@@ -5,6 +5,7 @@
5
5
  1. **YAML is king** - 99% of configuration should be in spec/\*.yaml files
6
6
  2. **Custom code locations** (in order of preference):
7
7
  - `src/expressions/` - Computed/derived properties
8
+ - `src/actions/` - Named domain operations declared under `actions:`
8
9
  - `src/invariants/` - Business rule constraints
9
10
  - `src/transformers/` - Automatic state fixers
10
11
  - `src/handlers/` - Event & lifecycle handlers