@salsita-ai/sdk 0.50.0-develop.9eab66c5a9 → 0.50.0-develop.9fe72d003e

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 (379) hide show
  1. package/README.md +1 -1
  2. package/dist/application-spec/core/enhanced-json-value.d.ts +2 -31
  3. package/dist/application-spec/core/enhanced-json-value.js +1 -1
  4. package/dist/application-spec/core/index.d.ts +1 -3
  5. package/dist/application-spec/core/index.js +1 -1
  6. package/dist/application-spec/core/json-schema.d.ts +2 -52
  7. package/dist/application-spec/core/markers/index.d.ts +1 -1
  8. package/dist/application-spec/core/markers/index.js +1 -1
  9. package/dist/application-spec/core/markers/msg-marker.d.ts +2 -28
  10. package/dist/application-spec/core/markers/msg-marker.js +1 -1
  11. package/dist/application-spec/core/markers/raw-eval-write-marker.d.ts +1 -1
  12. package/dist/application-spec/core/markers/raw-eval-write-marker.js +1 -1
  13. package/dist/application-spec/core/markers/raw-read-write-marker.js +1 -1
  14. package/dist/application-spec/errors/diagnostic-codes.d.ts +8 -1
  15. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  16. package/dist/application-spec/errors/diagnostic-messages.d.ts +15 -1
  17. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  18. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  19. package/dist/application-spec/generate-application/code/templates/index.d.ts +2 -6
  20. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  21. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.d.ts +10 -0
  22. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +7 -0
  23. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +1 -1
  24. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +1 -1
  25. package/dist/application-spec/generate-application/implementations/phx-model.d.ts +1 -1
  26. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +1 -2
  27. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +1 -2
  28. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +1 -2
  29. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.d.ts +1 -1
  30. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +1 -1
  31. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +1 -2
  32. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +1 -1
  33. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.d.ts +1 -1
  34. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.js +1 -1
  35. package/dist/application-spec/generate-application/runtime/sections/actions-runtime.d.ts +1 -2
  36. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +1 -1
  37. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
  38. package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.d.ts +1 -1
  39. package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +1 -2
  40. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +1 -2
  41. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
  42. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +1 -2
  43. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.js +1 -1
  44. package/dist/application-spec/generate-application/runtime/sections/preset-runtime.d.ts +2 -3
  45. package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +1 -1
  46. package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.d.ts +1 -1
  47. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +96 -31
  48. package/dist/application-spec/generate-application/runtime-spec/spec-code-id.d.ts +1 -1
  49. package/dist/application-spec/parse-application-files/merge/merged-assistant.d.ts +13 -4
  50. package/dist/application-spec/parse-application-files/merge/merged-assistant.js +1 -1
  51. package/dist/application-spec/parse-application-files/merge/merged-infra.d.ts +4 -11
  52. package/dist/application-spec/parse-application-files/merge/merged-transformers.d.ts +2 -4
  53. package/dist/application-spec/parse-application-files/parse-application-files.js +1 -1
  54. package/dist/application-spec/parse-application-files/raw-spec/raw-acl.d.ts +2 -2
  55. package/dist/application-spec/parse-application-files/raw-spec/raw-acl.js +1 -1
  56. package/dist/application-spec/parse-application-files/raw-spec/raw-admin-pages.d.ts +3 -24
  57. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +25 -20
  58. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  59. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.d.ts +1 -1
  60. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.js +1 -1
  61. package/dist/application-spec/parse-application-files/raw-spec/raw-resources.d.ts +19 -64
  62. package/dist/application-spec/parse-application-files/spec/application/admin-spec/admin-pages.d.ts +3 -20
  63. package/dist/application-spec/parse-application-files/spec/application/admin-spec/states.d.ts +3 -5
  64. package/dist/application-spec/parse-application-files/spec/application/configurator-spec/states.d.ts +3 -8
  65. package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding.d.ts +3 -13
  66. package/dist/application-spec/parse-application-files/spec/components/bindings/write-binding.d.ts +4 -32
  67. package/dist/application-spec/parse-application-files/spec/components/component-filter.d.ts +4 -10
  68. package/dist/application-spec/parse-application-files/spec/components/components.d.ts +3 -4
  69. package/dist/application-spec/parse-application-files/spec/components/index.d.ts +1 -2
  70. package/dist/application-spec/parse-application-files/spec/components/index.js +1 -1
  71. package/dist/application-spec/parse-application-files/spec/components/sdk-component-entry.d.ts +1 -1
  72. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.d.ts +2 -3
  73. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.js +1 -1
  74. package/dist/application-spec/parse-application-files/spec/components/user-components.d.ts +2 -3
  75. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +2 -2
  76. package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +7 -29
  77. package/dist/application-spec/parse-application-files/spec/expressions/index.d.ts +0 -1
  78. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.d.ts +4 -71
  79. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.js +1 -1
  80. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts +2 -2
  81. package/dist/application-spec/parse-application-files/spec/invariants/invariant.d.ts +5 -21
  82. package/dist/application-spec/parse-application-files/spec/invariants/invariants.d.ts +4 -14
  83. package/dist/application-spec/parse-application-files/spec/model/aliases.d.ts +3 -9
  84. package/dist/application-spec/parse-application-files/spec/model/common-types.d.ts +6 -14
  85. package/dist/application-spec/parse-application-files/spec/model/defaults.d.ts +6 -31
  86. package/dist/application-spec/parse-application-files/spec/model/entity-types.d.ts +3 -8
  87. package/dist/application-spec/parse-application-files/spec/model/model-version-key.d.ts +3 -3
  88. package/dist/application-spec/parse-application-files/spec/model/names/action-name.d.ts +3 -7
  89. package/dist/application-spec/parse-application-files/spec/model/names/alias-name.d.ts +3 -7
  90. package/dist/application-spec/parse-application-files/spec/model/names/entity-or-alias-name.d.ts +3 -8
  91. package/dist/application-spec/parse-application-files/spec/model/names/entity-type-name.d.ts +3 -8
  92. package/dist/application-spec/parse-application-files/spec/model/names/expression-name.d.ts +3 -6
  93. package/dist/application-spec/parse-application-files/spec/model/names/instance-name.d.ts +3 -7
  94. package/dist/application-spec/parse-application-files/spec/model/names/invariant-name.d.ts +3 -3
  95. package/dist/application-spec/parse-application-files/spec/model/names/shape-property-name.d.ts +3 -11
  96. package/dist/application-spec/parse-application-files/spec/model/names/violation-type-name.d.ts +3 -3
  97. package/dist/application-spec/parse-application-files/spec/model/presets.d.ts +6 -29
  98. package/dist/application-spec/parse-application-files/spec/sections/actions.d.ts +6 -23
  99. package/dist/application-spec/parse-application-files/spec/sections/app-metadata.d.ts +3 -18
  100. package/dist/application-spec/parse-application-files/spec/sections/application-version.d.ts +3 -7
  101. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  102. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant.js +1 -1
  103. package/dist/application-spec/parse-application-files/spec/sections/data-spec/chunks.d.ts +6 -23
  104. package/dist/application-spec/parse-application-files/spec/sections/data-spec/custom-data-spec.d.ts +1 -16
  105. package/dist/application-spec/parse-application-files/spec/sections/data-spec/data-entry-key.d.ts +3 -9
  106. package/dist/application-spec/parse-application-files/spec/sections/data-spec/data-spec.d.ts +1 -10
  107. package/dist/application-spec/parse-application-files/spec/sections/data-spec/swatch-data-spec.d.ts +1 -14
  108. package/dist/application-spec/parse-application-files/spec/sections/state-value.d.ts +3 -7
  109. package/dist/application-spec/parse-application-files/spec/sections/theme.d.ts +3 -10
  110. package/dist/application-spec/parse-application-files/spec/sections/transformers.d.ts +4 -11
  111. package/dist/application-spec/parse-application-files/spec/sections/ui.d.ts +3 -12
  112. package/dist/configurator/ConfiguratorApp.js +1 -1
  113. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  114. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +19 -3
  115. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  116. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +70 -56
  117. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  118. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +15 -0
  119. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  120. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.d.ts +40 -0
  121. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.js +1 -0
  122. package/dist/configurator/common/configurator-interface.d.ts +2 -2
  123. package/dist/configurator/common/configurator-interface.js +1 -1
  124. package/dist/configurator/configurator-context/PresetSelectionProvider.js +1 -1
  125. package/dist/configurator/configurator-context/configurator-hooks/index.d.ts +0 -1
  126. package/dist/configurator/configurator-context/configurator-hooks/index.js +1 -1
  127. package/dist/configurator/configurator-context/index.d.ts +0 -4
  128. package/dist/configurator/configurator-context/index.js +1 -1
  129. package/dist/configurator/pages/ConfiguratorNotFoundPage.js +1 -1
  130. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  131. package/dist/configurator/pages/error-boundaries/DevContextFallback.js +1 -1
  132. package/dist/configurator/pages/error-boundaries/DevLoadingFallback.js +1 -1
  133. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  134. package/dist/configurator/ui/assistant/tool-chip.d.ts +19 -9
  135. package/dist/configurator/ui/assistant/tool-chip.js +1 -1
  136. package/dist/configurator/ui/configurator-layout/slots/canvas/GPUAccelerationDisabled.js +1 -1
  137. package/dist/configurator/ui/configurator-layout/slots/canvas/WebGLNotSupported.js +1 -1
  138. package/dist/configurator/ui/configurator-layout/slots/readonly-banner/CloneToEditDialog.js +1 -1
  139. package/dist/configurator/ui/legacy/chat/MobileChat.js +1 -1
  140. package/dist/configurator/ui/legacy/layout/common/CommonTopNavigation.js +1 -1
  141. package/dist/configurator/ui/legacy/layout/simple/SimpleSidebar.js +1 -1
  142. package/dist/configurator/ui/legacy/layout/simple/SimpleTopNavigation.js +1 -1
  143. package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.js +1 -1
  144. package/dist/configurator/ui/legacy/layout/steps/StepsOwnerLayout.js +1 -1
  145. package/dist/configurator/ui/legacy/layout/steps/StepsSideBar.js +1 -1
  146. package/dist/configurator/ui/legacy/layout/tabs/TabsSidebar.js +1 -1
  147. package/dist/configurator/ui/phoenix-layout-elements/header/common/back-button/use-go-back-action.js +1 -1
  148. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.js +1 -1
  149. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/PreviousStepButton.js +1 -1
  150. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -1
  151. package/dist/docs/3d-scene/cameras/custom.mdx +4 -2
  152. package/dist/docs/drag-and-drop/room-planner.mdx +1 -1
  153. package/dist/docs/index.json +1 -1
  154. package/dist/docs/phoenix/configurator-interface.mdx +1 -1
  155. package/dist/docs/phoenix/layout-slots.mdx +21 -0
  156. package/dist/docs/phoenix/phoenix-cli.mdx +4 -3
  157. package/dist/docs/phoenix/project-structure.mdx +21 -17
  158. package/dist/docs/phoenix/sdk-builder-workflow.mdx +2 -2
  159. package/dist/docs/phoenix/webhooks.mdx +5 -1
  160. package/dist/domain/application/application-config.d.ts +6 -24
  161. package/dist/domain/application/assistant/assistant-manifest.d.ts +13 -3
  162. package/dist/domain/application/assistant/assistant-manifest.js +1 -1
  163. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +5 -9
  164. package/dist/domain/application/assistant/assistant-resolved-manifest.js +1 -1
  165. package/dist/domain/application/assistant/build-assistant-lenses.js +1 -1
  166. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  167. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  168. package/dist/domain/application/assistant/index.d.ts +3 -3
  169. package/dist/domain/application/assistant/index.js +1 -1
  170. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
  171. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +2 -4
  172. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
  173. package/dist/domain/application/assistant-mutations.js +1 -1
  174. package/dist/domain/index.d.ts +1 -0
  175. package/dist/domain/index.js +1 -1
  176. package/dist/domain/spec/application/admin-pages-section.d.ts +29 -0
  177. package/dist/domain/spec/application/admin-pages.d.ts +26 -0
  178. package/dist/domain/spec/application/admin-states.d.ts +5 -0
  179. package/dist/domain/spec/application/configurator-states.d.ts +8 -0
  180. package/dist/domain/spec/application/configurator-states.js +1 -0
  181. package/dist/domain/spec/application/index.d.ts +5 -0
  182. package/dist/domain/spec/application/index.js +1 -0
  183. package/dist/domain/spec/components/bindings/index.d.ts +2 -0
  184. package/dist/domain/spec/components/bindings/index.js +1 -0
  185. package/dist/domain/spec/components/bindings/read-binding.d.ts +13 -0
  186. package/dist/domain/spec/components/bindings/read-binding.js +1 -0
  187. package/dist/domain/spec/components/bindings/write-binding.d.ts +32 -0
  188. package/dist/domain/spec/components/bindings/write-binding.js +1 -0
  189. package/dist/{application-spec/parse-application-files → domain}/spec/components/component-entry.d.ts +3 -3
  190. package/dist/domain/spec/components/component-entry.js +1 -0
  191. package/dist/{application-spec/core → domain/spec}/components/component-filter.d.ts +3 -2
  192. package/dist/domain/spec/components/component-filters.d.ts +10 -0
  193. package/dist/domain/spec/components/component-filters.js +1 -0
  194. package/dist/domain/spec/components/components.d.ts +4 -0
  195. package/dist/domain/spec/components/components.js +1 -0
  196. package/dist/domain/spec/components/index.d.ts +6 -0
  197. package/dist/domain/spec/enhanced-json-value.d.ts +30 -0
  198. package/dist/domain/spec/enhanced-json-value.js +1 -0
  199. package/dist/{application-spec/parse-application-files → domain}/spec/expressions/expression.d.ts +9 -3
  200. package/dist/domain/spec/expressions/expression.js +1 -0
  201. package/dist/domain/spec/expressions/expressions.d.ts +27 -0
  202. package/dist/domain/spec/expressions/expressions.js +1 -0
  203. package/dist/domain/spec/expressions/index.d.ts +5 -0
  204. package/dist/domain/spec/expressions/memo-eval-plan.d.ts +70 -0
  205. package/dist/domain/spec/expressions/memo-eval-plan.js +1 -0
  206. package/dist/domain/spec/expressions/relation-expression-params.js +1 -0
  207. package/dist/domain/spec/index.d.ts +9 -0
  208. package/dist/domain/spec/index.js +1 -0
  209. package/dist/domain/spec/invariants/index.d.ts +2 -0
  210. package/dist/domain/spec/invariants/index.js +1 -0
  211. package/dist/domain/spec/invariants/invariant.d.ts +24 -0
  212. package/dist/domain/spec/invariants/invariant.js +1 -0
  213. package/dist/domain/spec/invariants/invariants.d.ts +14 -0
  214. package/dist/domain/spec/invariants/invariants.js +1 -0
  215. package/dist/domain/spec/json-schema.d.ts +52 -0
  216. package/dist/domain/spec/json-schema.js +1 -0
  217. package/dist/domain/spec/markers/index.d.ts +3 -0
  218. package/dist/domain/spec/markers/index.js +1 -0
  219. package/dist/domain/spec/markers/msg-marker.d.ts +28 -0
  220. package/dist/domain/spec/markers/msg-marker.js +1 -0
  221. package/dist/domain/spec/model/aliases.d.ts +9 -0
  222. package/dist/domain/spec/model/aliases.js +1 -0
  223. package/dist/domain/spec/model/common-types.d.ts +15 -0
  224. package/dist/domain/spec/model/common-types.js +1 -0
  225. package/dist/domain/spec/model/defaults.d.ts +33 -0
  226. package/dist/domain/spec/model/defaults.js +1 -0
  227. package/dist/domain/spec/model/entity-types.d.ts +8 -0
  228. package/dist/domain/spec/model/entity-types.js +1 -0
  229. package/dist/domain/spec/model/index.d.ts +7 -0
  230. package/dist/domain/spec/model/index.js +1 -0
  231. package/dist/domain/spec/model/model-version-key.d.ts +3 -0
  232. package/dist/domain/spec/model/model-version-key.js +1 -0
  233. package/dist/domain/spec/model/names/action-name.d.ts +7 -0
  234. package/dist/domain/spec/model/names/action-name.js +1 -0
  235. package/dist/domain/spec/model/names/alias-name.d.ts +7 -0
  236. package/dist/domain/spec/model/names/alias-name.js +1 -0
  237. package/dist/domain/spec/model/names/entity-or-alias-name.d.ts +8 -0
  238. package/dist/domain/spec/model/names/entity-or-alias-name.js +1 -0
  239. package/dist/domain/spec/model/names/entity-type-name.d.ts +8 -0
  240. package/dist/domain/spec/model/names/entity-type-name.js +1 -0
  241. package/dist/domain/spec/model/names/expression-name.d.ts +6 -0
  242. package/dist/domain/spec/model/names/expression-name.js +1 -0
  243. package/dist/domain/spec/model/names/index.d.ts +9 -0
  244. package/dist/domain/spec/model/names/index.js +1 -0
  245. package/dist/domain/spec/model/names/instance-name.d.ts +7 -0
  246. package/dist/domain/spec/model/names/instance-name.js +1 -0
  247. package/dist/domain/spec/model/names/invariant-name.d.ts +3 -0
  248. package/dist/domain/spec/model/names/invariant-name.js +1 -0
  249. package/dist/domain/spec/model/names/shape-property-name.d.ts +11 -0
  250. package/dist/domain/spec/model/names/shape-property-name.js +1 -0
  251. package/dist/domain/spec/model/names/violation-type-name.d.ts +3 -0
  252. package/dist/domain/spec/model/names/violation-type-name.js +1 -0
  253. package/dist/domain/spec/model/presets.d.ts +30 -0
  254. package/dist/domain/spec/model/presets.js +1 -0
  255. package/dist/domain/spec/sections/actions.d.ts +23 -0
  256. package/dist/domain/spec/sections/actions.js +1 -0
  257. package/dist/domain/spec/sections/app-metadata.d.ts +18 -0
  258. package/dist/domain/spec/sections/app-metadata.js +1 -0
  259. package/dist/domain/spec/sections/application-version.d.ts +7 -0
  260. package/dist/domain/spec/sections/application-version.js +1 -0
  261. package/dist/domain/spec/sections/data-spec/chunks.d.ts +23 -0
  262. package/dist/domain/spec/sections/data-spec/chunks.js +1 -0
  263. package/dist/domain/spec/sections/data-spec/custom-data-spec-entry.d.ts +16 -0
  264. package/dist/domain/spec/sections/data-spec/custom-data-spec-entry.js +1 -0
  265. package/dist/domain/spec/sections/data-spec/data-entry-key.d.ts +9 -0
  266. package/dist/domain/spec/sections/data-spec/data-entry-key.js +1 -0
  267. package/dist/domain/spec/sections/data-spec/index.d.ts +5 -0
  268. package/dist/domain/spec/sections/data-spec/index.js +1 -0
  269. package/dist/domain/spec/sections/data-spec/parsed-data-spec-entries.d.ts +10 -0
  270. package/dist/domain/spec/sections/data-spec/parsed-data-spec-entries.js +1 -0
  271. package/dist/domain/spec/sections/data-spec/swatch-data-spec-entry.d.ts +14 -0
  272. package/dist/domain/spec/sections/data-spec/swatch-data-spec-entry.js +1 -0
  273. package/dist/domain/spec/sections/index.d.ts +9 -0
  274. package/dist/domain/spec/sections/index.js +1 -0
  275. package/dist/domain/spec/sections/infra/acl.d.ts +12 -0
  276. package/dist/domain/spec/sections/infra/acl.js +1 -0
  277. package/dist/domain/spec/sections/infra/index.d.ts +3 -0
  278. package/dist/domain/spec/sections/infra/index.js +1 -0
  279. package/dist/domain/spec/sections/infra/resource-entry.d.ts +46 -0
  280. package/dist/domain/spec/sections/infra/resource-entry.js +1 -0
  281. package/dist/domain/spec/sections/infra/resources-config.d.ts +10 -0
  282. package/dist/domain/spec/sections/infra/resources-config.js +1 -0
  283. package/dist/domain/spec/sections/state-value.d.ts +7 -0
  284. package/dist/domain/spec/sections/state-value.js +1 -0
  285. package/dist/domain/spec/sections/theme.d.ts +10 -0
  286. package/dist/domain/spec/sections/theme.js +1 -0
  287. package/dist/domain/spec/sections/transformers.d.ts +15 -0
  288. package/dist/domain/spec/sections/transformers.js +1 -0
  289. package/dist/domain/spec/sections/ui.d.ts +12 -0
  290. package/dist/domain/spec/sections/ui.js +1 -0
  291. package/dist/editor/graphql/GraphQLPanel.js +1 -1
  292. package/dist/phoenix/application-spec/generate-application-spec-project.d.ts +1 -0
  293. package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
  294. package/dist/phoenix/application-spec/generate-project-files.d.ts +1 -0
  295. package/dist/phoenix/application-spec/index.d.ts +1 -0
  296. package/dist/phoenix/application-spec/index.js +1 -1
  297. package/dist/phoenix/bin.js +1 -1
  298. package/dist/phoenix/commands/build.js +1 -1
  299. package/dist/phoenix/commands/clean.js +1 -1
  300. package/dist/phoenix/commands/deploy.js +1 -1
  301. package/dist/phoenix/commands/sync.js +1 -1
  302. package/dist/phoenix/lingui/index.d.ts +1 -0
  303. package/dist/phoenix/lingui/index.js +1 -0
  304. package/dist/phoenix/services/application-spec-project-watcher.js +1 -1
  305. package/dist/phoenix/services/index.d.ts +1 -1
  306. package/dist/phoenix/services/index.js +1 -1
  307. package/dist/phoenix/services/lingui-watcher.js +1 -1
  308. package/dist/phoenix/services/vite-config.js +1 -1
  309. package/dist/react-sdk/application-runtime/domain-application-context/chat-system.d.ts +1 -1
  310. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/ConfiguratorRoutingProvider.d.ts +1 -1
  311. package/dist/react-sdk/configurator-routing/ConfiguratorRoutingProvider.js +1 -0
  312. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/OnGoToIndexHandler.d.ts +1 -2
  313. package/dist/react-sdk/configurator-routing/OnGoToIndexHandler.js +1 -0
  314. package/dist/react-sdk/configurator-routing/index.d.ts +3 -0
  315. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/index.js +1 -1
  316. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/use-power-routing-lifecycle.d.ts +2 -0
  317. package/dist/react-sdk/configurator-routing/use-power-routing-lifecycle.js +1 -0
  318. package/dist/react-sdk/domain-application-context/ConfigurationPersistSystemFailureHandler.js +1 -1
  319. package/dist/react-sdk/domain-application-context/OnPresetLoadedHandler.js +1 -0
  320. package/dist/react-sdk/domain-application-context/chat-hooks.d.ts +4 -0
  321. package/dist/react-sdk/domain-application-context/chat-hooks.js +1 -0
  322. package/dist/react-sdk/domain-application-context/index.d.ts +2 -0
  323. package/dist/react-sdk/domain-application-context/index.js +1 -1
  324. package/dist/react-sdk/index.d.ts +4 -0
  325. package/dist/react-sdk/index.js +1 -1
  326. package/dist/react-sdk/integration/IntegrationSubscription.js +1 -0
  327. package/dist/react-sdk/integration/index.d.ts +1 -0
  328. package/dist/react-sdk/integration/index.js +1 -0
  329. package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.d.ts +8 -0
  330. package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.js +1 -0
  331. package/dist/react-sdk/lifecycle-providers/LifecycleProviders.js +1 -0
  332. package/dist/react-sdk/lifecycle-providers/index.d.ts +2 -0
  333. package/dist/react-sdk/lifecycle-providers/index.js +1 -0
  334. package/dist/react-sdk/notifications/index.d.ts +1 -0
  335. package/dist/react-sdk/notifications/index.js +1 -0
  336. package/dist/react-sdk/notifications/snackbar-action-button.d.ts +30 -0
  337. package/dist/react-sdk/notifications/snackbar-action-button.js +1 -0
  338. package/dist/ui-sdk/components/snackbar/Snackbar.d.ts +24 -3
  339. package/dist/ui-sdk/components/snackbar/Snackbar.js +1 -1
  340. package/dist/watch/glob-matcher.d.ts +4 -4
  341. package/dist/watch/glob-matcher.js +1 -1
  342. package/dist/watch/watch.d.ts +4 -4
  343. package/dist/watch/watch.js +1 -1
  344. package/package.json +3 -3
  345. package/dist/application-spec/core/components/index.d.ts +0 -2
  346. package/dist/application-spec/core/expressions/index.d.ts +0 -2
  347. package/dist/configurator/configurator-context/ConfiguratorDataProvider.d.ts +0 -2
  348. package/dist/configurator/configurator-context/ConfiguratorDataProvider.js +0 -1
  349. package/dist/configurator/configurator-context/IntegrationSubscription.js +0 -1
  350. package/dist/configurator/configurator-context/LifecycleProviders.js +0 -1
  351. package/dist/configurator/configurator-context/OnPresetLoadedHandler.js +0 -1
  352. package/dist/configurator/configurator-context/configurator-hooks/chat-hooks.d.ts +0 -1
  353. package/dist/configurator/configurator-context/configurator-hooks/chat-hooks.js +0 -1
  354. package/dist/configurator/configurator-context/configurator-routing/ConfiguratorRoutingProvider.js +0 -1
  355. package/dist/configurator/configurator-context/configurator-routing/OnGoToIndexHandler.js +0 -1
  356. package/dist/configurator/configurator-context/configurator-routing/index.d.ts +0 -2
  357. package/dist/configurator/configurator-context/configurator-routing/use-power-routing-lifecycle.js +0 -1
  358. /package/dist/{application-spec/core/expressions/relation-expression-params.js → domain/spec/application/admin-pages-section.js} +0 -0
  359. /package/dist/{application-spec/parse-application-files/spec/components/component-entry.js → domain/spec/application/admin-pages.js} +0 -0
  360. /package/dist/{application-spec/parse-application-files/spec/expressions/expression.js → domain/spec/application/admin-states.js} +0 -0
  361. /package/dist/{application-spec/core → domain/spec/application}/application-instance.d.ts +0 -0
  362. /package/dist/{application-spec/core → domain/spec/application}/application-instance.js +0 -0
  363. /package/dist/{application-spec/core → domain/spec}/components/component-filter.js +0 -0
  364. /package/dist/{application-spec/core → domain/spec}/components/index.js +0 -0
  365. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.d.ts +0 -0
  366. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.js +0 -0
  367. /package/dist/{application-spec/core → domain/spec}/expressions/index.js +0 -0
  368. /package/dist/{application-spec/core → domain/spec}/expressions/relation-expression-params.d.ts +0 -0
  369. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.d.ts +0 -0
  370. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.js +0 -0
  371. /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.d.ts +0 -0
  372. /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.js +0 -0
  373. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.d.ts +0 -0
  374. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.js +0 -0
  375. /package/dist/phoenix/{services → lingui}/lingui.d.ts +0 -0
  376. /package/dist/phoenix/{services → lingui}/lingui.js +0 -0
  377. /package/dist/{configurator/configurator-context → react-sdk/domain-application-context}/OnPresetLoadedHandler.d.ts +0 -0
  378. /package/dist/{configurator/configurator-context → react-sdk/integration}/IntegrationSubscription.d.ts +0 -0
  379. /package/dist/{configurator/configurator-context → react-sdk/lifecycle-providers}/LifecycleProviders.d.ts +0 -0
