@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.
- package/README.md +10 -3
- package/dist/application-spec/errors/diagnostic-codes.d.ts +8 -0
- package/dist/application-spec/errors/diagnostic-codes.js +1 -1
- package/dist/application-spec/errors/diagnostic-messages.d.ts +9 -1
- package/dist/application-spec/errors/diagnostic-messages.js +1 -1
- package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
- package/dist/application-spec/generate-application/code/standalone-app-files.js +1 -1
- package/dist/application-spec/generate-application/code/templates/admin-config.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/admin-config.js +3 -2
- package/dist/application-spec/generate-application/code/templates/application-types.js +5 -5
- package/dist/application-spec/generate-application/code/templates/configurator-config.js +4 -2
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js +6 -8
- package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.js +8 -6
- package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.d.ts +1 -4
- package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.js +2 -2
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +26 -29
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +0 -3
- package/dist/application-spec/generate-application/code/templates/domain.js +3 -3
- package/dist/application-spec/generate-application/code/templates/frontend-config.js +7 -3
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.d.ts +3 -3
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.js +3 -3
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.d.ts +10 -6
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.js +7 -7
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +11 -12
- package/dist/application-spec/generate-application/code/templates/skills/core/cli.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/core/sdk.js +3 -2
- package/dist/application-spec/generate-application/code/templates/skills/core/workflow.js +13 -11
- package/dist/application-spec/generate-application/code/templates/skills/features/application-states/views-and-tools.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/assistant/index.d.ts +3 -0
- package/dist/application-spec/generate-application/code/templates/skills/features/assistant/index.js +1 -0
- package/dist/application-spec/generate-application/code/templates/skills/features/assistant/panel.d.ts +3 -0
- package/dist/application-spec/generate-application/code/templates/skills/features/assistant/panel.js +42 -0
- package/dist/application-spec/generate-application/code/templates/skills/features/assistant/reading-and-changing.d.ts +3 -0
- package/dist/application-spec/generate-application/code/templates/skills/features/assistant/reading-and-changing.js +55 -0
- package/dist/application-spec/generate-application/code/templates/skills/features/{webhooks/assistant-setup.d.ts → assistant/session-setup.d.ts} +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/assistant/session-setup.js +16 -0
- package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/custom-layout.js +3 -3
- package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/pages.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/pages.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/domain-controls/custom-controls.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/domain-controls/scene-controls.js +4 -2
- package/dist/application-spec/generate-application/code/templates/skills/features/domain-model/actions.js +3 -3
- package/dist/application-spec/generate-application/code/templates/skills/features/domain-model/expressions.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/features.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/state/violations.js +2 -2
- package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/authentication.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/entry-and-environment.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/webhooks.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/guide.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +3 -3
- package/dist/application-spec/generate-application/code/templates/skills/processes/asset-conversion.js +3 -3
- package/dist/application-spec/generate-application/code/templates/skills/processes/assistant-configuration.d.ts +3 -0
- package/dist/application-spec/generate-application/code/templates/skills/processes/assistant-configuration.js +3 -0
- package/dist/application-spec/generate-application/code/templates/skills/processes/feedback/report.js +29 -1
- package/dist/application-spec/generate-application/code/templates/skills/processes/finalization.js +2 -2
- package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/build.js +29 -15
- package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/direction.js +17 -14
- package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/first-draft.js +2 -2
- package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/handoff.js +3 -3
- package/dist/application-spec/generate-application/code/templates/skills/processes/index.d.ts +2 -0
- package/dist/application-spec/generate-application/code/templates/skills/processes/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/processes/model-migration.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/processes/review/appearance.js +2 -2
- package/dist/application-spec/generate-application/code/templates/skills/processes/review/code.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/processes/review/review.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/processes/review/visual-inspection.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/processes/scene-realism.d.ts +2 -0
- package/dist/application-spec/generate-application/code/templates/skills/processes/scene-realism.js +29 -0
- package/dist/application-spec/generate-application/code/templates/skills/processes/specification/product-definition.js +2 -0
- package/dist/application-spec/generate-application/code/templates/skills/processes/specification/specification.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-specification.d.ts +2 -0
- package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-specification.js +28 -0
- package/dist/application-spec/generate-application/code/templates/webhook-builders.js +7 -6
- package/dist/application-spec/generate-application/code/templates/webhook-index.d.ts +2 -1
- package/dist/application-spec/generate-application/code/templates/webhook-index.js +2 -2
- package/dist/application-spec/parse-application-files/merge/merged-app-metadata.d.ts +3 -0
- package/dist/application-spec/parse-application-files/merge/merged-app-metadata.js +1 -1
- package/dist/application-spec/parse-application-files/merge/merged-assistant.js +1 -1
- package/dist/application-spec/parse-application-files/parse-application-files.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-actions.d.ts +3 -2
- package/dist/application-spec/parse-application-files/raw-spec/raw-actions.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +66 -7
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-components.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.d.ts +6 -3
- package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
- package/dist/application-spec/parse-application-files/resolve/resolve-import-modules.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.js +1 -1
- package/dist/application-spec/parse-application-files/spec/model/session-data-schema.js +1 -1
- package/dist/application-spec/parse-application-files/spec/relations/relations.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/actions.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/app-metadata.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.d.ts +14 -2
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +7 -10
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-server-settings.d.ts +5 -6
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-server-settings.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/index.d.ts +0 -1
- package/dist/application-spec/webhook-boundary.js +1 -1
- package/dist/client/cli-client/cli-api-client.d.ts +17 -0
- package/dist/client/cli-client/cli-api-client.js +1 -0
- package/dist/client/cli-client/index.d.ts +2 -0
- package/dist/client/cli-client/index.js +1 -0
- package/dist/client/cli-client/unsupported-api-version-error.d.ts +11 -0
- package/dist/client/cli-client/unsupported-api-version-error.js +1 -0
- package/dist/client/contract.d.ts +1 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +1 -1
- package/dist/client/phoenix-api.d.ts +5263 -1723
- package/dist/configurator/ConfiguratorApp.js +1 -1
- package/dist/configurator/application-runtime/extensions/configurator-extension-systems.d.ts +5 -4
- package/dist/configurator/application-runtime/extensions/configurator-extension-systems.js +1 -1
- package/dist/configurator/application-runtime/extensions/create-configurator-extensions.js +1 -1
- package/dist/configurator/application-runtime/extensions/selectors.d.ts +4 -2
- package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/action-system/action-context.d.ts +14 -0
- package/dist/configurator/application-runtime/extensions/systems/action-system/action-factory.d.ts +13 -0
- package/dist/configurator/application-runtime/extensions/systems/action-system/action-system.d.ts +55 -0
- package/dist/configurator/application-runtime/extensions/systems/action-system/action-system.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/action-system/action.d.ts +56 -0
- package/dist/configurator/application-runtime/extensions/systems/action-system/action.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/action-system/index.d.ts +6 -0
- package/dist/configurator/application-runtime/extensions/systems/action-system/index.js +1 -0
- package/dist/{domain/domain-runtime/spec → configurator/application-runtime/extensions/systems/action-system}/prepare-action-implementations.d.ts +4 -3
- package/dist/{domain/domain-runtime/spec → configurator/application-runtime/extensions/systems/action-system}/prepare-action-implementations.js +2 -2
- package/dist/{domain/spec/modules → configurator/application-runtime/extensions/systems/action-system}/resolve-action-modules.d.ts +2 -2
- package/dist/configurator/application-runtime/extensions/systems/action-system/resolve-action-modules.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-annotation.d.ts +7 -4
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +99 -35
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/composer-attachments.d.ts +12 -17
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/composer-attachments.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +52 -36
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/index.d.ts +3 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/index.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/register-webmcp-tools.d.ts +33 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/register-webmcp-tools.js +6 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/share-link.d.ts +14 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/share-link.js +2 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/to-webmcp-result.d.ts +10 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/to-webmcp-result.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.d.ts +41 -35
- package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.d.ts +14 -4
- package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +8 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +46 -12
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/is-offered-for-selection.d.ts +16 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/is-offered-for-selection.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/read-offered-navigation.d.ts +26 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/read-offered-navigation.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.d.ts +25 -8
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/export-image-capture.d.ts +15 -4
- package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/export-image-capture.js +3 -3
- package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.d.ts +15 -7
- package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/index.d.ts +5 -4
- package/dist/configurator/application-runtime/extensions/systems/index.js +1 -1
- package/dist/configurator/application-runtime/hooks/use-configurator.d.ts +3 -3
- package/dist/configurator/common/configurator-interface.d.ts +9 -7
- package/dist/configurator/common/configurator-interface.js +1 -1
- package/dist/configurator/scene/cameras/CameraPadding.d.ts +5 -0
- package/dist/configurator/scene/cameras/CameraPadding.js +1 -1
- package/dist/configurator/scene/resources/use-phx-gltf.js +1 -1
- package/dist/configurator/scene/scene-entity/materials/LocalCreatedMaterial.js +1 -1
- package/dist/configurator/scene/scene-entity/materials/RemoteReplacedMaterial.d.ts +5 -0
- package/dist/configurator/scene/scene-entity/materials/RemoteReplacedMaterial.js +1 -1
- package/dist/configurator/scene/scene-entity/materials/use-dispose-replaced.d.ts +27 -0
- package/dist/configurator/scene/scene-entity/materials/use-dispose-replaced.js +1 -0
- package/dist/configurator/toolbar-actions/use-toolbar-actions.js +1 -1
- package/dist/configurator/ui/assistant/AssistantChips.d.ts +5 -5
- package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
- package/dist/configurator/ui/assistant/AssistantComposer.d.ts +4 -3
- package/dist/configurator/ui/assistant/AssistantComposer.js +1 -1
- package/dist/configurator/ui/assistant/AssistantPanel.d.ts +6 -4
- package/dist/configurator/ui/assistant/AssistantPanel.js +1 -1
- package/dist/configurator/ui/assistant/AssistantThread.d.ts +10 -2
- package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
- package/dist/configurator/ui/assistant/annotation/AnnotationViewer.js +1 -1
- package/dist/configurator/ui/assistant/annotation/MessageAnnotations.js +1 -1
- package/dist/configurator/ui/assistant/annotation/editor/AnnotationComment.d.ts +6 -5
- package/dist/configurator/ui/assistant/annotation/editor/AnnotationComment.js +1 -1
- package/dist/configurator/ui/assistant/annotation/editor/AnnotationEditor.d.ts +6 -5
- package/dist/configurator/ui/assistant/annotation/editor/AnnotationEditor.js +1 -1
- package/dist/configurator/ui/assistant/annotation/editor/annotation-pins.d.ts +5 -0
- package/dist/configurator/ui/assistant/annotation/editor/annotation-pins.js +1 -1
- package/dist/configurator/ui/assistant/annotation/index.d.ts +0 -1
- package/dist/configurator/ui/assistant/annotation/index.js +1 -1
- package/dist/configurator/ui/assistant/assistant-failure.d.ts +6 -4
- package/dist/configurator/ui/assistant/assistant-failure.js +1 -1
- package/dist/configurator/ui/assistant/attachments/MessageImages.js +1 -1
- package/dist/configurator/ui/assistant/disclaimer/AssistantDisclaimerDialog.d.ts +10 -0
- package/dist/configurator/ui/assistant/disclaimer/AssistantDisclaimerDialog.js +1 -0
- package/dist/configurator/ui/assistant/disclaimer/AssistantDisclaimerLine.d.ts +10 -0
- package/dist/configurator/ui/assistant/disclaimer/AssistantDisclaimerLine.js +1 -0
- package/dist/configurator/ui/assistant/disclaimer/index.d.ts +2 -0
- package/dist/configurator/ui/assistant/disclaimer/index.js +1 -0
- package/dist/configurator/ui/assistant/drawing/AssistantDrawing.d.ts +1 -1
- package/dist/configurator/ui/assistant/drawing/AssistantDrawing.js +1 -1
- package/dist/configurator/ui/assistant/drawing/index.d.ts +1 -1
- package/dist/configurator/ui/assistant/drawing/index.js +1 -1
- package/dist/configurator/ui/assistant/drawing/parse-drawing.js +1 -1
- package/dist/configurator/ui/assistant/drawing/use-drawing-url.d.ts +6 -12
- package/dist/configurator/ui/assistant/drawing/use-drawing-url.js +1 -1
- package/dist/configurator/ui/assistant/form/AssistantForm.d.ts +1 -1
- package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -1
- package/dist/configurator/ui/assistant/form/form-model.d.ts +9 -0
- package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +6 -5
- package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -1
- package/dist/configurator/ui/assistant/form/read-form-tile.d.ts +8 -0
- package/dist/configurator/ui/assistant/form/read-form-tile.js +1 -0
- package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.d.ts +6 -3
- package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.js +1 -1
- package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.d.ts +11 -7
- package/dist/configurator/ui/assistant/form/registry/form-registry.d.ts +1 -1
- package/dist/configurator/ui/assistant/form/registry/form-registry.js +1 -1
- package/dist/configurator/ui/assistant/form/split-form-rows.d.ts +7 -0
- package/dist/configurator/ui/assistant/form/split-form-rows.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +7 -4
- package/dist/configurator/ui/assistant/form-elements/FormOptions.js +1 -1
- package/dist/configurator/ui/assistant/form-elements/FormTile.d.ts +72 -0
- package/dist/configurator/ui/assistant/form-elements/FormTile.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +27 -0
- package/dist/configurator/ui/assistant/form-elements/index.d.ts +2 -3
- package/dist/configurator/ui/assistant/form-elements/index.js +1 -1
- package/dist/configurator/ui/assistant/image-view/ImageView.js +1 -1
- package/dist/configurator/ui/assistant/index.d.ts +2 -2
- package/dist/configurator/ui/assistant/panel/AssistantPanelHeader.js +1 -1
- package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.d.ts +4 -1
- package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.js +1 -1
- package/dist/configurator/ui/assistant/reference-link/index.d.ts +2 -1
- package/dist/configurator/ui/assistant/reference-link/index.js +1 -1
- package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -1
- package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +2 -6
- package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -1
- package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +5 -6
- package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -1
- package/dist/configurator/ui/assistant/thread-items.d.ts +2 -2
- package/dist/configurator/ui/assistant/thread-items.js +1 -1
- package/dist/configurator/ui/assistant/use-assistant-composer.d.ts +7 -1
- package/dist/configurator/ui/assistant/use-assistant-composer.js +2 -2
- package/dist/configurator/ui/assistant/use-assistant-thread.d.ts +15 -1
- package/dist/configurator/ui/assistant/use-assistant-thread.js +1 -1
- package/dist/configurator/ui/assistant/use-load-older-on-top.d.ts +3 -3
- package/dist/configurator/ui/assistant/use-load-older-on-top.js +1 -1
- package/dist/configurator/ui/assistant/{annotation/use-end-on-unmount.d.ts → use-on-unmount.d.ts} +1 -1
- package/dist/configurator/ui/assistant/use-on-unmount.js +1 -0
- package/dist/configurator/ui/configurator-layout/index.d.ts +1 -1
- package/dist/configurator/ui/configurator-layout/index.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/canvas/LayoutCanvas.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/DesktopSidebar.js +4 -4
- package/dist/configurator/ui/configurator-layout/slots/index.d.ts +2 -0
- package/dist/configurator/ui/configurator-layout/slots/index.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/view-controls/DesktopViewControls.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/view-controls/MobileViewControls.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/view-controls/NestedViewControls.d.ts +7 -0
- package/dist/configurator/ui/configurator-layout/slots/view-controls/NestedViewControls.js +1 -0
- package/dist/configurator/ui/configurator-layout/slots/view-controls/use-view-control-items.d.ts +6 -0
- package/dist/configurator/ui/configurator-layout/slots/view-controls/use-view-control-items.js +1 -0
- package/dist/configurator/ui/configurator-layout/universal/DesktopPreview.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +3 -3
- package/dist/configurator/ui/configurator-layout/universal/MobilePreview.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/use-preview-description.d.ts +1 -0
- package/dist/configurator/ui/configurator-layout/universal/use-preview-description.js +1 -0
- package/dist/configurator/ui/index.d.ts +1 -1
- package/dist/configurator/ui/legacy/layout/common/ViewControls.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -1
- package/dist/docs/index.json +128 -3
- package/dist/docs/layouts/nested-view-controls.mdx +223 -0
- package/dist/docs/layouts/presets/custom.mdx +1 -0
- package/dist/docs/layouts/preview/always.mdx +22 -0
- package/dist/docs/layouts/view-controls.mdx +2 -0
- package/dist/docs/other-features/domain-actions.mdx +58 -62
- package/dist/docs/other-features/violation-messages.mdx +3 -1
- package/dist/docs/phoenix/application-states.mdx +1 -1
- package/dist/docs/phoenix/assistant/actions.mdx +183 -0
- package/dist/docs/phoenix/assistant/changing-the-configuration.mdx +333 -0
- package/dist/docs/phoenix/assistant/instructions-and-ai-settings.mdx +221 -0
- package/dist/docs/phoenix/assistant/overview.mdx +137 -0
- package/dist/docs/phoenix/assistant/per-session-setup.mdx +166 -0
- package/dist/docs/phoenix/assistant/reading-the-configuration.mdx +349 -0
- package/dist/docs/phoenix/assistant/screenshots.mdx +135 -0
- package/dist/docs/phoenix/assistant/security-and-limits.mdx +151 -0
- package/dist/docs/phoenix/assistant/the-panel.mdx +298 -0
- package/dist/docs/phoenix/configurator-interface.mdx +68 -39
- package/dist/docs/phoenix/data-sources.mdx +1 -1
- package/dist/docs/phoenix/getting-started.mdx +1 -1
- package/dist/docs/phoenix/layout-slots.mdx +2 -2
- package/dist/docs/phoenix/migrations.mdx +1 -1
- package/dist/docs/phoenix/phoenix-cli.mdx +90 -54
- package/dist/docs/phoenix/project-structure.mdx +17 -7
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +57 -28
- package/dist/docs/phoenix/sessions-and-access.mdx +10 -7
- package/dist/docs/phoenix/theming.mdx +5 -9
- package/dist/docs/phoenix/webhook-membership.mdx +1 -1
- package/dist/docs/phoenix/webhooks.mdx +56 -4
- package/dist/docs/ux-guidelines/choosing-navigation.mdx +2 -0
- package/dist/docs/ux-guidelines/designing-the-configuration-journey.mdx +43 -0
- package/dist/docs/ux-guidelines/interaction-modes.mdx +2 -2
- package/dist/docs/ux-guidelines/overview.mdx +11 -9
- package/dist/domain/application/application-config.d.ts +5 -0
- package/dist/domain/application/assistant/assistant-exposure.d.ts +22 -0
- package/dist/domain/application/assistant/assistant-exposure.js +1 -0
- package/dist/domain/application/assistant/assistant-selection.d.ts +30 -0
- package/dist/domain/application/assistant/assistant-selection.js +1 -0
- package/dist/domain/application/assistant/build-assistant-lenses.js +4 -4
- package/dist/domain/application/assistant/build-assistant-manifest.d.ts +2 -2
- package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
- package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +18 -2
- package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
- package/dist/domain/application/assistant/index.d.ts +5 -1
- package/dist/domain/application/assistant/index.js +1 -1
- package/dist/domain/application/assistant/prepare-assistant-navigation-updates.d.ts +16 -0
- package/dist/domain/application/assistant/prepare-assistant-navigation-updates.js +1 -0
- package/dist/domain/application/assistant/read-assistant-navigation.d.ts +40 -0
- package/dist/domain/application/assistant/read-assistant-navigation.js +1 -0
- package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +30 -2
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
- package/dist/domain/application/assistant/session-setup/assistant-takes-images.d.ts +7 -0
- package/dist/domain/application/assistant/session-setup/assistant-takes-images.js +1 -0
- package/dist/domain/application/assistant/session-setup/index.d.ts +1 -0
- package/dist/domain/application/assistant/session-setup/index.js +1 -1
- package/dist/domain/application/assistant-field-options.d.ts +2 -0
- package/dist/domain/application/assistant-field-options.js +1 -1
- package/dist/domain/application/assistant-mutations.d.ts +17 -11
- package/dist/domain/application/assistant-mutations.js +1 -1
- package/dist/domain/application/assistant-recipe-groups.d.ts +4 -3
- package/dist/domain/application/assistant-recipe-groups.js +1 -1
- package/dist/domain/application/configurator-builder.d.ts +8 -0
- package/dist/domain/application/configurator-builder.js +1 -1
- package/dist/domain/available-system-components/available-system-components.d.ts +1 -1
- package/dist/domain/available-system-components/available-system-components.js +1 -1
- package/dist/domain/core/action/action.d.ts +0 -49
- package/dist/domain/core/component/system-component-filter.d.ts +1 -0
- package/dist/domain/core/component/system-component-filter.js +1 -1
- package/dist/domain/core/component/view-state-component.d.ts +4 -3
- package/dist/domain/core/component/view-state-component.js +1 -1
- package/dist/domain/core/domain-factory.d.ts +2 -3
- package/dist/domain/core/invariant/control-violation-hints.d.ts +37 -0
- package/dist/domain/core/invariant/control-violation-hints.js +1 -0
- package/dist/domain/core/invariant/index.d.ts +1 -0
- package/dist/domain/core/invariant/index.js +1 -1
- package/dist/domain/domain-builder/domain-builder.d.ts +1 -6
- package/dist/domain/domain-builder/domain-builder.js +1 -1
- package/dist/domain/domain-context/domain-context-systems.d.ts +3 -5
- package/dist/domain/domain-context/index.d.ts +0 -1
- package/dist/domain/domain-context/index.js +1 -1
- package/dist/domain/domain-context/navigation-system/navigation-system.d.ts +2 -2
- package/dist/domain/domain-context/navigation-system/navigation-system.js +1 -1
- package/dist/domain/domain-context/transformers/when-builder.js +1 -1
- package/dist/domain/domain-runtime/domain-context/domain-context.d.ts +1 -1
- package/dist/domain/domain-runtime/domain-context/domain-context.js +1 -1
- package/dist/domain/domain-runtime/domain-context/index.d.ts +0 -1
- package/dist/domain/domain-runtime/domain-context/selectors.d.ts +5 -6
- package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
- package/dist/domain/domain-runtime/domain-runtime.d.ts +13 -19
- package/dist/domain/domain-runtime/domain-runtime.js +1 -1
- package/dist/domain/domain-runtime/index.d.ts +0 -1
- package/dist/domain/domain-runtime/index.js +1 -1
- package/dist/domain/domain-runtime/spec/index.d.ts +0 -1
- package/dist/domain/domain-runtime/spec/index.js +1 -1
- package/dist/domain/domain-runtime/spec/initialize.js +1 -1
- package/dist/domain/domain-runtime/spec/selectors.d.ts +2 -2
- package/dist/domain/domain-runtime/spec/types.d.ts +12 -10
- package/dist/domain/extensions/assistant/assistant-greeting.d.ts +30 -0
- package/dist/domain/extensions/assistant/assistant-greeting.js +1 -0
- package/dist/domain/extensions/assistant/index.d.ts +1 -0
- package/dist/domain/extensions/assistant/index.js +1 -0
- package/dist/domain/extensions/export-images/agent-screenshot.d.ts +5 -4
- package/dist/domain/extensions/export-images/agent-screenshot.js +1 -1
- package/dist/domain/extensions/index.d.ts +1 -1
- package/dist/domain/extensions/index.js +1 -1
- package/dist/domain/index.d.ts +1 -1
- package/dist/domain/index.js +1 -1
- package/dist/domain/mocks/create-mock-domain-runtime.d.ts +6 -8
- package/dist/domain/spec/modules/index.d.ts +0 -1
- package/dist/domain/spec/modules/index.js +1 -1
- package/dist/domain/spec/phx/phx-domain.d.ts +0 -1
- package/dist/domain/spec/phx/phx-domain.js +1 -1
- package/dist/domain/spec/runtime/application-spec-slice.d.ts +5 -5
- package/dist/domain/spec/runtime/application-spec-slice.js +1 -1
- package/dist/domain/spec/runtime/create-application.d.ts +5 -2
- package/dist/domain/spec/runtime/create-application.js +1 -1
- package/dist/domain/spec/runtime-spec/runtime-spec.d.ts +2 -2
- package/dist/domain/spec/sections/actions.d.ts +3 -2
- package/dist/domain/spec/sections/app-metadata.d.ts +3 -0
- package/dist/domain/spec/sections/assistant/assistant-features.d.ts +13 -0
- package/dist/domain/spec/sections/assistant/assistant-features.js +1 -0
- package/dist/domain/spec/sections/assistant/assistant-manifest.d.ts +34 -1
- package/dist/domain/spec/sections/assistant/assistant-navigation.d.ts +21 -0
- package/dist/domain/spec/sections/assistant/assistant-navigation.js +1 -0
- package/dist/domain/spec/sections/assistant/assistant-resolved-manifest.d.ts +45 -4
- package/dist/domain/spec/sections/assistant/assistant-select.d.ts +12 -0
- package/dist/domain/spec/sections/assistant/assistant-select.js +1 -0
- package/dist/domain/spec/sections/assistant/form/assistant-form-elements.d.ts +10 -26
- package/dist/domain/spec/sections/assistant/form/assistant-form-elements.js +1 -1
- package/dist/domain/spec/sections/assistant/index.d.ts +4 -1
- package/dist/domain/system-components/index.d.ts +1 -0
- package/dist/domain/system-components/index.js +1 -1
- package/dist/domain/system-components/navigation/index.d.ts +1 -0
- package/dist/domain/system-components/navigation/index.js +1 -0
- package/dist/domain/system-components/navigation/view-controls.d.ts +24 -0
- package/dist/domain/system-components/navigation/view-controls.js +1 -0
- package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
- package/dist/editor/domain-editors/apply-spec-update.js +1 -1
- package/dist/editor/domain-editors/use-implementation-files.d.ts +4 -3
- package/dist/editor/domain-editors/use-implementation-files.js +1 -1
- package/dist/extras/cognito/CognitoSignInPage.d.ts +2 -0
- package/dist/extras/cognito/CognitoSignInPage.js +1 -0
- package/dist/extras/cognito/index.d.ts +1 -0
- package/dist/extras/cognito/index.js +1 -0
- package/dist/globals/index.d.ts +5 -0
- package/dist/i18n/locales/cs/messages.js +1 -1
- package/dist/i18n/locales/da/messages.js +1 -1
- package/dist/i18n/locales/de/messages.js +1 -1
- package/dist/i18n/locales/de-AT/messages.js +1 -1
- package/dist/i18n/locales/en/messages.js +1 -1
- package/dist/i18n/locales/en-AU/messages.js +1 -1
- package/dist/i18n/locales/en-GB/messages.js +1 -1
- package/dist/i18n/locales/es/messages.js +1 -1
- package/dist/i18n/locales/fr/messages.js +1 -1
- package/dist/i18n/locales/hu/messages.js +1 -1
- package/dist/i18n/locales/it/messages.js +1 -1
- package/dist/i18n/locales/nl/messages.js +1 -1
- package/dist/i18n/locales/pl/messages.js +1 -1
- package/dist/i18n/locales/pt/messages.js +1 -1
- package/dist/i18n/locales/ro/messages.js +1 -1
- package/dist/i18n/locales/sk/messages.js +1 -1
- package/dist/i18n/locales/tr/messages.js +1 -1
- package/dist/legacy/deployment-cli/commands/create-environment.js +1 -1
- package/dist/legacy/deployment-cli/commands/list-environments.js +1 -1
- package/dist/legacy/deployment-cli/commands/register-deployment.js +1 -1
- package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +25 -3
- package/dist/legacy/phoenix-cli/commands/prepare-deployment-command.js +1 -1
- package/dist/legacy/phoenix-cli/commands/prepare-local-environment-command.js +1 -1
- package/dist/legacy/phoenix-cli/services/prepare-development-environment.js +1 -1
- package/dist/legacy/phoenix-cli/services/webhook-service/transport.js +1 -1
- package/dist/legacy/webhook-cli/lib/webhook-boundary.js +1 -1
- package/dist/phoenix/application-spec/index.d.ts +1 -1
- package/dist/phoenix/application-spec/index.js +1 -1
- package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +1 -0
- package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
- package/dist/phoenix/cli.js +1 -1
- package/dist/phoenix/commands/account/index.d.ts +1 -0
- package/dist/phoenix/commands/account/index.js +1 -0
- package/dist/phoenix/commands/account/whoami.d.ts +10 -0
- package/dist/phoenix/commands/account/whoami.js +4 -0
- package/dist/phoenix/commands/cleanup-environment.js +1 -1
- package/dist/phoenix/commands/deploy.d.ts +7 -2
- package/dist/phoenix/commands/deploy.js +8 -2
- package/dist/phoenix/commands/deployment-build-envs-command.js +1 -1
- package/dist/phoenix/commands/feedback.d.ts +2 -2
- package/dist/phoenix/commands/feedback.js +1 -1
- package/dist/phoenix/commands/finish-deployment-command.js +1 -1
- package/dist/phoenix/commands/index.d.ts +1 -0
- package/dist/phoenix/commands/index.js +1 -1
- package/dist/phoenix/commands/init-starter-spec.js +3 -4
- package/dist/phoenix/commands/init.d.ts +2 -2
- package/dist/phoenix/commands/init.js +1 -1
- package/dist/phoenix/commands/login.d.ts +6 -3
- package/dist/phoenix/commands/login.js +3 -3
- package/dist/phoenix/commands/logout.js +1 -1
- package/dist/phoenix/commands/prepare-deployment-command.js +2 -2
- package/dist/phoenix/commands/prepare-local-environment-command.js +1 -1
- package/dist/phoenix/services/cli-credentials.d.ts +26 -7
- package/dist/phoenix/services/cli-credentials.js +2 -2
- package/dist/phoenix/services/cli-server/describe-saved-logins.d.ts +5 -0
- package/dist/phoenix/services/cli-server/describe-saved-logins.js +1 -0
- package/dist/phoenix/services/cli-server/index.d.ts +2 -0
- package/dist/phoenix/services/cli-server/index.js +1 -0
- package/dist/phoenix/services/cli-server/resolve-cli-server-url.d.ts +19 -0
- package/dist/phoenix/services/cli-server/resolve-cli-server-url.js +1 -0
- package/dist/phoenix/services/development-credential.js +1 -1
- package/dist/phoenix/services/frontend-config.d.ts +2 -0
- package/dist/phoenix/services/index.d.ts +4 -2
- package/dist/phoenix/services/index.js +1 -1
- package/dist/phoenix/services/phoenix-regions.d.ts +6 -1
- package/dist/phoenix/services/phoenix-regions.js +1 -1
- package/dist/phoenix/services/prepare-development-environment.js +1 -1
- package/dist/phoenix/services/session/phoenix-application.js +1 -1
- package/dist/phoenix/services/signed-in-development-environment.d.ts +15 -4
- package/dist/phoenix/services/signed-in-development-environment.js +1 -1
- package/dist/phoenix/services/spec-project/describe-workspace-projects.d.ts +11 -0
- package/dist/phoenix/services/spec-project/describe-workspace-projects.js +1 -0
- package/dist/phoenix/services/spec-project/index.d.ts +3 -0
- package/dist/phoenix/services/spec-project/index.js +1 -0
- package/dist/phoenix/services/spec-project/resolve-deploy-target.d.ts +47 -0
- package/dist/phoenix/services/spec-project/resolve-deploy-target.js +1 -0
- package/dist/phoenix/services/spec-project/resolve-target-project.d.ts +34 -0
- package/dist/phoenix/services/spec-project/resolve-target-project.js +2 -0
- package/dist/phoenix/services/spec-project/write-spec-project.d.ts +7 -0
- package/dist/phoenix/services/spec-project/write-spec-project.js +1 -0
- package/dist/phoenix/services/telemetry/telemetry-event.js +1 -1
- package/dist/phoenix/services/telemetry/telemetry-state.d.ts +1 -1
- package/dist/phoenix/services/telemetry/telemetry-state.js +1 -1
- package/dist/phoenix/services/variant-file-session.js +1 -1
- package/dist/phoenix/services/vite-config.js +1 -1
- package/dist/phoenix/services/webhook-service/transport.js +1 -1
- package/dist/react-sdk/application-runtime/common-services/index.d.ts +1 -0
- package/dist/react-sdk/application-runtime/common-services/index.js +1 -1
- package/dist/react-sdk/application-runtime/common-services/selectors.d.ts +2 -0
- package/dist/react-sdk/application-runtime/common-services/selectors.js +1 -1
- package/dist/react-sdk/application-runtime/common-services/webmcp/index.d.ts +3 -0
- package/dist/react-sdk/application-runtime/common-services/webmcp/index.js +1 -0
- package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-host.d.ts +35 -0
- package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-host.js +1 -0
- package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-model-context.d.ts +44 -0
- package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-model-context.js +1 -0
- package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-tool-result.d.ts +24 -0
- package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-tool-result.js +1 -0
- package/dist/react-sdk/application-runtime/domain-application-context/application-runtime-extension.d.ts +7 -1
- package/dist/react-sdk/application-runtime/domain-application-context/application-runtime-extension.js +1 -1
- package/dist/react-sdk/application-runtime/domain-application-context/domain-application-systems.d.ts +2 -2
- package/dist/react-sdk/application-runtime/domain-application-context/selectors.d.ts +1 -3
- package/dist/react-sdk/application-runtime/domain-application-context/selectors.js +1 -1
- package/dist/react-sdk/application-runtime/hooks/index.d.ts +1 -0
- package/dist/react-sdk/application-runtime/hooks/index.js +1 -1
- package/dist/react-sdk/application-runtime/hooks/use-spec.d.ts +1 -1
- package/dist/react-sdk/application-runtime/hooks/use-webmcp-host.d.ts +7 -0
- package/dist/react-sdk/application-runtime/hooks/use-webmcp-host.js +1 -0
- package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +14 -16
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
- package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +5 -6
- package/dist/react-sdk/domain-context/common-hooks/use-state-validity.d.ts +1 -1
- package/dist/react-sdk/domain-context/common-hooks/use-state-validity.js +1 -1
- package/dist/react-sdk/domain-context/index.d.ts +3 -2
- package/dist/react-sdk/domain-context/index.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/generate-share-link-hooks.d.ts +1 -5
- package/dist/react-sdk/domain-context/system-hooks/generate-share-link-hooks.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/generate-share-link.d.ts +25 -0
- package/dist/react-sdk/domain-context/system-hooks/generate-share-link.js +1 -0
- package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.d.ts +5 -3
- package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
- package/dist/react-sdk/preset-selection/PresetSelectionProvider.d.ts +11 -0
- package/dist/react-sdk/preset-selection/PresetSelectionProvider.js +1 -1
- package/dist/react-sdk/preset-selection/PresetWebMcpTools.d.ts +14 -0
- package/dist/react-sdk/preset-selection/PresetWebMcpTools.js +1 -0
- package/dist/react-sdk/preset-selection/index.d.ts +2 -1
- package/dist/react-sdk/preset-selection/index.js +1 -1
- package/dist/react-sdk/preset-selection/register-preset-webmcp-tools.d.ts +31 -0
- package/dist/react-sdk/preset-selection/register-preset-webmcp-tools.js +1 -0
- package/dist/ui-sdk/components/preview/Preview.d.ts +12 -4
- package/dist/ui-sdk/components/preview/Preview.js +2 -2
- package/dist/ui-sdk/components/snackbar/Snackbar.d.ts +3 -2
- package/dist/ui-sdk/components/snackbar/Snackbar.js +1 -1
- package/dist/ui-sdk/components/toolbar/desktop-toolbar/ToolbarPopper.d.ts +2 -0
- package/dist/ui-sdk/components/toolbar/desktop-toolbar/ToolbarPopper.js +1 -1
- package/dist/ui-sdk/components/view-controls/ViewControlsContext.d.ts +3 -1
- package/dist/ui-sdk/components/view-controls/ViewControlsItem.js +1 -1
- package/dist/ui-sdk/components/view-controls/ViewControlsRoot.d.ts +6 -1
- package/dist/ui-sdk/components/view-controls/ViewControlsRoot.js +1 -1
- package/dist/webhook/builders/auth-handler-builder.d.ts +3 -0
- package/dist/webhook/builders/auth-handler-builder.js +1 -1
- package/dist/webhook/builders/common.d.ts +3 -1
- package/dist/webhook/builders/webhook-builder.d.ts +5 -0
- package/dist/webhook/builders/webhook-builder.js +1 -1
- package/package.json +9 -4
- package/schema/domain-spec.json +444 -65
- package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/assistant-setup.js +0 -32
- package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-guidelines.d.ts +0 -2
- package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-guidelines.js +0 -25
- package/dist/configurator/ui/assistant/annotation/use-end-on-unmount.js +0 -1
- package/dist/configurator/ui/assistant/form-elements/FormCard.d.ts +0 -68
- package/dist/configurator/ui/assistant/form-elements/FormCard.js +0 -1
- package/dist/configurator/ui/assistant/form-elements/FormSwatch.d.ts +0 -61
- package/dist/configurator/ui/assistant/form-elements/FormSwatch.js +0 -1
- package/dist/domain/domain-context/action-system/action-system.d.ts +0 -64
- package/dist/domain/domain-context/action-system/action-system.js +0 -1
- package/dist/domain/domain-context/action-system/index.d.ts +0 -1
- package/dist/domain/domain-context/action-system/index.js +0 -1
- package/dist/domain/domain-runtime/action-factory.d.ts +0 -11
- package/dist/domain/domain-runtime/domain-context/action-context.d.ts +0 -11
- package/dist/domain/extensions/view-controls.d.ts +0 -25
- package/dist/domain/extensions/view-controls.js +0 -1
- package/dist/domain/spec/modules/resolve-action-modules.js +0 -1
- /package/dist/{domain/domain-runtime/domain-context → configurator/application-runtime/extensions/systems/action-system}/action-context.js +0 -0
- /package/dist/{domain/domain-runtime → configurator/application-runtime/extensions/systems/action-system}/action-factory.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ButtonProps, ComponentsOverrides } from '@mui/material';
|
|
2
|
-
import { type ElementType, type HTMLAttributes } from 'react';
|
|
2
|
+
import { type ButtonHTMLAttributes, type ElementType, type HTMLAttributes } from 'react';
|
|
3
3
|
import type { ValueOf } from '@salsita-ai/common/utils';
|
|
4
4
|
import { type AssistantThreadItemSlots } from './AssistantThreadItemView.js';
|
|
5
5
|
declare const MuiComponentName: 'PhxAssistantThread';
|
|
@@ -21,6 +21,8 @@ declare const Slots: {
|
|
|
21
21
|
readonly Root: 'root';
|
|
22
22
|
readonly Messages: 'messages';
|
|
23
23
|
readonly Greeting: 'greeting';
|
|
24
|
+
readonly Starters: 'starters';
|
|
25
|
+
readonly Starter: 'starter';
|
|
24
26
|
readonly Status: 'status';
|
|
25
27
|
readonly OlderStatus: 'olderStatus';
|
|
26
28
|
readonly EarlierButton: 'earlierButton';
|
|
@@ -36,6 +38,8 @@ export interface ThemeableAssistantThreadProps {
|
|
|
36
38
|
* - `root` — The thread (`div`).
|
|
37
39
|
* - `messages` — The scrolling log of the conversation (`div`).
|
|
38
40
|
* - `greeting` — The greeting of an empty thread (`div`).
|
|
41
|
+
* - `starters` — The row of starters under the greeting (`div`).
|
|
42
|
+
* - `starter` — A starter, which sends its ready-made message on a tap (`button`).
|
|
39
43
|
* - `status` — A line on what the thread is doing, such as loading (`div`).
|
|
40
44
|
* - `olderStatus` — The line over the top of the thread while earlier messages load; it also takes the styles of `status` (`div`).
|
|
41
45
|
* - `earlierButton` — The control that loads an earlier conversation (`Button`).
|
|
@@ -55,6 +59,8 @@ export interface ThemeableAssistantThreadProps {
|
|
|
55
59
|
* - `root` — Props for the thread.
|
|
56
60
|
* - `messages` — Props for the scrolling log.
|
|
57
61
|
* - `greeting` — Props for the greeting.
|
|
62
|
+
* - `starters` — Props for the row of starters.
|
|
63
|
+
* - `starter` — Props for each starter.
|
|
58
64
|
* - `status` — Props for each status line.
|
|
59
65
|
* - `olderStatus` — Props for the line over the top of the thread.
|
|
60
66
|
* - `earlierButton` — Props for the earlier-conversation control.
|
|
@@ -65,6 +71,8 @@ export interface ThemeableAssistantThreadProps {
|
|
|
65
71
|
readonly [Slots.Root]: HTMLAttributes<HTMLDivElement>;
|
|
66
72
|
readonly [Slots.Messages]: HTMLAttributes<HTMLDivElement>;
|
|
67
73
|
readonly [Slots.Greeting]: HTMLAttributes<HTMLDivElement>;
|
|
74
|
+
readonly [Slots.Starters]: HTMLAttributes<HTMLDivElement>;
|
|
75
|
+
readonly [Slots.Starter]: ButtonHTMLAttributes<HTMLButtonElement>;
|
|
68
76
|
readonly [Slots.Status]: HTMLAttributes<HTMLDivElement>;
|
|
69
77
|
readonly [Slots.OlderStatus]: HTMLAttributes<HTMLDivElement>;
|
|
70
78
|
readonly [Slots.EarlierButton]: ButtonProps;
|
|
@@ -74,7 +82,7 @@ export interface ThemeableAssistantThreadProps {
|
|
|
74
82
|
}
|
|
75
83
|
/**
|
|
76
84
|
* The conversation: user bubbles, assistant Markdown, tool chips, and what the panel
|
|
77
|
-
* has to say itself, which is a line while the thread loads, a greeting for an empty thread, a
|
|
85
|
+
* has to say itself, which is a line while the thread loads, a greeting and the project's starters for an empty thread, a
|
|
78
86
|
* "Thinking…" line and a failure with its way out. It follows a streaming reply until the user scrolls up.
|
|
79
87
|
*
|
|
80
88
|
* A conversation is painted whole as the user scrolls up: the thread shows its newest messages first
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Trans as s}from"@lingui/react";import{Button as t,styled as i,useThemeProps as n}from"@mui/material";import{useCallback as r,useMemo as o,useRef as l,useState as d}from"react";import{match as u}from"ts-pattern";import{useLocalizable as c}from"#package/react-sdk";import{PhxIcon as g,hoverStyles as m}from"#package/ui-sdk";import{useConfigurator as h}from"../../application-runtime/index.js";import{AssistantActivityRow as p}from"./AssistantChips.js";import{AssistantThreadItemView as k}from"./AssistantThreadItemView.js";import{EntityLinkSelectionProvider as b,useCreateEntityLinkSelection as f}from"./entity-link/index.js";import{useAssistantThread as v}from"./use-assistant-thread.js";import{useFollowStream as w}from"./use-follow-stream.js";import{useLoadOlderOnTop as y}from"./use-load-older-on-top.js";let x="PhxAssistantThread",T={id:"sdk.assistant.failure.resting",message:"The assistant needs a break. Try again in {minutes, plural, one {# minute} other {# minutes}}."},B=i("div",{name:x,slot:"root"})({display:"grid",position:"relative"}),I=i("div",{name:x,slot:"messages"})(({theme:{spacing:e,typography:a}})=>({...a.body2,display:"flex",flexDirection:"column",gap:e(1.5),overflowY:"auto",overscrollBehavior:"contain",paddingBlock:e(2),paddingInline:`var(--phx-sidebar-padding, ${e(2)})`,position:"relative","& > :first-child":{marginBlockStart:"auto"}})),C=i("div",{name:x,slot:"greeting"})({}),R=i("div",{name:x,slot:"starters"})(({theme:{spacing:e}})=>({display:"flex",flexWrap:"wrap",gap:e(1)})),S=i("button",{name:x,slot:"starter"})(({theme:{palette:e,spacing:a,typography:s}})=>({...s.body2,background:e.background.paper,border:`1px solid ${e.divider}`,borderRadius:"calc(infinity * 1px)",color:e.text.primary,cursor:"pointer",margin:0,paddingBlock:a(.5),paddingInline:a(1.5),textAlign:"start","&:hover:not(:disabled)":{background:e.action.hover},"&:focus-visible":{outline:`2px solid ${e.primary.main}`,outlineOffset:1},"&:disabled":{color:e.text.disabled,cursor:"default"}})),j=i("div",{name:x,slot:"status"})(({theme:{palette:e,typography:a}})=>({...a.caption,color:e.text.secondary})),A=i(t,{name:x,slot:"earlierButton"})({alignSelf:"center"}),M=i("div")({blockSize:1,insetBlockStart:0,insetInline:0,position:"absolute"}),L=i(j,{name:x,slot:"olderStatus"})(({theme:{palette:e,shape:a,spacing:s}})=>({background:e.background.paper,borderRadius:a.borderRadius,insetBlockStart:s(1),insetInlineStart:"50%",paddingBlock:s(.5),paddingInline:s(1),position:"absolute",translate:"-50% 0"})),z=i("div",{name:x,slot:"notice"})(({theme:{palette:e,shape:a,spacing:s}})=>({alignItems:"center",background:e.action.hover,borderRadius:a.borderRadius,display:"flex",flexWrap:"wrap",gap:s(1),justifyContent:"space-between",paddingBlock:s(1),paddingInline:s(1.5)})),E=i(t,{name:x,slot:"newReplyButton"})(({theme:{palette:e,spacing:a}})=>({background:e.text.primary,borderRadius:"calc(infinity * 1px)",color:e.background.paper,insetBlockEnd:a(1),insetInlineStart:"50%",position:"absolute",translate:"-50% 0","&:hover":{background:e.text.primary},...m({"&:hover":{background:e.text.secondary}})}));export const AssistantThread=i=>{let{slots:m={},slotProps:Y={}}=n({props:i,name:x}),{items:$,earlierItems:D,isLoadingThread:N,isEmpty:O,greeting:U,starters:W,isReplying:q,isThinking:H,isResuming:K,failure:P,retry:V,hasOlderMessages:F,isLoadingOlderMessages:G,loadOlderMessages:J,canLoadEarlierThread:Q,isLoadingEarlierThread:X,loadEarlierThread:Z,undoableToolCallId:_,undo:ee,newestMessageKey:ea,firstMessageId:es}=v(),et=o(()=>$.filter(({kind:e})=>"user"===e).at(-1)?.id,[$]),ei=c({...T,values:{minutes:P?.kind==="resting"?P.minutes:0}}),{scrollerRef:en,hasUnseenContent:er,handleScroll:eo,scrollToEnd:el}=w(o(()=>({newestMessageKey:ea,isThinking:H,isResuming:K,failure:P?.kind}),[ea,H,K,P?.kind]),et),ed=l(null);y(en,ed,{enabled:F&&!G,onReachTop:J,firstItemKey:es});let eu=f(),{assistantSystem:ec}=h(),[eg,em]=d(!1),eh=r(e=>{em(!0),ec.send(e).finally(()=>em(!1))},[ec]),ep=r(e=>{e.target instanceof Element&&e.target.closest('a, button, input, label, select, textarea, [role="button"], [role="tooltip"]')||window.getSelection()?.isCollapsed!==!1&&eu.release()},[eu]),ek=m.root??B,eb=m.messages??I,ef=m.greeting??C,ev=m.starters??R,ew=m.starter??S,ey=m.status??j,ex=m.olderStatus??L,eT=m.earlierButton??A,eB=m.notice??z,eI=m.newReplyButton??E,eC=o(()=>({userMessage:m.userMessage,assistantMessage:m.assistantMessage,toolChips:m.toolChips,separator:m.separator}),[m.userMessage,m.assistantMessage,m.toolChips,m.separator]);return a(ek,{...Y.root,children:[e(b,{selection:eu,children:a(eb,{role:"log","aria-live":"polite",...Y.messages,ref:en,onScroll:eo,onClick:ep,children:[O&&e(ef,{...Y.greeting,children:U??e(s,{id:"sdk.assistant.thread.greeting",message:"Hi. I can answer questions about this design and change it with you. Tell me what you need."})}),O&&W.length>0&&e(ev,{...Y.starters,children:W.map((a,s)=>e(ew,{...Y.starter,type:"button",disabled:eg,onClick:()=>eh(a.reply),children:a.title},s))}),N&&e(ey,{...Y.status,children:e(s,{id:"sdk.assistant.thread.loading",message:"Loading the conversation…"})}),X&&e(ey,{...Y.status,children:e(s,{id:"sdk.assistant.thread.loadingEarlier",message:"Loading the earlier conversation…"})}),Q&&e(eT,{size:"small",color:"inherit",...Y.earlierButton,onClick:Z,children:e(s,{id:"sdk.assistant.thread.showEarlier.label",message:"Show earlier conversation"})}),D.map(a=>e(k,{item:a,isActive:!1,undoableToolCallId:_,onUndo:ee,slots:eC},a.id)),$.map(a=>e(k,{item:a,isActive:q&&a===$.at(-1),undoableToolCallId:_,onUndo:ee,slots:eC},a.id)),K&&e(ey,{...Y.status,children:e(s,{id:"sdk.assistant.thread.resuming",message:"Resuming the conversation…"})}),H&&e(p,{label:e(s,{id:"sdk.assistant.thread.thinking",message:"Thinking…"})}),P&&a(eB,{role:"alert",...Y.notice,children:[e("span",{children:u(P.kind).with("notAvailable",()=>e(s,{id:"sdk.assistant.failure.notAvailable",message:"The assistant is not available here."})).with("busy",()=>e(s,{id:"sdk.assistant.failure.busy",message:"The assistant is still working on an earlier message."})).with("resting",()=>ei).with("exhausted",()=>e(s,{id:"sdk.assistant.failure.exhausted",message:"The assistant is unavailable right now. You can keep configuring as usual."})).with("locked",()=>e(s,{id:"sdk.assistant.failure.locked",message:"The assistant won't continue on this configuration because of how it was used. You can keep configuring as usual."})).with("networkLocked",()=>e(s,{id:"sdk.assistant.failure.networkLocked",message:"The assistant is paused for your network because of how it was used from here. Try again later. You can keep configuring as usual."})).with("unheard",()=>e(s,{id:"sdk.assistant.failure.unheard",message:"Nothing was heard in your voice message. Try recording it again."})).with("providerBusy",()=>e(s,{id:"sdk.assistant.failure.providerBusy",message:"The AI service behind the assistant is overloaded right now. Try again in a moment."})).with("unavailable",()=>e(s,{id:"sdk.assistant.failure.unavailable",message:"The assistant is unavailable right now."})).exhaustive()}),P.canRetry&&e(t,{size:"small",variant:"outlined",color:"inherit",onClick:V,children:e(s,{id:"sdk.assistant.failure.retry.label",message:"Try again"})})]}),F&&e(M,{ref:ed,"aria-hidden":!0})]})}),G&&e(ex,{role:"status",...Y.olderStatus,children:e(s,{id:"sdk.assistant.thread.loadingOlder",message:"Loading earlier messages…"})}),er&&e(eI,{size:"small",endIcon:e(g,{name:"CaretDown"}),...Y.newReplyButton,onClick:el,children:e(s,{id:"sdk.assistant.thread.newReply.label",message:"New reply"})})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{Trans as i}from"@lingui/react";import{Button as r}from"@mui/material";import{useCallback as n,useEffect as o,useRef as a,useState as s}from"react";import{useLocalizable as d}from"#package/react-sdk";import{useScreenshotSrc as l}from"../screenshots/index.js";import{useOnUnmount as m}from"../use-on-unmount.js";import{AnnotationPin as c}from"./AnnotationPin.js";import{ANNOTATION_FADE_DURATION as u,AnnotationStage as p,AnnotationSurface as h,annotationSurfaceSize as g,useAnnotationSlots as f}from"./annotation-layout.js";import{prefersReducedMotion as k}from"./prefers-reduced-motion.js";let w={id:"sdk.assistant.annotation.viewer.label",message:"Annotation"};export const AnnotationViewer=({annotation:v,close:j})=>{let x=l(v.imageId),[y,b]=s(),[T,A]=s(!1),{Root:E,Toolbar:L,slotProps:z}=f(),C=a(j),S=d(w);C.current=j,m(()=>C.current());let F=n(()=>{A(!0),setTimeout(()=>C.current(),k()?0:u)},[]);return o(()=>{let t=t=>{"Escape"===t.key&&F()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[F]),e(E,{...z.root,role:"dialog","aria-modal":"true","aria-label":S,"data-leaving":T,children:[t(p,{children:void 0!==x&&e(h,{sx:y?g(y.width,y.height):{visibility:"hidden"},children:[t("img",{src:x,alt:"",style:{display:"block",inlineSize:"100%",blockSize:"100%"},onLoad:t=>b({width:t.currentTarget.naturalWidth,height:t.currentTarget.naturalHeight})}),v.pins.map((e,i)=>t(c,{pin:e,index:i,variant:"target"},i))]})}),t(L,{...z.toolbar,children:t(r,{variant:"contained",autoFocus:!0,onClick:F,children:t(i,{id:"sdk.assistant.annotation.close",message:"Close"})})})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as
|
|
1
|
+
import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useLocalizable as o}from"#package/react-sdk";import{useConfigurator as a}from"../../../application-runtime/index.js";import{MessageThumbnail as e,MessageThumbnailPicture as i}from"../attachments/index.js";import{useScreenshotSrc as s}from"../screenshots/index.js";import{AnnotationBadge as r}from"./AnnotationBadge.js";let m={id:"sdk.assistant.message.annotation.open",message:"Show the annotation"},d=({annotation:d})=>{let{assistantSystem:p}=a(),c=s(d.imageId);return n(e,{"aria-label":o(m),disabled:void 0===c,onClick:()=>p.viewAnnotation(d),children:[void 0!==c&&t(i,{src:c,alt:""}),t(r,{count:d.pins.length})]})};export const MessageAnnotations=({annotations:n})=>n.map(n=>t(d,{annotation:n},n.imageId));
|
|
@@ -36,14 +36,15 @@ export interface ThemeableAssistantAnnotationCommentProps {
|
|
|
36
36
|
interface AnnotationCommentProps {
|
|
37
37
|
/** Where its pin is on the view. */
|
|
38
38
|
readonly point: AnnotationPoint;
|
|
39
|
-
/**
|
|
40
|
-
readonly
|
|
39
|
+
/** What is typed in the comment, which the editor keeps: Done saves it, closing the comment otherwise drops it. */
|
|
40
|
+
readonly draft: string;
|
|
41
|
+
readonly onDraftChange: (draft: string) => void;
|
|
41
42
|
readonly onDelete: () => void;
|
|
42
|
-
readonly onSave: (
|
|
43
|
+
readonly onSave: () => void;
|
|
43
44
|
}
|
|
44
45
|
/**
|
|
45
46
|
* The comment of a pin, open for editing by the pin: it takes the focus as it opens. Enter saves it and
|
|
46
|
-
* Shift+Enter adds a line, as in the composer.
|
|
47
|
+
* Shift+Enter adds a line, as in the composer.
|
|
47
48
|
*/
|
|
48
|
-
export declare const AnnotationComment: ({ point,
|
|
49
|
+
export declare const AnnotationComment: ({ point, draft, onDraftChange, onDelete, onSave }: AnnotationCommentProps) => import("react/jsx-runtime").JSX.Element;
|
|
49
50
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Tooltip as n,styled as o,useThemeProps as a}from"@mui/material";import{useCallback as i,useRef as s
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Tooltip as n,styled as o,useThemeProps as a}from"@mui/material";import{useCallback as i,useRef as s}from"react";import{useLocalizable as r}from"#package/react-sdk";import{PhxIcon as l}from"#package/ui-sdk";import{ComposerField as m,ComposerFrame as c,ComposerInput as p,ComposerPrimaryButton as d,ComposerToolButton as u}from"../../composer/index.js";let h="PhxAssistantAnnotationComment",g={id:"sdk.assistant.annotation.comment.placeholder",message:"Add a comment…"},f={id:"sdk.assistant.annotation.comment.delete",message:"Delete"},k={id:"sdk.assistant.annotation.comment.save",message:"Save"},x=o(c,{name:h,slot:"root"})(({theme:{palette:e,shadows:t}})=>({background:e.background.paper,boxShadow:t[6],inlineSize:"min(280px, 80cqw)",position:"absolute",zIndex:1})),v=o("div")(({theme:{spacing:e}})=>({cursor:"default",display:"flex",gap:e(.5),gridColumn:2})),C={};export const AnnotationComment=({point:o,draft:c,onDraftChange:b,onDelete:S,onSave:w})=>{let y=s(null),z=r(g),D=r(f),P=r(k),{slots:j={},slotProps:A={}}=a({props:C,name:h}),E=i(e=>{e.stopPropagation(),e.target===e.currentTarget&&(e.preventDefault(),y.current?.focus())},[]),$=i(e=>{"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),w())},[w]);return t(j.root??x,{...A.root,style:{...A.root?.style,...(({x:e,y:t})=>({...e<.5?{insetInlineStart:`${100*e}%`}:{insetInlineEnd:`${(1-e)*100}%`},...t<.5?{insetBlockStart:`calc(${100*t}% + 18px)`}:{insetBlockEnd:`calc(${(1-t)*100}% + 18px)`}}))(o)},onPointerDown:e=>e.stopPropagation(),onMouseDown:E,children:[e(m,{children:e(p,{autoFocus:!0,multiline:!0,maxRows:4,placeholder:z,value:c,inputRef:y,inputProps:{"aria-label":z},onChange:e=>b(e.target.value),onKeyDown:$})}),t(v,{children:[e(n,{title:D,placement:"top",children:e(u,{size:"small","aria-label":D,onClick:S,children:e(l,{name:"Trash",fontSize:"small"})})}),e(n,{title:P,placement:"top",children:e(d,{size:"small","aria-label":P,onClick:w,children:e(l,{name:"Check",fontSize:"small"})})})]})]})};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AssistantAnnotationDrawing } from '../../../../application-runtime/index.js';
|
|
2
2
|
interface AnnotationEditorProps {
|
|
3
3
|
/** The frozen view, at the canvas's resolution. */
|
|
4
4
|
readonly view: HTMLCanvasElement;
|
|
5
5
|
/** Ends the editor with what the user made, or with `null` when they cancel. */
|
|
6
|
-
readonly finish: (
|
|
6
|
+
readonly finish: (drawing: AssistantAnnotationDrawing | null) => void;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* The editor over the configurator: the frozen view, which cannot be moved or zoomed. Marker draws
|
|
10
10
|
* red strokes; Comment places a numbered pin where the user clicks and opens its comment, and opens
|
|
11
11
|
* the comment of a pin clicked again, with Delete. Hovering or tapping a pin shows its comment.
|
|
12
12
|
*
|
|
13
|
-
* Done
|
|
14
|
-
* does nothing while there is nothing on it. Cancel, or
|
|
15
|
-
* fades out first.
|
|
13
|
+
* Done saves what is typed in an open comment, as Save would, drops the pins without a comment and flattens
|
|
14
|
+
* the strokes and the pin badges onto the view; it does nothing while there is nothing on it. Cancel, or
|
|
15
|
+
* Escape, ends it with nothing. Either way it fades out first. While a comment is open, Escape and a click
|
|
16
|
+
* beside it close it and drop what was typed in it. An editor that goes away before it ended ends as cancelled.
|
|
16
17
|
*/
|
|
17
18
|
export declare const AnnotationEditor: ({ view, finish }: AnnotationEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as n}from"react/jsx-runtime";import{Trans as t}from"@lingui/react";import{Button as r,ToggleButton as i,ToggleButtonGroup as o}from"@mui/material";import{useCallback as a,useEffect as l,useLayoutEffect as s,useRef as m,useState as c}from"react";import{useLocalizable as u}from"#package/react-sdk";import{PhxIcon as d}from"#package/ui-sdk";import{useOnUnmount as p}from"../../use-on-unmount.js";import{AnnotationPin as h}from"../AnnotationPin.js";import{ANNOTATION_FADE_DURATION as g,ANNOTATION_STROKE_WIDTH as f,AnnotationPicture as w,AnnotationStage as v,AnnotationSurface as k,annotationSurfaceSize as C,useAnnotationSlots as x}from"../annotation-layout.js";import{prefersReducedMotion as j}from"../prefers-reduced-motion.js";import{AnnotationComment as P}from"./AnnotationComment.js";import{drawAnnotationStrokes as b}from"./annotation-drawing.js";import{annotationPointIn as y,closeAnnotationPin as I,createAnnotationPin as E,deleteAnnotationPin as T,draftedAnnotationPins as A,keptAnnotationPins as D,replaceAnnotationPin as M}from"./annotation-pins.js";import{flattenAnnotation as z}from"./flatten-annotation.js";let R={id:"sdk.assistant.annotation.label",message:"Annotate the view"},S=(e,n)=>y(n.getBoundingClientRect(),e.clientX,e.clientY);export const AnnotationEditor=({view:y,finish:F})=>{let[L,O]=c("marker"),{Root:W,Toolbar:q,slotProps:B}=x(),[H,U]=c([]),[X,Y]=c([]),[G,J]=c(null),[K,N]=c(""),[Q,V]=c(!1),Z=m(null),$=m(null),_=m(null),ee=m(null),en=m(!1),et=m(F);et.current=F;let er=u(R),ei=D(A(X,G,K)),eo=H.length>0||ei.length>0;p(()=>et.current(null)),s(()=>{$.current?.getContext("2d")?.drawImage(y,0,0)},[y]);let ea=a(()=>{let e,n,t,r=_.current,i=r?.getContext("2d");if(!r||!i)return;let{width:o,height:a,ratio:l}=(e=globalThis.devicePixelRatio||1,n=Math.round(r.clientWidth*e),t=Math.round(r.clientHeight*e),(r.width!==n||r.height!==t)&&(r.width=n,r.height=t),{width:n,height:t,ratio:e}),s=ee.current;i.clearRect(0,0,o,a),b(i,s?[...H,s.points]:H,{width:o,height:a},f*l)},[H]),el=m(null),es=a(()=>{null!==el.current&&(cancelAnimationFrame(el.current),el.current=null)},[]),em=a(()=>{el.current??=requestAnimationFrame(()=>{el.current=null,ea()})},[ea]);l(()=>es,[es]),s(()=>{es(),ea();let e=Z.current;if(!e)return;let n=new ResizeObserver(()=>{es(),ea()});return n.observe(e),()=>n.disconnect()},[es,ea]);let ec=a(async e=>{if(en.current)return;en.current=!0,V(!0);let[n]=await Promise.all([e(),new Promise(e=>setTimeout(e,j()?0:g))]);et.current(n)},[]),eu=a(()=>void ec(async()=>null),[ec]),ed=a(()=>{let e=Z.current;if(!eo||!e)return;let n=y.width/e.clientWidth;ec(async()=>{try{return{blob:await z({view:y,strokes:H,pins:ei,scale:n}),pins:ei}}catch{return null}})},[ei,eo,ec,H,y]),ep=a(e=>{J(e),N(e.comment)},[]),eh=a(()=>{G&&Y(e=>I(e,G)),J(null)},[G]),eg=a(()=>{if(G){let e={...G,comment:K.trim()};Y(n=>I(M(n,G,e),e))}J(null)},[K,G]),ef=a(()=>{G&&Y(e=>T(e,G)),J(null)},[G]),ew=a(e=>{e!==G&&(eh(),ep(e))},[eh,ep,G]);l(()=>{let e=e=>{"Escape"!==e.key||e.isComposing||(G?eh():eu())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[eh,G,eu]);let ev=a(e=>{if(ee.current||!e.isPrimary)return;let n=S(e,e.currentTarget);if("comment"===L){if(G)eh();else{let e=E(n);Y(n=>[...n,e]),ep(e)}return}e.currentTarget.setPointerCapture(e.pointerId),ee.current={pointerId:e.pointerId,points:[n]}},[eh,ep,G,L]),ek=a(e=>{let n=ee.current;n?.pointerId===e.pointerId&&(n.points.push(S(e,e.currentTarget)),em())},[em]),eC=a(e=>{let n=ee.current;n?.pointerId===e.pointerId&&(ee.current=null,U(e=>[...e,n.points]))},[]);return n(W,{...B.root,role:"dialog","aria-modal":"true","aria-label":er,"data-leaving":Q,children:[e(v,{children:n(k,{ref:Z,sx:{...C(y.width,y.height),cursor:"comment"===L?"copy":"crosshair"},onPointerDown:ev,onMouseDown:e=>"comment"===L&&e.preventDefault(),onPointerMove:ek,onPointerUp:eC,onPointerCancel:eC,children:[e(w,{ref:$,width:y.width,height:y.height}),e(w,{ref:_}),X.map((n,t)=>e(h,{pin:n,index:t,variant:"badge",isEdited:n===G,onClick:"comment"===L?()=>ew(n):void 0},t)),G&&e(P,{point:G,draft:K,onDraftChange:N,onDelete:ef,onSave:eg},X.indexOf(G))]})}),n(q,{...B.toolbar,children:[n(o,{exclusive:!0,size:"small",value:L,onChange:(e,n)=>{n&&(O(n),eh())},children:[n(i,{value:"marker",autoFocus:!0,children:[e(d,{name:"PencilSimpleLine",fontSize:"small",sx:{marginInlineEnd:.5}}),e(t,{id:"sdk.assistant.annotation.marker",message:"Marker"})]}),n(i,{value:"comment",children:[e(d,{name:"ChatCircleText",fontSize:"small",sx:{marginInlineEnd:.5}}),e(t,{id:"sdk.assistant.annotation.comment",message:"Comment"})]})]}),e(r,{variant:"text",onClick:eu,children:e(t,{id:"sdk.assistant.annotation.cancel",message:"Cancel"})}),e(r,{variant:"contained",disabled:!eo,onClick:ed,children:e(t,{id:"sdk.assistant.annotation.done",message:"Done"})})]})]})};
|
|
@@ -11,6 +11,11 @@ export declare const replaceAnnotationPin: (pins: AnnotationPins, pin: Assistant
|
|
|
11
11
|
export declare const deleteAnnotationPin: (pins: AnnotationPins, pin: AssistantAnnotationPin) => AnnotationPins;
|
|
12
12
|
/** The pins once the comment of `pin` closes: no pin is left without a comment, so a pin with none goes. */
|
|
13
13
|
export declare const closeAnnotationPin: (pins: AnnotationPins, pin: AssistantAnnotationPin) => AnnotationPins;
|
|
14
|
+
/**
|
|
15
|
+
* The pins with the open comment of `pin` saved as `draft`, the text typed in it: Done keeps what is typed in an open
|
|
16
|
+
* comment, as Save would. With no open comment, the pins as they are.
|
|
17
|
+
*/
|
|
18
|
+
export declare const draftedAnnotationPins: (pins: AnnotationPins, pin: AssistantAnnotationPin | null, draft: string) => AnnotationPins;
|
|
14
19
|
/** The pins an annotation keeps once it is done: those with a comment, renumbered, their comments trimmed. */
|
|
15
20
|
export declare const keptAnnotationPins: (pins: AnnotationPins) => AnnotationPins;
|
|
16
21
|
/** Where a point of the page is on a box, as fractions of it, kept within it. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const createAnnotationPin=({x:t,y:n})=>({x:t,y:n,comment:""});export const replaceAnnotationPin=(t,n,o)=>t.map(t=>t===n?o:t);export const deleteAnnotationPin=(t,n)=>t.filter(t=>t!==n);export const closeAnnotationPin=(t,n)=>n.comment.trim()?t:deleteAnnotationPin(t,n);export const keptAnnotationPins=t=>t.flatMap(t=>{let n=t.comment.trim();return n?[{...t,comment:n}]:[]});let t=t=>Math.min(1,Math.max(0,t));export const annotationPointIn=(n,o,e)=>({x:t((o-n.left)/n.width),y:t((e-n.top)/n.height)});
|
|
1
|
+
export const createAnnotationPin=({x:t,y:n})=>({x:t,y:n,comment:""});export const replaceAnnotationPin=(t,n,o)=>t.map(t=>t===n?o:t);export const deleteAnnotationPin=(t,n)=>t.filter(t=>t!==n);export const closeAnnotationPin=(t,n)=>n.comment.trim()?t:deleteAnnotationPin(t,n);export const draftedAnnotationPins=(t,n,o)=>n?replaceAnnotationPin(t,n,{...n,comment:o}):t;export const keptAnnotationPins=t=>t.flatMap(t=>{let n=t.comment.trim();return n?[{...t,comment:n}]:[]});let t=t=>Math.min(1,Math.max(0,t));export const annotationPointIn=(n,o,e)=>({x:t((o-n.left)/n.width),y:t((e-n.top)/n.height)});
|
|
@@ -3,4 +3,3 @@ export { AnnotationOverlay } from './AnnotationOverlay.js';
|
|
|
3
3
|
export { MessageAnnotations } from './MessageAnnotations.js';
|
|
4
4
|
export type { ThemeableAssistantAnnotationProps } from './annotation-layout.js';
|
|
5
5
|
export type { ThemeableAssistantAnnotationCommentProps } from './editor/index.js';
|
|
6
|
-
export { useEndOnUnmount } from './use-end-on-unmount.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AnnotationBadge}from"./AnnotationBadge.js";export{AnnotationOverlay}from"./AnnotationOverlay.js";export{MessageAnnotations}from"./MessageAnnotations.js";
|
|
1
|
+
export{AnnotationBadge}from"./AnnotationBadge.js";export{AnnotationOverlay}from"./AnnotationOverlay.js";export{MessageAnnotations}from"./MessageAnnotations.js";
|
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
* - `networkLocked`: the assistant is paused for the user's network for how it was used from there, and sending again
|
|
9
9
|
* will not help until the pause ends
|
|
10
10
|
* - `unheard`: nothing was heard in the voice message the user sent, so it was not sent; they may record it again
|
|
11
|
+
* - `providerBusy`: the AI service behind the assistant was busy and failed the reply, which may be regenerated
|
|
11
12
|
* - `unavailable`: anything else, including a dropped connection and a reply that broke off
|
|
12
13
|
*/
|
|
13
|
-
export type AssistantFailureKind = 'notAvailable' | 'busy' | 'resting' | 'exhausted' | 'locked' | 'networkLocked' | 'unheard' | 'unavailable';
|
|
14
|
+
export type AssistantFailureKind = 'notAvailable' | 'busy' | 'resting' | 'exhausted' | 'locked' | 'networkLocked' | 'unheard' | 'providerBusy' | 'unavailable';
|
|
14
15
|
export type AssistantFailure = {
|
|
15
16
|
readonly kind: Exclude<AssistantFailureKind, 'resting'>;
|
|
16
17
|
/** True when loading the thread again may help, so the panel offers "Try again". */
|
|
@@ -25,7 +26,8 @@ export type AssistantFailure = {
|
|
|
25
26
|
* Maps a failed assistant request to what the panel shows, by the HTTP status the server answered
|
|
26
27
|
* with and the seconds it asked to wait. A failure without a status never reached the server or broke
|
|
27
28
|
* off mid-reply; it gets the same generic message as an unknown status, because the chat client does
|
|
28
|
-
* not tell those apart
|
|
29
|
-
*
|
|
29
|
+
* not tell those apart, unless the server said how the reply's run failed (`runFailed`): a busy AI
|
|
30
|
+
* service gets a message of its own. A lock the server reported overrides the status: the thread read
|
|
31
|
+
* reports it without failing.
|
|
30
32
|
*/
|
|
31
|
-
export declare const describeAssistantFailure: (failedStatus: number | undefined, retryAfterSeconds: number | undefined, isLocked: boolean, isNetworkLocked: boolean) => AssistantFailure;
|
|
33
|
+
export declare const describeAssistantFailure: (failedStatus: number | undefined, retryAfterSeconds: number | undefined, isLocked: boolean, isNetworkLocked: boolean, runFailed?: 'busy' | 'other') => AssistantFailure;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const describeAssistantFailure=(n,
|
|
1
|
+
export const describeAssistantFailure=(e,n,a,t,i)=>t?{kind:"networkLocked",canRetry:!1}:a?{kind:"locked",canRetry:!1}:403===e?{kind:"notAvailable",canRetry:!1}:409===e?{kind:"busy",canRetry:!0}:422===e?{kind:"unheard",canRetry:!1}:429===e&&void 0!==n?{kind:"resting",canRetry:!1,minutes:Math.max(1,Math.ceil(n/60))}:429===e?{kind:"exhausted",canRetry:!1}:{kind:"busy"===i?"providerBusy":"unavailable",canRetry:!0};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{ButtonBase as
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{ButtonBase as a,styled as o,useThemeProps as t}from"@mui/material";import{useLocalizable as s}from"#package/react-sdk";import{useConfigurator as r}from"../../../application-runtime/index.js";import{useScreenshotSrc as n}from"../screenshots/index.js";let m="PhxAssistantMessageImages",l={id:"sdk.assistant.message.image.open",message:"Show the attached image larger"},d=o("div",{name:m,slot:"root"})(({theme:{spacing:e}})=>({display:"flex",flexWrap:"wrap",gap:e(.75),justifyContent:"flex-end"}));export const MessageThumbnail=o(a,{name:m,slot:"image"})(({theme:{palette:e,shape:i}})=>({background:e.action.hover,blockSize:64,borderRadius:i.borderRadius,inlineSize:64,overflow:"hidden",position:"relative"}));export const MessageThumbnailPicture=o("img")({blockSize:"100%",display:"block",inlineSize:"100%",objectFit:"cover"});let c=({imageId:i,component:a,componentProps:o})=>{let{assistantSystem:t}=r(),m=n(i);return e(a,{"aria-label":s(l),...o,disabled:void 0===m,onClick:()=>void 0!==m&&t.viewImage({kind:"url",url:m,title:void 0}),children:void 0!==m&&e(MessageThumbnailPicture,{src:m,alt:""})})};export const MessageImages=a=>{let{imageIds:o,children:s,slots:r={},slotProps:n={}}=t({props:a,name:m});return i(r.root??d,{...n.root,children:[o.map(i=>e(c,{imageId:i,component:r.image??MessageThumbnail,componentProps:n.image},i)),s]})};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface AssistantDisclaimerDialogProps {
|
|
2
|
+
readonly isOpen: boolean;
|
|
3
|
+
readonly onClose: () => void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The full disclaimer of the assistant panel, opened from the line under the composer. The body is one message
|
|
7
|
+
* written in Markdown, so a project rewrites it, links and lists included, in its own catalogs. Full screen on a
|
|
8
|
+
* phone, like the legacy chat's disclaimer.
|
|
9
|
+
*/
|
|
10
|
+
export declare const AssistantDisclaimerDialog: ({ isOpen, onClose }: AssistantDisclaimerDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Button as i,DialogActions as s,DialogContent as a,DialogTitle as n,IconButton as o,styled as r}from"@mui/material";import l from"react-markdown";import{useLocalizable as d}from"#package/react-sdk";import{Dialog as c,PhxIcon as m,useResponsive as h}from"#package/ui-sdk";let u={id:"sdk.assistant.disclaimer.title",message:"About this AI assistant"},p={id:"sdk.assistant.disclaimer.close",message:"Close"},g={id:"sdk.assistant.disclaimer.body",message:"This assistant is an automated AI system. It answers from the information it has about the products on this website and can change your design when you ask it to.\n\n**Accuracy.** Answers can be incomplete, out of date or wrong. Check important details such as dimensions, compatibility and price before you rely on them, and contact the seller if you are unsure.\n\n**Your responsibility.** You decide what to do with the assistant's answers. Neither the owner of this website nor the provider of the assistant technology is liable for actions, losses or damages resulting from its use.\n\nBy using the assistant, you accept this disclaimer. If you do not agree with any part of it, please do not use the assistant."},f=r(n)(({theme:{spacing:e}})=>({paddingInlineEnd:e(7)})),y=r(o)(({theme:{spacing:e}})=>({insetBlockStart:e(1.5),insetInlineEnd:e(1.5),position:"absolute"})),k=r(s)(({theme:{spacing:e}})=>({padding:e(1,3,2)})),b=r(a)(({theme:{palette:e,spacing:t,typography:i}})=>({...i.body2,color:e.text.primary,"& > :first-child":{marginBlockStart:0},"& > :last-child":{marginBlockEnd:0},"& p, & ul, & ol":{marginBlock:t(1.5)},"& ul, & ol":{paddingInlineStart:t(3)},"& a":{color:e.primary.main}})),w={a:({node:t,...i})=>e("a",{...i,target:"_blank",rel:"noopener noreferrer"})};export const AssistantDisclaimerDialog=({isOpen:s,onClose:a})=>{let{isMobile:n}=h(),o=d(u),r=d(p),x=d(g);return t(c.Root,{isOpen:s,onClose:a,fullScreen:n,sx:n?void 0:{maxWidth:"40rem",width:"90%"},children:[e(y,{"aria-label":r,onClick:a,children:e(m,{name:"X"})}),e(f,{children:o}),e(b,{children:e(l,{components:w,children:x})}),e(k,{children:e(i,{variant:"contained",onClick:a,children:r})})]})};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface AssistantDisclaimerLineProps {
|
|
2
|
+
/** Opens the dialog with the full disclaimer. */
|
|
3
|
+
readonly onLearnMore: () => void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The line under the composer that tells the shopper they are chatting with an AI, as the EU AI Act Art. 50(1)
|
|
7
|
+
* requires, with a link to the full disclaimer. The link is part of the one message, so a translation can place it
|
|
8
|
+
* anywhere in the sentence.
|
|
9
|
+
*/
|
|
10
|
+
export declare const AssistantDisclaimerLine: ({ onLearnMore }: AssistantDisclaimerLineProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{Trans as i}from"@lingui/react";import{Link as n}from"@mui/material";export const AssistantDisclaimerLine=({onLearnMore:a})=>t(i,{id:"sdk.assistant.disclaimer.line",components:{0:t(n,{component:"button",type:"button",variant:"inherit",color:"inherit",onClick:a})},message:"You're chatting with an AI. It can make mistakes. <0>Learn more</0>"});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{AssistantDisclaimerDialog}from"./AssistantDisclaimerDialog.js";export{AssistantDisclaimerLine}from"./AssistantDisclaimerLine.js";
|
|
@@ -51,7 +51,7 @@ export interface AssistantDrawingProps {
|
|
|
51
51
|
/**
|
|
52
52
|
* A drawing the model wrote in a reply, framed and as wide as the thread allows; a click opens it
|
|
53
53
|
* larger beside the panel. It is shown as an image, so nothing in it runs or loads, and its source
|
|
54
|
-
* never
|
|
54
|
+
* is never rendered as markup; a source that is not a drawing the panel can show leaves a note. While the
|
|
55
55
|
* model writes it, a placeholder stands in.
|
|
56
56
|
*/
|
|
57
57
|
export declare const AssistantDrawing: import("react").MemoExoticComponent<({ source, status }: AssistantDrawingProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i}from"react/jsx-runtime";import{Trans as e}from"@lingui/react";import{ButtonBase as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{Trans as e}from"@lingui/react";import{ButtonBase as r,styled as t,useThemeProps as o}from"@mui/material";import{memo as n,useCallback as a,useMemo as s,useState as l}from"react";import{useLocalizable as d}from"#package/react-sdk";import{useConfigurator as m}from"../../../application-runtime/index.js";import{parseDrawing as g}from"./parse-drawing.js";import{useDrawingUrl as c}from"./use-drawing-url.js";let u="PhxAssistantDrawing",p=t("div",{name:u,slot:"root"})(({theme:{palette:i,shape:e,spacing:r}})=>({border:`1px solid ${i.divider}`,borderRadius:e.borderRadius,boxSizing:"border-box",marginBlock:r(1),maxInlineSize:"100%",padding:r(1)})),b={id:"sdk.assistant.drawing.open.label",message:"Open the drawing"},w=t(r,{name:u,slot:"button"})(({theme:{palette:i}})=>({cursor:"zoom-in",display:"block",inlineSize:"100%","&:focus-visible":{outline:`2px solid ${i.primary.main}`,outlineOffset:2}})),h=t("img",{name:u,slot:"image"})({blockSize:"auto",display:"block",inlineSize:"100%"}),k=t("div",{name:u,slot:"note"})(({theme:{palette:i,spacing:e,typography:r}})=>({...r.caption,color:i.text.secondary,paddingBlock:e(1),paddingInline:e(.5)})),f={},x=()=>{let{slots:i={},slotProps:e={}}=o({props:f,name:u});return{Root:i.root??p,Button:i.button??w,Image:i.image??h,NoteSlot:i.note??k,slotProps:e}},v=()=>{let{Root:r,NoteSlot:t,slotProps:o}=x();return i(r,{...o.root,children:i(t,{...o.note,role:"alert",children:i(e,{id:"sdk.assistant.drawing.failure",message:"This drawing could not be shown"})})})},z=({source:e,title:r})=>{let{assistantSystem:t}=m(),o=c(e),[n,s]=l(),g=d(b),{Root:u,Button:p,Image:w,slotProps:h}=x(),k=a(()=>{t.viewImage({kind:"svg",source:e,title:r})},[t,e,r]),f=a(()=>{s(o)},[o]);return o===n?i(v,{}):i(u,{...h.root,children:i(p,{...h.button,"aria-label":void 0===r?g:void 0,onClick:k,children:i(w,{...h.image,src:o,alt:r??"",onError:f})})})},S=({source:e})=>{let r=s(()=>g(e),[e]);return r.ok?i(z,{source:e,title:r.title}):i(v,{})},j=()=>{let{Root:r,NoteSlot:t,slotProps:o}=x();return i(r,{...o.root,children:i(t,{...o.note,role:"status",children:i(e,{id:"sdk.assistant.drawing.writing",message:"Drawing…"})})})};export const AssistantDrawing=n(({source:e,status:r})=>"writing"===r?i(j,{}):i(S,{source:e}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { AssistantDrawing, type ThemeableAssistantDrawingProps } from './AssistantDrawing.js';
|
|
2
|
-
export {
|
|
2
|
+
export { useDrawingUrl } from './use-drawing-url.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AssistantDrawing}from"./AssistantDrawing.js";export{
|
|
1
|
+
export{AssistantDrawing}from"./AssistantDrawing.js";export{useDrawingUrl}from"./use-drawing-url.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let e="http://www.w3.org/2000/svg";export const MAX_DRAWING_SIZE=
|
|
1
|
+
let e="http://www.w3.org/2000/svg";export const MAX_DRAWING_SIZE=51200;let t=Object.freeze({ok:!1});export const parseDrawing=r=>{if(new TextEncoder().encode(r).length>51200)return t;let n=new DOMParser().parseFromString(r,"image/svg+xml"),a=n.documentElement;if(n.getElementsByTagName("parsererror").length>0||"svg"!==a.localName||a.namespaceURI!==e||!(a.hasAttribute("viewBox")||a.hasAttribute("width")&&a.hasAttribute("height")))return t;let o=a.getElementsByTagNameNS(e,"title")[0]?.textContent?.trim();return{ok:!0,title:""===o?void 0:o}};
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import { type SyntheticEvent } from 'react';
|
|
2
1
|
/**
|
|
3
|
-
* A `
|
|
4
|
-
* script of it, loads nothing it points at and keeps its styles to itself. The source never
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* A `data:` URL of type `image/svg+xml` for the source of a drawing, for an `<img>`, which runs no
|
|
3
|
+
* script of it, loads nothing it points at and keeps its styles to itself. The source is never
|
|
4
|
+
* rendered as markup of the page. A `data:` URL has an opaque origin, so a drawing the user opens
|
|
5
|
+
* in a new tab never runs as a document of the host page's origin; unlike a revoked `blob:` URL,
|
|
6
|
+
* it stays valid, so the browser's own image menu can save it.
|
|
7
7
|
*/
|
|
8
|
-
export declare const useDrawingUrl: (source: string) => string
|
|
9
|
-
/**
|
|
10
|
-
* The `onLoad` of a drawing's `<img>`: revokes its URL once the picture is decoded, which stays
|
|
11
|
-
* painted. A live `blob:` URL has the host page's origin, so "Open image in new tab" would load the
|
|
12
|
-
* SVG as a document of that origin, where a script the model wrote would run.
|
|
13
|
-
*/
|
|
14
|
-
export declare const revokeDrawingUrlOnLoad: (event: SyntheticEvent<HTMLImageElement>) => void;
|
|
8
|
+
export declare const useDrawingUrl: (source: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useMemo as e}from"react";export const useDrawingUrl=o=>e(()=>`data:image/svg+xml,${encodeURIComponent(o)}`,[o]);
|
|
@@ -40,7 +40,7 @@ export interface ThemeableAssistantFormProps {
|
|
|
40
40
|
* - `note` — The note shown while a form is written, or when it could not be built (`div`).
|
|
41
41
|
*
|
|
42
42
|
* Component slots, one per built-in form element, each given that element's props:
|
|
43
|
-
* `group`, `choice`, `choices`, `reply`, `
|
|
43
|
+
* `group`, `choice`, `choices`, `reply`, `tile`, `text`, `number` and `confirm`.
|
|
44
44
|
* The project's own form elements are registered with `createAssistantFormElement` instead.
|
|
45
45
|
*/
|
|
46
46
|
readonly slots?: Partial<Record<AssistantFormSlots, ElementType>> & AssistantBuiltInFormSlots;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Trans as i}from"@lingui/react";import{Button as o,styled as
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Trans as i}from"@lingui/react";import{Button as o,styled as r,useThemeProps as n}from"@mui/material";import{memo as a,useCallback as s,useEffect as d,useMemo as l,useState as m}from"react";import{match as c}from"ts-pattern";import{useDomain as p,useResolveLocalizable as u,useStoreSelector as b}from"#package/react-sdk";import{hoverStyles as f}from"#package/ui-sdk";import{useConfigurator as g}from"../../../application-runtime/index.js";import{createBuiltInFormSlotDefinitions as h}from"./built-in-form-slots.js";import{composeAnswer as k}from"./compose-answer.js";import{describeBuildErrors as w}from"./describe-build-errors.js";import{parseFormBlock as x}from"./parse-form-block.js";import{readFormTile as y}from"./read-form-tile.js";import{useFormRegistry as v}from"./registry/index.js";import{splitFormRows as B}from"./split-form-rows.js";let M="PhxAssistantForm",S=r("div",{name:M,slot:"root"})(({theme:{spacing:e}})=>({display:"flex",flexDirection:"column",gap:e(1.5),marginBlock:e(1)})),j=r(o,{name:M,slot:"submitButton"})(({theme:{palette:e,spacing:t,typography:i}})=>({...i.body2,alignSelf:"end",background:e.primary.main,border:"none",borderRadius:8,color:e.primary.contrastText,fontWeight:i.fontWeightMedium,letterSpacing:"normal",minBlockSize:0,minInlineSize:0,paddingBlock:t(.5),paddingInline:t(2),textTransform:"none","&:hover":{background:e.primary.dark,border:"none"},"&.Mui-disabled":{background:e.action.disabledBackground,border:"none",color:e.action.disabled}})),I=r(o,{name:M,slot:"fixButton"})(({theme:{palette:e,spacing:t,typography:i}})=>({...i.caption,background:"transparent",border:`1px solid ${e.divider}`,borderRadius:8,boxShadow:"none",color:e.text.primary,fontWeight:i.fontWeightMedium,letterSpacing:"normal",minBlockSize:0,minInlineSize:0,paddingBlock:t(.25),paddingInline:t(1.5),textTransform:"none","&:hover":{background:"transparent",border:`1px solid ${e.divider}`,boxShadow:"none"},...f({"&:hover":{background:e.action.hover}}),"&.Mui-disabled":{background:"transparent",border:`1px solid ${e.action.disabledBackground}`,color:e.action.disabled}})),T=r("div",{name:M,slot:"note"})(({theme:{palette:e,shape:t,spacing:i,typography:o}})=>({...o.caption,alignItems:"center",background:e.action.hover,borderRadius:t.borderRadius,color:e.text.secondary,display:"flex",flexWrap:"wrap",gap:i(1),justifyContent:"space-between",marginBlock:i(1),paddingBlock:i(1),paddingInline:i(1.5)})),z=new Set(["text","search","email","url","tel","number","password"]),C=({model:o,disabled:r,send:n,root:a,submitButton:l,slotProps:p,slotDefinitions:u})=>{let[b,f]=m(()=>new Map),[g,h]=m(()=>new Map),w=(t,i)=>{let{id:a,label:s,attributes:d}=t;return c(u.get(t.definition.name)??t.definition).with({role:"option"},({component:l})=>e(l,{attributes:t.tile?{...d,...t.tile}:d,label:s,disabled:r,selected:!0===b.get(a),onSelect:e=>{o.isQuick?n(k(o,new Map([[t.id,!0]]),new Map([[t.id,e]]))):(h(i=>new Map(i).set(t.id,e)),f(e=>{let o=new Map(e);if("choice"===i.definition.role){for(let e of i.children)o.delete(e.id);o.set(t.id,!0)}else o.set(t.id,!0!==e.get(t.id));return o}))}},a)).with({role:"input"},({component:i})=>e(i,{attributes:d,label:s,disabled:r,state:b.get(a),onChange:(e,i)=>{o.isQuick?n(k(o,new Map([[t.id,e]]),new Map([[t.id,i]]))):(f(i=>new Map(i).set(t.id,e)),h(e=>new Map(e).set(t.id,i)))}},a)).with({role:"group"},{role:"choice"},{role:"choices"},({component:i})=>{let o=new Map(t.children.map(e=>[e.id,w(e,t)]));return e(i,{attributes:d,label:s,disabled:r,rows:B(t.children).map(e=>e.map(e=>o.get(e.id))),children:[...o.values()]},a)}).exhaustive()},x=s(()=>{r||o.isQuick||n(k(o,b,g))},[r,o,n,b,g]),[y,v]=m(!1);return d(()=>{y&&(v(!1),x())},[y,x]),t(a,{...p.root,onKeyDown:e=>{!("Enter"===e.key&&!e.nativeEvent.isComposing&&!e.shiftKey&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&!e.defaultPrevented&&e.target instanceof HTMLInputElement&&z.has(e.target.type))||r||o.isQuick||v(!0)},children:[o.root.children.map(e=>w(e,o.root)),!o.isQuick&&e(l,{variant:"contained",disableElevation:!0,...p.submitButton,disabled:r,onClick:x,children:e(i,{id:"sdk.assistant.form.submit.label",message:"Submit"})})]})};export const AssistantForm=a(o=>{let{source:r,status:a,slots:c={},slotProps:f={}}=n({props:o,name:M}),{assistantSystem:k}=g(),[B,z]=m(!1),K="writing"===a,Q=v(),{componentReader:W}=p(),E=u(),P=b(({state:e})=>{if(K)return;let t=k.getSessionManifest();return x(r,Q,i=>t?y(i,e,{manifest:t,componentReader:W,resolveLocalizable:e=>E(e)}):null)},[r,K,Q,k,W,E]),R=P?.ok===!1?w(P.errors):void 0,D="ready"!==a||B,F=s(e=>{z(!0),k.send(e).finally(()=>z(!1))},[k]);d(()=>{null!=R&&console.warn("The assistant wrote a form that could not be built.",R)},[R]);let{group:$,choice:A,choices:L,reply:H,tile:q,text:G,number:J,confirm:N}=c,O=l(()=>h({group:$,choice:A,choices:L,reply:H,tile:q,text:G,number:J,confirm:N}),[$,A,L,H,q,G,J,N]),U=c.note??T,V=c.fixButton??I;return P?P.ok?0===P.root.children.length?null:e(C,{model:P,disabled:D,send:F,root:c.root??S,submitButton:c.submitButton??j,slotProps:f,slotDefinitions:O}):t(U,{role:"alert",...f.note,children:[e("span",{children:e(i,{id:"sdk.assistant.form.failure",message:"The assistant couldn't build this form."})}),e(V,{...f.fixButton,disabled:D,onClick:()=>F(w(P.errors)),children:e(i,{id:"sdk.assistant.form.fix.label",message:"Fix it"})})]}):e(U,{...f.note,children:e(i,{id:"sdk.assistant.form.writing",message:"Preparing a form…"})})});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { AssistantFormTileData } from '../form-elements/index.js';
|
|
2
|
+
import type { AssistantReferenceTarget } from '../reference-link/index.js';
|
|
1
3
|
import type { FormElementDefinition } from './registry/index.js';
|
|
2
4
|
/**
|
|
3
5
|
* An element of a parsed form. Options outside a `choice` or `choices` are already wrapped in an
|
|
@@ -9,8 +11,15 @@ export interface FormNode {
|
|
|
9
11
|
readonly definition: FormElementDefinition;
|
|
10
12
|
readonly label?: string;
|
|
11
13
|
readonly attributes: Readonly<Record<string, unknown>>;
|
|
14
|
+
/** What the `ref` of a `tile` resolved to; the form hands it to the tile's component with its attributes. */
|
|
15
|
+
readonly tile?: AssistantFormTileData;
|
|
12
16
|
readonly children: readonly FormNode[];
|
|
13
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Reads what a `tile` shows of the recipe or option its ref names, on the current configuration,
|
|
20
|
+
* without the model's `description`; `null` when the ref does not resolve there.
|
|
21
|
+
*/
|
|
22
|
+
export type ResolveFormTile = (target: AssistantReferenceTarget) => AssistantFormTileData | null;
|
|
14
23
|
/** Why an element made its block unbuildable, named by its tag and its label or its position in the block. */
|
|
15
24
|
export interface FormBuildError {
|
|
16
25
|
readonly element: string;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { FormModel } from './form-model.js';
|
|
1
|
+
import type { FormModel, ResolveFormTile } from './form-model.js';
|
|
2
2
|
import type { FormRegistry } from './registry/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Builds a form from the markup of a ```` ```form ```` fence. A block whose only content is loose
|
|
5
5
|
* options asks one question, so they form an implicit `choice`; elsewhere loose options form an
|
|
6
|
-
* implicit `choices`. A block that asks one question, a choice or a quick input, is quick.
|
|
7
|
-
* with any unknown element, invalid attribute,
|
|
8
|
-
*
|
|
6
|
+
* implicit `choices`. A block that asks one question, a choice or a quick input, is quick. Each
|
|
7
|
+
* `tile` is resolved through `resolveTile`. A block with any unknown element, invalid attribute,
|
|
8
|
+
* misplaced element, option with nothing to show or tile whose ref does not resolve is not built
|
|
9
|
+
* at all, and every such error is returned.
|
|
9
10
|
*/
|
|
10
|
-
export declare const parseFormBlock: (source: string, registry: FormRegistry) => FormModel;
|
|
11
|
+
export declare const parseFormBlock: (source: string, registry: FormRegistry, resolveTile: ResolveFormTile) => FormModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Parser as e}from"htmlparser2";import{
|
|
1
|
+
import{Parser as e}from"htmlparser2";import{parseAssistantLinkTarget as r}from"../reference-link/index.js";import{readFormAttributes as t}from"./read-form-attributes.js";let o=({name:e,attributes:r,position:t})=>({element:e,label:r.label,position:t}),i=({definition:e},r,t)=>({id:r,definition:e,attributes:{},children:t}),n=(e,r)=>{let t=[],o=[],n=()=>{o.length>0&&(t.push(i(r.registry.choices,`choices-${o[0]?.id}`,o)),o=[])};for(let r of e)"option"===r.definition.role?o.push(r):(n(),t.push(r));return n(),t},l=(e,i,s)=>e.flatMap(e=>((e,i,s)=>{var a;let p,u=s.registry.get(e.name);if(!u){s.errors.push({...o(e),message:"not a form element"}),l(e.children,void 0,s);return}let{definition:h}=u,c=(a=h.role,i?.role==="option"||i?.role==="input"?`cannot be inside <${i.name}>, which holds no elements`:(i?.role==="choice"||i?.role==="choices")&&"option"!==a?`cannot be inside <${i.name}>, which holds only options`:void 0);c&&s.errors.push({...o(e),message:c});let{attributes:d,errors:g}=t(u,e.attributes);for(let r of g)s.errors.push({...o(e),message:r});let{label:m,...f}=d;null!=h.identity&&["label",...h.identity].every(r=>{let t;return null==(t=e.attributes[r])||""===t})&&s.errors.push({...o(e),message:(p=h.identity,`has nothing to show: give it one of the attributes ${["label",...p].map(e=>`"${e}"`).join(", ")}`)});let y="tile"===h.name?((e,{ref:t,description:i},n)=>{if("string"!=typeof t)return;let l=r(t);if(null==l||"entity"===l.kind)return void n.errors.push({...o(e),message:`the ref "${t}" is not the target of a recipe or option link: write it as \`recipe:<entityId>/<groupId>/<key>\` or \`option:<entityId>/<edgeName>/<value>\``});let s=n.resolveTile(l);return s?"string"==typeof i&&""!==i?{...s,description:i}:s:void n.errors.push({...o(e),message:`the ref "${t}" names no recipe or option the configuration offers now: read it again from \`meta\``})})(e,d,s):void 0,b=l(e.children,{name:e.name,role:h.role},s);return{id:String(e.position),definition:h,label:"string"==typeof m?m:void 0,attributes:f,...y&&{tile:y},children:"group"===h.role?n(b,s):b}})(e,i,s)??[]),s=e=>{let{definition:r}=e;if("choice"===r.role||"input"===r.role&&!0===r.quick)return!0;let[t,...o]=e.children;return"group"===r.role&&null!=t&&0===o.length&&s(t)};export const parseFormBlock=(r,t,o)=>{let a,p,u,h,c={registry:t,resolveTile:o,errors:[]},d={name:t.group.definition.name,role:"group"},g=l((p=[a=[]],u=0,(h=new e({onopentag:(e,r)=>{let t={name:e,attributes:r,position:u+=1,children:[]};p.at(-1)?.push(t),p.push(t.children)},onclosetag:()=>{p.length>1&&p.pop()}},{xmlMode:!0,lowerCaseTags:!0,lowerCaseAttributeNames:!0,recognizeSelfClosing:!0})).write(r),h.end(),a),d,c);if(c.errors.length>0)return{ok:!1,errors:c.errors};let m=g.length>0&&g.every(e=>"option"===e.definition.role)?[i(t.choice,"choice",g)]:n(g,c),f=i(t.group,"root",m);return{ok:!0,root:f,isQuick:s(f)}};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DomainEntity, DomainState } from '#package/domain';
|
|
2
|
+
import type { AssistantFormTileData } from '../form-elements/index.js';
|
|
3
|
+
import { type AssistantReferenceContext, type AssistantReferenceTarget } from '../reference-link/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* What a `tile` shows of the recipe or option its ref names on the given state, read as the popover
|
|
6
|
+
* of a link reads it; `null` when the ref does not resolve there.
|
|
7
|
+
*/
|
|
8
|
+
export declare const readFormTile: (target: AssistantReferenceTarget, state: DomainState<DomainEntity<string>>, context: AssistantReferenceContext) => AssistantFormTileData | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{readAssistantReferenceDetails as e}from"../reference-link/index.js";export const readFormTile=(r,t,l)=>{let n=e(r,t,l);if(!n)return null;let{name:i,description:o,imageUrl:a,color:c}=n;return{look:(({source:e,imageUrl:r})=>"materialSwatch"===e?"swatch":null==r?"text":"picture")(n),name:i,description:o,imageUrl:a,color:c}};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ASSISTANT_BUILT_IN_FORM_ELEMENTS, type AssistantBuiltInFormElementAttributes, type AssistantBuiltInFormElementName } from '#package/domain';
|
|
2
|
-
import { type FormContainerProps, type FormInputProps, type FormOptionProps } from '../../form-elements/index.js';
|
|
2
|
+
import { type FormContainerProps, type FormInputProps, type FormOptionProps, type FormTileProps } from '../../form-elements/index.js';
|
|
3
3
|
import { type FormElementDefinition } from './form-element-definition.js';
|
|
4
4
|
type BuiltInFormElementRole<NAME extends AssistantBuiltInFormElementName> = Extract<(typeof ASSISTANT_BUILT_IN_FORM_ELEMENTS)[number], {
|
|
5
5
|
readonly name: NAME;
|
|
@@ -10,8 +10,11 @@ interface BuiltInFormInputStates {
|
|
|
10
10
|
readonly number: number;
|
|
11
11
|
readonly confirm: boolean;
|
|
12
12
|
}
|
|
13
|
-
/**
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* The props the component of a built-in element takes: those of its role, typed from its
|
|
15
|
+
* descriptor; a `tile`'s attributes also carry what the form resolved its ref to.
|
|
16
|
+
*/
|
|
17
|
+
export type BuiltInFormElementProps<NAME extends AssistantBuiltInFormElementName> = NAME extends 'tile' ? FormTileProps : BuiltInFormElementRole<NAME> extends 'option' ? FormOptionProps<AssistantBuiltInFormElementAttributes<NAME>> : BuiltInFormElementRole<NAME> extends 'input' ? FormInputProps<NAME extends keyof BuiltInFormInputStates ? BuiltInFormInputStates[NAME] : never, AssistantBuiltInFormElementAttributes<NAME>> : FormContainerProps<AssistantBuiltInFormElementAttributes<NAME>>;
|
|
15
18
|
type Same<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => (T extends B ? 1 : 2) ? true : false;
|
|
16
19
|
type PropsOf<COMPONENT> = COMPONENT extends (props: infer PROPS) => unknown ? PROPS : never;
|
|
17
20
|
/**
|