@salsita-ai/sdk 0.50.0-develop.aec0f535bf → 0.50.0-develop.af031dec0f
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 +6 -0
- package/dist/application-spec/errors/diagnostic-codes.js +1 -1
- package/dist/application-spec/errors/diagnostic-messages.d.ts +7 -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/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/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 +16 -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 +47 -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 +15 -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 +23 -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 +1 -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-assistant.d.ts +42 -5
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.d.ts +4 -3
- package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.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/sections/app-metadata.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +2 -2
- 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/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/index.d.ts +1 -0
- package/dist/client/index.js +1 -1
- package/dist/client/phoenix-api.d.ts +5290 -1754
- 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 +44 -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 +91 -33
- 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 +43 -37
- 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 +2 -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 +29 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/register-webmcp-tools.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 +38 -9
- 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/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/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/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/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/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/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 +2 -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/docs/index.json +22 -2
- 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 +10 -11
- package/dist/docs/other-features/violation-messages.mdx +3 -1
- package/dist/docs/phoenix/application-states.mdx +1 -1
- package/dist/docs/phoenix/configurator-interface.mdx +81 -35
- 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 +1 -1
- package/dist/docs/phoenix/migrations.mdx +1 -1
- package/dist/docs/phoenix/phoenix-cli.mdx +89 -53
- package/dist/docs/phoenix/project-structure.mdx +7 -7
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +56 -27
- package/dist/docs/phoenix/sessions-and-access.mdx +9 -6
- package/dist/docs/phoenix/theming.mdx +5 -9
- package/dist/docs/phoenix/webhooks.mdx +55 -3
- 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 +14 -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 +17 -1
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.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/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/app-metadata.d.ts +1 -0
- package/dist/domain/spec/sections/assistant/assistant-manifest.d.ts +28 -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 +30 -2
- 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 +3 -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/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 +24 -2
- 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/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/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 +1 -1
- package/dist/react-sdk/domain-context/index.js +1 -1
- 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/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 +440 -53
- 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
package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { I18n } from '@lingui/core';
|
|
1
2
|
import { type $DomainEntity, type AssistantManifest, type AssistantRecipeContext, type DomainEntity, type DomainEntityId, type DomainState, type StateUpdate, type StateUpdateEmission, type StateValidationResult } from '#package/domain';
|
|
2
3
|
import { type ViolationEntry } from './violations.js';
|
|
3
4
|
type AnyDomainState = DomainState<DomainEntity<string>>;
|
|
@@ -28,18 +29,23 @@ export interface EntityMetaContext {
|
|
|
28
29
|
readonly takeScreenshot: (source: EntityMetaSource, view: string) => Promise<{
|
|
29
30
|
readonly image: string;
|
|
30
31
|
} | null>;
|
|
32
|
+
/** Whether the configurator's UI lets the user select an entity in a state, for `selectable`. */
|
|
33
|
+
readonly isOfferedForSelection: (entityId: DomainEntityId<string>, state: AnyDomainState) => boolean;
|
|
31
34
|
/**
|
|
32
35
|
* Validates a state: the one an entity was read on, for its warnings, or the one a dry-run ran on,
|
|
33
36
|
* whose warnings the dry-run's own are compared with.
|
|
34
37
|
*/
|
|
35
38
|
readonly validateState: (state: AnyDomainState) => StateValidationResult<DomainEntity<string>, string>;
|
|
39
|
+
/** The language a failed dry-run's violations are formatted in, as the controls format them. */
|
|
40
|
+
readonly i18n: I18n;
|
|
36
41
|
}
|
|
37
42
|
/**
|
|
38
43
|
* The value of an entity's `meta` field: its built-ins, resolved lazily against the state the entity
|
|
39
44
|
* was read on. `childRecipes` and `replaceRecipes` hold one field per manifest recipe group of their
|
|
40
45
|
* kind, read only when selected, `null` when the group is not active on the entity there; each
|
|
41
46
|
* options edge lists the choices of its field there, or `null` when its component is not active;
|
|
42
|
-
* `screenshot` renders the entity there,
|
|
47
|
+
* `screenshot` renders the entity there, `selectable` says whether the agent can select it there, and
|
|
48
|
+
* `warnings` lists the warnings and notices the entity holds there.
|
|
43
49
|
*/
|
|
44
50
|
export declare const createEntityMeta: (source: EntityMetaSource, context: EntityMetaContext) => {
|
|
45
51
|
childRecipes: () => {
|
|
@@ -111,6 +117,7 @@ export declare const createEntityMeta: (source: EntityMetaSource, context: Entit
|
|
|
111
117
|
}) => Promise<{
|
|
112
118
|
readonly image: string;
|
|
113
119
|
} | null>;
|
|
120
|
+
selectable: () => boolean;
|
|
114
121
|
warnings: () => readonly import("./violations.js").AssistantWarning[];
|
|
115
122
|
};
|
|
116
123
|
export {};
|
package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"lodash-es/isEqual.js";import{findAssistantFieldOptions as t,findAssistantRecipeGroups as i,
|
|
1
|
+
import e from"lodash-es/isEqual.js";import{findAssistantFieldOptions as t,findAssistantRecipeGroups as i,isAssistantSelectable as r,isAssistantVisible as n,modifyEntityUpdateTag as a,prepareAssistantRecipeUpdates as o,readAssistantFieldOptions as s,readAssistantRecipeGroup as d,systemUpdateFactory as l}from"#package/domain";import{readSideEffects as c}from"./side-effects.js";import{readEntityWarnings as u,readStateWarnings as p,readViolationEntries as m}from"./violations.js";let y=e=>({ok:!1,root:null,changedEntities:[],deletedEntityIds:[],sideEffects:[],warnings:[],errors:e}),f=(e,{state:t},{manifest:i,recipes:r,prepareStateEmission:a,find$Entity:o,validateState:s,i18n:d})=>{let l=a(e,t,"committed"),{validity:u,state:f,updates:h}=l;if(u.valid){let a=new Map(t.entities.map(e=>[e.id,e])),d=new Set(f.entities.map(e=>e.id)),l=new Set(e.flatMap(e=>{switch(e.kind){case"replaceDomainEntity":return[e.entityId,e.replacementEntity.id];case"createDomainEntity":case"modifyDomainEntity":case"deleteEntity":return[e.entityId];default:return[]}})),m=e=>l.has(e.id)||n(e,i);return{ok:!0,root:o(f.rootEntityId,f),changedEntities:f.entities.filter(e=>a.get(e.id)!==e&&m(e)).flatMap(e=>o(e.id,f)??[]),deletedEntityIds:t.entities.filter(e=>!d.has(e.id)&&m(e)).map(e=>e.id),sideEffects:c(h,r.resolveLocalizable),warnings:()=>p(u,s(t),r.resolveLocalizable),errors:[]}}return y(m({validity:u,stateEmission:l},{i18n:d,resolveLocalizable:r.resolveLocalizable}))};export const createEntityMeta=(n,c)=>{let p=e=>()=>Object.fromEntries(i(c.manifest,e,n.entity.type).map(t=>[t.groupId,()=>{let i=d(e,t,n.entity.id,n.state,c.recipes);return i?((e,t,i)=>{let{group:r,label:n,description:a,recipes:s}=e,{resolveLocalizable:d}=i.recipes;return{groupId:r.groupId,name:void 0===n?r.instanceName:d(n),description:void 0===a?null:d(a),recipes:({keys:r})=>s.filter(e=>!r||r.includes(e.key)).map(r=>((e,t,i,r)=>{let{key:n,item:a}=e,{resolveLocalizable:s}=r.recipes;return{key:n,name:s(a.title),description:void 0===a.description?null:s(a.description),imageUrl:void 0===a.thumbnailUrl?null:s(a.thumbnailUrl),dryRun:()=>t.group.dryRuns?((e,t,i,r)=>{let{updates:n,error:a}=((e,t,{entity:i,state:r},{recipes:n})=>{try{return{updates:o(e,t,i.id,r,n),error:void 0}}catch(e){if("child"===t.target.kind)throw e;return{updates:void 0,error:e instanceof Error?e.message:String(e)}}})(e,t,i,r);return void 0===n?y([{type:"uncaught",entityId:null,message:a}]):f(n,i,r)})(e,t,i,r):null}})(r,e,t,i))}})(i,n,c):null}]));return{...Object.fromEntries(t(c.manifest,n.entity.type).map(t=>[t.edgeName,({values:i})=>s(t,n.entity.id,n.state,c.recipes)?.filter(t=>!i||i.some(i=>e(i,t.value))).map(e=>({...e,dryRun:()=>t.dryRuns?(({field:e},{value:t},i,r)=>{let{entity:n}=i,o=Object.entries(Object.entries(r.manifest.writableFields??{}).find(([e])=>e===n.type)?.[1]??{}).find(([t])=>t===e)?.[1];if(void 0===o)throw Error(`The options of "${e}" on "${n.id}" cannot be dry-run: the schema lists them, but the configurator has no writable field "${e}" on ${n.type}. This is a fault in the configurator, not in your request. Tell the user this is not available.`);let s=i.state.entities.find(e=>e.id===n.id);if(!s)throw Error(`The options of "${e}" on "${n.id}" cannot be dry-run: entity "${n.id}" does not exist. It may have been deleted by an earlier operation or field. Query the current entities and use an id they return.`);let d={[o]:t},c=r.validateEntity({...s,...d});return c.success?f([l.DomainEntityModification({entityId:n.id,stateDelta:d,updateTag:a})],i,r):y([{type:"uncaught",entityId:n.id,message:`Writing ${JSON.stringify(t)} to "${e}" would make "${n.id}" an invalid ${n.type}: ${c.errors.join("; ")}. The option comes from the configurator and cannot be corrected from here, so do not write it.`}])})(t,e,n,c):null}))??null])),childRecipes:p("child"),replaceRecipes:p("replace"),screenshot:({view:e})=>c.takeScreenshot(n,e),selectable:()=>r(n.entity,n.state,c,c.manifest.select??[]),warnings:()=>u(n.entity.id,c.validateState(n.state),c.recipes.resolveLocalizable)}};
|
package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ExecutionResult } from 'graphql';
|
|
2
2
|
import { type Localizable } from '@salsita-ai/common/utils';
|
|
3
|
-
import { type $DomainEntity, type AgentScreenshotComponent, type ComponentSnapshot, type DomainContextSelectors, type DomainEntity, type DomainServicesSelectors, type DomainState, type
|
|
3
|
+
import { type $DomainEntity, type AgentScreenshotComponent, type ComponentSnapshot, type DomainContextSelectors, type DomainEntity, type DomainServicesSelectors, type DomainState, type SessionAssistantSetup, type StateUpdateEmission } from '#package/domain';
|
|
4
|
+
import type { ConfiguratorExtensionSelectors } from '../../selectors.js';
|
|
4
5
|
import { type AssistantWarning } from './violations.js';
|
|
5
6
|
/** One single-operation GraphQL document with its own variables, as executed by {@link GraphQLSystem}. */
|
|
6
7
|
export interface GraphQLOperation {
|
|
@@ -8,12 +9,36 @@ export interface GraphQLOperation {
|
|
|
8
9
|
readonly variables?: Readonly<Record<string, unknown>>;
|
|
9
10
|
readonly operationName?: string;
|
|
10
11
|
}
|
|
11
|
-
/**
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* A screenshot an operation took, under the label its `image` field returned: either the id the
|
|
14
|
+
* server stored the picture under, which the panel's tool result references it by, or the picture
|
|
15
|
+
* itself, kept in the browser for a caller that hands it on without the server (WebMCP).
|
|
16
|
+
*/
|
|
17
|
+
export type GraphQLScreenshot = {
|
|
13
18
|
readonly entityId: string;
|
|
14
19
|
readonly view: string;
|
|
15
|
-
|
|
20
|
+
} & ({
|
|
16
21
|
readonly imageId: string;
|
|
22
|
+
} | {
|
|
23
|
+
readonly image: Blob;
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* Where the screenshots of an execution go: `upload` stores each one in the assistant thread on the
|
|
27
|
+
* server, which the panel's assistant needs; `inline` keeps the picture in the browser, for an
|
|
28
|
+
* outside agent that receives it in the tool result and has no thread to store it in.
|
|
29
|
+
*/
|
|
30
|
+
export type GraphQLScreenshotStorage = 'upload' | 'inline';
|
|
31
|
+
/** How {@link GraphQLSystem.prepare} and {@link GraphQLSystem.execute} run their operations. */
|
|
32
|
+
export interface GraphQLExecutionOptions {
|
|
33
|
+
/** Where the screenshots go; `upload` when omitted. */
|
|
34
|
+
readonly screenshots?: GraphQLScreenshotStorage;
|
|
35
|
+
/**
|
|
36
|
+
* Runs only the mutations that move the user around the UI, for a caller that may not change the
|
|
37
|
+
* configuration right now: every other mutation field fails with `message`, which says why.
|
|
38
|
+
*/
|
|
39
|
+
readonly navigationOnly?: {
|
|
40
|
+
readonly message: string;
|
|
41
|
+
};
|
|
17
42
|
}
|
|
18
43
|
export interface GraphQLSystemContext {
|
|
19
44
|
/** The assistant the initialized session runs: the operations are validated and executed against its schema. */
|
|
@@ -31,6 +56,7 @@ export interface GraphQLSystemContext {
|
|
|
31
56
|
readonly uploadScreenshot: (image: Blob) => Promise<{
|
|
32
57
|
readonly imageId: string;
|
|
33
58
|
}>;
|
|
59
|
+
readonly configuratorExtensionSelectors: Pick<ConfiguratorExtensionSelectors, 'getActionSystem'>;
|
|
34
60
|
readonly domainContextSelectors: DomainContextSelectors;
|
|
35
61
|
readonly domainServicesSelectors: DomainServicesSelectors;
|
|
36
62
|
}
|
|
@@ -112,9 +138,12 @@ export declare class GraphQLSystem {
|
|
|
112
138
|
private readonly _find$Entity;
|
|
113
139
|
private readonly _validateState;
|
|
114
140
|
private readonly _validateCached;
|
|
141
|
+
private readonly _readOfferedNavigation;
|
|
142
|
+
private readonly _isOfferedForSelection;
|
|
115
143
|
private readonly _recipeContext;
|
|
116
144
|
/** Root field resolvers, called by the executor with the field arguments and the operation context. */
|
|
117
145
|
private readonly _rootValue;
|
|
146
|
+
/** An entity resolves to its own object type, or to `OtherEntity` when the active manifest does not expose its type. */
|
|
118
147
|
private readonly _resolveType;
|
|
119
148
|
private _generation;
|
|
120
149
|
/**
|
|
@@ -139,7 +168,8 @@ export declare class GraphQLSystem {
|
|
|
139
168
|
private readonly _runMutation;
|
|
140
169
|
/**
|
|
141
170
|
* Takes a screenshot once every one asked for before it in the execution has been taken, so they
|
|
142
|
-
* render in document order, and
|
|
171
|
+
* render in document order, and stores it as the execution asks as soon as it has rendered:
|
|
172
|
+
* uploaded, or kept as the picture. A failure nulls only its
|
|
143
173
|
* own field and fails nothing else: the user kept changing the configuration, rendering failed,
|
|
144
174
|
* or the server did not store the picture.
|
|
145
175
|
*/
|
|
@@ -155,10 +185,9 @@ export declare class GraphQLSystem {
|
|
|
155
185
|
* Runs the operations in order through one working state that starts at `originalState`: a query
|
|
156
186
|
* reads the current working state, and each mutation field advances it with its own emission.
|
|
157
187
|
* The closing braces an operation's document left off are added, then the lenses it spreads are injected into it. Nothing is committed. The first operation that fails stops the list; every later one gets a
|
|
158
|
-
* "not run" error instead. Screenshots render only while
|
|
159
|
-
* default, is active.
|
|
188
|
+
* "not run" error instead. Screenshots render only while the current initialization is active.
|
|
160
189
|
*/
|
|
161
|
-
prepare: (originalState: AnyDomainState, operations: readonly GraphQLOperation[],
|
|
190
|
+
prepare: (originalState: AnyDomainState, operations: readonly GraphQLOperation[], { screenshots: screenshotStorage, navigationOnly }?: GraphQLExecutionOptions) => Promise<readonly PreparedOperation[]>;
|
|
162
191
|
/**
|
|
163
192
|
* The side effects of prepared operations: the hints of every update of their emissions, as the
|
|
164
193
|
* agent is told them, in applied order.
|
|
@@ -182,6 +211,6 @@ export declare class GraphQLSystem {
|
|
|
182
211
|
* nothing is committed or prepared again: the operations were written for the configuration
|
|
183
212
|
* that was left.
|
|
184
213
|
*/
|
|
185
|
-
execute: (operations: readonly GraphQLOperation[]) => Promise<GraphQLExecution>;
|
|
214
|
+
execute: (operations: readonly GraphQLOperation[], options?: GraphQLExecutionOptions) => Promise<GraphQLExecution>;
|
|
186
215
|
}
|
|
187
216
|
export {};
|
package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{GraphQLError as e,NoSchemaIntrospectionCustomRule as t,defaultFieldResolver as i,execute as n,getNamedType as o,parse as r,specifiedRules as s,validate as a,validateSchema as l}from"graphql";import{assertExistence as c,createSelector as h,isMessageDescriptor as d,isMultilingualString as u}from"@salsita-ai/common/utils";import{AGENT_SCREENSHOT_MAX_SIDE as m,DomainEntityIdSchema as f,agentScreenshotComponent as p,createAssistantExecutionSchema as g,findAssistantMutation as v}from"#package/domain";import{ExportBusyError as y}from"../export-system/export-busy-error.js";import{closeUnclosedBraces as S}from"./close-unclosed-braces.js";import{createEntityMeta as _}from"./entity-meta.js";import{injectAssistantLenses as w}from"./inject-assistant-lenses.js";import{readSideEffects as x}from"./side-effects.js";import{ViolationsError as E,readStateWarnings as T,readViolationEntries as $}from"./violations.js";let b={errors:[new e("The configurator does not provide this request. This is a fault in the configurator, not in your request. Tell the user this is not available.")]},C={errors:[new e("The configuration is not loaded yet, so there is no state to query. Run the query again once the configurator has finished loading.")]},N="Not taken: another configuration was loaded while this request ran. Query the current configuration before asking for screenshots again.",M=class ScreenshotTooLargeError extends Error{constructor(e,t){super(`The view is configured at ${e} \xd7 ${t} px, more than the ${m} \xd7 ${m} px a screenshot may have.`),this.name="ScreenshotTooLargeError"}},R=new RegExp(f.pattern),k=[...s,t],j=e=>"object"==typeof e&&null!==e&&"type"in e&&"string"==typeof e.type&&"id"in e&&"string"==typeof e.id,A=(e,t)=>"object"==typeof e&&null!==e?Reflect.get(e,t):void 0,L=e=>e instanceof Error?e.message:String(e),O=e=>/[.!?]$/.test(e)?e:`${e}.`,z=e=>"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.prototype,q=(e,t)=>{let i=z(e)?e._raw:void 0;if(j(i))return i;if(!Array.isArray(e)&&!z(e))return e;if(t.has(e))throw Error("The value contains itself.");let n=new Set([...t,e]);return Array.isArray(e)?e.map(e=>q(e,n)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,q(t,n)]))};export const localize=(e,t)=>Array.isArray(e)?e.map(e=>localize(e,t)):"string"==typeof e||d(e)||u(e)?t(e):e;let F=t=>new e(`The configurator cannot handle this request: ${O(t)} This is a fault in the configurator, not in your request. Tell the user this is not available.`);export const SCREENSHOT_NOT_TAKEN="SCREENSHOT_NOT_TAKEN";let I=(t,i)=>new e(t,{originalError:i,extensions:{code:SCREENSHOT_NOT_TAKEN}}),V=e=>(e.errors??[]).some(e=>e.extensions.code!==SCREENSHOT_NOT_TAKEN),P=t=>({errors:[new e(`Not run: operation ${t+1} failed, so the operations after it were skipped and no change of the list takes effect. Fix the failing operation and send the whole list again.`)]});export class GraphQLSystem{_context;_selectSchema=h([h.leaf(e=>e)],e=>{try{let t=g(e),i=l(t);return i.length>0?F(i.map(e=>e.message).join(" ")):t}catch(e){return F(L(e))}});_selectLenses=h([h.leaf(e=>e)],e=>r(e));_selectFieldResolver=h([h.leaf(e=>e)],t=>(n,r,s,a)=>{if(a.parentType===a.schema.getQueryType())return i(n,r,s,a);if(a.parentType===a.schema.getMutationType())return this._resolveMutation(a.fieldName,String(a.path.key),r,s);if(!j(n))return i(n,r,s,a);if("meta"===a.fieldName){let e;return _({entity:n,state:("object"==typeof(e=A(n,"_state"))&&null!==e&&"entities"in e&&"rootEntityId"in e?e:void 0)??s.state},{manifest:s.manifest,recipes:this._recipeContext(),prepareStateEmission:(e,t,i)=>{let n=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(e,t,i);return s.validities.set(n.state,n.validity),n},find$Entity:(e,t)=>this._find$Entity(e,t),validateEntity:e=>this._context.domainContextSelectors.getDomain().validateEntity(e),takeScreenshot:(e,t)=>this._takeScreenshot(e,t,s),validateState:e=>this._validateCached(e,s)})}let{source:l,localized:c}=t[a.parentType.name]?.[a.fieldName]??{source:a.fieldName},h=((t,i)=>{try{return A(t,i)}catch(n){throw new e(`Expression "${i}" failed on ${j(t)?t.id:"an entity"}: ${O(L(n))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:n instanceof Error?n:void 0})}})(n,l);return c?localize(h,this._context.domainServicesSelectors.getResolveLocalizable()):l.startsWith("$")&&"JSON"===o(a.returnType).name?((t,i,n)=>{try{return q(n,new Set)}catch(n){throw new e(`Expression "${i}" returned a value that is not plain serializable data on ${j(t)?t.id:"an entity"}: ${O(L(n))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:n instanceof Error?n:void 0})}})(n,l,h):h});constructor(e){this._context=e}_get$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().get$Entity(e,t);_find$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().getEntity(e,t)?this._get$Entity(e,t):null;_validateState=e=>this._context.domainContextSelectors.getValidationProjections().validateState(e);_validateCached=(e,{validities:t})=>{let i=t.get(e);if(i)return i;let n=this._validateState(e);return t.set(e,n),n};_recipeContext=()=>({componentReader:this._context.domainContextSelectors.getComponentReader(),recipeCooker:this._context.domainContextSelectors.getRecipeCookerSystem(),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});_rootValue={warnings:(e,t)=>T(this._validateCached(t.state,t),void 0,this._context.domainServicesSelectors.getResolveLocalizable()),root:(e,{state:t})=>this._get$Entity(t.rootEntityId,t),entities:({ids:t},{state:i})=>{if(null==t)return i.entities.map(e=>this._get$Entity(e.id,i));var n=i.rootEntityId;let o=t.filter(e=>!R.test(e));if(o.length>0)throw new e(`${o.map(e=>`"${e}"`).join(", ")} ${1===o.length?"is not an entity id":"are not entity ids"}. Entity ids have the form "<Type>-<number>", e.g. "${n}". Use ids as returned by the "id" field.`);return t.map(e=>R.test(e)?this._find$Entity(e,i):null)},selectedEntity:(e,{state:t})=>this._find$Entity(this._context.domainContextSelectors.getNavigationSystem().getActiveSelectionState(t),t),navigation:(e,{state:t})=>{let i=this._context.domainContextSelectors.getNavigationSystem();return{navigationState:i.getActiveNavigationState(t),viewState:i.getActiveViewState(t),toolState:i.getActiveToolState(t)}}};_resolveType=e=>j(e)?e.type:void 0;_generation={active:!0};_renderScreenshot=async(e,t,i)=>{let n=this._context.domainContextSelectors.getComponentReader().readOneComponent({entityId:e,componentType:p,instanceName:t},i);if(!n)return null;let{width:o,height:r}=n.state;if(o>m||r>m)throw new M(o,r);let s=await this._context.renderScreenshot(n,i);return null===s?null:new Blob([s],{type:"JPEG"===n.state.fileFormat?"image/jpeg":"image/png"})};initialize=()=>{this._generation.active=!1,this._generation={active:!0}};_resolveMutation=(t,i,n,o)=>{if(void 0!==o.failedMutationField)throw new e(`Not run: the earlier field "${o.failedMutationField}" of this operation failed, so "${i}" was skipped and no change of the operation takes effect. Fix the failing field and send the operation again.`);try{return this._runMutation(t,n,o)}catch(e){throw o.failedMutationField=i,e}};_runMutation=(t,i,n)=>{let o=v(t,n.manifest);if(!o)throw new e(`The schema declares the mutation "${t}", but the configurator has no implementation for it. This is a fault in the configurator, not in your request. Tell the user this is not available.`);let r=n.state,s=o.implementation(i,r,{manifest:n.manifest,action:this._context.domainContextSelectors.getActionSystem().createContext(r),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});if(s.updates.length>0){let i=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(s.updates,r,"committed"),{validity:o}=i;if("uncaught"===o.severity)throw new e(`The changes of "${t}" were not applied, because the resulting configuration is invalid: validating it threw: ${O(L(o.error))} Change the request so the configuration stays valid.`,{originalError:o.error});if(!o.valid)throw new E(`The changes of "${t}" were not applied, because the resulting configuration has ${o.severity} violations.`,$(o,this._context.domainServicesSelectors.getResolveLocalizable()));n.emissions.push(i),n.validities.set(i.state,o),n.state=i.state}return s.readResult({previousState:r,state:n.state})};_takeScreenshot=({entity:t,state:i},n,o)=>{let r=o.manifest.screenshots?.[t.type]?.find(e=>e.view===n);if(!r)return Promise.reject(new e(`The schema declares the screenshot view "${n}" on ${t.type}, but the configurator has no view of that name. This is a fault in the configurator, not in your request. Tell the user this is not available.`));let s=o.lastScreenshot.then(async()=>{if(!o.generation.active)throw I(N);let e=await this._renderScreenshot(t.id,r.instanceName,i).catch(e=>{throw I(e instanceof y?"User made concurrent actions that prevented the screenshot from being taken, try again":e instanceof M?`The screenshot of ${t.id} from "${n}" cannot be taken: ${e.message} Tell the user the screenshot is not available.`:`The screenshot of ${t.id} from "${n}" could not be taken: ${O(L(e))} Try again; if it fails again, tell the user the screenshot is not available.`,e instanceof Error?e:void 0)});if(!o.generation.active)throw I(N);if(null===e)return null;let{imageId:s}=await this._context.uploadScreenshot(e).catch(e=>{throw I(`The screenshot of ${t.id} from "${n}" was taken but could not be stored: ${O(L(e))} Try again; if it fails again, tell the user the screenshot is not available.`,e instanceof Error?e:void 0)}),a=`${t.id}/${n}`,l=[...o.screenshots.values()].filter(e=>e.entityId===t.id&&e.view===n).length,c=0===l?a:`${a}#${l+1}`;return o.screenshots.set(c,{entityId:t.id,view:n,imageId:s}),{image:c}});return o.lastScreenshot=s.catch(()=>void 0),s};_setup=()=>{let{manifest:t,error:i}=this._context.getAssistantSetup();if(i)return{ready:!1,result:{errors:[new e(i.message,{originalError:i})]}};if(!t)return{ready:!1,result:b};let n=this._selectSchema(t.sdl);return n instanceof e?{ready:!1,result:{errors:[n]}}:{ready:!0,assistant:t,schema:n,lenses:t.lenses?.definitions?this._selectLenses(t.lenses.definitions):void 0,fieldResolver:this._selectFieldResolver(t.fields)}};_run=async(t,i,o,s)=>{var l;let c;try{c=r(t)}catch(t){return{errors:[t instanceof e?t:new e(L(t))]}}let h=a(o.schema,c,k);return h.length>0?{errors:h}:(l=await n({schema:o.schema,document:c,rootValue:this._rootValue,contextValue:s,variableValues:i.variables,operationName:i.operationName,fieldResolver:o.fieldResolver,typeResolver:this._resolveType}),l.errors?.some(e=>e.originalError instanceof E)?{...l,errors:l.errors.flatMap(t=>t.originalError instanceof E?t.originalError.entries.map(({type:i,entityId:n,message:o})=>new e(o??i,{nodes:t.nodes,source:t.source,positions:t.positions,path:t.path,extensions:{code:"VIOLATION",type:i,entityId:n}})):[t])}:l)};prepare=async(t,i,n=this._generation)=>{let o,r=this._setup();if(!r.ready)return i.map(()=>({result:r.result,emissions:[],screenshots:new Map}));let s={manifest:r.assistant,state:t,emissions:[],failedMutationField:void 0,screenshots:new Map,lastScreenshot:Promise.resolve(),generation:n,validities:new WeakMap},a=[];for(let[t,n]of i.entries())if(void 0===o){let i=s.emissions.length,l=s.screenshots.size;s.failedMutationField=void 0;let c=S(n.document),h=r.lenses?w(c,r.lenses):c,d=h instanceof e?{errors:[h]}:await this._run(h,n,r,s);await s.lastScreenshot,a.push({result:d,emissions:s.emissions.slice(i),screenshots:new Map([...s.screenshots].slice(l))}),V(d)&&(o=t)}else a.push({result:P(o),emissions:[],screenshots:new Map});return a};readSideEffects=e=>{let t=this._context.domainServicesSelectors.getResolveLocalizable();return e.flatMap(({emissions:e})=>e.flatMap(e=>x(e.updates,t)))};readScreenshots=e=>new Map(e.flatMap(({screenshots:e})=>[...e]));readWarnings=(e,t)=>{let i=t.flatMap(({emissions:e})=>e).at(-1);return void 0===i||t.some(({result:e})=>V(e))?[]:T(i.validity,this._validateState(e),this._context.domainServicesSelectors.getResolveLocalizable())};_prepareAndCommit=async(e,t)=>{let i,n,o,r=this._context.domainContextSelectors.getStoreSystem(),s=r.stateSlices.committed.value.state,a=await this.prepare(s,e,t),l=a.map(({result:e})=>e),h=this.readSideEffects(a),d=this.readScreenshots(a),u=a.flatMap(e=>e.emissions);if(!t.active)return{results:l,sideEffects:h,screenshots:d,warnings:[],outcome:"conflict"};if(l.some(V)||0===u.length)return{results:l,sideEffects:h,screenshots:d,warnings:[],outcome:"none"};let m=(i=c(u[0]),n=c(u[u.length-1]),o=u.some(e=>void 0!==e.transformationLog),{kind:"committed",previousState:i.previousState,state:n.state,updates:u.flatMap(e=>e.updates),validity:n.validity,transformationLog:o?u.flatMap(e=>e.transformationLog??[]):void 0});return{results:l,sideEffects:h,screenshots:d,warnings:this.readWarnings(s,a),outcome:r.commitPrepared(m),preparedState:m.state}};execute=async e=>{let t=this._generation;if(!this._context.domainContextSelectors.getStoreSystem().isInitialized)return{results:e.map(()=>C),committed:!1,sideEffects:[],warnings:[],screenshots:new Map};let i=await this._prepareAndCommit(e,t),{results:n,sideEffects:o,warnings:r,screenshots:s,outcome:a,preparedState:l}="conflict"===i.outcome&&t.active?await this._prepareAndCommit(e,t):i;return"committed"===a?{results:n,committed:!0,sideEffects:o,warnings:r,screenshots:s,preparedState:l}:"held"===a?{results:n,committed:!1,message:"The changes wait for the user's approval and are not applied yet. Do not send them again; the next `[changes]` block lists them once approved.",sideEffects:o,warnings:r,screenshots:s,preparedState:l}:"conflict"===a?{results:n,committed:!1,message:"The changes were not committed, because the configuration changed while they were being applied. The results describe a state that was discarded. Query the current configuration and send the operations again if they still make sense.",sideEffects:o,warnings:r,screenshots:s}:{results:n,committed:!1,sideEffects:o,warnings:r,screenshots:s}}}
|
|
1
|
+
import{GraphQLError as e,NoSchemaIntrospectionCustomRule as t,defaultFieldResolver as i,execute as n,getNamedType as o,parse as r,specifiedRules as s,validate as a,validateSchema as l}from"graphql";import{assertExistence as c,createSelector as h,isMessageDescriptor as d,isMultilingualString as f}from"@salsita-ai/common/utils";import{AGENT_SCREENSHOT_MAX_SIDE as m,ASSISTANT_OTHER_ENTITY as u,DomainEntityIdSchema as p,agentScreenshotComponent as g,createAssistantExecutionSchema as v,findAssistantMutation as y,isAssistantVisible as S,readAssistantNavigation as _}from"#package/domain";import{ExportBusyError as w}from"../export-system/export-busy-error.js";import{closeUnclosedBraces as x}from"./close-unclosed-braces.js";import{createEntityMeta as E}from"./entity-meta.js";import{injectAssistantLenses as T}from"./inject-assistant-lenses.js";import{isOfferedForSelection as b}from"./is-offered-for-selection.js";import{readOfferedNavigation as $}from"./read-offered-navigation.js";import{readSideEffects as C}from"./side-effects.js";import{ViolationsError as N,readStateWarnings as O,readViolationEntries as R}from"./violations.js";let j={errors:[new e("The configurator does not provide this request. This is a fault in the configurator, not in your request. Tell the user this is not available.")]},M={errors:[new e("The configuration is not loaded yet, so there is no state to query. Run the query again once the configurator has finished loading.")]},k="Not taken: another configuration was loaded while this request ran. Query the current configuration before asking for screenshots again.",A=class ScreenshotTooLargeError extends Error{constructor(e,t){super(`The view is configured at ${e} \xd7 ${t} px, more than the ${m} \xd7 ${m} px a screenshot may have.`),this.name="ScreenshotTooLargeError"}},L=new RegExp(p.pattern),z=[...s,t],F=e=>"object"==typeof e&&null!==e&&"type"in e&&"string"==typeof e.type&&"id"in e&&"string"==typeof e.id,q=(e,t)=>"object"==typeof e&&null!==e?Reflect.get(e,t):void 0,I=e=>e instanceof Error?e.message:String(e),V=e=>/[.!?]$/.test(e)?e:`${e}.`,P=e=>"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.prototype,D=(e,t)=>{let i=P(e)?e._raw:void 0;if(F(i))return i;if(!Array.isArray(e)&&!P(e))return e;if(t.has(e))throw Error("The value contains itself.");let n=new Set([...t,e]);return Array.isArray(e)?e.map(e=>D(e,n)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,D(t,n)]))};export const localize=(e,t)=>Array.isArray(e)?e.map(e=>localize(e,t)):"string"==typeof e||d(e)||f(e)?t(e):e;let H=t=>new e(`The configurator cannot handle this request: ${V(t)} This is a fault in the configurator, not in your request. Tell the user this is not available.`);export const SCREENSHOT_NOT_TAKEN="SCREENSHOT_NOT_TAKEN";let K=(t,i)=>new e(t,{originalError:i,extensions:{code:SCREENSHOT_NOT_TAKEN}}),Q=e=>(e.errors??[]).some(e=>e.extensions.code!==SCREENSHOT_NOT_TAKEN),W=t=>({errors:[new e(`Not run: operation ${t+1} failed, so the operations after it were skipped and no change of the list takes effect. Fix the failing operation and send the whole list again.`)]}),G=e=>Array.isArray(e)?e.map(G):"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,G(t)])):e;export class GraphQLSystem{_context;_selectSchema=h([h.leaf(e=>e)],e=>{try{let t=v(e),i=l(t);return i.length>0?H(i.map(e=>e.message).join(" ")):t}catch(e){return H(I(e))}});_selectLenses=h([h.leaf(e=>e)],e=>r(e));_selectFieldResolver=h([h.leaf(e=>e)],t=>(n,r,s,a)=>{if(a.parentType===a.schema.getQueryType())return i(n,r,s,a);if(a.parentType===a.schema.getMutationType())return this._resolveMutation(a.fieldName,String(a.path.key),r,s);if(!F(n))return i(n,r,s,a);if("meta"===a.fieldName){let e;return E({entity:n,state:("object"==typeof(e=q(n,"_state"))&&null!==e&&"entities"in e&&"rootEntityId"in e?e:void 0)??s.state},{manifest:s.manifest,recipes:this._recipeContext(),prepareStateEmission:(e,t,i)=>{let n=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(e,t,i);return s.validities.set(n.state,n.validity),n},find$Entity:(e,t)=>this._find$Entity(e,t),validateEntity:e=>this._context.domainContextSelectors.getDomain().validateEntity(e),takeScreenshot:(e,t)=>this._takeScreenshot(e,t,s),isOfferedForSelection:this._isOfferedForSelection,i18n:this._context.domainServicesSelectors.getI18n(),validateState:e=>this._validateCached(e,s)})}let{source:l,localized:c}=t[a.parentType.name]?.[a.fieldName]??{source:a.fieldName},h=((t,i)=>{try{return q(t,i)}catch(n){throw new e(`Expression "${i}" failed on ${F(t)?t.id:"an entity"}: ${V(I(n))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:n instanceof Error?n:void 0})}})(n,l);return c?localize(h,this._context.domainServicesSelectors.getResolveLocalizable()):l.startsWith("$")&&"JSON"===o(a.returnType).name?((t,i,n)=>{try{return D(n,new Set)}catch(n){throw new e(`Expression "${i}" returned a value that is not plain serializable data on ${F(t)?t.id:"an entity"}: ${V(I(n))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:n instanceof Error?n:void 0})}})(n,l,h):h});constructor(e){this._context=e}_get$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().get$Entity(e,t);_find$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().getEntity(e,t)?this._get$Entity(e,t):null;_validateState=e=>this._context.domainContextSelectors.getValidationProjections().validateState(e);_validateCached=(e,{validities:t})=>{let i=t.get(e);if(i)return i;let n=this._validateState(e);return t.set(e,n),n};_readOfferedNavigation=e=>$(e,{componentReader:this._context.domainContextSelectors.getComponentReader(),navigationSystem:this._context.domainContextSelectors.getNavigationSystem()});_isOfferedForSelection=(e,t)=>b(e,t,{componentReader:this._context.domainContextSelectors.getComponentReader()});_recipeContext=()=>({componentReader:this._context.domainContextSelectors.getComponentReader(),recipeCooker:this._context.domainContextSelectors.getRecipeCookerSystem(),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});_rootValue={warnings:(e,t)=>O(this._validateCached(t.state,t),void 0,this._context.domainServicesSelectors.getResolveLocalizable()),root:(e,{state:t})=>this._get$Entity(t.rootEntityId,t),entities:({ids:t},{state:i})=>{if(null==t)return i.entities.map(e=>this._get$Entity(e.id,i));var n=i.rootEntityId;let o=t.filter(e=>!L.test(e));if(o.length>0)throw new e(`${o.map(e=>`"${e}"`).join(", ")} ${1===o.length?"is not an entity id":"are not entity ids"}. Entity ids have the form "<Type>-<number>", e.g. "${n}". Use ids as returned by the "id" field.`);return t.map(e=>L.test(e)?this._find$Entity(e,i):null)},selectedEntity:(e,{state:t})=>this._find$Entity(this._context.domainContextSelectors.getNavigationSystem().getActiveSelectionState(t),t),navigation:(e,{state:t,manifest:i})=>_(t,{navigationSystem:this._context.domainContextSelectors.getNavigationSystem(),readOfferedNavigation:this._readOfferedNavigation},i.navigation??{navigationStates:[],viewStates:[],toolStates:[]})};_resolveType=(e,{manifest:t})=>{if(F(e))return S(e,t)?e.type:u};_generation={active:!0};_renderScreenshot=async(e,t,i)=>{let n=this._context.domainContextSelectors.getComponentReader().readOneComponent({entityId:e,componentType:g,instanceName:t},i);if(!n)return null;let{width:o,height:r}=n.state;if(o>m||r>m)throw new A(o,r);let s=await this._context.renderScreenshot(n,i);return null===s?null:new Blob([s],{type:"JPEG"===n.state.fileFormat?"image/jpeg":"image/png"})};initialize=()=>{this._generation.active=!1,this._generation={active:!0}};_resolveMutation=(t,i,n,o)=>{if(void 0!==o.failedMutationField)throw new e(`Not run: the earlier field "${o.failedMutationField}" of this operation failed, so "${i}" was skipped and no change of the operation takes effect. Fix the failing field and send the operation again.`);try{return this._runMutation(t,n,o)}catch(e){throw o.failedMutationField=i,e}};_runMutation=(t,i,n)=>{let o=y(t,n.manifest),r=Object.entries(n.manifest.actions??{}).find(([e])=>e===t)?.[1];if(!o&&void 0===r)throw new e(`The schema declares the mutation "${t}", but the configurator has no implementation for it. This is a fault in the configurator, not in your request. Tell the user this is not available.`);if(n.navigationOnly&&!o?.navigation)throw new e(n.navigationOnly.message);let s=n.state,a=o?o.implementation(i,s,{manifest:n.manifest,systems:this._context.domainContextSelectors.getDomainSystems(),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable(),readOfferedNavigation:this._readOfferedNavigation,isOfferedForSelection:this._isOfferedForSelection}):this._context.configuratorExtensionSelectors.getActionSystem().prepareAction(r,G(i),s);if(a.updates.length>0){let i=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(a.updates,s,"committed"),{validity:o}=i;if("uncaught"===o.severity)throw new e(`The changes of "${t}" were not applied, because the resulting configuration is invalid: validating it threw: ${V(I(o.error))} Change the request so the configuration stays valid.`,{originalError:o.error});if(!o.valid)throw new N(`The changes of "${t}" were not applied, because the resulting configuration has ${o.severity} violations.`,R({validity:o,stateEmission:i},{i18n:this._context.domainServicesSelectors.getI18n(),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()}));n.emissions.push(i),n.validities.set(i.state,o),n.state=i.state}return a.readResult({previousState:s,state:n.state})};_takeScreenshot=({entity:t,state:i},n,o)=>{let r=o.manifest.screenshots?.[t.type]?.find(e=>e.view===n);if(!r)return Promise.reject(new e(`The schema declares the screenshot view "${n}" on ${t.type}, but the configurator has no view of that name. This is a fault in the configurator, not in your request. Tell the user this is not available.`));let s=o.lastScreenshot.then(async()=>{if(!o.generation.active)throw K(k);let e=await this._renderScreenshot(t.id,r.instanceName,i).catch(e=>{throw K(e instanceof w?"User made concurrent actions that prevented the screenshot from being taken, try again":e instanceof A?`The screenshot of ${t.id} from "${n}" cannot be taken: ${e.message} Tell the user the screenshot is not available.`:`The screenshot of ${t.id} from "${n}" could not be taken: ${V(I(e))} Try again; if it fails again, tell the user the screenshot is not available.`,e instanceof Error?e:void 0)});if(!o.generation.active)throw K(k);if(null===e)return null;let s="inline"===o.screenshotStorage?{image:e}:await this._context.uploadScreenshot(e).catch(e=>{throw K(`The screenshot of ${t.id} from "${n}" was taken but could not be stored: ${V(I(e))} Try again; if it fails again, tell the user the screenshot is not available.`,e instanceof Error?e:void 0)}),a=`${t.id}/${n}`,l=[...o.screenshots.values()].filter(e=>e.entityId===t.id&&e.view===n).length,c=0===l?a:`${a}#${l+1}`;return o.screenshots.set(c,{entityId:t.id,view:n,...s}),{image:c}});return o.lastScreenshot=s.catch(()=>void 0),s};_setup=()=>{let{manifest:t,error:i}=this._context.getAssistantSetup();if(i)return{ready:!1,result:{errors:[new e(i.message,{originalError:i})]}};if(!t)return{ready:!1,result:j};let n=this._selectSchema(t.sdl);return n instanceof e?{ready:!1,result:{errors:[n]}}:{ready:!0,assistant:t,schema:n,lenses:t.lenses?.definitions?this._selectLenses(t.lenses.definitions):void 0,fieldResolver:this._selectFieldResolver(t.fields)}};_run=async(t,i,o,s)=>{var l;let c;try{c=r(t)}catch(t){return{errors:[t instanceof e?t:new e(I(t))]}}let h=a(o.schema,c,z);return h.length>0?{errors:h}:(l=await n({schema:o.schema,document:c,rootValue:this._rootValue,contextValue:s,variableValues:i.variables,operationName:i.operationName,fieldResolver:o.fieldResolver,typeResolver:this._resolveType}),l.errors?.some(e=>e.originalError instanceof N)?{...l,errors:l.errors.flatMap(t=>t.originalError instanceof N?t.originalError.entries.map(({type:i,entityId:n,message:o,details:r})=>new e(o,{nodes:t.nodes,source:t.source,positions:t.positions,path:t.path,extensions:{code:"VIOLATION",type:i,entityId:n,...void 0===r?{}:{details:r}}})):[t])}:l)};prepare=async(t,i,{screenshots:n="upload",navigationOnly:o}={})=>{let r,s=this._generation,a=this._setup();if(!a.ready)return i.map(()=>({result:a.result,emissions:[],screenshots:new Map}));let l={manifest:a.assistant,state:t,emissions:[],failedMutationField:void 0,screenshots:new Map,lastScreenshot:Promise.resolve(),generation:s,screenshotStorage:n,navigationOnly:o,validities:new WeakMap},c=[];for(let[t,n]of i.entries())if(void 0===r){let i=l.emissions.length,o=l.screenshots.size;l.failedMutationField=void 0;let s=x(n.document),h=a.lenses?T(s,a.lenses):s,d=h instanceof e?{errors:[h]}:await this._run(h,n,a,l);await l.lastScreenshot,c.push({result:d,emissions:l.emissions.slice(i),screenshots:new Map([...l.screenshots].slice(o))}),Q(d)&&(r=t)}else c.push({result:W(r),emissions:[],screenshots:new Map});return c};readSideEffects=e=>{let t=this._context.domainServicesSelectors.getResolveLocalizable();return e.flatMap(({emissions:e})=>e.flatMap(e=>C(e.updates,t)))};readScreenshots=e=>new Map(e.flatMap(({screenshots:e})=>[...e]));readWarnings=(e,t)=>{let i=t.flatMap(({emissions:e})=>e).at(-1);return void 0===i||t.some(({result:e})=>Q(e))?[]:O(i.validity,this._validateState(e),this._context.domainServicesSelectors.getResolveLocalizable())};_prepareAndCommit=async(e,t,i)=>{let n,o,r,s=this._context.domainContextSelectors.getStoreSystem(),a=s.stateSlices.committed.value.state,l=await this.prepare(a,e,i),h=l.map(({result:e})=>e),d=this.readSideEffects(l),f=this.readScreenshots(l),m=l.flatMap(e=>e.emissions);if(!t.active)return{results:h,sideEffects:d,screenshots:f,warnings:[],outcome:"conflict"};if(h.some(Q)||0===m.length)return{results:h,sideEffects:d,screenshots:f,warnings:[],outcome:"none"};let u=(n=c(m[0]),o=c(m[m.length-1]),r=m.some(e=>void 0!==e.transformationLog),{kind:"committed",previousState:n.previousState,state:o.state,updates:m.flatMap(e=>e.updates),validity:o.validity,transformationLog:r?m.flatMap(e=>e.transformationLog??[]):void 0});return{results:h,sideEffects:d,screenshots:f,warnings:this.readWarnings(a,l),outcome:s.commitPrepared(u),preparedState:u.state}};execute=async(e,t={})=>{let i=this._generation;if(!this._context.domainContextSelectors.getStoreSystem().isInitialized)return{results:e.map(()=>M),committed:!1,sideEffects:[],warnings:[],screenshots:new Map};let n=await this._prepareAndCommit(e,i,t),{results:o,sideEffects:r,warnings:s,screenshots:a,outcome:l,preparedState:c}="conflict"===n.outcome&&i.active?await this._prepareAndCommit(e,i,t):n;return"committed"===l?{results:o,committed:!0,sideEffects:r,warnings:s,screenshots:a,preparedState:c}:"held"===l?{results:o,committed:!1,message:"The changes wait for the user's approval and are not applied yet. Do not send them again; the next `[changes]` block lists them once approved.",sideEffects:r,warnings:s,screenshots:a,preparedState:c}:"conflict"===l?{results:o,committed:!1,message:"The changes were not committed, because the configuration changed while they were being applied. The results describe a state that was discarded. Query the current configuration and send the operations again if they still make sense.",sideEffects:r,warnings:s,screenshots:a}:{results:o,committed:!1,sideEffects:r,warnings:s,screenshots:a}}}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type AnyComponentReader, type DomainEntity, type DomainEntityId, type DomainState } from '#package/domain';
|
|
2
|
+
/** What whether an entity is offered for selection is read through: the UI components. */
|
|
3
|
+
export interface OfferedSelectionContext {
|
|
4
|
+
readonly componentReader: Pick<AnyComponentReader, 'readManyComponents'>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Whether the UI lets the user select the entity `entityId` in `state`: the entity carries a
|
|
8
|
+
* `selectable` component, which makes it selectable by clicking it in the scene, or a
|
|
9
|
+
* `sceneEntitySelectHotspot`, whose hotspot selects it.
|
|
10
|
+
*
|
|
11
|
+
* Known gaps: a component counts while it is present in the state, whether or not it is on screen;
|
|
12
|
+
* and an entity the user can select only through an `entityChildrenList` item or its "Edit" action,
|
|
13
|
+
* or through controls of a custom layout that call `useSelectEntity` or `getSelectUpdate`, is not
|
|
14
|
+
* offered.
|
|
15
|
+
*/
|
|
16
|
+
export declare const isOfferedForSelection: (entityId: DomainEntityId<string>, state: DomainState<DomainEntity<string>>, { componentReader }: OfferedSelectionContext) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{sceneEntitySelectHotspotComponent as e,selectableComponent as o}from"#package/domain";export const isOfferedForSelection=(n,t,{componentReader:p})=>p.readManyComponents({componentTypes:[o,e],entityIds:[n]},t).length>0;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type AnyComponentReader, type AnyNavigationSystem, type AssistantOfferedNavigation, type DomainEntity, type DomainState } from '#package/domain';
|
|
2
|
+
/** What the offered states are read through: the UI components, and the active navigation and selection. */
|
|
3
|
+
export interface OfferedNavigationContext {
|
|
4
|
+
readonly componentReader: Pick<AnyComponentReader, 'readFirstRootComponent' | 'readFirstComponent' | 'readManyComponents'>;
|
|
5
|
+
readonly navigationSystem: Pick<AnyNavigationSystem, 'getActiveNavigationState' | 'getActiveSelectionState'>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The states the UI offers the user in `state`, read from the controls the built-in layout shows,
|
|
9
|
+
* one by one:
|
|
10
|
+
* - the first `navigationSteps` on the root: every step before the active one and the one after it
|
|
11
|
+
* (the first step while none is active), entered by its first navigation state;
|
|
12
|
+
* - the tabs of every `sidebarTabs` of the selected entity and of the first `horizontalTabs`, each
|
|
13
|
+
* entered by its first navigation state. Both kinds are read wherever they are declared, although
|
|
14
|
+
* of the desktop headers only the fixed one shows horizontal tabs; the floating and hidden headers show the
|
|
15
|
+
* sidebar tabs alone, and the mobile tabs show the one kind declared and fail when both are;
|
|
16
|
+
* - every `sceneEntityNavigationHotspot`; a state only a hotspot that pushes offers is entered by
|
|
17
|
+
* pushing it, as that hotspot does. When two pushing hotspots offer the same state, the last one's
|
|
18
|
+
* `canStackOnto` is used;
|
|
19
|
+
* - the items of the first `viewControls` on the root;
|
|
20
|
+
* - the items of the first `toolControls` on the root, the options of every `toolMenuFab` and the
|
|
21
|
+
* exit of every `exitToolModeFab`.
|
|
22
|
+
*
|
|
23
|
+
* A step or tab without navigation states is left out, as the UI leaves it out. A component offers
|
|
24
|
+
* its states while it is present in the state, whether or not it is on screen.
|
|
25
|
+
*/
|
|
26
|
+
export declare const readOfferedNavigation: (state: DomainState<DomainEntity<string>>, { componentReader, navigationSystem }: OfferedNavigationContext) => AssistantOfferedNavigation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{exitToolModeFabComponent as t,horizontalTabsComponent as e,navigationStepsComponent as o,sceneEntityNavigationHotspotComponent as a,sidebarTabsComponent as n,toolControlsComponent as s,toolMenuFabComponent as i,viewControlsComponent as f}from"#package/domain";export const readOfferedNavigation=(d,{componentReader:r,navigationSystem:l})=>{let p=new Set,m=new Map,c=new Set,S=new Set,v=l.getActiveNavigationState(d),g=(r.readFirstRootComponent({componentTypes:[o]},d)?.state.steps??[]).filter(t=>t.navigationStates.length>0),y=g.findIndex(t=>t.navigationStates.includes(v));for(let[t,e]of g.entries())if(t<y||t===y+1)for(let t of e.navigationStates.slice(0,1))p.add(t);for(let t of r.readManyComponents({componentTypes:[n],entityIds:[l.getActiveSelectionState(d)]},d).flatMap(t=>t.state.tabs))for(let e of t.navigationStates.slice(0,1))p.add(e);let T=r.readFirstComponent({componentTypes:[e]},d);for(let t of T?.state.tabs??[])for(let e of t.navigationStates.slice(0,1))p.add(e);let u=r.readManyComponents({componentTypes:[a]},d);for(let{state:t}of u)t.pushToStack||p.add(t.navigationState);for(let{state:t}of u)t.pushToStack&&!p.has(t.navigationState)&&m.set(t.navigationState,t.canStackOnto);for(let t of m.keys())p.add(t);let C=r.readFirstRootComponent({componentTypes:[f]},d);for(let t of C?.state.items??[])if(void 0!==t.value)c.add(t.value);else for(let e of t.items)c.add(e.value);let M=r.readFirstRootComponent({componentTypes:[s]},d);for(let t of M?.state.items??[])S.add(t.value);for(let t of r.readManyComponents({componentTypes:[i]},d))for(let e of t.state.options)S.add(e.toolState);for(let e of r.readManyComponents({componentTypes:[t]},d))S.add(e.state.exitTo);return{navigationStates:p,pushedNavigationStates:m,viewStates:c,toolStates:S}};
|
package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.d.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
import type { I18n } from '@lingui/core';
|
|
1
2
|
import type { Localizable } from '@salsita-ai/common/utils';
|
|
2
|
-
import type
|
|
3
|
+
import { type $DomainEntity, type DomainEntity, type EntityId, type StateEmission, type StateValidationResult } from '#package/domain';
|
|
3
4
|
type AnyStateValidationResult = StateValidationResult<DomainEntity<string>, string>;
|
|
4
|
-
|
|
5
|
+
type AnyStateEmission = StateEmission<DomainEntity<string>, Record<string, $DomainEntity<DomainEntity<string>>>>;
|
|
6
|
+
/**
|
|
7
|
+
* One reason a change fails, as the agent reads it; a violation can sit on a virtual entity.
|
|
8
|
+
* `message` is the violation's own message as the user would be told it, or its type when it has
|
|
9
|
+
* none; `details` is its message formatted for this change, present only when it says more.
|
|
10
|
+
*/
|
|
5
11
|
export interface ViolationEntry {
|
|
6
12
|
readonly type: string;
|
|
7
13
|
readonly entityId: EntityId | null;
|
|
8
|
-
readonly message: string
|
|
14
|
+
readonly message: string;
|
|
15
|
+
readonly details?: string;
|
|
9
16
|
}
|
|
10
17
|
/** One warning or notice, which never makes a change fail. */
|
|
11
18
|
export interface AssistantWarning {
|
|
@@ -23,13 +30,23 @@ export declare class ViolationsError extends Error {
|
|
|
23
30
|
readonly entries: readonly ViolationEntry[];
|
|
24
31
|
constructor(message: string, entries: readonly ViolationEntry[]);
|
|
25
32
|
}
|
|
33
|
+
/** The change whose validity failed: its emission, and its validity narrowed to the failure. */
|
|
34
|
+
export interface ReadViolationEntriesProps {
|
|
35
|
+
readonly validity: Extract<AnyStateValidationResult, {
|
|
36
|
+
readonly valid: false;
|
|
37
|
+
}>;
|
|
38
|
+
readonly stateEmission: AnyStateEmission;
|
|
39
|
+
}
|
|
40
|
+
/** The language the reasons are written in and how their messages are resolved to it. */
|
|
41
|
+
export interface ReadViolationEntriesContext {
|
|
42
|
+
readonly i18n: I18n;
|
|
43
|
+
readonly resolveLocalizable: (message: Localizable) => string;
|
|
44
|
+
}
|
|
26
45
|
/**
|
|
27
|
-
* The
|
|
28
|
-
* validation threw.
|
|
46
|
+
* The reasons a change fails, as the controls explain a refused change: its fatal and fixable
|
|
47
|
+
* violations selected by `selectControlViolationHints`, or the one error that validation threw.
|
|
29
48
|
*/
|
|
30
|
-
export declare const readViolationEntries: (validity:
|
|
31
|
-
readonly valid: false;
|
|
32
|
-
}>, resolveLocalizable: (message: Localizable) => string) => readonly ViolationEntry[];
|
|
49
|
+
export declare const readViolationEntries: ({ validity, stateEmission }: ReadViolationEntriesProps, { i18n, resolveLocalizable }: ReadViolationEntriesContext) => readonly ViolationEntry[];
|
|
33
50
|
/**
|
|
34
51
|
* The warnings and notices of `after` that `before` did not have, in the order of `after`; every one
|
|
35
52
|
* of `after` when there is no `before`.
|
package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export class ViolationsError extends Error{entries;constructor(e,t){super(e),this.entries=t}}let
|
|
1
|
+
import{CONTROL_VIOLATION_SEVERITIES as e,selectControlViolationHints as t}from"#package/domain";export class ViolationsError extends Error{entries;constructor(e,t){super(e),this.entries=t}}let i=(e,t)=>void 0===e?null:t(e);export const readViolationEntries=({validity:n,stateEmission:r},{i18n:s,resolveLocalizable:o})=>"uncaught"===n.severity?[{type:"uncaught",entityId:null,message:n.error.message}]:t({violations:n.entityViolations.filter(({violation:t})=>e.includes(t.severity)),stateEmission:r,ignoreViolationTypes:[]},{i18n:s,resolveLocalizable:o}).map(({entityViolation:{entityId:e,violation:t},hint:n})=>{let r=i(t.message,o)??t.type;return{type:t.type,entityId:e,message:r,...void 0===n||n===r?{}:{details:n}}});let n=e=>null===e.severity||"uncaught"===e.severity?[]:e.entityViolations.filter(({violation:e})=>{let t;return"warning"===(t=e.severity)||"notice"===t}),r=({entityId:e,violation:{type:t,severity:i}})=>JSON.stringify([e,t,i]),s=(e,t,n)=>({type:t.type,severity:"notice"===t.severity?"notice":"warning",entityId:e,message:i(t.message,n)});export const readStateWarnings=(e,t,i)=>{let o=new Set(void 0===t?[]:n(t).map(r));return n(e).filter(e=>!o.has(r(e))).map(({entityId:e,violation:t})=>s(e,t,i))};export const readEntityWarnings=(e,t,i)=>n(t).filter(t=>t.entityId===e).map(({violation:t})=>s(e,t,i));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { AnimationSystem, type AnimationSystemContext } from './animation-system.js';
|
|
2
|
-
export type { AssistantAnnotation, AssistantAnnotationOverlay } from './assistant-system/assistant-annotation.js';
|
|
2
|
+
export type { AssistantAnnotation, AssistantAnnotationDrawing, AssistantAnnotationOverlay, } from './assistant-system/assistant-annotation.js';
|
|
3
3
|
export type { AssistantImageView } from './assistant-system/assistant-image-view.js';
|
|
4
|
-
export { type AssistantDraftAttachment, MAX_COMPOSER_ATTACHMENTS } from './assistant-system/composer-attachments.js';
|
|
5
|
-
export { type
|
|
4
|
+
export { type AssistantAttachment, type AssistantDraftAttachment, MAX_COMPOSER_ATTACHMENTS, } from './assistant-system/composer-attachments.js';
|
|
5
|
+
export { type AssistantAnnotationTarget, type AssistantChatSnapshot, type AssistantEarlierThreadSnapshot, type AssistantClientTool, type AssistantPanelSnapshot, AssistantSystem, type AssistantSystemContext, } from './assistant-system/assistant-system.js';
|
|
6
6
|
export type { AssistantPlayback, AssistantPlaybackStatus } from './assistant-system/assistant-speech-player.js';
|
|
7
7
|
export { isSpeakableReply } from './assistant-system/speakable-reply.js';
|
|
8
8
|
export { CameraControlSystem, CameraControlType } from './camera-control-system/camera-control-system.js';
|
|
@@ -11,10 +11,11 @@ export { createCameraControls } from './camera-control-system/create-camera-cont
|
|
|
11
11
|
export { type AnyCanvasSystem, CanvasSystem, type EntityObjectFilter, type FlushToken } from './canvas-system.js';
|
|
12
12
|
export { type AnyDragAndDropSystem, DragAndDropSystem, type DragAndDropSystemContext, type DraggableState, type DraggingState, type RotationDraggingState, } from './drag-and-drop-system/drag-and-drop-system.js';
|
|
13
13
|
export { type AnyExportSystem, ExportSystem, type ExportSystemContext } from './export-system/export-system.js';
|
|
14
|
-
export { type GraphQLExecution, type GraphQLScreenshot, type GraphQLOperation, GraphQLSystem, type GraphQLSystemContext, type PreparedOperation, SCREENSHOT_NOT_TAKEN, } from './graphql-system/graphql-system.js';
|
|
14
|
+
export { type GraphQLExecution, type GraphQLExecutionOptions, type GraphQLScreenshot, type GraphQLScreenshotStorage, type GraphQLOperation, GraphQLSystem, type GraphQLSystemContext, type PreparedOperation, SCREENSHOT_NOT_TAKEN, } from './graphql-system/graphql-system.js';
|
|
15
15
|
export type * from './image-rendering-system/image-renderer.js';
|
|
16
16
|
export { type AnyImageRenderingSystem, ImageRenderingSystem, type ImageRenderingSystemContext, } from './image-rendering-system/image-rendering-system.js';
|
|
17
17
|
export { type AnyLayoutSystem, LayoutSystem, type LayoutSystemContext } from './layout-system/layout-system.js';
|
|
18
18
|
export { toolbarHelpElementName } from './layout-system/toolbar-help-element.js';
|
|
19
19
|
export { type AnySketchingSystem, SketchingSystem } from './sketching-system/sketching-system.js';
|
|
20
20
|
export { LineEndPointUpdateTag, LineLengthUpdateTag, LineLineConnectionUpdateTag, LineRectangleBottomLeftConnectionUpdateTag, LineRectangleBottomRightConnectionUpdateTag, LineRectangleTopLeftConnectionUpdateTag, LineRectangleTopRightConnectionUpdateTag, LineSketchingPointUpdateTag, LineStartPointUpdateTag, RectangleBottomLeftCornerUpdateTag, RectangleBottomRightCornerUpdateTag, RectangleDepthUpdateTag, RectangleSketchingPointUpdateTag, RectangleTopLeftCornerUpdateTag, RectangleTopRightCornerUpdateTag, RectangleWidthUpdateTag, SetInitialSketchingPointPositionTag, SketchingFixTransformationTag, isAnySketchingPointUpdate, isLineEndPointUpdate, isLineLengthUpdate, isLineLineConnectionUpdate, isLineRectangleBottomLeftConnectionUpdate, isLineRectangleBottomRightConnectionUpdate, isLineRectangleTopLeftConnectionUpdate, isLineRectangleTopRightConnectionUpdate, isLineSketchingPointUpdate, isLineStartPointUpdate, isRectangleBottomLeftCornerUpdate, isRectangleBottomRightCornerUpdate, isRectangleDepthUpdate, isRectangleSketchingPointUpdate, isRectangleTopLeftCornerUpdate, isRectangleTopRightCornerUpdate, isRectangleWidthUpdate, isSetInitialLinePositionUpdate, isSetInitialRectanglePositionUpdate, isSketchingFixTransformationUpdate, } from './sketching-system/sketching-updates.js';
|
|
21
|
+
export * from './action-system/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AnimationSystem}from"./animation-system.js";export{MAX_COMPOSER_ATTACHMENTS}from"./assistant-system/composer-attachments.js";export{AssistantSystem}from"./assistant-system/assistant-system.js";export{isSpeakableReply}from"./assistant-system/speakable-reply.js";export{CameraControlSystem,CameraControlType}from"./camera-control-system/camera-control-system.js";export{CameraSystem}from"./camera-control-system/camera-system.js";export{createCameraControls}from"./camera-control-system/create-camera-controls.js";export{CanvasSystem}from"./canvas-system.js";export{DragAndDropSystem}from"./drag-and-drop-system/drag-and-drop-system.js";export{ExportSystem}from"./export-system/export-system.js";export{GraphQLSystem,SCREENSHOT_NOT_TAKEN}from"./graphql-system/graphql-system.js";export{ImageRenderingSystem}from"./image-rendering-system/image-rendering-system.js";export{LayoutSystem}from"./layout-system/layout-system.js";export{toolbarHelpElementName}from"./layout-system/toolbar-help-element.js";export{SketchingSystem}from"./sketching-system/sketching-system.js";export{LineEndPointUpdateTag,LineLengthUpdateTag,LineLineConnectionUpdateTag,LineRectangleBottomLeftConnectionUpdateTag,LineRectangleBottomRightConnectionUpdateTag,LineRectangleTopLeftConnectionUpdateTag,LineRectangleTopRightConnectionUpdateTag,LineSketchingPointUpdateTag,LineStartPointUpdateTag,RectangleBottomLeftCornerUpdateTag,RectangleBottomRightCornerUpdateTag,RectangleDepthUpdateTag,RectangleSketchingPointUpdateTag,RectangleTopLeftCornerUpdateTag,RectangleTopRightCornerUpdateTag,RectangleWidthUpdateTag,SetInitialSketchingPointPositionTag,SketchingFixTransformationTag,isAnySketchingPointUpdate,isLineEndPointUpdate,isLineLengthUpdate,isLineLineConnectionUpdate,isLineRectangleBottomLeftConnectionUpdate,isLineRectangleBottomRightConnectionUpdate,isLineRectangleTopLeftConnectionUpdate,isLineRectangleTopRightConnectionUpdate,isLineSketchingPointUpdate,isLineStartPointUpdate,isRectangleBottomLeftCornerUpdate,isRectangleBottomRightCornerUpdate,isRectangleDepthUpdate,isRectangleSketchingPointUpdate,isRectangleTopLeftCornerUpdate,isRectangleTopRightCornerUpdate,isRectangleWidthUpdate,isSetInitialLinePositionUpdate,isSetInitialRectanglePositionUpdate,isSketchingFixTransformationUpdate}from"./sketching-system/sketching-updates.js";
|
|
1
|
+
export{AnimationSystem}from"./animation-system.js";export{MAX_COMPOSER_ATTACHMENTS}from"./assistant-system/composer-attachments.js";export{AssistantSystem}from"./assistant-system/assistant-system.js";export{isSpeakableReply}from"./assistant-system/speakable-reply.js";export{CameraControlSystem,CameraControlType}from"./camera-control-system/camera-control-system.js";export{CameraSystem}from"./camera-control-system/camera-system.js";export{createCameraControls}from"./camera-control-system/create-camera-controls.js";export{CanvasSystem}from"./canvas-system.js";export{DragAndDropSystem}from"./drag-and-drop-system/drag-and-drop-system.js";export{ExportSystem}from"./export-system/export-system.js";export{GraphQLSystem,SCREENSHOT_NOT_TAKEN}from"./graphql-system/graphql-system.js";export{ImageRenderingSystem}from"./image-rendering-system/image-rendering-system.js";export{LayoutSystem}from"./layout-system/layout-system.js";export{toolbarHelpElementName}from"./layout-system/toolbar-help-element.js";export{SketchingSystem}from"./sketching-system/sketching-system.js";export{LineEndPointUpdateTag,LineLengthUpdateTag,LineLineConnectionUpdateTag,LineRectangleBottomLeftConnectionUpdateTag,LineRectangleBottomRightConnectionUpdateTag,LineRectangleTopLeftConnectionUpdateTag,LineRectangleTopRightConnectionUpdateTag,LineSketchingPointUpdateTag,LineStartPointUpdateTag,RectangleBottomLeftCornerUpdateTag,RectangleBottomRightCornerUpdateTag,RectangleDepthUpdateTag,RectangleSketchingPointUpdateTag,RectangleTopLeftCornerUpdateTag,RectangleTopRightCornerUpdateTag,RectangleWidthUpdateTag,SetInitialSketchingPointPositionTag,SketchingFixTransformationTag,isAnySketchingPointUpdate,isLineEndPointUpdate,isLineLengthUpdate,isLineLineConnectionUpdate,isLineRectangleBottomLeftConnectionUpdate,isLineRectangleBottomRightConnectionUpdate,isLineRectangleTopLeftConnectionUpdate,isLineRectangleTopRightConnectionUpdate,isLineSketchingPointUpdate,isLineStartPointUpdate,isRectangleBottomLeftCornerUpdate,isRectangleBottomRightCornerUpdate,isRectangleDepthUpdate,isRectangleSketchingPointUpdate,isRectangleTopLeftCornerUpdate,isRectangleTopRightCornerUpdate,isRectangleWidthUpdate,isSetInitialLinePositionUpdate,isSetInitialRectanglePositionUpdate,isSketchingFixTransformationUpdate}from"./sketching-system/sketching-updates.js";export*from"./action-system/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { $DomainEntity, DomainEntity } from '#package/domain';
|
|
1
|
+
import type { $DomainEntity, ActionTypes, DomainEntity } from '#package/domain';
|
|
2
2
|
import { type ConfiguratorExtensionSystems } from '../extensions/index.js';
|
|
3
|
-
export type UseConfiguratorExtensions<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string> = () => ConfiguratorExtensionSystems<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>;
|
|
3
|
+
export type UseConfiguratorExtensions<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string, ACTION_TYPES extends ActionTypes = ActionTypes> = () => ConfiguratorExtensionSystems<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, ACTION_TYPES>;
|
|
4
4
|
/**
|
|
5
5
|
* Reads the runtime-owned configurator systems. The graph is available before a configuration
|
|
6
6
|
* lifecycle so bootstrap flows such as preset selection can use it.
|
|
@@ -8,4 +8,4 @@ export type UseConfiguratorExtensions<ENTITIES extends DomainEntity<string>, ALL
|
|
|
8
8
|
* The application runtime provider erases its generic system extension. This hook is the generated
|
|
9
9
|
* configurator boundary that restores the application's entity-aware configurator system graph.
|
|
10
10
|
*/
|
|
11
|
-
export declare const useConfigurator: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string>() => ConfiguratorExtensionSystems<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>;
|
|
11
|
+
export declare const useConfigurator: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string, ACTION_TYPES extends ActionTypes = ActionTypes>() => ConfiguratorExtensionSystems<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, ACTION_TYPES>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type $DomainEntity, type ActionTypes, type ConfiguratorBuilder, type CreateCustomPhoenixEntityElement, type CreateCustomPhoenixLayoutElement, type CreateGetThemeHandler, type CreateGetWebComponentOptionsHandler, type CreatePhoenixHandler, type DomainEntity, type IsCreateRecipeUpdate, type IsReplaceRecipeUpdate, type TransformerBuilder, type TransformerFactory, type UpdateFactory, getIdSequence } from '#package/domain';
|
|
2
|
-
import { type CreateAddEntityFab, type CreateAppLoader, type CreateCollectFrontendDataHandler, type CreateConfigurationNotFoundPage, type CreateConfiguratorErrorPage, type CreateDeleteEntityFab, type CreateFilterPublishedChunksHandler, type CreateNavigationHotspot, type CreateNotAuthenticatedPage, type CreateOnApplicationStartProvider, type CreateOnBackendDataReadyProvider, type CreateOnConfiguratorReadyProvider, type CreateOnFrontendDataReadyProvider, type CreateOnGoToIndexHandler, type CreateOnPresetLoadedHandler, type CreateOnPublishedDataReadyProvider, type CreateOnRoutingReadyProvider, type CreateOnSessionReadyProvider, type CreatePresetUi, type CreateSelectionHotspot, type CreateToolMenuFab, type IsAngleDimensionUpdate, type IsAttributeSelectionUpdate, type IsAttributeSwitchUpdate, type IsDeleteEntityUpdate, type IsDistanceDimensionUpdate, type IsGenericDimensionUpdate, type IsSwatchSelectionUpdate, type IsTextValueUpdate, type UseAccessService, type UseActiveNavigationState, type UseActiveToolState, type UseActiveViewState, type UseActiveViewports, type UseAnalyticsService, type UseAngleDimension, type UseAttributeSelection, type UseAttributeSwitch, type UseAuthenticatedClient, type UseAuthorizedClient, type UseBackendData, type UseChildEntitySelection, type UseComponent, type UseComponents, type UseComposition, type UseConfigurationId, type UseConfigurationSaveState, type UseConfiguratorMessages, type UseConfiguratorRouting, type UseControlViolations, type UseCookRecipes, type UseCookReplaceRecipes, type UseCookedRecipes, type UseCookedReplaceRecipes, type UseCreateAuthorizedClient, type UseDeleteEntity, type UseDeletedEntity, type UseDeselect, type UseDistanceDimension, type UseDistanceDimensionSelection, type UseDomainApplicationContext, type UseDomainApplicationProps, type UseDomainContext, type UseDomainEntityState, type UseEntityPrice, type UseEntitySelector, type UseFinalizeAction, type UseFinalizeActions, type UseFinalizeViolations, type UseFirstComponent, type UseFirstRootComponent, type UseFrontendData, type UseGenericDimension, type UseGroupedRecipeOptions, type UseHoveredDomainEntityId, type UseHoveredEntity, type UseHoveredEntityId, type UseIntegrationService, type UseIntegrationState, type UseIsFullscreenActive, type UseLoadedData, type UseLoadingState, type UseLocaleSwitch, type UseMapViolationHints, type UseNavigate, type UsePopNavigate, type UsePresetEmbeddedState, type UsePresetSelection, type UsePublishedData, type UsePushNavigate, type UseRecipeEmbeddedState, type UseReplaceEntityRecipeOptions, type UseRootComponents, type UseRootEntityId, type UseRootEntityPrice, type UseRootEntitySelector, type UseRootEntityState, type UseSelectEntity, type UseSelectParent, type UseSelectedDomainEntityId, type UseSelectedEntity, type UseSelectedEntityId, type UseSession, type UseSessionRole, type UseSessionService, type UseSetFullscreen, type UseSetViewState, type UseShareLinks, type UseSlice, type UseState, type UseStateValidity, type UseStepNavigation, type UseSwatchSelection, type UseSynchronizedSelector, type UseSynchronizedSelector$, type UseTabNavigation, type UseTextValue, type UseUndoRedo, type UseUpdateControl, type UseUpdatedControl, useGenerateShareLink, useLoadingStateValue, useLocalizable, useResolveLocalizable } from '#package/react-sdk';
|
|
2
|
+
import { type CreateAddEntityFab, type CreateAppLoader, type CreateCollectFrontendDataHandler, type CreateConfigurationNotFoundPage, type CreateConfiguratorErrorPage, type CreateDeleteEntityFab, type CreateFilterPublishedChunksHandler, type CreateNavigationHotspot, type CreateNotAuthenticatedPage, type CreateOnApplicationStartProvider, type CreateOnBackendDataReadyProvider, type CreateOnConfiguratorReadyProvider, type CreateOnFrontendDataReadyProvider, type CreateOnGoToIndexHandler, type CreateOnPresetLoadedHandler, type CreateOnPublishedDataReadyProvider, type CreateOnRoutingReadyProvider, type CreateOnSessionReadyProvider, type CreatePresetUi, type CreateSelectionHotspot, type CreateToolMenuFab, type IsAngleDimensionUpdate, type IsAttributeSelectionUpdate, type IsAttributeSwitchUpdate, type IsDeleteEntityUpdate, type IsDistanceDimensionUpdate, type IsGenericDimensionUpdate, type IsSwatchSelectionUpdate, type IsTextValueUpdate, type UseAccessService, type UseActiveNavigationState, type UseActiveToolState, type UseActiveViewState, type UseActiveViewports, type UseAnalyticsService, type UseAngleDimension, type UseAttributeSelection, type UseAttributeSwitch, type UseAuthenticatedClient, type UseAuthorizedClient, type UseBackendData, type UseChildEntitySelection, type UseComponent, type UseComponents, type UseComposition, type UseConfigurationId, type UseConfigurationSaveState, type UseConfiguratorMessages, type UseConfiguratorRouting, type UseControlViolations, type UseCookRecipes, type UseCookReplaceRecipes, type UseCookedRecipes, type UseCookedReplaceRecipes, type UseCreateAuthorizedClient, type UseDeleteEntity, type UseDeletedEntity, type UseDeselect, type UseDistanceDimension, type UseDistanceDimensionSelection, type UseDomainApplicationContext, type UseDomainApplicationProps, type UseDomainContext, type UseDomainEntityState, type UseEntityPrice, type UseEntitySelector, type UseFinalizeAction, type UseFinalizeActions, type UseFinalizeViolations, type UseFirstComponent, type UseFirstRootComponent, type UseFrontendData, type UseGenericDimension, type UseGroupedRecipeOptions, type UseHoveredDomainEntityId, type UseHoveredEntity, type UseHoveredEntityId, type UseIntegrationService, type UseIntegrationState, type UseIsFullscreenActive, type UseLoadedData, type UseLoadingState, type UseLocaleSwitch, type UseMapViolationHints, type UseNavigate, type UsePopNavigate, type UsePresetEmbeddedState, type UsePresetSelection, type UsePublishedData, type UsePushNavigate, type UseRecipeEmbeddedState, type UseReplaceEntityRecipeOptions, type UseRootComponents, type UseRootEntityId, type UseRootEntityPrice, type UseRootEntitySelector, type UseRootEntityState, type UseSelectEntity, type UseSelectParent, type UseSelectedDomainEntityId, type UseSelectedEntity, type UseSelectedEntityId, type UseSession, type UseSessionRole, type UseSessionService, type UseSetFullscreen, type UseSetViewState, type UseShareLinks, type UseSlice, type UseState, type UseStateValidity, type UseStepNavigation, type UseSwatchSelection, type UseSynchronizedSelector, type UseSynchronizedSelector$, type UseTabNavigation, type UseTextValue, type UseUndoRedo, type UseUpdateControl, type UseUpdatedControl, useActiveViewChildState, useGenerateShareLink, useLoadingStateValue, useLocalizable, useResolveLocalizable } from '#package/react-sdk';
|
|
3
3
|
import { type CreatePhoenixIconSet } from '#package/ui-sdk';
|
|
4
|
-
import { type UseConfiguratorExtensions } from '../application-runtime/index.js';
|
|
4
|
+
import { type UseConfiguratorExtensions, createActionFactory } from '../application-runtime/index.js';
|
|
5
5
|
import { usePreview, usePropertyPageStack, usePropertyPageState } from '../configurator-context/index.js';
|
|
6
6
|
import { useCloseAction } from '../integration/index.js';
|
|
7
7
|
import { type CreateGetTextureProcessingMapHandler } from '../scene/index.js';
|
|
@@ -264,16 +264,16 @@ export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, AL
|
|
|
264
264
|
/**
|
|
265
265
|
* Domain context with all typesd domain systems
|
|
266
266
|
*/
|
|
267
|
-
useDomain: UseDomainContext<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES
|
|
267
|
+
useDomain: UseDomainContext<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>;
|
|
268
268
|
/**
|
|
269
269
|
* Domain application context with all typed domain application systems
|
|
270
270
|
*/
|
|
271
271
|
useDomainApplication: UseDomainApplicationContext;
|
|
272
272
|
/** Configurator runtime extensions with all typed configurator systems. */
|
|
273
|
-
useConfigurator: UseConfiguratorExtensions<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>;
|
|
274
|
-
/**
|
|
275
|
-
|
|
276
|
-
|
|
273
|
+
useConfigurator: UseConfiguratorExtensions<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, ACTION_TYPES>;
|
|
274
|
+
/** Implements configurator actions with project-typed parameters, results and systems. */
|
|
275
|
+
readonly implementActions: ReturnType<typeof createActionFactory<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ACTION_TYPES>>;
|
|
276
|
+
/** Routing service used to navigate in the configurator. */
|
|
277
277
|
useConfiguratorRouting: UseConfiguratorRouting;
|
|
278
278
|
/**
|
|
279
279
|
* Preset selection service used to select a preset
|
|
@@ -517,6 +517,8 @@ export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, AL
|
|
|
517
517
|
* Get the currently active view state
|
|
518
518
|
*/
|
|
519
519
|
useActiveViewState: UseActiveViewState<VIEW_STATES>;
|
|
520
|
+
/** Current runtime choice within the declared view. */
|
|
521
|
+
useActiveViewChildState: typeof useActiveViewChildState;
|
|
520
522
|
/**
|
|
521
523
|
* Make the given view state the active one
|
|
522
524
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createCustomPhoenixEntityElement as e,createCustomPhoenixLayoutElement as t,createGetThemeHandler as
|
|
1
|
+
import{createCustomPhoenixEntityElement as e,createCustomPhoenixLayoutElement as t,createGetThemeHandler as o,createGetWebComponentOptionsHandler as r,createPhoenixHandler as i,createTransformer as n,createTransformerBuilder as s,createUpdateFactory as m,getIdSequence as a,isCreateEntityUpdate as p,isReplaceEntityUpdate as d}from"#package/domain";import{createAddEntityFab as c,createAppLoader as u,createCollectFrontendDataHandler as f,createConfigurationNotFoundPage as l,createConfiguratorErrorPage as g,createDeleteEntityFab as j,createFilterPublishedChunksHandler as x,createNavigationHotspot as k,createNotAuthenticatedPage as y,createOnApplicationStartProvider as A,createOnBackendDataReadyProvider as I,createOnConfiguratorReadyProvider as C,createOnFrontendDataReadyProvider as S,createOnGoToIndexHandler as w,createOnPresetLoadedHandler as E,createOnPublishedDataReadyProvider as b,createOnRoutingReadyProvider as q,createOnSessionReadyProvider as B,createPresetUi as P,createSelectionHotspot as R,createToolMenuFab as U,isAngleDimensionUpdate as h,isAttributeSelectionUpdate as v,isAttributeSwitchUpdate as z,isDeleteEntityUpdate as D,isDistanceDimensionUpdate as F,isGenericDimensionUpdate as G,isSwatchSelectionUpdate as H,isTextValueUpdate as J,useAccessService as K,useActiveNavigationState as L,useActiveToolState as M,useActiveViewChildState as N,useActiveViewState as O,useActiveViewports as Q,useAnalyticsService as T,useAngleDimension as V,useAttributeSelection as W,useAttributeSwitch as X,useAuthenticatedClient as Y,useAuthorizedClient as Z,useBackendData as $,useChildEntitySelection as _,useCommittedSlice as ee,useCommittedState as et,useComponent as eo,useComponents as er,useComposition as ei,useConfigurationId as en,useConfigurationSaveState as es,useConfiguratorMessages as em,useConfiguratorRouting as ea,useControlViolations as ep,useCookRecipes as ed,useCookReplaceRecipes as ec,useCookedRecipes as eu,useCookedReplaceRecipes as ef,useCreateAuthorizedClient as el,useDeleteEntity as eg,useDeletedEntity as ej,useDeselect as ex,useDistanceDimension as ek,useDistanceDimensionSelection as ey,useDomain as eA,useDomainApplication as eI,useDomainApplicationProps as eC,useDomainEntityRenderedState as eS,useDomainEntityState as ew,useEntityPrice as eE,useEntitySelector as eb,useFinalizeAction as eq,useFinalizeActions as eB,useFinalizeViolations as eP,useFirstComponent as eR,useFirstRenderedComponent as eU,useFirstRootComponent as eh,useFirstRootRenderedComponent as ev,useFrontendData as ez,useGenerateShareLink as eD,useGenericDimension as eF,useGroupedRecipeOptions as eG,useHoveredDomainEntityId as eH,useHoveredEntity as eJ,useHoveredEntityId as eK,useIntegrationService as eL,useIntegrationState as eM,useIsFullscreenActive as eN,useLoadedData as eO,useLoadingState as eQ,useLoadingStateValue as eT,useLocaleSwitch as eV,useLocalizable as eW,useMapViolationHints as eX,useNavigate as eY,usePopNavigate as eZ,usePresetEmbeddedState as e$,usePresetSelection as e_,usePublishedData as e0,usePushNavigate as e1,useRecipeEmbeddedState as e2,useRenderedComponent as e3,useRenderedComponents as e4,useRenderedEntitySelector as e5,useRenderedRootEntitySelector as e6,useRenderedSelector as e7,useRenderedSelector$ as e8,useRenderedSlice as e9,useRenderedState as te,useReplaceEntityRecipeOptions as tt,useResolveLocalizable as to,useRootComponents as tr,useRootEntityId as ti,useRootEntityPrice as tn,useRootEntityRenderedId as ts,useRootEntityRenderedState as tm,useRootEntitySelector as ta,useRootEntityState as tp,useRootRenderedComponents as td,useSelectEntity as tc,useSelectParent as tu,useSelectedDomainEntityId as tf,useSelectedEntity as tl,useSelectedEntityId as tg,useSession as tj,useSessionRole as tx,useSessionService as tk,useSetFullscreen as ty,useSetViewState as tA,useShareLinks as tI,useStateValidity as tC,useStepNavigation as tS,useStoreSelector as tw,useStoreSelector$ as tE,useSwatchSelection as tb,useTabNavigation as tq,useTextValue as tB,useUndoRedo as tP,useUpdateControl as tR,useUpdatedControl as tU}from"#package/react-sdk";import{createPhoenixIconSet as th}from"#package/ui-sdk";import{createActionFactory as tv,useConfigurator as tz}from"../application-runtime/index.js";import{usePreview as tD,usePropertyPageStack as tF,usePropertyPageState as tG}from"../configurator-context/index.js";import{useCloseAction as tH}from"../integration/index.js";import{createGetTextureProcessingMapHandler as tJ}from"../scene/index.js";import{useUpdateEntityObjectSelection as tK}from"../scene/scene-entity/drag-and-drop/use-updated-selection.js";import{useAssistantPanel as tL,useMeasurements as tM,useToolbarActions as tN}from"../toolbar-actions/index.js";import{LayoutSlots as tO,createCanvasLoader as tQ,createLayoutAdminUi as tT,createLayoutCustomOwnerUi as tV,createLayoutCustomReadUi as tW,createLayoutDialog as tX,createLayoutFooter as tY,createLayoutToolbarDesktop as tZ,createLayoutToolbarDesktopFullScreen as t$,createLayoutToolbarReadDesktop as t_,createLayoutToolbarReadDesktopFullScreen as t0,createLayoutUserUi as t1,createToolbarHelp as t2,useAssistantComposer as t3,useAssistantThread as t4,useSceneSafeArea as t5}from"../ui/index.js";import{createPresetDeviceNotSupported as t6,createPresetPageAction as t7}from"../ui/preset-layout/PresetUi.js";import{useResetCamera as t8}from"./use-reset-camera.js";export const createConfiguratorInterface=t9=>({updates:m(),getIdSequence:a,createGetWebComponentOptionsHandler:r,createGetThemeHandler:o,createPhoenixHandler:i,createCustomPhoenixEntityElement:e,createCustomPhoenixLayoutElement:t,createPhoenixIconSet:th,createGetTextureProcessingMapHandler:tJ,createCollectFrontendDataHandler:f,createFilterPublishedChunksHandler:x,createOnGoToIndexHandler:w,createOnApplicationStartProvider:A,createOnSessionReadyProvider:B,createOnPublishedDataReadyProvider:b,createOnFrontendDataReadyProvider:S,createOnBackendDataReadyProvider:I,createOnRoutingReadyProvider:q,createOnConfiguratorReadyProvider:C,createOnPresetLoadedHandler:E,createPresetUi:P,createPresetPageAction:t7,createPresetDeviceNotSupported:t6,createLayoutFooter:tY,createAppLoader:u,createCanvasLoader:tQ,createLayoutDialog:tX,createLayoutToolbarDesktop:tZ,createLayoutToolbarDesktopFullScreen:t$,createLayoutToolbarReadDesktop:t_,createLayoutToolbarReadDesktopFullScreen:t0,createLayoutCustomOwnerUi:tV,createLayoutCustomReadUi:tW,createLayoutAdminUi:tT,createLayoutUserUi:t1,createToolbarHelp:t2,createNotAuthenticatedPage:y,createConfigurationNotFoundPage:l,createConfiguratorErrorPage:g,createAddEntityFab:c,createDeleteEntityFab:j,createSelectionHotspot:R,createNavigationHotspot:k,createToolMenuFab:U,createTransformer:n,transformerBuilder:s(),useAnalytics:T,useAuthenticatedClient:Y,useAuthorizedClient:Z,useCreateAuthorizedClient:el,useAccessService:K,useConfigurationId:en,useSession:tj,useSessionRole:tx,useSessionService:tk,useDomain:eA,useDomainApplication:eI,useConfigurator:tz,implementActions:tv(),useConfiguratorRouting:ea,usePresetSelection:e_,usePublishedData:e0,useFrontendData:ez,useBackendData:$,useDomainApplicationProps:eC,useLoadedData:eO,useIntegrationService:eL,useIntegrationState:eM,usePresetEmbeddedState:e$,useRecipeEmbeddedState:e2,useCommittedSlice:ee,useRenderedSlice:e9,useCommittedState:et,useRenderedState:te,useStoreSelector:tw,useRenderedSelector:e7,useStoreSelector$:tE,useRenderedSelector$:e8,useEntitySelector:eb,useRenderedEntitySelector:e5,useRootEntitySelector:ta,useRenderedRootEntitySelector:e6,useStateValidity:tC,useMapViolationHints:eX,useNavigate:eY,usePopNavigate:eZ,usePushNavigate:e1,useControlViolations:ep,useFinalizeViolations:eP,useConfiguratorMessages:em,useConfigurationSaveState:es,useFinalizeAction:eq,useFinalizeActions:eB,useComponent:eo,useRenderedComponent:e3,useComponents:er,useRenderedComponents:e4,useFirstComponent:eR,useFirstRenderedComponent:eU,useRootComponents:tr,useRootRenderedComponents:td,useFirstRootComponent:eh,useFirstRootRenderedComponent:ev,useEntityState:ew,useEntityRenderedState:eS,useRootEntityState:tp,useRootEntityRenderedState:tm,useRootEntityId:ti,useRootEntityRenderedId:ts,useEntityPrice:eE,useRootEntityPrice:tn,useSelectedEntity:tl,useSelectedEntityId:tg,useSelectedDomainEntityId:tf,useSelectEntity:tc,useDeselect:ex,useSelectParent:tu,useHoveredEntity:eJ,useHoveredEntityId:eK,useHoveredDomainEntityId:eH,useActiveNavigationState:L,useActiveViewState:O,useActiveViewChildState:N,useSetViewState:tA,useActiveToolState:M,useIsFullscreenActive:eN,useSetFullscreen:ty,useResetCamera:t8,useUndoRedo:tP,useTabNavigation:tq,useStepNavigation:tS,useSceneSafeArea:t5,useActiveViewports:Q,usePreview:tD,useCloseAction:tH,useIsCloningAllowed:tO.useIsCloningAllowed,useResolveLocalizable:to,useLocalizable:eW,useToolbarActions:tN,useMeasurements:tM,useLocaleSwitch:eV,useShareLinks:tI,useAssistantPanel:tL,useAssistantThread:t4,useAssistantComposer:t3,useComposition:ei,useUpdateControl:tR,useUpdatedControl:tU,useCookRecipes:ed,useCookedRecipes:eu,useCookReplaceRecipes:ec,useCookedReplaceRecipes:ef,useDeleteEntity:eg,useDeletedEntity:ej,useSwatchSelection:tb,useTextValue:tB,useAttributeSelection:W,useAttributeSwitch:X,useDistanceDimension:ek,useDistanceDimensionSelection:ey,useGenericDimension:eF,useAngleDimension:V,useChildEntitySelection:_,useGroupedRecipeOptions:eG,useReplaceEntityRecipeOptions:tt,useUpdateEntityObjectSelection:tK,useGenerateShareLink:eD,useLoadingState:eQ,useLoadingStateValue:eT,usePropertyPageStack:tF,usePropertyPageState:tG,isCreateEntityUpdate:p,isReplaceEntityUpdate:d,isDeleteEntityUpdate:D,isAngleDimensionUpdate:h,isDistanceDimensionUpdate:F,isGenericDimensionUpdate:G,isAttributeSelectionUpdate:v,isAttributeSwitchUpdate:z,isTextValueUpdate:J,isSwatchSelectionUpdate:H});
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pushes the layout's canvas padding into `CameraControlSystem`, which fits the camera against it and
|
|
3
|
+
* eases the view offset toward it, so the scene glides into a new framing (preview/layout transition,
|
|
4
|
+
* resize, sidebar toggle) instead of snapping.
|
|
5
|
+
*/
|
|
1
6
|
export declare const CameraPadding: () => null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useEffect as r}from"react";import{useResponsive as a}from"#package/ui-sdk";import{useConfigurator as t}from"../../application-runtime/index.js";export const CameraPadding=()=>{let{cameraControlSystem:i}=t(),{canvasPadding:e}=a();return r(()=>{i.setCanvasPadding(e)},[i,e]),null};
|
|
@@ -35,12 +35,12 @@ export interface ThemeableAssistantToolChipsProps {
|
|
|
35
35
|
* The components used for each slot inside a row of tool calls.
|
|
36
36
|
*
|
|
37
37
|
* - `root` — The row (`div`).
|
|
38
|
-
* - `activity` — The frame of the turning icon (`span`).
|
|
38
|
+
* - `activity` — The frame of the turning icon, or of Undo in its place (`span`).
|
|
39
39
|
* - `activityIcon` — The icon that turns while the assistant works on the row (`PhxIcon`).
|
|
40
40
|
* - `chip` — The note of one call, or of its screenshots (`span`).
|
|
41
41
|
* - `chipLabel` — The text of a call's note (`span`).
|
|
42
42
|
* - `screenshotsLink` — The label that opens a call's screenshots (`span`).
|
|
43
|
-
* - `undoButton` — The Undo control
|
|
43
|
+
* - `undoButton` — The Undo control in place of the resting icon, with its tooltip (`ButtonBase`).
|
|
44
44
|
* - `violation` — A line of a failed call's tooltip, one per violation (`span`).
|
|
45
45
|
* - `fullLabel` — The full text of a cut note, at the top of its tooltip (`span`).
|
|
46
46
|
*/
|
|
@@ -82,9 +82,9 @@ export interface AssistantToolChipsProps {
|
|
|
82
82
|
/**
|
|
83
83
|
* A row of notes on what the assistant did in a reply, one per tool call, and one for the
|
|
84
84
|
* screenshots of a call that took any. A click on a call's note logs the input and the result of
|
|
85
|
-
* its call to the console. While one of the row's changes is the step
|
|
86
|
-
*
|
|
87
|
-
*
|
|
85
|
+
* its call to the console. While one of the row's changes is the step of the undo history the
|
|
86
|
+
* configuration is at, an Undo in place of the row's icon takes the row's changes back, up to a
|
|
87
|
+
* change the user made in between.
|
|
88
88
|
*/
|
|
89
89
|
export declare const AssistantToolChips: import("react").MemoExoticComponent<(inProps: AssistantToolChipsProps & ThemeableAssistantToolChipsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
90
90
|
export interface AssistantActivityRowProps {
|