@salsita-ai/sdk 0.50.0-develop.ca5894b56c → 0.50.0-develop.cba048b0d7

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 (238) hide show
  1. package/dist/application-spec/errors/diagnostic-codes.d.ts +7 -1
  2. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  3. package/dist/application-spec/errors/diagnostic-messages.d.ts +14 -1
  4. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  5. package/dist/application-spec/generate-application/implementations/phx-model.d.ts +1 -1
  6. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +1 -2
  7. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +1 -2
  8. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +1 -2
  9. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +1 -2
  10. package/dist/application-spec/generate-application/runtime/sections/actions-runtime.d.ts +1 -2
  11. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +1 -1
  12. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
  13. package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.d.ts +1 -1
  14. package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +1 -2
  15. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +1 -2
  16. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +1 -2
  17. package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +1 -2
  18. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +96 -31
  19. package/dist/application-spec/generate-application/runtime-spec/spec-code-id.d.ts +1 -1
  20. package/dist/application-spec/parse-application-files/merge/merged-assistant.d.ts +13 -4
  21. package/dist/application-spec/parse-application-files/merge/merged-assistant.js +1 -1
  22. package/dist/application-spec/parse-application-files/merge/merged-infra.d.ts +4 -11
  23. package/dist/application-spec/parse-application-files/merge/merged-transformers.d.ts +2 -4
  24. package/dist/application-spec/parse-application-files/raw-spec/raw-acl.d.ts +2 -2
  25. package/dist/application-spec/parse-application-files/raw-spec/raw-acl.js +1 -1
  26. package/dist/application-spec/parse-application-files/raw-spec/raw-admin-pages.d.ts +3 -24
  27. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +25 -20
  28. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  29. package/dist/application-spec/parse-application-files/raw-spec/raw-resources.d.ts +19 -64
  30. package/dist/application-spec/parse-application-files/spec/application/admin-spec/admin-pages.d.ts +3 -20
  31. package/dist/application-spec/parse-application-files/spec/application/admin-spec/states.d.ts +3 -5
  32. package/dist/application-spec/parse-application-files/spec/application/configurator-spec/states.d.ts +3 -8
  33. package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding.d.ts +3 -13
  34. package/dist/application-spec/parse-application-files/spec/components/bindings/write-binding.d.ts +4 -32
  35. package/dist/application-spec/parse-application-files/spec/components/component-filter.d.ts +4 -10
  36. package/dist/application-spec/parse-application-files/spec/components/components.d.ts +3 -4
  37. package/dist/application-spec/parse-application-files/spec/components/index.d.ts +1 -2
  38. package/dist/application-spec/parse-application-files/spec/components/index.js +1 -1
  39. package/dist/application-spec/parse-application-files/spec/components/sdk-component-entry.d.ts +1 -1
  40. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.d.ts +2 -3
  41. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.js +1 -1
  42. package/dist/application-spec/parse-application-files/spec/components/user-components.d.ts +2 -3
  43. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +2 -2
  44. package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +7 -29
  45. package/dist/application-spec/parse-application-files/spec/expressions/index.d.ts +0 -1
  46. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.d.ts +4 -71
  47. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.js +1 -1
  48. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts +2 -2
  49. package/dist/application-spec/parse-application-files/spec/invariants/invariant.d.ts +5 -21
  50. package/dist/application-spec/parse-application-files/spec/invariants/invariants.d.ts +4 -14
  51. package/dist/application-spec/parse-application-files/spec/sections/actions.d.ts +6 -23
  52. package/dist/application-spec/parse-application-files/spec/sections/app-metadata.d.ts +3 -18
  53. package/dist/application-spec/parse-application-files/spec/sections/application-version.d.ts +3 -7
  54. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  55. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant.js +1 -1
  56. package/dist/application-spec/parse-application-files/spec/sections/data-spec/chunks.d.ts +6 -23
  57. package/dist/application-spec/parse-application-files/spec/sections/data-spec/custom-data-spec.d.ts +1 -16
  58. package/dist/application-spec/parse-application-files/spec/sections/data-spec/data-entry-key.d.ts +3 -9
  59. package/dist/application-spec/parse-application-files/spec/sections/data-spec/data-spec.d.ts +1 -10
  60. package/dist/application-spec/parse-application-files/spec/sections/data-spec/swatch-data-spec.d.ts +1 -14
  61. package/dist/application-spec/parse-application-files/spec/sections/state-value.d.ts +3 -7
  62. package/dist/application-spec/parse-application-files/spec/sections/theme.d.ts +3 -10
  63. package/dist/application-spec/parse-application-files/spec/sections/transformers.d.ts +4 -11
  64. package/dist/application-spec/parse-application-files/spec/sections/ui.d.ts +3 -12
  65. package/dist/configurator/ConfiguratorApp.js +1 -1
  66. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  67. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +19 -3
  68. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  69. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +70 -56
  70. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  71. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +15 -0
  72. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  73. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.d.ts +40 -0
  74. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.js +1 -0
  75. package/dist/configurator/common/configurator-interface.d.ts +2 -2
  76. package/dist/configurator/common/configurator-interface.js +1 -1
  77. package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.js +1 -1
  78. package/dist/configurator/configurator-context/index.d.ts +0 -1
  79. package/dist/configurator/configurator-context/index.js +1 -1
  80. package/dist/configurator/pages/NewConfiguratorPage.js +1 -1
  81. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  82. package/dist/configurator/ui/assistant/tool-chip.d.ts +19 -9
  83. package/dist/configurator/ui/assistant/tool-chip.js +1 -1
  84. package/dist/configurator/ui/configurator-layout/universal/DesktopPreview.js +1 -1
  85. package/dist/configurator/ui/configurator-layout/universal/MobilePreview.js +1 -1
  86. package/dist/configurator/ui/legacy/layout/common/CommonTopNavigation.js +1 -1
  87. package/dist/configurator/ui/legacy/layout/simple/SimpleTopNavigation.js +1 -1
  88. package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.js +1 -1
  89. package/dist/configurator/ui/legacy/layout/steps/StepsOwnerLayout.js +1 -1
  90. package/dist/configurator/ui/phoenix-layout-elements/header/common/back-button/use-go-back-action.js +1 -1
  91. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.js +1 -1
  92. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/basic/use-basic-sidebar-footer.js +1 -1
  93. package/dist/configurator/ui/preset-layout/CategoryPresetUi.js +1 -1
  94. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -1
  95. package/dist/docs/drag-and-drop/room-planner.mdx +1 -1
  96. package/dist/docs/index.json +1 -1
  97. package/dist/docs/phoenix/configurator-interface.mdx +1 -1
  98. package/dist/docs/phoenix/layout-slots.mdx +21 -0
  99. package/dist/docs/phoenix/phoenix-cli.mdx +1 -0
  100. package/dist/domain/application/application-config.d.ts +6 -24
  101. package/dist/domain/application/assistant/assistant-manifest.d.ts +13 -3
  102. package/dist/domain/application/assistant/assistant-manifest.js +1 -1
  103. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +5 -9
  104. package/dist/domain/application/assistant/assistant-resolved-manifest.js +1 -1
  105. package/dist/domain/application/assistant/build-assistant-lenses.js +1 -1
  106. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  107. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  108. package/dist/domain/application/assistant/index.d.ts +3 -3
  109. package/dist/domain/application/assistant/index.js +1 -1
  110. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
  111. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +2 -4
  112. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
  113. package/dist/domain/application/assistant-mutations.js +1 -1
  114. package/dist/domain/available-system-components/available-system-components.d.ts +11 -0
  115. package/dist/domain/available-system-components/available-system-components.js +1 -0
  116. package/dist/domain/available-system-components/index.d.ts +1 -0
  117. package/dist/domain/available-system-components/index.js +1 -0
  118. package/dist/domain/{domain-builder.d.ts → domain-builder/domain-builder.d.ts} +2 -2
  119. package/dist/domain/domain-builder/domain-builder.js +1 -0
  120. package/dist/domain/domain-builder/index.d.ts +1 -0
  121. package/dist/domain/domain-builder/index.js +1 -0
  122. package/dist/domain/index.d.ts +2 -2
  123. package/dist/domain/index.js +1 -1
  124. package/dist/domain/spec/application/admin-pages-section.d.ts +29 -0
  125. package/dist/domain/spec/application/admin-pages.d.ts +26 -0
  126. package/dist/domain/spec/application/admin-states.d.ts +5 -0
  127. package/dist/domain/spec/application/admin-states.js +1 -0
  128. package/dist/domain/spec/application/configurator-states.d.ts +8 -0
  129. package/dist/domain/spec/application/configurator-states.js +1 -0
  130. package/dist/domain/spec/application/index.d.ts +4 -0
  131. package/dist/domain/spec/components/bindings/index.d.ts +2 -0
  132. package/dist/domain/spec/components/bindings/index.js +1 -0
  133. package/dist/domain/spec/components/bindings/read-binding.d.ts +13 -0
  134. package/dist/domain/spec/components/bindings/read-binding.js +1 -0
  135. package/dist/domain/spec/components/bindings/write-binding.d.ts +32 -0
  136. package/dist/domain/spec/components/bindings/write-binding.js +1 -0
  137. package/dist/{application-spec/parse-application-files → domain}/spec/components/component-entry.d.ts +3 -3
  138. package/dist/domain/spec/components/component-entry.js +1 -0
  139. package/dist/domain/spec/components/component-filters.d.ts +10 -0
  140. package/dist/domain/spec/components/component-filters.js +1 -0
  141. package/dist/domain/spec/components/components.d.ts +4 -0
  142. package/dist/domain/spec/components/components.js +1 -0
  143. package/dist/domain/spec/components/index.d.ts +4 -0
  144. package/dist/domain/spec/{enhanced-json-value.d.ts → enhanced-json/enhanced-json-value.d.ts} +1 -1
  145. package/dist/domain/spec/enhanced-json/index.d.ts +1 -0
  146. package/dist/domain/spec/enhanced-json/index.js +1 -0
  147. package/dist/{application-spec/parse-application-files → domain}/spec/expressions/expression.d.ts +9 -3
  148. package/dist/domain/spec/expressions/expression.js +1 -0
  149. package/dist/domain/spec/expressions/expressions.d.ts +27 -0
  150. package/dist/domain/spec/expressions/expressions.js +1 -0
  151. package/dist/domain/spec/expressions/index.d.ts +3 -0
  152. package/dist/domain/spec/expressions/memo-eval-plan.d.ts +70 -0
  153. package/dist/domain/spec/expressions/memo-eval-plan.js +1 -0
  154. package/dist/domain/spec/index.d.ts +3 -1
  155. package/dist/domain/spec/index.js +1 -1
  156. package/dist/domain/spec/invariants/index.d.ts +2 -0
  157. package/dist/domain/spec/invariants/index.js +1 -0
  158. package/dist/domain/spec/invariants/invariant.d.ts +24 -0
  159. package/dist/domain/spec/invariants/invariant.js +1 -0
  160. package/dist/domain/spec/invariants/invariants.d.ts +14 -0
  161. package/dist/domain/spec/invariants/invariants.js +1 -0
  162. package/dist/domain/spec/markers/index.d.ts +1 -0
  163. package/dist/domain/spec/markers/index.js +1 -1
  164. package/dist/domain/spec/model/defaults.d.ts +1 -1
  165. package/dist/domain/spec/sections/actions.d.ts +23 -0
  166. package/dist/domain/spec/sections/actions.js +1 -0
  167. package/dist/domain/spec/sections/app-metadata.d.ts +18 -0
  168. package/dist/domain/spec/sections/app-metadata.js +1 -0
  169. package/dist/domain/spec/sections/application-version.d.ts +7 -0
  170. package/dist/domain/spec/sections/application-version.js +1 -0
  171. package/dist/domain/spec/sections/data-spec/chunks.d.ts +23 -0
  172. package/dist/domain/spec/sections/data-spec/chunks.js +1 -0
  173. package/dist/domain/spec/sections/data-spec/custom-data-spec-entry.d.ts +16 -0
  174. package/dist/domain/spec/sections/data-spec/custom-data-spec-entry.js +1 -0
  175. package/dist/domain/spec/sections/data-spec/data-entry-key.d.ts +9 -0
  176. package/dist/domain/spec/sections/data-spec/data-entry-key.js +1 -0
  177. package/dist/domain/spec/sections/data-spec/index.d.ts +5 -0
  178. package/dist/domain/spec/sections/data-spec/index.js +1 -0
  179. package/dist/domain/spec/sections/data-spec/parsed-data-spec-entries.d.ts +10 -0
  180. package/dist/domain/spec/sections/data-spec/parsed-data-spec-entries.js +1 -0
  181. package/dist/domain/spec/sections/data-spec/swatch-data-spec-entry.d.ts +14 -0
  182. package/dist/domain/spec/sections/data-spec/swatch-data-spec-entry.js +1 -0
  183. package/dist/domain/spec/sections/index.d.ts +9 -0
  184. package/dist/domain/spec/sections/index.js +1 -0
  185. package/dist/domain/spec/sections/infra/acl.d.ts +12 -0
  186. package/dist/domain/spec/sections/infra/acl.js +1 -0
  187. package/dist/domain/spec/sections/infra/index.d.ts +3 -0
  188. package/dist/domain/spec/sections/infra/index.js +1 -0
  189. package/dist/domain/spec/sections/infra/resource-entry.d.ts +46 -0
  190. package/dist/domain/spec/sections/infra/resource-entry.js +1 -0
  191. package/dist/domain/spec/sections/infra/resources-config.d.ts +10 -0
  192. package/dist/domain/spec/sections/infra/resources-config.js +1 -0
  193. package/dist/domain/spec/sections/state-value.d.ts +7 -0
  194. package/dist/domain/spec/sections/state-value.js +1 -0
  195. package/dist/domain/spec/sections/theme.d.ts +10 -0
  196. package/dist/domain/spec/sections/theme.js +1 -0
  197. package/dist/domain/spec/sections/transformers.d.ts +15 -0
  198. package/dist/domain/spec/sections/transformers.js +1 -0
  199. package/dist/domain/spec/sections/ui.d.ts +12 -0
  200. package/dist/domain/spec/sections/ui.js +1 -0
  201. package/dist/domain/system-definitions.js +1 -1
  202. package/dist/domain/utils/index.d.ts +2 -0
  203. package/dist/domain/utils/index.js +1 -0
  204. package/dist/editor/graphql/GraphQLPanel.js +1 -1
  205. package/dist/phoenix/services/application-spec-project-watcher.js +1 -1
  206. package/dist/react-sdk/domain-application-context/ConfigurationPersistSystemFailureHandler.js +1 -1
  207. package/dist/react-sdk/index.d.ts +2 -0
  208. package/dist/react-sdk/index.js +1 -1
  209. package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.d.ts +8 -0
  210. package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.js +1 -0
  211. package/dist/react-sdk/lifecycle-providers/index.d.ts +1 -0
  212. package/dist/react-sdk/lifecycle-providers/index.js +1 -1
  213. package/dist/react-sdk/notifications/index.d.ts +1 -0
  214. package/dist/react-sdk/notifications/index.js +1 -0
  215. package/dist/react-sdk/notifications/snackbar-action-button.d.ts +30 -0
  216. package/dist/react-sdk/notifications/snackbar-action-button.js +1 -0
  217. package/dist/react-sdk/preset-selection/PresetSelectionProvider.js +1 -0
  218. package/dist/react-sdk/preset-selection/index.d.ts +1 -0
  219. package/dist/react-sdk/preset-selection/index.js +1 -0
  220. package/dist/ui-sdk/components/snackbar/Snackbar.d.ts +24 -3
  221. package/dist/ui-sdk/components/snackbar/Snackbar.js +1 -1
  222. package/dist/watch/glob-matcher.d.ts +4 -4
  223. package/dist/watch/glob-matcher.js +1 -1
  224. package/dist/watch/watch.d.ts +4 -4
  225. package/dist/watch/watch.js +1 -1
  226. package/package.json +3 -3
  227. package/dist/configurator/configurator-context/ConfiguratorDataProvider.d.ts +0 -2
  228. package/dist/configurator/configurator-context/ConfiguratorDataProvider.js +0 -1
  229. package/dist/configurator/configurator-context/PresetSelectionProvider.js +0 -1
  230. package/dist/domain/available-system-components.d.ts +0 -11
  231. package/dist/domain/available-system-components.js +0 -1
  232. package/dist/domain/domain-builder.js +0 -1
  233. /package/dist/{application-spec/parse-application-files/spec/components/component-entry.js → domain/spec/application/admin-pages-section.js} +0 -0
  234. /package/dist/{application-spec/parse-application-files/spec/expressions/expression.js → domain/spec/application/admin-pages.js} +0 -0
  235. /package/dist/domain/spec/{enhanced-json-value.js → enhanced-json/enhanced-json-value.js} +0 -0
  236. /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.d.ts +0 -0
  237. /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.js +0 -0
  238. /package/dist/{configurator/configurator-context → react-sdk/preset-selection}/PresetSelectionProvider.d.ts +0 -0
