@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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{createPhoenixFeatureGuide as e}from"../../guide.js";let s=`A visitor who opens a shared configuration may ask about it but not change it:
|
|
2
|
+
|
|
3
|
+
\`\`\`ts
|
|
4
|
+
// src/handlers/assistant-setup.ts
|
|
5
|
+
export default phx.domain.createAssistantSetupHandler((manifest, { access }) =>
|
|
6
|
+
access === 'o'
|
|
7
|
+
? manifest
|
|
8
|
+
: {
|
|
9
|
+
...manifest,
|
|
10
|
+
writable: {},
|
|
11
|
+
deletable: {},
|
|
12
|
+
instructions: 'The visitor is viewing a shared configuration. Describe it and answer questions; never offer to change it.',
|
|
13
|
+
}
|
|
14
|
+
)
|
|
15
|
+
\`\`\``;export const generatePhoenixAssistantSessionSetupFeature=()=>e({path:"features/assistant/session-setup.md",title:"Session setup",summary:"Narrowing what the assistant may see and change per session, or switching it off; read when it must behave differently by role, session data or access.",whenToUse:"Read when the assistant must offer less to some sessions, such as viewers of a shared configuration or anonymous visitors, or none at all.",capabilities:"- Default-export `phx.domain.createAssistantSetupHandler((manifest, { role, sessionData, access }) => manifest)` from one file in `src/handlers/`. It joins the webhook automatically, so it imports only server-safe modules ([Webhook entry and environment](../webhooks/entry-and-environment.md)). `role` and `sessionData` come from [authentication](../webhooks/authentication.md); `access` is how the configuration was opened, such as `o` for its owner.\n- It runs for every session, with the manifest the `assistant` section declares. Return it narrowed, never widened: leave out entries to hide them, replace `instructions`, change `ai`, or set `webmcp: false`. Return `null` to switch the assistant off. Its buttons and panel follow the spec, not the handler, so hide them per session in the layout, for example with `$filter`.\n- Keep it synchronous, pure and deterministic: it runs in the browser and in the webhook, and both must reach the same manifest. The browser's manifest has no `ai`, so decide nothing else from it. A handler that throws leaves the assistant unavailable for the session. Deployed environments reuse a session's setup for up to 15 minutes; under `phoenix dev` it runs on every request.",example:s,documentation:'The shipped SDK docs mention the handler only where it changes voice and WebMCP. Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/configurator-interface.mdx` — "Assistant" for `ai.voice` per session, and "Assistant tools for agents in the browser (WebMCP)" for turning WebMCP off per session.',phxMembers:["domain.createAssistantSetupHandler"]});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{createPhoenixIndexGuide as e}from"../../guide.js";import{generatePhoenixFinalizationActionsFeature as o}from"./finalization-actions.js";import{generatePhoenixMessagesFeature as t}from"./messages.js";import{generatePhoenixProjectPagesFeature as s}from"./pages.js";import{generatePhoenixSceneAndSafeAreaFeature as a}from"./scene-and-safe-area.js";import{generatePhoenixLayoutSlotsFeature as
|
|
1
|
+
import{createPhoenixIndexGuide as e}from"../../guide.js";import{generatePhoenixFinalizationActionsFeature as o}from"./finalization-actions.js";import{generatePhoenixMessagesFeature as t}from"./messages.js";import{generatePhoenixProjectPagesFeature as s}from"./pages.js";import{generatePhoenixSceneAndSafeAreaFeature as a}from"./scene-and-safe-area.js";import{generatePhoenixLayoutSlotsFeature as n}from"./slots.js";import{generatePhoenixTabsAndStepsFeature as r}from"./tabs-and-steps.js";import{generatePhoenixToolbarActionsFeature as i}from"./toolbar-actions.js";import{generatePhoenixViewModeFeature as d}from"./view-mode.js";let l=`A layout element registered as \`ConfiguratorLayout\` replaces everything Phoenix renders for a loaded configuration, in owner and in read mode, finalization included. It shows only what it composes.
|
|
2
2
|
|
|
3
3
|
- YAML keeps the domain and the structure the layout reads: control components, in-scene anchors, tabs, steps, toolbar entries and finalize actions. The layout reads them through \`phx.frontend\` hooks, or mounts a built-in slot that reads them.
|
|
4
4
|
- The spec does not describe the page: the layout draws its own panels and renders the project's control elements in them.
|
|
5
|
-
- Start every layout from the skeleton in [Scene and safe area](scene-and-safe-area.md),
|
|
5
|
+
- Start every layout from the skeleton in [Scene and safe area](scene-and-safe-area.md). Before adding a feature, read its guide below and use its spec and hook contracts. In particular, custom tabs and steps use [Tabs and steps](tabs-and-steps.md), not a parallel React navigation state.
|
|
6
6
|
- Each feature is either a built-in slot ([Layout slots](slots.md)) or the layout's own UI over hooks, which the other guides cover. No hook enforces read mode, so [View mode](view-mode.md) applies to all of them.
|
|
7
|
-
- The controls inside the layout's panels and on the product, their YAML components and React elements, belong to [Domain controls](../domain-controls/index.md).`;export const generatePhoenixCustomLayoutGuides=()=>{let m=[a(),
|
|
7
|
+
- The controls inside the layout's panels and on the product, their YAML components and React elements, belong to [Domain controls](../domain-controls/index.md); use [Scene controls](../domain-controls/scene-controls.md) for actions placed at positions on the product.`;export const generatePhoenixCustomLayoutGuides=()=>{let m=[a(),n(),r(),i(),t(),o(),d(),s()];return[e({path:"features/custom-layout/index.md",title:"Custom project layout",summary:"The project's page-level UI: the `ConfiguratorLayout` element with its canvas, built-in slots, tabs and steps, toolbar, messages, finalization and read mode, the preset screen, loader and error pages; read when creating or changing a project layout or one of these pages.",intro:l,guides:m,notes:[]}),...m]};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type PhoenixGuide } from '../../guide.js';
|
|
2
|
-
/** The project's pages outside the loaded configuration: preset screen, loader
|
|
2
|
+
/** The project's pages outside the loaded configuration: preset screen, loader and failure pages. */
|
|
3
3
|
export declare const generatePhoenixProjectPagesFeature: () => PhoenixGuide;
|
|
@@ -46,4 +46,4 @@ const PresetScreen = () => {
|
|
|
46
46
|
export default phx.frontend.createPresetUi(PresetScreen)
|
|
47
47
|
\`\`\`
|
|
48
48
|
|
|
49
|
-
The app loader is as short: \`export default phx.frontend.createAppLoader(({ phases }) => <span role="status">{phases[0]?.label ?? 'Loading…'}</span>)\`.`;export const generatePhoenixProjectPagesFeature=()=>e({path:"features/custom-layout/pages.md",title:"Project pages",summary:"Replacing the preset screen and its action and overlay, the app loader, the not-authenticated, not-found and error pages
|
|
49
|
+
The app loader is as short: \`export default phx.frontend.createAppLoader(({ phases }) => <span role="status">{phases[0]?.label ?? 'Loading…'}</span>)\`.`;export const generatePhoenixProjectPagesFeature=()=>e({path:"features/custom-layout/pages.md",title:"Project pages",summary:"Replacing the preset screen and its action and overlay, the app loader, and the not-authenticated, not-found and error pages; read when branding the first moments or the failure pages.",whenToUse:"Read when a page outside the loaded configuration should carry the brand, such as the preset screen, the loader or a failure page.",capabilities:"Each page below is an element: default-export its registration from a file in `src/elements/`.\n\n### Preset screen\n\n- The preset screen shows at the start when there is more than one preset; with a single preset the configuration starts at once.\n- `phx.frontend.createPresetUi(Component)` replaces the whole screen. The built-in screen's categories, close button, action, overlay and empty state go with it.\n- Inside it, `phx.frontend.usePresetSelection()` returns `{ presetCategories, hasMultiplePresets, selectPreset, createFromPreset, creatingPresetId, selectionError }`.\n- A category is `{ id, name, description?, img?, imgAlt?, presets }`; a preset is `{ id, name, description?, img?, imgAlt?, detailTitle?, detailDescription? }`. Texts are `Localizable`: resolve them with `phx.frontend.useResolveLocalizable()`.\n- `img` is a resource path: turn it into a URL with `useResourceUrl().getResourceUrl(img)` from `@salsita-ai/sdk/react`, as the built-in screen does.\n- `selectPreset(id)` creates the configuration and opens it. While `creatingPresetId` is set, mark that card busy and disable the others.\n- `selectionError` is the last failed creation: show it. In production with several presets the failure is also a snackbar, so mount `PresetSnackbarsRoot` from `@salsita-ai/sdk/configurator`, or it renders outside the configurator.\n- Keep the preview branch. While `phx.frontend.usePreview().isPreview` is `true`, return `PresetPreviewLayout` from `@salsita-ai/sdk/configurator` with `title` and `startButtonLabel`. Without it, a phone embed with `preview: auto` never expands and shows the whole screen in the collapsed preview.\n- With no categories, for example when the host's `presetTags` match none, the built-in screen shows the not-found page; a replacement decides itself.\n- What a preset is and how to declare one belongs to [Presets](../application-states/presets.md).\n\n### Preset action and overlay\n\nThese fill the built-in preset screen only; a `createPresetUi` screen renders its own instead.\n\n- `phx.frontend.createPresetPageAction(Component)` adds content below the cards, such as a link to request an unlisted product.\n- `phx.frontend.createPresetDeviceNotSupported(Component)` adds an overlay, such as a notice that the configurator works best on a larger screen.\n- The overlay renders as the last child of the screen, not over the cards, and at every width: make it a dialog or position it, and gate it on the condition it is for.\n\n### App loader\n\n- `phx.frontend.createAppLoader(({ phases }) => …)` replaces what the loading overlay shows. Phoenix keeps the overlay, its place over the safe area and its fade.\n- `phases` are the running loading phases, each `{ id, label?, progress? }` with `progress` from 0 to 1. The list can be empty while the loader waits for the scene.\n- The loader covers the session, the data, the configuration and the scene; it waits for the scene only when the layout mounts `LayoutSlots.SharedCanvas` ([Scene and safe area](scene-and-safe-area.md)).\n- `phx.frontend.useLoadingStateValue()` returns `{ isLoading, hasError, phases, expectedPhaseIds }` for loader content that needs more than `phases`.\n- `phx.frontend.useLoadingState()` returns `{ startPhase, endPhase }`, or `null` outside the loader's host. `startPhase({ id, label, progress })` holds the overlay for the project's own loading step; calling it again with the same `id` updates it.\n- End every started phase with `endPhase(id)`, on failure and on unmount too, or the overlay never leaves.\n- A top-level `appLoader: legacy` in the spec turns the overlay off.\n\n### Failure pages\n\n- `phx.frontend.createNotAuthenticatedPage(Component)` — shown when session authentication fails, and to an anonymous visitor of the start page when `acl.canCreate` excludes `anonymous`. It gets no props. Its default renders the not-found page, so a project not-found page shows there too.\n- `phx.frontend.createConfigurationNotFoundPage(({ onBack }) => …)` — shown when a configuration fails to load, is opened without a valid access key, or a signed-in role may not create one. Offer a way back only when the optional `onBack` is set.\n- `phx.frontend.createConfiguratorErrorPage(({ reason, onRetry }) => …)` — the production error page. `reason` is `'uncaughtError'` or `'presetCreationFailed'` (the single preset failed to start); `onRetry` renders again or reloads.\n- Development shows detailed error pages instead, or in agent mode the \"Agent at work\" screen, so check the error page in a production build. A page that throws falls back to the built-in one.\n- Use these helpers rather than `createCustomPhoenixLayoutElement` with the element's name: only the helpers type the props.\n",example:t,documentation:'Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/layouts/presets/custom.mdx` — the complete branded preset screen with search and the preview branch.\n- `docs/layouts/presets/action-and-overlay.mdx` — the action and the overlay of the built-in screen.\n- `docs/phoenix/configurator-interface.mdx` — "Preset UI", "Configuration Not Found Page", "Configurator Error Page" and "App Loader".\n- `docs/other-features/not-found-404.mdx`, `docs/other-features/error-5xx.mdx` — worked failure pages.\n- `docs/ux-guidelines/presets.mdx` — what a good preset screen offers.',phxMembers:["frontend.createPresetUi","frontend.usePresetSelection","frontend.createPresetPageAction","frontend.createPresetDeviceNotSupported","frontend.createAppLoader","frontend.useLoadingState","frontend.useLoadingStateValue","frontend.createNotAuthenticatedPage","frontend.createConfigurationNotFoundPage","frontend.createConfiguratorErrorPage"]});
|
|
@@ -71,4 +71,4 @@ const DeskPanel = () => {
|
|
|
71
71
|
|
|
72
72
|
return deskId !== null && !accessInfo.viewMode ? <DeskControls deskId={deskId} /> : null
|
|
73
73
|
}
|
|
74
|
-
\`\`\``;export const generatePhoenixCustomControlsFeature=()=>e({path:"features/domain-controls/custom-controls.md",title:"Custom controls",summary:"The project's own React element per control: where the file lives, registering spec-named elements, mounting it for the selected entity, read mode and the write path; read when rendering a control component.",whenToUse:"Read when a control component needs its UI: a panel in the project layout, a control next to a part on the product, or a change no single control component makes. [Control hooks](control-hooks.md) lists the hooks by job; [Updates and dry runs](../state/updates.md) covers writing the store directly.",capabilities:"### One element per control\n\n- Render each control component with the project's own React element, built from its control hook ([Control hooks](control-hooks.md)): `phx.frontend.useAttributeSelection(entityId, 'frameColor')` for an `attributeSelection` instance named `frameColor`, and so on.\n- Take a typed entity id as a prop, such as `Desk['id']`. Entity types are global in a project, like `phx`.\n- Group the elements of one entity type in a panel component when the layout shows them together.\n\n### Where the file lives\n\n- **Rendered by the layout** — a plain component in an underscore folder, such as `src/_shared/DeskControls.tsx`, with a named export. The layout imports it with a relative `.js` path. It needs no registration: the control hooks work anywhere inside the `ConfiguratorLayout`.\n- **Named by the spec** — an element that an `htmlHotspot`, `sceneEntityObjectHtmlHotspot` or `sceneEntityControl` names ([Scene controls](scene-controls.md)). Default-export `phx.frontend.createCustomPhoenixEntityElement('Name', ({ entityId }) => …)` from `src/elements/`; a file may export an array of registrations instead. It must return an element, `<></>` for nothing.\n- Every file in `src/elements/` outside an underscore folder must default-export a registration, so keep plain components out of it. An unregistered name in the spec renders a red \"not found\" box.\n- A spec-named element receives only `entityId`, untyped: find the entity in `phx.frontend.useCommittedState().entities` and narrow it by `type` before reading fields or calling the typed hooks. An element registered under a built-in kind name, such as the FAB factories of [Scene controls](scene-controls.md), also receives that kind's YAML props.\n\n### Mount it from the layout\n\n- Read the selected entity with `phx.frontend.useSelectedEntityId(phx.domain.enhancedModel.$Desk)`: the id while a desk is selected, else `null`. With nothing selected the root counts as selected.\n- `phx.frontend.useRootEntityId()` gives the root's id for controls that always show.\n- Render the panel only for an id of the right type, and only while `phx.frontend.useAccessService().accessInfo.viewMode` is `false`: no hook enforces read mode.\n- Mirror any `$filter` of the control component in the same condition, since the hook throws while its instance is filtered out ([Control components](control-components.md)).\n- [Scene and safe area](../custom-layout/scene-and-safe-area.md) has the layout skeleton with such a panel.\n\n### Write anything else\n\nWhen no control hook fits, such as a change to several fields or entities, build the updates with `phx.frontend.updates` ([Updates and dry runs](../state/updates.md)) and let a hook dry-run them:\n\n- `phx.frontend.useUpdatedControl(updates)` returns `{ disabled, hints, update }` for one update list. Memoize the list: every new array is a new dry run.\n- `phx.frontend.useUpdateControl()` returns `prepare(updates)`, which returns the same for each candidate, such as one per button.\n- `update()` stages and commits in one step, one undo entry; `disabled` and `hints` follow [Violations](../state/violations.md). Both hooks take `fixableViolations`, which only hides those types from `hints`.\n- Run a domain action the same way: `prepare(phx.frontend.
|
|
74
|
+
\`\`\``;export const generatePhoenixCustomControlsFeature=()=>e({path:"features/domain-controls/custom-controls.md",title:"Custom controls",summary:"The project's own React element per control: where the file lives, registering spec-named elements, mounting it for the selected entity, read mode and the write path; read when rendering a control component.",whenToUse:"Read when a control component needs its UI: a panel in the project layout, a control next to a part on the product, or a change no single control component makes. [Control hooks](control-hooks.md) lists the hooks by job; [Updates and dry runs](../state/updates.md) covers writing the store directly.",capabilities:"### One element per control\n\n- Render each control component with the project's own React element, built from its control hook ([Control hooks](control-hooks.md)): `phx.frontend.useAttributeSelection(entityId, 'frameColor')` for an `attributeSelection` instance named `frameColor`, and so on.\n- Take a typed entity id as a prop, such as `Desk['id']`. Entity types are global in a project, like `phx`.\n- Group the elements of one entity type in a panel component when the layout shows them together.\n\n### Where the file lives\n\n- **Rendered by the layout** — a plain component in an underscore folder, such as `src/_shared/DeskControls.tsx`, with a named export. The layout imports it with a relative `.js` path. It needs no registration: the control hooks work anywhere inside the `ConfiguratorLayout`.\n- **Named by the spec** — an element that an `htmlHotspot`, `sceneEntityObjectHtmlHotspot` or `sceneEntityControl` names ([Scene controls](scene-controls.md)). Default-export `phx.frontend.createCustomPhoenixEntityElement('Name', ({ entityId }) => …)` from `src/elements/`; a file may export an array of registrations instead. It must return an element, `<></>` for nothing.\n- Every file in `src/elements/` outside an underscore folder must default-export a registration, so keep plain components out of it. An unregistered name in the spec renders a red \"not found\" box.\n- A spec-named element receives only `entityId`, untyped: find the entity in `phx.frontend.useCommittedState().entities` and narrow it by `type` before reading fields or calling the typed hooks. An element registered under a built-in kind name, such as the FAB factories of [Scene controls](scene-controls.md), also receives that kind's YAML props.\n\n### Mount it from the layout\n\n- Read the selected entity with `phx.frontend.useSelectedEntityId(phx.domain.enhancedModel.$Desk)`: the id while a desk is selected, else `null`. With nothing selected the root counts as selected.\n- `phx.frontend.useRootEntityId()` gives the root's id for controls that always show.\n- Render the panel only for an id of the right type, and only while `phx.frontend.useAccessService().accessInfo.viewMode` is `false`: no hook enforces read mode.\n- Mirror any `$filter` of the control component in the same condition, since the hook throws while its instance is filtered out ([Control components](control-components.md)).\n- [Scene and safe area](../custom-layout/scene-and-safe-area.md) has the layout skeleton with such a panel.\n\n### Write anything else\n\nWhen no control hook fits, such as a change to several fields or entities, build the updates with `phx.frontend.updates` ([Updates and dry runs](../state/updates.md)) and let a hook dry-run them:\n\n- `phx.frontend.useUpdatedControl(updates)` returns `{ disabled, hints, update }` for one update list. Memoize the list: every new array is a new dry run.\n- `phx.frontend.useUpdateControl()` returns `prepare(updates)`, which returns the same for each candidate, such as one per button.\n- `update()` stages and commits in one step, one undo entry; `disabled` and `hints` follow [Violations](../state/violations.md). Both hooks take `fixableViolations`, which only hides those types from `hints`.\n- Run a domain action the same way: `prepare(phx.frontend.useConfigurator().actionSystem.prepareAction(name, args, state).updates)`, with `state` from `phx.frontend.useCommittedState()`. `prepareAction` throws on arguments it rejects, so catch it and show its message; [Actions](../domain-model/actions.md) owns them.\n\n```tsx\nconst control = prepare([\n phx.frontend.updates.DomainEntityModification({\n entityId: deskId,\n stateDelta: { width: 1800, depth: 800 },\n updateTag: 'desk.sizePreset',\n }),\n])\n// <Button disabled={control.disabled} title={control.hints} onClick={control.update}>Large</Button>\n```\n\n### Look native\n\nThe project's element is the default. Inside it, the SDK's control components from `@salsita-ai/sdk/react`, such as `AttributeCardSelector` with `entityId` and `instanceName`, can render one control in the SDK's look, and `PropertyContainer` from `@salsita-ai/sdk/ui` gives section spacing and headings. None of these is on `phx`.",example:t,documentation:'Read each with `pnpm phoenix docs -r <path>`:\n\n- `docs/layouts/custom-layout.mdx` — "Read and change the product" (a control in the layout\'s panel, from `src/_shared/`) and "Put a control on the product" (a hotspot element).\n- `docs/controls/custom.mdx` — `useUpdatedControl` and `useCookedRecipes` in elements; skip its property-page attachment.\n- `docs/other-features/domain-actions.mdx` — "Run it from the UI": an action behind `useUpdateControl`.\n- "Updates Factory" in `docs/phoenix/configurator-interface.mdx` — `useUpdatedControl` and `useUpdateControl` with a worked element.',phxMembers:["frontend.createCustomPhoenixEntityElement","frontend.useUpdateControl","frontend.useUpdatedControl"]});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import{createPhoenixFeatureGuide as e}from"../../guide.js";let t=`
|
|
1
|
+
import{createPhoenixFeatureGuide as e}from"../../guide.js";let t=`For a modular run, put an add FAB at the exposed end for new columns and another above a column for stacking. Each belongs to the entity whose child recipes create the part. Position it from the current dimensions, and offer compatible sizes through its recipe menu. After adding, make the new part the editing target through [Selection and hover](../application-states/selection.md); keep its properties contextual and shared finishes separate. Check a blocked addition and phone target visibility as well as the successful path. [Control components](control-components.md) owns recipe wiring.
|
|
2
|
+
|
|
3
|
+
The smaller shelf example below shows placement and branded deletion. The delete FAB keeps its dry run: it is disabled with the reason while removing the shelf would break an invariant.
|
|
2
4
|
|
|
3
5
|
\`\`\`yaml
|
|
4
6
|
# spec/scene-controls.yaml
|
|
@@ -45,4 +47,4 @@ export default phx.frontend.createDeleteEntityFab(({ onDelete, disabled, disable
|
|
|
45
47
|
})
|
|
46
48
|
\`\`\`
|
|
47
49
|
|
|
48
|
-
\`onDelete\` already stops the click's propagation and records the built-in analytics event.`;export const generatePhoenixSceneControlsFeature=()=>e({path:"features/domain-controls/scene-controls.md",title:"Scene controls",summary:"Hotspots, FABs, editable dimension indicators and 3D entity controls, their placement, and replacing the built-in look; read when putting a control on the product.",whenToUse:"Read when configurator users should act on the product itself: select a part or go to a step from a hotspot, add or delete from a FAB, edit a dimension in the scene, switch tools, or open a project control next to a part. These controls write the same control components as the project's elements ([Control components](control-components.md)).",capabilities:"### Choose the control\n\n- **Select a part** — `sceneEntitySelectHotspot`. Selection itself belongs to [Selection and hover](../application-states/selection.md).\n- **Go to a navigation state** — `sceneEntityNavigationHotspot` with `navigationState` (required), `pushToStack` and `canStackOnto`; [Navigation states](../application-states/navigation.md) owns the stack.\n- **Add children** — `sceneEntityAddFab` offers the entity's `childEntityRecipes`: `instanceNames` narrows them, `skipMenuWhenOnlyOne` adds a single recipe directly, `hideWhenNone` hides an empty FAB, `label` and `icon` style it, and `hiddenViolations` drops those types from its hints.\n- **Delete the entity** — `sceneEntityDeleteFab` with `icon`, `title` and `label`, and `hiddenViolations` to drop those types from its hints.\n- **Switch tools** — `toolMenuFab` with `title` and `options` of `{ label, icon?, toolState }`; [View and tool states](../application-states/views-and-tools.md) owns tools.\n- **Edit a dimension on the product** — the editable indicators open an input for the component they target. `editableDistanceDimensionIndicator` (`targetDimension`, a `distanceDimension` instance), `listSelectorDimensionIndicator` (`targetDistanceDimensionSelect`) and `editableSizeIndicator` (`targetSize`) draw a dimension line from `startX/Y/Z` to `endX/Y/Z`. `editableAngleIndicator` targets an `angleDimension` and is placed by `positionX/Y/Z`, `startAngle` and `sweepAngle`.\n- `editableOffsetIndicator` has no start and end: it requires `targetOffset`, `targetEntityOffsetAnchors`, `targetReferenceOffsetAnchors` and `directionVector`. `dimensionIndicator`, `angleIndicator` and `offsetIndicator` only show the value.\n- **A project control on the product** — `htmlHotspot` with `name`, a project element ([Custom controls](custom-controls.md)), or `sceneEntityObjectHtmlHotspot` with `target`, a `sceneEntityRemoteObject` instance whose animation it follows, offsets in that object's local space and units.\n- **3D content on an entity** — `sceneEntityControl` with `name`: the element renders inside the WebGL scene, so it returns React Three Fiber objects, such as drei's `Billboard` and `Text`, not DOM. It stays out of camera fitting unless `includeInCameraFit: true`.\n\nPrefer the built-in control for its job and restyle it (below); an `htmlHotspot` is for a control the SDK has none of.\n\n### Place and show\n\n- `offsetX`, `offsetY` and `offsetZ` are measured from the entity's origin in the distance data unit; `screenOffsetHorizontal` and `screenOffsetVertical` shift the control in pixels. `$read` or `$eval` an offset that follows a size.\n- `showWhen` takes `selected` and `unselected`. Defaults: `[selected]` for the add and delete FABs, `[unselected]` for the selection and navigation hotspots and the tool menu; an `htmlHotspot` shows in both.\n- `hideWhileDragging` hides the control while an entity is dragged. `azimuthAngleLimits` and `polarAngleLimits` (radians) and `distanceLimits` fade it outside `{ min, max, smoothZone?, minOpacity? }`.\n- Give an icon-only FAB or hotspot a `title`; `tooltipVisibility` is `on-hover` (default), `forced`, `forced-when-still` or `hidden`.\n- `$filter` decides when the control exists: `modes: [owner]` keeps editing controls from viewers, `navigationStates` ties them to a step. [Components](../domain-model/components.md) owns filters.\n- `controlHotspot: true` on an `htmlHotspot` hides it while a change is previewed, so its dry runs never read a stale state; the add and delete FABs always behave so. It also unmounts an open popover on every change: leave it off for a hotspot whose menu stays open while users compare options. `inert: true` makes an `htmlHotspot` ignore the pointer.\n\n### Elements in the scene\n\n- In-scene elements get the theme and every `phx.frontend` hook; MUI popovers and tooltips work inside them.\n- Stop a click inside a project control from reaching the scene with `event.stopPropagation()`, or it also changes the selection. The `onDelete`, `onSelect` and `onNavigate` props below already do; a recipe's `handleClick` does not.\n- The scene's HTML sits under the layout's panels, so a covered control cannot be clicked.\n\n### Replace a built-in control's look\n\nEach helper registers the element the scene renders for one component, everywhere the spec places it, in the built-in layout and in a project layout. The spec keeps the position, visibility, filters and tooltip settings. Pass a component `(props) => JSX.Element | null` (`null` shows nothing) and default-export the registration, or an array of registrations, from a file in `src/elements/`:\n\n- `phx.frontend.createAddEntityFab(Component)` — replaces `AddEntityFab`, for `sceneEntityAddFab`. Props: `entityId`, `instanceNames`, `fixableViolations` (the spec's `hiddenViolations`), `icon`, `label`, `title`, `tooltipVisibility`, `skipMenuWhenOnlyOne`, `hideWhenNone`. It gets no recipes: read them with `phx.frontend.useGroupedRecipeOptions(entityId, instanceNames, fixableViolations)` in the menu, mounted only while open, since every recipe is a dry run.\n- `phx.frontend.createDeleteEntityFab(Component)` — replaces `DeleteEntityFab`. Props: `entityId`, `onDelete`, `disabled`, `disabledHint`, `trace` (logs the dry run), `icon`, `label`, `title`, `tooltipVisibility`.\n- `phx.frontend.createSelectionHotspot(Component)` — replaces `SelectionHotspot`. Props: `entityId`, `onSelect`, `title`, `tooltipVisibility`.\n- `phx.frontend.createNavigationHotspot(Component)` — replaces `NavigationHotspot`. Props: `entityId`, `navigationState`, `onNavigate`, `title`, `tooltipVisibility`.\n- `phx.frontend.createToolMenuFab(Component)` — replaces `ToolMenuFab`. Props: `entityId`, `options`, `onSelectTool(toolState)`, `icon`, `title`, `tooltipVisibility`.\n\n`title` and `label` are localizable: resolve them with `phx.frontend.useResolveLocalizable()`. Registering these names with `createCustomPhoenixEntityElement` works too, but types only `entityId`. The dimension indicators have no replacement; build a different editor as an `htmlHotspot`.",example:t,documentation:'Read each with `pnpm phoenix docs -r <path>`:\n\n- "In-Scene Controls" in `docs/phoenix/configurator-interface.mdx` — the replaceable elements, their props and a complete replacement.\n- `docs/fabs/basic.mdx`, `docs/fabs/layout.mdx` — FAB settings, visibility and tooltips, and grouping controls with screen offsets.\n- `docs/controls/scene/html-hotspots.mdx`, `docs/controls/scene/object-html-hotspots.mdx`, `docs/controls/scene/custom-controls.mdx` (`sceneEntityControl`).\n- "Put a control on the product" in `docs/layouts/custom-layout.mdx` — a project hotspot with a popover.\n- `docs/dimensions/3d-scene-integration/editable-distance-dimension-indicator.mdx` and its siblings in that folder, one per indicator (`pnpm phoenix docs -l` lists them).',phxMembers:["frontend.createAddEntityFab","frontend.createDeleteEntityFab","frontend.createSelectionHotspot","frontend.createNavigationHotspot","frontend.createToolMenuFab"]});
|
|
50
|
+
\`onDelete\` already stops the click's propagation and records the built-in analytics event.`;export const generatePhoenixSceneControlsFeature=()=>e({path:"features/domain-controls/scene-controls.md",title:"Scene controls",summary:"Hotspots, FABs, editable dimension indicators and 3D entity controls, their placement, and replacing the built-in look; read when putting a control on the product.",whenToUse:"Read when configurator users should act on the product itself: select a part or go to a step from a hotspot, add or delete from a FAB, edit a dimension in the scene, switch tools, or open a project control next to a part. These controls write the same control components as the project's elements ([Control components](control-components.md)).",capabilities:"For adding, placing or resizing parts at a visible location, start with the corresponding scene control. A menu of options can open from that location; multiple sizes do not require a permanent panel. Use a panel when it makes the target or choices clearer for the task, such as obscured attachment points. Try the spatial action before expanding the property editor.\n\n### Choose the control\n\n- **Select a part** — `sceneEntitySelectHotspot`. Selection itself belongs to [Selection and hover](../application-states/selection.md).\n- **Go to a navigation state** — `sceneEntityNavigationHotspot` with `navigationState` (required), `pushToStack` and `canStackOnto`; [Navigation states](../application-states/navigation.md) owns the stack.\n- **Add children** — `sceneEntityAddFab` offers the entity's `childEntityRecipes`: `instanceNames` narrows them, `skipMenuWhenOnlyOne` adds a single recipe directly, `hideWhenNone` hides an empty FAB, `label` and `icon` style it, and `hiddenViolations` drops those types from its hints.\n- **Delete the entity** — `sceneEntityDeleteFab` with `icon`, `title` and `label`, and `hiddenViolations` to drop those types from its hints.\n- **Switch tools** — `toolMenuFab` with `title` and `options` of `{ label, icon?, toolState }`; [View and tool states](../application-states/views-and-tools.md) owns tools.\n- **Edit a dimension on the product** — the editable indicators open an input for the component they target. `editableDistanceDimensionIndicator` (`targetDimension`, a `distanceDimension` instance), `listSelectorDimensionIndicator` (`targetDistanceDimensionSelect`) and `editableSizeIndicator` (`targetSize`) draw a dimension line from `startX/Y/Z` to `endX/Y/Z`. `editableAngleIndicator` targets an `angleDimension` and is placed by `positionX/Y/Z`, `startAngle` and `sweepAngle`.\n- `editableOffsetIndicator` has no start and end: it requires `targetOffset`, `targetEntityOffsetAnchors`, `targetReferenceOffsetAnchors` and `directionVector`. `dimensionIndicator`, `angleIndicator` and `offsetIndicator` only show the value.\n- **A project control on the product** — `htmlHotspot` with `name`, a project element ([Custom controls](custom-controls.md)), or `sceneEntityObjectHtmlHotspot` with `target`, a `sceneEntityRemoteObject` instance whose animation it follows, offsets in that object's local space and units.\n- **3D content on an entity** — `sceneEntityControl` with `name`: the element renders inside the WebGL scene, so it returns React Three Fiber objects, such as drei's `Billboard` and `Text`, not DOM. It stays out of camera fitting unless `includeInCameraFit: true`.\n\nPrefer the built-in control for its job and restyle it (below); an `htmlHotspot` is for a control the SDK has none of.\n\n### Place and show\n\n- `offsetX`, `offsetY` and `offsetZ` are measured from the entity's origin in the distance data unit; `screenOffsetHorizontal` and `screenOffsetVertical` shift the control in pixels. `$read` or `$eval` an offset that follows a size.\n- `showWhen` takes `selected` and `unselected`. Defaults: `[selected]` for the add and delete FABs, `[unselected]` for the selection and navigation hotspots and the tool menu; an `htmlHotspot` shows in both.\n- `hideWhileDragging` hides the control while an entity is dragged. `azimuthAngleLimits` and `polarAngleLimits` (radians) and `distanceLimits` fade it outside `{ min, max, smoothZone?, minOpacity? }`.\n- Give an icon-only FAB or hotspot a `title`; `tooltipVisibility` is `on-hover` (default), `forced`, `forced-when-still` or `hidden`.\n- `$filter` decides when the control exists: `modes: [owner]` keeps editing controls from viewers, `navigationStates` ties them to a step. [Components](../domain-model/components.md) owns filters.\n- `controlHotspot: true` on an `htmlHotspot` hides it while a change is previewed, so its dry runs never read a stale state; the add and delete FABs always behave so. It also unmounts an open popover on every change: leave it off for a hotspot whose menu stays open while users compare options. `inert: true` makes an `htmlHotspot` ignore the pointer.\n\n### Elements in the scene\n\n- In-scene elements get the theme and every `phx.frontend` hook; MUI popovers and tooltips work inside them.\n- Stop a click inside a project control from reaching the scene with `event.stopPropagation()`, or it also changes the selection. The `onDelete`, `onSelect` and `onNavigate` props below already do; a recipe's `handleClick` does not.\n- The scene's HTML sits under the layout's panels, so a covered control cannot be clicked.\n\n### Replace a built-in control's look\n\nEach helper registers the element the scene renders for one component, everywhere the spec places it, in the built-in layout and in a project layout. The spec keeps the position, visibility, filters and tooltip settings. Pass a component `(props) => JSX.Element | null` (`null` shows nothing) and default-export the registration, or an array of registrations, from a file in `src/elements/`:\n\n- `phx.frontend.createAddEntityFab(Component)` — replaces `AddEntityFab`, for `sceneEntityAddFab`. Props: `entityId`, `instanceNames`, `fixableViolations` (the spec's `hiddenViolations`), `icon`, `label`, `title`, `tooltipVisibility`, `skipMenuWhenOnlyOne`, `hideWhenNone`. It gets no recipes: read them with `phx.frontend.useGroupedRecipeOptions(entityId, instanceNames, fixableViolations)` in the menu, mounted only while open, since every recipe is a dry run.\n- `phx.frontend.createDeleteEntityFab(Component)` — replaces `DeleteEntityFab`. Props: `entityId`, `onDelete`, `disabled`, `disabledHint`, `trace` (logs the dry run), `icon`, `label`, `title`, `tooltipVisibility`.\n- `phx.frontend.createSelectionHotspot(Component)` — replaces `SelectionHotspot`. Props: `entityId`, `onSelect`, `title`, `tooltipVisibility`.\n- `phx.frontend.createNavigationHotspot(Component)` — replaces `NavigationHotspot`. Props: `entityId`, `navigationState`, `onNavigate`, `title`, `tooltipVisibility`.\n- `phx.frontend.createToolMenuFab(Component)` — replaces `ToolMenuFab`. Props: `entityId`, `options`, `onSelectTool(toolState)`, `icon`, `title`, `tooltipVisibility`.\n\n`title` and `label` are localizable: resolve them with `phx.frontend.useResolveLocalizable()`. Registering these names with `createCustomPhoenixEntityElement` works too, but types only `entityId`. The dimension indicators have no replacement; build a different editor as an `htmlHotspot`.",example:t,documentation:'Read each with `pnpm phoenix docs -r <path>`:\n\n- "In-Scene Controls" in `docs/phoenix/configurator-interface.mdx` — the replaceable elements, their props and a complete replacement.\n- `docs/fabs/basic.mdx`, `docs/fabs/layout.mdx` — FAB settings, visibility and tooltips, and grouping controls with screen offsets.\n- `docs/controls/scene/html-hotspots.mdx`, `docs/controls/scene/object-html-hotspots.mdx`, `docs/controls/scene/custom-controls.mdx` (`sceneEntityControl`).\n- "Put a control on the product" in `docs/layouts/custom-layout.mdx` — a project hotspot with a popover.\n- `docs/dimensions/3d-scene-integration/editable-distance-dimension-indicator.mdx` and its siblings in that folder, one per indicator (`pnpm phoenix docs -l` lists them).',phxMembers:["frontend.createAddEntityFab","frontend.createDeleteEntityFab","frontend.createSelectionHotspot","frontend.createNavigationHotspot","frontend.createToolMenuFab"]});
|
|
@@ -22,7 +22,7 @@ actions:
|
|
|
22
22
|
|
|
23
23
|
\`\`\`ts
|
|
24
24
|
// src/actions/move-drawer.ts
|
|
25
|
-
export default phx.
|
|
25
|
+
export default phx.frontend.implementActions({
|
|
26
26
|
moveDrawer: ({ drawerId, delta }, state, { systems: { domain }, updates }) => {
|
|
27
27
|
const desk = domain.getRoot$Entity(state)
|
|
28
28
|
const from = desk.drawerIds.indexOf(drawerId)
|
|
@@ -49,7 +49,7 @@ export default phx.domain.implementActions({
|
|
|
49
49
|
|
|
50
50
|
\`\`\`tsx
|
|
51
51
|
// in the drawer's custom element: one prepared move per button
|
|
52
|
-
const { actionSystem } = phx.frontend.
|
|
52
|
+
const { actionSystem } = phx.frontend.useConfigurator()
|
|
53
53
|
const state = phx.frontend.useCommittedState()
|
|
54
54
|
const prepare = phx.frontend.useUpdateControl()
|
|
55
55
|
|
|
@@ -61,4 +61,4 @@ const move = (delta: number) => {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
const left = move(-1) // <Button disabled={left.disabled} title={left.hints} onClick={left.update}>
|
|
64
|
-
\`\`\``;export const generatePhoenixActionsFeature=()=>e({path:"features/domain-model/actions.md",title:"Actions",summary:"Named domain operations declared in YAML, prepared in `src/actions/` and run by controls or the assistant; read when one change touches several entities or the UI and the assistant must share it.",whenToUse:"Read when a change is more than writing one field — a move among siblings, a swap, a change to several entities at once — or when the UI and the assistant must make the same change under the same rule. A single bound field needs no action: bind it in YAML ([Components](components.md)).",capabilities:"### Declare\n\n- Declare actions under the top-level `actions:`, each with a `description`, `params` and `result`. Both maps are required; write `params: {}` for an action without parameters. Names are identifiers.\n- Each param and result member is a JSON schema with the shape syntax: `$ref: phx:...`, `references`, `tsType` and `import`. A param whose schema admits `null` is optional; the others are required.\n- `phx:DomainEntityId` with `references` types an id param; `phx:$DomainEntity` with `references` types a result member as the `$` entity after the change.\n- The descriptions become the doc comments of the generated `ActionParams<'name'>` and `ActionResult<'name'>` types and what the assistant reads about the action, so write them for both readers.\n- Only the configurator domain has actions; the admin domain has none.\n\n### Implement\n\n- Default-export `phx.
|
|
64
|
+
\`\`\``;export const generatePhoenixActionsFeature=()=>e({path:"features/domain-model/actions.md",title:"Actions",summary:"Named domain operations declared in YAML, prepared in `src/actions/` and run by controls or the assistant; read when one change touches several entities or the UI and the assistant must share it.",whenToUse:"Read when a change is more than writing one field — a move among siblings, a swap, a change to several entities at once — or when the UI and the assistant must make the same change under the same rule. A single bound field needs no action: bind it in YAML ([Components](components.md)).",capabilities:"### Declare\n\n- Declare actions under the top-level `actions:`, each with a `description`, `params` and `result`. Both maps are required; write `params: {}` for an action without parameters. Names are identifiers.\n- Each param and result member is a JSON schema with the shape syntax: `$ref: phx:...`, `references`, `tsType` and `import`. A param whose schema admits `null` is optional; the others are required.\n- `phx:DomainEntityId` with `references` types an id param; `phx:$DomainEntity` with `references` types a result member as the `$` entity after the change.\n- The descriptions become the doc comments of the generated `ActionParams<'name'>` and `ActionResult<'name'>` types and what the assistant reads about the action, so write them for both readers.\n- Only the configurator domain has actions; the admin domain has none.\n\n### Implement\n\n- Default-export `phx.frontend.implementActions({ name: (params, state, ctx) => ... })` from a file in `src/actions/`. A file may implement any subset of the declared actions.\n- `params` arrive validated against the declared schema; `state` is the state the action runs on.\n- `ctx.systems` holds the domain systems and the registered systems for this browser application slot (`systems.domain.get$Entity(id, state)`, `systems.domain.getRoot$Entity(state)`); `ctx.updates` is the typed update factory, `ctx.getIdSequence()` gives ids for created entities, and `ctx.expressionContext` is the expression context.\n- Return `{ updates, readResult }`: the updates to apply, and `readResult({ previousState, state })`, which reads the declared result from the state those updates produced, transformer changes included.\n- An action only prepares. It never stages or commits; its caller does.\n- Throw to reject a call, with a message that says what was wrong and what to send instead: users see it as the control's hint and the assistant as the failed mutation's error.\n- `references` types an id but any entity id passes validation, so check what the id names, for example with `phx.domain.model.Drawer.isId(id)` or by finding it in the parent's list.\n- A declared action without an implementation stops the application at start: `.phoenix/phoenix-dev.log` shows `Missing actions: <names>`, and the editor (`--editor`) the `MISSING_ACTION_IMPLEMENTATIONS` diagnostic; implementing an undeclared name is a type error. Nothing validates what `readResult` returns at runtime.\n- Actions currently execute in the browser, including assistant custom mutations. Built-in extensions such as `ctx.systems.sketchingSystem` are optional: check the value before using it and throw a clear message when the slot does not provide it. For a custom system, check its name with `in` and narrow its value with a local type guard.\n- Action implementations are registered only by the browser assembly. They may import browser systems; the webhook reads their declarations for the assistant schema without loading their implementation modules.\n- Read sketching projections from the supplied `state` and call `getLineLengthUpdates`, `getRectangleWidthUpdates`, `getRectangleDepthUpdates`, `getConnectionAngleUpdate` or `getMoveSketchingPointUpdates`. Do not use methods that read committed state, such as `prepareInitialDrawingUpdates`. Never stage, commit, roll back, or change drawing/camera state in an action: assistant operations can use a hypothetical working state.\n\n### Run from the UI\n\n- `phx.frontend.useConfigurator().actionSystem.prepareAction(name, args, state)` returns the prepared action for the committed state from `phx.frontend.useCommittedState()`.\n- Pass its `updates` to a function from `phx.frontend.useUpdateControl()`: it dry-runs them for `disabled` and `hints` and commits them on `update()`. [Custom controls](../domain-controls/custom-controls.md) owns that hook and the control around it.\n- `prepareAction` throws for an unknown name, arguments that do not fit and every rejection; catch it and show the message as the disabled control's hint.\n- The generated `useConfigurator().actionSystem` checks action names and arguments and preserves each action result type.\n\n### Expose to the assistant\n\n- List the action under `assistant.actions` to add it as a custom mutation; `as` renames the field and `description` replaces the action's. The mutation runs the same `prepareAction` and applies its updates with the same validation as every other change.",example:t,documentation:"Read `docs/other-features/domain-actions.mdx` with `pnpm phoenix docs -r docs/other-features/domain-actions.mdx`: declaring, implementing and running an action, with a complete control and the assistant schema. `docs/phoenix/domain-model.mdx` has no actions section.",phxMembers:["frontend.implementActions"]});
|
|
@@ -43,4 +43,4 @@ export default phx.domain.implementCustomExpressions({
|
|
|
43
43
|
})
|
|
44
44
|
\`\`\`
|
|
45
45
|
|
|
46
|
-
\`$delivery\` keeps one object while its five inputs are unchanged, so a reader of \`cabinet.$delivery\` re-renders only when one of them changes. \`$halfWidth\` is a number and needs neither TypeScript nor \`memoEval\`.`;export const generatePhoenixExpressionsFeature=()=>e({path:"features/domain-model/expressions.md",title:"Expressions",summary:"Derived values in YAML or TypeScript, `memoEval`, the expression context and the data hooks; read when computing a value from entity state or data sources.",whenToUse:"Read when a value derives from the configuration or its data — a price, a label, a limit, recipe options, a filter condition — or when custom React code needs the published, frontend or backend data.",capabilities:"### Choose the form\n\n- **`constants:`** — a fixed value per entity type or alias, without code (`$maxLegs: 4`). One that does not read `self` is also readable without an entity, as `phx.domain.enhancedModel.$Chair.$maxLegs`.\n- **`$eval` under `expressions:`** — one inline JavaScript expression of `self` (`$eval: self.width / 2`); give it an explicit `type`, because a value that reads `self` cannot be inferred. It sees only `self`: no state, context, helpers or imports. A `$eval` that does not read `self` is folded at parse time when it uses only literals, operators and `Math`; anything else needs an explicit `type` too.\n- **`$msg`** — a translatable text; [Localization](../localization.md) owns it.\n- **TypeScript** — anything that reads the data sources, the state or a helper, or needs more than one expression: declare the type in YAML and implement it in `src/expressions/`.\n\n### Declare and implement\n\n- Declare under `expressions:`, by entity type or alias, a `$name` with a JSON schema: `type`, `items`, `properties`, `$ref: phx:...`, or `tsType` with `import`.\n- Implement it with `phx.domain.implementCustomExpressions({ Desk: { $name: (self, state, ctx) => value } })`, default-exported from a file in `src/expressions/`, one file per entity type. Implement it under the entity type or alias that declares it.\n- A declared expression without an implementation stops the application at start with `MISSING_IMPLEMENTATION`; one implemented twice, or one the spec already gives a value, with `DUPLICATE_DEFINITION`.\n- Inference: a component `$read: $name` or filter `active: { $read: $name }` of an undeclared `$name` declares it with the type that prop or criterion expects, as recipe lists usually are. It still needs a TypeScript implementation. Declare it yourself to own the type; a type no read can accept fails with `EXPRESSION_READ_TYPE_CONFLICT`.\n\n### Pure, server-safe and stable\n\n- Expressions are pure: no side effects, no mutation of inputs, the same result for the same state and data. They are computed on demand and cached per state.\n- Expressions and invariants also run on the server. Use `phx.domain` only, never `phx.frontend`, React or a browser-only import; put shared helpers in `_`-prefixed folders.\n- [Actions](actions.md)
|
|
46
|
+
\`$delivery\` keeps one object while its five inputs are unchanged, so a reader of \`cabinet.$delivery\` re-renders only when one of them changes. \`$halfWidth\` is a number and needs neither TypeScript nor \`memoEval\`.`;export const generatePhoenixExpressionsFeature=()=>e({path:"features/domain-model/expressions.md",title:"Expressions",summary:"Derived values in YAML or TypeScript, `memoEval`, the expression context and the data hooks; read when computing a value from entity state or data sources.",whenToUse:"Read when a value derives from the configuration or its data — a price, a label, a limit, recipe options, a filter condition — or when custom React code needs the published, frontend or backend data.",capabilities:"### Choose the form\n\n- **`constants:`** — a fixed value per entity type or alias, without code (`$maxLegs: 4`). One that does not read `self` is also readable without an entity, as `phx.domain.enhancedModel.$Chair.$maxLegs`.\n- **`$eval` under `expressions:`** — one inline JavaScript expression of `self` (`$eval: self.width / 2`); give it an explicit `type`, because a value that reads `self` cannot be inferred. It sees only `self`: no state, context, helpers or imports. A `$eval` that does not read `self` is folded at parse time when it uses only literals, operators and `Math`; anything else needs an explicit `type` too.\n- **`$msg`** — a translatable text; [Localization](../localization.md) owns it.\n- **TypeScript** — anything that reads the data sources, the state or a helper, or needs more than one expression: declare the type in YAML and implement it in `src/expressions/`.\n\n### Declare and implement\n\n- Declare under `expressions:`, by entity type or alias, a `$name` with a JSON schema: `type`, `items`, `properties`, `$ref: phx:...`, or `tsType` with `import`.\n- Implement it with `phx.domain.implementCustomExpressions({ Desk: { $name: (self, state, ctx) => value } })`, default-exported from a file in `src/expressions/`, one file per entity type. Implement it under the entity type or alias that declares it.\n- A declared expression without an implementation stops the application at start with `MISSING_IMPLEMENTATION`; one implemented twice, or one the spec already gives a value, with `DUPLICATE_DEFINITION`.\n- Inference: a component `$read: $name` or filter `active: { $read: $name }` of an undeclared `$name` declares it with the type that prop or criterion expects, as recipe lists usually are. It still needs a TypeScript implementation. Declare it yourself to own the type; a type no read can accept fails with `EXPRESSION_READ_TYPE_CONFLICT`.\n\n### Pure, server-safe and stable\n\n- Expressions are pure: no side effects, no mutation of inputs, the same result for the same state and data. They are computed on demand and cached per state.\n- Expressions and invariants also run on the server. Use `phx.domain` only, never `phx.frontend`, React or a browser-only import; put shared helpers in `_`-prefixed folders.\n- [Actions](actions.md) belong to configurator and load only in the browser; expressions and invariants must remain server-safe.\n- Keep the reference of an object or array result while its inputs are unchanged: wrap the implementation in `memoEval(deps, compute)` from `@salsita-ai/sdk/domain`. `deps(self, state, ctx)` returns an array compared item by item with `===`, and `compute(...deps)` runs only when an item changed.\n- List every input in `deps` and read nothing else in `compute`. Primitives need no `memoEval`.\n- A new object on every evaluation re-renders every reader and can reset systems that react to references, such as cameras; a mutated cached result hides the change.\n\n### The expression context\n\n- `self` is the `$` entity: fields, relations (`self.$drawers`), expressions and constants.\n- `state` is the domain state: `state.entities`, `state.rootEntityId`.\n- `ctx.publishedData`, `ctx.frontendData` and `ctx.sessionData` are typed by the spec's `publishedData:`, `frontendData:` and `sessionData:` schemas: a property missing from the schema's `required` list is optional.\n- A `sessionData` schema cannot list `required` properties (`SESSION_DATA_REQUIRED_PROPERTIES`), so every `ctx.sessionData` property may be `undefined`.\n- `ctx.backendData` is `Record<string, unknown> | undefined`: optional and untyped, so narrow each value before use.\n- `ctx.mode` is `owner`, `read` or `finalize`; `ctx.role` is the session role.\n- `ctx.domain.get$Entity(id, state)` and `ctx.domain.getRoot$Entity(state)` read other entities; `ctx` also has the component reader and the projections.\n\n### The data in React\n\n- `phx.frontend.usePublishedData()` and `phx.frontend.useFrontendData()` return the typed published and frontend data.\n- `phx.frontend.useBackendData()` returns the same optional, untyped backend data as `ctx.backendData`.\n- `phx.frontend.useLoadedData()` returns what the configurator loaded — `initialEntities`, `initialRevisionId`, `modelVersion`, `rootEntityType` — not the current state, which [State slices](../state/slices.md) reads.\n- Prefer an expression when the value also depends on the configuration: it is cached, runs on the server and can be bound in YAML. Read the hooks for data a custom element only displays.",example:t,documentation:"Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/domain-model.mdx` — the Expressions, Constants and Static values with `$eval` sections.\n- `docs/phoenix/expression-context.mdx` — the context, its projections and the SDK expression builders.\n- `docs/phoenix/data-sources.mdx` — declaring the data schemas, their sources and lifetimes.\n- `docs/phoenix/components.mdx` — the `memoEval` section, for component outputs.",phxMembers:["domain.implementCustomExpressions","frontend.usePublishedData","frontend.useFrontendData","frontend.useBackendData","frontend.useLoadedData"]});
|
package/dist/application-spec/generate-application/code/templates/skills/features/features.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createPhoenixIndexGuide as e}from"../guide.js";import{generatePhoenixApplicationStatesGuides as n}from"./application-states/index.js";import{
|
|
1
|
+
import{createPhoenixIndexGuide as e}from"../guide.js";import{generatePhoenixApplicationStatesGuides as n}from"./application-states/index.js";import{generatePhoenixAssistantGuides as o}from"./assistant/index.js";import{generatePhoenixCustomLayoutGuides as t}from"./custom-layout/index.js";import{generatePhoenixDomainControlsGuides as s}from"./domain-controls/index.js";import{generatePhoenixDomainModelGuides as i}from"./domain-model/index.js";import{generatePhoenixInspectionFeature as a}from"./inspection.js";import{generatePhoenixLocalizationFeature as d}from"./localization.js";import{generatePhoenixSceneObjectsFeature as r}from"./scene-objects.js";import{generatePhoenixStateGuides as c}from"./state/index.js";import{generatePhoenixVariantsFeature as p}from"./variants.js";import{generatePhoenixWebhooksGuides as m}from"./webhooks/index.js";export const generatePhoenixFeatureGuides=()=>{let h=[i(),c(),n(),s(),t(),o(),[d()],[r()],m(),[a()],[p()]];return[e({path:"features/index.md",title:"Features",summary:"What Phoenix capabilities support, their constraints and the canonical SDK documentation.",intro:"Read only the guide the task needs. Each guide teaches its part of the `phx` global and names the SDK documents to read with `pnpm phoenix docs -r <path>`; a link does not make its destination required reading.",guides:h.flatMap(e=>e.slice(0,1)),notes:["## Browse the SDK docs\n\n`pnpm phoenix docs` lists every category with its document count, `-c '<Category>'` shows one category's documents with descriptions and `-l` lists every path with its title. `-s '<text>'` matches literal text line by line, so search for one distinctive term, such as an API or YAML key, rather than a phrase.","## Topic map\n\nTopics no guide covers yet point straight to the canonical SDK docs.\n\n### Project and customization\n\n- `docs/phoenix/getting-started.mdx`, `docs/phoenix/quickstart.mdx` — setup and a complete worked configurator.\n- `docs/phoenix/best-practices.mdx` — supported composition and extension patterns.\n- `docs/phoenix/project-structure.mdx` — authored folders, generated files and naming rules.\n- `docs/phoenix/theming.mdx`, `docs/ux-guidelines/overview.mdx` — theme, branding and interaction principles.\n- The **3d scene**, **Drag & Drop**, **Performance** and **Complex Use Cases** categories — materials, lights, cameras, dragging and snapping, and worked combinations.\n\n### Data sources\n\n- `docs/phoenix/data-sources.mdx`, `docs/phoenix/connected-data-sources.mdx` — published, frontend, session and backend data, and connected sheets.\n\n### Admin and Studio\n\n- `docs/phoenix/admin.mdx`, `docs/phoenix/publishing.mdx` — project content administration and published revisions.\n- `docs/phoenix/sdk-builder-workflow.mdx` — Studio workspaces, projects, environments and builds.\n\n### CLI, access and deployment\n\n- `docs/phoenix/phoenix-cli.mdx` — login, dependencies, sync, dev, build and check.\n- `docs/phoenix/sessions-and-access.mdx`, `docs/phoenix/clerk-sign-in.mdx` — configurator access and project authentication.\n- `docs/phoenix/deployments.mdx` — environments and server builds."]}),...h.flat()]};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createPhoenixFeatureGuide as t}from"../../guide.js";let
|
|
1
|
+
import{createPhoenixFeatureGuide as t}from"../../guide.js";let e=`A missing purpose is a \`warning\`: the change stays, the purpose step's Next waits for it, and finalizing waits for it like for every other warning. Its priority puts its text alone in the finalize hint while lower-ranked warnings also hold.
|
|
2
2
|
|
|
3
3
|
\`\`\`yaml
|
|
4
4
|
# spec/invariants.yaml
|
|
@@ -33,4 +33,4 @@ export const PurposeNextButton = () => {
|
|
|
33
33
|
</Tooltip>
|
|
34
34
|
)
|
|
35
35
|
}
|
|
36
|
-
\`\`\``;export const generatePhoenixViolationsFeature=()=>t({path:"features/state/violations.md",title:"Violations",summary:"How violations disable control options, become hints and gate finalizing; read when a control or button must reflect what a change would break or what still blocks the configuration.",whenToUse:"Read when a control must show what an option would break, when hint text needs ranking or custom wording, or when Next or Finalize must wait for the configuration's problems. Declaring invariants, choosing a severity and repairing with transformers belong to [Validation and repair](../domain-model/validation-and-repair.md).",capabilities:"### Where violations surface\n\n- **Controls** — every option is dry-run ([Updates and dry runs](updates.md#dry-runs)). An option is `disabled` when its dry run, after transformers, still has a `fatal` or `fixable` violation or an invariant throws; its hint is the text of those violations. A `warning` or `notice` never disables an option.\n- **Messages** — a rejected commit reaches the potentially invalid slice, and its violations become configurator messages. They include every violation of that state, notices and warnings too, so check `violation.severity`. [Messages](../custom-layout/messages.md) owns showing them.\n- **Finalizing** — reads the committed state: a `warning` or a failed save blocks it, a `notice` only adds text.\n\n### Control violations\n\n`phx.frontend.useControlViolations(ignoredTypes)` returns a function from a prepared emission to `{ disabled, hints, violations }`:\n\n- no violation — enabled, no hint;\n- `notice` or `warning` — enabled, no hint, `violations` listed;\n- `fatal` or `fixable` — disabled, `hints` from those violations, `violations` all of them;\n- an invariant that throws — disabled, no hint. A transformer that throws is not caught: the control's render throws.\n\nPrefer `phx.frontend.useUpdateControl` from [Custom controls](../domain-controls/custom-controls.md), which prepares the emission and applies this mapping. Call `useControlViolations` yourself only for an emission you prepared, such as a dialog listing from `violations` what an option would break.\n\n`fixableViolations`, an argument of every control hook and of both update hooks, only removes those violation types from the hint text: the option stays disabled. List a type when another part of the UI explains it. To keep an option enabled, repair the violation in a transformer, so its dry run ends valid.\n\n### Hint text\n\n- Hints keep only the violations with the highest `controlViolationPriority` (default 0), drop duplicates and join several as sentences. Rank a root cause above its consequences, such as size above color.\n- Ignored types are removed before the highest priority is found, so ignoring the top-ranked violation shows the next one.\n- Set `controlViolationPriority` on a YAML invariant or on a violation returned from TypeScript. The finalize hint applies the same ranking.\n- A TypeScript violation may add `formatControlViolationMessage(emission, { i18n })`: a hint naming the attempted value, or `null` to drop this hint, such as for all but one of identical violations. Messages keep using `message`.\n- `message` is optional on a TypeScript violation, and messages fall back to its type. In YAML it is a string or `$msg`; [Localization](../localization.md) covers the catalogs.\n- `phx.frontend.useMapViolationHints(ignoreTypes?)` returns `(violations, emission) => string`, the hint text these rules make from any violations. For the committed state, take the emission from `phx.frontend.useCommittedSlice()`.\n\n### Finalize and step gating\n\n`phx.frontend.useFinalizeViolations()` returns `{ disabled, hints, violations }` for the committed state:\n\n- `disabled` while a `warning` holds or the last save failed; `hints` then says why, and `violations` is `undefined` for a failed save;\n- a `notice` leaves it enabled, with its text in `hints`;\n- `violations` lists the committed state's violations, `undefined` when there are none.\n\n`phx.frontend.useStateValidity()` returns the validity of the last committed emission: `{ valid: true, severity: null }`, or `{ valid: true, severity: 'warning' | 'notice', entityViolations }`. A `fatal` or `fixable` violation is never committed, so a `warning` is the problem the committed state can still have. Its type also lists the rejected results: narrow on `severity` before reading `entityViolations`.\n\n- Gate Finalize with `disabled` and show `hints` beside it; `useFinalizeActions` already returns both ([Finalization actions](../custom-layout/finalization-actions.md)).\n- Next enforces nothing by itself ([Tabs and steps](../custom-layout/tabs-and-steps.md)). Gate it with `disabled` and show `hints`. `useStateValidity().severity === 'warning'` holds it for the configuration alone, ignoring a failed save, and gives no text.\n- When a step waits only for its own problems, filter `violations` by their types and word them with `useMapViolationHints`.",example:
|
|
36
|
+
\`\`\``;export const generatePhoenixViolationsFeature=()=>t({path:"features/state/violations.md",title:"Violations",summary:"How violations disable control options, become hints and gate finalizing; read when a control or button must reflect what a change would break or what still blocks the configuration.",whenToUse:"Read when a control must show what an option would break, when hint text needs ranking or custom wording, or when Next or Finalize must wait for the configuration's problems. Declaring invariants, choosing a severity and repairing with transformers belong to [Validation and repair](../domain-model/validation-and-repair.md).",capabilities:"### Where violations surface\n\n- **Controls** — every option is dry-run ([Updates and dry runs](updates.md#dry-runs)). An option is `disabled` when its dry run, after transformers, still has a `fatal` or `fixable` violation or an invariant throws; its hint is the text of those violations. A `warning` or `notice` never disables an option.\n- **Messages** — a rejected commit reaches the potentially invalid slice, and its violations become configurator messages. They include every violation of that state, notices and warnings too, so check `violation.severity`. [Messages](../custom-layout/messages.md) owns showing them.\n- **Finalizing** — reads the committed state: a `warning` or a failed save blocks it, a `notice` only adds text.\n\n### Control violations\n\n`phx.frontend.useControlViolations(ignoredTypes)` returns a function from a prepared emission to `{ disabled, hints, violations }`:\n\n- no violation — enabled, no hint;\n- `notice` or `warning` — enabled, no hint, `violations` listed;\n- `fatal` or `fixable` — disabled, `hints` from those violations, `violations` all of them;\n- an invariant that throws — disabled, no hint. A transformer that throws is not caught: the control's render throws.\n\nPrefer `phx.frontend.useUpdateControl` from [Custom controls](../domain-controls/custom-controls.md), which prepares the emission and applies this mapping. Call `useControlViolations` yourself only for an emission you prepared, such as a dialog listing from `violations` what an option would break.\n\n`fixableViolations`, an argument of every control hook and of both update hooks, only removes those violation types from the hint text: the option stays disabled. List a type when another part of the UI explains it. To keep an option enabled, repair the violation in a transformer, so its dry run ends valid.\n\n### Hint text\n\n- Hints keep only the violations with the highest `controlViolationPriority` (default 0), drop duplicates and join several as sentences. Rank a root cause above its consequences, such as size above color.\n- Ignored types are removed before the highest priority is found, so ignoring the top-ranked violation shows the next one.\n- Set `controlViolationPriority` on a YAML invariant or on a violation returned from TypeScript. The finalize hint applies the same ranking.\n- A TypeScript violation may add `formatControlViolationMessage(emission, { i18n })`: a hint naming the attempted value, or `null` to drop this hint, such as for all but one of identical violations. When every hint is dropped, the first violation's `message` is shown, so a disabled option always says why. Messages keep using `message`.\n- The AI assistant reads a change it cannot make by these rules too: each reason's `message`, and the formatted hint as `details` when it differs.\n- `message` is optional on a TypeScript violation, and messages fall back to its type. In YAML it is a string or `$msg`; [Localization](../localization.md) covers the catalogs.\n- `phx.frontend.useMapViolationHints(ignoreTypes?)` returns `(violations, emission) => string`, the hint text these rules make from any violations. For the committed state, take the emission from `phx.frontend.useCommittedSlice()`.\n\n### Finalize and step gating\n\n`phx.frontend.useFinalizeViolations()` returns `{ disabled, hints, violations }` for the committed state:\n\n- `disabled` while a `warning` holds or the last save failed; `hints` then says why, and `violations` is `undefined` for a failed save;\n- a `notice` leaves it enabled, with its text in `hints`;\n- `violations` lists the committed state's violations, `undefined` when there are none.\n\n`phx.frontend.useStateValidity()` returns the validity of the last committed emission: `{ valid: true, severity: null }`, or `{ valid: true, severity: 'warning' | 'notice', entityViolations }`. A `fatal` or `fixable` violation is never committed, so a `warning` is the problem the committed state can still have. Its type also lists the rejected results: narrow on `severity` before reading `entityViolations`.\n\n- Gate Finalize with `disabled` and show `hints` beside it; `useFinalizeActions` already returns both ([Finalization actions](../custom-layout/finalization-actions.md)).\n- Next enforces nothing by itself ([Tabs and steps](../custom-layout/tabs-and-steps.md)). Gate it with `disabled` and show `hints`. `useStateValidity().severity === 'warning'` holds it for the configuration alone, ignoring a failed save, and gives no text.\n- When a step waits only for its own problems, filter `violations` by their types and word them with `useMapViolationHints`.",example:e,documentation:'Read each with `pnpm phoenix docs -r <path>`:\n\n- `docs/other-features/violation-messages.mdx` — `controlViolationPriority` and `formatControlViolationMessage` worked through four ranked violations, with localized hint text.\n- `docs/other-features/violation-severity.mdx` — what each severity does to controls and finalizing; [Validation and repair](../domain-model/validation-and-repair.md) owns choosing one.\n- `docs/complex-use-cases/filtered-controls-with-fix-dialog.mdx` — controls ordered so transformers repair lower choices, with `fixableViolations` shortening each hint.\n- `docs/phoenix/configurator-interface.mdx` — "Violations" lists the violation hooks with what each returns.',phxMembers:["frontend.useControlViolations","frontend.useFinalizeViolations","frontend.useStateValidity","frontend.useMapViolationHints"]});
|
|
@@ -39,4 +39,4 @@ export const authHandler = phx.webhooks.authHandlerBuilder
|
|
|
39
39
|
})
|
|
40
40
|
.withAnonymousHandler(async () => ({ success: true, role: 'anonymous', data: { customerGroup: 'retail' } }))
|
|
41
41
|
.build()
|
|
42
|
-
\`\`\``;export const generatePhoenixWebhookAuthenticationFeature=()=>e({path:"features/webhooks/authentication.md",title:"Authentication",summary:"The auth hook: code, refresh, anonymous and Clerk flows, roles, session data and expiry; read when the configurator signs users in or treats some of them differently.",whenToUse:"Read when configurator users sign in, arrive from a host application, need different roles or prices, or when anonymous access must be refused.",capabilities:"### When the hook runs\n\n- With `useAuthHook: true` every configurator session starts with a call to the hook. Without it every configurator user gets an anonymous session and the hook never runs. Clerk sign-in needs `useClerk: true` as well, which adds the Clerk credentials to the webhook.\n- Build the hook with `phx.webhooks.authHandlerBuilder` and register it with `withAuthHook` in the [entry](entry-and-environment.md). What the browser sends picks the flow:\n - **Code** — a host application's backend deposited its token with the platform and handed the configurator a one-time code. `withCodeHandler` receives `{ accessToken, refreshToken?, idToken? }` and decides who the configurator user is.\n - **Refresh** — the session expired and the browser holds a refresh token an earlier answer returned. `withRefreshHandler` receives `{ refreshToken }`.\n - **Anonymous** — neither. `withAnonymousHandler` grants or refuses a session to configurator users who are not signed in; without it their sessions fail.\n- `withClerkCodeHandler()`, `withClerkSessionHandler()` and `withClerkRefreshHandler()` add the Clerk flows, which are tried before the custom handlers. The session handler rejects banned Clerk users.\n- Under `phoenix dev` the hook has 15 seconds to answer.\n\n### What a handler returns\n\n- `{ success: false }` refuses the session. `{ success: true, role, data }` grants it:\n - `role` — `anonymous`, `user`, `admin` or `superadmin`. The admin roles also open Project Admin.\n - `data` — the session data, validated strictly against the spec's `sessionData` schema. The schema declares no required properties, because Admin and preset sessions carry no custom session data, so code reading it handles a missing field. Later webhook calls read it as `data.sessionPayload`, and the configurator reads it as session data. It is readable in the browser, so it never holds a credential configurator users must not see, such as an API key.\n - `userId` — the stable id of the person, so their configurations and assistant threads follow them.\n - `refreshToken` — returned to the browser for the refresh flow; return one only together with a refresh handler.\n - `expirationTime` — when the session ends, as a Unix timestamp in seconds, not a duration. Leave it out: the three-hour default is what the platform's session tracking assumes, so change it only when the client needs other session lengths.\n- `withPublishedChunkScopes(({ role, data }) => [...])` grants the published-data chunk scopes a session may read; `public` is always granted. Read `docs/phoenix/publishing.mdx` before scoping chunks.",example:s,documentation:"Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/sessions-and-access.mdx` — sessions, roles, the session user and access to configurations.\n- `docs/phoenix/clerk-sign-in.mdx` — Clerk sign-in, its handlers and pages.\n- `docs/phoenix/integration/authentication-internal.mdx` and `authentication-external.mdx` — a host application signing its users in with a code.",phxMembers:["webhooks.authHandlerBuilder"]});
|
|
42
|
+
\`\`\``;export const generatePhoenixWebhookAuthenticationFeature=()=>e({path:"features/webhooks/authentication.md",title:"Authentication",summary:"The auth hook: code, refresh, anonymous and Clerk flows, roles, session data and expiry; read when the configurator signs users in or treats some of them differently.",whenToUse:"Read when configurator users sign in, arrive from a host application, need different roles or prices, or when anonymous access must be refused.",capabilities:"### When the hook runs\n\n- With `useAuthHook: true` every configurator session starts with a call to the hook. Without it every configurator user gets an anonymous session and the hook never runs. Clerk sign-in needs `useClerk: true` as well, which adds the Clerk credentials to the webhook.\n- Build the hook with `phx.webhooks.authHandlerBuilder` and register it with `withAuthHook` in the [entry](entry-and-environment.md). What the browser sends picks the flow:\n - **Code** — a host application's backend deposited its token with the platform and handed the configurator a one-time code. `withCodeHandler` receives `{ accessToken, refreshToken?, idToken? }` and decides who the configurator user is.\n - **Refresh** — the session expired and the browser holds a refresh token an earlier answer returned. `withRefreshHandler` receives `{ refreshToken }`.\n - **Anonymous** — neither. `withAnonymousHandler` grants or refuses a session to configurator users who are not signed in; without it their sessions fail.\n- `withClerkCodeHandler()`, `withClerkSessionHandler()` and `withClerkRefreshHandler()` add the Clerk flows, which are tried before the custom handlers. The session handler rejects banned Clerk users.\n- `useCognito: true` selects shared Phoenix sign-in for Cognito SDK Builder workspaces, enables generated redirect pages and the auth hook, and accepts current project grant roles and membership tags. It conflicts with `useClerk`. Without a project webhook it refuses anonymous sessions; custom hooks can add `withAnonymousHandler`. `withCognitoHandlers()` enables this flow on a manually assembled builder. See the Cognito section of `docs/phoenix/webhooks.mdx` for its session schema and fifteen-minute authentication limit.\n- Under `phoenix dev` the hook has 15 seconds to answer.\n\n### What a handler returns\n\n- `{ success: false }` refuses the session. `{ success: true, role, data }` grants it:\n - `role` — `anonymous`, `user`, `admin` or `superadmin`. The admin roles also open Project Admin.\n - `data` — the session data, validated strictly against the spec's `sessionData` schema. The schema declares no required properties, because Admin and preset sessions carry no custom session data, so code reading it handles a missing field. Later webhook calls read it as `data.sessionPayload`, and the configurator reads it as session data. It is readable in the browser, so it never holds a credential configurator users must not see, such as an API key.\n - `userId` — the stable id of the person, so their configurations and assistant threads follow them.\n - `refreshToken` — returned to the browser for the refresh flow; return one only together with a refresh handler.\n - `expirationTime` — when the session ends, as a Unix timestamp in seconds, not a duration. Leave it out: the three-hour default is what the platform's session tracking assumes, so change it only when the client needs other session lengths.\n- `withPublishedChunkScopes(({ role, data }) => [...])` grants the published-data chunk scopes a session may read; `public` is always granted. Read `docs/phoenix/publishing.mdx` before scoping chunks.",example:s,documentation:"Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/sessions-and-access.mdx` — sessions, roles, the session user and access to configurations.\n- `docs/phoenix/clerk-sign-in.mdx` — Clerk sign-in, its handlers and pages.\n- `docs/phoenix/integration/authentication-internal.mdx` and `authentication-external.mdx` — a host application signing its users in with a code.",phxMembers:["webhooks.authHandlerBuilder"]});
|
|
@@ -35,4 +35,4 @@ export default phx.webhooks.webhookBuilder
|
|
|
35
35
|
.withFetchBackendData(fetchBackendData)
|
|
36
36
|
.withConfiguratorFinalize(quoteFinalization)
|
|
37
37
|
.build()
|
|
38
|
-
\`\`\``;export const generatePhoenixWebhookEntryFeature=()=>e({path:"features/webhooks/entry-and-environment.md",title:"Webhook entry and environment",summary:"`src/webhooks/index.ts`, which project code runs on the server, browser-import limits and `env.webhook` variables; read when creating the webhook, adding server code or a secret, or fixing a webhook parse or build error.",whenToUse:"Read when the project needs server-side code — sign-in, backend data, finalization — or a credential, or when parsing or the build names a webhook file.",capabilities:"### The entry\n\n- The webhook is the project's server side: one bundle the platform calls for sign-in, backend data, finalization and its callback, Admin publishing and assistant setup. A deployed environment runs it as a cloud function; `phoenix dev` runs it on the developer's machine through the development tunnel.\n- `src/webhooks/index.ts` is the entry and default-exports `phx.webhooks.webhookBuilder` with its hooks, then `.build()`. Only that file is imported; other files in `src/webhooks/` run when it imports them. Files in `src/webhooks/` without an `index.ts` fail with `MISSING_WEBHOOK_INDEX`.\n- The builder takes `withAuthHook` ([Authentication](authentication.md)), `withFetchBackendData` ([Backend data](backend-data.md)) and `withConfiguratorFinalize` ([Finalization](finalization.md)). Register only what the project uses. The SDK adds [Admin publishing](publishing.md) itself, and [assistant setup](assistant-setup.md) when the spec configures the assistant.\n-
|
|
38
|
+
\`\`\``;export const generatePhoenixWebhookEntryFeature=()=>e({path:"features/webhooks/entry-and-environment.md",title:"Webhook entry and environment",summary:"`src/webhooks/index.ts`, which project code runs on the server, browser-import limits and `env.webhook` variables; read when creating the webhook, adding server code or a secret, or fixing a webhook parse or build error.",whenToUse:"Read when the project needs server-side code — sign-in, backend data, finalization — or a credential, or when parsing or the build names a webhook file.",capabilities:"### The entry\n\n- The webhook is the project's server side: one bundle the platform calls for sign-in, backend data, finalization and its callback, configuration insights evaluation, Admin publishing and assistant setup. A deployed environment runs it as a cloud function; `phoenix dev` runs it on the developer's machine through the development tunnel.\n- `src/webhooks/index.ts` is the entry and default-exports `phx.webhooks.webhookBuilder` with its hooks, then `.build()`. Only that file is imported; other files in `src/webhooks/` run when it imports them. Files in `src/webhooks/` without an `index.ts` fail with `MISSING_WEBHOOK_INDEX`.\n- The builder takes `withAuthHook` ([Authentication](authentication.md)), `withFetchBackendData` ([Backend data](backend-data.md)) and `withConfiguratorFinalize` ([Finalization](finalization.md)). Register only what the project uses. The SDK adds [Admin publishing](publishing.md) itself, and [assistant setup](../assistant/session-setup.md) when the spec configures the assistant.\n- `withConfigurationInsights(fields)` publishes explicitly selected scalar expressions for Studio. Each field supplies `id`, `label`, `description`, `expression` (such as `$price`), `version` and `type` (`number`, `category` or `boolean`); money also supplies `currency` and `taxBasis`. Use only deterministic expressions over saved entities and published catalog data. Session, frontend and live backend dependencies are unsupported. Ask the Phoenix team to enable Configuration insights for the project in System Studio before finalizing. It defaults off. Enabling it does not backfill older finalizations. The server evaluates against the deployment and catalog versions captured when finalization is accepted, outside the finalization request. Mutable development tunnels and historical finalizations without provenance cannot produce verified values. Do not expose personal data through these fields.\n- With `useCognito: true`, the built-in webhook authenticates invited Phoenix accounts and refuses anonymous sessions. Otherwise, without an entry the SDK builds a webhook that signs every configurator user in anonymously. `useAuthHook: true` or `useClerk: true` without an entry reports `AUTH_WITHOUT_PROJECT_WEBHOOK`.\n- A hook that throws answers with an error: the sign-in, the finalization or the publish fails. Its message reaches the server log, not the configurator user, so log what went wrong with the `logger` each hook receives.\n\n### Project code in the webhook\n\n- The spec's domain, expressions and invariants also run in the webhook. Action implementation modules load and execute only in the browser, including assistant custom mutations; assistant setup uses their shared schemas. Components, admin components and handlers are frontend-only by default.\n- A handler module that calls `phx.domain.createAssistantSetupHandler` or one of the `phx.domain.admin` publishing and validation factories joins the webhook automatically. The call is detected literally, so do not alias it.\n- Make `'use webhook'` the first statement of another component or handler the server needs, such as one that prepares the scene for server rendering. Leading comments may precede it.\n- An included file and every local file it imports must not import the browser SDK entry points (`admin`, `application`, `configurator`, `editor`, `react`, `ui`, `extras/clerk`, `extras/cognito`) or style, font and image files. Type-only imports are allowed. For files included by `'use webhook'` or a detected handler registration, parsing reports `WEBHOOK_UNSAFE_IMPORT` with the import chain. Action implementations load only in the browser and are not part of webhook assembly. Move logic both sides need into a module without them, and keep rendering in a frontend-only file.\n\n### Environment variables and secrets\n\n- Declare variables under `env.webhook`: `type` is `bool`, `str`, `num` or `url`, with an optional `default`, `devDefault` (the value under `phoenix dev`) and `required`. A variable that is neither required nor defaulted is `undefined` when unset. Read them as `phx.webhooksEnv.NAME`.\n- Values are fixed when the webhook is built: a changed value needs a restart of `phoenix dev` locally and a new deploy on an environment. Deployed builds take values from the environment variables a workspace or project Superadmin sets in Studio; `phoenix dev` takes them from `.env`, which is not committed.\n- Keep credentials in the webhook. Session data, backend data and the finalization result all reach the browser, and `env.frontend` values are public.\n- `budgets.webhookGzipMb` fails the build when the compressed webhook grows past it; `phoenix build --onlyWebhook` builds the webhook alone.",example:t,documentation:"Read with `pnpm phoenix docs -r <path>`:\n\n- `docs/phoenix/webhooks.mdx` — the entry, the built-in webhook and environment variables.\n- `docs/phoenix/webhook-membership.mdx` — which files join the webhook and the server-safe import rule.\n- `docs/phoenix/sdk-builder-workflow.mdx` — setting environment variables in Studio.",phxMembers:["webhooks.webhookBuilder"]});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createPhoenixIndexGuide as e}from"../../guide.js";import{
|
|
1
|
+
import{createPhoenixIndexGuide as e}from"../../guide.js";import{generatePhoenixWebhookAuthenticationFeature as t}from"./authentication.js";import{generatePhoenixWebhookBackendDataFeature as n}from"./backend-data.js";import{generatePhoenixWebhookEntryFeature as o}from"./entry-and-environment.js";import{generatePhoenixWebhookFinalizationFeature as i}from"./finalization.js";import{generatePhoenixPublishingFeature as a}from"./publishing.js";import{generatePhoenixTaskGuides as r}from"./tasks/index.js";export const generatePhoenixWebhooksGuides=()=>{let s=r(),h=[o(),t(),n(),i(),...s.slice(0,1),a()];return[e({path:"features/webhooks/index.md",title:"Webhooks",summary:"Server-side project code: the webhook entry and environment, sign-in, backend data, finalization and its tasks and Admin publishing; read when the configurator needs the server.",intro:"The webhook is the project's server side: `src/webhooks/index.ts` and the handler modules that join it run on the platform and hold the project's credentials, which never reach the browser. The platform calls it to sign configurator users in, to fetch backend data, to finalize a configuration and return its result, to publish Admin content and to set up the assistant ([Session setup](../assistant/session-setup.md)). Start from [Webhook entry and environment](entry-and-environment.md), then read only the guide for the hook at hand.",guides:h,notes:["## The examples\n\nThe guides build one quote configurator for a `Chair` with a `label`, a `finish` and a `width`: each example is a file of that project, and the files fit together. Take the pattern, not the names."]}),...h,...s.slice(1)]};
|
|
@@ -18,7 +18,7 @@ export interface PhoenixGuide {
|
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* A member of the `phx` global a generated project declares, named by its namespace and member, such as
|
|
21
|
-
* `frontend.useTabNavigation` or `
|
|
21
|
+
* `frontend.useTabNavigation` or `frontend.implementActions`.
|
|
22
22
|
*
|
|
23
23
|
* The `phx` global is the public interface the guidance teaches. Every member has exactly one feature guide as its
|
|
24
24
|
* home, which teaches it as `phx.<namespace>.<member>`, or a recorded reason why no guide teaches it yet.
|
package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{renderAgentSkill as e}from"./agent-skill.js";import{generatePhoenixCliCore as o,generatePhoenixSdkCore as t,generatePhoenixWorkflowCore as r}from"./core/index.js";import{generatePhoenixFeatureGuides as n}from"./features/index.js";import{createPhoenixIndexGuide as s}from"./guide.js";import{generatePhoenixAssetConversion as i,
|
|
1
|
+
import{renderAgentSkill as e}from"./agent-skill.js";import{generatePhoenixCliCore as o,generatePhoenixSdkCore as t,generatePhoenixWorkflowCore as r}from"./core/index.js";import{generatePhoenixFeatureGuides as n}from"./features/index.js";import{createPhoenixIndexGuide as s}from"./guide.js";import{generatePhoenixAssetConversion as i,generatePhoenixAssistantConfiguration as a,generatePhoenixBeta as d,generatePhoenixFeedbackGuides as c,generatePhoenixFinalization as h,generatePhoenixFirstDraftGuides as l,generatePhoenixModelMigration as u,generatePhoenixReviewGuides as p,generatePhoenixSceneRealism as m,generatePhoenixSpecificationGuides as f}from"./processes/index.js";export const generatePhoenixSkillBundle=w=>{let g=[r(),t(),o()],x=[l(),f(),[h()],[i()],[m()],[a()],[u()],p(),c(),[d(w)]],k=s({path:"processes/index.md",title:"Processes",summary:"Procedures summarized by outcome and when to use them.",intro:"Read the procedure or section whose outcome the task needs. The [workflow](../core/workflow.md) owns strategy, preferences and effort; processes supply the execution.",guides:x.flatMap(e=>e.slice(0,1)),notes:[]}),y=n();return{content:e({name:"phoenix",description:"Build, change, inspect, deploy or review a Phoenix configurator project. Use for all Phoenix project work, including a first draft of a new project, visual alternatives and platform feedback.",sections:[`# Phoenix
|
|
2
2
|
|
|
3
3
|
Use the required core to choose how to work, then load task details only when they apply.`,`## Required reading
|
|
4
4
|
|
|
5
5
|
Before Phoenix work, read these three core guides in order:
|
|
6
6
|
|
|
7
|
-
${
|
|
7
|
+
${g.map((e,o)=>`${o+1}. [${e.title}](${e.path}) — ${e.summary}.`).join("\n")}
|
|
8
8
|
|
|
9
9
|
The core governs every task; reading the workflow does not mean executing every stage. Reuse the core while it remains in context and unchanged, and read it again when context is lost or sync or an SDK update changes it.`,`## Optional guidance
|
|
10
10
|
|
|
11
11
|
- [Processes](processes/index.md) — procedures summarized by outcome and when to use them.
|
|
12
12
|
- [Features](features/index.md) — what Phoenix capabilities support, their constraints and canonical SDK documentation.
|
|
13
13
|
|
|
14
|
-
Follow only the destinations the task needs; a link does not require reading its whole subtree.`]}),references:[...
|
|
14
|
+
Follow only the destinations the task needs; a link does not require reading its whole subtree.`]}),references:[...g,k,...x.flat(),...y].map(({path:e,content:o})=>({path:e,content:o}))}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createPhoenixProcessGuide as e}from"../guide.js";let t=`Conversion is part of the product's appearance, not a preliminary chore: a converted model that is misplaced, incomplete or stripped of its detail is a visible defect, and the client sees it before anything else.
|
|
1
|
+
import{createPhoenixProcessGuide as e}from"../guide.js";let t=`Conversion is part of the product's appearance, not a preliminary chore: a converted model that is misplaced, incomplete or stripped of its detail is a visible defect, and the client sees it before anything else. If a requested realism improvement or a specific material/contact defect remains within scope, [scene realism](scene-realism.md) offers optional refinement guidance; conversion alone does not call for that pass.
|
|
2
2
|
|
|
3
3
|
### Write a script, not a sequence of one-off fixes
|
|
4
4
|
|
|
@@ -19,5 +19,5 @@ Reduce geometry per part, never uniformly across a model. A single ratio removes
|
|
|
19
19
|
|
|
20
20
|
### Verify every model, not the first one
|
|
21
21
|
|
|
22
|
-
Inspect each converted model with the [asset inspection](../features/inspection.md) tooling, and check every requirement above for every model in the set. A batch that reuses a script verified on one file still needs each result looked at: source files in one delivery frequently differ in origin, scale and structure.`,
|
|
23
|
-
- Divergences from published figures are reported to the client, not silently adopted.`;export const generatePhoenixAssetConversion=()=>e({path:"processes/asset-conversion.md",title:"Asset conversion",summary:"Convert and verify supplied 3D models with a reproducible script; read when supplied models need conversion or repair before configuration.",whenToUse:"When supplied models need conversion or repair before they can be configured. A [first draft](first-draft/direction.md) converts only its representative model, or builds a labeled stand-in when no model is supplied.",steps:t,doneWhen:
|
|
22
|
+
Inspect each converted model with the [asset inspection](../features/inspection.md) tooling, and check every requirement above for every model in the set. A batch that reuses a script verified on one file still needs each result looked at: source files in one delivery frequently differ in origin, scale and structure.`,a=`- Every model in scope is converted by the committed script and inspected against each requirement.
|
|
23
|
+
- Divergences from published figures are reported to the client, not silently adopted.`;export const generatePhoenixAssetConversion=()=>e({path:"processes/asset-conversion.md",title:"Asset conversion",summary:"Convert and verify supplied 3D models with a reproducible script; read when supplied models need conversion or repair before configuration.",whenToUse:"When supplied models need conversion or repair before they can be configured. A [first draft](first-draft/direction.md) converts only its representative model, or builds a labeled stand-in when no model is supplied.",steps:t,doneWhen:a,example:"For a set of chairs, parameterize the conversion for the source units, the ground contact and separately configurable upholstery and frame materials. Run the same script for every supplied chair and inspect each output; a valid first model does not validate the rest."});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import{createPhoenixProcessGuide as e}from"../guide.js";let t=`### Survey how the configurator changes
|
|
2
|
+
|
|
3
|
+
Before you write the \`assistant\` section, read the model, its relations and controls. List every way the UI creates, replaces, moves or deletes entities, and note how each one works: a recipe control, a plain field write, a creation in custom code, a drag handle, a sketch tool or a builder behind a button. Note also where the assistant would read its facts, such as catalog data or a price. This survey usually takes longer than the section itself, and it decides most of it.
|
|
4
|
+
|
|
5
|
+
Take axes, units and placement from the code that places parts, not from field names. A field called \`length\` can run along any axis.
|
|
6
|
+
|
|
7
|
+
### Choose and agree the approach
|
|
8
|
+
|
|
9
|
+
For each path, choose a standard write, a recipe or an action as [reading and changing](../features/assistant/reading-and-changing.md) describes. When a small refactor would let a recipe or a plain write replace an action, suggest it to the client. Explain what changes for them, usually nothing visible, and what it saves: the assistant previews and compares standard changes, while it has to learn an action from its description alone. Keep the client's decision. A refactor that would change how users work, such as placement that follows the camera, stays theirs to choose.
|
|
10
|
+
|
|
11
|
+
Agree with the client what the assistant should be able to do first. A small useful assistant that reads the configuration and makes the common changes is a better first step than complete coverage.
|
|
12
|
+
|
|
13
|
+
### Build in layers
|
|
14
|
+
|
|
15
|
+
Start with \`ai\`, which the client chooses, then what the assistant reads and the standard changes. Then add the option lists, screenshots and navigation, and finally the actions the survey called for. Run \`pnpm phoenix dev\` after each layer: section diagnostics name the key to fix. Write descriptions in the client's product terms, with units and axes, and keep rules that span entities in \`instructions\`.
|
|
16
|
+
|
|
17
|
+
### Check it as the assistant sees it
|
|
18
|
+
|
|
19
|
+
Look at each screenshot view's image as the assistant receives it, not only its spec; the panel never shows it. Development browsers rarely offer WebMCP, so install a stub right after the page navigates, before the configuration loads: \`document.modelContext = { registerTool: tool => { window.tools[tool.name] = tool } }\` with \`window.tools = {}\`. Then \`await window.tools.configurator_query.execute({ operations: [{ query }] })\` with a query of \`meta { screenshot(view: …) { image } }\` returns the image as base64. Check that the product fills the frame and that nothing hides the parts the assistant must check.
|
|
20
|
+
|
|
21
|
+
Then try the client's typical requests in the assistant panel, from a first message to a finished design. A project layout has no panel unless it keeps the built-in sidebar, so use its own thread, or ask the client to add one first ([Panel](../features/assistant/panel.md)). Read the conversation for failed tool rounds, parameter names the model guessed wrong on first use, values the assistant reads as opaque JSON, and repeated reads of lists that never change. Fix the section or a description rather than adding instructions that work around it.`,a=`- Each way the UI changes the configuration that the assistant should support maps to a write, a recipe, a deletion or an action, and each action has a stated reason a standard way does not fit.
|
|
22
|
+
- Refactors that would make the standard way work were suggested to the client, and their decision is recorded.
|
|
23
|
+
- The client's typical requests run in the assistant's thread without failed changes, and each screenshot view shows what the assistant needs to check.`;export const generatePhoenixAssistantConfiguration=()=>e({path:"processes/assistant-configuration.md",title:"Assistant configuration",summary:"Survey how the configurator changes, choose standard ways before actions, build the `assistant` section and check it as the assistant sees it; read when setting up the assistant or extending what it can do.",whenToUse:"Use when the client wants the AI assistant in their configurator, or wants it to read or change more. A wording fix in a description or in `instructions` needs only [reading and changing](../features/assistant/reading-and-changing.md).",steps:t,doneWhen:a,example:'A desk configurator adds drawers from a recipe control, sets the leg finish with a custom control, and places lamps from a catalog page with a creation in custom code, at the point the camera looks at. The survey maps drawers to `childRecipes` and the leg finish to `writable`, with an assistant-only `attributeSelection` list. For the lamps, suggest a recipe group per lamp category, with placement moved to a transformer that finds a free spot on the desk. If the client keeps the camera placement for mouse users, add an `addLamp` action that computes the spot itself. Then check the top view\'s image, and run "add two drawers and a lamp on the left" in the panel.'});
|
|
@@ -4,4 +4,32 @@ import{createPhoenixProcessGuide as e}from"../../guide.js";let t=`Draft feedback
|
|
|
4
4
|
- **Misleading guidance** — a doc page, a Phoenix guide or an error message pointed the wrong way, or did not say what was needed.
|
|
5
5
|
- **Missing feature** — something the SDK does not support forced a workaround, or a routine task took far more steps than it should.
|
|
6
6
|
|
|
7
|
-
Do not draft feedback for problems in this project's own specs or code, for a suspicion that is not checked, or twice for the same problem. For a finished run, use [Evaluate the run](evaluate.md) instead
|
|
7
|
+
Do not draft feedback for problems in this project's own specs or code, for a suspicion that is not checked, or twice for the same problem. For a finished run, use [Evaluate the run](evaluate.md) instead.`,o=`Write one draft per distinct problem, as plain text with the labels below, in this order, so the Phoenix team reads every report the same way. Keep every label; write \`none\` or \`not deployed yet\` where there is nothing to put.
|
|
8
|
+
|
|
9
|
+
\`\`\`text
|
|
10
|
+
Build: <build id> <Studio build page link>
|
|
11
|
+
Configurator: <live configurator link>
|
|
12
|
+
|
|
13
|
+
What I was doing:
|
|
14
|
+
<the task and the step you were on>
|
|
15
|
+
|
|
16
|
+
What happened and what I expected:
|
|
17
|
+
<what you ran or called, the result you got, and the result you expected>
|
|
18
|
+
|
|
19
|
+
Exact error or agent output:
|
|
20
|
+
<the error text or the output, copied unchanged>
|
|
21
|
+
|
|
22
|
+
Workaround:
|
|
23
|
+
<what you did instead, or none>
|
|
24
|
+
|
|
25
|
+
Conversation log:
|
|
26
|
+
<the conversation condensed to the turns that matter: what the client asked, what you tried, what failed>
|
|
27
|
+
\`\`\`
|
|
28
|
+
|
|
29
|
+
- **Build** is the latest build of this project, whose sources show the problem. \`pnpm phoenix deploy\` prints it as \`Build #<n> started in <preview>\` and its page, whose address carries the build id, as \`Follow the build in Studio: <url>\`. When that line is missing, use the build page URL from Studio for the project shown by \`phoenix whoami\`; do not infer a workspace from a personal login. Never invent a build id: when the project was not deployed, write \`not deployed yet\`.
|
|
30
|
+
- **Configurator** is the preview's live address \`pnpm phoenix deploy\` prints once the build is live.
|
|
31
|
+
- The team downloads the build's sources from its Studio page, so do not paste whole files; quote only the lines that show the problem.
|
|
32
|
+
- Quote errors and output exactly. A report that paraphrases an error cannot be searched for.
|
|
33
|
+
- Condense the conversation log rather than dumping it: keep the client's requests, the decisions and the failures, and leave out tool output the other sections already carry.
|
|
34
|
+
|
|
35
|
+
Then follow [Approve and send](send.md).`;export const generatePhoenixFeedbackReport=()=>e({path:"processes/feedback/report.md",title:"Report a problem",summary:"A verified SDK bug, misleading guidance or missing capability, drafted for the Phoenix team; read when such a problem affects the work.",whenToUse:t,steps:o,doneWhen:"- Each distinct, verified problem has one draft with every label filled or marked `none`.\n- The drafts went through [Approve and send](send.md).",example:"When `pnpm phoenix variants` rejects a script that only edits `src/elements/`, confirm the script follows the documented contract, then draft a bug with the exact rejection message, the script's relevant lines and `not deployed yet` for the build."});
|
package/dist/application-spec/generate-application/code/templates/skills/processes/finalization.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createPhoenixProcessGuide as e}from"../guide.js";let a=`- Each agreed action works end to end
|
|
2
|
-
- Real messages or orders were sent only with the client's authorization.`;export const generatePhoenixFinalization=()=>e({path:"processes/finalization.md",title:"Finalization",summary:"Implement the agreed completion journey: summary PDFs, emails, sharing, quotes, orders or other integrations; read when a configuration needs an ending or an integration.",whenToUse:"When the configuration journey needs an ending: saving, sharing, a summary PDF, an email, a quote, an order or another integration. A [first draft](first-draft/build.md)
|
|
1
|
+
import{createPhoenixProcessGuide as e}from"../guide.js";let a=`- Each agreed action works end to end, and its success and failure paths are visible; any delivery or integration awaiting verification remains explicitly pending.
|
|
2
|
+
- Real messages or orders were sent only with the client's authorization.`;export const generatePhoenixFinalization=()=>e({path:"processes/finalization.md",title:"Finalization",summary:"Implement the agreed completion journey: summary PDFs, emails, sharing, quotes, orders or other integrations; read when a configuration needs an ending or an integration.",whenToUse:"When the configuration journey needs an ending: saving, sharing, a summary PDF, an email, a quote, an order or another integration. A [first draft](first-draft/build.md) reaches this once its configuration is stable and finalization serves the intended outcome.",steps:"1. Agree what completing means: what is collected, what is submitted and where, what the configurator user receives, and how progress, success, failure and recovery look. Discover requirements early when they affect earlier design decisions, and implement them here.\n2. Declare each completion as a `finalizeAction` component with `variant` `primary` or `secondary` and a handler registered with `phx.frontend.createPhoenixHandler`. Render the actions in the project layout with `phx.frontend.useFinalizeActions()`, as [Finalization actions](../features/custom-layout/finalization-actions.md) describes.\n3. Implement the server side in the project webhook as [Finalization](../features/webhooks/finalization.md) describes: a finalize handler registered with `withConfiguratorFinalize`, the [tasks](../features/webhooks/tasks/index.md) the journey needs, such as a configuration link, a PDF and an email, and a callback that returns the result. Images rendered by the configurator, described in `docs/other-features/client-side-rendering/declarative.mdx`, embed in PDFs without server rendering. Mail clients drop `data:` images and CSS filters, and signed file links expire after 30 minutes, so an email attaches its product images and loads its logo from `assets/public/` in a version made for the background it sits on ([Email](../features/webhooks/tasks/email.md)).\n4. Exercise the form and its validation, progress and recovery in the browser; check generated outputs and links in their intended viewing mode. Test payloads and delivery outcomes separately, without sending real messages or creating real orders unless the client authorizes it. Report which parts were verified: a working form or mocked handler does not establish successful delivery. Keep unfinished rules and provisional prices identifiable, so nothing produces a misleading real quote or order.",doneWhen:a,example:"For a summary with email: the primary action generates a configuration link and two configurator renders, builds a branded PDF and offers it for download; the secondary action opens a form for an email address and sends the same PDF and images. Test the email with the client's own address after they agree, and simulate a delivery failure to check recovery."});
|