@salsita-ai/sdk 0.50.0-develop.da8d27f5d7 → 0.50.0-develop.dbf0122072
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 +19 -11
- package/dist/{phoenix/application-spec → application-spec/assistant}/generate-assistant-prompt.d.ts +6 -5
- package/dist/application-spec/assistant/generate-assistant-prompt.js +1 -0
- package/dist/application-spec/assistant/index.d.ts +1 -0
- package/dist/application-spec/assistant/index.js +1 -0
- 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 +6 -0
- 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/project-scaffolding.js +2 -2
- package/dist/application-spec/generate-application/code/templates/application-types.js +6 -6
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js +11 -8
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.d.ts +2 -2
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.d.ts +3 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +70 -66
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +3 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec.js +7 -7
- package/dist/application-spec/generate-application/code/templates/domain.js +2 -2
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.d.ts +11 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.js +8 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/globals.js +1 -0
- package/dist/application-spec/generate-application/code/templates/index.d.ts +7 -6
- package/dist/application-spec/generate-application/code/templates/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/agents-md.js +2 -0
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -0
- package/dist/application-spec/generate-application/code/templates/{phoenix-create-configurator-skill.d.ts → skills/phoenix-create-configurator-skill.d.ts} +1 -1
- package/dist/application-spec/generate-application/code/templates/{phoenix-create-configurator-skill.js → skills/phoenix-create-configurator-skill.js} +43 -13
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +54 -0
- package/dist/application-spec/generate-application/code/templates/{phoenix-review-skill.js → skills/phoenix-review-skill.js} +7 -5
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -0
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.js +6 -0
- package/dist/application-spec/generate-application/code/templates/{common → skills}/sdk-content.d.ts +52 -3
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +82 -0
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +2 -0
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/actions-runtime.d.ts +14 -0
- package/dist/application-spec/generate-application/runtime/sections/actions-runtime.js +1 -0
- package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.d.ts +4 -3
- package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/index.d.ts +1 -0
- package/dist/application-spec/generate-application/runtime/sections/index.js +1 -1
- package/dist/application-spec/index.d.ts +1 -0
- package/dist/application-spec/index.js +1 -1
- package/dist/application-spec/parse-application-files/categorize/categorize-files.d.ts +3 -1
- package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
- package/dist/application-spec/parse-application-files/merge/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/merge/index.js +1 -1
- package/dist/application-spec/parse-application-files/merge/merged-actions.d.ts +11 -0
- package/dist/application-spec/parse-application-files/merge/merged-actions.js +1 -0
- package/dist/application-spec/parse-application-files/merge/merged-spec.d.ts +2 -0
- package/dist/application-spec/parse-application-files/merge/merged-spec.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/raw-spec/index.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-actions.d.ts +18 -0
- package/dist/application-spec/parse-application-files/raw-spec/raw-actions.js +1 -0
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +14 -2
- 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 +2 -0
- package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
- package/dist/application-spec/parse-application-files/resolve/resolve-import-modules.js +1 -1
- package/dist/application-spec/parse-application-files/spec/application/application-spec.js +1 -1
- package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.d.ts +4 -2
- package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.js +1 -1
- package/dist/application-spec/parse-application-files/spec/common/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/spec/common/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/common/schema-ref-resolver.d.ts +23 -0
- package/dist/application-spec/parse-application-files/spec/common/schema-ref-resolver.js +1 -0
- package/dist/application-spec/parse-application-files/spec/model/names/action-name.d.ts +10 -0
- package/dist/application-spec/parse-application-files/spec/model/names/action-name.js +1 -0
- package/dist/application-spec/parse-application-files/spec/model/names/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/spec/model/names/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/actions.d.ts +35 -0
- package/dist/application-spec/parse-application-files/spec/sections/actions.js +1 -0
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.d.ts +5 -21
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +14 -39
- 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 +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant.d.ts +5 -19
- package/dist/application-spec/parse-application-files/spec/sections/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/spec/sections/index.js +1 -1
- package/dist/client/phoenix-api.d.ts +5 -1
- package/dist/configurator/application-runtime/extensions/configurator-extension-systems.d.ts +2 -1
- package/dist/configurator/application-runtime/extensions/configurator-extension-systems.js +1 -1
- package/dist/configurator/application-runtime/extensions/selectors.d.ts +2 -1
- package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +180 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -0
- package/dist/configurator/{assistant → application-runtime/extensions/systems/assistant-system}/browser-details.d.ts +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/browser-details.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/change-recorder.d.ts +85 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/change-recorder.js +1 -0
- package/dist/configurator/{assistant → application-runtime/extensions/systems/assistant-system}/graphql-tools.d.ts +20 -16
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +4 -0
- 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 +16 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/side-effects.d.ts +9 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/side-effects.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -0
- package/dist/configurator/application-runtime/extensions/systems/index.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.d.ts +2 -0
- package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.js +1 -1
- package/dist/configurator/common/frontend-analytics.d.ts +21 -21
- package/dist/configurator/index.d.ts +0 -1
- package/dist/configurator/index.js +1 -1
- package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
- package/dist/configurator/scene/scene-analytics/scene-analytics.d.ts +2 -2
- package/dist/configurator/ui/assistant/AssistantChips.d.ts +11 -0
- package/dist/configurator/ui/assistant/AssistantChips.js +1 -0
- package/dist/configurator/ui/assistant/AssistantComposer.d.ts +6 -0
- package/dist/configurator/ui/assistant/AssistantComposer.js +1 -0
- package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +7 -0
- package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -0
- package/dist/configurator/ui/assistant/AssistantPanel.d.ts +11 -0
- package/dist/configurator/ui/assistant/AssistantPanel.js +1 -0
- package/dist/configurator/ui/assistant/AssistantThread.d.ts +6 -0
- package/dist/configurator/ui/assistant/AssistantThread.js +1 -0
- package/dist/configurator/ui/assistant/assistant-failure.d.ts +18 -0
- package/dist/configurator/ui/assistant/assistant-failure.js +1 -0
- package/dist/configurator/ui/assistant/index.d.ts +2 -0
- package/dist/configurator/ui/assistant/index.js +1 -0
- package/dist/configurator/ui/assistant/streamed-markdown.d.ts +6 -0
- package/dist/configurator/ui/assistant/streamed-markdown.js +2 -0
- package/dist/configurator/ui/assistant/theme.d.ts +2 -0
- package/dist/configurator/ui/assistant/theme.js +1 -0
- package/dist/configurator/ui/assistant/thread-items.d.ts +37 -0
- package/dist/configurator/ui/assistant/thread-items.js +1 -0
- package/dist/configurator/ui/assistant/tool-chip.d.ts +44 -0
- package/dist/configurator/ui/assistant/tool-chip.js +1 -0
- package/dist/configurator/ui/assistant/use-follow-stream.d.ts +17 -0
- package/dist/configurator/ui/assistant/use-follow-stream.js +1 -0
- package/dist/configurator/ui/assistant/use-is-assistant-panel-open.d.ts +5 -0
- package/dist/configurator/ui/assistant/use-is-assistant-panel-open.js +1 -0
- package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.js +5 -5
- package/dist/configurator/ui/configurator-layout/universal/MobileLayout.d.ts +2 -0
- package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +4 -4
- package/dist/configurator/ui/legacy/mobile-controls/MobileControls.d.ts +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.d.ts +10 -0
- package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -0
- package/dist/configurator/ui/phoenix-layout-elements/index.d.ts +1 -0
- package/dist/configurator/ui/phoenix-layout-elements/index.js +1 -1
- package/dist/docs/index.json +12 -2
- package/dist/docs/layouts/toolbar.mdx +6 -0
- package/dist/docs/other-features/domain-actions.mdx +418 -0
- package/dist/docs/other-features/side-effects.mdx +26 -0
- package/dist/docs/phoenix/admin.mdx +2 -2
- package/dist/docs/phoenix/best-practices.mdx +1 -0
- package/dist/docs/phoenix/finalization.mdx +1 -1
- package/dist/docs/phoenix/integration/headless-mode-external.mdx +5 -5
- package/dist/docs/phoenix/integration/widget-mode-external.mdx +5 -5
- package/dist/docs/phoenix/migrations.mdx +45 -5
- package/dist/docs/phoenix/phoenix-cli.mdx +139 -20
- package/dist/docs/phoenix/project-structure.mdx +7 -3
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +12 -8
- package/dist/domain/actions/action-factory.d.ts +10 -0
- package/dist/domain/actions/action-factory.js +1 -0
- package/dist/domain/actions/prepare-action-implementations.d.ts +15 -0
- package/dist/domain/actions/prepare-action-implementations.js +5 -0
- package/dist/domain/application/application-config.d.ts +2 -60
- package/dist/domain/application/assistant/assistant-manifest.d.ts +61 -0
- package/dist/domain/application/assistant/assistant-manifest.js +1 -0
- package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +95 -0
- package/dist/domain/application/assistant/assistant-resolved-manifest.js +1 -0
- package/dist/domain/application/assistant/assistant-value-type.d.ts +9 -0
- package/dist/domain/application/assistant/assistant-value-type.js +1 -0
- package/dist/domain/application/assistant/build-assistant-manifest.d.ts +4 -0
- package/dist/domain/application/assistant/build-assistant-manifest.js +1 -0
- package/dist/domain/application/assistant/index.d.ts +3 -0
- package/dist/domain/application/assistant/index.js +1 -0
- package/dist/domain/application/assistant-field-options.d.ts +1 -1
- package/dist/domain/application/assistant-mutations.d.ts +16 -15
- package/dist/domain/application/assistant-mutations.js +1 -1
- package/dist/domain/application/assistant-recipe-groups.d.ts +1 -1
- package/dist/domain/application/configurator-builder.d.ts +4 -3
- package/dist/domain/application/index.d.ts +2 -1
- package/dist/domain/application/index.js +1 -1
- package/dist/domain/components/updates.d.ts +16 -0
- package/dist/domain/core/action.d.ts +67 -0
- package/dist/domain/core/action.js +1 -0
- package/dist/domain/core/domain-factory.d.ts +4 -0
- package/dist/domain/core/index.d.ts +1 -0
- package/dist/domain/domain-builder.d.ts +7 -0
- package/dist/domain/domain-builder.js +1 -1
- package/dist/domain/domain-context/action-system/action-system.d.ts +40 -0
- package/dist/domain/domain-context/action-system/action-system.js +1 -0
- package/dist/domain/domain-context/domain-context-systems.d.ts +5 -2
- package/dist/domain/domain-context/index.d.ts +2 -1
- package/dist/domain/domain-context/index.js +1 -1
- package/dist/domain/domain-context/store-system/store-system.js +1 -1
- package/dist/domain/domain-runtime/domain-context/domain-context.js +1 -1
- package/dist/domain/domain-runtime/domain-context/selectors.d.ts +4 -0
- package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
- package/dist/domain/domain-runtime/domain-runtime.d.ts +16 -4
- 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/selectors.js +1 -1
- package/dist/domain/domain-runtime/spec/types.d.ts +18 -4
- package/dist/domain/index.d.ts +2 -0
- package/dist/domain/index.js +1 -1
- package/dist/domain/mocks/create-mock-domain-runtime.d.ts +8 -2
- package/dist/domain/system-components/phoenix-layout-elements/assistant-toolbar-button.d.ts +44 -0
- package/dist/domain/system-components/phoenix-layout-elements/assistant-toolbar-button.js +1 -0
- package/dist/domain/system-components/phoenix-layout-elements/index.d.ts +1 -0
- package/dist/domain/system-components/phoenix-layout-elements/index.js +1 -1
- package/dist/domain/system-components/phoenix-layout-elements/phoenix-layout-element.d.ts +2 -1
- package/dist/domain/system-components/phoenix-layout-elements/phoenix-layout-element.js +1 -1
- package/dist/editor/Editor.js +1 -1
- 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 +7 -3
- package/dist/editor/domain-editors/use-implementation-files.js +1 -1
- package/dist/editor/graphql/GraphQLPanel.js +1 -1
- package/dist/editor/variants/VariantAnswerFooter.d.ts +17 -0
- package/dist/editor/variants/VariantAnswerFooter.js +1 -0
- package/dist/editor/variants/VariantPreviewHandler.d.ts +6 -0
- package/dist/editor/variants/VariantPreviewHandler.js +1 -0
- package/dist/editor/variants/variant-preview-styles.d.ts +49 -0
- package/dist/editor/variants/variant-preview-styles.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/domain-spec/__generated/domain-schema.d.ts +6 -0
- package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
- package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
- package/dist/phoenix/cli.js +1 -1
- package/dist/phoenix/commands/build.d.ts +5 -0
- package/dist/phoenix/commands/build.js +1 -1
- package/dist/phoenix/commands/deploy.js +2 -2
- package/dist/phoenix/commands/dev.js +5 -5
- package/dist/phoenix/commands/feedback.d.ts +2 -1
- package/dist/phoenix/commands/feedback.js +1 -1
- package/dist/phoenix/commands/index.d.ts +1 -0
- package/dist/phoenix/commands/index.js +1 -1
- package/dist/phoenix/commands/login.d.ts +24 -6
- package/dist/phoenix/commands/login.js +2 -2
- package/dist/phoenix/commands/story-dev.js +2 -2
- package/dist/phoenix/commands/variants.d.ts +35 -0
- package/dist/phoenix/commands/variants.js +1 -0
- package/dist/phoenix/editor-server/commands-router.d.ts +68 -1
- package/dist/phoenix/editor-server/commands-router.js +1 -1
- package/dist/phoenix/editor-server/editor-router.d.ts +65 -0
- package/dist/phoenix/editor-server/editor-server.d.ts +3 -3
- package/dist/phoenix/editor-server/editor-server.js +1 -1
- package/dist/phoenix/editor-server/protocol.d.ts +1 -0
- package/dist/phoenix/editor-server/spec-router.js +1 -1
- package/dist/phoenix/editor-server/trpc.d.ts +3 -0
- package/dist/phoenix/services/application-spec-project-watcher.d.ts +13 -2
- package/dist/phoenix/services/application-spec-project-watcher.js +3 -3
- package/dist/phoenix/services/index.d.ts +5 -0
- package/dist/phoenix/services/index.js +1 -1
- package/dist/phoenix/services/phoenix-application.d.ts +21 -0
- package/dist/phoenix/services/phoenix-application.js +1 -0
- package/dist/phoenix/services/phoenix-store.d.ts +48 -0
- package/dist/phoenix/services/phoenix-store.js +1 -0
- package/dist/phoenix/services/phx-banner-plugin.d.ts +32 -0
- package/dist/phoenix/services/phx-banner-plugin.js +1 -0
- package/dist/phoenix/services/phx-licenses-plugin.d.ts +55 -0
- package/dist/phoenix/services/phx-licenses-plugin.js +8 -0
- package/dist/phoenix/services/phx-variant-previews-plugin.d.ts +9 -0
- package/dist/phoenix/services/phx-variant-previews-plugin.js +1 -0
- package/dist/phoenix/services/variant-file-session.d.ts +36 -0
- package/dist/phoenix/services/variant-file-session.js +1 -0
- package/dist/phoenix/services/variant-preview-service.d.ts +80 -0
- package/dist/phoenix/services/variant-preview-service.js +1 -0
- package/dist/phoenix/services/vite-config.d.ts +2 -0
- package/dist/phoenix/services/vite-config.js +1 -1
- package/dist/phoenix/utils/index.d.ts +1 -0
- package/dist/phoenix/utils/index.js +1 -1
- package/dist/phoenix/utils/read-git-commit.d.ts +14 -0
- package/dist/phoenix/utils/read-git-commit.js +1 -0
- package/dist/react-sdk/application-runtime/common-services/analytics/analytics-service.d.ts +2 -2
- package/dist/react-sdk/application-runtime/common-services/analytics/domain-controls-analytics.d.ts +21 -21
- package/dist/react-sdk/application-runtime/hooks/data/use-published-data.d.ts +1 -1
- package/dist/react-sdk/application-runtime/hooks/use-spec.d.ts +1 -1
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +16 -4
- package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +3 -0
- package/dist/ui-sdk/common/use-viewport-size.d.ts +4 -1
- package/dist/ui-sdk/common/use-viewport-size.js +1 -1
- package/dist/ui-sdk/components/mobile-controls/index.d.ts +1 -1
- package/dist/ui-sdk/theme/types.d.ts +4 -0
- package/package.json +5 -8
- package/schema/domain-spec.json +24 -0
- package/dist/application-spec/generate-application/code/templates/agents-md.js +0 -2
- package/dist/application-spec/generate-application/code/templates/common/sdk-content.js +0 -67
- package/dist/application-spec/generate-application/code/templates/phoenix-cli-skill.js +0 -1
- package/dist/application-spec/generate-application/code/templates/phoenix-feedback-skill.js +0 -31
- package/dist/application-spec/generate-application/code/templates/phoenix-skill.js +0 -1
- package/dist/configurator/assistant/browser-details.js +0 -1
- package/dist/configurator/assistant/graphql-tools.js +0 -1
- package/dist/configurator/assistant/index.d.ts +0 -1
- package/dist/configurator/assistant/index.js +0 -1
- package/dist/configurator/assistant/use-assistant-chat.d.ts +0 -20
- package/dist/configurator/assistant/use-assistant-chat.js +0 -1
- package/dist/extras/assistant/AssistantChat.d.ts +0 -6
- package/dist/extras/assistant/AssistantChat.js +0 -1
- package/dist/extras/assistant/index.d.ts +0 -1
- package/dist/extras/assistant/index.js +0 -1
- package/dist/phoenix/application-spec/generate-assistant-prompt.js +0 -1
- /package/dist/application-spec/generate-application/code/templates/{common → skills}/agent-skill.d.ts +0 -0
- /package/dist/application-spec/generate-application/code/templates/{common → skills}/agent-skill.js +0 -0
- /package/dist/application-spec/generate-application/code/templates/{agents-md.d.ts → skills/agents-md.d.ts} +0 -0
- /package/dist/application-spec/generate-application/code/templates/{phoenix-cli-skill.d.ts → skills/phoenix-cli-skill.d.ts} +0 -0
- /package/dist/application-spec/generate-application/code/templates/{phoenix-feedback-skill.d.ts → skills/phoenix-feedback-skill.d.ts} +0 -0
- /package/dist/application-spec/generate-application/code/templates/{phoenix-review-skill.d.ts → skills/phoenix-review-skill.d.ts} +0 -0
- /package/dist/application-spec/generate-application/code/templates/{phoenix-skill.d.ts → skills/phoenix-skill.d.ts} +0 -0
package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import{renderAgentSkill as e}from"./agent-skill.js";let t=`## When to Raise Feedback
|
|
2
|
+
Draft feedback for the Phoenix team when one of these happens while you work in this project:
|
|
3
|
+
- **Bug** — the SDK, the \`phoenix\` CLI or generated code crashes, produces wrong output or behaves differently from its documentation, and the cause is not in this project's own code.
|
|
4
|
+
- **Misleading guidance** — a doc page, a Phoenix skill or an error message sent you the wrong way, or did not say what you needed.
|
|
5
|
+
- **Missing feature** — something the SDK does not support forced a workaround, or a routine task took far more steps than it should.
|
|
6
|
+
|
|
7
|
+
Do not draft feedback for problems in this project's own specs or code, for a suspicion you have not checked, or twice for the same problem. Write one draft per distinct problem.
|
|
8
|
+
|
|
9
|
+
The evaluation of a finished run is feedback too; the section "Evaluate the Run" says when to ask for it.`,o=`## Ask Before You Send
|
|
10
|
+
Never send feedback on your own. Show the user a draft and send it only after they approve it.
|
|
11
|
+
|
|
12
|
+
When to ask is your judgement:
|
|
13
|
+
- **Right away** — the problem is crucial: it blocks the task or forces a workaround the user should know about now. Interrupt the work, show the draft, and continue once the user has answered.
|
|
14
|
+
- **At the end of the task** — everything else. Collect the details while you work and show all drafts together in your final message.
|
|
15
|
+
- **When the user asks** you to send feedback — draft it and show it before sending.
|
|
16
|
+
|
|
17
|
+
The draft is exactly what would be sent: the type, the full message, the project if you name one with \`--projectSlug\`, and the contact if the user gave one. Send it unchanged after a yes; if the user edits it, send their version. If they decline, drop it and do not raise that problem again.`,n=`## Evaluate the Run
|
|
18
|
+
When the work on the configurator is finished, interview the user for an evaluation of the run and send it as feedback. The run is finished when the user says they are done, or when \`phoenix deploy\` reported the configurator live and the user confirms they have nothing more to build; ask that once after a deploy goes live, and do not start the interview while they want to continue.
|
|
19
|
+
|
|
20
|
+
Say first that the answers are sent to the Phoenix team as feedback, and that the user can decline. Then ask one question at a time, in this order, and wait for each answer before asking the next. Give the short explanation with each question. Every score is a whole number from 0 to 10, where 0 is catastrophic, 5 is passable and 10 is amazing:
|
|
21
|
+
1. **Minutes spent** — roughly how many minutes the user spent on the run, from the first prompt to now. This one is a number of minutes, not a score.
|
|
22
|
+
2. **Agent guidance** — how clear it was what to expect and what to do, how clearly you explained yourself, and how well they understood the consequences of their choices.
|
|
23
|
+
3. **Functionality** — how complete the configurator is: whether it configures the full product with all its options, keeps the user from creating or submitting a wrong configuration, and offers a way to finalize one.
|
|
24
|
+
4. **UX** — how easy the configurator is to understand and operate, how clear the choices are, and how understandable incompatibilities and the ways to resolve them are.
|
|
25
|
+
5. **3D quality** — how realistic and attractive the configured object and its scene are: shapes, textures, surroundings, lighting and shadows.
|
|
26
|
+
6. **UI visuals** — how good the user interface looks.
|
|
27
|
+
7. **Overall** — the user's subjective verdict on the configurator as a whole.
|
|
28
|
+
8. **Comments** — anything else about the experience, in their own words. This one is free text and may be empty.
|
|
29
|
+
|
|
30
|
+
Rules of the interview:
|
|
31
|
+
- Ask once per conversation. Do not run it again after a later deploy, and do not run it after a deploy that failed.
|
|
32
|
+
- Never choose, guess or adjust a score, and never answer a question for the user. When they skip one, write \`skipped\` for it.
|
|
33
|
+
- When the user declines the evaluation, send nothing and do not ask again.
|
|
34
|
+
|
|
35
|
+
Compose the evaluation from the answers with exactly these labels, one per line, in this order. Write \`none\` when there are no comments, and fill \`Build\` and \`Configurator\` as the report template describes:
|
|
36
|
+
\`\`\`text
|
|
37
|
+
Evaluation
|
|
38
|
+
Minutes spent: <minutes>
|
|
39
|
+
Agent guidance: <score>/10
|
|
40
|
+
Functionality: <score>/10
|
|
41
|
+
UX: <score>/10
|
|
42
|
+
3D quality: <score>/10
|
|
43
|
+
UI visuals: <score>/10
|
|
44
|
+
Overall: <score>/10
|
|
45
|
+
Comments: <their comments, or none>
|
|
46
|
+
Build: <build id> <Studio build page link>
|
|
47
|
+
Configurator: <live configurator link>
|
|
48
|
+
\`\`\`
|
|
49
|
+
Keep the labels and their order, so the scores can be read out of the feedback list and its export. Show the user the text exactly as it would be sent, and send it with \`--type other\` only after a yes; if they edit it, send their version. An evaluation is not a bug report: when a comment names a concrete problem, offer to draft it as its own report.`,a=`## What Never Goes Into Feedback
|
|
50
|
+
The message leaves this project and is read by the Phoenix team. Never include:
|
|
51
|
+
- secrets and credentials: API tokens, keys, passwords or \`.env\` values, also when they appear inside an error or a log you quote. Replace each with \`<redacted>\`;
|
|
52
|
+
- personal data, or data of the project's customers and end users, such as names, email addresses and orders, other than a contact the user asked you to add.
|
|
53
|
+
|
|
54
|
+
Parts of this project may go into a message: file names and paths, snippets of its specs and code, and the user's own words. They are sent only as part of a draft the user saw and approved, which is why the draft you show is always the full text.`;export const generatePhoenixFeedbackSkill=()=>e({name:"phoenix-feedback",description:"Evaluating a finished run and drafting feedback about the Phoenix SDK, CLI, documentation or Studio for the Phoenix team, sent with the phoenix feedback command once the user approves the draft. Use right after phoenix deploy reports the configurator live or when the user says they are done, to offer the evaluation of the run, and when the SDK or CLI misbehaves, a doc or skill misled you, a missing feature forced a workaround or the user asks to send feedback.",sections:[t,o,"## Report Template\nWrite a report 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 you have nothing to put.\n```text\nBuild: <build id> <Studio build page link>\nConfigurator: <live configurator link>\n\nWhat I was doing:\n<the task and the step you were on>\n\nWhat happened and what I expected:\n<what you ran or called, the result you got, and the result you expected>\n\nExact error or agent output:\n<the error text or the output, copied unchanged>\n\nWorkaround:\n<what you did instead, or none>\n\nConversation log:\n<the conversation condensed to the turns that matter: what the user asked, what you tried, what failed>\n```\n- **Build** is the latest build of this project, the one whose sources show the problem. `pnpm phoenix deploy` prints its id as `Build <id> started` and its page as `Follow the build in Studio: <url>`. When that line is missing, compose the link as `https://<workspace>.<studio host>/builder/deployments/<build id>`: the workspace is the one named at `phoenix login`, and the host is `studio.eu.salsita.ai` for the `eu` region, `studio.salsita.ai` for `us` and `studio-staging.salsita.app` for staging. A Studio address passed to login with `--studioUrl` replaces the workspace and host. Never invent a build id: when the project was not deployed, write `not deployed yet`.\n- **Configurator** is the live address `pnpm phoenix deploy` prints once the build is live.\n- The team downloads the sources of the build from its Studio page, so do not paste whole files; quote only the lines that show the problem.\n- Quote errors and output exactly. A report that paraphrases an error cannot be searched for.\n- Condense the conversation log, do not dump it: keep the user's requests, your decisions and the failures, and leave out tool output that the other sections already carry.",n,"## How to Send It\nWrite a report or an evaluation to a text file and send the file, so the shell changes nothing in it:\n```bash\npnpm phoenix feedback --file <path> --type bug --agent '<your agent name>'\n```\nPut the file outside the project, in the system's temporary folder, and delete it after sending. A note of a line or two can go in as an argument instead:\n```bash\npnpm phoenix feedback '<message>' --type idea --agent '<your agent name>'\n```\n- Give either `--file` or the message argument, never both.\n- Put a message argument in single quotes, so the shell passes backticks, `$` and double quotes through unchanged. In bash or zsh, write a single quote inside the message as `'\\''`; in PowerShell, double it instead.\n- `--type` is `bug`, `idea` or `other` (default `other`). Use `idea` for a missing feature or an improvement, and `other` for an evaluation.\n- `--agent` names you, the coding agent, so the team can tell agent feedback from a person's.\n- `--contact '<email>'` only when the user wants a reply and gave you the contact to use.\n- The workspace, user, SDK version and the spec's `project` are attached automatically. `--projectSlug <slug>` names another project of the workspace.\n- A message holds at most 100,000 characters. Shorten the conversation log first when a report is longer.\n\nThe command needs `phoenix login`. If it answers that you are not signed in, tell the user once and continue; do not sign in yourself, because the sign-in is approved in a browser.\n\nAfter sending, confirm it to the user in one line.",a]});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{renderAgentSkill as e}from"./
|
|
1
|
+
import{renderAgentSkill as e}from"./agent-skill.js";let i=`Review all current git changes for correctness, Phoenix pattern violations, and security issues.
|
|
2
2
|
|
|
3
3
|
## Phoenix-Specific Review
|
|
4
4
|
|
|
@@ -7,13 +7,15 @@ import{renderAgentSkill as e}from"./common/agent-skill.js";let i=`Review all cur
|
|
|
7
7
|
- [ ] Relations properly define parent-child ownership (1-N, 0-1)
|
|
8
8
|
- [ ] Expressions have matching implementations in src/expressions/
|
|
9
9
|
- [ ] Invariants have matching implementations in src/invariants/
|
|
10
|
+
- [ ] Actions declared under actions: have matching implementations in src/actions/ (a missing one fails the type check of the generated barrel)
|
|
10
11
|
- [ ] Component bindings use correct entity types or aliases
|
|
11
12
|
- [ ] $read/$write/$bind reference valid properties or expressions
|
|
12
|
-
- [ ]
|
|
13
|
+
- [ ] A model that has been deployed is unchanged under its version: the change is in \`model.latest\`, the deployed model is kept as \`model.v<N>\`, and \`src/migrations/v<N+1>.ts\` migrates saved configurations
|
|
13
14
|
|
|
14
|
-
### Expressions & Invariants (src/expressions/, src/invariants/)
|
|
15
|
+
### Expressions, Actions & Invariants (src/expressions/, src/actions/, src/invariants/)
|
|
15
16
|
|
|
16
|
-
- [ ] Use phx.domain.implementCustomExpressions() / implementCustomInvariants()
|
|
17
|
+
- [ ] Use phx.domain.implementCustomExpressions() / implementActions() / implementCustomInvariants()
|
|
18
|
+
- [ ] Actions only prepare: they return updates and a readResult reader, never stage or commit, and throw messages that say what to send instead
|
|
17
19
|
- [ ] Expression names prefixed with $ in YAML match implementation
|
|
18
20
|
- [ ] No side effects in expressions (pure computed values only)
|
|
19
21
|
- [ ] Invariant violations return proper severity and messages
|
|
@@ -58,7 +60,7 @@ import{renderAgentSkill as e}from"./common/agent-skill.js";let i=`Review all cur
|
|
|
58
60
|
|
|
59
61
|
## Auto-Generated Files — DO NOT modify
|
|
60
62
|
|
|
61
|
-
- .phoenix/ directory, tsconfig.json, eslint.config.js, prettier.config.js
|
|
63
|
+
- .phoenix/ directory (except the option files in .phoenix/variants/, which the phoenix-variants skill writes), tsconfig.json, eslint.config.js, prettier.config.js
|
|
62
64
|
- src/locales/\\*.ts files
|
|
63
65
|
|
|
64
66
|
### Runtime Verification
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{renderAgentSkill as e}from"./agent-skill.js";import{sdkGuidanceSections as t}from"./sdk-content.js";export const followsCanaryBuilds=e=>!e.useWorkspace&&e.sdkVersion.includes("-develop.");export const generatePhoenixSkill=({checkLatestCanary:n})=>e({name:"phoenix",description:`Phoenix SDK project conventions, covering project structure, architecture principles, key patterns, file and export rules, webhook membership, versioning the domain model once it is deployed, showing the user the dev preview and the build of a deploy, the run evaluation that follows a live deploy, inspecting the rendered result, and how to search the SDK documentation${n?", and the internal-beta check for the latest canary SDK build":""}. Use before writing or changing specs or source code in this Phoenix configurator project.`,sections:[...n?["## Stay on the Latest Canary\nDuring the internal beta this project uses the `canary` build of the SDK, which is published from every change to the platform. Once per conversation, before you change anything, compare the installed version with the newest canary:\n```bash\npnpm list @salsita-ai/sdk --depth 0\nnpm view @salsita-ai/sdk@canary version\n```\nWhen they differ, tell the user which version you are moving to, then update the project and regenerate its files:\n```bash\npnpm add @salsita-ai/sdk@canary\npnpm phoenix sync\n```\n`sync` rewrites the Phoenix skills, so read the ones you use again after it. When the user runs a globally installed `phoenix`, update that too with `npm install -g @salsita-ai/sdk@canary`. If the project no longer builds after the update, stop and tell the user; the `phoenix-feedback` skill covers reporting it."]:[],t.projectStructure,t.architecturePrinciples,t.keyPatterns,t.fileConventions,t.exportRules,t.webhookMembership,t.doNotEdit,t.modelVersioning,"## Show the Preview While You Work\nThe user should see the configurator change as you build it. Before your first change in a conversation, make sure `pnpm phoenix dev` is running (start it in the background when it is not) and open the address it prints as `Preview: <url>` (also written to `.phoenix/phoenix-dev.log`) in the user's browser: `open '<url>'` on macOS, `xdg-open '<url>'` on Linux, `Start-Process '<url>'` in PowerShell, `start \"\" \"<url>\"` in cmd. Keep the quotes, the shell would otherwise read a `?` in the address as a pattern. The log keeps the lines of earlier runs, so when you have just started dev, wait for the `Preview:` line written after your start and use the last one. Open it once; the preview reloads on every change, so tell the user to keep that tab open instead of opening it again.",t.visualInspection,'## Show the Build After a Deploy\n`pnpm phoenix deploy` starts a build on the server and waits for it to go live. Right after `Build <id> started` it prints `Follow the build in Studio: <url>`. Run the deploy so that you can read its output while it runs, and open that link in the user\'s browser, quoted as above, as soon as it appears, so they can follow the build they just triggered. When the line is missing, the sign-in is older than the link: tell the user the build is listed under Deployments in Studio, and that `pnpm phoenix login <workspace>` brings the link back.\n\nWhen the deploy reports the configurator live, load the `phoenix-feedback` skill before you write your final message and follow its "Evaluate the Run" section, so the user is asked about the run while they are still there. It is asked once per conversation, and only once the user has nothing more to build.',"## Code Review\nUse the `phoenix-review` skill to review code changes before committing.",t.sdkDocumentation]});
|
package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generatePhoenixVariantsSkill: () => string;
|
package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{renderAgentSkill as e}from"./agent-skill.js";let t=`## When to Offer Options
|
|
2
|
+
- Offer options when the answer is a matter of taste or brand and the supplied materials do not settle it.
|
|
3
|
+
- Do not offer options for facts (dimensions, prices, rules), for something the user already decided, or to avoid a decision you can make yourself and state.
|
|
4
|
+
- One decision per set, one set open at a time. Vary one thing and keep everything else identical.
|
|
5
|
+
- Usually offer two to four options; the system has no fixed option limit. Original is always available as the captured baseline.
|
|
6
|
+
- Make the options differ in a way the UI or scene can show. Three sheens of one matte wood in soft light look the same.`;export const generatePhoenixVariantsSkill=()=>e({name:"phoenix-variants",description:"Showing the user a few options over the dev preview and getting their pick back, with the phoenix variants command. Use when a visual or interaction decision has several reasonable answers and the taste of the user decides it, such as a shape, a material setting, lighting, an environment, a control or a flow.",sections:[t,"## Choose the Kind of Option\n- Use `<id>.variant.js` to edit real frontend project files on top of one captured baseline. Use `<id>.html` for a standalone branding, layout or flow proposal rendered in an iframe.\n- Use the same mechanism for controls, layout, brand, lights, visuals, materials, positions, components, elements and transformers.\n- Keep the model, schemas, data, assistant server settings, webhooks and code shared with them, dependencies, environment and uploaded assets unchanged. The preview rejects changes needing server preparation.\n- Options reuse the already loaded configurator, one at a time. Variant transactions bypass file-watcher debounce; hot reload still takes time to apply, without a special wait for rendering to settle.",'## Write the Options\n- One folder per set: `.phoenix/variants/<name>/`, one script or HTML file per option. HTML and scripts can share a set, but option ids must be unique. Keep HTML self-contained. This folder survives rebuilds and is never committed.\n- For HTML, set `<title>` and `<meta name="description" content="...">`; choosing a page changes no source files.\n- For scripts, export `title` and `description` as plain string literals, and a default function `({ read, write, remove }) => {}`; it may be async.\n- `read(path)` returns the original baseline file contents. `write(path, contents)` replaces or creates a file; `remove(path)` deletes it. Paths are relative to the project root.\n- Scripts run once per selection in the browser and collect edits. Phoenix validates and writes the whole batch locally; it owns backups and undo. Do not perform your own filesystem or network operations.\n- Supported edits are YAML in `spec/` outside `spec/admin/`, and TypeScript under `src/components`, `transformers`, `handlers`, `elements` and `_`-prefixed shared folders. Expressions, actions and invariants run on the server too, so they cannot be edited.\n- Every option starts from the same baseline. Original restores it; switching restores files the previous option alone changed.\n- Keep the working tree untouched while comparing. Phoenix never overwrites an edit made outside the preview: it refuses to switch options over one, and when the comparison ends it leaves that file as it is and warns in the dev log.\n- Name options in the user\'s product language; explain what changes in one line.','## Run It and Wait\n```bash\npnpm phoenix variants .phoenix/variants/<name> --title \'<the question>\' --description \'<what differs between the options>\'\n```\n- `pnpm phoenix dev` must be running with the preview open in a browser. Tell the user the options are open there.\n- Put the title and the description in single quotes, so the shell passes backticks, `$` and double quotes through unchanged. In bash or zsh, write a single quote inside them as `\'\\\'\'`; in PowerShell, double it instead.\n- The command waits for the answer, 540 seconds unless `--timeout <seconds>` says otherwise, so give it a command timeout longer than that. It prints JSON:\n - `"status": "chosen"` with `choice` (the option id, or `null` for Original) and `label`;\n - `"status": "waiting"` when the wait ran out. The options stay open: run the same command again, or end your turn and run it when the user is back. An answer given in between is returned by the next run;\n - `"status": "closed"` when the preview was closed without an answer.\n- `pnpm phoenix variants --close` closes the open set when you give up on it.\n- `--port <port>` names the editor WebSocket port when `phoenix dev` does not use 3020.\n- The live configurator keeps its current configuration. Interactions still change it; restoring source files does not undo configuration changes.',"## Use the Answer\n- **Chosen:** a script's exact file edits remain in the project. For an HTML choice, implement the selected proposal using the SDK and compare the result with the page. With `choice: null`, the user chose Original and the baseline remains. Verify the result using `pnpm phoenix inspect:scene` and `pnpm phoenix screenshot`, and tell the user anything that came out differently.\n- Record the decision and its reason where the project keeps its decisions, such as `configurator-spec.md`.\n- The user confirms Original or another option; Escape and the backdrop do not close the comparison. The agent can use `--close` to restore baseline source files without an answer. The folder is removed once the user answers. Pass `--keep` when you still need the files to build from, and remove the folder yourself afterwards."]});
|
package/dist/application-spec/generate-application/code/templates/{common → skills}/sdk-content.d.ts
RENAMED
|
@@ -25,6 +25,7 @@ Declarative 3D product configurator built with Phoenix SDK. Domain model defined
|
|
|
25
25
|
readonly projectStructure: `## Project Structure
|
|
26
26
|
- \`spec/\` — Domain YAML specs (entities, relations, expressions, invariants, components, application config)
|
|
27
27
|
- \`src/expressions/\` — Computed/derived entity properties (\`phx.domain.implementCustomExpressions()\`)
|
|
28
|
+
- \`src/actions/\` — Domain operations declared under \`actions:\` in the spec (\`phx.domain.implementActions()\`), run by controls and exposed to the assistant
|
|
28
29
|
- \`src/invariants/\` — Business rule constraints (\`phx.domain.implementCustomInvariants()\`)
|
|
29
30
|
- \`src/transformers/\` — Automatic state fixers (\`phx.frontend.transformerBuilder\`)
|
|
30
31
|
- \`src/components/\` — ECS system components (\`phx.domain.attachComponent.withEntity()\`)
|
|
@@ -35,7 +36,7 @@ Declarative 3D product configurator built with Phoenix SDK. Domain model defined
|
|
|
35
36
|
- \`src/locales/\` — Locale catalogs (authored .po sources; compiled .ts, do not edit)
|
|
36
37
|
- \`src/admin/\` — Admin interface (mirrors main src/ structure)
|
|
37
38
|
- \`src/_shared/\` — Shared utilities (NOT auto-imported, requires explicit imports)
|
|
38
|
-
- \`.phoenix/\` — Auto-generated files (DO NOT EDIT)
|
|
39
|
+
- \`.phoenix/\` — Auto-generated files (DO NOT EDIT, except the option files in \`.phoenix/variants/\`)
|
|
39
40
|
- \`public/\` — Static assets (3D models, textures, images, HDRI maps, fonts)
|
|
40
41
|
- \`assets/\` — Uploadable resources (PDF templates, email assets)`;
|
|
41
42
|
/** The YAML-first, ECS, reactive-state principles a project follows. */
|
|
@@ -48,6 +49,7 @@ Declarative 3D product configurator built with Phoenix SDK. Domain model defined
|
|
|
48
49
|
/** Expressions, invariants, transformers, components, webhooks, and filters at a glance. */
|
|
49
50
|
readonly keyPatterns: `## Key Patterns
|
|
50
51
|
- Expressions = computed properties on entities (prefix: \`$\`), implemented per-entity in src/expressions/
|
|
52
|
+
- Actions = named domain operations (\`actions:\` in YAML with \`params\` and \`result\` schemas), implemented in src/actions/, prepared through \`actionSystem.prepareAction()\` and exposed as assistant mutations through \`assistant.actions\`
|
|
51
53
|
- Invariants = validation rules returning violations, static or dynamic
|
|
52
54
|
- Transformers = auto-fixers maintaining consistency after state changes
|
|
53
55
|
- Components defined in YAML with \`$read\`/\`$bind\` bindings, or custom in src/components/ using attachComponent builder
|
|
@@ -63,7 +65,7 @@ Declarative 3D product configurator built with Phoenix SDK. Domain model defined
|
|
|
63
65
|
- Underscore folders (_shared/, _utils/) are NOT auto-imported`;
|
|
64
66
|
/** The default-export rule of the SDK auto-import system. */
|
|
65
67
|
readonly exportRules: `## Export Rules
|
|
66
|
-
All files in src/expressions/, src/invariants/, src/transformers/, src/components/, src/handlers/, src/webhooks/ MUST use default exports. Can be a single item or an array. Named exports are ignored by the SDK auto-import system.`;
|
|
68
|
+
All files in src/expressions/, src/actions/, src/invariants/, src/transformers/, src/components/, src/handlers/, src/webhooks/ MUST use default exports. Can be a single item or an array. Named exports are ignored by the SDK auto-import system.`;
|
|
67
69
|
/** Which components and handlers are bundled into the webhook. */
|
|
68
70
|
readonly webhookMembership: `## Webhook Membership
|
|
69
71
|
- User-authored components, admin components, and handlers are frontend-only by default.
|
|
@@ -73,9 +75,30 @@ All files in src/expressions/, src/invariants/, src/transformers/, src/component
|
|
|
73
75
|
- Keep browser rendering in an unpinned file. Move shared server-safe logic into a separate module when both frontend and webhook code need it.`;
|
|
74
76
|
/** Generated files a project must not edit. */
|
|
75
77
|
readonly doNotEdit: `## Do Not Edit
|
|
76
|
-
- \`.phoenix/\` directory — completely regenerated on each build
|
|
78
|
+
- \`.phoenix/\` directory — completely regenerated on each build. The one exception is \`.phoenix/variants/\`, where the \`phoenix-variants\` skill has you write option files; a rebuild keeps it
|
|
77
79
|
- \`tsconfig.json\`, \`eslint.config.js\`, \`prettier.config.js\`, \`.prettierignore\`, \`.linguirc\`, \`.nvmrc\`
|
|
78
80
|
- \`src/locales/\` .ts files — compiled from .po files`;
|
|
81
|
+
/** When and how a deployed domain model gets a new version and a migration, with the recipe for replacing the starter. */
|
|
82
|
+
readonly modelVersioning: `## Version the Domain Model Once It Is Deployed
|
|
83
|
+
A deployed model version cannot change, because saved configurations depend on it. \`pnpm phoenix deploy\` is refused, before anything is uploaded, when the model differs from the one already deployed under the same version. The version is not written anywhere: \`model.latest\` is always the highest numbered version plus one, so a spec with only \`latest\` is v1, and \`applicationVersion\` plays no part. \`pnpm phoenix dev\` accepts every model change, so a working preview does not show that the deploy will pass.
|
|
84
|
+
|
|
85
|
+
To change a model that has been deployed as v<N>:
|
|
86
|
+
1. Keep the deployed model, unchanged, as \`model.v<N>\` in the spec. A file of its own, such as \`spec/model-v<N>.yaml\`, keeps \`latest\` readable.
|
|
87
|
+
2. Make the change in \`model.latest\`, which is now v<N+1>.
|
|
88
|
+
3. Add \`src/migrations/v<N+1>.ts\` exporting \`migrateToV<N+1>\`. It receives the saved entities of v<N> and returns entities that are valid in v<N+1>; \`ModelV<N>\` and \`ModelV<N+1>\` are generated global namespaces.
|
|
89
|
+
|
|
90
|
+
The admin model is versioned on its own, under \`src/admin/migrations/\`, with its types in \`AdminV<N>\`.
|
|
91
|
+
|
|
92
|
+
**Replacing the starter.** When the first deployment of the workspace was the starter, its \`Box\` model is v1 in production. When the real model replaces it, keep the starter's model as \`model.v1\` and define the real model in \`latest\`. Configurations saved from the starter are not worth converting, so the migration returns the starting state of the new model, the \`initialDomainEntities\` of its preset, and drops the boxes:
|
|
93
|
+
\`\`\`typescript
|
|
94
|
+
// src/migrations/v2.ts
|
|
95
|
+
import type { Migration } from '@salsita-ai/sdk/domain'
|
|
96
|
+
|
|
97
|
+
export const migrateToV2: Migration<ModelV1.AnyDomainEntity, ModelV2.AnyDomainEntity> = () => [
|
|
98
|
+
// the entities of the new model's preset
|
|
99
|
+
]
|
|
100
|
+
\`\`\`
|
|
101
|
+
An entity of a type the new version no longer has must not stay in the returned state. An entity id starts with its type (\`Box-1\`), so an entity that keeps its data under a new type name needs a new id and every relation pointing at it rewritten. Read \`docs/phoenix/migrations.mdx\` before writing any other migration.`;
|
|
79
102
|
/** How to find and read SDK documentation from the CLI. */
|
|
80
103
|
readonly sdkDocumentation: `## SDK Documentation
|
|
81
104
|
|
|
@@ -217,6 +240,16 @@ Get the current Three.js scene graph as JSON via \`pnpm phoenix inspect:scene\`.
|
|
|
217
240
|
**Tips:** Scene graphs can be large. Pipe through \`head\`/\`tail\` for partial output.
|
|
218
241
|
|
|
219
242
|
**Use cases:** AI agent context, debugging 3D scene layout, inspecting materials and lighting`;
|
|
243
|
+
/** The `variants` command; the `phoenix-variants` skill holds the workflow and the options. */
|
|
244
|
+
readonly variantPreviews: `## Variant Previews
|
|
245
|
+
|
|
246
|
+
Show the user several options over the configurator and get their pick back via \`pnpm phoenix variants .phoenix/variants/<name>\`. Use it when a visual or interaction decision is a matter of the user's taste. Load the \`phoenix-variants\` skill first: it says when to offer options, how to write them and which flags the command takes.
|
|
247
|
+
|
|
248
|
+
**Prerequisites:** same as screenshot (dev server running + browser open)
|
|
249
|
+
|
|
250
|
+
**Input:** a folder below \`.phoenix/variants/\` with one file per option: \`<id>.variant.js\` for a script that edits frontend files from a captured baseline, or \`<id>.html\` for a standalone iframe proposal. A selected HTML proposal is returned for you to implement. Options run one at a time through normal hot reload; Original always restores the baseline; picking an option keeps its edits, and the agent can use \`--close\` to restore the baseline without an answer.
|
|
251
|
+
|
|
252
|
+
**Returns:** JSON with \`status\`: \`chosen\` (with \`choice\`, or \`null\` for Original, and \`label\`), \`waiting\` (the wait ran out and the preview stays open; run the same command again) or \`closed\`.`;
|
|
220
253
|
/** Browser automation setup for agents driving the 3D configurator. */
|
|
221
254
|
readonly playwrightMcpSetup: `## Playwright MCP Setup (for AI agents)
|
|
222
255
|
|
|
@@ -242,4 +275,20 @@ Key flags:
|
|
|
242
275
|
- \`--headed\` — visible browser (required for GPU rendering)
|
|
243
276
|
- \`--use-gl=swiftshader\` — software GPU fallback for environments without a physical GPU
|
|
244
277
|
- \`--enable-webgl\` + \`--ignore-gpu-blocklist\` — ensure WebGL is available`;
|
|
278
|
+
readonly visualInspection: `## Visual inspection
|
|
279
|
+
Apply this whenever a change can alter what the canvas or the interface shows: geometry, materials, scene, layout, controls, or the data behind any of them. When a change cannot affect the rendered result, say so rather than passing over this silently.
|
|
280
|
+
|
|
281
|
+
Rendered appearance is a deliverable, not a side effect. Before presenting any preview, and before reporting work as complete, open the configuration that best represents the product at desktop width, wait for it to finish loading, look at it, and report what you found. Report what you saw, not whether it passed. State the observation each judgement rests on: “nothing floats” is a verdict, “the casters meet the floor and the shadow lies under them” is an observation. A result you have not looked at is unverified, whatever the automated checks say.
|
|
282
|
+
|
|
283
|
+
Inspect and report:
|
|
284
|
+
|
|
285
|
+
1. Geometry. Every part rests on its support. Name where the product meets the ground and confirm its shadow and any selection indicator sit there too. Nothing floats, intersects, or protrudes. Scale and orientation are consistent between parts and match the stated dimensions. Each part is complete and present.
|
|
286
|
+
2. Fidelity. The result matches the client's own photographs, renders, and drawings where supplied. Name any divergence.
|
|
287
|
+
3. Response. Every configurable surface of every part reacts to its control, not only the parts you just changed.
|
|
288
|
+
4. Density. Every decision the user must make is reachable without hunting, and no single property's options dominate the surface holding them.
|
|
289
|
+
5. Loading. How long until a meaningful first frame, and whether anything indicates progress meanwhile.
|
|
290
|
+
|
|
291
|
+
Report defects you are deferring as defects. Do not call work done, verified, or complete while any of the above is unchecked or failing: say which, and recommend fixing now or later.
|
|
292
|
+
|
|
293
|
+
Record the result of each point above in the specification alongside the increment it belongs to, with the viewport you used. An inspection nobody can read afterwards is indistinguishable from one that never happened.`;
|
|
245
294
|
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export const sdkGuidanceSections={projectIntro:`## Phoenix Configurator Project
|
|
2
|
+
|
|
3
|
+
Declarative 3D product configurator built with Phoenix SDK. Domain model defined in YAML, custom logic in TypeScript.`,buildCommands:"## Build Commands\n- `pnpm phoenix build` — Full production build\n- `pnpm phoenix dev` — Development mode with hot reload\n- `pnpm phoenix sync` — Sync generated files without full build",devLogs:"## Dev Logs\n- `pnpm phoenix dev` writes all logs to `.phoenix/phoenix-dev.log`\n- Contains: spec parse errors, build errors, browser runtime errors, file watcher events\n- After making changes, always check the log for errors: `tail -50 .phoenix/phoenix-dev.log` or `grep ERROR .phoenix/phoenix-dev.log`\n- Rotated automatically at 10MB (`.log.1`, `.log.2` are older rotations)",projectStructure:"## Project Structure\n- `spec/` — Domain YAML specs (entities, relations, expressions, invariants, components, application config)\n- `src/expressions/` — Computed/derived entity properties (`phx.domain.implementCustomExpressions()`)\n- `src/actions/` — Domain operations declared under `actions:` in the spec (`phx.domain.implementActions()`), run by controls and exposed to the assistant\n- `src/invariants/` — Business rule constraints (`phx.domain.implementCustomInvariants()`)\n- `src/transformers/` — Automatic state fixers (`phx.frontend.transformerBuilder`)\n- `src/components/` — ECS system components (`phx.domain.attachComponent.withEntity()`)\n- `src/elements/` — Page-level React components (`phx.frontend.createCustomPhoenixLayoutElement()`)\n- `src/handlers/` — Event & lifecycle handlers\n- `src/webhooks/` — Server-side webhook handlers (`phx.webhooks.*Builder`)\n- `src/migrations/` — Schema version migrations (v*.ts)\n- `src/locales/` — Locale catalogs (authored .po sources; compiled .ts, do not edit)\n- `src/admin/` — Admin interface (mirrors main src/ structure)\n- `src/_shared/` — Shared utilities (NOT auto-imported, requires explicit imports)\n- `.phoenix/` — Auto-generated files (DO NOT EDIT, except the option files in `.phoenix/variants/`)\n- `public/` — Static assets (3D models, textures, images, HDRI maps, fonts)\n- `assets/` — Uploadable resources (PDF templates, email assets)",architecturePrinciples:"## Architecture Principles\n- YAML-first: 99% of configuration in spec/*.yaml, custom code is last resort\n- ECS pattern: entities (domain objects) + components (behavior/UI) + systems (SDK runtime)\n- Reactive state: immutable domain state flows through RxJS pipelines\n- Data binding: `$read` (read-only), `$write` (write-only), `$bind` (bidirectional) connect components to domain\n- memoEval: all component implementations must use memoEval for stable object references",keyPatterns:"## Key Patterns\n- Expressions = computed properties on entities (prefix: `$`), implemented per-entity in src/expressions/\n- Actions = named domain operations (`actions:` in YAML with `params` and `result` schemas), implemented in src/actions/, prepared through `actionSystem.prepareAction()` and exposed as assistant mutations through `assistant.actions`\n- Invariants = validation rules returning violations, static or dynamic\n- Transformers = auto-fixers maintaining consistency after state changes\n- Components defined in YAML with `$read`/`$bind` bindings, or custom in src/components/ using attachComponent builder\n- Webhooks = server-side finalization tasks (PDF, email, CSV, image rendering)\n- Filters = contextual component activation via navigationStates, viewStates, modes, selectedEntityIds",fileConventions:`## File Conventions
|
|
4
|
+
- Components: PascalCase (.tsx)
|
|
5
|
+
- Utilities: kebab-case (.ts)
|
|
6
|
+
- Expressions: entity-name.ts
|
|
7
|
+
- Migrations: v*.ts (sequential)
|
|
8
|
+
- Specs: kebab-case.yaml
|
|
9
|
+
- Underscore folders (_shared/, _utils/) are NOT auto-imported`,exportRules:`## Export Rules
|
|
10
|
+
All files in src/expressions/, src/actions/, src/invariants/, src/transformers/, src/components/, src/handlers/, src/webhooks/ MUST use default exports. Can be a single item or an array. Named exports are ignored by the SDK auto-import system.`,webhookMembership:"## Webhook Membership\n- User-authored components, admin components, and handlers are frontend-only by default.\n- A handler that registers `createMapPublishedRevisionDataHandler`, `createMapPublishedChunkedDataHandler`, `createDataRowValidatorHandler`, or `createSheetValidatorHandler` is included in the webhook automatically.\n- To include another component or handler in the webhook, put `'use webhook'` as its first statement (leading comments are allowed).\n- A webhook-included file and its runtime local-import closure must not import browser SDK entrypoints (`application`, `admin`, `configurator`, `editor`, `react`, `ui`) or style/font/image assets. Spec parsing reports the unsafe import and inclusion reason as a diagnostic.\n- Keep browser rendering in an unpinned file. Move shared server-safe logic into a separate module when both frontend and webhook code need it.",doNotEdit:"## Do Not Edit\n- `.phoenix/` directory — completely regenerated on each build. The one exception is `.phoenix/variants/`, where the `phoenix-variants` skill has you write option files; a rebuild keeps it\n- `tsconfig.json`, `eslint.config.js`, `prettier.config.js`, `.prettierignore`, `.linguirc`, `.nvmrc`\n- `src/locales/` .ts files — compiled from .po files",modelVersioning:"## Version the Domain Model Once It Is Deployed\nA deployed model version cannot change, because saved configurations depend on it. `pnpm phoenix deploy` is refused, before anything is uploaded, when the model differs from the one already deployed under the same version. The version is not written anywhere: `model.latest` is always the highest numbered version plus one, so a spec with only `latest` is v1, and `applicationVersion` plays no part. `pnpm phoenix dev` accepts every model change, so a working preview does not show that the deploy will pass.\n\nTo change a model that has been deployed as v<N>:\n1. Keep the deployed model, unchanged, as `model.v<N>` in the spec. A file of its own, such as `spec/model-v<N>.yaml`, keeps `latest` readable.\n2. Make the change in `model.latest`, which is now v<N+1>.\n3. Add `src/migrations/v<N+1>.ts` exporting `migrateToV<N+1>`. It receives the saved entities of v<N> and returns entities that are valid in v<N+1>; `ModelV<N>` and `ModelV<N+1>` are generated global namespaces.\n\nThe admin model is versioned on its own, under `src/admin/migrations/`, with its types in `AdminV<N>`.\n\n**Replacing the starter.** When the first deployment of the workspace was the starter, its `Box` model is v1 in production. When the real model replaces it, keep the starter's model as `model.v1` and define the real model in `latest`. Configurations saved from the starter are not worth converting, so the migration returns the starting state of the new model, the `initialDomainEntities` of its preset, and drops the boxes:\n```typescript\n// src/migrations/v2.ts\nimport type { Migration } from '@salsita-ai/sdk/domain'\n\nexport const migrateToV2: Migration<ModelV1.AnyDomainEntity, ModelV2.AnyDomainEntity> = () => [\n // the entities of the new model's preset\n]\n```\nAn entity of a type the new version no longer has must not stay in the returned state. An entity id starts with its type (`Box-1`), so an entity that keeps its data under a new type name needs a new id and every relation pointing at it rewritten. Read `docs/phoenix/migrations.mdx` before writing any other migration.",sdkDocumentation:'## SDK Documentation\n\nAlways search SDK docs for relevant examples before implementing Phoenix features.\n\n### Commands\n- `pnpm phoenix docs` — Full documentation index with descriptions\n- `pnpm phoenix docs -s <term>` — Search all doc content and metadata (case-insensitive)\n- `pnpm phoenix docs --dir` — Print the absolute docs directory for grep or ripgrep\n- `pnpm phoenix docs -r <path>` — Read specific doc (raw text to stdout)\n- `pnpm phoenix docs -c <category>` — List docs in a category\n- `pnpm phoenix docs -l` — List all doc paths with titles\n\n### Key Docs\n- `docs/phoenix/getting-started.mdx` — Setup, prerequisites, first project\n- `docs/phoenix/quickstart.mdx` — End-to-end tutorial building a configurator\n- `docs/phoenix/domain-model.mdx` — Entities, attributes, relations, specs\n- `docs/phoenix/components.mdx` — ECS pattern, YAML components, custom components\n- `docs/phoenix/project-structure.mdx` — Files, folders, conventions\n- `docs/phoenix/best-practices.mdx` — YAML-first, code patterns, common pitfalls\n- `docs/phoenix/state-management.mdx` — Reactive state, RxJS pipelines, data flow\n- `docs/phoenix/expression-context.mdx` — Expression API, context object, helpers\n- `docs/phoenix/webhooks.mdx` — Server-side finalization workflows\n- `docs/phoenix/finalization.mdx` — Finalization system, PDF/email/CSV generation\n- `docs/phoenix/migrations.mdx` — Schema versioning, migration files\n\n### Agent Workflow\n1. Find relevant docs by content: `pnpm phoenix docs -s \'camera\'`\n2. Read matching doc: `pnpm phoenix docs -r docs/3d-scene/cameras/transitions.mdx`\n3. Search within a doc: `pnpm phoenix docs -r <path> | grep "example"`\n4. Search titles only as a fallback: `pnpm phoenix docs -l | grep "camera"`\n5. Search generated files directly when needed: `grep -rn "camera" "$(pnpm phoenix docs --dir)"`\n6. Browse a topic area: `pnpm phoenix docs -c "Layouts"`',assetInspection:"## 3D Asset Inspection\n\nRun `pnpm phoenix inspect:assets` to discover all glTF/GLB files in `public/` and get a summary table. Use `--file <path>` for detailed single-file inspection.\n\n**When to use:** before writing YAML/code that references objectName, materialsToOverride, morphTargetInfluences, or object positioning.\n\n**What it shows per node:**\n- Name, type (Mesh/Light/Camera/Empty), children\n- Transform: `pos=`, `rot=`, `scale=` (only non-default values shown)\n- Per-node morph targets: `morphs=Width,Height`\n- Bounding box: `bounds=WxHxD` (width x height x depth in meters)\n- Origin placement: `origin=center`, `bottom-center`, `top-center`, `bottom-corner`, etc. with numerical offset\n\n**Use cases:**\n- Find exact node names for `objectName` in scene entity components\n- Find material names for `materialsToOverride`\n- Find morph target names for `morphTargetInfluences`\n- Check model dimensions (bounds) for positioning, dimension indicators, or invariants\n- Check origin placement to understand how models anchor (center vs bottom-center)\n- Use `--json` for programmatic access to all data\n\n**Flags:** `--objects`, `--materials`, `--morphs`, `--animations`, `--json`",screenshotCli:"## Screenshot CLI\n\nCapture 3D canvas screenshots from a running dev server via `pnpm phoenix screenshot`.\n\n**Prerequisites:**\n1. `phoenix dev` must be running (starts the WebSocket server on port 3020)\n2. Configurator must be open in a browser (the browser does the actual rendering)\n\n**Options:**\n- `--output, -o` — Output file path (default: `./screenshot.png`)\n- `--width, -w` — Width in pixels (default: 1920)\n- `--height` — Height in pixels (default: 1080)\n- `--format, -f` — Image format: PNG or JPEG (default: PNG)\n- `--port` — WebSocket server port (default: 3020)\n\n**Example workflow:**\n1. Start dev server: `pnpm phoenix dev`\n2. Open configurator in browser (or via Playwright MCP)\n3. Take screenshot: `pnpm phoenix screenshot -o ./render.png -w 2560 --height 1440`\n\n**Use cases:** visual regression testing, generating product images, debugging 3D renders",inspectState:"## Inspect: State\n\nGet the current editor runtime state as JSON via `pnpm phoenix inspect:state`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` — Output file path (prints to stdout if omitted)\n- `--sections, -s` — Comma-separated: entities, navigation, validation (default: all)\n- `--pretty` — Pretty-print JSON (default: true)\n- `--port` — WebSocket server port (default: 3020)\n\n**Example:** `pnpm phoenix inspect:state -o ./state.json -s entities,navigation`\n\n**Lifecycle status:** Always included in response. Shows which systems are ready:\n- `domainLoaded` — domain data loaded\n- `domainContextReady` — domain context initialized (entities available)\n- `configuratorReady` — 3D configurator initialized\n- `sessionAuthenticated` — session service active\n- `editorMode` — editor mode enabled\n\n**Tips:** Use `--sections` to limit payload size. Pipe through `head`/`tail` for partial output (e.g., `pnpm phoenix inspect:state | head -50`).\n\n**Use cases:** AI agent context, debugging entity state, inspecting navigation/validation",inspectData:`## Inspect: Data
|
|
11
|
+
|
|
12
|
+
Get the current editor context data as JSON via \`pnpm phoenix inspect:data\`.
|
|
13
|
+
|
|
14
|
+
**Prerequisites:** same as screenshot (dev server running + browser open)
|
|
15
|
+
|
|
16
|
+
**Options:**
|
|
17
|
+
- \`--output, -o\` — Output file path (prints to stdout if omitted)
|
|
18
|
+
- \`--pretty\` — Pretty-print JSON (default: true)
|
|
19
|
+
- \`--port\` — WebSocket server port (default: 3020)
|
|
20
|
+
|
|
21
|
+
**Returns:** publishedData, frontendData, backendData, sessionData, accessData, webComponentProperties
|
|
22
|
+
|
|
23
|
+
**Example:** \`pnpm phoenix inspect:data -o ./data.json\`
|
|
24
|
+
|
|
25
|
+
**Tips:** Pipe through \`head\`/\`tail\` for partial output (e.g., \`pnpm phoenix inspect:data | head -30\`).
|
|
26
|
+
|
|
27
|
+
**Use cases:** AI agent context, debugging published/session/access data`,inspectScene:`## Inspect: Scene
|
|
28
|
+
|
|
29
|
+
Get the current Three.js scene graph as JSON via \`pnpm phoenix inspect:scene\`.
|
|
30
|
+
|
|
31
|
+
**Prerequisites:** same as screenshot (dev server running + browser open)
|
|
32
|
+
|
|
33
|
+
**Options:**
|
|
34
|
+
- \`--output, -o\` — Output file path (prints to stdout if omitted)
|
|
35
|
+
- \`--pretty\` — Pretty-print JSON (default: true)
|
|
36
|
+
- \`--port\` — WebSocket server port (default: 3020)
|
|
37
|
+
|
|
38
|
+
**Returns:** Recursive scene tree with per-node: name, type, visible, position, rotation, scale, userData (entityId), and for meshes: geometry name, bounding box, material properties (color, metalness, roughness, opacity, textures), morph target influences. Lights include color, intensity, and type-specific properties.
|
|
39
|
+
|
|
40
|
+
**Example:** \`pnpm phoenix inspect:scene -o ./scene.json\`
|
|
41
|
+
|
|
42
|
+
**Tips:** Scene graphs can be large. Pipe through \`head\`/\`tail\` for partial output.
|
|
43
|
+
|
|
44
|
+
**Use cases:** AI agent context, debugging 3D scene layout, inspecting materials and lighting`,variantPreviews:"## Variant Previews\n\nShow the user several options over the configurator and get their pick back via `pnpm phoenix variants .phoenix/variants/<name>`. Use it when a visual or interaction decision is a matter of the user's taste. Load the `phoenix-variants` skill first: it says when to offer options, how to write them and which flags the command takes.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Input:** a folder below `.phoenix/variants/` with one file per option: `<id>.variant.js` for a script that edits frontend files from a captured baseline, or `<id>.html` for a standalone iframe proposal. A selected HTML proposal is returned for you to implement. Options run one at a time through normal hot reload; Original always restores the baseline; picking an option keeps its edits, and the agent can use `--close` to restore the baseline without an answer.\n\n**Returns:** JSON with `status`: `chosen` (with `choice`, or `null` for Original, and `label`), `waiting` (the wait ran out and the preview stays open; run the same command again) or `closed`.",playwrightMcpSetup:`## Playwright MCP Setup (for AI agents)
|
|
45
|
+
|
|
46
|
+
To interact with the 3D configurator in a browser, Playwright MCP needs GPU-enabled flags for WebGL rendering. Add to \`~/.claude/.mcp.json\`:
|
|
47
|
+
|
|
48
|
+
\`\`\`json
|
|
49
|
+
{
|
|
50
|
+
"mcpServers": {
|
|
51
|
+
"playwright": {
|
|
52
|
+
"command": "npx",
|
|
53
|
+
"args": [
|
|
54
|
+
"@playwright/mcp@latest",
|
|
55
|
+
"--headed",
|
|
56
|
+
"--launch-options",
|
|
57
|
+
"{\\"args\\":[\\"--use-gl=swiftshader\\",\\"--enable-webgl\\",\\"--ignore-gpu-blocklist\\"]}"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
\`\`\`
|
|
63
|
+
|
|
64
|
+
Key flags:
|
|
65
|
+
- \`--headed\` — visible browser (required for GPU rendering)
|
|
66
|
+
- \`--use-gl=swiftshader\` — software GPU fallback for environments without a physical GPU
|
|
67
|
+
- \`--enable-webgl\` + \`--ignore-gpu-blocklist\` — ensure WebGL is available`,visualInspection:`## Visual inspection
|
|
68
|
+
Apply this whenever a change can alter what the canvas or the interface shows: geometry, materials, scene, layout, controls, or the data behind any of them. When a change cannot affect the rendered result, say so rather than passing over this silently.
|
|
69
|
+
|
|
70
|
+
Rendered appearance is a deliverable, not a side effect. Before presenting any preview, and before reporting work as complete, open the configuration that best represents the product at desktop width, wait for it to finish loading, look at it, and report what you found. Report what you saw, not whether it passed. State the observation each judgement rests on: “nothing floats” is a verdict, “the casters meet the floor and the shadow lies under them” is an observation. A result you have not looked at is unverified, whatever the automated checks say.
|
|
71
|
+
|
|
72
|
+
Inspect and report:
|
|
73
|
+
|
|
74
|
+
1. Geometry. Every part rests on its support. Name where the product meets the ground and confirm its shadow and any selection indicator sit there too. Nothing floats, intersects, or protrudes. Scale and orientation are consistent between parts and match the stated dimensions. Each part is complete and present.
|
|
75
|
+
2. Fidelity. The result matches the client's own photographs, renders, and drawings where supplied. Name any divergence.
|
|
76
|
+
3. Response. Every configurable surface of every part reacts to its control, not only the parts you just changed.
|
|
77
|
+
4. Density. Every decision the user must make is reachable without hunting, and no single property's options dominate the surface holding them.
|
|
78
|
+
5. Loading. How long until a meaningful first frame, and whether anything indicates progress meanwhile.
|
|
79
|
+
|
|
80
|
+
Report defects you are deferring as defects. Do not call work done, verified, or complete while any of the above is unchecked or failing: say which, and recommend fixing now or later.
|
|
81
|
+
|
|
82
|
+
Record the result of each point above in the specification alongside the increment it belongs to, with the viewport you used. An inspection nobody can read afterwards is indistinguishable from one that never happened.`};
|
|
@@ -2,6 +2,7 @@ import { Branded } from '@salsita-ai/common/utils';
|
|
|
2
2
|
import type { ImportedTransformer } from '#package/domain';
|
|
3
3
|
import type { RuntimeReferenceStore } from '../../../caching/index.js';
|
|
4
4
|
import type { ApplicationSpec } from '../../../parse-application-files/index.js';
|
|
5
|
+
import { ActionsRuntime } from '../sections/actions-runtime.js';
|
|
5
6
|
import { AssistantRuntime } from '../sections/assistant-runtime.js';
|
|
6
7
|
import { ComponentOptics } from '../sections/component-optic.js';
|
|
7
8
|
import { type ExpressionImplementations, ExpressionRuntime, type InvariantImplementations, type MissingExpression } from '../sections/expression-runtime.js';
|
|
@@ -20,6 +21,7 @@ export type ConfiguratorRuntime = Branded<'ConfiguratorRuntime', {
|
|
|
20
21
|
readonly themeRuntime: ThemeRuntime;
|
|
21
22
|
readonly transformersRuntime: TransformersRuntime;
|
|
22
23
|
readonly assistantRuntime: AssistantRuntime;
|
|
24
|
+
readonly actionsRuntime: ActionsRuntime;
|
|
23
25
|
}>;
|
|
24
26
|
export type ConfiguratorRuntimeResult = {
|
|
25
27
|
readonly ok: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Branded as t}from"@salsita-ai/common/utils";import{AssistantRuntime as e}from"../sections/assistant-runtime.js";import{ComponentOptics as
|
|
1
|
+
import{Branded as t}from"@salsita-ai/common/utils";import{ActionsRuntime as o}from"../sections/actions-runtime.js";import{AssistantRuntime as e}from"../sections/assistant-runtime.js";import{ComponentOptics as r}from"../sections/component-optic.js";import{ExpressionRuntime as s}from"../sections/expression-runtime.js";import{PresetRuntime as i}from"../sections/preset-runtime.js";import{ThemeRuntime as n}from"../sections/theme-runtime.js";import{TransformersRuntime as m}from"../sections/transformers-runtime.js";import{ConfiguratorModelRuntime as u}from"./configurator-model-runtime.js";import{ConfiguratorStatesRuntime as c}from"./states-runtime.js";export const ConfiguratorRuntime=(p,a,f,g,R)=>{let j=u(p.configurator,a),x=s(p.configurator,a,f,"configuratorExpressionRuntime",R);return x.ok?{ok:!0,runtime:t({modelRuntime:j,componentOptics:r(a,{components:p.configurator.components,referenceScope:"configuratorRuntime/componentOptics",modelRuntime:j}),presetRuntime:i(a,{referenceScope:"configuratorRuntime/presetRuntime",presets:p.configurator.presets.presets}),statesRuntime:c(p,a),expressionRuntime:x.runtime,themeRuntime:n(p,a),transformersRuntime:m(p,a,g),assistantRuntime:e(p,a),actionsRuntime:o(p.configurator.actions,a)})}:{ok:!1,missingExpressions:x.missing}};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Branded } from '@salsita-ai/common/utils';
|
|
2
|
+
import type { ActionDefinitions } from '#package/domain';
|
|
3
|
+
import type { RuntimeReferenceStore } from '../../../caching/index.js';
|
|
4
|
+
import type { Actions } from '../../../parse-application-files/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* The declared actions as the runtime spec slice holds them, with change tracking: the definitions
|
|
7
|
+
* are rebuilt only when their declaration changes, so a hot reload of an unrelated section keeps
|
|
8
|
+
* the action system's compiled validators.
|
|
9
|
+
*/
|
|
10
|
+
export type ActionsRuntime = Branded<'ActionsRuntime', {
|
|
11
|
+
readonly definitions: ActionDefinitions;
|
|
12
|
+
readonly changed: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const ActionsRuntime: (actions: Actions, referenceStore: RuntimeReferenceStore) => ActionsRuntime;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import i from"lodash-es/isEqual.js";import{Branded as e}from"@salsita-ai/common/utils";export const ActionsRuntime=(t,n)=>{let o=n.createBuilder("configuratorRuntime/actions",{build:i=>i.definition,getKey:i=>i.definition.name,compare:(e,t)=>i(e.definition,t.definition)}),a=!1,r=new Set,d={};for(let i of t.values()){let e={definition:{name:String(i.name),...void 0===i.description?{}:{description:i.description},params:i.paramsSchema}},t=o.build(e);t.changed&&(a=!0),r.add(o.getKey(e)),d[t.output.name]=t.output}return o.cleanup(r)&&(a=!0),e({definitions:d,changed:a})};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Branded } from '@salsita-ai/common/utils';
|
|
2
|
+
import type { AssistantResolvedManifest } from '#package/domain';
|
|
2
3
|
import type { RuntimeReferenceStore } from '../../../caching/index.js';
|
|
3
|
-
import type { ApplicationSpec
|
|
4
|
-
/**
|
|
4
|
+
import type { ApplicationSpec } from '../../../parse-application-files/index.js';
|
|
5
|
+
/** Resolved assistant manifest with change tracking, carried to the runtime spec on hot reload. */
|
|
5
6
|
export type AssistantRuntime = Branded<'AssistantRuntime', {
|
|
6
|
-
readonly assistant:
|
|
7
|
+
readonly assistant: AssistantResolvedManifest | null;
|
|
7
8
|
readonly changed: boolean;
|
|
8
9
|
}>;
|
|
9
10
|
export declare const AssistantRuntime: (spec: ApplicationSpec, referenceStore: RuntimeReferenceStore) => AssistantRuntime;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import s from"lodash-es/isEqual.js";import{Branded as t}from"@salsita-ai/common/utils";export const AssistantRuntime=(a,i)=>{let
|
|
1
|
+
import s from"lodash-es/isEqual.js";import{Branded as t}from"@salsita-ai/common/utils";export const AssistantRuntime=(a,i)=>{let e=i.createBuilder("assistant",{build:s=>s,getKey:()=>"assistant",compare:(t,a)=>s(t,a)}).build({assistant:a.configurator.assistant?.resolved??null});return t({assistant:e.output.assistant,changed:e.changed})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AssistantRuntime}from"./assistant-runtime.js";export{ComponentOptics}from"./component-optic.js";export{DataRuntime}from"./data-runtime.js";export{ExpressionRuntime}from"./expression-runtime.js";export{PresetRuntime}from"./preset-runtime.js";export{ThemeRuntime}from"./theme-runtime.js";export{TransformersRuntime}from"./transformers-runtime.js";export{evaluateStaticMemoEvalPlan,generateMemoEvalPlanRuntime}from"./generate-memo-eval-plan-runtime.js";export{evaluateReflectionConstants,findReflectionConstants}from"./reflection-constants-runtime.js";
|
|
1
|
+
export{ActionsRuntime}from"./actions-runtime.js";export{AssistantRuntime}from"./assistant-runtime.js";export{ComponentOptics}from"./component-optic.js";export{DataRuntime}from"./data-runtime.js";export{ExpressionRuntime}from"./expression-runtime.js";export{PresetRuntime}from"./preset-runtime.js";export{ThemeRuntime}from"./theme-runtime.js";export{TransformersRuntime}from"./transformers-runtime.js";export{evaluateStaticMemoEvalPlan,generateMemoEvalPlanRuntime}from"./generate-memo-eval-plan-runtime.js";export{evaluateReflectionConstants,findReflectionConstants}from"./reflection-constants-runtime.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./core/index.js";export*from"./caching/index.js";export*from"./errors/index.js";export*from"./generate-application/index.js";export*from"./parse-application-files/index.js";export*from"./webhook-boundary.js";
|
|
1
|
+
export*from"./core/index.js";export*from"./caching/index.js";export*from"./errors/index.js";export*from"./generate-application/index.js";export*from"./parse-application-files/index.js";export*from"./webhook-boundary.js";export*from"./assistant/index.js";
|
|
@@ -3,7 +3,7 @@ import { type RuntimeReferenceStore } from '../../caching/index.js';
|
|
|
3
3
|
import type { ParseContext, RawProjectFiles, TextFile } from '../../core/index.js';
|
|
4
4
|
import { type ModuleAnalysis, type ModuleAnalyzer, type WebhookMembership } from './module-analysis.js';
|
|
5
5
|
/** Known file categories used for path-based sorting. */
|
|
6
|
-
export type FileCategory = 'spec' | 'expressions' | 'handlers' | 'elements' | 'transformers' | 'components' | 'invariants' | 'migrations' | 'adminMigrations' | 'adminExpressions' | 'adminInvariants' | 'adminComponents' | 'adminElements' | 'webhooks' | 'locales' | 'mockTemplates' | 'projectFiles' | 'customCode';
|
|
6
|
+
export type FileCategory = 'spec' | 'expressions' | 'actions' | 'handlers' | 'elements' | 'transformers' | 'components' | 'invariants' | 'migrations' | 'adminMigrations' | 'adminExpressions' | 'adminInvariants' | 'adminComponents' | 'adminElements' | 'webhooks' | 'locales' | 'mockTemplates' | 'projectFiles' | 'customCode';
|
|
7
7
|
/**
|
|
8
8
|
* A text file categorized by path pattern, with dep-aware change tracking.
|
|
9
9
|
*
|
|
@@ -32,6 +32,8 @@ export type CategorizedFiles = Branded<'CategorizedFiles', {
|
|
|
32
32
|
readonly specChanged: boolean;
|
|
33
33
|
readonly expressions: readonly CategorizedFile[];
|
|
34
34
|
readonly expressionsChanged: boolean;
|
|
35
|
+
readonly actions: readonly CategorizedFile[];
|
|
36
|
+
readonly actionsChanged: boolean;
|
|
35
37
|
readonly handlers: readonly CategorizedFile[];
|
|
36
38
|
readonly handlersChanged: boolean;
|
|
37
39
|
readonly elements: readonly CategorizedFile[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"lodash-es/isEqual.js";import{Branded as n}from"@salsita-ai/common/utils";import{computeFileDepHashes as s}from"../../caching/index.js";import{DiagnosticCode as o,diagnosticMessages as a}from"../../errors/index.js";import{findWebhookHandlerRegistration as i}from"./module-analysis.js";import{findWebhookSafetyViolation as t}from"./webhook-safety.js";export const buildProjectFileIndex=e=>new Map([...e.spec,...e.expressions,...e.handlers,...e.elements,...e.transformers,...e.components,...e.invariants,...e.migrations,...e.adminMigrations,...e.adminExpressions,...e.adminInvariants,...e.adminComponents,...e.adminElements,...e.webhooks,...e.locales,...e.mockTemplates,...e.projectFiles,...e.customCode].map(e=>[e.file.name,e]));let r=e=>/\/_[^/]+\//.test(e),m=[{path:"spec/",key:"spec"},{path:"src/admin/expressions/",key:"adminExpressions"},{path:"src/admin/invariants/",key:"adminInvariants"},{path:"src/admin/components/",key:"adminComponents"},{path:"src/admin/elements/",key:"adminElements"},{path:"src/admin/migrations/",key:"adminMigrations"},{path:"src/expressions/",key:"expressions"},{path:"src/handlers/",key:"handlers"},{path:"src/elements/",key:"elements"},{path:"src/transformers/",key:"transformers"},{path:"src/components/",key:"components"},{path:"src/invariants/",key:"invariants"},{path:"src/migrations/",key:"migrations"},{path:"src/webhooks/",key:"webhooks"},{path:"src/locales/",key:"locales"},{path:"mocks/",key:"mockTemplates"}],l=new Set(["package.json",".gitignore","CLAUDE.md",".cursor/rules/phoenix.mdc"]),d=new Set(["migrations","adminMigrations"]),
|
|
1
|
+
import e from"lodash-es/isEqual.js";import{Branded as n}from"@salsita-ai/common/utils";import{computeFileDepHashes as s}from"../../caching/index.js";import{DiagnosticCode as o,diagnosticMessages as a}from"../../errors/index.js";import{findWebhookHandlerRegistration as i}from"./module-analysis.js";import{findWebhookSafetyViolation as t}from"./webhook-safety.js";export const buildProjectFileIndex=e=>new Map([...e.spec,...e.expressions,...e.actions,...e.handlers,...e.elements,...e.transformers,...e.components,...e.invariants,...e.migrations,...e.adminMigrations,...e.adminExpressions,...e.adminInvariants,...e.adminComponents,...e.adminElements,...e.webhooks,...e.locales,...e.mockTemplates,...e.projectFiles,...e.customCode].map(e=>[e.file.name,e]));let r=e=>/\/_[^/]+\//.test(e),m=[{path:"spec/",key:"spec"},{path:"src/admin/expressions/",key:"adminExpressions"},{path:"src/admin/invariants/",key:"adminInvariants"},{path:"src/admin/components/",key:"adminComponents"},{path:"src/admin/elements/",key:"adminElements"},{path:"src/admin/migrations/",key:"adminMigrations"},{path:"src/expressions/",key:"expressions"},{path:"src/actions/",key:"actions"},{path:"src/handlers/",key:"handlers"},{path:"src/elements/",key:"elements"},{path:"src/transformers/",key:"transformers"},{path:"src/components/",key:"components"},{path:"src/invariants/",key:"invariants"},{path:"src/migrations/",key:"migrations"},{path:"src/webhooks/",key:"webhooks"},{path:"src/locales/",key:"locales"},{path:"mocks/",key:"mockTemplates"}],l=new Set(["package.json",".gitignore","CLAUDE.md",".cursor/rules/phoenix.mdc"]),d=new Set(["migrations","adminMigrations"]),c=m.filter(({path:e,key:n})=>e.startsWith("src/")&&d.has(n)),p=(e,n)=>{let s=e.slice(n.length).split("/");return!(s.length<=1)&&s.slice(0,-1).some(e=>!e.startsWith("_"))},h=/\.(ts|tsx|js|jsx)$/,f=(e,n)=>{if("components"===e||"adminComponents"===e)return n.hasUseWebhookDirective?{membership:"pinned",logSuffix:"webhook ('use webhook' directive)"}:{membership:"frontend",logSuffix:"frontend only (no 'use webhook' directive)"};if("handlers"===e){let e=i(n);return void 0!==e?{membership:"named-handler",logSuffix:`webhook (the ${e} registration)`}:n.hasUseWebhookDirective?{membership:"pinned",logSuffix:"webhook ('use webhook' directive)"}:{membership:"frontend",logSuffix:"frontend only (not a named handler or pin)"}}};export const CategorizedFiles=(i,d,g,u)=>{let k={spec:[],expressions:[],actions:[],handlers:[],elements:[],transformers:[],components:[],invariants:[],migrations:[],adminMigrations:[],adminExpressions:[],adminInvariants:[],adminComponents:[],adminElements:[],webhooks:[],locales:[],mockTemplates:[],projectFiles:[],customCode:[]},b=[];for(let e of i.files){if("text"!==e.kind)continue;if(r(e.name)){k.customCode.push({file:e,category:"customCode"});continue}if(l.has(e.name)){k.projectFiles.push({file:e,category:"projectFiles"});continue}let n=!1;for(let{path:s,key:o}of m)if(e.name.startsWith(s)){k[o].push({file:e,category:o}),n=!0;break}n||b.push(e.name)}for(let e of b)e.startsWith("src/")&&g.error(o.UNKNOWN_SRC_PATH,a.UNKNOWN_SRC_PATH(e));for(let{path:e,key:n}of c)for(let s of k[n])p(s.file.name,e)&&g.error(o.INVALID_SUBDIRECTORY,a.INVALID_SUBDIRECTORY(s.file.name,e));if(k.webhooks.length>0&&!k.webhooks.some(e=>"src/webhooks/index.ts"===e.file.name)&&g.error(o.MISSING_WEBHOOK_INDEX,a.MISSING_WEBHOOK_INDEX()),g.hasErrors)return;let C=[];for(let e of Object.values(k))for(let n of e)C.push(n.file.name);let v=s(i,C),{analyzer:x,logger:y}=u,E=d.createBuilder("categorizedFiles/moduleAnalysis",{build:e=>{try{return{analysis:x(e.name,e.content)}}catch(e){return{error:e instanceof Error?e.message:String(e)}}},getKey:e=>e.name,compare:(e,n)=>e.content===n.content}),I=new Set,w=e=>{if(!h.test(e.name))return;I.add(e.name);let n=E.build({name:e.name,content:e.content}).output;return void 0!==n.error?void g.error(o.MODULE_ANALYSIS_FAILED,a[o.MODULE_ANALYSIS_FAILED](e.name,n.error)):n.analysis},S={},j={};for(let[e,s]of Object.entries(k)){let o=d.createBuilder(`categorizedFiles/${e}`,{build:e=>e,getKey:e=>e.name,compare:(e,n)=>e.depHash===n.depHash}),a=new Set;S[e]=s.map(e=>{let s=v[e.file.name]??{deps:[],hash:""},{changed:i}=o.build({name:e.file.name,depHash:s.hash});a.add(e.file.name);let t=w(e.file),r=void 0===t?void 0:f(e.category,t);return void 0!==r&&y.debug(`Webhook membership: ${e.file.name} -> ${r.logSuffix}`),n({file:e.file,category:e.category,deps:s.deps,depHash:s.hash,changed:i,analysis:t,webhookMembership:r?.membership})}),j[e]=o.cleanup(a)}E.cleanup(I);let _=(e,n)=>n.some(e=>e.changed)||!0===j[e],F=d.createBuilder("categorizedFiles/envs",{build:e=>e.envs,getKey:()=>"singleton",compare:(n,s)=>e(n.envs,s.envs)}).build({envs:i.envs}),M=n({spec:S.spec,specChanged:_("spec",S.spec),expressions:S.expressions,expressionsChanged:_("expressions",S.expressions),actions:S.actions,actionsChanged:_("actions",S.actions),handlers:S.handlers,handlersChanged:_("handlers",S.handlers),elements:S.elements,elementsChanged:_("elements",S.elements),transformers:S.transformers,transformersChanged:_("transformers",S.transformers),components:S.components,componentsChanged:_("components",S.components),invariants:S.invariants,invariantsChanged:_("invariants",S.invariants),migrations:S.migrations,migrationsChanged:_("migrations",S.migrations),adminMigrations:S.adminMigrations,adminMigrationsChanged:_("adminMigrations",S.adminMigrations),adminExpressions:S.adminExpressions,adminExpressionsChanged:_("adminExpressions",S.adminExpressions),adminInvariants:S.adminInvariants,adminInvariantsChanged:_("adminInvariants",S.adminInvariants),adminComponents:S.adminComponents,adminComponentsChanged:_("adminComponents",S.adminComponents),adminElements:S.adminElements,adminElementsChanged:_("adminElements",S.adminElements),webhooks:S.webhooks,webhooksChanged:_("webhooks",S.webhooks),locales:S.locales,localesChanged:_("locales",S.locales),mockTemplates:S.mockTemplates,mockTemplatesChanged:_("mockTemplates",S.mockTemplates),projectFiles:S.projectFiles,projectFilesChanged:_("projectFiles",S.projectFiles),customCode:S.customCode,customCodeChanged:_("customCode",S.customCode),envs:F.output,envsChanged:F.changed}),O=buildProjectFileIndex(M);for(let e of O.values()){if("pinned"!==e.webhookMembership&&"named-handler"!==e.webhookMembership)continue;let n=t(e,O);void 0!==n&&g.error(o.WEBHOOK_UNSAFE_IMPORT,a[o.WEBHOOK_UNSAFE_IMPORT](n.fileName,n.inclusionReason,n.importer,n.specifier))}return M};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./classified-spec-file.js";export*from"./merged-admin-components.js";export*from"./merged-admin-expressions.js";export*from"./merged-admin-invariants.js";export*from"./merged-admin-states.js";export*from"./merged-admin-model.js";export*from"./merged-components.js";export*from"./merged-configurator-states.js";export*from"./merged-defaults.js";export*from"./merged-model.js";export*from"./merged-admin-pages.js";export*from"./merged-admin-presets.js";export*from"./merged-admin-relations.js";export*from"./merged-assistant.js";export*from"./merged-budgets.js";export*from"./merged-data-schemas.js";export*from"./merged-data-spec.js";export*from"./merged-expressions.js";export*from"./merged-presets.js";export*from"./merged-relations.js";export*from"./merged-spec.js";export*from"./merged-theme.js";export*from"./merged-ui.js";export*from"./merged-transformers.js";export*from"./merged-app-metadata.js";export*from"./merged-infra.js";export*from"./merged-invariants.js";export*from"./merged-chunks.js";
|
|
1
|
+
export*from"./classified-spec-file.js";export*from"./merged-actions.js";export*from"./merged-admin-components.js";export*from"./merged-admin-expressions.js";export*from"./merged-admin-invariants.js";export*from"./merged-admin-states.js";export*from"./merged-admin-model.js";export*from"./merged-components.js";export*from"./merged-configurator-states.js";export*from"./merged-defaults.js";export*from"./merged-model.js";export*from"./merged-admin-pages.js";export*from"./merged-admin-presets.js";export*from"./merged-admin-relations.js";export*from"./merged-assistant.js";export*from"./merged-budgets.js";export*from"./merged-data-schemas.js";export*from"./merged-data-spec.js";export*from"./merged-expressions.js";export*from"./merged-presets.js";export*from"./merged-relations.js";export*from"./merged-spec.js";export*from"./merged-theme.js";export*from"./merged-ui.js";export*from"./merged-transformers.js";export*from"./merged-app-metadata.js";export*from"./merged-infra.js";export*from"./merged-invariants.js";export*from"./merged-chunks.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Branded } from '@salsita-ai/common/utils';
|
|
2
|
+
import type { ParseContext } from '../../core/index.js';
|
|
3
|
+
import type { RawActions } from '../raw-spec/index.js';
|
|
4
|
+
import type { ClassifiedSpecFile } from './classified-spec-file.js';
|
|
5
|
+
/**
|
|
6
|
+
* Merged actions from all spec files; an action name declared in two files is a merge conflict.
|
|
7
|
+
* Actions belong to the configurator domain, so an `actions` block in an admin spec file is reported
|
|
8
|
+
* rather than merged.
|
|
9
|
+
*/
|
|
10
|
+
export type MergedActions = Branded<'MergedActions', RawActions>;
|
|
11
|
+
export declare const MergedActions: (files: readonly ClassifiedSpecFile[], ctx: ParseContext) => MergedActions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Branded as e}from"@salsita-ai/common/utils";import{DiagnosticCode as n,diagnosticMessages as o}from"../../errors/index.js";export const MergedActions=(t,i)=>{let r={},a={};for(let e of t)if(e.content.actions){if(e.isAdmin){i.inFile(e.name).at("actions").error(n.ACTIONS_IN_ADMIN_FILE,o.ACTIONS_IN_ADMIN_FILE(e.name));continue}for(let[n,o]of Object.entries(e.content.actions)){let t=a[n];if(t){i.error("MERGE_CONFLICT",`Action "${n}" is declared in both "${t}" and "${e.name}". Each action can only be declared once. Keep one declaration and remove the other.`);continue}r[n]=o,a[n]=e.name}}return e(r)};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Branded } from '@salsita-ai/common/utils';
|
|
2
2
|
import type { ParseContext } from '../../core/index.js';
|
|
3
3
|
import type { ResolvedSpecFiles } from '../resolve/index.js';
|
|
4
|
+
import { MergedActions } from './merged-actions.js';
|
|
4
5
|
import { MergedAdminPages } from './merged-admin-pages.js';
|
|
5
6
|
import { MergedAdminStates } from './merged-admin-states.js';
|
|
6
7
|
import { MergedAppMetadata } from './merged-app-metadata.js';
|
|
@@ -31,6 +32,7 @@ export type MergedSpec = Branded<'MergedSpec', {
|
|
|
31
32
|
readonly adminPages: MergedAdminPages;
|
|
32
33
|
readonly expressions: MergedExpressions;
|
|
33
34
|
readonly adminExpressions: MergedExpressions;
|
|
35
|
+
readonly actions: MergedActions;
|
|
34
36
|
readonly invariants: MergedInvariants;
|
|
35
37
|
readonly adminInvariants: MergedInvariants;
|
|
36
38
|
readonly relations: MergedRelations;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Branded as e}from"@salsita-ai/common/utils";import{classifySpecFile as r}from"./classified-spec-file.js";import{
|
|
1
|
+
import{Branded as e}from"@salsita-ai/common/utils";import{classifySpecFile as r}from"./classified-spec-file.js";import{MergedActions as m}from"./merged-actions.js";import{MergedAdminComponents as o}from"./merged-admin-components.js";import{MergedAdminExpressions as s}from"./merged-admin-expressions.js";import{MergedAdminInvariants as t}from"./merged-admin-invariants.js";import{MergedAdminModel as i}from"./merged-admin-model.js";import{MergedAdminPages as d}from"./merged-admin-pages.js";import{MergedAdminPresets as p}from"./merged-admin-presets.js";import{MergedAdminRelations as a}from"./merged-admin-relations.js";import{MergedAdminStates as n}from"./merged-admin-states.js";import{MergedAppMetadata as g}from"./merged-app-metadata.js";import{MergedAssistant as f}from"./merged-assistant.js";import{MergedBudgets as j}from"./merged-budgets.js";import{MergedChunks as l}from"./merged-chunks.js";import{MergedComponents as c}from"./merged-components.js";import{MergedConfiguratorStates as M}from"./merged-configurator-states.js";import{MergedDataSchemas as S}from"./merged-data-schemas.js";import{MergedDataSpec as u}from"./merged-data-spec.js";import{MergedDefaults as h}from"./merged-defaults.js";import{MergedExpressions as A}from"./merged-expressions.js";import{MergedInfra as x}from"./merged-infra.js";import{MergedInvariants as k}from"./merged-invariants.js";import{MergedModel as v}from"./merged-model.js";import{MergedPresets as C}from"./merged-presets.js";import{MergedRelations as b}from"./merged-relations.js";import{MergedTheme as q}from"./merged-theme.js";import{MergedTransformers as w}from"./merged-transformers.js";import{MergedUi as y}from"./merged-ui.js";export const MergedSpec=(z,B)=>{let D=z.map(e=>r(e)),E=D.filter(e=>!e.isAdmin),F=D.filter(e=>e.isAdmin),G=B.startSpan("MergedModel","MergedSpec","merged-model.ts"),H=v(E,B);G();let I=B.startSpan("MergedAdminModel","MergedSpec","merged-admin-model.ts"),J=i(F,B);I();let K=B.startSpan("MergedComponents","MergedSpec","merged-components.ts"),L=c(E,B);K();let N=B.startSpan("MergedAdminComponents","MergedSpec","merged-admin-components.ts"),O=o(F,B);N();let P=C(E),Q=p(F,B),R=d(F,B),T=A(E,B),U=s(F,B),V=m(D,B),W=k(E,B),X=t(F,B),Y=b(E,B),Z=a(F,B),$=h(E,B),_=h(F,B),ee=S(D,B),er=u(D,B),em=M(E,B),eo=n(F,B),es=q(D,B),et=y(D,B),ei=w(D,B),ed=g(D,B),ep=x(D,B),ea=j(D,B);return e({model:H,adminModel:J,components:L,adminComponents:O,presets:P,adminPresets:Q,adminPages:R,expressions:T,adminExpressions:U,actions:V,invariants:W,adminInvariants:X,relations:Y,adminRelations:Z,defaults:$,adminDefaults:_,dataSchemas:ee,dataSpec:er,configuratorStates:em,adminStates:eo,theme:es,ui:et,transformers:ei,appMetadata:ed,infra:ep,budgets:ea,chunks:l(D,B),assistant:f(D,B)})};
|