@@ -1,82 +1,145 @@
1
- import type { AdminSpec, ApplicationSpec, AssistantSpec, ConfiguratorSpec, DataSchemaEntry, DataSchemas, DataSpec, EntitySchema, Infra, ModelVersion, ResolvedModelVersion, ResolvedVersions, Shape } from '../../parse-application-files/index.js';
1
+ import type { Acl, Actions, AdminPages, AdminStates, AppMetadata, AssistantResolvedManifest, Chunks, CommonTypes, Components, ConfiguratorStates, Defaults, EntityOrAliasName, EntityTypeName, EntityTypes, Expressions, Invariants, JsonSchema, ModelVersionKey, ParsedDataSpecEntries, Presets, ResourceEntry, SpecAliases, SpecResourcesConfig, SpecTransformers, Theme, Ui } from '#package/domain';
2
2
  /**
3
3
  * The part of a parsed entity schema the runtime reads: the entity type and the schema of its
4
4
  * shape, from which it builds the entity's reflection. The full schema with `id` and `type` is
5
5
  * only registered with a deployment, and the compiled shape validators only check presets and
6
6
  * defaults while parsing.
7
7
  */
8
- export type RuntimeEntitySchema = Pick<EntitySchema, 'entityType' | 'shapeSchema'>;
8
+ export interface RuntimeEntitySchema {
9
+ readonly entityType: EntityTypeName;
10
+ readonly shapeSchema: JsonSchema;
11
+ }
9
12
  /**
10
13
  * The part of a parsed model version the runtime reads: the entity types, the aliases, the common
11
14
  * types and the schema of every entity's shape. The shapes and the resolved shapes only serve the
12
15
  * parser and the type generator, except the runtime schemas of the latest version's shapes (see
13
16
  * `RuntimeLatestModelVersion`).
14
17
  */
