@salsita-ai/sdk 0.50.0-develop.91d65bd507 → 0.50.0-develop.9239ced550

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 (212) hide show
  1. package/README.md +1 -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/markers/index.d.ts +1 -1
  17. package/dist/application-spec/core/markers/index.js +1 -1
  18. package/dist/application-spec/core/markers/msg-marker.d.ts +2 -28
  19. package/dist/application-spec/core/markers/msg-marker.js +1 -1
  20. package/dist/application-spec/core/markers/raw-eval-write-marker.d.ts +1 -1
  21. package/dist/application-spec/core/markers/raw-eval-write-marker.js +1 -1
  22. package/dist/application-spec/core/markers/raw-read-write-marker.js +1 -1
  23. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  24. package/dist/application-spec/generate-application/code/templates/index.d.ts +2 -6
  25. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  26. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.d.ts +10 -0
  27. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +7 -0
  28. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  29. package/dist/application-spec/generate-application/implementations/phx-application-types.d.ts +25 -0
  30. package/dist/application-spec/generate-application/implementations/phx-application-types.js +1 -0
  31. package/dist/application-spec/generate-application/implementations/phx-domain.d.ts +36 -0
  32. package/dist/application-spec/generate-application/implementations/phx-domain.js +1 -0
  33. package/dist/application-spec/generate-application/implementations/phx-model.d.ts +24 -0
  34. package/dist/application-spec/generate-application/implementations/phx-model.js +1 -0
  35. package/dist/application-spec/generate-application/implementations/phx.d.ts +22 -0
  36. package/dist/application-spec/generate-application/implementations/phx.js +1 -0
  37. package/dist/application-spec/generate-application/index.d.ts +2 -0
  38. package/dist/application-spec/generate-application/index.js +1 -1
  39. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +3 -3
  40. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +4 -2
  41. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
  42. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.d.ts +16 -0
  43. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.js +1 -0
  44. package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +5 -0
  45. package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
  46. package/dist/application-spec/generate-application/runtime/application-spec-slice.d.ts +71 -0
  47. package/dist/application-spec/generate-application/runtime/application-spec-slice.js +1 -0
  48. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +3 -3
  49. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +4 -2
  50. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
  51. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.d.ts +16 -0
  52. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.js +1 -0
  53. package/dist/application-spec/generate-application/runtime/create-application.d.ts +57 -0
  54. package/dist/application-spec/generate-application/runtime/create-application.js +1 -0
  55. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +1 -1
  56. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +1 -1
  57. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +1 -1
  58. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.d.ts +1 -1
  59. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.js +1 -1
  60. package/dist/application-spec/generate-application/runtime/index.d.ts +8 -0
  61. package/dist/application-spec/generate-application/runtime/index.js +1 -0
  62. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
  63. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +1 -1
  64. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
  65. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +1 -1
  66. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.js +1 -1
  67. package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.d.ts +1 -1
  68. package/dist/application-spec/generate-application/runtime/spec-runtime.d.ts +21 -0
  69. package/dist/application-spec/generate-application/runtime/spec-runtime.js +1 -0
  70. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.d.ts +3 -2
  71. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +44 -9
  72. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.js +1 -1
  73. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.d.ts +1 -1
  74. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.js +1 -1
  75. package/dist/client/authorized-client.d.ts +3 -1
  76. package/dist/client/authorized-client.js +1 -1
  77. package/dist/client/contract.d.ts +17 -0
  78. package/dist/client/index.d.ts +1 -1
  79. package/dist/client/local-authorized-client.d.ts +3 -1
  80. package/dist/client/local-authorized-client.js +1 -1
  81. package/dist/client/memory-authorized-client.d.ts +4 -1
  82. package/dist/client/memory-authorized-client.js +1 -1
  83. package/dist/client/phoenix-api.d.ts +228 -0
  84. package/dist/configurator/ConfiguratorApp.js +1 -1
  85. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  86. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +13 -0
  87. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  88. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +2 -1
  89. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  90. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +15 -9
  91. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  92. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.d.ts +1 -1
  93. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -1
  94. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +12 -4
  95. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -1
  96. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +8 -0
  97. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -0
  98. package/dist/docs/index.json +1 -1
  99. package/dist/docs/layouts/gallery/nightjar-guitar.mdx +31 -16
  100. package/dist/docs/layouts/gallery/tidepool-aquascape.mdx +205 -33
  101. package/dist/docs/phoenix/domain-model.mdx +4 -1
  102. package/dist/docs/phoenix/phoenix-cli.mdx +14 -6
  103. package/dist/docs/phoenix/project-structure.mdx +21 -17
  104. package/dist/docs/phoenix/sdk-builder-workflow.mdx +6 -4
  105. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  106. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  107. package/dist/domain/application/configurator-builder.d.ts +7 -1
  108. package/dist/domain/application/configurator-builder.js +1 -1
  109. package/dist/domain/application/index.d.ts +1 -1
  110. package/dist/domain/application/index.js +1 -1
  111. package/dist/domain/application/standard-properties.js +1 -1
  112. package/dist/domain/domain-runtime/application.d.ts +39 -0
  113. package/dist/domain/domain-runtime/application.js +1 -0
  114. package/dist/domain/domain-runtime/domain-runtime.d.ts +36 -4
  115. package/dist/domain/domain-runtime/domain-runtime.js +1 -1
  116. package/dist/domain/domain-runtime/environment/initialize.d.ts +1 -1
  117. package/dist/domain/domain-runtime/index.d.ts +1 -0
  118. package/dist/domain/domain-runtime/index.js +1 -1
  119. package/dist/domain/domain-runtime/web-component/actions.d.ts +3 -0
  120. package/dist/domain/domain-runtime/web-component/actions.js +1 -1
  121. package/dist/domain/domain-runtime/web-component/initialize.d.ts +1 -0
  122. package/dist/domain/domain-runtime/web-component/initialize.js +1 -1
  123. package/dist/domain/domain-runtime/web-component/selectors.d.ts +2 -0
  124. package/dist/domain/domain-runtime/web-component/selectors.js +1 -1
  125. package/dist/domain/domain-runtime/web-component/types.d.ts +6 -3
  126. package/dist/domain/index.d.ts +1 -0
  127. package/dist/domain/index.js +1 -1
  128. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +5 -0
  129. package/dist/domain/spec/application/index.d.ts +1 -0
  130. package/dist/domain/spec/application/index.js +1 -0
  131. package/dist/{application-spec/core → domain/spec}/components/component-filter.d.ts +3 -2
  132. package/dist/domain/spec/enhanced-json-value.d.ts +30 -0
  133. package/dist/domain/spec/enhanced-json-value.js +1 -0
  134. package/dist/domain/spec/index.d.ts +5 -0
  135. package/dist/domain/spec/index.js +1 -0
  136. package/dist/domain/spec/markers/index.d.ts +2 -0
  137. package/dist/domain/spec/markers/index.js +1 -0
  138. package/dist/domain/spec/markers/msg-marker.d.ts +28 -0
  139. package/dist/domain/spec/markers/msg-marker.js +1 -0
  140. package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
  141. package/dist/editor/domain-editors/apply-spec-update.d.ts +2 -1
  142. package/dist/editor/domain-editors/apply-spec-update.js +1 -1
  143. package/dist/editor/domain-editors/use-implementation-files.d.ts +0 -3
  144. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  145. package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
  146. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +11 -0
  147. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  148. package/dist/phoenix/bin.js +1 -1
  149. package/dist/phoenix/cli.js +1 -1
  150. package/dist/phoenix/commands/deploy.js +1 -1
  151. package/dist/phoenix/commands/dev.js +5 -5
  152. package/dist/phoenix/commands/generated-env-markers.d.ts +1 -0
  153. package/dist/phoenix/commands/generated-env-markers.js +1 -1
  154. package/dist/phoenix/commands/index.d.ts +1 -1
  155. package/dist/phoenix/commands/index.js +1 -1
  156. package/dist/phoenix/lingui/index.d.ts +1 -0
  157. package/dist/phoenix/lingui/index.js +1 -0
  158. package/dist/phoenix/{services → lingui}/lingui.d.ts +5 -2
  159. package/dist/phoenix/lingui/lingui.js +1 -0
  160. package/dist/phoenix/services/application-spec-project-watcher.d.ts +3 -1
  161. package/dist/phoenix/services/application-spec-project-watcher.js +2 -2
  162. package/dist/phoenix/services/index.d.ts +1 -0
  163. package/dist/phoenix/services/index.js +1 -1
  164. package/dist/phoenix/services/lingui-watcher.js +1 -1
  165. package/dist/phoenix/services/prepare-development-environment.js +1 -1
  166. package/dist/phoenix/services/vite-config.js +1 -1
  167. package/dist/react-sdk/application-runtime/common-services/analytics/analytics-service.d.ts +1 -1
  168. package/dist/react-sdk/application-runtime/common-services/initialize.d.ts +2 -2
  169. package/dist/react-sdk/application-runtime/hooks/use-access-service.js +1 -1
  170. package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.d.ts +4 -11
  171. package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.js +1 -1
  172. package/dist/react-sdk/application-runtime/hooks/use-web-component.d.ts +5 -0
  173. package/dist/react-sdk/application-runtime/hooks/use-web-component.js +1 -1
  174. package/dist/react-sdk/application-runtime/host-properties/actions.d.ts +15 -0
  175. package/dist/react-sdk/application-runtime/host-properties/actions.js +1 -0
  176. package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.d.ts +30 -0
  177. package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.js +1 -0
  178. package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.d.ts +7 -0
  179. package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.js +1 -0
  180. package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.d.ts +21 -0
  181. package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.js +1 -0
  182. package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.d.ts +42 -0
  183. package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.js +1 -0
  184. package/dist/react-sdk/application-runtime/host-properties/index.d.ts +8 -0
  185. package/dist/react-sdk/application-runtime/host-properties/index.js +1 -0
  186. package/dist/react-sdk/application-runtime/host-properties/initialize.d.ts +7 -0
  187. package/dist/react-sdk/application-runtime/host-properties/initialize.js +1 -0
  188. package/dist/react-sdk/application-runtime/host-properties/selectors.d.ts +54 -0
  189. package/dist/react-sdk/application-runtime/host-properties/selectors.js +1 -0
  190. package/dist/react-sdk/application-runtime/host-properties/types.d.ts +18 -0
  191. package/dist/react-sdk/application-runtime/host-properties/types.js +1 -0
  192. package/dist/react-sdk/application-runtime/index.d.ts +1 -0
  193. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  194. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +151 -9
  195. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
  196. package/package.json +3 -3
  197. package/dist/phoenix/services/lingui.js +0 -1
  198. /package/dist/{application-spec/core → domain/spec/application}/application-instance.d.ts +0 -0
  199. /package/dist/{application-spec/core → domain/spec/application}/application-instance.js +0 -0
  200. /package/dist/{application-spec/core → domain/spec}/components/component-filter.js +0 -0
  201. /package/dist/{application-spec/core → domain/spec}/components/index.d.ts +0 -0
  202. /package/dist/{application-spec/core → domain/spec}/components/index.js +0 -0
  203. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.d.ts +0 -0
  204. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.js +0 -0
  205. /package/dist/{application-spec/core → domain/spec}/expressions/index.d.ts +0 -0
  206. /package/dist/{application-spec/core → domain/spec}/expressions/index.js +0 -0
  207. /package/dist/{application-spec/core → domain/spec}/expressions/relation-expression-params.d.ts +0 -0
  208. /package/dist/{application-spec/core → domain/spec}/expressions/relation-expression-params.js +0 -0
  209. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.d.ts +0 -0
  210. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.js +0 -0
  211. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.d.ts +0 -0
  212. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.js +0 -0
