@salsita-ai/sdk 0.50.0-develop.f101f4c3c9 → 0.50.0-develop.f16492b14e

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 (872) hide show
  1. package/README.md +5 -1
  2. package/dist/application/index.d.ts +1 -0
  3. package/dist/application/index.js +1 -1
  4. package/dist/application/mount-application.d.ts +1 -1
  5. package/dist/application/mount-application.js +1 -1
  6. package/dist/application/mount-configurator.d.ts +19 -0
  7. package/dist/application/mount-configurator.js +1 -0
  8. package/dist/application/mounted-application-runtime.d.ts +4 -0
  9. package/dist/application/mounted-application-runtime.js +1 -0
  10. package/dist/application/register-web-component.d.ts +2 -0
  11. package/dist/application/register-web-component.js +1 -0
  12. package/dist/application-spec/core/enhanced-json-value.d.ts +2 -31
  13. package/dist/application-spec/core/enhanced-json-value.js +1 -1
  14. package/dist/application-spec/core/index.d.ts +1 -3
  15. package/dist/application-spec/core/index.js +1 -1
  16. package/dist/application-spec/core/json-schema.d.ts +2 -52
  17. package/dist/application-spec/core/markers/index.d.ts +1 -1
  18. package/dist/application-spec/core/markers/index.js +1 -1
  19. package/dist/application-spec/core/markers/msg-marker.d.ts +2 -28
  20. package/dist/application-spec/core/markers/msg-marker.js +1 -1
  21. package/dist/application-spec/core/markers/raw-eval-write-marker.d.ts +1 -1
  22. package/dist/application-spec/core/markers/raw-eval-write-marker.js +1 -1
  23. package/dist/application-spec/core/markers/raw-read-write-marker.js +1 -1
  24. package/dist/application-spec/errors/diagnostic-codes.d.ts +17 -1
  25. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  26. package/dist/application-spec/errors/diagnostic-messages.d.ts +25 -2
  27. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  28. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  29. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  30. package/dist/application-spec/generate-application/code/templates/application-types.js +6 -6
  31. package/dist/application-spec/generate-application/code/templates/common/doc-comment.d.ts +2 -0
  32. package/dist/application-spec/generate-application/code/templates/common/doc-comment.js +1 -0
  33. package/dist/application-spec/generate-application/code/templates/configurator-globals.d.ts +2 -1
  34. package/dist/application-spec/generate-application/code/templates/configurator-globals.js +19 -6
  35. package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.js +7 -7
  36. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.d.ts +12 -0
  37. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.js +7 -0
  38. package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +24 -22
  39. package/dist/application-spec/generate-application/code/templates/global-definition/index.d.ts +1 -0
  40. package/dist/application-spec/generate-application/code/templates/global-definition/index.js +1 -1
  41. package/dist/application-spec/generate-application/code/templates/index.d.ts +2 -6
  42. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  43. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.d.ts +10 -0
  44. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +7 -0
  45. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  46. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +14 -7
  47. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
  48. package/dist/application-spec/generate-application/implementations/phx-application-types.d.ts +25 -0
  49. package/dist/application-spec/generate-application/implementations/phx-application-types.js +1 -0
  50. package/dist/application-spec/generate-application/implementations/phx-domain.d.ts +36 -0
  51. package/dist/application-spec/generate-application/implementations/phx-domain.js +1 -0
  52. package/dist/application-spec/generate-application/implementations/phx-model.d.ts +24 -0
  53. package/dist/application-spec/generate-application/implementations/phx-model.js +1 -0
  54. package/dist/application-spec/generate-application/implementations/phx.d.ts +22 -0
  55. package/dist/application-spec/generate-application/implementations/phx.js +1 -0
  56. package/dist/application-spec/generate-application/index.d.ts +2 -0
  57. package/dist/application-spec/generate-application/index.js +1 -1
  58. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +3 -4
  59. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +7 -4
  60. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
  61. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.d.ts +16 -0
  62. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.js +1 -0
  63. package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +17 -4
  64. package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
  65. package/dist/application-spec/generate-application/runtime/application-spec-slice.d.ts +71 -0
  66. package/dist/application-spec/generate-application/runtime/application-spec-slice.js +1 -0
  67. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +3 -4
  68. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +7 -5
  69. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
  70. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.d.ts +16 -0
  71. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.js +1 -0
  72. package/dist/application-spec/generate-application/runtime/create-application.d.ts +57 -0
  73. package/dist/application-spec/generate-application/runtime/create-application.js +1 -0
  74. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +1 -2
  75. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.d.ts +1 -1
  76. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +1 -1
  77. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +1 -2
  78. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +1 -1
  79. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.d.ts +1 -1
  80. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.js +1 -1
  81. package/dist/application-spec/generate-application/runtime/index.d.ts +8 -0
  82. package/dist/application-spec/generate-application/runtime/index.js +1 -0
  83. package/dist/application-spec/generate-application/runtime/sections/actions-runtime.d.ts +1 -2
  84. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +1 -1
  85. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
  86. package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.d.ts +1 -1
  87. package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +1 -2
  88. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +9 -4
  89. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
  90. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +1 -2
  91. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.js +1 -1
  92. package/dist/application-spec/generate-application/runtime/sections/preset-runtime.d.ts +2 -3
  93. package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +1 -1
  94. package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.d.ts +1 -1
  95. package/dist/application-spec/generate-application/runtime/spec-runtime.d.ts +21 -0
  96. package/dist/application-spec/generate-application/runtime/spec-runtime.js +1 -0
  97. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.d.ts +3 -2
  98. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +124 -24
  99. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.js +1 -1
  100. package/dist/application-spec/generate-application/runtime-spec/spec-code-id.d.ts +1 -1
  101. package/dist/application-spec/parse-application-files/merge/merged-assistant.d.ts +13 -4
  102. package/dist/application-spec/parse-application-files/merge/merged-assistant.js +1 -1
  103. package/dist/application-spec/parse-application-files/merge/merged-infra.d.ts +4 -11
  104. package/dist/application-spec/parse-application-files/merge/merged-transformers.d.ts +2 -4
  105. package/dist/application-spec/parse-application-files/parse-application-files.js +1 -1
  106. package/dist/application-spec/parse-application-files/raw-spec/raw-acl.d.ts +2 -2
  107. package/dist/application-spec/parse-application-files/raw-spec/raw-acl.js +1 -1
  108. package/dist/application-spec/parse-application-files/raw-spec/raw-admin-pages.d.ts +3 -24
  109. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +58 -23
  110. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  111. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.d.ts +1 -1
  112. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.js +1 -1
  113. package/dist/application-spec/parse-application-files/raw-spec/raw-resources.d.ts +19 -64
  114. package/dist/application-spec/parse-application-files/spec/application/admin-spec/admin-pages.d.ts +3 -20
  115. package/dist/application-spec/parse-application-files/spec/application/admin-spec/states.d.ts +3 -5
  116. package/dist/application-spec/parse-application-files/spec/application/configurator-spec/states.d.ts +3 -8
  117. package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding.d.ts +3 -13
  118. package/dist/application-spec/parse-application-files/spec/components/bindings/write-binding.d.ts +4 -32
  119. package/dist/application-spec/parse-application-files/spec/components/component-filter.d.ts +4 -10
  120. package/dist/application-spec/parse-application-files/spec/components/components.d.ts +3 -4
  121. package/dist/application-spec/parse-application-files/spec/components/index.d.ts +1 -2
  122. package/dist/application-spec/parse-application-files/spec/components/index.js +1 -1
  123. package/dist/application-spec/parse-application-files/spec/components/sdk-component-entry.d.ts +1 -1
  124. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.d.ts +2 -3
  125. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.js +1 -1
  126. package/dist/application-spec/parse-application-files/spec/components/user-components.d.ts +2 -3
  127. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +2 -2
  128. package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +7 -29
  129. package/dist/application-spec/parse-application-files/spec/expressions/index.d.ts +0 -1
  130. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.d.ts +4 -71
  131. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.js +1 -1
  132. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts +2 -2
  133. package/dist/application-spec/parse-application-files/spec/invariants/invariant.d.ts +5 -21
  134. package/dist/application-spec/parse-application-files/spec/invariants/invariants.d.ts +4 -14
  135. package/dist/application-spec/parse-application-files/spec/model/aliases.d.ts +3 -9
  136. package/dist/application-spec/parse-application-files/spec/model/common-types.d.ts +6 -14
  137. package/dist/application-spec/parse-application-files/spec/model/defaults.d.ts +6 -31
  138. package/dist/application-spec/parse-application-files/spec/model/entity-types.d.ts +3 -8
  139. package/dist/application-spec/parse-application-files/spec/model/model-version-key.d.ts +3 -3
  140. package/dist/application-spec/parse-application-files/spec/model/names/action-name.d.ts +3 -7
  141. package/dist/application-spec/parse-application-files/spec/model/names/alias-name.d.ts +3 -7
  142. package/dist/application-spec/parse-application-files/spec/model/names/entity-or-alias-name.d.ts +3 -8
  143. package/dist/application-spec/parse-application-files/spec/model/names/entity-type-name.d.ts +3 -8
  144. package/dist/application-spec/parse-application-files/spec/model/names/expression-name.d.ts +3 -6
  145. package/dist/application-spec/parse-application-files/spec/model/names/instance-name.d.ts +3 -7
  146. package/dist/application-spec/parse-application-files/spec/model/names/invariant-name.d.ts +3 -3
  147. package/dist/application-spec/parse-application-files/spec/model/names/shape-property-name.d.ts +3 -11
  148. package/dist/application-spec/parse-application-files/spec/model/names/violation-type-name.d.ts +3 -3
  149. package/dist/application-spec/parse-application-files/spec/model/presets.d.ts +6 -29
  150. package/dist/application-spec/parse-application-files/spec/sections/actions.d.ts +6 -23
  151. package/dist/application-spec/parse-application-files/spec/sections/app-metadata.d.ts +3 -18
  152. package/dist/application-spec/parse-application-files/spec/sections/application-version.d.ts +3 -7
  153. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.d.ts +9 -0
  154. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.js +1 -0
  155. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +4 -1
  156. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  157. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant.js +1 -1
  158. package/dist/application-spec/parse-application-files/spec/sections/data-spec/chunks.d.ts +6 -23
  159. package/dist/application-spec/parse-application-files/spec/sections/data-spec/custom-data-spec.d.ts +1 -16
  160. package/dist/application-spec/parse-application-files/spec/sections/data-spec/data-entry-key.d.ts +3 -9
  161. package/dist/application-spec/parse-application-files/spec/sections/data-spec/data-spec.d.ts +1 -10
  162. package/dist/application-spec/parse-application-files/spec/sections/data-spec/swatch-data-spec.d.ts +1 -14
  163. package/dist/application-spec/parse-application-files/spec/sections/state-value.d.ts +3 -7
  164. package/dist/application-spec/parse-application-files/spec/sections/theme.d.ts +3 -10
  165. package/dist/application-spec/parse-application-files/spec/sections/transformers.d.ts +4 -11
  166. package/dist/application-spec/parse-application-files/spec/sections/ui.d.ts +3 -12
  167. package/dist/client/authorized-client.d.ts +3 -1
  168. package/dist/client/authorized-client.js +1 -1
  169. package/dist/client/contract.d.ts +17 -0
  170. package/dist/client/index.d.ts +1 -1
  171. package/dist/client/local-authorized-client.d.ts +3 -1
  172. package/dist/client/local-authorized-client.js +1 -1
  173. package/dist/client/memory-authorized-client.d.ts +4 -1
  174. package/dist/client/memory-authorized-client.js +1 -1
  175. package/dist/client/phoenix-api.d.ts +240 -1
  176. package/dist/configurator/ConfiguratorApp.js +1 -1
  177. package/dist/configurator/app-loader-content/index.d.ts +0 -1
  178. package/dist/configurator/app-loader-content/index.js +1 -1
  179. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  180. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +17 -3
  181. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  182. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +52 -9
  183. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  184. package/dist/configurator/application-runtime/extensions/systems/canvas-system.d.ts +8 -0
  185. package/dist/configurator/application-runtime/extensions/systems/canvas-system.js +1 -1
  186. package/dist/configurator/application-runtime/extensions/systems/export-system/export-busy-error.d.ts +8 -0
  187. package/dist/configurator/application-runtime/extensions/systems/export-system/export-busy-error.js +1 -0
  188. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.d.ts +23 -1
  189. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.js +1 -1
  190. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +82 -55
  191. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  192. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +66 -4
  193. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  194. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.d.ts +40 -0
  195. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.js +1 -0
  196. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.d.ts +14 -5
  197. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.js +1 -1
  198. package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -1
  199. package/dist/configurator/common/configurator-interface.d.ts +9 -6
  200. package/dist/configurator/common/configurator-interface.js +1 -1
  201. package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.d.ts +5 -0
  202. package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.js +1 -0
  203. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.d.ts +0 -6
  204. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.js +1 -1
  205. package/dist/configurator/configuration-not-found-page/index.d.ts +2 -2
  206. package/dist/configurator/configuration-not-found-page/index.js +1 -1
  207. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.d.ts +3 -3
  208. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.js +1 -1
  209. package/dist/configurator/configurator-context/PreviewContextProvider.js +1 -1
  210. package/dist/configurator/configurator-context/configurator-hooks/index.d.ts +0 -1
  211. package/dist/configurator/configurator-context/configurator-hooks/index.js +1 -1
  212. package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.js +1 -1
  213. package/dist/configurator/configurator-context/index.d.ts +0 -5
  214. package/dist/configurator/configurator-context/index.js +1 -1
  215. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.d.ts +3 -3
  216. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.js +1 -1
  217. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.d.ts +0 -5
  218. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.js +1 -1
  219. package/dist/configurator/configurator-error-page/index.d.ts +1 -2
  220. package/dist/configurator/configurator-error-page/index.js +1 -1
  221. package/dist/configurator/index.d.ts +9 -2
  222. package/dist/configurator/index.js +1 -1
  223. package/dist/configurator/pages/ConfiguratorNotFoundPage.js +1 -1
  224. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  225. package/dist/configurator/pages/NewConfiguratorPage.js +1 -1
  226. package/dist/configurator/pages/default-configurator-elements.js +1 -1
  227. package/dist/configurator/pages/error-boundaries/DevContextFallback.js +1 -1
  228. package/dist/configurator/pages/error-boundaries/DevLoadingFallback.js +1 -1
  229. package/dist/configurator/pages/error-boundaries/LoadingErrorBoundary.js +1 -1
  230. package/dist/configurator/ui/assistant/AssistantChips.d.ts +3 -2
  231. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  232. package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -1
  233. package/dist/configurator/ui/assistant/form/compose-answer.d.ts +1 -2
  234. package/dist/configurator/ui/assistant/form/compose-answer.js +1 -1
  235. package/dist/configurator/ui/assistant/form/form-model.d.ts +1 -3
  236. package/dist/configurator/ui/assistant/form/form-state.d.ts +1 -1
  237. package/dist/configurator/ui/assistant/form/index.d.ts +2 -0
  238. package/dist/configurator/ui/assistant/form/index.js +1 -1
  239. package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +1 -1
  240. package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -1
  241. package/dist/configurator/ui/assistant/form/read-form-attributes.d.ts +1 -1
  242. package/dist/configurator/ui/assistant/form/read-form-attributes.js +1 -1
  243. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.d.ts +3 -0
  244. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.js +1 -0
  245. package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.d.ts +31 -0
  246. package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.js +1 -0
  247. package/dist/configurator/ui/assistant/form/{form-element-definition.d.ts → registry/form-element-definition.d.ts} +3 -1
  248. package/dist/configurator/ui/assistant/form/registry/form-element-definition.js +1 -0
  249. package/dist/configurator/ui/assistant/form/{form-registry.d.ts → registry/form-registry.d.ts} +1 -1
  250. package/dist/configurator/ui/assistant/form/registry/form-registry.js +1 -0
  251. package/dist/configurator/ui/assistant/form/registry/index.d.ts +6 -0
  252. package/dist/configurator/ui/assistant/form/registry/index.js +1 -0
  253. package/dist/configurator/ui/assistant/form/registry/use-form-registry.d.ts +8 -0
  254. package/dist/configurator/ui/assistant/form/registry/use-form-registry.js +1 -0
  255. package/dist/configurator/ui/assistant/form-elements/FormCard.d.ts +1 -1
  256. package/dist/configurator/ui/assistant/form-elements/FormCard.js +1 -1
  257. package/dist/configurator/ui/assistant/form-elements/FormReply.d.ts +1 -1
  258. package/dist/configurator/ui/assistant/form-elements/FormReply.js +1 -1
  259. package/dist/configurator/ui/assistant/form-elements/FormSwatch.d.ts +1 -1
  260. package/dist/configurator/ui/assistant/form-elements/FormSwatch.js +1 -1
  261. package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +5 -5
  262. package/dist/configurator/ui/assistant/index.d.ts +3 -0
  263. package/dist/configurator/ui/assistant/index.js +1 -1
  264. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.d.ts +9 -0
  265. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -0
  266. package/dist/configurator/ui/assistant/screenshots/index.d.ts +2 -0
  267. package/dist/configurator/ui/assistant/screenshots/index.js +1 -0
  268. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +22 -0
  269. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -0
  270. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +8 -0
  271. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -0
  272. package/dist/configurator/ui/assistant/tool-chip.d.ts +19 -9
  273. package/dist/configurator/ui/assistant/tool-chip.js +1 -1
  274. package/dist/configurator/ui/configurator-layout/slots/canvas/GPUAccelerationDisabled.js +1 -1
  275. package/dist/configurator/ui/configurator-layout/slots/canvas/LayoutCanvas.js +1 -1
  276. package/dist/configurator/ui/configurator-layout/slots/canvas/SharedCanvas.js +1 -1
  277. package/dist/configurator/ui/configurator-layout/slots/canvas/WebGLNotSupported.js +1 -1
  278. package/dist/configurator/ui/configurator-layout/slots/readonly-banner/CloneToEditDialog.js +1 -1
  279. package/dist/configurator/ui/configurator-layout/universal/DesktopPreview.js +1 -1
  280. package/dist/configurator/ui/configurator-layout/universal/ExportingOverlay.d.ts +5 -0
  281. package/dist/configurator/ui/configurator-layout/universal/ExportingOverlay.js +1 -0
  282. package/dist/configurator/ui/configurator-layout/universal/Layout.js +1 -1
  283. package/dist/configurator/ui/configurator-layout/universal/MobilePreview.js +1 -1
  284. package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.js +1 -1
  285. package/dist/configurator/ui/index.d.ts +1 -0
  286. package/dist/configurator/ui/index.js +1 -1
  287. package/dist/configurator/ui/legacy/chat/MobileChat.js +1 -1
  288. package/dist/configurator/ui/legacy/layout/common/CommonTopNavigation.js +1 -1
  289. package/dist/configurator/ui/legacy/layout/common/ReactiveInterfaceLayout.js +1 -1
  290. package/dist/configurator/ui/legacy/layout/simple/SimpleSidebar.js +1 -1
  291. package/dist/configurator/ui/legacy/layout/simple/SimpleTopNavigation.js +1 -1
  292. package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.js +1 -1
  293. package/dist/configurator/ui/legacy/layout/steps/StepsOwnerLayout.js +1 -1
  294. package/dist/configurator/ui/legacy/layout/steps/StepsSideBar.js +1 -1
  295. package/dist/configurator/ui/legacy/layout/tabs/TabsSidebar.js +1 -1
  296. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.d.ts +0 -7
  297. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.js +2 -2
  298. package/dist/configurator/ui/phoenix-layout-elements/header/common/back-button/use-go-back-action.js +1 -1
  299. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.js +1 -1
  300. package/dist/configurator/ui/phoenix-layout-elements/index.d.ts +8 -1
  301. package/dist/configurator/ui/phoenix-layout-elements/index.js +1 -1
  302. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/basic/use-basic-sidebar-footer.js +1 -1
  303. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/PreviousStepButton.js +1 -1
  304. package/dist/configurator/ui/preset-layout/CategoryPresetUi.js +1 -1
  305. package/dist/configurator/ui/preset-layout/PresetUi.d.ts +0 -2
  306. package/dist/configurator/ui/preset-layout/PresetUi.js +1 -1
  307. package/dist/configurator/ui/preset-layout/index.d.ts +6 -1
  308. package/dist/configurator/ui/preset-layout/index.js +1 -1
  309. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -1
  310. package/dist/docs/3d-scene/cameras/custom.mdx +4 -2
  311. package/dist/docs/drag-and-drop/room-planner.mdx +1 -1
  312. package/dist/docs/index.json +95 -1
  313. package/dist/docs/integrations/webcomponent-api/basics.mdx +2 -0
  314. package/dist/docs/layouts/custom-layout.mdx +318 -158
  315. package/dist/docs/layouts/gallery/ardent-compressor.mdx +3516 -0
  316. package/dist/docs/layouts/gallery/corvid-drone.mdx +3428 -0
  317. package/dist/docs/layouts/gallery/fenwick-window.mdx +2803 -0
  318. package/dist/docs/layouts/gallery/ferrule-bar-station.mdx +6567 -0
  319. package/dist/docs/layouts/gallery/kestrel-kettle.mdx +1858 -0
  320. package/dist/docs/layouts/gallery/nightjar-guitar.mdx +3698 -0
  321. package/dist/docs/layouts/gallery/sunfold-solar.mdx +2683 -0
  322. package/dist/docs/layouts/gallery/tidepool-aquascape.mdx +5203 -0
  323. package/dist/docs/other-features/client-side-rendering/declarative.mdx +1 -1
  324. package/dist/docs/phoenix/configurator-interface.mdx +9 -7
  325. package/dist/docs/phoenix/domain-model.mdx +4 -1
  326. package/dist/docs/phoenix/layout-slots.mdx +21 -0
  327. package/dist/docs/phoenix/phoenix-cli.mdx +40 -7
  328. package/dist/docs/phoenix/project-structure.mdx +21 -17
  329. package/dist/docs/phoenix/sdk-builder-workflow.mdx +6 -4
  330. package/dist/docs/phoenix/sessions-and-access.mdx +2 -0
  331. package/dist/docs/phoenix/webhooks.mdx +5 -1
  332. package/dist/domain/application/application-config.d.ts +6 -24
  333. package/dist/domain/application/assistant/assistant-manifest.d.ts +29 -4
  334. package/dist/domain/application/assistant/assistant-manifest.js +1 -1
  335. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +12 -9
  336. package/dist/domain/application/assistant/assistant-resolved-manifest.js +1 -1
  337. package/dist/domain/application/assistant/build-assistant-lenses.js +1 -1
  338. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  339. package/dist/domain/application/assistant/form/assistant-form-element-name.d.ts +11 -0
  340. package/dist/domain/application/assistant/form/assistant-form-element-name.js +8 -0
  341. package/dist/domain/application/assistant/form/assistant-form-elements.d.ts +39 -28
  342. package/dist/domain/application/assistant/form/assistant-form-elements.js +1 -1
  343. package/dist/domain/application/assistant/form/index.d.ts +1 -1
  344. package/dist/domain/application/assistant/form/index.js +1 -1
  345. package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +1 -1
  346. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  347. package/dist/domain/application/assistant/index.d.ts +3 -3
  348. package/dist/domain/application/assistant/index.js +1 -1
  349. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
  350. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +4 -4
  351. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
  352. package/dist/domain/application/assistant-mutations.js +1 -1
  353. package/dist/domain/application/configurator-builder.d.ts +7 -1
  354. package/dist/domain/application/configurator-builder.js +1 -1
  355. package/dist/domain/application/index.d.ts +1 -1
  356. package/dist/domain/application/index.js +1 -1
  357. package/dist/domain/application/standard-properties.js +1 -1
  358. package/dist/domain/application/web-component-property.d.ts +3 -1
  359. package/dist/domain/application/web-component-property.js +1 -1
  360. package/dist/domain/available-system-components/available-system-components.d.ts +11 -0
  361. package/dist/domain/available-system-components/available-system-components.js +1 -0
  362. package/dist/domain/available-system-components/index.d.ts +1 -0
  363. package/dist/domain/available-system-components/index.js +1 -0
  364. package/dist/domain/{domain-builder.d.ts → domain-builder/domain-builder.d.ts} +11 -5
  365. package/dist/domain/domain-builder/domain-builder.js +1 -0
  366. package/dist/domain/domain-builder/index.d.ts +1 -0
  367. package/dist/domain/domain-builder/index.js +1 -0
  368. package/dist/domain/domain-context/store-system/store-system.d.ts +5 -0
  369. package/dist/domain/domain-context/store-system/store-system.js +1 -1
  370. package/dist/domain/domain-runtime/application.d.ts +39 -0
  371. package/dist/domain/domain-runtime/application.js +1 -0
  372. package/dist/domain/domain-runtime/domain-context/selectors.d.ts +1 -0
  373. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  374. package/dist/domain/domain-runtime/domain-runtime.d.ts +44 -4
  375. package/dist/domain/domain-runtime/domain-runtime.js +1 -1
  376. package/dist/domain/domain-runtime/environment/initialize.d.ts +1 -1
  377. package/dist/domain/domain-runtime/environment/types.d.ts +1 -1
  378. package/dist/domain/domain-runtime/errors/implementation-error-collector.d.ts +2 -0
  379. package/dist/domain/domain-runtime/errors/implementation-error-collector.js +1 -1
  380. package/dist/domain/domain-runtime/index.d.ts +2 -1
  381. package/dist/domain/domain-runtime/index.js +1 -1
  382. package/dist/domain/domain-runtime/spec/index.d.ts +1 -1
  383. package/dist/domain/domain-runtime/spec/index.js +1 -1
  384. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  385. package/dist/domain/domain-runtime/spec/module-checks/element-registration.d.ts +15 -1
  386. package/dist/domain/domain-runtime/spec/module-checks/element-registration.js +1 -1
  387. package/dist/domain/domain-runtime/spec/module-checks/find-assistant-form-element-errors.d.ts +12 -0
  388. package/dist/domain/domain-runtime/spec/module-checks/find-assistant-form-element-errors.js +1 -0
  389. package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +3 -1
  390. package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
  391. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.d.ts +23 -0
  392. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.js +1 -0
  393. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.d.ts +3 -4
  394. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.js +1 -1
  395. package/dist/domain/domain-runtime/spec/selectors.d.ts +3 -1
  396. package/dist/domain/domain-runtime/spec/selectors.js +1 -1
  397. package/dist/domain/domain-runtime/web-component/actions.d.ts +3 -0
  398. package/dist/domain/domain-runtime/web-component/actions.js +1 -1
  399. package/dist/domain/domain-runtime/web-component/initialize.d.ts +1 -0
  400. package/dist/domain/domain-runtime/web-component/initialize.js +1 -1
  401. package/dist/domain/domain-runtime/web-component/selectors.d.ts +2 -0
  402. package/dist/domain/domain-runtime/web-component/selectors.js +1 -1
  403. package/dist/domain/domain-runtime/web-component/types.d.ts +6 -3
  404. package/dist/domain/extensions/export-images/agent-screenshot.d.ts +24 -0
  405. package/dist/domain/extensions/export-images/agent-screenshot.js +1 -0
  406. package/dist/domain/extensions/{client-side-image.d.ts → export-images/client-side-image.d.ts} +2 -2
  407. package/dist/domain/extensions/export-images/client-side-image.js +1 -0
  408. package/dist/domain/extensions/export-images/index.d.ts +3 -0
  409. package/dist/domain/extensions/export-images/index.js +1 -0
  410. package/dist/domain/extensions/{save-template-thumbnail.d.ts → export-images/save-template-thumbnail.d.ts} +2 -2
  411. package/dist/domain/extensions/export-images/save-template-thumbnail.js +1 -0
  412. package/dist/domain/extensions/index.d.ts +1 -2
  413. package/dist/domain/extensions/index.js +1 -1
  414. package/dist/domain/index.d.ts +3 -2
  415. package/dist/domain/index.js +1 -1
  416. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +9 -0
  417. package/dist/domain/spec/application/admin-pages-section.d.ts +29 -0
  418. package/dist/domain/spec/application/admin-pages.d.ts +26 -0
  419. package/dist/domain/spec/application/admin-states.d.ts +5 -0
  420. package/dist/domain/spec/application/configurator-states.d.ts +8 -0
  421. package/dist/domain/spec/application/index.d.ts +5 -0
  422. package/dist/domain/spec/application/index.js +1 -0
  423. package/dist/domain/spec/components/bindings/index.d.ts +2 -0
  424. package/dist/domain/spec/components/bindings/read-binding.d.ts +13 -0
  425. package/dist/domain/spec/components/bindings/write-binding.d.ts +32 -0
  426. package/dist/domain/spec/components/bindings/write-binding.js +1 -0
  427. package/dist/{application-spec/parse-application-files → domain}/spec/components/component-entry.d.ts +3 -3
  428. package/dist/domain/spec/components/component-entry.js +1 -0
  429. package/dist/{application-spec/core → domain/spec}/components/component-filter.d.ts +3 -2
  430. package/dist/domain/spec/components/component-filters.d.ts +10 -0
  431. package/dist/domain/spec/components/component-filters.js +1 -0
  432. package/dist/domain/spec/components/components.d.ts +4 -0
  433. package/dist/domain/spec/components/components.js +1 -0
  434. package/dist/domain/spec/components/index.d.ts +6 -0
  435. package/dist/domain/spec/enhanced-json/enhanced-json-value.d.ts +30 -0
  436. package/dist/domain/spec/enhanced-json/enhanced-json-value.js +1 -0
  437. package/dist/domain/spec/enhanced-json/index.d.ts +1 -0
  438. package/dist/domain/spec/enhanced-json/index.js +1 -0
  439. package/dist/{application-spec/parse-application-files → domain}/spec/expressions/expression.d.ts +9 -3
  440. package/dist/domain/spec/expressions/expression.js +1 -0
  441. package/dist/domain/spec/expressions/expressions.d.ts +27 -0
  442. package/dist/domain/spec/expressions/expressions.js +1 -0
  443. package/dist/domain/spec/expressions/index.d.ts +5 -0
  444. package/dist/domain/spec/expressions/memo-eval-plan.d.ts +70 -0
  445. package/dist/domain/spec/expressions/memo-eval-plan.js +1 -0
  446. package/dist/domain/spec/expressions/relation-expression-params.js +1 -0
  447. package/dist/domain/spec/index.d.ts +9 -0
  448. package/dist/domain/spec/index.js +1 -0
  449. package/dist/domain/spec/invariants/index.d.ts +2 -0
  450. package/dist/domain/spec/invariants/index.js +1 -0
  451. package/dist/domain/spec/invariants/invariant.d.ts +24 -0
  452. package/dist/domain/spec/invariants/invariant.js +1 -0
  453. package/dist/domain/spec/invariants/invariants.d.ts +14 -0
  454. package/dist/domain/spec/invariants/invariants.js +1 -0
  455. package/dist/domain/spec/json-schema.d.ts +52 -0
  456. package/dist/domain/spec/json-schema.js +1 -0
  457. package/dist/domain/spec/markers/index.d.ts +3 -0
  458. package/dist/domain/spec/markers/index.js +1 -0
  459. package/dist/domain/spec/markers/msg-marker.d.ts +28 -0
  460. package/dist/domain/spec/markers/msg-marker.js +1 -0
  461. package/dist/domain/spec/model/aliases.d.ts +9 -0
  462. package/dist/domain/spec/model/aliases.js +1 -0
  463. package/dist/domain/spec/model/common-types.d.ts +15 -0
  464. package/dist/domain/spec/model/common-types.js +1 -0
  465. package/dist/domain/spec/model/defaults.d.ts +33 -0
  466. package/dist/domain/spec/model/defaults.js +1 -0
  467. package/dist/domain/spec/model/entity-types.d.ts +8 -0
  468. package/dist/domain/spec/model/entity-types.js +1 -0
  469. package/dist/domain/spec/model/index.d.ts +7 -0
  470. package/dist/domain/spec/model/index.js +1 -0
  471. package/dist/domain/spec/model/model-version-key.d.ts +3 -0
  472. package/dist/domain/spec/model/model-version-key.js +1 -0
  473. package/dist/domain/spec/model/names/action-name.d.ts +7 -0
  474. package/dist/domain/spec/model/names/action-name.js +1 -0
  475. package/dist/domain/spec/model/names/alias-name.d.ts +7 -0
  476. package/dist/domain/spec/model/names/alias-name.js +1 -0
  477. package/dist/domain/spec/model/names/entity-or-alias-name.d.ts +8 -0
  478. package/dist/domain/spec/model/names/entity-or-alias-name.js +1 -0
  479. package/dist/domain/spec/model/names/entity-type-name.d.ts +8 -0
  480. package/dist/domain/spec/model/names/entity-type-name.js +1 -0
  481. package/dist/domain/spec/model/names/expression-name.d.ts +6 -0
  482. package/dist/domain/spec/model/names/expression-name.js +1 -0
  483. package/dist/domain/spec/model/names/index.d.ts +9 -0
  484. package/dist/domain/spec/model/names/index.js +1 -0
  485. package/dist/domain/spec/model/names/instance-name.d.ts +7 -0
  486. package/dist/domain/spec/model/names/instance-name.js +1 -0
  487. package/dist/domain/spec/model/names/invariant-name.d.ts +3 -0
  488. package/dist/domain/spec/model/names/invariant-name.js +1 -0
  489. package/dist/domain/spec/model/names/shape-property-name.d.ts +11 -0
  490. package/dist/domain/spec/model/names/shape-property-name.js +1 -0
  491. package/dist/domain/spec/model/names/violation-type-name.d.ts +3 -0
  492. package/dist/domain/spec/model/names/violation-type-name.js +1 -0
  493. package/dist/domain/spec/model/presets.d.ts +30 -0
  494. package/dist/domain/spec/model/presets.js +1 -0
  495. package/dist/domain/spec/sections/actions.d.ts +23 -0
  496. package/dist/domain/spec/sections/actions.js +1 -0
  497. package/dist/domain/spec/sections/app-metadata.d.ts +18 -0
  498. package/dist/domain/spec/sections/app-metadata.js +1 -0
  499. package/dist/domain/spec/sections/application-version.d.ts +7 -0
  500. package/dist/domain/spec/sections/application-version.js +1 -0
  501. package/dist/domain/spec/sections/data-spec/chunks.d.ts +23 -0
  502. package/dist/domain/spec/sections/data-spec/chunks.js +1 -0
  503. package/dist/domain/spec/sections/data-spec/custom-data-spec-entry.d.ts +16 -0
  504. package/dist/domain/spec/sections/data-spec/custom-data-spec-entry.js +1 -0
  505. package/dist/domain/spec/sections/data-spec/data-entry-key.d.ts +9 -0
  506. package/dist/domain/spec/sections/data-spec/data-entry-key.js +1 -0
  507. package/dist/domain/spec/sections/data-spec/index.d.ts +5 -0
  508. package/dist/domain/spec/sections/data-spec/index.js +1 -0
  509. package/dist/domain/spec/sections/data-spec/parsed-data-spec-entries.d.ts +10 -0
  510. package/dist/domain/spec/sections/data-spec/parsed-data-spec-entries.js +1 -0
  511. package/dist/domain/spec/sections/data-spec/swatch-data-spec-entry.d.ts +14 -0
  512. package/dist/domain/spec/sections/data-spec/swatch-data-spec-entry.js +1 -0
  513. package/dist/domain/spec/sections/index.d.ts +9 -0
  514. package/dist/domain/spec/sections/index.js +1 -0
  515. package/dist/domain/spec/sections/infra/acl.d.ts +12 -0
  516. package/dist/domain/spec/sections/infra/acl.js +1 -0
  517. package/dist/domain/spec/sections/infra/index.d.ts +3 -0
  518. package/dist/domain/spec/sections/infra/index.js +1 -0
  519. package/dist/domain/spec/sections/infra/resource-entry.d.ts +46 -0
  520. package/dist/domain/spec/sections/infra/resource-entry.js +1 -0
  521. package/dist/domain/spec/sections/infra/resources-config.d.ts +10 -0
  522. package/dist/domain/spec/sections/infra/resources-config.js +1 -0
  523. package/dist/domain/spec/sections/state-value.d.ts +7 -0
  524. package/dist/domain/spec/sections/state-value.js +1 -0
  525. package/dist/domain/spec/sections/theme.d.ts +10 -0
  526. package/dist/domain/spec/sections/theme.js +1 -0
  527. package/dist/domain/spec/sections/transformers.d.ts +15 -0
  528. package/dist/domain/spec/sections/transformers.js +1 -0
  529. package/dist/domain/spec/sections/ui.d.ts +12 -0
  530. package/dist/domain/spec/sections/ui.js +1 -0
  531. package/dist/domain/system-definitions.js +1 -1
  532. package/dist/domain/utils/index.d.ts +2 -0
  533. package/dist/domain/utils/index.js +1 -0
  534. package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
  535. package/dist/editor/domain-editors/apply-spec-update.d.ts +10 -2
  536. package/dist/editor/domain-editors/apply-spec-update.js +1 -1
  537. package/dist/editor/domain-editors/use-implementation-files.d.ts +6 -14
  538. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  539. package/dist/editor/graphql/GraphQLPanel.js +1 -1
  540. package/dist/editor/screenshot/ScreenshotHandler.js +1 -1
  541. package/dist/i18n/locales/cs/messages.js +1 -1
  542. package/dist/i18n/locales/da/messages.js +1 -1
  543. package/dist/i18n/locales/de/messages.js +1 -1
  544. package/dist/i18n/locales/de-AT/messages.js +1 -1
  545. package/dist/i18n/locales/en/messages.js +1 -1
  546. package/dist/i18n/locales/en-AU/messages.js +1 -1
  547. package/dist/i18n/locales/en-GB/messages.js +1 -1
  548. package/dist/i18n/locales/es/messages.js +1 -1
  549. package/dist/i18n/locales/fr/messages.js +1 -1
  550. package/dist/i18n/locales/hu/messages.js +1 -1
  551. package/dist/i18n/locales/it/messages.js +1 -1
  552. package/dist/i18n/locales/nl/messages.js +1 -1
  553. package/dist/i18n/locales/pl/messages.js +1 -1
  554. package/dist/i18n/locales/pt/messages.js +1 -1
  555. package/dist/i18n/locales/ro/messages.js +1 -1
  556. package/dist/i18n/locales/sk/messages.js +1 -1
  557. package/dist/i18n/locales/tr/messages.js +1 -1
  558. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  559. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  560. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +16 -0
  561. package/dist/legacy/domain-spec/spec/domain-spec.js +1 -1
  562. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
  563. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
  564. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
  565. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +11 -5
  566. package/dist/phoenix/application-spec/generate-application-spec-project.d.ts +1 -0
  567. package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
  568. package/dist/phoenix/application-spec/generate-project-files.d.ts +1 -0
  569. package/dist/phoenix/application-spec/index.d.ts +1 -0
  570. package/dist/phoenix/application-spec/index.js +1 -1
  571. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +11 -0
  572. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  573. package/dist/phoenix/bin.js +1 -1
  574. package/dist/phoenix/cli.js +1 -1
  575. package/dist/phoenix/commands/activate-deployment.js +1 -1
  576. package/dist/phoenix/commands/build.js +1 -1
  577. package/dist/phoenix/commands/changelog.js +1 -1
  578. package/dist/phoenix/commands/check.js +1 -1
  579. package/dist/phoenix/commands/clean.js +1 -1
  580. package/dist/phoenix/commands/cleanup-environment.js +2 -2
  581. package/dist/phoenix/commands/create-environment.js +1 -1
  582. package/dist/phoenix/commands/data.js +1 -1
  583. package/dist/phoenix/commands/deploy.js +1 -1
  584. package/dist/phoenix/commands/deployment-build-envs-command.js +1 -1
  585. package/dist/phoenix/commands/dev.js +5 -5
  586. package/dist/phoenix/commands/docs.js +1 -1
  587. package/dist/phoenix/commands/finish-deployment-command.js +1 -1
  588. package/dist/phoenix/commands/fix.js +1 -1
  589. package/dist/phoenix/commands/generated-env-markers.d.ts +1 -0
  590. package/dist/phoenix/commands/generated-env-markers.js +1 -1
  591. package/dist/phoenix/commands/index.d.ts +1 -1
  592. package/dist/phoenix/commands/index.js +1 -1
  593. package/dist/phoenix/commands/inspect-assets.js +1 -1
  594. package/dist/phoenix/commands/list-environments.js +1 -1
  595. package/dist/phoenix/commands/login.d.ts +4 -1
  596. package/dist/phoenix/commands/login.js +2 -2
  597. package/dist/phoenix/commands/prepare-deployment-command.js +2 -2
  598. package/dist/phoenix/commands/register-deployment.js +1 -1
  599. package/dist/phoenix/commands/scene.js +1 -1
  600. package/dist/phoenix/commands/screenshot.js +1 -1
  601. package/dist/phoenix/commands/state.js +1 -1
  602. package/dist/phoenix/commands/story-build.js +3 -3
  603. package/dist/phoenix/commands/story-create.js +1 -1
  604. package/dist/phoenix/commands/sync.js +1 -1
  605. package/dist/phoenix/commands/variants.js +1 -1
  606. package/dist/phoenix/lingui/index.d.ts +1 -0
  607. package/dist/phoenix/lingui/index.js +1 -0
  608. package/dist/phoenix/{services → lingui}/lingui.d.ts +5 -2
  609. package/dist/phoenix/lingui/lingui.js +1 -0
  610. package/dist/phoenix/services/application-spec-project-watcher.d.ts +3 -1
  611. package/dist/phoenix/services/application-spec-project-watcher.js +2 -2
  612. package/dist/phoenix/services/cli-credentials.d.ts +3 -0
  613. package/dist/phoenix/services/cli-credentials.js +1 -1
  614. package/dist/phoenix/services/cli-exit.d.ts +5 -0
  615. package/dist/phoenix/services/cli-exit.js +1 -0
  616. package/dist/phoenix/services/index.d.ts +3 -0
  617. package/dist/phoenix/services/index.js +1 -1
  618. package/dist/phoenix/services/lingui-watcher.js +1 -1
  619. package/dist/phoenix/services/prepare-development-environment.js +1 -1
  620. package/dist/phoenix/services/telemetry/amplitude-telemetry-transport.d.ts +9 -0
  621. package/dist/phoenix/services/telemetry/amplitude-telemetry-transport.js +1 -0
  622. package/dist/phoenix/services/telemetry/index.d.ts +3 -0
  623. package/dist/phoenix/services/telemetry/index.js +1 -0
  624. package/dist/phoenix/services/telemetry/telemetry-client.d.ts +25 -0
  625. package/dist/phoenix/services/telemetry/telemetry-client.js +1 -0
  626. package/dist/phoenix/services/telemetry/telemetry-command.d.ts +2 -0
  627. package/dist/phoenix/services/telemetry/telemetry-command.js +1 -0
  628. package/dist/phoenix/services/telemetry/telemetry-event.d.ts +44 -0
  629. package/dist/phoenix/services/telemetry/telemetry-event.js +1 -0
  630. package/dist/phoenix/services/telemetry/telemetry-state.d.ts +25 -0
  631. package/dist/phoenix/services/telemetry/telemetry-state.js +2 -0
  632. package/dist/phoenix/services/vite-config.js +1 -1
  633. package/dist/react-sdk/application-runtime/common-services/analytics/analytics-service.d.ts +1 -1
  634. package/dist/react-sdk/application-runtime/common-services/initialize.d.ts +2 -2
  635. package/dist/react-sdk/application-runtime/domain-application-context/chat-system.d.ts +1 -1
  636. package/dist/react-sdk/application-runtime/hooks/index.d.ts +2 -0
  637. package/dist/react-sdk/application-runtime/hooks/index.js +1 -1
  638. package/dist/react-sdk/application-runtime/hooks/loading/index.d.ts +5 -0
  639. package/dist/react-sdk/application-runtime/hooks/loading/index.js +1 -0
  640. package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.d.ts +11 -0
  641. package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.js +1 -0
  642. package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.d.ts +8 -0
  643. package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.js +1 -0
  644. package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.d.ts +7 -0
  645. package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.js +1 -0
  646. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.d.ts +9 -0
  647. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.js +1 -0
  648. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.d.ts +24 -0
  649. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.js +1 -0
  650. package/dist/react-sdk/application-runtime/hooks/responsive/index.d.ts +3 -0
  651. package/dist/react-sdk/application-runtime/hooks/responsive/index.js +1 -0
  652. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.d.ts +9 -0
  653. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.js +1 -0
  654. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.d.ts +26 -0
  655. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.js +1 -0
  656. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.d.ts +10 -0
  657. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.js +1 -0
  658. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.d.ts +24 -0
  659. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.js +1 -0
  660. package/dist/react-sdk/application-runtime/hooks/use-access-service.d.ts +5 -0
  661. package/dist/react-sdk/application-runtime/hooks/use-access-service.js +1 -1
  662. package/dist/react-sdk/application-runtime/hooks/use-phoenix-element-slots.d.ts +2 -1
  663. package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.d.ts +4 -11
  664. package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.js +1 -1
  665. package/dist/react-sdk/application-runtime/hooks/use-web-component.d.ts +5 -0
  666. package/dist/react-sdk/application-runtime/hooks/use-web-component.js +1 -1
  667. package/dist/react-sdk/application-runtime/host-properties/actions.d.ts +15 -0
  668. package/dist/react-sdk/application-runtime/host-properties/actions.js +1 -0
  669. package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.d.ts +30 -0
  670. package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.js +1 -0
  671. package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.d.ts +7 -0
  672. package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.js +1 -0
  673. package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.d.ts +21 -0
  674. package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.js +1 -0
  675. package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.d.ts +42 -0
  676. package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.js +1 -0
  677. package/dist/react-sdk/application-runtime/host-properties/index.d.ts +8 -0
  678. package/dist/react-sdk/application-runtime/host-properties/index.js +1 -0
  679. package/dist/react-sdk/application-runtime/host-properties/initialize.d.ts +7 -0
  680. package/dist/react-sdk/application-runtime/host-properties/initialize.js +1 -0
  681. package/dist/react-sdk/application-runtime/host-properties/selectors.d.ts +54 -0
  682. package/dist/react-sdk/application-runtime/host-properties/selectors.js +1 -0
  683. package/dist/react-sdk/application-runtime/host-properties/types.d.ts +18 -0
  684. package/dist/react-sdk/application-runtime/host-properties/types.js +1 -0
  685. package/dist/react-sdk/application-runtime/index.d.ts +3 -0
  686. package/dist/react-sdk/application-runtime/integration/initialize.d.ts +7 -6
  687. package/dist/react-sdk/application-runtime/integration/initialize.js +1 -1
  688. package/dist/react-sdk/application-runtime/integration/selectors.d.ts +11 -2
  689. package/dist/react-sdk/application-runtime/integration/selectors.js +1 -1
  690. package/dist/react-sdk/application-runtime/integration/types.d.ts +5 -2
  691. package/dist/react-sdk/application-runtime/loading/actions.d.ts +45 -0
  692. package/dist/react-sdk/application-runtime/loading/actions.js +1 -0
  693. package/dist/react-sdk/application-runtime/loading/index.d.ts +4 -0
  694. package/dist/react-sdk/application-runtime/loading/index.js +1 -0
  695. package/dist/react-sdk/application-runtime/loading/initialize.d.ts +3 -0
  696. package/dist/react-sdk/application-runtime/loading/initialize.js +1 -0
  697. package/dist/react-sdk/application-runtime/loading/selectors.d.ts +18 -0
  698. package/dist/react-sdk/application-runtime/loading/selectors.js +1 -0
  699. package/dist/react-sdk/application-runtime/loading/types.d.ts +59 -0
  700. package/dist/react-sdk/application-runtime/loading/types.js +1 -0
  701. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  702. package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.d.ts +6 -0
  703. package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.js +1 -1
  704. package/dist/react-sdk/application-runtime/provider/ApplicationType.d.ts +7 -0
  705. package/dist/react-sdk/application-runtime/provider/ApplicationType.js +1 -1
  706. package/dist/react-sdk/application-runtime/responsive/actions.d.ts +47 -0
  707. package/dist/react-sdk/application-runtime/responsive/actions.js +1 -0
  708. package/dist/react-sdk/application-runtime/responsive/index.d.ts +4 -0
  709. package/dist/react-sdk/application-runtime/responsive/index.js +1 -0
  710. package/dist/react-sdk/application-runtime/responsive/initialize.d.ts +3 -0
  711. package/dist/react-sdk/application-runtime/responsive/initialize.js +1 -0
  712. package/dist/react-sdk/application-runtime/responsive/selectors.d.ts +20 -0
  713. package/dist/react-sdk/application-runtime/responsive/selectors.js +1 -0
  714. package/dist/react-sdk/application-runtime/responsive/types.d.ts +104 -0
  715. package/dist/react-sdk/application-runtime/responsive/types.js +1 -0
  716. package/dist/react-sdk/application-runtime/routing/routing-service.d.ts +34 -2
  717. package/dist/react-sdk/application-runtime/routing/routing-service.js +1 -1
  718. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +313 -10
  719. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
  720. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/ConfiguratorRoutingProvider.d.ts +1 -1
  721. package/dist/react-sdk/configurator-routing/ConfiguratorRoutingProvider.js +1 -0
  722. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/OnGoToIndexHandler.d.ts +1 -2
  723. package/dist/react-sdk/configurator-routing/OnGoToIndexHandler.js +1 -0
  724. package/dist/react-sdk/configurator-routing/index.d.ts +3 -0
  725. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/index.js +1 -1
  726. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/use-power-routing-lifecycle.d.ts +2 -0
  727. package/dist/react-sdk/configurator-routing/use-power-routing-lifecycle.js +1 -0
  728. package/dist/react-sdk/domain-application-context/BackendDataProvider.js +1 -1
  729. package/dist/react-sdk/domain-application-context/ConfigurationPersistSystemFailureHandler.js +1 -1
  730. package/dist/react-sdk/domain-application-context/FrontendDataProvider.js +1 -1
  731. package/dist/react-sdk/domain-application-context/OnPresetLoadedHandler.js +1 -0
  732. package/dist/react-sdk/domain-application-context/PublishedDataProvider.js +1 -1
  733. package/dist/react-sdk/domain-application-context/chat-hooks.d.ts +4 -0
  734. package/dist/react-sdk/domain-application-context/chat-hooks.js +1 -0
  735. package/dist/react-sdk/domain-application-context/index.d.ts +2 -0
  736. package/dist/react-sdk/domain-application-context/index.js +1 -1
  737. package/dist/react-sdk/domain-context/common-hooks/index.d.ts +1 -0
  738. package/dist/react-sdk/domain-context/common-hooks/index.js +1 -1
  739. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.d.ts +23 -0
  740. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.js +1 -0
  741. package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +1 -0
  742. package/dist/react-sdk/domain-context/index.d.ts +1 -0
  743. package/dist/react-sdk/domain-context/index.js +1 -1
  744. package/dist/react-sdk/elements/index.d.ts +0 -1
  745. package/dist/react-sdk/index.d.ts +6 -1
  746. package/dist/react-sdk/index.js +1 -1
  747. package/dist/react-sdk/integration/IntegrationSubscription.js +1 -0
  748. package/dist/react-sdk/integration/index.d.ts +1 -0
  749. package/dist/react-sdk/integration/index.js +1 -0
  750. package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.d.ts +8 -0
  751. package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.js +1 -0
  752. package/dist/react-sdk/lifecycle-providers/LifecycleProviders.js +1 -0
  753. package/dist/react-sdk/lifecycle-providers/index.d.ts +2 -0
  754. package/dist/react-sdk/lifecycle-providers/index.js +1 -0
  755. package/dist/react-sdk/loading-state/LoaderHost.d.ts +20 -0
  756. package/dist/react-sdk/loading-state/LoaderHost.js +1 -0
  757. package/dist/react-sdk/loading-state/built-in-loading-phase.d.ts +9 -0
  758. package/dist/react-sdk/loading-state/built-in-loading-phase.js +1 -0
  759. package/dist/react-sdk/loading-state/create-app-loader.d.ts +18 -0
  760. package/dist/react-sdk/loading-state/create-app-loader.js +1 -0
  761. package/dist/react-sdk/loading-state/index.d.ts +4 -2
  762. package/dist/react-sdk/loading-state/index.js +1 -1
  763. package/dist/react-sdk/loading-state/{LoadingStateProvider.d.ts → loading-state-hooks.d.ts} +3 -12
  764. package/dist/react-sdk/loading-state/loading-state-hooks.js +1 -0
  765. package/dist/react-sdk/notifications/index.d.ts +1 -0
  766. package/dist/react-sdk/notifications/index.js +1 -0
  767. package/dist/react-sdk/notifications/snackbar-action-button.d.ts +30 -0
  768. package/dist/react-sdk/notifications/snackbar-action-button.js +1 -0
  769. package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.d.ts +17 -0
  770. package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.js +1 -0
  771. package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.d.ts +17 -0
  772. package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.js +1 -0
  773. package/dist/react-sdk/page-elements/configurator-error-page-props.js +1 -0
  774. package/dist/{configurator/configuration-not-found-page → react-sdk/page-elements}/create-configuration-not-found-page.d.ts +7 -1
  775. package/dist/react-sdk/page-elements/create-configuration-not-found-page.js +1 -0
  776. package/dist/{configurator/configurator-error-page → react-sdk/page-elements}/create-configurator-error-page.d.ts +6 -1
  777. package/dist/react-sdk/page-elements/create-configurator-error-page.js +1 -0
  778. package/dist/react-sdk/page-elements/create-preset-ui.d.ts +9 -0
  779. package/dist/react-sdk/page-elements/create-preset-ui.js +1 -0
  780. package/dist/react-sdk/page-elements/index.d.ts +6 -0
  781. package/dist/react-sdk/page-elements/index.js +1 -0
  782. package/dist/react-sdk/preset-selection/PresetSelectionProvider.js +1 -0
  783. package/dist/react-sdk/preset-selection/index.d.ts +1 -0
  784. package/dist/react-sdk/preset-selection/index.js +1 -0
  785. package/dist/react-sdk/session/SessionServiceProvider.js +1 -1
  786. package/dist/react-sdk/web-component/create-web-component.js +1 -1
  787. package/dist/react-sdk/web-component/god-mode/god-mode-registry.d.ts +30 -0
  788. package/dist/react-sdk/web-component/god-mode/god-mode-registry.js +1 -0
  789. package/dist/react-sdk/web-component/god-mode/index.d.ts +1 -0
  790. package/dist/react-sdk/web-component/god-mode/index.js +1 -0
  791. package/dist/ui-sdk/components/snackbar/Snackbar.d.ts +24 -3
  792. package/dist/ui-sdk/components/snackbar/Snackbar.js +1 -1
  793. package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.d.ts +2 -2
  794. package/dist/ui-sdk/responsive-application/responsive-state-store.d.ts +11 -9
  795. package/dist/ui-sdk/responsive-application/use-store-responsive-info.js +1 -1
  796. package/dist/ui-sdk/theme/types.d.ts +5 -1
  797. package/dist/watch/glob-matcher.d.ts +4 -4
  798. package/dist/watch/glob-matcher.js +1 -1
  799. package/dist/watch/watch.d.ts +4 -4
  800. package/dist/watch/watch.js +1 -1
  801. package/package.json +13 -3
  802. package/schema/domain-spec.json +140 -0
  803. package/dist/application-spec/core/components/index.d.ts +0 -2
  804. package/dist/application-spec/core/expressions/index.d.ts +0 -2
  805. package/dist/configurator/app-loader-content/app-loader-content-name.d.ts +0 -5
  806. package/dist/configurator/app-loader-content/app-loader-content-name.js +0 -1
  807. package/dist/configurator/configuration-not-found-page/create-configuration-not-found-page.js +0 -1
  808. package/dist/configurator/configurator-context/ConfiguratorDataProvider.d.ts +0 -2
  809. package/dist/configurator/configurator-context/ConfiguratorDataProvider.js +0 -1
  810. package/dist/configurator/configurator-context/IntegrationSubscription.js +0 -1
  811. package/dist/configurator/configurator-context/LifecycleProviders.js +0 -1
  812. package/dist/configurator/configurator-context/OnPresetLoadedHandler.js +0 -1
  813. package/dist/configurator/configurator-context/PresetSelectionProvider.js +0 -1
  814. package/dist/configurator/configurator-context/configurator-hooks/chat-hooks.d.ts +0 -1
  815. package/dist/configurator/configurator-context/configurator-hooks/chat-hooks.js +0 -1
  816. package/dist/configurator/configurator-context/configurator-routing/ConfiguratorRoutingProvider.js +0 -1
  817. package/dist/configurator/configurator-context/configurator-routing/OnGoToIndexHandler.js +0 -1
  818. package/dist/configurator/configurator-context/configurator-routing/index.d.ts +0 -2
  819. package/dist/configurator/configurator-context/configurator-routing/use-power-routing-lifecycle.js +0 -1
  820. package/dist/configurator/configurator-error-page/create-configurator-error-page.js +0 -1
  821. package/dist/configurator/ui/assistant/form/built-in-form-registry.d.ts +0 -10
  822. package/dist/configurator/ui/assistant/form/built-in-form-registry.js +0 -1
  823. package/dist/configurator/ui/assistant/form/form-registry.js +0 -8
  824. package/dist/domain/application/assistant/form/get-assistant-form-value-attribute.d.ts +0 -6
  825. package/dist/domain/application/assistant/form/get-assistant-form-value-attribute.js +0 -1
  826. package/dist/domain/available-system-components.d.ts +0 -11
  827. package/dist/domain/available-system-components.js +0 -1
  828. package/dist/domain/domain-builder.js +0 -1
  829. package/dist/domain/extensions/client-side-image.js +0 -1
  830. package/dist/domain/extensions/save-template-thumbnail.js +0 -1
  831. package/dist/phoenix/services/lingui.js +0 -1
  832. package/dist/react-sdk/application-runtime/runtime/god-mode.d.ts +0 -19
  833. package/dist/react-sdk/application-runtime/runtime/god-mode.js +0 -1
  834. package/dist/react-sdk/loading-state/LoadingStateProvider.js +0 -1
  835. package/dist/react-sdk/loading-state/loading-state-manager.d.ts +0 -37
  836. package/dist/react-sdk/loading-state/loading-state-manager.js +0 -1
  837. package/dist/react-sdk/responsive-state/ResponsiveStateProvider.d.ts +0 -25
  838. package/dist/react-sdk/responsive-state/ResponsiveStateProvider.js +0 -1
  839. package/dist/react-sdk/responsive-state/canvas-padding.d.ts +0 -14
  840. package/dist/react-sdk/responsive-state/index.d.ts +0 -5
  841. package/dist/react-sdk/responsive-state/index.js +0 -1
  842. package/dist/react-sdk/responsive-state/responsive-state-manager.d.ts +0 -111
  843. package/dist/react-sdk/responsive-state/responsive-state-manager.js +0 -1
  844. package/dist/react-sdk/responsive-state/use-responsive-state-manager.d.ts +0 -10
  845. package/dist/react-sdk/responsive-state/use-responsive-state-manager.js +0 -1
  846. package/dist/react-sdk/responsive-state/use-responsive-state.d.ts +0 -11
  847. package/dist/react-sdk/responsive-state/use-responsive-state.js +0 -1
  848. /package/dist/{application-spec/core/expressions/relation-expression-params.js → domain/spec/application/admin-pages-section.js} +0 -0
  849. /package/dist/{application-spec/parse-application-files/spec/components/component-entry.js → domain/spec/application/admin-pages.js} +0 -0
  850. /package/dist/{application-spec/parse-application-files/spec/expressions/expression.js → domain/spec/application/admin-states.js} +0 -0
  851. /package/dist/{application-spec/core → domain/spec/application}/application-instance.d.ts +0 -0
  852. /package/dist/{application-spec/core → domain/spec/application}/application-instance.js +0 -0
  853. /package/dist/{configurator/ui/assistant/form/form-element-definition.js → domain/spec/application/configurator-states.js} +0 -0
  854. /package/dist/{react-sdk/elements/configurator-error-page-props.js → domain/spec/components/bindings/index.js} +0 -0
  855. /package/dist/{react-sdk/responsive-state/canvas-padding.js → domain/spec/components/bindings/read-binding.js} +0 -0
  856. /package/dist/{application-spec/core → domain/spec}/components/component-filter.js +0 -0
  857. /package/dist/{application-spec/core → domain/spec}/components/index.js +0 -0
  858. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.d.ts +0 -0
  859. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.js +0 -0
  860. /package/dist/{application-spec/core → domain/spec}/expressions/index.js +0 -0
  861. /package/dist/{application-spec/core → domain/spec}/expressions/relation-expression-params.d.ts +0 -0
  862. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.d.ts +0 -0
  863. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.js +0 -0
  864. /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.d.ts +0 -0
  865. /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.js +0 -0
  866. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.d.ts +0 -0
  867. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.js +0 -0
  868. /package/dist/{configurator/configurator-context → react-sdk/domain-application-context}/OnPresetLoadedHandler.d.ts +0 -0
  869. /package/dist/{configurator/configurator-context → react-sdk/integration}/IntegrationSubscription.d.ts +0 -0
  870. /package/dist/{configurator/configurator-context → react-sdk/lifecycle-providers}/LifecycleProviders.d.ts +0 -0
  871. /package/dist/react-sdk/{elements → page-elements}/configurator-error-page-props.d.ts +0 -0
  872. /package/dist/{configurator/configurator-context → react-sdk/preset-selection}/PresetSelectionProvider.d.ts +0 -0
