@salsita-ai/sdk 0.50.0-develop.ecda3c6152 → 0.50.0-develop.eeaf6c4605

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 (415) hide show
  1. package/README.md +4 -2
  2. package/dist/application-spec/caching/index.d.ts +6 -1
  3. package/dist/application-spec/caching/index.js +1 -1
  4. package/dist/application-spec/generate-application/code/domain-runtime-files.d.ts +0 -19
  5. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  6. package/dist/application-spec/generate-application/code/templates/gitignore.js +2 -1
  7. package/dist/application-spec/generate-application/code/templates/index.d.ts +1 -1
  8. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  9. package/dist/application-spec/generate-application/code/templates/lingui-rc.js +5 -4
  10. package/dist/application-spec/generate-application/code/templates/skills/core/cli.d.ts +2 -0
  11. package/dist/application-spec/generate-application/code/templates/skills/core/cli.js +1 -0
  12. package/dist/application-spec/generate-application/code/templates/skills/core/index.d.ts +3 -0
  13. package/dist/application-spec/generate-application/code/templates/skills/core/index.js +1 -0
  14. package/dist/application-spec/generate-application/code/templates/skills/core/sdk.d.ts +2 -0
  15. package/dist/application-spec/generate-application/code/templates/skills/core/sdk.js +150 -0
  16. package/dist/application-spec/generate-application/code/templates/skills/core/workflow.d.ts +2 -0
  17. package/dist/application-spec/generate-application/code/templates/skills/core/workflow.js +40 -0
  18. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout.d.ts +2 -0
  19. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout.js +1 -0
  20. package/dist/application-spec/generate-application/code/templates/skills/features/features.d.ts +3 -0
  21. package/dist/application-spec/generate-application/code/templates/skills/features/features.js +1 -0
  22. package/dist/application-spec/generate-application/code/templates/skills/features/index.d.ts +1 -0
  23. package/dist/application-spec/generate-application/code/templates/skills/features/index.js +1 -0
  24. package/dist/application-spec/generate-application/code/templates/skills/features/inspection.d.ts +2 -0
  25. package/dist/application-spec/generate-application/code/templates/skills/features/inspection.js +1 -0
  26. package/dist/application-spec/generate-application/code/templates/skills/features/variants.d.ts +2 -0
  27. package/dist/application-spec/generate-application/code/templates/skills/features/variants.js +1 -0
  28. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks.d.ts +2 -0
  29. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks.js +1 -0
  30. package/dist/application-spec/generate-application/code/templates/skills/guide.d.ts +54 -0
  31. package/dist/application-spec/generate-application/code/templates/skills/guide.js +18 -0
  32. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.d.ts +2 -2
  33. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +12 -5
  34. package/dist/application-spec/generate-application/code/templates/skills/processes/asset-conversion.d.ts +2 -0
  35. package/dist/application-spec/generate-application/code/templates/skills/processes/asset-conversion.js +23 -0
  36. package/dist/application-spec/generate-application/code/templates/skills/processes/feedback/evaluate.d.ts +2 -0
  37. package/dist/application-spec/generate-application/code/templates/skills/processes/feedback/evaluate.js +39 -0
  38. package/dist/application-spec/generate-application/code/templates/skills/processes/feedback/feedback.d.ts +3 -0
  39. package/dist/application-spec/generate-application/code/templates/skills/processes/feedback/feedback.js +1 -0
  40. package/dist/application-spec/generate-application/code/templates/skills/processes/feedback/index.d.ts +1 -0
  41. package/dist/application-spec/generate-application/code/templates/skills/processes/feedback/index.js +1 -0
  42. package/dist/application-spec/generate-application/code/templates/skills/processes/feedback/report.d.ts +2 -0
  43. package/dist/application-spec/generate-application/code/templates/skills/processes/feedback/report.js +7 -0
  44. package/dist/application-spec/generate-application/code/templates/skills/processes/feedback/send.d.ts +2 -0
  45. package/dist/application-spec/generate-application/code/templates/skills/processes/feedback/send.js +2 -0
  46. package/dist/application-spec/generate-application/code/templates/skills/processes/finalization.d.ts +2 -0
  47. package/dist/application-spec/generate-application/code/templates/skills/processes/finalization.js +2 -0
  48. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/build.d.ts +2 -0
  49. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/build.js +23 -0
  50. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/direction.d.ts +2 -0
  51. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/direction.js +26 -0
  52. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/first-draft.d.ts +3 -0
  53. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/first-draft.js +3 -0
  54. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/handoff.d.ts +2 -0
  55. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/handoff.js +7 -0
  56. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/index.d.ts +1 -0
  57. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/index.js +1 -0
  58. package/dist/application-spec/generate-application/code/templates/skills/processes/index.d.ts +9 -0
  59. package/dist/application-spec/generate-application/code/templates/skills/processes/index.js +1 -0
  60. package/dist/application-spec/generate-application/code/templates/skills/processes/model-migration.d.ts +2 -0
  61. package/dist/application-spec/generate-application/code/templates/skills/processes/model-migration.js +1 -0
  62. package/dist/application-spec/generate-application/code/templates/skills/{phoenix-skill.d.ts → processes/operations.d.ts} +2 -1
  63. package/dist/application-spec/generate-application/code/templates/skills/processes/operations.js +2 -0
  64. package/dist/application-spec/generate-application/code/templates/skills/processes/planning.d.ts +2 -0
  65. package/dist/application-spec/generate-application/code/templates/skills/processes/planning.js +5 -0
  66. package/dist/application-spec/generate-application/code/templates/skills/processes/review/appearance.d.ts +2 -0
  67. package/dist/application-spec/generate-application/code/templates/skills/processes/review/appearance.js +46 -0
  68. package/dist/application-spec/generate-application/code/templates/skills/processes/review/code.d.ts +2 -0
  69. package/dist/application-spec/generate-application/code/templates/skills/processes/review/code.js +2 -0
  70. package/dist/application-spec/generate-application/code/templates/skills/processes/review/hand-over.d.ts +2 -0
  71. package/dist/application-spec/generate-application/code/templates/skills/processes/review/hand-over.js +6 -0
  72. package/dist/application-spec/generate-application/code/templates/skills/processes/review/index.d.ts +1 -0
  73. package/dist/application-spec/generate-application/code/templates/skills/processes/review/index.js +1 -0
  74. package/dist/application-spec/generate-application/code/templates/skills/processes/review/review.d.ts +3 -0
  75. package/dist/application-spec/generate-application/code/templates/skills/processes/review/review.js +1 -0
  76. package/dist/application-spec/generate-application/code/templates/skills/processes/review/visual-inspection.d.ts +2 -0
  77. package/dist/application-spec/generate-application/code/templates/skills/processes/review/visual-inspection.js +13 -0
  78. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/branding.d.ts +2 -0
  79. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/branding.js +20 -0
  80. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/catalog.d.ts +2 -0
  81. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/catalog.js +1 -0
  82. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/index.d.ts +1 -0
  83. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/index.js +1 -0
  84. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/product-definition.d.ts +2 -0
  85. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/product-definition.js +22 -0
  86. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/specification.d.ts +3 -0
  87. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/specification.js +1 -0
  88. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-guidelines.d.ts +2 -0
  89. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-guidelines.js +25 -0
  90. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +63 -249
  91. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +3 -58
  92. package/dist/application-spec/generate-application/code/templates/spec-code/collect-spec-code.d.ts +1 -1
  93. package/dist/application-spec/generate-application/code/templates/spec-code/collect-spec-code.js +1 -1
  94. package/dist/application-spec/generate-application/code/templates/tsconfig.js +2 -1
  95. package/dist/application-spec/generate-application/index.d.ts +1 -8
  96. package/dist/application-spec/generate-application/index.js +1 -1
  97. package/dist/client/authorized-client.d.ts +1 -1
  98. package/dist/client/contract.d.ts +4 -3
  99. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +28 -18
  100. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  101. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +8 -2
  102. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  103. package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -1
  104. package/dist/configurator/application-runtime/extensions/systems/index.js +1 -1
  105. package/dist/configurator/ui/assistant/AssistantChips.d.ts +10 -0
  106. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  107. package/dist/configurator/ui/assistant/AssistantComposer.js +2 -2
  108. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
  109. package/dist/configurator/ui/assistant/AssistantThread.d.ts +4 -3
  110. package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
  111. package/dist/configurator/ui/assistant/alert/AssistantAlert.d.ts +4 -1
  112. package/dist/configurator/ui/assistant/alert/AssistantAlert.js +1 -1
  113. package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.js +1 -1
  114. package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -1
  115. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.d.ts +26 -0
  116. package/dist/configurator/ui/assistant/form-elements/FormNumber.js +1 -1
  117. package/dist/configurator/ui/assistant/popover/AssistantPopover.d.ts +24 -0
  118. package/dist/configurator/ui/assistant/popover/AssistantPopover.js +1 -0
  119. package/dist/configurator/ui/assistant/popover/index.d.ts +1 -0
  120. package/dist/configurator/ui/assistant/popover/index.js +1 -0
  121. package/dist/configurator/ui/assistant/reference-link/AssistantReferenceLink.js +1 -1
  122. package/dist/configurator/ui/assistant/reference-link/reference-styles.js +1 -1
  123. package/dist/configurator/ui/assistant/streamed-markdown.d.ts +11 -0
  124. package/dist/configurator/ui/assistant/streamed-markdown.js +2 -2
  125. package/dist/configurator/ui/assistant/tool-chip.js +1 -1
  126. package/dist/configurator/ui/assistant/use-load-older-on-top.d.ts +22 -0
  127. package/dist/configurator/ui/assistant/use-load-older-on-top.js +1 -0
  128. package/dist/configurator/ui/configurator-layout/universal/Layout.js +1 -1
  129. package/dist/docs/index.json +1 -1
  130. package/dist/docs/phoenix/getting-started.mdx +0 -2
  131. package/dist/docs/phoenix/migration-guide.mdx +7 -8
  132. package/dist/docs/phoenix/phoenix-cli.mdx +21 -12
  133. package/dist/docs/phoenix/project-structure.mdx +30 -35
  134. package/dist/docs/phoenix/sdk-builder-workflow.mdx +3 -9
  135. package/dist/domain/application/GetApplicationWrapperHandler.d.ts +1 -1
  136. package/dist/domain/application/GetThemeHandler.d.ts +1 -1
  137. package/dist/domain/application/GetWebComponentOptions.d.ts +1 -1
  138. package/dist/domain/application/application-config.d.ts +1 -3
  139. package/dist/domain/application/assistant/assistant-fields.d.ts +1 -1
  140. package/dist/domain/application/assistant/assistant-value-type.d.ts +1 -1
  141. package/dist/domain/application/assistant/build-assistant-lenses.d.ts +1 -2
  142. package/dist/domain/application/assistant/build-assistant-manifest.d.ts +1 -2
  143. package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +1 -2
  144. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  145. package/dist/domain/application/assistant/index.d.ts +0 -4
  146. package/dist/domain/application/assistant/index.js +1 -1
  147. package/dist/domain/application/assistant/session-setup/AssistantSetupHandler.d.ts +1 -1
  148. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.d.ts +1 -1
  149. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +1 -1
  150. package/dist/domain/application/assistant/session-setup/create-session-assistant.d.ts +1 -2
  151. package/dist/domain/application/assistant-field-options.d.ts +1 -1
  152. package/dist/domain/application/assistant-mutations.d.ts +1 -1
  153. package/dist/domain/application/assistant-recipe-groups.d.ts +1 -1
  154. package/dist/domain/application/configurator-builder.d.ts +1 -2
  155. package/dist/domain/application/create-initial-published-data.d.ts +2 -1
  156. package/dist/domain/application/published-data/DataRowValidatorHandler.d.ts +1 -1
  157. package/dist/domain/application/published-data/FilterPublishedChunksHandler.d.ts +1 -1
  158. package/dist/domain/application/published-data/MapPublishedChunkedDataHandler.d.ts +1 -1
  159. package/dist/domain/application/published-data/MapPublishedRevisionDataHandler.d.ts +1 -1
  160. package/dist/domain/application/published-data/SheetValidatorHandler.d.ts +1 -1
  161. package/dist/domain/domain-builder/domain-builder.d.ts +1 -1
  162. package/dist/domain/domain-builder/domain-builder.js +1 -1
  163. package/dist/domain/domain-runtime/domain-runtime.d.ts +24 -24
  164. package/dist/domain/domain-runtime/index.d.ts +0 -1
  165. package/dist/domain/domain-runtime/index.js +1 -1
  166. package/dist/domain/domain-runtime/spec/create-violation-expressions.d.ts +1 -1
  167. package/dist/domain/domain-runtime/spec/create-violation-expressions.js +1 -1
  168. package/dist/domain/domain-runtime/spec/index.d.ts +1 -1
  169. package/dist/domain/domain-runtime/spec/index.js +1 -1
  170. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  171. package/dist/domain/domain-runtime/spec/{module-checks/resolve-imported-transformers.d.ts → resolve-imported-transformers.d.ts} +3 -3
  172. package/dist/domain/domain-runtime/spec/resolve-imported-transformers.js +1 -0
  173. package/dist/domain/domain-runtime/spec/selectors.d.ts +5 -5
  174. package/dist/domain/domain-runtime/spec/types.d.ts +2 -2
  175. package/dist/domain/index.d.ts +13 -1
  176. package/dist/domain/index.js +1 -1
  177. package/dist/domain/mocks/create-test-application-config.d.ts +1 -1
  178. package/dist/domain/spec/index.d.ts +3 -8
  179. package/dist/domain/spec/index.js +1 -1
  180. package/dist/domain/{domain-runtime/spec/module-checks → spec/modules}/element-registration.d.ts +1 -1
  181. package/dist/domain/{domain-runtime/spec/module-checks → spec/modules}/find-assistant-form-element-errors.d.ts +1 -1
  182. package/dist/domain/spec/modules/find-assistant-form-element-errors.js +1 -0
  183. package/dist/domain/{domain-runtime/spec/module-checks → spec/modules}/index.d.ts +2 -3
  184. package/dist/domain/spec/modules/index.js +1 -0
  185. package/dist/domain/{domain-runtime/spec/module-checks → spec/modules}/merge-expression-modules.d.ts +2 -2
  186. package/dist/domain/spec/modules/merge-expression-modules.js +1 -0
  187. package/dist/domain/{domain-runtime/spec/module-checks → spec/modules}/project-modules.d.ts +1 -1
  188. package/dist/domain/spec/modules/project-modules.js +1 -0
  189. package/dist/domain/{domain-runtime/spec/module-checks → spec/modules}/resolve-action-modules.d.ts +1 -1
  190. package/dist/domain/{domain-runtime/spec/module-checks → spec/modules}/resolve-component-optic-modules.d.ts +1 -1
  191. package/dist/domain/{domain-runtime/spec/module-checks → spec/modules}/resolve-expression-modules.d.ts +1 -1
  192. package/dist/domain/{domain-runtime/spec/module-checks → spec/modules}/resolve-invariant-modules.d.ts +1 -1
  193. package/dist/domain/spec/phx/index.d.ts +1 -0
  194. package/dist/domain/spec/phx/index.js +1 -0
  195. package/dist/{application-spec/generate-application/implementations → domain/spec/phx}/phx-application-types.d.ts +1 -1
  196. package/dist/domain/spec/phx/phx-application-types.js +1 -0
  197. package/dist/domain/spec/phx/phx-domain.js +1 -0
  198. package/dist/{application-spec/generate-application/implementations → domain/spec/phx}/phx-model.d.ts +2 -2
  199. package/dist/domain/spec/phx/phx-model.js +1 -0
  200. package/dist/{application-spec/generate-application/implementations → domain/spec/phx}/phx.d.ts +1 -2
  201. package/dist/{application-spec/generate-application → domain/spec}/runtime/admin-runtime/admin-runtime.d.ts +7 -6
  202. package/dist/domain/spec/runtime/admin-runtime/admin-runtime.js +1 -0
  203. package/dist/{application-spec/generate-application → domain/spec}/runtime/admin-runtime/admin-spec-runtime.d.ts +2 -2
  204. package/dist/domain/spec/runtime/admin-runtime/admin-spec-runtime.js +1 -0
  205. package/dist/domain/spec/runtime/admin-runtime/index.d.ts +2 -0
  206. package/dist/domain/spec/runtime/admin-runtime/index.js +1 -0
  207. package/dist/{application-spec/generate-application → domain/spec}/runtime/admin-runtime/states-runtime.d.ts +1 -1
  208. package/dist/{application-spec/generate-application → domain/spec}/runtime/application-runtime.d.ts +8 -6
  209. package/dist/domain/spec/runtime/application-runtime.js +1 -0
  210. package/dist/{application-spec/generate-application → domain/spec}/runtime/application-spec-slice.d.ts +3 -1
  211. package/dist/domain/spec/runtime/application-spec-slice.js +1 -0
  212. package/dist/{application-spec/generate-application → domain/spec}/runtime/configurator-runtime/configurator-runtime.d.ts +8 -10
  213. package/dist/domain/spec/runtime/configurator-runtime/configurator-runtime.js +1 -0
  214. package/dist/{application-spec/generate-application → domain/spec}/runtime/configurator-runtime/configurator-spec-runtime.d.ts +2 -2
  215. package/dist/domain/spec/runtime/configurator-runtime/configurator-spec-runtime.js +1 -0
  216. package/dist/domain/spec/runtime/configurator-runtime/index.d.ts +2 -0
  217. package/dist/domain/spec/runtime/configurator-runtime/index.js +1 -0
  218. package/dist/{application-spec/generate-application → domain/spec}/runtime/configurator-runtime/states-runtime.d.ts +1 -1
  219. package/dist/{application-spec/generate-application → domain/spec}/runtime/create-application.d.ts +3 -2
  220. package/dist/domain/spec/runtime/create-application.js +1 -0
  221. package/dist/{application-spec/generate-application/runtime/sections → domain/spec/runtime/expressions}/expression-runtime.d.ts +5 -2
  222. package/dist/domain/spec/runtime/expressions/expression-runtime.js +1 -0
  223. package/dist/{application-spec/generate-application/runtime/sections → domain/spec/runtime/expressions}/generate-memo-eval-plan-runtime.d.ts +2 -1
  224. package/dist/domain/spec/runtime/expressions/generate-memo-eval-plan-runtime.js +1 -0
  225. package/dist/domain/spec/runtime/expressions/index.d.ts +3 -0
  226. package/dist/domain/spec/runtime/expressions/index.js +1 -0
  227. package/dist/{application-spec/generate-application/runtime/sections → domain/spec/runtime/expressions}/reflection-constants-runtime.d.ts +2 -1
  228. package/dist/{application-spec/generate-application → domain/spec}/runtime/factory-data/factory-data-runtime.d.ts +4 -2
  229. package/dist/{application-spec/generate-application → domain/spec}/runtime/factory-data/recipe-defaults.d.ts +1 -1
  230. package/dist/domain/spec/runtime/factory-data/recipe-defaults.js +1 -0
  231. package/dist/{application-spec/generate-application → domain/spec}/runtime/factory-data/static-violations.d.ts +2 -1
  232. package/dist/domain/spec/runtime/factory-data/static-violations.js +1 -0
  233. package/dist/{application-spec/generate-application → domain/spec}/runtime/generate-runtime-instance.d.ts +1 -1
  234. package/dist/domain/spec/runtime/generate-runtime-instance.js +1 -0
  235. package/dist/domain/spec/runtime/index.d.ts +13 -0
  236. package/dist/domain/spec/runtime/index.js +1 -0
  237. package/dist/{application-spec/generate-application → domain/spec}/runtime/migrations/migration-runtime.d.ts +2 -2
  238. package/dist/domain/spec/runtime/migrations/migration-runtime.js +1 -0
  239. package/dist/{application-spec/generate-application/runtime/admin-runtime → domain/spec/runtime/model}/admin-model-runtime.d.ts +4 -2
  240. package/dist/domain/spec/runtime/model/admin-model-runtime.js +1 -0
  241. package/dist/{application-spec/generate-application/runtime/configurator-runtime → domain/spec/runtime/model}/configurator-model-runtime.d.ts +4 -2
  242. package/dist/domain/spec/runtime/model/configurator-model-runtime.js +1 -0
  243. package/dist/domain/spec/runtime/model/index.d.ts +2 -0
  244. package/dist/domain/spec/runtime/model/index.js +1 -0
  245. package/dist/{application-spec/generate-application/runtime/sections → domain/spec/runtime/optics}/build-sdk-optic.d.ts +3 -4
  246. package/dist/domain/spec/runtime/optics/build-sdk-optic.js +1 -0
  247. package/dist/domain/spec/runtime/optics/build-user-bound-optic.d.ts +7 -0
  248. package/dist/domain/spec/runtime/optics/build-user-bound-optic.js +1 -0
  249. package/dist/domain/spec/runtime/optics/built-component-optic.d.ts +11 -0
  250. package/dist/{application-spec/generate-application/runtime/sections → domain/spec/runtime/optics}/component-optic.d.ts +4 -13
  251. package/dist/domain/spec/runtime/optics/index.d.ts +2 -0
  252. package/dist/domain/spec/runtime/optics/index.js +1 -0
  253. package/dist/{application-spec/caching → domain/spec/runtime}/runtime-reference-store.d.ts +1 -5
  254. package/dist/domain/spec/runtime/runtime-reference-store.js +1 -0
  255. package/dist/{application-spec/generate-application → domain/spec}/runtime/sections/actions-runtime.d.ts +3 -2
  256. package/dist/{application-spec/generate-application → domain/spec}/runtime/sections/assistant-runtime.d.ts +2 -2
  257. package/dist/{application-spec/generate-application → domain/spec}/runtime/sections/data-runtime.d.ts +1 -1
  258. package/dist/domain/spec/runtime/sections/index.d.ts +6 -0
  259. package/dist/domain/spec/runtime/sections/index.js +1 -0
  260. package/dist/{application-spec/generate-application → domain/spec}/runtime/sections/preset-runtime.d.ts +3 -2
  261. package/dist/{application-spec/generate-application → domain/spec}/runtime/sections/theme-runtime.d.ts +1 -1
  262. package/dist/{application-spec/generate-application → domain/spec}/runtime/sections/transformers-runtime.d.ts +2 -2
  263. package/dist/{application-spec/generate-application → domain/spec}/runtime/spec-code/resolve-spec-code.d.ts +1 -1
  264. package/dist/{application-spec/generate-application → domain/spec}/runtime/spec-runtime.d.ts +3 -3
  265. package/dist/domain/spec/runtime/spec-runtime.js +1 -0
  266. package/dist/domain/spec/runtime-spec/index.d.ts +4 -0
  267. package/dist/domain/spec/runtime-spec/index.js +1 -0
  268. package/dist/{application-spec/generate-application → domain/spec}/runtime-spec/runtime-spec.d.ts +7 -1
  269. package/dist/{application-spec/generate-application → domain/spec}/runtime-spec/spec-code-id.d.ts +1 -1
  270. package/dist/domain/spec/sections/assistant/assistant-resolved-manifest.js +1 -0
  271. package/dist/domain/spec/sections/assistant/index.d.ts +4 -0
  272. package/dist/domain/spec/sections/assistant/index.js +1 -0
  273. package/dist/domain/spec/sections/index.d.ts +1 -0
  274. package/dist/domain/spec/sections/index.js +1 -1
  275. package/dist/i18n/locales/cs/messages.js +1 -1
  276. package/dist/i18n/locales/da/messages.js +1 -1
  277. package/dist/i18n/locales/de/messages.js +1 -1
  278. package/dist/i18n/locales/de-AT/messages.js +1 -1
  279. package/dist/i18n/locales/en/messages.js +1 -1
  280. package/dist/i18n/locales/en-AU/messages.js +1 -1
  281. package/dist/i18n/locales/en-GB/messages.js +1 -1
  282. package/dist/i18n/locales/es/messages.js +1 -1
  283. package/dist/i18n/locales/fr/messages.js +1 -1
  284. package/dist/i18n/locales/hu/messages.js +1 -1
  285. package/dist/i18n/locales/it/messages.js +1 -1
  286. package/dist/i18n/locales/nl/messages.js +1 -1
  287. package/dist/i18n/locales/pl/messages.js +1 -1
  288. package/dist/i18n/locales/pt/messages.js +1 -1
  289. package/dist/i18n/locales/ro/messages.js +1 -1
  290. package/dist/i18n/locales/sk/messages.js +1 -1
  291. package/dist/i18n/locales/tr/messages.js +1 -1
  292. package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
  293. package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
  294. package/dist/phoenix/application-spec/index.d.ts +1 -0
  295. package/dist/phoenix/application-spec/index.js +1 -1
  296. package/dist/phoenix/application-spec/project-files.d.ts +8 -2
  297. package/dist/phoenix/application-spec/project-files.js +1 -1
  298. package/dist/phoenix/commands/clean.js +1 -1
  299. package/dist/phoenix/commands/deploy.js +1 -1
  300. package/dist/phoenix/services/source-archive.d.ts +2 -0
  301. package/dist/phoenix/services/source-archive.js +1 -1
  302. package/dist/phoenix/services/swc.d.ts +5 -4
  303. package/dist/phoenix/services/swc.js +2 -2
  304. package/dist/ui-sdk/components/numerical-input/InputField.d.ts +2 -0
  305. package/dist/ui-sdk/components/numerical-input/InputField.js +1 -1
  306. package/dist/ui-sdk/components/numerical-input/NumericalInput.d.ts +2 -2
  307. package/dist/ui-sdk/components/numerical-input/Slider.d.ts +3 -1
  308. package/dist/ui-sdk/components/numerical-input/Slider.js +1 -1
  309. package/package.json +3 -3
  310. package/dist/application-spec/caching/runtime-reference-store.js +0 -1
  311. package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.d.ts +0 -1
  312. package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +0 -1
  313. package/dist/application-spec/generate-application/code/templates/skills/phoenix-create-configurator-skill.d.ts +0 -3
  314. package/dist/application-spec/generate-application/code/templates/skills/phoenix-create-configurator-skill.js +0 -166
  315. package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.d.ts +0 -1
  316. package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +0 -54
  317. package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.d.ts +0 -1
  318. package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +0 -115
  319. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +0 -1
  320. package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.d.ts +0 -1
  321. package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.js +0 -6
  322. package/dist/application-spec/generate-application/implementations/phx-application-types.js +0 -1
  323. package/dist/application-spec/generate-application/implementations/phx-domain.js +0 -1
  324. package/dist/application-spec/generate-application/implementations/phx-model.js +0 -1
  325. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.js +0 -1
  326. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +0 -1
  327. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.js +0 -1
  328. package/dist/application-spec/generate-application/runtime/application-runtime.js +0 -1
  329. package/dist/application-spec/generate-application/runtime/application-spec-slice.js +0 -1
  330. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.js +0 -1
  331. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +0 -1
  332. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.js +0 -1
  333. package/dist/application-spec/generate-application/runtime/create-application.js +0 -1
  334. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +0 -1
  335. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +0 -1
  336. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.js +0 -1
  337. package/dist/application-spec/generate-application/runtime/index.d.ts +0 -8
  338. package/dist/application-spec/generate-application/runtime/index.js +0 -1
  339. package/dist/application-spec/generate-application/runtime/migrations/migration-runtime.js +0 -1
  340. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +0 -1
  341. package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.d.ts +0 -8
  342. package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.js +0 -1
  343. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +0 -1
  344. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.js +0 -1
  345. package/dist/application-spec/generate-application/runtime/sections/index.d.ts +0 -10
  346. package/dist/application-spec/generate-application/runtime/sections/index.js +0 -1
  347. package/dist/application-spec/generate-application/runtime/spec-runtime.js +0 -1
  348. package/dist/application-spec/generate-application/runtime-spec/index.d.ts +0 -5
  349. package/dist/application-spec/generate-application/runtime-spec/index.js +0 -1
  350. package/dist/configurator/application-runtime/extensions/systems/assistant-system/browser-details.d.ts +0 -17
  351. package/dist/configurator/application-runtime/extensions/systems/assistant-system/browser-details.js +0 -1
  352. package/dist/domain/domain-runtime/spec/module-checks/find-assistant-form-element-errors.js +0 -1
  353. package/dist/domain/domain-runtime/spec/module-checks/index.js +0 -1
  354. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.js +0 -1
  355. package/dist/domain/domain-runtime/spec/module-checks/project-modules.js +0 -1
  356. package/dist/domain/domain-runtime/spec/module-checks/resolve-imported-transformers.js +0 -1
  357. /package/dist/domain/{domain-runtime → spec}/errors/implementation-error-collector.d.ts +0 -0
  358. /package/dist/domain/{domain-runtime → spec}/errors/implementation-error-collector.js +0 -0
  359. /package/dist/domain/{domain-runtime → spec}/errors/implementation-error.d.ts +0 -0
  360. /package/dist/domain/{domain-runtime → spec}/errors/implementation-error.js +0 -0
  361. /package/dist/domain/{domain-runtime → spec}/errors/implementation-errors.d.ts +0 -0
  362. /package/dist/domain/{domain-runtime → spec}/errors/implementation-errors.js +0 -0
  363. /package/dist/domain/{domain-runtime → spec}/errors/index.d.ts +0 -0
  364. /package/dist/domain/{domain-runtime → spec}/errors/index.js +0 -0
  365. /package/dist/domain/{domain-runtime → spec}/errors/to-implementation-errors.d.ts +0 -0
  366. /package/dist/domain/{domain-runtime → spec}/errors/to-implementation-errors.js +0 -0
  367. /package/dist/domain/{domain-runtime/spec/module-checks → spec/modules}/element-registration.js +0 -0
  368. /package/dist/domain/{domain-runtime/spec/module-checks → spec/modules}/handler-registration.d.ts +0 -0
  369. /package/dist/domain/{domain-runtime/spec/module-checks → spec/modules}/handler-registration.js +0 -0
  370. /package/dist/domain/{domain-runtime/spec/module-checks → spec/modules}/resolve-action-modules.js +0 -0
  371. /package/dist/domain/{domain-runtime/spec/module-checks → spec/modules}/resolve-component-optic-modules.js +0 -0
  372. /package/dist/domain/{domain-runtime/spec/module-checks → spec/modules}/resolve-expression-modules.js +0 -0
  373. /package/dist/domain/{domain-runtime/spec/module-checks → spec/modules}/resolve-invariant-modules.js +0 -0
  374. /package/dist/{application-spec/generate-application/implementations → domain/spec/phx}/phx-domain.d.ts +0 -0
  375. /package/dist/{application-spec/generate-application/implementations → domain/spec/phx}/phx.js +0 -0
  376. /package/dist/{application-spec/generate-application → domain/spec}/runtime/admin-runtime/states-runtime.js +0 -0
  377. /package/dist/{application-spec/generate-application → domain/spec}/runtime/configurator-runtime/states-runtime.js +0 -0
  378. /package/dist/{application-spec/generate-application/runtime/sections → domain/spec/runtime/expressions}/reflection-constants-runtime.js +0 -0
  379. /package/dist/{application-spec/generate-application → domain/spec}/runtime/factory-data/factory-data-runtime.js +0 -0
  380. /package/dist/{application-spec/generate-application → domain/spec}/runtime/factory-data/index.d.ts +0 -0
  381. /package/dist/{application-spec/generate-application → domain/spec}/runtime/factory-data/index.js +0 -0
  382. /package/dist/{application-spec/generate-application → domain/spec}/runtime/migrations/index.d.ts +0 -0
  383. /package/dist/{application-spec/generate-application → domain/spec}/runtime/migrations/index.js +0 -0
  384. /package/dist/{application-spec/generate-application/runtime/spec-code/spec-code-module.js → domain/spec/runtime/optics/built-component-optic.js} +0 -0
  385. /package/dist/{application-spec/generate-application/runtime/sections → domain/spec/runtime/optics}/component-optic.js +0 -0
  386. /package/dist/{application-spec/generate-application → domain/spec}/runtime/sections/actions-runtime.js +0 -0
  387. /package/dist/{application-spec/generate-application → domain/spec}/runtime/sections/assistant-runtime.js +0 -0
  388. /package/dist/{application-spec/generate-application → domain/spec}/runtime/sections/data-runtime.js +0 -0
  389. /package/dist/{application-spec/generate-application → domain/spec}/runtime/sections/preset-runtime.js +0 -0
  390. /package/dist/{application-spec/generate-application → domain/spec}/runtime/sections/theme-runtime.js +0 -0
  391. /package/dist/{application-spec/generate-application → domain/spec}/runtime/sections/transformers-runtime.js +0 -0
  392. /package/dist/{application-spec/generate-application → domain/spec}/runtime/spec-code/index.d.ts +0 -0
  393. /package/dist/{application-spec/generate-application → domain/spec}/runtime/spec-code/index.js +0 -0
  394. /package/dist/{application-spec/generate-application → domain/spec}/runtime/spec-code/resolve-spec-code.js +0 -0
  395. /package/dist/{application-spec/generate-application → domain/spec}/runtime/spec-code/spec-code-module.d.ts +0 -0
  396. /package/dist/domain/{application/assistant/assistant-resolved-manifest.js → spec/runtime/spec-code/spec-code-module.js} +0 -0
  397. /package/dist/{application-spec/generate-application → domain/spec}/runtime-spec/decode-runtime-spec.d.ts +0 -0
  398. /package/dist/{application-spec/generate-application → domain/spec}/runtime-spec/decode-runtime-spec.js +0 -0
  399. /package/dist/{application-spec/generate-application → domain/spec}/runtime-spec/encode-runtime-spec.d.ts +0 -0
  400. /package/dist/{application-spec/generate-application → domain/spec}/runtime-spec/encode-runtime-spec.js +0 -0
  401. /package/dist/{application-spec/generate-application → domain/spec}/runtime-spec/encoded-runtime-spec.d.ts +0 -0
  402. /package/dist/{application-spec/generate-application → domain/spec}/runtime-spec/encoded-runtime-spec.js +0 -0
  403. /package/dist/{application-spec/generate-application → domain/spec}/runtime-spec/runtime-spec.js +0 -0
  404. /package/dist/{application-spec/generate-application → domain/spec}/runtime-spec/spec-code-id.js +0 -0
  405. /package/dist/domain/{application → spec/sections}/assistant/assistant-manifest.d.ts +0 -0
  406. /package/dist/domain/{application → spec/sections}/assistant/assistant-manifest.js +0 -0
  407. /package/dist/domain/{application → spec/sections}/assistant/assistant-resolved-manifest.d.ts +0 -0
  408. /package/dist/domain/{application → spec/sections}/assistant/form/assistant-form-element-name.d.ts +0 -0
  409. /package/dist/domain/{application → spec/sections}/assistant/form/assistant-form-element-name.js +0 -0
  410. /package/dist/domain/{application → spec/sections}/assistant/form/assistant-form-elements.d.ts +0 -0
  411. /package/dist/domain/{application → spec/sections}/assistant/form/assistant-form-elements.js +0 -0
  412. /package/dist/domain/{application → spec/sections}/assistant/form/assistant-resource-path.d.ts +0 -0
  413. /package/dist/domain/{application → spec/sections}/assistant/form/assistant-resource-path.js +0 -0
  414. /package/dist/domain/{application → spec/sections}/assistant/form/index.d.ts +0 -0
  415. /package/dist/domain/{application → spec/sections}/assistant/form/index.js +0 -0