package/README.md CHANGED
@@ -103,7 +103,7 @@ The `package.json` `exports` map is the machine-readable list, and the TypeScrip
103
103
  ## Documentation and support
104
104
 
105
105
  - `pnpm phoenix docs -s "<topic>"` searches the bundled documentation; `phoenix docs -r <path>` reads a page.
106
- - `phoenix sync` generates agent skills into `.claude/skills/` and `.agents/skills/`, so coding agents know the project conventions and the CLI.
106
+ - `phoenix sync` generates one `phoenix` skill under `.claude/skills/` and `.agents/skills/`, with task-specific project, CLI, workflow, review, variants and feedback guides linked from its entry point.
107
107
  - The builder docs at [docs.salsita.ai](https://docs.salsita.ai) have the guides for getting started and the CLI reference; Studio is where you sign in and manage projects.
108
108
  - `pnpm phoenix feedback "<message>"` reaches the team directly.
109
109
 
@@ -1,3 +1,4 @@
1
1
  export { mountApplication,
2
2
  /** @deprecated Use embedded admin in Editor instead */
3
3
  mountStandaloneAdminApplication, mountConfiguratorApplication, mountEmbeddedAdminApplication, mountEmbeddedConfiguratorApplication, embeddedModuleSchema, } from './mount-application.js';
4
+ export { mountConfigurator } from './mount-configurator.js';
@@ -1 +1 @@
1
- export{mountApplication,mountStandaloneAdminApplication,mountConfiguratorApplication,mountEmbeddedAdminApplication,mountEmbeddedConfiguratorApplication,embeddedModuleSchema}from"./mount-application.js";
1
+ export{mountApplication,mountStandaloneAdminApplication,mountConfiguratorApplication,mountEmbeddedAdminApplication,mountEmbeddedConfiguratorApplication,embeddedModuleSchema}from"./mount-application.js";export{mountConfigurator}from"./mount-configurator.js";
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import type { $DomainEntity, ApplicationConfig, DomainEntity } from '#package/domain';
2
+ import { type $DomainEntity, type ApplicationConfig, type DomainEntity } from '#package/domain';
3
3
  export declare const embeddedModuleSchema: z.ZodObject<{
4
4
  default: z.ZodObject<{
5
5
  mount: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodString>;
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{z as t}from"zod";import{Application as n,EmbeddedAdmin as e,StandaloneAdmin as i}from"#package/admin";import{ConfiguratorApp as p,createConfiguratorExtensions as a}from"#package/configurator";import{createApplicationRuntime as m,createWebComponent as r}from"#package/react-sdk";export const embeddedModuleSchema=t.object({default:t.object({mount:t.function().returns(t.string()),config:t.unknown()})});let c=(o,t)=>{customElements.get(o)?console.error(`Web component with tag name "${o}" is already registered.`):customElements.define(o,t)};export const mountApplication=t=>{let e=t.mount.Application?t.mount.Application(t):()=>o(n,{});c(t.mount.tag,r({RootComponent:e,webComponentOptions:t.mount.options,embeddedIntegration:!1,applicationRuntimeFactory:o=>m(t,o,a)}))};export const mountConfiguratorApplication=t=>{let n=t.mount.Application?t.mount.Application(t):()=>o(p,{});c(t.mount.tag,r({RootComponent:n,webComponentOptions:t.mount.options,embeddedIntegration:!1,applicationRuntimeFactory:o=>m(t,o,a)}))};export const mountStandaloneAdminApplication=t=>{c("salsita-admin",r({RootComponent:()=>o(i,{}),webComponentOptions:{},embeddedIntegration:!1,applicationRuntimeFactory:o=>m(t,o,a)}))};export const mountEmbeddedAdminApplication=(t,n,i)=>{c(`salsita-admin-${n}-${i}`,r({RootComponent:()=>o(e,{}),webComponentOptions:{},embeddedIntegration:!0,applicationRuntimeFactory:o=>m(t,o,a)}))};export const mountEmbeddedConfiguratorApplication=(t,n,e)=>{c(`salsita-configurator-${n}-${e}`,r({RootComponent:t.mount.Application?t.mount.Application(t):()=>o(p,{}),webComponentOptions:t.mount.options,embeddedIntegration:!0,applicationRuntimeFactory:o=>m(t,o,a)}))};
1
+ import{jsx as o}from"react/jsx-runtime";import{z as t}from"zod";import{Application as n,EmbeddedAdmin as i,StandaloneAdmin as e}from"#package/admin";import{ConfiguratorApp as p}from"#package/configurator";import{applicationFromConfig as m}from"#package/domain";import{createWebComponent as a}from"#package/react-sdk";import{createMountedApplicationRuntime as r}from"./mounted-application-runtime.js";import{registerWebComponent as c}from"./register-web-component.js";export const embeddedModuleSchema=t.object({default:t.object({mount:t.function().returns(t.string()),config:t.unknown()})});export const mountApplication=t=>{let i=t.mount.Application?t.mount.Application(t):()=>o(n,{});c(t.mount.tag,a({RootComponent:i,webComponentOptions:t.mount.options,embeddedIntegration:!1,applicationRuntimeFactory:o=>r(m(t),o)}))};export const mountConfiguratorApplication=t=>{let n=t.mount.Application?t.mount.Application(t):()=>o(p,{});c(t.mount.tag,a({RootComponent:n,webComponentOptions:t.mount.options,embeddedIntegration:!1,applicationRuntimeFactory:o=>r(m(t),o)}))};export const mountStandaloneAdminApplication=t=>{c("salsita-admin",a({RootComponent:()=>o(e,{}),webComponentOptions:{},embeddedIntegration:!1,applicationRuntimeFactory:o=>r(m(t),o)}))};export const mountEmbeddedAdminApplication=(t,n,e)=>{c(`salsita-admin-${n}-${e}`,a({RootComponent:()=>o(i,{}),webComponentOptions:{},embeddedIntegration:!0,applicationRuntimeFactory:o=>r(m(t),o)}))};export const mountEmbeddedConfiguratorApplication=(t,n,i)=>{c(`salsita-configurator-${n}-${i}`,a({RootComponent:t.mount.Application?t.mount.Application(t):()=>o(p,{}),webComponentOptions:t.mount.options,embeddedIntegration:!0,applicationRuntimeFactory:o=>r(m(t),o)}))};
@@ -0,0 +1,19 @@
1
+ import { type Application } from '#package/domain';
2
+ /**
3
+ * Declares the web component of a configurator application built from its runtime spec
4
+ * (`createApplication` of `@salsita-ai/sdk/application-spec`), with no `ApplicationConfig`.
5
+ *
6
+ * It registers `application.tag`; every `<tag></tag>` element in the DOM renders the configurator
7
+ * in a closed shadow DOM. The web component's properties and events and the wrapper of the
8
+ * application come from the project's `GetWebComponentOptions` and `GetApplicationWrapper` handlers.
9
+ * With `embedded`, the configurator integrates with the page that embeds it, as
10
+ * `mountEmbeddedConfiguratorApplication` does; the embedding host looks for the tag
11
+ * `salsita-configurator-<project slug>-<environment slug>`, which the caller passes to
12
+ * `createApplication` as `tag`.
13
+ *
14
+ * It runs the same runtime as `mountConfiguratorApplication`, which converts its config to an
15
+ * application first.
16
+ */
17
+ export declare const mountConfigurator: <TYPES>(application: Application<TYPES>, options?: {
18
+ readonly embedded?: boolean;
19
+ }) => void;
@@ -0,0 +1 @@
1
+ import{jsx as o}from"react/jsx-runtime";import{ConfiguratorApp as r}from"#package/configurator";import{isGetApplicationWrapperHandler as t,isGetWebComponentOptionsHandler as e}from"#package/domain";import{createWebComponent as n}from"#package/react-sdk";import{createMountedApplicationRuntime as a}from"./mounted-application-runtime.js";import{registerWebComponent as i}from"./register-web-component.js";export const mountConfigurator=(m,p={})=>{let{handlers:d}=m.spec.configurator,c=d.find(t)?.handler().handler,f=d.find(e)?.handler().handler(void 0),s=c?c(m):()=>o(r,{});i(m.tag,n({RootComponent:s,webComponentOptions:f??{},embeddedIntegration:p.embedded??!1,applicationRuntimeFactory:o=>a(m,o)}))};
@@ -0,0 +1,4 @@
1
+ import { type AnyConfiguratorExtensionSystems } from '#package/configurator';
2
+ import type { Application } from '#package/domain';
3
+ import { type ApplicationRuntime, type ApplicationRuntimeBootConfig } from '#package/react-sdk';
4
+ export declare const createMountedApplicationRuntime: (application: Application, bootConfig: ApplicationRuntimeBootConfig) => ApplicationRuntime<AnyConfiguratorExtensionSystems>;
@@ -0,0 +1 @@
1
+ import{createConfiguratorExtensions as o}from"#package/configurator";import{createApplicationRuntime as t}from"#package/react-sdk";export const createMountedApplicationRuntime=(r,a)=>t(r,a,o);
@@ -0,0 +1,2 @@
1
+ /** Defines the custom element of a mounted application, unless its tag is taken. */
2
+ export declare const registerWebComponent: (tag: string, element: CustomElementConstructor) => void;
@@ -0,0 +1 @@
1
+ export const registerWebComponent=(e,t)=>{customElements.get(e)?console.error(`Web component with tag name "${e}" is already registered.`):customElements.define(e,t)};
@@ -1,26 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { type EvalMarker } from './markers/eval-marker.js';
3
- import { type MsgMarker } from './markers/msg-marker.js';
4
- /**
5
- * A JSON-serialisable value augmented with Phoenix structural markers:
6
- * `$msg` (i18n) and `$eval` (self-scoped code).
7
- *
8
- * Single shared shape across components, expressions, and defaults — lowered
9
- * either to TypeScript source via {@link stringifyEnhancedJsonValue} or to a
10
- * runtime value via {@link resolveEnhancedJsonValue}.
11
- *
12
- * Which markers are allowed at a given slot is controlled by
13
- * {@link EnhancedJsonValueCaps}, not by the type — all markers parse
14
- * identically, capability checks kick in at lowering time.
15
- */
16
- export type EnhancedJsonValue = string | number | boolean | null | MsgMarker | EvalMarker | EnhancedJsonArray | EnhancedJsonObject;
17
- /** Array form of {@link EnhancedJsonValue} — extracted as a named interface so `z.lazy` can close the recursion. */
18
- export interface EnhancedJsonArray extends ReadonlyArray<EnhancedJsonValue> {
19
- }
20
- /** Object form of {@link EnhancedJsonValue} — extracted for the same reason as {@link EnhancedJsonArray}. */
21
- export interface EnhancedJsonObject {
22
- readonly [key: string]: EnhancedJsonValue;
23
- }
2
+ import { type EnhancedJsonObject, type EnhancedJsonValue } from '#package/domain';
3
+ export { type EnhancedJsonArray, type EnhancedJsonObject, type EnhancedJsonValue, type SelfAccessor, canonicalEnhancedJsonValueKey, } from '#package/domain';
24
4
  /** Historical component-value shape used by domain-spec to import a project module member. */
25
5
  export interface ImportRefShape {
26
6
  readonly $importRef: {
@@ -63,18 +43,9 @@ export declare const CONSTANT_CAPS: EnhancedJsonValueCaps;
63
43
  export interface ImportSink {
64
44
  addImport(module: string, member: string): void;
65
45
  }
66
- /** Runtime `self` accessor — shape-agnostic entity state. */
67
- export type SelfAccessor = object;
68
46
  /**
69
47
  * Type guard that narrows an {@link EnhancedJsonValue} to the generic
70
48
  * {@link EnhancedJsonObject} branch — excludes primitives, arrays, and the
71
49
  * known structural markers (`$eval`, `$msg`).
72
50
  */
73
51
  export declare const isEnhancedJsonObject: (value: EnhancedJsonValue) => value is EnhancedJsonObject;
74
- /**
75
- * Deterministic string key for a value — sorted object keys, JSON-encoded.
76
- * Used by the expression runtime's reference store to preserve an evaluator when the
77
- * underlying value is structurally unchanged (mirrors the content-hash pattern
78
- * used for components).
79
- */
80
- export declare const canonicalEnhancedJsonValueKey: (value: EnhancedJsonValue) => string;
@@ -1 +1 @@
1
- import{z as e}from"zod";import{evalMarkerSchema as r,isEvalMarker as o}from"./markers/eval-marker.js";import{isMsgMarker as t,msgMarkerSchema as n}from"./markers/msg-marker.js";let s=e.object({$importRef:e.object({module:e.string(),member:e.string()}).strict()}).strict();export const isImportRefShaped=e=>s.safeParse(e).success;export const enhancedJsonValueSchema=e.lazy(()=>e.union([e.string(),e.number(),e.boolean(),e.null(),n,r,e.array(enhancedJsonValueSchema),e.record(e.string(),enhancedJsonValueSchema)]));export const CONSTANT_CAPS={selfScoped:!1,localizable:!0};export const isEnhancedJsonObject=e=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&!t(e)&&!o(e);export const canonicalEnhancedJsonValueKey=e=>{let r=e=>{if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(r);let o={};for(let t of Object.keys(e).sort())o[t]=r(e[t]);return o};return JSON.stringify(r(e))};
1
+ import{z as e}from"zod";import{evalMarkerSchema as o,isEvalMarker as n,isMsgMarker as a,msgMarkerSchema as r}from"#package/domain";export{canonicalEnhancedJsonValueKey}from"#package/domain";let c=e.object({$importRef:e.object({module:e.string(),member:e.string()}).strict()}).strict();export const isImportRefShaped=e=>c.safeParse(e).success;export const enhancedJsonValueSchema=e.lazy(()=>e.union([e.string(),e.number(),e.boolean(),e.null(),r,o,e.array(enhancedJsonValueSchema),e.record(e.string(),enhancedJsonValueSchema)]));export const CONSTANT_CAPS={selfScoped:!1,localizable:!0};export const isEnhancedJsonObject=e=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&!a(e)&&!n(e);
@@ -1,8 +1,6 @@
1
+ export { ApplicationInstance, FILTER_CRITERION_KEYS, type FilterCriterion, type RelationExpressionParams, type SdkCodeRef, type SdkExpressionImplementation, type SpecComponentFilter as ComponentFilter, isSdkCodeRef, isSdkExpressionImplementation, } from '#package/domain';
1
2
  export * from './application-file.js';
2
- export * from './components/index.js';
3
- export * from './expressions/index.js';
4
3
  export * from './specification-files.js';
5
- export * from './application-instance.js';
6
4
  export * from './spec-diagnostic.js';
7
5
  export * from './enhanced-json-schema.js';
8
6
  export * from './enhanced-json-value.js';
@@ -1 +1 @@
1
- export*from"./application-file.js";export*from"./components/index.js";export*from"./expressions/index.js";export*from"./specification-files.js";export*from"./application-instance.js";export*from"./spec-diagnostic.js";export*from"./enhanced-json-schema.js";export*from"./enhanced-json-value.js";export*from"./eval-expression-parser.js";export*from"./json-schema.js";export*from"./json-value.js";export*from"./markers/index.js";export*from"./phoenix-definitions.js";export*from"./project-path.js";
1
+ export{ApplicationInstance,FILTER_CRITERION_KEYS,isSdkCodeRef,isSdkExpressionImplementation}from"#package/domain";export*from"./application-file.js";export*from"./specification-files.js";export*from"./spec-diagnostic.js";export*from"./enhanced-json-schema.js";export*from"./enhanced-json-value.js";export*from"./eval-expression-parser.js";export*from"./json-schema.js";export*from"./json-value.js";export*from"./markers/index.js";export*from"./phoenix-definitions.js";export*from"./project-path.js";
@@ -1,4 +1,4 @@
1
- export * from './eval-marker.js';
1
+ export { EVAL_MARKER_KEY, type EvalMarker, evalMarkerSchema, isEvalMarker } from '#package/domain';
2
2
  export * from './filter-keys.js';
3
3
  export * from './msg-marker.js';
4
4
  export * from './raw-bind-marker.js';
@@ -1 +1 @@
1
- export*from"./eval-marker.js";export*from"./filter-keys.js";export*from"./msg-marker.js";export*from"./raw-bind-marker.js";export*from"./raw-data-ref-marker.js";export*from"./raw-eval-write-marker.js";export*from"./raw-read-marker.js";export*from"./raw-read-write-marker.js";export*from"./raw-write-marker.js";
1
+ export{EVAL_MARKER_KEY,evalMarkerSchema,isEvalMarker}from"#package/domain";export*from"./filter-keys.js";export*from"./msg-marker.js";export*from"./raw-bind-marker.js";export*from"./raw-data-ref-marker.js";export*from"./raw-eval-write-marker.js";export*from"./raw-read-marker.js";export*from"./raw-read-write-marker.js";export*from"./raw-write-marker.js";
@@ -1,31 +1,5 @@
1
- import type { MessageDescriptor } from '@lingui/core';
2
- import { z } from 'zod';
3
- /** Key literal for the `$msg` marker in raw YAML. */
4
- export declare const MSG_MARKER_KEY: '$msg';
5
- /** Key literal for the optional `$msgId` qualifier on `$msg`. */
6
- export declare const MSG_ID_MARKER_KEY: '$msgId';
7
- /**
8
- * YAML marker produced by `$msg: 'text'` / `$msg: 'text', $msgId: 'id'` entries.
9
- * `$msgId` is a qualifier on `$msg`, not a standalone marker.
10
- */
11
- export interface MsgMarker {
12
- readonly $msg: string;
13
- readonly $msgId?: string;
14
- }
15
- /** Zod decoder for {@link MsgMarker}. Strict — rejects extra keys. */
16
- export declare const msgMarkerSchema: z.ZodObject<{
17
- $msg: z.ZodString;
18
- $msgId: z.ZodOptional<z.ZodString>;
19
- }, "strict", z.ZodTypeAny, {
20
- $msg: string;
21
- $msgId?: string | undefined;
22
- }, {
23
- $msg: string;
24
- $msgId?: string | undefined;
25
- }>;
26
- /** Structural type guard for {@link MsgMarker}. */
27
- export declare const isMsgMarker: (value: unknown) => value is MsgMarker;
28
- export declare const createMessageDescriptor: (marker: MsgMarker) => MessageDescriptor;
1
+ import type { MsgMarker } from '#package/domain';
2
+ export { MSG_ID_MARKER_KEY, MSG_MARKER_KEY, type MsgMarker, createMessageDescriptor, isMsgMarker, msgMarkerSchema, } from '#package/domain';
29
3
  /**
30
4
  * Serializes a {@link MsgMarker} to lingui macro source — `` msg`…` `` or
31
5
  * `msg({ id, message })` with `$msgId` — escaping template-literal syntax in
@@ -1 +1 @@
1
- import{generateMessageId as s}from"@lingui/message-utils/generateMessageId";import{z as e}from"zod";export const MSG_MARKER_KEY="$msg";export const MSG_ID_MARKER_KEY="$msgId";export const msgMarkerSchema=e.object({$msg:e.string(),$msgId:e.string().optional()}).strict();export const isMsgMarker=s=>msgMarkerSchema.safeParse(s).success;export const createMessageDescriptor=e=>({id:e.$msgId??s(e.$msg),message:e.$msg});export const stringifyMsgMacroCode=s=>void 0!==s.$msgId?`msg({ id: ${JSON.stringify(s.$msgId)}, message: ${JSON.stringify(s.$msg)} })`:`msg\`${s.$msg.replaceAll("\\","\\\\").replaceAll("`","\\`").replaceAll("${","\\${")}\``;
1
+ export{MSG_ID_MARKER_KEY,MSG_MARKER_KEY,createMessageDescriptor,isMsgMarker,msgMarkerSchema}from"#package/domain";export const stringifyMsgMacroCode=e=>void 0!==e.$msgId?`msg({ id: ${JSON.stringify(e.$msgId)}, message: ${JSON.stringify(e.$msg)} })`:`msg\`${e.$msg.replaceAll("\\","\\\\").replaceAll("`","\\`").replaceAll("${","\\${")}\``;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { type EvalMarker } from './eval-marker.js';
2
+ import { type EvalMarker } from '#package/domain';
3
3
  import { type RawWriteMarker } from './raw-write-marker.js';
4
4
  /**
5
5
  * YAML marker produced by `$eval: '…', $write: 'fieldName'` — computed read via
@@ -1 +1 @@
1
- import{z as r}from"zod";import{EVAL_MARKER_KEY as e}from"./eval-marker.js";import{WRITE_MARKER_KEY as a}from"./raw-write-marker.js";export const rawEvalWriteMarkerSchema=r.object({[e]:r.string(),[a]:r.string()}).strict();export const isRawEvalWriteMarker=r=>rawEvalWriteMarkerSchema.safeParse(r).success;
1
+ import{z as r}from"zod";import{EVAL_MARKER_KEY as a}from"#package/domain";import{WRITE_MARKER_KEY as e}from"./raw-write-marker.js";export const rawEvalWriteMarkerSchema=r.object({[a]:r.string(),[e]:r.string()}).strict();export const isRawEvalWriteMarker=r=>rawEvalWriteMarkerSchema.safeParse(r).success;
@@ -1 +1 @@
1
- import{z as r}from"zod";import{EVAL_MARKER_KEY as e}from"./eval-marker.js";import{bindMarkerDefinition as t}from"./raw-bind-marker.js";import{READ_MARKER_KEY as i,readMarkerDefinition as o}from"./raw-read-marker.js";import{WRITE_MARKER_KEY as a,writeMarkerDefinition as s}from"./raw-write-marker.js";export const rawReadWriteMarkerSchema=r.object({[i]:r.string(),[a]:r.string()}).strict();export const isRawReadWriteMarker=r=>rawReadWriteMarkerSchema.safeParse(r).success;export const readWriteMarkerDefinition={anyOf:[t,{type:"object",properties:{...o.properties??{},...s.properties??{}},required:o.required,additionalProperties:!1},{type:"object",properties:{[e]:{type:"string"},...s.properties??{}},required:[e,...s.required??[]],additionalProperties:!1}]};
1
+ import{z as r}from"zod";import{EVAL_MARKER_KEY as e}from"#package/domain";import{bindMarkerDefinition as t}from"./raw-bind-marker.js";import{READ_MARKER_KEY as i,readMarkerDefinition as o}from"./raw-read-marker.js";import{WRITE_MARKER_KEY as a,writeMarkerDefinition as p}from"./raw-write-marker.js";export const rawReadWriteMarkerSchema=r.object({[i]:r.string(),[a]:r.string()}).strict();export const isRawReadWriteMarker=r=>rawReadWriteMarkerSchema.safeParse(r).success;export const readWriteMarkerDefinition={anyOf:[t,{type:"object",properties:{...o.properties??{},...p.properties??{}},required:o.required,additionalProperties:!1},{type:"object",properties:{[e]:{type:"string"},...p.properties??{}},required:[e,...p.required??[]],additionalProperties:!1}]};
@@ -1,6 +1,6 @@
1
- import{GeneratedApplicationFile as e}from"../../core/index.js";import{followsCanaryBuilds as r,generateApplicationSpecEslintConfig as t,generateApplicationSpecFavicon as i,generateApplicationSpecGitignore as n,generateApplicationSpecPrettierConfig as a,generateApplicationSpecRobotsTxt as o,generateApplicationSpecRootTsconfig as l,generateApplicationSpecTsconfig as s,generateLinguiRcFile as c,generatePhoenixCliSkill as f,generatePhoenixCreateConfiguratorSkill as p,generatePhoenixCreateConfiguratorSkillReferences as d,generatePhoenixFeedbackSkill as m,generatePhoenixReviewSkill as g,generatePhoenixSkill as h,generatePhoenixVariantsSkill as u,stripSdkMarkerContent as j}from"./templates/index.js";export const agentSkillRoots=[".claude/skills",".agents/skills"];let x=[{path:"CLAUDE.md",generatedPrefix:""},{path:".cursor/rules/phoenix.mdc",generatedPrefix:`---
1
+ import{GeneratedApplicationFile as e}from"../../core/index.js";import{followsCanaryBuilds as i,generateApplicationSpecEslintConfig as r,generateApplicationSpecFavicon as t,generateApplicationSpecGitignore as a,generateApplicationSpecPrettierConfig as o,generateApplicationSpecRobotsTxt as n,generateApplicationSpecRootTsconfig as l,generateApplicationSpecTsconfig as s,generateLinguiRcFile as c,generatePhoenixSkillBundle as d,stripSdkMarkerContent as f}from"./templates/index.js";export const agentSkillRoots=[".claude/skills",".agents/skills"];let p=[{path:"CLAUDE.md",generatedPrefix:""},{path:".cursor/rules/phoenix.mdc",generatedPrefix:`---
2
2
  description: Phoenix SDK project rules
3
3
  globs:
4
4
  alwaysApply: true
5
5
  ---
6
- `}],P=[".claude/commands/review.md",".cursor/commands/review.md"],v=(e,r)=>e.projectFiles.find(e=>e.file.name===r)?.file.content;export const generateProjectScaffolding=F=>{let E,G,{applicationSpec:b,categorizedFiles:k,sdkVersion:w,projectInGitRepository:L=!0,cliUseWorkspace:S}=F,$=v(k,".gitignore"),y=void 0!==S?S:b.appMetadata.workspace,C=(r=>{let t=[],i=[...P];for(let{path:n,generatedPrefix:a}of x){let o=v(r,n);if(void 0===o)continue;let l=j(o,a);void 0===l?i.push(n):l!==o&&t.push(e(n,l,{format:!1}))}return{strippedFiles:t,removedFiles:i}})(k),M={generatedProjectFiles:(E=[{file:e("tsconfig.json",l()),hasEarlierGenerated:k.hasEarlierGeneratedTsconfig},{file:e("eslint.config.js",t()),hasEarlierGenerated:k.hasEarlierGeneratedEslintConfig},{file:e("prettier.config.js",a()),hasEarlierGenerated:k.hasEarlierGeneratedPrettierConfig}]).filter(e=>e.hasEarlierGenerated).map(e=>e.file),initialProjectFiles:E.filter(e=>!e.hasEarlierGenerated).map(e=>e.file)};return{phoenixFiles:[e("tsconfig.json",s()),e(".linguirc",c(b.configurator.ui.availableLocales),{format:!1})],generatedProjectFiles:[...M.generatedProjectFiles,...L?[e(".gitignore",n($))]:[],...(G=[{name:"phoenix",content:h({checkLatestCanary:r({useWorkspace:y,sdkVersion:w})}),references:[]},{name:"phoenix-cli",content:f(),references:[]},{name:"phoenix-create-configurator",content:p(),references:d()},{name:"phoenix-feedback",content:m(),references:[]},{name:"phoenix-review",content:g(),references:[]},{name:"phoenix-variants",content:u(),references:[]}],agentSkillRoots.flatMap(r=>G.flatMap(t=>[e(`${r}/${t.name}/SKILL.md`,t.content),...t.references.map(i=>e(`${r}/${t.name}/${i.path}`,i.content))]))),...C.strippedFiles],initialProjectFiles:[...M.initialProjectFiles,e("public/favicon.ico",i(),{binary:!0}),e("public/robots.txt",o(),{format:!1})],removedProjectFiles:C.removedFiles}};
6
+ `}],g=[".claude/commands/review.md",".cursor/commands/review.md"],m=(e,i)=>e.projectFiles.find(e=>e.file.name===i)?.file.content;export const generateProjectScaffolding=h=>{let u,j,{applicationSpec:x,categorizedFiles:P,sdkVersion:F,projectInGitRepository:E=!0,cliUseWorkspace:v}=h,G=m(P,".gitignore"),b=void 0!==v?v:x.appMetadata.workspace,k=(i=>{let r=[],t=[...g];for(let{path:a,generatedPrefix:o}of p){let n=m(i,a);if(void 0===n)continue;let l=f(n,o);void 0===l?t.push(a):l!==n&&r.push(e(a,l,{format:!1}))}return{strippedFiles:r,removedFiles:t}})(P),L={generatedProjectFiles:(u=[{file:e("tsconfig.json",l()),hasEarlierGenerated:P.hasEarlierGeneratedTsconfig},{file:e("eslint.config.js",r()),hasEarlierGenerated:P.hasEarlierGeneratedEslintConfig},{file:e("prettier.config.js",o()),hasEarlierGenerated:P.hasEarlierGeneratedPrettierConfig}]).filter(e=>e.hasEarlierGenerated).map(e=>e.file),initialProjectFiles:u.filter(e=>!e.hasEarlierGenerated).map(e=>e.file)};return{phoenixFiles:[e("tsconfig.json",s()),e(".linguirc",c(x.configurator.ui.availableLocales),{format:!1})],generatedProjectFiles:[...L.generatedProjectFiles,...E?[e(".gitignore",a(G))]:[],...(j=d({checkLatestCanary:i({useWorkspace:b,sdkVersion:F})}),agentSkillRoots.flatMap(i=>[e(`${i}/phoenix/SKILL.md`,j.content),...j.references.map(r=>e(`${i}/phoenix/${r.path}`,r.content))])),...k.strippedFiles],initialProjectFiles:[...L.initialProjectFiles,e("public/favicon.ico",t(),{binary:!0}),e("public/robots.txt",n(),{format:!1})],removedProjectFiles:k.removedFiles}};
@@ -37,12 +37,8 @@ export { generateApplicationSpecGlobals } from './globals.js';
37
37
  export { generateApplicationSpecHtmlAdminIndex } from './html-admin-index.js';
38
38
  export { generateApplicationSpecHtmlIndex } from './html-index.js';
39
39
  export { generateLinguiRcFile } from './lingui-rc.js';
40
- export { generatePhoenixCliSkill } from './skills/phoenix-cli-skill.js';
41
- export { generatePhoenixCreateConfiguratorSkill, generatePhoenixCreateConfiguratorSkillReferences, } from './skills/phoenix-create-configurator-skill.js';
42
- export { generatePhoenixFeedbackSkill } from './skills/phoenix-feedback-skill.js';
43
- export { generatePhoenixReviewSkill } from './skills/phoenix-review-skill.js';
44
- export { type PhoenixSkillOptions, followsCanaryBuilds, generatePhoenixSkill } from './skills/phoenix-skill.js';
45
- export { generatePhoenixVariantsSkill } from './skills/phoenix-variants-skill.js';
40
+ export { generatePhoenixSkillBundle } from './skills/phoenix-skill-bundle.js';
41
+ export { type PhoenixSkillOptions, followsCanaryBuilds } from './skills/phoenix-skill.js';
46
42
  export { generateApplicationSpecPrettierConfig } from './prettier-config.js';
47
43
  export { generateApplicationSpecRobotsTxt } from './robots-txt.js';
48
44
  export { generateApplicationSpecRootTsconfig } from './root-tsconfig.js';
@@ -1 +1 @@
1
- export{stripSdkMarkerContent}from"./common/strip-sdk-marker-content.js";export{generateApplicationSpecAdminConfig}from"./admin-config.js";export{generateApplicationSpecAdminCode}from"./admin-domain-code.js";export{generateApplicationSpecAdminFrontendCode}from"./admin-frontend-code.js";export{generateAdminGlobalBindingBlock,generateApplicationSpecAdminGlobals}from"./admin-globals.js";export{generateApplicationSpecTypesModule}from"./application-types.js";export{generateApplicationSpecAdminFile}from"./admin.js";export{generateApplicationSpecConfiguratorConfig}from"./configurator-config.js";export{generateApplicationSpecConfiguratorCode}from"./configurator-domain-code.js";export{generateApplicationSpecConfiguratorFrontendCode}from"./configurator-frontend-code.js";export{generateApplicationSpecConfiguratorGlobals,generateConfiguratorGlobalBindingBlock}from"./configurator-globals.js";export{generateApplicationSpecConfiguratorFile}from"./configurator.js";export{generateApplicationSpecDomainSpecFile}from"./domain-spec.js";export{generateImportedStateConstants,generatePhxExportsBlock,generatePhxGlobalsBlock,generateStateConstants}from"./domain-spec/index.js";export{generateApplicationSpecDomainFile}from"./domain.js";export{generateApplicationSpecEditorFile}from"./editor.js";export{generateApplicationSpecEmbeddedAdmin}from"./embedded-admin.js";export{generateApplicationSpecEmbeddedConfigurator}from"./embedded-configurator.js";export{generateApplicationSpecEslintConfig}from"./eslint-config.js";export{generateApplicationSpecFavicon}from"./favicon.js";export{generateApplicationSpecFrontendConfig}from"./frontend-config.js";export{generateApplicationSpecGitignore}from"./gitignore.js";export{generateApplicationSpecGlobals}from"./globals.js";export{generateApplicationSpecHtmlAdminIndex}from"./html-admin-index.js";export{generateApplicationSpecHtmlIndex}from"./html-index.js";export{generateLinguiRcFile}from"./lingui-rc.js";export{generatePhoenixCliSkill}from"./skills/phoenix-cli-skill.js";export{generatePhoenixCreateConfiguratorSkill,generatePhoenixCreateConfiguratorSkillReferences}from"./skills/phoenix-create-configurator-skill.js";export{generatePhoenixFeedbackSkill}from"./skills/phoenix-feedback-skill.js";export{generatePhoenixReviewSkill}from"./skills/phoenix-review-skill.js";export{followsCanaryBuilds,generatePhoenixSkill}from"./skills/phoenix-skill.js";export{generatePhoenixVariantsSkill}from"./skills/phoenix-variants-skill.js";export{generateApplicationSpecPrettierConfig}from"./prettier-config.js";export{generateApplicationSpecRobotsTxt}from"./robots-txt.js";export{generateApplicationSpecRootTsconfig}from"./root-tsconfig.js";export{generateApplicationSpecStoryDevDeclaration,generateApplicationSpecStoryPhxModule,generateApplicationSpecStoryRawProjectFiles,generateApplicationSpecStoryWrapper}from"./story/index.js";export{generateApplicationSpecCodeFile}from"./spec-code/index.js";export{generateApplicationSpecMessagesFile}from"./spec-messages/index.js";export{generateApplicationSpecTsconfig}from"./tsconfig.js";export{generateApplicationSpecWebhookBuilders}from"./webhook-builders.js";export{generateApplicationSpecWebhookIndex}from"./webhook-index.js";export{generateApplicationSpecWebhooksConfig}from"./webhooks-config.js";
1
+ export{stripSdkMarkerContent}from"./common/strip-sdk-marker-content.js";export{generateApplicationSpecAdminConfig}from"./admin-config.js";export{generateApplicationSpecAdminCode}from"./admin-domain-code.js";export{generateApplicationSpecAdminFrontendCode}from"./admin-frontend-code.js";export{generateAdminGlobalBindingBlock,generateApplicationSpecAdminGlobals}from"./admin-globals.js";export{generateApplicationSpecTypesModule}from"./application-types.js";export{generateApplicationSpecAdminFile}from"./admin.js";export{generateApplicationSpecConfiguratorConfig}from"./configurator-config.js";export{generateApplicationSpecConfiguratorCode}from"./configurator-domain-code.js";export{generateApplicationSpecConfiguratorFrontendCode}from"./configurator-frontend-code.js";export{generateApplicationSpecConfiguratorGlobals,generateConfiguratorGlobalBindingBlock}from"./configurator-globals.js";export{generateApplicationSpecConfiguratorFile}from"./configurator.js";export{generateApplicationSpecDomainSpecFile}from"./domain-spec.js";export{generateImportedStateConstants,generatePhxExportsBlock,generatePhxGlobalsBlock,generateStateConstants}from"./domain-spec/index.js";export{generateApplicationSpecDomainFile}from"./domain.js";export{generateApplicationSpecEditorFile}from"./editor.js";export{generateApplicationSpecEmbeddedAdmin}from"./embedded-admin.js";export{generateApplicationSpecEmbeddedConfigurator}from"./embedded-configurator.js";export{generateApplicationSpecEslintConfig}from"./eslint-config.js";export{generateApplicationSpecFavicon}from"./favicon.js";export{generateApplicationSpecFrontendConfig}from"./frontend-config.js";export{generateApplicationSpecGitignore}from"./gitignore.js";export{generateApplicationSpecGlobals}from"./globals.js";export{generateApplicationSpecHtmlAdminIndex}from"./html-admin-index.js";export{generateApplicationSpecHtmlIndex}from"./html-index.js";export{generateLinguiRcFile}from"./lingui-rc.js";export{generatePhoenixSkillBundle}from"./skills/phoenix-skill-bundle.js";export{followsCanaryBuilds}from"./skills/phoenix-skill.js";export{generateApplicationSpecPrettierConfig}from"./prettier-config.js";export{generateApplicationSpecRobotsTxt}from"./robots-txt.js";export{generateApplicationSpecRootTsconfig}from"./root-tsconfig.js";export{generateApplicationSpecStoryDevDeclaration,generateApplicationSpecStoryPhxModule,generateApplicationSpecStoryRawProjectFiles,generateApplicationSpecStoryWrapper}from"./story/index.js";export{generateApplicationSpecCodeFile}from"./spec-code/index.js";export{generateApplicationSpecMessagesFile}from"./spec-messages/index.js";export{generateApplicationSpecTsconfig}from"./tsconfig.js";export{generateApplicationSpecWebhookBuilders}from"./webhook-builders.js";export{generateApplicationSpecWebhookIndex}from"./webhook-index.js";export{generateApplicationSpecWebhooksConfig}from"./webhooks-config.js";
@@ -0,0 +1,10 @@
1
+ import { type AgentSkillReference } from './agent-skill.js';
2
+ import { type PhoenixSkillOptions } from './phoenix-skill.js';
3
+ /** The discoverable entry point and the documents it ships beside it. */
4
+ interface PhoenixSkillBundle {
5
+ readonly content: string;
6
+ readonly references: readonly AgentSkillReference[];
7
+ }
8
+ /** Keeps the existing generators as content owners while changing only discovery and relative routing. */
9
+ export declare const generatePhoenixSkillBundle: (options: PhoenixSkillOptions) => PhoenixSkillBundle;
10
+ export {};
@@ -0,0 +1,7 @@
1
+ import{renderAgentSkill as e}from"./agent-skill.js";import{generatePhoenixCliSkill as t}from"./phoenix-cli-skill.js";import{generatePhoenixCreateConfiguratorSkill as n,generatePhoenixCreateConfiguratorSkillReferences as r}from"./phoenix-create-configurator-skill.js";import{generatePhoenixFeedbackSkill as i}from"./phoenix-feedback-skill.js";import{generatePhoenixReviewSkill as o}from"./phoenix-review-skill.js";import{generatePhoenixSkill as a}from"./phoenix-skill.js";import{generatePhoenixVariantsSkill as s}from"./phoenix-variants-skill.js";let l=(e,t,n)=>n.reduce((e,n)=>{let r="../".repeat(t.split("/").length-2),i=`[${n.title}](${r}${n.path.slice(11)})`;return e.replaceAll(`\`${n.name}\` skill`,i).replaceAll(`${n.name} skill`,i)},e),c=e=>{let t="\n---\n\n",n=e.content.indexOf(t),r=e.content.slice(0,n).split("\n").find(e=>e.startsWith("description: "));if(-1===n||void 0===r)throw Error(`Cannot emit the ${e.name} guide: its skill frontmatter is missing. Render it with renderAgentSkill.`);return{description:r.slice(13),body:e.content.slice(n+t.length)}};export const generatePhoenixSkillBundle=h=>{let p=[{name:"phoenix",title:"Project guidance",path:"references/project.md",content:a(h),references:[]},{name:"phoenix-create-configurator",title:"Configurator workflow",path:"references/create-configurator/guide.md",content:n(),references:r()},{name:"phoenix-cli",title:"CLI guide",path:"references/cli.md",content:t(),references:[]},{name:"phoenix-review",title:"Code review guide",path:"references/review.md",content:o(),references:[]},{name:"phoenix-variants",title:"Variants guide",path:"references/variants.md",content:s(),references:[]},{name:"phoenix-feedback",title:"Feedback guide",path:"references/feedback.md",content:i(),references:[]}];return{content:e({name:"phoenix",description:"Build, change, inspect, deploy or review a Phoenix configurator project. Use for Phoenix project work, visual alternatives, and platform feedback.",sections:[`# Phoenix
2
+
3
+ Load the guides for the work in hand before doing that work. Several may apply. Follow their existing instructions; this entry point only routes to them. Reuse guidance already read in the conversation unless sync or an SDK update changed it.`,`## Choose the relevant guidance
4
+
5
+ | When | Read |
6
+ | --- | --- |
7
+ ${p.map(e=>`| ${c(e).description} | [${e.title}](${e.path}) |`).join("\n")}`,"The workflow guide links to product discovery, asset conversion, UX guidance and appearance review at the stages that use them. An isolated code fix needs project guidance and the applicable CLI/review guides; it does not restart the configurator workflow.\n\nEarlier Phoenix skill names refer to these guides: ask for the same task through `phoenix`. Read linked documents when their task applies, not the whole reference tree."]}),references:p.flatMap(e=>[{path:e.path,content:l(c(e).body,e.path,p)},...e.references.map(t=>{let n=`${e.path.slice(0,e.path.lastIndexOf("/")+1)}${t.path}`;return{path:n,content:l(t.content,n,p)}})])}};
@@ -1 +1 @@
1
- import{renderAgentSkill as e}from"./agent-skill.js";import{sdkGuidanceSections as t}from"./sdk-content.js";export const followsCanaryBuilds=e=>!e.useWorkspace&&e.sdkVersion.includes("-develop.");export const generatePhoenixSkill=({checkLatestCanary:n})=>e({name:"phoenix",description:`Phoenix SDK project conventions, covering project structure, architecture principles, key patterns, file and export rules, webhook membership, versioning the domain model once it is deployed, showing the user the dev preview and the build of a deploy, the run evaluation that follows a live deploy, inspecting the rendered result, and how to search the SDK documentation${n?", and the internal-beta check for the latest canary SDK build":""}. Use before writing or changing specs or source code, or deploying this Phoenix configurator project.`,sections:[t.packageManager,...n?["## Stay on the Latest Canary\nDuring the internal beta this project uses the `canary` build of the SDK, which is published from every change to the platform. Once per conversation, before you change anything, compare the installed version, the `version` in `node_modules/@salsita-ai/sdk/package.json`, with the newest canary:\n```bash\nnpm view @salsita-ai/sdk@canary version\n```\nWhen they differ, tell the user which version you are moving to, then update the SDK, bring the packages it needs next to it in line, and regenerate the project's files:\n```bash\npnpm add @salsita-ai/sdk@canary && pnpm phoenix deps && pnpm install && pnpm phoenix sync\n```\n`sync` rewrites the Phoenix skills, so read the ones you use again after it. When the user runs a globally installed `phoenix`, update that too with `npm install -g @salsita-ai/sdk@canary`. If the project no longer builds after the update, stop and tell the user; the `phoenix-feedback` skill covers reporting it."]:[],t.projectStructure,t.architecturePrinciples,t.keyPatterns,t.fileConventions,t.exportRules,t.webhookMembership,t.doNotEdit,t.modelVersioning,"## Show the Preview While You Work\nThe user should see the configurator change as you build it. Before your first change in a conversation, make sure `pnpm phoenix dev` is running (start it in the background when it is not) and open the address it prints as `Preview: <url>` (also written to `.phoenix/phoenix-dev.log`) in the user's browser: `open '<url>'` on macOS, `xdg-open '<url>'` on Linux, `Start-Process '<url>'` in PowerShell, `start \"\" \"<url>\"` in cmd. Keep the quotes, the shell would otherwise read a `?` in the address as a pattern. The log keeps the lines of earlier runs, so when you have just started dev, wait for the `Preview:` line written after your start and use the last one. Open it once; the preview reloads on every change, so tell the user to keep that tab open instead of opening it again.",t.visualInspection,"## Show the Build After a Deploy\nImmediately before invoking `pnpm phoenix deploy`, refresh `conversation.log` in the project root with the current conversation. Prefer the agent application's native session export when available; do not invent an export command or scan unrelated sessions. Otherwise write the messages still available in context and label the log `reconstructed; incomplete`. Never present a compaction summary as verbatim earlier messages.\n\nUse UTF-8 text with a header naming the agent, export time, source (native export or reconstructed), covered session and known omissions. Preserve user and assistant messages in chronological order, plus tool names, arguments and results when available. Keep each tool result to at most 16 KiB of text, marking truncation explicitly; describe image attachments by reference rather than embedding binary/base64 data, and mark references whose files are not uploaded. Exclude internal instructions, hidden reasoning, credentials and unrelated sensitive content; mark redactions without repeating the removed content. Refresh the current session's log rather than appending duplicate copies or silently carrying over a previous session.\n\nShow the user the exact file to review or redact and obtain approval to include it before deploying; do not ask again when they have already approved that file. If they decline, move it out of the project root before deployment so it cannot be collected. Deploy includes the file in the build's private source archive, downloadable by those authorized to download that build's sources, and leaves it out when extracting build inputs. A missing log warns but does not block deployment. The CLI does not export, redact or validate the transcript's completeness for you.\n\n`pnpm phoenix deploy` starts a build on the server and waits for it to go live. Right after `Build <id> started` it prints `Follow the build in Studio: <url>`. Run the deploy so that you can read its output while it runs, and open that link in the user's browser, quoted as above, as soon as it appears, so they can follow the build they just triggered. When the line is missing, the sign-in is older than the link: tell the user the build is listed under Deployments in Studio, and that `pnpm phoenix login <workspace>` brings the link back.\n\nWhen the deploy reports the configurator live, load the `phoenix-feedback` skill before you write your final message and follow its \"Evaluate the Run\" section, so the user is asked about the run while they are still there. It is asked once per conversation, and only once the user has nothing more to build.","## Code Review\nUse the `phoenix-review` skill to review code changes before committing.",t.sdkDocumentation]});
1
+ import{renderAgentSkill as e}from"./agent-skill.js";import{sdkGuidanceSections as t}from"./sdk-content.js";export const followsCanaryBuilds=e=>!e.useWorkspace&&e.sdkVersion.includes("-develop.");export const generatePhoenixSkill=({checkLatestCanary:n})=>e({name:"phoenix",description:`Phoenix SDK project conventions, covering project structure, architecture principles, key patterns, file and export rules, webhook membership, versioning the domain model once it is deployed, showing the user the dev preview and the build of a deploy, the run evaluation that follows a live deploy, inspecting the rendered result, and how to search the SDK documentation${n?", and the internal-beta check for the latest canary SDK build":""}. Use before writing or changing specs or source code, or deploying this Phoenix configurator project.`,sections:[t.packageManager,...n?["## Stay on the Latest Canary\nDuring the internal beta this project uses the `canary` build of the SDK, which is published from every change to the platform. Once per conversation, before you change anything, compare the installed version, the `version` in `node_modules/@salsita-ai/sdk/package.json`, with the newest canary:\n```bash\nnpm view @salsita-ai/sdk@canary version\n```\nWhen they differ, tell the user which version you are moving to, then update the SDK, bring the packages it needs next to it in line, and regenerate the project's files:\n```bash\npnpm add @salsita-ai/sdk@canary && pnpm phoenix deps && pnpm install && pnpm phoenix sync\n```\n`sync` rewrites the Phoenix skills, so read the ones you use again after it. When the user runs a globally installed `phoenix`, update that too with `npm install -g @salsita-ai/sdk@canary`. If the project no longer builds after the update, stop and tell the user; the `phoenix-feedback` skill covers reporting it."]:[],t.projectStructure,t.architecturePrinciples,t.keyPatterns,t.fileConventions,t.exportRules,t.webhookMembership,t.doNotEdit,t.modelVersioning,"## Show the Preview While You Work\nThe user should see the configurator change as you build it. Before your first change in a conversation, make sure `pnpm phoenix dev` is running (start it in the background when it is not) and open the address it prints as `Preview: <url>` (also written to `.phoenix/phoenix-dev.log`) in the user's browser: `open '<url>'` on macOS, `xdg-open '<url>'` on Linux, `Start-Process '<url>'` in PowerShell, `start \"\" \"<url>\"` in cmd. Keep the quotes, the shell would otherwise read a `?` in the address as a pattern. The log keeps the lines of earlier runs, so when you have just started dev, wait for the `Preview:` line written after your start and use the last one. Open it once; the preview reloads on every change, so tell the user to keep that tab open instead of opening it again. A domain model change is the exception: `pnpm phoenix dev` registers the model with the server only when it starts, and after the change it logs an error that asks for a restart. Restart it, wait for the new `Preview:` line and open that address in place of the old tab, whose address carries the `?cid=` of a configuration saved with the earlier model, which the new model rejects.",t.visualInspection,"## Show the Build After a Deploy\nImmediately before invoking `pnpm phoenix deploy`, refresh `conversation.log` in the project root with the current conversation. Prefer the agent application's native session export when available; do not invent an export command or scan unrelated sessions. Otherwise write the messages still available in context and label the log `reconstructed; incomplete`. Never present a compaction summary as verbatim earlier messages.\n\nUse UTF-8 text with a header naming the agent, export time, source (native export or reconstructed), covered session and known omissions. Preserve user and assistant messages in chronological order, plus tool names, arguments and results when available. Keep each tool result to at most 16 KiB of text, marking truncation explicitly; describe image attachments by reference rather than embedding binary/base64 data, and mark references whose files are not uploaded. Exclude internal instructions, hidden reasoning, credentials and unrelated sensitive content; mark redactions without repeating the removed content. Refresh the current session's log rather than appending duplicate copies or silently carrying over a previous session.\n\nShow the user the exact file to review or redact and obtain approval to include it before deploying; do not ask again when they have already approved that file. If they decline, move it out of the project root before deployment so it cannot be collected. Deploy includes the file in the build's private source archive, downloadable by those authorized to download that build's sources, and leaves it out when extracting build inputs. A missing log warns but does not block deployment. The CLI does not export, redact or validate the transcript's completeness for you.\n\n`pnpm phoenix deploy` starts a build on the server and waits for it to go live. Right after `Build <id> started` it prints `Follow the build in Studio: <url>`. Run the deploy so that you can read its output while it runs, and open that link in the user's browser, quoted as above, as soon as it appears, so they can follow the build they just triggered. When the line is missing, the sign-in is older than the link: tell the user the build is listed under Deployments in Studio, and that `pnpm phoenix login <workspace>` brings the link back.\n\nWhen the deploy reports the configurator live, load the `phoenix-feedback` skill before you write your final message and follow its \"Evaluate the Run\" section, so the user is asked about the run while they are still there. It is asked once per conversation, and only once the user has nothing more to build.","## Code Review\nUse the `phoenix-review` skill to review code changes before committing.",t.sdkDocumentation]});
@@ -0,0 +1,25 @@
1
+ import { type EnumLike } from '#package/domain';
2
+ import type { RuntimeSpec } from '../runtime-spec/index.js';
3
+ /**
4
+ * The value of `phx.applicationTypes`: the application's version and published data hash, the JSON
5
+ * schemas of its data (`undefined` for data the spec leaves out), and its state enums.
6
+ */
7
+ export interface PhxApplicationTypes {
8
+ readonly ApplicationVersion: string;
9
+ readonly PublishedDataHash: string;
10
+ readonly PublishedData: unknown;
11
+ readonly SessionData: unknown;
12
+ readonly FrontendData: unknown;
13
+ readonly BackendData: unknown;
14
+ readonly FinalizeData: unknown;
15
+ readonly PrefetchedFinalizeData: unknown;
16
+ readonly FinalizeResult: unknown;
17
+ readonly CallbackData: unknown;
18
+ readonly NavigationState: EnumLike<string>;
19
+ readonly ViewState: EnumLike<string>;
20
+ readonly ToolState: EnumLike<string>;
21
+ readonly ExportState: EnumLike<string>;
22
+ readonly AdminNavigationState: EnumLike<string>;
23
+ }
24
+ /** Builds `phx.applicationTypes` from the spec, with the values generated `domain-spec.ts` writes. */
25
+ export declare const createPhxApplicationTypes: (spec: RuntimeSpec) => PhxApplicationTypes;
@@ -0,0 +1 @@
1
+ import{EnumReflection as a}from"#package/domain";let t=(t,e)=>new a(t,{enum:[...e]});export const createPhxApplicationTypes=a=>{let{dataSchemas:e,states:i}=a.configurator;return{ApplicationVersion:a.appMetadata.applicationVersion,PublishedDataHash:e.publishedDataHash,PublishedData:e.publishedData.runtimeSchema,SessionData:e.sessionData.runtimeSchema,FrontendData:e.frontendData.runtimeSchema,BackendData:e.backendData?.runtimeSchema,FinalizeData:e.finalizeData.runtimeSchema,PrefetchedFinalizeData:e.prefetchedFinalizeData.runtimeSchema,FinalizeResult:e.finalizeResult.runtimeSchema,CallbackData:e.callbackData.runtimeSchema,NavigationState:t("NavigationState",i.navigationStates),ViewState:t("ViewState",i.viewStates),ToolState:t("ToolState",i.toolStates),ExportState:t("ExportState",i.exportStates),AdminNavigationState:t("AdminNavigationState",a.admin.states.navigationStates)}};
@@ -0,0 +1,36 @@
1
+ import type { FactoryDataRuntime } from '../runtime/index.js';
2
+ import type { PhxModel } from './phx-model.js';
3
+ /**
4
+ * The value of `phx.domain`: the reflections and the factories project code writes its expressions,
5
+ * invariants, actions, components and recipes with, and the same for the admin domain under `admin`.
6
+ * The factories carry only the data the spec gives them (aliases, static violations, defaults); their
7
+ * types come from the project's `globals.d.ts`, which declares every member.
8
+ */
9
+ export interface PhxDomain extends PhxModel {
10
+ readonly implementCustomExpressions: unknown;
11
+ readonly implementCustomInvariants: unknown;
12
+ readonly implementActions: unknown;
13
+ readonly createAssistantSetupHandler: unknown;
14
+ readonly attachComponent: unknown;
15
+ readonly createRecipe: unknown;
16
+ readonly admin: PhxModel & {
17
+ readonly implementCustomExpressions: unknown;
18
+ readonly implementCustomInvariants: unknown;
19
+ readonly attachComponent: unknown;
20
+ readonly createMapPublishedRevisionDataHandler: unknown;
21
+ readonly createMapPublishedChunkedDataHandler: unknown;
22
+ readonly createDataRowValidatorHandler: unknown;
23
+ readonly createSheetValidatorHandler: unknown;
24
+ readonly createRecipe: unknown;
25
+ };
26
+ }
27
+ interface PhxDomainInput {
28
+ readonly model: PhxModel;
29
+ readonly factoryData: FactoryDataRuntime;
30
+ }
31
+ /**
32
+ * Builds `phx.domain` from the reflections and the factory data of both domains, with the same
33
+ * factories and the same data generated `domain-spec.ts` passes them.
34
+ */
35
+ export declare const createPhxDomain: (configurator: PhxDomainInput, admin: PhxDomainInput) => PhxDomain;
36
+ export {};
@@ -0,0 +1 @@
1
+ import{DomainComponentOpticBuilder as a,createActionFactory as t,createAssistantSetupHandlerFactory as e,createCustomExpressionFactory as o,createCustomInvariantFactory as i,createDataRowValidatorHandler as s,createMapPublishedChunkedDataHandlerFactory as n,createMapPublishedRevisionDataHandlerFactory as m,createRecipeFactory as r,createSheetValidatorHandler as c}from"#package/domain";let l=a=>r(a.aliases,a.entityReflections,a.defaults);export const createPhxDomain=(r,p)=>({...r.model,implementCustomExpressions:o(),implementCustomInvariants:i()(r.factoryData.staticViolations),implementActions:t(),createAssistantSetupHandler:e(),attachComponent:a.from(r.factoryData.aliases),createRecipe:l(r.factoryData),admin:{...p.model,implementCustomExpressions:o(),implementCustomInvariants:i()(p.factoryData.staticViolations),attachComponent:a.from(p.factoryData.aliases),createMapPublishedRevisionDataHandler:m(),createMapPublishedChunkedDataHandler:n(),createDataRowValidatorHandler:s,createSheetValidatorHandler:c,createRecipe:l(p.factoryData)}});
@@ -0,0 +1,24 @@
1
+ import type { Expressions } from '../../parse-application-files/index.js';
2
+ import type { RuntimeLatestModelVersion } from '../runtime-spec/index.js';
3
+ import type { AdminModelRuntime, ConfiguratorModelRuntime, SpecCodeMap } from '../runtime/index.js';
4
+ /**
5
+ * The reflections of one domain that project code reads from `phx.domain` (or `phx.domain.admin`):
6
+ * `model` holds the entity, alias, common type and shape reflections, `enhancedModel` the enhanced
7
+ * reflection of every entity and alias, named `$<Name>`.
8
+ */
9
+ export interface PhxModel {
10
+ readonly model: Readonly<Record<string, unknown>>;
11
+ readonly enhancedModel: Readonly<Record<string, unknown>>;
12
+ }
13
+ interface PhxModelSpec {
14
+ readonly latestModel: RuntimeLatestModelVersion;
15
+ readonly expressions: Expressions;
16
+ }
17
+ /**
18
+ * Builds the reflections of one domain from its runtime spec and its model runtime. The entity and
19
+ * alias reflections and the enhanced entity reflections are the model runtime's own, so the domain
20
+ * built from the same model runtime validates with the same objects; common types, shapes and
21
+ * enhanced aliases are built here, in the order generated code lists them.
22
+ */
23
+ export declare const createPhxModel: (domainSpec: PhxModelSpec, modelRuntime: ConfiguratorModelRuntime | AdminModelRuntime, code: SpecCodeMap | undefined) => PhxModel;
24
+ export {};
@@ -0,0 +1 @@
1
+ import{EnhancedAliasReflection as e,EnumReflection as t,SchemaReflection as n}from"#package/domain";import{evaluateReflectionConstants as o}from"../runtime/index.js";let r=e=>e,i=(e,o,i)=>{let l,s=r(i);return void 0!==(l=o.enum)&&l.length>0&&l.every(e=>"string"==typeof e)?new t(e,{...s,enum:[...o.enum]}):new n(e,s)};export const createPhxModel=(t,l,s)=>{let a={...l.entities,...l.aliasReflections};for(let[e,n]of t.latestModel.commonTypes)a[String(e)]=i(String(e),n.schema,n.runtimeSchema);for(let e of t.latestModel.shapes.values()){let t=`${String(e.name)}Shape`;a[t]=new n(t,r(e.runtimeSchema))}let m={};for(let[e,t]of Object.entries(l.$entityReflections))m[`$${e}`]=t;for(let[n,r]of t.latestModel.aliases){let i=String(n);m[`$${i}`]=new e(`$${i}`,r.map(String),o(t.expressions,i,s))}return{model:a,enhancedModel:m}};
@@ -0,0 +1,22 @@
1
+ import type { RuntimeReferenceStore } from '../../caching/index.js';
2
+ import type { RuntimeSpec } from '../runtime-spec/index.js';
3
+ import { type SpecCodeModule } from '../runtime/index.js';
4
+ import { type PhxApplicationTypes } from './phx-application-types.js';
5
+ import { type PhxDomain } from './phx-domain.js';
6
+ /** The `phx` values an application's project modules read while they load. */
7
+ export interface Phx {
8
+ readonly domain: PhxDomain;
9
+ readonly applicationTypes: PhxApplicationTypes;
10
+ }
11
+ /**
12
+ * Builds the values of `phx.domain` and `phx.applicationTypes` from an application's runtime spec
13
+ * (`.phoenix/application-spec.json`, decoded with `decodeRuntimeSpec`) and its generated code module
14
+ * (`.phoenix/spec-code.ts`): the model reflections of both domains, and the factories with the
15
+ * static violations, aliases and defaults of the spec.
16
+ *
17
+ * It builds the spec's sections in `referenceStore`. The application's `ApplicationRuntime` is
18
+ * built later in the same store, so `phx.domain.model` holds the reflections the application's
19
+ * domain validates with. It assigns nothing: the generated entry assigns `phx` before it imports
20
+ * the project's modules, because a development server renames the global in project files only.
21
+ */
22
+ export declare const createPhx: (spec: RuntimeSpec, referenceStore: RuntimeReferenceStore, specCode?: SpecCodeModule) => Phx;
@@ -0,0 +1 @@
1
+ import{SpecRuntime as o}from"../runtime/index.js";import{createPhxApplicationTypes as t}from"./phx-application-types.js";import{createPhxDomain as a}from"./phx-domain.js";import{createPhxModel as m}from"./phx-model.js";export const createPhx=(r,i,e)=>{let{configurator:n,admin:p}=o(r,i,e);return{domain:a({model:m(r.configurator,n.modelRuntime,e?.configurator),factoryData:n.factoryDataRuntime},{model:m(r.admin,p.modelRuntime,e?.admin),factoryData:p.factoryDataRuntime}),applicationTypes:t(r)}};
@@ -1,5 +1,7 @@
1
1
  export * from './runtime/sections/index.js';
2
2
  export * from './runtime/application-runtime.js';
3
+ export { applicationSpecSlice, type ApplicationSpecSliceModules } from './runtime/application-spec-slice.js';
4
+ export { type ApplicationModules, createApplication } from './runtime/create-application.js';
3
5
  export * from './runtime/factory-data/index.js';
4
6
  export * from './runtime/migrations/index.js';
5
7
  export { isConfiguratorModelSchemaCompatible } from './runtime/configurator-runtime/configurator-model-runtime.js';
@@ -1 +1 @@
1
- export*from"./runtime/sections/index.js";export*from"./runtime/application-runtime.js";export*from"./runtime/factory-data/index.js";export*from"./runtime/migrations/index.js";export{isConfiguratorModelSchemaCompatible}from"./runtime/configurator-runtime/configurator-model-runtime.js";export*from"./code/index.js";export{generateRuntimeInstance}from"./runtime/generate-runtime-instance.js";
1
+ export*from"./runtime/sections/index.js";export*from"./runtime/application-runtime.js";export{applicationSpecSlice}from"./runtime/application-spec-slice.js";export{createApplication}from"./runtime/create-application.js";export*from"./runtime/factory-data/index.js";export*from"./runtime/migrations/index.js";export{isConfiguratorModelSchemaCompatible}from"./runtime/configurator-runtime/configurator-model-runtime.js";export*from"./code/index.js";export{generateRuntimeInstance}from"./runtime/generate-runtime-instance.js";
@@ -1,8 +1,8 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
2
  import { type $DomainEntity, $DomainEntityReflection, DomainBuilder, type DomainEntity, DomainEntityReflection, RawAliasReflection, SchemaReflection } from '#package/domain';
3
3
  import type { RuntimeReferenceStore } from '../../../caching/index.js';
4
- import type { DataSchemas, Expressions } from '../../../parse-application-files/index.js';
5
- import type { RuntimeModelVersion, RuntimeResolvedVersions } from '../../runtime-spec/index.js';
4
+ import type { Expressions } from '../../../parse-application-files/index.js';
5
+ import type { RuntimeDataSchemas, RuntimeModelVersion, RuntimeResolvedVersions } from '../../runtime-spec/index.js';
6
6
  import type { SpecCodeMap } from '../spec-code/index.js';
7
7
  type AnyEntity = DomainEntity<string>;
8
8
  type AnyAliases = Record<string, AnyEntity>;
@@ -26,5 +26,5 @@ interface AdminModelRuntimeFields {
26
26
  readonly schemaChanged: boolean;
27
27
  }
28
28
  export type AdminModelRuntime = Branded<'AdminModelRuntime', AdminModelRuntimeFields>;
29
- export declare const AdminModelRuntime: (domainSpec: AdminModelRuntimeSpec, dataSchemas: DataSchemas, referenceStore: RuntimeReferenceStore, code: SpecCodeMap | undefined) => AdminModelRuntime;
29
+ export declare const AdminModelRuntime: (domainSpec: AdminModelRuntimeSpec, dataSchemas: RuntimeDataSchemas, referenceStore: RuntimeReferenceStore, code: SpecCodeMap | undefined) => AdminModelRuntime;
30
30
  export {};
@@ -2,13 +2,13 @@ import { Branded } from '@salsita-ai/common/utils';
2
2
  import { type ImplementationErrorCollector, type ProjectModule } from '#package/domain';
3
3
  import type { RuntimeReferenceStore } from '../../../caching/index.js';
4
4
  import type { RuntimeSpec } from '../../runtime-spec/index.js';
5
- import { FactoryDataRuntime } from '../factory-data/index.js';
5
+ import type { FactoryDataRuntime } from '../factory-data/index.js';
6
6
  import { type MigrationModules, MigrationRuntime } from '../migrations/index.js';
7
7
  import { ComponentOptics } from '../sections/component-optic.js';
8
8
  import { ExpressionRuntime, type InvariantImplementations, type MissingExpression } from '../sections/expression-runtime.js';
9
9
  import { PresetRuntime } from '../sections/preset-runtime.js';
10
10
  import type { SpecCodeMap } from '../spec-code/index.js';
11
- import { AdminModelRuntime } from './admin-model-runtime.js';
11
+ import type { AdminModelRuntime } from './admin-model-runtime.js';
12
12
  import { AdminStatesRuntime } from './states-runtime.js';
13
13
  export type AdminRuntime = Branded<'AdminRuntime', {
14
14
  readonly modelRuntime: AdminModelRuntime;
@@ -25,5 +25,7 @@ export type AdminRuntimeResult = {
25
25
  } | {
26
26
  readonly ok: false;
27
27
  readonly missingExpressions: readonly MissingExpression[];
28
+ /** The migrations the migration modules do not export, as `migrationRuntime.missingMigrations` lists them. */
29
+ readonly missingMigrations: readonly string[];
28
30
  };
29
31
  export declare const AdminRuntime: (spec: RuntimeSpec, referenceStore: RuntimeReferenceStore, expressionModules: readonly ProjectModule[], invariantImplementations: InvariantImplementations, migrationModules: MigrationModules, code: SpecCodeMap | undefined, errors: ImplementationErrorCollector) => AdminRuntimeResult;
@@ -1 +1 @@
1
- import{Branded as e}from"@salsita-ai/common/utils";import{Preset as t,PresetCategory as i,commonAdminCustomExpressions as n,commonAdminViolationExpressions as r}from"#package/domain";import{FactoryDataRuntime as s}from"../factory-data/index.js";import{MigrationRuntime as o}from"../migrations/index.js";import{ComponentOptics as m}from"../sections/component-optic.js";import{ExpressionRuntime as a}from"../sections/expression-runtime.js";import{PresetRuntime as p}from"../sections/preset-runtime.js";import{AdminModelRuntime as u}from"./admin-model-runtime.js";import{AdminStatesRuntime as f}from"./states-runtime.js";let c={Preset:[{evaluate:(e,i,n)=>{let s=n.domain.get$Entity(e,i);return t.assert(s),r.Preset.nameNotEmpty(s)}}]},d={PresetCategory:{$isDraft:{origin:{name:"$isDraft",typeOrAlias:"PresetCategory"},evaluate:(e,t,r)=>{let s=r.domain.get$Entity(e,t);return i.assert(s),n.PresetCategory.$isDraft(s)},meta:{}}}},l=new WeakMap;export const AdminRuntime=(t,i,n,r,g,R,y)=>{let j=u(t.admin,t.configurator.dataSchemas,i,R),k=a(t.admin,i,n,"adminExpressionRuntime",((e,t)=>{if(0===Object.keys(e).length)return c;let i=l.get(t)??new WeakMap;l.set(t,i);let n=i.get(e);if(n)return n;let r={};for(let i of[c,e])for(let[e,n]of Object.entries(i))for(let i of t[e]??[e])r[i]=[...r[i]??[],...n];return i.set(e,r),r})(r,j.aliases),R,y,d);return k.ok?{ok:!0,runtime:e({modelRuntime:j,componentOptics:m(i,{components:t.admin.components,referenceScope:"adminRuntime/componentOptics",modelRuntime:j,code:R}),expressionRuntime:k.runtime,presetRuntime:p(i,{referenceScope:"adminRuntime/presetRuntime",presets:t.admin.presets.presets}),statesRuntime:f(t,i),migrationRuntime:o(i,{referenceScope:"adminRuntime/migrationRuntime",resolvedVersions:t.admin.resolvedVersions,latestEntities:j.entities,migrationModules:g}),factoryDataRuntime:s(i,{referenceScope:"adminRuntime/factoryDataRuntime",invariants:t.admin.invariants,defaults:t.admin.defaults,aliases:j.aliases,entities:j.entities})})}:{ok:!1,missingExpressions:k.missing}};
1
+ import{Branded as e}from"@salsita-ai/common/utils";import{Preset as t,PresetCategory as i,commonAdminCustomExpressions as s,commonAdminViolationExpressions as n}from"#package/domain";import{MigrationRuntime as r}from"../migrations/index.js";import{ComponentOptics as o}from"../sections/component-optic.js";import{ExpressionRuntime as m}from"../sections/expression-runtime.js";import{PresetRuntime as a}from"../sections/preset-runtime.js";import{AdminSpecRuntime as p}from"./admin-spec-runtime.js";import{AdminStatesRuntime as u}from"./states-runtime.js";let c={Preset:[{evaluate:(e,i,s)=>{let r=s.domain.get$Entity(e,i);return t.assert(r),n.Preset.nameNotEmpty(r)}}]},f={PresetCategory:{$isDraft:{origin:{name:"$isDraft",typeOrAlias:"PresetCategory"},evaluate:(e,t,n)=>{let r=n.domain.get$Entity(e,t);return i.assert(r),s.PresetCategory.$isDraft(r)},meta:{}}}},l=new WeakMap;export const AdminRuntime=(t,i,s,n,g,d,R)=>{let{modelRuntime:j,factoryDataRuntime:y}=p(t,i,d),k=m(t.admin,i,s,"adminExpressionRuntime",((e,t)=>{if(0===Object.keys(e).length)return c;let i=l.get(t)??new WeakMap;l.set(t,i);let s=i.get(e);if(s)return s;let n={};for(let i of[c,e])for(let[e,s]of Object.entries(i))for(let i of t[e]??[e])n[i]=[...n[i]??[],...s];return i.set(e,n),n})(n,j.aliases),d,R,f),x=r(i,{referenceScope:"adminRuntime/migrationRuntime",resolvedVersions:t.admin.resolvedVersions,latestEntities:j.entities,migrationModules:g});return k.ok?{ok:!0,runtime:e({modelRuntime:j,componentOptics:o(i,{components:t.admin.components,referenceScope:"adminRuntime/componentOptics",modelRuntime:j,code:d}),expressionRuntime:k.runtime,presetRuntime:a(i,{referenceScope:"adminRuntime/presetRuntime",presets:t.admin.presets.presets}),statesRuntime:u(t,i),migrationRuntime:x,factoryDataRuntime:y})}:{ok:!1,missingExpressions:k.missing,missingMigrations:x.missingMigrations}};
@@ -0,0 +1,16 @@
1
+ import { Branded } from '@salsita-ai/common/utils';
2
+ import type { RuntimeReferenceStore } from '../../../caching/index.js';
3
+ import type { RuntimeSpec } from '../../runtime-spec/index.js';
4
+ import { FactoryDataRuntime } from '../factory-data/index.js';
5
+ import type { SpecCodeMap } from '../spec-code/index.js';
6
+ import { AdminModelRuntime } from './admin-model-runtime.js';
7
+ /**
8
+ * The sections of the admin domain that the spec alone determines: its model and the data of its
9
+ * `phx.domain.admin` factories. `AdminRuntime` builds its own from this function, so a build of
10
+ * either in the same reference store returns the same objects.
11
+ */
12
+ export type AdminSpecRuntime = Branded<'AdminSpecRuntime', {
13
+ readonly modelRuntime: AdminModelRuntime;
14
+ readonly factoryDataRuntime: FactoryDataRuntime;
15
+ }>;
16
+ export declare const AdminSpecRuntime: (spec: RuntimeSpec, referenceStore: RuntimeReferenceStore, code: SpecCodeMap | undefined) => AdminSpecRuntime;
@@ -0,0 +1 @@
1
+ import{Branded as a}from"@salsita-ai/common/utils";import{FactoryDataRuntime as t}from"../factory-data/index.js";import{AdminModelRuntime as i}from"./admin-model-runtime.js";export const AdminSpecRuntime=(e,n,m)=>{let r=i(e.admin,e.configurator.dataSchemas,n,m);return a({modelRuntime:r,factoryDataRuntime:t(n,{referenceScope:"adminRuntime/factoryDataRuntime",invariants:e.admin.invariants,defaults:e.admin.defaults,aliases:r.aliases,entities:r.entities})})};