@@ -1,6 +1,6 @@
1
- import{GeneratedApplicationFile as e}from"../../core/index.js";import{followsCanaryBuilds as r,generateApplicationSpecEslintConfig as t,generateApplicationSpecFavicon as i,generateApplicationSpecGitignore as n,generateApplicationSpecPrettierConfig as a,generateApplicationSpecRobotsTxt as o,generateApplicationSpecRootTsconfig as l,generateApplicationSpecTsconfig as s,generateLinguiRcFile as c,generatePhoenixCliSkill as f,generatePhoenixCreateConfiguratorSkill as p,generatePhoenixCreateConfiguratorSkillReferences as d,generatePhoenixFeedbackSkill as m,generatePhoenixReviewSkill as g,generatePhoenixSkill as h,generatePhoenixVariantsSkill as u,stripSdkMarkerContent as j}from"./templates/index.js";export const agentSkillRoots=[".claude/skills",".agents/skills"];let x=[{path:"CLAUDE.md",generatedPrefix:""},{path:".cursor/rules/phoenix.mdc",generatedPrefix:`---
1
+ import{GeneratedApplicationFile as e}from"../../core/index.js";import{followsCanaryBuilds as i,generateApplicationSpecEslintConfig as r,generateApplicationSpecFavicon as t,generateApplicationSpecGitignore as a,generateApplicationSpecPrettierConfig as o,generateApplicationSpecRobotsTxt as n,generateApplicationSpecRootTsconfig as l,generateApplicationSpecTsconfig as s,generateLinguiRcFile as c,generatePhoenixSkillBundle as d,stripSdkMarkerContent as f}from"./templates/index.js";export const agentSkillRoots=[".claude/skills",".agents/skills"];let p=[{path:"CLAUDE.md",generatedPrefix:""},{path:".cursor/rules/phoenix.mdc",generatedPrefix:`---
2
2
  description: Phoenix SDK project rules
3
3
  globs:
4
4
  alwaysApply: true
5
5
  ---
6
- `}],P=[".claude/commands/review.md",".cursor/commands/review.md"],v=(e,r)=>e.projectFiles.find(e=>e.file.name===r)?.file.content;export const generateProjectScaffolding=F=>{let E,G,{applicationSpec:b,categorizedFiles:k,sdkVersion:w,projectInGitRepository:L=!0,cliUseWorkspace:S}=F,$=v(k,".gitignore"),y=void 0!==S?S:b.appMetadata.workspace,C=(r=>{let t=[],i=[...P];for(let{path:n,generatedPrefix:a}of x){let o=v(r,n);if(void 0===o)continue;let l=j(o,a);void 0===l?i.push(n):l!==o&&t.push(e(n,l,{format:!1}))}return{strippedFiles:t,removedFiles:i}})(k),M={generatedProjectFiles:(E=[{file:e("tsconfig.json",l()),hasEarlierGenerated:k.hasEarlierGeneratedTsconfig},{file:e("eslint.config.js",t()),hasEarlierGenerated:k.hasEarlierGeneratedEslintConfig},{file:e("prettier.config.js",a()),hasEarlierGenerated:k.hasEarlierGeneratedPrettierConfig}]).filter(e=>e.hasEarlierGenerated).map(e=>e.file),initialProjectFiles:E.filter(e=>!e.hasEarlierGenerated).map(e=>e.file)};return{phoenixFiles:[e("tsconfig.json",s()),e(".linguirc",c(b.configurator.ui.availableLocales),{format:!1})],generatedProjectFiles:[...M.generatedProjectFiles,...L?[e(".gitignore",n($))]:[],...(G=[{name:"phoenix",content:h({checkLatestCanary:r({useWorkspace:y,sdkVersion:w})}),references:[]},{name:"phoenix-cli",content:f(),references:[]},{name:"phoenix-create-configurator",content:p(),references:d()},{name:"phoenix-feedback",content:m(),references:[]},{name:"phoenix-review",content:g(),references:[]},{name:"phoenix-variants",content:u(),references:[]}],agentSkillRoots.flatMap(r=>G.flatMap(t=>[e(`${r}/${t.name}/SKILL.md`,t.content),...t.references.map(i=>e(`${r}/${t.name}/${i.path}`,i.content))]))),...C.strippedFiles],initialProjectFiles:[...M.initialProjectFiles,e("public/favicon.ico",i(),{binary:!0}),e("public/robots.txt",o(),{format:!1})],removedProjectFiles:C.removedFiles}};
6
+ `}],g=[".claude/commands/review.md",".cursor/commands/review.md"],m=(e,i)=>e.projectFiles.find(e=>e.file.name===i)?.file.content;export const generateProjectScaffolding=h=>{let u,j,{applicationSpec:x,categorizedFiles:P,sdkVersion:F,projectInGitRepository:E=!0,cliUseWorkspace:v}=h,G=m(P,".gitignore"),b=void 0!==v?v:x.appMetadata.workspace,k=(i=>{let r=[],t=[...g];for(let{path:a,generatedPrefix:o}of p){let n=m(i,a);if(void 0===n)continue;let l=f(n,o);void 0===l?t.push(a):l!==n&&r.push(e(a,l,{format:!1}))}return{strippedFiles:r,removedFiles:t}})(P),L={generatedProjectFiles:(u=[{file:e("tsconfig.json",l()),hasEarlierGenerated:P.hasEarlierGeneratedTsconfig},{file:e("eslint.config.js",r()),hasEarlierGenerated:P.hasEarlierGeneratedEslintConfig},{file:e("prettier.config.js",o()),hasEarlierGenerated:P.hasEarlierGeneratedPrettierConfig}]).filter(e=>e.hasEarlierGenerated).map(e=>e.file),initialProjectFiles:u.filter(e=>!e.hasEarlierGenerated).map(e=>e.file)};return{phoenixFiles:[e("tsconfig.json",s()),e(".linguirc",c(x.configurator.ui.availableLocales),{format:!1})],generatedProjectFiles:[...L.generatedProjectFiles,...E?[e(".gitignore",a(G))]:[],...(j=d({checkLatestCanary:i({useWorkspace:b,sdkVersion:F})}),agentSkillRoots.flatMap(i=>[e(`${i}/phoenix/SKILL.md`,j.content),...j.references.map(r=>e(`${i}/phoenix/${r.path}`,r.content))])),...k.strippedFiles],initialProjectFiles:[...L.initialProjectFiles,e("public/favicon.ico",t(),{binary:!0}),e("public/robots.txt",n(),{format:!1})],removedProjectFiles:k.removedFiles}};
@@ -37,12 +37,8 @@ export { generateApplicationSpecGlobals } from './globals.js';
37
37
  export { generateApplicationSpecHtmlAdminIndex } from './html-admin-index.js';