15
- export type RuntimeModelVersion = Pick<ModelVersion, 'versionKey' | 'entityTypes' | 'rootEntityTypes' | 'aliases' | 'commonTypes'> & {
18
+ export interface RuntimeModelVersion {
19
+ readonly versionKey: ModelVersionKey;
20
+ readonly entityTypes: EntityTypes;
21
+ /** Entity types allowed as preset root — members of the RootEntity alias, or all entity types if no RootEntity alias. */
22
+ readonly rootEntityTypes: readonly EntityTypeName[];
23
+ readonly aliases: SpecAliases;
24
+ readonly commonTypes: CommonTypes;
16
25
  readonly entitySchemas: readonly RuntimeEntitySchema[];
17
- };
26
+ }
18
27
  /**
19
28
  * The latest model version of a domain as the runtime reads it: a model version plus the runtime
20
29
  * schema of every shape, which `phx.domain.model` reflects as `<Name>Shape`.
21
30
  */
22
- export type RuntimeLatestModelVersion = RuntimeModelVersion & {
23
- readonly shapes: ReadonlyMap<Shape['name'], RuntimeShapeSchema>;
24
- };
31
+ export interface RuntimeLatestModelVersion extends RuntimeModelVersion {
32
+ readonly shapes: ReadonlyMap<EntityOrAliasName, RuntimeShapeSchema>;
33
+ }
25
34
  /** The part of a parsed shape the runtime reads: its name and its runtime JSON schema. */
26
- export type RuntimeShapeSchema = Pick<Shape, 'name' | 'runtimeSchema'>;
27
- /** One model version of a domain as the runtime reads it, with the migration file that leads to it. */
28
- export type RuntimeResolvedModelVersion = Omit<ResolvedModelVersion, 'modelVersion'> & {
35
+ export interface RuntimeShapeSchema {
36
+ readonly name: EntityOrAliasName;
37
+ readonly runtimeSchema: JsonSchema;
38
+ }
39
+ /**
40
+ * One model version of a domain as the runtime reads it, with the migration file that leads to it.
41
+ * `version` is the integer version number (1, 2, 3, …), `key` is always `v{N}`, never `latest`,
42
+ * `isLatest` marks the version of the `latest` model key, and `migrationFile` is the path of the
43
+ * migration file, present from v2 on.
44
+ */
45
+ export interface RuntimeResolvedModelVersion {
46
+ readonly version: number;
47
+ readonly key: string;
48
+ readonly isLatest: boolean;
29
49
  readonly modelVersion: RuntimeModelVersion;
30
- };
31
- /** Every model version of a domain as the runtime reads it; it builds the domain's migrations from them. */
32
- export type RuntimeResolvedVersions = Pick<ResolvedVersions, 'latestVersion'> & {
50
+ readonly migrationFile: string | undefined;
51
+ }
52
+ /**
53
+ * Every model version of a domain as the runtime reads it; it builds the domain's migrations from
54
+ * them. `latestVersion` is the integer of the `latest` key, and `versionedModels` is sorted
55
+ * ascending by version number.
56
+ */
57
+ export interface RuntimeResolvedVersions {
58
+ readonly latestVersion: number;
33
59
  readonly versionedModels: readonly RuntimeResolvedModelVersion[];
34
- };
60
+ }
35
61
  /** The model of a domain as the runtime reads it: the latest version and every earlier one. */
36
62
  interface RuntimeDomainModel {
37
63
  readonly latestModel: RuntimeLatestModelVersion;
38
64
  readonly resolvedVersions: RuntimeResolvedVersions;
39
65
  }
40
66
  /** The part of a parsed data schema the runtime reads: the JSON schema it validates the data with. */
41
- export type RuntimeDataSchemaEntry = Pick<DataSchemaEntry, 'runtimeSchema'>;
67
+ export interface RuntimeDataSchemaEntry {
68
+ readonly runtimeSchema: JsonSchema;
69
+ }
42
70
  /**
43
71
  * The data schemas as the runtime reads them: the JSON schema of each kind of data and the hash of
44
72
  * the published data. The enhanced schemas, with Phoenix references, only serve the type generator.
45
73
  */
46
- export type RuntimeDataSchemas = Pick<DataSchemas, 'publishedDataHash'> & {
47
- readonly [KIND in Exclude<keyof DataSchemas, 'publishedDataHash' | 'backendData'>]: RuntimeDataSchemaEntry;
48
- } & {
74
+ export interface RuntimeDataSchemas {
75
+ readonly publishedData: RuntimeDataSchemaEntry;
76
+ readonly publishedDataHash: string;
77
+ readonly sessionData: RuntimeDataSchemaEntry;
78
+ readonly frontendData: RuntimeDataSchemaEntry;
49
79
  readonly backendData: RuntimeDataSchemaEntry | undefined;
50
- };
80
+ readonly finalizeData: RuntimeDataSchemaEntry;
81
+ readonly prefetchedFinalizeData: RuntimeDataSchemaEntry;
82
+ readonly finalizeResult: RuntimeDataSchemaEntry;
83
+ readonly callbackData: RuntimeDataSchemaEntry;
84
+ }
51
85
  /**
52
86
  * The assistant as the runtime reads it: its resolved manifest. The parsed assistant schema the
53
87
  * manifest is resolved from only serves the parser.
54
88
  */
