@salsita-ai/sdk 0.50.0-develop.11a39afa73 → 0.50.0-develop.12744a81f2

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 (587) hide show
  1. package/README.md +10 -3
  2. package/dist/application-spec/errors/diagnostic-codes.d.ts +8 -0
  3. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  4. package/dist/application-spec/errors/diagnostic-messages.d.ts +9 -1
  5. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  6. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  7. package/dist/application-spec/generate-application/code/standalone-app-files.js +1 -1
  8. package/dist/application-spec/generate-application/code/templates/admin-config.d.ts +1 -1
  9. package/dist/application-spec/generate-application/code/templates/admin-config.js +3 -2
  10. package/dist/application-spec/generate-application/code/templates/application-types.js +5 -5
  11. package/dist/application-spec/generate-application/code/templates/configurator-config.js +4 -2
  12. package/dist/application-spec/generate-application/code/templates/configurator-domain-code.d.ts +0 -1
  13. package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js +6 -8
  14. package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.d.ts +1 -0
  15. package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.js +8 -6
  16. package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.d.ts +1 -4
  17. package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.js +2 -2
  18. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.d.ts +1 -1
  19. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +26 -29
  20. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +0 -3
  21. package/dist/application-spec/generate-application/code/templates/domain.js +3 -3
  22. package/dist/application-spec/generate-application/code/templates/frontend-config.js +7 -3
  23. package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.d.ts +3 -3
  24. package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.js +3 -3
  25. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.d.ts +10 -6
  26. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.js +7 -7
  27. package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +11 -12
  28. package/dist/application-spec/generate-application/code/templates/skills/core/cli.js +1 -1
  29. package/dist/application-spec/generate-application/code/templates/skills/core/sdk.js +3 -2
  30. package/dist/application-spec/generate-application/code/templates/skills/core/workflow.js +13 -11
  31. package/dist/application-spec/generate-application/code/templates/skills/features/application-states/views-and-tools.js +1 -1
  32. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/index.d.ts +3 -0
  33. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/index.js +1 -0
  34. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/panel.d.ts +3 -0
  35. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/panel.js +42 -0
  36. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/reading-and-changing.d.ts +3 -0
  37. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/reading-and-changing.js +55 -0
  38. package/dist/application-spec/generate-application/code/templates/skills/features/{webhooks/assistant-setup.d.ts → assistant/session-setup.d.ts} +1 -1
  39. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/session-setup.js +16 -0
  40. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/custom-layout.js +3 -3
  41. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/pages.d.ts +1 -1
  42. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/pages.js +1 -1
  43. package/dist/application-spec/generate-application/code/templates/skills/features/domain-controls/custom-controls.js +1 -1
  44. package/dist/application-spec/generate-application/code/templates/skills/features/domain-controls/scene-controls.js +4 -2
  45. package/dist/application-spec/generate-application/code/templates/skills/features/domain-model/actions.js +3 -3
  46. package/dist/application-spec/generate-application/code/templates/skills/features/domain-model/expressions.js +1 -1
  47. package/dist/application-spec/generate-application/code/templates/skills/features/features.js +1 -1
  48. package/dist/application-spec/generate-application/code/templates/skills/features/state/violations.js +2 -2
  49. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/authentication.js +1 -1
  50. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/entry-and-environment.js +1 -1
  51. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/webhooks.js +1 -1
  52. package/dist/application-spec/generate-application/code/templates/skills/guide.d.ts +1 -1
  53. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +3 -3
  54. package/dist/application-spec/generate-application/code/templates/skills/processes/asset-conversion.js +3 -3
  55. package/dist/application-spec/generate-application/code/templates/skills/processes/assistant-configuration.d.ts +3 -0
  56. package/dist/application-spec/generate-application/code/templates/skills/processes/assistant-configuration.js +3 -0
  57. package/dist/application-spec/generate-application/code/templates/skills/processes/feedback/report.js +29 -1
  58. package/dist/application-spec/generate-application/code/templates/skills/processes/finalization.js +2 -2
  59. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/build.js +29 -15
  60. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/direction.js +17 -14
  61. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/first-draft.js +2 -2
  62. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/handoff.js +3 -3
  63. package/dist/application-spec/generate-application/code/templates/skills/processes/index.d.ts +2 -0
  64. package/dist/application-spec/generate-application/code/templates/skills/processes/index.js +1 -1
  65. package/dist/application-spec/generate-application/code/templates/skills/processes/model-migration.js +1 -1
  66. package/dist/application-spec/generate-application/code/templates/skills/processes/review/appearance.js +2 -2
  67. package/dist/application-spec/generate-application/code/templates/skills/processes/review/code.js +1 -1
  68. package/dist/application-spec/generate-application/code/templates/skills/processes/review/review.js +1 -1
  69. package/dist/application-spec/generate-application/code/templates/skills/processes/review/visual-inspection.js +1 -1
  70. package/dist/application-spec/generate-application/code/templates/skills/processes/scene-realism.d.ts +2 -0
  71. package/dist/application-spec/generate-application/code/templates/skills/processes/scene-realism.js +29 -0
  72. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/product-definition.js +2 -0
  73. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/specification.js +1 -1
  74. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-specification.d.ts +2 -0
  75. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-specification.js +28 -0
  76. package/dist/application-spec/generate-application/code/templates/webhook-builders.js +7 -6
  77. package/dist/application-spec/generate-application/code/templates/webhook-index.d.ts +2 -1
  78. package/dist/application-spec/generate-application/code/templates/webhook-index.js +2 -2
  79. package/dist/application-spec/parse-application-files/merge/merged-app-metadata.d.ts +3 -0
  80. package/dist/application-spec/parse-application-files/merge/merged-app-metadata.js +1 -1
  81. package/dist/application-spec/parse-application-files/merge/merged-assistant.js +1 -1
  82. package/dist/application-spec/parse-application-files/parse-application-files.js +1 -1
  83. package/dist/application-spec/parse-application-files/raw-spec/raw-actions.d.ts +3 -2
  84. package/dist/application-spec/parse-application-files/raw-spec/raw-actions.js +1 -1
  85. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +66 -7
  86. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  87. package/dist/application-spec/parse-application-files/raw-spec/raw-components.js +1 -1
  88. package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.d.ts +6 -3
  89. package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
  90. package/dist/application-spec/parse-application-files/resolve/resolve-import-modules.js +1 -1
  91. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.js +1 -1
  92. package/dist/application-spec/parse-application-files/spec/model/session-data-schema.js +1 -1
  93. package/dist/application-spec/parse-application-files/spec/relations/relations.js +1 -1
  94. package/dist/application-spec/parse-application-files/spec/sections/actions.js +1 -1
  95. package/dist/application-spec/parse-application-files/spec/sections/app-metadata.js +1 -1
  96. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.d.ts +14 -2
  97. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.js +1 -1
  98. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +7 -10
  99. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  100. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-server-settings.d.ts +5 -6
  101. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-server-settings.js +1 -1
  102. package/dist/application-spec/parse-application-files/spec/sections/assistant/index.d.ts +0 -1
  103. package/dist/application-spec/webhook-boundary.js +1 -1
  104. package/dist/client/cli-client/cli-api-client.d.ts +17 -0
  105. package/dist/client/cli-client/cli-api-client.js +1 -0
  106. package/dist/client/cli-client/index.d.ts +2 -0
  107. package/dist/client/cli-client/index.js +1 -0
  108. package/dist/client/cli-client/unsupported-api-version-error.d.ts +11 -0
  109. package/dist/client/cli-client/unsupported-api-version-error.js +1 -0
  110. package/dist/client/contract.d.ts +1 -1
  111. package/dist/client/index.d.ts +1 -0
  112. package/dist/client/index.js +1 -1
  113. package/dist/client/phoenix-api.d.ts +5263 -1723
  114. package/dist/configurator/ConfiguratorApp.js +1 -1
  115. package/dist/configurator/application-runtime/extensions/configurator-extension-systems.d.ts +5 -4
  116. package/dist/configurator/application-runtime/extensions/configurator-extension-systems.js +1 -1
  117. package/dist/configurator/application-runtime/extensions/create-configurator-extensions.js +1 -1
  118. package/dist/configurator/application-runtime/extensions/selectors.d.ts +4 -2
  119. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  120. package/dist/configurator/application-runtime/extensions/systems/action-system/action-context.d.ts +14 -0
  121. package/dist/configurator/application-runtime/extensions/systems/action-system/action-factory.d.ts +13 -0
  122. package/dist/configurator/application-runtime/extensions/systems/action-system/action-system.d.ts +55 -0
  123. package/dist/configurator/application-runtime/extensions/systems/action-system/action-system.js +1 -0
  124. package/dist/configurator/application-runtime/extensions/systems/action-system/action.d.ts +56 -0
  125. package/dist/configurator/application-runtime/extensions/systems/action-system/action.js +1 -0
  126. package/dist/configurator/application-runtime/extensions/systems/action-system/index.d.ts +6 -0
  127. package/dist/configurator/application-runtime/extensions/systems/action-system/index.js +1 -0
  128. package/dist/{domain/domain-runtime/spec → configurator/application-runtime/extensions/systems/action-system}/prepare-action-implementations.d.ts +4 -3
  129. package/dist/{domain/domain-runtime/spec → configurator/application-runtime/extensions/systems/action-system}/prepare-action-implementations.js +2 -2
  130. package/dist/{domain/spec/modules → configurator/application-runtime/extensions/systems/action-system}/resolve-action-modules.d.ts +2 -2
  131. package/dist/configurator/application-runtime/extensions/systems/action-system/resolve-action-modules.js +1 -0
  132. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-annotation.d.ts +7 -4
  133. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +99 -35
  134. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  135. package/dist/configurator/application-runtime/extensions/systems/assistant-system/composer-attachments.d.ts +12 -17
  136. package/dist/configurator/application-runtime/extensions/systems/assistant-system/composer-attachments.js +1 -1
  137. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +52 -36
  138. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  139. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/index.d.ts +3 -0
  140. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/index.js +1 -0
  141. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/register-webmcp-tools.d.ts +33 -0
  142. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/register-webmcp-tools.js +6 -0
  143. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/share-link.d.ts +14 -0
  144. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/share-link.js +2 -0
  145. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/to-webmcp-result.d.ts +10 -0
  146. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/to-webmcp-result.js +1 -0
  147. package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.d.ts +41 -35
  148. package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.js +1 -1
  149. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.d.ts +14 -4
  150. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.js +1 -1
  151. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +8 -1
  152. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  153. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +46 -12
  154. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  155. package/dist/configurator/application-runtime/extensions/systems/graphql-system/is-offered-for-selection.d.ts +16 -0
  156. package/dist/configurator/application-runtime/extensions/systems/graphql-system/is-offered-for-selection.js +1 -0
  157. package/dist/configurator/application-runtime/extensions/systems/graphql-system/read-offered-navigation.d.ts +26 -0
  158. package/dist/configurator/application-runtime/extensions/systems/graphql-system/read-offered-navigation.js +1 -0
  159. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.d.ts +25 -8
  160. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.js +1 -1
  161. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/export-image-capture.d.ts +15 -4
  162. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/export-image-capture.js +3 -3
  163. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.d.ts +15 -7
  164. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.js +1 -1
  165. package/dist/configurator/application-runtime/extensions/systems/index.d.ts +5 -4
  166. package/dist/configurator/application-runtime/extensions/systems/index.js +1 -1
  167. package/dist/configurator/application-runtime/hooks/use-configurator.d.ts +3 -3
  168. package/dist/configurator/common/configurator-interface.d.ts +9 -7
  169. package/dist/configurator/common/configurator-interface.js +1 -1
  170. package/dist/configurator/scene/cameras/CameraPadding.d.ts +5 -0
  171. package/dist/configurator/scene/cameras/CameraPadding.js +1 -1
  172. package/dist/configurator/scene/resources/use-phx-gltf.js +1 -1
  173. package/dist/configurator/scene/scene-entity/materials/LocalCreatedMaterial.js +1 -1
  174. package/dist/configurator/scene/scene-entity/materials/RemoteReplacedMaterial.d.ts +5 -0
  175. package/dist/configurator/scene/scene-entity/materials/RemoteReplacedMaterial.js +1 -1
  176. package/dist/configurator/scene/scene-entity/materials/use-dispose-replaced.d.ts +27 -0
  177. package/dist/configurator/scene/scene-entity/materials/use-dispose-replaced.js +1 -0
  178. package/dist/configurator/toolbar-actions/use-toolbar-actions.js +1 -1
  179. package/dist/configurator/ui/assistant/AssistantChips.d.ts +5 -5
  180. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  181. package/dist/configurator/ui/assistant/AssistantComposer.d.ts +4 -3
  182. package/dist/configurator/ui/assistant/AssistantComposer.js +1 -1
  183. package/dist/configurator/ui/assistant/AssistantPanel.d.ts +6 -4
  184. package/dist/configurator/ui/assistant/AssistantPanel.js +1 -1
  185. package/dist/configurator/ui/assistant/AssistantThread.d.ts +10 -2
  186. package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
  187. package/dist/configurator/ui/assistant/annotation/AnnotationViewer.js +1 -1
  188. package/dist/configurator/ui/assistant/annotation/MessageAnnotations.js +1 -1
  189. package/dist/configurator/ui/assistant/annotation/editor/AnnotationComment.d.ts +6 -5
  190. package/dist/configurator/ui/assistant/annotation/editor/AnnotationComment.js +1 -1
  191. package/dist/configurator/ui/assistant/annotation/editor/AnnotationEditor.d.ts +6 -5
  192. package/dist/configurator/ui/assistant/annotation/editor/AnnotationEditor.js +1 -1
  193. package/dist/configurator/ui/assistant/annotation/editor/annotation-pins.d.ts +5 -0
  194. package/dist/configurator/ui/assistant/annotation/editor/annotation-pins.js +1 -1
  195. package/dist/configurator/ui/assistant/annotation/index.d.ts +0 -1
  196. package/dist/configurator/ui/assistant/annotation/index.js +1 -1
  197. package/dist/configurator/ui/assistant/assistant-failure.d.ts +6 -4
  198. package/dist/configurator/ui/assistant/assistant-failure.js +1 -1
  199. package/dist/configurator/ui/assistant/attachments/MessageImages.js +1 -1
  200. package/dist/configurator/ui/assistant/disclaimer/AssistantDisclaimerDialog.d.ts +10 -0
  201. package/dist/configurator/ui/assistant/disclaimer/AssistantDisclaimerDialog.js +1 -0
  202. package/dist/configurator/ui/assistant/disclaimer/AssistantDisclaimerLine.d.ts +10 -0
  203. package/dist/configurator/ui/assistant/disclaimer/AssistantDisclaimerLine.js +1 -0
  204. package/dist/configurator/ui/assistant/disclaimer/index.d.ts +2 -0
  205. package/dist/configurator/ui/assistant/disclaimer/index.js +1 -0
  206. package/dist/configurator/ui/assistant/drawing/AssistantDrawing.d.ts +1 -1
  207. package/dist/configurator/ui/assistant/drawing/AssistantDrawing.js +1 -1
  208. package/dist/configurator/ui/assistant/drawing/index.d.ts +1 -1
  209. package/dist/configurator/ui/assistant/drawing/index.js +1 -1
  210. package/dist/configurator/ui/assistant/drawing/parse-drawing.js +1 -1
  211. package/dist/configurator/ui/assistant/drawing/use-drawing-url.d.ts +6 -12
  212. package/dist/configurator/ui/assistant/drawing/use-drawing-url.js +1 -1
  213. package/dist/configurator/ui/assistant/form/AssistantForm.d.ts +1 -1
  214. package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -1
  215. package/dist/configurator/ui/assistant/form/form-model.d.ts +9 -0
  216. package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +6 -5
  217. package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -1
  218. package/dist/configurator/ui/assistant/form/read-form-tile.d.ts +8 -0
  219. package/dist/configurator/ui/assistant/form/read-form-tile.js +1 -0
  220. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.d.ts +6 -3
  221. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.js +1 -1
  222. package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.d.ts +11 -7
  223. package/dist/configurator/ui/assistant/form/registry/form-registry.d.ts +1 -1
  224. package/dist/configurator/ui/assistant/form/registry/form-registry.js +1 -1
  225. package/dist/configurator/ui/assistant/form/split-form-rows.d.ts +7 -0
  226. package/dist/configurator/ui/assistant/form/split-form-rows.js +1 -0
  227. package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +7 -4
  228. package/dist/configurator/ui/assistant/form-elements/FormOptions.js +1 -1
  229. package/dist/configurator/ui/assistant/form-elements/FormTile.d.ts +72 -0
  230. package/dist/configurator/ui/assistant/form-elements/FormTile.js +1 -0
  231. package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +27 -0
  232. package/dist/configurator/ui/assistant/form-elements/index.d.ts +2 -3
  233. package/dist/configurator/ui/assistant/form-elements/index.js +1 -1
  234. package/dist/configurator/ui/assistant/image-view/ImageView.js +1 -1
  235. package/dist/configurator/ui/assistant/index.d.ts +2 -2
  236. package/dist/configurator/ui/assistant/panel/AssistantPanelHeader.js +1 -1
  237. package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.d.ts +4 -1
  238. package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.js +1 -1
  239. package/dist/configurator/ui/assistant/reference-link/index.d.ts +2 -1
  240. package/dist/configurator/ui/assistant/reference-link/index.js +1 -1
  241. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -1
  242. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +2 -6
  243. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -1
  244. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +5 -6
  245. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -1
  246. package/dist/configurator/ui/assistant/thread-items.d.ts +2 -2
  247. package/dist/configurator/ui/assistant/thread-items.js +1 -1
  248. package/dist/configurator/ui/assistant/use-assistant-composer.d.ts +7 -1
  249. package/dist/configurator/ui/assistant/use-assistant-composer.js +2 -2
  250. package/dist/configurator/ui/assistant/use-assistant-thread.d.ts +15 -1
  251. package/dist/configurator/ui/assistant/use-assistant-thread.js +1 -1
  252. package/dist/configurator/ui/assistant/use-load-older-on-top.d.ts +3 -3
  253. package/dist/configurator/ui/assistant/use-load-older-on-top.js +1 -1
  254. package/dist/configurator/ui/assistant/{annotation/use-end-on-unmount.d.ts → use-on-unmount.d.ts} +1 -1
  255. package/dist/configurator/ui/assistant/use-on-unmount.js +1 -0
  256. package/dist/configurator/ui/configurator-layout/index.d.ts +1 -1
  257. package/dist/configurator/ui/configurator-layout/index.js +1 -1
  258. package/dist/configurator/ui/configurator-layout/slots/canvas/LayoutCanvas.js +1 -1
  259. package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/DesktopSidebar.js +4 -4
  260. package/dist/configurator/ui/configurator-layout/slots/index.d.ts +2 -0
  261. package/dist/configurator/ui/configurator-layout/slots/index.js +1 -1
  262. package/dist/configurator/ui/configurator-layout/slots/view-controls/DesktopViewControls.js +1 -1
  263. package/dist/configurator/ui/configurator-layout/slots/view-controls/MobileViewControls.js +1 -1
  264. package/dist/configurator/ui/configurator-layout/slots/view-controls/NestedViewControls.d.ts +7 -0
  265. package/dist/configurator/ui/configurator-layout/slots/view-controls/NestedViewControls.js +1 -0
  266. package/dist/configurator/ui/configurator-layout/slots/view-controls/use-view-control-items.d.ts +6 -0
  267. package/dist/configurator/ui/configurator-layout/slots/view-controls/use-view-control-items.js +1 -0
  268. package/dist/configurator/ui/configurator-layout/universal/DesktopPreview.js +1 -1
  269. package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +3 -3
  270. package/dist/configurator/ui/configurator-layout/universal/MobilePreview.js +1 -1
  271. package/dist/configurator/ui/configurator-layout/universal/use-preview-description.d.ts +1 -0
  272. package/dist/configurator/ui/configurator-layout/universal/use-preview-description.js +1 -0
  273. package/dist/configurator/ui/index.d.ts +1 -1
  274. package/dist/configurator/ui/legacy/layout/common/ViewControls.js +1 -1
  275. package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -1
  276. package/dist/docs/index.json +128 -3
  277. package/dist/docs/layouts/nested-view-controls.mdx +223 -0
  278. package/dist/docs/layouts/presets/custom.mdx +1 -0
  279. package/dist/docs/layouts/preview/always.mdx +22 -0
  280. package/dist/docs/layouts/view-controls.mdx +2 -0
  281. package/dist/docs/other-features/domain-actions.mdx +58 -62
  282. package/dist/docs/other-features/violation-messages.mdx +3 -1
  283. package/dist/docs/phoenix/application-states.mdx +1 -1
  284. package/dist/docs/phoenix/assistant/actions.mdx +183 -0
  285. package/dist/docs/phoenix/assistant/changing-the-configuration.mdx +333 -0
  286. package/dist/docs/phoenix/assistant/instructions-and-ai-settings.mdx +221 -0
  287. package/dist/docs/phoenix/assistant/overview.mdx +137 -0
  288. package/dist/docs/phoenix/assistant/per-session-setup.mdx +166 -0
  289. package/dist/docs/phoenix/assistant/reading-the-configuration.mdx +349 -0
  290. package/dist/docs/phoenix/assistant/screenshots.mdx +135 -0
  291. package/dist/docs/phoenix/assistant/security-and-limits.mdx +151 -0
  292. package/dist/docs/phoenix/assistant/the-panel.mdx +298 -0
  293. package/dist/docs/phoenix/configurator-interface.mdx +68 -39
  294. package/dist/docs/phoenix/data-sources.mdx +1 -1
  295. package/dist/docs/phoenix/getting-started.mdx +1 -1
  296. package/dist/docs/phoenix/layout-slots.mdx +2 -2
  297. package/dist/docs/phoenix/migrations.mdx +1 -1
  298. package/dist/docs/phoenix/phoenix-cli.mdx +90 -54
  299. package/dist/docs/phoenix/project-structure.mdx +17 -7
  300. package/dist/docs/phoenix/sdk-builder-workflow.mdx +57 -28
  301. package/dist/docs/phoenix/sessions-and-access.mdx +10 -7
  302. package/dist/docs/phoenix/theming.mdx +5 -9
  303. package/dist/docs/phoenix/webhook-membership.mdx +1 -1
  304. package/dist/docs/phoenix/webhooks.mdx +56 -4
  305. package/dist/docs/ux-guidelines/choosing-navigation.mdx +2 -0
  306. package/dist/docs/ux-guidelines/designing-the-configuration-journey.mdx +43 -0
  307. package/dist/docs/ux-guidelines/interaction-modes.mdx +2 -2
  308. package/dist/docs/ux-guidelines/overview.mdx +11 -9
  309. package/dist/domain/application/application-config.d.ts +5 -0
  310. package/dist/domain/application/assistant/assistant-exposure.d.ts +22 -0
  311. package/dist/domain/application/assistant/assistant-exposure.js +1 -0
  312. package/dist/domain/application/assistant/assistant-selection.d.ts +30 -0
  313. package/dist/domain/application/assistant/assistant-selection.js +1 -0
  314. package/dist/domain/application/assistant/build-assistant-lenses.js +4 -4
  315. package/dist/domain/application/assistant/build-assistant-manifest.d.ts +2 -2
  316. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  317. package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +18 -2
  318. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  319. package/dist/domain/application/assistant/index.d.ts +5 -1
  320. package/dist/domain/application/assistant/index.js +1 -1
  321. package/dist/domain/application/assistant/prepare-assistant-navigation-updates.d.ts +16 -0
  322. package/dist/domain/application/assistant/prepare-assistant-navigation-updates.js +1 -0
  323. package/dist/domain/application/assistant/read-assistant-navigation.d.ts +40 -0
  324. package/dist/domain/application/assistant/read-assistant-navigation.js +1 -0
  325. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
  326. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +30 -2
  327. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
  328. package/dist/domain/application/assistant/session-setup/assistant-takes-images.d.ts +7 -0
  329. package/dist/domain/application/assistant/session-setup/assistant-takes-images.js +1 -0
  330. package/dist/domain/application/assistant/session-setup/index.d.ts +1 -0
  331. package/dist/domain/application/assistant/session-setup/index.js +1 -1
  332. package/dist/domain/application/assistant-field-options.d.ts +2 -0
  333. package/dist/domain/application/assistant-field-options.js +1 -1
  334. package/dist/domain/application/assistant-mutations.d.ts +17 -11
  335. package/dist/domain/application/assistant-mutations.js +1 -1
  336. package/dist/domain/application/assistant-recipe-groups.d.ts +4 -3
  337. package/dist/domain/application/assistant-recipe-groups.js +1 -1
  338. package/dist/domain/application/configurator-builder.d.ts +8 -0
  339. package/dist/domain/application/configurator-builder.js +1 -1
  340. package/dist/domain/available-system-components/available-system-components.d.ts +1 -1
  341. package/dist/domain/available-system-components/available-system-components.js +1 -1
  342. package/dist/domain/core/action/action.d.ts +0 -49
  343. package/dist/domain/core/component/system-component-filter.d.ts +1 -0
  344. package/dist/domain/core/component/system-component-filter.js +1 -1
  345. package/dist/domain/core/component/view-state-component.d.ts +4 -3
  346. package/dist/domain/core/component/view-state-component.js +1 -1
  347. package/dist/domain/core/domain-factory.d.ts +2 -3
  348. package/dist/domain/core/invariant/control-violation-hints.d.ts +37 -0
  349. package/dist/domain/core/invariant/control-violation-hints.js +1 -0
  350. package/dist/domain/core/invariant/index.d.ts +1 -0
  351. package/dist/domain/core/invariant/index.js +1 -1
  352. package/dist/domain/domain-builder/domain-builder.d.ts +1 -6
  353. package/dist/domain/domain-builder/domain-builder.js +1 -1
  354. package/dist/domain/domain-context/domain-context-systems.d.ts +3 -5
  355. package/dist/domain/domain-context/index.d.ts +0 -1
  356. package/dist/domain/domain-context/index.js +1 -1
  357. package/dist/domain/domain-context/navigation-system/navigation-system.d.ts +2 -2
  358. package/dist/domain/domain-context/navigation-system/navigation-system.js +1 -1
  359. package/dist/domain/domain-context/transformers/when-builder.js +1 -1
  360. package/dist/domain/domain-runtime/domain-context/domain-context.d.ts +1 -1
  361. package/dist/domain/domain-runtime/domain-context/domain-context.js +1 -1
  362. package/dist/domain/domain-runtime/domain-context/index.d.ts +0 -1
  363. package/dist/domain/domain-runtime/domain-context/selectors.d.ts +5 -6
  364. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  365. package/dist/domain/domain-runtime/domain-runtime.d.ts +13 -19
  366. package/dist/domain/domain-runtime/domain-runtime.js +1 -1
  367. package/dist/domain/domain-runtime/index.d.ts +0 -1
  368. package/dist/domain/domain-runtime/index.js +1 -1
  369. package/dist/domain/domain-runtime/spec/index.d.ts +0 -1
  370. package/dist/domain/domain-runtime/spec/index.js +1 -1
  371. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  372. package/dist/domain/domain-runtime/spec/selectors.d.ts +2 -2
  373. package/dist/domain/domain-runtime/spec/types.d.ts +12 -10
  374. package/dist/domain/extensions/assistant/assistant-greeting.d.ts +30 -0
  375. package/dist/domain/extensions/assistant/assistant-greeting.js +1 -0
  376. package/dist/domain/extensions/assistant/index.d.ts +1 -0
  377. package/dist/domain/extensions/assistant/index.js +1 -0
  378. package/dist/domain/extensions/export-images/agent-screenshot.d.ts +5 -4
  379. package/dist/domain/extensions/export-images/agent-screenshot.js +1 -1
  380. package/dist/domain/extensions/index.d.ts +1 -1
  381. package/dist/domain/extensions/index.js +1 -1
  382. package/dist/domain/index.d.ts +1 -1
  383. package/dist/domain/index.js +1 -1
  384. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +6 -8
  385. package/dist/domain/spec/modules/index.d.ts +0 -1
  386. package/dist/domain/spec/modules/index.js +1 -1
  387. package/dist/domain/spec/phx/phx-domain.d.ts +0 -1
  388. package/dist/domain/spec/phx/phx-domain.js +1 -1
  389. package/dist/domain/spec/runtime/application-spec-slice.d.ts +5 -5
  390. package/dist/domain/spec/runtime/application-spec-slice.js +1 -1
  391. package/dist/domain/spec/runtime/create-application.d.ts +5 -2
  392. package/dist/domain/spec/runtime/create-application.js +1 -1
  393. package/dist/domain/spec/runtime-spec/runtime-spec.d.ts +2 -2
  394. package/dist/domain/spec/sections/actions.d.ts +3 -2
  395. package/dist/domain/spec/sections/app-metadata.d.ts +3 -0
  396. package/dist/domain/spec/sections/assistant/assistant-features.d.ts +13 -0
  397. package/dist/domain/spec/sections/assistant/assistant-features.js +1 -0
  398. package/dist/domain/spec/sections/assistant/assistant-manifest.d.ts +34 -1
  399. package/dist/domain/spec/sections/assistant/assistant-navigation.d.ts +21 -0
  400. package/dist/domain/spec/sections/assistant/assistant-navigation.js +1 -0
  401. package/dist/domain/spec/sections/assistant/assistant-resolved-manifest.d.ts +45 -4
  402. package/dist/domain/spec/sections/assistant/assistant-select.d.ts +12 -0
  403. package/dist/domain/spec/sections/assistant/assistant-select.js +1 -0
  404. package/dist/domain/spec/sections/assistant/form/assistant-form-elements.d.ts +10 -26
  405. package/dist/domain/spec/sections/assistant/form/assistant-form-elements.js +1 -1
  406. package/dist/domain/spec/sections/assistant/index.d.ts +4 -1
  407. package/dist/domain/system-components/index.d.ts +1 -0
  408. package/dist/domain/system-components/index.js +1 -1
  409. package/dist/domain/system-components/navigation/index.d.ts +1 -0
  410. package/dist/domain/system-components/navigation/index.js +1 -0
  411. package/dist/domain/system-components/navigation/view-controls.d.ts +24 -0
  412. package/dist/domain/system-components/navigation/view-controls.js +1 -0
  413. package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
  414. package/dist/editor/domain-editors/apply-spec-update.js +1 -1
  415. package/dist/editor/domain-editors/use-implementation-files.d.ts +4 -3
  416. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  417. package/dist/extras/cognito/CognitoSignInPage.d.ts +2 -0
  418. package/dist/extras/cognito/CognitoSignInPage.js +1 -0
  419. package/dist/extras/cognito/index.d.ts +1 -0
  420. package/dist/extras/cognito/index.js +1 -0
  421. package/dist/globals/index.d.ts +5 -0
  422. package/dist/i18n/locales/cs/messages.js +1 -1
  423. package/dist/i18n/locales/da/messages.js +1 -1
  424. package/dist/i18n/locales/de/messages.js +1 -1
  425. package/dist/i18n/locales/de-AT/messages.js +1 -1
  426. package/dist/i18n/locales/en/messages.js +1 -1
  427. package/dist/i18n/locales/en-AU/messages.js +1 -1
  428. package/dist/i18n/locales/en-GB/messages.js +1 -1
  429. package/dist/i18n/locales/es/messages.js +1 -1
  430. package/dist/i18n/locales/fr/messages.js +1 -1
  431. package/dist/i18n/locales/hu/messages.js +1 -1
  432. package/dist/i18n/locales/it/messages.js +1 -1
  433. package/dist/i18n/locales/nl/messages.js +1 -1
  434. package/dist/i18n/locales/pl/messages.js +1 -1
  435. package/dist/i18n/locales/pt/messages.js +1 -1
  436. package/dist/i18n/locales/ro/messages.js +1 -1
  437. package/dist/i18n/locales/sk/messages.js +1 -1
  438. package/dist/i18n/locales/tr/messages.js +1 -1
  439. package/dist/legacy/deployment-cli/commands/create-environment.js +1 -1
  440. package/dist/legacy/deployment-cli/commands/list-environments.js +1 -1
  441. package/dist/legacy/deployment-cli/commands/register-deployment.js +1 -1
  442. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +25 -3
  443. package/dist/legacy/phoenix-cli/commands/prepare-deployment-command.js +1 -1
  444. package/dist/legacy/phoenix-cli/commands/prepare-local-environment-command.js +1 -1
  445. package/dist/legacy/phoenix-cli/services/prepare-development-environment.js +1 -1
  446. package/dist/legacy/phoenix-cli/services/webhook-service/transport.js +1 -1
  447. package/dist/legacy/webhook-cli/lib/webhook-boundary.js +1 -1
  448. package/dist/phoenix/application-spec/index.d.ts +1 -1
  449. package/dist/phoenix/application-spec/index.js +1 -1
  450. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +1 -0
  451. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  452. package/dist/phoenix/cli.js +1 -1
  453. package/dist/phoenix/commands/account/index.d.ts +1 -0
  454. package/dist/phoenix/commands/account/index.js +1 -0
  455. package/dist/phoenix/commands/account/whoami.d.ts +10 -0
  456. package/dist/phoenix/commands/account/whoami.js +4 -0
  457. package/dist/phoenix/commands/cleanup-environment.js +1 -1
  458. package/dist/phoenix/commands/deploy.d.ts +7 -2
  459. package/dist/phoenix/commands/deploy.js +8 -2
  460. package/dist/phoenix/commands/deployment-build-envs-command.js +1 -1
  461. package/dist/phoenix/commands/feedback.d.ts +2 -2
  462. package/dist/phoenix/commands/feedback.js +1 -1
  463. package/dist/phoenix/commands/finish-deployment-command.js +1 -1
  464. package/dist/phoenix/commands/index.d.ts +1 -0
  465. package/dist/phoenix/commands/index.js +1 -1
  466. package/dist/phoenix/commands/init-starter-spec.js +3 -4
  467. package/dist/phoenix/commands/init.d.ts +2 -2
  468. package/dist/phoenix/commands/init.js +1 -1
  469. package/dist/phoenix/commands/login.d.ts +6 -3
  470. package/dist/phoenix/commands/login.js +3 -3
  471. package/dist/phoenix/commands/logout.js +1 -1
  472. package/dist/phoenix/commands/prepare-deployment-command.js +2 -2
  473. package/dist/phoenix/commands/prepare-local-environment-command.js +1 -1
  474. package/dist/phoenix/services/cli-credentials.d.ts +26 -7
  475. package/dist/phoenix/services/cli-credentials.js +2 -2
  476. package/dist/phoenix/services/cli-server/describe-saved-logins.d.ts +5 -0
  477. package/dist/phoenix/services/cli-server/describe-saved-logins.js +1 -0
  478. package/dist/phoenix/services/cli-server/index.d.ts +2 -0
  479. package/dist/phoenix/services/cli-server/index.js +1 -0
  480. package/dist/phoenix/services/cli-server/resolve-cli-server-url.d.ts +19 -0
  481. package/dist/phoenix/services/cli-server/resolve-cli-server-url.js +1 -0
  482. package/dist/phoenix/services/development-credential.js +1 -1
  483. package/dist/phoenix/services/frontend-config.d.ts +2 -0
  484. package/dist/phoenix/services/index.d.ts +4 -2
  485. package/dist/phoenix/services/index.js +1 -1
  486. package/dist/phoenix/services/phoenix-regions.d.ts +6 -1
  487. package/dist/phoenix/services/phoenix-regions.js +1 -1
  488. package/dist/phoenix/services/prepare-development-environment.js +1 -1
  489. package/dist/phoenix/services/session/phoenix-application.js +1 -1
  490. package/dist/phoenix/services/signed-in-development-environment.d.ts +15 -4
  491. package/dist/phoenix/services/signed-in-development-environment.js +1 -1
  492. package/dist/phoenix/services/spec-project/describe-workspace-projects.d.ts +11 -0
  493. package/dist/phoenix/services/spec-project/describe-workspace-projects.js +1 -0
  494. package/dist/phoenix/services/spec-project/index.d.ts +3 -0
  495. package/dist/phoenix/services/spec-project/index.js +1 -0
  496. package/dist/phoenix/services/spec-project/resolve-deploy-target.d.ts +47 -0
  497. package/dist/phoenix/services/spec-project/resolve-deploy-target.js +1 -0
  498. package/dist/phoenix/services/spec-project/resolve-target-project.d.ts +34 -0
  499. package/dist/phoenix/services/spec-project/resolve-target-project.js +2 -0
  500. package/dist/phoenix/services/spec-project/write-spec-project.d.ts +7 -0
  501. package/dist/phoenix/services/spec-project/write-spec-project.js +1 -0
  502. package/dist/phoenix/services/telemetry/telemetry-event.js +1 -1
  503. package/dist/phoenix/services/telemetry/telemetry-state.d.ts +1 -1
  504. package/dist/phoenix/services/telemetry/telemetry-state.js +1 -1
  505. package/dist/phoenix/services/variant-file-session.js +1 -1
  506. package/dist/phoenix/services/vite-config.js +1 -1
  507. package/dist/phoenix/services/webhook-service/transport.js +1 -1
  508. package/dist/react-sdk/application-runtime/common-services/index.d.ts +1 -0
  509. package/dist/react-sdk/application-runtime/common-services/index.js +1 -1
  510. package/dist/react-sdk/application-runtime/common-services/selectors.d.ts +2 -0
  511. package/dist/react-sdk/application-runtime/common-services/selectors.js +1 -1
  512. package/dist/react-sdk/application-runtime/common-services/webmcp/index.d.ts +3 -0
  513. package/dist/react-sdk/application-runtime/common-services/webmcp/index.js +1 -0
  514. package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-host.d.ts +35 -0
  515. package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-host.js +1 -0
  516. package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-model-context.d.ts +44 -0
  517. package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-model-context.js +1 -0
  518. package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-tool-result.d.ts +24 -0
  519. package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-tool-result.js +1 -0
  520. package/dist/react-sdk/application-runtime/domain-application-context/application-runtime-extension.d.ts +7 -1
  521. package/dist/react-sdk/application-runtime/domain-application-context/application-runtime-extension.js +1 -1
  522. package/dist/react-sdk/application-runtime/domain-application-context/domain-application-systems.d.ts +2 -2
  523. package/dist/react-sdk/application-runtime/domain-application-context/selectors.d.ts +1 -3
  524. package/dist/react-sdk/application-runtime/domain-application-context/selectors.js +1 -1
  525. package/dist/react-sdk/application-runtime/hooks/index.d.ts +1 -0
  526. package/dist/react-sdk/application-runtime/hooks/index.js +1 -1
  527. package/dist/react-sdk/application-runtime/hooks/use-spec.d.ts +1 -1
  528. package/dist/react-sdk/application-runtime/hooks/use-webmcp-host.d.ts +7 -0
  529. package/dist/react-sdk/application-runtime/hooks/use-webmcp-host.js +1 -0
  530. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  531. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +14 -16
  532. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
  533. package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +5 -6
  534. package/dist/react-sdk/domain-context/common-hooks/use-state-validity.d.ts +1 -1
  535. package/dist/react-sdk/domain-context/common-hooks/use-state-validity.js +1 -1
  536. package/dist/react-sdk/domain-context/index.d.ts +3 -2
  537. package/dist/react-sdk/domain-context/index.js +1 -1
  538. package/dist/react-sdk/domain-context/system-hooks/generate-share-link-hooks.d.ts +1 -5
  539. package/dist/react-sdk/domain-context/system-hooks/generate-share-link-hooks.js +1 -1
  540. package/dist/react-sdk/domain-context/system-hooks/generate-share-link.d.ts +25 -0
  541. package/dist/react-sdk/domain-context/system-hooks/generate-share-link.js +1 -0
  542. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.d.ts +5 -3
  543. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
  544. package/dist/react-sdk/preset-selection/PresetSelectionProvider.d.ts +11 -0
  545. package/dist/react-sdk/preset-selection/PresetSelectionProvider.js +1 -1
  546. package/dist/react-sdk/preset-selection/PresetWebMcpTools.d.ts +14 -0
  547. package/dist/react-sdk/preset-selection/PresetWebMcpTools.js +1 -0
  548. package/dist/react-sdk/preset-selection/index.d.ts +2 -1
  549. package/dist/react-sdk/preset-selection/index.js +1 -1
  550. package/dist/react-sdk/preset-selection/register-preset-webmcp-tools.d.ts +31 -0
  551. package/dist/react-sdk/preset-selection/register-preset-webmcp-tools.js +1 -0
  552. package/dist/ui-sdk/components/preview/Preview.d.ts +12 -4
  553. package/dist/ui-sdk/components/preview/Preview.js +2 -2
  554. package/dist/ui-sdk/components/snackbar/Snackbar.d.ts +3 -2
  555. package/dist/ui-sdk/components/snackbar/Snackbar.js +1 -1
  556. package/dist/ui-sdk/components/toolbar/desktop-toolbar/ToolbarPopper.d.ts +2 -0
  557. package/dist/ui-sdk/components/toolbar/desktop-toolbar/ToolbarPopper.js +1 -1
  558. package/dist/ui-sdk/components/view-controls/ViewControlsContext.d.ts +3 -1
  559. package/dist/ui-sdk/components/view-controls/ViewControlsItem.js +1 -1
  560. package/dist/ui-sdk/components/view-controls/ViewControlsRoot.d.ts +6 -1
  561. package/dist/ui-sdk/components/view-controls/ViewControlsRoot.js +1 -1
  562. package/dist/webhook/builders/auth-handler-builder.d.ts +3 -0
  563. package/dist/webhook/builders/auth-handler-builder.js +1 -1
  564. package/dist/webhook/builders/common.d.ts +3 -1
  565. package/dist/webhook/builders/webhook-builder.d.ts +5 -0
  566. package/dist/webhook/builders/webhook-builder.js +1 -1
  567. package/package.json +9 -4
  568. package/schema/domain-spec.json +444 -65
  569. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/assistant-setup.js +0 -32
  570. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-guidelines.d.ts +0 -2
  571. package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-guidelines.js +0 -25
  572. package/dist/configurator/ui/assistant/annotation/use-end-on-unmount.js +0 -1
  573. package/dist/configurator/ui/assistant/form-elements/FormCard.d.ts +0 -68
  574. package/dist/configurator/ui/assistant/form-elements/FormCard.js +0 -1
  575. package/dist/configurator/ui/assistant/form-elements/FormSwatch.d.ts +0 -61
  576. package/dist/configurator/ui/assistant/form-elements/FormSwatch.js +0 -1
  577. package/dist/domain/domain-context/action-system/action-system.d.ts +0 -64
  578. package/dist/domain/domain-context/action-system/action-system.js +0 -1
  579. package/dist/domain/domain-context/action-system/index.d.ts +0 -1
  580. package/dist/domain/domain-context/action-system/index.js +0 -1
  581. package/dist/domain/domain-runtime/action-factory.d.ts +0 -11
  582. package/dist/domain/domain-runtime/domain-context/action-context.d.ts +0 -11
  583. package/dist/domain/extensions/view-controls.d.ts +0 -25
  584. package/dist/domain/extensions/view-controls.js +0 -1
  585. package/dist/domain/spec/modules/resolve-action-modules.js +0 -1
  586. /package/dist/{domain/domain-runtime/domain-context → configurator/application-runtime/extensions/systems/action-system}/action-context.js +0 -0
  587. /package/dist/{domain/domain-runtime → configurator/application-runtime/extensions/systems/action-system}/action-factory.js +0 -0