38
38
  export { generateApplicationSpecHtmlIndex } from './html-index.js';
39
39
  export { generateLinguiRcFile } from './lingui-rc.js';
40
- export { generatePhoenixCliSkill } from './skills/phoenix-cli-skill.js';
41
- export { generatePhoenixCreateConfiguratorSkill, generatePhoenixCreateConfiguratorSkillReferences, } from './skills/phoenix-create-configurator-skill.js';
42
- export { generatePhoenixFeedbackSkill } from './skills/phoenix-feedback-skill.js';
43
- export { generatePhoenixReviewSkill } from './skills/phoenix-review-skill.js';
44
- export { type PhoenixSkillOptions, followsCanaryBuilds, generatePhoenixSkill } from './skills/phoenix-skill.js';
45
- export { generatePhoenixVariantsSkill } from './skills/phoenix-variants-skill.js';
40
+ export { generatePhoenixSkillBundle } from './skills/phoenix-skill-bundle.js';
41
+ export { type PhoenixSkillOptions, followsCanaryBuilds } from './skills/phoenix-skill.js';
46
42
  export { generateApplicationSpecPrettierConfig } from './prettier-config.js';
47
43
  export { generateApplicationSpecRobotsTxt } from './robots-txt.js';
48
44
  export { generateApplicationSpecRootTsconfig } from './root-tsconfig.js';