@@ -1 +1 @@
1
- import{jsx as e,jsxs as i}from"react/jsx-runtime";import{Trans as r}from"@lingui/react";import{Button as o,styled as t}from"@mui/material";import{memo as n,useCallback as a,useEffect as s,useMemo as l,useState as d}from"react";import{match as m}from"ts-pattern";import{useConfigurator as c}from"../../../application-runtime/index.js";import{AssistantPanelName as p}from"../theme.js";import{composeAnswer as u}from"./compose-answer.js";import{describeBuildErrors as b}from"./describe-build-errors.js";import{parseFormBlock as f}from"./parse-form-block.js";import{useFormRegistry as g}from"./registry/index.js";let h=t("div",{name:p,slot:"form"})(({theme:{spacing:e}})=>({display:"flex",flexDirection:"column",gap:e(1.5),marginBlock:e(1)})),k=t(o,{name:p,slot:"formSubmit"})(({theme:{palette:e,spacing:i,typography:r}})=>({...r.body2,alignSelf:"end",background:e.primary.main,border:"none",borderRadius:8,color:e.primary.contrastText,fontWeight:r.fontWeightMedium,letterSpacing:"normal",minBlockSize:0,minInlineSize:0,paddingBlock:i(.5),paddingInline:i(2),textTransform:"none","&:hover":{background:e.primary.dark,border:"none"},"&.Mui-disabled":{background:e.action.disabledBackground,border:"none",color:e.action.disabled}})),w=t("div",{name:p,slot:"formNote"})(({theme:{palette:e,shape:i,spacing:r,typography:o}})=>({...o.caption,alignItems:"center",background:e.action.hover,borderRadius:i.borderRadius,color:e.text.secondary,display:"flex",flexWrap:"wrap",gap:r(1),justifyContent:"space-between",marginBlock:r(1),paddingBlock:r(1),paddingInline:r(1.5)})),x=({model:o,disabled:t,send:n})=>{let[a,s]=d(()=>new Map),[l,c]=d(()=>new Map),p=(i,r)=>{let{id:l,definition:d,label:b,attributes:f}=i;return m(d).with({role:"option"},({component:d})=>e(d,{attributes:f,label:b,disabled:t,selected:!0===a.get(l),onSelect:e=>{o.isQuick?n(u(o,new Map([[i.id,!0]]),new Map([[i.id,e]]))):(c(r=>new Map(r).set(i.id,e)),s(e=>{let o=new Map(e);if("choice"===r.definition.role){for(let e of r.children)o.delete(e.id);o.set(i.id,!0)}else o.set(i.id,!0!==e.get(i.id));return o}))}},l)).with({role:"input"},({component:r})=>e(r,{attributes:f,label:b,disabled:t,state:a.get(l),onChange:(e,r)=>{o.isQuick?n(u(o,new Map([[i.id,e]]),new Map([[i.id,r]]))):(s(r=>new Map(r).set(i.id,e)),c(e=>new Map(e).set(i.id,r)))}},l)).with({role:"group"},{role:"choice"},{role:"choices"},({component:r})=>e(r,{attributes:f,label:b,disabled:t,children:i.children.map(e=>p(e,i))},l)).exhaustive()};return i(h,{children:[o.root.children.map(e=>p(e,o.root)),!o.isQuick&&e(k,{variant:"contained",disabled:t,disableElevation:!0,onClick:()=>{t||o.isQuick||n(u(o,a,l))},children:e(r,{id:"sdk.assistant.form.submit.label",message:"Submit"})})]})};export const AssistantForm=n(({source:t,status:n})=>{let{assistantSystem:m}=c(),[p,u]=d(!1),h="writing"===n,k=g(),M=l(()=>h?void 0:f(t,k),[t,h,k]),y="ready"!==n||p,j=a(e=>{u(!0),m.send(e).finally(()=>u(!1))},[m]);return(s(()=>{M?.ok===!1&&console.warn("The assistant wrote a form that could not be built.",M.errors)},[M]),M)?M.ok?0===M.root.children.length?null:e(x,{model:M,disabled:y,send:j}):i(w,{role:"alert",children:[e("span",{children:e(r,{id:"sdk.assistant.form.failure",message:"The assistant couldn't build this form."})}),e(o,{size:"small",variant:"outlined",color:"inherit",disabled:y,onClick:()=>j(b(M.errors)),children:e(r,{id:"sdk.assistant.form.fix.label",message:"Fix it"})})]}):e(w,{children:e(r,{id:"sdk.assistant.form.writing",message:"Preparing a form…"})})});
1
+ import{jsx as e,jsxs as i}from"react/jsx-runtime";import{Trans as r}from"@lingui/react";import{Button as o,styled as n}from"@mui/material";import{memo as t,useCallback as a,useEffect as d,useMemo as s,useState as l}from"react";import{match as m}from"ts-pattern";import{hoverStyles as c}from"#package/ui-sdk";import{useConfigurator as p}from"../../../application-runtime/index.js";import{AssistantPanelName as b}from"../theme.js";import{composeAnswer as u}from"./compose-answer.js";import{describeBuildErrors as g}from"./describe-build-errors.js";import{parseFormBlock as f}from"./parse-form-block.js";import{useFormRegistry as h}from"./registry/index.js";let k=n("div",{name:b,slot:"form"})(({theme:{spacing:e}})=>({display:"flex",flexDirection:"column",gap:e(1.5),marginBlock:e(1)})),x=n(o,{name:b,slot:"formSubmit"})(({theme:{palette:e,spacing:i,typography:r}})=>({...r.body2,alignSelf:"end",background:e.primary.main,border:"none",borderRadius:8,color:e.primary.contrastText,fontWeight:r.fontWeightMedium,letterSpacing:"normal",minBlockSize:0,minInlineSize:0,paddingBlock:i(.5),paddingInline:i(2),textTransform:"none","&:hover":{background:e.primary.dark,border:"none"},"&.Mui-disabled":{background:e.action.disabledBackground,border:"none",color:e.action.disabled}})),w=n(o,{name:b,slot:"formFix"})(({theme:{palette:e,spacing:i,typography:r}})=>({...r.caption,background:"transparent",border:`1px solid ${e.divider}`,borderRadius:8,boxShadow:"none",color:e.text.primary,fontWeight:r.fontWeightMedium,letterSpacing:"normal",minBlockSize:0,minInlineSize:0,paddingBlock:i(.25),paddingInline:i(1.5),textTransform:"none","&:hover":{background:"transparent",border:`1px solid ${e.divider}`,boxShadow:"none"},...c({"&:hover":{background:e.action.hover}}),"&.Mui-disabled":{background:"transparent",border:`1px solid ${e.action.disabledBackground}`,color:e.action.disabled}})),M=n("div",{name:b,slot:"formNote"})(({theme:{palette:e,shape:i,spacing:r,typography:o}})=>({...o.caption,alignItems:"center",background:e.action.hover,borderRadius:i.borderRadius,color:e.text.secondary,display:"flex",flexWrap:"wrap",gap:r(1),justifyContent:"space-between",marginBlock:r(1),paddingBlock:r(1),paddingInline:r(1.5)})),v=({model:o,disabled:n,send:t})=>{let[a,d]=l(()=>new Map),[s,c]=l(()=>new Map),p=(i,r)=>{let{id:s,definition:l,label:b,attributes:g}=i;return m(l).with({role:"option"},({component:l})=>e(l,{attributes:g,label:b,disabled:n,selected:!0===a.get(s),onSelect:e=>{o.isQuick?t(u(o,new Map([[i.id,!0]]),new Map([[i.id,e]]))):(c(r=>new Map(r).set(i.id,e)),d(e=>{let o=new Map(e);if("choice"===r.definition.role){for(let e of r.children)o.delete(e.id);o.set(i.id,!0)}else o.set(i.id,!0!==e.get(i.id));return o}))}},s)).with({role:"input"},({component:r})=>e(r,{attributes:g,label:b,disabled:n,state:a.get(s),onChange:(e,r)=>{o.isQuick?t(u(o,new Map([[i.id,e]]),new Map([[i.id,r]]))):(d(r=>new Map(r).set(i.id,e)),c(e=>new Map(e).set(i.id,r)))}},s)).with({role:"group"},{role:"choice"},{role:"choices"},({component:r})=>e(r,{attributes:g,label:b,disabled:n,children:i.children.map(e=>p(e,i))},s)).exhaustive()};return i(k,{children:[o.root.children.map(e=>p(e,o.root)),!o.isQuick&&e(x,{variant:"contained",disabled:n,disableElevation:!0,onClick:()=>{n||o.isQuick||t(u(o,a,s))},children:e(r,{id:"sdk.assistant.form.submit.label",message:"Submit"})})]})};export const AssistantForm=t(({source:o,status:n})=>{let{assistantSystem:t}=p(),[m,c]=l(!1),b="writing"===n,u=h(),k=s(()=>b?void 0:f(o,u),[o,b,u]),x="ready"!==n||m,y=a(e=>{c(!0),t.send(e).finally(()=>c(!1))},[t]);return(d(()=>{k?.ok===!1&&console.warn("The assistant wrote a form that could not be built.",k.errors)},[k]),k)?k.ok?0===k.root.children.length?null:e(v,{model:k,disabled:x,send:y}):i(M,{role:"alert",children:[e("span",{children:e(r,{id:"sdk.assistant.form.failure",message:"The assistant couldn't build this form."})}),e(w,{disabled:x,onClick:()=>y(g(k.errors)),children:e(r,{id:"sdk.assistant.form.fix.label",message:"Fix it"})})]}):e(M,{children:e(r,{id:"sdk.assistant.form.writing",message:"Preparing a form…"})})});
@@ -1,3 +1,29 @@
1
+ import { ASSISTANT_BUILT_IN_FORM_ELEMENTS, type AssistantBuiltInFormElementAttributes, type AssistantBuiltInFormElementName } from '#package/domain';
2
+ import { type FormContainerProps, type FormInputProps, type FormOptionProps } from '../../form-elements/index.js';
1
3
  import { type FormElementDefinition } from './form-element-definition.js';