@@ -1 +1 @@
1
- import{globby as e}from"globby";import{resolve as o}from"path";import{inspectGltfFile as t}from"./gltf-inspector.js";let n=e=>e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`;export const formatSummary=e=>{let o=[`File: ${e.filePath}`,`Size: ${n(e.fileSize)}${e.fileSize>0xa00000?" (large file)":""}`,`Format: ${e.format} ${e.version}`,`Generator: ${e.generator}`];return e.extensions.length>0&&o.push(`Extensions: ${e.extensions.join(", ")}`),e.dracoCompressed&&o.push("Note: Draco-compressed meshes (vertex data not decoded)"),o.join("\n")};let r=e=>String(Math.round(1e3*e)/1e3),a=e=>`[${e.map(r).join(", ")}]`,i=(e,o)=>0===o||Math.abs(e)<.01*o,s=(e,o)=>o>0&&Math.abs(Math.abs(e)-o/2)<.01*o,l=e=>{let o,t,n,l=e.children.length>0?` [${e.children.join(", ")}]`:"",m=` ${e.name} (${e.type})${l}`;if((0!==(o=e.translation)[0]||0!==o[1]||0!==o[2])&&(m+=` pos=${a(e.translation)}`),(0!==(t=e.rotation)[0]||0!==t[1]||0!==t[2]||1!==t[3])&&(m+=` rot=${a(e.rotation)}`),(1!==(n=e.scale)[0]||1!==n[1]||1!==n[2])&&(m+=` scale=${a(e.scale)}`),e.morphTargets.length>0&&(m+=` morphs=${e.morphTargets.join(",")}`),e.boundingBox){let o=e.boundingBox.dimensions,t=e.boundingBox.originOffset,n=((e,o)=>{let t=i(e[0],o[0]),n=i(e[1],o[1]),r=i(e[2],o[2]);if(t&&n&&r)return"center";let a=s(e[1],o[1])?e[1]>0?"bottom":"top":"",l=s(e[0],o[0]),m=s(e[2],o[2]),f=t&&r?"center":l&&m?"corner":l||m?"edge":"";return a&&f?`${a}-${f}`:a||f||"offset"})(t,o);m+=` bounds=${r(o[0])}x${r(o[1])}x${r(o[2])} origin=${n} ${a(t)}`}return m};export const formatNodes=e=>0===e.length?"Nodes: (none)":[`Nodes (${e.length}):`,...e.map(l)].join("\n");export const formatMaterials=e=>0===e.length?"Materials: (none)":[`Materials (${e.length}):`,...e.map(e=>` ${e.name}`)].join("\n");export const formatMorphTargets=e=>{if(0===e.size)return"Morph Targets: (none)";let o=["Morph Targets:"];for(let[t,n]of e)o.push(` ${t}: ${n.join(", ")}`);return o.join("\n")};export const formatAnimations=e=>0===e.length?"Animations: (none)":[`Animations (${e.length}):`,...e.map(e=>` ${e.name} (${e.duration}s, ${e.channelCount} channels)`)].join("\n");export const formatFullReport=e=>[formatSummary(e),"",formatNodes(e.nodes),"",formatMaterials(e.materials),"",formatMorphTargets(e.morphTargets),"",formatAnimations(e.animations)].join("\n");export const formatSummaryTable=e=>{let o="File Size Nodes Materials Morphs Animations",t="─".repeat(o.length);return[o,t,...e.map(e=>{let o=[...e.morphTargets.values()].reduce((e,o)=>e+o.length,0);return[e.filePath.padEnd(40),n(e.fileSize).padStart(10),String(e.nodes.length).padStart(7),String(e.materials.length).padStart(10),String(o).padStart(8),String(e.animations.length).padStart(11)].join("")})].join("\n")};let m=e=>({...e,morphTargets:Object.fromEntries(e.morphTargets)});export const runInspectAssetsCommand=async(n,r)=>{let{logger:a}=r;try{if(n.file){let e=o(n.file),r=await t(e);if(n.json)return void console.log(JSON.stringify(m(r),null,2));if(n.objects)return void console.log(formatNodes(r.nodes));if(n.materials)return void console.log(formatMaterials(r.materials));if(n.morphs)return void console.log(formatMorphTargets(r.morphTargets));if(n.animations)return void console.log(formatAnimations(r.animations));console.log(formatFullReport(r));return}let r=await e("public/**/*.{glb,gltf}");if(0===r.length)return void a.warn("No glTF/GLB files found in public/");let i=[];for(let e of r)try{i.push(await t(o(e)))}catch(o){a.error(`Failed to parse ${e}`,o)}if(0===i.length)return void a.warn("No files could be parsed");if(n.json)return void console.log(JSON.stringify(i.map(m),null,2));if(n.objects){let e=i.flatMap(e=>e.nodes.map(o=>`${e.filePath}: ${o.name} (${o.type})`));console.log(e.join("\n"));return}if(n.materials){let e=i.flatMap(e=>e.materials.map(o=>`${e.filePath}: ${o.name}`));console.log(e.join("\n"));return}if(n.morphs){let e=[];for(let o of i)for(let[t,n]of o.morphTargets)e.push(`${o.filePath}: ${t} → ${n.join(", ")}`);if(0===e.length)return void a.info("No morph targets found in any file");console.log(e.join("\n"));return}if(n.animations){let e=i.flatMap(e=>e.animations.map(o=>`${e.filePath}: ${o.name} (${o.duration}s, ${o.channelCount} ch)`));if(0===e.length)return void a.info("No animations found in any file");console.log(e.join("\n"));return}console.log(formatSummaryTable(i))}catch(e){e instanceof Error?a.error(e.message):a.error("Unexpected error during asset inspection",e),process.exit(1)}};
1
+ import{globby as e}from"globby";import{resolve as o}from"path";import{exitCli as t}from"../services/index.js";import{inspectGltfFile as n}from"./gltf-inspector.js";let r=e=>e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`;export const formatSummary=e=>{let o=[`File: ${e.filePath}`,`Size: ${r(e.fileSize)}${e.fileSize>0xa00000?" (large file)":""}`,`Format: ${e.format} ${e.version}`,`Generator: ${e.generator}`];return e.extensions.length>0&&o.push(`Extensions: ${e.extensions.join(", ")}`),e.dracoCompressed&&o.push("Note: Draco-compressed meshes (vertex data not decoded)"),o.join("\n")};let a=e=>String(Math.round(1e3*e)/1e3),i=e=>`[${e.map(a).join(", ")}]`,s=(e,o)=>0===o||Math.abs(e)<.01*o,l=(e,o)=>o>0&&Math.abs(Math.abs(e)-o/2)<.01*o,m=e=>{let o,t,n,r=e.children.length>0?` [${e.children.join(", ")}]`:"",m=` ${e.name} (${e.type})${r}`;if((0!==(o=e.translation)[0]||0!==o[1]||0!==o[2])&&(m+=` pos=${i(e.translation)}`),(0!==(t=e.rotation)[0]||0!==t[1]||0!==t[2]||1!==t[3])&&(m+=` rot=${i(e.rotation)}`),(1!==(n=e.scale)[0]||1!==n[1]||1!==n[2])&&(m+=` scale=${i(e.scale)}`),e.morphTargets.length>0&&(m+=` morphs=${e.morphTargets.join(",")}`),e.boundingBox){let o=e.boundingBox.dimensions,t=e.boundingBox.originOffset,n=((e,o)=>{let t=s(e[0],o[0]),n=s(e[1],o[1]),r=s(e[2],o[2]);if(t&&n&&r)return"center";let a=l(e[1],o[1])?e[1]>0?"bottom":"top":"",i=l(e[0],o[0]),m=l(e[2],o[2]),f=t&&r?"center":i&&m?"corner":i||m?"edge":"";return a&&f?`${a}-${f}`:a||f||"offset"})(t,o);m+=` bounds=${a(o[0])}x${a(o[1])}x${a(o[2])} origin=${n} ${i(t)}`}return m};export const formatNodes=e=>0===e.length?"Nodes: (none)":[`Nodes (${e.length}):`,...e.map(m)].join("\n");export const formatMaterials=e=>0===e.length?"Materials: (none)":[`Materials (${e.length}):`,...e.map(e=>` ${e.name}`)].join("\n");export const formatMorphTargets=e=>{if(0===e.size)return"Morph Targets: (none)";let o=["Morph Targets:"];for(let[t,n]of e)o.push(` ${t}: ${n.join(", ")}`);return o.join("\n")};export const formatAnimations=e=>0===e.length?"Animations: (none)":[`Animations (${e.length}):`,...e.map(e=>` ${e.name} (${e.duration}s, ${e.channelCount} channels)`)].join("\n");export const formatFullReport=e=>[formatSummary(e),"",formatNodes(e.nodes),"",formatMaterials(e.materials),"",formatMorphTargets(e.morphTargets),"",formatAnimations(e.animations)].join("\n");export const formatSummaryTable=e=>{let o="File Size Nodes Materials Morphs Animations",t="─".repeat(o.length);return[o,t,...e.map(e=>{let o=[...e.morphTargets.values()].reduce((e,o)=>e+o.length,0);return[e.filePath.padEnd(40),r(e.fileSize).padStart(10),String(e.nodes.length).padStart(7),String(e.materials.length).padStart(10),String(o).padStart(8),String(e.animations.length).padStart(11)].join("")})].join("\n")};let f=e=>({...e,morphTargets:Object.fromEntries(e.morphTargets)});export const runInspectAssetsCommand=async(r,a)=>{let{logger:i}=a;try{if(r.file){let e=o(r.file),t=await n(e);if(r.json)return void console.log(JSON.stringify(f(t),null,2));if(r.objects)return void console.log(formatNodes(t.nodes));if(r.materials)return void console.log(formatMaterials(t.materials));if(r.morphs)return void console.log(formatMorphTargets(t.morphTargets));if(r.animations)return void console.log(formatAnimations(t.animations));console.log(formatFullReport(t));return}let t=await e("public/**/*.{glb,gltf}");if(0===t.length)return void i.warn("No glTF/GLB files found in public/");let a=[];for(let e of t)try{a.push(await n(o(e)))}catch(o){i.error(`Failed to parse ${e}`,o)}if(0===a.length)return void i.warn("No files could be parsed");if(r.json)return void console.log(JSON.stringify(a.map(f),null,2));if(r.objects){let e=a.flatMap(e=>e.nodes.map(o=>`${e.filePath}: ${o.name} (${o.type})`));console.log(e.join("\n"));return}if(r.materials){let e=a.flatMap(e=>e.materials.map(o=>`${e.filePath}: ${o.name}`));console.log(e.join("\n"));return}if(r.morphs){let e=[];for(let o of a)for(let[t,n]of o.morphTargets)e.push(`${o.filePath}: ${t} → ${n.join(", ")}`);if(0===e.length)return void i.info("No morph targets found in any file");console.log(e.join("\n"));return}if(r.animations){let e=a.flatMap(e=>e.animations.map(o=>`${e.filePath}: ${o.name} (${o.duration}s, ${o.channelCount} ch)`));if(0===e.length)return void i.info("No animations found in any file");console.log(e.join("\n"));return}console.log(formatSummaryTable(a))}catch(e){e instanceof Error?i.error(e.message):i.error("Unexpected error during asset inspection",e),await t(1)}};
@@ -1 +1 @@
1
- import{runCommand as e}from"../utils/index.js";export const runListEnvironmentsCommand=async(n,r)=>{let{logger:t}=r;try{t.warn("DEPRECATED: environment:list command is deprecated, switch to a new workflow and use the prepare environment flow instead"),t.step("Listing deployment environments");let r=["list"];n?.server&&r.push("--server",`"${n.server}"`),n?.apiKey&&r.push("--apiKey",`"${n.apiKey}"`),await e({command:"deployment-cli",args:r,description:"Listing environments"},{logger:t})}catch(e){t.error(`Failed to list environments: ${e instanceof Error?e.message:String(e)}`,e),process.exit(1)}};
1
+ import{exitCli as e}from"../services/index.js";import{runCommand as n}from"../utils/index.js";export const runListEnvironmentsCommand=async(r,t)=>{let{logger:i}=t;try{i.warn("DEPRECATED: environment:list command is deprecated, switch to a new workflow and use the prepare environment flow instead"),i.step("Listing deployment environments");let e=["list"];r?.server&&e.push("--server",`"${r.server}"`),r?.apiKey&&e.push("--apiKey",`"${r.apiKey}"`),await n({command:"deployment-cli",args:e,description:"Listing environments"},{logger:i})}catch(n){i.error(`Failed to list environments: ${n instanceof Error?n.message:String(n)}`,n),await e(1)}};
@@ -37,5 +37,8 @@ export declare const startLoginCallbackListener: (props: LoginCallbackListenerPr
37
37
  * one-time code to this CLI's loopback listener, and the CLI exchanges it with its PKCE verifier for an API token.
38
38
  * The browser waits on the callback meanwhile and ends on Studio's page for the outcome.
39
39
  */
40
- export declare const runLoginCommand: (props: LoginCommandProps, { logger }: CommandContext) => Promise<void>;
40
+ export declare const runLoginCommand: (props: LoginCommandProps, { logger }: CommandContext) => Promise<{
41
+ userId: string;
42
+ workspaceId: string;
43
+ } | undefined>;
41
44
  export {};
@@ -1,4 +1,4 @@
1
- import{spawn as e}from"node:child_process";import{createHash as t,randomBytes as r}from"node:crypto";import{createServer as o}from"node:http";import{hostname as n}from"node:os";import{createApiBaseClient as s}from"#package/client";import{getServerCredentials as i,saveServerCredentials as a}from"../services/index.js";let l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},c=(e,t)=>`<!doctype html><html><head><meta charset="utf-8"><title>${e}</title></head><body style="font-family:system-ui,sans-serif;display:grid;place-items:center;height:100vh;margin:0"><main style="text-align:center"><h1>${e}</h1><p>${t.replace(/[&<>"']/g,e=>l[e]??e)}</p></main></body></html>`,d=(e,t,r,o)=>new Promise(n=>{e.destroyed?n():(e.once("close",n),e.writeHead(t,{...r,connection:"close"}).end(o))});export const startLoginCallbackListener=async e=>{let{state:t,studioUrl:r,customer:n}=e,s=(e,t)=>{let o=new URL(e,r);return o.searchParams.set("customer",n),t&&o.searchParams.set("name",t),o.toString()},i=null,a=!1,l=new Promise((e,t)=>{i={resolve:e,reject:t}}),m=o((e,r)=>{let o=new URL(e.url??"/","http://127.0.0.1"),n=o.searchParams.get("code"),l="access_denied"===o.searchParams.get("error");if("/callback"!==o.pathname)return void r.writeHead(404).end();if(o.searchParams.get("state")!==t||a||!n&&!l){d(r,400,{"content-type":"text/html"},c("Sign-in failed","This response does not belong to the waiting CLI. Run phoenix login again.")),a||i?.reject(Error("The sign-in response did not match this CLI session. Run `phoenix login` again."));return}if(a=!0,l||!n)return void d(r,302,{location:s("/builder/cli-login/denied",null)}).then(()=>{i?.reject(Error("The sign-in was denied in Studio. Run `phoenix login` again to sign in."))});let m=o.searchParams.get("name");i?.resolve({code:n,tokenName:m,finish:e=>e.signedIn?d(r,302,{location:s("/builder/cli-login/done",m)}):d(r,200,{"content-type":"text/html"},c("Sign-in failed",e.message))})}),h=await new Promise((e,t)=>{m.once("error",t),m.listen(0,"127.0.0.1",()=>{let r=m.address();null===r||"string"==typeof r?t(Error("The login callback listener did not get a port. Run `phoenix login` again.")):e(r.port)})}),u=setTimeout(()=>{i?.reject(Error("Nobody approved the sign-in within 5 minutes. Run `phoenix login` again."))},3e5);return{port:h,callback:l,close:()=>{clearTimeout(u),m.close()}}};let m=async(e,t)=>{try{let{error:r,response:o}=await s(e).DELETE("/auth/token",{headers:{authorization:`Bearer ${t}`,"content-type":null}});return r&&401!==o.status?r.message:null}catch(e){return e instanceof Error?e.message:String(e)}},h=async(e,t)=>{let{data:r,error:o}=await s(e.serverUrl).POST("/auth/token",{body:t});if(o||!r)throw Error(`The server did not accept the sign-in: ${o?.message??"no response"}`);if(r.customer.slug!==e.customer)throw await m(e.serverUrl,r.token),Error(`The sign-in was approved in workspace "${r.customer.slug}", not "${e.customer}". Check --region or --studioUrl and run \`phoenix login ${e.customer}\` again.`);let n=await i(e.serverUrl),l=await a(e.serverUrl,{token:r.token,userId:r.userId,customerSlug:r.customer.slug,customerName:r.customer.name,studioUrl:e.studioUrl,createdAt:new Date().toISOString()}),c=n?await m(e.serverUrl,n.token):null;return{customerName:r.customer.name,path:l,revokeError:c}};export const runLoginCommand=async(o,{logger:s})=>{let i=r(32).toString("base64url"),a=t("sha256").update(i).digest("base64url"),l=r(16).toString("base64url"),c=n(),d=`phoenix CLI on ${c}`,m=await startLoginCallbackListener({state:l,studioUrl:o.studioUrl,customer:o.customer});try{let t=new URL("/builder/cli-login",o.studioUrl);t.searchParams.set("customer",o.customer),t.searchParams.set("port",String(m.port)),t.searchParams.set("state",l),t.searchParams.set("challenge",a),t.searchParams.set("name",d),t.searchParams.set("host",c),t.searchParams.set("started",String(Date.now())),s.step(`Signing in to workspace "${o.customer}" on ${o.serverUrl}`),s.info(`Approve the CLI in your browser:
1
+ import{spawn as e}from"node:child_process";import{createHash as t,randomBytes as r}from"node:crypto";import{createServer as o}from"node:http";import{hostname as n}from"node:os";import{z as s}from"zod";import{createApiBaseClient as i}from"#package/client";import{getServerCredentials as a,saveServerCredentials as l}from"../services/index.js";let c=s.string().uuid(),d={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},m=(e,t)=>`<!doctype html><html><head><meta charset="utf-8"><title>${e}</title></head><body style="font-family:system-ui,sans-serif;display:grid;place-items:center;height:100vh;margin:0"><main style="text-align:center"><h1>${e}</h1><p>${t.replace(/[&<>"']/g,e=>d[e]??e)}</p></main></body></html>`,u=(e,t,r,o)=>new Promise(n=>{e.destroyed?n():(e.once("close",n),e.writeHead(t,{...r,connection:"close"}).end(o))});export const startLoginCallbackListener=async e=>{let{state:t,studioUrl:r,customer:n}=e,s=(e,t)=>{let o=new URL(e,r);return o.searchParams.set("customer",n),t&&o.searchParams.set("name",t),o.toString()},i=null,a=!1,l=new Promise((e,t)=>{i={resolve:e,reject:t}}),c=o((e,r)=>{let o=new URL(e.url??"/","http://127.0.0.1"),n=o.searchParams.get("code"),l="access_denied"===o.searchParams.get("error");if("/callback"!==o.pathname)return void r.writeHead(404).end();if(o.searchParams.get("state")!==t||a||!n&&!l){u(r,400,{"content-type":"text/html"},m("Sign-in failed","This response does not belong to the waiting CLI. Run phoenix login again.")),a||i?.reject(Error("The sign-in response did not match this CLI session. Run `phoenix login` again."));return}if(a=!0,l||!n)return void u(r,302,{location:s("/builder/cli-login/denied",null)}).then(()=>{i?.reject(Error("The sign-in was denied in Studio. Run `phoenix login` again to sign in."))});let c=o.searchParams.get("name");i?.resolve({code:n,tokenName:c,finish:e=>e.signedIn?u(r,302,{location:s("/builder/cli-login/done",c)}):u(r,200,{"content-type":"text/html"},m("Sign-in failed",e.message))})}),d=await new Promise((e,t)=>{c.once("error",t),c.listen(0,"127.0.0.1",()=>{let r=c.address();null===r||"string"==typeof r?t(Error("The login callback listener did not get a port. Run `phoenix login` again.")):e(r.port)})}),h=setTimeout(()=>{i?.reject(Error("Nobody approved the sign-in within 5 minutes. Run `phoenix login` again."))},3e5);return{port:d,callback:l,close:()=>{clearTimeout(h),c.close()}}};let h=async(e,t)=>{try{let{error:r,response:o}=await i(e).DELETE("/auth/token",{headers:{authorization:`Bearer ${t}`,"content-type":null}});return r&&401!==o.status?r.message:null}catch(e){return e instanceof Error?e.message:String(e)}},g=async(e,t)=>{let{data:r,error:o}=await i(e.serverUrl).POST("/auth/token",{body:t});if(o||!r)throw Error(`The server did not accept the sign-in: ${o?.message??"no response"}`);if(r.customer.slug!==e.customer)throw await h(e.serverUrl,r.token),Error(`The sign-in was approved in workspace "${r.customer.slug}", not "${e.customer}". Check --region or --studioUrl and run \`phoenix login ${e.customer}\` again.`);let n=await a(e.serverUrl),s=c.safeParse(r.customer.id),d=await l(e.serverUrl,{token:r.token,userId:r.userId,...s.success?{customerId:s.data}:{},customerSlug:r.customer.slug,customerName:r.customer.name,studioUrl:e.studioUrl,createdAt:new Date().toISOString()}),m=n?await h(e.serverUrl,n.token):null;return{customerName:r.customer.name,path:d,revokeError:m,telemetryAssociation:s.success?{userId:r.userId,workspaceId:s.data}:void 0}};export const runLoginCommand=async(o,{logger:s})=>{let i=r(32).toString("base64url"),a=t("sha256").update(i).digest("base64url"),l=r(16).toString("base64url"),c=n(),d=`phoenix CLI on ${c}`,m=await startLoginCallbackListener({state:l,studioUrl:o.studioUrl,customer:o.customer});try{let t=new URL("/builder/cli-login",o.studioUrl);t.searchParams.set("customer",o.customer),t.searchParams.set("port",String(m.port)),t.searchParams.set("state",l),t.searchParams.set("challenge",a),t.searchParams.set("name",d),t.searchParams.set("host",c),t.searchParams.set("started",String(Date.now())),s.step(`Signing in to workspace "${o.customer}" on ${o.serverUrl}`),s.info(`Approve the CLI in your browser:
2
2
 
3
3
  ${t.toString()}
4
- `),o.open&&(t=>{let[r,o]="darwin"===process.platform?["open",[t]]:"win32"===process.platform?["rundll32",["url.dll,FileProtocolHandler",t]]:["xdg-open",[t]];e(r,o,{stdio:"ignore",detached:!0}).on("error",()=>void 0).unref()})(t.toString());let r=await m.callback;try{let e=await h(o,{code:r.code,codeVerifier:i,port:m.port,name:d});e.revokeError&&s.warn(`The server did not revoke the token this sign-in replaces (${e.revokeError}). It stays valid on the server. Contact Phoenix support to revoke it.`),await r.finish({signedIn:!0}),s.success(`Signed in to ${e.customerName}. The token is stored in ${e.path}; revoke it with phoenix logout.`)}catch(e){throw await r.finish({signedIn:!1,message:e instanceof Error?e.message:String(e)}),e}}finally{m.close()}};
4
+ `),o.open&&(t=>{let[r,o]="darwin"===process.platform?["open",[t]]:"win32"===process.platform?["rundll32",["url.dll,FileProtocolHandler",t]]:["xdg-open",[t]];e(r,o,{stdio:"ignore",detached:!0}).on("error",()=>void 0).unref()})(t.toString());let r=await m.callback;try{let e=await g(o,{code:r.code,codeVerifier:i,port:m.port,name:d});return e.revokeError&&s.warn(`The server did not revoke the token this sign-in replaces (${e.revokeError}). It stays valid on the server. Contact Phoenix support to revoke it.`),await r.finish({signedIn:!0}),s.success(`Signed in to ${e.customerName}. The token is stored in ${e.path}; revoke it with phoenix logout.`),e.telemetryAssociation}catch(e){throw await r.finish({signedIn:!1,message:e instanceof Error?e.message:String(e)}),e}}finally{m.close()}};
@@ -1,2 +1,2 @@
1
- import{writeFile as e}from"fs/promises";import{createApiBaseClient as t}from"#package/client";import{resolveApplicationSpecDeploymentData as a}from"../application-spec/index.js";import{formatEnvContent as r,formatEnvLine as i}from"../utils/index.js";export const runPrepareDeploymentCommand=async(s,n)=>{let{logger:o}=n;try{o.step("Preparing deployment");let{apiKey:n,projectKey:l,projectSlug:p,projectRef:c,projectSha:m,environmentSlug:d,outFile:h,skipUpload:u,overrideSchema:f,uploadLinksFile:g,serverUrl:v}=s;o.info(`Preparing deployment for project "${p}", environment "${d}"`);let b=t(v);o.debug(`Using server URL: ${v}`);let y=await a({skipUpload:u,logger:o});if(y.assistantSetup){let{sdl:e,prompt:t,instructions:a}=y.assistantSetup,r=t.length+e.length+(a?.length??0);o.info(`Assistant GraphQL schema:
2
- ${e}`),o.info(`Assistant prompt of this deployment (generated prompt, schema and instructions): ${r} characters`)}o.info("Preparing deployment on server...");let{data:w,error:S}=await b.POST("/environments/prepare",{body:{projectSlug:p,environmentSlug:d,applicationVersion:y.applicationVersion,projectRef:c,projectSha:m,publishedDataHash:y.publishedDataHash,useAuthHook:y.useAuthHook,overrideSchema:f,configurationSchema:{version:y.schemaVersion,schema:y.schema},adminConfigurationSchema:y.adminSchema?{schema:y.adminSchema,version:y.adminSchemaVersion}:void 0,chat:y.chat,embeddings:y.embeddings,...y.assistant?{assistant:!0}:{},acl:{canCreate:y.aclCanCreate},privateFiles:[...y.assets.privateFilePaths],publicFiles:[...y.assets.publicFilePaths]},headers:{"x-api-key":n,"x-project-key":l,"x-project-slug":p}});if(S)throw Error(`Failed to prepare deployment with server: ${S.message}`);if(!w)throw Error("No data returned from server");o.debug("Deployment prepared on server");let{baseDomain:F,isCustomDomain:P}=w,U=w.environmentVariables,k=w.privateUploadUrls,$=w.publicUploadUrls;if(!U||!k||!$)throw Error("Incomplete data returned from server");try{let t=[r(U),i("BASE_DOMAIN",String(F)),i("IS_CUSTOM_DOMAIN",String(P))].join("\n");await e(h,t+"\n"),o.debug(`Environment variables written to ${h}`)}catch(e){throw Error("Failed to write environment variables to file")}try{if(u)await e(g,JSON.stringify({privateFiles:[],publicFiles:[]},null,2)),o.debug("Upload links file cleared (upload was skipped)");else{let t={privateFiles:[...y.assets.privateFilesFullPaths].map(e=>({localPath:e,uploadUrl:k[e.replace(/^assets\/private\//,"")]})),publicFiles:[...y.assets.publicFilesFullPaths].map(e=>({localPath:e,uploadUrl:$[e.replace(/^assets\/public\//,"")]}))};await e(g,JSON.stringify(t,null,2)),o.debug(`Upload links written to ${g}`),o.info('Run "finish" command to upload files and activate the deployment')}}catch(e){throw Error("Failed to write upload links to file")}o.success("Deployment prepared successfully!")}catch(e){o.error(`Deployment preparation failed: ${e instanceof Error?e.message:String(e)}`,e),process.exit(1)}};
1
+ import{writeFile as e}from"fs/promises";import{createApiBaseClient as a}from"#package/client";import{resolveApplicationSpecDeploymentData as t}from"../application-spec/index.js";import{exitCli as r}from"../services/index.js";import{formatEnvContent as i,formatEnvLine as s}from"../utils/index.js";export const runPrepareDeploymentCommand=async(n,o)=>{let{logger:l}=o;try{l.step("Preparing deployment");let{apiKey:r,projectKey:o,projectSlug:p,projectRef:c,projectSha:m,environmentSlug:d,outFile:h,skipUpload:u,overrideSchema:f,uploadLinksFile:g,serverUrl:v}=n;l.info(`Preparing deployment for project "${p}", environment "${d}"`);let b=a(v);l.debug(`Using server URL: ${v}`);let y=await t({skipUpload:u,logger:l});if(y.assistantSetup){let{sdl:e,prompt:a,instructions:t}=y.assistantSetup,r=a.length+e.length+(t?.length??0);l.info(`Assistant GraphQL schema:
2
+ ${e}`),l.info(`Assistant prompt of this deployment (generated prompt, schema and instructions): ${r} characters`)}l.info("Preparing deployment on server...");let{data:w,error:S}=await b.POST("/environments/prepare",{body:{projectSlug:p,environmentSlug:d,applicationVersion:y.applicationVersion,projectRef:c,projectSha:m,publishedDataHash:y.publishedDataHash,useAuthHook:y.useAuthHook,overrideSchema:f,configurationSchema:{version:y.schemaVersion,schema:y.schema},adminConfigurationSchema:y.adminSchema?{schema:y.adminSchema,version:y.adminSchemaVersion}:void 0,chat:y.chat,embeddings:y.embeddings,...y.assistant?{assistant:!0}:{},acl:{canCreate:y.aclCanCreate},privateFiles:[...y.assets.privateFilePaths],publicFiles:[...y.assets.publicFilePaths]},headers:{"x-api-key":r,"x-project-key":o,"x-project-slug":p}});if(S)throw Error(`Failed to prepare deployment with server: ${S.message}`);if(!w)throw Error("No data returned from server");l.debug("Deployment prepared on server");let{baseDomain:F,isCustomDomain:P}=w,U=w.environmentVariables,k=w.privateUploadUrls,$=w.publicUploadUrls;if(!U||!k||!$)throw Error("Incomplete data returned from server");try{let a=[i(U),s("BASE_DOMAIN",String(F)),s("IS_CUSTOM_DOMAIN",String(P))].join("\n");await e(h,a+"\n"),l.debug(`Environment variables written to ${h}`)}catch(e){throw Error("Failed to write environment variables to file")}try{if(u)await e(g,JSON.stringify({privateFiles:[],publicFiles:[]},null,2)),l.debug("Upload links file cleared (upload was skipped)");else{let a={privateFiles:[...y.assets.privateFilesFullPaths].map(e=>({localPath:e,uploadUrl:k[e.replace(/^assets\/private\//,"")]})),publicFiles:[...y.assets.publicFilesFullPaths].map(e=>({localPath:e,uploadUrl:$[e.replace(/^assets\/public\//,"")]}))};await e(g,JSON.stringify(a,null,2)),l.debug(`Upload links written to ${g}`),l.info('Run "finish" command to upload files and activate the deployment')}}catch(e){throw Error("Failed to write upload links to file")}l.success("Deployment prepared successfully!")}catch(e){l.error(`Deployment preparation failed: ${e instanceof Error?e.message:String(e)}`,e),await r(1)}};
@@ -1 +1 @@
1
- import{runCommand as e}from"../utils/index.js";export const runRegisterDeploymentCommand=async(t,i)=>{let{logger:r}=i;try{r.warn("DEPRECATED: deployment:register command is deprecated, switch to a new workflow and use deployment:prepare and deployment:finish instead"),r.step("Registering deployment");let i=["register"];t?.server&&i.push("--server",`"${t.server}"`),t?.apiKey&&i.push("--apiKey",`"${t.apiKey}"`),t?.outFile&&i.push("--outFile",`"${t.outFile}"`),t?.skipUpload&&i.push("--skipUpload"),t?.activate===void 0||t.activate||i.push("--activate","false"),t?.overrideSchema&&i.push("--overrideSchema"),i.push("--configPath",'"./.phoenix/phoenix.config.ts"'),await e({command:"deployment-cli",args:i,description:"Registering deployment"},{logger:r}),r.success("Deployment registered successfully!")}catch(e){r.error(`Deployment registration failed: ${e instanceof Error?e.message:String(e)}`,e),process.exit(1)}};
1
+ import{exitCli as e}from"../services/index.js";import{runCommand as i}from"../utils/index.js";export const runRegisterDeploymentCommand=async(t,r)=>{let{logger:s}=r;try{s.warn("DEPRECATED: deployment:register command is deprecated, switch to a new workflow and use deployment:prepare and deployment:finish instead"),s.step("Registering deployment");let e=["register"];t?.server&&e.push("--server",`"${t.server}"`),t?.apiKey&&e.push("--apiKey",`"${t.apiKey}"`),t?.outFile&&e.push("--outFile",`"${t.outFile}"`),t?.skipUpload&&e.push("--skipUpload"),t?.activate===void 0||t.activate||e.push("--activate","false"),t?.overrideSchema&&e.push("--overrideSchema"),e.push("--configPath",'"./.phoenix/phoenix.config.ts"'),await i({command:"deployment-cli",args:e,description:"Registering deployment"},{logger:s}),s.success("Deployment registered successfully!")}catch(i){s.error(`Deployment registration failed: ${i instanceof Error?i.message:String(i)}`,i),await e(1)}};
@@ -1 +1 @@
1
- import{createTRPCClient as e,createWSClient as t,wsLink as r}from"@trpc/client";import{writeFile as o}from"fs/promises";import{resolve as i}from"path";import s from"ws";export const runSceneCommand=async(n,c)=>{let{logger:l}=c,a=n.port??"3020",p=n.pretty??!0,m=t({url:`ws://localhost:${a}`,WebSocket:s}),f=e({links:[r({client:m})]});try{let e=await f.getEditorScene.mutate(),t=JSON.stringify(e,null,p?2:void 0);if(n.output){let e=i(n.output);await o(e,t,"utf-8"),l.success(`Scene saved: ${e}`)}else console.log(t)}catch(e){if(e instanceof Error){let t=e.cause;null!=t&&"object"==typeof t&&"code"in t&&"ECONNREFUSED"===t.code&&(l.error("Dev server not running. Start with `phoenix dev`"),process.exit(1)),l.error(e.message)}else l.error(`Scene command failed: ${String(e)}`);process.exit(1)}finally{await m.close()}};
1
+ import{createTRPCClient as e,createWSClient as t,wsLink as r}from"@trpc/client";import{writeFile as o}from"fs/promises";import{resolve as i}from"path";import n from"ws";import{exitCli as s}from"../services/index.js";export const runSceneCommand=async(a,c)=>{let{logger:l}=c,m=a.port??"3020",f=a.pretty??!0,p=t({url:`ws://localhost:${m}`,WebSocket:n}),u=e({links:[r({client:p})]});try{let e=await u.getEditorScene.mutate(),t=JSON.stringify(e,null,f?2:void 0);if(a.output){let e=i(a.output);await o(e,t,"utf-8"),l.success(`Scene saved: ${e}`)}else console.log(t)}catch(e){if(e instanceof Error){let t=e.cause;if(null!=t&&"object"==typeof t&&"code"in t&&"ECONNREFUSED"===t.code){l.error("Dev server not running. Start with `phoenix dev`"),await s(1);return}l.error(e.message)}else l.error(`Scene command failed: ${String(e)}`);await s(1)}finally{await p.close()}};
@@ -1 +1 @@
1
- import{createTRPCClient as e,createWSClient as t,wsLink as r}from"@trpc/client";import{resolve as o}from"path";import s from"ws";export const runScreenshotCommand=async(n,c)=>{let{logger:i}=c,a=n.port??"3020",l=n.output??"./screenshot.png",p=n.width??1920,h=n.height??1080,m=n.format?.toUpperCase()??"PNG";"PNG"!==m&&"JPEG"!==m&&(i.error(`Invalid format: ${m}. Use PNG or JPEG`),process.exit(1));let f=t({url:`ws://localhost:${a}`,WebSocket:s}),u=e({links:[r({client:f})]});try{let e=await u.takeScreenshot.mutate({width:p,height:h,fileFormat:m,output:o(l)});console.log(`Screenshot saved: ${e.filePath}`)}catch(e){if(e instanceof Error){let t=e.cause;null!=t&&"object"==typeof t&&"code"in t&&"ECONNREFUSED"===t.code&&(i.error("Dev server not running. Start with `phoenix dev`"),process.exit(1)),i.error(e.message)}else i.error(`Screenshot failed: ${String(e)}`);process.exit(1)}finally{await f.close()}};
1
+ import{createTRPCClient as e,createWSClient as t,wsLink as r}from"@trpc/client";import{resolve as o}from"path";import a from"ws";import{exitCli as i}from"../services/index.js";export const runScreenshotCommand=async(n,s)=>{let{logger:c}=s,l=n.port??"3020",p=n.output??"./screenshot.png",f=n.width??1920,h=n.height??1080,m=n.format?.toUpperCase()??"PNG";if("PNG"!==m&&"JPEG"!==m){c.error(`Invalid format: ${m}. Use PNG or JPEG`),await i(1);return}let u=t({url:`ws://localhost:${l}`,WebSocket:a}),d=e({links:[r({client:u})]});try{let e=await d.takeScreenshot.mutate({width:f,height:h,fileFormat:m,output:o(p)});console.log(`Screenshot saved: ${e.filePath}`)}catch(e){if(e instanceof Error){let t=e.cause;if(null!=t&&"object"==typeof t&&"code"in t&&"ECONNREFUSED"===t.code){c.error("Dev server not running. Start with `phoenix dev`"),await i(1);return}c.error(e.message)}else c.error(`Screenshot failed: ${String(e)}`);await i(1)}finally{await u.close()}};
@@ -1 +1 @@
1
- import{createTRPCClient as t,createWSClient as e,wsLink as o}from"@trpc/client";import{writeFile as r}from"fs/promises";import{resolve as i}from"path";import s from"ws";let n=["entities","navigation","validation"];export const runStateCommand=async(a,l)=>{let{logger:c}=l,p=a.port??"3020",m=a.pretty??!0,f=a.sections?a.sections.split(",").map(t=>t.trim()):[...n],u=f.filter(t=>!n.includes(t));u.length>0&&(c.error(`Invalid sections: ${u.join(", ")}. Valid: ${n.join(", ")}`),process.exit(1));let d=e({url:`ws://localhost:${p}`,WebSocket:s}),S=t({links:[o({client:d})]});try{let t=await S.getEditorState.mutate({sections:f}),e=JSON.stringify(t,null,m?2:void 0);if(a.output){let t=i(a.output);await r(t,e,"utf-8"),c.success(`State saved: ${t}`)}else console.log(e)}catch(t){if(t instanceof Error){let e=t.cause;null!=e&&"object"==typeof e&&"code"in e&&"ECONNREFUSED"===e.code&&(c.error("Dev server not running. Start with `phoenix dev`"),process.exit(1)),c.error(t.message)}else c.error(`State command failed: ${String(t)}`);process.exit(1)}finally{await d.close()}};
1
+ import{createTRPCClient as t,createWSClient as e,wsLink as i}from"@trpc/client";import{writeFile as r}from"fs/promises";import{resolve as o}from"path";import a from"ws";import{exitCli as n}from"../services/index.js";let s=["entities","navigation","validation"];export const runStateCommand=async(l,c)=>{let{logger:m}=c,f=l.port??"3020",p=l.pretty??!0,u=l.sections?l.sections.split(",").map(t=>t.trim()):[...s],d=u.filter(t=>!s.includes(t));if(d.length>0){m.error(`Invalid sections: ${d.join(", ")}. Valid: ${s.join(", ")}`),await n(1);return}let v=e({url:`ws://localhost:${f}`,WebSocket:a}),w=t({links:[i({client:v})]});try{let t=await w.getEditorState.mutate({sections:u}),e=JSON.stringify(t,null,p?2:void 0);if(l.output){let t=o(l.output);await r(t,e,"utf-8"),m.success(`State saved: ${t}`)}else console.log(e)}catch(t){if(t instanceof Error){let e=t.cause;if(null!=e&&"object"==typeof e&&"code"in e&&"ECONNREFUSED"===e.code){m.error("Dev server not running. Start with `phoenix dev`"),await n(1);return}m.error(t.message)}else m.error(`State command failed: ${String(t)}`);await n(1)}finally{await v.close()}};
@@ -1,3 +1,3 @@
1
- import r from"promise-queue";import{generateApplicationSpecStory as e}from"../application-spec/generate-application-spec-story.js";import{resolveGlobToDirectories as o}from"./resolve-story-directories.js";export const buildStoryInDirectory=async(r,o)=>{let{logger:t}=o;t.step(`Building Storybook example in ${r.targetDir}`),await e(r.targetDir,o),t.success(`Completed building Storybook example in ${r.targetDir}`)};export const runStoryBuildCommand=async(e,t)=>{let{logger:i}=t;try{let s=await o(e.folder,e.baseDir);if(0===s.length){let r=e.baseDir?`${e.baseDir}/${e.folder}`:e.folder;i.error(`No directories found matching pattern: ${r}. The pattern did not match any directories in the base directory, ensure the base directory exists and contains matching folders.`),process.exit(1)}console.log(`
2
- Found ${s.length} matching ${1===s.length?"directory":"directories"}:
3
- `),s.forEach(r=>{console.log(` - ${r}`)}),console.log("");let n=new r(4,1/0),a=[];if(await Promise.all(s.map(async r=>{try{await n.add(()=>buildStoryInDirectory({targetDir:r},t)),console.log("")}catch(e){i.error(`Failed to build story in ${r}: ${e instanceof Error?e.message:String(e)}`),console.log(e),a.push({dir:r,error:e instanceof Error?e:Error(String(e))})}})),a.length>0)throw i.error(`Failed to build ${a.length} ${1===a.length?"story":"stories"}:`),a.forEach(r=>{i.error(` - ${r.dir}: ${r.error.message}`)}),Error("Failed to build stories");i.success(`Completed building ${s.length} ${1===s.length?"story":"stories"}!`)}catch(r){throw i.error(`Story build failed: ${r instanceof Error?r.message:String(r)}`),r}};
1
+ import r from"promise-queue";import{generateApplicationSpecStory as e}from"../application-spec/generate-application-spec-story.js";import{exitCli as o}from"../services/index.js";import{resolveGlobToDirectories as t}from"./resolve-story-directories.js";export const buildStoryInDirectory=async(r,o)=>{let{logger:t}=o;t.step(`Building Storybook example in ${r.targetDir}`),await e(r.targetDir,o),t.success(`Completed building Storybook example in ${r.targetDir}`)};export const runStoryBuildCommand=async(e,i)=>{let{logger:s}=i;try{let n=await t(e.folder,e.baseDir);if(0===n.length){let r=e.baseDir?`${e.baseDir}/${e.folder}`:e.folder;s.error(`No directories found matching pattern: ${r}. The pattern did not match any directories in the base directory, ensure the base directory exists and contains matching folders.`),await o(1);return}console.log(`
2
+ Found ${n.length} matching ${1===n.length?"directory":"directories"}:
3
+ `),n.forEach(r=>{console.log(` - ${r}`)}),console.log("");let a=new r(4,1/0),l=[];if(await Promise.all(n.map(async r=>{try{await a.add(()=>buildStoryInDirectory({targetDir:r},i)),console.log("")}catch(e){s.error(`Failed to build story in ${r}: ${e instanceof Error?e.message:String(e)}`),console.log(e),l.push({dir:r,error:e instanceof Error?e:Error(String(e))})}})),l.length>0)throw s.error(`Failed to build ${l.length} ${1===l.length?"story":"stories"}:`),l.forEach(r=>{s.error(` - ${r.dir}: ${r.error.message}`)}),Error("Failed to build stories");s.success(`Completed building ${n.length} ${1===n.length?"story":"stories"}!`)}catch(r){throw s.error(`Story build failed: ${r instanceof Error?r.message:String(r)}`),r}};
@@ -1 +1 @@
1
- import{basename as r,join as e}from"path";import{generateInitialStory as t}from"../story-scaffolding/index.js";import{askQuestion as o,exists as s,toPascalCase as a}from"../utils/index.js";import{buildStoryInDirectory as i}from"./story-build.js";export const runStoryCreateCommand=async(n={},c)=>{let{logger:m}=c;try{m.step("Creating new Storybook example");let y=n.name;if(!y)for(;!y;){let r=await o('Enter the story name (e.g., "my-feature" or "MyFeature"): ');if(!r||0===r.trim().length){m.error("Story name is required");continue}if(!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(r)){m.error("Story name must start with a letter and contain only letters, numbers, hyphens, and underscores");continue}y=r.trim()}y||(m.error("Story name is required"),process.exit(1)),await s(e(process.cwd(),`src/${y}`))&&(m.error(`Story ${y} already exists`),process.exit(1));let l=e(process.cwd(),`src/examples/${y}`),d=a(r(l));await t(l,d),await i({targetDir:l},c),m.success(`Story created successfully in ${l}!`)}catch(r){m.error(`Story creation failed: ${r instanceof Error?r.message:String(r)}`,r),process.exit(1)}};
1
+ import{basename as r,join as e}from"path";import{exitCli as t}from"../services/index.js";import{generateInitialStory as a}from"../story-scaffolding/index.js";import{askQuestion as o,exists as i,toPascalCase as s}from"../utils/index.js";import{buildStoryInDirectory as n}from"./story-build.js";export const runStoryCreateCommand=async(m={},c)=>{let{logger:y}=c;try{y.step("Creating new Storybook example");let f=m.name;if(!f)for(;!f;){let r=await o('Enter the story name (e.g., "my-feature" or "MyFeature"): ');if(!r||0===r.trim().length){y.error("Story name is required");continue}if(!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(r)){y.error("Story name must start with a letter and contain only letters, numbers, hyphens, and underscores");continue}f=r.trim()}if(!f){y.error("Story name is required"),await t(1);return}if(await i(e(process.cwd(),`src/${f}`))){y.error(`Story ${f} already exists`),await t(1);return}let l=e(process.cwd(),`src/examples/${f}`),u=s(r(l));await a(l,u),await n({targetDir:l},c),y.success(`Story created successfully in ${l}!`)}catch(r){y.error(`Story creation failed: ${r instanceof Error?r.message:String(r)}`,r),await t(1)}};
@@ -1 +1 @@
1
- import{generateProjectFiles as e}from"../application-spec/index.js";export const runSyncCommand=async(s,c)=>{let{logger:i}=c,{sdkVersion:r,projectSlug:t,environmentSlug:n,cliUseWorkspace:o,enableEditor:l,force:p=!1,analyze:a=!1}=s;try{i.step("Syncing Phoenix project files"),i.step("Building project files"),await e({sdkVersion:r,projectSlug:t,environmentSlug:n,cliUseWorkspace:o,enableEditor:l,inlineTemplates:!0,force:p,analyze:a},c),i.success("Project files built successfully"),i.success("Sync completed successfully!")}catch(e){i.error(`Sync failed: ${e instanceof Error?e.message:String(e)}`,e),process.exit(1)}};
1
+ import{generateProjectFiles as e,logDiagnostics as s}from"../application-spec/index.js";import{exitCli as c}from"../services/index.js";export const runSyncCommand=async(i,r)=>{let{logger:t}=r,{sdkVersion:n,projectSlug:o,environmentSlug:l,cliUseWorkspace:a,enableEditor:p,force:f=!1,analyze:m=!1}=i;try{t.step("Syncing Phoenix project files"),t.step("Building project files");let{diagnostics:c}=await e({sdkVersion:n,projectSlug:o,environmentSlug:l,cliUseWorkspace:a,enableEditor:p,inlineTemplates:!0,force:f,analyze:m},r);s(c,t),t.success("Project files built successfully"),t.success("Sync completed successfully!")}catch(e){t.error(`Sync failed: ${e instanceof Error?e.message:String(e)}`,e),await c(1)}};
@@ -1 +1 @@
1
- import{createTRPCClient as e,createWSClient as t,wsLink as o}from"@trpc/client";import{existsSync as r,readFileSync as i,readdirSync as n,rmSync as a,statSync as s}from"fs";import{isAbsolute as l,join as c,relative as p,resolve as d,sep as h}from"path";import f from"ws";import{toPosixPath as w}from"../utils/path.js";let m=".phoenix",u="variants",v=".variant.js",g=".html",y={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},$=e=>{let t=e?.trim();return""===t?void 0:t},b=e=>$(e?.replace(/&(?:amp|lt|gt|quot|#39);/g,e=>y[e]??e)),C=(e,t)=>{let o=e.match(RegExp(`export\\s+const\\s+${t}\\s*=\\s*(['"\`])((?:\\\\.|(?!\\1).)*)\\1`))?.[2];return $(o?.replace(/\\(.)/g,"$1"))};export const readVariantSet=e=>{let t=d(e.projectRoot,m),o=c(t,u),a=d(e.projectRoot,e.directory),f=p(o,a),y=`${m}/${u}/<name>/`;if(""===f||".."===f||f.startsWith(`..${h}`)||l(f))throw Error(`Cannot preview ${e.directory}: the dev server only shows options from a folder of their own below ${m}/${u}/. Write the option files to ${y} and pass that folder`);if(!r(a)||!s(a).isDirectory())throw Error(`Cannot preview ${e.directory}: there is no such folder. Write one ${v} or ${g} file per option to ${y} first`);let $=n(a),E=Math.round(Math.max(0,...$.map(e=>s(c(a,e)).mtimeMs))),x=$.filter(e=>e.endsWith(v)||e.endsWith(g)).sort().map(e=>(e=>{let{webRoot:t,directory:o,name:r,version:n}=e,a=c(o,r),s=i(a,"utf8"),l=`/${w(p(t,a)).split("/").map(encodeURIComponent).join("/")}`,d=r.endsWith(v),h=r.slice(0,-(d?v:g).length),f=s.match(/<meta\b[^>]*\bname=(["'])description\1[^>]*>/i)?.[0];return{id:h,kind:d?"script":"page",label:(d?C(s,"title"):b(s.match(/<title[^>]*>([^<]*)<\/title>/i)?.[1]))??h,description:(d?C(s,"description"):b(f?.match(/\bcontent=(["'])(.*?)\1/i)?.[2]))??"",url:`${l}?t=${n}`}})({webRoot:t,directory:a,name:e,version:E}));if(0===x.length)throw Error(`Cannot preview ${e.directory}: it holds no ${v} or ${g} file, so there is no option to show. Write one file per option; any other file is a helper the options share`);let R=x.find((e,t)=>x.findIndex(t=>t.id===e.id)!==t);if(R)throw Error(`Cannot preview ${e.directory}: two options are named "${R.id}", and the answer names an option by its file name without the suffix. Rename one of the files`);return{directory:a,variantsRoot:o,options:x}};let E=r=>{let i=t({url:`ws://localhost:${r}`,WebSocket:f});return{wsClient:i,client:e({links:[o({client:i})]})}},x=e=>{console.log(JSON.stringify(e,null,2))},R=async e=>{let{wsClient:t,client:o}=E(e);try{let{closed:e}=await o.closeVariantPreview.mutate();x({status:"closed",message:e?"The open preview was closed.":"No preview was open."})}finally{await t.close()}},S=async(e,t,o,i)=>{let{wsClient:s,client:l}=E(t.port);try{let s=await l.previewVariants.mutate({title:t.title??"Which option do you prefer?",description:t.description??"",variants:[...e.options],timeoutMs:o});if("waiting"===s.status)return void x({status:"waiting",message:"The preview is still open and nothing was picked yet. Run the same command again to keep waiting."});if("closed"===s.status)return void x({status:"closed",message:"The preview was closed before an answer was given. The option folder is kept."});await l.claimVariantChoice.mutate({requestId:s.requestId});let c=e.options.find(e=>e.id===s.choice);if(x({status:"chosen",choice:s.choice,label:c?.label??"Original"}),!t.keep)try{a(e.directory,{recursive:!0,force:!0}),r(e.variantsRoot)&&0===n(e.variantsRoot).length&&a(e.variantsRoot,{recursive:!0,force:!0})}catch(t){i.logger.warn(`Could not remove ${e.directory} after the answer: ${t instanceof Error?t.message:String(t)}. Remove the folder yourself`)}}finally{await s.close()}};export const runVariantsCommand=async(e,t)=>{let{logger:o}=t;try{if(e.close)return void await R(e.port);if(void 0===e.directory)throw Error(`Cannot preview without a folder: the options to show are read from it. Pass ${m}/${u}/<name>/, or --close to close the open preview`);let o=(e=>{let t=Math.round((e??540)*1e3);if(!Number.isFinite(t)||t<=0)throw Error(`Cannot wait for ${e} seconds: --timeout is how long the command waits for the answer. Pass a positive number of seconds`);if(t>0x7fffffff)throw Error(`Cannot wait for ${e} seconds: a wait is at most ${Math.floor(2147483.647)} seconds. Pass a smaller --timeout and run the command again while it answers "waiting"`);return t})(e.timeout),r=readVariantSet({projectRoot:process.cwd(),directory:e.directory});await S(r,e,o,t)}catch(e){o.error((e=>{let t;if(!(e instanceof Error))return`Variant preview failed: ${String(e)}`;let o=e.cause;return null!=o&&"object"==typeof o&&"code"in o&&"ECONNREFUSED"===o.code?"Dev server not running. Start with `phoenix dev`":"object"==typeof(t="data"in e?e.data:void 0)&&null!==t&&"code"in t&&"NOT_FOUND"===t.code?"Cannot preview: the dev server that is running has no variant previews, because it runs the legacy pipeline or an older SDK. Variant previews need `phoenix dev` of a project on the application-spec pipeline, started with this SDK version":e.message})(e)),process.exit(1)}};
1
+ import{createTRPCClient as e,createWSClient as t,wsLink as o}from"@trpc/client";import{existsSync as r,readFileSync as i,readdirSync as n,rmSync as a,statSync as s}from"fs";import{isAbsolute as l,join as c,relative as p,resolve as d,sep as h}from"path";import f from"ws";import{exitCli as w}from"../services/index.js";import{toPosixPath as m}from"../utils/path.js";let u=".phoenix",v="variants",g=".variant.js",y=".html",$={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},b=e=>{let t=e?.trim();return""===t?void 0:t},C=e=>b(e?.replace(/&(?:amp|lt|gt|quot|#39);/g,e=>$[e]??e)),E=(e,t)=>{let o=e.match(RegExp(`export\\s+const\\s+${t}\\s*=\\s*(['"\`])((?:\\\\.|(?!\\1).)*)\\1`))?.[2];return b(o?.replace(/\\(.)/g,"$1"))};export const readVariantSet=e=>{let t=d(e.projectRoot,u),o=c(t,v),a=d(e.projectRoot,e.directory),f=p(o,a),w=`${u}/${v}/<name>/`;if(""===f||".."===f||f.startsWith(`..${h}`)||l(f))throw Error(`Cannot preview ${e.directory}: the dev server only shows options from a folder of their own below ${u}/${v}/. Write the option files to ${w} and pass that folder`);if(!r(a)||!s(a).isDirectory())throw Error(`Cannot preview ${e.directory}: there is no such folder. Write one ${g} or ${y} file per option to ${w} first`);let $=n(a),b=Math.round(Math.max(0,...$.map(e=>s(c(a,e)).mtimeMs))),x=$.filter(e=>e.endsWith(g)||e.endsWith(y)).sort().map(e=>(e=>{let{webRoot:t,directory:o,name:r,version:n}=e,a=c(o,r),s=i(a,"utf8"),l=`/${m(p(t,a)).split("/").map(encodeURIComponent).join("/")}`,d=r.endsWith(g),h=r.slice(0,-(d?g:y).length),f=s.match(/<meta\b[^>]*\bname=(["'])description\1[^>]*>/i)?.[0];return{id:h,kind:d?"script":"page",label:(d?E(s,"title"):C(s.match(/<title[^>]*>([^<]*)<\/title>/i)?.[1]))??h,description:(d?E(s,"description"):C(f?.match(/\bcontent=(["'])(.*?)\1/i)?.[2]))??"",url:`${l}?t=${n}`}})({webRoot:t,directory:a,name:e,version:b}));if(0===x.length)throw Error(`Cannot preview ${e.directory}: it holds no ${g} or ${y} file, so there is no option to show. Write one file per option; any other file is a helper the options share`);let R=x.find((e,t)=>x.findIndex(t=>t.id===e.id)!==t);if(R)throw Error(`Cannot preview ${e.directory}: two options are named "${R.id}", and the answer names an option by its file name without the suffix. Rename one of the files`);return{directory:a,variantsRoot:o,options:x}};let x=r=>{let i=t({url:`ws://localhost:${r}`,WebSocket:f});return{wsClient:i,client:e({links:[o({client:i})]})}},R=e=>{console.log(JSON.stringify(e,null,2))},j=async e=>{let{wsClient:t,client:o}=x(e);try{let{closed:e}=await o.closeVariantPreview.mutate();R({status:"closed",message:e?"The open preview was closed.":"No preview was open."})}finally{await t.close()}},S=async(e,t,o,i)=>{let{wsClient:s,client:l}=x(t.port);try{let s=await l.previewVariants.mutate({title:t.title??"Which option do you prefer?",description:t.description??"",variants:[...e.options],timeoutMs:o});if("waiting"===s.status)return void R({status:"waiting",message:"The preview is still open and nothing was picked yet. Run the same command again to keep waiting."});if("closed"===s.status)return void R({status:"closed",message:"The preview was closed before an answer was given. The option folder is kept."});await l.claimVariantChoice.mutate({requestId:s.requestId});let c=e.options.find(e=>e.id===s.choice);if(R({status:"chosen",choice:s.choice,label:c?.label??"Original"}),!t.keep)try{a(e.directory,{recursive:!0,force:!0}),r(e.variantsRoot)&&0===n(e.variantsRoot).length&&a(e.variantsRoot,{recursive:!0,force:!0})}catch(t){i.logger.warn(`Could not remove ${e.directory} after the answer: ${t instanceof Error?t.message:String(t)}. Remove the folder yourself`)}}finally{await s.close()}};export const runVariantsCommand=async(e,t)=>{let{logger:o}=t;try{if(e.close)return void await j(e.port);if(void 0===e.directory)throw Error(`Cannot preview without a folder: the options to show are read from it. Pass ${u}/${v}/<name>/, or --close to close the open preview`);let o=(e=>{let t=Math.round((e??540)*1e3);if(!Number.isFinite(t)||t<=0)throw Error(`Cannot wait for ${e} seconds: --timeout is how long the command waits for the answer. Pass a positive number of seconds`);if(t>0x7fffffff)throw Error(`Cannot wait for ${e} seconds: a wait is at most ${Math.floor(2147483.647)} seconds. Pass a smaller --timeout and run the command again while it answers "waiting"`);return t})(e.timeout),r=readVariantSet({projectRoot:process.cwd(),directory:e.directory});await S(r,e,o,t)}catch(e){o.error((e=>{let t;if(!(e instanceof Error))return`Variant preview failed: ${String(e)}`;let o=e.cause;return null!=o&&"object"==typeof o&&"code"in o&&"ECONNREFUSED"===o.code?"Dev server not running. Start with `phoenix dev`":"object"==typeof(t="data"in e?e.data:void 0)&&null!==t&&"code"in t&&"NOT_FOUND"===t.code?"Cannot preview: the dev server that is running has no variant previews, because it runs the legacy pipeline or an older SDK. Variant previews need `phoenix dev` of a project on the application-spec pipeline, started with this SDK version":e.message})(e)),await w(1)}};
@@ -0,0 +1 @@
1
+ export { LINGUI_CONFIG_PATH, bootstrapLinguiCatalogs, compileLingui, extractAndCompileLingui } from './lingui.js';
@@ -0,0 +1 @@
1
+ export{LINGUI_CONFIG_PATH,bootstrapLinguiCatalogs,compileLingui,extractAndCompileLingui}from"./lingui.js";
@@ -1,10 +1,11 @@
1
1
  import { type Logger } from '../utils/index.js';
2
2
  /**
3
3
  * The project's Lingui configuration, which sync generates, relative to the project root. The Lingui
4
- * CLI, the Lingui Vite plugin and the Lingui macros in the Vite builds are always given this path, so a
4
+ * CLI, the Lingui Vite plugin and the Lingui macros in the Vite builds are given this path, so a
5
5
  * `.linguirc` that earlier SDK versions left in the project root is not read. Lingui searches the
6
6
  * working directory instead only when the named file is missing; generation writes it with the rest of
7
- * `.phoenix/` before Phoenix runs Lingui or Vite.
7
+ * `.phoenix/` before Phoenix runs Lingui or Vite. Missing-catalog bootstrap compiles with a temporary
8
+ * copy that stages output while keeping every locale available for fallback reads.
8
9
  */
9
10
  export declare const LINGUI_CONFIG_PATH = ".phoenix/.linguirc";
10
11
  interface LinguiCommandContext {
@@ -12,4 +13,6 @@ interface LinguiCommandContext {
12
13
  }
13
14
  export declare const compileLingui: (context: LinguiCommandContext) => Promise<void>;
14
15
  export declare const extractAndCompileLingui: (context: LinguiCommandContext) => Promise<void>;
16
+ /** Creates only catalogs missing from a project's generated domain imports; continuous updates stay opt-in. */
17
+ export declare const bootstrapLinguiCatalogs: (locales: readonly string[], context: LinguiCommandContext) => Promise<void>;
15
18
  export {};
@@ -0,0 +1 @@
1
+ import{constants as i}from"node:fs";import{copyFile as a,mkdir as t,mkdtemp as e,readFile as o,rm as n,writeFile as s}from"node:fs/promises";import{dirname as r,join as l}from"node:path";import{exists as c,runSdkTool as g}from"../utils/index.js";export const LINGUI_CONFIG_PATH=".phoenix/.linguirc";let p=async i=>{await g({tool:{packageName:"@lingui/cli",binName:"lingui"},args:["extract","--config",LINGUI_CONFIG_PATH],description:"Extracting i18n messages",quiet:!0,extraEnv:{LC_ALL:"en_US.UTF-8"}},i)};export const compileLingui=async i=>{await g({tool:{packageName:"@lingui/cli",binName:"lingui"},args:["compile","--config",LINGUI_CONFIG_PATH],description:"Compiling i18n messages",quiet:!0},i)};export const extractAndCompileLingui=async i=>{await p(i),await compileLingui(i)};export const bootstrapLinguiCatalogs=async(p,m)=>{let u,f=(await Promise.all(p.map(async i=>await c(`src/locales/${i}/messages.ts`)?[]:[i]))).flat();if(0!==f.length)try{m.logger.info(`Bootstrapping missing i18n catalogs: ${f.join(", ")}`);let n=(await Promise.all(f.map(async i=>await c(`src/locales/${i}/messages.po`)?[]:[i]))).flat();n.length>0&&await g({tool:{packageName:"@lingui/cli",binName:"lingui"},args:["extract","--config",LINGUI_CONFIG_PATH,"--locale",n.join(",")],description:"Extracting missing i18n catalogs",quiet:!0,extraEnv:{LC_ALL:"en_US.UTF-8"}},m);let p=JSON.parse(await o(LINGUI_CONFIG_PATH,"utf-8"));if("object"!=typeof p||null===p||Array.isArray(p))throw Error(`${LINGUI_CONFIG_PATH} is not a configuration object`);u=await e(".phoenix/lingui-bootstrap-");let N=l(u,".linguirc");for(let e of(await s(N,JSON.stringify({...p,catalogsMergePath:l(u,"compiled","{locale}","messages").replaceAll("\\","/")})),await g({tool:{packageName:"@lingui/cli",binName:"lingui"},args:["compile","--config",N],description:"Compiling missing i18n catalogs",quiet:!0},m),f)){let o=l("src","locales",e,"messages.ts");await t(r(o),{recursive:!0}),await a(l(u,"compiled",e,"messages.ts"),o,i.COPYFILE_EXCL)}}catch(i){throw Error(`Cannot bootstrap i18n catalogs for ${f.join(", ")}: ${i instanceof Error?i.message:String(i)}. Fix the reported Lingui error and restart phoenix dev, or run phoenix sync to update all catalogs.`,{cause:i})}finally{void 0!==u&&await n(u,{recursive:!0,force:!0})}};
@@ -1,4 +1,5 @@
1
1
  import { type ViteDevServer } from 'vite';
2
+ import type { ApplicationSpec } from '#package/application-spec';
2
3
  import type { Logger } from '../utils/index.js';
3
4
  import type { PhoenixPubSub } from './phoenix-pubsub.js';
4
5
  import type { VariantFileEdit } from './variant-file-session.js';
@@ -8,7 +9,8 @@ export declare const IGNORED_PATTERNS: string[];
8
9
  export interface ApplicationSpecProjectWatcherConfig {
9
10
  readonly pubsub: PhoenixPubSub;
10
11
  readonly logger: Logger;
11
- readonly onRebuilt?: () => void;
12
+ /** Called with the application spec of every rebuild that succeeded. */
13
+ readonly onRebuilt?: (applicationSpec: ApplicationSpec) => void;
12
14
  readonly onViteServerChange?: (viteServer: ViteDevServer) => void;
13
15
  readonly sdkVersion: string;
14
16
  readonly projectSlug: string;
@@ -1,4 +1,4 @@
1
- import{mkdirSync as e}from"fs";import{resolve as t}from"path";import i from"promise-queue";import{Subject as s,buffer as r,debounceTime as o}from"rxjs";import{createServer as n,normalizePath as l}from"vite";import{watch as h}from"#package/watch";import{ApplicationSpecBuilder as a}from"../application-spec/application-spec-builder.js";import{logDiagnostics as c}from"../application-spec/metrics/index.js";import{syncTemplateFiles as u}from"../application-spec/template-files.js";import{buildWebhooks as p}from"../webhooks/index.js";import{getViteDevConfig as g}from"./vite-config.js";export const WATCH_PATTERNS=["spec/**/*.{yaml,yml}","src/**/*.{ts,tsx,yaml,yml,json,html,css}","templates/*.html",".env",".env.generated",".phoenix/.env.generated"];export const IGNORED_PATTERNS=["src/locales/**/*.{ts,tsx}",".phoenix/!(.env.generated)/**"];export class ApplicationSpecProjectWatcher{watcher=null;subscription=null;rebuildQueue=new i(1,1/0);changeSubject$=new s;viteServer=null;pubsub;logger;onRebuilt;onViteServerChange;builder;useServer;isShuttingDown=!1;suspended=!1;heldChanges=new Set;constructor(e){this.pubsub=e.pubsub,this.logger=e.logger,this.onRebuilt=e.onRebuilt,this.onViteServerChange=e.onViteServerChange,this.builder=new a({logger:e.logger,sdkVersion:e.sdkVersion,projectSlug:e.projectSlug,environmentSlug:e.environmentSlug,cliUseWorkspace:e.cliUseWorkspace,enableEditor:e.enableEditor,inlineTemplates:e.inlineTemplates}),this.useServer=e.useServer}start(e){this.viteServer=e,this.setupFileWatcher(),this.setupRebuildSubscription()}applyVariantFiles(e){this.rebuildQueue.add(async()=>{this.isShuttingDown||await this.rebuild(new Set(e.map(e=>e.fileName)),!1,!0)})}suspend(){this.suspended=!0}resume(){for(let e of(this.suspended=!1,this.heldChanges))this.changeSubject$.next(e);this.heldChanges.clear()}async close(){this.isShuttingDown=!0,this.watcher&&(await this.watcher.close(),this.watcher=null),this.subscription?.unsubscribe(),this.changeSubject$.complete()}setupFileWatcher(){e(t(process.cwd(),"src"),{recursive:!0}),this.watcher=h(WATCH_PATTERNS,{ignored:IGNORED_PATTERNS,cwd:process.cwd(),persistent:!0,ignoreInitial:!1}),this.watcher.on("all",(e,t)=>{if("change"===e||"add"===e||"unlink"===e){if(this.suspended)return void this.heldChanges.add(t);this.logger.info(`
1
+ import{mkdirSync as e}from"fs";import{resolve as t}from"path";import i from"promise-queue";import{Subject as s,buffer as r,debounceTime as o}from"rxjs";import{createServer as n,normalizePath as l}from"vite";import{watch as a}from"#package/watch";import{ApplicationSpecBuilder as h}from"../application-spec/application-spec-builder.js";import{logDiagnostics as c}from"../application-spec/metrics/index.js";import{syncTemplateFiles as u}from"../application-spec/template-files.js";import{buildWebhooks as p}from"../webhooks/index.js";import{getViteDevConfig as g}from"./vite-config.js";export const WATCH_PATTERNS=["package.json","spec/**/*.{yaml,yml}","src/**/*.{ts,tsx,yaml,yml,json,html,css}","templates/*.html",".env",".env.generated",".phoenix/.env.generated"];export const IGNORED_PATTERNS=["src/locales/**/*.{ts,tsx}",".phoenix/!(.env.generated)/**"];export class ApplicationSpecProjectWatcher{watcher=null;subscription=null;rebuildQueue=new i(1,1/0);changeSubject$=new s;viteServer=null;pubsub;logger;onRebuilt;onViteServerChange;builder;useServer;isShuttingDown=!1;suspended=!1;heldChanges=new Set;constructor(e){this.pubsub=e.pubsub,this.logger=e.logger,this.onRebuilt=e.onRebuilt,this.onViteServerChange=e.onViteServerChange,this.builder=new h({logger:e.logger,sdkVersion:e.sdkVersion,projectSlug:e.projectSlug,environmentSlug:e.environmentSlug,cliUseWorkspace:e.cliUseWorkspace,enableEditor:e.enableEditor,inlineTemplates:e.inlineTemplates}),this.useServer=e.useServer}start(e){this.viteServer=e,this.setupFileWatcher(),this.setupRebuildSubscription()}applyVariantFiles(e){this.rebuildQueue.add(async()=>{this.isShuttingDown||await this.rebuild(new Set(e.map(e=>e.fileName)),!1,!0)})}suspend(){this.suspended=!0}resume(){for(let e of(this.suspended=!1,this.heldChanges))this.changeSubject$.next(e);this.heldChanges.clear()}async close(){this.isShuttingDown=!0,this.watcher&&(await this.watcher.close(),this.watcher=null),this.subscription?.unsubscribe(),this.changeSubject$.complete()}setupFileWatcher(){e(t(process.cwd(),"src"),{recursive:!0}),this.watcher=a(WATCH_PATTERNS,{ignored:IGNORED_PATTERNS,cwd:process.cwd(),persistent:!0,ignoreInitial:!1}),this.watcher.on("all",(e,t)=>{if("change"===e||"add"===e||"unlink"===e){if(this.suspended)return void this.heldChanges.add(t);this.logger.info(`
2
2
  📝 Detected ${e}: ${t}`),this.changeSubject$.next(t)}})}setupRebuildSubscription(){let e=this.changeSubject$.pipe(o(10));this.subscription=this.changeSubject$.pipe(r(e)).subscribe(e=>{let t=new Set(e),i=t.has(".env");this.rebuildQueue.add(async()=>{this.isShuttingDown||(this.logger.info(`
3
3
  🔨 Rebuilding spec files...
4
- `),await this.rebuild(t,i,!1))})})}async rebuild(e,i,s){try{let r=this.viteServer;if(!r)throw Error("Cannot rebuild the project: the watcher has no Vite server yet, because it was not started. Start the watcher before applying files");let o=await u();if(this.isShuttingDown)return;let h=await this.builder.build({compile:!s});if(this.isShuttingDown)return;if(c(h.diagnostics,this.logger),!h.ok){for(let e of h.errors)this.logger.error(`[${e.code}] ${e.message}${e.file?` (${e.file})`:""}`);this.pubsub.specFile$.next({rawProjectFiles:h.rawProjectFiles,projectRoot:process.cwd()});return}this.onRebuilt?.();let{application:a,changedFiles:d}=h,w=r.moduleGraph,b=Date.now(),f=new Set,S=process.cwd(),m=e=>{let t=w.getModulesByFile(l(e));if(t)for(let e of t)w.invalidateModule(e,f,b,!0)};for(let i of e)m(t(S,i));for(let e of d)m(t(S,`.phoenix/${e.path}`));if(this.pubsub.specFile$.next({rawProjectFiles:a.rawProjectFiles,projectRoot:process.cwd(),configurationSchemaHash:a.applicationSpec.configurator.configurationSchema.hash}),this.isShuttingDown)return;if(i){if(await r.close(),this.isShuttingDown)return;let e=await g({templateFiles:o});if(this.isShuttingDown)return;let t=await n(e);if(this.isShuttingDown||(await t.listen(),this.isShuttingDown))return void await t.close();this.viteServer=t,this.onViteServerChange?.(t),this.logger.success("Vite server restarted (env changed)")}if(this.useServer&&!s){if(this.logger.step("Building webhooks"),await p({experimental:!0,skipNodeEnvOverride:!0,webhookEntryPoint:"./.phoenix/.swc/.phoenix/webhook.js",preserveExistingOutput:!0}),this.isShuttingDown)return;this.logger.success("Webhooks rebuilt successfully")}this.logger.success("Project files rebuilt successfully")}catch(e){this.logger.error(`Build failed: ${e instanceof Error?e.message:String(e)}`,e)}}}
4
+ `),await this.rebuild(t,i,!1))})})}async rebuild(e,i,s){try{let r=this.viteServer;if(!r)throw Error("Cannot rebuild the project: the watcher has no Vite server yet, because it was not started. Start the watcher before applying files");let o=await u();if(this.isShuttingDown)return;let a=await this.builder.build({compile:!s});if(this.isShuttingDown)return;if(c(a.diagnostics,this.logger),!a.ok){for(let e of a.errors)this.logger.error(`[${e.code}] ${e.message}${e.file?` (${e.file})`:""}`);this.pubsub.specFile$.next({rawProjectFiles:a.rawProjectFiles,projectRoot:process.cwd()});return}let{application:h,changedFiles:d}=a;this.onRebuilt?.(h.applicationSpec);let w=r.moduleGraph,b=Date.now(),f=new Set,S=process.cwd(),m=e=>{let t=w.getModulesByFile(l(e));if(t)for(let e of t)w.invalidateModule(e,f,b,!0)};for(let i of e)m(t(S,i));for(let e of d)m(t(S,`.phoenix/${e.path}`));if(this.pubsub.specFile$.next({rawProjectFiles:h.rawProjectFiles,projectRoot:process.cwd(),configurationSchemaHash:h.applicationSpec.configurator.configurationSchema.hash}),this.isShuttingDown)return;if(i){if(await r.close(),this.isShuttingDown)return;let e=await g({templateFiles:o});if(this.isShuttingDown)return;let t=await n(e);if(this.isShuttingDown||(await t.listen(),this.isShuttingDown))return void await t.close();this.viteServer=t,this.onViteServerChange?.(t),this.logger.success("Vite server restarted (env changed)")}if(this.useServer&&!s){if(this.logger.step("Building webhooks"),await p({experimental:!0,skipNodeEnvOverride:!0,webhookEntryPoint:"./.phoenix/.swc/.phoenix/webhook.js",preserveExistingOutput:!0}),this.isShuttingDown)return;this.logger.success("Webhooks rebuilt successfully")}this.logger.success("Project files rebuilt successfully")}catch(e){this.logger.error(`Build failed: ${e instanceof Error?e.message:String(e)}`,e)}}}
@@ -5,6 +5,7 @@ import { z } from 'zod';
5
5
  declare const ServerCredentials: z.ZodObject<{
6
6
  token: z.ZodString;
7
7
  userId: z.ZodString;
8
+ customerId: z.ZodOptional<z.ZodString>;
8
9
  customerSlug: z.ZodString;
9
10
  customerName: z.ZodString;
10
11
  studioUrl: z.ZodOptional<z.ZodString>;
@@ -12,6 +13,7 @@ declare const ServerCredentials: z.ZodObject<{
12
13
  }, "strip", z.ZodTypeAny, {
13
14
  token: string;
14
15
  userId: string;
16
+ customerId?: string | undefined;
15
17
  customerSlug: string;
16
18
  customerName: string;
17
19
  studioUrl?: string | undefined;
@@ -19,6 +21,7 @@ declare const ServerCredentials: z.ZodObject<{
19
21
  }, {
20
22
  token: string;
21
23
  userId: string;
24
+ customerId?: string | undefined;
22
25
  customerSlug: string;
23
26
  customerName: string;
24
27
  studioUrl?: string | undefined;
@@ -1,2 +1,2 @@
1
- import{chmod as e,mkdir as r,readFile as t,writeFile as s}from"node:fs/promises";import{homedir as n}from"node:os";import{dirname as a,join as i}from"node:path";import{z as o}from"zod";let l=o.object({token:o.string().min(1),userId:o.string(),customerSlug:o.string(),customerName:o.string(),studioUrl:o.string().optional(),createdAt:o.string()}),c=o.object({version:o.literal(1),servers:o.record(o.string(),l)}),d={version:1,servers:{}};export const getCredentialsPath=()=>process.env.PHOENIX_CREDENTIALS_FILE??i(n(),".phoenix","credentials.json");let u=e=>new URL(e).origin,g=async()=>{let e;try{e=await t(getCredentialsPath(),"utf8")}catch(e){if(e instanceof Error&&"code"in e&&"ENOENT"===e.code)return d;throw e}let r=c.safeParse((e=>{try{return JSON.parse(e)}catch{return null}})(e));if(!r.success)throw Error(`The credentials file ${getCredentialsPath()} is not valid. Delete it and run \`phoenix login\` again.`);return r.data},m=async t=>{let n=getCredentialsPath();return await r(a(n),{recursive:!0,mode:448}),await s(n,`${JSON.stringify(t,null,2)}
1
+ import{chmod as e,mkdir as r,readFile as t,writeFile as s}from"node:fs/promises";import{homedir as n}from"node:os";import{dirname as i,join as o}from"node:path";import{z as a}from"zod";let l=a.object({token:a.string().min(1),userId:a.string(),customerId:a.string().uuid().optional(),customerSlug:a.string(),customerName:a.string(),studioUrl:a.string().optional(),createdAt:a.string()}),c=a.object({version:a.literal(1),servers:a.record(a.string(),l)}),d={version:1,servers:{}};export const getCredentialsPath=()=>process.env.PHOENIX_CREDENTIALS_FILE??o(n(),".phoenix","credentials.json");let u=e=>new URL(e).origin,g=async()=>{let e;try{e=await t(getCredentialsPath(),"utf8")}catch(e){if(e instanceof Error&&"code"in e&&"ENOENT"===e.code)return d;throw e}let r=c.safeParse((e=>{try{return JSON.parse(e)}catch{return null}})(e));if(!r.success)throw Error(`The credentials file ${getCredentialsPath()} is not valid. Delete it and run \`phoenix login\` again.`);return r.data},m=async t=>{let n=getCredentialsPath();return await r(i(n),{recursive:!0,mode:448}),await s(n,`${JSON.stringify(t,null,2)}
2
2
  `,{mode:384}),await e(n,384),n};export const getServerCredentials=async e=>(await g()).servers[u(e)]??null;export const saveServerCredentials=async(e,r)=>{let t=await g();return m({...t,servers:{...t.servers,[u(e)]:r}})};export const removeServerCredentials=async e=>{let r=await g(),{[u(e)]:t,...s}=r.servers;await m({...r,servers:s})};
@@ -0,0 +1,5 @@
1
+ type BeforeCliExit = (exitCode: number) => Promise<void>;
2
+ export declare const setBeforeCliExit: (handler: BeforeCliExit) => (() => void);
3
+ /** Gives the Phoenix CLI a chance to finish best-effort work, then preserves process.exit semantics. */
4
+ export declare const exitCli: (exitCode: number) => Promise<never>;
5
+ export {};
@@ -0,0 +1 @@
1
+ let t=null;export const setBeforeCliExit=e=>(t=e,()=>{t===e&&(t=null)});export const exitCli=async e=>{try{await t?.(e)}finally{process.exit(e)}};
@@ -8,6 +8,7 @@ export { MockTemplateWatcher, type MockTemplateWatcherConfig } from './mock-temp
8
8
  export { ApplicationSpecProjectWatcher, type ApplicationSpecProjectWatcherConfig, } from './application-spec-project-watcher.js';
9
9
  export { ApplicationSpecStoryWatcher, type ApplicationSpecStoryWatcherConfig, } from './application-spec-story-watcher.js';
10
10
  export { LinguiWatcher, type LinguiWatcherConfig } from './lingui-watcher.js';
11
+ export { bootstrapLinguiCatalogs, extractAndCompileLingui } from '../lingui/index.js';
11
12
  export { loadMockTemplates, parseMockTemplateYaml, type LoadMockTemplatesResult, type ParsedMockTemplate, } from './spec-files.js';
12
13
  export { LOG_STREAMS, LogBus, type LogEntry, type LogLevel, type LogPage, type LogQuery, type LogStream, } from './log-bus.js';
13
14
  export { createBusLogger, type CreateBusLoggerOptions } from './bus-logger.js';
@@ -18,6 +19,8 @@ export { STORY_DEV_MARKER_PATH, readActiveStoryDevMarker, type StoryDevMarker }
18
19
  export { composeDefaultBanner } from './phx-banner-plugin.js';
19
20
  export { getViteBuildConfigs, getViteDevConfig, setViteLogSink, type ViteLogSink, type ViteLogSinkOptions, } from './vite-config.js';
20
21
  export { getServerCredentials, removeServerCredentials, saveServerCredentials } from './cli-credentials.js';
22
+ export { exitCli, setBeforeCliExit } from './cli-exit.js';
21
23
  export { createSourceArchive, extractSourceArchive } from './source-archive.js';
22
24
  export { resolveSignedInDevelopmentEnvironment } from './signed-in-development-environment.js';
25
+ export { createTelemetryClient, resolveTelemetryCommand, type CommandTelemetryAttempt, type TelemetryAssociation, type TelemetryClient, type TelemetryCommand, } from './telemetry/index.js';
23
26
  export { DEFAULT_PHOENIX_REGION, PHOENIX_REGIONS, PUBLIC_PHOENIX_REGIONS, getRegionServerUrl, getRegionStudioUrl, } from './phoenix-regions.js';
@@ -1 +1 @@
1
- export{PhoenixPubSub}from"./phoenix-pubsub.js";export{PhoenixStore}from"./phoenix-store.js";export{PhoenixApplication}from"./phoenix-application.js";export{VariantFileSession}from"./variant-file-session.js";export{VariantPreviewService}from"./variant-preview-service.js";export{MockTemplateWatcher}from"./mock-template-watcher.js";export{ApplicationSpecProjectWatcher}from"./application-spec-project-watcher.js";export{ApplicationSpecStoryWatcher}from"./application-spec-story-watcher.js";export{LinguiWatcher}from"./lingui-watcher.js";export{loadMockTemplates,parseMockTemplateYaml}from"./spec-files.js";export{LOG_STREAMS,LogBus}from"./log-bus.js";export{createBusLogger}from"./bus-logger.js";export{patchConsole}from"./console-capture.js";export{WebhookTunnelMonitor}from"./webhook-tunnel-monitor.js";export{compileWithSwc,watchWithSwc}from"./swc.js";export{STORY_DEV_MARKER_PATH,readActiveStoryDevMarker}from"./story-dev-marker.js";export{composeDefaultBanner}from"./phx-banner-plugin.js";export{getViteBuildConfigs,getViteDevConfig,setViteLogSink}from"./vite-config.js";export{getServerCredentials,removeServerCredentials,saveServerCredentials}from"./cli-credentials.js";export{createSourceArchive,extractSourceArchive}from"./source-archive.js";export{resolveSignedInDevelopmentEnvironment}from"./signed-in-development-environment.js";export{DEFAULT_PHOENIX_REGION,PHOENIX_REGIONS,PUBLIC_PHOENIX_REGIONS,getRegionServerUrl,getRegionStudioUrl}from"./phoenix-regions.js";
1
+ export{PhoenixPubSub}from"./phoenix-pubsub.js";export{PhoenixStore}from"./phoenix-store.js";export{PhoenixApplication}from"./phoenix-application.js";export{VariantFileSession}from"./variant-file-session.js";export{VariantPreviewService}from"./variant-preview-service.js";export{MockTemplateWatcher}from"./mock-template-watcher.js";export{ApplicationSpecProjectWatcher}from"./application-spec-project-watcher.js";export{ApplicationSpecStoryWatcher}from"./application-spec-story-watcher.js";export{LinguiWatcher}from"./lingui-watcher.js";export{bootstrapLinguiCatalogs,extractAndCompileLingui}from"../lingui/index.js";export{loadMockTemplates,parseMockTemplateYaml}from"./spec-files.js";export{LOG_STREAMS,LogBus}from"./log-bus.js";export{createBusLogger}from"./bus-logger.js";export{patchConsole}from"./console-capture.js";export{WebhookTunnelMonitor}from"./webhook-tunnel-monitor.js";export{compileWithSwc,watchWithSwc}from"./swc.js";export{STORY_DEV_MARKER_PATH,readActiveStoryDevMarker}from"./story-dev-marker.js";export{composeDefaultBanner}from"./phx-banner-plugin.js";export{getViteBuildConfigs,getViteDevConfig,setViteLogSink}from"./vite-config.js";export{getServerCredentials,removeServerCredentials,saveServerCredentials}from"./cli-credentials.js";export{exitCli,setBeforeCliExit}from"./cli-exit.js";export{createSourceArchive,extractSourceArchive}from"./source-archive.js";export{resolveSignedInDevelopmentEnvironment}from"./signed-in-development-environment.js";export{createTelemetryClient,resolveTelemetryCommand}from"./telemetry/index.js";export{DEFAULT_PHOENIX_REGION,PHOENIX_REGIONS,PUBLIC_PHOENIX_REGIONS,getRegionServerUrl,getRegionStudioUrl}from"./phoenix-regions.js";
@@ -1 +1 @@
1
- import e from"promise-queue";import{Subject as t,buffer as i,debounceTime as s}from"rxjs";import{watch as r}from"#package/watch";import{compileLingui as n,extractAndCompileLingui as o}from"./lingui.js";let c=["src/**/*.{ts,tsx}","src/locales/**/*.po"],g=["src/locales/**/*.{ts,tsx}"];export class LinguiWatcher{watcher=null;subscription=null;runQueue=new e(1,1/0);changeSubject$=new t;logger;isShuttingDown=!1;constructor(e){this.logger=e.logger}start(){this.setupFileWatcher(),this.setupRunSubscription()}trigger(){this.changeSubject$.next("<codegen-rebuild>")}async close(){this.isShuttingDown=!0,this.watcher&&(await this.watcher.close(),this.watcher=null),this.subscription?.unsubscribe(),this.changeSubject$.complete()}setupFileWatcher(){this.watcher=r(c,{ignored:g,cwd:process.cwd(),ignoreInitial:!0,persistent:!0}),this.watcher.on("all",(e,t)=>{("change"===e||"add"===e||"unlink"===e)&&(this.logger.debug(`Lingui source ${e}: ${t}`),this.changeSubject$.next(t))}).on("error",e=>{this.logger.error(`Lingui watcher error: ${e instanceof Error?e.message:String(e)}`,e)})}setupRunSubscription(){let e=this.changeSubject$.pipe(s(200));this.subscription=this.changeSubject$.pipe(i(e)).subscribe(e=>{let t=e.some(e=>!e.endsWith(".po"));this.runQueue.add(async()=>{if(!this.isShuttingDown)try{t?(this.logger.info("Lingui sources changed, extracting and compiling i18n messages..."),await o({logger:this.logger})):(this.logger.info("Lingui catalogs changed, compiling i18n messages..."),await n({logger:this.logger}))}catch(e){this.logger.error(`Lingui update failed: ${e instanceof Error?e.message:String(e)}`,e)}})})}}
1
+ import e from"promise-queue";import{Subject as i,buffer as t,debounceTime as s}from"rxjs";import{watch as r}from"#package/watch";import{compileLingui as n,extractAndCompileLingui as o}from"../lingui/index.js";let c=["src/**/*.{ts,tsx}","src/locales/**/*.po"],g=["src/locales/**/*.{ts,tsx}"];export class LinguiWatcher{watcher=null;subscription=null;runQueue=new e(1,1/0);changeSubject$=new i;logger;isShuttingDown=!1;constructor(e){this.logger=e.logger}start(){this.setupFileWatcher(),this.setupRunSubscription()}trigger(){this.changeSubject$.next("<codegen-rebuild>")}async close(){this.isShuttingDown=!0,this.watcher&&(await this.watcher.close(),this.watcher=null),this.subscription?.unsubscribe(),this.changeSubject$.complete()}setupFileWatcher(){this.watcher=r(c,{ignored:g,cwd:process.cwd(),ignoreInitial:!0,persistent:!0}),this.watcher.on("all",(e,i)=>{("change"===e||"add"===e||"unlink"===e)&&(this.logger.debug(`Lingui source ${e}: ${i}`),this.changeSubject$.next(i))}).on("error",e=>{this.logger.error(`Lingui watcher error: ${e instanceof Error?e.message:String(e)}`,e)})}setupRunSubscription(){let e=this.changeSubject$.pipe(s(200));this.subscription=this.changeSubject$.pipe(t(e)).subscribe(e=>{let i=e.some(e=>!e.endsWith(".po"));this.runQueue.add(async()=>{if(!this.isShuttingDown)try{i?(this.logger.info("Lingui sources changed, extracting and compiling i18n messages..."),await o({logger:this.logger})):(this.logger.info("Lingui catalogs changed, compiling i18n messages..."),await n({logger:this.logger}))}catch(e){this.logger.error(`Lingui update failed: ${e instanceof Error?e.message:String(e)}`,e)}})})}}
@@ -1,2 +1,2 @@
1
- import{writeFile as e}from"node:fs/promises";import{createApiBaseClient as i}from"#package/client";import{resolveApplicationSpecDeploymentData as t}from"../application-spec/index.js";import{formatEnvContent as r,uploadFilesWithPresignedUrls as a}from"../utils/index.js";import{getDevelopmentCredentialHint as o,getDevelopmentHeaders as s}from"./development-credential.js";export const prepareDevelopmentEnvironment=async(n,l)=>{let{logger:p}=l,{projectSlug:d,environmentSlug:m,serverUrl:c,credential:h,outFile:v,skipUpload:f,overrideSchema:u,projectVersion:g}=n;p.step("Preparing development environment"),p.info(`Preparing development environment for project "${d}", environment "${m}"`);let E=i(c);p.debug(`Using server URL: ${c}`);let b=await t({skipUpload:f,logger:p});p.info("Preparing and activating the development deployment on the server...");let{data:P,error:$}=await E.POST("/environments/development/prepare",{body:{applicationVersion:b.applicationVersion,publishedDataHash:b.publishedDataHash,useAuthHook:b.useAuthHook,overrideSchema:u,configurationSchema:{version:b.schemaVersion,schema:b.schema},adminConfigurationSchema:b.adminSchema?{schema:b.adminSchema,version:b.adminSchemaVersion}:void 0,chat:b.chat,embeddings:b.embeddings,...b.assistant?{assistant:!0}:{},acl:{canCreate:b.aclCanCreate},privateFiles:[...b.assets.privateFilePaths],publicFiles:[...b.assets.publicFilePaths],sdkVersion:g},headers:s(h,{projectSlug:d,environmentSlug:m})});if($)throw Error(`Failed to prepare development deployment for ${d}/${m} on ${c}: ${$.message}. ${o(h,d)}`);if(!P)throw Error("No data returned from server while preparing the development deployment.");let{environmentVariables:y,privateUploadUrls:w,publicUploadUrls:F}=P;if(f)p.debug("Skipping file upload");else{p.info("Uploading files to S3...");let e={privateFiles:[...b.assets.privateFilesFullPaths].map(e=>{let i=e.replace("assets/private/",""),t=w[i];if(!t)throw Error(`No upload URL provided for private file ${i}, the server did not return a presigned URL for this file, please verify the file exists in the assets/private directory.`);return{localPath:e,uploadUrl:t}}),publicFiles:[...b.assets.publicFilesFullPaths].map(e=>{let i=e.replace("assets/public/",""),t=F[i];if(!t)throw Error(`No upload URL provided for public file ${i}, the server did not return a presigned URL for this file, please verify the file exists in the assets/public directory.`);return{localPath:e,uploadUrl:t}})};await a(e,{logger:p})}try{await e(v,`${r({...y,PHOENIX_PROJECT_SLUG:d,PHOENIX_ENVIRONMENT_SLUG:m,PHOENIX_SERVER_URL:c})}
1
+ import{writeFile as e}from"node:fs/promises";import{createApiBaseClient as i}from"#package/client";import{resolveApplicationSpecDeploymentData as t}from"../application-spec/index.js";import{formatEnvContent as r,uploadFilesWithPresignedUrls as a}from"../utils/index.js";import{getDevelopmentCredentialHint as o,getDevelopmentHeaders as s}from"./development-credential.js";export const prepareDevelopmentEnvironment=async(n,l)=>{let{logger:p}=l,{projectSlug:d,environmentSlug:m,serverUrl:c,credential:h,outFile:v,skipUpload:f,overrideSchema:u,projectVersion:E}=n;p.step("Preparing development environment"),p.info(`Preparing development environment for project "${d}", environment "${m}"`);let g=i(c);p.debug(`Using server URL: ${c}`);let P=await t({skipUpload:f,logger:p});p.info("Preparing and activating the development deployment on the server...");let{data:b,error:$}=await g.POST("/environments/development/prepare",{body:{applicationVersion:P.applicationVersion,publishedDataHash:P.publishedDataHash,useAuthHook:P.useAuthHook,overrideSchema:u,configurationSchema:{version:P.schemaVersion,schema:P.schema},adminConfigurationSchema:P.adminSchema?{schema:P.adminSchema,version:P.adminSchemaVersion}:void 0,chat:P.chat,embeddings:P.embeddings,...P.assistant?{assistant:!0}:{},acl:{canCreate:P.aclCanCreate},privateFiles:[...P.assets.privateFilePaths],publicFiles:[...P.assets.publicFilePaths],sdkVersion:E},headers:s(h,{projectSlug:d,environmentSlug:m})});if($)throw Error(`Failed to prepare development deployment for ${d}/${m} on ${c}: ${$.message}. ${o(h,d)}`);if(!b)throw Error("No data returned from server while preparing the development deployment.");let{environmentVariables:y,privateUploadUrls:N,publicUploadUrls:w}=b;if(f)p.debug("Skipping file upload");else{p.info("Uploading files to S3...");let e={privateFiles:[...P.assets.privateFilesFullPaths].map(e=>{let i=e.replace("assets/private/",""),t=N[i];if(!t)throw Error(`No upload URL provided for private file ${i}, the server did not return a presigned URL for this file, please verify the file exists in the assets/private directory.`);return{localPath:e,uploadUrl:t}}),publicFiles:[...P.assets.publicFilesFullPaths].map(e=>{let i=e.replace("assets/public/",""),t=w[i];if(!t)throw Error(`No upload URL provided for public file ${i}, the server did not return a presigned URL for this file, please verify the file exists in the assets/public directory.`);return{localPath:e,uploadUrl:t}})};await a(e,{logger:p})}try{await e(v,`${r({...y,PHOENIX_PROJECT_SLUG:d,PHOENIX_ENVIRONMENT_SLUG:m,PHOENIX_SERVER_URL:c,PHOENIX_DEPLOYMENT_FINGERPRINT:P.fingerprint})}
2
2
  `),p.debug(`Environment variables written to ${v}`)}catch{throw Error(`Failed to write environment variables to file at ${v}, please verify you have write permissions to this location.`)}p.info(`Project: ${d}`),p.info(`Environment: ${m}`),p.info(`Deployment ID: ${y.DEPLOYMENT_ID}`),p.success("Development environment prepared successfully!")};
@@ -0,0 +1,9 @@
1
+ import type { TelemetryEvent } from './telemetry-event.js';
2
+ export interface TelemetryTransport {
3
+ readonly send: (events: readonly TelemetryEvent[], timeoutMs: number) => Promise<void>;
4
+ }
5
+ interface AmplitudeTelemetryTransportContext {
6
+ readonly fetch: typeof fetch;
7
+ }
8
+ export declare const createAmplitudeTelemetryTransport: (context?: AmplitudeTelemetryTransportContext) => TelemetryTransport;
9
+ export {};
@@ -0,0 +1 @@
1
+ let e=e=>({event_type:e.name,device_id:e.deviceId,...void 0===e.userId?{}:{user_id:e.userId},insert_id:e.eventId,time:e.occurredAt.getTime(),event_properties:e.properties}),t=e=>429===e.status||e.status>=500;export const createAmplitudeTelemetryTransport=(r={fetch})=>({send:async(a,i)=>{if(0===a.length)return;let n=new AbortController,o=setTimeout(()=>n.abort(),i),s=JSON.stringify({api_key:"46b8fa9ce868c9da04f8ad2b6715a2f7",events:a.map(e)});try{for(let e=0;e<2;e+=1)try{let e=await r.fetch("https://api2.amplitude.com/2/httpapi",{method:"POST",headers:{"content-type":"application/json"},body:s,signal:n.signal});if(await e.body?.cancel(),e.ok||!t(e))return}catch{if(n.signal.aborted)return}}finally{n.abort(),clearTimeout(o)}}});
@@ -0,0 +1,3 @@
1
+ export { createTelemetryClient, type CommandTelemetryAttempt, type TelemetryClient } from './telemetry-client.js';
2
+ export { resolveTelemetryCommand, type TelemetryCommand } from './telemetry-command.js';
3
+ export type { TelemetryAssociation } from './telemetry-state.js';
@@ -0,0 +1 @@
1
+ export{createTelemetryClient}from"./telemetry-client.js";export{resolveTelemetryCommand}from"./telemetry-command.js";
@@ -0,0 +1,25 @@
1
+ import { type TelemetryTransport } from './amplitude-telemetry-transport.js';
2
+ import type { TelemetryCommand } from './telemetry-command.js';
3
+ import { type TelemetryFailureCategory, type TelemetryOutcome } from './telemetry-event.js';
4
+ import { type TelemetryAssociation, type TelemetryIdentity } from './telemetry-state.js';
5
+ export interface CommandTelemetryAttempt {
6
+ readonly ready: () => void;
7
+ readonly complete: (outcome: TelemetryOutcome, failureCategory?: TelemetryFailureCategory) => void;
8
+ }
9
+ export interface TelemetryClient {
10
+ readonly startCommandAttempt: (command: TelemetryCommand) => CommandTelemetryAttempt;
11
+ readonly identify: (association: TelemetryAssociation) => Promise<void>;
12
+ readonly flush: () => Promise<void>;
13
+ }
14
+ interface CreateTelemetryClientProps {
15
+ readonly sdkVersion: string;
16
+ }
17
+ interface TelemetryClientContext {
18
+ readonly createId: () => string;
19
+ readonly loadIdentity: () => Promise<TelemetryIdentity>;
20
+ readonly now: () => Date;
21
+ readonly saveAssociation: (identity: TelemetryIdentity, association: TelemetryAssociation) => Promise<void>;
22
+ readonly transport: TelemetryTransport;
23
+ }
24
+ export declare const createTelemetryClient: (props: CreateTelemetryClientProps, context?: TelemetryClientContext) => Promise<TelemetryClient>;
25
+ export {};
@@ -0,0 +1 @@
1
+ import{randomUUID as t}from"node:crypto";import{createAmplitudeTelemetryTransport as e}from"./amplitude-telemetry-transport.js";import{createCommandEvent as r}from"./telemetry-event.js";import{loadTelemetryIdentity as o,saveTelemetryAssociation as n}from"./telemetry-state.js";let a={ready:()=>void 0,complete:()=>void 0},s={startCommandAttempt:()=>a,identify:async()=>void 0,flush:async()=>void 0};export const createTelemetryClient=async(a,i={createId:t,loadIdentity:o,now:()=>new Date,saveAssociation:n,transport:e()})=>{if("1"===process.env.PHOENIX_TELEMETRY_DISABLED)return s;try{var d;let t,e;return d=await i.loadIdentity(),t=[],e=d,{startCommandAttempt:o=>{let n=i.createId(),s=i.now(),d=!1,c=!1;return t=[...t,r({identity:e,sdkVersion:a.sdkVersion,command:o,attemptId:n,phase:"started",outcome:"unknown",occurredAt:s},i)],{ready:()=>{if("dev"!==o||c||d)return;c=!0;let m=i.now();t=[...t,r({identity:e,sdkVersion:a.sdkVersion,command:o,attemptId:n,phase:"ready",outcome:"unknown",occurredAt:m,durationMs:Math.max(0,m.getTime()-s.getTime())},i)]},complete:(c,m)=>{if(d)return;d=!0;let u=i.now();t=[...t,r({identity:e,sdkVersion:a.sdkVersion,command:o,attemptId:n,phase:"completed",outcome:c,occurredAt:u,durationMs:Math.max(0,u.getTime()-s.getTime()),failureCategory:m},i)]}}},identify:async t=>{e={...e,...t};try{await i.saveAssociation(e,t)}catch{return}},flush:async()=>{let e=t;t=[];try{await i.transport.send(e,1e3)}catch{return}}}}catch{return s}};
@@ -0,0 +1,2 @@
1
+ export type TelemetryCommand = 'build' | 'changelog' | 'check' | 'clean' | 'deploy' | 'deployment:activate' | 'deployment:build-envs' | 'deployment:extract-sources' | 'deployment:finish' | 'deployment:prepare' | 'deployment:prepare-dev' | 'deployment:prepare-local' | 'deployment:register' | 'dev' | 'docs' | 'environment:cleanup' | 'environment:create' | 'environment:list' | 'feedback' | 'fix' | 'init' | 'inspect:assets' | 'inspect:data' | 'inspect:scene' | 'inspect:state' | 'link' | 'login' | 'logout' | 'prepare:ci' | 'screenshot' | 'story' | 'sync' | 'unlink' | 'variants';
2
+ export declare const resolveTelemetryCommand: (arguments_: readonly string[]) => TelemetryCommand | null;
@@ -0,0 +1 @@
1
+ let e={b:"build",build:"build",c:"check",changelog:"changelog",check:"check",ci:"prepare:ci",cl:"clean",clean:"clean",clog:"changelog",d:"dev",da:"deployment:activate",dbe:"deployment:build-envs",deploy:"deploy","dep:activate":"deployment:activate","dep:build-envs":"deployment:build-envs","dep:finish":"deployment:finish","dep:prepare":"deployment:prepare","dep:prepare-dev":"deployment:prepare-dev","dep:prepare-local":"deployment:prepare-local","dep:register":"deployment:register","deployment:activate":"deployment:activate","deployment:build-envs":"deployment:build-envs","deployment:extract-sources":"deployment:extract-sources","deployment:finish":"deployment:finish","deployment:prepare":"deployment:prepare","deployment:prepare-dev":"deployment:prepare-dev","deployment:prepare-local":"deployment:prepare-local","deployment:register":"deployment:register",dev:"dev",df:"deployment:finish",doc:"docs",docs:"docs",dp:"deployment:prepare",dpd:"deployment:prepare-dev",dpl:"deployment:prepare-local",dr:"deployment:register",ec:"environment:cleanup","env:cleanup":"environment:cleanup","env:create":"environment:create","env:list":"environment:list","environment:cleanup":"environment:cleanup","environment:create":"environment:create","environment:list":"environment:list",f:"fix",feedback:"feedback",fix:"fix",ia:"inspect:assets",id:"inspect:data",init:"init","inspect:assets":"inspect:assets","inspect:data":"inspect:data","inspect:scene":"inspect:scene","inspect:state":"inspect:state",is:"inspect:state",isc:"inspect:scene",l:"link",link:"link",login:"login",logout:"logout",pci:"prepare:ci","prepare:ci":"prepare:ci",s:"sync",screenshot:"screenshot",ss:"screenshot",st:"story",story:"story",sync:"sync",ul:"unlink",unlink:"unlink",variants:"variants"};export const resolveTelemetryCommand=n=>e[n[0]??""]??null;
@@ -0,0 +1,44 @@
1
+ import type { TelemetryCommand } from './telemetry-command.js';
2
+ import type { TelemetryIdentity } from './telemetry-state.js';
3
+ export type TelemetryOutcome = 'succeeded' | 'failed';
4
+ export type TelemetryFailureCategory = 'command_failed';
5
+ export type TelemetrySource = 'cli' | 'studio' | 'backend' | 'preview';
6
+ export type TelemetryClassification = 'internal' | 'beta' | 'general' | 'unknown';
7
+ export interface TelemetryEvent {
8
+ /** Unique event delivery identity, mapped to Amplitude's insert_id. */
9
+ readonly eventId: string;
10
+ readonly name: 'cli_command_started' | 'cli_dev_server_ready' | 'cli_command_completed';
11
+ readonly occurredAt: Date;
12
+ readonly deviceId: string;
13
+ readonly userId?: string;
14
+ readonly properties: {
15
+ readonly schema_version: 1;
16
+ readonly source: TelemetrySource;
17
+ readonly command: TelemetryCommand;
18
+ readonly attempt_id: string;
19
+ readonly phase: 'started' | 'ready' | 'completed';
20
+ readonly outcome: 'unknown' | TelemetryOutcome;
21
+ readonly duration_ms?: number;
22
+ readonly failure_category?: TelemetryFailureCategory;
23
+ readonly sdk_version: string;
24
+ readonly classification: TelemetryClassification;
25
+ readonly work_session_id: string;
26
+ readonly workspace_id?: string;
27
+ };
28
+ }
29
+ interface CreateCommandEventProps {
30
+ readonly identity: TelemetryIdentity;
31
+ readonly sdkVersion: string;
32
+ readonly command: TelemetryCommand;
33
+ readonly attemptId: string;
34
+ readonly phase: 'started' | 'ready' | 'completed';
35
+ readonly outcome: 'unknown' | TelemetryOutcome;
36
+ readonly occurredAt: Date;
37
+ readonly durationMs?: number;
38
+ readonly failureCategory?: TelemetryFailureCategory;
39
+ }
40
+ interface TelemetryEventContext {
41
+ readonly createId: () => string;
42
+ }
43
+ export declare const createCommandEvent: (props: CreateCommandEventProps, context: TelemetryEventContext) => TelemetryEvent;
44
+ export {};
@@ -0,0 +1 @@
1
+ export const createCommandEvent=(e,t)=>({eventId:t.createId(),name:"ready"===e.phase?"cli_dev_server_ready":"started"===e.phase?"cli_command_started":"cli_command_completed",occurredAt:e.occurredAt,deviceId:e.identity.installationId,..."userId"in e.identity?{userId:e.identity.userId}:{},properties:{schema_version:1,source:"cli",command:e.command,attempt_id:e.attemptId,phase:e.phase,outcome:e.outcome,...void 0===e.durationMs?{}:{duration_ms:e.durationMs},...void 0===e.failureCategory?{}:{failure_category:e.failureCategory},sdk_version:e.sdkVersion,classification:"userId"in e.identity?"general":"unknown",work_session_id:e.identity.workSessionId,..."workspaceId"in e.identity?{workspace_id:e.identity.workspaceId}:{}}});
@@ -0,0 +1,25 @@
1
+ export interface AnonymousTelemetryIdentity {
2
+ /** Random identifier for one operating-system user profile, without machine or account data. */
3
+ readonly installationId: string;
4
+ /** Random identifier for CLI activity separated by less than thirty minutes. */
5
+ readonly workSessionId: string;
6
+ }
7
+ export interface TelemetryAssociation {
8
+ /** Stable authenticated builder user ID, mapped to Amplitude's user_id after authentication. */
9
+ readonly userId: string;
10
+ /** Internal UUID of the SDK-builder workspace the CLI authenticated against. */
11
+ readonly workspaceId: string;
12
+ }
13
+ export type TelemetryIdentity = AnonymousTelemetryIdentity | (AnonymousTelemetryIdentity & TelemetryAssociation);
14
+ interface TelemetryStateContext {
15
+ readonly createId: () => string;
16
+ readonly now: () => Date;
17
+ }
18
+ export declare const getTelemetryStatePath: () => string;
19
+ /**
20
+ * Loads the anonymous CLI identity and records current activity. Broken or unwritable state never blocks a command:
21
+ * the invocation gets an ephemeral identity, while an invalid existing file is left untouched for inspection.
22
+ */
23
+ export declare const loadTelemetryIdentity: (context?: TelemetryStateContext) => Promise<TelemetryIdentity>;
24
+ export declare const saveTelemetryAssociation: (identity: TelemetryIdentity, association: TelemetryAssociation) => Promise<void>;
25
+ export {};
@@ -0,0 +1,2 @@
1
+ import{randomUUID as t}from"node:crypto";import{chmod as e,mkdir as i,readFile as n,writeFile as a}from"node:fs/promises";import{homedir as s}from"node:os";import{dirname as r,join as o}from"node:path";import{z as d}from"zod";let l=d.object({installationId:d.string().uuid(),workSessionId:d.string().uuid(),lastActiveAt:d.string().datetime()}),c=d.union([l.extend({userId:d.string().min(5),workspaceId:d.string().uuid()}),l.strict()]),I={createId:t,now:()=>new Date};export const getTelemetryStatePath=()=>process.env.PHOENIX_TELEMETRY_FILE??o(s(),".phoenix","telemetry.json");let u=async(t,n)=>{await i(r(t),{recursive:!0,mode:448}),await a(t,`${JSON.stringify(n,null,2)}
2
+ `,{mode:384}),await e(t,384)},w=async t=>{let e;try{e=await n(t,"utf8")}catch(t){return t instanceof Error&&"code"in t&&"ENOENT"===t.code?{kind:"missing"}:{kind:"invalid"}}try{let t=c.safeParse(JSON.parse(e));return t.success?{kind:"valid",state:t.data}:{kind:"invalid"}}catch{return{kind:"invalid"}}};export const loadTelemetryIdentity=async(t=I)=>{let e=getTelemetryStatePath(),i=await w(e),n="valid"===i.kind?i.state:null,a=t.now(),s=null===n?null:Date.parse(n.lastActiveAt),r=null===s||a.getTime()-s>=18e5,o=null===n?{installationId:t.createId(),workSessionId:t.createId(),lastActiveAt:a.toISOString()}:{...n,workSessionId:r?t.createId():n.workSessionId,lastActiveAt:a.toISOString()};try{"invalid"!==i.kind&&await u(e,o)}catch{return{installationId:o.installationId,workSessionId:o.workSessionId}}return{installationId:o.installationId,workSessionId:o.workSessionId,..."userId"in o&&"workspaceId"in o?{userId:o.userId,workspaceId:o.workspaceId}:{}}};export const saveTelemetryAssociation=async(t,e)=>{let i=getTelemetryStatePath(),n=await w(i);"valid"===n.kind&&n.state.installationId===t.installationId&&n.state.workSessionId===t.workSessionId&&await u(i,{...n.state,...e})};