@@ -1 +1 @@
1
- export{stripSdkMarkerContent}from"./common/strip-sdk-marker-content.js";export{generateApplicationSpecAdminConfig}from"./admin-config.js";export{generateApplicationSpecAdminCode}from"./admin-domain-code.js";export{generateApplicationSpecAdminFrontendCode}from"./admin-frontend-code.js";export{generateAdminGlobalBindingBlock,generateApplicationSpecAdminGlobals}from"./admin-globals.js";export{generateApplicationSpecTypesModule}from"./application-types.js";export{generateApplicationSpecAdminFile}from"./admin.js";export{generateApplicationSpecConfiguratorConfig}from"./configurator-config.js";export{generateApplicationSpecConfiguratorCode}from"./configurator-domain-code.js";export{generateApplicationSpecConfiguratorFrontendCode}from"./configurator-frontend-code.js";export{generateApplicationSpecConfiguratorGlobals,generateConfiguratorGlobalBindingBlock}from"./configurator-globals.js";export{generateApplicationSpecConfiguratorFile}from"./configurator.js";export{generateApplicationSpecDomainSpecFile}from"./domain-spec.js";export{generateImportedStateConstants,generatePhxExportsBlock,generatePhxGlobalsBlock,generateStateConstants}from"./domain-spec/index.js";export{generateApplicationSpecDomainFile}from"./domain.js";export{generateApplicationSpecEditorFile}from"./editor.js";export{generateApplicationSpecEmbeddedAdmin}from"./embedded-admin.js";export{generateApplicationSpecEmbeddedConfigurator}from"./embedded-configurator.js";export{generateApplicationSpecEslintConfig}from"./eslint-config.js";export{generateApplicationSpecFavicon}from"./favicon.js";export{generateApplicationSpecFrontendConfig}from"./frontend-config.js";export{generateApplicationSpecGitignore}from"./gitignore.js";export{generateApplicationSpecGlobals}from"./globals.js";export{generateApplicationSpecHtmlAdminIndex}from"./html-admin-index.js";export{generateApplicationSpecHtmlIndex}from"./html-index.js";export{generateLinguiRcFile}from"./lingui-rc.js";export{generatePhoenixCliSkill}from"./skills/phoenix-cli-skill.js";export{generatePhoenixCreateConfiguratorSkill,generatePhoenixCreateConfiguratorSkillReferences}from"./skills/phoenix-create-configurator-skill.js";export{generatePhoenixFeedbackSkill}from"./skills/phoenix-feedback-skill.js";export{generatePhoenixReviewSkill}from"./skills/phoenix-review-skill.js";export{followsCanaryBuilds,generatePhoenixSkill}from"./skills/phoenix-skill.js";export{generatePhoenixVariantsSkill}from"./skills/phoenix-variants-skill.js";export{generateApplicationSpecPrettierConfig}from"./prettier-config.js";export{generateApplicationSpecRobotsTxt}from"./robots-txt.js";export{generateApplicationSpecRootTsconfig}from"./root-tsconfig.js";export{generateApplicationSpecStoryDevDeclaration,generateApplicationSpecStoryPhxModule,generateApplicationSpecStoryRawProjectFiles,generateApplicationSpecStoryWrapper}from"./story/index.js";export{generateApplicationSpecCodeFile}from"./spec-code/index.js";export{generateApplicationSpecMessagesFile}from"./spec-messages/index.js";export{generateApplicationSpecTsconfig}from"./tsconfig.js";export{generateApplicationSpecWebhookBuilders}from"./webhook-builders.js";export{generateApplicationSpecWebhookIndex}from"./webhook-index.js";export{generateApplicationSpecWebhooksConfig}from"./webhooks-config.js";
1
+ export{stripSdkMarkerContent}from"./common/strip-sdk-marker-content.js";export{generateApplicationSpecAdminConfig}from"./admin-config.js";export{generateApplicationSpecAdminCode}from"./admin-domain-code.js";export{generateApplicationSpecAdminFrontendCode}from"./admin-frontend-code.js";export{generateAdminGlobalBindingBlock,generateApplicationSpecAdminGlobals}from"./admin-globals.js";export{generateApplicationSpecTypesModule}from"./application-types.js";export{generateApplicationSpecAdminFile}from"./admin.js";export{generateApplicationSpecConfiguratorConfig}from"./configurator-config.js";export{generateApplicationSpecConfiguratorCode}from"./configurator-domain-code.js";export{generateApplicationSpecConfiguratorFrontendCode}from"./configurator-frontend-code.js";export{generateApplicationSpecConfiguratorGlobals,generateConfiguratorGlobalBindingBlock}from"./configurator-globals.js";export{generateApplicationSpecConfiguratorFile}from"./configurator.js";export{generateApplicationSpecDomainSpecFile}from"./domain-spec.js";export{generateImportedStateConstants,generatePhxExportsBlock,generatePhxGlobalsBlock,generateStateConstants}from"./domain-spec/index.js";export{generateApplicationSpecDomainFile}from"./domain.js";export{generateApplicationSpecEditorFile}from"./editor.js";export{generateApplicationSpecEmbeddedAdmin}from"./embedded-admin.js";export{generateApplicationSpecEmbeddedConfigurator}from"./embedded-configurator.js";export{generateApplicationSpecEslintConfig}from"./eslint-config.js";export{generateApplicationSpecFavicon}from"./favicon.js";export{generateApplicationSpecFrontendConfig}from"./frontend-config.js";export{generateApplicationSpecGitignore}from"./gitignore.js";export{generateApplicationSpecGlobals}from"./globals.js";export{generateApplicationSpecHtmlAdminIndex}from"./html-admin-index.js";export{generateApplicationSpecHtmlIndex}from"./html-index.js";export{generateLinguiRcFile}from"./lingui-rc.js";export{generatePhoenixSkillBundle}from"./skills/phoenix-skill-bundle.js";export{followsCanaryBuilds}from"./skills/phoenix-skill.js";export{generateApplicationSpecPrettierConfig}from"./prettier-config.js";export{generateApplicationSpecRobotsTxt}from"./robots-txt.js";export{generateApplicationSpecRootTsconfig}from"./root-tsconfig.js";export{generateApplicationSpecStoryDevDeclaration,generateApplicationSpecStoryPhxModule,generateApplicationSpecStoryRawProjectFiles,generateApplicationSpecStoryWrapper}from"./story/index.js";export{generateApplicationSpecCodeFile}from"./spec-code/index.js";export{generateApplicationSpecMessagesFile}from"./spec-messages/index.js";export{generateApplicationSpecTsconfig}from"./tsconfig.js";export{generateApplicationSpecWebhookBuilders}from"./webhook-builders.js";export{generateApplicationSpecWebhookIndex}from"./webhook-index.js";export{generateApplicationSpecWebhooksConfig}from"./webhooks-config.js";
@@ -0,0 +1,10 @@
1
+ import { type AgentSkillReference } from './agent-skill.js';
2
+ import { type PhoenixSkillOptions } from './phoenix-skill.js';
3
+ /** The discoverable entry point and the documents it ships beside it. */
4
+ interface PhoenixSkillBundle {
5
+ readonly content: string;
6
+ readonly references: readonly AgentSkillReference[];
7
+ }
8
+ /** Keeps the existing generators as content owners while changing only discovery and relative routing. */
9
+ export declare const generatePhoenixSkillBundle: (options: PhoenixSkillOptions) => PhoenixSkillBundle;
10
+ export {};
@@ -0,0 +1,7 @@
1
+ import{renderAgentSkill as e}from"./agent-skill.js";import{generatePhoenixCliSkill as t}from"./phoenix-cli-skill.js";import{generatePhoenixCreateConfiguratorSkill as n,generatePhoenixCreateConfiguratorSkillReferences as r}from"./phoenix-create-configurator-skill.js";import{generatePhoenixFeedbackSkill as i}from"./phoenix-feedback-skill.js";import{generatePhoenixReviewSkill as o}from"./phoenix-review-skill.js";import{generatePhoenixSkill as a}from"./phoenix-skill.js";import{generatePhoenixVariantsSkill as s}from"./phoenix-variants-skill.js";let l=(e,t,n)=>n.reduce((e,n)=>{let r="../".repeat(t.split("/").length-2),i=`[${n.title}](${r}${n.path.slice(11)})`;return e.replaceAll(`\`${n.name}\` skill`,i).replaceAll(`${n.name} skill`,i)},e),c=e=>{let t="\n---\n\n",n=e.content.indexOf(t),r=e.content.slice(0,n).split("\n").find(e=>e.startsWith("description: "));if(-1===n||void 0===r)throw Error(`Cannot emit the ${e.name} guide: its skill frontmatter is missing. Render it with renderAgentSkill.`);return{description:r.slice(13),body:e.content.slice(n+t.length)}};export const generatePhoenixSkillBundle=h=>{let p=[{name:"phoenix",title:"Project guidance",path:"references/project.md",content:a(h),references:[]},{name:"phoenix-create-configurator",title:"Configurator workflow",path:"references/create-configurator/guide.md",content:n(),references:r()},{name:"phoenix-cli",title:"CLI guide",path:"references/cli.md",content:t(),references:[]},{name:"phoenix-review",title:"Code review guide",path:"references/review.md",content:o(),references:[]},{name:"phoenix-variants",title:"Variants guide",path:"references/variants.md",content:s(),references:[]},{name:"phoenix-feedback",title:"Feedback guide",path:"references/feedback.md",content:i(),references:[]}];return{content:e({name:"phoenix",description:"Build, change, inspect, deploy or review a Phoenix configurator project. Use for Phoenix project work, visual alternatives, and platform feedback.",sections:[`# Phoenix
2
+
3
+ Load the guides for the work in hand before doing that work. Several may apply. Follow their existing instructions; this entry point only routes to them. Reuse guidance already read in the conversation unless sync or an SDK update changed it.`,`## Choose the relevant guidance
4
+
5
+ | When | Read |
6
+ | --- | --- |
7
+ ${p.map(e=>`| ${c(e).description} | [${e.title}](${e.path}) |`).join("\n")}`,"The workflow guide links to product discovery, asset conversion, UX guidance and appearance review at the stages that use them. An isolated code fix needs project guidance and the applicable CLI/review guides; it does not restart the configurator workflow.\n\nEarlier Phoenix skill names refer to these guides: ask for the same task through `phoenix`. Read linked documents when their task applies, not the whole reference tree."]}),references:p.flatMap(e=>[{path:e.path,content:l(c(e).body,e.path,p)},...e.references.map(t=>{let n=`${e.path.slice(0,e.path.lastIndexOf("/")+1)}${t.path}`;return{path:n,content:l(t.content,n,p)}})])}};
@@ -54,7 +54,7 @@ Without a lockfile, use the package manager the \`packageManager\` field of \`pa
54
54
  - \`AppLoaderContent\`: \`phx.frontend.createAppLoader(({ phases }) => …)\` replaces what the loading overlay shows (each phase \`{ id, label?, progress? }\`, the list possibly empty); Phoenix keeps the overlay itself
55
55
  - Assistant form elements: an element declared under \`assistant.formElements\` (\`description\`, \`role\`, scalar \`attributes\` beside the built-in \`label\`, a \`value\` included, \`required\`) is the default export \`phx.frontend.createAssistantFormElement('name', Component)\` of one file; the name types the component's props by its role (\`AssistantFormElementProps<'name'>\`): an option reports its answer with \`onSelect(answer)\`, an input with \`onChange(state, answer)\`; and the application does not start while a declared element has no registration or a registration no declaration
56
56
  - \`src/handlers/\` — Event & lifecycle handlers
57
- - \`src/webhooks/\` — Server-side webhook handlers (\`phx.webhooks.*Builder\`); the webhook is the default export of \`src/webhooks/index.ts\`, which you create when the project needs its own handlers — without it the build uses a built-in inert webhook that answers only anonymous auth, so create the file before setting \`useAuthHook\` or \`useClerk\`
57
+ - \`src/webhooks/\` — Server-side webhook handlers (\`phx.webhooks.*Builder\`); the webhook is the default export of \`src/webhooks/index.ts\`, which you create when the project needs its own handlers. Without it, generation continues with a built-in webhook that answers only anonymous auth; enabling \`useAuthHook\` or \`useClerk\` reports \`AUTH_WITHOUT_PROJECT_WEBHOOK\`. Add the entry with the required Clerk or custom auth handlers, or disable unintended auth settings
58
58
  - \`src/migrations/\` — Schema version migrations (v*.ts)
59
59
  - \`src/locales/\` — Locale catalogs (authored .po sources; compiled .ts, do not edit)
60
60
  - \`src/admin/\` — Admin interface (mirrors main src/ structure)
@@ -1,4 +1,4 @@
1
- export const sdkGuidanceSections={packageManager:"## Package Manager\nThe project installs with its own package manager, and the commands in this skill are written for pnpm. Run them through the package manager the project uses, which the lockfile in the project root names:\n- `pnpm-lock.yaml`: `pnpm phoenix <command>`, `pnpm install`, `pnpm add <package>`\n- `package-lock.json`: `npx phoenix <command>`, `npm install`, `npm install <package>`\n- `yarn.lock`: `yarn phoenix <command>`, `yarn install`, `yarn add <package>`\n- `bun.lock` or `bun.lockb`: `bunx phoenix <command>`, `bun install`, `bun add <package>`\n\nWithout a lockfile, use the package manager the `packageManager` field of `package.json` names, or ask the user.",buildCommands:"## Build Commands\n- `pnpm phoenix build` — Full production build\n- `pnpm phoenix dev` — Development mode with hot reload\n- `pnpm phoenix sync` — Sync generated files without full build\n- `pnpm phoenix deps` — Add the SDK's missing peer dependencies to `package.json` and move out-of-range ones into the SDK's range; it installs nothing, so install after it",devLogs:"## Dev Logs\n- `pnpm phoenix dev` writes all logs to `.phoenix/phoenix-dev.log`\n- Contains: spec parse errors, build errors, browser runtime errors, file watcher events\n- After making changes, always check the log for errors: `tail -50 .phoenix/phoenix-dev.log` or `grep ERROR .phoenix/phoenix-dev.log`\n- Rotated automatically at 10MB (`.log.1`, `.log.2` are older rotations)",projectStructure:"## Project Structure\n- `spec/` — Domain YAML specs (entities, relations, expressions, invariants, components, application config)\n- `src/expressions/` — Computed/derived entity properties (`phx.domain.implementCustomExpressions()`)\n- `src/actions/` — Domain operations declared under `actions:` in the spec (`phx.domain.implementActions()`), run by controls and exposed to the assistant\n- `src/invariants/` — Business rule constraints (`phx.domain.implementCustomInvariants()`)\n- `src/transformers/` — Automatic state fixers (`phx.frontend.transformerBuilder`)\n- `src/components/` — ECS system components (`phx.domain.attachComponent.withEntity()`)\n- `src/elements/` — Page-level React components (`phx.frontend.createCustomPhoenixLayoutElement()`)\n - `ConfiguratorLayout`: a layout element with this name replaces everything the built-in layout renders for a loaded configuration, in owner and read mode, finalization included. Prefer arranging the spec's layout components; write one for shell-level changes, such as moving the sidebar or adding an area the built-in layout has no place for\n - Mount `LayoutSlots.SharedCanvas` (from `@salsita-ai/sdk/configurator`) in a positioned root covering the page; put the UI above it, positioned and after it in the markup. With the canvas mounted the app loader waits until the scene has loaded; a layout without a canvas is not held by the loader. Call `phx.frontend.useSceneSafeArea()` and put `containerRef` on the element covering the whole canvas and `safeAreaRef` on the region the UI leaves free, with `pointerEvents: 'none'`, so the camera frames the scene there\n - Sidebar moved, contents as the spec configures them: mount `LayoutSlots.DesktopSidebar` in a positioned container that sets its size, with `side=\"start\"` on the left; `docs/layouts/sidebar/in-a-custom-layout.mdx` is the whole layout\n - Your own UI: \"Hooks for a Project Layout\" in `docs/phoenix/configurator-interface.mdx` lists the hooks with what each returns (`pnpm phoenix docs -r docs/phoenix/configurator-interface.mdx`), `docs/phoenix/layout-slots.mdx` the built-in pieces you can still mount, and `docs/layouts/custom-layout.mdx` is a worked example. Call the hooks as `phx.frontend.useX()`; besides those below, these are often needed: `usePreview()` (`isPreview` while the preview start screen shows), `useCloseAction()` (the host's close action or `null`), `useActiveViewports()` (the container's breakpoints, `null` until measured, `desktop` above 768 px: the desktop/phone switch), `useResolveLocalizable()` and `useLocalizable(text)` (spec texts to strings), `useIsCloningAllowed()` (a read-mode \"edit a copy\" action with `LayoutSlots.CloneToEditDialog`)\n - Undo and redo: `phx.frontend.useUndoRedo()` returns `{ canUndo, canRedo, undo, redo }`; disable each button from `canUndo`/`canRedo`\n - Tabs: `phx.frontend.useTabNavigation()` returns `{ source, tabs, activeTab, select }` for the spec's `sidebarTabs` (of the selected entity) or `horizontalTabs`; render `tabs` (each `{ index, label, icon, state, isActive }`, `icon` a PhxIcon name) and call `select(tab.index)` on click. Pass `{ source: 'sidebarTabs' }` or `{ source: 'horizontalTabs' }` when the layout shows one kind only. Not `LayoutSlots.useSidebarTabs()`: it serves the built-in sidebar and returns no tabs while its summary shows\n - Steps: `phx.frontend.useStepNavigation()` returns `{ steps, activeStep, activeIndex, isFirst, isLast, canGoNext, canGoPrevious, next, previous, goTo }` for the spec's `navigationSteps`; render `steps` (each `{ index, label, state, status }`, `status` `'complete' | 'active' | 'upcoming'`), call `next()`/`previous()` for Back and Next and `goTo(step.index)` from a stepper. It enforces no order and no validity: enable only `'complete'` steps for an \"earlier steps only\" stepper, and to block moving on while the configuration has a problem, require `phx.frontend.useStateValidity().severity !== 'warning'` besides `canGoNext`: a change with a `fixable` or `fatal` violation is rejected, so the configuration is never invalid, and a `warning` is the problem that stays (it blocks finalizing too). `useSteps` and `useHasSteps` from `@salsita-ai/sdk/configurator` are deprecated\n - Messages: mount `LayoutSlots.Services` for the built-in snackbars, or show violations, side-effect hints, errors and failed saves yourself with `phx.frontend.useConfiguratorMessages(onMessage)`, not both. A failed save arrives as `saveError`, the next successful save as `saveRecovery`; a layout that mounts neither shows no sign of a failed save. Either way mount a snackbar root (`LayoutSlots.DesktopSnackbarsRoot` or `LayoutSlots.MobileSnackbarsRoot`): errors of the built-in actions are always snackbars\n - Finalize over the spec's `finalizeAction` components, each naming a handler registered with `phx.frontend.createPhoenixHandler`: `phx.frontend.useFinalizeActions()` returns `{ actions, primary, secondary, disabled, hints }`; render `primary` (and `secondary` in a menu or list) in a loop, each action `{ key, label, title, icon, run, isPending, error, disabled }`, and call `action.run()` on click (its promise never rejects; show `action.error` on failure). The configurator runs the handlers itself, outside the layout, so a handler must not rely on a provider the layout adds. For one known handler, `phx.frontend.useFinalizeAction(handler)` in a component wrapped in `PhoenixHandlerBoundary` (from `@salsita-ai/sdk/react`) works too; `FinalizeActions` (from `@salsita-ai/sdk/configurator`) mounts the built-in buttons. `finalizePage` and `finalizeButton` are legacy\n - Read mode and fullscreen are the layout's job, no hook enforces them (`useUndoRedo`, `useFinalizeActions` and `useStepNavigation` included): hide undo, redo, finalization and whatever else a viewer must not change while `phx.frontend.useAccessService().accessInfo.viewMode` is `true` (tabs are navigation, so a viewer may switch them), and remove panels while `phx.frontend.useIsFullscreenActive()` is set; `phx.frontend.useSetFullscreen()` returns its setter\n - `ConfigurationNotFoundPage`: `phx.frontend.createConfigurationNotFoundPage(({ onBack }) => …)` replaces the \"configuration not accessible\" page; show a way back only when the optional `onBack` is set. The not-authenticated page's default renders it too; only the admin's not-authorized page keeps the built-in page\n - `ConfiguratorErrorPage`: `phx.frontend.createConfiguratorErrorPage(({ reason, onRetry }) => …)` replaces the production error page; `reason` is `uncaughtError` or `presetCreationFailed`. A page that throws falls back to the built-in one, and development keeps the detailed error pages, so the project page shows only in a production build. Register both pages with these helpers: `createCustomPhoenixLayoutElement` with the name works too, but types the component as taking only `children`, so the typed props do not compile there in a strict project\n - `AppLoaderContent`: `phx.frontend.createAppLoader(({ phases }) => …)` replaces what the loading overlay shows (each phase `{ id, label?, progress? }`, the list possibly empty); Phoenix keeps the overlay itself\n - Assistant form elements: an element declared under `assistant.formElements` (`description`, `role`, scalar `attributes` beside the built-in `label`, a `value` included, `required`) is the default export `phx.frontend.createAssistantFormElement('name', Component)` of one file; the name types the component's props by its role (`AssistantFormElementProps<'name'>`): an option reports its answer with `onSelect(answer)`, an input with `onChange(state, answer)`; and the application does not start while a declared element has no registration or a registration no declaration\n- `src/handlers/` — Event & lifecycle handlers\n- `src/webhooks/` — Server-side webhook handlers (`phx.webhooks.*Builder`); the webhook is the default export of `src/webhooks/index.ts`, which you create when the project needs its own handlers — without it the build uses a built-in inert webhook that answers only anonymous auth, so create the file before setting `useAuthHook` or `useClerk`\n- `src/migrations/` — Schema version migrations (v*.ts)\n- `src/locales/` — Locale catalogs (authored .po sources; compiled .ts, do not edit)\n- `src/admin/` — Admin interface (mirrors main src/ structure)\n- `src/_shared/` — Shared utilities (NOT auto-imported, requires explicit imports)\n- `.phoenix/` — Auto-generated files (DO NOT EDIT, except the option files in `.phoenix/variants/`)\n- `public/` — Static assets (3D models, textures, images, HDRI maps, fonts)\n- `assets/` — Uploadable resources (PDF templates, email assets)",architecturePrinciples:"## Architecture Principles\n- YAML-first: 99% of configuration in spec/*.yaml, custom code is last resort\n- ECS pattern: entities (domain objects) + components (behavior/UI) + systems (SDK runtime)\n- Reactive state: immutable domain state flows through RxJS pipelines\n- Data binding: `$read` (read-only), `$write` (write-only), `$bind` (bidirectional) connect components to domain\n- memoEval: all component implementations must use memoEval for stable object references",keyPatterns:"## Key Patterns\n- Expressions = computed properties on entities (prefix: `$`), implemented per-entity in src/expressions/\n- Actions = named domain operations (`actions:` in YAML with `params` and `result` schemas), implemented in src/actions/, prepared through `actionSystem.prepareAction()` and exposed as assistant mutations through `assistant.actions`\n- Invariants = validation rules returning violations, static or dynamic\n- Transformers = auto-fixers maintaining consistency after state changes\n- Components defined in YAML with `$read`/`$bind` bindings, or custom in src/components/ using attachComponent builder\n- Webhooks = server-side finalization tasks (PDF, email, CSV, image rendering)\n- Filters = contextual component activation via navigationStates, viewStates, modes, selectedEntityIds",fileConventions:`## File Conventions
1
+ export const sdkGuidanceSections={packageManager:"## Package Manager\nThe project installs with its own package manager, and the commands in this skill are written for pnpm. Run them through the package manager the project uses, which the lockfile in the project root names:\n- `pnpm-lock.yaml`: `pnpm phoenix <command>`, `pnpm install`, `pnpm add <package>`\n- `package-lock.json`: `npx phoenix <command>`, `npm install`, `npm install <package>`\n- `yarn.lock`: `yarn phoenix <command>`, `yarn install`, `yarn add <package>`\n- `bun.lock` or `bun.lockb`: `bunx phoenix <command>`, `bun install`, `bun add <package>`\n\nWithout a lockfile, use the package manager the `packageManager` field of `package.json` names, or ask the user.",buildCommands:"## Build Commands\n- `pnpm phoenix build` — Full production build\n- `pnpm phoenix dev` — Development mode with hot reload\n- `pnpm phoenix sync` — Sync generated files without full build\n- `pnpm phoenix deps` — Add the SDK's missing peer dependencies to `package.json` and move out-of-range ones into the SDK's range; it installs nothing, so install after it",devLogs:"## Dev Logs\n- `pnpm phoenix dev` writes all logs to `.phoenix/phoenix-dev.log`\n- Contains: spec parse errors, build errors, browser runtime errors, file watcher events\n- After making changes, always check the log for errors: `tail -50 .phoenix/phoenix-dev.log` or `grep ERROR .phoenix/phoenix-dev.log`\n- Rotated automatically at 10MB (`.log.1`, `.log.2` are older rotations)",projectStructure:"## Project Structure\n- `spec/` — Domain YAML specs (entities, relations, expressions, invariants, components, application config)\n- `src/expressions/` — Computed/derived entity properties (`phx.domain.implementCustomExpressions()`)\n- `src/actions/` — Domain operations declared under `actions:` in the spec (`phx.domain.implementActions()`), run by controls and exposed to the assistant\n- `src/invariants/` — Business rule constraints (`phx.domain.implementCustomInvariants()`)\n- `src/transformers/` — Automatic state fixers (`phx.frontend.transformerBuilder`)\n- `src/components/` — ECS system components (`phx.domain.attachComponent.withEntity()`)\n- `src/elements/` — Page-level React components (`phx.frontend.createCustomPhoenixLayoutElement()`)\n - `ConfiguratorLayout`: a layout element with this name replaces everything the built-in layout renders for a loaded configuration, in owner and read mode, finalization included. Prefer arranging the spec's layout components; write one for shell-level changes, such as moving the sidebar or adding an area the built-in layout has no place for\n - Mount `LayoutSlots.SharedCanvas` (from `@salsita-ai/sdk/configurator`) in a positioned root covering the page; put the UI above it, positioned and after it in the markup. With the canvas mounted the app loader waits until the scene has loaded; a layout without a canvas is not held by the loader. Call `phx.frontend.useSceneSafeArea()` and put `containerRef` on the element covering the whole canvas and `safeAreaRef` on the region the UI leaves free, with `pointerEvents: 'none'`, so the camera frames the scene there\n - Sidebar moved, contents as the spec configures them: mount `LayoutSlots.DesktopSidebar` in a positioned container that sets its size, with `side=\"start\"` on the left; `docs/layouts/sidebar/in-a-custom-layout.mdx` is the whole layout\n - Your own UI: \"Hooks for a Project Layout\" in `docs/phoenix/configurator-interface.mdx` lists the hooks with what each returns (`pnpm phoenix docs -r docs/phoenix/configurator-interface.mdx`), `docs/phoenix/layout-slots.mdx` the built-in pieces you can still mount, and `docs/layouts/custom-layout.mdx` is a worked example. Call the hooks as `phx.frontend.useX()`; besides those below, these are often needed: `usePreview()` (`isPreview` while the preview start screen shows), `useCloseAction()` (the host's close action or `null`), `useActiveViewports()` (the container's breakpoints, `null` until measured, `desktop` above 768 px: the desktop/phone switch), `useResolveLocalizable()` and `useLocalizable(text)` (spec texts to strings), `useIsCloningAllowed()` (a read-mode \"edit a copy\" action with `LayoutSlots.CloneToEditDialog`)\n - Undo and redo: `phx.frontend.useUndoRedo()` returns `{ canUndo, canRedo, undo, redo }`; disable each button from `canUndo`/`canRedo`\n - Tabs: `phx.frontend.useTabNavigation()` returns `{ source, tabs, activeTab, select }` for the spec's `sidebarTabs` (of the selected entity) or `horizontalTabs`; render `tabs` (each `{ index, label, icon, state, isActive }`, `icon` a PhxIcon name) and call `select(tab.index)` on click. Pass `{ source: 'sidebarTabs' }` or `{ source: 'horizontalTabs' }` when the layout shows one kind only. Not `LayoutSlots.useSidebarTabs()`: it serves the built-in sidebar and returns no tabs while its summary shows\n - Steps: `phx.frontend.useStepNavigation()` returns `{ steps, activeStep, activeIndex, isFirst, isLast, canGoNext, canGoPrevious, next, previous, goTo }` for the spec's `navigationSteps`; render `steps` (each `{ index, label, state, status }`, `status` `'complete' | 'active' | 'upcoming'`), call `next()`/`previous()` for Back and Next and `goTo(step.index)` from a stepper. It enforces no order and no validity: enable only `'complete'` steps for an \"earlier steps only\" stepper, and to block moving on while the configuration has a problem, require `phx.frontend.useStateValidity().severity !== 'warning'` besides `canGoNext`: a change with a `fixable` or `fatal` violation is rejected, so the configuration is never invalid, and a `warning` is the problem that stays (it blocks finalizing too). `useSteps` and `useHasSteps` from `@salsita-ai/sdk/configurator` are deprecated\n - Messages: mount `LayoutSlots.Services` for the built-in snackbars, or show violations, side-effect hints, errors and failed saves yourself with `phx.frontend.useConfiguratorMessages(onMessage)`, not both. A failed save arrives as `saveError`, the next successful save as `saveRecovery`; a layout that mounts neither shows no sign of a failed save. Either way mount a snackbar root (`LayoutSlots.DesktopSnackbarsRoot` or `LayoutSlots.MobileSnackbarsRoot`): errors of the built-in actions are always snackbars\n - Finalize over the spec's `finalizeAction` components, each naming a handler registered with `phx.frontend.createPhoenixHandler`: `phx.frontend.useFinalizeActions()` returns `{ actions, primary, secondary, disabled, hints }`; render `primary` (and `secondary` in a menu or list) in a loop, each action `{ key, label, title, icon, run, isPending, error, disabled }`, and call `action.run()` on click (its promise never rejects; show `action.error` on failure). The configurator runs the handlers itself, outside the layout, so a handler must not rely on a provider the layout adds. For one known handler, `phx.frontend.useFinalizeAction(handler)` in a component wrapped in `PhoenixHandlerBoundary` (from `@salsita-ai/sdk/react`) works too; `FinalizeActions` (from `@salsita-ai/sdk/configurator`) mounts the built-in buttons. `finalizePage` and `finalizeButton` are legacy\n - Read mode and fullscreen are the layout's job, no hook enforces them (`useUndoRedo`, `useFinalizeActions` and `useStepNavigation` included): hide undo, redo, finalization and whatever else a viewer must not change while `phx.frontend.useAccessService().accessInfo.viewMode` is `true` (tabs are navigation, so a viewer may switch them), and remove panels while `phx.frontend.useIsFullscreenActive()` is set; `phx.frontend.useSetFullscreen()` returns its setter\n - `ConfigurationNotFoundPage`: `phx.frontend.createConfigurationNotFoundPage(({ onBack }) => …)` replaces the \"configuration not accessible\" page; show a way back only when the optional `onBack` is set. The not-authenticated page's default renders it too; only the admin's not-authorized page keeps the built-in page\n - `ConfiguratorErrorPage`: `phx.frontend.createConfiguratorErrorPage(({ reason, onRetry }) => …)` replaces the production error page; `reason` is `uncaughtError` or `presetCreationFailed`. A page that throws falls back to the built-in one, and development keeps the detailed error pages, so the project page shows only in a production build. Register both pages with these helpers: `createCustomPhoenixLayoutElement` with the name works too, but types the component as taking only `children`, so the typed props do not compile there in a strict project\n - `AppLoaderContent`: `phx.frontend.createAppLoader(({ phases }) => …)` replaces what the loading overlay shows (each phase `{ id, label?, progress? }`, the list possibly empty); Phoenix keeps the overlay itself\n - Assistant form elements: an element declared under `assistant.formElements` (`description`, `role`, scalar `attributes` beside the built-in `label`, a `value` included, `required`) is the default export `phx.frontend.createAssistantFormElement('name', Component)` of one file; the name types the component's props by its role (`AssistantFormElementProps<'name'>`): an option reports its answer with `onSelect(answer)`, an input with `onChange(state, answer)`; and the application does not start while a declared element has no registration or a registration no declaration\n- `src/handlers/` — Event & lifecycle handlers\n- `src/webhooks/` — Server-side webhook handlers (`phx.webhooks.*Builder`); the webhook is the default export of `src/webhooks/index.ts`, which you create when the project needs its own handlers. Without it, generation continues with a built-in webhook that answers only anonymous auth; enabling `useAuthHook` or `useClerk` reports `AUTH_WITHOUT_PROJECT_WEBHOOK`. Add the entry with the required Clerk or custom auth handlers, or disable unintended auth settings\n- `src/migrations/` — Schema version migrations (v*.ts)\n- `src/locales/` — Locale catalogs (authored .po sources; compiled .ts, do not edit)\n- `src/admin/` — Admin interface (mirrors main src/ structure)\n- `src/_shared/` — Shared utilities (NOT auto-imported, requires explicit imports)\n- `.phoenix/` — Auto-generated files (DO NOT EDIT, except the option files in `.phoenix/variants/`)\n- `public/` — Static assets (3D models, textures, images, HDRI maps, fonts)\n- `assets/` — Uploadable resources (PDF templates, email assets)",architecturePrinciples:"## Architecture Principles\n- YAML-first: 99% of configuration in spec/*.yaml, custom code is last resort\n- ECS pattern: entities (domain objects) + components (behavior/UI) + systems (SDK runtime)\n- Reactive state: immutable domain state flows through RxJS pipelines\n- Data binding: `$read` (read-only), `$write` (write-only), `$bind` (bidirectional) connect components to domain\n- memoEval: all component implementations must use memoEval for stable object references",keyPatterns:"## Key Patterns\n- Expressions = computed properties on entities (prefix: `$`), implemented per-entity in src/expressions/\n- Actions = named domain operations (`actions:` in YAML with `params` and `result` schemas), implemented in src/actions/, prepared through `actionSystem.prepareAction()` and exposed as assistant mutations through `assistant.actions`\n- Invariants = validation rules returning violations, static or dynamic\n- Transformers = auto-fixers maintaining consistency after state changes\n- Components defined in YAML with `$read`/`$bind` bindings, or custom in src/components/ using attachComponent builder\n- Webhooks = server-side finalization tasks (PDF, email, CSV, image rendering)\n- Filters = contextual component activation via navigationStates, viewStates, modes, selectedEntityIds",fileConventions:`## File Conventions
2
2
  - Components: PascalCase (.tsx)
3
3
  - Utilities: kebab-case (.ts)
4
4
  - Expressions: entity-name.ts
@@ -1,4 +1,4 @@
1
- import type { Expressions } from '../../parse-application-files/index.js';
1
+ import { type Expressions } from '#package/domain';
2
2
  import type { RuntimeLatestModelVersion } from '../runtime-spec/index.js';
3
3
  import type { AdminModelRuntime, ConfiguratorModelRuntime, SpecCodeMap } from '../runtime/index.js';
4
4
  /**
@@ -1,7 +1,6 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
- import { type $DomainEntity, $DomainEntityReflection, DomainBuilder, type DomainEntity, DomainEntityReflection, RawAliasReflection, SchemaReflection } from '#package/domain';
2
+ import { type $DomainEntity, $DomainEntityReflection, DomainBuilder, type DomainEntity, DomainEntityReflection, type Expressions, RawAliasReflection, SchemaReflection } from '#package/domain';
3
3
  import type { RuntimeReferenceStore } from '../../../caching/index.js';
4
- import type { Expressions } from '../../../parse-application-files/index.js';
5
4
  import type { RuntimeDataSchemas, RuntimeModelVersion, RuntimeResolvedVersions } from '../../runtime-spec/index.js';
6
5
  import type { SpecCodeMap } from '../spec-code/index.js';
7
6
  type AnyEntity = DomainEntity<string>;
@@ -1,7 +1,6 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
- import { type $DomainEntity, $DomainEntityReflection, DomainBuilder, type DomainEntity, DomainEntityReflection, RawAliasReflection, SchemaReflection } from '#package/domain';
2
+ import { type $DomainEntity, $DomainEntityReflection, DomainBuilder, type DomainEntity, DomainEntityReflection, type Expressions, RawAliasReflection, SchemaReflection } from '#package/domain';
3
3
  import type { RuntimeReferenceStore } from '../../../caching/index.js';
4
- import type { Expressions } from '../../../parse-application-files/index.js';
5
4
  import type { RuntimeDataSchemas, RuntimeModelVersion, RuntimeResolvedVersions } from '../../runtime-spec/index.js';
6
5
  import type { SpecCodeMap } from '../spec-code/index.js';
7
6
  type AnyEntity = DomainEntity<string>;
@@ -1,7 +1,6 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
- import type { AnyEntityReflections, DomainEntity, DomainEntityReflection } from '#package/domain';
2
+ import type { AnyEntityReflections, Defaults, DomainEntity, DomainEntityReflection, Invariants } from '#package/domain';
3
3
  import type { RuntimeReferenceStore } from '../../../caching/index.js';
4
- import type { Defaults, Invariants } from '../../../parse-application-files/index.js';
5
4
  import { type RecipeDefaults } from './recipe-defaults.js';
6
5
  import { type StaticViolations } from './static-violations.js';
7
6
  interface FactoryDataRuntimeFields {
@@ -1,4 +1,4 @@
1
- import type { Defaults } from '../../../parse-application-files/index.js';
1
+ import { type Defaults } from '#package/domain';
2
2
  /**
3
3
  * The default property values of each entity type, keyed by entity type: what
4
4
  * `phx.domain.createRecipe` puts into a new recipe before the caller's overrides. Alias entries are
@@ -1 +1 @@
1
- import{createMessageDescriptor as e,isEvalMarker as t,isMsgMarker as r}from"../../../core/index.js";let s=(a,i)=>{if(null===a||"object"!=typeof a)return a;if(r(a))return e(a);if(t(a))throw Error(`The default at ${i} is an $eval expression. Defaults are static values; the parser rejects $eval in them, so the spec given to the runtime was not produced by it. Parse the spec again and pass the result.`);return Array.isArray(a)?a.map((e,t)=>s(e,`${i}[${t}]`)):Object.fromEntries(Object.entries(a).map(([e,t])=>[e,s(t,`${i}.${e}`)]))};export const createRecipeDefaults=e=>Object.fromEntries(Object.entries(e.entries).map(([e,t])=>[e,Object.fromEntries(Object.entries(t).map(([t,r])=>[t,s(r,`${e}.${t}`)]))]));
1
+ import{createMessageDescriptor as e,isEvalMarker as t,isMsgMarker as r}from"#package/domain";let a=(s,i)=>{if(null===s||"object"!=typeof s)return s;if(r(s))return e(s);if(t(s))throw Error(`The default at ${i} is an $eval expression. Defaults are static values; the parser rejects $eval in them, so the spec given to the runtime was not produced by it. Parse the spec again and pass the result.`);return Array.isArray(s)?s.map((e,t)=>a(e,`${i}[${t}]`)):Object.fromEntries(Object.entries(s).map(([e,t])=>[e,a(t,`${i}.${e}`)]))};export const createRecipeDefaults=e=>Object.fromEntries(Object.entries(e.entries).map(([e,t])=>[e,Object.fromEntries(Object.entries(t).map(([t,r])=>[t,a(r,`${e}.${t}`)]))]));
@@ -1,5 +1,4 @@
1
- import type { Violation } from '#package/domain';
2
- import type { Invariants } from '../../../parse-application-files/index.js';
1
+ import { type Invariants, type Violation } from '#package/domain';
3
2
  /**
4
3
  * The violation each static invariant of a domain reports when its implementation returns `false`,
5
4
  * by entity type or alias and by invariant name. `phx.domain.implementCustomInvariants` closes over
@@ -1 +1 @@
1
- import{createMessageDescriptor as t}from"../../../core/index.js";export const createStaticViolations=e=>{let i={};for(let[o,r]of Object.entries(e.entries))for(let e of Object.values(r)){if("static"!==e.kind)continue;let r={type:String(e.violationType),severity:e.severity,message:"string"==typeof e.message?e.message:t(e.message),...void 0===e.controlViolationPriority?{}:{controlViolationPriority:e.controlViolationPriority}};i[o]={...i[o],[String(e.name)]:r}}return i};
1
+ import{createMessageDescriptor as t}from"#package/domain";export const createStaticViolations=e=>{let i={};for(let[o,r]of Object.entries(e.entries))for(let e of Object.values(r)){if("static"!==e.kind)continue;let r={type:String(e.violationType),severity:e.severity,message:"string"==typeof e.message?e.message:t(e.message),...void 0===e.controlViolationPriority?{}:{controlViolationPriority:e.controlViolationPriority}};i[o]={...i[o],[String(e.name)]:r}}return i};
@@ -1,2 +1,2 @@
1
- import { ApplicationInstance } from '../../core/index.js';
1
+ import { ApplicationInstance } from '#package/domain';
2
2
  export declare const generateRuntimeInstance: (applicationInstance: ApplicationInstance) => ApplicationInstance;
@@ -1 +1 @@
1
- import{ApplicationInstance as e}from"../../core/index.js";export const generateRuntimeInstance=n=>e(n.applicationVersion);
1
+ import{ApplicationInstance as e}from"#package/domain";export const generateRuntimeInstance=n=>e(n.applicationVersion);
@@ -1,7 +1,6 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
- import type { ActionDefinitions } from '#package/domain';
2
+ import type { ActionDefinitions, Actions } from '#package/domain';
3
3
  import type { RuntimeReferenceStore } from '../../../caching/index.js';
4
- import type { Actions } from '../../../parse-application-files/index.js';
5
4
  /**
6
5
  * The declared actions as the runtime spec slice holds them, with change tracking: the definitions
7
6
  * are rebuilt only when their declaration changes, so a hot reload of an unrelated section keeps
@@ -1,4 +1,4 @@
1
- import type { ComponentEntry, ComponentImplementation } from '../../../parse-application-files/spec/index.js';
1
+ import { type ComponentEntry, type ComponentImplementation } from '#package/domain';
2
2
  import type { AdminModelRuntime } from '../admin-runtime/admin-model-runtime.js';
3
3
  import type { ConfiguratorModelRuntime } from '../configurator-runtime/configurator-model-runtime.js';
4
4
  import { type SpecCodeMap } from '../spec-code/index.js';
@@ -1 +1 @@
1
- import{Branded as e}from"@salsita-ai/common/utils";import{DomainComponentOpticBuilder as t,adminSidebarComponent as a,attributeSelectionComponent as i,componentsByName as r,composedOfComponent as n,navigationPageComponent as o,navigationPanelListComponent as d,referenceComponent as c}from"#package/domain";import*as m from"#package/domain";import{FILTER_CRITERION_KEYS as s,isSdkCodeRef as l}from"../../../core/index.js";import{specCodeComponentKey as g,specCodeFilterId as p}from"../../runtime-spec/index.js";import{resolveSpecCode as R}from"../spec-code/index.js";let A=new Map([["reference",c],["composedOf",n],["adminSidebar",a],["attributeSelection",i],["navigationPage",o],["navigationPanelList",d]]),f={createAdminCustomPageRead:m.createAdminCustomPageRead,createAdminCustomSidebarRead:m.createAdminCustomSidebarRead,createAdminDataPageRead:m.createAdminDataPageRead,createAdminDataTableSidebarRead:m.createAdminDataTableSidebarRead,createAdminNavigationPanelRead:m.createAdminNavigationPanelRead,createAdminPresetCategoryPageRead:m.createAdminPresetCategoryPageRead,createAdminPresetCategorySelectionRead:m.createAdminPresetCategorySelectionRead,createAdminPresetCategorySelectionWrite:m.createAdminPresetCategorySelectionWrite,createAdminPresetCategorySidebarRead:m.createAdminPresetCategorySidebarRead,createAdminPresetListPageRead:m.createAdminPresetListPageRead,createAdminPresetSidebarRead:m.createAdminPresetSidebarRead,createAdminRecipeCollectionPageRead:m.createAdminRecipeCollectionPageRead,createAdminRecipeSidebarRead:m.createAdminRecipeSidebarRead},u=(e,t)=>{let a=f[e.sdkFunction]??m[e.sdkFunction];if("function"!=typeof a)throw Error(`SDK factory function "${e.sdkFunction}" not found. Make sure it is exported from the package.`);return a(...e.params.map(e=>{if(l(e)){let a=t.entities[e.$codeRef]??t.aliasReflections[e.$codeRef];if(!a)throw Error(`Reflection "${e.$codeRef}" not found in ModelRuntime. This is a bug — the target was validated at parse time.`);return a}return e}))};export const buildSdkOptic=(a,i,n,o,d)=>{let c=t.from(n),m=r.get(a.componentName)??A.get(a.componentName);if(!m)throw Error(`SDK component "${a.componentName}" not found. This is a bug — the component was validated at parse time.`);let l=c.withComponent(m,a.instanceName,!0),f=a.isAlias?l.withAlias(String(a.typeOrAlias)):l.withEntity(String(a.typeOrAlias)),P=g(String(a.typeOrAlias),String(a.instanceName),a.componentName);for(let[e,t]of i.filters.items.entries()){if("root"===t.kind){let e=t.target,a=t=>t[e];f=f.withFilter(a);continue}let a={};for(let i of s){let r=t[i];void 0!==r&&("dynamic"===r.kind?a[i]=e=>e[r.target]:"eval"===r.kind?a[i]=R(d,p(P,e,i,r.code),r.code):a[i]=r.value)}f=f.withGradualFilter(a)}let S=u(i.readFactory,o),y=u(i.writeFactory,o),b=f.attach(S,y);return e({typeOrAlias:String(a.typeOrAlias),componentName:a.componentName,instanceName:String(a.instanceName),optic:b})};
1
+ import{Branded as e}from"@salsita-ai/common/utils";import{DomainComponentOpticBuilder as t,FILTER_CRITERION_KEYS as a,adminSidebarComponent as i,attributeSelectionComponent as r,componentsByName as n,composedOfComponent as o,isSdkCodeRef as d,navigationPageComponent as c,navigationPanelListComponent as m,referenceComponent as s}from"#package/domain";import*as l from"#package/domain";import{specCodeComponentKey as g,specCodeFilterId as p}from"../../runtime-spec/index.js";import{resolveSpecCode as R}from"../spec-code/index.js";let A=new Map([["reference",s],["composedOf",o],["adminSidebar",i],["attributeSelection",r],["navigationPage",c],["navigationPanelList",m]]),f={createAdminCustomPageRead:l.createAdminCustomPageRead,createAdminCustomSidebarRead:l.createAdminCustomSidebarRead,createAdminDataPageRead:l.createAdminDataPageRead,createAdminDataTableSidebarRead:l.createAdminDataTableSidebarRead,createAdminNavigationPanelRead:l.createAdminNavigationPanelRead,createAdminPresetCategoryPageRead:l.createAdminPresetCategoryPageRead,createAdminPresetCategorySelectionRead:l.createAdminPresetCategorySelectionRead,createAdminPresetCategorySelectionWrite:l.createAdminPresetCategorySelectionWrite,createAdminPresetCategorySidebarRead:l.createAdminPresetCategorySidebarRead,createAdminPresetListPageRead:l.createAdminPresetListPageRead,createAdminPresetSidebarRead:l.createAdminPresetSidebarRead,createAdminRecipeCollectionPageRead:l.createAdminRecipeCollectionPageRead,createAdminRecipeSidebarRead:l.createAdminRecipeSidebarRead},u=(e,t)=>{let a=f[e.sdkFunction]??l[e.sdkFunction];if("function"!=typeof a)throw Error(`SDK factory function "${e.sdkFunction}" not found. Make sure it is exported from the package.`);return a(...e.params.map(e=>{if(d(e)){let a=t.entities[e.$codeRef]??t.aliasReflections[e.$codeRef];if(!a)throw Error(`Reflection "${e.$codeRef}" not found in ModelRuntime. This is a bug — the target was validated at parse time.`);return a}return e}))};export const buildSdkOptic=(i,r,o,d,c)=>{let m=t.from(o),s=n.get(i.componentName)??A.get(i.componentName);if(!s)throw Error(`SDK component "${i.componentName}" not found. This is a bug — the component was validated at parse time.`);let l=m.withComponent(s,i.instanceName,!0),f=i.isAlias?l.withAlias(String(i.typeOrAlias)):l.withEntity(String(i.typeOrAlias)),P=g(String(i.typeOrAlias),String(i.instanceName),i.componentName);for(let[e,t]of r.filters.items.entries()){if("root"===t.kind){let e=t.target,a=t=>t[e];f=f.withFilter(a);continue}let i={};for(let r of a){let a=t[r];void 0!==a&&("dynamic"===a.kind?i[r]=e=>e[a.target]:"eval"===a.kind?i[r]=R(c,p(P,e,r,a.code),a.code):i[r]=a.value)}f=f.withGradualFilter(i)}let S=u(r.readFactory,d),y=u(r.writeFactory,d),b=f.attach(S,y);return e({typeOrAlias:String(i.typeOrAlias),componentName:i.componentName,instanceName:String(i.instanceName),optic:b})};
@@ -1,4 +1,4 @@
1
- import { type ComponentEntry, type ComponentImplementation } from '../../../parse-application-files/spec/index.js';
1
+ import { type ComponentEntry, type ComponentImplementation } from '#package/domain';
2
2
  import type { AdminModelRuntime } from '../admin-runtime/admin-model-runtime.js';
3
3
  import type { ConfiguratorModelRuntime } from '../configurator-runtime/configurator-model-runtime.js';
4
4
  import { type SpecCodeMap } from '../spec-code/index.js';
@@ -1,7 +1,6 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
- import { type DomainComponentOptic, type SystemComponentTypeConstraint } from '#package/domain';
2
+ import { type ComponentEntry, type DomainComponentOptic, type SystemComponentTypeConstraint } from '#package/domain';
3
3
  import type { RuntimeReferenceStore } from '../../../caching/index.js';
4
- import type { ComponentEntry } from '../../../parse-application-files/spec/index.js';
5
4
  import type { AdminModelRuntime } from '../admin-runtime/admin-model-runtime.js';
6
5
  import type { ConfiguratorModelRuntime } from '../configurator-runtime/configurator-model-runtime.js';
7
6
  import type { SpecCodeMap } from '../spec-code/index.js';
@@ -1,7 +1,6 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
- import type { DomainEntity, Expression as DomainExpression, Invariant as DomainInvariant, ImplementationErrorCollector, ProjectModule } from '#package/domain';
2
+ import { type DomainEntity, type Expression as DomainExpression, type Invariant as DomainInvariant, type Expressions, type ImplementationErrorCollector, type ProjectModule } from '#package/domain';
3
3
  import type { RuntimeReferenceStore } from '../../../caching/index.js';
4
- import type { Expressions } from '../../../parse-application-files/index.js';
5
4
  import { type RuntimeModelVersion } from '../../runtime-spec/index.js';
6
5
  import type { SpecCodeMap } from '../spec-code/index.js';
7
6
  type RuntimeData = Record<string, unknown>;
@@ -1 +1 @@
1
- import e from"lodash-es/isEqual.js";import{Branded as t}from"@salsita-ai/common/utils";import{ImplementationError as i,createRelationFactory as n,mergeExpressionModules as a}from"#package/domain";import{canonicalEnhancedJsonValueKey as r,isSdkExpressionImplementation as o}from"../../../core/index.js";import{specCodeExpressionKey as l}from"../../runtime-spec/index.js";import{generateMemoEvalPlanRuntime as s}from"./generate-memo-eval-plan-runtime.js";let p={},m=["0-1","1-1","0-N","1-N"],d={relation:(e,t)=>{let i=t[0];if(!("object"==typeof i&&null!==i&&"kind"in i&&"target"in i&&"string"==typeof i.target&&"cardinality"in i&&m.includes(i.cardinality)&&("allOfType"===i.kind||("direct"===i.kind||"indirect"===i.kind)&&"field"in i&&"string"==typeof i.field)))throw Error("Cannot create the relation expression because its parameter is not a relation declaration. The application spec is inconsistent; rebuild it from a valid relations declaration.");return n(e.aliasMap)(i)},violations:(e,t)=>{let i=t[0];if("object"!=typeof i||null===i||!("entityType"in i)||"string"!=typeof i.entityType)throw Error("Cannot create the violations expression because its entityType parameter is missing. The application spec is inconsistent; rebuild it from a valid invariants declaration.");let n=i.entityType,a=Object.entries(e.invariantImplementations).flatMap(([t,i])=>{let a=e.aliasMap[t];return t===n||a?.includes(n)?i:[]});return{origin:{name:"$violations",typeOrAlias:n},evaluate:(e,t,i)=>a.flatMap(n=>n.evaluate(e,t,i)),meta:{}}}},f=e=>{let t=s(e.plan,l(e.entityOrAlias,e.name),e.code);return{origin:{name:e.name,typeOrAlias:e.entityOrAlias},evaluate:(e,i,n)=>t(n.domain.get$Entity(e,i),i,n),meta:{}}},u=e=>({...(0,d[e.kind])({aliasMap:e.aliasMap,invariantImplementations:e.invariantImplementations},e.params),origin:{name:e.name,typeOrAlias:e.entityOrAlias}});export const ExpressionRuntime=(n,l,s,m,d=p,c,g,y={})=>{let v={};for(let[e,t]of n.latestModel.aliases)v[String(e)]=t.map(String);let x={...y};for(let[e,t]of Object.entries(a(s,v,g,((e,t,i)=>{let n=new Map,a=(e,t)=>{n.set(e,(n.get(e)??new Set).add(t))};for(let[i,n]of e.expressions.expressions)for(let[e,r]of n)if("user"!==r.implementation.kind)for(let n of t[String(i)]??[String(i)])a(n,String(e));for(let[e,t]of Object.entries(i))for(let i of Object.keys(t))a(e,i);return n})(n,v,y))))x[e]={...x[e],...t};let S=l.createBuilder(`${m}/sdk`,{build:u,getKey:e=>`sdk::${e.entityOrAlias}::${e.name}`,compare:(t,i)=>t.kind===i.kind&&e(t.params,i.params)&&e(t.aliasMap,i.aliasMap)&&("violations"!==i.kind||t.invariantImplementations===i.invariantImplementations)}),h=l.createBuilder(`${m}/user`,{build:e=>e.impl,getKey:e=>`user::${e.entityType}::${e.name}`,compare:(e,t)=>{let i,n;return(i=e.impl)===(n=t.impl)||i.evaluate===n.evaluate&&i.meta===n.meta&&i.origin.name===n.origin.name&&i.origin.typeOrAlias===n.origin.typeOrAlias}}),O=l.createBuilder(`${m}/value`,{build:f,getKey:e=>`value::${e.entityOrAlias}::${e.name}`,compare:(e,t)=>e.valueKey===t.valueKey&&e.code===t.code}),b={},k=!1,$=new Set,M=new Set,j=new Set;for(let[e,t]of n.expressions.expressions)for(let[,i]of t){let t=v[String(e)]??[String(e)];if(o(i.implementation)){let n={entityOrAlias:String(e),name:String(i.name),kind:i.implementation.kind,params:i.implementation.params,aliasMap:v,invariantImplementations:d},a=S.build(n);for(let e of(a.changed&&(k=!0),$.add(S.getKey(n)),t))b[e]||(b[e]={}),b[e][String(i.name)]=a.output;continue}if("value"===i.implementation.kind){let n=i.implementation.value,a={entityOrAlias:String(e),name:String(i.name),valueKey:r(n),plan:i.implementation.plan,code:c},o=O.build(a);for(let e of(o.changed&&(k=!0),j.add(O.getKey(a)),t))b[e]||(b[e]={}),b[e][String(i.name)]=o.output;continue}}for(let[e,t]of Object.entries(x))for(let[i,n]of Object.entries(t)){let t={entityType:e,name:i,impl:n},a=h.build(t);a.changed&&(k=!0),M.add(h.getKey(t)),b[e]||(b[e]={}),b[e][i]=a.output}S.cleanup($)&&(k=!0),h.cleanup(M)&&(k=!0),O.cleanup(j)&&(k=!0);let A=[];for(let[e,t]of n.expressions.entityExpressions)for(let i of t.shapeGroups){let t=n.expressions.expressions.get(i);if(t)for(let[i]of t)b[String(e)]?.[String(i)]||A.push({entityType:String(e),exprName:String(i)})}return A.length>0?(A.forEach(e=>g.add(new i({code:"MISSING_IMPLEMENTATION",origin:null,problem:`Missing implementation of expression ${e.entityType}.${e.exprName}`,fix:"The spec declares it without a value of its own ($eval, $msg or a read), so a project file implements it: a default export of phx.domain.implementCustomExpressions({ ... }) in src/expressions/, or of phx.domain.admin.implementCustomExpressions({ ... }) in src/admin/expressions/ for an admin entity type. Implement it, or remove the declaration from the spec."}))),{ok:!1,missing:A}):{ok:!0,runtime:t({merged:b,changed:k})}};
1
+ import e from"lodash-es/isEqual.js";import{Branded as t}from"@salsita-ai/common/utils";import{ImplementationError as i,canonicalEnhancedJsonValueKey as n,createRelationFactory as a,isSdkExpressionImplementation as r,mergeExpressionModules as o}from"#package/domain";import{specCodeExpressionKey as l}from"../../runtime-spec/index.js";import{generateMemoEvalPlanRuntime as s}from"./generate-memo-eval-plan-runtime.js";let p={},m=["0-1","1-1","0-N","1-N"],d={relation:(e,t)=>{let i=t[0];if(!("object"==typeof i&&null!==i&&"kind"in i&&"target"in i&&"string"==typeof i.target&&"cardinality"in i&&m.includes(i.cardinality)&&("allOfType"===i.kind||("direct"===i.kind||"indirect"===i.kind)&&"field"in i&&"string"==typeof i.field)))throw Error("Cannot create the relation expression because its parameter is not a relation declaration. The application spec is inconsistent; rebuild it from a valid relations declaration.");return a(e.aliasMap)(i)},violations:(e,t)=>{let i=t[0];if("object"!=typeof i||null===i||!("entityType"in i)||"string"!=typeof i.entityType)throw Error("Cannot create the violations expression because its entityType parameter is missing. The application spec is inconsistent; rebuild it from a valid invariants declaration.");let n=i.entityType,a=Object.entries(e.invariantImplementations).flatMap(([t,i])=>{let a=e.aliasMap[t];return t===n||a?.includes(n)?i:[]});return{origin:{name:"$violations",typeOrAlias:n},evaluate:(e,t,i)=>a.flatMap(n=>n.evaluate(e,t,i)),meta:{}}}},f=e=>{let t=s(e.plan,l(e.entityOrAlias,e.name),e.code);return{origin:{name:e.name,typeOrAlias:e.entityOrAlias},evaluate:(e,i,n)=>t(n.domain.get$Entity(e,i),i,n),meta:{}}},u=e=>({...(0,d[e.kind])({aliasMap:e.aliasMap,invariantImplementations:e.invariantImplementations},e.params),origin:{name:e.name,typeOrAlias:e.entityOrAlias}});export const ExpressionRuntime=(a,l,s,m,d=p,c,g,y={})=>{let v={};for(let[e,t]of a.latestModel.aliases)v[String(e)]=t.map(String);let x={...y};for(let[e,t]of Object.entries(o(s,v,g,((e,t,i)=>{let n=new Map,a=(e,t)=>{n.set(e,(n.get(e)??new Set).add(t))};for(let[i,n]of e.expressions.expressions)for(let[e,r]of n)if("user"!==r.implementation.kind)for(let n of t[String(i)]??[String(i)])a(n,String(e));for(let[e,t]of Object.entries(i))for(let i of Object.keys(t))a(e,i);return n})(a,v,y))))x[e]={...x[e],...t};let S=l.createBuilder(`${m}/sdk`,{build:u,getKey:e=>`sdk::${e.entityOrAlias}::${e.name}`,compare:(t,i)=>t.kind===i.kind&&e(t.params,i.params)&&e(t.aliasMap,i.aliasMap)&&("violations"!==i.kind||t.invariantImplementations===i.invariantImplementations)}),h=l.createBuilder(`${m}/user`,{build:e=>e.impl,getKey:e=>`user::${e.entityType}::${e.name}`,compare:(e,t)=>{let i,n;return(i=e.impl)===(n=t.impl)||i.evaluate===n.evaluate&&i.meta===n.meta&&i.origin.name===n.origin.name&&i.origin.typeOrAlias===n.origin.typeOrAlias}}),O=l.createBuilder(`${m}/value`,{build:f,getKey:e=>`value::${e.entityOrAlias}::${e.name}`,compare:(e,t)=>e.valueKey===t.valueKey&&e.code===t.code}),b={},k=!1,$=new Set,M=new Set,A=new Set;for(let[e,t]of a.expressions.expressions)for(let[,i]of t){let t=v[String(e)]??[String(e)];if(r(i.implementation)){let n={entityOrAlias:String(e),name:String(i.name),kind:i.implementation.kind,params:i.implementation.params,aliasMap:v,invariantImplementations:d},a=S.build(n);for(let e of(a.changed&&(k=!0),$.add(S.getKey(n)),t))b[e]||(b[e]={}),b[e][String(i.name)]=a.output;continue}if("value"===i.implementation.kind){let a=i.implementation.value,r={entityOrAlias:String(e),name:String(i.name),valueKey:n(a),plan:i.implementation.plan,code:c},o=O.build(r);for(let e of(o.changed&&(k=!0),A.add(O.getKey(r)),t))b[e]||(b[e]={}),b[e][String(i.name)]=o.output;continue}}for(let[e,t]of Object.entries(x))for(let[i,n]of Object.entries(t)){let t={entityType:e,name:i,impl:n},a=h.build(t);a.changed&&(k=!0),M.add(h.getKey(t)),b[e]||(b[e]={}),b[e][i]=a.output}S.cleanup($)&&(k=!0),h.cleanup(M)&&(k=!0),O.cleanup(A)&&(k=!0);let T=[];for(let[e,t]of a.expressions.entityExpressions)for(let i of t.shapeGroups){let t=a.expressions.expressions.get(i);if(t)for(let[i]of t)b[String(e)]?.[String(i)]||T.push({entityType:String(e),exprName:String(i)})}return T.length>0?(T.forEach(e=>g.add(new i({code:"MISSING_IMPLEMENTATION",origin:null,problem:`Missing implementation of expression ${e.entityType}.${e.exprName}`,fix:"The spec declares it without a value of its own ($eval, $msg or a read), so a project file implements it: a default export of phx.domain.implementCustomExpressions({ ... }) in src/expressions/, or of phx.domain.admin.implementCustomExpressions({ ... }) in src/admin/expressions/ for an admin entity type. Implement it, or remove the declaration from the spec."}))),{ok:!1,missing:T}):{ok:!0,runtime:t({merged:b,changed:k})}};
@@ -1,5 +1,4 @@
1
- import type { SelfAccessor } from '../../../core/index.js';
2
- import type { MemoEvalPlan } from '../../../parse-application-files/spec/index.js';
1
+ import { type MemoEvalPlan, type SelfAccessor } from '#package/domain';
3
2
  import { type SpecCodeMap } from '../spec-code/index.js';
4
3
  /**
5
4
  * Runtime counterpart to
@@ -1 +1 @@
1
- import{memoEval as e}from"#package/domain";import{createMessageDescriptor as t}from"../../../core/index.js";import{specCodeEvalIds as r}from"../../runtime-spec/index.js";import{resolveSpecCode as a}from"../spec-code/index.js";let n=(e,r)=>{if("literal"===e.kind)return e.value;if("slot"===e.kind)return r[e.depIndex];if("msg"===e.kind)return t(e.marker);if("array"===e.kind)return e.items.map(e=>n(e,r));let a={};for(let[t,l]of e.entries)a[t]=n(l,r);return a};export const generateMemoEvalPlanRuntime=(t,l,i)=>{if(0===t.deps.length){let e=n(t.template,[]);return()=>e}let o=r(t,l),s=t.deps.map((e,t)=>{let r=o[t];return"eval"===e.kind&&void 0!==r?a(i,r,e.code):void 0});return e(e=>t.deps.map((t,r)=>"eval"===t.kind?s[r](e):Reflect.get(e,t.target)),(...e)=>n(t.template,e))};export const evaluateStaticMemoEvalPlan=(e,t,l)=>{if(e.usesSelf)throw Error("Cannot evaluate a plan that uses self as a static value. Filter self-dependent plans before evaluating constants.");let i=r(e,t),o=e.deps.map((e,t)=>{if("read"===e.kind)throw Error(`Cannot evaluate the self-dependent read "${e.target}" as a static value. Filter self-dependent plans before evaluating constants.`);return a(l,i[t],e.code)()});return n(e.template,o)};
1
+ import{createMessageDescriptor as e,memoEval as t}from"#package/domain";import{specCodeEvalIds as a}from"../../runtime-spec/index.js";import{resolveSpecCode as r}from"../spec-code/index.js";let n=(t,a)=>{if("literal"===t.kind)return t.value;if("slot"===t.kind)return a[t.depIndex];if("msg"===t.kind)return e(t.marker);if("array"===t.kind)return t.items.map(e=>n(e,a));let r={};for(let[e,l]of t.entries)r[e]=n(l,a);return r};export const generateMemoEvalPlanRuntime=(e,l,i)=>{if(0===e.deps.length){let t=n(e.template,[]);return()=>t}let s=a(e,l),o=e.deps.map((e,t)=>{let a=s[t];return"eval"===e.kind&&void 0!==a?r(i,a,e.code):void 0});return t(t=>e.deps.map((e,a)=>"eval"===e.kind?o[a](t):Reflect.get(t,e.target)),(...t)=>n(e.template,t))};export const evaluateStaticMemoEvalPlan=(e,t,l)=>{if(e.usesSelf)throw Error("Cannot evaluate a plan that uses self as a static value. Filter self-dependent plans before evaluating constants.");let i=a(e,t),s=e.deps.map((e,t)=>{if("read"===e.kind)throw Error(`Cannot evaluate the self-dependent read "${e.target}" as a static value. Filter self-dependent plans before evaluating constants.`);return r(l,i[t],e.code)()});return n(e.template,s)};
@@ -1,7 +1,6 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
- import type { DomainEntity, ProductPreset } from '#package/domain';
2
+ import type { DomainEntity, ProductPreset, SpecPreset } from '#package/domain';
3
3
  import type { RuntimeReferenceStore } from '../../../caching/index.js';
4
- import type { Preset } from '../../../parse-application-files/index.js';
5
4
  type AnyProductPreset = ProductPreset<DomainEntity<string>, DomainEntity<string>>;
6
5
  /** Collection of runtime presets with change tracking. */
7
6
  export type PresetRuntime = Branded<'PresetRuntime', {
@@ -10,7 +9,7 @@ export type PresetRuntime = Branded<'PresetRuntime', {
10
9
  }>;
11
10
  interface PresetRuntimeProps {
12
11
  readonly referenceScope: string;
13
- readonly presets: readonly Preset[];
12
+ readonly presets: readonly SpecPreset[];
14
13
  }
15
14
  /**
16
15
  * Builds preset runtime objects with per-item reference stability.
@@ -1,4 +1,4 @@
1
- import type { ExpressionName, Expressions, MemoEvalPlan } from '../../../parse-application-files/index.js';
1
+ import type { ExpressionName, Expressions, MemoEvalPlan } from '#package/domain';
2
2
  import type { SpecCodeMap } from '../spec-code/index.js';
3
3
  /** The self-free `constants:` plans declared on one entity or alias, or `undefined` when it has none. */
4
4
  export declare const findReflectionConstants: (expressions: Expressions, entityOrAlias: string) => ReadonlyMap<ExpressionName, MemoEvalPlan> | undefined;
@@ -1,4 +1,4 @@
1
- import type { SelfAccessor } from '../../../core/index.js';
1
+ import type { SelfAccessor } from '#package/domain';
2
2
  import type { SpecCodeId } from '../../runtime-spec/index.js';
3
3
  import type { SpecCodeMap } from './spec-code-module.js';
4
4
  /**
@@ -1,82 +1,145 @@
1
- import type { AdminSpec, ApplicationSpec, AssistantSpec, ConfiguratorSpec, DataSchemaEntry, DataSchemas, DataSpec, EntitySchema, Infra, ModelVersion, ResolvedModelVersion, ResolvedVersions, Shape } from '../../parse-application-files/index.js';
1
+ import type { Acl, Actions, AdminPages, AdminStates, AppMetadata, AssistantResolvedManifest, Chunks, CommonTypes, Components, ConfiguratorStates, Defaults, EntityOrAliasName, EntityTypeName, EntityTypes, Expressions, Invariants, JsonSchema, ModelVersionKey, ParsedDataSpecEntries, Presets, ResourceEntry, SpecAliases, SpecResourcesConfig, SpecTransformers, Theme, Ui } from '#package/domain';
2
2
  /**
3
3
  * The part of a parsed entity schema the runtime reads: the entity type and the schema of its
4
4
  * shape, from which it builds the entity's reflection. The full schema with `id` and `type` is
5
5
  * only registered with a deployment, and the compiled shape validators only check presets and
6
6
  * defaults while parsing.
7
7
  */
8
- export type RuntimeEntitySchema = Pick<EntitySchema, 'entityType' | 'shapeSchema'>;
8
+ export interface RuntimeEntitySchema {
9
+ readonly entityType: EntityTypeName;
10
+ readonly shapeSchema: JsonSchema;
11
+ }
9
12
  /**
10
13
  * The part of a parsed model version the runtime reads: the entity types, the aliases, the common
11
14
  * types and the schema of every entity's shape. The shapes and the resolved shapes only serve the
12
15
  * parser and the type generator, except the runtime schemas of the latest version's shapes (see
13
16
  * `RuntimeLatestModelVersion`).
14
17
  */
15
- export type RuntimeModelVersion = Pick<ModelVersion, 'versionKey' | 'entityTypes' | 'rootEntityTypes' | 'aliases' | 'commonTypes'> & {
18
+ export interface RuntimeModelVersion {
19
+ readonly versionKey: ModelVersionKey;
20
+ readonly entityTypes: EntityTypes;
21
+ /** Entity types allowed as preset root — members of the RootEntity alias, or all entity types if no RootEntity alias. */
22
+ readonly rootEntityTypes: readonly EntityTypeName[];
23
+ readonly aliases: SpecAliases;
24
+ readonly commonTypes: CommonTypes;
16
25
  readonly entitySchemas: readonly RuntimeEntitySchema[];
17
- };
26
+ }
18
27
  /**
19
28
  * The latest model version of a domain as the runtime reads it: a model version plus the runtime
20
29
  * schema of every shape, which `phx.domain.model` reflects as `<Name>Shape`.
21
30
  */
22
- export type RuntimeLatestModelVersion = RuntimeModelVersion & {
23
- readonly shapes: ReadonlyMap<Shape['name'], RuntimeShapeSchema>;
24
- };
31
+ export interface RuntimeLatestModelVersion extends RuntimeModelVersion {
32
+ readonly shapes: ReadonlyMap<EntityOrAliasName, RuntimeShapeSchema>;
33
+ }
25
34
  /** The part of a parsed shape the runtime reads: its name and its runtime JSON schema. */
26
- export type RuntimeShapeSchema = Pick<Shape, 'name' | 'runtimeSchema'>;
27
- /** One model version of a domain as the runtime reads it, with the migration file that leads to it. */
28
- export type RuntimeResolvedModelVersion = Omit<ResolvedModelVersion, 'modelVersion'> & {
35
+ export interface RuntimeShapeSchema {
36
+ readonly name: EntityOrAliasName;
37
+ readonly runtimeSchema: JsonSchema;
38
+ }
39
+ /**
40
+ * One model version of a domain as the runtime reads it, with the migration file that leads to it.
41
+ * `version` is the integer version number (1, 2, 3, …), `key` is always `v{N}`, never `latest`,
42
+ * `isLatest` marks the version of the `latest` model key, and `migrationFile` is the path of the
43
+ * migration file, present from v2 on.
44
+ */
45
+ export interface RuntimeResolvedModelVersion {
46
+ readonly version: number;
47
+ readonly key: string;
48
+ readonly isLatest: boolean;
29
49
  readonly modelVersion: RuntimeModelVersion;
30
- };
31
- /** Every model version of a domain as the runtime reads it; it builds the domain's migrations from them. */
32
- export type RuntimeResolvedVersions = Pick<ResolvedVersions, 'latestVersion'> & {
50
+ readonly migrationFile: string | undefined;
51
+ }
52
+ /**
53
+ * Every model version of a domain as the runtime reads it; it builds the domain's migrations from
54
+ * them. `latestVersion` is the integer of the `latest` key, and `versionedModels` is sorted
55
+ * ascending by version number.
56
+ */
57
+ export interface RuntimeResolvedVersions {
58
+ readonly latestVersion: number;
33
59
  readonly versionedModels: readonly RuntimeResolvedModelVersion[];
34
- };
60
+ }
35
61
  /** The model of a domain as the runtime reads it: the latest version and every earlier one. */
36
62
  interface RuntimeDomainModel {
37
63
  readonly latestModel: RuntimeLatestModelVersion;
38
64
  readonly resolvedVersions: RuntimeResolvedVersions;
39
65
  }
40
66
  /** The part of a parsed data schema the runtime reads: the JSON schema it validates the data with. */
41
- export type RuntimeDataSchemaEntry = Pick<DataSchemaEntry, 'runtimeSchema'>;
67
+ export interface RuntimeDataSchemaEntry {
68
+ readonly runtimeSchema: JsonSchema;
69
+ }
42
70
  /**
43
71
  * The data schemas as the runtime reads them: the JSON schema of each kind of data and the hash of
44
72
  * the published data. The enhanced schemas, with Phoenix references, only serve the type generator.
45
73
  */
46
- export type RuntimeDataSchemas = Pick<DataSchemas, 'publishedDataHash'> & {
47
- readonly [KIND in Exclude<keyof DataSchemas, 'publishedDataHash' | 'backendData'>]: RuntimeDataSchemaEntry;
48
- } & {
74
+ export interface RuntimeDataSchemas {
75
+ readonly publishedData: RuntimeDataSchemaEntry;
76
+ readonly publishedDataHash: string;
77
+ readonly sessionData: RuntimeDataSchemaEntry;
78
+ readonly frontendData: RuntimeDataSchemaEntry;
49
79
  readonly backendData: RuntimeDataSchemaEntry | undefined;
50
- };
80
+ readonly finalizeData: RuntimeDataSchemaEntry;
81
+ readonly prefetchedFinalizeData: RuntimeDataSchemaEntry;
82
+ readonly finalizeResult: RuntimeDataSchemaEntry;
83
+ readonly callbackData: RuntimeDataSchemaEntry;
84
+ }
51
85
  /**
52
86
  * The assistant as the runtime reads it: its resolved manifest. The parsed assistant schema the
53
87
  * manifest is resolved from only serves the parser.
54
88
  */
55
- export type RuntimeAssistantSpec = Pick<NonNullable<AssistantSpec>, 'resolved'> | null;
89
+ export type RuntimeAssistantSpec = {
90
+ readonly resolved: AssistantResolvedManifest;
91
+ } | null;
56
92
  /**
57
93
  * The data spec as the runtime reads it: the data entries and their chunks. The data entries and
58
94
  * admin data pages the parser derives from them only serve the admin spec and the type generator.
59
95
  */
60
- export type RuntimeDataSpec = Pick<DataSpec, 'entries' | 'chunks'>;
96
+ export interface RuntimeDataSpec {
97
+ /** Validated entries grouped by their source `$data` subsection for generated SDK config. */
98
+ readonly entries: ParsedDataSpecEntries;
99
+ /** Validated published-data chunks, including the auto-injected `system` chunk when needed. */
100
+ readonly chunks: Chunks;
101
+ }
61
102
  /**
62
103
  * The configurator part of the runtime spec. It leaves out the configuration schema and its
63
104
  * version, which only a deployment registers, and the assistant's server settings (instructions
64
105
  * and AI settings), which must never reach the browser of a customer.
65
106
  */
66
- export type RuntimeConfiguratorSpec = Pick<ConfiguratorSpec, 'components' | 'presets' | 'expressions' | 'actions' | 'invariants' | 'defaults' | 'states' | 'theme' | 'ui' | 'transformers'> & RuntimeDomainModel & {
107
+ export interface RuntimeConfiguratorSpec extends RuntimeDomainModel {
108
+ readonly components: Components;
109
+ readonly presets: Presets;
110
+ readonly expressions: Expressions;
111
+ readonly actions: Actions;
112
+ readonly invariants: Invariants;
113
+ readonly defaults: Defaults;
114
+ readonly states: ConfiguratorStates;
115
+ readonly theme: Theme;
116
+ readonly ui: Ui;
117
+ readonly transformers: SpecTransformers;
67
118
  readonly dataSchemas: RuntimeDataSchemas;
68
119
  readonly assistant: RuntimeAssistantSpec;
69
- };
120
+ }
70
121
  /**
71
122
  * The admin part of the runtime spec. It leaves out the configuration schema and its version, which
72
123
  * only a deployment registers.
73
124
  */
74
- export type RuntimeAdminSpec = Pick<AdminSpec, 'components' | 'presets' | 'expressions' | 'invariants' | 'defaults' | 'states' | 'adminPages'> & RuntimeDomainModel;
125
+ export interface RuntimeAdminSpec extends RuntimeDomainModel {
126
+ readonly components: Components;
127
+ readonly presets: Presets;
128
+ readonly expressions: Expressions;
129
+ readonly invariants: Invariants;
130
+ readonly defaults: Defaults;
131
+ readonly states: AdminStates;
132
+ readonly adminPages: AdminPages;
133
+ }
75
134
  /**
76
135
  * The infrastructure settings the runtime reads: access control and resources. The environment
77
136
  * variable declarations only drive the generated environment readers.
78
137
  */
79
- export type RuntimeInfra = Pick<Infra, 'acl' | 'resources' | 'resourcesConfig'>;
138
+ export interface RuntimeInfra {
139
+ readonly acl: Acl;
140
+ readonly resources: readonly ResourceEntry[] | undefined;
141
+ readonly resourcesConfig: SpecResourcesConfig | undefined;
142
+ }
80
143
  /**
81
144
  * The parsed application spec as the runtime reads it: what `ApplicationRuntime` builds the
82
145
  * configurator and admin runtimes from, and the sections an application needs besides its domains
@@ -84,11 +147,12 @@ export type RuntimeInfra = Pick<Infra, 'acl' | 'resources' | 'resourcesConfig'>;
84
147
  * schemas, admin pages). `phoenix sync` and `phoenix build` write it to
85
148
  * `.phoenix/application-spec.json` with `encodeRuntimeSpec`.
86
149
  *
87
- * It is derived from the parsed types, so a section the runtime reads keeps the parser's type. It
88
- * leaves out what only the parser, the type generator or a deployment use, and holds plain data,
89
- * Maps and Sets only, so it can be encoded as JSON.
150
+ * Its sections are the spec data types of `domain`, the types the parser produces, so a parsed
151
+ * `ApplicationSpec` is assignable to it. It leaves out what only the parser, the type generator or
152
+ * a deployment use, and holds plain data, Maps and Sets only, so it can be encoded as JSON.
90
153
  */
91
- export interface RuntimeSpec extends Pick<ApplicationSpec, 'appMetadata'> {
154
+ export interface RuntimeSpec {
155
+ readonly appMetadata: AppMetadata;
92
156
  readonly dataSpec: RuntimeDataSpec;
93
157
  readonly configurator: RuntimeConfiguratorSpec;
94
158
  readonly admin: RuntimeAdminSpec;
@@ -97,7 +161,8 @@ export interface RuntimeSpec extends Pick<ApplicationSpec, 'appMetadata'> {
97
161
  /**
98
162
  * Takes from a parsed application spec the part the runtime reads. It reuses the sections it keeps
99
163
  * whole, and builds trimmed copies of the model versions, data schemas, assistant and data spec
100
- * without what the runtime does not read.
164
+ * without what the runtime does not read. It takes any `RuntimeSpec`, which a parsed
165
+ * `ApplicationSpec` is, and copies only what the type declares.
101
166
  */
102
- export declare const toRuntimeSpec: (spec: ApplicationSpec) => RuntimeSpec;
167
+ export declare const toRuntimeSpec: (spec: RuntimeSpec) => RuntimeSpec;
103
168
  export {};