4
+ type BuiltInFormElementRole<NAME extends AssistantBuiltInFormElementName> = Extract<(typeof ASSISTANT_BUILT_IN_FORM_ELEMENTS)[number], {
5
+ readonly name: NAME;
6
+ }>['role'];
7
+ /** The state each built-in input keeps, which the form hands back to it. */
8
+ interface BuiltInFormInputStates {
9
+ readonly text: string;
10
+ readonly number: number;
11
+ readonly confirm: boolean;
12
+ }
13
+ /** The props the component of a built-in element takes: those of its role, typed from its descriptor. */
14
+ type BuiltInFormElementProps<NAME extends AssistantBuiltInFormElementName> = BuiltInFormElementRole<NAME> extends 'option' ? FormOptionProps<AssistantBuiltInFormElementAttributes<NAME>> : BuiltInFormElementRole<NAME> extends 'input' ? FormInputProps<NAME extends keyof BuiltInFormInputStates ? BuiltInFormInputStates[NAME] : never, AssistantBuiltInFormElementAttributes<NAME>> : FormContainerProps<AssistantBuiltInFormElementAttributes<NAME>>;
15
+ type Same<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => (T extends B ? 1 : 2) ? true : false;
16
+ type PropsOf<COMPONENT> = COMPONENT extends (props: infer PROPS) => unknown ? PROPS : never;
17
+ /**
18
+ * Checks the component of every built-in element against the name it stands under, since the
19
+ * definition built from it is cast on the word that the two belong together: an entry whose
20
+ * component does not take exactly the props of its name becomes `never`. Exactly, because
21
+ * assignability would let a component whose attributes are all optional, or that reports another
22
+ * state through a method, stand under another name.
23
+ */
24
+ export type BuiltInFormComponents<COMPONENTS extends Readonly<Record<AssistantBuiltInFormElementName, unknown>>> = {
25
+ readonly [NAME in AssistantBuiltInFormElementName]: Same<PropsOf<COMPONENTS[NAME]>, BuiltInFormElementProps<NAME>> extends true ? COMPONENTS[NAME] : never;
26
+ };
2
27
  /** The elements of every assistant form: the built-ins the SDK prompt lists, with their components. */
