@salsita-ai/sdk 0.50.0-develop.f81ab6ac76 → 0.50.0-develop.f9cd9b3a12

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 (460) hide show
  1. package/dist/application-spec/errors/diagnostic-codes.d.ts +9 -0
  2. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  3. package/dist/application-spec/errors/diagnostic-messages.d.ts +10 -1
  4. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  5. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  6. package/dist/application-spec/generate-application/code/templates/application-types.js +6 -6
  7. package/dist/application-spec/generate-application/code/templates/common/doc-comment.d.ts +2 -0
  8. package/dist/application-spec/generate-application/code/templates/common/doc-comment.js +1 -0
  9. package/dist/application-spec/generate-application/code/templates/configurator-globals.d.ts +2 -1
  10. package/dist/application-spec/generate-application/code/templates/configurator-globals.js +19 -6
  11. package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.js +7 -7
  12. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.d.ts +12 -0
  13. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.js +7 -0
  14. package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +24 -22
  15. package/dist/application-spec/generate-application/code/templates/global-definition/index.d.ts +1 -0
  16. package/dist/application-spec/generate-application/code/templates/global-definition/index.js +1 -1
  17. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +13 -6
  18. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
  19. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +33 -3
  20. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  21. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.d.ts +9 -0
  22. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.js +1 -0
  23. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +4 -1
  24. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  25. package/dist/configurator/ConfiguratorApp.js +1 -1
  26. package/dist/configurator/app-loader-content/DefaultAppLoaderContent.d.ts +2 -0
  27. package/dist/configurator/app-loader-content/DefaultAppLoaderContent.js +5 -0
  28. package/dist/configurator/app-loader-content/app-loader-content-name.d.ts +5 -0
  29. package/dist/configurator/app-loader-content/app-loader-content-name.js +1 -0
  30. package/dist/configurator/app-loader-content/index.d.ts +2 -0
  31. package/dist/configurator/app-loader-content/index.js +1 -0
  32. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  33. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +4 -3
  34. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  35. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +33 -7
  36. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  37. package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.d.ts +1 -1
  38. package/dist/configurator/application-runtime/extensions/systems/canvas-system.d.ts +8 -0
  39. package/dist/configurator/application-runtime/extensions/systems/canvas-system.js +1 -1
  40. package/dist/configurator/application-runtime/extensions/systems/export-system/export-busy-error.d.ts +8 -0
  41. package/dist/configurator/application-runtime/extensions/systems/export-system/export-busy-error.js +1 -0
  42. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.d.ts +23 -1
  43. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.js +1 -1
  44. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +14 -1
  45. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  46. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +45 -4
  47. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  48. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.d.ts +14 -5
  49. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.js +1 -1
  50. package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -1
  51. package/dist/configurator/common/configurator-interface.d.ts +112 -4
  52. package/dist/configurator/common/configurator-interface.js +1 -1
  53. package/dist/configurator/configuration-not-found-page/create-configuration-not-found-page.d.ts +9 -0
  54. package/dist/configurator/configuration-not-found-page/create-configuration-not-found-page.js +1 -0
  55. package/dist/configurator/configuration-not-found-page/index.d.ts +1 -0
  56. package/dist/configurator/configuration-not-found-page/index.js +1 -1
  57. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.d.ts +12 -0
  58. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.js +1 -0
  59. package/dist/configurator/configurator-context/PreviewContextProvider.js +1 -1
  60. package/dist/configurator/configurator-context/ViewportStateSync.d.ts +2 -2
  61. package/dist/configurator/configurator-context/ViewportStateSync.js +1 -1
  62. package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.d.ts +10 -0
  63. package/dist/configurator/configurator-context/configurator-routing/ConfiguratorRoutingProvider.js +1 -1
  64. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.d.ts +6 -0
  65. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.js +1 -0
  66. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.d.ts +12 -0
  67. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.js +1 -0
  68. package/dist/configurator/configurator-error-page/create-configurator-error-page.d.ts +9 -0
  69. package/dist/configurator/configurator-error-page/create-configurator-error-page.js +1 -0
  70. package/dist/configurator/configurator-error-page/index.d.ts +3 -0
  71. package/dist/configurator/configurator-error-page/index.js +1 -0
  72. package/dist/configurator/index.d.ts +3 -0
  73. package/dist/configurator/index.js +1 -1
  74. package/dist/configurator/pages/ConfiguratorErrorPage.d.ts +0 -1
  75. package/dist/configurator/pages/ConfiguratorErrorPage.js +1 -1
  76. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  77. package/dist/configurator/pages/PresetCreationErrorPage.d.ts +1 -1
  78. package/dist/configurator/pages/PresetCreationErrorPage.js +1 -1
  79. package/dist/configurator/pages/default-configurator-elements.d.ts +4 -2
  80. package/dist/configurator/pages/default-configurator-elements.js +1 -1
  81. package/dist/configurator/pages/default-elements/index.d.ts +1 -0
  82. package/dist/configurator/pages/default-elements/index.js +1 -1
  83. package/dist/configurator/pages/default-elements/scene-controls/BuiltInAddEntityFab.d.ts +3 -0
  84. package/dist/configurator/pages/default-elements/scene-controls/BuiltInAddEntityFab.js +1 -0
  85. package/dist/configurator/pages/default-elements/scene-controls/BuiltInDeleteEntityFab.d.ts +3 -0
  86. package/dist/configurator/pages/default-elements/scene-controls/BuiltInDeleteEntityFab.js +1 -0
  87. package/dist/configurator/pages/default-elements/scene-controls/BuiltInNavigationHotspot.d.ts +3 -0
  88. package/dist/configurator/pages/default-elements/scene-controls/BuiltInNavigationHotspot.js +1 -0
  89. package/dist/configurator/pages/default-elements/scene-controls/BuiltInSelectionHotspot.d.ts +3 -0
  90. package/dist/configurator/pages/default-elements/scene-controls/BuiltInSelectionHotspot.js +1 -0
  91. package/dist/configurator/pages/default-elements/scene-controls/BuiltInToolMenuFab.d.ts +3 -0
  92. package/dist/configurator/pages/default-elements/scene-controls/BuiltInToolMenuFab.js +1 -0
  93. package/dist/configurator/pages/default-elements/scene-controls/index.d.ts +6 -0
  94. package/dist/configurator/pages/default-elements/scene-controls/index.js +1 -0
  95. package/dist/configurator/pages/default-elements/scene-controls/scene-control-elements.d.ts +6 -0
  96. package/dist/configurator/pages/default-elements/scene-controls/scene-control-elements.js +1 -0
  97. package/dist/configurator/pages/error-boundaries/GeneralErrorBoundary.js +1 -1
  98. package/dist/configurator/scene/index.d.ts +1 -0
  99. package/dist/configurator/scene/index.js +1 -1
  100. package/dist/configurator/scene/scene-controls/ToolFab.d.ts +4 -0
  101. package/dist/configurator/scene/scene-controls/ToolFab.js +1 -1
  102. package/dist/configurator/scene/scene-controls/use-scene-control-tooltip.d.ts +2 -1
  103. package/dist/configurator/scene/scene-entity/scene-controls/SceneEntityHtmlHotspots.js +1 -1
  104. package/dist/configurator/toolbar-actions/index.d.ts +3 -0
  105. package/dist/configurator/toolbar-actions/index.js +1 -0
  106. package/dist/configurator/toolbar-actions/use-assistant-panel.d.ts +18 -0
  107. package/dist/configurator/toolbar-actions/use-assistant-panel.js +1 -0
  108. package/dist/configurator/toolbar-actions/use-measurements.d.ts +35 -0
  109. package/dist/configurator/toolbar-actions/use-measurements.js +1 -0
  110. package/dist/configurator/toolbar-actions/use-toolbar-actions.d.ts +100 -0
  111. package/dist/configurator/toolbar-actions/use-toolbar-actions.js +1 -0
  112. package/dist/configurator/toolbar-actions/use-toolbar-help.d.ts +7 -0
  113. package/dist/configurator/toolbar-actions/use-toolbar-help.js +1 -0
  114. package/dist/configurator/ui/assistant/AssistantChips.d.ts +3 -2
  115. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  116. package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +1 -1
  117. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
  118. package/dist/configurator/ui/assistant/alert/AssistantAlert.d.ts +8 -0
  119. package/dist/configurator/ui/assistant/alert/AssistantAlert.js +1 -0
  120. package/dist/configurator/ui/assistant/alert/index.d.ts +2 -0
  121. package/dist/configurator/ui/assistant/alert/index.js +1 -0
  122. package/dist/configurator/ui/assistant/alert/remark-alerts.d.ts +10 -0
  123. package/dist/configurator/ui/assistant/alert/remark-alerts.js +1 -0
  124. package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -1
  125. package/dist/configurator/ui/assistant/form/compose-answer.d.ts +1 -1
  126. package/dist/configurator/ui/assistant/form/compose-answer.js +1 -1
  127. package/dist/configurator/ui/assistant/form/form-model.d.ts +3 -4
  128. package/dist/configurator/ui/assistant/form/form-state.d.ts +1 -1
  129. package/dist/configurator/ui/assistant/form/index.d.ts +2 -0
  130. package/dist/configurator/ui/assistant/form/index.js +1 -1
  131. package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +3 -2
  132. package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -1
  133. package/dist/configurator/ui/assistant/form/read-form-attributes.d.ts +1 -1
  134. package/dist/configurator/ui/assistant/form/read-form-attributes.js +1 -1
  135. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.d.ts +3 -0
  136. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.js +1 -0
  137. package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.d.ts +31 -0
  138. package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.js +1 -0
  139. package/dist/configurator/ui/assistant/form/{form-element-definition.d.ts → registry/form-element-definition.d.ts} +3 -1
  140. package/dist/configurator/ui/assistant/form/registry/form-element-definition.js +1 -0
  141. package/dist/configurator/ui/assistant/form/{form-registry.d.ts → registry/form-registry.d.ts} +2 -2
  142. package/dist/configurator/ui/assistant/form/registry/form-registry.js +1 -0
  143. package/dist/configurator/ui/assistant/form/registry/index.d.ts +6 -0
  144. package/dist/configurator/ui/assistant/form/registry/index.js +1 -0
  145. package/dist/configurator/ui/assistant/form/registry/use-form-registry.d.ts +8 -0
  146. package/dist/configurator/ui/assistant/form/registry/use-form-registry.js +1 -0
  147. package/dist/configurator/ui/assistant/form-elements/FormCard.d.ts +9 -0
  148. package/dist/configurator/ui/assistant/form-elements/FormCard.js +1 -0
  149. package/dist/configurator/ui/assistant/form-elements/FormConfirm.d.ts +9 -0
  150. package/dist/configurator/ui/assistant/form-elements/FormConfirm.js +1 -0
  151. package/dist/configurator/ui/assistant/form-elements/FormGroup.d.ts +4 -1
  152. package/dist/configurator/ui/assistant/form-elements/FormNumber.d.ts +9 -0
  153. package/dist/configurator/ui/assistant/form-elements/FormNumber.js +1 -0
  154. package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +4 -1
  155. package/dist/configurator/ui/assistant/form-elements/FormReply.d.ts +4 -1
  156. package/dist/configurator/ui/assistant/form-elements/FormReply.js +1 -1
  157. package/dist/configurator/ui/assistant/form-elements/FormSwatch.d.ts +10 -0
  158. package/dist/configurator/ui/assistant/form-elements/FormSwatch.js +1 -0
  159. package/dist/configurator/ui/assistant/form-elements/FormText.d.ts +4 -1
  160. package/dist/configurator/ui/assistant/form-elements/FormText.js +1 -1
  161. package/dist/configurator/ui/assistant/form-elements/clamp-form-number.d.ts +10 -0
  162. package/dist/configurator/ui/assistant/form-elements/clamp-form-number.js +1 -0
  163. package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +20 -16
  164. package/dist/configurator/ui/assistant/form-elements/index.d.ts +4 -0
  165. package/dist/configurator/ui/assistant/form-elements/index.js +1 -1
  166. package/dist/configurator/ui/assistant/index.d.ts +3 -0
  167. package/dist/configurator/ui/assistant/index.js +1 -1
  168. package/dist/configurator/ui/assistant/resource-image/index.d.ts +1 -1
  169. package/dist/configurator/ui/assistant/resource-image/index.js +1 -1
  170. package/dist/configurator/ui/assistant/resource-image/resource-path.d.ts +0 -9
  171. package/dist/configurator/ui/assistant/resource-image/resource-path.js +1 -1
  172. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.d.ts +9 -0
  173. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -0
  174. package/dist/configurator/ui/assistant/screenshots/index.d.ts +2 -0
  175. package/dist/configurator/ui/assistant/screenshots/index.js +1 -0
  176. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +14 -0
  177. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -0
  178. package/dist/configurator/ui/assistant/streamed-markdown.d.ts +2 -2
  179. package/dist/configurator/ui/assistant/streamed-markdown.js +2 -2
  180. package/dist/configurator/ui/assistant/tool-chip.js +1 -1
  181. package/dist/configurator/ui/configurator-layout/slots/canvas/LayoutCanvas.js +1 -1
  182. package/dist/configurator/ui/configurator-layout/slots/canvas/SharedCanvas.js +1 -1
  183. package/dist/configurator/ui/configurator-layout/universal/ExportingOverlay.d.ts +5 -0
  184. package/dist/configurator/ui/configurator-layout/universal/ExportingOverlay.js +1 -0
  185. package/dist/configurator/ui/configurator-layout/universal/Layout.js +1 -1
  186. package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.d.ts +1 -1
  187. package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.js +1 -1
  188. package/dist/configurator/ui/configurator-layout/universal/use-scene-safe-area.d.ts +1 -1
  189. package/dist/configurator/ui/index.d.ts +1 -0
  190. package/dist/configurator/ui/index.js +1 -1
  191. package/dist/configurator/ui/legacy/layout/common/ReactiveInterfaceLayout.js +1 -1
  192. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.js +2 -6
  193. package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -1
  194. package/dist/configurator/ui/phoenix-layout-elements/LanguageMenuAction.js +1 -1
  195. package/dist/configurator/ui/phoenix-layout-elements/LanguageToolbarButton.js +1 -1
  196. package/dist/configurator/ui/phoenix-layout-elements/MeasurementsMenuAction.js +1 -1
  197. package/dist/configurator/ui/phoenix-layout-elements/MeasurementsToolbarButton.js +1 -1
  198. package/dist/configurator/ui/phoenix-layout-elements/ShareToolbarButton.js +1 -1
  199. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/DesktopNavigationSteps.d.ts +1 -1
  200. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/DesktopNavigationSteps.js +1 -1
  201. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.d.ts +2 -8
  202. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.js +1 -1
  203. package/dist/configurator/ui/phoenix-layout-elements/measurements/DimensionUnitSelector.js +1 -1
  204. package/dist/configurator/ui/phoenix-layout-elements/measurements/MeasurementsIndicatorsSwitch.js +1 -1
  205. package/dist/configurator/ui/phoenix-layout-elements/share/ShareModal.js +1 -1
  206. package/dist/configurator/ui/phoenix-layout-elements/share/use-share.d.ts +7 -8
  207. package/dist/configurator/ui/phoenix-layout-elements/share/use-share.js +1 -1
  208. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/FinalizeActions.js +1 -1
  209. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/NextStepButton.js +1 -1
  210. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/PreviousStepButton.js +1 -1
  211. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -1
  212. package/dist/docs/complex-use-cases/focus-mode.mdx +2 -0
  213. package/dist/docs/fabs/basic.mdx +4 -0
  214. package/dist/docs/index.json +62 -1
  215. package/dist/docs/integrations/webcomponent-api/basics.mdx +2 -0
  216. package/dist/docs/layouts/custom-layout.mdx +321 -159
  217. package/dist/docs/layouts/gallery/ardent-compressor.mdx +3516 -0
  218. package/dist/docs/layouts/gallery/fenwick-window.mdx +2803 -0
  219. package/dist/docs/layouts/gallery/ferrule-bar-station.mdx +6567 -0
  220. package/dist/docs/layouts/gallery/kestrel-kettle.mdx +1858 -0
  221. package/dist/docs/layouts/gallery/sunfold-solar.mdx +2683 -0
  222. package/dist/docs/other-features/client-side-rendering/declarative.mdx +1 -1
  223. package/dist/docs/other-features/error-5xx.mdx +1 -1
  224. package/dist/docs/other-features/navigation-hotspot.mdx +2 -0
  225. package/dist/docs/other-features/not-found-404.mdx +1 -1
  226. package/dist/docs/phoenix/configurator-interface.mdx +200 -66
  227. package/dist/docs/phoenix/finalization.mdx +1 -1
  228. package/dist/docs/phoenix/layout-slots.mdx +5 -5
  229. package/dist/docs/phoenix/sdk-builder-workflow.mdx +1 -1
  230. package/dist/docs/phoenix/sessions-and-access.mdx +2 -0
  231. package/dist/docs/phoenix/testing.mdx +2 -2
  232. package/dist/docs/selection-and-highlight/hotspots.mdx +2 -0
  233. package/dist/domain/application/assistant/assistant-manifest.d.ts +16 -1
  234. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +8 -1
  235. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  236. package/dist/domain/application/assistant/form/assistant-form-element-name.d.ts +11 -0
  237. package/dist/domain/application/assistant/form/assistant-form-element-name.js +8 -0
  238. package/dist/domain/application/assistant/form/assistant-form-elements.d.ts +174 -0
  239. package/dist/domain/application/assistant/form/assistant-form-elements.js +1 -0
  240. package/dist/domain/application/assistant/form/assistant-resource-path.d.ts +10 -0
  241. package/dist/domain/application/assistant/form/assistant-resource-path.js +1 -0
  242. package/dist/domain/application/assistant/form/index.d.ts +4 -0
  243. package/dist/domain/application/assistant/form/index.js +1 -0
  244. package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +3 -0
  245. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  246. package/dist/domain/application/assistant/index.d.ts +2 -3
  247. package/dist/domain/application/assistant/index.js +1 -1
  248. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
  249. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +2 -0
  250. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
  251. package/dist/domain/application/web-component-property.d.ts +3 -1
  252. package/dist/domain/application/web-component-property.js +1 -1
  253. package/dist/domain/available-system-components.d.ts +1 -1
  254. package/dist/domain/available-system-components.js +1 -1
  255. package/dist/domain/domain-context/store-system/store-system.d.ts +5 -0
  256. package/dist/domain/domain-context/store-system/store-system.js +1 -1
  257. package/dist/domain/domain-runtime/domain-context/selectors.d.ts +1 -0
  258. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  259. package/dist/domain/domain-runtime/domain-runtime.d.ts +8 -0
  260. package/dist/domain/domain-runtime/environment/types.d.ts +1 -1
  261. package/dist/domain/domain-runtime/spec/index.d.ts +1 -1
  262. package/dist/domain/domain-runtime/spec/index.js +1 -1
  263. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  264. package/dist/domain/domain-runtime/spec/module-checks/element-registration.d.ts +15 -1
  265. package/dist/domain/domain-runtime/spec/module-checks/element-registration.js +1 -1
  266. package/dist/domain/domain-runtime/spec/module-checks/find-assistant-form-element-errors.d.ts +12 -0
  267. package/dist/domain/domain-runtime/spec/module-checks/find-assistant-form-element-errors.js +1 -0
  268. package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +2 -1
  269. package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
  270. package/dist/domain/domain-runtime/spec/selectors.d.ts +3 -1
  271. package/dist/domain/domain-runtime/spec/selectors.js +1 -1
  272. package/dist/domain/extensions/export-images/agent-screenshot.d.ts +24 -0
  273. package/dist/domain/extensions/export-images/agent-screenshot.js +1 -0
  274. package/dist/domain/extensions/{client-side-image.d.ts → export-images/client-side-image.d.ts} +2 -2
  275. package/dist/domain/extensions/export-images/client-side-image.js +1 -0
  276. package/dist/domain/extensions/export-images/index.d.ts +3 -0
  277. package/dist/domain/extensions/export-images/index.js +1 -0
  278. package/dist/domain/extensions/{save-template-thumbnail.d.ts → export-images/save-template-thumbnail.d.ts} +2 -2
  279. package/dist/domain/extensions/export-images/save-template-thumbnail.js +1 -0
  280. package/dist/domain/extensions/index.d.ts +1 -2
  281. package/dist/domain/extensions/index.js +1 -1
  282. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +4 -0
  283. package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
  284. package/dist/editor/domain-editors/apply-spec-update.d.ts +8 -1
  285. package/dist/editor/domain-editors/apply-spec-update.js +1 -1
  286. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  287. package/dist/editor/screenshot/ScreenshotHandler.js +1 -1
  288. package/dist/i18n/locales/cs/messages.js +1 -1
  289. package/dist/i18n/locales/da/messages.js +1 -1
  290. package/dist/i18n/locales/de/messages.js +1 -1
  291. package/dist/i18n/locales/de-AT/messages.js +1 -1
  292. package/dist/i18n/locales/en/messages.js +1 -1
  293. package/dist/i18n/locales/en-AU/messages.js +1 -1
  294. package/dist/i18n/locales/en-GB/messages.js +1 -1
  295. package/dist/i18n/locales/es/messages.js +1 -1
  296. package/dist/i18n/locales/fr/messages.js +1 -1
  297. package/dist/i18n/locales/hu/messages.js +1 -1
  298. package/dist/i18n/locales/it/messages.js +1 -1
  299. package/dist/i18n/locales/nl/messages.js +1 -1
  300. package/dist/i18n/locales/pl/messages.js +1 -1
  301. package/dist/i18n/locales/pt/messages.js +1 -1
  302. package/dist/i18n/locales/ro/messages.js +1 -1
  303. package/dist/i18n/locales/sk/messages.js +1 -1
  304. package/dist/i18n/locales/tr/messages.js +1 -1
  305. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  306. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  307. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +16 -0
  308. package/dist/legacy/domain-spec/spec/domain-spec.js +1 -1
  309. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
  310. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
  311. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
  312. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +11 -5
  313. package/dist/react-sdk/application-runtime/common-services/analytics/frontend-analytics.d.ts +4 -0
  314. package/dist/react-sdk/application-runtime/hooks/index.d.ts +1 -0
  315. package/dist/react-sdk/application-runtime/hooks/index.js +1 -1
  316. package/dist/react-sdk/application-runtime/hooks/responsive/index.d.ts +3 -0
  317. package/dist/react-sdk/application-runtime/hooks/responsive/index.js +1 -0
  318. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.d.ts +9 -0
  319. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.js +1 -0
  320. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.d.ts +26 -0
  321. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.js +1 -0
  322. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.d.ts +10 -0
  323. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.js +1 -0
  324. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.d.ts +24 -0
  325. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.js +1 -0
  326. package/dist/react-sdk/application-runtime/hooks/use-access-service.d.ts +5 -0
  327. package/dist/react-sdk/application-runtime/hooks/use-access-service.js +1 -1
  328. package/dist/react-sdk/application-runtime/hooks/use-phoenix-element-slots.d.ts +2 -1
  329. package/dist/react-sdk/application-runtime/index.d.ts +1 -0
  330. package/dist/react-sdk/application-runtime/integration/initialize.d.ts +7 -6
  331. package/dist/react-sdk/application-runtime/integration/initialize.js +1 -1
  332. package/dist/react-sdk/application-runtime/integration/selectors.d.ts +11 -2
  333. package/dist/react-sdk/application-runtime/integration/selectors.js +1 -1
  334. package/dist/react-sdk/application-runtime/integration/types.d.ts +5 -2
  335. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  336. package/dist/react-sdk/application-runtime/responsive/actions.d.ts +47 -0
  337. package/dist/react-sdk/application-runtime/responsive/actions.js +1 -0
  338. package/dist/react-sdk/application-runtime/responsive/index.d.ts +4 -0
  339. package/dist/react-sdk/application-runtime/responsive/index.js +1 -0
  340. package/dist/react-sdk/application-runtime/responsive/initialize.d.ts +3 -0
  341. package/dist/react-sdk/application-runtime/responsive/initialize.js +1 -0
  342. package/dist/react-sdk/application-runtime/responsive/selectors.d.ts +20 -0
  343. package/dist/react-sdk/application-runtime/responsive/selectors.js +1 -0
  344. package/dist/react-sdk/application-runtime/responsive/types.d.ts +104 -0
  345. package/dist/react-sdk/application-runtime/routing/routing-service.d.ts +34 -2
  346. package/dist/react-sdk/application-runtime/routing/routing-service.js +1 -1
  347. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +95 -2
  348. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
  349. package/dist/react-sdk/domain-context/common-hooks/index.d.ts +9 -0
  350. package/dist/react-sdk/domain-context/common-hooks/index.js +1 -0
  351. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.d.ts +23 -0
  352. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.js +1 -0
  353. package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +1 -0
  354. package/dist/react-sdk/domain-context/component-hooks/index.d.ts +1 -0
  355. package/dist/react-sdk/domain-context/component-hooks/index.js +1 -0
  356. package/dist/react-sdk/domain-context/component-hooks/use-component.js +1 -1
  357. package/dist/react-sdk/domain-context/entity-hooks/use-domain-entity-state.js +1 -1
  358. package/dist/react-sdk/domain-context/entity-hooks/use-entity-price.js +1 -1
  359. package/dist/react-sdk/domain-context/entity-hooks/use-root-entity-id.js +1 -1
  360. package/dist/react-sdk/domain-context/entity-hooks/use-root-entity-state.js +1 -1
  361. package/dist/react-sdk/domain-context/index.d.ts +5 -0
  362. package/dist/react-sdk/domain-context/index.js +1 -1
  363. package/dist/react-sdk/domain-context/system-hooks/composition-hooks.js +1 -1
  364. package/dist/react-sdk/domain-context/system-hooks/dimension-hooks.js +1 -1
  365. package/dist/react-sdk/domain-context/system-hooks/generate-share-link-hooks.d.ts +8 -0
  366. package/dist/react-sdk/domain-context/system-hooks/generate-share-link-hooks.js +1 -0
  367. package/dist/react-sdk/domain-context/system-hooks/hover-hooks.js +1 -1
  368. package/dist/react-sdk/domain-context/system-hooks/locale-switch-hooks.d.ts +24 -0
  369. package/dist/react-sdk/domain-context/system-hooks/locale-switch-hooks.js +1 -0
  370. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
  371. package/dist/react-sdk/domain-context/system-hooks/selection-hooks.js +1 -1
  372. package/dist/react-sdk/domain-context/system-hooks/share-links-hooks.d.ts +32 -0
  373. package/dist/react-sdk/domain-context/system-hooks/share-links-hooks.js +1 -0
  374. package/dist/react-sdk/domain-context/system-hooks/step-navigation-hooks.d.ts +57 -0
  375. package/dist/react-sdk/domain-context/system-hooks/step-navigation-hooks.js +1 -0
  376. package/dist/react-sdk/domain-context/system-hooks/tab-navigation-hooks.js +1 -1
  377. package/dist/react-sdk/domain-context/system-hooks/undo-redo-hooks.js +1 -1
  378. package/dist/react-sdk/elements/configurator-error-page-props.d.ts +20 -0
  379. package/dist/react-sdk/elements/configurator-error-page-props.js +1 -0
  380. package/dist/react-sdk/elements/index.d.ts +1 -0
  381. package/dist/react-sdk/handlers/FinalizeActionRunner.d.ts +13 -0
  382. package/dist/react-sdk/handlers/FinalizeActionRunner.js +1 -0
  383. package/dist/react-sdk/handlers/FinalizeActionsHost.d.ts +10 -0
  384. package/dist/react-sdk/handlers/FinalizeActionsHost.js +1 -0
  385. package/dist/react-sdk/handlers/FinalizeActionsProvider.d.ts +11 -0
  386. package/dist/react-sdk/handlers/FinalizeActionsProvider.js +1 -0
  387. package/dist/react-sdk/handlers/finalize-actions-context.d.ts +6 -0
  388. package/dist/react-sdk/handlers/finalize-actions-context.js +1 -0
  389. package/dist/react-sdk/handlers/finalize-actions-store.d.ts +23 -0
  390. package/dist/react-sdk/handlers/finalize-actions-store.js +1 -0
  391. package/dist/react-sdk/handlers/index.d.ts +5 -0
  392. package/dist/react-sdk/handlers/index.js +1 -1
  393. package/dist/react-sdk/handlers/use-finalize-action.d.ts +3 -2
  394. package/dist/react-sdk/handlers/use-finalize-action.js +1 -1
  395. package/dist/react-sdk/handlers/use-finalize-actions.d.ts +53 -0
  396. package/dist/react-sdk/handlers/use-finalize-actions.js +1 -0
  397. package/dist/react-sdk/index.d.ts +1 -0
  398. package/dist/react-sdk/index.js +1 -1
  399. package/dist/react-sdk/loading-state/loading-state-manager.d.ts +5 -0
  400. package/dist/react-sdk/loading-state/loading-state-manager.js +1 -1
  401. package/dist/react-sdk/scene-control-elements/AddEntityFabElement.d.ts +36 -0
  402. package/dist/react-sdk/scene-control-elements/AddEntityFabElement.js +1 -0
  403. package/dist/react-sdk/scene-control-elements/DeleteEntityFabElement.d.ts +44 -0
  404. package/dist/react-sdk/scene-control-elements/DeleteEntityFabElement.js +1 -0
  405. package/dist/react-sdk/scene-control-elements/NavigationHotspotElement.d.ts +38 -0
  406. package/dist/react-sdk/scene-control-elements/NavigationHotspotElement.js +1 -0
  407. package/dist/react-sdk/scene-control-elements/SelectionHotspotElement.d.ts +30 -0
  408. package/dist/react-sdk/scene-control-elements/SelectionHotspotElement.js +1 -0
  409. package/dist/react-sdk/scene-control-elements/ToolMenuFabElement.d.ts +30 -0
  410. package/dist/react-sdk/scene-control-elements/ToolMenuFabElement.js +1 -0
  411. package/dist/react-sdk/scene-control-elements/create-add-entity-fab.d.ts +9 -0
  412. package/dist/react-sdk/scene-control-elements/create-add-entity-fab.js +1 -0
  413. package/dist/react-sdk/scene-control-elements/create-delete-entity-fab.d.ts +9 -0
  414. package/dist/react-sdk/scene-control-elements/create-delete-entity-fab.js +1 -0
  415. package/dist/react-sdk/scene-control-elements/create-navigation-hotspot.d.ts +10 -0
  416. package/dist/react-sdk/scene-control-elements/create-navigation-hotspot.js +1 -0
  417. package/dist/react-sdk/scene-control-elements/create-selection-hotspot.d.ts +9 -0
  418. package/dist/react-sdk/scene-control-elements/create-selection-hotspot.js +1 -0
  419. package/dist/react-sdk/scene-control-elements/create-tool-menu-fab.d.ts +9 -0
  420. package/dist/react-sdk/scene-control-elements/create-tool-menu-fab.js +1 -0
  421. package/dist/react-sdk/scene-control-elements/index.d.ts +11 -0
  422. package/dist/react-sdk/scene-control-elements/index.js +1 -0
  423. package/dist/react-sdk/scene-control-elements/scene-control-tooltip-visibility.d.ts +5 -0
  424. package/dist/react-sdk/scene-control-elements/scene-control-tooltip-visibility.js +1 -0
  425. package/dist/react-sdk/web-component/create-web-component.js +1 -1
  426. package/dist/react-sdk/web-component/god-mode/god-mode-registry.d.ts +30 -0
  427. package/dist/react-sdk/web-component/god-mode/god-mode-registry.js +1 -0
  428. package/dist/react-sdk/web-component/god-mode/index.d.ts +1 -0
  429. package/dist/react-sdk/web-component/god-mode/index.js +1 -0
  430. package/dist/ui-sdk/icons/__generated/Lightbulb.d.ts +3 -0
  431. package/dist/ui-sdk/icons/__generated/Lightbulb.js +1 -0
  432. package/dist/ui-sdk/icons/__generated/XCircle.d.ts +3 -0
  433. package/dist/ui-sdk/icons/__generated/XCircle.js +1 -0
  434. package/dist/ui-sdk/icons/__generated/index.d.ts +4 -0
  435. package/dist/ui-sdk/icons/__generated/index.js +1 -1
  436. package/dist/ui-sdk/icons/icons-registry.js +1 -1
  437. package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.d.ts +9 -0
  438. package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.js +1 -1
  439. package/dist/ui-sdk/responsive-application/index.d.ts +1 -0
  440. package/dist/ui-sdk/responsive-application/responsive-state-store.d.ts +59 -0
  441. package/dist/ui-sdk/responsive-application/responsive-state-store.js +1 -0
  442. package/dist/ui-sdk/responsive-application/use-store-responsive-info.d.ts +7 -0
  443. package/dist/ui-sdk/responsive-application/use-store-responsive-info.js +1 -0
  444. package/dist/ui-sdk/theme/types.d.ts +5 -1
  445. package/package.json +13 -3
  446. package/schema/domain-spec.json +140 -0
  447. package/dist/configurator/ui/assistant/form/built-in-form-registry.d.ts +0 -10
  448. package/dist/configurator/ui/assistant/form/built-in-form-registry.js +0 -1
  449. package/dist/configurator/ui/assistant/form/form-registry.js +0 -8
  450. package/dist/configurator/ui/phoenix-layout-elements/language/use-locale-options.d.ts +0 -4
  451. package/dist/configurator/ui/phoenix-layout-elements/language/use-locale-options.js +0 -1
  452. package/dist/configurator/ui/phoenix-layout-elements/measurements/use-measurements-visibility.d.ts +0 -4
  453. package/dist/configurator/ui/phoenix-layout-elements/measurements/use-measurements-visibility.js +0 -1
  454. package/dist/domain/application/assistant/assistant-form-elements.d.ts +0 -28
  455. package/dist/domain/application/assistant/assistant-form-elements.js +0 -1
  456. package/dist/domain/extensions/client-side-image.js +0 -1
  457. package/dist/domain/extensions/save-template-thumbnail.js +0 -1
  458. package/dist/react-sdk/application-runtime/runtime/god-mode.d.ts +0 -19
  459. package/dist/react-sdk/application-runtime/runtime/god-mode.js +0 -1
  460. /package/dist/{configurator/ui/assistant/form/form-element-definition.js → react-sdk/application-runtime/responsive/types.js} +0 -0