55
- export type RuntimeAssistantSpec = Pick<NonNullable<AssistantSpec>, 'resolved'> | null;
89
+ export type RuntimeAssistantSpec = {
90
+ readonly resolved: AssistantResolvedManifest;
91
+ } | null;
56
92
  /**
57
93
  * The data spec as the runtime reads it: the data entries and their chunks. The data entries and
58
94
  * admin data pages the parser derives from them only serve the admin spec and the type generator.
59
95
  */
60
- export type RuntimeDataSpec = Pick<DataSpec, 'entries' | 'chunks'>;
96
+ export interface RuntimeDataSpec {
97
+ /** Validated entries grouped by their source `$data` subsection for generated SDK config. */
98
+ readonly entries: ParsedDataSpecEntries;
99
+ /** Validated published-data chunks, including the auto-injected `system` chunk when needed. */
100
+ readonly chunks: Chunks;
101
+ }
61
102
  /**
62
103
  * The configurator part of the runtime spec. It leaves out the configuration schema and its
63
104
  * version, which only a deployment registers, and the assistant's server settings (instructions
64
105
  * and AI settings), which must never reach the browser of a customer.
65
106
  */
66
- export type RuntimeConfiguratorSpec = Pick<ConfiguratorSpec, 'components' | 'presets' | 'expressions' | 'actions' | 'invariants' | 'defaults' | 'states' | 'theme' | 'ui' | 'transformers'> & RuntimeDomainModel & {
107
+ export interface RuntimeConfiguratorSpec extends RuntimeDomainModel {
108
+ readonly components: Components;
109
+ readonly presets: Presets;
110
+ readonly expressions: Expressions;
111
+ readonly actions: Actions;
112
+ readonly invariants: Invariants;
113
+ readonly defaults: Defaults;
114
+ readonly states: ConfiguratorStates;
115
+ readonly theme: Theme;
116
+ readonly ui: Ui;
117
+ readonly transformers: SpecTransformers;
67
118
  readonly dataSchemas: RuntimeDataSchemas;
68
119
  readonly assistant: RuntimeAssistantSpec;
69
- };
120
+ }
70
121
  /**
71
122
  * The admin part of the runtime spec. It leaves out the configuration schema and its version, which
72
123
  * only a deployment registers.
73
124
  */
74
- export type RuntimeAdminSpec = Pick<AdminSpec, 'components' | 'presets' | 'expressions' | 'invariants' | 'defaults' | 'states' | 'adminPages'> & RuntimeDomainModel;
125
+ export interface RuntimeAdminSpec extends RuntimeDomainModel {
126
+ readonly components: Components;
127
+ readonly presets: Presets;
128
+ readonly expressions: Expressions;
129
+ readonly invariants: Invariants;
130
+ readonly defaults: Defaults;
131
+ readonly states: AdminStates;
132
+ readonly adminPages: AdminPages;
133
+ }
75
134
  /**
76
135
  * The infrastructure settings the runtime reads: access control and resources. The environment
77
136
  * variable declarations only drive the generated environment readers.
78
137
  */
79
- export type RuntimeInfra = Pick<Infra, 'acl' | 'resources' | 'resourcesConfig'>;
138
+ export interface RuntimeInfra {
139
+ readonly acl: Acl;
140
+ readonly resources: readonly ResourceEntry[] | undefined;
141
+ readonly resourcesConfig: SpecResourcesConfig | undefined;
142
+ }
80
143
  /**
81
144
  * The parsed application spec as the runtime reads it: what `ApplicationRuntime` builds the
82
145
  * configurator and admin runtimes from, and the sections an application needs besides its domains
@@ -84,11 +147,12 @@ export type RuntimeInfra = Pick<Infra, 'acl' | 'resources' | 'resourcesConfig'>;
84
147
  * schemas, admin pages). `phoenix sync` and `phoenix build` write it to
85
148
  * `.phoenix/application-spec.json` with `encodeRuntimeSpec`.
86
149
  *
87
- * It is derived from the parsed types, so a section the runtime reads keeps the parser's type. It
88
- * leaves out what only the parser, the type generator or a deployment use, and holds plain data,
89
- * Maps and Sets only, so it can be encoded as JSON.
150
+ * Its sections are the spec data types of `domain`, the types the parser produces, so a parsed
151
+ * `ApplicationSpec` is assignable to it. It leaves out what only the parser, the type generator or
152
+ * a deployment use, and holds plain data, Maps and Sets only, so it can be encoded as JSON.
90
153
  */