3
28
  export declare const BUILT_IN_FORM_ELEMENTS: readonly FormElementDefinition[];
29
+ export {};
@@ -1 +1 @@
1
- import{jsx as r,jsxs as i}from"react/jsx-runtime";import{Trans as e}from"@lingui/react";import{styled as o}from"@mui/material";import{useCallback as t,useEffect as a}from"react";import{NumericalInput as m}from"#package/ui-sdk";import{AssistantPanelName as n}from"../theme.js";import{clampFormNumber as s}from"./clamp-form-number.js";let l=o("div",{name:n,slot:"formNumber"})(({theme:{palette:r,spacing:i,typography:e}})=>({alignSelf:"stretch",color:r.text.secondary,display:"grid",gap:i(.5),...e.caption})),d=(r,i)=>i?`${r} ${i}`:String(r),u=r=>""===r.trim()?null:Number(r);export const FormNumber=({attributes:{value:o,min:n,max:p,step:v,unit:c},label:f,disabled:g,state:b,onChange:h})=>{let x=void 0===o?void 0:s(o,{min:n,max:p}),j=b??x;a(()=>{void 0===b&&void 0!==x&&h(x,d(x,c))},[b,x,c,h]);let N=t(r=>h(r,d(r,c)),[h,c]),S=t(()=>{if(void 0===j)return;let r=s(j,{min:n,max:p});r!==j&&N(r)},[j,n,p,N]),k=t(r=>void 0===j?"":String(r),[j]);return i(l,{role:"group","aria-label":f,children:[null!=f&&r("span",{"aria-hidden":!0,children:f}),r(m,{value:j??n??0,min:n,max:p,unit:c,size:"small",disabled:g,withSlider:void 0!==n&&void 0!==p,sliderProps:void 0===v?void 0:{step:v},inputFieldProps:{parseValue:u,formatValue:k,invalidNumberErrorMessage:r(e,{id:"sdk.assistant.form.number.invalid",message:"Enter a number."})},onChange:N,onChanged:S})]})};
1
+ import{jsx as r,jsxs as i}from"react/jsx-runtime";import{Trans as e}from"@lingui/react";import{styled as a}from"@mui/material";import{useCallback as o,useEffect as t}from"react";import{NumericalInput as m}from"#package/ui-sdk";import{AssistantPanelName as l}from"../theme.js";import{clampFormNumber as n}from"./clamp-form-number.js";let s=a("div",{name:l,slot:"formNumber"})(({theme:{palette:r,spacing:i,typography:e}})=>({alignSelf:"stretch",color:r.text.secondary,display:"grid",gap:i(.5),...e.caption})),d=(r,i)=>i?`${r} ${i}`:String(r),u=r=>""===r.trim()?null:Number(r);export const FormNumber=({attributes:{value:a,min:l,max:p,step:g,unit:v},label:b,disabled:c,state:f,onChange:h})=>{let x=void 0===a?void 0:n(a,{min:l,max:p}),j=f??x;t(()=>{void 0===f&&void 0!==x&&h(x,d(x,v))},[f,x,v,h]);let N=o(r=>h(r,d(r,v)),[h,v]),S=o(()=>{if(void 0===j)return;let r=n(j,{min:l,max:p});r!==j&&N(r)},[j,l,p,N]),k=o(r=>void 0===j?"":String(r),[j]),y=o(()=>b??"",[b]);return i(s,{role:"group","aria-label":b,children:[null!=b&&r("span",{"aria-hidden":!0,children:b}),r(m,{value:j??l??0,min:l,max:p,unit:v,size:"small",disabled:c,withSlider:void 0!==l&&void 0!==p,sliderProps:{step:g,getAriaLabel:null==b?void 0:y},inputFieldProps:{"aria-label":b,parseValue:u,formatValue:k,invalidNumberErrorMessage:r(e,{id:"sdk.assistant.form.number.invalid",message:"Enter a number."})},onChange:N,onChanged:S})]})};
@@ -0,0 +1,24 @@
1
+ import { type KeyboardEvent, type ReactElement, type ReactNode } from 'react';
2
+ /** What makes the element that opens a popover a button to the keyboard and to assistive technology. */
3
+ export interface AssistantPopoverTriggerProps {
4
+ readonly role: 'button';
5
+ readonly tabIndex: 0;
6
+ readonly 'aria-expanded': boolean;
7
+ readonly onClick: () => void;
8
+ readonly onKeyDown: (event: KeyboardEvent) => void;
9
+ }
10
+ export interface AssistantPopoverProps {
11
+ /**
12
+ * What the popover shows; the tooltip mounts it only while the popover is open. `rePlace` places
13
+ * the popover again after its content changed size, as when a picture in it has loaded.
14
+ */
15
+ readonly title: (rePlace: () => void) => ReactNode;
16
+ /** The element that opens the popover, given the props that make it do so. */
17
+ readonly children: (trigger: AssistantPopoverTriggerProps) => ReactElement;
18
+ }
19
+ /**
20
+ * A popover over something in the thread, such as a reference in a reply or the screenshots of a
21
+ * tool call: hovering, focusing or tapping its element opens it; leaving it, tapping outside or
22
+ * Escape closes it. It describes its element, whose label stays its own.
23
+ */
24
+ export declare const AssistantPopover: ({ title, children }: AssistantPopoverProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{ClickAwayListener as n,Tooltip as o}from"@mui/material";import{useCallback as t,useRef as r,useState as i}from"react";export const AssistantPopover=({title:p,children:a})=>{let[l,s]=i(!1),c=t(()=>s(!0),[]),u=t(()=>s(!1),[]),d=r(null),m=t(e=>{d.current=e},[]),x=t(()=>{d.current?.update()},[]),h=t(e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),s(!0))},[]);return e(n,{onClickAway:u,mouseEvent:!!l&&"onClick",touchEvent:!!l&&"onTouchEnd",children:e(o,{open:l,onOpen:c,onClose:u,title:p(x),placement:"top-start",describeChild:!0,disableTouchListener:!0,PopperProps:{popperRef:m},slotProps:{tooltip:{sx:{background:"none",maxInlineSize:"none",padding:0}}},children:a({role:"button",tabIndex:0,"aria-expanded":l,onClick:c,onKeyDown:h})})})};
@@ -0,0 +1 @@
1
+ export { AssistantPopover } from './AssistantPopover.js';
@@ -0,0 +1 @@
1
+ export{AssistantPopover}from"./AssistantPopover.js";
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Trans as n}from"@lingui/react";import{ClickAwayListener as t,Tooltip as a,styled as i}from"@mui/material";import{memo as o,useCallback as l,useEffect as s,useRef as d,useState as c}from"react";import{isShallowEqual as p}from"@salsita-ai/common/utils";import{useResourceUrl as m}from"#package/react-sdk";import{AssistantPanelName as u}from"../theme.js";import{assistantReferenceStyles as f}from"./reference-styles.js";import{useAssistantReferenceDetails as h}from"./use-assistant-reference-details.js";let b=i("span",{name:u,slot:"referenceLink"})(f),x=i("span",{name:u,slot:"referenceDetails"})(({theme:{palette:e,shape:r,shadows:n,spacing:t,typography:a}})=>({...a.body2,background:e.background.paper,borderRadius:r.borderRadius,boxShadow:n[4],color:e.text.primary,display:"flex",gap:t(1.5),maxInlineSize:320,padding:t(1.5),'&[data-reference-details="unavailable"]':{color:e.text.secondary}})),g=i("img")(({theme:{shape:e}})=>({alignSelf:"flex-start",blockSize:"auto",borderRadius:e.borderRadius/2,flexShrink:0,inlineSize:64,maxBlockSize:96,objectFit:"contain"})),k=i("span")(({theme:{palette:e,shape:r}})=>({blockSize:32,borderRadius:r.borderRadius/2,boxShadow:`inset 0 0 0 1px ${e.divider}`,flexShrink:0,inlineSize:32})),y=i("span")(({theme:{palette:e,spacing:r}})=>({display:"flex",flexDirection:"column",gap:r(.5),minInlineSize:0,"& > :first-of-type":{fontWeight:600},"& > :not(:first-of-type)":{color:e.text.secondary}})),S=({target:t,onResolve:a,onImageLoad:i})=>{let o=h(t),{getResourceUrl:l}=m(),d=null!=o;if(s(()=>{a(d)},[d,a]),!o)return e(x,{"data-reference-details":"unavailable",children:e(n,{id:"sdk.assistant.reference.unavailable.message",message:"Not available right now"})});let{name:c,description:p,imageUrl:u,color:f}=o;return r(x,{children:[null!=u&&e(g,{src:l(u),alt:"",onLoad:i}),null==u&&null!=f&&e(k,{style:{background:f}}),r(y,{children:[e("span",{children:c}),null!=p&&e("span",{children:p})]})]})};export const AssistantReferenceLink=o(({target:r,children:n})=>{let[i,o]=c(!1),[s,p]=c(!1),m=l(()=>o(!0),[]),u=l(()=>o(!1),[]),f=l(e=>p(!e),[]),h=d(null),x=l(e=>{h.current=e},[]),g=l(()=>{h.current?.update()},[]),k=l(e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),o(!0))},[]);return e(t,{onClickAway:u,mouseEvent:!!i&&"onClick",touchEvent:!!i&&"onTouchEnd",children:e(a,{open:i,onOpen:m,onClose:u,title:e(S,{target:r,onResolve:f,onImageLoad:g}),placement:"top-start",describeChild:!0,disableTouchListener:!0,PopperProps:{popperRef:x},slotProps:{tooltip:{sx:{background:"none",maxInlineSize:"none",padding:0}}},children:e(b,{role:"button",tabIndex:0,"aria-expanded":i,"data-reference":s?"muted":void 0,onClick:m,onKeyDown:k,children:n})})})},(e,r)=>e.children===r.children&&p(e.target,r.target));
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Trans as a}from"@lingui/react";import{styled as i}from"@mui/material";import{memo as t,useCallback as n,useEffect as o,useState as l}from"react";import{isShallowEqual as s}from"@salsita-ai/common/utils";import{useResourceUrl as d}from"#package/react-sdk";import{AssistantPopover as m}from"../popover/index.js";import{AssistantPanelName as c}from"../theme.js";import{assistantReferenceStyles as f}from"./reference-styles.js";import{useAssistantReferenceDetails as p}from"./use-assistant-reference-details.js";let u=i("span",{name:c,slot:"referenceLink"})(f),h=i("span",{name:c,slot:"referenceDetails"})(({theme:{palette:e,shape:r,shadows:a,spacing:i,typography:t}})=>({...t.body2,background:e.background.paper,borderRadius:r.borderRadius,boxShadow:a[4],color:e.text.primary,display:"flex",gap:i(1.5),maxInlineSize:320,padding:i(1.5),'&[data-reference-details="unavailable"]':{color:e.text.secondary}})),b=i("img")(({theme:{shape:e}})=>({alignSelf:"flex-start",blockSize:"auto",borderRadius:e.borderRadius/2,flexShrink:0,inlineSize:64,maxBlockSize:96,objectFit:"contain"})),x=i("span")(({theme:{palette:e,shape:r}})=>({blockSize:32,borderRadius:r.borderRadius/2,boxShadow:`inset 0 0 0 1px ${e.divider}`,flexShrink:0,inlineSize:32})),g=i("span")(({theme:{palette:e,spacing:r}})=>({display:"flex",flexDirection:"column",gap:r(.5),minInlineSize:0,"& > :first-of-type":{fontWeight:600},"& > :not(:first-of-type)":{color:e.text.secondary}})),k=({target:i,onResolve:t,onImageLoad:n})=>{let l=p(i),{getResourceUrl:s}=d(),m=null!=l;if(o(()=>{t(m)},[m,t]),!l)return e(h,{"data-reference-details":"unavailable",children:e(a,{id:"sdk.assistant.reference.unavailable.message",message:"Not available right now"})});let{name:c,description:f,imageUrl:u,color:k}=l;return r(h,{children:[null!=u&&e(b,{src:s(u),alt:"",onLoad:n}),null==u&&null!=k&&e(x,{style:{background:k}}),r(g,{children:[e("span",{children:c}),null!=f&&e("span",{children:f})]})]})};export const AssistantReferenceLink=t(({target:r,children:a})=>{let[i,t]=l(!1),o=n(e=>t(!e),[]);return e(m,{title:a=>e(k,{target:r,onResolve:o,onImageLoad:a}),children:r=>e(u,{...r,"data-reference":i?"muted":void 0,children:a})})},(e,r)=>e.children===r.children&&s(e.target,r.target));
@@ -1 +1 @@
1
- import{alpha as e}from"@mui/material";export const assistantReferenceStyles=({theme:{palette:r,shape:o}})=>({background:"none",border:"none",borderRadius:o.borderRadius/2,boxDecorationBreak:"clone",color:r.primary.main,cursor:"pointer",font:"inherit",margin:0,padding:0,textDecorationLine:"underline",textDecorationStyle:"dashed",textDecorationThickness:1,textUnderlineOffset:"0.2em",WebkitBoxDecorationBreak:"clone",'&:hover, &:focus-visible, &[data-hovered="true"], &[aria-expanded="true"]':{background:e(r.primary.main,r.action.hoverOpacity)},"&:focus-visible":{outline:`2px solid ${r.primary.main}`,outlineOffset:1},'&[data-reference="plain"]':{color:"inherit",cursor:"auto"},'&[data-reference="muted"]':{color:r.text.disabled}});
1
+ import{alpha as e}from"@mui/material";import{hoverStyles as r}from"#package/ui-sdk";export const assistantReferenceStyles=({theme:{palette:o,shape:i}})=>({background:"none",border:"none",borderRadius:i.borderRadius/2,boxDecorationBreak:"clone",color:o.primary.main,cursor:"pointer",font:"inherit",margin:0,padding:0,textDecorationLine:"underline",textDecorationStyle:"dashed",textDecorationThickness:1,textUnderlineOffset:"0.2em",WebkitBoxDecorationBreak:"clone",'&:focus-visible, &[data-hovered="true"], &[aria-expanded="true"]':{background:e(o.primary.main,o.action.hoverOpacity)},...r({"&:hover":{background:e(o.primary.main,o.action.hoverOpacity)}}),"&:focus-visible":{outline:`2px solid ${o.primary.main}`,outlineOffset:1},'&[data-reference="plain"]':{color:"inherit",cursor:"auto"},'&[data-reference="muted"]':{color:o.text.disabled}});
@@ -1,3 +1,14 @@
1
+ /** Where a code block starts and ends in the text, as Markdown parsed it. */
2
+ export interface FencePosition {
3
+ readonly start: number;
4
+ readonly end: number;
5
+ }
6
+ /**
7
+ * True when a code block of a finished reply was cut off: it runs to the end of the reply without
8
+ * the line that closes its fence, whatever backticks the reply has elsewhere. A block that the end
9
+ * of its list item or blockquote closed before the reply went on is not cut off.
10
+ */
11
+ export declare const isCutOffFence: (text: string, { start, end }: FencePosition) => boolean;
1
12
  /** True when the text has a code fence the model has not closed yet. */