@@ -26,8 +26,8 @@ export const Toolbar = () => (
26
26
 
27
27
  - A slot takes no props unless its row names them, and reads what it shows from the spec and the configurator's state. It renders inside the configurator only, under a `ConfiguratorLayout`.
28
28
  - A slot brings its own look but not its place: it adds no padding or scrolling around itself, so the layout puts it in a container. Two members differ: `SharedCanvas` fills its nearest positioned ancestor, and `DesktopSidebar` brings the sidebar's spacing and scrolling with it.
29
- - Read mode means `useAccessService().accessInfo.viewMode` is `true`: a configuration shared for viewing is open, or the host sets the `readonly` property. "No change" in the read-mode column means the slot renders the same for a viewer, so the layout decides whether a viewer sees it.
30
- - `Desktop*` and `Mobile*` members are twins that differ in size and arrangement; [Phone layout](#phone-layout) lists the phone ones. The container's width, not the window's, decides which one fits: `useActiveViewports()` from `@salsita-ai/sdk/react` returns the breakpoints the container satisfies. The built-in layout uses the `Desktop*` members while `desktop` is active, for a container wider than 768 pixels, and the `Mobile*` members otherwise, while `mobile` is active; `phone` means narrower than 480 pixels and `tablet` between 480 and 1024.
29
+ - Read mode means `phx.frontend.useAccessService().accessInfo.viewMode` is `true`: a configuration shared for viewing is open, or the host sets the `readonly` property. "No change" in the read-mode column means the slot renders the same for a viewer, so the layout decides whether a viewer sees it.
30
+ - `Desktop*` and `Mobile*` members are twins that differ in size and arrangement; [Phone layout](#phone-layout) lists the phone ones. The container's width, not the window's, decides which one fits: `phx.frontend.useActiveViewports()`, also exported from `@salsita-ai/sdk/react`, returns the breakpoints the container satisfies. The built-in layout uses the `Desktop*` members while `desktop` is active, for a container wider than 768 pixels, and the `Mobile*` members otherwise, while `mobile` is active; `phone` means narrower than 480 pixels and `tablet` between 480 and 1024.
31
31
 
32
32
  ## Canvas and services
33
33
 
@@ -40,9 +40,9 @@ export const Toolbar = () => (
40
40
  | `SideEffects` | An info snackbar for each committed update that carries a hint | The hints of committed updates | Nothing | No change |
41
41
  | `DesktopSnackbarsRoot` | The element the snackbars are rendered into: a stack anchored to its bottom edge, at most 320 pixels wide | Every snackbar the configurator raises | An empty element | No change |
42
42
 
43
- - Mount `SharedCanvas`, not `Canvas`: `Canvas` suspends while it probes the GPU on its first mount, and `SharedCanvas` holds the boundary that catches it. Without either, the app loader stays on screen unless the project sets `appLoader: legacy`.
43
+ - Mount `SharedCanvas`, not `Canvas`: `Canvas` suspends while it probes the GPU on its first mount, and `SharedCanvas` holds the boundary that catches it. `SharedCanvas` also tells the app loader to wait for the scene from the moment it mounts; `Canvas` alone does so only once the probe is done, so the loader can leave and come back. A layout with neither is not held by the loader for a scene.
44
44
  - `SharedCanvas` fills its nearest positioned ancestor and paints an opaque background, so the layout positions its own UI after it in the markup.
45
- - Snackbars are raised by `Services`, for violations, side-effect hints, validation errors and a failed save, and also by the built-in finalize and footer actions when their handler fails. A layout that shows these messages its own way calls `phx.frontend.useConfiguratorMessages(onMessage)` instead of mounting `Services`, and then shows the failed save too, see [Configurator Interface → Hooks for a Project Layout](?path=/docs/phoenix-configurator-interface--docs#hooks-for-a-project-layout); the other snackbars still need a root. They render into the snackbar root the layout mounts; with no root mounted they render into the page's `document.body`, outside the configurator. The desktop root is a zero-height element the snackbars stack upwards from, so the layout places it where their bottom edge belongs. The phone root leaves them fixed to the viewport, see `MobileSnackbarsRoot`. A finalize action the layout runs with `phx.frontend.useFinalizeAction` raises no snackbar; its error is the hook's `error`.
45
+ - Snackbars are raised by `Services`, for violations, side-effect hints, validation errors and a failed save, and also by the built-in finalize and footer actions when their handler fails. A layout that shows these messages its own way calls `phx.frontend.useConfiguratorMessages(onMessage)` instead of mounting `Services`, and then shows the failed save too, see [Configurator Interface → Hooks for a Project Layout](?path=/docs/phoenix-configurator-interface--docs#hooks-for-a-project-layout); the other snackbars still need a root. They render into the snackbar root the layout mounts; with no root mounted they render into the page's `document.body`, outside the configurator. The desktop root is a zero-height element the snackbars stack upwards from, so the layout places it where their bottom edge belongs. The phone root leaves them fixed to the viewport, see `MobileSnackbarsRoot`. A finalize action the layout runs with `phx.frontend.useFinalizeActions` or `phx.frontend.useFinalizeAction` raises no snackbar; its error is the action's `error`.
46
46
 
47
47
  ## Desktop sidebar
48
48
 
@@ -79,7 +79,7 @@ Instead of `DesktopViewControls` or `MobileViewControls`, a layout can build its
79
79
  | `DesktopReadonlyBanner` | "You're viewing a read-only configuration" with an **Edit configuration** button that opens `CloneToEditDialog`. Props: the MUI `Alert` props and `icon`, also settable in the theme as `PhxDesktopReadonlyBanner` | `useIsCloningAllowed()`; its icon from the application config's `readonlyBannerIcon` | Nothing unless cloning is allowed | **It does not check read mode.** The layout renders it only in read mode, as the built-in layout does while not in fullscreen |
80
80
  | `MobileReadonlyBanner` | An **Edit** button that opens `CloneToEditDialog`. Props: the MUI `Button` props and `icon`, also settable in the theme as `PhxMobileReadonlyBanner` | As `DesktopReadonlyBanner` | Nothing unless cloning is allowed | As `DesktopReadonlyBanner` |
81
81
  | `CloneToEditDialog` | The "Edit configuration" dialog that creates an editable copy of the configuration and opens it. Props, typed `CloneToEditDialogProps`: `open` and `onClose` | The open configuration | — | — |
82
- | `useIsCloningAllowed()` | A hook, `boolean`: `true` when the application config sets `shareCloneToEdit` and the session's role may create configurations | The application config and the session | `false` | Does not check read mode |
82
+ | `useIsCloningAllowed()` | A hook, also `phx.frontend.useIsCloningAllowed()`, returning a `boolean`: `true` when the application config sets `shareCloneToEdit` and the session's role may create configurations | The application config and the session | `false` | Does not check read mode |
83
83
  | `DesktopPoweredBy` / `MobilePoweredBy` | The "Powered by Salsita" mark, a link | Its props `visible`, `variant` (`'black'` or `'white'`), `href`, `title`, `slots` and `slotProps`. All but `href` and `title` are also settable in the theme as `PhxDesktopBrandingPoweredBy` / `PhxMobileBrandingPoweredBy` | The mark | No change |
84
84
 
85
85
  ## Page footer
@@ -95,7 +95,7 @@ Tell us what is broken, confusing or missing, from wherever you are:
95
95
 
96
96
  - In Studio, **Send beta feedback** in the sidebar opens a short form.
97
97
  - In the terminal, `pnpm phoenix feedback "<message>" --type bug|idea|other` sends it with your sign-in, and `--file <path>` sends a text file instead of the argument. See the [CLI reference](?path=/docs/phoenix-phoenix-cli--docs).
98
- - On a build's page in Studio, **Download sources** downloads the archive `phoenix deploy` uploaded for that build, so a report only needs to name the build.
98
+ - On a build's page in Studio, **Download** → **Sources** downloads the archive `phoenix deploy` uploaded for that build, so a report only needs to name the build.
99
99
 
100
100
  Coding agents working in your project use the same command, guided by the generated `phoenix-feedback` skill. They never send on their own: an agent shows you a draft, right away when the problem is crucial and otherwise at the end of the task, and sends it only after you approve it. A report names the build with its Studio page link and the live configurator, says what the agent was doing, what happened and what it expected, quotes the exact error and ends with a condensed conversation log. Agents are told never to include secrets, credentials or personal data; parts of your project and your own words go in only through a draft you approved. When you are done with the configurator, the agent also asks you, once per conversation, to evaluate the run: minutes spent, then scores from 0 to 10 for the agent's guidance, functionality, UX, 3D quality, UI visuals and the overall result, and your comments. It asks one question at a time, never picks a score for you, tells you the answers go to the Phoenix team, shows the message and sends it only after you approve it.
101
101
 
@@ -427,6 +427,8 @@ The `readonly` web component property lets the host force view mode without chan
427
427
 
428
428
  Because an owner-token session can be forced read-only client-side while the server still accepts writes from that owner token, Phoenix skips persistence and logs a warning instead of updating the configuration. This guards against the configuration being silently overwritten by code paths that mutate state in read-only mode. UI that triggers significant changes (anything that produces a new revision) should still be disabled when `accessInfo.viewMode` is true — the warning is a backstop, not a substitute.
429
429
 
430
+ The assistant follows the same read-only rule as the UI: its `apply` tool refuses changes while `accessInfo.viewMode` is true, that is with a read-revision token or while `readonly` is set, and makes them again once it is false. A switch of `readonly` takes effect at once, in both directions, and the configurator loads the configuration again. A change applied after `readonly` is cleared and before the configuration has loaded again is not saved; saving resumes once it has loaded. The `query` tool keeps working, including its dry-run mutations.
431
+
430
432
  ```html
431
433
  <salsita-configurator readonly></salsita-configurator>
432
434
  ```
@@ -34,8 +34,8 @@ handler, element and transformer; it reads the frontend environment when it is i
34
34
  uses it stubs `phx.frontendEnv` first.
35
35
 
36
36
  A test that mounts the configurator's UI builds from `configuratorConfig`: it carries the SDK's default
37
- elements, the built-in layout, preset screen, not-found and not-authenticated pages, controls, toolbar
38
- buttons and sidebar-footer pieces, which `configuratorBuilder` does not, so a test that mounts the UI from `createTestApplicationConfig(configuratorBuilder)`
37
+ elements, the built-in layout, preset screen, not-found, not-authenticated and error pages, app loader content,
38
+ controls, toolbar buttons and sidebar-footer pieces, which `configuratorBuilder` does not, so a test that mounts the UI from `createTestApplicationConfig(configuratorBuilder)`
39
39
  shows a "not found" box in place of every built-in element. Code that assembles a config without the
40
40
  generated files calls `.withDefaultElements(defaultConfiguratorElements)` on its configurator builder, with
41
41
  the list from `@salsita-ai/sdk/configurator`, or `defaultAdminElements` from `@salsita-ai/sdk/admin` for
@@ -56,6 +56,8 @@ sceneEntitySelectHotspot:
56
56
 
57
57
  The `title` supplies the tooltip text. Tooltips appear on hover by default; `tooltipVisibility` can instead keep them visible continuously, while the camera is still, or hide them. The `showWhen` property controls visibility based on selection state. The default `['unselected']` hides hotspots once entities are selected, keeping the view clean. Setting it to `['selected', 'unselected']` keeps hotspots always visible.
58
58
 
59
+ The hotspot is the entity element `SelectionHotspot`. A project replaces its look by registering its own with `phx.frontend.createSelectionHotspot`, which receives `onSelect`, the selection with its analytics event; the settings above still apply. See [Configurator Interface → In-Scene Controls](?path=/docs/phoenix-configurator-interface--docs#in-scene-controls).
60
+
59
61
  ## System Component Interfaces
60
62
 
61
63
  ```typescript
@@ -1,3 +1,4 @@
1
+ import type { AssistantFormElementDescriptor } from './form/index.js';
1
2
  /**
2
3
  * Where one exposed assistant GraphQL field reads its value on the `$` entity: a stored field name,
3
4
  * or an expression name including its `$`. `localized` marks a localizable value that resolves to a
@@ -35,6 +36,16 @@ export interface AssistantFieldOptions {
35
36
  readonly validate: boolean;
36
37
  readonly dryRuns: boolean;
37
38
  }
39
+ /**
40
+ * One view the assistant manifest lets the agent take a screenshot of an entity from: `view` is the
41
+ * value of the `<Type>ScreenshotView` enum the agent asks for it by, `instanceName` the
42
+ * `agentScreenshot` component instance that renders it, and `description` what the view shows.
43
+ */
44
+ export interface AssistantScreenshotView {
45
+ readonly view: string;
46
+ readonly instanceName: string;
47
+ readonly description: string;
48
+ }
38
49
  /**
39
50
  * Experimental assistant manifest generated from the application spec `assistant` section. `sdl` is
40
51
  * the GraphQL schema text rebuilt from the resolved manifest; `fields` maps each GraphQL object type's exposed
@@ -46,7 +57,8 @@ export interface AssistantFieldOptions {
46
57
  * the recipe groups `meta { childRecipes }` and `addChild` expose, in manifest order, and absent
47
58
  * means none; `replaceRecipes` lists the same for `meta { replaceRecipes }` and `replaceEntity`;
48
59
  * `fieldOptions` lists, per entity type, the options edges `meta` exposes for its
49
- * writable fields, and absent means none; `actions` maps each custom `Mutation` field to the
60
+ * writable fields, and absent means none; `screenshots` lists, per entity type, the views
61
+ * `meta { screenshot }` renders, and absent means none; `actions` maps each custom `Mutation` field to the
50
62
  * declared action it runs, and absent means none; `lenses` holds the generated lens fragments, and
51
63
  * absent means none: `declarations` is the text the prompt shows, each lens once with its relations
52
64
  * spreading the lens itself, and `definitions` the valid GraphQL injected into an operation that
@@ -63,9 +75,12 @@ export interface AssistantManifest {
63
75
  readonly childRecipes?: Readonly<Record<string, readonly AssistantRecipeGroup[]>>;
64
76
  readonly replaceRecipes?: Readonly<Record<string, readonly AssistantRecipeGroup[]>>;
65
77
  readonly fieldOptions?: Readonly<Record<string, readonly AssistantFieldOptions[]>>;
78
+ readonly screenshots?: Readonly<Record<string, readonly AssistantScreenshotView[]>>;
66
79
  readonly actions?: Readonly<Record<string, string>>;
67
80
  readonly lenses?: {
68
81
  readonly declarations: string;
69
82
  readonly definitions: string;
70
83
  };
84
+ /** The project's own form elements, in YAML order; absent means none. */
85
+ readonly formElements?: readonly AssistantFormElementDescriptor[];
71
86
  }
@@ -1,4 +1,5 @@
1
- import type { AssistantFieldOptions, AssistantRecipeGroup } from './assistant-manifest.js';
1
+ import type { AssistantFieldOptions, AssistantRecipeGroup, AssistantScreenshotView } from './assistant-manifest.js';
2
+ import type { AssistantFormElementDescriptor } from './form/index.js';
2
3
  /** JSON description of a scalar or recursively nested list, including nullability at each level. */
3
4
  export type AssistantValueType = {
4
5
  readonly kind: 'scalar';
@@ -50,12 +51,16 @@ export interface AssistantResolvedManifest {
50
51
  readonly childRecipes: Readonly<Record<string, AssistantResolvedRecipes>>;
51
52
  readonly replaceRecipes: Readonly<Record<string, AssistantResolvedRecipes>>;
52
53
  readonly optionsEdges: Readonly<Record<string, readonly AssistantResolvedOptionsEdge[]>>;
54
+ /** The screenshot views of each entity type with at least one, aliases expanded, in manifest order. */
55
+ readonly screenshots: Readonly<Record<string, readonly AssistantScreenshotView[]>>;
53
56
  readonly actionFields: readonly AssistantResolvedAction[];
54
57
  /** The declared lenses by name: when to use each, and how many levels its tagged relations nest. */
55
58
  readonly lenses: Readonly<Record<string, {
56
59
  readonly description: string;
57
60
  readonly maxDepth: number;
58
61
  }>>;
62
+ /** The project's own form elements, in YAML order, which the prompt lists after the built-ins and the panel renders with their registered components. */
63
+ readonly formElements: readonly AssistantFormElementDescriptor[];
59
64
  }
60
65
  /** Optional mutation input for one stored field, using its exposed name. */
61
66
  export interface AssistantWritableField {
@@ -113,6 +118,8 @@ export interface AssistantDeclarations {
113
118
  readonly writable: Readonly<Record<string, Readonly<Record<string, AssistantDeclaredWrite>>>>;
114
119
  readonly childRecipes: Readonly<Record<string, AssistantResolvedRecipes>>;
115
120
  readonly replaceRecipes: Readonly<Record<string, AssistantResolvedRecipes>>;
121
+ /** The screenshot views under the entity type or alias key that declares them. */
122
+ readonly screenshots: Readonly<Record<string, readonly AssistantScreenshotView[]>>;
116
123
  }
117
124
  /** An original field declaration, including metadata needed to reapply inheritance and enum descriptions. */
118
125
  export interface AssistantDeclaredField extends AssistantResolvedField {
@@ -1 +1 @@
1
- import{GraphQLBoolean as e,GraphQLID as t,GraphQLInputObjectType as n,GraphQLInterfaceType as i,GraphQLList as r,GraphQLNonNull as s,GraphQLObjectType as o,GraphQLSchema as a,GraphQLString as p,printSchema as d,validateSchema as c}from"graphql";import{GraphQLJSON as l,createAssistantValueType as h}from"./assistant-value-type.js";import{buildAssistantLenses as y}from"./build-assistant-lenses.js";import{createAssistantExecutionSchema as w}from"./create-assistant-execution-schema.js";let u="AnyDomainEntity",m="RootEntity",f=[["navigationState","Active navigation state.","navigationStates"],["viewState","Active view state.","viewStates"],["toolState","Active tool state.","toolStates"]],g={section:"childRecipes",mutation:"addChild"},b={section:"replaceRecipes",mutation:"replaceEntity"},j=(e,t)=>Object.entries(e).find(([e])=>e===t)?.[1],v=(e,t)=>{if(!t||0===t.length)return e;let n=`One of: ${t.map(e=>`"${e}"`).join(", ")}.`;return e?/[.!?]$/.test(e)?`${e} ${n}`:`${e}. ${n}`:n},$=({target:e,cardinality:t},n)=>{let i=n(e);switch(t){case"1-1":return new s(i);case"0-1":return i;case"0-N":case"1-N":return new s(new r(new s(i)))}},O=(e,n,i)=>{let r={id:{type:new s(t),description:i?`Unique id of the entity, assigned by the configurator, e.g. "${i}-1".`:void 0},type:{type:new s(p),description:i?`Entity type name, e.g. "${i}".`:void 0}};for(let t of e)r[t.name]={type:"edge"===t.type.kind?$(t.type,n):h(t.type.type),description:t.description};return r},E=e=>Object.fromEntries(e.map(({name:e,source:t,localized:n})=>[e,n?{source:t,localized:!0}:{source:t}])),R={sameForAllInstances:e=>`Same recipe groups and recipes for every ${e}.`,constantDuringSession:()=>"Fixed for the session."},k={sameForAllInstances:e=>`Same for every ${e}.`,constantDuringSession:()=>"Fixed for the session."},I=(e,t,n)=>e.map(e=>` ${t[e](n)}`).join(""),T=({section:e},{groups:t,hints:n},{entityType:i,purpose:o,recipeGroup:a})=>{let p=t.filter(({dryRuns:e})=>!e).map(({groupId:e})=>e);return 0===t.length?{}:{[e]:{type:new s(new r(new s(a))),description:`The recipe groups for ${o} this ${i}: ${t.map(({groupId:e})=>e).join(", ")}. A group is listed only while the configurator offers it on the entity.${p.length>0?` Recipes of these groups cannot be dry-run: ${p.join(", ")}.`:""}${I(n,R,i)}`}}},N=({entityType:e,childRecipes:t,replaceRecipes:n,optionsEdges:i},{recipeGroup:a,fieldOption:p})=>new o({name:`${e}Meta`,fields:Object.assign(T(g,t,{entityType:e,purpose:"adding children to",recipeGroup:a}),T(b,n,{entityType:e,purpose:"replacing",recipeGroup:a}),...i.map(({options:{edgeName:t,field:n,validate:i,dryRuns:o},hints:a})=>({[t]:{type:new r(new s(p)),description:`Values "${n}" accepts on this ${e}. Null when there is no choice to make.${i?"":" Not checked on write."}${o?"":" Cannot be dry-run."}${I(a,k,e)}`}})))}),A=e=>Object.entries(e).map(([e,t])=>`${e} (${t.map(({groupId:e})=>e).join(", ")})`);export const buildAssistantManifest=$=>{var R,k,I,T,S;let D,M,F,W,{entityTypes:x,aliases:C,exampleType:q,fields:G,states:U,deletableTypes:K,writableTypes:P,actionFields:V,optionsEdges:z}=$,Q=Object.fromEntries(Object.entries($.childRecipes).map(([e,t])=>[e,t.groups])),B=Object.fromEntries(Object.entries($.replaceRecipes).map(([e,t])=>[e,t.groups])),H=new Map,J=new Map,L=new Map,X=e=>{let[t,...n]=Object.entries(C).find(([t])=>t===e)?.[1]??[];return(t&&0===n.length?J.get(t):void 0)??L.get(e)??Z},Y=e=>J.get(e)??X(e),Z=new i({name:u,description:"Every entity of the configuration.",fields:()=>O(G[u]??[],Y,q)});for(let e of(L.set(u,Z),Object.keys(C)))e!==u&&L.set(e,new i({name:e,interfaces:[Z],fields:()=>O(G[e]??[],Y)}));let _={};for(let e of x){let t=[u,...Object.entries(C).filter(([t,n])=>t!==u&&n.includes(e)).map(([e])=>e)],n=G[e]??[];_[e]=E(n),J.set(e,new o({name:e,interfaces:t.flatMap(e=>L.get(e)??[]),fields:()=>{let t=H.get(e);return{...O(n,Y),...t?{meta:{type:new s(t),description:"What can be done to this entity right now."}}:{}}}}))}let ee=(R=()=>X(L.has(m)?m:u),k=()=>X(u),D=new o({name:"DryRunError",description:"One reason a change cannot be made right now.",fields:{type:{type:new s(p),description:"Kind of the problem."},entityId:{type:t,description:"The entity the problem is on, when it is on one."},message:{type:p,description:"The problem as the user would be told it."}}}),new o({name:"DryRun",description:"What using a recipe or writing an option would do, tried out on the configuration the query reads. Nothing is changed.",fields:()=>({ok:{type:new s(e),description:"Whether the change would succeed on the configuration the query reads."},root:{type:R(),description:"The root entity of the configuration as it would be after the change; null when ok is false. Everything selected under it reads that configuration."},changedEntities:{type:new s(new r(new s(k()))),description:"Entities the change would add or modify; empty when ok is false. One whose id is not in the configuration would be added, and its real id may differ. An entity written to is listed even when its values stay the same."},deletedEntityIds:{type:new s(new r(new s(t))),description:"The ids of the entities the change would remove; empty when ok is false."},sideEffects:{type:new s(new r(new s(p))),description:"The major or unexpected things the configurator would change along with it; empty when ok is false."},errors:{type:new s(new r(new s(D))),description:"Why the change cannot be made; empty when ok is true."}})})),et={recipeGroup:(I=[...Object.keys(Q).length>0?[g.mutation]:[],...Object.keys(B).length>0?[b.mutation]:[]],M=I.join(" or "),F=new o({name:"Recipe",description:`${I.includes("addChild")?"One thing that can be added to the entity (under childRecipes)":"One thing the entity can be replaced with (under replaceRecipes)"}${I.length>1?" or that it can be replaced with (under replaceRecipes)":""}.`,fields:{key:{type:new s(p),description:`Pass to ${M} as recipeKey. Valid only for the listing it came from.`},name:{type:new s(p),description:"Name shown to the user."},description:{type:p},imageUrl:{type:p,description:"Thumbnail shown to the user."},dryRun:{type:ee,description:"What using this recipe would do. Null when it cannot be tried."}}}),new o({name:"RecipeGroup",description:"A group of recipes for this entity.",fields:{groupId:{type:new s(p),description:`Pass to ${M} as recipeGroupId.`},name:{type:new s(p),description:"Name shown to the user."},description:{type:p},recipes:{type:new s(new r(new s(F)))}}})),fieldOption:new o({name:"FieldOption",description:"One value a field accepts. Writing a value outside the list is rejected unless the field description says it is not checked.",fields:{value:{type:new s(l),description:"The value to write to the field."},name:{type:p,description:"Name shown to the user."},description:{type:p},imageUrl:{type:p,description:"Image shown to the user."},color:{type:p,description:'Color shown to the user, as "#rrggbb".'},dryRun:{type:ee,description:"What writing this value would do. Null when it cannot be tried."}}})};for(let e of x){let t=j($.childRecipes,e)??{groups:[],hints:[]},n=j($.replaceRecipes,e)??{groups:[],hints:[]},i=j(z,e)??[];(t.groups.length>0||n.groups.length>0||i.length>0)&&H.set(e,N({entityType:e,childRecipes:t,replaceRecipes:n,optionsEdges:i.map(t=>({...t,hints:(C[m]??[]).includes(e)?t.hints.filter(e=>"sameForAllInstances"!==e):t.hints}))},et))}let en=new a({query:(T=X(L.has(m)?m:u),S=X(u),W=(e=>{let t={};for(let[n,i,r]of f){let o=e[r];o.length>1&&(t[n]={type:new s(p),description:v(i,o)})}if(0!==Object.keys(t).length)return new o({name:"Navigation",description:"The active UI states of the configurator.",fields:t})})(U),new o({name:"Query",fields:{root:{type:new s(T),description:"The root entity of the configuration."},entities:{type:new s(new r(S)),args:{ids:{type:new r(new s(t))}},description:"Every entity, or the given ids in order with null for an unknown id."},selectedEntity:{type:new s(S),description:"The selected entity, or the root entity when nothing is selected."},...W?{navigation:{type:new s(W)}}:{}}})),mutation:(({deletableTypes:e,writableTypes:i,childRecipes:a,replaceRecipes:d,actionFields:c,objectTypes:l,anyDomainEntity:y,targetOutputType:w})=>{let u,m;if(0!==e.length||0!==i.length||0!==Object.keys(a).length||0!==Object.keys(d).length||0!==c.length)return new o({name:"Mutation",fields:Object.assign(0===e.length?{}:{deleteEntity:{type:new s(new r(new s(t))),args:{id:{type:new s(t)}},description:`Deletes the entity and everything composed into it. Deletable types: ${e.join(", ")}. Returns the ids removed, the given one first.`}},0===(u=A(a)).length?{}:{addChild:{type:new s(new r(new s(y))),args:{parentId:{type:new s(t)},recipeGroupId:{type:new s(p)},recipeKey:{type:new s(p)}},description:`Adds a child to the entity parentId from a recipe listed under its meta { childRecipes }. Types with child recipes: ${u.join("; ")}. Returns the entities added, the recipe's own first; empty when they were removed again.`}},0===(m=A(d)).length?{}:{replaceEntity:{type:new s(new r(new s(y))),args:{entityId:{type:new s(t)},recipeGroupId:{type:new s(p)},recipeKey:{type:new s(p)}},description:`Replaces the entity entityId from a recipe listed under its meta { replaceRecipes }. Types with replace recipes: ${m.join("; ")}. The replacement is a new entity: it has a new id and the field values of its recipe, and entityId no longer exists. Returns the entities added, the replacement first; empty when they were removed again.`}},...i.flatMap(e=>{let i=l.get(e.entityType);return i?[(({entityType:e,fields:i},r)=>{let o=Object.fromEntries(i.map(({name:e,type:t,description:n})=>[e,{type:h(t),description:n}]));return{[`modify${e}`]:{type:r,args:{id:{type:new s(t)},delta:{type:new s(new n({name:`${e}Delta`,fields:o}))}},description:`Sets the fields named in delta on one ${e}. Returns the entity after the change, or null when the change removed it.`}}})(e,i)]:[]}),Object.fromEntries(c.map(e=>{var t;return[e.fieldName,{type:new s(new o({name:(t=e.fieldName,`${t.charAt(0).toUpperCase()+t.slice(1)}Result`),description:`What ${e.fieldName} returns, read from the configuration after the change.`,fields:()=>Object.fromEntries(Object.entries(e.result).map(([e,t])=>[e,{type:"edge"===t.kind?(({target:e,list:t,nullable:n},i)=>{let o=t?new r(new s(i(e))):i(e);return n?o:new s(o)})(t,w):h(t.type),description:t.description}]))})),args:Object.fromEntries(Object.entries(e.args).map(([e,t])=>[e,{type:h(t.type),description:t.description}])),description:e.description}]})))})})({deletableTypes:K,writableTypes:P,childRecipes:Q,replaceRecipes:B,actionFields:V,objectTypes:J,anyDomainEntity:X(u),targetOutputType:Y}),types:[...L.values(),...J.values()]}),ei=c(en);if(ei.length>0)throw Error(ei.map(e=>e.message).join(" "));let er=d(en);return{sdl:er,navigationFields:f.filter(([,,e])=>U[e].length>1).map(([e])=>e),fields:_,deletableTypes:K,writableFields:Object.fromEntries(P.map(({entityType:e,fields:t})=>[e,Object.fromEntries(t.map(({name:e,property:t})=>[e,t]))])),childRecipes:Q,replaceRecipes:B,fieldOptions:Object.fromEntries(x.flatMap(e=>{let t=j(z,e);return t?[[e,t.map(({options:e})=>e)]]:[]})),actions:Object.fromEntries(V.map(({fieldName:e,actionName:t})=>[e,t])),lenses:y($,w(er))}};
1
+ import{GraphQLBoolean as e,GraphQLEnumType as t,GraphQLID as n,GraphQLInputObjectType as i,GraphQLInterfaceType as s,GraphQLList as r,GraphQLNonNull as o,GraphQLObjectType as a,GraphQLSchema as p,GraphQLString as c,printSchema as d,validateSchema as l}from"graphql";import{GraphQLJSON as h,createAssistantValueType as w}from"./assistant-value-type.js";import{buildAssistantLenses as y}from"./build-assistant-lenses.js";import{createAssistantExecutionSchema as u}from"./create-assistant-execution-schema.js";let m="AnyDomainEntity",f="RootEntity",g=[["navigationState","Active navigation state.","navigationStates"],["viewState","Active view state.","viewStates"],["toolState","Active tool state.","toolStates"]],b={section:"childRecipes",mutation:"addChild"},v={section:"replaceRecipes",mutation:"replaceEntity"},j=(e,t)=>Object.entries(e).find(([e])=>e===t)?.[1],$=(e,t)=>{if(!t||0===t.length)return e;let n=`One of: ${t.map(e=>`"${e}"`).join(", ")}.`;return e?/[.!?]$/.test(e)?`${e} ${n}`:`${e}. ${n}`:n},O=({target:e,cardinality:t},n)=>{let i=n(e);switch(t){case"1-1":return new o(i);case"0-1":return i;case"0-N":case"1-N":return new o(new r(new o(i)))}},E=(e,t,i)=>{let s={id:{type:new o(n),description:i?`Unique id of the entity, assigned by the configurator, e.g. "${i}-1".`:void 0},type:{type:new o(c),description:i?`Entity type name, e.g. "${i}".`:void 0}};for(let n of e)s[n.name]={type:"edge"===n.type.kind?O(n.type,t):w(n.type.type),description:n.description};return s},R=e=>Object.fromEntries(e.map(({name:e,source:t,localized:n})=>[e,n?{source:t,localized:!0}:{source:t}])),k={sameForAllInstances:e=>`Same recipe groups and recipes for every ${e}.`,constantDuringSession:()=>"Fixed for the session."},T={sameForAllInstances:e=>`Same for every ${e}.`,constantDuringSession:()=>"Fixed for the session."},I=(e,t,n)=>e.map(e=>` ${t[e](n)}`).join(""),N=({section:e},{groups:t,hints:n},{entityType:i,purpose:s,recipeGroup:a})=>{let p=t.filter(({dryRuns:e})=>!e).map(({groupId:e})=>e);return 0===t.length?{}:{[e]:{type:new o(new r(new o(a))),description:`The recipe groups for ${s} this ${i}: ${t.map(({groupId:e})=>e).join(", ")}. A group is listed only while the configurator offers it on the entity.${p.length>0?` Recipes of these groups cannot be dry-run: ${p.join(", ")}.`:""}${I(n,k,i)}`}}},A=({entityType:e,childRecipes:n,replaceRecipes:i,optionsEdges:s,screenshots:p},{recipeGroup:c,fieldOption:d,screenshot:l})=>new a({name:`${e}Meta`,fields:Object.assign(N(b,n,{entityType:e,purpose:"adding children to",recipeGroup:c}),N(v,i,{entityType:e,purpose:"replacing",recipeGroup:c}),...s.map(({options:{edgeName:t,field:n,validate:i,dryRuns:s},hints:a})=>({[t]:{type:new r(new o(d)),description:`Values "${n}" accepts on this ${e}. Null when there is no choice to make.${i?"":" Not checked on write."}${s?"":" Cannot be dry-run."}${I(a,T,e)}`}})),0===p.length?{}:{screenshot:{type:l,args:{view:{type:new o(new t({name:`${e}ScreenshotView`,values:Object.fromEntries(p.map(({view:e,description:t})=>[e,{description:t}]))}))}},description:"Renders this entity from a predefined view. The picture follows the tool result as an image labelled with `image`. Each one costs tokens and blocks the user's configurator while it renders: ask only when seeing the design answers something the data cannot. The images of one call share a size budget; past it, further screenshots come back null. Null as well when the view does not apply to this entity right now."}})}),S=e=>Object.entries(e).map(([e,t])=>`${e} (${t.map(({groupId:e})=>e).join(", ")})`);export const buildAssistantManifest=t=>{var O,k,T,I,N;let M,D,F,W,{entityTypes:x,aliases:C,exampleType:q,fields:G,states:U,deletableTypes:K,writableTypes:V,actionFields:z,optionsEdges:P}=t,L=Object.fromEntries(Object.entries(t.childRecipes).map(([e,t])=>[e,t.groups])),Q=Object.fromEntries(Object.entries(t.replaceRecipes).map(([e,t])=>[e,t.groups])),B=new Map,H=new Map,J=new Map,X=e=>{let[t,...n]=Object.entries(C).find(([t])=>t===e)?.[1]??[];return(t&&0===n.length?H.get(t):void 0)??J.get(e)??Z},Y=e=>H.get(e)??X(e),Z=new s({name:m,description:"Every entity of the configuration.",fields:()=>E(G[m]??[],Y,q)});for(let e of(J.set(m,Z),Object.keys(C)))e!==m&&J.set(e,new s({name:e,interfaces:[Z],fields:()=>E(G[e]??[],Y)}));let _={};for(let e of x){let t=[m,...Object.entries(C).filter(([t,n])=>t!==m&&n.includes(e)).map(([e])=>e)],n=G[e]??[];_[e]=R(n),H.set(e,new a({name:e,interfaces:t.flatMap(e=>J.get(e)??[]),fields:()=>{let t=B.get(e);return{...E(n,Y),...t?{meta:{type:new o(t),description:"What can be done to this entity right now."}}:{}}}}))}let ee=(O=()=>X(J.has(f)?f:m),k=()=>X(m),M=new a({name:"DryRunError",description:"One reason a change cannot be made right now.",fields:{type:{type:new o(c),description:"Kind of the problem."},entityId:{type:n,description:"The entity the problem is on, when it is on one."},message:{type:c,description:"The problem as the user would be told it."}}}),new a({name:"DryRun",description:"What using a recipe or writing an option would do, tried out on the configuration the query reads. Nothing is changed.",fields:()=>({ok:{type:new o(e),description:"Whether the change would succeed on the configuration the query reads."},root:{type:O(),description:"The root entity of the configuration as it would be after the change; null when ok is false. Everything selected under it reads that configuration."},changedEntities:{type:new o(new r(new o(k()))),description:"Entities the change would add or modify; empty when ok is false. One whose id is not in the configuration would be added, and its real id may differ. An entity written to is listed even when its values stay the same."},deletedEntityIds:{type:new o(new r(new o(n))),description:"The ids of the entities the change would remove; empty when ok is false."},sideEffects:{type:new o(new r(new o(c))),description:"The major or unexpected things the configurator would change along with it; empty when ok is false."},errors:{type:new o(new r(new o(M))),description:"Why the change cannot be made; empty when ok is true."}})})),et={recipeGroup:(T=[...Object.keys(L).length>0?[b.mutation]:[],...Object.keys(Q).length>0?[v.mutation]:[]],D=T.join(" or "),F=new a({name:"Recipe",description:`${T.includes("addChild")?"One thing that can be added to the entity (under childRecipes)":"One thing the entity can be replaced with (under replaceRecipes)"}${T.length>1?" or that it can be replaced with (under replaceRecipes)":""}.`,fields:{key:{type:new o(c),description:`Pass to ${D} as recipeKey. Valid only for the listing it came from.`},name:{type:new o(c),description:"Name shown to the user."},description:{type:c},imageUrl:{type:c,description:"Thumbnail shown to the user."},dryRun:{type:ee,description:"What using this recipe would do. Null when it cannot be tried."}}}),new a({name:"RecipeGroup",description:"A group of recipes for this entity.",fields:{groupId:{type:new o(c),description:`Pass to ${D} as recipeGroupId.`},name:{type:new o(c),description:"Name shown to the user."},description:{type:c},recipes:{type:new o(new r(new o(F)))}}})),fieldOption:new a({name:"FieldOption",description:"One value a field accepts. Writing a value outside the list is rejected unless the field description says it is not checked.",fields:{value:{type:new o(h),description:"The value to write to the field."},name:{type:c,description:"Name shown to the user."},description:{type:c},imageUrl:{type:c,description:"Image shown to the user."},color:{type:c,description:'Color shown to the user, as "#rrggbb".'},dryRun:{type:ee,description:"What writing this value would do. Null when it cannot be tried."}}}),screenshot:new a({name:"Screenshot",description:"A screenshot of an entity. The picture itself follows the tool result.",fields:{image:{type:new o(n),description:"Label of the image that follows the tool result."}}})};for(let e of x){let n=j(t.childRecipes,e)??{groups:[],hints:[]},i=j(t.replaceRecipes,e)??{groups:[],hints:[]},s=j(P,e)??[],r=j(t.screenshots,e)??[];(n.groups.length>0||i.groups.length>0||s.length>0||r.length>0)&&B.set(e,A({entityType:e,childRecipes:n,replaceRecipes:i,optionsEdges:s.map(t=>({...t,hints:(C[f]??[]).includes(e)?t.hints.filter(e=>"sameForAllInstances"!==e):t.hints})),screenshots:r},et))}let en=new p({query:(I=X(J.has(f)?f:m),N=X(m),W=(e=>{let t={};for(let[n,i,s]of g){let r=e[s];r.length>1&&(t[n]={type:new o(c),description:$(i,r)})}if(0!==Object.keys(t).length)return new a({name:"Navigation",description:"The active UI states of the configurator.",fields:t})})(U),new a({name:"Query",fields:{root:{type:new o(I),description:"The root entity of the configuration."},entities:{type:new o(new r(N)),args:{ids:{type:new r(new o(n))}},description:"Every entity, or the given ids in order with null for an unknown id."},selectedEntity:{type:new o(N),description:"The selected entity, or the root entity when nothing is selected."},...W?{navigation:{type:new o(W)}}:{}}})),mutation:(({deletableTypes:e,writableTypes:t,childRecipes:s,replaceRecipes:p,actionFields:d,objectTypes:l,anyDomainEntity:h,targetOutputType:y})=>{let u,m;if(0!==e.length||0!==t.length||0!==Object.keys(s).length||0!==Object.keys(p).length||0!==d.length)return new a({name:"Mutation",fields:Object.assign(0===e.length?{}:{deleteEntity:{type:new o(new r(new o(n))),args:{id:{type:new o(n)}},description:`Deletes the entity and everything composed into it. Deletable types: ${e.join(", ")}. Returns the ids removed, the given one first.`}},0===(u=S(s)).length?{}:{addChild:{type:new o(new r(new o(h))),args:{parentId:{type:new o(n)},recipeGroupId:{type:new o(c)},recipeKey:{type:new o(c)}},description:`Adds a child to the entity parentId from a recipe listed under its meta { childRecipes }. Types with child recipes: ${u.join("; ")}. Returns the entities added, the recipe's own first; empty when they were removed again.`}},0===(m=S(p)).length?{}:{replaceEntity:{type:new o(new r(new o(h))),args:{entityId:{type:new o(n)},recipeGroupId:{type:new o(c)},recipeKey:{type:new o(c)}},description:`Replaces the entity entityId from a recipe listed under its meta { replaceRecipes }. Types with replace recipes: ${m.join("; ")}. The replacement is a new entity: it has a new id and the field values of its recipe, and entityId no longer exists. Returns the entities added, the replacement first; empty when they were removed again.`}},...t.flatMap(e=>{let t=l.get(e.entityType);return t?[(({entityType:e,fields:t},s)=>{let r=Object.fromEntries(t.map(({name:e,type:t,description:n})=>[e,{type:w(t),description:n}]));return{[`modify${e}`]:{type:s,args:{id:{type:new o(n)},delta:{type:new o(new i({name:`${e}Delta`,fields:r}))}},description:`Sets the fields named in delta on one ${e}. Returns the entity after the change, or null when the change removed it.`}}})(e,t)]:[]}),Object.fromEntries(d.map(e=>{var t;return[e.fieldName,{type:new o(new a({name:(t=e.fieldName,`${t.charAt(0).toUpperCase()+t.slice(1)}Result`),description:`What ${e.fieldName} returns, read from the configuration after the change.`,fields:()=>Object.fromEntries(Object.entries(e.result).map(([e,t])=>[e,{type:"edge"===t.kind?(({target:e,list:t,nullable:n},i)=>{let s=t?new r(new o(i(e))):i(e);return n?s:new o(s)})(t,y):w(t.type),description:t.description}]))})),args:Object.fromEntries(Object.entries(e.args).map(([e,t])=>[e,{type:w(t.type),description:t.description}])),description:e.description}]})))})})({deletableTypes:K,writableTypes:V,childRecipes:L,replaceRecipes:Q,actionFields:z,objectTypes:H,anyDomainEntity:X(m),targetOutputType:Y}),types:[...J.values(),...H.values()]}),ei=l(en);if(ei.length>0)throw Error(ei.map(e=>e.message).join(" "));let es=d(en);return{sdl:es,navigationFields:g.filter(([,,e])=>U[e].length>1).map(([e])=>e),fields:_,deletableTypes:K,writableFields:Object.fromEntries(V.map(({entityType:e,fields:t})=>[e,Object.fromEntries(t.map(({name:e,property:t})=>[e,t]))])),childRecipes:L,replaceRecipes:Q,fieldOptions:Object.fromEntries(x.flatMap(e=>{let t=j(P,e);return t?[[e,t.map(({options:e})=>e)]]:[]})),screenshots:Object.fromEntries(x.flatMap(e=>{let n=j(t.screenshots,e);return n?[[e,n]]:[]})),actions:Object.fromEntries(z.map(({fieldName:e,actionName:t})=>[e,t])),lenses:y(t,u(es)),formElements:t.formElements}};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The shape of a form element's tag, and of its attributes' names: the panel reads form markup
3
+ * with lowercase tag and attribute names, so a name with an upper-case letter would never match.
4
+ */
5
+ export declare const ASSISTANT_FORM_NAME_PATTERN: RegExp;
6
+ /**
7
+ * Whether a tag is an HTML element name, which no form element may take, so that markup in a form
8
+ * is never mistaken for HTML. The spec rejects a project's element by it and the panel's registry
9
+ * refuses one, so both read the same list.
10
+ */
11
+ export declare const isHtmlElementName: (name: string) => boolean;
@@ -0,0 +1,8 @@
1
+ let e=new Set(`a abbr acronym address applet area article aside audio b base basefont bdi bdo big blink blockquote body br
2
+ button canvas caption center cite code col colgroup data datalist dd del details dfn dialog dir div dl dt em
3
+ embed fieldset figcaption figure font footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html
4
+ i iframe image img input ins kbd keygen label legend li link main map mark marquee math menu menuitem meta
5
+ meter nav nobr noembed noframes noscript object ol optgroup option output p param picture plaintext pre
6
+ progress q rb rp rt rtc ruby s samp script search section select slot small source span strike strong style
7
+ sub summary sup svg table tbody td template textarea tfoot th thead time title tr track tt u ul var video wbr
8
+ xmp`.split(/\s+/));export const ASSISTANT_FORM_NAME_PATTERN=/^[a-z][a-z0-9-]*$/;export const isHtmlElementName=t=>e.has(t);
@@ -0,0 +1,174 @@
1
+ /**
2
+ * What an element of an assistant form collects: a `group` all its children, a `choice` exactly one
3
+ * of its options, a `choices` any number of them; an `option` is something to pick and an `input` a
4
+ * free value.
5
+ */
6
+ export type AssistantFormRole = 'group' | 'choice' | 'choices' | 'option' | 'input';
7
+ /** The type an attribute of a form element is validated and coerced to; the model writes every attribute as a string. */
8
+ export interface AssistantFormAttribute {
9
+ readonly type: 'string' | 'number' | 'integer' | 'boolean';
10
+ /** The words a string, or the numbers a number, may be; a number's are written as text in the markup. */
11
+ readonly enum?: readonly (string | number)[];
12
+ /** A JSON Schema `pattern` a string attribute must match, such as a resource path or a `#rrggbb` color. */
13
+ readonly pattern?: string;
14
+ /** The bounds a number attribute must be within, as in JSON Schema. */
15
+ readonly minimum?: number;
16
+ readonly maximum?: number;
17
+ /** The bounds of a string attribute's length, as in JSON Schema. */
18
+ readonly minLength?: number;
19
+ readonly maxLength?: number;
20
+ }
21
+ /**
22
+ * An element the assistant can write inside a ```` ```form ```` fence of its reply to ask the user
23
+ * something. The panel renders it, and the SDK prompt lists it, so the model and the panel agree on
24
+ * one set of elements: the built-ins below, followed by the project's own, which its YAML declares
25
+ * under `assistant.formElements` with the fields up to `required`.
26
+ */
27
+ export interface AssistantFormElementDescriptor {
28
+ /** The tag: lowercase, and never the name of an HTML element. */
29
+ readonly name: string;
30
+ readonly role: AssistantFormRole;
31
+ /** What the element is for, printed in the prompt after its signature. */
32
+ readonly description: string;
33
+ /**
34
+ * Attributes beyond the built-in `label`, in the order the prompt lists them. An option or an
35
+ * input that takes a `value` declares it like any other: by convention an option answers with
36
+ * it instead of its label, and an input starts with it.
37
+ */
38
+ readonly attributes: Readonly<Record<string, AssistantFormAttribute>>;
39
+ readonly required?: readonly string[];
40
+ /**
41
+ * An input the user answers with one action, such as a `confirm`: a form whose only question it
42
+ * is sends on that action, without a submit button, as a lone `choice` sends on the first pick.
43
+ */
44
+ readonly quick?: true;
45
+ /**
46
+ * The attributes an option can answer with besides `label`, in the order its component tries
47
+ * them. An option that declares them and has none of them, nor `label`, makes its form fail.
48
+ */
49
+ readonly identity?: readonly string[];
50
+ }
51
+ /** What an attribute's declaration makes of its value: one of its words, a string, a number or a boolean. */
52
+ export type AssistantFormAttributeValue<ATTRIBUTE extends AssistantFormAttribute> = ATTRIBUTE extends {
53
+ readonly enum: readonly (infer WORD)[];
54
+ } ? WORD : ATTRIBUTE['type'] extends 'string' ? string : ATTRIBUTE['type'] extends 'boolean' ? boolean : number;
55
+ type RequiredAttributeName<DESCRIPTOR> = DESCRIPTOR extends {
56
+ readonly required: readonly (infer NAME)[];
57
+ } ? NAME : never;
58
+ /**
59
+ * The attributes a form element's component gets, typed from its descriptor: the declared ones,
60
+ * optional unless `required`. The form validates the markup against the same descriptor, so the
61
+ * component can rely on these types.
62
+ */
63
+ export type AssistantFormElementAttributes<DESCRIPTOR extends AssistantFormElementDescriptor> = {
64
+ readonly [NAME in keyof DESCRIPTOR['attributes'] as NAME extends RequiredAttributeName<DESCRIPTOR> ? NAME : never]: AssistantFormAttributeValue<DESCRIPTOR['attributes'][NAME]>;
65
+ } & {
66
+ readonly [NAME in keyof DESCRIPTOR['attributes'] as NAME extends RequiredAttributeName<DESCRIPTOR> ? never : NAME]?: AssistantFormAttributeValue<DESCRIPTOR['attributes'][NAME]>;
67
+ };
68
+ /** The elements every assistant form understands, in the order the prompt lists them. */
69
+ export declare const ASSISTANT_BUILT_IN_FORM_ELEMENTS: readonly [{
70
+ readonly name: 'group';
71
+ readonly role: 'group';
72
+ readonly description: 'Puts related questions together under its label.';
73
+ readonly attributes: {};
74
+ }, {
75
+ readonly name: 'choice';
76
+ readonly role: 'choice';
77
+ readonly description: 'The user picks exactly one of its options.';
78
+ readonly attributes: {};
79
+ }, {
80
+ readonly name: 'choices';
81
+ readonly role: 'choices';
82
+ readonly description: 'The user picks any number of its options.';
83
+ readonly attributes: {};
84
+ }, {
85
+ readonly name: 'reply';
86
+ readonly role: 'option';
87
+ readonly description: 'A short answer shown as a button.';
88
+ readonly attributes: {
89
+ readonly value: {
90
+ readonly type: 'string';
91
+ };
92
+ };
93
+ }, {
94
+ readonly name: 'card';
95
+ readonly role: 'option';
96
+ readonly description: 'A tile with an optional picture over its label and a one-line `description`. `image` is a path you read on an `imageUrl` field. Without `value` or `label` it sends its `description`, or else its `image`.';
97
+ readonly attributes: {
98
+ readonly value: {
99
+ readonly type: 'string';
100
+ };
101
+ readonly description: {
102
+ readonly type: 'string';
103
+ };
104
+ readonly image: {
105
+ readonly type: 'string';
106
+ readonly pattern: string;
107
+ };
108
+ };
109
+ readonly identity: readonly ["value", "description", "image"];
110
+ }, {
111
+ readonly name: 'swatch';
112
+ readonly role: 'option';
113
+ readonly description: 'A small tile of a color or a material, without text: its label shows on hover. `color` is `#rrggbb`, as on the `color` field of an option, and `image` a path you read on an `imageUrl` field. Without `value` or `label` it sends its `color`, or else its `image`.';
114
+ readonly attributes: {
115
+ readonly value: {
116
+ readonly type: 'string';
117
+ };
118
+ readonly color: {
119
+ readonly type: 'string';
120
+ readonly pattern: '^#[0-9a-fA-F]{6}$';
121
+ };
122
+ readonly image: {
123
+ readonly type: 'string';
124
+ readonly pattern: string;
125
+ };
126
+ };
127
+ readonly identity: readonly ["value", "color", "image"];
128
+ }, {
129
+ readonly name: 'text';
130
+ readonly role: 'input';
131
+ readonly description: 'A single line the user types.';
132
+ readonly attributes: {
133
+ readonly value: {
134
+ readonly type: 'string';
135
+ };
136
+ readonly placeholder: {
137
+ readonly type: 'string';
138
+ };
139
+ };
140
+ }, {
141
+ readonly name: 'number';
142
+ readonly role: 'input';
143
+ readonly description: 'A number the user types, with a slider when both `min` and `max` are given. The answer carries the `unit`, as in `Length: 240 cm`.';
144
+ readonly attributes: {
145
+ readonly value: {
146
+ readonly type: 'number';
147
+ };
148
+ readonly min: {
149
+ readonly type: 'number';
150
+ };
151
+ readonly max: {
152
+ readonly type: 'number';
153
+ };
154
+ readonly step: {
155
+ readonly type: 'number';
156
+ };
157
+ readonly unit: {
158
+ readonly type: 'string';
159
+ };
160
+ };
161
+ }, {
162
+ readonly name: 'confirm';
163
+ readonly role: 'input';
164
+ readonly description: "A yes or no question, shown as two buttons. It answers with the user's own words for yes and no, such as `Yes` or `Ano`, and alone in a form it sends on the click.";
165
+ readonly attributes: {};
166
+ readonly quick: true;
167
+ }];
168
+ /** The name of a built-in form element. */
169
+ export type AssistantBuiltInFormElementName = (typeof ASSISTANT_BUILT_IN_FORM_ELEMENTS)[number]['name'];
170
+ /** The attributes the component of a built-in form element gets, typed from its descriptor. */
171
+ export type AssistantBuiltInFormElementAttributes<NAME extends AssistantBuiltInFormElementName> = AssistantFormElementAttributes<Extract<(typeof ASSISTANT_BUILT_IN_FORM_ELEMENTS)[number], {
172
+ readonly name: NAME;
173
+ }>>;
174
+ export {};
@@ -0,0 +1 @@
1
+ import{ASSISTANT_RESOURCE_PATH_PATTERN as e}from"./assistant-resource-path.js";export const ASSISTANT_BUILT_IN_FORM_ELEMENTS=[{name:"group",role:"group",description:"Puts related questions together under its label.",attributes:{}},{name:"choice",role:"choice",description:"The user picks exactly one of its options.",attributes:{}},{name:"choices",role:"choices",description:"The user picks any number of its options.",attributes:{}},{name:"reply",role:"option",description:"A short answer shown as a button.",attributes:{value:{type:"string"}}},{name:"card",role:"option",description:"A tile with an optional picture over its label and a one-line `description`. `image` is a path you read on an `imageUrl` field. Without `value` or `label` it sends its `description`, or else its `image`.",attributes:{value:{type:"string"},description:{type:"string"},image:{type:"string",pattern:e}},identity:["value","description","image"]},{name:"swatch",role:"option",description:"A small tile of a color or a material, without text: its label shows on hover. `color` is `#rrggbb`, as on the `color` field of an option, and `image` a path you read on an `imageUrl` field. Without `value` or `label` it sends its `color`, or else its `image`.",attributes:{value:{type:"string"},color:{type:"string",pattern:"^#[0-9a-fA-F]{6}$"},image:{type:"string",pattern:e}},identity:["value","color","image"]},{name:"text",role:"input",description:"A single line the user types.",attributes:{value:{type:"string"},placeholder:{type:"string"}}},{name:"number",role:"input",description:"A number the user types, with a slider when both `min` and `max` are given. The answer carries the `unit`, as in `Length: 240 cm`.",attributes:{value:{type:"number"},min:{type:"number"},max:{type:"number"},step:{type:"number"},unit:{type:"string"}}},{name:"confirm",role:"input",description:"A yes or no question, shown as two buttons. It answers with the user's own words for yes and no, such as `Yes` or `Ano`, and alone in a form it sends on the click.",attributes:{},quick:!0}];
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A path into the project's resources, the kind stored on `imageUrl` fields: no scheme and no host,
3
+ * so resolving it never leaves the resources origin. A backslash, a control character or leading
4
+ * whitespace is refused too, because the URL parser reads a backslash as a slash and strips the
5
+ * others, which would turn `\\host` or ` //host` into an address on another host.
6
+ *
7
+ * Written as a JSON Schema `pattern`, so the `image` attribute of a form element applies the same
8
+ * rule as the images of a reply.
9
+ */
10
+ export declare const ASSISTANT_RESOURCE_PATH_PATTERN: string;
@@ -0,0 +1 @@
1
+ export const ASSISTANT_RESOURCE_PATH_PATTERN=String.raw`^(?![a-zA-Z][a-zA-Z0-9+.-]*:)(?!//)[^\s\\\x00-\x1f][^\\\x00-\x1f]*$`;
@@ -0,0 +1,4 @@
1
+ export { ASSISTANT_FORM_NAME_PATTERN, isHtmlElementName } from './assistant-form-element-name.js';
2
+ export { ASSISTANT_BUILT_IN_FORM_ELEMENTS } from './assistant-form-elements.js';
3
+ export type { AssistantBuiltInFormElementAttributes, AssistantBuiltInFormElementName, AssistantFormAttribute, AssistantFormAttributeValue, AssistantFormElementAttributes, AssistantFormElementDescriptor, AssistantFormRole, } from './assistant-form-elements.js';
4
+ export { ASSISTANT_RESOURCE_PATH_PATTERN } from './assistant-resource-path.js';
@@ -0,0 +1 @@
1
+ export{ASSISTANT_FORM_NAME_PATTERN,isHtmlElementName}from"./assistant-form-element-name.js";export{ASSISTANT_BUILT_IN_FORM_ELEMENTS}from"./assistant-form-elements.js";export{ASSISTANT_RESOURCE_PATH_PATTERN}from"./assistant-resource-path.js";
@@ -1,3 +1,6 @@
1
1
  import type { AssistantManifest } from './assistant-manifest.js';
2
+ import { type AssistantFormElementDescriptor } from './form/index.js';
3
+ /** How the prompt writes an element: its tag with each attribute and what it takes. Exported for tests. */
4
+ export declare const formElementSignature: ({ name, role, attributes }: AssistantFormElementDescriptor) => string;
2
5
  /** SDK-version conventions for using the manifest's capabilities and reading their results. */
3
6
  export declare const generateAssistantPrompt: (assistant: AssistantManifest) => string;
@@ -1 +1 @@
1
- import{ASSISTANT_BUILT_IN_FORM_ELEMENTS as e}from"./assistant-form-elements.js";let t=[["Containers",["group","choice","choices"]],["Options",["option"]],["Inputs",["input"]]];export const generateAssistantPrompt=a=>{let n=Object.values(a.childRecipes??{}).some(e=>e.length>0),s=Object.values(a.replaceRecipes??{}).some(e=>e.length>0),i=Object.values(a.fieldOptions??{}).some(e=>e.length>0),o=Object.keys(a.actions??{}).length>0,r=(a.deletableTypes?.length??0)>0||Object.values(a.writableFields??{}).some(e=>Object.keys(e).length>0)||n||s||o,h=n||s||i,l=[...n?["`childRecipes` is what can be added to it"]:[],...s?["`replaceRecipes` what it can be replaced with"]:[],...i?["`<field>Options` the values a field accepts"]:[]],d=["`selected`",...(a.navigationFields??[]).map(e=>`\`${e}\``)].join(", ");return[["Tools","- Put related operations in one call and select only the fields you need.",...r?[`- Use a mutation inside \`query\` to answer a what-if about a change ${h?"the lists under `meta` do not show":"before making it"}.`,"- Use `apply` only for what the user asked for."]:["- Nothing in this configurator can be changed through you. Say so when the user asks for a change."],"- When an operation fails, its `errors` say why and what to send instead."],...r?[["After a change","- A change is made only when the `apply` result has `committed: true`. Otherwise `errors` or `message` says what happened; without either, nothing changed. Never say a change was made when it was not.","- `sideEffects` names the major or unexpected things the configurator changed along with your change. Tell the user about them when committed; otherwise they describe what would happen. Smaller adjustments are not listed.","- A mutation returns the state after the change: use the ids and values it returned, not the ones you sent.",...o?["- When one mutation does the whole of what the user asked, use it instead of building the same change from several others."]:[]]]:[],...h?[["What can be done to an entity",`- \`meta\` lists what is possible right now: ${l.join(", ")}. Read the list before such a change and before telling the user what is available.`,`- You can select \`dryRun\` on ${[...n||s?["recipes"]:[],...i?["options"]:[]].join(" or ")} to look ahead and pick one that meets what the user asked for. It is optional before a change.`,"- Read the lists again after a change, unless their descriptions say they stay the same."]]:[],["The `[changes]` block","- Every user message starts with it: a glimpse of what the user did in the configurator since your last turn.",`- \`[changes: none]\`, or only ${d} lines: what you know still holds. Do not query it again.`,"- Other lines are a hint at what to read again: `A` added, `D` deleted, `M` modified with the fields. Text after `#` says what caused the line; `reset: undo/redo` says the user undid or redid changes.","- Read computed fields again when a listed change may affect them.","- `[changes: unavailable]` and `[changes: too many (n)]`: read again before relying on anything you read earlier.",...r?["- Your applied changes are not listed, except those waiting for user approval: they appear once approved."]:[]],["Reading the schema","- Take ids from results.",...(a.deletableTypes?.length??0)>0||s?["- The id of a deleted or replaced entity is gone and may later be given to another entity."]:[],`- A field whose name starts with \`_\` is computed: read it${r?", never write it":""}.`,"- Numbers are in the unit the field description names. Convert when the user uses another unit."],["Links","- You may link an entity of the current configuration when you speak about that very entity: `[the left burner](entity:CookingTop-1)`. It helps the user find it in the configurator.",...h?["- Whenever you name recipes or options you read from `meta`, in a list, a table or a sentence, link each one: `[Single gas burner](recipe:KitchenRange-1/top/gas_single)` or `[Oak](option:Cabinet-2/finishOptions/oak)`. The link shows the user its picture or color and its description, so never draw previews yourself. The target is the entity id, the recipe group id or the options field you read, and the key or value, each encoded as in a URL."]:[]],["Replies","- Write Markdown only, never HTML: the panel does not render it.","- An image, `![alt](path)`, is shown only when its path is relative."],["Forms","- To ask the user something they answer by picking or typing, end your reply with a form: a fenced code block with the language `form`. It holds only elements, written as lowercase tags with string attributes, without Markdown or text.","- Every element takes `label`, the text the user sees; on a container or an input it also names the answer. Options and inputs take `value`: an option sends it instead of its label, and an input starts with it.","- Options can also stand on their own, outside a `choice` or `choices`.","- An element or attribute not listed here, or an element other than an option inside a `choice` or `choices`, makes the whole form fail.","- The answer is the user's next message. Each container or input gives a line `Label: value`, or the bare value without a label; the lines of a labelled container are indented by two spaces under it, a `choices` lists each picked option on its own line, and `—` marks what was left unanswered.",'- Example: `<choice label="Plinth"><reply label="Black" /><reply label="Oak" /></choice>` is answered with `Plinth: Oak`.',"- The chat shows the answer as the user's own message, so a `value` reads as natural words, never as an id, key or code. Give `value` only when the label alone would be unclear as an answer, and map the answer's labels back to ids yourself.",...t.flatMap(([t,a])=>{let n=e.filter(({role:e})=>a.includes(e));return 0===n.length?[]:[`- ${t}:`,...n.map(e=>` - \`${(({name:e,role:t,attributes:a})=>{let n=["label",..."option"===t||"input"===t?["value"]:[],...Object.keys(a)];return"option"===t||"input"===t?`<${e} ${n.join(" ")} />`:`<${e} ${n.join(" ")}>…</${e}>`})(e)}\`: ${e.description}`)]})],...a.lenses?.declarations?[["Built-in fragments","- These fragments are already defined for every operation. Spread one by name on a field of its type, as in `field { ...FragmentName }`, instead of listing its fields.","- A fragment is a starting selection: add the other fields you need next to the spread, by name from the schema.","- Never define a fragment with one of these names.","",a.lenses.declarations]]:[]].map(e=>e.join("\n")).join("\n\n")};
1
+ import{ASSISTANT_BUILT_IN_FORM_ELEMENTS as e}from"./form/index.js";let t=[["Containers",["group","choice","choices"]],["Options",["option"]],["Inputs",["input"]]];export const formElementSignature=({name:e,role:t,attributes:a})=>{let n=["label",...Object.entries(a).map(([e,t])=>((e,{type:t,enum:a})=>a?`${e}="${a.join("|")}"`:"string"===t?e:`${e}="<${t}>"`)(e,t))];return"option"===t||"input"===t?`<${e} ${n.join(" ")} />`:`<${e} ${n.join(" ")}>…</${e}>`};export const generateAssistantPrompt=a=>{let n,s=Object.values(a.childRecipes??{}).some(e=>e.length>0),i=Object.values(a.replaceRecipes??{}).some(e=>e.length>0),o=Object.values(a.fieldOptions??{}).some(e=>e.length>0),r=Object.keys(a.actions??{}).length>0,h=(a.deletableTypes?.length??0)>0||Object.values(a.writableFields??{}).some(e=>Object.keys(e).length>0)||s||i||r,l=s||i||o,d=[...s?["`childRecipes` is what can be added to it"]:[],...i?["`replaceRecipes` what it can be replaced with"]:[],...o?["`<field>Options` the values a field accepts"]:[]],c=["`selected`",...(a.navigationFields??[]).map(e=>`\`${e}\``)].join(", ");return[["Tools","- Put related operations in one call and select only the fields you need.",...h?[`- Use a mutation inside \`query\` to answer a what-if about a change ${l?"the lists under `meta` do not show":"before making it"}.`,"- Use `apply` only for what the user asked for."]:["- Nothing in this configurator can be changed through you. Say so when the user asks for a change."],"- When an operation fails, its `errors` say why and what to send instead."],...h?[["After a change","- A change is made only when the `apply` result has `committed: true`. Otherwise `errors` or `message` says what happened; without either, nothing changed. Never say a change was made when it was not.","- `sideEffects` names the major or unexpected things the configurator changed along with your change. Tell the user about them when committed; otherwise they describe what would happen. Smaller adjustments are not listed.","- A mutation returns the state after the change: use the ids and values it returned, not the ones you sent.",...r?["- When one mutation does the whole of what the user asked, use it instead of building the same change from several others."]:[]]]:[],...l?[["What can be done to an entity",`- \`meta\` lists what is possible right now: ${d.join(", ")}. Read the list before such a change and before telling the user what is available.`,`- You can select \`dryRun\` on ${[...s||i?["recipes"]:[],...o?["options"]:[]].join(" or ")} to look ahead and pick one that meets what the user asked for. It is optional before a change.`,"- Read the lists again after a change, unless their descriptions say they stay the same."]]:[],["The `[changes]` block","- Every user message starts with it: a glimpse of what the user did in the configurator since your last turn.",`- \`[changes: none]\`, or only ${c} lines: what you know still holds. Do not query it again.`,"- Other lines are a hint at what to read again: `A` added, `D` deleted, `M` modified with the fields. Text after `#` says what caused the line; `reset: undo/redo` says the user undid or redid changes.","- Read computed fields again when a listed change may affect them.","- `[changes: unavailable]` and `[changes: too many (n)]`: read again before relying on anything you read earlier.",...h?["- Your applied changes are not listed, except those waiting for user approval: they appear once approved."]:[]],["Reading the schema","- Take ids from results.",...(a.deletableTypes?.length??0)>0||i?["- The id of a deleted or replaced entity is gone and may later be given to another entity."]:[],`- A field whose name starts with \`_\` is computed: read it${h?", never write it":""}.`,"- Numbers are in the unit the field description names. Convert when the user uses another unit."],["Links","- You may link an entity of the current configuration when you speak about that very entity: `[the left burner](entity:CookingTop-1)`. It helps the user find it in the configurator.",...l?["- Whenever you name recipes or options you read from `meta`, in a list, a table or a sentence, link each one: `[Single gas burner](recipe:KitchenRange-1/top/gas_single)` or `[Oak](option:Cabinet-2/finishOptions/oak)`. The link shows the user its picture or color and its description, so never draw previews yourself. The target is the entity id, the recipe group id or the options field you read, and the key or value, each encoded as in a URL."]:[]],["Replies","- Write Markdown only, never HTML: the panel does not render it.","- An image, `![alt](path)`, is shown only when its path is relative.","- To make a warning or a key note stand out, write a GitHub alert: a blockquote whose first line is only `[!WARNING]` or `[!NOTE]`. Use it sparingly."],["Forms","- To ask the user something they answer by picking or typing, end your reply with a form: a fenced code block with the language `form`. It holds only elements, written as lowercase tags with string attributes, without Markdown or text.","- Every element takes `label`, the text the user sees; on a container or an input it also names the answer. An option or an input whose signature lists `value` takes it: an option sends it instead of its label, and an input starts with it.",'- A bare attribute in a signature takes any text, `name="<type>"` takes a value of that type written as text, such as `min="<number>"`, and `name="a|b"` takes one of the words listed.',"- Options can also stand on their own, outside a `choice` or `choices`.","- An element or attribute not listed here, or an element other than an option inside a `choice` or `choices`, makes the whole form fail.","- The answer is the user's next message. Each container or input gives a line `Label: value`, or the bare value without a label; the lines of a labelled container are indented by two spaces under it, a `choices` lists each picked option on its own line, and `—` marks what was left unanswered.",'- Example: `<choice label="Plinth"><reply label="Black" /><reply label="Oak" /></choice>` is answered with `Plinth: Oak`.',"- The chat shows the answer as the user's own message, so a `value` reads as natural words, never as an id, key or code. Give `value` only when the label alone would be unclear as an answer, and map the answer's labels back to ids yourself.",...(n=[...e,...a.formElements??[]],t.flatMap(([e,t])=>{let a=n.filter(({role:e})=>t.includes(e));return 0===a.length?[]:[`- ${e}:`,...a.map(e=>` - \`${formElementSignature(e)}\`: ${(({description:e,required:t=[]})=>0===t.length?e:`${e} Requires ${t.map(e=>`\`${e}\``).join(", ")}.`)(e)}`)]}))],...a.lenses?.declarations?[["Built-in fragments","- These fragments are already defined for every operation. Spread one by name on a field of its type, as in `field { ...FragmentName }`, instead of listing its fields.","- A fragment is a starting selection: add the other fields you need next to the spread, by name from the schema.","- Never define a fragment with one of these names.","",a.lenses.declarations]]:[]].map(e=>e.join("\n")).join("\n\n")};
@@ -3,9 +3,8 @@ export type { AssistantResolvedManifest, AssistantDeclaredField, AssistantDeclar
3
3
  export { buildAssistantManifest } from './build-assistant-manifest.js';
4
4
  export type { AssistantFieldExposure } from './create-assistant-execution-schema.js';
5
5
  export { AssistantFieldClashError, createAssistantExecutionSchema } from './create-assistant-execution-schema.js';
6
- export type { AssistantFieldSource, AssistantRecipeGroup, AssistantFieldOptions, AssistantManifest, } from './assistant-manifest.js';
6
+ export type { AssistantFieldSource, AssistantRecipeGroup, AssistantFieldOptions, AssistantScreenshotView, AssistantManifest, } from './assistant-manifest.js';
7
7
  export { generateAssistantPrompt } from './generate-assistant-prompt.js';
8
8
  export * from './session-setup/index.js';
9
9
  export { describeAssistantValues, mergeAssistantFields, resolveAssistantField } from './assistant-fields.js';
10
- export { ASSISTANT_BUILT_IN_FORM_ELEMENTS } from './assistant-form-elements.js';
11
- export type { AssistantFormAttribute, AssistantFormElementDescriptor, AssistantFormRole, } from './assistant-form-elements.js';
10
+ export * from './form/index.js';
@@ -1 +1 @@
1
- export{ASSISTANT_HINTS}from"./assistant-resolved-manifest.js";export{buildAssistantManifest}from"./build-assistant-manifest.js";export{AssistantFieldClashError,createAssistantExecutionSchema}from"./create-assistant-execution-schema.js";export{generateAssistantPrompt}from"./generate-assistant-prompt.js";export*from"./session-setup/index.js";export{describeAssistantValues,mergeAssistantFields,resolveAssistantField}from"./assistant-fields.js";export{ASSISTANT_BUILT_IN_FORM_ELEMENTS}from"./assistant-form-elements.js";
1
+ export{ASSISTANT_HINTS}from"./assistant-resolved-manifest.js";export{buildAssistantManifest}from"./build-assistant-manifest.js";export{AssistantFieldClashError,createAssistantExecutionSchema}from"./create-assistant-execution-schema.js";export{generateAssistantPrompt}from"./generate-assistant-prompt.js";export*from"./session-setup/index.js";export{describeAssistantValues,mergeAssistantFields,resolveAssistantField}from"./assistant-fields.js";export*from"./form/index.js";
@@ -1 +1 @@
1
- import{ASSISTANT_AI_PROVIDERS as e,ASSISTANT_MODEL_TIERS as t,ASSISTANT_REASONING_LEVELS as i}from"@salsita-ai/contracts/assistant";import{describeAssistantValues as s,mergeAssistantFields as n,resolveAssistantField as o}from"../assistant-fields.js";import{ASSISTANT_HINTS as a}from"../assistant-resolved-manifest.js";import{projectAssistantSetupManifest as r}from"./assistant-setup-manifest.js";export class AssistantSetupError extends Error{constructor(e,t){super(`${e}: ${t}`),this.name="AssistantSetupError"}}let l=(e,t)=>{throw new AssistantSetupError(e,t)},p=(e,t,i)=>{for(let s of((null===t||"object"!=typeof t||Array.isArray(t))&&l(i,"expected an object; omit an entry to remove it"),Object.keys(t)))Object.hasOwn(e,s)||l(`${i}.${s}`,"not declared in the spec; remove this key")},d=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0,c=(e,t,i)=>(void 0!==e&&"string"!=typeof e&&l(`${i}.description`,"expected a string"),e??t),u=(e,t,i)=>(void 0!==e&&!1!==e&&l(`${i}.allowDryRuns`,"can only disable dry-runs; omit this flag or set false"),!1!==e&&t);export const applyAssistantSetup=(f,m,b)=>{if(null===b)return null;let y=r(f,m),g=f.declarations;p({entities:{},deletable:{},writable:{},childRecipes:{},replaceRecipes:{},actions:{},instructions:"",ai:{}},b,"assistant"),p(y.entities,b.entities,"assistant.entities"),p(y.deletable,b.deletable,"assistant.deletable"),p(y.writable,b.writable,"assistant.writable"),p(y.actions,b.actions,"assistant.actions");let v=Object.fromEntries(Object.entries(b.entities).map(([e,t])=>{let i=`assistant.entities.${e}`;p(y.entities[e],t,i);let n=g.entities[e];return[e,Object.entries(t).map(([e,t])=>{p({description:""},t,`${i}.${e}`);let o=n.find(t=>t.source===e),a=c(t.description,o.valueDescription,`${i}.${e}`);return{...o,valueDescription:a,description:s(a,o.enumValues),describedByManifest:void 0!==t.description||o.describedByManifest}})]})),w=(e,t,i)=>l(`assistant.entities.${e}`,`conflicting sources ${t} and ${i}`),$=n([],d(v,"AnyDomainEntity")??[],()=>void 0,w),h=new Map([["AnyDomainEntity",$]]);for(let e of Object.keys(f.aliases))"AnyDomainEntity"!==e&&h.set(e,n([$],d(v,e)??[],()=>void 0,w));for(let e of f.entityTypes){let t=Object.entries(f.aliases).filter(([t,i])=>"AnyDomainEntity"!==t&&i.includes(e));h.set(e,n([$,...t.map(([e])=>h.get(e)??[])],d(v,e)??[],t=>g.enumValues[e]?.[t],w))}let j=Object.fromEntries([...h].map(([e,t])=>[e,t.map(t=>o(t,d(v,e)??[]))])),O=new Map,x=new Map;for(let[e,t]of Object.entries(b.writable)){let i=`assistant.writable.${e}`;for(let[s,n]of(p(y.writable[e],t,i),Object.entries(t))){let t=`${i}.${s}`,o=g.writable[e][s];for(let[e,{field:i,options:a,exposedDescription:r}]of(p(Object.values(o.members).some(e=>e.options)?{options:{}}:{},n,t),void 0!==n.options&&(p({validate:!0,allowDryRuns:!1},n.options,`${t}.options`),void 0!==n.options.validate&&!0!==n.options.validate&&l(`${t}.options.validate`,"can only enable validation; omit this flag or set true"),u(n.options.allowDryRuns,!0,`${t}.options`)),Object.entries(o.members))){let p=d(v,e)?.find(e=>e.source===s)?.name??h.get(e)?.find(e=>e.source===s)?.name,c=p??s;void 0===p&&h.get(e)?.some(e=>e.name===s&&e.source!==s)&&l(t,`narrowing leaves ${e}.${s} bound to another read field; retain its original exposure or remove this writable property`);let f=O.get(e)??new Map;if([...f.values()].some(e=>e.name===c&&e.property!==s)&&l(t,`narrowing maps multiple writable properties to ${e}.${c}; retain their original exposures or remove the conflicting property`),f.has(s)||f.set(s,{...i,name:c,...void 0===p?{}:{description:r}}),O.set(e,f),a){let i=o.defaultOptionsName?`${c}Options`:a.options.edgeName;x.get(e)?.some(e=>e.options.edgeName===i||e.options.field===c)&&l(`${t}.options`,`narrowing duplicates options edge ${e}.${i}; retain the original field exposures or remove the conflicting writable declaration`),x.set(e,[...x.get(e)??[],{hints:a.hints,options:{...a.options,field:c,edgeName:i,validate:n.options?.validate??a.options.validate,dryRuns:u(n.options?.allowDryRuns,a.options.dryRuns,`${t}.options`)}}])}}}}for(let[e,t]of Object.entries(f.optionsEdges))for(let i of t){let t=f.writableTypes.find(t=>t.entityType===e)?.fields.find(e=>e.name===i.options.field)?.property;if(i.options.validate&&t&&O.get(e)?.has(t)&&!x.get(e)?.some(i=>i.options.field===O.get(e)?.get(t)?.name&&i.options.validate)){let i=Object.keys(b.writable).find(i=>Object.hasOwn(b.writable[i],t)&&g.writable[i]?.[t]?.members[e]);l(`assistant.writable.${i}.${t}`,`cannot remove declared validation while another declaration keeps ${e}.${t} writable; remove all writable declarations for it`)}}let R=e=>{p(y[e],b[e],`assistant.${e}`);let t=new Map;for(let[i,s]of Object.entries(b[e])){let n=`assistant.${e}.${i}`;p({groups:{}},s,n),p(y[e][i].groups,s.groups,`${n}.groups`);let o=g[e][i],r=Object.entries(s.groups).map(([e,t])=>{let i=`${n}.groups.${e}`;p({description:"",allowDryRuns:!1},t,i);let s=o.groups.find(t=>t.instanceName===e);return{...s,description:c(t.description,s.description,i),dryRuns:u(t.allowDryRuns,s.dryRuns,i)}});for(let e of f.entityTypes.includes(i)?[i]:f.aliases[i]??[]){let i=t.get(e);t.set(e,{groups:[...i?.groups??[],...r],hints:a.filter(e=>o.hints.includes(e)||i?.hints.includes(e))})}}return Object.fromEntries(f.entityTypes.flatMap(e=>{let i=t.get(e);return i?.groups.length?[[e,i]]:[]}))};for(let[e,t]of Object.entries(b.deletable))p({},t,`assistant.deletable.${e}`);let E=new Set(Object.keys(b.deletable).flatMap(e=>f.entityTypes.includes(e)?[e]:f.aliases[e]??[])),T=f.actionFields.flatMap(e=>{let t=d(b.actions,e.actionName);if(void 0===t)return[];let i=`assistant.actions.${e.actionName}`;return p({description:""},t,i),[{...e,description:c(t.description,e.description,i)}]}),D=m;if(m){void 0!==b.ai&&p({...m.ai,maxThreadSize:void 0},b.ai,"assistant.ai");let s={...m.ai,...Object.fromEntries(Object.entries(b.ai??{}).filter(([,e])=>void 0!==e))};e.includes(s.provider)&&t.includes(s.model)&&i.includes(s.reasoning)||l("assistant.ai","expected a supported provider, model and reasoning level"),void 0!==s.maxThreadSize&&(!Number.isInteger(s.maxThreadSize)||s.maxThreadSize<=0)&&l("assistant.ai.maxThreadSize","expected a positive whole number of input tokens"),void 0!==b.instructions&&"string"!=typeof b.instructions&&l("assistant.instructions","expected a string"),D={instructions:""===b.instructions?null:b.instructions??m.instructions,ai:s}}return{resolved:{...f,fields:j,deletableTypes:f.entityTypes.filter(e=>E.has(e)),writableTypes:f.entityTypes.flatMap(e=>{let t=[...O.get(e)?.values()??[]];return t.length?[{entityType:e,fields:t}]:[]}),optionsEdges:Object.fromEntries(x),childRecipes:R("childRecipes"),replaceRecipes:R("replaceRecipes"),actionFields:T},settings:D}};
1
+ import{ASSISTANT_AI_PROVIDERS as e,ASSISTANT_MODEL_TIERS as t,ASSISTANT_REASONING_LEVELS as s}from"@salsita-ai/contracts/assistant";import{describeAssistantValues as i,mergeAssistantFields as n,resolveAssistantField as o}from"../assistant-fields.js";import{ASSISTANT_HINTS as r}from"../assistant-resolved-manifest.js";import{projectAssistantSetupManifest as a}from"./assistant-setup-manifest.js";export class AssistantSetupError extends Error{constructor(e,t){super(`${e}: ${t}`),this.name="AssistantSetupError"}}let l=(e,t)=>{throw new AssistantSetupError(e,t)},p=(e,t,s)=>{for(let i of((null===t||"object"!=typeof t||Array.isArray(t))&&l(s,"expected an object; omit an entry to remove it"),Object.keys(t)))Object.hasOwn(e,i)||l(`${s}.${i}`,"not declared in the spec; remove this key")},c=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0,d=(e,t,s)=>(void 0!==e&&"string"!=typeof e&&l(`${s}.description`,"expected a string"),e??t),u=(e,t,s)=>(void 0!==e&&!1!==e&&l(`${s}.allowDryRuns`,"can only disable dry-runs; omit this flag or set false"),!1!==e&&t);export const applyAssistantSetup=(f,m,b)=>{if(null===b)return null;let y=a(f,m),g=f.declarations;p({entities:{},deletable:{},writable:{},childRecipes:{},replaceRecipes:{},screenshots:{},actions:{},instructions:"",ai:{}},b,"assistant"),p(y.entities,b.entities,"assistant.entities"),p(y.deletable,b.deletable,"assistant.deletable"),p(y.writable,b.writable,"assistant.writable"),p(y.actions,b.actions,"assistant.actions"),p(y.screenshots,b.screenshots,"assistant.screenshots");let h=Object.fromEntries(Object.entries(b.entities).map(([e,t])=>{let s=`assistant.entities.${e}`;p(y.entities[e],t,s);let n=g.entities[e];return[e,Object.entries(t).map(([e,t])=>{p({description:""},t,`${s}.${e}`);let o=n.find(t=>t.source===e),r=d(t.description,o.valueDescription,`${s}.${e}`);return{...o,valueDescription:r,description:i(r,o.enumValues),describedByManifest:void 0!==t.description||o.describedByManifest}})]})),v=(e,t,s)=>l(`assistant.entities.${e}`,`conflicting sources ${t} and ${s}`),$=n([],c(h,"AnyDomainEntity")??[],()=>void 0,v),w=new Map([["AnyDomainEntity",$]]);for(let e of Object.keys(f.aliases))"AnyDomainEntity"!==e&&w.set(e,n([$],c(h,e)??[],()=>void 0,v));for(let e of f.entityTypes){let t=Object.entries(f.aliases).filter(([t,s])=>"AnyDomainEntity"!==t&&s.includes(e));w.set(e,n([$,...t.map(([e])=>w.get(e)??[])],c(h,e)??[],t=>g.enumValues[e]?.[t],v))}let j=Object.fromEntries([...w].map(([e,t])=>[e,t.map(t=>o(t,c(h,e)??[]))])),O=new Map,T=new Map;for(let[e,t]of Object.entries(b.writable)){let s=`assistant.writable.${e}`;for(let[i,n]of(p(y.writable[e],t,s),Object.entries(t))){let t=`${s}.${i}`,o=g.writable[e][i];for(let[e,{field:s,options:r,exposedDescription:a}]of(p(Object.values(o.members).some(e=>e.options)?{options:{}}:{},n,t),void 0!==n.options&&(p({validate:!0,allowDryRuns:!1},n.options,`${t}.options`),void 0!==n.options.validate&&!0!==n.options.validate&&l(`${t}.options.validate`,"can only enable validation; omit this flag or set true"),u(n.options.allowDryRuns,!0,`${t}.options`)),Object.entries(o.members))){let p=c(h,e)?.find(e=>e.source===i)?.name??w.get(e)?.find(e=>e.source===i)?.name,d=p??i;void 0===p&&w.get(e)?.some(e=>e.name===i&&e.source!==i)&&l(t,`narrowing leaves ${e}.${i} bound to another read field; retain its original exposure or remove this writable property`);let f=O.get(e)??new Map;if([...f.values()].some(e=>e.name===d&&e.property!==i)&&l(t,`narrowing maps multiple writable properties to ${e}.${d}; retain their original exposures or remove the conflicting property`),f.has(i)||f.set(i,{...s,name:d,...void 0===p?{}:{description:a}}),O.set(e,f),r){let s=o.defaultOptionsName?`${d}Options`:r.options.edgeName;T.get(e)?.some(e=>e.options.edgeName===s||e.options.field===d)&&l(`${t}.options`,`narrowing duplicates options edge ${e}.${s}; retain the original field exposures or remove the conflicting writable declaration`),T.set(e,[...T.get(e)??[],{hints:r.hints,options:{...r.options,field:d,edgeName:s,validate:n.options?.validate??r.options.validate,dryRuns:u(n.options?.allowDryRuns,r.options.dryRuns,`${t}.options`)}}])}}}}for(let[e,t]of Object.entries(f.optionsEdges))for(let s of t){let t=f.writableTypes.find(t=>t.entityType===e)?.fields.find(e=>e.name===s.options.field)?.property;if(s.options.validate&&t&&O.get(e)?.has(t)&&!T.get(e)?.some(s=>s.options.field===O.get(e)?.get(t)?.name&&s.options.validate)){let s=Object.keys(b.writable).find(s=>Object.hasOwn(b.writable[s],t)&&g.writable[s]?.[t]?.members[e]);l(`assistant.writable.${s}.${t}`,`cannot remove declared validation while another declaration keeps ${e}.${t} writable; remove all writable declarations for it`)}}let x=e=>{p(y[e],b[e],`assistant.${e}`);let t=new Map;for(let[s,i]of Object.entries(b[e])){let n=`assistant.${e}.${s}`;p({groups:{}},i,n),p(y[e][s].groups,i.groups,`${n}.groups`);let o=g[e][s],a=Object.entries(i.groups).map(([e,t])=>{let s=`${n}.groups.${e}`;p({description:"",allowDryRuns:!1},t,s);let i=o.groups.find(t=>t.instanceName===e);return{...i,description:d(t.description,i.description,s),dryRuns:u(t.allowDryRuns,i.dryRuns,s)}});for(let e of f.entityTypes.includes(s)?[s]:f.aliases[s]??[]){let s=t.get(e);t.set(e,{groups:[...s?.groups??[],...a],hints:r.filter(e=>o.hints.includes(e)||s?.hints.includes(e))})}}return Object.fromEntries(f.entityTypes.flatMap(e=>{let s=t.get(e);return s?.groups.length?[[e,s]]:[]}))},E=new Map;for(let[e,t]of Object.entries(b.screenshots)){let s=`assistant.screenshots.${e}`;p(y.screenshots[e],t,s);let i=f.entityTypes.includes(e)?[e]:f.aliases[e]??[];for(let[n,o]of Object.entries(t)){let t=`${s}.${n}`;p({description:""},o,t);let r=g.screenshots[e].find(e=>e.instanceName===n),a={...r,description:d(o.description,r.description,t)??r.description};for(let e of i)E.set(e,[...E.get(e)??[],a])}}for(let[e,t]of Object.entries(b.deletable))p({},t,`assistant.deletable.${e}`);let R=new Set(Object.keys(b.deletable).flatMap(e=>f.entityTypes.includes(e)?[e]:f.aliases[e]??[])),M=f.actionFields.flatMap(e=>{let t=c(b.actions,e.actionName);if(void 0===t)return[];let s=`assistant.actions.${e.actionName}`;return p({description:""},t,s),[{...e,description:d(t.description,e.description,s)}]}),D=m;if(m){void 0!==b.ai&&p({...m.ai,maxThreadSize:void 0},b.ai,"assistant.ai");let i={...m.ai,...Object.fromEntries(Object.entries(b.ai??{}).filter(([,e])=>void 0!==e))};e.includes(i.provider)&&t.includes(i.model)&&s.includes(i.reasoning)||l("assistant.ai","expected a supported provider, model and reasoning level"),void 0!==i.maxThreadSize&&(!Number.isInteger(i.maxThreadSize)||i.maxThreadSize<=0)&&l("assistant.ai.maxThreadSize","expected a positive whole number of input tokens"),void 0!==b.instructions&&"string"!=typeof b.instructions&&l("assistant.instructions","expected a string"),D={instructions:""===b.instructions?null:b.instructions??m.instructions,ai:i}}return{resolved:{...f,fields:j,deletableTypes:f.entityTypes.filter(e=>R.has(e)),writableTypes:f.entityTypes.flatMap(e=>{let t=[...O.get(e)?.values()??[]];return t.length?[{entityType:e,fields:t}]:[]}),optionsEdges:Object.fromEntries(T),childRecipes:x("childRecipes"),replaceRecipes:x("replaceRecipes"),screenshots:Object.fromEntries(f.entityTypes.flatMap(e=>{let t=E.get(e);return t?[[e,t]]:[]})),actionFields:M},settings:D}};
@@ -12,6 +12,8 @@ export interface AssistantSetupManifest<ENTITIES extends DomainEntity<string> =
12
12
  };
13
13
  readonly childRecipes: Readonly<Record<string, AssistantSetupRecipes>>;
14
14
  readonly replaceRecipes: Readonly<Record<string, AssistantSetupRecipes>>;
15
+ /** The screenshot views under their original entity or alias key, keyed by `agentScreenshot` instance name. */
16
+ readonly screenshots: Readonly<Record<string, Readonly<Record<string, AssistantSetupField>>>>;
15
17
  readonly actions: {
16
18
  readonly [ACTION in keyof ACTIONS]?: AssistantSetupField;
17
19
  };
@@ -1 +1 @@
1
- export const projectAssistantSetupManifest=(e,i)=>{let t=e=>Object.fromEntries(Object.entries(e).map(([e,i])=>[e,{groups:Object.fromEntries(i.groups.map(e=>[e.instanceName,{...void 0===e.description?{}:{description:e.description},...!e.dryRuns?{allowDryRuns:!1}:{}}]))}])),s=e.declarations;return{entities:Object.fromEntries(Object.entries(s.entities).map(([e,i])=>[e,Object.fromEntries(i.map(e=>[e.source,{...!e.describedByManifest||void 0===e.valueDescription?{}:{description:e.valueDescription}}]))])),deletable:Object.fromEntries(s.deletable.map(e=>[e,{}])),writable:Object.fromEntries(Object.entries(s.writable).map(([e,i])=>[e,Object.fromEntries(Object.entries(i).map(([e,i])=>{let t=Object.values(i.members).find(e=>e.options)?.options?.options;return[e,t?{options:{...t.validate?{validate:!0}:{},...!t.dryRuns?{allowDryRuns:!1}:{}}}:{}]}))])),childRecipes:t(s.childRecipes),replaceRecipes:t(s.replaceRecipes),actions:Object.fromEntries(e.actionFields.map(e=>[e.actionName,void 0===e.description?{}:{description:e.description}])),...i?{instructions:i.instructions??void 0,ai:{...i.ai}}:{}}};
1
+ export const projectAssistantSetupManifest=(e,t)=>{let i=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{groups:Object.fromEntries(t.groups.map(e=>[e.instanceName,{...void 0===e.description?{}:{description:e.description},...!e.dryRuns?{allowDryRuns:!1}:{}}]))}])),s=e.declarations;return{entities:Object.fromEntries(Object.entries(s.entities).map(([e,t])=>[e,Object.fromEntries(t.map(e=>[e.source,{...!e.describedByManifest||void 0===e.valueDescription?{}:{description:e.valueDescription}}]))])),deletable:Object.fromEntries(s.deletable.map(e=>[e,{}])),writable:Object.fromEntries(Object.entries(s.writable).map(([e,t])=>[e,Object.fromEntries(Object.entries(t).map(([e,t])=>{let i=Object.values(t.members).find(e=>e.options)?.options?.options;return[e,i?{options:{...i.validate?{validate:!0}:{},...!i.dryRuns?{allowDryRuns:!1}:{}}}:{}]}))])),childRecipes:i(s.childRecipes),replaceRecipes:i(s.replaceRecipes),screenshots:Object.fromEntries(Object.entries(s.screenshots).map(([e,t])=>[e,Object.fromEntries(t.map(({instanceName:e,description:t})=>[e,{description:t}]))])),actions:Object.fromEntries(e.actionFields.map(e=>[e.actionName,void 0===e.description?{}:{description:e.description}])),...t?{instructions:t.instructions??void 0,ai:{...t.ai}}:{}}};