91
- export interface RuntimeSpec extends Pick<ApplicationSpec, 'appMetadata'> {
154
+ export interface RuntimeSpec {
155
+ readonly appMetadata: AppMetadata;
92
156
  readonly dataSpec: RuntimeDataSpec;
93
157
  readonly configurator: RuntimeConfiguratorSpec;
94
158
  readonly admin: RuntimeAdminSpec;
@@ -97,7 +161,8 @@ export interface RuntimeSpec extends Pick<ApplicationSpec, 'appMetadata'> {
97
161
  /**
98
162
  * Takes from a parsed application spec the part the runtime reads. It reuses the sections it keeps
99
163
  * whole, and builds trimmed copies of the model versions, data schemas, assistant and data spec
100
- * without what the runtime does not read.
164
+ * without what the runtime does not read. It takes any `RuntimeSpec`, which a parsed
165
+ * `ApplicationSpec` is, and copies only what the type declares.
101
166
  */
102
- export declare const toRuntimeSpec: (spec: ApplicationSpec) => RuntimeSpec;
167
+ export declare const toRuntimeSpec: (spec: RuntimeSpec) => RuntimeSpec;
103
168
  export {};
@@ -1,4 +1,4 @@
1
- import type { MemoEvalPlan } from '../../parse-application-files/index.js';
1
+ import type { MemoEvalPlan } from '#package/domain';
2
2
  /**
3
3
  * The id under which the generated `.phoenix/spec-code.ts` holds one piece of code written in YAML,
4
4
  * and under which the runtime looks it up. Ids are unique within one domain; the configurator and
@@ -1,13 +1,22 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
+ import type { AssistantAiSettings } from '@salsita-ai/contracts/assistant';
2
3
  import type { ParseContext } from '../../core/index.js';
3
4
  import type { RawAssistant } from '../raw-spec/index.js';
4
5
  import type { ClassifiedSpecFile } from './classified-spec-file.js';
5
6
  /**
6
- * The singular `assistant` manifest after merge, or `null` when no spec file declares one. `origin`
7
- * names the declaring spec file so manifest diagnostics point at it.
7
+ * The assistant manifest merged from every spec file that declares an `assistant` block. Each file
8
+ * may leave `ai` out, but the merged manifest has it: the deployment cannot run its assistant
9
+ * without the provider, model tier and reasoning level.
10
+ */
11
+ export type MergedAssistantManifest = RawAssistant & {
12
+ readonly ai: AssistantAiSettings;
13
+ };
14
+ /**
15
+ * The `assistant` manifest merged from every spec file that declares an `assistant` block, or `null`
16
+ * when none does or when none of them declares `ai`. Manifest diagnostics raised after the merge
17
+ * carry the YAML path but no file, as in every other merged section.
8
18
  */
9
19
  export type MergedAssistant = Branded<'MergedAssistant', {
10
- readonly manifest: RawAssistant | null;
11
- readonly origin: string | null;
20
+ readonly manifest: MergedAssistantManifest | null;
12
21
  }>;
13
22
  export declare const MergedAssistant: (files: readonly ClassifiedSpecFile[], ctx: ParseContext) => MergedAssistant;
@@ -1 +1 @@
1
- import{Branded as t}from"@salsita-ai/common/utils";import{DiagnosticCode as n,diagnosticMessages as o}from"../../errors/index.js";export const MergedAssistant=(r,i)=>{let s,e=null;for(let t of r)if(void 0!==t.content.assistant){if(s){i.error(n.CONFLICTING_ASSISTANT,o.CONFLICTING_ASSISTANT(s,t.name));continue}s=t.name,e=t.content.assistant}return t({manifest:e,origin:s??null})};
1
+ import{Branded as e}from"@salsita-ai/common/utils";import{DiagnosticCode as t,diagnosticMessages as s}from"../../errors/index.js";let i=(e,i,n,r)=>{let l=i.flatMap(e=>{let t=n(e.manifest);return t?[{file:e.file,entries:t}]:[]});if(0===l.length)return;let a={},o=new Map;for(let{file:i,entries:n}of l)for(let[l,f]of Object.entries(n)){let n=o.get(l);if(n){r.at("assistant",e,l).error(t.ASSISTANT_MERGE_CONFLICT,s.ASSISTANT_MERGE_CONFLICT(e,l,n,i));continue}o.set(l,i),a[l]=f}return a},n=(e,i,n,r)=>{let l,a;for(let o of i){let i=n(o.manifest);if(void 0!==i){if(l){r.at("assistant",e).error(t.DUPLICATE_ASSISTANT_FIELD,s.DUPLICATE_ASSISTANT_FIELD(e,l,o.file));continue}l=o.file,a=i}}return a};export const MergedAssistant=(r,l)=>{let a=r.flatMap(e=>e.content.assistant?[{file:e.name,manifest:e.content.assistant}]:[]);if(0===a.length)return e({manifest:null});let o={entities:i("entities",a,e=>e.entities,l),deletable:i("deletable",a,e=>e.deletable,l),writable:i("writable",a,e=>e.writable,l),childRecipes:i("childRecipes",a,e=>e.childRecipes,l),replaceRecipes:i("replaceRecipes",a,e=>e.replaceRecipes,l),actions:i("actions",a,e=>e.actions,l),screenshots:i("screenshots",a,e=>e.screenshots,l),formElements:i("formElements",a,e=>e.formElements,l),lenses:n("lenses",a,e=>e.lenses,l),instructions:n("instructions",a,e=>e.instructions,l),ai:n("ai",a,e=>e.ai,l)},{ai:f}=o;return f?e({manifest:{...o,ai:f}}):(l.at("assistant","ai").error(t.ASSISTANT_MISSING_AI,s.ASSISTANT_MISSING_AI()),e({manifest:null}))};
@@ -1,8 +1,7 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
+ import type { Acl, ResourceEntry, SpecResourcesConfig } from '#package/domain';
2
3
  import type { ParseContext } from '../../core/index.js';
3
- import type { AclRole } from '../raw-spec/raw-acl.js';
4
4
  import type { RawEnvVarEntry } from '../raw-spec/raw-env.js';
5
- import type { RawResourceEntry } from '../raw-spec/raw-resources.js';
6
5
  import type { ClassifiedSpecFile } from './classified-spec-file.js';
7
6
  /** Merged infrastructure settings (env, ACL, resources). */
8
7
  export type MergedInfra = Branded<'MergedInfra', {
@@ -10,14 +9,8 @@ export type MergedInfra = Branded<'MergedInfra', {
10
9
  readonly frontend?: Readonly<Record<string, RawEnvVarEntry>>;
11
10
  readonly webhook?: Readonly<Record<string, RawEnvVarEntry>>;
12
11
  };
13
- readonly acl: {
14
- readonly canCreate: readonly AclRole[];
15
- };
16
- readonly resources?: readonly RawResourceEntry[];
17
- readonly resourcesConfig?: {
18
- readonly baseResourcesUrl?: string;
19
- readonly prefetchTextureUrls?: readonly string[];
20
- readonly deploymentQueryDisabled?: boolean;
21
- };
12
+ readonly acl: Acl;
13
+ readonly resources?: readonly ResourceEntry[];
14
+ readonly resourcesConfig?: SpecResourcesConfig;
22
15
  }>;
23
16
  export declare const MergedInfra: (files: readonly ClassifiedSpecFile[], ctx: ParseContext) => MergedInfra;
@@ -1,10 +1,8 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
+ import type { TransformerEntry } from '#package/domain';
2
3
  import type { ParseContext } from '../../core/index.js';
3
4
  import type { ClassifiedSpecFile } from './classified-spec-file.js';
4
- export interface TransformerEntry {
5
- readonly name: string;
6
- readonly priority?: number;
7
- }
5
+ export type { TransformerEntry } from '#package/domain';
8
6
  /** Merged transformers. The "transformers" section is singular — only one file may declare it. */
9
7
  export type MergedTransformers = Branded<'MergedTransformers', readonly TransformerEntry[]>;
10
8
  export declare const MergedTransformers: (files: readonly ClassifiedSpecFile[], ctx: ParseContext) => MergedTransformers;
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- export declare const aclRoles: readonly ['anonymous', 'user', 'admin', 'superadmin'];
3
- export type AclRole = (typeof aclRoles)[number];
2
+ import { type AclRole } from '#package/domain';
3
+ export { type AclRole, aclRoles } from '#package/domain';
4
4
  export type RawAcl = {
5
5
  readonly canCreate?: readonly AclRole[];
6
6
  };
@@ -1 +1 @@
1
- import{z as o}from"zod";export const aclRoles=["anonymous","user","admin","superadmin"];export const rawAclSchema=o.object({canCreate:o.array(o.enum(aclRoles)).optional()});
1
+ import{z as o}from"zod";import{aclRoles as a}from"#package/domain";export{aclRoles}from"#package/domain";export const rawAclSchema=o.object({canCreate:o.array(o.enum(a)).optional()});
@@ -1,26 +1,5 @@
1
1
  import { z } from 'zod';
2
- export interface RawAdminPages {
3
- readonly presets?: boolean | {
4
- readonly categoryNavigationState?: string;
5
- readonly presetNavigationState?: string;
6
- };
7
- readonly recipes?: ReadonlyArray<{
8
- readonly name: string;
9
- readonly navigationState?: string;
10
- }>;
11
- readonly pages?: ReadonlyArray<{
12
- readonly key: string;
13
- readonly title: string;
14
- readonly icon?: string;
15
- readonly navigationState?: string;
16
- readonly entity?: string;
17
- readonly component?: string;
18
- readonly actionsComponent?: string;
19
- readonly connectedDataEntry?: string;
20
- readonly sidebar?: {
21
- readonly title: string;
22
- readonly component: string;
23
- };
24
- }>;
25
- }
2
+ import type { AdminPagesSection } from '#package/domain';
3
+ /** The `$adminPages` section of an admin spec file as written; see {@link AdminPagesSection} in `domain`. */
4
+ export type RawAdminPages = AdminPagesSection;
26
5
  export declare const rawAdminPagesSchema: z.ZodType<RawAdminPages, z.ZodTypeDef, unknown>;
@@ -57,12 +57,15 @@ export type AssistantHint = (typeof ASSISTANT_HINTS)[number];
57
57
  * system component `componentType` on the entity type. It generates the `<field>Options` edge under
58
58
  * `meta`, named by `as` when given, and makes `modify<Type>` reject a value outside the choices
59
59
  * unless `validate` is `false`. `allowDryRuns: false` turns the dry-run of the choices off, for
60
- * fields with too many of them to try out. The component is named explicitly and never inferred from
61
- * a `$bind`.
60
+ * fields with too many of them to try out. `componentType` and `instanceName` are given together or
61
+ * not at all: without them the component is the one `materialSwatch`, `attributeSelection` or
62
+ * `distanceDimensionSelect` instance on the entity type, or on an alias containing it, that writes
63
+ * the field through `$bind` or `$write`. Naming it chooses between several such instances, or gives
64
+ * the agent another list than the user's control shows.
62
65
  */
63
66
  export interface RawAssistantFieldOptions {
64
- readonly componentType: AssistantOptionComponentType;
65
- readonly instanceName: string;
67
+ readonly componentType?: AssistantOptionComponentType;
68
+ readonly instanceName?: string;
66
69
  readonly as?: string;
67
70
  readonly validate?: boolean;
68
71
  readonly allowDryRuns?: boolean;
@@ -70,30 +73,26 @@ export interface RawAssistantFieldOptions {
70
73
  }
71
74
  /**
72
75
  * One writable field of the assistant `writable` map. An empty entry (`width:` in YAML) declares the
73
- * stored field writable; `options` links it to the component that holds its choices.
76
+ * stored field writable, linked to the component that holds its choices when one instance writes it;
77
+ * `options` sets up that link, and `options: null` declares the field without one.
74
78
  */
75
79
  export interface RawAssistantWritableField {
76
- readonly options?: RawAssistantFieldOptions;
80
+ readonly options?: RawAssistantFieldOptions | null;
77
81
  }
78
82
  /**
79
83
  * One recipe group of the assistant `childRecipes` or `replaceRecipes` map, keyed by the instance
80
- * name of a `childEntityRecipes` or a `replaceEntityRecipes` component. `as` is the id the agent addresses the group by, the instance name
81
- * by default; `description` replaces the component's group description; `allowDryRuns: false` turns
82
- * the dry-run of the group's recipes off, for groups too large to try out. An empty entry
83
- * (`cabinets:` in YAML) exposes the group with its defaults.
84
+ * name of a `childEntityRecipes` or a `replaceEntityRecipes` component. It becomes a field of the
85
+ * entity type's `<Type>ChildRecipes` or `<Type>ReplaceRecipes` type, named by `as`, the instance
86
+ * name by default, which is also the id the agent passes to `addChild` or `replaceEntity`.
87
+ * `description` describes that field; `allowDryRuns: false` turns the dry-run of the group's recipes
88
+ * off, for groups too large to try out; `hints` say when the agent can reuse what it read. An empty
89
+ * entry (`cabinets:` in YAML) exposes the group with its defaults.
84
90
  */
85
91
  export interface RawAssistantRecipeGroup {
86
92
  readonly as?: string;
87
93
  readonly description?: string;
88
94
  readonly allowDryRuns?: boolean;
89
- }
90
- /**
91
- * The recipes of one entity type or alias in the assistant `childRecipes` or `replaceRecipes` map:
92
- * its recipe groups under `groups`, and the `hints` that hold for the whole edge of the type.
93
- */
94
- export interface RawAssistantRecipes {
95
95
  readonly hints?: readonly AssistantHint[];
96
- readonly groups: Readonly<Record<string, RawAssistantRecipeGroup | null>>;
97
96
  }
98
97
  /**
99
98
  * One entry of the assistant `actions` map, keyed by the name of an action declared under the
@@ -131,6 +130,10 @@ export interface RawAssistantScreenshot {
131
130
  * entries are tagged with, and `formElements` the project's own elements of the forms the agent
132
131
  * asks the user with.
133
132
  *
133
+ * The manifest can be split across spec files: each section keyed by entity type, action or form
134
+ * element name merges per key, while `ai`, `instructions` and `lenses` are declared in one file
135
+ * each, and `ai` in exactly one.
136
+ *
134
137
  * `ai` and `instructions` are for the server only: the provider, model tier and reasoning level the
135
138
  * deployment's assistant runs with, and the integrator's own guidance for it, appended to the system
136
139
  * prompt. Both are sent when a deployment is prepared and never reach the application bundle.
@@ -139,13 +142,15 @@ export interface RawAssistant {
139
142
  readonly entities?: Readonly<Record<string, Readonly<Record<string, RawAssistantField | null>>>>;
140
143
  readonly deletable?: Readonly<Record<string, RawAssistantDeletable | null>>;
141
144
  readonly writable?: Readonly<Record<string, Readonly<Record<string, RawAssistantWritableField | null>>>>;
142
- readonly childRecipes?: Readonly<Record<string, RawAssistantRecipes>>;
143
- readonly replaceRecipes?: Readonly<Record<string, RawAssistantRecipes>>;
145
+ readonly childRecipes?: Readonly<Record<string, Readonly<Record<string, RawAssistantRecipeGroup | null>>>>;
146
+ readonly replaceRecipes?: Readonly<Record<string, Readonly<Record<string, RawAssistantRecipeGroup | null>>>>;
144
147
  readonly actions?: Readonly<Record<string, RawAssistantAction | null>>;
145
148
  readonly screenshots?: Readonly<Record<string, Readonly<Record<string, RawAssistantScreenshot>>>>;
146
149
  readonly lenses?: Readonly<Record<string, RawAssistantLens>>;
147
150
  readonly formElements?: Readonly<Record<string, RawAssistantFormElement>>;
148
151
  readonly instructions?: string;
149
- readonly ai: AssistantAiSettings;
152
+ readonly ai?: AssistantAiSettings;
150
153
  }
154
+ /** A GraphQL name the schema may use for a field or type: letters, digits and `_`, not starting with a digit or `__`. */
155
+ export declare const GRAPHQL_NAME_PATTERN: RegExp;
151
156
  export declare const rawAssistantSchema: z.ZodType<RawAssistant>;
@@ -1 +1 @@
1
- import{z as e}from"zod";import{ASSISTANT_AI_PROVIDERS as t,ASSISTANT_MODEL_TIERS as n,ASSISTANT_REASONING_LEVELS as o}from"@salsita-ai/contracts/assistant";import{ASSISTANT_FORM_NAME_PATTERN as i,ASSISTANT_HINTS as r}from"#package/domain";export const ASSISTANT_OPTION_COMPONENT_TYPES=["materialSwatch","attributeSelection","distanceDimensionSelect"];let s=e.string().regex(/^(?!__)[_A-Za-z][_0-9A-Za-z]*$/,'must be a GraphQL name: letters, digits and "_", not starting with a digit or "__"'),a=t=>e.enum(t,{errorMap:()=>({message:`must be one of: ${t.join(", ")}`})}),m=e.object({description:e.string().optional(),as:s.optional(),lenses:e.array(e.string()).optional()}).strict(),l="must be a whole number of at least 1; remove the key to nest tagged relations one level",p=e.object({description:e.string().trim().min(1,"must not be empty; say when the agent should use the lens"),maxDepth:e.number({invalid_type_error:l}).int(l).min(1,l).optional()}).strict(),c=s.refine(e=>!e.includes("__"),'must not contain "__", which names the generated copies of a lens'),u=e.array(a(r)),d=e.object({options:e.object({componentType:a(ASSISTANT_OPTION_COMPONENT_TYPES),instanceName:e.string().min(1,"must not be empty; name the component instance that holds the choices"),as:s.optional(),validate:e.boolean().optional(),allowDryRuns:e.boolean().optional(),hints:u.optional()}).strict().optional()}).strict(),g=e.object({as:e.string().trim().min(1,"must not be empty; remove the key to use the instance name").optional(),description:e.string().optional(),allowDryRuns:e.boolean().optional()}).strict(),h=t=>e.object({hints:u.optional(),groups:e.record(e.string(),g.nullable(),{required_error:`is required: the recipe groups of the type go under "groups", keyed by the instance name of a "${t}" component`})}).strict(),b=e.object({description:e.string().optional(),as:s.optional()}).strict(),y=["enum","pattern","minimum","maximum","minLength","maxLength"],f=["enum","pattern","minLength","maxLength"],_=["enum","minimum","maximum"],v=e.object({type:a(["string","number","integer","boolean"]),enum:e.array(e.union([e.string(),e.number()])).min(1,"must list at least one value").optional(),pattern:e.string().refine(e=>{try{return RegExp(e,"u"),!0}catch{return!1}},"must be a regular expression, as in JSON Schema").optional(),minimum:e.number().optional(),maximum:e.number().optional(),minLength:e.number().int().nonnegative().optional(),maxLength:e.number().int().nonnegative().optional()}).strict().superRefine((t,n)=>{let o="string"===t.type?f:"boolean"===t.type?[]:_;for(let i of y)void 0===t[i]||o.includes(i)||n.addIssue({code:e.ZodIssueCode.custom,path:[i],message:`does not apply to an attribute of type "${t.type}"; remove it or change the type`});let i="string"===t.type?"string":"number";for(let[o,r]of("boolean"!==t.type&&t.enum?.some(e=>typeof e!==i||"integer"===t.type&&!Number.isInteger(e))&&n.addIssue({code:e.ZodIssueCode.custom,path:["enum"],message:`must list only ${"integer"===t.type?"whole number":i}s, since the attribute is of type "${t.type}"`}),[["minimum","maximum"],["minLength","maxLength"]])){let[i,s]=[t[o],t[r]];void 0!==i&&void 0!==s&&i>s&&n.addIssue({code:e.ZodIssueCode.custom,path:[o],message:`must not be greater than "${r}", or no value could satisfy the attribute`})}}),w=e.string().regex(i,'must start with a lowercase letter and hold only lowercase letters, digits and "-", since the panel reads form markup in lowercase'),j=e.object({description:e.string().trim().min(1,"must not be empty; say what the element is for and where the agent may use it"),role:a(["group","choice","choices","option","input"]),attributes:e.record(w,v).optional(),required:e.array(e.string()).optional()}).strict(),x=e.object({description:e.string().trim().min(1,"must not be empty; say what the view shows"),as:s.optional()}).strict(),S=`is required: declare provider (${t.join(", ")}), model (${n.join(", ")}) and reasoning (${o.join(", ")})`,T="must be a positive whole number of input tokens; remove the key to use the default of the server",I=e.object({provider:a(t),model:a(n),reasoning:a(o),maxThreadSize:e.number({invalid_type_error:T}).int(T).positive(T).optional()},{required_error:S,invalid_type_error:S}).strict();export const rawAssistantSchema=e.object({entities:e.record(e.string(),e.record(e.string(),m.nullable())).optional(),deletable:e.record(e.string(),e.object({}).strict().nullable()).optional(),writable:e.record(e.string(),e.record(e.string(),d.nullable())).optional(),childRecipes:e.record(e.string(),h("childEntityRecipes")).optional(),replaceRecipes:e.record(e.string(),h("replaceEntityRecipes")).optional(),actions:e.record(e.string(),b.nullable()).optional(),screenshots:e.record(e.string(),e.record(e.string(),x)).optional(),lenses:e.record(c,p).optional(),formElements:e.record(w,j).optional(),instructions:e.string().trim().min(1,"must not be empty; remove the key when there are no instructions").optional(),ai:I}).strict();
1
+ import{z as e}from"zod";import{ASSISTANT_AI_PROVIDERS as t,ASSISTANT_MODEL_TIERS as o,ASSISTANT_REASONING_LEVELS as n}from"@salsita-ai/contracts/assistant";import{ASSISTANT_FORM_NAME_PATTERN as i,ASSISTANT_HINTS as r}from"#package/domain";export const ASSISTANT_OPTION_COMPONENT_TYPES=["materialSwatch","attributeSelection","distanceDimensionSelect"];export const GRAPHQL_NAME_PATTERN=/^(?!__)[_A-Za-z][_0-9A-Za-z]*$/;let a=e.string().regex(GRAPHQL_NAME_PATTERN,'must be a GraphQL name: letters, digits and "_", not starting with a digit or "__"'),s=t=>e.enum(t,{errorMap:()=>({message:`must be one of: ${t.join(", ")}`})}),l=e.object({description:e.string().optional(),as:a.optional(),lenses:e.array(e.string()).optional()}).strict(),m="must be a whole number of at least 1; remove the key to nest tagged relations one level",p=e.object({description:e.string().trim().min(1,"must not be empty; say when the agent should use the lens"),maxDepth:e.number({invalid_type_error:m}).int(m).min(1,m).optional()}).strict(),c=a.refine(e=>!e.includes("__"),'must not contain "__", which names the generated copies of a lens'),u=e.array(s(r)),d=e.object({options:e.object({componentType:s(ASSISTANT_OPTION_COMPONENT_TYPES).optional(),instanceName:e.string().min(1,"must not be empty; name the component instance that holds the choices").optional(),as:a.optional(),validate:e.boolean().optional(),allowDryRuns:e.boolean().optional(),hints:u.optional()}).strict().refine(({componentType:e,instanceName:t})=>void 0===e==(void 0===t),'must give "componentType" and "instanceName" together, or neither to use the one option component instance that writes the field').nullable().optional()}).strict(),g=e.object({as:a.optional(),description:e.string().optional(),allowDryRuns:e.boolean().optional(),hints:u.optional()},{errorMap:(t,o)=>({message:t.code===e.ZodIssueCode.unrecognized_keys?`${o.defaultError}. A recipe group takes "as", "description", "allowDryRuns" and "hints"; the groups of a type go directly under it, keyed by instance name, with no "groups" level`:o.defaultError})}).strict(),h=e.object({description:e.string().optional(),as:a.optional()}).strict(),b=["enum","pattern","minimum","maximum","minLength","maxLength"],y=["enum","pattern","minLength","maxLength"],f=["enum","minimum","maximum"],_=e.object({type:s(["string","number","integer","boolean"]),enum:e.array(e.union([e.string(),e.number()])).min(1,"must list at least one value").optional(),pattern:e.string().refine(e=>{try{return RegExp(e,"u"),!0}catch{return!1}},"must be a regular expression, as in JSON Schema").optional(),minimum:e.number().optional(),maximum:e.number().optional(),minLength:e.number().int().nonnegative().optional(),maxLength:e.number().int().nonnegative().optional()}).strict().superRefine((t,o)=>{let n="string"===t.type?y:"boolean"===t.type?[]:f;for(let i of b)void 0===t[i]||n.includes(i)||o.addIssue({code:e.ZodIssueCode.custom,path:[i],message:`does not apply to an attribute of type "${t.type}"; remove it or change the type`});let i="string"===t.type?"string":"number";for(let[n,r]of("boolean"!==t.type&&t.enum?.some(e=>typeof e!==i||"integer"===t.type&&!Number.isInteger(e))&&o.addIssue({code:e.ZodIssueCode.custom,path:["enum"],message:`must list only ${"integer"===t.type?"whole number":i}s, since the attribute is of type "${t.type}"`}),[["minimum","maximum"],["minLength","maxLength"]])){let[i,a]=[t[n],t[r]];void 0!==i&&void 0!==a&&i>a&&o.addIssue({code:e.ZodIssueCode.custom,path:[n],message:`must not be greater than "${r}", or no value could satisfy the attribute`})}}),v=e.string().regex(i,'must start with a lowercase letter and hold only lowercase letters, digits and "-", since the panel reads form markup in lowercase'),w=e.object({description:e.string().trim().min(1,"must not be empty; say what the element is for and where the agent may use it"),role:s(["group","choice","choices","option","input"]),attributes:e.record(v,_).optional(),required:e.array(e.string()).optional()}).strict(),j=e.object({description:e.string().trim().min(1,"must not be empty; say what the view shows"),as:a.optional()}).strict(),x=`must be an object: declare provider (${t.join(", ")}), model (${o.join(", ")}) and reasoning (${n.join(", ")})`,T="must be a positive whole number of input tokens; remove the key to use the default of the server",N=e.object({provider:s(t),model:s(o),reasoning:s(n),maxThreadSize:e.number({invalid_type_error:T}).int(T).positive(T).optional()},{invalid_type_error:x}).strict();export const rawAssistantSchema=e.object({entities:e.record(e.string(),e.record(e.string(),l.nullable())).optional(),deletable:e.record(e.string(),e.object({}).strict().nullable()).optional(),writable:e.record(e.string(),e.record(e.string(),d.nullable())).optional(),childRecipes:e.record(e.string(),e.record(e.string(),g.nullable())).optional(),replaceRecipes:e.record(e.string(),e.record(e.string(),g.nullable())).optional(),actions:e.record(e.string(),h.nullable()).optional(),screenshots:e.record(e.string(),e.record(e.string(),j)).optional(),lenses:e.record(c,p).optional(),formElements:e.record(v,w).optional(),instructions:e.string().trim().min(1,"must not be empty; remove the key when there are no instructions").optional(),ai:N.optional()}).strict();
@@ -1,67 +1,22 @@
1
1
  import { z } from 'zod';
2
- declare const rawConfigurationLinkSchema: z.ZodObject<{
3
- type: z.ZodLiteral<"ConfigurationLink">;
4
- name: z.ZodString;
5
- }, "strip", z.ZodTypeAny, {
6
- type: "ConfigurationLink";
7
- name: string;
8
- }, {
9
- type: "ConfigurationLink";
10
- name: string;
11
- }>;
12
- declare const rawCsvSchema: z.ZodObject<{
13
- type: z.ZodLiteral<"Csv">;
14
- name: z.ZodString;
15
- s3Key: z.ZodOptional<z.ZodString>;
16
- }, "strip", z.ZodTypeAny, {
17
- type: "Csv";
18
- name: string;
19
- s3Key?: string | undefined;
20
- }, {
21
- type: "Csv";
22
- name: string;
23
- s3Key?: string | undefined;
24
- }>;
25
- declare const rawPdfSchema: z.ZodObject<{
26
- type: z.ZodLiteral<"Pdf">;
27
- name: z.ZodString;
28
- s3Key: z.ZodOptional<z.ZodString>;
29
- }, "strip", z.ZodTypeAny, {
30
- type: "Pdf";
31
- name: string;
32
- s3Key?: string | undefined;
33
- }, {
34
- type: "Pdf";
35
- name: string;
36
- s3Key?: string | undefined;
37
- }>;
38
- export type RawConfigurationLinkResource = Readonly<z.infer<typeof rawConfigurationLinkSchema>>;
39
- export type RawCsvResource = Readonly<z.infer<typeof rawCsvSchema>>;
40
- export type RawPdfResource = Readonly<z.infer<typeof rawPdfSchema>>;
41
- export interface RawClientGeneratedImageResource {
42
- readonly type: 'Image';
43
- readonly name: string;
44
- readonly clientGenerated: true;
45
- readonly s3Key: string;
46
- }
47
- export interface RawExistingImageResource {
48
- readonly type: 'Image';
49
- readonly name: string;
50
- readonly exists: true;
51
- readonly url: string;
52
- }
53
- export interface RawGeneratedImageResource {
54
- readonly type: 'Image';
55
- readonly name: string;
56
- readonly s3Key: string;
57
- }
58
- export type RawImageResource = RawClientGeneratedImageResource | RawExistingImageResource | RawGeneratedImageResource;
59
- export type RawResourceEntry = RawConfigurationLinkResource | RawCsvResource | RawPdfResource | RawImageResource;
2
+ import type { ClientGeneratedImageResource, ConfigurationLinkResource, CsvResource, ExistingImageResource, GeneratedImageResource, ImageResource, PdfResource, ResourceEntry, SpecResourcesConfig } from '#package/domain';
3
+ /** A configuration link resource; see {@link ConfigurationLinkResource} in `domain`. */
4
+ export type RawConfigurationLinkResource = ConfigurationLinkResource;
5
+ /** A CSV document resource; see {@link CsvResource} in `domain`. */
6
+ export type RawCsvResource = CsvResource;
7
+ /** A PDF document resource; see {@link PdfResource} in `domain`. */
8
+ export type RawPdfResource = PdfResource;
9
+ /** An image resource the client renders; see {@link ClientGeneratedImageResource} in `domain`. */
10
+ export type RawClientGeneratedImageResource = ClientGeneratedImageResource;
11
+ /** An image resource that already exists at a URL; see {@link ExistingImageResource} in `domain`. */
12
+ export type RawExistingImageResource = ExistingImageResource;
13
+ /** An image resource the server renders; see {@link GeneratedImageResource} in `domain`. */
14
+ export type RawGeneratedImageResource = GeneratedImageResource;
15
+ /** One of the three kinds of image resource; see {@link ImageResource} in `domain`. */
16
+ export type RawImageResource = ImageResource;
17
+ /** One entry of the `resources` section; see {@link ResourceEntry} in `domain`. */
18
+ export type RawResourceEntry = ResourceEntry;
60
19
  export declare const rawResourcesSchema: z.ZodType<readonly RawResourceEntry[]>;
61
- export type RawResourcesConfig = {
62
- readonly baseResourcesUrl?: string;
63
- readonly prefetchTextureUrls?: readonly string[];
64
- readonly deploymentQueryDisabled?: boolean;
65
- };
20
+ /** The `resourcesConfig` section; see {@link SpecResourcesConfig} in `domain`. */
21
+ export type RawResourcesConfig = SpecResourcesConfig;
66
22
  export declare const rawResourcesConfigSchema: z.ZodType<RawResourcesConfig>;
67
- export {};
@@ -1,27 +1,10 @@
1
- import { Branded } from '@salsita-ai/common/utils';
1
+ import type { AdminPages as AdminPagesData } from '#package/domain';
2
2
  import type { ParseContext } from '../../../../core/index.js';
3
3
  import type { MergedAdminPages } from '../../../merge/index.js';
4
- import type { RawAdminPages } from '../../../raw-spec/index.js';
5
- import { type ComponentEntry } from '../../components/index.js';
6
4
  import type { ModelVersion } from '../../model/index.js';
7
5
  import type { DataSpec } from '../../sections/index.js';
8
- export type AdminPages = Branded<'AdminPages', {
9
- readonly spec: RawAdminPages;
10
- readonly components: readonly ComponentEntry[];
11
- readonly navigationItems: readonly AdminNavigationItem[];
12
- readonly navigationStates: readonly string[];
13
- }>;
14
- interface AdminNavigationListItem {
15
- readonly label: string;
16
- readonly icon?: string;
17
- readonly navigationStates: readonly string[];
18
- }
19
- interface AdminNestedNavigationListItem {
20
- readonly label: string;
21
- readonly icon?: string;
22
- readonly items: ReadonlyArray<Omit<AdminNavigationListItem, 'icon'>>;
23
- }
24
- type AdminNavigationItem = AdminNavigationListItem | AdminNestedNavigationListItem;
6
+ /** The parsed admin pages of an admin spec; see {@link AdminPagesData | AdminPages} in `domain`. */
7
+ export type AdminPages = AdminPagesData;
25
8
  interface AdminPageContext {
26
9
  readonly latestModel: ModelVersion;
27
10
  readonly parsingContext: ParseContext;
@@ -1,8 +1,6 @@
1
- import { Branded } from '@salsita-ai/common/utils';
1
+ import type { AdminStates as AdminStatesData } from '#package/domain';
2
2
  import type { ParseContext } from '../../../../core/index.js';
3
3
  import type { MergedAdminStates } from '../../../merge/index.js';
4
- import { type StateValue } from '../../sections/state-value.js';
5
- export type AdminStates = Branded<'AdminStates', {
6
- readonly navigationStates: readonly StateValue[];
7
- }>;
4
+ /** The validated navigation states of the admin; see {@link AdminStatesData | AdminStates} in `domain`. */
5
+ export type AdminStates = AdminStatesData;
8
6
  export declare const AdminStates: (merged: MergedAdminStates, ctx: ParseContext) => AdminStates;
@@ -1,11 +1,6 @@
1
- import { Branded } from '@salsita-ai/common/utils';
1
+ import type { ConfiguratorStates as ConfiguratorStatesData } from '#package/domain';
2
2
  import type { ParseContext } from '../../../../core/index.js';
3
3
  import type { MergedConfiguratorStates } from '../../../merge/index.js';
4
- import { StateValue } from '../../sections/state-value.js';
5
- export type ConfiguratorStates = Branded<'ConfiguratorStates', {
6
- readonly navigationStates: readonly StateValue[];
7
- readonly viewStates: readonly StateValue[];
8
- readonly toolStates: readonly StateValue[];
9
- readonly exportStates: readonly StateValue[];
10
- }>;
4
+ /** The validated UI states of the configurator; see {@link ConfiguratorStatesData | ConfiguratorStates} in `domain`. */
5
+ export type ConfiguratorStates = ConfiguratorStatesData;
11
6
  export declare const ConfiguratorStates: (merged: MergedConfiguratorStates, ctx: ParseContext) => ConfiguratorStates;