@salsita-ai/sdk 0.50.0-develop.aec0f535bf → 0.50.0-develop.af031dec0f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -3
- package/dist/application-spec/errors/diagnostic-codes.d.ts +6 -0
- package/dist/application-spec/errors/diagnostic-codes.js +1 -1
- package/dist/application-spec/errors/diagnostic-messages.d.ts +7 -1
- package/dist/application-spec/errors/diagnostic-messages.js +1 -1
- package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
- package/dist/application-spec/generate-application/code/standalone-app-files.js +1 -1
- package/dist/application-spec/generate-application/code/templates/admin-config.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/admin-config.js +3 -2
- package/dist/application-spec/generate-application/code/templates/configurator-config.js +4 -2
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js +6 -8
- package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.js +8 -6
- package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.d.ts +1 -4
- package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.js +2 -2
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +26 -29
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +0 -3
- package/dist/application-spec/generate-application/code/templates/domain.js +3 -3
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +11 -12
- package/dist/application-spec/generate-application/code/templates/skills/core/cli.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/core/sdk.js +3 -2
- package/dist/application-spec/generate-application/code/templates/skills/core/workflow.js +13 -11
- package/dist/application-spec/generate-application/code/templates/skills/features/application-states/views-and-tools.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/assistant/index.d.ts +3 -0
- package/dist/application-spec/generate-application/code/templates/skills/features/assistant/index.js +1 -0
- package/dist/application-spec/generate-application/code/templates/skills/features/assistant/panel.d.ts +3 -0
- package/dist/application-spec/generate-application/code/templates/skills/features/assistant/panel.js +16 -0
- package/dist/application-spec/generate-application/code/templates/skills/features/assistant/reading-and-changing.d.ts +3 -0
- package/dist/application-spec/generate-application/code/templates/skills/features/assistant/reading-and-changing.js +47 -0
- package/dist/application-spec/generate-application/code/templates/skills/features/{webhooks/assistant-setup.d.ts → assistant/session-setup.d.ts} +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/assistant/session-setup.js +15 -0
- package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/custom-layout.js +3 -3
- package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/pages.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/pages.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/domain-controls/custom-controls.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/domain-controls/scene-controls.js +4 -2
- package/dist/application-spec/generate-application/code/templates/skills/features/domain-model/actions.js +3 -3
- package/dist/application-spec/generate-application/code/templates/skills/features/domain-model/expressions.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/features.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/state/violations.js +2 -2
- package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/authentication.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/entry-and-environment.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/webhooks.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/guide.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +3 -3
- package/dist/application-spec/generate-application/code/templates/skills/processes/asset-conversion.js +3 -3
- package/dist/application-spec/generate-application/code/templates/skills/processes/assistant-configuration.d.ts +3 -0
- package/dist/application-spec/generate-application/code/templates/skills/processes/assistant-configuration.js +23 -0
- package/dist/application-spec/generate-application/code/templates/skills/processes/feedback/report.js +29 -1
- package/dist/application-spec/generate-application/code/templates/skills/processes/finalization.js +2 -2
- package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/build.js +29 -15
- package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/direction.js +17 -14
- package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/first-draft.js +2 -2
- package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/handoff.js +3 -3
- package/dist/application-spec/generate-application/code/templates/skills/processes/index.d.ts +2 -0
- package/dist/application-spec/generate-application/code/templates/skills/processes/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/processes/model-migration.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/processes/review/appearance.js +2 -2
- package/dist/application-spec/generate-application/code/templates/skills/processes/review/code.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/processes/review/review.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/processes/review/visual-inspection.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/processes/scene-realism.d.ts +2 -0
- package/dist/application-spec/generate-application/code/templates/skills/processes/scene-realism.js +29 -0
- package/dist/application-spec/generate-application/code/templates/skills/processes/specification/product-definition.js +2 -0
- package/dist/application-spec/generate-application/code/templates/skills/processes/specification/specification.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-specification.d.ts +2 -0
- package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-specification.js +28 -0
- package/dist/application-spec/generate-application/code/templates/webhook-builders.js +7 -6
- package/dist/application-spec/generate-application/code/templates/webhook-index.d.ts +2 -1
- package/dist/application-spec/generate-application/code/templates/webhook-index.js +2 -2
- package/dist/application-spec/parse-application-files/merge/merged-app-metadata.d.ts +1 -0
- package/dist/application-spec/parse-application-files/merge/merged-app-metadata.js +1 -1
- package/dist/application-spec/parse-application-files/merge/merged-assistant.js +1 -1
- package/dist/application-spec/parse-application-files/parse-application-files.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +42 -5
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.d.ts +4 -3
- package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.js +1 -1
- package/dist/application-spec/parse-application-files/spec/model/session-data-schema.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/app-metadata.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +2 -2
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-server-settings.d.ts +5 -6
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-server-settings.js +1 -1
- package/dist/application-spec/webhook-boundary.js +1 -1
- package/dist/client/cli-client/cli-api-client.d.ts +17 -0
- package/dist/client/cli-client/cli-api-client.js +1 -0
- package/dist/client/cli-client/index.d.ts +2 -0
- package/dist/client/cli-client/index.js +1 -0
- package/dist/client/cli-client/unsupported-api-version-error.d.ts +11 -0
- package/dist/client/cli-client/unsupported-api-version-error.js +1 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +1 -1
- package/dist/client/phoenix-api.d.ts +5290 -1754
- package/dist/configurator/ConfiguratorApp.js +1 -1
- package/dist/configurator/application-runtime/extensions/configurator-extension-systems.d.ts +5 -4
- package/dist/configurator/application-runtime/extensions/configurator-extension-systems.js +1 -1
- package/dist/configurator/application-runtime/extensions/create-configurator-extensions.js +1 -1
- package/dist/configurator/application-runtime/extensions/selectors.d.ts +4 -2
- package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/action-system/action-context.d.ts +14 -0
- package/dist/configurator/application-runtime/extensions/systems/action-system/action-factory.d.ts +13 -0
- package/dist/configurator/application-runtime/extensions/systems/action-system/action-system.d.ts +55 -0
- package/dist/configurator/application-runtime/extensions/systems/action-system/action-system.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/action-system/action.d.ts +44 -0
- package/dist/configurator/application-runtime/extensions/systems/action-system/action.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/action-system/index.d.ts +6 -0
- package/dist/configurator/application-runtime/extensions/systems/action-system/index.js +1 -0
- package/dist/{domain/domain-runtime/spec → configurator/application-runtime/extensions/systems/action-system}/prepare-action-implementations.d.ts +4 -3
- package/dist/{domain/domain-runtime/spec → configurator/application-runtime/extensions/systems/action-system}/prepare-action-implementations.js +2 -2
- package/dist/{domain/spec/modules → configurator/application-runtime/extensions/systems/action-system}/resolve-action-modules.d.ts +2 -2
- package/dist/configurator/application-runtime/extensions/systems/action-system/resolve-action-modules.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-annotation.d.ts +7 -4
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +91 -33
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/composer-attachments.d.ts +12 -17
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/composer-attachments.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +43 -37
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/index.d.ts +2 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/index.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/register-webmcp-tools.d.ts +29 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/register-webmcp-tools.js +2 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/to-webmcp-result.d.ts +10 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/to-webmcp-result.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.d.ts +41 -35
- package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.d.ts +14 -4
- package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +8 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +38 -9
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/is-offered-for-selection.d.ts +16 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/is-offered-for-selection.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/read-offered-navigation.d.ts +26 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/read-offered-navigation.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.d.ts +25 -8
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/index.d.ts +5 -4
- package/dist/configurator/application-runtime/extensions/systems/index.js +1 -1
- package/dist/configurator/application-runtime/hooks/use-configurator.d.ts +3 -3
- package/dist/configurator/common/configurator-interface.d.ts +9 -7
- package/dist/configurator/common/configurator-interface.js +1 -1
- package/dist/configurator/scene/cameras/CameraPadding.d.ts +5 -0
- package/dist/configurator/scene/cameras/CameraPadding.js +1 -1
- package/dist/configurator/ui/assistant/AssistantChips.d.ts +5 -5
- package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
- package/dist/configurator/ui/assistant/AssistantComposer.d.ts +4 -3
- package/dist/configurator/ui/assistant/AssistantComposer.js +1 -1
- package/dist/configurator/ui/assistant/AssistantPanel.d.ts +6 -4
- package/dist/configurator/ui/assistant/AssistantThread.d.ts +10 -2
- package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
- package/dist/configurator/ui/assistant/annotation/AnnotationViewer.js +1 -1
- package/dist/configurator/ui/assistant/annotation/MessageAnnotations.js +1 -1
- package/dist/configurator/ui/assistant/annotation/editor/AnnotationComment.d.ts +6 -5
- package/dist/configurator/ui/assistant/annotation/editor/AnnotationComment.js +1 -1
- package/dist/configurator/ui/assistant/annotation/editor/AnnotationEditor.d.ts +6 -5
- package/dist/configurator/ui/assistant/annotation/editor/AnnotationEditor.js +1 -1
- package/dist/configurator/ui/assistant/annotation/editor/annotation-pins.d.ts +5 -0
- package/dist/configurator/ui/assistant/annotation/editor/annotation-pins.js +1 -1
- package/dist/configurator/ui/assistant/annotation/index.d.ts +0 -1
- package/dist/configurator/ui/assistant/annotation/index.js +1 -1
- package/dist/configurator/ui/assistant/assistant-failure.d.ts +6 -4
- package/dist/configurator/ui/assistant/assistant-failure.js +1 -1
- package/dist/configurator/ui/assistant/attachments/MessageImages.js +1 -1
- package/dist/configurator/ui/assistant/drawing/AssistantDrawing.d.ts +1 -1
- package/dist/configurator/ui/assistant/drawing/AssistantDrawing.js +1 -1
- package/dist/configurator/ui/assistant/drawing/index.d.ts +1 -1
- package/dist/configurator/ui/assistant/drawing/index.js +1 -1
- package/dist/configurator/ui/assistant/drawing/parse-drawing.js +1 -1
- package/dist/configurator/ui/assistant/drawing/use-drawing-url.d.ts +6 -12
- package/dist/configurator/ui/assistant/drawing/use-drawing-url.js +1 -1
- package/dist/configurator/ui/assistant/form/AssistantForm.d.ts +1 -1
- package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -1
- package/dist/configurator/ui/assistant/form/form-model.d.ts +9 -0
- package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +6 -5
- package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -1
- package/dist/configurator/ui/assistant/form/read-form-tile.d.ts +8 -0
- package/dist/configurator/ui/assistant/form/read-form-tile.js +1 -0
- package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.d.ts +6 -3
- package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.js +1 -1
- package/dist/configurator/ui/assistant/form/registry/form-registry.d.ts +1 -1
- package/dist/configurator/ui/assistant/form/registry/form-registry.js +1 -1
- package/dist/configurator/ui/assistant/form/split-form-rows.d.ts +7 -0
- package/dist/configurator/ui/assistant/form/split-form-rows.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +7 -4
- package/dist/configurator/ui/assistant/form-elements/FormOptions.js +1 -1
- package/dist/configurator/ui/assistant/form-elements/FormTile.d.ts +72 -0
- package/dist/configurator/ui/assistant/form-elements/FormTile.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +27 -0
- package/dist/configurator/ui/assistant/form-elements/index.d.ts +2 -3
- package/dist/configurator/ui/assistant/form-elements/index.js +1 -1
- package/dist/configurator/ui/assistant/image-view/ImageView.js +1 -1
- package/dist/configurator/ui/assistant/index.d.ts +2 -2
- package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.d.ts +4 -1
- package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.js +1 -1
- package/dist/configurator/ui/assistant/reference-link/index.d.ts +2 -1
- package/dist/configurator/ui/assistant/reference-link/index.js +1 -1
- package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -1
- package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +2 -6
- package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -1
- package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +5 -6
- package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -1
- package/dist/configurator/ui/assistant/thread-items.d.ts +2 -2
- package/dist/configurator/ui/assistant/thread-items.js +1 -1
- package/dist/configurator/ui/assistant/use-assistant-composer.d.ts +2 -1
- package/dist/configurator/ui/assistant/use-assistant-composer.js +2 -2
- package/dist/configurator/ui/assistant/use-assistant-thread.d.ts +15 -1
- package/dist/configurator/ui/assistant/use-assistant-thread.js +1 -1
- package/dist/configurator/ui/assistant/use-load-older-on-top.d.ts +3 -3
- package/dist/configurator/ui/assistant/use-load-older-on-top.js +1 -1
- package/dist/configurator/ui/assistant/{annotation/use-end-on-unmount.d.ts → use-on-unmount.d.ts} +1 -1
- package/dist/configurator/ui/assistant/use-on-unmount.js +1 -0
- package/dist/configurator/ui/configurator-layout/index.d.ts +1 -1
- package/dist/configurator/ui/configurator-layout/index.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/canvas/LayoutCanvas.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/DesktopSidebar.js +4 -4
- package/dist/configurator/ui/configurator-layout/slots/index.d.ts +2 -0
- package/dist/configurator/ui/configurator-layout/slots/index.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/view-controls/DesktopViewControls.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/view-controls/MobileViewControls.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/view-controls/NestedViewControls.d.ts +7 -0
- package/dist/configurator/ui/configurator-layout/slots/view-controls/NestedViewControls.js +1 -0
- package/dist/configurator/ui/configurator-layout/slots/view-controls/use-view-control-items.d.ts +6 -0
- package/dist/configurator/ui/configurator-layout/slots/view-controls/use-view-control-items.js +1 -0
- package/dist/configurator/ui/configurator-layout/universal/DesktopPreview.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +3 -3
- package/dist/configurator/ui/configurator-layout/universal/MobilePreview.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/use-preview-description.d.ts +1 -0
- package/dist/configurator/ui/configurator-layout/universal/use-preview-description.js +1 -0
- package/dist/configurator/ui/index.d.ts +1 -1
- package/dist/configurator/ui/legacy/layout/common/ViewControls.js +1 -1
- package/dist/docs/index.json +22 -2
- package/dist/docs/layouts/nested-view-controls.mdx +223 -0
- package/dist/docs/layouts/presets/custom.mdx +1 -0
- package/dist/docs/layouts/preview/always.mdx +22 -0
- package/dist/docs/layouts/view-controls.mdx +2 -0
- package/dist/docs/other-features/domain-actions.mdx +10 -11
- package/dist/docs/other-features/violation-messages.mdx +3 -1
- package/dist/docs/phoenix/application-states.mdx +1 -1
- package/dist/docs/phoenix/configurator-interface.mdx +81 -35
- package/dist/docs/phoenix/data-sources.mdx +1 -1
- package/dist/docs/phoenix/getting-started.mdx +1 -1
- package/dist/docs/phoenix/layout-slots.mdx +1 -1
- package/dist/docs/phoenix/migrations.mdx +1 -1
- package/dist/docs/phoenix/phoenix-cli.mdx +89 -53
- package/dist/docs/phoenix/project-structure.mdx +7 -7
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +56 -27
- package/dist/docs/phoenix/sessions-and-access.mdx +9 -6
- package/dist/docs/phoenix/theming.mdx +5 -9
- package/dist/docs/phoenix/webhooks.mdx +55 -3
- package/dist/docs/ux-guidelines/choosing-navigation.mdx +2 -0
- package/dist/docs/ux-guidelines/designing-the-configuration-journey.mdx +43 -0
- package/dist/docs/ux-guidelines/interaction-modes.mdx +2 -2
- package/dist/docs/ux-guidelines/overview.mdx +11 -9
- package/dist/domain/application/application-config.d.ts +5 -0
- package/dist/domain/application/assistant/assistant-exposure.d.ts +22 -0
- package/dist/domain/application/assistant/assistant-exposure.js +1 -0
- package/dist/domain/application/assistant/assistant-selection.d.ts +30 -0
- package/dist/domain/application/assistant/assistant-selection.js +1 -0
- package/dist/domain/application/assistant/build-assistant-lenses.js +4 -4
- package/dist/domain/application/assistant/build-assistant-manifest.d.ts +2 -2
- package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
- package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +14 -2
- package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
- package/dist/domain/application/assistant/index.d.ts +5 -1
- package/dist/domain/application/assistant/index.js +1 -1
- package/dist/domain/application/assistant/prepare-assistant-navigation-updates.d.ts +16 -0
- package/dist/domain/application/assistant/prepare-assistant-navigation-updates.js +1 -0
- package/dist/domain/application/assistant/read-assistant-navigation.d.ts +40 -0
- package/dist/domain/application/assistant/read-assistant-navigation.js +1 -0
- package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +17 -1
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
- package/dist/domain/application/assistant-field-options.d.ts +2 -0
- package/dist/domain/application/assistant-field-options.js +1 -1
- package/dist/domain/application/assistant-mutations.d.ts +17 -11
- package/dist/domain/application/assistant-mutations.js +1 -1
- package/dist/domain/application/assistant-recipe-groups.d.ts +4 -3
- package/dist/domain/application/assistant-recipe-groups.js +1 -1
- package/dist/domain/application/configurator-builder.d.ts +8 -0
- package/dist/domain/application/configurator-builder.js +1 -1
- package/dist/domain/available-system-components/available-system-components.d.ts +1 -1
- package/dist/domain/available-system-components/available-system-components.js +1 -1
- package/dist/domain/core/action/action.d.ts +0 -49
- package/dist/domain/core/component/system-component-filter.d.ts +1 -0
- package/dist/domain/core/component/system-component-filter.js +1 -1
- package/dist/domain/core/component/view-state-component.d.ts +4 -3
- package/dist/domain/core/component/view-state-component.js +1 -1
- package/dist/domain/core/domain-factory.d.ts +2 -3
- package/dist/domain/core/invariant/control-violation-hints.d.ts +37 -0
- package/dist/domain/core/invariant/control-violation-hints.js +1 -0
- package/dist/domain/core/invariant/index.d.ts +1 -0
- package/dist/domain/core/invariant/index.js +1 -1
- package/dist/domain/domain-builder/domain-builder.d.ts +1 -6
- package/dist/domain/domain-builder/domain-builder.js +1 -1
- package/dist/domain/domain-context/domain-context-systems.d.ts +3 -5
- package/dist/domain/domain-context/index.d.ts +0 -1
- package/dist/domain/domain-context/index.js +1 -1
- package/dist/domain/domain-context/navigation-system/navigation-system.d.ts +2 -2
- package/dist/domain/domain-context/navigation-system/navigation-system.js +1 -1
- package/dist/domain/domain-context/transformers/when-builder.js +1 -1
- package/dist/domain/domain-runtime/domain-context/domain-context.d.ts +1 -1
- package/dist/domain/domain-runtime/domain-context/domain-context.js +1 -1
- package/dist/domain/domain-runtime/domain-context/index.d.ts +0 -1
- package/dist/domain/domain-runtime/domain-context/selectors.d.ts +5 -6
- package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
- package/dist/domain/domain-runtime/domain-runtime.d.ts +13 -19
- package/dist/domain/domain-runtime/domain-runtime.js +1 -1
- package/dist/domain/domain-runtime/index.d.ts +0 -1
- package/dist/domain/domain-runtime/index.js +1 -1
- package/dist/domain/domain-runtime/spec/index.d.ts +0 -1
- package/dist/domain/domain-runtime/spec/index.js +1 -1
- package/dist/domain/domain-runtime/spec/initialize.js +1 -1
- package/dist/domain/domain-runtime/spec/selectors.d.ts +2 -2
- package/dist/domain/domain-runtime/spec/types.d.ts +12 -10
- package/dist/domain/extensions/assistant/assistant-greeting.d.ts +30 -0
- package/dist/domain/extensions/assistant/assistant-greeting.js +1 -0
- package/dist/domain/extensions/assistant/index.d.ts +1 -0
- package/dist/domain/extensions/assistant/index.js +1 -0
- package/dist/domain/extensions/index.d.ts +1 -1
- package/dist/domain/extensions/index.js +1 -1
- package/dist/domain/index.d.ts +1 -1
- package/dist/domain/index.js +1 -1
- package/dist/domain/mocks/create-mock-domain-runtime.d.ts +6 -8
- package/dist/domain/spec/modules/index.d.ts +0 -1
- package/dist/domain/spec/modules/index.js +1 -1
- package/dist/domain/spec/phx/phx-domain.d.ts +0 -1
- package/dist/domain/spec/phx/phx-domain.js +1 -1
- package/dist/domain/spec/runtime/application-spec-slice.d.ts +5 -5
- package/dist/domain/spec/runtime/application-spec-slice.js +1 -1
- package/dist/domain/spec/runtime/create-application.d.ts +5 -2
- package/dist/domain/spec/runtime/create-application.js +1 -1
- package/dist/domain/spec/runtime-spec/runtime-spec.d.ts +2 -2
- package/dist/domain/spec/sections/app-metadata.d.ts +1 -0
- package/dist/domain/spec/sections/assistant/assistant-manifest.d.ts +28 -1
- package/dist/domain/spec/sections/assistant/assistant-navigation.d.ts +21 -0
- package/dist/domain/spec/sections/assistant/assistant-navigation.js +1 -0
- package/dist/domain/spec/sections/assistant/assistant-resolved-manifest.d.ts +30 -2
- package/dist/domain/spec/sections/assistant/assistant-select.d.ts +12 -0
- package/dist/domain/spec/sections/assistant/assistant-select.js +1 -0
- package/dist/domain/spec/sections/assistant/form/assistant-form-elements.d.ts +10 -26
- package/dist/domain/spec/sections/assistant/form/assistant-form-elements.js +1 -1
- package/dist/domain/spec/sections/assistant/index.d.ts +3 -1
- package/dist/domain/system-components/index.d.ts +1 -0
- package/dist/domain/system-components/index.js +1 -1
- package/dist/domain/system-components/navigation/index.d.ts +1 -0
- package/dist/domain/system-components/navigation/index.js +1 -0
- package/dist/domain/system-components/navigation/view-controls.d.ts +24 -0
- package/dist/domain/system-components/navigation/view-controls.js +1 -0
- package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
- package/dist/editor/domain-editors/apply-spec-update.js +1 -1
- package/dist/editor/domain-editors/use-implementation-files.d.ts +4 -3
- package/dist/editor/domain-editors/use-implementation-files.js +1 -1
- package/dist/extras/cognito/CognitoSignInPage.d.ts +2 -0
- package/dist/extras/cognito/CognitoSignInPage.js +1 -0
- package/dist/extras/cognito/index.d.ts +1 -0
- package/dist/extras/cognito/index.js +1 -0
- package/dist/i18n/locales/cs/messages.js +1 -1
- package/dist/i18n/locales/da/messages.js +1 -1
- package/dist/i18n/locales/de/messages.js +1 -1
- package/dist/i18n/locales/de-AT/messages.js +1 -1
- package/dist/i18n/locales/en/messages.js +1 -1
- package/dist/i18n/locales/en-AU/messages.js +1 -1
- package/dist/i18n/locales/en-GB/messages.js +1 -1
- package/dist/i18n/locales/es/messages.js +1 -1
- package/dist/i18n/locales/fr/messages.js +1 -1
- package/dist/i18n/locales/hu/messages.js +1 -1
- package/dist/i18n/locales/it/messages.js +1 -1
- package/dist/i18n/locales/nl/messages.js +1 -1
- package/dist/i18n/locales/pl/messages.js +1 -1
- package/dist/i18n/locales/pt/messages.js +1 -1
- package/dist/i18n/locales/ro/messages.js +1 -1
- package/dist/i18n/locales/sk/messages.js +1 -1
- package/dist/i18n/locales/tr/messages.js +1 -1
- package/dist/legacy/deployment-cli/commands/create-environment.js +1 -1
- package/dist/legacy/deployment-cli/commands/list-environments.js +1 -1
- package/dist/legacy/deployment-cli/commands/register-deployment.js +1 -1
- package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +24 -2
- package/dist/legacy/phoenix-cli/commands/prepare-deployment-command.js +1 -1
- package/dist/legacy/phoenix-cli/commands/prepare-local-environment-command.js +1 -1
- package/dist/legacy/phoenix-cli/services/prepare-development-environment.js +1 -1
- package/dist/legacy/phoenix-cli/services/webhook-service/transport.js +1 -1
- package/dist/legacy/webhook-cli/lib/webhook-boundary.js +1 -1
- package/dist/phoenix/application-spec/index.d.ts +1 -1
- package/dist/phoenix/application-spec/index.js +1 -1
- package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +1 -0
- package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
- package/dist/phoenix/cli.js +1 -1
- package/dist/phoenix/commands/account/index.d.ts +1 -0
- package/dist/phoenix/commands/account/index.js +1 -0
- package/dist/phoenix/commands/account/whoami.d.ts +10 -0
- package/dist/phoenix/commands/account/whoami.js +4 -0
- package/dist/phoenix/commands/cleanup-environment.js +1 -1
- package/dist/phoenix/commands/deploy.d.ts +7 -2
- package/dist/phoenix/commands/deploy.js +8 -2
- package/dist/phoenix/commands/deployment-build-envs-command.js +1 -1
- package/dist/phoenix/commands/feedback.d.ts +2 -2
- package/dist/phoenix/commands/feedback.js +1 -1
- package/dist/phoenix/commands/finish-deployment-command.js +1 -1
- package/dist/phoenix/commands/index.d.ts +1 -0
- package/dist/phoenix/commands/index.js +1 -1
- package/dist/phoenix/commands/init-starter-spec.js +3 -4
- package/dist/phoenix/commands/init.d.ts +2 -2
- package/dist/phoenix/commands/init.js +1 -1
- package/dist/phoenix/commands/login.d.ts +6 -3
- package/dist/phoenix/commands/login.js +3 -3
- package/dist/phoenix/commands/logout.js +1 -1
- package/dist/phoenix/commands/prepare-deployment-command.js +2 -2
- package/dist/phoenix/commands/prepare-local-environment-command.js +1 -1
- package/dist/phoenix/services/cli-credentials.d.ts +26 -7
- package/dist/phoenix/services/cli-credentials.js +2 -2
- package/dist/phoenix/services/cli-server/describe-saved-logins.d.ts +5 -0
- package/dist/phoenix/services/cli-server/describe-saved-logins.js +1 -0
- package/dist/phoenix/services/cli-server/index.d.ts +2 -0
- package/dist/phoenix/services/cli-server/index.js +1 -0
- package/dist/phoenix/services/cli-server/resolve-cli-server-url.d.ts +19 -0
- package/dist/phoenix/services/cli-server/resolve-cli-server-url.js +1 -0
- package/dist/phoenix/services/development-credential.js +1 -1
- package/dist/phoenix/services/index.d.ts +4 -2
- package/dist/phoenix/services/index.js +1 -1
- package/dist/phoenix/services/phoenix-regions.d.ts +6 -1
- package/dist/phoenix/services/phoenix-regions.js +1 -1
- package/dist/phoenix/services/prepare-development-environment.js +1 -1
- package/dist/phoenix/services/session/phoenix-application.js +1 -1
- package/dist/phoenix/services/signed-in-development-environment.d.ts +15 -4
- package/dist/phoenix/services/signed-in-development-environment.js +1 -1
- package/dist/phoenix/services/spec-project/describe-workspace-projects.d.ts +11 -0
- package/dist/phoenix/services/spec-project/describe-workspace-projects.js +1 -0
- package/dist/phoenix/services/spec-project/index.d.ts +3 -0
- package/dist/phoenix/services/spec-project/index.js +1 -0
- package/dist/phoenix/services/spec-project/resolve-deploy-target.d.ts +47 -0
- package/dist/phoenix/services/spec-project/resolve-deploy-target.js +1 -0
- package/dist/phoenix/services/spec-project/resolve-target-project.d.ts +34 -0
- package/dist/phoenix/services/spec-project/resolve-target-project.js +2 -0
- package/dist/phoenix/services/spec-project/write-spec-project.d.ts +7 -0
- package/dist/phoenix/services/spec-project/write-spec-project.js +1 -0
- package/dist/phoenix/services/telemetry/telemetry-event.js +1 -1
- package/dist/phoenix/services/telemetry/telemetry-state.d.ts +1 -1
- package/dist/phoenix/services/telemetry/telemetry-state.js +1 -1
- package/dist/phoenix/services/variant-file-session.js +1 -1
- package/dist/phoenix/services/webhook-service/transport.js +1 -1
- package/dist/react-sdk/application-runtime/common-services/index.d.ts +1 -0
- package/dist/react-sdk/application-runtime/common-services/index.js +1 -1
- package/dist/react-sdk/application-runtime/common-services/selectors.d.ts +2 -0
- package/dist/react-sdk/application-runtime/common-services/selectors.js +1 -1
- package/dist/react-sdk/application-runtime/common-services/webmcp/index.d.ts +3 -0
- package/dist/react-sdk/application-runtime/common-services/webmcp/index.js +1 -0
- package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-host.d.ts +35 -0
- package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-host.js +1 -0
- package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-model-context.d.ts +44 -0
- package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-model-context.js +1 -0
- package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-tool-result.d.ts +24 -0
- package/dist/react-sdk/application-runtime/common-services/webmcp/webmcp-tool-result.js +1 -0
- package/dist/react-sdk/application-runtime/domain-application-context/application-runtime-extension.d.ts +7 -1
- package/dist/react-sdk/application-runtime/domain-application-context/application-runtime-extension.js +1 -1
- package/dist/react-sdk/application-runtime/domain-application-context/domain-application-systems.d.ts +2 -2
- package/dist/react-sdk/application-runtime/domain-application-context/selectors.d.ts +1 -3
- package/dist/react-sdk/application-runtime/domain-application-context/selectors.js +1 -1
- package/dist/react-sdk/application-runtime/hooks/index.d.ts +1 -0
- package/dist/react-sdk/application-runtime/hooks/index.js +1 -1
- package/dist/react-sdk/application-runtime/hooks/use-spec.d.ts +1 -1
- package/dist/react-sdk/application-runtime/hooks/use-webmcp-host.d.ts +7 -0
- package/dist/react-sdk/application-runtime/hooks/use-webmcp-host.js +1 -0
- package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +14 -16
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
- package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +5 -6
- package/dist/react-sdk/domain-context/common-hooks/use-state-validity.d.ts +1 -1
- package/dist/react-sdk/domain-context/common-hooks/use-state-validity.js +1 -1
- package/dist/react-sdk/domain-context/index.d.ts +1 -1
- package/dist/react-sdk/domain-context/index.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.d.ts +5 -3
- package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
- package/dist/react-sdk/preset-selection/PresetSelectionProvider.d.ts +11 -0
- package/dist/react-sdk/preset-selection/PresetSelectionProvider.js +1 -1
- package/dist/react-sdk/preset-selection/PresetWebMcpTools.d.ts +14 -0
- package/dist/react-sdk/preset-selection/PresetWebMcpTools.js +1 -0
- package/dist/react-sdk/preset-selection/index.d.ts +2 -1
- package/dist/react-sdk/preset-selection/index.js +1 -1
- package/dist/react-sdk/preset-selection/register-preset-webmcp-tools.d.ts +31 -0
- package/dist/react-sdk/preset-selection/register-preset-webmcp-tools.js +1 -0
- package/dist/ui-sdk/components/preview/Preview.d.ts +12 -4
- package/dist/ui-sdk/components/preview/Preview.js +2 -2
- package/dist/ui-sdk/components/toolbar/desktop-toolbar/ToolbarPopper.d.ts +2 -0
- package/dist/ui-sdk/components/toolbar/desktop-toolbar/ToolbarPopper.js +1 -1
- package/dist/ui-sdk/components/view-controls/ViewControlsContext.d.ts +3 -1
- package/dist/ui-sdk/components/view-controls/ViewControlsItem.js +1 -1
- package/dist/ui-sdk/components/view-controls/ViewControlsRoot.d.ts +6 -1
- package/dist/ui-sdk/components/view-controls/ViewControlsRoot.js +1 -1
- package/dist/webhook/builders/auth-handler-builder.d.ts +3 -0
- package/dist/webhook/builders/auth-handler-builder.js +1 -1
- package/dist/webhook/builders/common.d.ts +3 -1
- package/dist/webhook/builders/webhook-builder.d.ts +5 -0
- package/dist/webhook/builders/webhook-builder.js +1 -1
- package/package.json +9 -4
- package/schema/domain-spec.json +440 -53
- package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/assistant-setup.js +0 -32
- package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-guidelines.d.ts +0 -2
- package/dist/application-spec/generate-application/code/templates/skills/processes/specification/ux-guidelines.js +0 -25
- package/dist/configurator/ui/assistant/annotation/use-end-on-unmount.js +0 -1
- package/dist/configurator/ui/assistant/form-elements/FormCard.d.ts +0 -68
- package/dist/configurator/ui/assistant/form-elements/FormCard.js +0 -1
- package/dist/configurator/ui/assistant/form-elements/FormSwatch.d.ts +0 -61
- package/dist/configurator/ui/assistant/form-elements/FormSwatch.js +0 -1
- package/dist/domain/domain-context/action-system/action-system.d.ts +0 -64
- package/dist/domain/domain-context/action-system/action-system.js +0 -1
- package/dist/domain/domain-context/action-system/index.d.ts +0 -1
- package/dist/domain/domain-context/action-system/index.js +0 -1
- package/dist/domain/domain-runtime/action-factory.d.ts +0 -11
- package/dist/domain/domain-runtime/domain-context/action-context.d.ts +0 -11
- package/dist/domain/extensions/view-controls.d.ts +0 -25
- package/dist/domain/extensions/view-controls.js +0 -1
- package/dist/domain/spec/modules/resolve-action-modules.js +0 -1
- /package/dist/{domain/domain-runtime/domain-context → configurator/application-runtime/extensions/systems/action-system}/action-context.js +0 -0
- /package/dist/{domain/domain-runtime → configurator/application-runtime/extensions/systems/action-system}/action-factory.js +0 -0
package/dist/phoenix/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bool as e,str as t}from"envalid";import{readFileSync as o}from"fs";import{readFile as i}from"fs/promises";import{arch as r,platform as n}from"os";import{dirname as a,join as s,resolve as l}from"path";import{P as p,match as d}from"ts-pattern";import{fileURLToPath as c}from"url";import u from"yargs";import{hideBin as E}from"yargs/helpers";import{z as v}from"zod";import{createEnvReader as f}from"@salsita-ai/common/env";import{DEFAULT_PROJECT_ALIAS as g,FeedbackType as m}from"@salsita-ai/contracts/domain";import{phoenixCli as h}from"#package/legacy";import{readSpecProject as y}from"./application-spec/read-spec-project.js";import{prepareDevelopmentEnvironment as R,prepareLocalEnvironment as S,runActivateDeploymentCommand as _,runBuildCommand as O,runChangelogCommand as U,runCheckCommand as P,runCleanCommand as b,runCleanupEnvironmentCommand as L,runCreateEnvironmentCommand as I,runDataCommand as w,runDeployCommand as N,runDeploymentBuildEnvsCommand as T,runDepsCommand as k,runDevCommand as D,runDocsCommand as j,runExtractSourcesCommand as G,runFeedbackCommand as C,runFinishDeploymentCommand as A,runFixCommand as K,runInitCommand as V,runInspectAssetsCommand as M,runLinkCommand as B,runListEnvironmentsCommand as J,runLoginCommand as F,runLogoutCommand as x,runPrepareCiCommand as Y,runPrepareDeploymentCommand as q,runRegisterDeploymentCommand as H,runSceneCommand as W,runScreenshotCommand as $,runStateCommand as X,runStoryCommand as z,runSyncCommand as Q,runUnlinkCommand as Z,runVariantsCommand as ee}from"./commands/index.js";import{DEFAULT_PHOENIX_REGION as et,PHOENIX_REGIONS as eo,PUBLIC_PHOENIX_REGIONS as ei,VariantFileSession as er,createTelemetryClient as en,exitCli as ea,getRegionServerUrl as es,getRegionStudioUrl as el,readExplicitEditorSetting as ep,resolveDevExperience as ed,resolveRegeneratedPageExperience as ec,resolveSignedInDevelopmentEnvironment as eu,resolveTelemetryCommand as eE,setBeforeCliExit as ev}from"./services/index.js";import{getIsEditorEnabled as ef}from"./utils/get-is-editor-enabled.js";import{createLogger as eg}from"./utils/index.js";let em=(e,t,o)=>{e?.info(`Using ${t?"application-spec":"domain-spec"} flow (${o})`)},eh=(e,t,o)=>{let i=o?.logger??eg();if(void 0!==e)return i.detail(`Application spec: ${e} (from CLI flag)`),em(o?.logger,e,"from CLI flag"),e;let r=process.env.USE_APPLICATION_SPEC;if(void 0!==r){let e="true"===r||"1"===r;return i.detail(`Application spec: ${e} (from environment variable)`),em(o?.logger,e,"from environment variable"),e}return void 0!==t?(i.detail(`Application spec: ${t} (from package.json phoenix.applicationFlow)`),em(o?.logger,t,"from package.json phoenix.applicationFlow"),t):(i.detail("Application spec: false (default)"),em(o?.logger,!1,"default"),!1)},ey=o(s(a(c(import.meta.url)),"../../package.json"),"utf-8");if(!ey)throw Error("Project package.json is required, please provide it in the package.json file");let eR=v.object({version:v.string({required_error:"Project version is required, please provide it in the package.json file"}),name:v.string({required_error:"Project name is required, please provide it in the package.json file"}),dependencies:v.object({eslint:v.string(),prettier:v.string()})}).parse(JSON.parse(ey)),eS=async()=>{try{let e=await i("./package.json","utf-8"),t=JSON.parse(e);return{name:t.name,applicationFlow:t.phoenix?.applicationFlow}}catch{return{name:void 0,applicationFlow:void 0}}},e_=e=>{if(!(e instanceof Error))return String(e);let t=(e=>{if(!(e instanceof Error))return;if(e.message.length>0)return e.message;let t=(e instanceof AggregateError?e.errors:[]).find(e=>e instanceof Error&&e.message.length>0);return t instanceof Error?t.message:"code"in e&&"string"==typeof e.code?e.code:void 0})(e.cause);return void 0===t?e.message:`${e.message}: ${t}`},eO=E(process.argv),eU=eE(eO),eP=null===eU?null:await en({sdkVersion:eR.version}),eb=null===eU?null:eP?.startCommandAttempt(eU),eL=eP?.flush(),eI=!1,ew=!1,eN=async e=>{eI||(eI=!0,await eL,0===e?eb?.complete("succeeded"):eb?.complete("failed","command_failed"),await eP?.flush(),eT())},eT=ev(eN),ek=u(eO).scriptName("phoenix").usage("$0 <command> [options]").command(["build","b"],"Build the project",e=>e.option("workspace",{alias:"w",type:"boolean",description:"Override workspace mode (uses .phoenix.json config by default)"}).option("editor",{type:"boolean",description:"Generate the editor page, or with --no-editor a page without it (defaults: an agent-mode page phoenix dev generated is kept unless ENABLE_EDITOR is set in the environment or .env; otherwise ENABLE_EDITOR from the environment, the generated env file or .env, and the editor otherwise)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}).option("projectSlug",{alias:"p",type:"string",description:"Slug of the project (env: PROJECT_SLUG, defaults to project name in package.json)"}).option("environmentSlug",{alias:"e",type:"string",description:"Slug of the environment (env: ENVIRONMENT_SLUG, defaults to project name in package.json)"}).option("onlyFrontend",{alias:"F",type:"boolean",description:"Build only frontend bundle"}).option("onlyWebhook",{alias:"W",type:"boolean",description:"Build only webhooks"}).option("force",{alias:"f",type:"boolean",description:"Force full rebuild, skip cache (env: FORCE_REBUILD, default: false)"}).option("applicationSpec",{alias:"as",type:"boolean",description:"Use application-spec pipeline (env: USE_APPLICATION_SPEC, default: false)"}).option("banner",{type:"string",requiresArg:!0,description:"Text for the comment at the top of every frontend .js file, public in the bundle (default: application version from the spec and the git commit when available)",coerce:e=>"string"==typeof e?e:e.join("\n")}),async o=>{let i,r=f({PROJECT_SLUG:t({default:void 0}),ENVIRONMENT_SLUG:t({default:void 0}),ENABLE_EDITOR:e({default:void 0}),DEBUG:e({default:!1}),BUILD_TARGET:t({choices:["frontend","webhook","both"],default:"both"}),FORCE_REBUILD:e({default:!1})})(),n=eg({debug:o.debug??r.DEBUG}),a=ef(o.editor,r.ENABLE_EDITOR),s=o.force??r.FORCE_REBUILD,l=await eS(),p=eh(o.applicationSpec,l.applicationFlow,{logger:n}),d=o.projectSlug??r.PROJECT_SLUG??l.name,c=o.environmentSlug??r.ENVIRONMENT_SLUG??l.name;if(!d)throw Error("Project slug is required, provide via --projectSlug, set PROJECT_SLUG env, or ensure package.json has a name field");if(!c)throw Error("Environment slug is required, provide via --environmentSlug, set ENVIRONMENT_SLUG env, or ensure package.json has a name field");let u=o.onlyFrontend,E=o.onlyWebhook;if(u&&E)throw Error("Cannot use --onlyFrontend and --onlyWebhook flags together, they are mutually exclusive");i=u?"frontend":E?"webhook":r.BUILD_TARGET;let v={sdkVersion:eR.version,projectSlug:d,environmentSlug:c,cliUseWorkspace:o.workspace,buildTarget:i,force:s};await (p?O({...v,pageExperience:ec({cliEditor:o.editor,userEditor:ep(process.cwd()),environmentEditor:r.ENABLE_EDITOR},{logger:n}),banner:o.banner},{logger:n}):h.runBuildCommand({...v,enableEditor:a},{logger:n}))}).command(["clean","cl"],"Remove .phoenix and regenerate the project files; installs nothing (the legacy pipeline also removes node_modules and reinstalls)",e=>e.option("workspace",{alias:"w",type:"boolean",description:"Override workspace mode (uses .phoenix.json config by default)"}).option("editor",{type:"boolean",description:"Generate the editor page, or with --no-editor a page without it (defaults: an agent-mode page phoenix dev generated is kept unless ENABLE_EDITOR is set in the environment or .env; otherwise ENABLE_EDITOR from the environment, the generated env file or .env, and the editor otherwise)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}).option("projectSlug",{alias:"p",type:"string",description:"Slug of the project (env: PROJECT_SLUG, defaults to project name in package.json)"}).option("environmentSlug",{alias:"e",type:"string",description:"Slug of the environment (env: ENVIRONMENT_SLUG, defaults to project name in package.json)"}).option("applicationSpec",{alias:"as",type:"boolean",description:"Use application-spec pipeline (env: USE_APPLICATION_SPEC, default: false)"}),async o=>{let i=f({PROJECT_SLUG:t({default:void 0}),ENVIRONMENT_SLUG:t({default:void 0}),ENABLE_EDITOR:e({default:void 0}),DEBUG:e({default:!1})})(),r=eg({debug:o.debug??i.DEBUG}),n=ef(o.editor,i.ENABLE_EDITOR),a=await eS(),s=eh(o.applicationSpec,a.applicationFlow,{logger:r}),l=o.projectSlug??i.PROJECT_SLUG??a.name,p=o.environmentSlug??i.ENVIRONMENT_SLUG??a.name;if(!l)throw Error("Project slug is required, provide via --projectSlug, set PROJECT_SLUG env, or ensure package.json has a name field");if(!p)throw Error("Environment slug is required, provide via --environmentSlug, set ENVIRONMENT_SLUG env, or ensure package.json has a name field");let d={sdkVersion:eR.version,projectSlug:l,environmentSlug:p,cliUseWorkspace:o.workspace};await (s?b({...d,pageExperience:ec({cliEditor:o.editor,userEditor:ep(process.cwd()),environmentEditor:i.ENABLE_EDITOR},{logger:r})},{logger:r}):h.runCleanCommand({...d,enableEditor:n},{logger:r}))}).command(["dev","d"],"Start development mode (Vite, spec watching, and the webhook tunnel)",e=>e.option("workspace",{alias:"w",type:"boolean",description:"Override workspace mode (uses .phoenix.json config by default)"}).option("editor",{type:"boolean",description:'Show the Phoenix editor, or with --no-editor the configurator alone; either way with the detailed dev error pages (defaults to ENABLE_EDITOR in the environment or .env; otherwise agent mode when signed in: editor UI hidden and dev errors behind an "Agent at work" screen, and the editor otherwise)'}).option("editorWsPort",{alias:"ep",type:"string",description:"Port for the editor WebSocket server (defaults to EDITOR_WS_PORT env or 3020)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}).option("projectSlug",{alias:"p",type:"string",description:"Slug of the project (env: PROJECT_SLUG; required in server mode unless --local; offline modes default to the package name)"}).option("environmentSlug",{alias:"e",type:"string",description:"Slug of the environment (env: ENVIRONMENT_SLUG; required in server mode unless --local; offline modes default to the package name)"}).option("withLingui",{alias:"wl",type:"boolean",description:"Enable or disable i18n messages extraction and compilation (defaults to WITH_LINGUI env or false)"}).option("persistence",{alias:"P",type:"string",description:"Persistence mode for the configurator (defaults to PERSISTENCE_MODE env or server)",choices:["memory","local-storage","server"]}).option("force",{alias:"f",type:"boolean",description:"Force full rebuild, skip cache, and prepare the development deployment again (env: FORCE_REBUILD, default: false)"}).option("applicationSpec",{alias:"as",type:"boolean",description:"Use application-spec pipeline (env: USE_APPLICATION_SPEC, default: false)"}).option("tui",{alias:"T",type:"boolean",description:"Render logs in a terminal UI with per-stream pages and split view; requires an interactive terminal (env: PHOENIX_TUI, default: false)"}).option("local",{type:"boolean",description:"Use local-mode development environment defaults (env: PHOENIX_LOCAL, default: false)"}).option("region",{choices:ei,description:`Phoenix region of the workspace you are signed in to, used when .env has no SERVER_URL (default: ${et})`}).option("serverUrl",{type:"string",description:"URL of the Phoenix server, instead of SERVER_URL or the region default"}).option("skipUpload",{alias:"su",type:"boolean",description:"Skip upload of resources to S3 bucket when the development deployment is prepared (env: SKIP_UPLOAD, default: false)"}),async o=>{let i=f({ENABLE_EDITOR:e({default:!0}),PROJECT_SLUG:t({default:void 0}),ENVIRONMENT_SLUG:t({default:void 0}),EDITOR_WS_PORT:t({default:"3020"}),DEBUG:e({default:!1}),WITH_LINGUI:e({default:!1}),PERSISTENCE_MODE:t({default:void 0}),FORCE_REBUILD:e({default:!1}),PHOENIX_TUI:e({default:!1}),SERVER_URL:t({default:void 0}),DEVELOPMENT_KEY:t({default:void 0}),PHOENIX_LOCAL:e({default:!1}),PHOENIX_REGION:t({choices:eo,default:void 0}),SKIP_UPLOAD:e({default:!1})})(),r=o.debug??i.DEBUG,n=eg({debug:r}),a=o.editorWsPort??i.EDITOR_WS_PORT,s=o.force??i.FORCE_REBUILD,l=o.withLingui??i.WITH_LINGUI,c=o.persistence??i.PERSISTENCE_MODE,u=!c||"server"===c,E=o.tui??i.PHOENIX_TUI,v=await eS(),m=eh(o.applicationSpec,v.applicationFlow,{logger:n}),R=o.local??i.PHOENIX_LOCAL,S=o.projectSlug??i.PROJECT_SLUG;m&&await er.recover(process.cwd(),n);let _=u&&m&&!R&&!S?.length?await y(process.cwd()):void 0,{route:O,serverUrl:U,developmentKey:P,apiToken:b,projectSlug:L,environmentSlug:I}=await d({useServer:u,local:R,serverUrl:o.serverUrl??i.SERVER_URL,developmentKey:i.DEVELOPMENT_KEY,projectSlug:S?.length?S:_,environmentSlug:o.environmentSlug??i.ENVIRONMENT_SLUG}).with({useServer:!1},async({serverUrl:e,developmentKey:t,projectSlug:o,environmentSlug:i})=>({route:"no-server",serverUrl:e,developmentKey:t,apiToken:void 0,projectSlug:o??v.name,environmentSlug:i??v.name})).with({local:!0},async({serverUrl:e,developmentKey:t,projectSlug:o,environmentSlug:i})=>({route:"local",serverUrl:e?.length?e:"http://localhost:3000",developmentKey:t?.length?t:"dev_local-dev-key-12345",apiToken:void 0,projectSlug:o?.length?o:"local",environmentSlug:i?.length?i:"dev-local"})).with({developmentKey:p.string.minLength(1)},()=>_===g,()=>{throw Error(`phoenix dev has a DEVELOPMENT_KEY, but the spec says \`project: ${g}\`, which only a signed-in workspace can resolve. Set PROJECT_SLUG in .env by pasting the .env block of your Studio development environment, or name the project's slug in the spec.`)}).with({serverUrl:p.string.minLength(1),developmentKey:p.string.minLength(1),projectSlug:p.string.minLength(1),environmentSlug:p.string.minLength(1)},async({serverUrl:e,developmentKey:t,projectSlug:o,environmentSlug:i})=>({route:"development-key",serverUrl:e,developmentKey:t,apiToken:void 0,projectSlug:o,environmentSlug:i})).with({developmentKey:p.union(void 0,""),projectSlug:p.string.minLength(1)},()=>m,async({serverUrl:e,projectSlug:t})=>{let r=e?.length?e:es(o.region??i.PHOENIX_REGION??et),a=await eu({serverUrl:r,project:t});return n.info(`Developing in ${a.projectSlug}/${a.environmentSlug} of workspace "${a.workspaceName}" on ${r}`),{route:"signed-in",serverUrl:r,developmentKey:void 0,apiToken:a.apiToken,projectSlug:a.projectSlug,environmentSlug:a.environmentSlug}}).with({developmentKey:p.union(void 0,""),projectSlug:p.union(void 0,"")},()=>m,()=>{throw Error(`phoenix dev does not know which project to develop in. Add \`project: ${g}\` to spec/application.yaml to use the default project of the workspace you are signed in to, or paste the .env block of a Studio development environment into .env. Pass --local to use the local-mode server.`)}).otherwise(()=>{throw Error("phoenix dev needs SERVER_URL, PROJECT_SLUG, ENVIRONMENT_SLUG, and DEVELOPMENT_KEY in .env. Create a development environment for your project in Studio and paste its .env block, or pass --local to use the local-mode server.")});if(!L)throw Error("Project slug is required, provide via --projectSlug, set PROJECT_SLUG env, or ensure package.json has a name field");if(!I)throw Error("Environment slug is required, provide via --environmentSlug, set ENVIRONMENT_SLUG env, or ensure package.json has a name field");let w=ed({cliEditor:o.editor,envEditor:ep(process.cwd()),route:O},{logger:n}),N={sdkVersion:eR.version,projectSlug:L,environmentSlug:I,cliUseWorkspace:o.workspace,editorWsPort:a,debug:r,withLingui:l,persistenceMode:c,force:s,tui:E,serverUrl:U,skipUpload:o.skipUpload??i.SKIP_UPLOAD};if(m)await D({...N,devExperience:w,credential:P?{developmentKey:P}:b?{apiToken:b}:void 0},{logger:n});else{let e=ef(o.editor,i.ENABLE_EDITOR);await h.runDevCommand({...N,enableEditor:e,developmentKey:P},{logger:n})}eI||(ew=!0,eb?.ready(),await eP?.flush())}).command(["link","l"],"Internal tool, pnpm only: link a local SDK checkout for development through pnpm overrides; installs nothing, run the pnpm install it prints next",e=>e.option("sdk-path",{type:"string",description:"Path to the SDK repository",default:"../configurator-phoenix"}),async e=>{let t=eg();try{await B({sdkPath:e.sdkPath},{logger:t})}catch{process.exit(1)}}).command(["unlink","ul"],"Internal tool, pnpm only: remove the local SDK link that phoenix link added; installs nothing, run the pnpm install it prints next",()=>{},async()=>{let e=eg();try{await Z({logger:e})}catch{process.exit(1)}}).command(["sync","s"],"Sync project files and compile specs without building vite/webhooks",e=>e.option("workspace",{alias:"w",type:"boolean",description:"Override workspace mode (uses .phoenix.json config by default)"}).option("editor",{type:"boolean",description:"Generate the editor page, or with --no-editor a page without it (defaults: an agent-mode page phoenix dev generated is kept unless ENABLE_EDITOR is set in the environment or .env; otherwise ENABLE_EDITOR from the environment, the generated env file or .env, and the editor otherwise)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}).option("projectSlug",{alias:"p",type:"string",description:"Slug of the project (env: PROJECT_SLUG, defaults to project name in package.json)"}).option("environmentSlug",{alias:"e",type:"string",description:"Slug of the environment (env: ENVIRONMENT_SLUG, defaults to project name in package.json)"}).option("force",{alias:"f",type:"boolean",description:"Force full rebuild, skip cache (env: FORCE_REBUILD, default: false)"}).option("applicationSpec",{alias:"as",type:"boolean",description:"Use application-spec pipeline (env: USE_APPLICATION_SPEC, default: false)"}).option("analyze",{alias:"a",type:"boolean",description:"Print pipeline metrics flamegraph after build (requires --applicationSpec)"}),async o=>{let i=f({ENABLE_EDITOR:e({default:void 0}),DEBUG:e({default:!1}),PROJECT_SLUG:t({default:void 0}),ENVIRONMENT_SLUG:t({default:void 0}),FORCE_REBUILD:e({default:!1})})(),r=eg({debug:o.debug??i.DEBUG}),n=ef(o.editor,i.ENABLE_EDITOR),a=o.force??i.FORCE_REBUILD,s=await eS(),l=eh(o.applicationSpec,s.applicationFlow,{logger:r}),p=o.projectSlug??i.PROJECT_SLUG??s.name,d=o.environmentSlug??i.ENVIRONMENT_SLUG??s.name;if(!p)throw Error("Project slug is required, provide via --projectSlug, set PROJECT_SLUG env, or ensure package.json has a name field");if(!d)throw Error("Environment slug is required, provide via --environmentSlug, set ENVIRONMENT_SLUG env, or ensure package.json has a name field");let c={sdkVersion:eR.version,projectSlug:p,environmentSlug:d,cliUseWorkspace:o.workspace,force:a,analyze:o.analyze};await (l?Q({...c,pageExperience:ec({cliEditor:o.editor,userEditor:ep(process.cwd()),environmentEditor:i.ENABLE_EDITOR},{logger:r})},{logger:r}):h.runSyncCommand({...c,enableEditor:n},{logger:r}))}).command(["deps"],"Bring package.json in line with the SDK's peer dependencies: add the missing ones and move out-of-range versions into the SDK's range. Installs nothing; install the dependencies with your package manager next",e=>e.option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging"}).option("applicationSpec",{alias:"as",type:"boolean",description:"Use application-spec pipeline (env: USE_APPLICATION_SPEC, default: false)"}),async e=>{let t=eg({debug:e.debug??!1}),o=await eS();if(!eh(e.applicationSpec,o.applicationFlow,{logger:t}))return void t.info("phoenix deps changes nothing in a legacy project: phoenix sync manages its dependencies. Switch the project to the application-spec pipeline (phoenix.applicationFlow in package.json) to manage them with phoenix deps.");try{await k({projectRoot:process.cwd()},{logger:t})}catch(e){t.error(e instanceof Error?e.message:String(e)),process.exit(1)}}).command("init [folder]","Start a Phoenix project: write package.json with the SDK, its peers, ESLint and Prettier (an existing one gains only what it lacks) and a starter spec. Install the dependencies with your package manager, then continue with phoenix sync, phoenix login and phoenix dev",e=>e.positional("folder",{type:"string",description:"Folder to create the project in (default: the working directory)"}).option("scaffold",{type:"boolean",hidden:!0,description:"Accepted for compatibility and ignored: init always only writes the starter project"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging"}),async e=>{let t=eg({debug:e.debug??!1});try{await V({sdkVersion:eR.version,editorToolVersions:eR.dependencies,projectRoot:void 0===e.folder?void 0:l(e.folder)},{logger:t})}catch(e){t.error(e instanceof Error?e.message:String(e)),await ea(1)}}).command(["story","st"],"Storybook example utilities",e=>z(e),()=>{}).command(["check","c"],"Run checks (TypeScript, ESLint, Prettier). Runs all by default, or only selected when any of --types/--lint/--format is passed.",e=>e.option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}).option("types",{type:"boolean",description:"Run TypeScript check"}).option("lint",{type:"boolean",description:"Run ESLint check"}).option("format",{type:"boolean",description:"Run Prettier check"}),async t=>{let o=f({DEBUG:e({default:!1})})(),i=eg({debug:t.debug??o.DEBUG});await P({types:t.types,lint:t.lint,format:t.format},{logger:i})}).command(["fix","f"],"Fix linting and formatting issues. Runs all by default, or only selected when any of --lint/--format is passed.",e=>e.option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}).option("lint",{type:"boolean",description:"Run ESLint fix"}).option("format",{type:"boolean",description:"Run Prettier fix"}),async t=>{let o=f({DEBUG:e({default:!1})})(),i=eg({debug:t.debug??o.DEBUG});await K({lint:t.lint,format:t.format},{logger:i})}).command(["changelog","clog"],"Display SDK changelog",e=>e.option("ver",{type:"string",description:"Show specific version (e.g., 0.36.0)"}).option("all",{alias:"a",type:"boolean",description:"Show all versions (warning: large output)"}).option("page",{alias:"p",type:"number",description:"Page number (3 versions per page)"}).option("list",{alias:"l",type:"boolean",description:"List version numbers only"}),async e=>{let t=eg();await U({version:e.ver,all:e.all,page:e.page,list:e.list},{logger:t})}).command(["inspect:assets","ia"],"Inspect 3D assets (glTF/GLB) — nodes, transforms, bounds, origin, materials, morph targets, animations",e=>e.option("file",{alias:"f",type:"string",description:"Path to specific glTF/GLB file"}).option("objects",{alias:"O",type:"boolean",description:"Show only object/node names"}).option("materials",{alias:"m",type:"boolean",description:"Show only material names"}).option("morphs",{alias:"M",type:"boolean",description:"Show only morph target names"}).option("animations",{alias:"a",type:"boolean",description:"Show only animation names"}).option("json",{alias:"j",type:"boolean",description:"Output as JSON"}),async e=>{let t=eg();await M({file:e.file,objects:e.objects,materials:e.materials,morphs:e.morphs,animations:e.animations,json:e.json},{logger:t})}).command(["screenshot","ss"],"Capture a screenshot of the configurator canvas",e=>e.option("port",{alias:"p",type:"string",description:"WebSocket server port (defaults to EDITOR_WS_PORT env or 3020)"}).option("output",{alias:"o",type:"string",description:"Output file path (defaults to SCREENSHOT_OUTPUT env or ./screenshot.png)"}).option("width",{alias:"w",type:"number",description:"Width in pixels (default: 1920)"}).option("height",{alias:"H",type:"number",description:"Height in pixels (default: 1080)"}).option("format",{alias:"f",type:"string",description:"Image format: PNG or JPEG (default: PNG)"}),async e=>{let o=f({EDITOR_WS_PORT:t({default:"3020"}),SCREENSHOT_OUTPUT:t({default:"./screenshot.png"})})(),i=eg();await $({port:e.port??o.EDITOR_WS_PORT,output:e.output??o.SCREENSHOT_OUTPUT,width:e.width,height:e.height,format:e.format},{logger:i})}).command("variants [directory]","Show the options of a .phoenix/variants/<name>/ folder over the configurator and wait for the answer",e=>e.positional("directory",{type:"string",description:"Folder below .phoenix/variants/ holding one .variant.js script per option"}).option("title",{alias:"t",type:"string",description:"Question shown above the options"}).option("description",{alias:"d",type:"string",description:"A line under the question saying what differs between the options"}).option("timeout",{type:"number",description:'Seconds to wait for the answer before exiting with status "waiting" (default: 540)'}).option("keep",{type:"boolean",description:"Keep the folder after the answer instead of removing it"}).option("close",{type:"boolean",description:"Close the open preview without waiting for an answer; the folder is kept"}).option("port",{alias:"p",type:"string",description:"WebSocket server port (defaults to EDITOR_WS_PORT env or 3020)"}),async e=>{let o=f({EDITOR_WS_PORT:t({default:"3020"})})(),i=eg();await ee({directory:e.directory,title:e.title,description:e.description,timeout:e.timeout,keep:e.keep,close:e.close,port:e.port??o.EDITOR_WS_PORT},{logger:i})}).command(["inspect:state","is"],"Get the current editor state as JSON (entities, navigation, validation)",e=>e.option("port",{alias:"p",type:"string",description:"WebSocket server port (defaults to EDITOR_WS_PORT env or 3020)"}).option("output",{alias:"o",type:"string",description:"Output file path (prints to stdout if omitted)"}).option("sections",{alias:"s",type:"string",description:"Comma-separated sections: entities,navigation,validation (default: all)"}).option("pretty",{alias:"P",type:"boolean",description:"Pretty-print JSON output (default: true)",default:!0}),async e=>{let o=f({EDITOR_WS_PORT:t({default:"3020"})})(),i=eg();await X({port:e.port??o.EDITOR_WS_PORT,output:e.output,sections:e.sections,pretty:e.pretty},{logger:i})}).command(["inspect:data","id"],"Get the current editor context data as JSON (published, frontend, backend, session, access, web component)",e=>e.option("port",{alias:"p",type:"string",description:"WebSocket server port (defaults to EDITOR_WS_PORT env or 3020)"}).option("output",{alias:"o",type:"string",description:"Output file path (prints to stdout if omitted)"}).option("pretty",{alias:"P",type:"boolean",description:"Pretty-print JSON output (default: true)",default:!0}),async e=>{let o=f({EDITOR_WS_PORT:t({default:"3020"})})(),i=eg();await w({port:e.port??o.EDITOR_WS_PORT,output:e.output,pretty:e.pretty},{logger:i})}).command(["inspect:scene","isc"],"Get the current Three.js scene graph as JSON",e=>e.option("port",{alias:"p",type:"string",description:"WebSocket server port (defaults to EDITOR_WS_PORT env or 3020)"}).option("output",{alias:"o",type:"string",description:"Output file path (prints to stdout if omitted)"}).option("pretty",{alias:"P",type:"boolean",description:"Pretty-print JSON output (default: true)",default:!0}),async e=>{let o=f({EDITOR_WS_PORT:t({default:"3020"})})(),i=eg();await W({port:e.port??o.EDITOR_WS_PORT,output:e.output,pretty:e.pretty},{logger:i})}).command(["docs","doc"],"Browse SDK documentation",e=>e.option("read",{alias:"r",type:"string",description:"Read a specific doc file (e.g., docs/phoenix/admin.mdx)"}).option("category",{alias:"c",type:"string",description:"Show all docs in a category"}).option("list",{alias:"l",type:"boolean",description:"List all docs with paths and titles"}).option("search",{alias:"s",type:"string",description:"Search doc content for a term (case-insensitive)"}).option("dir",{type:"boolean",description:"Print the absolute path of the docs directory"}),async e=>{let t=eg();await j({read:e.read,category:e.category,list:e.list,search:e.search,dir:e.dir},{logger:t})}).command(["prepare:ci","pci","ci"],"Prepare CI environment by copying .env.ci to .env",()=>{},async()=>{let e=eg();await Y({logger:e})}).command({command:"environment:create",aliases:["env:create"],describe:"Create a new deployment environment",deprecated:"Switch to a new workflow and use deployment:prepare instead",builder:e=>e.option("server",{alias:"s",type:"string",description:"URL of the Phoenix server (defaults to SERVER_URL env)"}).option("apiKey",{alias:"k",type:"string",description:"API key for server access (defaults to ENVIRONMENT_API_KEY env)"}).option("name",{alias:"n",type:"string",description:"Name of the environment to be created"}).option("slug",{type:"string",description:"Slug of the customer to be created"}).option("uuid",{alias:"u",type:"string",description:"UUID of the environment to be created"}).option("outFile",{alias:"o",type:"string",description:"Output file to write the environment UUID to",default:".env.generated"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}),handler:async t=>{let o=f({DEBUG:e({default:!1})})(),i=t.debug??o.DEBUG,r=eg({debug:i});await I({server:t.server,apiKey:t.apiKey,name:t.name,slug:t.slug,uuid:t.uuid,outFile:t.outFile,debug:i},{logger:r})}}).command({command:"environment:list",aliases:["env:list"],describe:"List all deployment environments",deprecated:"Switch to a new workflow and use the prepare environment flow instead",builder:e=>e.option("server",{alias:"s",type:"string",description:"URL of the Phoenix server (defaults to SERVER_URL env)"}).option("apiKey",{alias:"k",type:"string",description:"API key for server access (defaults to ENVIRONMENT_API_KEY env)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}),handler:async t=>{let o=f({DEBUG:e({default:!1})})(),i=t.debug??o.DEBUG,r=eg({debug:i});await J({server:t.server,apiKey:t.apiKey,debug:i},{logger:r})}}).command(["environment:cleanup","env:cleanup","ec"],"Cleanup a transient deployment environment",e=>e.option("serverUrl",{alias:"su",type:"string",description:"URL of the Phoenix server (defaults to SERVER_URL env)"}).option("apiKey",{alias:"a",type:"string",description:"API key for server access (env: ENVIRONMENT_API_KEY, required)"}).option("projectKey",{alias:"k",type:"string",description:"Project key (env: PROJECT_KEY, required)"}).option("projectSlug",{alias:"p",type:"string",description:"Project slug (env: PROJECT_SLUG, required)"}).option("environmentSlug",{alias:"e",type:"string",description:"Environment slug (env: ENVIRONMENT_SLUG, defaults to project name in package.json)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}).option("outFile",{alias:"o",type:"string",description:"Output file to write cleanup result env variables to (env: OUT_FILE, default: .env.generated)",default:".env.generated"}),async o=>{let i=f({DEBUG:e({default:!1}),ENVIRONMENT_API_KEY:t({default:void 0}),PROJECT_KEY:t({default:void 0}),PROJECT_SLUG:t({default:void 0}),ENVIRONMENT_SLUG:t({default:void 0}),SERVER_URL:t({default:void 0}),OUT_FILE:t({default:void 0})})(),r=o.debug??i.DEBUG,n=o.apiKey??i.ENVIRONMENT_API_KEY,a=o.projectKey??i.PROJECT_KEY,s=o.projectSlug??i.PROJECT_SLUG,l=await eS(),p=o.environmentSlug??i.ENVIRONMENT_SLUG??l.name,d=o.serverUrl??i.SERVER_URL,c=o.outFile??i.OUT_FILE??".env.generated";if(!n)throw Error("API key is required, provide via --apiKey or -a, or set ENVIRONMENT_API_KEY environment variable");if(!a)throw Error("Project key is required, provide via --projectKey or -k, or set PROJECT_KEY environment variable");if(!s)throw Error("Project slug is required, provide via --projectSlug or -p, or set PROJECT_SLUG environment variable");if(!p)throw Error("Environment slug is required, provide via --environmentSlug or -e, or set ENVIRONMENT_SLUG environment variable");if(!d)throw Error("Server URL is required, provide via --serverUrl or -su, or set SERVER_URL environment variable");let u=eg({debug:r});await L({server:d,apiKey:n,projectKey:a,projectSlug:s,environmentSlug:p,debug:r,outFile:c},{logger:u})}).command(["login <customer>"],"Sign the CLI in to an SDK-builder workspace; you approve it in Studio",e=>e.positional("customer",{type:"string",demandOption:!0,description:"Slug of the SDK-builder workspace (customer)"}).option("region",{choices:ei,description:`Phoenix region the workspace lives in (default: ${et})`}).option("serverUrl",{alias:"su",type:"string",description:"URL of the Phoenix server, instead of the region default"}).option("studioUrl",{type:"string",description:"URL of Studio for the workspace, instead of the region default"}).option("open",{type:"boolean",default:!0,description:"Open the approval page in the default browser (--no-open to only print the link)"}),async e=>{let o=f({PHOENIX_REGION:t({choices:eo,default:void 0})})(),i=e.region??o.PHOENIX_REGION??et,r=eg();try{let t=await F({customer:e.customer,serverUrl:e.serverUrl??es(i),studioUrl:e.studioUrl??el(i,e.customer),open:e.open},{logger:r});t&&await eP?.identify(t)}catch(e){r.error(e_(e)),await ea(1)}}).command(["deploy"],"Upload this SDK-builder project and follow its build until it is live",e=>e.option("region",{choices:ei,description:`Phoenix region the workspace lives in (default: ${et})`}).option("serverUrl",{alias:"su",type:"string",description:"URL of the Phoenix server, instead of the region default"}).option("wait",{type:"boolean",default:!0,description:"Follow the build until it finishes (--no-wait to return once it starts)"}),async e=>{let o=f({PHOENIX_REGION:t({choices:eo,default:void 0})})(),i=e.region??o.PHOENIX_REGION??et,r=eg();try{await N({serverUrl:e.serverUrl??es(i),sdkVersion:eR.version,wait:e.wait,projectDir:process.cwd(),pollIntervalMs:3e3},{logger:r})}catch(e){r.error(e_(e)),await ea(1)}}).command(["logout"],"Revoke the API token of an SDK-builder workspace and forget it on this computer",e=>e.option("region",{choices:ei,description:`Phoenix region to sign out of (default: ${et})`}).option("serverUrl",{alias:"su",type:"string",description:"URL of the Phoenix server, instead of the region default"}),async e=>{let o=f({PHOENIX_REGION:t({choices:eo,default:void 0})})(),i=e.region??o.PHOENIX_REGION??et,r=eg();try{await x({serverUrl:e.serverUrl??es(i)},{logger:r})}catch(e){r.error(e_(e)),await ea(1)}}).command(["feedback [message]"],"Send feedback about the SDK, CLI, docs or Studio to the Phoenix team",e=>e.positional("message",{type:"string",description:"What you want to tell the Phoenix team; leave it out when you pass --file"}).option("file",{type:"string",description:"Path of a text file that holds the message, for a long report instead of the argument"}).option("type",{choices:[m.Bug,m.Idea,m.Other],default:m.Other,description:"What the feedback is about"}).option("contact",{type:"string",description:"How to reach you, when you want a reply"}).option("agent",{type:"string",description:"Name of the coding agent that writes the feedback"}).option("projectSlug",{alias:"p",type:"string",description:"Slug of the workspace project the feedback is about (env: PROJECT_SLUG, defaults to `project` of the application spec)"}).option("region",{choices:ei,description:`Phoenix region the workspace lives in (default: ${et})`}).option("serverUrl",{alias:"su",type:"string",description:"URL of the Phoenix server, instead of the region default"}),async e=>{let o=f({PHOENIX_REGION:t({choices:eo,default:void 0}),PROJECT_SLUG:t({default:void 0})})(),i=eg(),a=e.region??o.PHOENIX_REGION??et,s=e.projectSlug??o.PROJECT_SLUG,l=s?.length?s:await y(process.cwd()).catch(()=>{i.warn("The feedback is sent without a project, because `project` could not be read from the application spec. Pass --projectSlug to name the project.")});try{await C({serverUrl:e.serverUrl??es(a),message:e.message,file:e.file,type:e.type,contact:e.contact,agent:e.agent,project:l,sdkVersion:eR.version,clientInfo:`${n()} ${r()}, Node.js ${process.versions.node}`},{logger:i})}catch(e){i.error(e_(e)),await ea(1)}}).command({command:"deployment:register",aliases:["dep:register","dr"],describe:"Register deployment configuration",deprecated:"Switch to a new workflow and use deployment:prepare and deployment:finish instead",builder:e=>e.option("server",{alias:"s",type:"string",description:"URL of the Phoenix server (defaults to SERVER_URL env)"}).option("apiKey",{alias:"k",type:"string",description:"API key for server access (defaults to ENVIRONMENT_API_KEY env)"}).option("outFile",{alias:"o",type:"string",description:"Output file to write the deployment ID to",default:".env.generated"}).option("skipUpload",{alias:"su",type:"boolean",description:"Skip uploading assets",default:!1}).option("activate",{alias:"a",type:"boolean",description:"Activate deployment after registration",default:!0}).option("overrideSchema",{alias:"os",type:"boolean",description:"Override existing schema",default:!1}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}),handler:async t=>{let o=f({DEBUG:e({default:!1})})(),i=t.debug??o.DEBUG,r=eg({debug:i});await H({server:t.server,apiKey:t.apiKey,outFile:t.outFile,skipUpload:t.skipUpload,activate:t.activate,overrideSchema:t.overrideSchema,debug:i},{logger:r})}}).command({command:"deployment:activate",aliases:["dep:activate","da"],describe:"Activate a deployment",deprecated:"Switch to a new workflow and use deployment:prepare and deployment:finish instead",builder:e=>e.option("server",{alias:"s",type:"string",description:"URL of the Phoenix server (defaults to SERVER_URL env)"}).option("apiKey",{alias:"k",type:"string",description:"API key for server access (defaults to ENVIRONMENT_API_KEY env)"}).option("uuid",{alias:"u",type:"string",description:"UUID of the deployment to activate"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}),handler:async t=>{let o=f({DEBUG:e({default:!1})})(),i=t.debug??o.DEBUG,r=eg({debug:i});await _({server:t.server,apiKey:t.apiKey,uuid:t.uuid,debug:i},{logger:r})}}).command(["deployment:prepare","dep:prepare","dp"],"Prepare environment and register deployment (env: ENVIRONMENT_API_KEY, PROJECT_KEY, PROJECT_SLUG, PROJECT_REF, PROJECT_SHA, ENVIRONMENT_SLUG, OUT_FILE, SKIP_UPLOAD, OVERRIDE_SCHEMA, SERVER_URL)",e=>e.option("projectSlug",{alias:"p",type:"string",description:"Slug of the project (env: PROJECT_SLUG, required)"}).option("environmentSlug",{alias:"e",type:"string",description:"Slug of the environment (will be created if it does not exist) (env: ENVIRONMENT_SLUG, required)"}).option("projectRef",{type:"string",description:"Source branch, tag, or ref recorded as deployment provenance (env: PROJECT_REF)"}).option("projectSha",{type:"string",description:"Full commit SHA of the checked-out project revision (env: PROJECT_SHA)"}).option("outFile",{alias:"o",type:"string",description:"Output file to write the environment variables to (env: OUT_FILE, default: .env.generated)"}).option("skipUpload",{alias:"su",type:"boolean",description:"Skip upload of resources to S3 bucket (env: SKIP_UPLOAD, default: false)"}).option("overrideSchema",{alias:"os",type:"boolean",description:"Allows to override deployment schemas (env: OVERRIDE_SCHEMA, default: false)"}).option("apiKey",{alias:"a",type:"string",description:"API key for server access (env: ENVIRONMENT_API_KEY, required)"}).option("projectKey",{alias:"k",type:"string",description:"Project key to access the Project resources (env: PROJECT_KEY, required)"}).option("uploadLinksFile",{alias:"ulf",type:"string",description:"File to write upload links to (used by finish command) (default: .upload-links.json)"}).option("serverUrl",{alias:"s",type:"string",description:"PHX server URL (env: SERVER_URL, required)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (env: DEBUG, default: false)"}).option("applicationSpec",{alias:"as",type:"boolean",description:"Use application-spec pipeline (env: USE_APPLICATION_SPEC, default: false)"}),async o=>{let i=f({DEBUG:e({default:!1}),ENVIRONMENT_API_KEY:t({default:void 0}),PROJECT_KEY:t({default:void 0}),PROJECT_SLUG:t({default:void 0}),PROJECT_REF:t({default:void 0}),PROJECT_SHA:t({default:void 0}),ENVIRONMENT_SLUG:t({default:void 0}),OUT_FILE:t({default:".env.generated"}),SKIP_UPLOAD:e({default:!1}),OVERRIDE_SCHEMA:e({default:!1}),SERVER_URL:t({default:void 0})})(),r=o.debug??i.DEBUG,n=o.apiKey??i.ENVIRONMENT_API_KEY;if(!n)throw Error("API key is required, provide via --apiKey or -a, or set ENVIRONMENT_API_KEY environment variable");let a=o.projectKey??i.PROJECT_KEY;if(!a)throw Error("Project key is required, provide via --projectKey or -k, or set PROJECT_KEY environment variable");let s=o.projectSlug??i.PROJECT_SLUG;if(!s)throw Error("Project slug is required, provide via --projectSlug or -p, or set PROJECT_SLUG environment variable");let l=o.environmentSlug??i.ENVIRONMENT_SLUG;if(!l)throw Error("Environment slug is required, provide via --environmentSlug or -e, or set ENVIRONMENT_SLUG environment variable");let p=o.serverUrl??i.SERVER_URL;if(!p)throw Error("Server URL is required, provide via --serverUrl or -s, or set SERVER_URL environment variable");let d=await eS(),c=eg({debug:r}),u=eh(o.applicationSpec,d.applicationFlow,{logger:c});await (u?q:h.runPrepareDeploymentCommand)({apiKey:n,projectKey:a,projectSlug:s,projectRef:o.projectRef??i.PROJECT_REF,projectSha:o.projectSha??i.PROJECT_SHA,environmentSlug:l,outFile:o.outFile??i.OUT_FILE,skipUpload:o.skipUpload??i.SKIP_UPLOAD,overrideSchema:o.overrideSchema??i.OVERRIDE_SCHEMA,uploadLinksFile:o.uploadLinksFile??".upload-links.json",serverUrl:p,debug:r,projectVersion:eR.version},{logger:c})}).command(["deployment:prepare-dev","dep:prepare-dev","dpd"],"Prepare a development deployment (env: SERVER_URL, PROJECT_SLUG, ENVIRONMENT_SLUG, DEVELOPMENT_KEY, OUT_FILE, SKIP_UPLOAD, OVERRIDE_SCHEMA)",e=>e.option("projectSlug",{alias:"p",type:"string",description:"Slug of the project (env: PROJECT_SLUG, required unless --local)"}).option("environmentSlug",{alias:"e",type:"string",description:"Slug of the development environment (env: ENVIRONMENT_SLUG, required unless --local)"}).option("outFile",{alias:"o",type:"string",description:"Output file to write the environment variables to (env: OUT_FILE, default: .env.generated)"}).option("skipUpload",{alias:"su",type:"boolean",description:"Skip upload of resources to S3 bucket (env: SKIP_UPLOAD, default: false)"}).option("overrideSchema",{alias:"os",type:"boolean",description:"Allows overriding deployment schemas (env: OVERRIDE_SCHEMA, default: true)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (env: DEBUG, default: false)"}).option("applicationSpec",{alias:"as",type:"boolean",description:"Use application-spec pipeline (env: USE_APPLICATION_SPEC, default: false)"}).option("local",{type:"boolean",description:"Use local-mode development environment defaults (env: PHOENIX_LOCAL, default: false)"}),async o=>{let i=f({DEBUG:e({default:!1}),PROJECT_SLUG:t({default:void 0}),ENVIRONMENT_SLUG:t({default:void 0}),SERVER_URL:t({default:void 0}),DEVELOPMENT_KEY:t({default:void 0}),PHOENIX_LOCAL:e({default:!1}),OUT_FILE:t({default:".env.generated"}),SKIP_UPLOAD:e({default:!1}),OVERRIDE_SCHEMA:e({default:!0})})(),r=o.debug??i.DEBUG,n=eg({debug:r}),a=o.local??i.PHOENIX_LOCAL,s=i.SERVER_URL,l=o.projectSlug??i.PROJECT_SLUG,p=o.environmentSlug??i.ENVIRONMENT_SLUG,d=i.DEVELOPMENT_KEY;if(a&&(s=s?.length?s:"http://localhost:3000",l=l?.length?l:"local",p=p?.length?p:"dev-local",d=d?.length?d:"dev_local-dev-key-12345"),!s||!l||!p||!d)throw Error("phoenix deployment:prepare-dev needs SERVER_URL, PROJECT_SLUG, ENVIRONMENT_SLUG, and DEVELOPMENT_KEY in .env. Create a development environment for your project in Studio and paste its .env block, or pass --local to use the local-mode server.");let c=await eS(),u=eh(o.applicationSpec,c.applicationFlow,{logger:n}),E={serverUrl:s,projectSlug:l,environmentSlug:p,outFile:o.outFile??i.OUT_FILE,skipUpload:o.skipUpload??i.SKIP_UPLOAD,overrideSchema:o.overrideSchema??i.OVERRIDE_SCHEMA,debug:r,projectVersion:eR.version};try{u?await R({...E,credential:{developmentKey:d}},{logger:n}):await h.prepareDevelopmentEnvironment({...E,developmentKey:d},{logger:n})}catch(e){n.error(`Development environment preparation failed: ${e instanceof Error?e.message:String(e)}`,e),await ea(1)}}).command(["deployment:prepare-local","dep:prepare-local","dpl"],"Prepare local environment for development (env: PROJECT_KEY, PROJECT_SLUG, OUT_FILE, SKIP_UPLOAD, OVERRIDE_SCHEMA, SERVER_URL, LAMBDA_URL)",e=>e.option("projectSlug",{alias:"p",type:"string",description:"Slug of the project (env: PROJECT_SLUG, default: local)"}).option("environmentSlug",{alias:"e",type:"string",description:"Slug of the environment (env: ENVIRONMENT_SLUG, default: project name in package.json)"}).option("outFile",{alias:"o",type:"string",description:"Output file to write the environment variables to (env: OUT_FILE, default: .env.generated)"}).option("skipUpload",{alias:"su",type:"boolean",description:"Skip upload of resources to S3 bucket (env: SKIP_UPLOAD, default: false)"}).option("overrideSchema",{alias:"os",type:"boolean",description:"Allows to override deployment schemas (env: OVERRIDE_SCHEMA, default: true)"}).option("projectKey",{alias:"k",type:"string",description:"Project key to access the Project resources (env: PROJECT_KEY, required)"}).option("serverUrl",{alias:"s",type:"string",description:"PHX server URL (env: SERVER_URL, default: http://localhost:3000)"}).option("lambdaUrl",{alias:"l",type:"string",description:"Webhook URL (env: LAMBDA_URL, default: http://localhost:8080)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (env: DEBUG, default: false)"}).option("apiKey",{alias:"a",type:"string",description:"API key for server access (env: ENVIRONMENT_API_KEY, required)"}).option("applicationSpec",{alias:"as",type:"boolean",description:"Use application-spec pipeline (env: USE_APPLICATION_SPEC, default: false)"}),async o=>{let i=f({DEBUG:e({default:!1}),ENVIRONMENT_SLUG:t({default:void 0}),PROJECT_KEY:t({default:"project_local-dev-key-12345"}),PROJECT_SLUG:t({default:"local"}),OUT_FILE:t({default:".env.generated"}),SKIP_UPLOAD:e({default:!1}),OVERRIDE_SCHEMA:e({default:!0}),SERVER_URL:t({default:"http://localhost:3000"}),LAMBDA_URL:t({default:"http://localhost:8080"}),ENVIRONMENT_API_KEY:t({default:"local-dev-key-12345"})})(),r=o.debug??i.DEBUG,n=o.projectKey??i.PROJECT_KEY;if(!n)throw Error("Project key is required, provide via --projectKey or -k, or set PROJECT_KEY environment variable");let a=await eS(),s=o.environmentSlug??i.ENVIRONMENT_SLUG??a.name;if(!s)throw Error("Environment slug is required, provide via --environmentSlug or -e, or set ENVIRONMENT_SLUG environment variable");let l=o.apiKey??i.ENVIRONMENT_API_KEY;if(!l)throw Error("API key is required, provide via --apiKey or -a, or set ENVIRONMENT_API_KEY environment variable");let p=eg({debug:r}),d=eh(o.applicationSpec,a.applicationFlow,{logger:p});try{await (d?S:h.prepareLocalEnvironment)({apiKey:l,projectKey:n,projectSlug:o.projectSlug??i.PROJECT_SLUG,environmentSlug:s,outFile:o.outFile??i.OUT_FILE,skipUpload:o.skipUpload??i.SKIP_UPLOAD,overrideSchema:o.overrideSchema??i.OVERRIDE_SCHEMA,serverUrl:o.serverUrl??i.SERVER_URL,lambdaUrl:o.lambdaUrl??i.LAMBDA_URL,debug:r,projectVersion:eR.version},{logger:p})}catch(e){p.error(`Local environment preparation failed: ${e instanceof Error?e.message:String(e)}`,e),await ea(1)}}).command(["deployment:extract-sources <archive> <folder>"],"Validate the source archive of a phoenix deploy and extract its project files into a new folder. Links, special files, unsafe paths and oversized content are refused; entries that are not project files are left out",e=>e.positional("archive",{type:"string",demandOption:!0,description:"The source archive (.tgz)"}).positional("folder",{type:"string",demandOption:!0,description:"New or empty folder to extract the project files into"}),async e=>{let t=eg();try{await G({archivePath:e.archive,targetDir:e.folder},{logger:t})}catch(e){t.error(e instanceof Error?e.message:String(e)),await ea(1)}}).command(["deployment:build-envs","dep:build-envs","dbe"],"Write the environment variables for the build step of a prepared deployment that builds apart from its deploy (env: DEPLOYMENT_ID, ENVIRONMENT_API_KEY, PROJECT_KEY, PROJECT_SLUG, OUT_FILE, SERVER_URL)",e=>e.option("uuid",{alias:"u",type:"string",description:"Id of the prepared deployment (env: DEPLOYMENT_ID, required)"}).option("outFile",{alias:"o",type:"string",description:"Output file to write the environment variables to (env: OUT_FILE, default: .env.generated)"}).option("apiKey",{alias:"a",type:"string",description:"API key for server access (env: ENVIRONMENT_API_KEY, required)"}).option("projectKey",{alias:"k",type:"string",description:"Project key to access the Project resources (env: PROJECT_KEY, required)"}).option("projectSlug",{alias:"p",type:"string",description:"Slug of the project (env: PROJECT_SLUG, required)"}).option("serverUrl",{alias:"s",type:"string",description:"PHX server URL (env: SERVER_URL, required)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (env: DEBUG, default: false)"}),async o=>{let i=f({DEBUG:e({default:!1}),DEPLOYMENT_ID:t({default:void 0}),ENVIRONMENT_API_KEY:t({default:void 0}),PROJECT_KEY:t({default:void 0}),PROJECT_SLUG:t({default:void 0}),OUT_FILE:t({default:".env.generated"}),SERVER_URL:t({default:void 0})})(),r=o.debug??i.DEBUG,n=o.uuid??i.DEPLOYMENT_ID;if(!n)throw Error("Deployment ID is required, provide via --uuid or -u, or set DEPLOYMENT_ID environment variable");let a=o.apiKey??i.ENVIRONMENT_API_KEY;if(!a)throw Error("API key is required, provide via --apiKey or -a, or set ENVIRONMENT_API_KEY environment variable");let s=o.projectKey??i.PROJECT_KEY;if(!s)throw Error("Project key is required, provide via --projectKey or -k, or set PROJECT_KEY environment variable");let l=o.projectSlug??i.PROJECT_SLUG;if(!l)throw Error("Project slug is required, provide via --projectSlug or -p, or set PROJECT_SLUG environment variable");let p=o.serverUrl??i.SERVER_URL;if(!p)throw Error("Server URL is required, provide via --serverUrl or -s, or set SERVER_URL environment variable");let d=eg({debug:r});await T({uuid:n,apiKey:a,projectKey:s,projectSlug:l,outFile:o.outFile??i.OUT_FILE,serverUrl:p,debug:r},{logger:d})}).command(["deployment:finish","dep:finish","df"],"Upload files to S3 and activate deployment (env: DEPLOYMENT_ID, ENVIRONMENT_API_KEY, PROJECT_KEY, PROJECT_SLUG, LAMBDA_URL, SERVER_URL, SKIP_UPLOAD)",e=>e.option("uuid",{alias:"u",type:"string",description:"Id of the deployment to be activated (env: DEPLOYMENT_ID, required)"}).option("uploadLinksFile",{alias:"ulf",type:"string",description:"File containing upload links (generated by prepare command) (default: .upload-links.json)"}).option("apiKey",{alias:"a",type:"string",description:"API key for server access (env: ENVIRONMENT_API_KEY, required)"}).option("projectKey",{alias:"k",type:"string",description:"Project key to access the Project resources (env: PROJECT_KEY, required)"}).option("projectSlug",{alias:"p",type:"string",description:"Slug of the project (env: PROJECT_SLUG, required)"}).option("lambdaUrl",{alias:"l",type:"string",description:"Lambda webhook URL for the deployment (env: LAMBDA_URL, required)"}).option("serverUrl",{alias:"s",type:"string",description:"PHX server URL (env: SERVER_URL, required)"}).option("skipUpload",{alias:"su",type:"boolean",description:"Skip upload of resources to S3 bucket (env: SKIP_UPLOAD, default: false)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (env: DEBUG, default: false)"}),async o=>{let i=f({DEBUG:e({default:!1}),DEPLOYMENT_ID:t({default:void 0}),ENVIRONMENT_API_KEY:t({default:void 0}),PROJECT_KEY:t({default:void 0}),PROJECT_SLUG:t({default:void 0}),LAMBDA_URL:t({default:void 0}),SERVER_URL:t({default:void 0}),SKIP_UPLOAD:e({default:!1})})(),r=o.debug??i.DEBUG,n=o.uuid??i.DEPLOYMENT_ID;if(!n)throw Error("Deployment ID is required, provide via --uuid or -u, or set DEPLOYMENT_ID environment variable");let a=o.apiKey??i.ENVIRONMENT_API_KEY;if(!a)throw Error("API key is required, provide via --apiKey or -a, or set ENVIRONMENT_API_KEY environment variable");let s=o.projectKey??i.PROJECT_KEY;if(!s)throw Error("Project key is required, provide via --projectKey or -k, or set PROJECT_KEY environment variable");let l=o.projectSlug??i.PROJECT_SLUG;if(!l)throw Error("Project slug is required, provide via --projectSlug or -p, or set PROJECT_SLUG environment variable");let p=o.lambdaUrl??i.LAMBDA_URL;if(!p)throw Error("Lambda URL is required, provide via --lambdaUrl or -l, or set LAMBDA_URL environment variable");let d=o.serverUrl??i.SERVER_URL;if(!d)throw Error("Server URL is required, provide via --serverUrl or -s, or set SERVER_URL environment variable");let c=eg({debug:r});await A({uuid:n,uploadLinksFile:o.uploadLinksFile??".upload-links.json",apiKey:a,projectKey:s,projectSlug:l,lambdaUrl:p,serverUrl:d,skipUpload:o.skipUpload??i.SKIP_UPLOAD,debug:r},{logger:c})}).demandCommand(1,"Please specify a command").help().alias("help","h").version(eR.version).alias("version","v").exitProcess(!1).strict();try{await ek.parse()}catch{await eN(1),process.exitCode=1}ew||await eN(+(void 0!==process.exitCode&&0!==process.exitCode));
|
|
1
|
+
import{bool as e,str as t}from"envalid";import{readFileSync as o}from"fs";import{readFile as i}from"fs/promises";import{arch as r,platform as n}from"os";import{dirname as a,join as s,resolve as l}from"path";import{P as p,match as d}from"ts-pattern";import{fileURLToPath as c}from"url";import u from"yargs";import{hideBin as E}from"yargs/helpers";import{z as v}from"zod";import{createEnvReader as f}from"@salsita-ai/common/env";import{DEFAULT_PROJECT_ALIAS as g,FeedbackType as m}from"@salsita-ai/contracts/domain";import{phoenixCli as h}from"#package/legacy";import{readSpecProject as y}from"./application-spec/read-spec-project.js";import{prepareDevelopmentEnvironment as R,prepareLocalEnvironment as S,runActivateDeploymentCommand as _,runBuildCommand as U,runChangelogCommand as O,runCheckCommand as P,runCleanCommand as L,runCleanupEnvironmentCommand as b,runCreateEnvironmentCommand as w,runDataCommand as I,runDeployCommand as T,runDeploymentBuildEnvsCommand as N,runDepsCommand as k,runDevCommand as D,runDocsCommand as j,runExtractSourcesCommand as C,runFeedbackCommand as A,runFinishDeploymentCommand as G,runFixCommand as V,runInitCommand as K,runInspectAssetsCommand as M,runLinkCommand as B,runListEnvironmentsCommand as J,runLoginCommand as x,runLogoutCommand as F,runPrepareCiCommand as Y,runPrepareDeploymentCommand as q,runRegisterDeploymentCommand as H,runSceneCommand as W,runScreenshotCommand as $,runStateCommand as X,runStoryCommand as z,runSyncCommand as Q,runUnlinkCommand as Z,runVariantsCommand as ee,runWhoamiCommand as et}from"./commands/index.js";import{DEFAULT_PHOENIX_REGION as eo,PHOENIX_REGIONS as ei,PUBLIC_PHOENIX_REGIONS as er,VariantFileSession as en,createTelemetryClient as ea,exitCli as es,getServerStudioUrl as el,readExplicitEditorSetting as ep,resolveCliServerUrl as ed,resolveDevExperience as ec,resolveRegeneratedPageExperience as eu,resolveSignedInDevelopmentEnvironment as eE,resolveTelemetryCommand as ev,setBeforeCliExit as ef}from"./services/index.js";import{getIsEditorEnabled as eg}from"./utils/get-is-editor-enabled.js";import{askQuestion as em,createLogger as eh}from"./utils/index.js";let ey=(e,t,o)=>{e?.info(`Using ${t?"application-spec":"domain-spec"} flow (${o})`)},eR=(e,t,o)=>{let i=o?.logger??eh();if(void 0!==e)return i.detail(`Application spec: ${e} (from CLI flag)`),ey(o?.logger,e,"from CLI flag"),e;let r=process.env.USE_APPLICATION_SPEC;if(void 0!==r){let e="true"===r||"1"===r;return i.detail(`Application spec: ${e} (from environment variable)`),ey(o?.logger,e,"from environment variable"),e}return void 0!==t?(i.detail(`Application spec: ${t} (from package.json phoenix.applicationFlow)`),ey(o?.logger,t,"from package.json phoenix.applicationFlow"),t):(i.detail("Application spec: false (default)"),ey(o?.logger,!1,"default"),!1)},eS=o(s(a(c(import.meta.url)),"../../package.json"),"utf-8");if(!eS)throw Error("Project package.json is required, please provide it in the package.json file");let e_=v.object({version:v.string({required_error:"Project version is required, please provide it in the package.json file"}),name:v.string({required_error:"Project name is required, please provide it in the package.json file"}),dependencies:v.object({eslint:v.string(),prettier:v.string()})}).parse(JSON.parse(eS)),eU=async()=>{try{let e=await i("./package.json","utf-8"),t=JSON.parse(e);return{name:t.name,applicationFlow:t.phoenix?.applicationFlow}}catch{return{name:void 0,applicationFlow:void 0}}},eO=e=>{if(!(e instanceof Error))return String(e);let t=(e=>{if(!(e instanceof Error))return;if(e.message.length>0)return e.message;let t=(e instanceof AggregateError?e.errors:[]).find(e=>e instanceof Error&&e.message.length>0);return t instanceof Error?t.message:"code"in e&&"string"==typeof e.code?e.code:void 0})(e.cause);return void 0===t?e.message:`${e.message}: ${t}`},eP=E(process.argv),eL=ev(eP),eb=null===eL?null:await ea({sdkVersion:e_.version}),ew=null===eL?null:eb?.startCommandAttempt(eL),eI=eb?.flush(),eT=!1,eN=!1,ek=async e=>{eT||(eT=!0,await eI,0===e?ew?.complete("succeeded"):ew?.complete("failed","command_failed"),await eb?.flush(),eD())},eD=ef(ek),ej=u(eP).scriptName("phoenix").usage("$0 <command> [options]").command(["build","b"],"Build the project",e=>e.option("workspace",{alias:"w",type:"boolean",description:"Override workspace mode (uses .phoenix.json config by default)"}).option("editor",{type:"boolean",description:"Generate the editor page, or with --no-editor a page without it (defaults: an agent-mode page phoenix dev generated is kept unless ENABLE_EDITOR is set in the environment or .env; otherwise ENABLE_EDITOR from the environment, the generated env file or .env, and the editor otherwise)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}).option("projectSlug",{alias:"p",type:"string",description:"Slug of the project (env: PROJECT_SLUG, defaults to project name in package.json)"}).option("environmentSlug",{alias:"e",type:"string",description:"Slug of the environment (env: ENVIRONMENT_SLUG, defaults to project name in package.json)"}).option("onlyFrontend",{alias:"F",type:"boolean",description:"Build only frontend bundle"}).option("onlyWebhook",{alias:"W",type:"boolean",description:"Build only webhooks"}).option("force",{alias:"f",type:"boolean",description:"Force full rebuild, skip cache (env: FORCE_REBUILD, default: false)"}).option("applicationSpec",{alias:"as",type:"boolean",description:"Use application-spec pipeline (env: USE_APPLICATION_SPEC, default: false)"}).option("banner",{type:"string",requiresArg:!0,description:"Text for the comment at the top of every frontend .js file, public in the bundle (default: application version from the spec and the git commit when available)",coerce:e=>"string"==typeof e?e:e.join("\n")}),async o=>{let i,r=f({PROJECT_SLUG:t({default:void 0}),ENVIRONMENT_SLUG:t({default:void 0}),ENABLE_EDITOR:e({default:void 0}),DEBUG:e({default:!1}),BUILD_TARGET:t({choices:["frontend","webhook","both"],default:"both"}),FORCE_REBUILD:e({default:!1})})(),n=eh({debug:o.debug??r.DEBUG}),a=eg(o.editor,r.ENABLE_EDITOR),s=o.force??r.FORCE_REBUILD,l=await eU(),p=eR(o.applicationSpec,l.applicationFlow,{logger:n}),d=o.projectSlug??r.PROJECT_SLUG??l.name,c=o.environmentSlug??r.ENVIRONMENT_SLUG??l.name;if(!d)throw Error("Project slug is required, provide via --projectSlug, set PROJECT_SLUG env, or ensure package.json has a name field");if(!c)throw Error("Environment slug is required, provide via --environmentSlug, set ENVIRONMENT_SLUG env, or ensure package.json has a name field");let u=o.onlyFrontend,E=o.onlyWebhook;if(u&&E)throw Error("Cannot use --onlyFrontend and --onlyWebhook flags together, they are mutually exclusive");i=u?"frontend":E?"webhook":r.BUILD_TARGET;let v={sdkVersion:e_.version,projectSlug:d,environmentSlug:c,cliUseWorkspace:o.workspace,buildTarget:i,force:s};await (p?U({...v,pageExperience:eu({cliEditor:o.editor,userEditor:ep(process.cwd()),environmentEditor:r.ENABLE_EDITOR},{logger:n}),banner:o.banner},{logger:n}):h.runBuildCommand({...v,enableEditor:a},{logger:n}))}).command(["clean","cl"],"Remove .phoenix and regenerate the project files; installs nothing (the legacy pipeline also removes node_modules and reinstalls)",e=>e.option("workspace",{alias:"w",type:"boolean",description:"Override workspace mode (uses .phoenix.json config by default)"}).option("editor",{type:"boolean",description:"Generate the editor page, or with --no-editor a page without it (defaults: an agent-mode page phoenix dev generated is kept unless ENABLE_EDITOR is set in the environment or .env; otherwise ENABLE_EDITOR from the environment, the generated env file or .env, and the editor otherwise)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}).option("projectSlug",{alias:"p",type:"string",description:"Slug of the project (env: PROJECT_SLUG, defaults to project name in package.json)"}).option("environmentSlug",{alias:"e",type:"string",description:"Slug of the environment (env: ENVIRONMENT_SLUG, defaults to project name in package.json)"}).option("applicationSpec",{alias:"as",type:"boolean",description:"Use application-spec pipeline (env: USE_APPLICATION_SPEC, default: false)"}),async o=>{let i=f({PROJECT_SLUG:t({default:void 0}),ENVIRONMENT_SLUG:t({default:void 0}),ENABLE_EDITOR:e({default:void 0}),DEBUG:e({default:!1})})(),r=eh({debug:o.debug??i.DEBUG}),n=eg(o.editor,i.ENABLE_EDITOR),a=await eU(),s=eR(o.applicationSpec,a.applicationFlow,{logger:r}),l=o.projectSlug??i.PROJECT_SLUG??a.name,p=o.environmentSlug??i.ENVIRONMENT_SLUG??a.name;if(!l)throw Error("Project slug is required, provide via --projectSlug, set PROJECT_SLUG env, or ensure package.json has a name field");if(!p)throw Error("Environment slug is required, provide via --environmentSlug, set ENVIRONMENT_SLUG env, or ensure package.json has a name field");let d={sdkVersion:e_.version,projectSlug:l,environmentSlug:p,cliUseWorkspace:o.workspace};await (s?L({...d,pageExperience:eu({cliEditor:o.editor,userEditor:ep(process.cwd()),environmentEditor:i.ENABLE_EDITOR},{logger:r})},{logger:r}):h.runCleanCommand({...d,enableEditor:n},{logger:r}))}).command(["dev","d"],"Start development mode (Vite, spec watching, and the webhook tunnel)",e=>e.option("workspace",{alias:"w",type:"boolean",description:"Override workspace mode (uses .phoenix.json config by default)"}).option("editor",{type:"boolean",description:'Show the Phoenix editor, or with --no-editor the configurator alone; either way with the detailed dev error pages (defaults to ENABLE_EDITOR in the environment or .env; otherwise agent mode when signed in: editor UI hidden and dev errors behind an "Agent at work" screen, and the editor otherwise)'}).option("editorWsPort",{alias:"ep",type:"string",description:"Port for the editor WebSocket server (defaults to EDITOR_WS_PORT env or 3020)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}).option("project",{type:"string",description:"Slug of the project to develop in, instead of `project` of the application spec (phoenix whoami lists the ones you can reach)"}).option("projectSlug",{alias:"p",type:"string",description:"Same as --project (env: PROJECT_SLUG; required in server mode unless --local; offline modes default to the package name)"}).option("environmentSlug",{alias:"e",type:"string",description:"Slug of the environment (env: ENVIRONMENT_SLUG; required in server mode unless --local; offline modes default to the package name)"}).option("withLingui",{alias:"wl",type:"boolean",description:"Enable or disable i18n messages extraction and compilation (defaults to WITH_LINGUI env or false)"}).option("persistence",{alias:"P",type:"string",description:"Persistence mode for the configurator (defaults to PERSISTENCE_MODE env or server)",choices:["memory","local-storage","server"]}).option("force",{alias:"f",type:"boolean",description:"Force full rebuild, skip cache, and prepare the development deployment again (env: FORCE_REBUILD, default: false)"}).option("applicationSpec",{alias:"as",type:"boolean",description:"Use application-spec pipeline (env: USE_APPLICATION_SPEC, default: false)"}).option("tui",{alias:"T",type:"boolean",description:"Render logs in a terminal UI with per-stream pages and split view; requires an interactive terminal (env: PHOENIX_TUI, default: false)"}).option("local",{type:"boolean",description:"Use local-mode development environment defaults (env: PHOENIX_LOCAL, default: false)"}).option("region",{choices:er,description:`Phoenix region you are signed in to, instead of SERVER_URL or the saved login (default: ${eo})`}).option("serverUrl",{type:"string",description:"URL of the Phoenix server, instead of SERVER_URL, the saved login or the region default"}).option("skipUpload",{type:"boolean",description:"Skip upload of resources to S3 bucket when the development deployment is prepared (env: SKIP_UPLOAD, default: false)"}).option("su",{hidden:!0}),async o=>{let i=f({ENABLE_EDITOR:e({default:!0}),PROJECT_SLUG:t({default:void 0}),ENVIRONMENT_SLUG:t({default:void 0}),EDITOR_WS_PORT:t({default:"3020"}),DEBUG:e({default:!1}),WITH_LINGUI:e({default:!1}),PERSISTENCE_MODE:t({default:void 0}),FORCE_REBUILD:e({default:!1}),PHOENIX_TUI:e({default:!1}),SERVER_URL:t({default:void 0}),DEVELOPMENT_KEY:t({default:void 0}),PHOENIX_LOCAL:e({default:!1}),PHOENIX_REGION:t({choices:ei,default:void 0}),SKIP_UPLOAD:e({default:!1})});if(void 0!==o.su)throw Error("`phoenix dev --su` is no longer accepted, because --su names the server URL on the sign-in commands and skipped the upload here. Pass --skipUpload to skip the upload, or --serverUrl <url> to name the server.");let r=i(),n=o.debug??r.DEBUG,a=eh({debug:n}),s=o.editorWsPort??r.EDITOR_WS_PORT,l=o.force??r.FORCE_REBUILD,c=o.withLingui??r.WITH_LINGUI,u=o.persistence??r.PERSISTENCE_MODE,E=!u||"server"===u,v=o.tui??r.PHOENIX_TUI,m=await eU(),R=eR(o.applicationSpec,m.applicationFlow,{logger:a}),S=o.local??r.PHOENIX_LOCAL,_=o.project?.length?o.project:o.projectSlug?.length?o.projectSlug:void 0,U=r.PROJECT_SLUG?.length?r.PROJECT_SLUG:void 0;R&&await en.recover(process.cwd(),a);let O=E&&R&&!S&&!U?await y(process.cwd()):void 0,{route:P,serverUrl:L,developmentKey:b,apiToken:w,projectSlug:I,environmentSlug:T}=await d({useServer:E,local:S,serverUrl:o.serverUrl??r.SERVER_URL,developmentKey:r.DEVELOPMENT_KEY,projectSlug:_??U??(O===g?void 0:O),environmentSlug:o.environmentSlug??r.ENVIRONMENT_SLUG}).with({useServer:!1},async({serverUrl:e,developmentKey:t,projectSlug:o,environmentSlug:i})=>({route:"no-server",serverUrl:e,developmentKey:t,apiToken:void 0,projectSlug:o??m.name,environmentSlug:i??m.name})).with({local:!0},async({serverUrl:e,developmentKey:t,projectSlug:o,environmentSlug:i})=>({route:"local",serverUrl:e?.length?e:"http://localhost:3000",developmentKey:t?.length?t:"dev_local-dev-key-12345",apiToken:void 0,projectSlug:o?.length?o:"local",environmentSlug:i?.length?i:"dev-local"})).with({serverUrl:p.string.minLength(1),developmentKey:p.string.minLength(1),projectSlug:p.string.minLength(1),environmentSlug:p.string.minLength(1)},async({serverUrl:e,developmentKey:t,projectSlug:o,environmentSlug:i})=>({route:"development-key",serverUrl:e,developmentKey:t,apiToken:void 0,projectSlug:o,environmentSlug:i})).with({developmentKey:p.union(void 0,"")},()=>R,async()=>{let e=await ed({serverUrl:o.serverUrl,region:o.region,env:r}),t=await eE({serverUrl:e,flagProject:_,specProject:U??O,specProjectSource:U?"PROJECT_SLUG":"the spec",projectRoot:process.cwd(),interactive:!!process.stdin.isTTY&&!!process.stdout.isTTY},{logger:a,ask:em});return a.info(`Developing in ${t.projectSlug}/${t.environmentSlug}${t.workspaceName?` of workspace "${t.workspaceName}"`:""} on ${e}`),{route:"signed-in",serverUrl:e,developmentKey:void 0,apiToken:t.apiToken,projectSlug:t.projectSlug,environmentSlug:t.environmentSlug}}).otherwise(()=>{throw Error("phoenix dev needs SERVER_URL, PROJECT_SLUG, ENVIRONMENT_SLUG, and DEVELOPMENT_KEY in .env. Create a development environment for your project in Studio and paste its .env block, or pass --local to use the local-mode server.")});if(!I)throw Error("Project slug is required, provide via --projectSlug, set PROJECT_SLUG env, or ensure package.json has a name field");if(!T)throw Error("Environment slug is required, provide via --environmentSlug, set ENVIRONMENT_SLUG env, or ensure package.json has a name field");let N=ec({cliEditor:o.editor,envEditor:ep(process.cwd()),route:P},{logger:a}),k={sdkVersion:e_.version,projectSlug:I,environmentSlug:T,cliUseWorkspace:o.workspace,editorWsPort:s,debug:n,withLingui:c,persistenceMode:u,force:l,tui:v,serverUrl:L,skipUpload:o.skipUpload??r.SKIP_UPLOAD};if(R)await D({...k,devExperience:N,credential:b?{developmentKey:b}:w?{apiToken:w}:void 0},{logger:a});else{let e=eg(o.editor,r.ENABLE_EDITOR);await h.runDevCommand({...k,enableEditor:e,developmentKey:b},{logger:a})}eT||(eN=!0,ew?.ready(),await eb?.flush())}).command(["link","l"],"Internal tool, pnpm only: link a local SDK checkout for development through pnpm overrides; installs nothing, run the pnpm install it prints next",e=>e.option("sdk-path",{type:"string",description:"Path to the SDK repository",default:"../configurator-phoenix"}),async e=>{let t=eh();try{await B({sdkPath:e.sdkPath},{logger:t})}catch{process.exit(1)}}).command(["unlink","ul"],"Internal tool, pnpm only: remove the local SDK link that phoenix link added; installs nothing, run the pnpm install it prints next",()=>{},async()=>{let e=eh();try{await Z({logger:e})}catch{process.exit(1)}}).command(["sync","s"],"Sync project files and compile specs without building vite/webhooks",e=>e.option("workspace",{alias:"w",type:"boolean",description:"Override workspace mode (uses .phoenix.json config by default)"}).option("editor",{type:"boolean",description:"Generate the editor page, or with --no-editor a page without it (defaults: an agent-mode page phoenix dev generated is kept unless ENABLE_EDITOR is set in the environment or .env; otherwise ENABLE_EDITOR from the environment, the generated env file or .env, and the editor otherwise)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}).option("projectSlug",{alias:"p",type:"string",description:"Slug of the project (env: PROJECT_SLUG, defaults to project name in package.json)"}).option("environmentSlug",{alias:"e",type:"string",description:"Slug of the environment (env: ENVIRONMENT_SLUG, defaults to project name in package.json)"}).option("force",{alias:"f",type:"boolean",description:"Force full rebuild, skip cache (env: FORCE_REBUILD, default: false)"}).option("applicationSpec",{alias:"as",type:"boolean",description:"Use application-spec pipeline (env: USE_APPLICATION_SPEC, default: false)"}).option("analyze",{alias:"a",type:"boolean",description:"Print pipeline metrics flamegraph after build (requires --applicationSpec)"}),async o=>{let i=f({ENABLE_EDITOR:e({default:void 0}),DEBUG:e({default:!1}),PROJECT_SLUG:t({default:void 0}),ENVIRONMENT_SLUG:t({default:void 0}),FORCE_REBUILD:e({default:!1})})(),r=eh({debug:o.debug??i.DEBUG}),n=eg(o.editor,i.ENABLE_EDITOR),a=o.force??i.FORCE_REBUILD,s=await eU(),l=eR(o.applicationSpec,s.applicationFlow,{logger:r}),p=o.projectSlug??i.PROJECT_SLUG??s.name,d=o.environmentSlug??i.ENVIRONMENT_SLUG??s.name;if(!p)throw Error("Project slug is required, provide via --projectSlug, set PROJECT_SLUG env, or ensure package.json has a name field");if(!d)throw Error("Environment slug is required, provide via --environmentSlug, set ENVIRONMENT_SLUG env, or ensure package.json has a name field");let c={sdkVersion:e_.version,projectSlug:p,environmentSlug:d,cliUseWorkspace:o.workspace,force:a,analyze:o.analyze};await (l?Q({...c,pageExperience:eu({cliEditor:o.editor,userEditor:ep(process.cwd()),environmentEditor:i.ENABLE_EDITOR},{logger:r})},{logger:r}):h.runSyncCommand({...c,enableEditor:n},{logger:r}))}).command(["deps"],"Bring package.json in line with the SDK's peer dependencies: add the missing ones and move out-of-range versions into the SDK's range. Installs nothing; install the dependencies with your package manager next",e=>e.option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging"}).option("applicationSpec",{alias:"as",type:"boolean",description:"Use application-spec pipeline (env: USE_APPLICATION_SPEC, default: false)"}),async e=>{let t=eh({debug:e.debug??!1}),o=await eU();if(!eR(e.applicationSpec,o.applicationFlow,{logger:t}))return void t.info("phoenix deps changes nothing in a legacy project: phoenix sync manages its dependencies. Switch the project to the application-spec pipeline (phoenix.applicationFlow in package.json) to manage them with phoenix deps.");try{await k({projectRoot:process.cwd()},{logger:t})}catch(e){t.error(e instanceof Error?e.message:String(e)),process.exit(1)}}).command("init [folder]","Start a Phoenix project: write package.json with the SDK, its peers, ESLint and Prettier (an existing one gains only what it lacks) and a starter spec. Install the dependencies with your package manager, then continue with phoenix sync, phoenix login and phoenix dev",e=>e.positional("folder",{type:"string",description:"Folder to create the project in (default: the working directory)"}).option("scaffold",{type:"boolean",hidden:!0,description:"Accepted for compatibility and ignored: init always only writes the starter project"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging"}),async e=>{let t=eh({debug:e.debug??!1});try{await K({sdkVersion:e_.version,editorToolVersions:e_.dependencies,projectRoot:void 0===e.folder?void 0:l(e.folder)},{logger:t})}catch(e){t.error(e instanceof Error?e.message:String(e)),await es(1)}}).command(["story","st"],"Storybook example utilities",e=>z(e),()=>{}).command(["check","c"],"Run checks (TypeScript, ESLint, Prettier). Runs all by default, or only selected when any of --types/--lint/--format is passed.",e=>e.option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}).option("types",{type:"boolean",description:"Run TypeScript check"}).option("lint",{type:"boolean",description:"Run ESLint check"}).option("format",{type:"boolean",description:"Run Prettier check"}),async t=>{let o=f({DEBUG:e({default:!1})})(),i=eh({debug:t.debug??o.DEBUG});await P({types:t.types,lint:t.lint,format:t.format},{logger:i})}).command(["fix","f"],"Fix linting and formatting issues. Runs all by default, or only selected when any of --lint/--format is passed.",e=>e.option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}).option("lint",{type:"boolean",description:"Run ESLint fix"}).option("format",{type:"boolean",description:"Run Prettier fix"}),async t=>{let o=f({DEBUG:e({default:!1})})(),i=eh({debug:t.debug??o.DEBUG});await V({lint:t.lint,format:t.format},{logger:i})}).command(["changelog","clog"],"Display SDK changelog",e=>e.option("ver",{type:"string",description:"Show specific version (e.g., 0.36.0)"}).option("all",{alias:"a",type:"boolean",description:"Show all versions (warning: large output)"}).option("page",{alias:"p",type:"number",description:"Page number (3 versions per page)"}).option("list",{alias:"l",type:"boolean",description:"List version numbers only"}),async e=>{let t=eh();await O({version:e.ver,all:e.all,page:e.page,list:e.list},{logger:t})}).command(["inspect:assets","ia"],"Inspect 3D assets (glTF/GLB) — nodes, transforms, bounds, origin, materials, morph targets, animations",e=>e.option("file",{alias:"f",type:"string",description:"Path to specific glTF/GLB file"}).option("objects",{alias:"O",type:"boolean",description:"Show only object/node names"}).option("materials",{alias:"m",type:"boolean",description:"Show only material names"}).option("morphs",{alias:"M",type:"boolean",description:"Show only morph target names"}).option("animations",{alias:"a",type:"boolean",description:"Show only animation names"}).option("json",{alias:"j",type:"boolean",description:"Output as JSON"}),async e=>{let t=eh();await M({file:e.file,objects:e.objects,materials:e.materials,morphs:e.morphs,animations:e.animations,json:e.json},{logger:t})}).command(["screenshot","ss"],"Capture a screenshot of the configurator canvas",e=>e.option("port",{alias:"p",type:"string",description:"WebSocket server port (defaults to EDITOR_WS_PORT env or 3020)"}).option("output",{alias:"o",type:"string",description:"Output file path (defaults to SCREENSHOT_OUTPUT env or ./screenshot.png)"}).option("width",{alias:"w",type:"number",description:"Width in pixels (default: 1920)"}).option("height",{alias:"H",type:"number",description:"Height in pixels (default: 1080)"}).option("format",{alias:"f",type:"string",description:"Image format: PNG or JPEG (default: PNG)"}),async e=>{let o=f({EDITOR_WS_PORT:t({default:"3020"}),SCREENSHOT_OUTPUT:t({default:"./screenshot.png"})})(),i=eh();await $({port:e.port??o.EDITOR_WS_PORT,output:e.output??o.SCREENSHOT_OUTPUT,width:e.width,height:e.height,format:e.format},{logger:i})}).command("variants [directory]","Show the options of a .phoenix/variants/<name>/ folder over the configurator and wait for the answer",e=>e.positional("directory",{type:"string",description:"Folder below .phoenix/variants/ holding one .variant.js script per option"}).option("title",{alias:"t",type:"string",description:"Question shown above the options"}).option("description",{alias:"d",type:"string",description:"A line under the question saying what differs between the options"}).option("timeout",{type:"number",description:'Seconds to wait for the answer before exiting with status "waiting" (default: 540)'}).option("keep",{type:"boolean",description:"Keep the folder after the answer instead of removing it"}).option("close",{type:"boolean",description:"Close the open preview without waiting for an answer; the folder is kept"}).option("port",{alias:"p",type:"string",description:"WebSocket server port (defaults to EDITOR_WS_PORT env or 3020)"}),async e=>{let o=f({EDITOR_WS_PORT:t({default:"3020"})})(),i=eh();await ee({directory:e.directory,title:e.title,description:e.description,timeout:e.timeout,keep:e.keep,close:e.close,port:e.port??o.EDITOR_WS_PORT},{logger:i})}).command(["inspect:state","is"],"Get the current editor state as JSON (entities, navigation, validation)",e=>e.option("port",{alias:"p",type:"string",description:"WebSocket server port (defaults to EDITOR_WS_PORT env or 3020)"}).option("output",{alias:"o",type:"string",description:"Output file path (prints to stdout if omitted)"}).option("sections",{alias:"s",type:"string",description:"Comma-separated sections: entities,navigation,validation (default: all)"}).option("pretty",{alias:"P",type:"boolean",description:"Pretty-print JSON output (default: true)",default:!0}),async e=>{let o=f({EDITOR_WS_PORT:t({default:"3020"})})(),i=eh();await X({port:e.port??o.EDITOR_WS_PORT,output:e.output,sections:e.sections,pretty:e.pretty},{logger:i})}).command(["inspect:data","id"],"Get the current editor context data as JSON (published, frontend, backend, session, access, web component)",e=>e.option("port",{alias:"p",type:"string",description:"WebSocket server port (defaults to EDITOR_WS_PORT env or 3020)"}).option("output",{alias:"o",type:"string",description:"Output file path (prints to stdout if omitted)"}).option("pretty",{alias:"P",type:"boolean",description:"Pretty-print JSON output (default: true)",default:!0}),async e=>{let o=f({EDITOR_WS_PORT:t({default:"3020"})})(),i=eh();await I({port:e.port??o.EDITOR_WS_PORT,output:e.output,pretty:e.pretty},{logger:i})}).command(["inspect:scene","isc"],"Get the current Three.js scene graph as JSON",e=>e.option("port",{alias:"p",type:"string",description:"WebSocket server port (defaults to EDITOR_WS_PORT env or 3020)"}).option("output",{alias:"o",type:"string",description:"Output file path (prints to stdout if omitted)"}).option("pretty",{alias:"P",type:"boolean",description:"Pretty-print JSON output (default: true)",default:!0}),async e=>{let o=f({EDITOR_WS_PORT:t({default:"3020"})})(),i=eh();await W({port:e.port??o.EDITOR_WS_PORT,output:e.output,pretty:e.pretty},{logger:i})}).command(["docs","doc"],"Browse SDK documentation",e=>e.option("read",{alias:"r",type:"string",description:"Read a specific doc file (e.g., docs/phoenix/admin.mdx)"}).option("category",{alias:"c",type:"string",description:"Show all docs in a category"}).option("list",{alias:"l",type:"boolean",description:"List all docs with paths and titles"}).option("search",{alias:"s",type:"string",description:"Search doc content for a term (case-insensitive)"}).option("dir",{type:"boolean",description:"Print the absolute path of the docs directory"}),async e=>{let t=eh();await j({read:e.read,category:e.category,list:e.list,search:e.search,dir:e.dir},{logger:t})}).command(["prepare:ci","pci","ci"],"Prepare CI environment by copying .env.ci to .env",()=>{},async()=>{let e=eh();await Y({logger:e})}).command({command:"environment:create",aliases:["env:create"],describe:"Create a new deployment environment",deprecated:"Switch to a new workflow and use deployment:prepare instead",builder:e=>e.option("server",{alias:"s",type:"string",description:"URL of the Phoenix server (defaults to SERVER_URL env)"}).option("apiKey",{alias:"k",type:"string",description:"API key for server access (defaults to ENVIRONMENT_API_KEY env)"}).option("name",{alias:"n",type:"string",description:"Name of the environment to be created"}).option("slug",{type:"string",description:"Slug of the customer to be created"}).option("uuid",{alias:"u",type:"string",description:"UUID of the environment to be created"}).option("outFile",{alias:"o",type:"string",description:"Output file to write the environment UUID to",default:".env.generated"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}),handler:async t=>{let o=f({DEBUG:e({default:!1})})(),i=t.debug??o.DEBUG,r=eh({debug:i});await w({server:t.server,apiKey:t.apiKey,name:t.name,slug:t.slug,uuid:t.uuid,outFile:t.outFile,debug:i},{logger:r})}}).command({command:"environment:list",aliases:["env:list"],describe:"List all deployment environments",deprecated:"Switch to a new workflow and use the prepare environment flow instead",builder:e=>e.option("server",{alias:"s",type:"string",description:"URL of the Phoenix server (defaults to SERVER_URL env)"}).option("apiKey",{alias:"k",type:"string",description:"API key for server access (defaults to ENVIRONMENT_API_KEY env)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}),handler:async t=>{let o=f({DEBUG:e({default:!1})})(),i=t.debug??o.DEBUG,r=eh({debug:i});await J({server:t.server,apiKey:t.apiKey,debug:i},{logger:r})}}).command(["environment:cleanup","env:cleanup","ec"],"Cleanup a transient deployment environment",e=>e.option("serverUrl",{alias:"su",type:"string",description:"URL of the Phoenix server (defaults to SERVER_URL env)"}).option("apiKey",{alias:"a",type:"string",description:"API key for server access (env: ENVIRONMENT_API_KEY, required)"}).option("projectKey",{alias:"k",type:"string",description:"Project key (env: PROJECT_KEY, required)"}).option("projectSlug",{alias:"p",type:"string",description:"Project slug (env: PROJECT_SLUG, required)"}).option("environmentSlug",{alias:"e",type:"string",description:"Environment slug (env: ENVIRONMENT_SLUG, defaults to project name in package.json)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}).option("outFile",{alias:"o",type:"string",description:"Output file to write cleanup result env variables to (env: OUT_FILE, default: .env.generated)",default:".env.generated"}),async o=>{let i=f({DEBUG:e({default:!1}),ENVIRONMENT_API_KEY:t({default:void 0}),PROJECT_KEY:t({default:void 0}),PROJECT_SLUG:t({default:void 0}),ENVIRONMENT_SLUG:t({default:void 0}),SERVER_URL:t({default:void 0}),OUT_FILE:t({default:void 0})})(),r=o.debug??i.DEBUG,n=o.apiKey??i.ENVIRONMENT_API_KEY,a=o.projectKey??i.PROJECT_KEY,s=o.projectSlug??i.PROJECT_SLUG,l=await eU(),p=o.environmentSlug??i.ENVIRONMENT_SLUG??l.name,d=o.serverUrl??i.SERVER_URL,c=o.outFile??i.OUT_FILE??".env.generated";if(!n)throw Error("API key is required, provide via --apiKey or -a, or set ENVIRONMENT_API_KEY environment variable");if(!a)throw Error("Project key is required, provide via --projectKey or -k, or set PROJECT_KEY environment variable");if(!s)throw Error("Project slug is required, provide via --projectSlug or -p, or set PROJECT_SLUG environment variable");if(!p)throw Error("Environment slug is required, provide via --environmentSlug or -e, or set ENVIRONMENT_SLUG environment variable");if(!d)throw Error("Server URL is required, provide via --serverUrl or -su, or set SERVER_URL environment variable");let u=eh({debug:r});await b({server:d,apiKey:n,projectKey:a,projectSlug:s,environmentSlug:p,debug:r,outFile:c},{logger:u})}).command(["login [customer]"],"Sign in once for all the projects your account can reach",e=>e.positional("customer",{type:"string",description:"Legacy: slug of one SDK-builder workspace (customer) to bind the sign-in to"}).option("region",{choices:er,description:`Phoenix region you sign in to, instead of SERVER_URL or the saved login (default: ${eo})`}).option("serverUrl",{alias:"su",type:"string",description:"URL of the Phoenix server, instead of SERVER_URL, the saved login or the region default"}).option("studioUrl",{type:"string",description:"URL of Studio for the workspace, instead of the region default"}).option("open",{type:"boolean",default:!0,description:"Open the approval page in the default browser (--no-open to only print the link)"}),async e=>{let o=f({SERVER_URL:t({default:void 0}),PHOENIX_REGION:t({choices:ei,default:void 0})})(),i=eh();try{let t=await ed({serverUrl:e.serverUrl,region:e.region,env:o}),r=await x({customer:e.customer,serverUrl:t,studioUrl:e.studioUrl??el(t,e.customer),open:e.open},{logger:i});r&&await eb?.identify(r)}catch(e){i.error(eO(e)),await es(1)}}).command(["deploy"],"Upload this SDK-builder project into one of its previews and follow its build until it is live",e=>e.option("region",{choices:er,description:`Phoenix region you sign in to, instead of SERVER_URL or the saved login (default: ${eo})`}).option("serverUrl",{alias:"su",type:"string",description:"URL of the Phoenix server, instead of SERVER_URL, the saved login or the region default"}).option("project",{type:"string",description:"Slug of the project to deploy to, instead of `project` of the application spec (phoenix whoami lists the ones you can reach)"}).option("env",{type:"string",description:"Preview to build into (default: preview, created when the project has none). It must exist: --env never creates a preview, and production changes only by promoting a preview build in Studio"}).option("wait",{type:"boolean",default:!0,description:"Follow the build until it finishes (--no-wait to return once it starts or joins the queue)"}),async e=>{let o=f({SERVER_URL:t({default:void 0}),PHOENIX_REGION:t({choices:ei,default:void 0})})(),i=eh();try{await T({serverUrl:await ed({serverUrl:e.serverUrl,region:e.region,env:o}),sdkVersion:e_.version,wait:e.wait,projectDir:process.cwd(),project:e.project,environment:e.env,interactive:!!process.stdin.isTTY&&!!process.stdout.isTTY,pollIntervalMs:3e3},{logger:i})}catch(e){i.error(eO(e)),await es(1)}}).command(["whoami"],"Show the account and current projects available to this CLI credential",e=>e.option("region",{choices:er,description:`Phoenix region to inspect, instead of SERVER_URL or the saved login (default: ${eo})`}).option("serverUrl",{alias:"su",type:"string",description:"URL of the Phoenix server, instead of SERVER_URL, the saved login or the region default"}),async e=>{let o=f({SERVER_URL:t({default:void 0}),PHOENIX_REGION:t({choices:ei,default:void 0})})(),i=eh();try{await et({serverUrl:await ed({serverUrl:e.serverUrl,region:e.region,env:o}),projectDir:process.cwd()},{logger:i})}catch(e){i.error(eO(e)),await es(1)}}).command(["logout"],"Revoke the API token of an SDK-builder workspace and forget it on this computer",e=>e.option("region",{choices:er,description:`Phoenix region to sign out of, instead of SERVER_URL or the saved login (default: ${eo})`}).option("serverUrl",{alias:"su",type:"string",description:"URL of the Phoenix server, instead of SERVER_URL, the saved login or the region default"}),async e=>{let o=f({SERVER_URL:t({default:void 0}),PHOENIX_REGION:t({choices:ei,default:void 0})})(),i=eh();try{await F({serverUrl:await ed({serverUrl:e.serverUrl,region:e.region,env:o})},{logger:i})}catch(e){i.error(eO(e)),await es(1)}}).command(["feedback [message]"],"Send feedback about the SDK, CLI, docs or Studio to the Phoenix team",e=>e.positional("message",{type:"string",description:"What you want to tell the Phoenix team; leave it out when you pass --file"}).option("file",{type:"string",description:"Path of a text file that holds the message, for a long report instead of the argument"}).option("type",{choices:[m.Bug,m.Idea,m.Other],default:m.Other,description:"What the feedback is about"}).option("contact",{type:"string",description:"How to reach you, when you want a reply"}).option("agent",{type:"string",description:"Name of the coding agent that writes the feedback"}).option("projectSlug",{alias:"p",type:"string",description:"Slug of the workspace project the feedback is about (env: PROJECT_SLUG, defaults to `project` of the application spec)"}).option("region",{choices:er,description:`Phoenix region you sign in to, instead of SERVER_URL or the saved login (default: ${eo})`}).option("serverUrl",{alias:"su",type:"string",description:"URL of the Phoenix server, instead of SERVER_URL, the saved login or the region default"}),async e=>{let o=f({SERVER_URL:t({default:void 0}),PHOENIX_REGION:t({choices:ei,default:void 0}),PROJECT_SLUG:t({default:void 0})})(),i=eh(),a=e.projectSlug??o.PROJECT_SLUG,s=a?.length?a:await y(process.cwd()).catch(()=>{i.warn("The feedback is sent without a project, because `project` could not be read from the application spec. Pass --projectSlug to name the project.")});try{await A({serverUrl:await ed({serverUrl:e.serverUrl,region:e.region,env:o}),message:e.message,file:e.file,type:e.type,contact:e.contact,agent:e.agent,project:s===g?void 0:s,sdkVersion:e_.version,clientInfo:`${n()} ${r()}, Node.js ${process.versions.node}`},{logger:i})}catch(e){i.error(eO(e)),await es(1)}}).command({command:"deployment:register",aliases:["dep:register","dr"],describe:"Register deployment configuration",deprecated:"Switch to a new workflow and use deployment:prepare and deployment:finish instead",builder:e=>e.option("server",{alias:"s",type:"string",description:"URL of the Phoenix server (defaults to SERVER_URL env)"}).option("apiKey",{alias:"k",type:"string",description:"API key for server access (defaults to ENVIRONMENT_API_KEY env)"}).option("outFile",{alias:"o",type:"string",description:"Output file to write the deployment ID to",default:".env.generated"}).option("skipUpload",{alias:"su",type:"boolean",description:"Skip uploading assets",default:!1}).option("activate",{alias:"a",type:"boolean",description:"Activate deployment after registration",default:!0}).option("overrideSchema",{alias:"os",type:"boolean",description:"Override existing schema",default:!1}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}),handler:async t=>{let o=f({DEBUG:e({default:!1})})(),i=t.debug??o.DEBUG,r=eh({debug:i});await H({server:t.server,apiKey:t.apiKey,outFile:t.outFile,skipUpload:t.skipUpload,activate:t.activate,overrideSchema:t.overrideSchema,debug:i},{logger:r})}}).command({command:"deployment:activate",aliases:["dep:activate","da"],describe:"Activate a deployment",deprecated:"Switch to a new workflow and use deployment:prepare and deployment:finish instead",builder:e=>e.option("server",{alias:"s",type:"string",description:"URL of the Phoenix server (defaults to SERVER_URL env)"}).option("apiKey",{alias:"k",type:"string",description:"API key for server access (defaults to ENVIRONMENT_API_KEY env)"}).option("uuid",{alias:"u",type:"string",description:"UUID of the deployment to activate"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (defaults to DEBUG env or false)"}),handler:async t=>{let o=f({DEBUG:e({default:!1})})(),i=t.debug??o.DEBUG,r=eh({debug:i});await _({server:t.server,apiKey:t.apiKey,uuid:t.uuid,debug:i},{logger:r})}}).command(["deployment:prepare","dep:prepare","dp"],"Prepare environment and register deployment (env: ENVIRONMENT_API_KEY, PROJECT_KEY, PROJECT_SLUG, PROJECT_REF, PROJECT_SHA, ENVIRONMENT_SLUG, OUT_FILE, SKIP_UPLOAD, OVERRIDE_SCHEMA, SERVER_URL)",e=>e.option("projectSlug",{alias:"p",type:"string",description:"Slug of the project (env: PROJECT_SLUG, required)"}).option("environmentSlug",{alias:"e",type:"string",description:"Slug of the environment (will be created if it does not exist) (env: ENVIRONMENT_SLUG, required)"}).option("projectRef",{type:"string",description:"Source branch, tag, or ref recorded as deployment provenance (env: PROJECT_REF)"}).option("projectSha",{type:"string",description:"Full commit SHA of the checked-out project revision (env: PROJECT_SHA)"}).option("outFile",{alias:"o",type:"string",description:"Output file to write the environment variables to (env: OUT_FILE, default: .env.generated)"}).option("skipUpload",{alias:"su",type:"boolean",description:"Skip upload of resources to S3 bucket (env: SKIP_UPLOAD, default: false)"}).option("overrideSchema",{alias:"os",type:"boolean",description:"Allows to override deployment schemas (env: OVERRIDE_SCHEMA, default: false)"}).option("apiKey",{alias:"a",type:"string",description:"API key for server access (env: ENVIRONMENT_API_KEY, required)"}).option("projectKey",{alias:"k",type:"string",description:"Project key to access the Project resources (env: PROJECT_KEY, required)"}).option("uploadLinksFile",{alias:"ulf",type:"string",description:"File to write upload links to (used by finish command) (default: .upload-links.json)"}).option("serverUrl",{alias:"s",type:"string",description:"PHX server URL (env: SERVER_URL, required)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (env: DEBUG, default: false)"}).option("applicationSpec",{alias:"as",type:"boolean",description:"Use application-spec pipeline (env: USE_APPLICATION_SPEC, default: false)"}),async o=>{let i=f({DEBUG:e({default:!1}),ENVIRONMENT_API_KEY:t({default:void 0}),PROJECT_KEY:t({default:void 0}),PROJECT_SLUG:t({default:void 0}),PROJECT_REF:t({default:void 0}),PROJECT_SHA:t({default:void 0}),ENVIRONMENT_SLUG:t({default:void 0}),OUT_FILE:t({default:".env.generated"}),SKIP_UPLOAD:e({default:!1}),OVERRIDE_SCHEMA:e({default:!1}),SERVER_URL:t({default:void 0})})(),r=o.debug??i.DEBUG,n=o.apiKey??i.ENVIRONMENT_API_KEY;if(!n)throw Error("API key is required, provide via --apiKey or -a, or set ENVIRONMENT_API_KEY environment variable");let a=o.projectKey??i.PROJECT_KEY;if(!a)throw Error("Project key is required, provide via --projectKey or -k, or set PROJECT_KEY environment variable");let s=o.projectSlug??i.PROJECT_SLUG;if(!s)throw Error("Project slug is required, provide via --projectSlug or -p, or set PROJECT_SLUG environment variable");let l=o.environmentSlug??i.ENVIRONMENT_SLUG;if(!l)throw Error("Environment slug is required, provide via --environmentSlug or -e, or set ENVIRONMENT_SLUG environment variable");let p=o.serverUrl??i.SERVER_URL;if(!p)throw Error("Server URL is required, provide via --serverUrl or -s, or set SERVER_URL environment variable");let d=await eU(),c=eh({debug:r}),u=eR(o.applicationSpec,d.applicationFlow,{logger:c});await (u?q:h.runPrepareDeploymentCommand)({apiKey:n,projectKey:a,projectSlug:s,projectRef:o.projectRef??i.PROJECT_REF,projectSha:o.projectSha??i.PROJECT_SHA,environmentSlug:l,outFile:o.outFile??i.OUT_FILE,skipUpload:o.skipUpload??i.SKIP_UPLOAD,overrideSchema:o.overrideSchema??i.OVERRIDE_SCHEMA,uploadLinksFile:o.uploadLinksFile??".upload-links.json",serverUrl:p,debug:r,projectVersion:e_.version},{logger:c})}).command(["deployment:prepare-dev","dep:prepare-dev","dpd"],"Prepare a development deployment (env: SERVER_URL, PROJECT_SLUG, ENVIRONMENT_SLUG, DEVELOPMENT_KEY, OUT_FILE, SKIP_UPLOAD, OVERRIDE_SCHEMA)",e=>e.option("projectSlug",{alias:"p",type:"string",description:"Slug of the project (env: PROJECT_SLUG, required unless --local)"}).option("environmentSlug",{alias:"e",type:"string",description:"Slug of the development environment (env: ENVIRONMENT_SLUG, required unless --local)"}).option("outFile",{alias:"o",type:"string",description:"Output file to write the environment variables to (env: OUT_FILE, default: .env.generated)"}).option("skipUpload",{alias:"su",type:"boolean",description:"Skip upload of resources to S3 bucket (env: SKIP_UPLOAD, default: false)"}).option("overrideSchema",{alias:"os",type:"boolean",description:"Allows overriding deployment schemas (env: OVERRIDE_SCHEMA, default: true)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (env: DEBUG, default: false)"}).option("applicationSpec",{alias:"as",type:"boolean",description:"Use application-spec pipeline (env: USE_APPLICATION_SPEC, default: false)"}).option("local",{type:"boolean",description:"Use local-mode development environment defaults (env: PHOENIX_LOCAL, default: false)"}),async o=>{let i=f({DEBUG:e({default:!1}),PROJECT_SLUG:t({default:void 0}),ENVIRONMENT_SLUG:t({default:void 0}),SERVER_URL:t({default:void 0}),DEVELOPMENT_KEY:t({default:void 0}),PHOENIX_LOCAL:e({default:!1}),OUT_FILE:t({default:".env.generated"}),SKIP_UPLOAD:e({default:!1}),OVERRIDE_SCHEMA:e({default:!0})})(),r=o.debug??i.DEBUG,n=eh({debug:r}),a=o.local??i.PHOENIX_LOCAL,s=i.SERVER_URL,l=o.projectSlug??i.PROJECT_SLUG,p=o.environmentSlug??i.ENVIRONMENT_SLUG,d=i.DEVELOPMENT_KEY;if(a&&(s=s?.length?s:"http://localhost:3000",l=l?.length?l:"local",p=p?.length?p:"dev-local",d=d?.length?d:"dev_local-dev-key-12345"),!s||!l||!p||!d)throw Error("phoenix deployment:prepare-dev needs SERVER_URL, PROJECT_SLUG, ENVIRONMENT_SLUG, and DEVELOPMENT_KEY in .env. Create a development environment for your project in Studio and paste its .env block, or pass --local to use the local-mode server.");let c=await eU(),u=eR(o.applicationSpec,c.applicationFlow,{logger:n}),E={serverUrl:s,projectSlug:l,environmentSlug:p,outFile:o.outFile??i.OUT_FILE,skipUpload:o.skipUpload??i.SKIP_UPLOAD,overrideSchema:o.overrideSchema??i.OVERRIDE_SCHEMA,debug:r,projectVersion:e_.version};try{u?await R({...E,credential:{developmentKey:d}},{logger:n}):await h.prepareDevelopmentEnvironment({...E,developmentKey:d},{logger:n})}catch(e){n.error(`Development environment preparation failed: ${e instanceof Error?e.message:String(e)}`,e),await es(1)}}).command(["deployment:prepare-local","dep:prepare-local","dpl"],"Prepare local environment for development (env: PROJECT_KEY, PROJECT_SLUG, OUT_FILE, SKIP_UPLOAD, OVERRIDE_SCHEMA, SERVER_URL, LAMBDA_URL)",e=>e.option("projectSlug",{alias:"p",type:"string",description:"Slug of the project (env: PROJECT_SLUG, default: local)"}).option("environmentSlug",{alias:"e",type:"string",description:"Slug of the environment (env: ENVIRONMENT_SLUG, default: project name in package.json)"}).option("outFile",{alias:"o",type:"string",description:"Output file to write the environment variables to (env: OUT_FILE, default: .env.generated)"}).option("skipUpload",{alias:"su",type:"boolean",description:"Skip upload of resources to S3 bucket (env: SKIP_UPLOAD, default: false)"}).option("overrideSchema",{alias:"os",type:"boolean",description:"Allows to override deployment schemas (env: OVERRIDE_SCHEMA, default: true)"}).option("projectKey",{alias:"k",type:"string",description:"Project key to access the Project resources (env: PROJECT_KEY, required)"}).option("serverUrl",{alias:"s",type:"string",description:"PHX server URL (env: SERVER_URL, default: http://localhost:3000)"}).option("lambdaUrl",{alias:"l",type:"string",description:"Webhook URL (env: LAMBDA_URL, default: http://localhost:8080)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (env: DEBUG, default: false)"}).option("apiKey",{alias:"a",type:"string",description:"API key for server access (env: ENVIRONMENT_API_KEY, required)"}).option("applicationSpec",{alias:"as",type:"boolean",description:"Use application-spec pipeline (env: USE_APPLICATION_SPEC, default: false)"}),async o=>{let i=f({DEBUG:e({default:!1}),ENVIRONMENT_SLUG:t({default:void 0}),PROJECT_KEY:t({default:"project_local-dev-key-12345"}),PROJECT_SLUG:t({default:"local"}),OUT_FILE:t({default:".env.generated"}),SKIP_UPLOAD:e({default:!1}),OVERRIDE_SCHEMA:e({default:!0}),SERVER_URL:t({default:"http://localhost:3000"}),LAMBDA_URL:t({default:"http://localhost:8080"}),ENVIRONMENT_API_KEY:t({default:"local-dev-key-12345"})})(),r=o.debug??i.DEBUG,n=o.projectKey??i.PROJECT_KEY;if(!n)throw Error("Project key is required, provide via --projectKey or -k, or set PROJECT_KEY environment variable");let a=await eU(),s=o.environmentSlug??i.ENVIRONMENT_SLUG??a.name;if(!s)throw Error("Environment slug is required, provide via --environmentSlug or -e, or set ENVIRONMENT_SLUG environment variable");let l=o.apiKey??i.ENVIRONMENT_API_KEY;if(!l)throw Error("API key is required, provide via --apiKey or -a, or set ENVIRONMENT_API_KEY environment variable");let p=eh({debug:r}),d=eR(o.applicationSpec,a.applicationFlow,{logger:p});try{await (d?S:h.prepareLocalEnvironment)({apiKey:l,projectKey:n,projectSlug:o.projectSlug??i.PROJECT_SLUG,environmentSlug:s,outFile:o.outFile??i.OUT_FILE,skipUpload:o.skipUpload??i.SKIP_UPLOAD,overrideSchema:o.overrideSchema??i.OVERRIDE_SCHEMA,serverUrl:o.serverUrl??i.SERVER_URL,lambdaUrl:o.lambdaUrl??i.LAMBDA_URL,debug:r,projectVersion:e_.version},{logger:p})}catch(e){p.error(`Local environment preparation failed: ${e instanceof Error?e.message:String(e)}`,e),await es(1)}}).command(["deployment:extract-sources <archive> <folder>"],"Validate the source archive of a phoenix deploy and extract its project files into a new folder. Links, special files, unsafe paths and oversized content are refused; entries that are not project files are left out",e=>e.positional("archive",{type:"string",demandOption:!0,description:"The source archive (.tgz)"}).positional("folder",{type:"string",demandOption:!0,description:"New or empty folder to extract the project files into"}),async e=>{let t=eh();try{await C({archivePath:e.archive,targetDir:e.folder},{logger:t})}catch(e){t.error(e instanceof Error?e.message:String(e)),await es(1)}}).command(["deployment:build-envs","dep:build-envs","dbe"],"Write the environment variables for the build step of a prepared deployment that builds apart from its deploy (env: DEPLOYMENT_ID, ENVIRONMENT_API_KEY, PROJECT_KEY, PROJECT_SLUG, OUT_FILE, SERVER_URL)",e=>e.option("uuid",{alias:"u",type:"string",description:"Id of the prepared deployment (env: DEPLOYMENT_ID, required)"}).option("outFile",{alias:"o",type:"string",description:"Output file to write the environment variables to (env: OUT_FILE, default: .env.generated)"}).option("apiKey",{alias:"a",type:"string",description:"API key for server access (env: ENVIRONMENT_API_KEY, required)"}).option("projectKey",{alias:"k",type:"string",description:"Project key to access the Project resources (env: PROJECT_KEY, required)"}).option("projectSlug",{alias:"p",type:"string",description:"Slug of the project (env: PROJECT_SLUG, required)"}).option("serverUrl",{alias:"s",type:"string",description:"PHX server URL (env: SERVER_URL, required)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (env: DEBUG, default: false)"}),async o=>{let i=f({DEBUG:e({default:!1}),DEPLOYMENT_ID:t({default:void 0}),ENVIRONMENT_API_KEY:t({default:void 0}),PROJECT_KEY:t({default:void 0}),PROJECT_SLUG:t({default:void 0}),OUT_FILE:t({default:".env.generated"}),SERVER_URL:t({default:void 0})})(),r=o.debug??i.DEBUG,n=o.uuid??i.DEPLOYMENT_ID;if(!n)throw Error("Deployment ID is required, provide via --uuid or -u, or set DEPLOYMENT_ID environment variable");let a=o.apiKey??i.ENVIRONMENT_API_KEY;if(!a)throw Error("API key is required, provide via --apiKey or -a, or set ENVIRONMENT_API_KEY environment variable");let s=o.projectKey??i.PROJECT_KEY;if(!s)throw Error("Project key is required, provide via --projectKey or -k, or set PROJECT_KEY environment variable");let l=o.projectSlug??i.PROJECT_SLUG;if(!l)throw Error("Project slug is required, provide via --projectSlug or -p, or set PROJECT_SLUG environment variable");let p=o.serverUrl??i.SERVER_URL;if(!p)throw Error("Server URL is required, provide via --serverUrl or -s, or set SERVER_URL environment variable");let d=eh({debug:r});await N({uuid:n,apiKey:a,projectKey:s,projectSlug:l,outFile:o.outFile??i.OUT_FILE,serverUrl:p,debug:r},{logger:d})}).command(["deployment:finish","dep:finish","df"],"Upload files to S3 and activate deployment (env: DEPLOYMENT_ID, ENVIRONMENT_API_KEY, PROJECT_KEY, PROJECT_SLUG, LAMBDA_URL, SERVER_URL, SKIP_UPLOAD)",e=>e.option("uuid",{alias:"u",type:"string",description:"Id of the deployment to be activated (env: DEPLOYMENT_ID, required)"}).option("uploadLinksFile",{alias:"ulf",type:"string",description:"File containing upload links (generated by prepare command) (default: .upload-links.json)"}).option("apiKey",{alias:"a",type:"string",description:"API key for server access (env: ENVIRONMENT_API_KEY, required)"}).option("projectKey",{alias:"k",type:"string",description:"Project key to access the Project resources (env: PROJECT_KEY, required)"}).option("projectSlug",{alias:"p",type:"string",description:"Slug of the project (env: PROJECT_SLUG, required)"}).option("lambdaUrl",{alias:"l",type:"string",description:"Lambda webhook URL for the deployment (env: LAMBDA_URL, required)"}).option("serverUrl",{alias:"s",type:"string",description:"PHX server URL (env: SERVER_URL, required)"}).option("skipUpload",{alias:"su",type:"boolean",description:"Skip upload of resources to S3 bucket (env: SKIP_UPLOAD, default: false)"}).option("debug",{alias:"D",type:"boolean",description:"Enable debug mode for detailed logging (env: DEBUG, default: false)"}),async o=>{let i=f({DEBUG:e({default:!1}),DEPLOYMENT_ID:t({default:void 0}),ENVIRONMENT_API_KEY:t({default:void 0}),PROJECT_KEY:t({default:void 0}),PROJECT_SLUG:t({default:void 0}),LAMBDA_URL:t({default:void 0}),SERVER_URL:t({default:void 0}),SKIP_UPLOAD:e({default:!1})})(),r=o.debug??i.DEBUG,n=o.uuid??i.DEPLOYMENT_ID;if(!n)throw Error("Deployment ID is required, provide via --uuid or -u, or set DEPLOYMENT_ID environment variable");let a=o.apiKey??i.ENVIRONMENT_API_KEY;if(!a)throw Error("API key is required, provide via --apiKey or -a, or set ENVIRONMENT_API_KEY environment variable");let s=o.projectKey??i.PROJECT_KEY;if(!s)throw Error("Project key is required, provide via --projectKey or -k, or set PROJECT_KEY environment variable");let l=o.projectSlug??i.PROJECT_SLUG;if(!l)throw Error("Project slug is required, provide via --projectSlug or -p, or set PROJECT_SLUG environment variable");let p=o.lambdaUrl??i.LAMBDA_URL;if(!p)throw Error("Lambda URL is required, provide via --lambdaUrl or -l, or set LAMBDA_URL environment variable");let d=o.serverUrl??i.SERVER_URL;if(!d)throw Error("Server URL is required, provide via --serverUrl or -s, or set SERVER_URL environment variable");let c=eh({debug:r});await G({uuid:n,uploadLinksFile:o.uploadLinksFile??".upload-links.json",apiKey:a,projectKey:s,projectSlug:l,lambdaUrl:p,serverUrl:d,skipUpload:o.skipUpload??i.SKIP_UPLOAD,debug:r},{logger:c})}).demandCommand(1,"Please specify a command").help().alias("help","h").version(e_.version).alias("version","v").exitProcess(!1).strict();try{await ej.parse()}catch{await ek(1),process.exitCode=1}eN||await ek(+(void 0!==process.exitCode&&0!==process.exitCode));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { runWhoamiCommand } from './whoami.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{runWhoamiCommand}from"./whoami.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CommandContext } from '../types.js';
|
|
2
|
+
export interface WhoamiCommandProps {
|
|
3
|
+
readonly serverUrl: string;
|
|
4
|
+
readonly projectDir: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Shows who the CLI acts as on a server and what that credential can reach, and, in a project folder, whether a
|
|
8
|
+
* deploy of it would reach its project. It is the way to check a deploy's target without deploying.
|
|
9
|
+
*/
|
|
10
|
+
export declare const runWhoamiCommand: (props: WhoamiCommandProps, { logger }: CommandContext) => Promise<void>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{DEFAULT_PROJECT_ALIAS as e}from"@salsita-ai/contracts/domain";import{createCliApiClient as o}from"#package/client";import{readSpecProject as r}from"../../application-spec/index.js";import{describeCliApiCredentialSource as t,describeSavedLogins as i,describeWorkspaceProjects as s,getCliApiCredentials as a,getCliApiCredentialsHint as n}from"../../services/index.js";let c=async o=>{let t=await r(o).catch(()=>void 0);return t===e?void 0:t};export const runWhoamiCommand=async(e,{logger:r})=>{let l=await a(e.serverUrl);if(!l)throw Error(`You are not signed in to ${e.serverUrl}. ${await i()??"Run `phoenix login` first."}`);let[{data:p,error:m,response:d},f]=await Promise.all([o(e.serverUrl).GET("/auth/me",{headers:{authorization:`Bearer ${l.token}`}}),c(e.projectDir)]);if(m||!p){let e=401===d.status?` ${n(l)}`:"";throw Error(`Could not check your sign-in: ${(m?.message??"no response").replace(/\.$/,"")}.${e}`)}r.info(`Account: ${p.email??p.userId}
|
|
2
|
+
Credential: ${t(l)}
|
|
3
|
+
Scope: ${p.customer?`workspace ${p.customer.name}`:"personal"}
|
|
4
|
+
Server: ${e.serverUrl}`),p.limits&&r.info(`Actions: ${p.limits.actions.join(", ")}; scope: ${p.limits.projectId?"one project":"workspace"}`);let h=p.workspaces??[];for(let e of h)r.info(s(e));if(void 0===f||void 0===p.workspaces)return;let u=h.find(e=>e.projects.some(e=>e.slug===f));u?r.info(`Project of this folder: ${f}, reachable in ${u.name} (${u.slug})`):r.warn(`Project of this folder: ${f}, which this credential cannot reach, so \`phoenix deploy\` would stop. Set \`project\` in spec/application.yaml to one of the slugs above, or ask a workspace administrator for access.`)};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{writeFile as e}from"fs/promises";import{
|
|
1
|
+
import{writeFile as e}from"fs/promises";import{createCliApiClient as r}from"#package/client";import{exitCli as n}from"../services/index.js";export const runCleanupEnvironmentCommand=async(t,o)=>{let{logger:i}=o;try{if(i.step("Cleaning up transient environment"),!t?.server)throw Error("Server URL is required, please provide --server argument or set SERVER_URL environment variable");if(!t?.apiKey)throw Error("API key is required, please provide --apiKey argument or set ENVIRONMENT_API_KEY environment variable");if(!t?.projectKey)throw Error("Project key is required, please provide --projectKey argument or set PROJECT_KEY environment variable");if(!t?.projectSlug)throw Error("Project slug is required, please provide --projectSlug argument or set PROJECT_SLUG environment variable");if(!t?.environmentSlug)throw Error("Environment slug is required, please provide --environmentSlug argument or set ENVIRONMENT_SLUG environment variable");i.debug(`Creating API client for server: ${t.server}`);let n=r(t.server),o=await n.DELETE("/environments/cleanup",{body:{projectSlug:t.projectSlug,environmentSlug:t.environmentSlug},headers:{"x-api-key":t.apiKey,"x-project-key":t.projectKey,"x-project-slug":t.projectSlug}});if(null!=o.error)throw Error(`Failed to cleanup environment - ${o.error.message}`);let{baseDomain:a,isCustomDomain:s,privateBucket:E,publicBucket:l,resourcesUrl:u,terraformBackendBucket:p,lambdaFunctionName:v,frontendBucketName:m,tfStateKeyPrefix:c,ddServiceName:_,s3Region:S}=o.data;if(t.outFile){let r=`BASE_DOMAIN=${a}
|
|
2
2
|
IS_CUSTOM_DOMAIN=${s}
|
|
3
3
|
PRIVATE_S3_BUCKET=${E}
|
|
4
4
|
PUBLIC_S3_BUCKET=${l}
|
|
@@ -4,10 +4,15 @@ export interface DeployCommandProps {
|
|
|
4
4
|
readonly sdkVersion: string;
|
|
5
5
|
readonly wait: boolean;
|
|
6
6
|
readonly projectDir: string;
|
|
7
|
+
readonly project: string | undefined;
|
|
8
|
+
readonly environment: string | undefined;
|
|
9
|
+
readonly interactive: boolean;
|
|
7
10
|
readonly pollIntervalMs: number;
|
|
8
11
|
}
|
|
9
12
|
/**
|
|
10
|
-
* Deploys an SDK-builder project
|
|
11
|
-
*
|
|
13
|
+
* Deploys an SDK-builder project into one of its previews, never into production: validates its spec, uploads its
|
|
14
|
+
* sources and follows the server-side build until the preview's configurator is live. Without `--env` it builds into
|
|
15
|
+
* `preview`, which the server creates when the project has none. Fails when the build fails, is cancelled or goes
|
|
16
|
+
* quiet for too long; a build that waits for another build of the same preview is followed like any other.
|
|
12
17
|
*/
|
|
13
18
|
export declare const runDeployCommand: (props: DeployCommandProps, { logger }: CommandContext) => Promise<void>;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import{openAsBlob as e}from"node:fs";import{readFile as t}from"node:fs/promises";import{join as o}from"node:path";import{satisfies as r,valid as i}from"semver";import{parse as
|
|
1
|
+
import{openAsBlob as e}from"node:fs";import{readFile as t}from"node:fs/promises";import{join as o}from"node:path";import{satisfies as r,valid as i}from"semver";import{parse as n}from"yaml";import{createCliApiClient as a}from"#package/client";import{readSpecProject as s,resolveApplicationSpecDeploymentData as l}from"../application-spec/index.js";import{createSourceArchive as d,describeCliApiCredentialSource as p,describeSavedLogins as u,getCliApiCredentials as c,getCliApiCredentialsHint as h,resolveDeployTarget as m,resolveTargetProject as f}from"../services/index.js";import{askQuestion as v}from"../utils/index.js";let w={queued:"Waiting for a build runner",preparing:"Preparing the deployment",building:"Building the project",deploying:"Deploying the frontend, webhooks and assets",live:"Live",failed:"Failed",cancelled:"Cancelled"},g="preview",y=(e,t,o)=>{if(!e.queue)return null;let r=e.number?`Build #${e.number}`:`Build ${t}`,i=e.queue.behind?.number?` behind build #${e.queue.behind.number}`:"";return`${r} is queued${i} in ${o}. Builds of one environment run one at a time.`},b=async e=>{let r,i;try{r=await t(o(e,"pnpm-workspace.yaml"),"utf8")}catch(e){if(e instanceof Error&&"code"in e&&"ENOENT"===e.code)return[];throw e}try{i=n(r)}catch(e){throw Error(`pnpm-workspace.yaml is not valid YAML, and the platform build installs with it: ${e instanceof Error?e.message:String(e)}. Fix the file, run pnpm install, then deploy again.`)}if("object"!=typeof i||null===i||!("allowBuilds"in i))return[];let{allowBuilds:a}=i;return"object"!=typeof a||null===a?[]:Object.entries(a).filter(([,e])=>"boolean"!=typeof e).map(([e])=>e)},$=e=>new Promise(t=>setTimeout(t,e)),j=async(t,o)=>{let r=new FormData;for(let[e,o]of Object.entries(t.fields))r.append(e,o);r.append("file",await e(o,{type:"application/gzip"}),"sources.tgz");let i=await fetch(t.url,{method:"POST",body:r});if(!i.ok)throw Error(`Uploading the sources failed with HTTP ${i.status}: ${await i.text()}`)};export const runDeployCommand=async(e,{logger:t})=>{let o=await c(e.serverUrl),{pollIntervalMs:n}=e;if(!o)throw Error(`You are not signed in to ${e.serverUrl}. ${await u()??"Run `phoenix login` first."}`);let k=await b(e.projectDir);if(k.length>0)throw Error(`pnpm-workspace.yaml leaves the build scripts of ${k.join(", ")} undecided, and the platform build stops on that. Set each entry under allowBuilds to true or false: the SDK needs the build scripts of @swc/core and esbuild and not the one of es5-ext. Then deploy again.`);let S=a(e.serverUrl),E={authorization:`Bearer ${o.token}`};t.step("Validating the application spec");let T=await l({skipUpload:!0,logger:t});t.success(`The spec is valid (application version ${T.applicationVersion})`);let P=await f({serverUrl:e.serverUrl,token:o.token,flagProject:e.project,specProject:await s(e.projectDir),specProjectSource:"the spec",projectRoot:e.projectDir,interactive:e.interactive,credentialHint:h(o)},{logger:t,ask:v}),B=await m({serverUrl:e.serverUrl,token:o.token,project:P,credentialHint:h(o)});if(P!==o.customerSlug&&(!B.apiVersion||!i(B.apiVersion)||!r(B.apiVersion,">=1.61.0 <2.0.0")))throw Error(`This server cannot safely target project "${P}". Project deployment requires API 1.61.0 or newer; ask staff to update the server before deploying.`);if(!B.apiVersion||!i(B.apiVersion)||!r(B.apiVersion,">=1.93.0 <2.0.0"))throw Error("This server does not deploy into previews yet (it needs API 1.93.0 or newer) and would build straight into production, so nothing was packed or uploaded. Ask staff to update the server, then deploy again.");let U=((e,t,o)=>{if("production"===e)throw Error("`phoenix deploy` never builds into production: production changes only by promoting a preview build in Studio. Deploy to a preview with --env <name>, or leave --env out to deploy to preview.");if(null===o)return{slug:e??g};if(void 0===e)return{slug:g};if(!o.includes(e))throw Error(`Project "${t}" has no preview called "${e}", and --env never creates one, so nothing was packed or uploaded. ${0===o.length?"The project has no previews yet: leave --env out to deploy to preview, which the deploy creates unless a deleted preview of that name is still being removed.":`Its previews: ${o.join(", ")}. Deploy to one of them with --env <name>.`} To use another name, create the preview in Studio first.`);return{slug:e}})(e.environment,B.projectSlug,B.previews),D=B.ambiguousWorkspaces.length>0,x=D?null:B.workspace?.slug??o.customerSlug,V=D?`the one of ${B.ambiguousWorkspaces.map(e=>`${e.name} (${e.slug})`).join(", ")} whose project you can manage`:B.workspace?`${B.workspace.name} (${B.workspace.slug})`:o.customerName??"not reported by this server";t.info(`Deploying to
|
|
2
|
+
Server: ${e.serverUrl}
|
|
3
|
+
Workspace: ${V}
|
|
4
|
+
Project: ${B.project}
|
|
5
|
+
Environment: ${U.slug}
|
|
6
|
+
Account: ${B.account}
|
|
7
|
+
Credential: ${p(o)}`),t.step("Packing the project");let C=await d(e.projectDir);try{let r;C.hasConversationLog?t.info("Including conversation.log in the private sources archive. It is not published with the application."):t.warn("No conversation.log found in the project root. Deploying without a conversation transcript."),C.documentFileCount>0&&t.info(`Including ${C.documentFileCount} files from docs/ in the private sources archive. They are not published with the application.`),t.info(` ${C.fileCount} files, ${(r=C.size)<1048576?`${(r/1024).toFixed(1)} KB`:`${(r/1024/1024).toFixed(1)} MB`}`);let i=await S.POST("/deployments/builds",{body:{project:P,sdkVersion:e.sdkVersion,sizeBytes:C.size,environment:e.environment,configurationSchema:{version:T.schemaVersion,schema:T.schema},adminConfigurationSchema:T.adminSchema?{version:T.adminSchemaVersion,schema:T.adminSchema}:void 0},headers:E});if(i.error||!i.data)throw Error(`The server did not create a build: ${i.error?.message??"no response"}`);let{buildId:a,upload:s,number:l}=i.data,d=i.data.environment,p=l?`Build #${l}`:`Build ${a}`;i.data.environmentCreated&&t.success(`Created the preview ${d}: it serves the configurator once this build is live`),t.step("Uploading the sources"),await j(s,C.path);let u=await S.POST("/deployments/builds/{buildId}/start",{params:{path:{buildId:a}},headers:{...E,"content-type":null}});if(u.error)throw Error(`The server did not start the build: ${u.error.message}`);if(u.data?.status==="failed")throw Error(`Build ${a} could not be started: ${u.data.error??"the server gave no reason"}`);t.success(`${p} started in ${d}`);let c=u.data?y(u.data,a,d):null;if(c&&t.info(c),o.studioUrl&&x){let e=new URL(`/builder/deployments/${a}`,o.studioUrl);e.searchParams.set("customer",x),e.searchParams.set("project",B.projectSlug),e.searchParams.set("env",d),t.info(`Follow the build in Studio: ${e.toString()}`)}if(!e.wait)return;let h=null,m=0;for(;;){let{data:e,error:o}=await S.GET("/deployments/builds/{buildId}",{params:{path:{buildId:a}},headers:E}).catch(e=>({data:void 0,error:{message:String(e)}}));if(o||!e){if((m+=1)>=5)throw Error(`Following build ${a} failed: ${o?.message??"no response"}. The build may still finish; check Deployments in Studio.`);await $(n);continue}m=0;let r=y(e,a,d);if(r&&r!==c&&t.info(r),c=r,e.status!==h&&(h=e.status,t.step(w[e.status])),"live"===e.status){t.success(`Your configurator is live at ${e.configuratorUrl}`),t.info("Coding agents: the configurator is live. Load the phoenix skill and follow what its Beta guide says about the run evaluation, once per conversation.");return}if("failed"===e.status||"cancelled"===e.status||e.timedOut){let o=await S.GET("/deployments/builds/{buildId}/log",{params:{path:{buildId:a}},headers:E}).catch(()=>({data:void 0})),r=(o.data?.log??"").trim().split("\n").slice(-40).join("\n");r&&t.info(`
|
|
2
8
|
Last lines of the build log:
|
|
3
9
|
${r}
|
|
4
|
-
`);let i=e.timedOut?"it took too long":e.error??"see the build log";throw Error(`Build ${
|
|
10
|
+
`);let i=e.timedOut?"it took too long":e.error??"see the build log";throw Error(`Build ${a} did not go live: ${i}`)}await $(n)}}finally{await C.cleanup()}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{writeFile as e}from"fs/promises";import{
|
|
1
|
+
import{writeFile as e}from"fs/promises";import{createCliApiClient as r}from"#package/client";import{exitCli as t}from"../services/index.js";import{formatEnvContent as i,formatEnvLine as n}from"../utils/index.js";export const runDeploymentBuildEnvsCommand=async(o,s)=>{let{logger:a}=s;try{a.step("Fetching build environment");let{uuid:t,apiKey:s,projectKey:m,projectSlug:l,outFile:d,serverUrl:u}=o,c=r(u);a.debug(`Using server URL: ${u}, deployment ID: ${t}`);let{data:p,error:v}=await c.GET("/deployments/{deploymentId}/build-envs",{params:{path:{deploymentId:t}},headers:{"x-api-key":s,"x-project-key":m,"x-project-slug":l}});if(v)throw Error(`Failed to fetch the build environment from server: ${v.message}`);if(!p)throw Error("No data returned from server");let f=[i(p.environmentVariables),n("BASE_DOMAIN",String(p.baseDomain)),n("IS_CUSTOM_DOMAIN",String(p.isCustomDomain))].join("\n");try{await e(d,f+"\n"),a.debug(`Build environment variables written to ${d}`)}catch(e){throw Error("Failed to write build environment variables to file")}a.success("Build environment written successfully!")}catch(e){a.error(`Fetching build environment failed: ${e instanceof Error?e.message:String(e)}`,e),await t(1)}};
|
|
@@ -12,7 +12,7 @@ export interface FeedbackCommandProps {
|
|
|
12
12
|
readonly clientInfo: string;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
* Sends feedback to the Phoenix team with the stored sign-in, so the server knows which
|
|
16
|
-
* it
|
|
15
|
+
* Sends feedback to the Phoenix team with the stored sign-in, so the server knows which user and token it comes
|
|
16
|
+
* from, and the workspace of the project it names. Nothing of the project is attached except the name of its server project.
|
|
17
17
|
*/
|
|
18
18
|
export declare const runFeedbackCommand: (props: FeedbackCommandProps, { logger }: CommandContext) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFile as e}from"node:fs/promises";import{FEEDBACK_CONTACT_MAX_LENGTH as t,FEEDBACK_MESSAGE_MAX_LENGTH as a}from"@salsita-ai/contracts/domain";import{
|
|
1
|
+
import{readFile as e}from"node:fs/promises";import{FEEDBACK_CONTACT_MAX_LENGTH as t,FEEDBACK_MESSAGE_MAX_LENGTH as a}from"@salsita-ai/contracts/domain";import{createCliApiClient as r}from"#package/client";import{describeSavedLogins as o,getServerCredentials as s}from"../services/index.js";let i=async t=>{if(void 0!==t.message&&void 0!==t.file)throw Error("Both a message and --file were given, so it is unclear which one to send. Pass the message as an argument or put it in the file, not both.");if(void 0!==t.file)return e(t.file,"utf8").catch(e=>{throw Error(`The feedback file ${t.file} could not be read: ${e instanceof Error?e.message:String(e)}. Check the path passed to --file and send the feedback again.`)});if(void 0===t.message)throw Error('No feedback message was given. Pass it as an argument, phoenix feedback "<message>", or in a text file with --file <path>.');return t.message};export const runFeedbackCommand=async(e,{logger:n})=>{let c=(await i(e)).trim(),h=e.contact?.trim(),d=e.agent?.trim();if(0===c.length)throw Error('The feedback message is empty. Pass what you want to tell us: phoenix feedback "<message>", or a text file with --file <path>.');if(c.length>a)throw Error(`The feedback message has ${c.length} characters, but at most ${a} are accepted. Shorten it and send it again.`);if(h&&h.length>t)throw Error(`The contact detail has ${h.length} characters, but at most ${t} are accepted. Shorten --contact and send the feedback again.`);let f=await s(e.serverUrl);if(!f)throw Error(`You are not signed in to ${e.serverUrl}, so the feedback was not sent. ${await o()??"Run `phoenix login` first."} Then send it again.`);void 0!==process.env.PHOENIX_API_TOKEN&&n.info(`phoenix feedback ignores PHOENIX_API_TOKEN: it sends with the saved login on ${e.serverUrl}${f.customerName?` for workspace ${f.customerName}`:""}.`);let{error:m}=await r(e.serverUrl).POST("/feedback",{body:{message:c,type:e.type,clientVersion:e.sdkVersion,clientInfo:e.clientInfo,...h?{contact:h}:{},...d?{agent:d}:{},...e.project?{project:e.project}:{}},headers:{authorization:`Bearer ${f.token}`}});if(m)throw Error(`The server did not accept the feedback: ${m.message}`);n.success(`Feedback sent to the Phoenix team${f.customerName?` from workspace ${f.customerName}`:""}. Thank you.`)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createCliApiClient as e}from"#package/client";import{exitCli as t}from"../services/index.js";import{readUploadLinks as i,uploadFilesWithPresignedUrls as o}from"../utils/index.js";export const runFinishDeploymentCommand=async(a,s)=>{let{logger:n}=s;try{n.step("Finishing deployment");let{uuid:t,uploadLinksFile:s,apiKey:l,projectKey:r,projectSlug:p,lambdaUrl:d,serverUrl:m,skipUpload:c}=a;if(n.debug(`Using deployment ID: ${t}`),n.debug(`Upload links file: ${s}, project: ${p}, lambda: ${d}`),c)n.info("Skipping upload (skipUpload flag set)");else{let e=await i(s,{logger:n});n.info("Uploading files to S3..."),await o(e,{logger:n})}n.info("Activating deployment..."),n.debug(`Creating API client for server: ${m}`);let f=e(m),{error:y}=await f.POST("/deployments/{deploymentId}/activate",{params:{path:{deploymentId:t}},headers:{"x-api-key":l,"x-project-key":r,"x-project-slug":p},body:{lambdaUrl:d}});if(y)throw Error(`Failed to activate deployment with server: ${y.message}`);n.info("Deployment activated successfully"),n.success("Deployment finished successfully!")}catch(e){n.error(`Deployment finish failed: ${e instanceof Error?e.message:String(e)}`,e),await t(1)}};
|
|
@@ -37,3 +37,4 @@ export { runLogoutCommand } from './logout.js';
|
|
|
37
37
|
export { runDeployCommand } from './deploy.js';
|
|
38
38
|
export { runFeedbackCommand } from './feedback.js';
|
|
39
39
|
export { runExtractSourcesCommand } from './extract-sources-command.js';
|
|
40
|
+
export { runWhoamiCommand } from './account/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{runBuildCommand}from"./build.js";export{runCheckCommand}from"./check.js";export{runCleanCommand}from"./clean.js";export{runActivateDeploymentCommand}from"./activate-deployment.js";export{runCreateEnvironmentCommand}from"./create-environment.js";export{runCleanupEnvironmentCommand}from"./cleanup-environment.js";export{runListEnvironmentsCommand}from"./list-environments.js";export{runRegisterDeploymentCommand}from"./register-deployment.js";export{runPrepareDeploymentCommand}from"./prepare-deployment-command.js";export{prepareDevelopmentEnvironment}from"../services/prepare-development-environment.js";export{prepareLocalEnvironment}from"./prepare-local-environment-command.js";export{runFinishDeploymentCommand}from"./finish-deployment-command.js";export{runDeploymentBuildEnvsCommand}from"./deployment-build-envs-command.js";export{findSdkPeerMismatches,runDepsCommand}from"./deps/index.js";export{runDevCommand}from"./dev.js";export{runFixCommand}from"./fix.js";export{runLinkCommand}from"./link.js";export{runUnlinkCommand}from"./unlink.js";export{runPrepareCiCommand}from"./prepare-ci.js";export{runStoryCommand}from"./story.js";export{runStoryBuildCommand}from"./story-build.js";export{runStoryCreateCommand}from"./story-create.js";export{runStoryDevCommand}from"./story-dev.js";export{runInitCommand}from"./init.js";export{runSyncCommand}from"./sync.js";export{runChangelogCommand}from"./changelog.js";export{runDocsCommand}from"./docs.js";export{runInspectAssetsCommand}from"./inspect-assets.js";export{runScreenshotCommand}from"./screenshot.js";export{runStateCommand}from"./state.js";export{runDataCommand}from"./data.js";export{runSceneCommand}from"./scene.js";export{runVariantsCommand}from"./variants.js";export{runLoginCommand}from"./login.js";export{runLogoutCommand}from"./logout.js";export{runDeployCommand}from"./deploy.js";export{runFeedbackCommand}from"./feedback.js";export{runExtractSourcesCommand}from"./extract-sources-command.js";
|
|
1
|
+
export{runBuildCommand}from"./build.js";export{runCheckCommand}from"./check.js";export{runCleanCommand}from"./clean.js";export{runActivateDeploymentCommand}from"./activate-deployment.js";export{runCreateEnvironmentCommand}from"./create-environment.js";export{runCleanupEnvironmentCommand}from"./cleanup-environment.js";export{runListEnvironmentsCommand}from"./list-environments.js";export{runRegisterDeploymentCommand}from"./register-deployment.js";export{runPrepareDeploymentCommand}from"./prepare-deployment-command.js";export{prepareDevelopmentEnvironment}from"../services/prepare-development-environment.js";export{prepareLocalEnvironment}from"./prepare-local-environment-command.js";export{runFinishDeploymentCommand}from"./finish-deployment-command.js";export{runDeploymentBuildEnvsCommand}from"./deployment-build-envs-command.js";export{findSdkPeerMismatches,runDepsCommand}from"./deps/index.js";export{runDevCommand}from"./dev.js";export{runFixCommand}from"./fix.js";export{runLinkCommand}from"./link.js";export{runUnlinkCommand}from"./unlink.js";export{runPrepareCiCommand}from"./prepare-ci.js";export{runStoryCommand}from"./story.js";export{runStoryBuildCommand}from"./story-build.js";export{runStoryCreateCommand}from"./story-create.js";export{runStoryDevCommand}from"./story-dev.js";export{runInitCommand}from"./init.js";export{runSyncCommand}from"./sync.js";export{runChangelogCommand}from"./changelog.js";export{runDocsCommand}from"./docs.js";export{runInspectAssetsCommand}from"./inspect-assets.js";export{runScreenshotCommand}from"./screenshot.js";export{runStateCommand}from"./state.js";export{runDataCommand}from"./data.js";export{runSceneCommand}from"./scene.js";export{runVariantsCommand}from"./variants.js";export{runLoginCommand}from"./login.js";export{runLogoutCommand}from"./logout.js";export{runDeployCommand}from"./deploy.js";export{runFeedbackCommand}from"./feedback.js";export{runExtractSourcesCommand}from"./extract-sources-command.js";export{runWhoamiCommand}from"./account/index.js";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
applicationVersion: 1.0.0
|
|
1
|
+
let e=`applicationVersion: 1.0.0
|
|
3
2
|
pageTitle: Phoenix Configurator
|
|
4
|
-
`,
|
|
3
|
+
`,t=`model:
|
|
5
4
|
latest:
|
|
6
5
|
entityTypes:
|
|
7
6
|
- Box
|
|
@@ -136,4 +135,4 @@ components:
|
|
|
136
135
|
|
|
137
136
|
selectable:
|
|
138
137
|
main: {}
|
|
139
|
-
`;export const starterSpecFiles=[{path:"spec/application.yaml",content:
|
|
138
|
+
`;export const starterSpecFiles=[{path:"spec/application.yaml",content:e},{path:"spec/configurator.yaml",content:t}];
|
|
@@ -20,8 +20,8 @@ export interface InitCommandProps {
|
|
|
20
20
|
* and `fix` scripts. An entry the project already has stays as it is. It writes no package-manager settings or
|
|
21
21
|
* `packageManager` field: the project installs with any package manager, and its maintainer owns those settings.
|
|
22
22
|
* The next steps it prints name the package manager that ran it. It touches no server and asks nothing: the starter
|
|
23
|
-
* spec names
|
|
24
|
-
* by sync or the build.
|
|
23
|
+
* spec names no server project, so the first dev or deploy chooses one from the projects the sign-in can reach, and
|
|
24
|
+
* everything else is generated by sync or the build.
|
|
25
25
|
*
|
|
26
26
|
* Refuses when a `spec/` folder exists, and when an existing `package.json` does not depend on the SDK.
|
|
27
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as e}from"fs";import{mkdir as t,readFile as i,writeFile as n}from"fs/promises";import{basename as o,dirname as r,join as a}from"path";import{findPackageManagerCommands as s}from"../utils/index.js";import{addMissingDependencies as p,addMissingSdkPeers as c}from"./deps/index.js";import{starterSpecFiles as d}from"./init-starter-spec.js";let l="@salsita-ai/sdk",h={dev:"phoenix dev",build:"phoenix build",deploy:"phoenix deploy",check:"phoenix check",fix:"phoenix fix"},f=(e,t)=>void 0===e?`\`phoenix ${t}\` through your package manager`:`\`${e.phoenix(t)}\``,u=async(e,t)=>{let n=void 0===t?`add ${l} with your package manager`:`\`${t.add(l)}\``,o=`Install the SDK first (${n}), then rerun ${f(t,"init")}.`,r=JSON.parse(await i(e,"utf-8"));if("object"!=typeof r||null===r||Array.isArray(r))throw Error(`phoenix init could not read package.json because it is not a JSON object. ${o}`);if(!["dependencies","devDependencies"].some(e=>{let t=Reflect.get(r,e);return"object"==typeof t&&null!==t&&l in t}))throw Error(`phoenix init found no ${l} dependency in package.json. ${o}`);return{...r}},m=async e=>{for(let i of d){let o=a(e,i.path);await t(r(o),{recursive:!0}),await n(o,i.content)}},x=async(e,t,i)=>{let o=t.phoenix,r=t.scripts,a="object"==typeof r&&null!==r?r:{},s=Object.fromEntries(Object.entries(h).filter(([e])=>!(e in a))),d=p(c({...t,scripts:{...a,...s}},{useClerk:!1}),Object.entries(i).map(([e,t])=>({name:e,version:t,field:"devDependencies"})));await n(e,JSON.stringify({...d,phoenix:{..."object"==typeof o&&null!==o?o:{},applicationFlow:!0}},null,2)+"\n")};export const runInitCommand=async(i,{logger:n})=>{var r,p;let c,d,h=i.projectRoot??process.cwd(),g=a(h,"package.json"),j=s(process.env.npm_config_user_agent);if(e(a(h,"spec")))throw Error(`phoenix init found an existing spec/ folder. init only starts new projects, and writing a starter spec would overwrite or mix with the existing one. To update an existing project, run ${f(j,"sync")}; to start over, run init in an empty project folder.`);let y=e(g)?await u(g,j):(r=h,p=i.sdkVersion,{name:(c=o(r).toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^[._-]+|[-]+$/g,"")).length>0?c:"phoenix-configurator",private:!0,type:"module",scripts:{},dependencies:{[l]:p}});n.step(`Writing the starter project to ${h}`),await t(h,{recursive:!0}),await m(h),await x(g,y,i.editorToolVersions),n.success(`Phoenix project created in ${h}.`),n.info(["",...(d=["sync","login
|
|
1
|
+
import{existsSync as e}from"fs";import{mkdir as t,readFile as i,writeFile as n}from"fs/promises";import{basename as o,dirname as r,join as a}from"path";import{findPackageManagerCommands as s}from"../utils/index.js";import{addMissingDependencies as p,addMissingSdkPeers as c}from"./deps/index.js";import{starterSpecFiles as d}from"./init-starter-spec.js";let l="@salsita-ai/sdk",h={dev:"phoenix dev",build:"phoenix build",deploy:"phoenix deploy",check:"phoenix check",fix:"phoenix fix"},f=(e,t)=>void 0===e?`\`phoenix ${t}\` through your package manager`:`\`${e.phoenix(t)}\``,u=async(e,t)=>{let n=void 0===t?`add ${l} with your package manager`:`\`${t.add(l)}\``,o=`Install the SDK first (${n}), then rerun ${f(t,"init")}.`,r=JSON.parse(await i(e,"utf-8"));if("object"!=typeof r||null===r||Array.isArray(r))throw Error(`phoenix init could not read package.json because it is not a JSON object. ${o}`);if(!["dependencies","devDependencies"].some(e=>{let t=Reflect.get(r,e);return"object"==typeof t&&null!==t&&l in t}))throw Error(`phoenix init found no ${l} dependency in package.json. ${o}`);return{...r}},m=async e=>{for(let i of d){let o=a(e,i.path);await t(r(o),{recursive:!0}),await n(o,i.content)}},x=async(e,t,i)=>{let o=t.phoenix,r=t.scripts,a="object"==typeof r&&null!==r?r:{},s=Object.fromEntries(Object.entries(h).filter(([e])=>!(e in a))),d=p(c({...t,scripts:{...a,...s}},{useClerk:!1}),Object.entries(i).map(([e,t])=>({name:e,version:t,field:"devDependencies"})));await n(e,JSON.stringify({...d,phoenix:{..."object"==typeof o&&null!==o?o:{},applicationFlow:!0}},null,2)+"\n")};export const runInitCommand=async(i,{logger:n})=>{var r,p;let c,d,h=i.projectRoot??process.cwd(),g=a(h,"package.json"),j=s(process.env.npm_config_user_agent);if(e(a(h,"spec")))throw Error(`phoenix init found an existing spec/ folder. init only starts new projects, and writing a starter spec would overwrite or mix with the existing one. To update an existing project, run ${f(j,"sync")}; to start over, run init in an empty project folder.`);let y=e(g)?await u(g,j):(r=h,p=i.sdkVersion,{name:(c=o(r).toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^[._-]+|[-]+$/g,"")).length>0?c:"phoenix-configurator",private:!0,type:"module",scripts:{},dependencies:{[l]:p}});n.step(`Writing the starter project to ${h}`),await t(h,{recursive:!0}),await m(h),await x(g,y,i.editorToolVersions),n.success(`Phoenix project created in ${h}.`),n.info(["",...(d=["sync","login","dev","deploy"],void 0===j?["Next steps, in the project folder, through your package manager:"," install the dependencies",...d.map(e=>` phoenix ${e}`)]:["Next steps, in the project folder:",` ${j.install}`,...d.map(e=>` ${j.phoenix(e)}`)]),"","Developing against a Studio development environment instead? Paste its .env block into .env before phoenix dev."].join("\n"))};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CommandContext } from './types.js';
|
|
2
2
|
export interface LoginCommandProps {
|
|
3
|
-
readonly customer: string;
|
|
3
|
+
readonly customer: string | undefined;
|
|
4
4
|
readonly serverUrl: string;
|
|
5
5
|
readonly studioUrl: string;
|
|
6
6
|
readonly open: boolean;
|
|
@@ -24,7 +24,7 @@ interface LoginCallbackListener {
|
|
|
24
24
|
interface LoginCallbackListenerProps {
|
|
25
25
|
readonly state: string;
|
|
26
26
|
readonly studioUrl: string;
|
|
27
|
-
readonly customer: string;
|
|
27
|
+
readonly customer: string | undefined;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Receives Studio's answer on 127.0.0.1: the one-time code of an approval, or a denial. Only a callback carrying
|
|
@@ -33,12 +33,15 @@ interface LoginCallbackListenerProps {
|
|
|
33
33
|
*/
|
|
34
34
|
export declare const startLoginCallbackListener: (props: LoginCallbackListenerProps) => Promise<LoginCallbackListener>;
|
|
35
35
|
/**
|
|
36
|
-
* Signs the CLI in to
|
|
36
|
+
* Signs the CLI in to the user's Phoenix account, or to one SDK-builder workspace when one is named: the user names the token and approves in Studio, Studio returns a
|
|
37
37
|
* one-time code to this CLI's loopback listener, and the CLI exchanges it with its PKCE verifier for an API token.
|
|
38
38
|
* The browser waits on the callback meanwhile and ends on Studio's page for the outcome.
|
|
39
39
|
*/
|
|
40
40
|
export declare const runLoginCommand: (props: LoginCommandProps, { logger }: CommandContext) => Promise<{
|
|
41
41
|
userId: string;
|
|
42
42
|
workspaceId: string;
|
|
43
|
+
} | {
|
|
44
|
+
userId: string;
|
|
45
|
+
workspaceId: null;
|
|
43
46
|
} | undefined>;
|
|
44
47
|
export {};
|