@@ -1,16 +1,12 @@
1
1
  # Theming
2
2
 
3
- The SDK uses MUI 5's theming system with pre-configured themes that handle all styling needs.
3
+ Use Phoenix themes to give the configurator consistent brand colors, typography and component styling. Start from a preset and customize it for the product's visual identity.
4
4
 
5
- > **☝️ For FS developers, your focus should be on functionality, not styling details**
5
+ ## Choosing the customization
6
6
 
7
- ## Best Practices
8
-
9
- 1. **Don't Waste Time on UI Details**<br />
10
- Make it work and let the cleaning lady (UI Dev) match the designs.
11
-
12
- 2. **Avoid Theme Style Overrides**<br />
13
- When you need different styling, raise a flag to create proper props or variants rather than overriding styles.
7
+ - Use theme options for shared colors, typography, shape and component defaults or style overrides.
8
+ - Use a custom project layout when the page composition or interaction layout needs to change; see [Custom layout](../?path=/docs/layouts-custom-layout--docs).
9
+ - Keep focus, disabled, error and phone states legible when customizing the appearance.
14
10
 
15
11
  ## YAML Configuration
16
12
 
@@ -19,7 +19,7 @@ Published-data, validator and assistant setup handlers are detected when they re
19
19
  - `createMapPublishedChunkedDataHandler`