2
13
  export declare const hasOpenFence: (text: string) => boolean;
3
14
  /**
@@ -1,2 +1,2 @@
1
- let e=(e,t)=>e.split(t).length-1,t=/^\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/,l=/(^|\n) {0,3}>[ \t]*\[![a-z]*$/i,n=/(^|\n) {0,3}>[ \t]*\[![a-z]+\][ \t]*$/i;export const hasOpenFence=t=>e(t,"```")%2==1;export const completeStreamedMarkdown=s=>{var r;let a;if(hasOpenFence(s))return`${s}
2
- \`\`\``;let i=s.lastIndexOf("```"),c=-1===i?"":s.slice(0,i+3),{head:$,marker:h}=(r=s.slice(c.length),null==(a=n.exec(r))?{head:r.replace(l,"$1"),marker:""}:{head:r.slice(0,a.index),marker:r.slice(a.index)}),p=(e=>{let l=e.split("\n"),n=l.length;for(;n>0&&l[n-1]?.trimStart().startsWith("|");)n-=1;let s=l.slice(n),r=s[1],a=null!=r&&s.length>2&&t.test(r);return 0===s.length||a?e:l.slice(0,n).join("\n")})((e($,"`")%2==1?$.slice(0,$.lastIndexOf("`")):$).replace(/!?\[([^\]\n]*)\](?:\([^)\n]*)?$/,"$1").replace(/!?\[[^\]\n]*$/,"")),d=e(p,"**")%2==1?`${p}**`:p;return`${c}${d}${h}`};
1
+ let e=(e,t)=>e.split(t).length-1,t=/^\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/,l=/(^|\n) {0,3}>[ \t]*\[![a-z]*$/i,n=/(^|\n) {0,3}>[ \t]*\[![a-z]+\][ \t]*$/i,s=/^[ \t>]*(`{3,}|~{3,})/,r=/^[ \t>]*(`{3,}|~{3,})[ \t]*$/;export const isCutOffFence=(e,{start:t,end:l})=>{let n,i,c;return l>=e.trimEnd().length&&(n=e.slice(t,l).split("\n"),i=s.exec(n[0]??"")?.[1],c=n.length>1?r.exec(n.at(-1)??"")?.[1]:void 0,null==i||null==c||c[0]!==i[0]||!(c.length>=i.length))};export const hasOpenFence=t=>e(t,"```")%2==1;export const completeStreamedMarkdown=s=>{var r;let i;if(hasOpenFence(s))return`${s}
2
+ \`\`\``;let c=s.lastIndexOf("```"),a=-1===c?"":s.slice(0,c+3),{head:h,marker:$}=(r=s.slice(a.length),null==(i=n.exec(r))?{head:r.replace(l,"$1"),marker:""}:{head:r.slice(0,i.index),marker:r.slice(i.index)}),p=(e=>{let l=e.split("\n"),n=l.length;for(;n>0&&l[n-1]?.trimStart().startsWith("|");)n-=1;let s=l.slice(n),r=s[1],i=null!=r&&s.length>2&&t.test(r);return 0===s.length||i?e:l.slice(0,n).join("\n")})((e(h,"`")%2==1?h.slice(0,h.lastIndexOf("`")):h).replace(/!?\[([^\]\n]*)\](?:\([^)\n]*)?$/,"$1").replace(/!?\[[^\]\n]*$/,"")),d=e(p,"**")%2==1?`${p}**`:p;return`${a}${d}${$}`};
@@ -1 +1 @@
1
- import{Kind as e,parse as t}from"graphql";import{z as r}from"zod";import{ASSISTANT_TOOL_ERROR_CODES as a,AssistantToolError as n,applyTool as s,queryTool as i}from"@salsita-ai/contracts/assistant";let l=r.object({title:r.string().nullish().catch(void 0),operations:r.array(r.object({query:r.string(),operationName:r.string().nullish()}))}),o=r.object({results:r.array(r.object({errors:r.array(r.unknown()).optional()})),committed:r.boolean()}),u=r.tuple([r.object({type:r.literal("text"),content:r.string()})]).rest(r.unknown()),d=e=>{let t=u.safeParse(e);if(!t.success)return e;try{return JSON.parse(t.data[0].content)}catch{return e}},c=r.object({message:r.string(),extensions:r.object({code:r.literal("VIOLATION"),type:r.string()})});export const describeToolCall=r=>{var u;let f,m=(({name:r,input:a})=>{let n,o,u=(n=l.safeParse(a)).success&&n.data.title?.trim()||void 0;if(null!=u)return{kind:"text",text:u};let d=(o=l.safeParse(a)).success?o.data.operations.flatMap(({query:r,operationName:a})=>a??(r=>{try{let a=t(r).definitions.find(t=>t.kind===e.OPERATION_DEFINITION);return a?.kind===e.OPERATION_DEFINITION?a.name?.value:void 0}catch{return}})(r)??[]):[];return d.length>0?{kind:"text",text:d.join(", ")}:r===s.name?{kind:"updateDesign"}:r===i.name?{kind:"readDesign"}:{kind:"text",text:r}})(r);if(null==r.result&&null==r.error)return{label:m,state:r.isReplyRunning?"running":"done",errorCode:void 0,violations:[]};let p=(e=>{let t=n.safeParse(e);if(t.success)return a.find(e=>e===t.data.code)})(r.result),g=(({name:e,result:t,error:r},a)=>{if(null!=r||null!=a)return"failed";if(e!==s.name&&e!==i.name)return"done";let n=o.safeParse(d(t));if(!n.success)return"failed";let{results:l,committed:u}=n.data;return e===s.name?u?"done":"failed":l.some(({errors:e})=>(e?.length??0)>0)||0===l.length?"failed":"done"})(r,p);return{label:m,state:g,errorCode:p,violations:"failed"===g?(u=r.result,(f=o.safeParse(d(u))).success?f.data.results.flatMap(({errors:e})=>(e??[]).flatMap(e=>{let t=c.safeParse(e);return t.success&&t.data.message!==t.data.extensions.type?[t.data.message]:[]})):[]):[]}};
1
+ import{Kind as e,parse as t}from"graphql";import{z as r}from"zod";import{ASSISTANT_TOOL_ERROR_CODES as n,AssistantToolError as s,applyTool as a,queryTool as i}from"@salsita-ai/contracts/assistant";import{SCREENSHOT_NOT_TAKEN as o}from"../../application-runtime/index.js";let l=r.object({title:r.string().nullish().catch(void 0),operations:r.array(r.object({query:r.string(),operationName:r.string().nullish()}))}),u=r.object({results:r.array(r.object({errors:r.array(r.unknown()).optional()})),committed:r.boolean()}),d=r.tuple([r.object({type:r.literal("text"),content:r.string()})]).rest(r.unknown()),c=e=>{let t=d.safeParse(e);if(!t.success)return e;try{return JSON.parse(t.data[0].content)}catch{return e}},f=r.object({extensions:r.object({code:r.string()})}),m=r.object({message:r.string(),extensions:r.object({code:r.literal("VIOLATION"),type:r.string()})});export const describeToolCall=r=>{var d;let p,g=(({name:r,input:n})=>{let s,o,u=(s=l.safeParse(n)).success&&s.data.title?.trim()||void 0;if(null!=u)return{kind:"text",text:u};let d=(o=l.safeParse(n)).success?o.data.operations.flatMap(({query:r,operationName:n})=>n??(r=>{try{let n=t(r).definitions.find(t=>t.kind===e.OPERATION_DEFINITION);return n?.kind===e.OPERATION_DEFINITION?n.name?.value:void 0}catch{return}})(r)??[]):[];return d.length>0?{kind:"text",text:d.join(", ")}:r===a.name?{kind:"updateDesign"}:r===i.name?{kind:"readDesign"}:{kind:"text",text:r}})(r);if(null==r.result&&null==r.error)return{label:g,state:r.isReplyRunning?"running":"done",errorCode:void 0,violations:[]};let x=(e=>{let t=s.safeParse(e);if(t.success)return n.find(e=>e===t.data.code)})(r.result),b=(({name:e,result:t,error:r},n)=>{if(null!=r||null!=n)return"failed";if(e!==a.name&&e!==i.name)return"done";let s=u.safeParse(c(t));if(!s.success)return"failed";let{results:l,committed:d}=s.data;return e===a.name?d?"done":"failed":l.some(({errors:e})=>e?.some(e=>{let t;return!(t=f.safeParse(e)).success||t.data.extensions.code!==o}))||0===l.length?"failed":"done"})(r,x);return{label:g,state:b,errorCode:x,violations:"failed"===b?(d=r.result,(p=u.safeParse(c(d))).success?p.data.results.flatMap(({errors:e})=>(e??[]).flatMap(e=>{let t=m.safeParse(e);return t.success&&t.data.message!==t.data.extensions.type?[t.data.message]:[]})):[]):[]}};
@@ -0,0 +1,22 @@
1
+ import { type RefObject } from 'react';
2
+ export interface LoadOlderOnTopOptions {
3
+ /** True while there is an older page to load and none is loading. */
4
+ readonly enabled: boolean;
5
+ readonly onReachTop: () => void;
6
+ /** Changes when a page is painted above the thread, such as the id of its first message. */
7
+ readonly firstItemKey: unknown;
8
+ }
9
+ /**
10
+ * Loads older messages when the user scrolls the thread to its top: a sentinel above the first
11
+ * message is watched within the scroller, and `onReachTop` runs when it comes into view. A page
12
+ * that does not fill the scroller leaves the sentinel in view, so the next page loads too. An
13
+ * attempt that painted nothing, because it failed, is tried again only once the user scrolls the
14
+ * sentinel out of view and back.
15
+ *
16
+ * The page lands above what the user reads, so the reading position is kept: the distance from the
17
+ * end of the thread is restored once the page is painted, before the browser shows it, and again
18
+ * each time an image in the thread finishes loading, until the user scrolls: an image reserves no
19
+ * height, so one that loads above the reader grows the thread there. CSS scroll anchoring would do
20
+ * the same, but Safari does not support it.
21
+ */
22
+ export declare const useLoadOlderOnTop: <SCROLLER extends HTMLElement, SENTINEL extends HTMLElement>(scrollerRef: RefObject<SCROLLER>, sentinelRef: RefObject<SENTINEL>, { enabled, onReachTop, firstItemKey }: LoadOlderOnTopOptions) => void;
@@ -0,0 +1 @@
1
+ import{useEffect as r,useLayoutEffect as e,useRef as t}from"react";let n=Symbol("no attempt");export const useLoadOlderOnTop=(l,c,{enabled:o,onReachTop:u,firstItemKey:s})=>{let i=t(null),p=t(n),a=t(null),d=t({onReachTop:u,firstItemKey:s});d.current={onReachTop:u,firstItemKey:s},r(()=>{let r=l.current;if(!r)return;let e=()=>{null!==i.current&&(i.current=r.scrollHeight-r.scrollTop),a.current&&Math.abs(r.scrollTop-a.current.scrollTop)>1&&(a.current=null)},t=()=>{a.current&&(r.scrollTop=r.scrollHeight-a.current.distanceFromEnd,a.current={...a.current,scrollTop:r.scrollTop})};return r.addEventListener("scroll",e,{passive:!0}),r.addEventListener("load",t,!0),()=>{r.removeEventListener("scroll",e),r.removeEventListener("load",t,!0)}},[l]),r(()=>{let r=l.current,e=c.current;if(!o||!r||!e)return;let t=new IntersectionObserver(([e])=>{if(!e?.isIntersecting){p.current=n;return}p.current!==d.current.firstItemKey&&(p.current=d.current.firstItemKey,a.current=null,i.current=r.scrollHeight-r.scrollTop,d.current.onReachTop())},{root:r});return t.observe(e),()=>t.disconnect()},[o,l,c]),e(()=>{let r=l.current;r&&null!==i.current&&(r.scrollTop=r.scrollHeight-i.current,a.current={distanceFromEnd:i.current,scrollTop:r.scrollTop}),i.current=null},[s,l])};
@@ -1 +1 @@
1
- import{jsx as t,jsxs as e,Fragment as r}from"react/jsx-runtime";import{styled as o}from"@mui/material";import{useEffect as i}from"react";import{useEagerObservableValue as m}from"#package/react-sdk";import{useResponsive as n}from"#package/ui-sdk";import{useConfigurator as a}from"../../../application-runtime/index.js";import{LayoutSlots as s}from"../slots/index.js";import{DesktopLayout as c}from"./DesktopLayout.js";import{ExportingOverlay as p}from"./ExportingOverlay.js";import{MobileLayout as d}from"./MobileLayout.js";let l=o("div")({display:"contents"});export const Layout=()=>{let{isDesktop:o}=n(),{exportSystem:u}=a(),f=m(u.exporting$);return i(()=>{if(!f)return;let t=document.activeElement;return()=>{t instanceof HTMLElement&&t.isConnected&&document.activeElement===document.body&&t.focus()}},[f]),e(r,{children:[e(l,{...{inert:f?"":void 0},children:[t(s.Services,{}),t(s.SharedCanvas,{}),o?t(c,{}):t(d,{})]}),f&&t(p,{})]})};
1
+ import{jsx as t,jsxs as e,Fragment as o}from"react/jsx-runtime";import{styled as r}from"@mui/material";import{useEffect as i,useRef as n}from"react";import{useEagerObservableValue as m}from"#package/react-sdk";import{useResponsive as a}from"#package/ui-sdk";import{useConfigurator as s}from"../../../application-runtime/index.js";import{LayoutSlots as c}from"../slots/index.js";import{DesktopLayout as p}from"./DesktopLayout.js";import{ExportingOverlay as d}from"./ExportingOverlay.js";import{MobileLayout as l}from"./MobileLayout.js";let u=r("div")({display:"contents"});export const Layout=()=>{let{isDesktop:r}=a(),{exportSystem:f}=s(),j=m(f.exporting$),v=n(null);return i(()=>{if(!j)return;let t=v.current?.getRootNode(),e=t instanceof ShadowRoot?t.activeElement:document.activeElement;return()=>{e instanceof HTMLElement&&e.isConnected&&document.activeElement===document.body&&e.focus()}},[j]),e(o,{children:[e(u,{ref:v,...{inert:j?"":void 0},children:[t(c.Services,{}),t(c.SharedCanvas,{}),r?t(p,{}):t(l,{})]}),j&&t(d,{})]})};
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-10-19T19:24:03.911Z",
2
+ "generatedAt": "2026-10-21T06:49:59.185Z",
3
3
  "categories": [
4
4
  {
5
5
  "name": "Phoenix",
@@ -89,8 +89,6 @@ For inspiration and real-world implementation patterns, examine deployed Salsita
89
89
 
90
90
  When you encounter challenges or need to implement specific features, use these resources in order:
91
91
 
92
- **AI-Powered Assistance**: Every Phoenix project ships Phoenix agent skills, so coding agents in your project already know the SDK conventions and CLI. Start by using AI coding assistants in the `configurator-phoenix` project. While they may not solve complex problems directly, they can point you toward relevant examples or search terms that will help you find the right solution.
93
-
94
92
  **Storybook Documentation**: Search the Phoenix Storybook for functionality similar to what you need. When you find relevant examples, examine the corresponding code in the configurator-phoenix stories to understand the implementation details.
95
93
 
96
94
  **Repository Search Strategy**:
@@ -352,19 +352,17 @@ grep -r "from '\.\/" src/
352
352
 
353
353
  **Error:** Changes to `.phoenix/` files are overwritten
354
354
 
355
- **Solution:** Never commit `.phoenix/` contents. Add to `.gitignore`:
355
+ **Solution:** Keep generated files out of version control. Application-spec projects can commit their project-owned `.phoenix/workspace/` records; sync writes the appropriate ignore rules. Remove any custom rule that ignores the entire `.phoenix/` directory if you want to version those records. See [Project Structure](?path=/docs/phoenix-project-structure--docs#markers-for-partial-auto-generation) for the managed block and ownership rules.
356
356
 
357
- ```
358
- .phoenix/
359
- ```
360
-
361
- If you accidentally modified generated files, delete and regenerate:
357
+ If you accidentally modified generated files, clean and regenerate them with the CLI. In application-spec projects this preserves workspace records:
362
358
 
363
359
  ```bash
364
- rm -rf .phoenix/
360
+ pnpm phoenix clean
365
361
  pnpm phoenix build
366
362
  ```
367
363
 
364
+ The legacy pipeline has no workspace-preservation contract; see [Phoenix CLI](?path=/docs/phoenix-phoenix-cli--docs#phoenix-clean).
365
+
368
366
  **Note:** Mock templates are no longer auto-applied on Editor load. Users must manually select and apply templates (changed in v0.36.0).
369
367
 
370
368
  ### .gitignore Conflicts
@@ -376,7 +374,8 @@ pnpm phoenix build
376
374
  ```gitignore
377
375
  # ===== BEGIN PHOENIX AUTO-GENERATED =====
378
376
  # Auto-generated by Phoenix - DO NOT EDIT
379
- .phoenix/
377
+ **/.phoenix/*
378
+ !**/.phoenix/workspace/
380
379
  .env.generated
381
380
  # ===== END PHOENIX AUTO-GENERATED =====
382
381
 
@@ -40,7 +40,7 @@ pnpm phoenix dev
40
40
  3. Adds the `dev`, `build`, `deploy`, `check` and `fix` scripts to `package.json` (see [Project Scripts](#project-scripts)). A script the project already has under one of those names keeps its command.
41
41
  4. Writes a starter spec (`spec/application.yaml`, `spec/configurator.yaml`) with one resizable, recolorable box, and switches `package.json` to the application-spec pipeline.
42
42
 
43
- The next steps it prints use the package manager you ran it with, or name none when it cannot tell. It asks nothing, writes no `.env` and contacts no Phoenix server. It does send the operational telemetry described below unless telemetry is disabled. `phoenix sync` then generates every other project file, including the agent skills described in [Project Structure](?path=/docs/phoenix-project-structure--docs). The `.gitignore` is among them only when the folder is inside a git repository, so run `git init` before the first sync, or sync again after it.
43
+ The next steps it prints use the package manager you ran it with, or name none when it cannot tell. It asks nothing, writes no `.env` and contacts no Phoenix server. It does send the operational telemetry described below unless telemetry is disabled. `phoenix sync` then generates every other project file, as described in [Project Structure](?path=/docs/phoenix-project-structure--docs). The `.gitignore` is among them only when the folder is inside a git repository, so run `git init` before the first sync, or sync again after it.
44
44
 
45
45
  ### CLI telemetry
46
46
 
@@ -187,7 +187,7 @@ A project has one generated env file. Phoenix keeps it in `.phoenix/`, as `.phoe
187
187
  - `phoenix dev` reads and writes `.phoenix/.env.generated` in a project without a root `.env.generated`, and creates no file in the project root. In a project that has a root `.env.generated`, it reads and writes that file and `.phoenix/.env.generated` is not used.
188
188
  - The deployment and environment commands (`deployment:prepare`, `deployment:prepare-dev`, `deployment:prepare-local`, `deployment:build-envs` and the others with an `--outFile` option) write `.env.generated` in the project root unless `--outFile` or `OUT_FILE` names another file. Deploy pipelines read it there. Once one of them has written it, `phoenix dev` and `phoenix build` use it.
189
189
  - Everything that reads environment variables follows the same rule: the root `.env.generated` when it exists, otherwise `.phoenix/.env.generated`. The two files are never merged.
190
- - `phoenix clean` removes `.phoenix/` and with it `.phoenix/.env.generated`; the next `phoenix dev` prepares the development deployment again. A root `.env.generated` stays.
190
+ - `phoenix clean` removes the generated contents of `.phoenix/`, including `.phoenix/.env.generated`; the next `phoenix dev` prepares the development deployment again. A root `.env.generated` stays.
191
191
  - `phoenix dev` starts on the deployment the file names, and prepares a new one when the file was written for another project, environment or server, when the spec registers something on the server the deployment was not prepared with (the domain model, the published data schema, the auth hook, the roles that may create configurations, or the assistant), and on `--force`. A running `phoenix dev` does not prepare again after such a change: it logs an error that asks for a restart.
192
192
  - Asset contents do not trigger preparation. After changing uploaded assets, restart with `phoenix dev --force` to prepare and upload them again.
193
193
 
@@ -266,7 +266,7 @@ A build pipeline that receives the source archive of a [`phoenix deploy`](#phoen
266
266
  - it refuses an archive over 200 MB, one that extracts to more than 1 GB, or one with more than 100,000 files;
267
267
  - it refuses links, special files, absolute paths, paths that leave the folder, names with control characters, and entries that repeat or collide with an earlier one;
268
268
  - it refuses an archive it cannot read to the end, such as a truncated upload;
269
- - it extracts only project files and reports the entries it left out, including the optional `conversation.log` that deploy keeps in the private archive for review.
269
+ - it extracts only project files and reports the entries it left out, including the optional `conversation.log`, the `.phoenix/workspace/` records and the `docs/` documents that deploy keeps in the private archive for review.
270
270
 
271
271
  `<folder>` must be new or empty. When the command refuses an archive, it removes the folder, so a partly extracted project is never built.
272
272
 
@@ -436,7 +436,7 @@ Set initial values from a local production build with roughly 5–10% headroom t
436
436
 
437
437
  ### `phoenix clean`
438
438
 
439
- Removes `.phoenix/` and regenerates all project files from scratch. It installs nothing and leaves `node_modules/` as it is; to reinstall too, delete `node_modules/` and install with your package manager. In a project on the legacy pipeline (see [Current and legacy project tooling](#current-and-legacy-project-tooling)), `phoenix clean` also removes `node_modules/` and runs `pnpm install`. Use this when:
439
+ Removes generated output and regenerates the project files. In application-spec projects it preserves project-owned records under `.phoenix/workspace/`, installs nothing and leaves `node_modules/` as it is; to reinstall too, delete `node_modules/` and install with your package manager. In a project on the legacy pipeline (see [Current and legacy project tooling](#current-and-legacy-project-tooling)), `phoenix clean` removes the whole `.phoenix/` folder and `node_modules/` and runs `pnpm install`. Use this when:
440
440
 
441
441
  - Generated files are corrupted or out of sync
442
442
  - After major SDK version upgrades
@@ -567,7 +567,7 @@ phoenix screenshot -o preview.png -w 1920 --height 1080
567
567
 
568
568
  ### `phoenix variants`
569
569
 
570
- 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.
570
+ Compare options such as a table-top edge, surface gloss or control placement in the configurator. Write one file per option, choose in the browser, and the command returns the selection.
571
571
 
572
572
  ```bash
573
573
  phoenix variants .phoenix/variants/table-edge --title 'Which edge suits the table?' --description 'Only the edge of the top differs.'
@@ -642,8 +642,6 @@ Known limits:
642
642
  - Binary assets, CSS files, locale catalog changes, dependency changes and edits requiring a full application restart are unsupported.
643
643
  - Storybook `story-dev` has no variant previews. A project on the legacy pipeline has no variant previews; the command says so and exits.
644
644
 
645
- Generated projects carry the `phoenix` agent skill, whose linked Variants guide tells coding agents when to offer options, how to write each kind and what to do with your answer.
646
-
647
645
  ## SDK Development
648
646
 
649
647
  ### `phoenix link`
@@ -758,7 +756,7 @@ SDK-builder workspaces sign the CLI in with a personal API token instead of proj
758
756
 
759
757
  Signs the CLI in to the SDK-builder workspace `<customer>`:
760
758
 
761
- 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.
759
+ 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 sign-ins apart later.
762
760
  2. Studio sends a one-time code back to the CLI on `127.0.0.1`.
763
761
  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.
764
762
 
@@ -783,11 +781,22 @@ Revokes the token on the server and removes it from the credentials file. `--reg
783
781
 
784
782
  ### `phoenix deploy`
785
783
 
786
- Validates the spec, 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 in the Feedback guide linked from the `phoenix` 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.
784
+ Validates the spec, 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. It prints `Your configurator is live at <url>` when deployment succeeds. `--region` or `--serverUrl` selects the server, as for `login`; `--no-wait` returns as soon as the build starts.
785
+
786
+ A follow-up evaluation hint is addressed to coding agents; you can ignore it when running the command manually.
787
+
788
+ Project-owned records under `.phoenix/workspace/` and client documents under `docs/`, such as the
789
+ rendered specification PDFs, are included in the private source archive and can be downloaded with
790
+ the build's sources; deploy reports how many `docs/` files it includes. Local sync, build and clean
791
+ keep both. The build extractor leaves them out, so
792
+ they are not application build inputs or public assets. They use the archive's existing size limits
793
+ and exclusions for dependencies, generated files, environment files and macOS metadata. The
794
+ `.phoenix`, `.phoenix/workspace` and `docs` paths must be real directories, and linked or special
795
+ files are rejected. Keep their contents suitable for everyone authorized to download the sources.
787
796
 
788
797
  To keep the conversation that led to a build, place a reviewed UTF-8 transcript in `conversation.log` at the project root before deploying. Deploy automatically includes it in the private source archive. Download the build's sources from Studio to read it; access is the same as for the rest of that build's sources. The build extractor skips the log, so it is not an application build input or a public asset. Missing logs produce a warning and deployment continues. Directories, links and special files at that path are rejected.
789
798
 
790
- The Phoenix agent skill explains how to prepare the transcript: prefer a native session export; otherwise mark a reconstruction as incomplete. Preserve available user/assistant messages and tool calls, cap individual tool results at 16 KiB with explicit truncation markers, and reference images rather than embedding them. Include the agent, export time, source and known omissions. Review and redact credentials or unrelated sensitive content before approving upload. The CLI uploads the file as supplied; it does not collect agent history, redact content, check freshness or verify completeness. Remove the file from the project root to deploy without it. The log counts toward the source archive's existing size limits; there is no separate conversation upload or viewer.
799
+ Review and redact credentials or unrelated sensitive content before uploading the transcript. The CLI uploads the file as supplied; it does not collect conversation history, redact content, check freshness or verify completeness. Remove the file from the project root to deploy without it. The log counts toward the source archive's existing size limits; there is no separate conversation upload or viewer.
791
800
 
792
801
  ### `phoenix feedback [message]`
793
802
 
@@ -805,14 +814,14 @@ Pass the message as the argument for a short note, or `--file` for a longer repo
805
814
  | `--file` | — | — | Text file that holds the message, instead of the argument |
806
815
  | `--type` | — | `other` | What the feedback is about: `bug`, `idea` or `other` |
807
816
  | `--contact` | — | — | How to reach you, when you want a reply |
808
- | `--agent` | — | — | Name of the coding agent that writes the feedback |
817
+ | `--agent` | — | — | Name of the coding agent submitting the feedback |
809
818
  | `--projectSlug` / `-p` | `PROJECT_SLUG` | `project` of the spec, if any | Workspace project the feedback is about |
810
819
  | `--region` | — | `eu` | Phoenix region of the workspace: `eu` or `us` |
811
820
  | `--serverUrl` / `--su` | — | the region's server | Phoenix server URL, for a local or custom server |
812
821
 
813
822
  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.
814
823
 
815
- Generated projects carry the `phoenix` agent skill. Its linked Feedback guide 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.
824
+ Review the message before sending and omit secrets, credentials and personal data. The command needs a server with API 1.40.0 or newer; a message over 5000 characters needs API 1.43.0 or newer.
816
825
 
817
826
  ## Next Steps
818
827
 
@@ -199,23 +199,23 @@ type CustomMaterial = Phx['AdminModel']['CustomMaterial']
199
199
 
200
200
  ### Root Level Files
201
201
 
202
- | File | Auto-Generated? | Notes |
203
- | ---------------------------------------------------- | --------------- | ------------------------------------- |
204
- | `package.json` | No | Yours; see Dependencies |
205
- | `tsconfig.json` | Once | Yours; see below |
206
- | `eslint.config.js` | Once | Yours; see below |
207
- | `prettier.config.js` | Once | Yours; see below |
208
- | `.prettierignore` | No | Optional and your own; see below |
209
- | `pnpm-workspace.yaml` | No | Only with pnpm; see Package manager |
210
- | `.gitignore` | Partially | Only in a git repository; see Markers |
211
- | `.env` | No | Git-ignored, local config |
212
- | `.env.example` | No | Template for env vars |
213
- | `.env.generated` | Yes | Optional, git-ignored; see below |
214
- | `README.md` | No | Project documentation |
215
- | `AGENTS.md` | No | Your own coding-agent instructions |
216
- | `.claude/skills/phoenix/`, `.agents/skills/phoenix/` | Yes | Phoenix agent skills |
217
-
218
- With the application-spec pipeline, sync does not write `README.md`, `AGENTS.md`, `.env.example`, `.env.ci` or the `README.md` files in `assets/public/` and `assets/private/`. These files are yours to create and edit; sync preserves them. The legacy pipeline writes `README.md`, `.env.example`, `.env.ci` and the asset-folder `README.md` files when they are missing.
202
+ | File | Auto-Generated? | Notes |
203
+ | ---------------------------------------------------- | --------------- | --------------------------------------------- |
204
+ | `package.json` | No | Yours; see Dependencies |
205
+ | `tsconfig.json` | Once | Yours; see below |
206
+ | `eslint.config.js` | Once | Yours; see below |
207
+ | `prettier.config.js` | Once | Yours; see below |
208
+ | `.prettierignore` | No | Optional and your own; see below |
209
+ | `pnpm-workspace.yaml` | No | Only with pnpm; see Package manager |
210
+ | `.gitignore` | Partially | Only in a git repository; see Markers |
211
+ | `.env` | No | Git-ignored, local config |
212
+ | `.env.example` | No | Template for env vars |
213
+ | `.env.generated` | Yes | Optional, git-ignored; see below |
214
+ | `README.md` | No | Project documentation |
215
+ | `AGENTS.md` | No | Project-owned instructions; preserved by sync |
216
+ | `.claude/skills/phoenix/`, `.agents/skills/phoenix/` | Yes | SDK-managed files; see below |
217
+
218
+ With the application-spec pipeline, sync does not write `README.md`, `.env.example`, `.env.ci` or the `README.md` files in `assets/public/` and `assets/private/`. These files are yours to create and edit; sync preserves them. The legacy pipeline writes `README.md`, `.env.example`, `.env.ci` and the asset-folder `README.md` files when they are missing.
219
219
 
220
220
  Phoenix keeps the generated env file, with the IDs and values of the prepared deployment, in `.phoenix/` unless the project has a `.env.generated` in its root, which then is the one that counts. `phoenix dev` creates no `.env.generated` in the project root; the deployment and environment commands write it there. See [The generated env file](?path=/docs/phoenix-phoenix-cli--docs#the-generated-env-file).
221
221
 
@@ -229,34 +229,26 @@ With the application-spec pipeline, the project's TypeScript settings are in `.p
229
229
 
230
230
  The only root `tsconfig.json` sync replaces is the full file earlier SDK versions generated there, recognised by its settings; any other stays as it is. `phoenix dev`, `phoenix build` and the webhook bundle do not resolve `paths` aliases, so an alias added to the root file passes `phoenix check` and fails the build. `phoenix check` type-checks with the root `tsconfig.json`, or with `.phoenix/tsconfig.json` when the project has none. The legacy pipeline writes the full `tsconfig.json` on every sync.
231
231
 
232
- With the application-spec pipeline, sync writes `eslint.config.js` and `prettier.config.js` only when the project has none, each re-exporting the SDK's shared configuration so editors find it. They are yours to commit and to change. The only ones sync replaces are the files earlier SDK versions generated there; any other stays as it is. `phoenix check` and `phoenix fix` lint and format with the project's files, and with the SDK's configurations when a file is missing (see [`phoenix check`](?path=/docs/phoenix-phoenix-cli--docs#phoenix-check)). Sync formats the files it generates in the project root, such as the agent skills, with the same Prettier configuration, so `phoenix check` accepts them; while the project's configuration cannot be loaded, as before the first install, they get the SDK's settings. The legacy pipeline writes both files on every sync.
232
+ With the application-spec pipeline, sync writes `eslint.config.js` and `prettier.config.js` only when the project has none, each re-exporting the SDK's shared configuration so editors find it. They are yours to commit and to change. The only ones sync replaces are the files earlier SDK versions generated there; any other stays as it is. `phoenix check` and `phoenix fix` lint and format with the project's files, and with the SDK's configurations when a file is missing (see [`phoenix check`](?path=/docs/phoenix-phoenix-cli--docs#phoenix-check)). Sync formats the files it generates in the project root, such as `tsconfig.json`, with the same Prettier configuration, so `phoenix check` accepts them; while the project's configuration cannot be loaded, as before the first install, they get the SDK's settings. The legacy pipeline writes both files on every sync.
233
233
 
234
234
  With the application-spec pipeline, the Lingui configuration is `.phoenix/.linguirc`, which sync rewrites with the rest of `.phoenix/` from `availableLocales` in `spec/application.yaml`. Phoenix passes that file to Lingui every time it extracts or compiles the catalogs and to its Vite builds, so a `.linguirc` in the project root is not read and can be deleted. To run Lingui yourself, name the file: `npx lingui extract --config .phoenix/.linguirc`, from the project root. The legacy pipeline writes `.linguirc` in the project root on every sync.
235
235
 
236
236
  ### DO NOT EDIT (Fully Auto-Generated)
237
237
 
238
- - **Everything in `.phoenix/`** - Completely regenerated on each build. The exceptions are `.phoenix/variants/`, where a coding agent writes the option files for `phoenix variants`, and `.phoenix/.env.generated`, the generated env file of `phoenix dev`; a rebuild keeps both
238
+ - **Generated files in `.phoenix/`** — Rewritten on each build. In application-spec projects, `.phoenix/workspace/` is project-owned: sync, build and clean preserve it, and deploy includes it in the private source archive rather than build inputs or public assets. Rebuilds also keep `.phoenix/variants/`, which holds variant option files, and `.phoenix/.env.generated`, the generated env file of `phoenix dev`.
239
239
  - `src/locales/**/*.ts` - Compiled from `.po` catalogs
240
240
  - `.env.generated`
241
- - `phoenix` and `phoenix-*` skill folders under `.claude/skills/` and `.agents/skills/` — rewritten on every sync with anything else inside them removed, and other `phoenix`-prefixed skill folders are removed; to customise a skill, copy it to a folder whose name does not start with `phoenix`
242
-
243
- ### Agent Guidance
244
-
245
- Coding agents (Claude Code, Codex, Cursor) enter through the single `phoenix` skill under `.claude/skills/phoenix/` or `.agents/skills/phoenix/`. Its `SKILL.md` routes to the existing project, CLI, configurator workflow, code review, variants and feedback guides in `references/`. Agents read the guides for their task rather than the whole tree. The configurator workflow retains its five stages and supporting discovery, UX, asset-conversion and appearance-review references.
246
-
247
- Phoenix keeps this guidance in step with the installed SDK. During the internal beta, a project created from a canary build gets the canary-update instructions in the linked project guide: once per conversation the agent checks for a newer canary and, after telling you, updates the SDK, runs `phoenix deps`, installs, then runs `phoenix sync`.
248
-
249
- An `AGENTS.md` is yours to add; sync does not write one. Sync removes retired `phoenix-*` skill folders but leaves unrelated skills alone. If your own instructions name an earlier separate skill such as `phoenix-review`, point them at `phoenix` and the same task instead.
250
-
251
- 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; ask `phoenix` to review instead of using `/review`.
241
+ - The SDK-managed `phoenix` and `phoenix-*` folders under `.claude/skills/` and `.agents/skills/` — sync rewrites the current bundle, removes unrecognized files inside it and deletes retired folders with those prefixes. Keep custom files outside those prefixes. Sync also removes the SDK blocks from legacy `CLAUDE.md` and `.cursor/rules/phoenix.mdc`, preserves surrounding project text, deletes files left empty and removes the legacy review-command files.
252
242
 
253
243
  ### Markers for Partial Auto-Generation
254
244
 
255
- `.gitignore` holds the Phoenix entries between two marker lines. Sync rewrites that block and keeps everything outside it. With the application-spec pipeline the block does not list the files sync writes once, `tsconfig.json`, `eslint.config.js` and `prettier.config.js`, so a project commits them:
245
+ `.gitignore` holds the Phoenix entries between two marker lines. Sync rewrites that block and keeps everything outside it. With the application-spec pipeline the block does not list the files sync writes once, `tsconfig.json`, `eslint.config.js` and `prettier.config.js`, so a project commits them. It ignores generated entries inside `.phoenix/` but leaves `.phoenix/workspace/` available for version control, so working records can travel with a checkout:
256
246
 
257
247
  ```gitignore
258
248
  # ===== BEGIN PHOENIX AUTO-GENERATED =====
259
- # ... Phoenix-managed ignores ...
249
+ # ... other Phoenix-managed ignores ...
250
+ **/.phoenix/*
251
+ !**/.phoenix/workspace/
260
252
  # ===== END PHOENIX AUTO-GENERATED =====
261
253
 
262
254
  # Your custom ignores (preserved)
@@ -267,6 +259,8 @@ With the application-spec pipeline (see [Current and legacy project tooling](?pa
267
259
 
268
260
  ### Safe to Edit
269
261
 
262
+ - `.phoenix/workspace/` (application-spec project records and specification sources; include durable records in version control)
263
+ - `docs/` (client documents such as rendered specification PDFs; deploy includes them in the private source archive, not in build inputs or public assets)
270
264
  - `src/` (except compiled `src/locales/**/*.ts` files)
271
265
  - `spec/`
272
266
  - `public/`
@@ -278,7 +272,7 @@ With the application-spec pipeline (see [Current and legacy project tooling](?pa
278
272
  - `.env`, `.env.example`, `.env.ci`
279
273
  - `tsconfig.json` (application-spec pipeline; keep it extending `.phoenix/tsconfig.json`)
280
274
  - `eslint.config.js`, `prettier.config.js` (application-spec pipeline; sync writes them once, and they are the project's afterwards)
281
- - `README.md`, `AGENTS.md`
275
+ - `README.md`
282
276
 
283
277
  ## File Naming Conventions
284
278
 
@@ -359,7 +353,8 @@ project-root/
359
353
  │
360
354
  ├── blender/ # 3D model source files (Blender)
361
355
  │
362
- ├── .phoenix/ # AUTO-GENERATED (DO NOT EDIT)
356
+ ├── .phoenix/ # Generated output, except project-owned workspace/
357
+ │ ├── workspace/ # Working records, available for version control
363
358
  │ ├── domain/ # Compiled domain specs
364
359
  │ │ ├── model/ # Configurator model
365
360
  │ │ └── admin-model/ # Admin model
@@ -368,7 +363,7 @@ project-root/
368
363
  │ │ └── builders.ts
369
364
  │ ├── .swc/ # SWC transpiled sources
370
365
  │ ├── .lingui/ # Compiled i18n catalogs
371
- │ ├── variants/ # Option files of `phoenix variants`, written by coding agents
366
+ │ ├── variants/ # Option files of `phoenix variants`
372
367
  │ ├── dist/ # Build output
373
368
  │ │ ├── frontend/ # Frontend bundles
374
369
  │ │ └── webhooks/ # Webhook bundles
@@ -22,7 +22,7 @@ pnpm install
22
22
  pnpm phoenix sync
23
23
  ```
24
24
 
25
- `phoenix init [folder]` writes the starter project: `package.json` and the starter spec, `spec/application.yaml` and `spec/configurator.yaml`, which describe one box you can resize and recolour. The starter depends on the same SDK version as the CLI that created it and on the packages the SDK requires next to it (React, three.js, MUI, Lingui and the others, with their type packages), with ESLint and Prettier at the versions the SDK uses itself. Its `package.json` has the `dev`, `build`, `deploy`, `check` and `fix` scripts, which are yours to change. `phoenix sync` then adds the rest of the project: the TypeScript, lint and formatting config and the agent skills. It writes no webhook code: a project without `src/webhooks/index.ts` gets a built-in webhook (see [Webhook Entry Point](?path=/docs/phoenix-webhooks--docs#webhook-entry-point)). It writes a `.gitignore` only when the folder is inside a git repository; run `git init` before the first sync, or sync again after it, to get the file.
25
+ `phoenix init [folder]` writes the starter project: `package.json` and the starter spec, `spec/application.yaml` and `spec/configurator.yaml`, which describe one box you can resize and recolour. The starter depends on the same SDK version as the CLI that created it and on the packages the SDK requires next to it (React, three.js, MUI, Lingui and the others, with their type packages), with ESLint and Prettier at the versions the SDK uses itself. Its `package.json` has the `dev`, `build`, `deploy`, `check` and `fix` scripts, which are yours to change. `phoenix sync` then adds the TypeScript, lint and formatting config and the other generated files described in [Project Structure](?path=/docs/phoenix-project-structure--docs#root-level-files). It writes no webhook code: a project without `src/webhooks/index.ts` gets a built-in webhook (see [Webhook Entry Point](?path=/docs/phoenix-webhooks--docs#webhook-entry-point)). It writes a `.gitignore` only when the folder is inside a git repository; run `git init` before the first sync, or sync again after it, to get the file.
26
26
 
27
27
  `init` only writes these files: it asks nothing and contacts no server. It refuses a folder that already has a `spec/` folder. A `package.json` already in the folder is kept, as long as it depends on the SDK, and gains only the entries it lacks (see [Starting a New Project](?path=/docs/phoenix-phoenix-cli--docs#starting-a-new-project)).
28
28
 
@@ -36,7 +36,7 @@ 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 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.
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 its purpose 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
 
@@ -63,10 +63,6 @@ Every user who signs the CLI in gets their own development environment, so a tea
63
63
 
64
64
  `pnpm phoenix dev --persistence local-storage` still runs the project without any server, with state kept in the browser.
65
65
 
66
- Coding agents follow the generated `phoenix` skill: before their first change they start `phoenix dev` and open the preview in your browser, and after `phoenix deploy` starts a build they open its page in Studio.
67
-
68
- To build the configurator with your coding agent, give it your product documents, prices, pictures, drawings or models and ask it to create the configurator. The generated `phoenix` skill’s Configurator workflow guide takes it through five stages: a representative first slice you can try early, a plan of the whole configuration experience, options and features added in small increments, finalization, and a complete review. It studies the SDK documentation before building, keeps a `configurator-spec.md` in the project as the record of what is decided and what remains open, and asks you only for decisions it cannot derive from your materials.
69
-
70
66
  ## 4. Deploy
71
67
 
72
68
  ```bash
@@ -76,7 +72,7 @@ pnpm phoenix deploy
76
72
  `phoenix deploy` goes through these steps:
77
73
 
78
74
  1. It validates the application spec.
79
- 2. It packs the project files: the `.yaml` files in `spec`, everything in `src`, `mocks`, `assets`, `public` and `templates`, and `package.json`, `tsconfig.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.
75
+ 2. It packs the project files: the `.yaml` files in `spec`, everything in `src`, `mocks`, `assets`, `public` and `templates`, and `package.json`, `tsconfig.json`, `pnpm-lock.yaml`, `pnpm-workspace.yaml`, `.gitignore`, `CLAUDE.md` and `.cursor/rules/phoenix.mdc`. Project-owned `.phoenix/workspace/` records and the client documents in `docs/` also travel in the private source archive; they are excluded from build inputs and public assets. Other `.phoenix` contents, every `node_modules` and `__generated` folder, every `.DS_Store` and `._*` file and every `.env` and `.env.*` file are left out.
80
76
  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
77
  4. It uploads the archive, which may be up to 200 MB.
82
78
  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.
@@ -99,8 +95,6 @@ Tell us what is broken, confusing or missing, from wherever you are:
99
95
  - 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).
100
96
  - 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.
101
97
 
102
- Coding agents working in your project use the same command, guided by the generated `phoenix` skill’s Feedback guide. 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.
103
-
104
98
  ## Known limits
105
99
 
106
100
  - You can deploy once the workspace's first deployment is live. Until then, `phoenix deploy` tells you the workspace is still being set up.
@@ -1,6 +1,6 @@
1
1
  import type { ComponentType } from 'react';
2
2
  import type { $DomainEntity, DomainEntity } from '../core/index.js';
3
- import type { HandlerRegistration, SystemPhoenixHandlerRegistration } from '../domain-runtime/index.js';
3
+ import type { HandlerRegistration, SystemPhoenixHandlerRegistration } from '../spec/index.js';
4
4
  import type { ApplicationConfig } from './application-config.js';
5
5
  export declare const createGetApplicationWrapperHandler: (fn: (ctx: ApplicationConfig<any, any, any, any, any, any, never, any, any, any, any, any, any, any, any, any>) => ComponentType) => SystemPhoenixHandlerRegistration<ApplicationConfig<any, any, any, any, any, any, never, any, any, any, any, any, any, any, any, any>, ComponentType>;
6
6
  export type CreateGetApplicationWrapperHandler = typeof createGetApplicationWrapperHandler;