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

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
@@ -355,4 +355,4 @@ Now that you understand finalization workflows, explore these related topics:
355
355
  - **[Admin](?path=/docs/phoenix-admin--docs)** - Learn about admin finalization and published data generation
356
356
  - **[Best Practices](?path=/docs/phoenix-best-practices--docs)** - Follow proven patterns for finalization implementation
357
357
 
358
- For hands-on practice, explore the finalize demo in the **[Quickstart](?path=/docs/phoenix-quickstart--docs)** guide.
358
+ For hands-on practice, explore the Precision demo (`packages/demos/demo-precision/`) for finalization resources — PDF, CSV, images, email attachments and callbacks — and the Catalog Builder demo (`packages/demos/demo-catalog-builder/`) for the finalization data lifecycle and access links.
@@ -51,11 +51,11 @@ For details on the server-side token exchange, see [Authentication](?path=/docs/
51
51
 
52
52
  The `power` attribute controls the configurator's state:
53
53
 
54
- | Value | Behavior |
55
- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
56
- | `"off"` | Completely inactive. No rendering, no session, no network requests beyond loading the bundle. |
57
- | `"standby"` | Session initialized, assets preloaded (3D models, textures), but not rendered. Faster power-on, but consumes bandwidth and counts toward session quotas. |
58
- | `"on"` | Fully active and visible. |
54
+ | Value | Behavior |
55
+ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
56
+ | `"off"` | Completely inactive. No rendering, no session, no network requests beyond loading the bundle. |
57
+ | `"standby"` | Session initialized and any textures listed in `resourcesConfig.prefetchTextureUrls` prefetched; nothing is rendered and no models are loaded. Faster power-on, but consumes bandwidth and counts toward session quotas. |
58
+ | `"on"` | Fully active and visible. |
59
59
 
60
60
  A typical flow: power on at login (`"standby"`), then toggle between `"on"` and `"standby"` as the user opens and closes the configurator. Use `"off"` only before the user has authenticated.
61
61
 
@@ -28,11 +28,11 @@ The configurator fills its parent container. Set a height on the element or a wr
28
28
 
29
29
  The `power` attribute controls whether the configurator is active. It accepts three values:
30
30
 
31
- | Value | Behavior |
32
- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
33
- | `"off"` | Configurator is completely inactive. No rendering, no session initialization, no network requests beyond loading the bundle. Lowest resource usage. |
34
- | `"standby"` | Configurator initializes its session and preloads assets (3D models, textures), but does not render. Subsequent power-on is faster, but consumes bandwidth and counts toward monthly session quotas. |
35
- | `"on"` | Configurator is fully active and visible. |
31
+ | Value | Behavior |
32
+ | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
33
+ | `"off"` | Configurator is completely inactive. No rendering, no session initialization, no network requests beyond loading the bundle. Lowest resource usage. |
34
+ | `"standby"` | Configurator initializes its session and prefetches any textures listed in `resourcesConfig.prefetchTextureUrls`, but does not render or load models. Subsequent power-on is faster, but consumes bandwidth and counts toward monthly session quotas. |
35
+ | `"on"` | Configurator is fully active and visible. |
36
36
 
37
37
  ### Choosing the Initial Power
38
38
 
@@ -18,6 +18,8 @@ Each version defines its own:
18
18
 
19
19
  This versioning allows you to track changes over time and ensure proper migration paths.
20
20
 
21
+ The version number is not written anywhere: `latest` is the highest numbered version plus one, so a model with only `latest` is version 1. Once a version has been deployed it cannot change, because saved configurations depend on it. `phoenix deploy` refuses a model that differs from the one deployed under the same version, before anything is uploaded. To change a deployed model, keep it unchanged as `v<N>`, make the change in `latest` and add the migration to version N+1. Development environments replace the deployed model instead, so `phoenix dev` accepts every change.
22
+
21
23
  ## Model File Structure
22
24
 
23
25
  It's recommended to split your model versions into separate files for better maintainability:
@@ -39,9 +41,11 @@ The CLI generates separate TypeScript types for each version, which helps ensure
39
41
 
40
42
  ```typescript
41
43
  // The Migration type ensures you handle all entity types
42
- type Migration<FromEntity, ToEntity> = (state: FromEntity[]) => ToEntity[]
44
+ type Migration<FromEntity, ToEntity> = (state: readonly FromEntity[]) => readonly ToEntity[]
43
45
  ```
44
46
 
47
+ The types of each version are generated as global namespaces: `ModelV1`, `ModelV2`, and so on. `ModelV1.AnyDomainEntity` is the union of all entities of version 1, and `ModelV1.<EntityType>` is one of them. The admin model has its own namespaces, `AdminV1`, `AdminV2`, and so on. A migration needs no import for them.
48
+
45
49
  ## Migration File Location
46
50
 
47
51
  Migration files are organized in the `src/migrations/` directory with a specific naming convention:
@@ -63,11 +67,16 @@ Each migration file should export a function named `migrateToVN` where N is the
63
67
 
64
68
  ```typescript
65
69
  // src/migrations/v2.ts
66
- export const migrateToV2: Migration<V1Entity, V2Entity> = state => {
70
+ import type { Migration } from '@salsita-ai/sdk/domain'
71
+
72
+ export const migrateToV2: Migration<ModelV1.AnyDomainEntity, ModelV2.AnyDomainEntity> = state => {
67
73
  // Transform entities from v1 to v2
74
+ return state
68
75
  }
69
76
  ```
70
77
 
78
+ Keep the `Migration<...>` type on the export, with its `readonly` arrays: the generated domain file passes each migration to the migration builder, and a function typed with mutable arrays does not type-check there.
79
+
71
80
  **Note:** Migrations start from version 2. There is no migration TO v1 since v1 is the initial version. The first migration you write will be `migrateToV2`.
72
81
 
73
82
  The `ts-pattern` library is recommended for implementing migrations as it provides type-safe pattern matching.
@@ -77,11 +86,15 @@ The `ts-pattern` library is recommended for implementing migrations as it provid
77
86
  Migrations are implemented as functions that transform entities from one version to another. Each migration handles the transition between consecutive versions:
78
87
 
79
88
  ```typescript
80
- export const migrateToV4: Migration<V3Entity, V4Entity> = state => {
89
+ import { match } from 'ts-pattern'
90
+
91
+ import type { Migration } from '@salsita-ai/sdk/domain'
92
+
93
+ export const migrateToV4: Migration<ModelV3.AnyDomainEntity, ModelV4.AnyDomainEntity> = state => {
81
94
  return state.map(entity => {
82
95
  return (
83
96
  match(entity)
84
- .returnType<V4Entity>()
97
+ .returnType<ModelV4.AnyDomainEntity>()
85
98
  .with({ type: 'Burner' }, value => ({ ...value, y: 0 }))
86
99
  .with({ type: 'Cabinet' }, value => ({ ...value, y: 0 }))
87
100
  // ... handle other entities
@@ -91,6 +104,33 @@ export const migrateToV4: Migration<V3Entity, V4Entity> = state => {
91
104
  }
92
105
  ```
93
106
 
107
+ ### Renaming an Entity Type
108
+
109
+ An entity id starts with its entity type, such as `Box-1`, and is typed per entity type (`DomainEntityId<'Box'>`). The runtime validates that an entity's id matches its type, so an entity that keeps its data under a new type name needs a new id, and every relation that points at it must be rewritten to that id. The id is built from a string, which TypeScript cannot check, so this is one place where a cast is needed:
110
+
111
+ ```typescript
112
+ import { parseDomainEntityId } from '@salsita-ai/sdk/domain'
113
+
114
+ const toTableId = (id: ModelV1.Box['id']) =>
115
+ // The id is rebuilt for the new type name; nothing narrower than a cast can type a template string as an id
116
+ `Table-${parseDomainEntityId(id).sequenceNumber}` as ModelV2.Table['id']
117
+ ```
118
+
119
+ ### Replacing the Model Entirely
120
+
121
+ When the new model has nothing in common with the deployed one, there is nothing to convert. This is the case when a project that was first deployed as the starter gets its real model: the starter's `Box` model is version 1 in production, and a deployed version cannot change. Keep the deployed model as `v1`, define the real model in `latest`, and let the migration return the starting state of the new model, the `initialDomainEntities` of its preset:
122
+
123
+ ```typescript
124
+ // src/migrations/v2.ts
125
+ import type { Migration } from '@salsita-ai/sdk/domain'
126
+
127
+ export const migrateToV2: Migration<ModelV1.AnyDomainEntity, ModelV2.AnyDomainEntity> = () => [
128
+ // the entities of the new model's preset
129
+ ]
130
+ ```
131
+
132
+ No entity of a type that the new version no longer has may stay in the returned state: the migrated state is validated against the latest model, and an unknown entity type fails the load.
133
+
94
134
  ## Migration Runtime
95
135
 
96
136
  Migrations are executed automatically every time the domain is loaded, both in the client application and in webhooks. During this process:
@@ -114,7 +154,7 @@ When implementing migrations:
114
154
 
115
155
  4. **Testing**: Thoroughly test migrations with real-world data to ensure they handle all edge cases, use existing configurations from previous versions.
116
156
 
117
- 5. **Version Bumping**: Consider bumping the model version for both breaking changes (removing fields, changing types) and additive changes where existing data needs proper defaults. If you add a new required field, existing configurations need a migration to set that field's default value.
157
+ 5. **Version Bumping**: Every change to a model that has been deployed needs a new version, whether it is breaking (removing fields, changing types) or additive. If you add a new required field, existing configurations need a migration to set that field's default value; a change that needs no conversion still needs a migration that returns the state unchanged.
118
158
 
119
159
  ## Admin Model Migrations
120
160
 
@@ -327,15 +327,49 @@ as restart-required unless their feature documentation explicitly states live-up
327
327
 
328
328
  Builds the project for production deployment.
329
329
 
330
- | Flag | Env Variable | Default | Description |
331
- | ---------------- | --------------- | ------- | ------------------------------ |
332
- | `--onlyFrontend` | — | — | Build only the frontend bundle |
333
- | `--onlyWebhook` | — | — | Build only webhooks |
334
- | `--force` / `-f` | `FORCE_REBUILD` | `false` | Force full rebuild, skip cache |
335
- | `--debug` | `DEBUG` | `false` | Verbose logging |
330
+ | Flag | Env Variable | Default | Description |
331
+ | ----------------- | --------------- | ------- | --------------------------------------------------- |
332
+ | `--onlyFrontend` | — | — | Build only the frontend bundle |
333
+ | `--onlyWebhook` | — | — | Build only webhooks |
334
+ | `--force` / `-f` | `FORCE_REBUILD` | `false` | Force full rebuild, skip cache |
335
+ | `--banner <text>` | — | — | Replaces the application line of the banner comment |
336
+ | `--debug` | `DEBUG` | `false` | Verbose logging |
336
337
 
337
338
  The build target can also be controlled via `BUILD_TARGET` env (`frontend`, `webhook`, or `both`).
338
339
 
340
+ #### Banner comment
341
+
342
+ Every JavaScript file the frontend build emits (the configurator, admin and embedded bundles, and the editor's entry and lazy chunks) starts with a comment that identifies the build, so `head -n 5 <bundle.js>` tells two deployed bundles of nearly the same size apart:
343
+
344
+ ```js
345
+ /*!
346
+ * App version: 1.2.3; Commit: 9fd79ce0f4c1a2b3d4e5f60718293a4b5c6d7e8f
347
+ * Built with Salsita SDK 3.4.0. Copyright (c) Salsita s.r.o. All rights reserved.
348
+ * Third-party licences: THIRD-PARTY-LICENSES.txt
349
+ */
350
+ ```
351
+
352
+ The first line is the application's. By default it holds `applicationVersion` from `spec/application.yaml` and the commit checked out in the project, read with `git rev-parse HEAD`. Where git cannot read a commit for the project (no checkout, git missing or refusing the repository, or the project's `package.json` is not tracked by the repository around it), the line holds the version only and `--debug` logs it; this is the case for a platform build from uploaded sources.
353
+
354
+ `--banner <text>` replaces that line with your own text, for example when CI knows a release name the spec does not:
355
+
356
+ ```sh
357
+ pnpm phoenix build --banner "Release: ${RELEASE_NAME}; Commit: ${COMMIT_SHA}"
358
+ ```
359
+
360
+ The line is **public**: it ships in every bundle. The default publishes the application version and the commit SHA; pass `--banner ""` to leave the line out, and never put a secret or internal detail in your own text. The text is written as comment text only. Each line of a multi-line value (or each repeated `--banner`) becomes its own comment line and `*/` is written as `*\/`. There is no environment-variable fallback, and the option has no effect on webhook output or with `--onlyWebhook`. Lazy chunks keep their hashed file name when only the banner text changes.
361
+
362
+ The banner and the licences file below are produced by the application-spec pipeline; the legacy pipeline's build ignores `--banner`.
363
+
364
+ #### Third-party licences
365
+
366
+ The frontend build writes `.phoenix/dist/frontend/THIRD-PARTY-LICENSES.txt` next to the bundles and the banner comment points to it. It lists every third-party package whose code or styles are in any of the frontend bundles, once each, sorted by name and version, with the package's version, the licence declared in its `package.json` and the text of its licence file (`LICENSE*`, `LICENCE*` or `COPYING*`). A package that ships no licence file is listed without the text. Your project's own source is not listed.
367
+
368
+ Deploy the file together with the bundles, so the notices those licences ask for travel with every copy. The build lists licences; it does not judge whether a licence suits your product. Two kinds of package are not in the list, so add their notices yourself when you use them:
369
+
370
+ - packages used only inside a web worker, which are bundled separately;
371
+ - packages a stylesheet reaches on its own, through CSS `@import`, Sass `@use` or `url()`. A stylesheet imported from JavaScript or TypeScript (`import 'some-font/index.css'`) is listed.
372
+
339
373
  #### Bundle-size budgets
340
374
 
341
375
  Application-spec projects can set gzip-size limits for the standalone configurator and webhook bundles. Add the optional `budgets` section to a spec YAML file:
@@ -457,6 +491,85 @@ phoenix screenshot -o preview.png -w 1920 --height 1080
457
491
  | `--height` | `1080` | Image height in pixels |
458
492
  | `--format` / `-f` | `png` | Image format (`png` or `jpeg`) |
459
493
 
494
+ ### `phoenix variants`
495
+
496
+ Show several options over the configurator and wait for your pick. It is built for coding agents: when a decision is a matter of taste, such as the edge of a table top, how glossy a finish is or where a control sits, the agent writes one file per option, you choose in the browser, and the command hands your answer back to the agent.
497
+
498
+ ```bash
499
+ phoenix variants .phoenix/variants/table-edge --title 'Which edge suits the table?' --description 'Only the edge of the top differs.'
500
+ ```
501
+
502
+ Every `<id>.variant.js` script or `<id>.html` page in the folder is one option, shown in file-name order. Each script edits frontend project files on top of the same captured baseline. Original is always the first choice and restores that baseline. Switching options removes the previous option's edits and applies the selected script; the editor dialog has any number of choices on the left and your already loaded configurator on the right.
503
+
504
+ ```js
505
+ // .phoenix/variants/brand/blue.variant.js
506
+ export const title = 'Blue brand'
507
+ export const description = 'A blue primary colour with the current layout.'
508
+
509
+ export default ({ read, write, remove }) => {
510
+ const file = 'src/handlers/theme.ts'
511
+ write(file, read(file).replace("main: '#E93335'", "main: '#2364aa'"))
512
+ }
513
+ ```
514
+
515
+ `read(path)` always reads the baseline. `write(path, contents)` replaces or creates a file; `remove(path)` deletes it. Scripts run in the browser and collect edits; Phoenix validates and writes the batch locally. Supported files are YAML under `spec/` outside `spec/admin/`, and TypeScript under `src/components`, `transformers`, `handlers`, `elements` and `_`-prefixed shared folders. Expressions, actions and invariants also run on the server, so a script cannot edit them.
516
+
517
+ For standalone UI or branding proposals, write self-contained HTML files. Each page renders in its own iframe when selected; its `<title>` names the option and `<meta name="description" content="...">` describes it. HTML and scripts may share a set if their file names give distinct option ids.
518
+
519
+ ```html
520
+ <!-- .phoenix/variants/brand/blue.html -->
521
+ <!doctype html>
522
+ <title>Blue studio</title>
523
+ <meta name="description" content="A calm blue identity with generous spacing." />
524
+ <style>
525
+ body {
526
+ margin: 0;
527
+ padding: 40px;
528
+ background: #f0f5fa;
529
+ color: #163b66;
530
+ font-family: sans-serif;
531
+ }
532
+ </style>
533
+ <h1>Made for your everyday.</h1>
534
+ <button>Design your table</button>
535
+ ```
536
+
537
+ Scripts run once per selection. The completed file batch calls the existing rebuild queue directly, without a separate file-change event stream or a watcher that reapplies the option.
538
+
539
+ Use script options for controls, layout, brand, lights, visual effects, materials, positions, components, elements and transformers. Changes to the model, schemas, data or deployment settings are rejected before any files are written. Environment files, webhooks, their shared implementation dependencies, dependencies and uploaded assets cannot be overridden. Files connected through symbolic links are also excluded, so restoring the baseline preserves the original files. No server preparation or webhook rebuild runs for a variant transaction.
540
+
541
+ Picking a script keeps its exact implementation in the project. Picking an HTML page returns the selected proposal for the agent to implement; the page itself changes no project source files. Choosing Original keeps the captured baseline. Users finish by confirming Original or another option. Escape stays available to the configurator, and clicking the backdrop leaves the comparison open. The agent can use `--close` to restore the baseline source files without giving an answer. Phoenix records recovery information on disk and restores interrupted previews at the next `phoenix dev` start. It never overwrites a file edited outside the preview: switching options over such an edit is refused, and when the comparison ends, or is restored at the next start, that file is left as it is with a warning in the dev log while the others are restored. Other source changes made while a comparison is open are rebuilt once it ends.
542
+
543
+ Answers are held for four seconds with Undo and Send now.
544
+
545
+ The command prints the outcome as JSON. After `chosen` it removes the folder:
546
+
547
+ | `status` | Meaning |
548
+ | --------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
549
+ | `chosen` | An option was picked: `choice` is its id, or `null` for Original; `label` is its name. |
550
+ | `waiting` | The wait ran out. The preview stays open: the same command attaches to it again, and an answer given in between is returned by the next run. |
551
+ | `closed` | The preview was closed without an answer, by `--close` or by another set of options taking its place. The folder is kept. |
552
+
553
+ | Flag | Default | Description |
554
+ | ---------------------- | ----------------------------- | --------------------------------------------------------- |
555
+ | `--title` / `-t` | `Which option do you prefer?` | Question shown above the options |
556
+ | `--description` / `-d` | — | A line saying what differs between the options |
557
+ | `--timeout` | `540` | Seconds to wait for the answer |
558
+ | `--keep` | `false` | Keep the folder after the answer |
559
+ | `--close` | `false` | Close the open preview without an answer; needs no folder |
560
+ | `--port` / `-p` | `3020` | Editor WebSocket port |
561
+
562
+ Known limits:
563
+
564
+ - Variant transactions start rebuilding immediately, bypassing the normal file-watcher debounce. Hot reload still needs to parse and apply the updated implementation. There is no wait for UI or scene loading to settle; allow a visible transition to finish before judging or choosing.
565
+ - Only one option is displayed at a time; simultaneous comparison is not supported.
566
+ - For script options and Original, the dialog moves the existing configurator into the preview and returns it on close, preserving the loaded scene, camera and UI state. Opening the dialog starts no second application or initial loading screen. Configuration interactions still change the current configuration; restoring source files does not undo them.
567
+ - Custom scripts are trusted project code. Their file API stages edits; scripts must not make network requests or other side effects.
568
+ - Binary assets, CSS files, locale catalog changes, dependency changes and edits requiring a full application restart are unsupported.
569
+ - Storybook `story-dev` has no variant previews. A project on the legacy pipeline has no variant previews; the command says so and exits.
570
+
571
+ Generated projects carry the `phoenix-variants` agent skill, which tells coding agents when to offer options, how to write each kind and what to do with your answer.
572
+
460
573
  ## SDK Development
461
574
 
462
575
  ### `phoenix link`
@@ -569,9 +682,11 @@ SDK-builder workspaces sign the CLI in with a personal API token instead of proj
569
682
 
570
683
  Signs the CLI in to the SDK-builder workspace `<customer>`:
571
684
 
572
- 1. Opens Studio, where you approve the sign-in (use `--no-open` to only print the link).
685
+ 1. Opens Studio, where you name the token and approve the sign-in (use `--no-open` to only print the link). Only a super admin of the workspace can open its Studio, so only a super admin can sign the CLI in. The page shows the workspace, your account, the computer the CLI runs on and how long the link still works. The CLI suggests the name `phoenix CLI on <computer>`; change it so you can tell your machines and agents apart later.
573
686
  2. Studio sends a one-time code back to the CLI on `127.0.0.1`.
574
- 3. The CLI exchanges the code for a token.
687
+ 3. The CLI exchanges the code for a token with the name you approved, and sends the browser back to Studio, which confirms the sign-in.
688
+
689
+ **Deny** in Studio stops the CLI at once: it exits with `The sign-in was denied in Studio` and no token is created. The link works for five minutes and only for the CLI that printed it; after that, Studio shows that it no longer works and the CLI gives up.
575
690
 
576
691
  The token is stored in `~/.phoenix/credentials.json`, readable only by you, per server, together with the Studio URL of the sign-in; `PHOENIX_CREDENTIALS_FILE` moves the file. The token works until you revoke it. Signing in again to the same server revokes the token it replaces; the CLI warns if the server could not revoke it.
577
692
 
@@ -592,28 +707,32 @@ Revokes the token on the server and removes it from the credentials file. `--reg
592
707
 
593
708
  ### `phoenix deploy`
594
709
 
595
- Validates the spec, adds the pnpm settings `phoenix init` writes to `pnpm-workspace.yaml` when they are missing, packs and uploads the project, starts its build on the server and follows it until the configurator is live. Once the build starts it prints `Follow the build in Studio: <url>`, the build's page in the Studio you signed in through; a sign-in stored by an older CLI has no Studio URL, so sign in again to get the link. `--region` or `--serverUrl` selects the server, as for `login`; `--no-wait` returns as soon as the build starts.
710
+ Validates the spec, adds the pnpm settings `phoenix init` writes to `pnpm-workspace.yaml` when they are missing, packs and uploads the project, starts its build on the server and follows it until the configurator is live. Before the upload the server compares the domain model with the deployed one: a model that changed under an already deployed model version is refused with the reason, and needs a new model version and a [migration](?path=/docs/phoenix-migrations--docs). Once the build starts it prints `Follow the build in Studio: <url>`, the build's page in the Studio you signed in through; a sign-in stored by an older CLI has no Studio URL, so sign in again to get the link. After `Your configurator is live at <url>` it prints one line for coding agents, which tells them to offer the run evaluation of the `phoenix-feedback` skill once you have nothing more to build; you can ignore it when you run the command yourself. `--region` or `--serverUrl` selects the server, as for `login`; `--no-wait` returns as soon as the build starts.
596
711
 
597
- ### `phoenix feedback <message>`
712
+ ### `phoenix feedback [message]`
598
713
 
599
714
  Sends feedback about the SDK, the CLI, the documentation or Studio to the Phoenix team. It needs `phoenix login`: the server records the workspace, user and API token of the sign-in, so the message itself needs no introduction.
600
715
 
601
716
  ```bash
602
717
  phoenix feedback "phoenix build reports a missing entity when a module file is empty" --type bug
718
+ phoenix feedback --file report.txt --type bug
603
719
  ```
604
720
 
605
- | Flag | Env | Default | Description |
606
- | ---------------------- | -------------- | ----------------------------- | ---------------------------------------------------- |
607
- | `--type` | — | `other` | What the feedback is about: `bug`, `idea` or `other` |
608
- | `--contact` | — | — | How to reach you, when you want a reply |
609
- | `--agent` | — | — | Name of the coding agent that writes the feedback |
610
- | `--projectSlug` / `-p` | `PROJECT_SLUG` | `project` of the spec, if any | Workspace project the feedback is about |
611
- | `--region` | — | `eu` | Phoenix region of the workspace: `eu` or `us` |
612
- | `--serverUrl` / `-su` | — | the region's server | Phoenix server URL, for a local or custom server |
721
+ Pass the message as the argument for a short note, or `--file` for a longer report: the content of the file is the message, read as UTF-8, so quotes, backticks and new lines arrive unchanged. Giving both, or neither, is an error.
722
+
723
+ | Flag | Env | Default | Description |
724
+ | ---------------------- | -------------- | ----------------------------- | --------------------------------------------------------- |
725
+ | `--file` | — | — | Text file that holds the message, instead of the argument |
726
+ | `--type` | — | `other` | What the feedback is about: `bug`, `idea` or `other` |
727
+ | `--contact` | — | — | How to reach you, when you want a reply |
728
+ | `--agent` | — | — | Name of the coding agent that writes the feedback |
729
+ | `--projectSlug` / `-p` | `PROJECT_SLUG` | `project` of the spec, if any | Workspace project the feedback is about |
730
+ | `--region` | — | `eu` | Phoenix region of the workspace: `eu` or `us` |
731
+ | `--serverUrl` / `-su` | — | the region's server | Phoenix server URL, for a local or custom server |
613
732
 
614
- A message holds at most 5000 characters. Besides the message and the flags, the CLI sends only the SDK version, the operating system and the Node.js version; nothing of the project's files is attached. The project must belong to the signed-in workspace, otherwise the server refuses the feedback; without a project, the feedback is sent on its own.
733
+ A message holds at most 100,000 characters, from the argument or from the file. Besides the message and the flags, the CLI sends only the SDK version, the operating system and the Node.js version; no file of the project is attached, and the Phoenix team reads a build's sources through the build's page in Studio. The project must belong to the signed-in workspace, otherwise the server refuses the feedback; without a project, the feedback is sent on its own.
615
734
 
616
- Generated projects carry the `phoenix-feedback` agent skill. It tells coding agents when to draft feedback, to show you the draft and send it only after you approve it, and what must never go into it: secrets, customer data and the project's source. The command needs a server with API 1.40.0 or newer.
735
+ Generated projects carry the `phoenix-feedback` agent skill. It tells coding agents when to draft feedback, to show you the draft and send it only after you approve it, and how to write a report: the build id with its Studio page link, the live configurator link, what the agent was doing, what happened and what was expected, the exact error or output, the workaround and a condensed conversation log. When you say you are done, or a deploy went live and you confirm the run is finished, the agent asks you to evaluate the run, one question at a time: minutes spent, then a score from 0 to 10 for the agent's guidance, the configurator's functionality, its UX, the quality of the 3D, the UI visuals and the overall result, then your comments. It never picks a score for you and sends nothing when you decline. Secrets, credentials and personal data never go into a message; file paths, spec and code snippets and your own words may, once you approved the draft that contains them. The command needs a server with API 1.40.0 or newer; a message over 5000 characters needs API 1.43.0 or newer.
617
736
 
618
737
  ## Next Steps
619
738
 
@@ -40,6 +40,7 @@ project-root/
40
40
  | `components/` | Phoenix system components (ECS) |
41
41
  | `elements/` | Page elements (pages, providers) |
42
42
  | `expressions/` | Domain logic expressions |
43
+ | `actions/` | Implementations of the domain actions declared under `actions:` |
43
44
  | `invariants/` | Domain constraints |
44
45
  | `transformers/` | Data transformation logic |
45
46
  | `handlers/` | Event & lifecycle handlers |
@@ -188,7 +189,7 @@ type CustomMaterial = Phx['AdminModel']['CustomMaterial']
188
189
 
189
190
  ### DO NOT EDIT (Fully Auto-Generated)
190
191
 
191
- - **Everything in `.phoenix/`** - Completely regenerated on each build
192
+ - **Everything in `.phoenix/`** - Completely regenerated on each build. The one exception is `.phoenix/variants/`, where a coding agent writes the option files for `phoenix variants`; a rebuild keeps it
192
193
  - `tsconfig.json`, `eslint.config.js`, `prettier.config.js`, `.prettierignore`
193
194
  - `.linguirc`, `.nvmrc`
194
195
  - `src/locales/**/*.ts` - Compiled from `.po` catalogs
@@ -197,7 +198,7 @@ type CustomMaterial = Phx['AdminModel']['CustomMaterial']
197
198
 
198
199
  ### Agent Guidance
199
200
 
200
- Coding agents (Claude Code, Codex, Cursor) read `AGENTS.md` and the Phoenix agent skills. `AGENTS.md` is written once with the build commands, the do-not-edit list and a pointer to the skills; after that it is yours. The `phoenix`, `phoenix-cli`, `phoenix-feedback` and `phoenix-review` skills carry the SDK conventions, CLI tooling and review checklist, and the `phoenix-create-configurator` skill walks the agent from your product documents and assets to a reviewed configurator in five stages. Phoenix keeps them in step with the installed SDK, including the reference files inside a skill folder. During the internal beta, a project created from a canary build of the SDK gets one more section in the `phoenix` skill: once per conversation the agent checks for a newer canary and, after telling you, updates the project's SDK and runs `phoenix sync`. Other skill folders are never touched.
201
+ Coding agents (Claude Code, Codex, Cursor) read `AGENTS.md` and the Phoenix agent skills. `AGENTS.md` is written once with the build commands, the do-not-edit list and a pointer to the skills; after that it is yours. The `phoenix`, `phoenix-cli`, `phoenix-feedback` and `phoenix-review` skills carry the SDK conventions, CLI tooling and review checklist, and the `phoenix-create-configurator` skill walks the agent from your product documents and assets to a reviewed configurator in five stages. The `phoenix-variants` skill has the agent show you several options over the dev preview when a decision is a matter of taste, and build the one you pick. Phoenix keeps them in step with the installed SDK, including the reference files inside a skill folder. During the internal beta, a project created from a canary build of the SDK gets one more section in the `phoenix` skill: once per conversation the agent checks for a newer canary and, after telling you, updates the project's SDK and runs `phoenix sync`. Other skill folders are never touched.
201
202
 
202
203
  Projects created by earlier SDK versions had this guidance in `CLAUDE.md`, `.cursor/rules/phoenix.mdc` and `commands/review.md`. Sync removes the SDK block from the first two, keeps your own text around it, deletes a file that held nothing else, and deletes the review commands; use the `phoenix-review` skill instead of `/review`.
203
204
 
@@ -249,6 +250,7 @@ project-root/
249
250
  │ ├── components/ # Phoenix system components (ECS)
250
251
  │ ├── elements/ # UI elements (pages, providers)
251
252
  │ ├── expressions/ # Domain logic expressions
253
+ │ ├── actions/ # Domain action implementations
252
254
  │ ├── invariants/ # Domain constraints
253
255
  │ ├── transformers/ # Data transformation logic
254
256
  │ ├── handlers/ # Event & lifecycle handlers
@@ -314,6 +316,7 @@ project-root/
314
316
  │ │ └── builders.ts
315
317
  │ ├── .swc/ # SWC transpiled sources
316
318
  │ ├── .lingui/ # Compiled i18n catalogs
319
+ │ ├── variants/ # Option files of `phoenix variants`, written by coding agents
317
320
  │ ├── dist/ # Build output
318
321
  │ │ ├── frontend/ # Frontend bundles
319
322
  │ │ └── webhooks/ # Webhook bundles
@@ -362,6 +365,7 @@ Domain logic files define the business rules and computed properties of your con
362
365
  | Purpose | Location | Example Files |
363
366
  | ------------ | ------------------- | ---------------------------------------------- |
364
367
  | Expressions | `src/expressions/` | `table.ts`, `legs.ts`, `module.ts` |
368
+ | Actions | `src/actions/` | `move-part.ts`, `swap-cabinets.ts` |
365
369
  | Invariants | `src/invariants/` | `top.ts`, `legs.ts` |
366
370
  | Transformers | `src/transformers/` | `fix-table-top-material-update-transformer.ts` |
367
371
  | Migrations | `src/migrations/` | `v2.ts`, `v3.ts`, `v4.ts` |
@@ -510,7 +514,7 @@ The `application.yaml` file contains global application-level settings. These fi
510
514
  | Field | Type | Description |
511
515
  | -------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
512
516
  | `project` | `string` | Server project `phoenix dev` develops in: a project slug, or `default` for the default project of the signed-in workspace. Read only by the CLI; overridden by `--projectSlug` and `PROJECT_SLUG` |
513
- | `applicationVersion` | `string` | Semantic version (`x.y.z`) exported as `ApplicationVersion` constant and stored on the deployment record |
517
+ | `applicationVersion` | `string` | Semantic version (`x.y.z`) exported as `ApplicationVersion` constant, stored on the deployment record and named in the banner comment of built bundles |
514
518
  | `webComponentTag` | `string` | Custom HTML web component tag name for embedding |
515
519
  | `pageTitle` | `string` | Browser page title |
516
520
 
@@ -36,11 +36,11 @@ The starter `spec/application.yaml` begins with `project: default`, which means
36
36
  pnpm phoenix login <workspace>
37
37
  ```
38
38
 
39
- `phoenix login` opens Studio, where you approve the sign-in. Studio sends a one-time code back to the CLI on `127.0.0.1`, and the CLI exchanges it for a personal token. The code only works for the CLI that asked for it and expires after five minutes. Use `--no-open` to print the link instead of opening a browser.
39
+ `phoenix login` opens Studio, where you name the token and approve the sign-in. Only a super admin of the workspace can open Studio, so only a super admin can approve it. The CLI suggests `phoenix CLI on <computer>`; a name of your own, such as the agent and the machine, tells your tokens apart later. Studio sends a one-time code back to the CLI on `127.0.0.1`, the CLI exchanges it for a personal token and returns the browser to Studio, which confirms the sign-in. The code only works for the CLI that asked for it and expires after five minutes. **Deny** stops the waiting CLI at once and creates no token. Use `--no-open` to print the link instead of opening a browser.
40
40
 
41
41
  The CLI stores the token in `~/.phoenix/credentials.json`, readable only by you, with one entry per server. `PHOENIX_CREDENTIALS_FILE` moves the file. The token acts for you in your workspace until you revoke it. It stops working when you are removed from the workspace or banned.
42
42
 
43
- `pnpm phoenix logout` revokes the token and removes it from the file. Studio's **CLI tokens** page lists your tokens with when they were last used, and revokes any of them, for example one left on another computer.
43
+ `pnpm phoenix logout` revokes the token and removes it from the file. Studio's **CLI tokens** page lists your tokens by the names you gave them, with when they were last used, and revokes any of them, for example one left on another computer. A revoked token leaves the list.
44
44
 
45
45
  `login`, `logout` and `deploy` follow the region, not the `SERVER_URL` in the project's `.env`. `dev` follows the region too when `.env` has no `SERVER_URL`:
46
46
 
@@ -59,7 +59,7 @@ pnpm phoenix dev
59
59
 
60
60
  Signed in, `phoenix dev` needs no `.env` and nothing set up in Studio. When it starts, it asks the server for your development environment in the project the spec names. The server creates that environment the first time and finds it again on every later run. `phoenix dev` prints the workspace, project and environment it works in, prepares a development deployment there and opens the webhook tunnel, as for any Phoenix project (see [Phoenix CLI](?path=/docs/phoenix-phoenix-cli--docs)). It then prints the address of the preview as `Preview: <url>`; the preview talks to the server the deployment was prepared on.
61
61
 
62
- Every user of the workspace gets their own development environment, so a teammate who clones the project and signs in doesn't overwrite your schema or take over your webhooks. The development environment is separate from `production`: nothing you do in `phoenix dev` changes the live configurator.
62
+ Every user who signs the CLI in gets their own development environment, so a teammate (a super admin of the workspace, like you) who clones the project and signs in doesn't overwrite your schema or take over your webhooks. The development environment is separate from `production`: nothing you do in `phoenix dev` changes the live configurator.
63
63
 
64
64
  `pnpm dev:local` still runs the project without any server, with state kept in the browser.
65
65
 
@@ -77,8 +77,9 @@ pnpm phoenix deploy
77
77
 
78
78
  1. It validates the application spec.
79
79
  2. It packs the project files: the `.yaml` files in `spec`, everything in `src`, `mocks`, `assets`, `public` and `templates`, and `package.json`, `pnpm-lock.yaml`, `pnpm-workspace.yaml`, `.gitignore`, `CLAUDE.md` and `.cursor/rules/phoenix.mdc`. Every `node_modules`, `.phoenix` and `__generated` folder, every `.DS_Store` and `._*` file and every `.env` and `.env.*` file are left out, at any depth.
80
- 3. It uploads the archive, which may be up to 200 MB.
81
- 4. It starts the build, prints a link to the build's page in Studio and follows the build until your configurator is live, then prints its URL.
80
+ 3. It asks the server for a build. The server compares your domain model with the deployed one and refuses, before anything is uploaded, a model that changed under an already deployed model version; see [Migrations](?path=/docs/phoenix-migrations--docs).
81
+ 4. It uploads the archive, which may be up to 200 MB.
82
+ 5. It starts the build, prints a link to the build's page in Studio and follows the build until your configurator is live, then prints its URL.
82
83
 
83
84
  On the server, the install follows your `pnpm-lock.yaml` and `pnpm-workspace.yaml`, so it allows the same build scripts and package versions as `pnpm install` on your computer. The build runs without platform secrets. It sees only your own environment variables and the public platform values, the [build environment](?path=/docs/phoenix-phoenix-cli--docs) that `phoenix deployment:build-envs` writes. The trusted deploy step then publishes the frontend, webhooks and assets.
84
85
 
@@ -93,15 +94,18 @@ Studio's **Builds & deployments** page lists your builds and shows which one you
93
94
  Tell us what is broken, confusing or missing, from wherever you are:
94
95
 
95
96
  - In Studio, **Send beta feedback** in the sidebar opens a short form.
96
- - In the terminal, `pnpm phoenix feedback "<message>" --type bug|idea|other` sends it with your sign-in. See the [CLI reference](?path=/docs/phoenix-phoenix-cli--docs).
97
+ - In the terminal, `pnpm phoenix feedback "<message>" --type bug|idea|other` sends it with your sign-in, and `--file <path>` sends a text file instead of the argument. See the [CLI reference](?path=/docs/phoenix-phoenix-cli--docs).
98
+ - On a build's page in Studio, **Download sources** downloads the archive `phoenix deploy` uploaded for that build, so a report only needs to name the build.
97
99
 
98
- Coding agents working in your project use the same command, guided by the generated `phoenix-feedback` skill. They never send on their own: an agent shows you a draft, right away when the problem is crucial and otherwise at the end of the task, and sends it only after you approve it. They are told never to include secrets, customer data or your project's source. After a deploy goes live, the agent also asks you, once per conversation, to rate building with Phoenix from 0 to 10; it tells you the answer goes to the Phoenix team, shows the message and sends it only after you approve it.
100
+ Coding agents working in your project use the same command, guided by the generated `phoenix-feedback` skill. They never send on their own: an agent shows you a draft, right away when the problem is crucial and otherwise at the end of the task, and sends it only after you approve it. A report names the build with its Studio page link and the live configurator, says what the agent was doing, what happened and what it expected, quotes the exact error and ends with a condensed conversation log. Agents are told never to include secrets, credentials or personal data; parts of your project and your own words go in only through a draft you approved. When you are done with the configurator, the agent also asks you, once per conversation, to evaluate the run: minutes spent, then scores from 0 to 10 for the agent's guidance, functionality, UX, 3D quality, UI visuals and the overall result, and your comments. It asks one question at a time, never picks a score for you, tells you the answers go to the Phoenix team, shows the message and sends it only after you approve it.
99
101
 
100
102
  ## Known limits
101
103
 
102
104
  - You can deploy once the workspace's first deployment is live. Until then, `phoenix deploy` tells you the workspace is still being set up.
105
+ - The first deployment is the starter, so the starter's model is version 1 in production. Replacing it with your own model needs the starter's model kept as `v1` and a migration to version 2; [Migrations](?path=/docs/phoenix-migrations--docs) shows the migration for replacing a model entirely.
103
106
  - One workspace has one project, one `production` environment and one development environment per user.
104
107
  - `phoenix deploy` always deploys to the workspace's default project; it doesn't read `project` from the spec yet.
105
108
  - Only `phoenix dev` works from the sign-in. `phoenix deployment:prepare-dev` still needs the `.env` block of a Studio development environment.
106
109
  - Every deploy uploads the whole project; there are no incremental uploads.
107
- - Your own environment variables can't use platform names such as `LAMBDA_FUNCTION_NAME` or the `AWS_` prefix. A deploy that sets them fails before it registers.
110
+ - Your own environment variables are set in Studio under Environment, by a super admin of the workspace, and apply from the next deploy. `phoenix dev` doesn't receive them: your development environment has its own variables. A build reads them from `process.env`; a webhook reads the ones the spec declares under `env.webhook`, through `phx.webhooksEnv` (see [Webhooks](?path=/docs/phoenix-webhooks--docs)). They can't use platform names such as `LAMBDA_FUNCTION_NAME`, the `AWS_` prefix, the identity provider settings such as `CLERK_API_KEY`, or names the CLI and the deploy tooling read themselves, such as `SERVER_URL` or `NODE_OPTIONS`; Studio refuses those names.
111
+ - Only super admins of a workspace can open its Studio. Admins and users see a page that says so.
@@ -0,0 +1,10 @@
1
+ import type { ActionImplementations, ActionTypes } from '../core/action.js';
2
+ import type { $DomainEntity, DomainEntity } from '../core/model.js';
3
+ /**
4
+ * Creates the `implementActions` factory the generated `domain-spec.ts` exposes as
5
+ * `phx.domain.implementActions`. A module in `src/actions/` implements any subset of the declared
6
+ * actions and gets each parameter and result typed from the spec; a name the spec does not declare
7
+ * is a type error, since its implementation would have to be `never`. The generated barrel merges
8
+ * the modules and checks that every declared action is implemented.
9
+ */
10
+ export declare const createActionFactory: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string, ACTION_TYPES extends ActionTypes>() => <IMPLEMENTATIONS extends Partial<ActionImplementations<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, ACTION_TYPES>>>(implementations: IMPLEMENTATIONS & Readonly<Record<Exclude<keyof IMPLEMENTATIONS, keyof ACTION_TYPES>, never>>) => IMPLEMENTATIONS;
@@ -0,0 +1 @@
1
+ export const createActionFactory=()=>t=>t;
@@ -0,0 +1,15 @@
1
+ import type { ActionDefinitions, AnyActionImplementations } from '../core/index.js';
2
+ /** The declared actions that have no implementation, and the implementations of undeclared names. */
3
+ export interface ActionImplementationConflicts {
4
+ readonly missing: readonly string[];
5
+ readonly extra: readonly string[];
6
+ }
7
+ /** Compares the names of the declared actions with the implemented ones. */
8
+ export declare const findActionImplementationConflicts: (declared: readonly string[], implementations: AnyActionImplementations) => ActionImplementationConflicts;
9
+ /**
10
+ * Validates the implemented actions against the declared ones, as `prepareDomainExpressions` does
11
+ * for expressions: a declared action without an implementation throws, so the domain is not
12
+ * instantiated with an action that can only fail when it is called; an implementation of an
13
+ * undeclared name is logged. Returns the implementations unchanged.
14
+ */
15
+ export declare const prepareActionImplementations: (definitions: ActionDefinitions, implementations: AnyActionImplementations) => AnyActionImplementations;
@@ -0,0 +1,5 @@
1
+ export const findActionImplementationConflicts=(e,n)=>{let t=Object.keys(n);return{missing:e.filter(e=>!t.includes(e)),extra:t.filter(n=>!e.includes(n))}};export const prepareActionImplementations=(e,n)=>{let{missing:t,extra:i}=findActionImplementationConflicts(Object.values(e).map(e=>e.name),n);if(0===t.length&&0===i.length)return n;let o=Error("Domain cannot be instantiated because there are conflicts between declared and implemented actions."+(t.length>0?`
2
+
3
+ Missing actions: ${t.join(", ")}. Add each to a default export of phx.domain.implementActions({ ... }) in src/actions/.`:"")+(i.length>0?`
4
+
5
+ Extra actions: ${i.join(", ")}. Declare each under "actions" in a spec file or remove its implementation.`:"")+"\n");if(t.length>0)throw o;return console.error(o),n};
@@ -112,7 +112,8 @@ export interface AssistantFieldOptions {
112
112
  * the recipe groups `meta { childRecipes }` and `addChild` expose, in manifest order, and absent
113
113
  * means none; `replaceRecipes` lists the same for `meta { replaceRecipes }` and `replaceEntity`;
114
114
  * `fieldOptions` lists, per entity type, the options edges `meta` exposes for its
115
- * writable fields, and absent means none. Consumed by the configurator GraphQL system.
115
+ * writable fields, and absent means none; `actions` maps each custom `Mutation` field to the
116
+ * declared action it runs, and absent means none. Consumed by the configurator GraphQL system.
116
117
  */
117
118
  export interface AssistantManifest {
118
119
  readonly sdl: string;
@@ -122,6 +123,7 @@ export interface AssistantManifest {
122
123
  readonly childRecipes?: Readonly<Record<string, readonly AssistantRecipeGroup[]>>;
123
124
  readonly replaceRecipes?: Readonly<Record<string, readonly AssistantRecipeGroup[]>>;
124
125
  readonly fieldOptions?: Readonly<Record<string, readonly AssistantFieldOptions[]>>;
126
+ readonly actions?: Readonly<Record<string, string>>;
125
127
  }
126
128
  export type AdminPagesSpec = {
127
129
  readonly presets?: boolean | {