20
20
  - `createDataRowValidatorHandler`
21
21
  - `createSheetValidatorHandler`
22
- - `phx.domain.createAssistantSetupHandler`
22
+ - `phx.domain.createAssistantSetupHandler` (see [Per-session Setup](?path=/docs/phoenix-assistant-per-session-setup--docs))
23
23
 
24
24
  ## Pin a Server-Safe Component
25
25
 
@@ -16,7 +16,7 @@ To support project specific finalization workflows, authentication and custom in
16
16
  - **fetchBackendData** - server-side data for the configurator ([Backend Data Handler](#backend-data-handler))
17
17
  - **finalize** - configurator finalization ([Configurator Finalization](#configurator-finalization)) and Admin finalization when an admin publishes from Project Admin ([Admin Finalization](#admin-finalization))
18
18
  - **callback** - the result of a configurator finalization ([Callback Hook / Result](#callback-hook--result))
19
- - **assistantSetup** - the assistant's setup for a session, when the spec configures the assistant
19
+ - **assistantSetup** - the assistant's setup for a session, when the spec configures the assistant ([Per-session Setup](?path=/docs/phoenix-assistant-per-session-setup--docs))
20
20
 
21
21
  Under `phoenix dev` the webhook runs on the developer's machine, and the platform reaches it through the development webhook tunnel instead of the cloud function.
22
22
 
@@ -27,7 +27,7 @@ Phoenix provides domain-aware builders through the global `phx.webhooks` namespa
27
27
  **Available builders and factories:**
28
28
 
29
29
  - `phx.webhooks.authHandlerBuilder` - Authentication handler builder
30
- - `phx.webhooks.webhookBuilder` - Main webhook builder for composing handlers: `withAuthHook`, `withFetchBackendData`, `withConfiguratorFinalize` and `build()`
30
+ - `phx.webhooks.webhookBuilder` - Main webhook builder for composing handlers: `withAuthHook`, `withFetchBackendData`, `withConfiguratorFinalize`, `withConfigurationInsights` and `build()`. The [Precision demo](https://github.com/salsita/configurator-phoenix/blob/develop/packages/demos/demo-precision/README.md#saved-configuration-insights) shows how to publish expressions with `withConfigurationInsights`.
31
31
  - `phx.webhooks.taskFactory` - Factory for creating finalization tasks
32
32
  - `phx.webhooks.finalizeHandlerBuilder` - Configurator finalization handler builder; pass its `build()` result to `withConfiguratorFinalize`
33
33
  - `phx.webhooks.callbackBuilder` - Builder for callback handlers
@@ -38,7 +38,7 @@ There is no builder for Admin finalization: the SDK builds it itself (see [Admin
38
38
 
39
39
  ### Webhook Entry Point
40
40
 
41
- Your webhook is the default export of `src/webhooks/index.ts`. With the application-spec pipeline (see [Current and legacy project tooling](?path=/docs/phoenix-phoenix-cli--docs#current-and-legacy-project-tooling)), the file is yours to create; sync does not write it. A project without it gets a built-in webhook, so it builds and deploys with no webhook code. The built-in webhook has one handler, an anonymous auth handler, which the platform calls only when `spec/application.yaml` sets `useAuthHook`. The legacy pipeline writes the file with that webhook on the first sync.
41
+ Your webhook is the default export of `src/webhooks/index.ts`. With the application-spec pipeline (see [Current and legacy project tooling](?path=/docs/phoenix-phoenix-cli--docs#current-and-legacy-project-tooling)), the file is yours to create; sync does not write it. A project without it gets a built-in webhook, so it builds and deploys with no webhook code. Unless `useCognito` is enabled, the built-in webhook has one handler, an anonymous auth handler, which the platform calls only when `spec/application.yaml` sets `useAuthHook`. The legacy pipeline writes the file with that webhook on the first sync.
42
42
 
43
43
  Create `src/webhooks/index.ts` when the project needs its own handlers: finalization, backend data, or an auth handler that does more than start an anonymous session.
44
44
 
@@ -130,7 +130,7 @@ const GOOGLE_SERVICE_ACCOUNT_JSON = phx.webhooksEnv.GOOGLE_SERVICE_ACCOUNT_JSON
130
130
  ```
131
131
 
132
132
  The values are inlined into the webhook bundle when it is built, so a changed value takes effect only after a restart of `phoenix dev`, or a new deploy on a deployed environment.
133
- Deployed builds take the values from the environment variables a workspace super admin sets in Studio (see [SDK Builder Workflow](?path=/docs/phoenix-sdk-builder-workflow--docs)); `phoenix dev` reads them from the project's `.env`.
133
+ Deployed builds take the values from the environment variables a workspace or project Superadmin sets in Studio (see [SDK Builder Workflow](?path=/docs/phoenix-sdk-builder-workflow--docs)); `phoenix dev` reads them from the project's `.env`.
134
134
 
135
135
  ## Configurator Finalization
136
136
 
@@ -1683,3 +1683,55 @@ Now that you understand Phoenix's webhook system, explore these related topics:
1683
1683
  - **[Best Practices](?path=/docs/phoenix-best-practices--docs)** - Follow proven patterns for webhook implementation and deployment
1684
1684
 
1685
1685
  For hands-on practice, explore webhook examples in the **[demo projects](?path=/docs/phoenix-quickstart--docs)** and finalization workflows.
1686
+
1687
+ ## Cognito configurator sign-in
1688
+
1689
+ Use shared Phoenix accounts when invited dealers should open a configurator and project administrators should edit its catalog. This path requires a Cognito SDK Builder workspace and the current application-spec pipeline. Standard customers and staff retain Clerk; existing `useClerk` and custom handlers keep their defaults.
1690
+
1691
+ Add this to `spec/application.yaml`, then run `phoenix sync` and deploy to your workspace:
1692
+
1693
+ ```yaml
1694
+ useCognito: true
1695
+ sessionData:
1696
+ type: object
1697
+ properties:
1698
+ id:
1699
+ type: string
1700
+ emailAddress:
1701
+ type: string
1702
+ fullName:
1703
+ type:
1704
+ - string
1705
+ - 'null'
1706
+ accessToken:
1707
+ type: string
1708
+ tags:
1709
+ type: array
1710
+ items:
1711
+ type: string
1712
+ required: []
1713
+ additionalProperties: false
1714
+ ```
1715
+
1716
+ `useCognito` enables the auth hook, generated redirect sign-in pages, and the built-in Cognito handler. It cannot be combined with `useClerk: true` or `useAuthHook: false`. An incompatible session schema reports `COGNITO_SESSION_DATA_INCOMPATIBLE`. No custom webhook is needed for an invitation-only project: the built-in webhook refuses anonymous sessions.
1717
+
1718
+ If the project already has a webhook, register its auth hook as usual. The generated auth builder accepts Cognito identities automatically; `withCognitoHandlers()` also enables the handler when assembling a builder manually. Anonymous, custom code and custom refresh handlers compose with it:
1719
+
1720
+ ```typescript
1721
+ const authHandler = phx.webhooks.authHandlerBuilder
1722
+ .withCognitoHandlers()
1723
+ .withAnonymousHandler(async () => ({ success: true, data: {}, role: 'anonymous' }))
1724
+ .build()
1725
+
1726
+ export default phx.webhooks.webhookBuilder.withAuthHook(authHandler).build()
1727
+ ```
1728
+
1729
+ The server redirects through the shared Studio sign-in page, then returns a one-use code to the exact allowed frontend origin, preserving its path and query. A signed-in Studio account may still need to authenticate. A missing project grant opens **Access denied**, with an explicit retry instead of a redirect loop. Project User grants open the configurator; Admin and Superadmin grants also open its admin. Workspace Superadmins inherit every project. Workspace User/Admin membership alone grants no project access and does not grant Builder management access.
1730
+
1731
+ `id` is the stable Phoenix account UUID; the session subject is `phoenix-<id>`. `emailAddress` comes from verified native email, `tags` from the current workspace membership, and `fullName` is currently null. `accessToken` is an empty compatibility field: Cognito credentials never reach project code. Custom fields may be added to the schema, but the server protects identity, role and tags from changes by a webhook.
1732
+
1733
+ Sessions last at most five minutes and refresh through an opaque credential bounded to fifteen minutes from sign-in. Refresh does not renew that authentication deadline; sign in again afterwards. The server checks current account status, membership, project role and tags on each protected API request and refresh. Revocation takes effect on the next API request; changed tags or role require a refresh. This does not retract data already downloaded by the browser. Local sign-out clears the configurator session; the shared provider cookie can still make a later explicit sign-in silent.
1734
+
1735
+ Only the existing public `SERVER_URL` and `DEPLOYMENT_ID` are needed in generated projects. The server owns the pool/client configuration, login callback and credentials. There is no customer OAuth secret or per-customer Cognito client. The server sends resolved identities only over the existing IAM-authenticated Lambda transport or authenticated development tunnel; never expose a production webhook as an unauthenticated HTTP endpoint.
1736
+
1737
+ The Fold `demo-modular-layout` demonstrates Cognito admin sign-in alongside a public anonymous configurator. Its README describes workspace setup and the manual regression flow. Browser-local persistence cannot exercise real Cognito sign-in. Social sign-in/linking, MFA, public signup, custom branding and Standard-customer migration are separate work.
@@ -2,6 +2,8 @@
2
2
 
3
3
  Choose navigation from the structure of the user's decisions, not from the desired visual treatment.
4
4
 
5
+ First establish how buyers construct and modify the product with [Designing the configuration journey](?path=/docs/ux-guidelines-designing-the-configuration-journey--docs). Navigation supports that approach.
6
+
5
7
  ## Compare navigation patterns
6
8
 
7
9
  | Pattern | Use when |
@@ -0,0 +1,43 @@
1
+ # Designing the configuration journey
2
+
3
+ Help buyers understand and configure the product: determine how it is structured, the order in which users make decisions, how those decisions are displayed and how users interact with the configurator.
4
+
5
+ ## Identify the decisions that shape the product
6
+
7
+ Identify the product structure: what it is composed of; which parts are required, optional or repeatable; how they fit spatially; their relationships; and the constraints that affect the experience.
8
+
9
+ ## Establish the flow
10
+
11
+ Establish what users can directly configure, then a logical order for their choices. Each product is unique, but the following is a useful starting point:
12
+
13
+ 1. **The space the product will occupy.** When relevant, this tends to be a hard constraint: cabinets for an alcove need to fit. Many products do not need this.
14
+ 2. **Structural choices.** Anything that changes the overall structure: modules, dimensions and structural components.
15
+ 3. **Accessories, extras and attachments with visual impact.** Users need to understand where these are located and how they look.
16
+ 4. **Aesthetics.** Finishes, colors, materials and fabrics.
17
+ 5. **Other extras without visual impact.** Add-ons for which placement is not relevant, such as items ordered separately.
18
+
19
+ These do not always need separate steps or tabs. Split them only when it makes sense, and combine or reorder them when appropriate. For example, users might add a module and configure all its relevant properties, including color and accessories, at that point.
20
+
21
+ For products composed of multiple parts, also consider how users add, place, select, modify and remove them. Make clear whether a change affects one part or the whole product. When a constraint prevents a choice or causes an automatic adjustment, users need to understand what happened and what they can do next.
22
+
23
+ ## Consider where interactions and information belong
24
+
25
+ ### Scene versus controls
26
+
27
+ For each main action, choose the place where buyers can most clearly understand its target and effect. Configurators have a 3D scene and a 2D interface; selecting a part in the scene does not by itself make construction spatial. For actions tied to a position, prefer a control at that position: adding a neighboring module at an exposed edge, or stacking one above a column. This makes the destination visible before the action. Drag-and-drop can be useful for moving components when the task benefits from direct placement. The scene also helps communicate positional or dimensional information, such as dimensions and the location of specific components.
28
+
29
+ Choosing a destination and choosing an option can be separate interactions. For example, an add control above a column can open a menu of compatible module sizes; selecting one adds it at that location and makes it the editing target. Several size choices do not by themselves require moving the construction action into a permanent panel.
30
+
31
+ The 2D interface suits properties that do not belong to a specific position in the scene, more complex choices such as swatches or cards with many options, and information about what has been selected, such as a list of modules. It can also provide controls for editing a selected part. A panel or list may work better for obscured targets, dense arrangements or actions that need more explanation. Evaluate that tradeoff against the task rather than inheriting the placement from the existing layout.
32
+
33
+ ### Context
34
+
35
+ Context is especially important for complex configurators with many options. Display the information users need for what they are doing. Some information may be relevant only on a specific step or tab, or when a particular part is selected.
36
+
37
+ Consider navigation and selection together, so users have the information they need without being overwhelmed. Keep scene actions contextual so they do not obscure the product or compete with camera gestures. Check that targets remain discoverable and usable on a phone; a complementary list can help without moving every construction action out of the scene.
38
+
39
+ Different arrangements of panels can support the same interactions. When considering alternative ways to configure a product, look at how they change the task itself: the actions users take, the clarity of placement and how easily they can correct a choice. Trying a typical task through the controls, including a constraint case, reveals problems that screenshots or product-rule tests alone cannot show. Consider both desktop and phone use.
40
+
41
+ ## Related reading
42
+
43
+ Use [Choosing Navigation](?path=/docs/ux-guidelines-choosing-navigation--docs) to group and order decisions, [Choosing a Control](?path=/docs/ux-guidelines-choosing-a-control--docs) for individual inputs, and [Canvas and Feedback](?path=/docs/ux-guidelines-canvas-and-feedback--docs) for selection and scene behavior. [Presets](?path=/docs/ux-guidelines-presets--docs) covers starting arrangements.
@@ -9,7 +9,7 @@ Modes remove controls that do not apply to the user's current task. Treat each m
9
9
  | Footer | Only when edits affect price | Price only, when relevant | Finalization actions | Hidden |
10
10
  | Selection and scene FABs | Selection remains available | Disabled | Disabled | Disabled |
11
11
  | Tool controls | Hidden | Hidden | Hidden | Hidden |
12
- | View controls | Hidden | When relevant | When relevant | Desktop only |
12
+ | View controls | Hidden | When relevant | When relevant | Desktop; nested on mobile |
13
13
  | Undo and redo | Project-dependent | Hidden | Hidden | Hidden |
14
14
  | Exit | Explicit focus exit | Not applicable | Navigation-owned | Explicit full-screen exit |
15
15
 
@@ -35,6 +35,6 @@ Use [Choosing Navigation](?path=/docs/ux-guidelines-choosing-navigation--docs#su
35
35
  - The recommended full-screen toolbar contains exit, change measure, language, and reset camera when those actions apply. Do not include undo/redo or sharing.
36
36
  - Treat full-screen preview as view-only: filter project-defined preset navigation and footer content, selectable geometry, and scene FABs out of full-screen mode, including when the user enters with an active selection.
37
37
 
38
- On desktop, Phoenix hides its built-in header, sidebar, and tool controls in full-screen mode while keeping view controls available. On mobile, it also hides view controls. Both layouts keep the 3D model, camera interaction, and a reduced toolbar.
38
+ On desktop, Phoenix hides its built-in header, sidebar, and tool controls in full-screen mode while keeping view controls available. On mobile, fullscreen hides flat view controls and keeps nested view menus available. Both layouts keep the 3D model, camera interaction, and a reduced toolbar.
39
39
 
40
40
  “Full-screen preview” here means the in-configurator viewing mode, not the host integration's full-screen widget placement.
@@ -6,24 +6,26 @@ The guidelines describe decisions and behavior that a project can apply. Built-i
6
6
 
7
7
  ## How to use the guidelines
8
8
 
9
- 1. Choose the project's navigation, interaction modes, controls, and finalization flow before implementing individual screens.
9
+ 1. Establish the configuration journey, then choose navigation, interaction modes, controls and any finalization flow that serves its outcome.
10
10
  2. Read the relevant pattern pages and linked component examples.
11
11
  3. Reference the applicable guideline page or section in acceptance criteria and reviews. Mark guidance that does not apply rather than silently skipping it.
12
12
  4. Record intentional project-specific deviations with their reason.
13
13
 
14
14
  ## Find the right guidance
15
15
 
16
- | Designing | Start with |
17
- | --------------------------------------------------- | -------------------------------------------------------------------------- |
18
- | The preset entry screen | [Presets](?path=/docs/ux-guidelines-presets--docs) |
19
- | Simple navigation, tabs, or an ordered flow | [Choosing Navigation](?path=/docs/ux-guidelines-choosing-navigation--docs) |
20
- | Focus, view-only, summary, or full-screen behavior | [Interaction Modes](?path=/docs/ux-guidelines-interaction-modes--docs) |
21
- | A selector or dimension input | [Choosing a Control](?path=/docs/ux-guidelines-choosing-a-control--docs) |
22
- | Canvas appearance, camera behavior, or selection | [Canvas and Feedback](?path=/docs/ux-guidelines-canvas-and-feedback--docs) |
23
- | Submission, add-to-cart, or another completion flow | [Finalization](?path=/docs/phoenix-finalization--docs) |
16
+ | Designing | Start with |
17
+ | --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
18
+ | How buyers construct and modify the product | [Designing the configuration journey](?path=/docs/ux-guidelines-designing-the-configuration-journey--docs) |
19
+ | The preset entry screen | [Presets](?path=/docs/ux-guidelines-presets--docs) |
20
+ | Simple navigation, tabs, or an ordered flow | [Choosing Navigation](?path=/docs/ux-guidelines-choosing-navigation--docs) |
21
+ | Focus, view-only, summary, or full-screen behavior | [Interaction Modes](?path=/docs/ux-guidelines-interaction-modes--docs) |
22
+ | A selector or dimension input | [Choosing a Control](?path=/docs/ux-guidelines-choosing-a-control--docs) |
23
+ | Canvas appearance, camera behavior, or selection | [Canvas and Feedback](?path=/docs/ux-guidelines-canvas-and-feedback--docs) |
24
+ | Submission, add-to-cart, or another completion flow | [Finalization](?path=/docs/phoenix-finalization--docs) |
24
25
 
25
26
  ## Review checklist
26
27
 
28
+ - Users can complete typical tasks and understand how to resolve invalid choices.
27
29
  - The chosen navigation matches whether groups are independent or ordered.
28
30
  - Every active mode has an explicit entry, exit, and visibility contract.
29
31
  - Project-defined loading, empty, error, and success states give users a clear next action.
@@ -272,6 +272,11 @@ export interface ApplicationConfig<ENTITIES extends DomainEntity<string>, ALLOWE
272
272
  /** The `src/handlers/` and `src/elements/` files as project modules; the runtime spec validates and flattens both. */
273
273
  readonly handlers: readonly ProjectModule[];
274
274
  readonly elements: readonly ProjectModule[];
275
+ /**
276
+ * The `src/actions/` files as project modules, carried to the runtime spec unresolved. Only the
277
+ * browser assembly sets them; the configurator's action system resolves and validates them.
278
+ */
279
+ readonly actions: readonly ProjectModule[];
275
280
  /** The SDK's default element registrations; a project element with the same name replaces one. */
276
281
  readonly defaultElements?: readonly ElementRegistration[];
277
282
  readonly mount: MountConfig<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, CHAT_CONTEXT, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES>;
@@ -0,0 +1,22 @@
1
+ import type { AssistantManifest, AssistantResolvedManifest } from '../../spec/index.js';
2
+ /**
3
+ * The assistant object type that stands for every entity of a type the manifest does not expose:
4
+ * it implements only `AnyDomainEntity`, and its `type` field names the entity's real type.
5
+ */
6
+ export declare const ASSISTANT_OTHER_ENTITY = "OtherEntity";
7
+ /**
8
+ * The entity types the assistant schema gives their own object type, in model order: the root types,
9
+ * and every type an assistant section names, directly or through an alias. Naming `AnyDomainEntity`
10
+ * exposes every type. `names` are the keys of the `entities`, `writable`, `deletable`, `childRecipes`,
11
+ * `replaceRecipes`, `screenshots` and `navigation.select` sections. The resolver computes them from
12
+ * the spec and the session setup again from its narrowed sections.
13
+ */
14
+ export declare const assistantExposedTypes: (names: Iterable<string>, { entityTypes, aliases }: Pick<AssistantResolvedManifest, 'entityTypes' | 'aliases'>) => readonly string[];
15
+ /**
16
+ * Whether the assistant sees an entity of this type in detail: its type has its own object type,
17
+ * which its entry in the manifest's field table says. Change results and the change record list
18
+ * only such entities.
19
+ */
20
+ export declare const isAssistantVisible: ({ type }: {
21
+ readonly type: string;
22
+ }, { fields }: Pick<AssistantManifest, 'fields'>) => boolean;
@@ -0,0 +1 @@
1
+ export const ASSISTANT_OTHER_ENTITY="OtherEntity";export const assistantExposedTypes=(t,{entityTypes:s,aliases:e})=>{let n=[...t,"RootEntity"];return s.filter(t=>n.some(s=>s===t||Object.entries(e).some(([e,n])=>e===s&&n.includes(t))))};export const isAssistantVisible=({type:t},{fields:s})=>Object.hasOwn(s,t);
@@ -0,0 +1,30 @@
1
+ import type { DomainEntity, DomainEntityId, DomainState, StateUpdate } from '../../core/index.js';
2
+ import type { AnyNavigationSystem } from '../../domain-context/index.js';
3
+ import type { AssistantSelectTarget } from '../../spec/index.js';
4
+ type AnyDomainState = DomainState<DomainEntity<string>>;
5
+ type AnyStateUpdate = StateUpdate<DomainEntity<string>, DomainEntity<string>>;
6
+ /**
7
+ * What the assistant reads and changes the selection through: the navigation system for the
8
+ * selected entity and the updates that change it, and whether the UI lets the user select an entity
9
+ * in a state. The latter is read from the UI components, which the domain does not know, so the
10
+ * configurator runtime hands it in.
11
+ */
12
+ export interface AssistantSelectionContext {
13
+ readonly navigationSystem: Pick<AnyNavigationSystem, 'getActiveSelectionState' | 'getSelectUpdate' | 'getDeselectUpdate'>;
14
+ readonly isOfferedForSelection: (entityId: DomainEntityId<string>, state: AnyDomainState) => boolean;
15
+ }
16
+ /**
17
+ * Whether the agent can select `entity` in `state`: its type is exposed for selection, and the UI
18
+ * lets the user select it there, by a `selectable` component or a select hotspot on it.
19
+ */
20
+ export declare const isAssistantSelectable: (entity: DomainEntity<string>, state: AnyDomainState, { isOfferedForSelection }: Pick<AssistantSelectionContext, 'isOfferedForSelection'>, select: readonly AssistantSelectTarget[]) => boolean;
21
+ /**
22
+ * What `select` changes: the update that selects the entity `entityId` the way the UI selects it;
23
+ * none when it is selected already. Throws, saying which, for an unknown id, an entity of a type the
24
+ * manifest does not expose for selection, and an entity the UI does not let the user select in
25
+ * `state`.
26
+ */
27
+ export declare const prepareSelectUpdates: (entityId: string, state: AnyDomainState, { navigationSystem, isOfferedForSelection }: AssistantSelectionContext, select: readonly AssistantSelectTarget[]) => readonly AnyStateUpdate[];
28
+ /** What `deselect` changes: the update that clears the selection back to the root; none when the root is selected already. */
29
+ export declare const prepareDeselectUpdates: (state: AnyDomainState, { navigationSystem }: Pick<AssistantSelectionContext, 'navigationSystem'>) => readonly AnyStateUpdate[];
30
+ export {};
@@ -0,0 +1 @@
1
+ let e=e=>[...new Set(e.flatMap(({entityTypes:e})=>e))];export const isAssistantSelectable=(t,n,{isOfferedForSelection:i},o)=>e(o).includes(t.type)&&i(t.id,n);export const prepareSelectUpdates=(t,n,{navigationSystem:i,isOfferedForSelection:o},r)=>{let s=n.entities.find(e=>e.id===t);if(!s)throw Error(`Entity "${t}" does not exist, so it cannot be selected. It may have been deleted by an earlier operation or field. Query the current entities and use an id they return.`);let a=e(r);if(!a.includes(s.type))throw Error(`Entity "${t}" is a ${s.type}, which cannot be selected. Only entities of these types can be selected: ${a.join(", ")}. Select an entity of one of them instead.`);if(s.id===i.getActiveSelectionState(n))return[];if(!o(s.id,n))throw Error(`Entity "${t}" cannot be selected right now, so nothing was changed. Read meta { selectable } to see which entities can be selected now.`);return[i.getSelectUpdate(s.id)]};export const prepareDeselectUpdates=(e,{navigationSystem:t})=>t.getActiveSelectionState(e)===e.rootEntityId?[]:[t.getDeselectUpdate()];
@@ -1,5 +1,5 @@
1
- import{NoUnusedFragmentsRule as e,parse as t,specifiedRules as i,validate as n}from"graphql";let s="AnyDomainEntity",r=[{name:"RecipeGroup",description:"A recipe group with its recipes, without their dry-runs.",selections:["groupId","name","description","recipes { ...Recipe }"]},{name:"Recipe",description:"A recipe without its dry-run.",selections:["key","name","description","imageUrl"]},{name:"FieldOption",description:"A value a field accepts, without its dry-run.",selections:["value","name","description","imageUrl","color"]},{name:"DryRun",description:"What a dry-run would do, with the ids of the entities it would change instead of the entities.",selections:["ok","deletedEntityIds","sideEffects","warnings","errors { type entityId message }","changedEntities { id }"]}],a=(e,t)=>0===t?e:`${e}__${t}`,l=e=>e.split("\n").map(e=>`# ${e}`.trimEnd()).join("\n"),o=(e,t,i)=>[`fragment ${e} on ${t} {`,...i.map(e=>` ${e}`),"}"].join("\n"),p=(e,t,i)=>{let n=e=>"edge"===e.type.kind?`${e.name} { ${i} }`:e.name;return o(e,s,["id",...t.flatMap(({typeName:e,fields:t})=>e===s?t.map(n):[`... on ${e} {`,...t.map(e=>` ${n(e)}`),"}"])])};export const buildAssistantLenses=(d,m)=>{let c=Object.entries(d.lenses).flatMap(([e,t])=>{let i=[s,...Object.keys(d.aliases).filter(e=>e!==s),...d.entityTypes].flatMap(t=>{let i=(d.fields[t]??[]).filter(t=>t.lenses?.includes(e));return i.length>0?[{typeName:t,fields:i}]:[]});return i.length>0?[{name:e,...t,conditions:i}]:[]}),$=r.filter(({name:e})=>void 0!==m.getType(e)),h=[...c.map(({name:e,description:t,maxDepth:i,conditions:n})=>{let s=n.some(({fields:e})=>e.some(e=>"edge"===e.type.kind));return`${l(s?`${t} ${`Nested relations carry the same selection up to ${i} ${1===i?"level":"levels"}, below that only \`id\`.`}`:t)}
2
- ${p(e,n,`...${e}`)}`}),...$.map(({name:e,description:t,selections:i})=>`${l(t)}
3
- ${o(e,e,i)}`)].join("\n\n"),u=[...c.flatMap(({name:e,maxDepth:t,conditions:i})=>Array.from({length:t+1},(n,s)=>p(a(e,s),i,s<t?`...${a(e,s+1)}`:"id"))),...$.map(({name:e,selections:t})=>o(e,e,t))].join("\n\n");if(""!==u){let s=c.length>0?`entities { ${c.map(({name:e})=>`...${e}`).join(" ")} }`:"__typename",r=n(m,t(`${u}
1
+ import{NoUnusedFragmentsRule as e,parse as t,specifiedRules as i,validate as n}from"graphql";let r="AnyDomainEntity",s=[{name:"RecipeGroup",description:"A recipe group with its recipes, without their dry-runs.",selections:["groupId","name","description","recipes { ...Recipe }"]},{name:"Recipe",description:"A recipe without its dry-run.",selections:["key","name","description","imageUrl"]},{name:"FieldOption",description:"A value a field accepts, without its dry-run.",selections:["value","name","description","imageUrl","color"]},{name:"DryRun",description:"What a dry-run would do, with the ids of the entities it would change instead of the entities.",selections:["ok","deletedEntityIds","sideEffects","warnings","errors","changedEntities { id }"]}],a=(e,t)=>0===t?e:`${e}__${t}`,o=e=>e.split("\n").map(e=>`# ${e}`.trimEnd()).join("\n"),l=(e,t,i)=>[`fragment ${e} on ${t} {`,...i.map(e=>` ${e}`),"}"].join("\n"),p=(e,t,i)=>{let n=e=>"edge"===e.type.kind?`${e.name} { ${i} }`:e.name;return l(e,r,["id",...t.flatMap(({typeName:e,fields:t})=>e===r?t.map(n):[`... on ${e} {`,...t.map(e=>` ${n(e)}`),"}"])])};export const buildAssistantLenses=(d,m)=>{let c=Object.entries(d.lenses).flatMap(([e,t])=>{let i=[r,...Object.keys(d.aliases).filter(e=>e!==r),...d.entityTypes].flatMap(t=>{let i=(d.fields[t]??[]).filter(t=>t.lenses?.includes(e));return i.length>0&&void 0!==m.getType(t)?[{typeName:t,fields:i}]:[]});return i.length>0?[{name:e,...t,conditions:i}]:[]}),$=s.filter(({name:e})=>void 0!==m.getType(e)),h=[...c.map(({name:e,description:t,maxDepth:i,conditions:n})=>{let r=n.some(({fields:e})=>e.some(e=>"edge"===e.type.kind));return`${o(r?`${t} ${`Nested relations carry the same selection up to ${i} ${1===i?"level":"levels"}, below that only \`id\`.`}`:t)}
2
+ ${p(e,n,`...${e}`)}`}),...$.map(({name:e,description:t,selections:i})=>`${o(t)}
3
+ ${l(e,e,i)}`)].join("\n\n"),u=[...c.flatMap(({name:e,maxDepth:t,conditions:i})=>Array.from({length:t+1},(n,r)=>p(a(e,r),i,r<t?`...${a(e,r+1)}`:"id"))),...$.map(({name:e,selections:t})=>l(e,e,t))].join("\n\n");if(""!==u){let r=c.length>0?`entities { ${c.map(({name:e})=>`...${e}`).join(" ")} }`:"__typename",s=n(m,t(`${u}
4
4
 
5
- { ${s} }`),i.filter(t=>t!==e));if(r.length>0)throw Error(`The lens fragments generated from "assistant.lenses" are not valid GraphQL: ${[...new Set(r.map(e=>e.message))].join(" ")}`)}return{declarations:h,definitions:u}};
5
+ { ${r} }`),i.filter(t=>t!==e));if(s.length>0)throw Error(`The lens fragments generated from "assistant.lenses" are not valid GraphQL: ${[...new Set(s.map(e=>e.message))].join(" ")}`)}return{declarations:h,definitions:u}};
@@ -1,3 +1,3 @@
1
- import type { AssistantManifest, AssistantResolvedManifest } from '../../spec/index.js';
1
+ import type { AssistantResolvedManifest, BuiltAssistantManifest } from '../../spec/index.js';
2
2
  /** Constructs the schema and runtime sources exclusively from serializable resolved data. */
3
- export declare const buildAssistantManifest: (resolved: AssistantResolvedManifest) => Required<AssistantManifest>;
3
+ export declare const buildAssistantManifest: (resolved: AssistantResolvedManifest) => BuiltAssistantManifest;
@@ -1 +1 @@
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 d,printSchema as c,validateSchema as l}from"graphql";import{GraphQLJSON as h,createAssistantValueType as y}from"./assistant-value-type.js";import{buildAssistantLenses as w}from"./build-assistant-lenses.js";import{createAssistantExecutionSchema as u}from"./create-assistant-execution-schema.js";let g="AnyDomainEntity",f="RootEntity",m=[["navigationState","Active navigation state.","navigationStates"],["viewState","Active view state.","viewStates"],["toolState","Active tool state.","toolStates"]],b={section:"childRecipes",mutation:"addChild",typeSuffix:"ChildRecipes"},v={section:"replaceRecipes",mutation:"replaceEntity",typeSuffix:"ReplaceRecipes"},$=(e,t)=>Object.entries(e).find(([e])=>e===t)?.[1],j=(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,list:t,nullable:n},i)=>{let s=t?new r(new o(i(e))):i(e);return n?s:new o(s)},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(d),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):y(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=new o(new r(new o(h))),T=' Each is { type, severity, entityId, message }: severity is "warning" or "notice", entityId the entity it is on or null, message the warning as the user would be told it or null.',I={sameForAllInstances:e=>`Same recipes for every ${e}.`,constantDuringSession:()=>"Fixed for the session."},S={sameForAllInstances:e=>`Same for every ${e}.`,constantDuringSession:()=>"Fixed for the session."},N=(e,t,n)=>e.map(e=>` ${t[e](n)}`).join(""),A=({section:e,typeSuffix:t},n,{entityType:i,purpose:s,recipeGroup:r})=>0===n.length?{}:{[e]:{type:new o(new a({name:`${i}${t}`,fields:Object.fromEntries(n.map(({groupId:e,description:t,dryRuns:n,hints:s})=>{let o;return[e,{type:r,description:`${!(o=t?.trim())?"":/[.!?]$/.test(o)?`${o} `:`${o}. `}Null while the configurator does not offer it on the entity.${n?"":" Cannot be dry-run."}${N(s,I,i)}`}]}))})),description:`The recipe groups for ${s} this ${i}, one field each.`}},M=({entityType:e,childRecipes:n,replaceRecipes:i,optionsEdges:s,screenshots:p,hasInvariants:d},{recipeGroup:c,fieldOption:l,screenshot:y})=>new a({name:`${e}Meta`,fields:Object.assign(A(b,n,{entityType:e,purpose:"adding children to",recipeGroup:c}),A(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(l)),args:{values:{type:new r(new o(h)),description:"Only the options with these values; values not listed are ignored."}},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."}${N(a,S,e)}`}})),0===p.length?{}:{screenshot:{type:y,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`. Null when the view does not apply to this entity right now."}},d?{warnings:{type:k,description:`The warnings and notices this ${e} has right now.${T}`}}:{})}),D=(e,t)=>t?e?"What can be done to this entity right now, and its warnings.":"The warnings of this entity right now.":"What can be done to this entity right now.",W=e=>Object.entries(e).map(([e,t])=>`${e} (${t.map(({groupId:e})=>e).join(", ")})`);export const buildAssistantManifest=t=>{var I,S,N,A,x;let C,F,q,G,{entityTypes:U,aliases:K,exampleType:P,fields:V,states:z,deletableTypes:L,writableTypes:Q,actionFields:B,optionsEdges:H,invariantTypes:J}=t,{childRecipes:X,replaceRecipes:Y}=t,Z=new Map,_=new Map,ee=new Map,et=e=>{let[t,...n]=Object.entries(K).find(([t])=>t===e)?.[1]??[];return(t&&0===n.length?_.get(t):void 0)??ee.get(e)??ei},en=e=>_.get(e)??et(e),ei=new s({name:g,description:"Every entity of the configuration.",fields:()=>E(V[g]??[],en,P)});for(let e of(ee.set(g,ei),Object.keys(K)))e!==g&&ee.set(e,new s({name:e,interfaces:[ei],fields:()=>E(V[e]??[],en)}));let es={};for(let e of U){let t=[g,...Object.entries(K).filter(([t,n])=>t!==g&&n.includes(e)).map(([e])=>e)],n=V[e]??[];es[e]=R(n),_.set(e,new a({name:e,interfaces:t.flatMap(e=>ee.get(e)??[]),fields:()=>{let t=Z.get(e);return{...E(n,en),...t?{meta:{type:new o(t.type),description:t.description}}:{}}}}))}let er=(I=()=>et(ee.has(f)?f:g),S=()=>et(g),C=new a({name:"DryRunError",description:"One reason a change cannot be made right now.",fields:{type:{type:new o(d),description:"Kind of the problem."},entityId:{type:n,description:"The entity the problem is on, when it is on one."},message:{type:d,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:I(),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(S()))),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(d))),description:"The major or unexpected things the configurator would change along with it; empty when ok is false."},warnings:{type:k,description:`The warnings and notices the change would newly cause, which do not stop it; empty when ok is false.${T}`},errors:{type:new o(new r(new o(C))),description:"Why the change cannot be made; empty when ok is true."}})})),eo={recipeGroup:(N=[...Object.keys(X).length>0?[b.mutation]:[],...Object.keys(Y).length>0?[v.mutation]:[]],F=N.join(" or "),q=new a({name:"Recipe",description:`${N.includes("addChild")?"One thing that can be added to the entity (under childRecipes)":"One thing the entity can be replaced with (under replaceRecipes)"}${N.length>1?" or that it can be replaced with (under replaceRecipes)":""}.`,fields:{key:{type:new o(d),description:`Pass to ${F} as recipeKey, or to recipes(keys:) to read this recipe again.`},name:{type:new o(d),description:"Name shown to the user."},description:{type:d},imageUrl:{type:d,description:"Thumbnail shown to the user."},dryRun:{type:er,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(d),description:`Pass to ${F} as recipeGroupId.`},name:{type:new o(d),description:"Name shown to the user."},description:{type:d},recipes:{type:new o(new r(new o(q))),args:{keys:{type:new r(new o(d)),description:"Only the recipes with these keys; keys not in the group are ignored."}}}}})),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:d,description:"Name shown to the user."},description:{type:d},imageUrl:{type:d,description:"Image shown to the user."},color:{type:d,description:'Color shown to the user, as "#rrggbb".'},dryRun:{type:er,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 U){let n=$(X,e)??[],i=$(Y,e)??[],s=$(H,e)??[],r=$(t.screenshots,e)??[],o=J.includes(e),a=n.length>0||i.length>0||s.length>0||r.length>0;(a||o)&&Z.set(e,{description:D(a,o),type:M({entityType:e,childRecipes:n,replaceRecipes:i,optionsEdges:s,screenshots:r,hasInvariants:o},eo)})}let ea=new p({query:(A=et(ee.has(f)?f:g),x=et(g),G=(e=>{let t={};for(let[n,i,s]of m){let r=e[s];r.length>1&&(t[n]={type:new o(d),description:j(i,r)})}if(0!==Object.keys(t).length)return new a({name:"Navigation",description:"The active UI states of the configurator.",fields:t})})(z),new a({name:"Query",fields:{root:{type:new o(A),description:"The root entity of the configuration."},entities:{type:new o(new r(x)),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(x),description:"The selected entity, or the root entity when nothing is selected."},...G?{navigation:{type:new o(G)}}:{},warnings:{type:k,description:`Every warning and notice of the configuration the query reads.${T}`}}})),mutation:(({deletableTypes:e,writableTypes:t,childRecipes:s,replaceRecipes:p,actionFields:c,objectTypes:l,anyDomainEntity:h,targetOutputType:w})=>{let u,g;if(0!==e.length||0!==t.length||0!==Object.keys(s).length||0!==Object.keys(p).length||0!==c.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=W(s)).length?{}:{addChild:{type:new o(new r(new o(h))),args:{parentId:{type:new o(n)},recipeGroupId:{type:new o(d)},recipeKey:{type:new o(d)}},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===(g=W(p)).length?{}:{replaceEntity:{type:new o(new r(new o(h))),args:{entityId:{type:new o(n)},recipeGroupId:{type:new o(d)},recipeKey:{type:new o(d)}},description:`Replaces the entity entityId from a recipe listed under its meta { replaceRecipes }. Types with replace recipes: ${g.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:y(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(c.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?O(t,w):y(t.type),description:t.description}]))})),args:Object.fromEntries(Object.entries(e.args).map(([e,t])=>[e,{type:y(t.type),description:t.description}])),description:e.description}]})))})})({deletableTypes:L,writableTypes:Q,childRecipes:X,replaceRecipes:Y,actionFields:B,objectTypes:_,anyDomainEntity:et(g),targetOutputType:en}),types:[...ee.values(),..._.values()]}),ep=l(ea);if(ep.length>0)throw Error(ep.map(e=>e.message).join(" "));let ed=c(ea);return{sdl:ed,navigationFields:m.filter(([,,e])=>z[e].length>1).map(([e])=>e),fields:es,deletableTypes:L,writableFields:Object.fromEntries(Q.map(({entityType:e,fields:t})=>[e,Object.fromEntries(t.map(({name:e,property:t})=>[e,t]))])),childRecipes:X,replaceRecipes:Y,fieldOptions:Object.fromEntries(U.flatMap(e=>{let t=$(H,e);return t?[[e,t.map(({options:e})=>e)]]:[]})),screenshots:Object.fromEntries(U.flatMap(e=>{let n=$(t.screenshots,e);return n?[[e,n]]:[]})),actions:Object.fromEntries(B.map(({fieldName:e,actionName:t})=>[e,t])),lenses:w(t,u(ed)),formElements:t.formElements}};
1
+ import{GraphQLBoolean as e,GraphQLEnumType as t,GraphQLID as n,GraphQLInputObjectType as i,GraphQLInterfaceType as s,GraphQLList as o,GraphQLNonNull as a,GraphQLObjectType as r,GraphQLSchema as d,GraphQLString as h,printSchema as l,validateSchema as c}from"graphql";import{ASSISTANT_OTHER_ENTITY as p}from"./assistant-exposure.js";import{GraphQLJSON as y,createAssistantValueType as w}from"./assistant-value-type.js";import{buildAssistantLenses as g}from"./build-assistant-lenses.js";import{createAssistantExecutionSchema as u}from"./create-assistant-execution-schema.js";let f="AnyDomainEntity",m="RootEntity",v={section:"childRecipes",mutation:"addChild",typeSuffix:"ChildRecipes"},b={section:"replaceRecipes",mutation:"replaceEntity",typeSuffix:"ReplaceRecipes"},$=(e,t)=>Object.entries(e).find(([e])=>e===t)?.[1],S=({target:e,list:t,nullableItems:n,nullable:i},s)=>{let r=s(e),d=t?new o(n?r:new a(r)):r;return i?d:new a(d)},j=()=>void 0,O=(e,t)=>{if(void 0===t)return e;let n=`Accepts the values listed under meta { ${t} }.`;return e?`${e}${/[.!?]$/.test(e)?"":"."} ${n}`:n},E=(e,t)=>{let n=e.map(e=>$(t,e)??[]);return e=>{let[t,...i]=n.map(t=>t.find(t=>t.options.field===e)?.options.edgeName);return void 0!==t&&i.every(e=>e===t)?t:void 0}},R=(e,t,{exampleType:i,optionsEdgeOf:s=j}={})=>{let o={id:{type:new a(n),description:i?`Unique id of the entity, assigned by the configurator, e.g. "${i}-1".`:void 0},type:{type:new a(h),description:i?`Entity type name, e.g. "${i}".`:void 0}};for(let n of e)o[n.name]="edge"===n.type.kind?{type:S(n.type,t),description:n.description}:{type:w(n.type.type),description:O(n.description,s(n.name))};return o},k=e=>Object.fromEntries(e.map(({name:e,source:t,localized:n})=>[e,n?{source:t,localized:!0}:{source:t}])),T=(e,n)=>n.length>0?new t({name:e,values:Object.fromEntries(n.map(({name:e,description:t})=>[e,{description:t}]))}):void 0,A=e=>({type:new a(new o(new a(e)))}),I=new a(new o(new a(y))),N=' Each is { type, severity, entityId, message }: severity is "warning" or "notice", entityId the entity it is on or null, message the warning as the user would be told it or null.',M={sameForAllInstances:e=>`Same recipes for every ${e}.`,constantDuringSession:()=>"Fixed for the session."},x={sameForAllInstances:e=>`Same for every ${e}.`,constantDuringSession:()=>"Fixed for the session."},W=(e,t,n)=>e.map(e=>` ${t[e](n)}`).join(""),C=({section:e,typeSuffix:t},n,{entityType:i,purpose:s,recipeGroup:o})=>0===n.length?{}:{[e]:{type:new a(new r({name:`${i}${t}`,fields:Object.fromEntries(n.map(({groupId:e,description:t,dryRuns:n,hints:s})=>{let a;return[e,{type:o,description:`${!(a=t?.trim())?"":/[.!?]$/.test(a)?`${a} `:`${a}. `}Null while the configurator does not offer it on the entity.${n?"":" Cannot be dry-run."}${W(s,M,i)}`}]}))})),description:`The recipe groups for ${s} this ${i}, one field each.`}},D=({entityType:n,childRecipes:i,replaceRecipes:s,optionsEdges:d,screenshots:h,selectable:l,hasInvariants:c},{recipeGroup:p,fieldOption:w,screenshot:g})=>new r({name:`${n}Meta`,fields:Object.assign(C(v,i,{entityType:n,purpose:"adding children to",recipeGroup:p}),C(b,s,{entityType:n,purpose:"replacing",recipeGroup:p}),...d.map(({options:{edgeName:e,field:t,validate:i,dryRuns:s},hints:r})=>({[e]:{type:new o(new a(w)),args:{values:{type:new o(new a(y)),description:"Only the options with these values; values not listed are ignored."}},description:`Values "${t}" accepts on this ${n}. Null when there is no choice to make.${i?"":" Not checked on write."}${s?"":" Cannot be dry-run."}${W(r,x,n)}`}})),0===h.length?{}:{screenshot:{type:g,args:{view:{type:new a(new t({name:`${n}ScreenshotView`,values:Object.fromEntries(h.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`. Null when the view does not apply to this entity right now."}},l?{selectable:{type:new a(e),description:`Whether the user can select this ${n} right now, so select(id:) can select it.`}}:{},c?{warnings:{type:I,description:`The warnings and notices this ${n} has right now.${N}`}}:{})}),F=(e,t)=>t?e?"What can be done to this entity right now, and its warnings.":"The warnings of this entity right now.":"What can be done to this entity right now.",q=e=>Object.entries(e).map(([e,t])=>`${e} (${t.map(({groupId:e})=>e).join(", ")})`);export const buildAssistantManifest=t=>{var M;let x,W,C,U,V,K,{entityTypes:G,aliases:P,exampleType:z,fields:B,states:L,deletableTypes:Q,writableTypes:H,actionFields:J,navigation:X,optionsEdges:Y,invariantTypes:Z}=t,{childRecipes:_,replaceRecipes:ee}=t,et=t.exposedTypes??G,en=new Map,ei=new Map,es=new Map,eo=e=>{let[t,...n]=Object.entries(P).find(([t])=>t===e)?.[1]??[];return(t&&0===n.length?ei.get(t):void 0)??es.get(e)??er},ea=e=>ei.get(e)??eo(e),er=new s({name:f,description:"Every entity of the configuration.",fields:()=>R(B[f]??[],ea,{exampleType:z,optionsEdgeOf:et.length===G.length?E(G,Y):j})});for(let[e,t]of(es.set(f,er),Object.entries(P)))e!==f&&t.every(e=>et.includes(e))&&es.set(e,new s({name:e,interfaces:[er],fields:()=>R(B[e]??[],ea,{optionsEdgeOf:E(t,Y)})}));let ed={};for(let e of et){let t=[f,...Object.entries(P).filter(([t,n])=>t!==f&&n.includes(e)).map(([e])=>e)],n=B[e]??[];ed[e]=k(n),ei.set(e,new r({name:e,interfaces:t.flatMap(e=>es.get(e)??[]),fields:()=>{let t=en.get(e);return{...R(n,ea,{optionsEdgeOf:E([e],Y)}),...t?{meta:{type:new a(t.type),description:t.description}}:{}}}}))}let eh=et.length<G.length?new r({name:p,description:"An entity of a type this schema does not describe in detail: `type` names its type, and only the fields of AnyDomainEntity can be read.",interfaces:[er],fields:()=>R(B[f]??[],ea,{exampleType:z})}):void 0;eh&&(ed[p]=k(B[f]??[]));let el=(x=()=>eo(es.has(m)?m:f),W=()=>eo(f),new r({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 a(e),description:"Whether the change would succeed on the configuration the query reads."},root:{type:x(),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 a(new o(new a(W()))),description:"Entities the change would add or modify: the ones it changes itself, whatever their type, and the others of the types this schema describes in detail; 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 a(new o(new a(n))),description:"The ids of the entities the change would remove: the ones it removes itself, whatever their type, and the others of the types this schema describes in detail; empty when ok is false."},sideEffects:{type:new a(new o(new a(h))),description:"The major or unexpected things the configurator would change along with it; empty when ok is false."},warnings:{type:I,description:`The warnings and notices the change would newly cause, which do not stop it; empty when ok is false.${N}`},errors:{type:I,description:"Why the change cannot be made; empty when ok is true. Each is { type, entityId, message, details? }: type the kind of problem, entityId the entity it is on or null, message the problem as the user would be told it, and details what this change in particular would do, only when it says more than message."}})})),ec={recipeGroup:(M=[...Object.keys(_).length>0?[v.mutation]:[],...Object.keys(ee).length>0?[b.mutation]:[]],C=M.join(" or "),U=new r({name:"Recipe",description:`${M.includes("addChild")?"One thing that can be added to the entity (under childRecipes)":"One thing the entity can be replaced with (under replaceRecipes)"}${M.length>1?" or that it can be replaced with (under replaceRecipes)":""}.`,fields:{key:{type:new a(h),description:`Pass to ${C} as recipeKey, or to recipes(keys:) to read this recipe again.`},name:{type:new a(h),description:"Name shown to the user."},description:{type:h},imageUrl:{type:h,description:"Thumbnail shown to the user."},dryRun:{type:el,description:"What using this recipe would do. Null when it cannot be tried."}}}),new r({name:"RecipeGroup",description:"A group of recipes for this entity.",fields:{groupId:{type:new a(h),description:`Pass to ${C} as groupId.`},name:{type:new a(h),description:"Name shown to the user."},description:{type:h},recipes:{type:new a(new o(new a(U))),args:{keys:{type:new o(new a(h)),description:"Only the recipes with these keys; keys not in the group are ignored."}}}}})),fieldOption:new r({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 a(y),description:"The value to write to the field."},name:{type:h,description:"Name shown to the user."},description:{type:h},imageUrl:{type:h,description:"Image shown to the user."},color:{type:h,description:'Color shown to the user, as "#rrggbb".'},dryRun:{type:el,description:"What writing this value would do. Null when it cannot be tried."}}}),screenshot:new r({name:"Screenshot",description:"A screenshot of an entity. The picture itself follows the tool result.",fields:{image:{type:new a(n),description:"Label of the image that follows the tool result."}}})};for(let e of et){let n=$(_,e)??[],i=$(ee,e)??[],s=$(Y,e)??[],o=$(t.screenshots,e)??[],a=Z.includes(e),r=t.select.some(t=>t.entityTypes.includes(e)),d=n.length>0||i.length>0||s.length>0||o.length>0||r;(d||a)&&en.set(e,{description:F(d,a),type:D({entityType:e,childRecipes:n,replaceRecipes:i,optionsEdges:s,screenshots:o,selectable:r,hasInvariants:a},ec)})}let ep={navigationState:T("NavigationState",X.navigationStates),viewState:T("ViewState",X.viewStates),toolState:T("ToolState",X.toolStates)},ey=((e,t)=>{let n={...e.navigationStates.length>1?{navigationState:{type:new a(h),description:t.navigationState?"Active navigation state; it may be one `NavigationState` does not list.":"Active navigation state."}}:{},...e.viewStates.length>1?{viewState:{type:new a(h),description:t.viewState?"Active view state; it may be one `ViewState` does not list.":"Active view state."}}:{},...e.toolStates.length>1?{toolState:{type:new a(h),description:t.toolState?"Active tool state; it may be one `ToolState` does not list.":"Active tool state."}}:{},...(({navigationState:e,viewState:t,toolState:n})=>e||t||n?{available:{type:new a(new r({name:"AvailableNavigation",description:"The states the user can be moved to right now, besides the active ones.",fields:{...e?{navigationStates:A(e)}:{},...t?{viewStates:A(t)}:{},...n?{toolStates:A(n)}:{}}}))}}:{})(t)};if(0!==Object.keys(n).length)return new r({name:"Navigation",description:"The active UI states of the configurator.",fields:n})})(L,ep),ew=new d({query:(V=eo(es.has(m)?m:f),K=eo(f),new r({name:"Query",fields:{root:{type:new a(V),description:"The root entity of the configuration."},entities:{type:new a(new o(K)),args:{ids:{type:new o(new a(n))}},description:"Every entity, or the given ids in order with null for an unknown id."},selectedEntity:{type:new a(K),description:"The selected entity, or the root entity when nothing is selected."},...ey?{navigation:{type:new a(ey)}}:{},warnings:{type:I,description:`Every warning and notice of the configuration the query reads.${N}`}}})),mutation:(({deletableTypes:t,writableTypes:s,childRecipes:d,replaceRecipes:l,actionFields:c,navigationMutations:p,selectionMutations:y,objectTypes:g,optionsEdges:u,anyDomainEntity:f,targetOutputType:m})=>{let v,b;if(0!==t.length||0!==s.length||0!==Object.keys(d).length||0!==Object.keys(l).length||0!==c.length||0!==Object.keys(p).length||0!==Object.keys(y).length)return new r({name:"Mutation",fields:Object.assign(0===t.length?{}:{deleteEntity:{type:new a(new o(new a(n))),args:{id:{type:new a(n)}},description:`Deletes the entity and everything composed into it. Deletable types: ${t.join(", ")}. Returns the ids removed, the given one first, then the others of the types this schema describes in detail.`}},0===(v=q(d)).length?{}:{addChild:{type:new a(new o(new a(f))),args:{parentId:{type:new a(n)},groupId:{type:new a(h)},recipeKey:{type:new a(h)}},description:`Adds a child to the entity parentId from a recipe listed under its meta { childRecipes }. Types with child recipes: ${v.join("; ")}. Returns the entities added, the recipe's own first, then the others of the types this schema describes in detail; empty when they were removed again.`}},0===(b=q(l)).length?{}:{replaceEntity:{type:new a(new o(new a(f))),args:{entityId:{type:new a(n)},groupId:{type:new a(h)},recipeKey:{type:new a(h)}},description:`Replaces the entity entityId from a recipe listed under its meta { replaceRecipes }. Types with replace recipes: ${b.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, then the others of the types this schema describes in detail; empty when they were removed again.`}},...s.flatMap(e=>{let t=g.get(e.entityType);return t?[(({entityType:e,fields:t},s,o)=>{let r=Object.fromEntries(t.map(({name:e,type:t,description:n})=>[e,{type:w(t),description:O(n,o(e))}]));return{[`modify${e}`]:{type:s,args:{id:{type:new a(n)},delta:{type:new a(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,E([e.entityType],u))]:[]}),Object.fromEntries(c.map(t=>{var n,i;return[t.fieldName,{type:new a(t.result?(n=t.fieldName,i=t.result,new r({name:`${n.charAt(0).toUpperCase()+n.slice(1)}Result`,description:`What ${n} returns, read from the configuration after the change.`,fields:()=>Object.fromEntries(Object.entries(i).map(([e,t])=>[e,{type:"edge"===t.kind?S(t,m):w(t.type),description:t.description}]))})):e),args:Object.fromEntries(Object.entries(t.args).map(([e,t])=>[e,{type:w(t.type),description:t.description}])),description:t.result?t.description:[t.description,"Returns true once the change is applied."].filter(Boolean).join("\n\n")}]})),p,y)})})({deletableTypes:Q,writableTypes:H,childRecipes:_,replaceRecipes:ee,actionFields:J,navigationMutations:(({navigationState:e,viewState:t,toolState:n},i)=>i?{...e?{navigate:{type:new a(i),args:{to:{type:new a(e)}},description:"Switches the page the user is on to one listed under navigation { available { navigationStates } }; setting the active one changes nothing. Returns the navigation after the switch."}}:{},...t?{setView:{type:new a(i),args:{to:{type:new a(t)}},description:"Switches the view the user sees to one listed under navigation { available { viewStates } }; setting the active one changes nothing. Returns the navigation after the switch."}}:{},...n?{setTool:{type:new a(i),args:{to:{type:new a(n)}},description:"Switches the tool the user works with to one listed under navigation { available { toolStates } }; setting the active one changes nothing. Returns the navigation after the switch."}}:{}}:{})(ep,ey),selectionMutations:((e,t)=>{if(0===e.length)return{};let i=e.map(({name:e,description:t})=>void 0===t?e:`${e}: ${t}`);return{select:{type:new a(t),args:{id:{type:new a(n)}},description:`Selects the entity id, as the user does by clicking it, when its meta { selectable } is true; selecting the selected entity changes nothing. Types that can be selected: ${i.join("; ")}. Returns the selected entity.`},deselect:{type:new a(t),description:"Clears the selection, so the root entity is selected. Returns the selected entity."}}})(t.select,eo(f)),objectTypes:ei,optionsEdges:Y,anyDomainEntity:eo(f),targetOutputType:ea}),types:[...es.values(),...ei.values(),...eh?[eh]:[]]}),eg=c(ew);if(eg.length>0)throw Error(eg.map(e=>e.message).join(" "));let eu=l(ew);return{sdl:eu,navigationFields:[...L.navigationStates.length>1?["navigationState"]:[],...L.viewStates.length>1?["viewState"]:[],...L.toolStates.length>1?["toolState"]:[]],navigation:X,select:t.select,fields:ed,deletableTypes:Q,writableFields:Object.fromEntries(H.map(({entityType:e,fields:t})=>[e,Object.fromEntries(t.map(({name:e,property:t})=>[e,t]))])),childRecipes:_,replaceRecipes:ee,fieldOptions:Object.fromEntries(G.flatMap(e=>{let t=$(Y,e);return t?[[e,t.map(({options:e})=>e)]]:[]})),screenshots:Object.fromEntries(G.flatMap(e=>{let n=$(t.screenshots,e);return n?[[e,n]]:[]})),actions:Object.fromEntries(J.map(({fieldName:e,actionName:t})=>[e,t])),lenses:g(t,u(eu)),formElements:t.formElements,...void 0!==t.instructions&&{instructions:t.instructions},webmcp:!1!==t.webmcp,features:t.features}};
@@ -1,5 +1,21 @@
1
1
  import { type AssistantFormElementDescriptor, type AssistantManifest } from '../../spec/index.js';
2
2
  /** How the prompt writes an element: its tag with each attribute and what it takes. Exported for tests. */
3
- export declare const formElementSignature: ({ name, role, attributes }: AssistantFormElementDescriptor) => string;
3
+ export declare const formElementSignature: ({ name, role, attributes, labelled }: AssistantFormElementDescriptor) => string;
4
+ /**
5
+ * Who reads the generated prompt: `panel` is the configurator's own assistant, which the server
6
+ * prompts with it and whose replies the panel renders; `webmcp` is an outside agent in the user's
7
+ * browser that reads it from the `configurator_guide` WebMCP tool. That agent has no panel, so its
8
+ * prompt leaves out links, forms, drawings, the reply rules, annotations and the `[changes]` block, and names
9
+ * the WebMCP tools.
10
+ */
11
+ export type AssistantPromptSurface = 'panel' | 'webmcp';
12
+ /**
13
+ * How {@link generateAssistantPrompt} writes the prompt. `voice` is the session's effective `ai.voice`, which the
14
+ * browser never sees: only with it does the panel prompt teach spoken messages.
15
+ */
16
+ export interface AssistantPromptOptions {
17
+ readonly surface: AssistantPromptSurface;
18
+ readonly voice?: boolean;
19
+ }
4
20
  /** SDK-version conventions for using the manifest's capabilities and reading their results. */
5
- export declare const generateAssistantPrompt: (assistant: AssistantManifest) => string;
21
+ export declare const generateAssistantPrompt: (assistant: AssistantManifest, { surface, voice }?: AssistantPromptOptions) => string;
@@ -1 +1 @@
1
- import{ASSISTANT_BUILT_IN_FORM_ELEMENTS as e}from"../../spec/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),o=Object.values(a.replaceRecipes??{}).some(e=>e.length>0),i=Object.values(a.fieldOptions??{}).some(e=>e.length>0),r=Object.keys(a.actions??{}).length>0,h=Object.values(a.screenshots??{}).some(e=>e.length>0),l=(a.deletableTypes?.length??0)>0||Object.values(a.writableFields??{}).some(e=>Object.keys(e).length>0)||s||o||r,d=s||o||i,c=[...s?["`childRecipes` is what can be added to it"]:[],...o?["`replaceRecipes` what it can be replaced with"]:[],...i?["`<field>Options` the values a field accepts"]:[]],u=["`selected`",...(a.navigationFields??[]).map(e=>`\`${e}\``)].join(", ");return[["Tools","- Put related operations in one call and select only the fields you need.",`- Give every ${l?"`query` and `apply` call":"`query` call"} a \`title\` of two to five words in the user's language that says what it does for them, e.g. ${l?'"Add two drawers"':'"Compare drawer prices"'}.`,...l?[`- Use a mutation inside \`query\` to answer a what-if about a change ${d?"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. A change the configuration does not allow fails with one error per reason, as the user would be told it.","- Warnings and notices never make anything fail. The root `warnings` field lists every current one, and `meta { warnings }` those of one entity, where its type has them."],...l?[["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.","- `warnings` lists the warnings and notices your change newly causes. They do not block it: tell the user about them, and offer a fix when one is clear.","- 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."]:[]]]:[],...d?[["What can be done to an entity",`- \`meta\` lists what is possible right now: ${c.join(", ")}. Read the list before such a change and before telling the user what is available.`,`- You can select \`dryRun\` on ${[...s||o?["recipes"]:[],...i?["options"]:[]].join(" or ")} to look ahead and pick one that meets what the user asked for. It is optional before a change.`,`- Select only the ${[...s||o?["recipe groups"]:[],...i?["options edges"]:[]].join(" and ")} you need. To read again only the ones you are deciding between, pass ${[...s||o?["their `key` to `recipes(keys:)`"]:[],...i?["their `value` to `<field>Options(values:)`"]:[]].join(" or ")}.`,"- Read the lists again after a change, unless their descriptions say they stay the same."]]:[],...h?[["Seeing the design","- `meta { screenshot(view: …) { image } }` renders an entity from one of the views its `<Type>ScreenshotView` lists. The picture follows the tool result.","- Take one when the user asks how the design looks, or when you are not sure something is laid out right: what sits where, what overlaps or lines up. Otherwise rely on the data.","- Each one costs tokens and blocks the user's configurator while it renders."]]:[],["Images from the user","- The user may attach photos or reference images to a message, such as their room or a design they like.","- Sizes you read from a photo are estimates: tell the user the values you read and confirm them before you apply them.","- An image the message calls an annotation is marked up by the user: the red strokes are drawn by the user, and each numbered red pin marks the place its comment, listed by number before the message, is about.","- An annotation of the configurator view is the user's own current view of the configurator, not one of the screenshot views. An annotation of an image marks up an image, such as one of your drawings."],["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 ${u} 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.",...l?["- 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||o?["- 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${l?", 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.",...d?["- 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. Only a drawing holds markup.","- 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."],["Drawings","- You can draw a schematic for the user: a fenced code block with the language `svg` that holds one SVG document. The panel shows it as a picture, and the user can open it larger beside the chat.","- Draw when a schematic explains better than words, such as a layout seen from above, dimensions or clearances, or a comparison of options, or when the user or the instructions of this configurator ask for one. Never draw what the product looks like: the user sees it in the configurator.","- At most one drawing per reply.",'- The root is `<svg xmlns="http://www.w3.org/2000/svg" viewBox="…">`, and its first child is a `<title>` that says what the drawing shows.',"- Paint the background first with a `<rect>` that covers the whole `viewBox`, and give every fill and stroke an explicit colour, never `currentColor` or a CSS variable.","- The picture is as wide as the chat panel, about 360 px: keep text at least 14 px tall at that width, and use generic font families such as `sans-serif`.","- A drawing runs no script and loads nothing: no `<script>`, event attributes, `<foreignObject>`, external links or images.","- Keep it simple: a drawing that is not well-formed SVG, or is over 200 KB, is not shown.","- The user can annotate a drawing to give you feedback on it: their message then carries it as an annotation of an image."],["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")};
1
+ import{ASSISTANT_BUILT_IN_FORM_ELEMENTS as e}from"../../spec/index.js";let t=[["Containers",["group","choice","choices"]],["Options",["option"]],["Inputs",["input"]]];export const formElementSignature=({name:e,role:t,attributes:a,labelled:n})=>{let s=[...!1===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} ${s.join(" ")} />`:`<${e} ${s.join(" ")}>…</${e}>`};export const generateAssistantPrompt=(a,{surface:n,voice:s}={surface:"panel"})=>{let o,i="panel"===n,{drawings:r,forms:h,images:l,annotations:d}=a.features,c=[...r?["a drawing"]:[],...h?["a form"]:[]].join(" or "),u=i?"`query`":"`configurator_query`",w=i?"`apply`":"`configurator_apply`",g=Object.values(a.childRecipes??{}).some(e=>e.length>0),p=Object.values(a.replaceRecipes??{}).some(e=>e.length>0),m=Object.values(a.fieldOptions??{}).some(e=>e.length>0),f=Object.keys(a.actions??{}).length>0,y=Object.values(a.screenshots??{}).some(e=>e.length>0),b=(a.deletableTypes?.length??0)>0||Object.values(a.writableFields??{}).some(e=>Object.keys(e).length>0)||g||p||f,k=[...(a.navigation?.navigationStates.length??0)>0?["`navigate`"]:[],...(a.navigation?.viewStates.length??0)>0?["`setView`"]:[],...(a.navigation?.toolStates.length??0)>0?["`setTool`"]:[]],v=k.length>0,$=(a.select?.length??0)>0,T=b||v||$,x=g||p||m,A=[...g?["`childRecipes` is what can be added to it"]:[],...p?["`replaceRecipes` what it can be replaced with"]:[],...m?["`<field>Options` the values a field accepts"]:[]],j=["`selected`",...(a.navigationFields??[]).map(e=>`\`${e}\``)].join(", ");return[["Tools","- Put related operations in one call and select only the fields you need.",`- Give every ${T?`${u} and ${w} call`:`${u} call`} a \`title\` of two to five words in the user's language that says what it does for them, e.g. ${b?'"Add two drawers"':'"Compare drawer prices"'}.`,...b?[`- Use a mutation inside ${u} to answer a what-if about a change ${x?"the lists under `meta` do not show":"before making it"}.`,`- Use ${w} only for what the user asked for.`,"- Every change can be undone and refined later. When the request is clear, make the change without asking. Ask only about what you cannot tell, all of it in one question, and offer to make the change in the same question. A yes to what you proposed is the go-ahead: apply it, do not ask again."]:["- Nothing in this configurator can be changed through you. Say so when the user asks for a change."],...v?[`- ${w} also runs ${k.join(", ")}: each switches what the user sees to one of the states \`navigation { available }\` lists. They change nothing in the configuration and run even while it is read-only.`]:[],...$?[`- ${w} also runs \`select\` and \`deselect\`: \`select\` selects an entity whose \`meta { selectable }\` is true, as the user does by clicking it, and \`deselect\` goes back to the root. They change nothing in the configuration and run even while it is read-only.`]:[],"- When an operation fails, its `errors` say why and what to send instead. A change the configuration does not allow fails with one error per reason, as the user would be told it.","- Warnings and notices never make anything fail. The root `warnings` field lists every current one, and `meta { warnings }` those of one entity, where its type has them."],...b?[["After a change","- The user sees each change in the configurator as soon as it is made. Say briefly what you changed and what needs their attention, not what it now looks like or what stayed the same.",`- A change is made only when the ${w} 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.","- `warnings` lists the warnings and notices your change newly causes. They do not block it: tell the user about them, and offer a fix when one is clear.","- A mutation returns the state after the change: use the ids and values it returned, not the ones you sent.",...f?["- When one mutation does the whole of what the user asked, use it instead of building the same change from several others."]:[]]]:[],...x?[["What can be done to an entity",`- \`meta\` lists what is possible right now: ${A.join(", ")}. Read the list before such a change and before telling the user what is available.`,`- You can select \`dryRun\` on ${[...g||p?["recipes"]:[],...m?["options"]:[]].join(" or ")} to look ahead and pick one that meets what the user asked for. It is optional before a change.`,`- Select only the ${[...g||p?["recipe groups"]:[],...m?["options edges"]:[]].join(" and ")} you need. To read again only the ones you are deciding between, pass ${[...g||p?["their `key` to `recipes(keys:)`"]:[],...m?["their `value` to `<field>Options(values:)`"]:[]].join(" or ")}.`,"- Read the lists again after a change, unless their descriptions say they stay the same."]]:[],...y?[["Seeing the design","- `meta { screenshot(view: …) { image } }` renders an entity from one of the views its `<Type>ScreenshotView` lists. The picture follows the tool result.","- Take one when the user asks how the design looks, or when you are not sure something is laid out right: what sits where, what overlaps or lines up. Otherwise rely on the data.","- Each one costs tokens and blocks the user's configurator while it renders."]]:[],...!i||l||d?[["Images from the user","- The user may attach photos or reference images to a message, such as their room or a design they like.","- Sizes you estimate from a photo of a real space or object, such as their room, are estimates: tell the user the values you read and confirm them before you apply them.",...i&&d?["- An image the message calls an annotation is marked up by the user: the red strokes are drawn by the user, and each numbered red pin marks the place its comment, listed by number before the message, is about.",`- An annotation of the configurator view is the user's own current view of the configurator, not one of the screenshot views. An annotation of an image marks up an image${r?", such as one of your drawings":""}.`]:[]]]:[],...i?[["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 ${j} 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.",...T?["- 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||p?["- 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${b?", never write it":""}.`,"- Numbers are in the unit the field description names. Convert when the user uses another unit."],...i?[["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.",...x?["- 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.${r?" Only a drawing holds markup.":""}`,"- 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."],...r?[["Drawings","- You can draw a schematic for the user: a fenced code block with the language `svg` that holds one SVG document. The panel shows it as a picture, and the user can open it larger beside the chat.","- Draw when a schematic explains better than words, such as a layout seen from above, dimensions or clearances, or a comparison of options, or when the user or the instructions of this configurator ask for one. Never draw what the product looks like or the result of a change you made: the user sees it in the configurator. Draw to plan or explain, before a change.","- At most one drawing per reply. A drawing costs much more than text: after the user corrects one, say in a sentence what changed instead of drawing it again, unless they ask for a new drawing.",'- The root is `<svg xmlns="http://www.w3.org/2000/svg" viewBox="…">`, and its first child is a `<title>` that says what the drawing shows.',"- Paint the background first with a `<rect>` that covers the whole `viewBox`, and give every fill and stroke an explicit colour, never `currentColor` or a CSS variable.","- The picture is as wide as the chat panel, about 360 px: keep text at least 14 px tall at that width, and use generic font families such as `sans-serif`.","- A drawing runs no script and loads nothing: no `<script>`, event attributes, `<foreignObject>`, external links or images.","- Keep it simple: a drawing that is not well-formed SVG, or is over 50 KB, is not shown.",...d?["- The user can annotate a drawing to give you feedback on it: their message then carries it as an annotation of an image."]:[]]]:[],...h?[["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.",'- The user can always write in the chat instead of answering, so ask an open question in your reply, never with a form whose only element is a `text` or `number` input, and never add one for comments, corrections, details or "other". Use one only next to other questions, for a value with a clear form, such as a width or a name.',"- An element whose signature lists `label` takes 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.",...x?["- To offer recipes or options you read from `meta`, give each a `tile`, never a `reply`: the panel shows its name and its picture, color or description, and picks how it looks. A `ref` that names nothing the configuration offers now makes the whole form fail. A tile answers with its name: map it back to its key or value yourself."]:[],...(o=[...e.filter(({name:e})=>x||"tile"!==e),...a.formElements??[]],t.flatMap(([e,t])=>{let a=o.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)}`)]}))]]:[],...!0===s?[["Spoken messages","- A user message that starts with `(Spoken.)` is a speech-to-text transcript, and your reply to it is read aloud. One that starts with `(Typed.)` was typed, and your reply to it is not read aloud.","- The thread starts typed, and a marker holds until the next one: a user message without one is spoken or typed like the user message before it.","- Write the text of the reply to be heard: brief, in a few plain sentences, without lists, tables, inline code or Markdown formatting. Links are fine: only their text is read.",...""!==c?[`- ${c.charAt(0).toUpperCase()}${c.slice(1)} is shown but not read aloud. Use one whenever it helps,${h?" especially a form when the user would otherwise have to dictate a choice,":""} and say in the text that it is there, such as "${h?"pick one below":"see the drawing below"}".`]:[],'- Write numbers and units the way they are said, such as "800 millimetres" rather than "800 mm", and avoid symbols.',"- A word may be misheard: read the message for what the user most likely meant in this conversation, and when a misheard word could change what you would apply, ask before applying it."]]:[]]:[],...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,6 +1,10 @@
1
+ export { ASSISTANT_OTHER_ENTITY, assistantExposedTypes, isAssistantVisible } from './assistant-exposure.js';
1
2
  export { buildAssistantManifest } from './build-assistant-manifest.js';
2
3
  export type { AssistantFieldExposure } from './create-assistant-execution-schema.js';
3
4
  export { AssistantFieldClashError, createAssistantExecutionSchema } from './create-assistant-execution-schema.js';
4
- export { generateAssistantPrompt } from './generate-assistant-prompt.js';
5
+ export { type AssistantPromptOptions, type AssistantPromptSurface, generateAssistantPrompt, } from './generate-assistant-prompt.js';
5
6
  export * from './session-setup/index.js';
6
7
  export { describeAssistantValues, mergeAssistantFields, resolveAssistantField } from './assistant-fields.js';
8
+ export { prepareNavigateUpdates, prepareSetToolUpdates, prepareSetViewUpdates, } from './prepare-assistant-navigation-updates.js';
9
+ export { type AssistantNavigationContext, type AssistantOfferedNavigation, readAssistantNavigation, } from './read-assistant-navigation.js';
10
+ export { type AssistantSelectionContext, isAssistantSelectable, prepareDeselectUpdates, prepareSelectUpdates, } from './assistant-selection.js';
@@ -1 +1 @@
1
- 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";
1
+ export{ASSISTANT_OTHER_ENTITY,assistantExposedTypes,isAssistantVisible}from"./assistant-exposure.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{prepareNavigateUpdates,prepareSetToolUpdates,prepareSetViewUpdates}from"./prepare-assistant-navigation-updates.js";export{readAssistantNavigation}from"./read-assistant-navigation.js";export{isAssistantSelectable,prepareDeselectUpdates,prepareSelectUpdates}from"./assistant-selection.js";
@@ -0,0 +1,16 @@
1
+ import type { DomainEntity, DomainState, StateUpdate } from '../../core/index.js';
2
+ import type { AssistantNavigation } from '../../spec/index.js';
3
+ import type { AssistantNavigationContext } from './read-assistant-navigation.js';
4
+ type AnyDomainState = DomainState<DomainEntity<string>>;
5
+ type AnyStateUpdate = StateUpdate<DomainEntity<string>, DomainEntity<string>>;
6
+ /**
7
+ * What `navigate` changes: the update that moves the user to the exposed navigation state `name`,
8
+ * pushed on the history stack when only a hotspot that pushes offers it, as the hotspot does, and
9
+ * replacing the active state otherwise; none when it is active already.
10
+ */
11
+ export declare const prepareNavigateUpdates: (name: string, state: AnyDomainState, { navigationSystem, readOfferedNavigation }: AssistantNavigationContext, navigation: AssistantNavigation) => readonly AnyStateUpdate[];
12
+ /** What `setView` changes: the update to the exposed view state `name`; none when it is active already. */
13
+ export declare const prepareSetViewUpdates: (name: string, state: AnyDomainState, { navigationSystem, readOfferedNavigation }: AssistantNavigationContext, navigation: AssistantNavigation) => readonly AnyStateUpdate[];
14
+ /** What `setTool` changes: the update to the exposed tool state `name`; none when it is active already. */
15
+ export declare const prepareSetToolUpdates: (name: string, state: AnyDomainState, { navigationSystem, readOfferedNavigation }: AssistantNavigationContext, navigation: AssistantNavigation) => readonly AnyStateUpdate[];
16
+ export {};
@@ -0,0 +1 @@
1
+ let t=({label:t,name:e,targets:a,offered:o,activeState:s})=>{let i=a.find(t=>t.name===e);if(!i)throw Error(`The schema declares the ${t} "${e}", but the configurator has no state of that name. This is a fault in the configurator, not in your request. Tell the user this is not available.`);if(i.state!==s){if(!o.has(i.state)){let i=a.filter(t=>t.state!==s&&o.has(t.state)).map(t=>`"${t.name}"`);throw Error(`The ${t} "${e}" is not available right now, so nothing was changed. ${i.length>0?`The ${t}s available now are: ${i.join(", ")}; set one of them instead.`:`No other ${t} is available now.`}`)}return i}};export const prepareNavigateUpdates=(e,a,{navigationSystem:o,readOfferedNavigation:s},i)=>{let r=s(a),n=t({label:"navigation state",name:e,targets:i.navigationStates,offered:r.navigationStates,activeState:o.getActiveNavigationState(a)});return n?r.pushedNavigationStates.has(n.state)?[o.getPushNavigationUpdate(n.state,a,{canStackOnto:r.pushedNavigationStates.get(n.state)})]:[o.getNavigationUpdate(n.state)]:[]};export const prepareSetViewUpdates=(e,a,{navigationSystem:o,readOfferedNavigation:s},i)=>{let r=t({label:"view state",name:e,targets:i.viewStates,offered:s(a).viewStates,activeState:o.getActiveViewState(a)});return r?[o.getViewUpdate(r.state)]:[]};export const prepareSetToolUpdates=(e,a,{navigationSystem:o,readOfferedNavigation:s},i)=>{let r=t({label:"tool state",name:e,targets:i.toolStates,offered:s(a).toolStates,activeState:o.getActiveToolState(a)});return r?[o.getToolUpdate(r.state)]:[]};