@salsita-ai/sdk 0.50.0-develop.eb204e0da4 → 0.50.0-develop.f42416a4e6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -11
- package/dist/application-spec/errors/diagnostic-codes.d.ts +6 -0
- package/dist/application-spec/errors/diagnostic-codes.js +1 -1
- package/dist/application-spec/errors/diagnostic-messages.d.ts +6 -0
- package/dist/application-spec/errors/diagnostic-messages.js +1 -1
- package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
- package/dist/application-spec/generate-application/code/templates/application-types.js +6 -6
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js +11 -8
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.d.ts +3 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +70 -66
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +3 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec.js +5 -5
- package/dist/application-spec/generate-application/code/templates/domain.js +2 -2
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.d.ts +11 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.js +8 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/globals.js +1 -0
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-create-configurator-skill.js +3 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +39 -16
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +4 -2
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +3 -1
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +2 -0
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/actions-runtime.d.ts +14 -0
- package/dist/application-spec/generate-application/runtime/sections/actions-runtime.js +1 -0
- package/dist/application-spec/generate-application/runtime/sections/index.d.ts +1 -0
- package/dist/application-spec/generate-application/runtime/sections/index.js +1 -1
- package/dist/application-spec/parse-application-files/categorize/categorize-files.d.ts +3 -1
- package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
- package/dist/application-spec/parse-application-files/merge/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/merge/index.js +1 -1
- package/dist/application-spec/parse-application-files/merge/merged-actions.d.ts +11 -0
- package/dist/application-spec/parse-application-files/merge/merged-actions.js +1 -0
- package/dist/application-spec/parse-application-files/merge/merged-spec.d.ts +2 -0
- package/dist/application-spec/parse-application-files/merge/merged-spec.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/raw-spec/index.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-actions.d.ts +18 -0
- package/dist/application-spec/parse-application-files/raw-spec/raw-actions.js +1 -0
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +14 -2
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.d.ts +2 -0
- package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
- package/dist/application-spec/parse-application-files/resolve/resolve-import-modules.js +1 -1
- package/dist/application-spec/parse-application-files/spec/application/application-spec.js +1 -1
- package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.d.ts +4 -2
- package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.js +1 -1
- package/dist/application-spec/parse-application-files/spec/common/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/spec/common/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/common/schema-ref-resolver.d.ts +23 -0
- package/dist/application-spec/parse-application-files/spec/common/schema-ref-resolver.js +1 -0
- package/dist/application-spec/parse-application-files/spec/model/names/action-name.d.ts +10 -0
- package/dist/application-spec/parse-application-files/spec/model/names/action-name.js +1 -0
- package/dist/application-spec/parse-application-files/spec/model/names/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/spec/model/names/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/actions.d.ts +35 -0
- package/dist/application-spec/parse-application-files/spec/sections/actions.js +1 -0
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.d.ts +3 -14
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +12 -3
- 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.d.ts +5 -3
- package/dist/application-spec/parse-application-files/spec/sections/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/spec/sections/index.js +1 -1
- package/dist/configurator/application-runtime/extensions/configurator-extension-systems.d.ts +2 -1
- package/dist/configurator/application-runtime/extensions/configurator-extension-systems.js +1 -1
- package/dist/configurator/application-runtime/extensions/selectors.d.ts +2 -1
- package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +35 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -0
- package/dist/configurator/{assistant → application-runtime/extensions/systems/assistant-system}/browser-details.d.ts +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/browser-details.js +1 -0
- package/dist/configurator/{assistant → application-runtime/extensions/systems/assistant-system}/graphql-tools.d.ts +13 -14
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -0
- package/dist/configurator/application-runtime/extensions/systems/index.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.d.ts +2 -0
- package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.js +1 -1
- package/dist/configurator/assistant/use-assistant-chat.d.ts +15 -5
- package/dist/configurator/assistant/use-assistant-chat.js +1 -1
- package/dist/configurator/ui/assistant/AssistantChips.d.ts +11 -0
- package/dist/configurator/ui/assistant/AssistantChips.js +1 -0
- package/dist/configurator/ui/assistant/AssistantComposer.d.ts +11 -0
- package/dist/configurator/ui/assistant/AssistantComposer.js +1 -0
- package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +7 -0
- package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -0
- package/dist/configurator/ui/assistant/AssistantPanel.d.ts +11 -0
- package/dist/configurator/ui/assistant/AssistantPanel.js +1 -0
- package/dist/configurator/ui/assistant/AssistantPanelProvider.d.ts +42 -0
- package/dist/configurator/ui/assistant/AssistantPanelProvider.js +1 -0
- package/dist/configurator/ui/assistant/AssistantThread.d.ts +11 -0
- package/dist/configurator/ui/assistant/AssistantThread.js +1 -0
- package/dist/configurator/ui/assistant/assistant-failure.d.ts +18 -0
- package/dist/configurator/ui/assistant/assistant-failure.js +1 -0
- package/dist/configurator/ui/assistant/index.d.ts +2 -0
- package/dist/configurator/ui/assistant/index.js +1 -0
- package/dist/configurator/ui/assistant/streamed-markdown.d.ts +6 -0
- package/dist/configurator/ui/assistant/streamed-markdown.js +2 -0
- package/dist/configurator/ui/assistant/theme.d.ts +2 -0
- package/dist/configurator/ui/assistant/theme.js +1 -0
- package/dist/configurator/ui/assistant/thread-items.d.ts +37 -0
- package/dist/configurator/ui/assistant/thread-items.js +1 -0
- package/dist/configurator/ui/assistant/tool-chip.d.ts +37 -0
- package/dist/configurator/ui/assistant/tool-chip.js +1 -0
- package/dist/configurator/ui/assistant/use-follow-stream.d.ts +17 -0
- package/dist/configurator/ui/assistant/use-follow-stream.js +1 -0
- package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.js +5 -5
- package/dist/configurator/ui/configurator-layout/universal/Layout.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/MobileLayout.d.ts +2 -0
- package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +3 -3
- package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.d.ts +10 -0
- package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -0
- package/dist/configurator/ui/phoenix-layout-elements/index.d.ts +1 -0
- package/dist/configurator/ui/phoenix-layout-elements/index.js +1 -1
- package/dist/docs/index.json +12 -2
- package/dist/docs/layouts/toolbar.mdx +4 -0
- package/dist/docs/other-features/domain-actions.mdx +418 -0
- package/dist/docs/phoenix/admin.mdx +2 -2
- package/dist/docs/phoenix/best-practices.mdx +1 -0
- package/dist/docs/phoenix/finalization.mdx +1 -1
- package/dist/docs/phoenix/integration/headless-mode-external.mdx +5 -5
- package/dist/docs/phoenix/integration/widget-mode-external.mdx +5 -5
- package/dist/docs/phoenix/phoenix-cli.mdx +60 -20
- package/dist/docs/phoenix/project-structure.mdx +4 -1
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +5 -4
- package/dist/domain/actions/action-factory.d.ts +10 -0
- package/dist/domain/actions/action-factory.js +1 -0
- package/dist/domain/actions/prepare-action-implementations.d.ts +15 -0
- package/dist/domain/actions/prepare-action-implementations.js +5 -0
- package/dist/domain/application/application-config.d.ts +3 -1
- package/dist/domain/application/assistant-mutations.d.ts +15 -14
- package/dist/domain/application/assistant-mutations.js +1 -1
- package/dist/domain/core/action.d.ts +67 -0
- package/dist/domain/core/action.js +1 -0
- package/dist/domain/core/domain-factory.d.ts +4 -0
- package/dist/domain/core/index.d.ts +1 -0
- package/dist/domain/domain-builder.d.ts +7 -0
- package/dist/domain/domain-builder.js +1 -1
- package/dist/domain/domain-context/action-system/action-system.d.ts +40 -0
- package/dist/domain/domain-context/action-system/action-system.js +1 -0
- package/dist/domain/domain-context/domain-context-systems.d.ts +5 -2
- package/dist/domain/domain-context/index.d.ts +1 -0
- package/dist/domain/domain-context/index.js +1 -1
- package/dist/domain/domain-runtime/domain-context/domain-context.js +1 -1
- package/dist/domain/domain-runtime/domain-context/selectors.d.ts +4 -0
- package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
- package/dist/domain/domain-runtime/domain-runtime.d.ts +12 -0
- package/dist/domain/domain-runtime/spec/initialize.js +1 -1
- package/dist/domain/domain-runtime/spec/types.d.ts +15 -1
- package/dist/domain/index.d.ts +2 -0
- package/dist/domain/index.js +1 -1
- package/dist/domain/mocks/create-mock-domain-runtime.d.ts +6 -0
- package/dist/domain/system-components/phoenix-layout-elements/assistant-toolbar-button.d.ts +44 -0
- package/dist/domain/system-components/phoenix-layout-elements/assistant-toolbar-button.js +1 -0
- package/dist/domain/system-components/phoenix-layout-elements/index.d.ts +1 -0
- package/dist/domain/system-components/phoenix-layout-elements/index.js +1 -1
- package/dist/domain/system-components/phoenix-layout-elements/phoenix-layout-element.d.ts +2 -1
- package/dist/domain/system-components/phoenix-layout-elements/phoenix-layout-element.js +1 -1
- package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
- package/dist/editor/domain-editors/apply-spec-update.js +1 -1
- package/dist/editor/domain-editors/use-implementation-files.d.ts +7 -3
- package/dist/editor/domain-editors/use-implementation-files.js +1 -1
- package/dist/i18n/locales/cs/messages.js +1 -1
- package/dist/i18n/locales/da/messages.js +1 -1
- package/dist/i18n/locales/de/messages.js +1 -1
- package/dist/i18n/locales/de-AT/messages.js +1 -1
- package/dist/i18n/locales/en/messages.js +1 -1
- package/dist/i18n/locales/en-AU/messages.js +1 -1
- package/dist/i18n/locales/en-GB/messages.js +1 -1
- package/dist/i18n/locales/es/messages.js +1 -1
- package/dist/i18n/locales/fr/messages.js +1 -1
- package/dist/i18n/locales/hu/messages.js +1 -1
- package/dist/i18n/locales/it/messages.js +1 -1
- package/dist/i18n/locales/nl/messages.js +1 -1
- package/dist/i18n/locales/pl/messages.js +1 -1
- package/dist/i18n/locales/pt/messages.js +1 -1
- package/dist/i18n/locales/ro/messages.js +1 -1
- package/dist/i18n/locales/sk/messages.js +1 -1
- package/dist/i18n/locales/tr/messages.js +1 -1
- package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +6 -0
- package/dist/phoenix/application-spec/generate-assistant-prompt.d.ts +2 -2
- package/dist/phoenix/application-spec/generate-assistant-prompt.js +1 -1
- package/dist/phoenix/cli.js +1 -1
- package/dist/phoenix/commands/build.d.ts +5 -0
- package/dist/phoenix/commands/build.js +1 -1
- package/dist/phoenix/commands/deploy.js +2 -2
- package/dist/phoenix/commands/feedback.d.ts +2 -1
- package/dist/phoenix/commands/feedback.js +1 -1
- package/dist/phoenix/commands/login.d.ts +24 -6
- package/dist/phoenix/commands/login.js +2 -2
- package/dist/phoenix/services/index.d.ts +1 -0
- package/dist/phoenix/services/index.js +1 -1
- package/dist/phoenix/services/phx-banner-plugin.d.ts +32 -0
- package/dist/phoenix/services/phx-banner-plugin.js +1 -0
- package/dist/phoenix/services/phx-licenses-plugin.d.ts +55 -0
- package/dist/phoenix/services/phx-licenses-plugin.js +8 -0
- package/dist/phoenix/services/vite-config.d.ts +2 -0
- package/dist/phoenix/services/vite-config.js +1 -1
- package/dist/phoenix/utils/index.d.ts +1 -0
- package/dist/phoenix/utils/index.js +1 -1
- package/dist/phoenix/utils/read-git-commit.d.ts +14 -0
- package/dist/phoenix/utils/read-git-commit.js +1 -0
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +12 -0
- package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +3 -0
- package/dist/ui-sdk/theme/types.d.ts +4 -0
- package/package.json +4 -7
- package/schema/domain-spec.json +24 -0
- package/dist/configurator/assistant/browser-details.js +0 -1
- package/dist/configurator/assistant/graphql-tools.js +0 -1
- package/dist/extras/assistant/AssistantChat.d.ts +0 -6
- package/dist/extras/assistant/AssistantChat.js +0 -1
- package/dist/extras/assistant/index.d.ts +0 -1
- package/dist/extras/assistant/index.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export const messages=JSON.parse('{"sdk.admin.error.backToHome.label":["Ana sayfaya d\xf6n"],"sdk.admin.error.system.message":["Şu anda teknik zorluklar yaşıyoruz. L\xfctfen birka\xe7 dakika sonra tekrar deneyin. Sabrınız i\xe7in teşekk\xfcrler!"],"sdk.admin.error.system.title":["Sistem hatası"],"sdk.angleDimension.hintMessageTooLarge":["Mevcut değer ",["currentWithUnit"]," olup, izin verilen maksimum değer olan ",["limitWithUnit"]," değerinden b\xfcy\xfckt\xfcr."],"sdk.angleDimension.hintMessageTooSmall":["Mevcut değer ",["currentWithUnit"]," olup, izin verilen minimum değer olan ",["limitWithUnit"]," değerinden k\xfc\xe7\xfckt\xfcr."],"sdk.chat.disclaimer.close.label":["Kapat"],"sdk.chat.disclaimer.dialog.title":["Asistan bildirimi"],"sdk.chat.disclaimer.full.message":["<0>Aşağıdaki sorumluluk reddi, bu web sitesinde bulunan AI chatbot\'un sınırlamaları ve kullanım y\xf6nergeleri hakkında kullanıcıları bilgilendirmek amacıyla hazırlanmıştır. Chatbot ile etkileşime ge\xe7meden \xf6nce l\xfctfen bu sorumluluk reddini dikkatlice okuyun.</0><1><2>Genel Bilgiler:</2> AI chatbot, OpenAI/ChatGPT tarafından desteklenen otomatik bir sistemdir. Bu web sitesinde sunulan \xfcr\xfcnler hakkında mevcut bilgilere dayanarak bilgi ve yardım sağlamak \xfczere tasarlanmıştır. AI chatbot aracılığıyla doğru bilgi sağlamaya \xe7alışsak da, sağlanan bilgilerin doğruluğunu, eksiksizliğini veya g\xfcncelliğini garanti edemeyiz. Yanıtları başlangı\xe7 noktası olarak kullanmanızı ve yanıtları bu bilgilerin sağlayıcısı (bu web sitesinin sahibi) veya mevcut \xfcr\xfcn belgelerinde doğrulamanızı \xf6neririz.</1><3><4>Kullanıcı Sorumluluğu:</4> AI chatbot kullanıcıları, etkileşimleri ve sağlanan bilgilere g\xfcvenmeleri konusunda tam sorumluluk taşırlar. Chatbot\'un yanıtlarını yorumlarken ve bunlara g\xf6re hareket ederken dikkatli olmak ve kendi takdirinizi kullanmak \xf6nemlidir. Bu web sitesinin sahibi veya chatbot teknolojisinin sağlayıcısı, chatbot kullanımından kaynaklanan eylemler, kayıplar veya zararlardan sorumlu tutulamaz.</3><5><6>Veri Gizliliği ve G\xfcvenliği:</6> Kullanıcı bilgilerinin gizliliğini ve g\xfcvenliğini \xf6nceliklendiriyoruz. Chatbot konuşmalarının sonu\xe7ları iyileştirmek i\xe7in bu web sitesinin sahibi ve teknoloji sağlayıcısı tarafından incelenebileceğini unutmayın. OpenAI/ChatGPT bu konuşmaların g\xfcnl\xfcklerini 30 g\xfcn boyunca saklarken, bu veriler AI modellerini eğitmek i\xe7in kullanılmaz. Konuşmalarınızda hassas veya kişisel bilgiler paylaşmayın.</5><7>Bu AI chatbot\'u kullanarak, yukarıdaki sorumluluk reddini kabul ettiğinizi ve anladığınızı belirtirsiniz. Bu sorumluluk reddinin herhangi bir b\xf6l\xfcm\xfcyle aynı fikirde değilseniz, chatbot\'u kullanmamanızı \xf6neririz.</7>"],"sdk.chat.disclaimer.inline.message":["Asistan deneyseldir ve yanlış bilgiler sağlayabilir."],"sdk.chat.disclaimer.seeMore.label":["Daha fazla bilgi"],"sdk.chat.header.desktop.title":["Asistan"],"sdk.chat.input.default.placeholder":["Mesaj yazın..."],"sdk.chat.input.footer.placeholder":["Mesaj yazın..."],"sdk.chat.mobile.assistant.label":["Asistan"],"sdk.chat.send.button.label":["Mesaj g\xf6nder"],"sdk.chat.system.error.message":["Asistanla iletişim kurarken bir hata oluştu. L\xfctfen tekrar deneyin."],"sdk.chat.welcome.greeting.message":["Merhaba! Ben sizin asistanınızım ve \xfcr\xfcn yapılandırması konusunda size yardımcı olacağım. Ne \xf6ğrenmek istersiniz?"],"sdk.collision.warning.tooltip":["\xd6ğeler \xe7ok yakın veya \xe7akışıyor"],"sdk.controls.dimension.angle.error":["Ge\xe7ersiz a\xe7ı"],"sdk.controls.dimension.angle.hint":["A\xe7ı girin"],"sdk.controls.dimension.angle.hintRange":["L\xfctfen ",["0"],["unitLabelWithSpace"]," ile ",["1"],["unitLabelWithSpace"]," arasında bir sayı girin."],"sdk.controls.dimension.angleSlider.error":["Ge\xe7ersiz a\xe7ı"],"sdk.controls.dimension.distance.error":["Ge\xe7ersiz mesafe"],"sdk.controls.dimension.distance.hint":["Mesafe girin"],"sdk.controls.dimension.distance.hintRange":["Mesafe ",["0"]," ile ",["1"]," arasında olmalıdır"],"sdk.controls.dimension.distanceSlider.error":["Ge\xe7ersiz mesafe"],"sdk.controls.dimension.generic.error":["Ge\xe7ersiz değer"],"sdk.controls.dimension.generic.hint":["Değer girin"],"sdk.controls.dimension.generic.hintRange":["Değer ",["min"]," ile ",["max"]," arasında olmalıdır"],"sdk.controls.dimension.genericSlider.error":["Ge\xe7ersiz değer"],"sdk.controls.dimension.indicator.apply":["Uygula"],"sdk.controls.dimension.indicator.cancel":["İptal"],"sdk.controls.dimension.offset.hint":["Ofset girin"],"sdk.controls.dimension.size.hint":["Boyut girin"],"sdk.controls.entity.add.close.label":["Kapat"],"sdk.controls.entity.add.nothingMessage":["Eklenecek bir şey yok"],"sdk.controls.entity.childDelete.label":["Sil"],"sdk.controls.entity.childSelect.label":["Se\xe7"],"sdk.controls.entity.delete.label":["Sil"],"sdk.controls.entity.replace.label":["Değiştir"],"sdk.controls.property.back.label":["Geri"],"sdk.controls.recipeGroup.notFound.message":["Bulunamadı"],"sdk.controls.recipeGroup.notFound.title":["Aradığınız grup artık mevcut değil. L\xfctfen başka bir grup se\xe7in."],"sdk.controls.tool.close.label":["Kapat"],"sdk.controls.units.feet.label":["ayak"],"sdk.controls.units.inch.label":["in\xe7"],"sdk.controls.upload.dragDrop.hint":["Dosyaları buraya s\xfcr\xfckleyin veya se\xe7mek i\xe7in tıklayın"],"sdk.controls.upload.failed.error":["Y\xfckleme başarısız"],"sdk.controls.upload.link.label":["Veya bir bağlantı yapıştırın"],"sdk.controls.upload.size.error":["Dosya \xe7ok b\xfcy\xfck"],"sdk.distanceDimension.hintMessageTooLarge":["Mevcut değer ",["0"]," olup, izin verilen maksimum değer olan ",["1"]," değerinden b\xfcy\xfckt\xfcr."],"sdk.distanceDimension.hintMessageTooSmall":["Mevcut değer ",["0"]," olup, izin verilen minimum değer olan ",["1"]," değerinden k\xfc\xe7\xfckt\xfcr."],"sdk.finalize.notConfigured.tooltip":["Tamamlama \xf6zelliği yapılandırılmamış."],"sdk.finalize.outOfSync.hint":["Yapılandırma senkronize değil. Bazı değişiklikler d\xfczg\xfcn şekilde kaydedilmedi."],"sdk.genericDimension.hintMessageTooLarge":["Mevcut değer ",["currentWithUnit"]," olup, izin verilen maksimum değer olan ",["limitWithUnit"]," değerinden b\xfcy\xfckt\xfcr."],"sdk.genericDimension.hintMessageTooSmall":["Mevcut değer ",["currentWithUnit"]," olup, izin verilen minimum değer olan ",["limitWithUnit"]," değerinden k\xfc\xe7\xfckt\xfcr."],"sdk.layout.banner.readonly.cancel.label":["İptal"],"sdk.layout.banner.readonly.clone.label":["D\xfczenlemek i\xe7in klonla"],"sdk.layout.banner.readonly.clone.message":["Bu yapılandırmanın d\xfczenleme i\xe7in bir kopyasını oluşturmak ister misiniz?"],"sdk.layout.banner.readonly.clone.title":["Yapılandırmayı klonla"],"sdk.layout.banner.readonly.editConfig.label":["Yapılandırmayı d\xfczenle"],"sdk.layout.banner.readonly.editMobile.label":["D\xfczenle"],"sdk.layout.banner.readonly.info.message":["Bu yapılandırma salt okunurdur. D\xfczenlemek i\xe7in bir kopya oluşturun."],"sdk.layout.button.closeConfigurator.label":["Yapılandırıcıyı kapat"],"sdk.layout.button.closePresetPreview.label":["\xd6nceden ayarlanmış \xf6nizlemeyi kapat"],"sdk.layout.button.desktopBack.label":["Geri"],"sdk.layout.button.desktopSidebarBack.label":["Geri"],"sdk.layout.button.mobileBack.label":["Geri"],"sdk.layout.button.mobileSidebarBack.label":["Geri"],"sdk.layout.button.presetBack.label":["Geri"],"sdk.layout.button.saveRecipe.label":["Tarifi kaydet"],"sdk.layout.button.saveTemplate.label":["Şablonu kaydet"],"sdk.layout.button.setTemplate.label":["Şablon olarak ayarla"],"sdk.layout.controls.mobile.view3d.label":["3D g\xf6r\xfcn\xfcm"],"sdk.layout.controls.mobile.viewOnly.message":["<0>Sadece g\xf6r\xfcnt\xfcleme modu.</0> Konfig\xfcrasyonu değiştirmek i\xe7in daha b\xfcy\xfck ekranlı bir cihaz kullanın."],"sdk.layout.controls.tablet.viewOnly.message":["<0>Sadece g\xf6r\xfcnt\xfcleme modu.</0> Konfig\xfcrasyonu değiştirmek i\xe7in daha b\xfcy\xfck ekranlı bir cihaz kullanın veya cihazınızın y\xf6n\xfcn\xfc değiştirmeyi deneyin."],"sdk.layout.finalize.moreActions":["More finalization options"],"sdk.layout.footer.price.label":["Toplam fiyat"],"sdk.layout.hamburgerMenu.language.dialogTitle":["Dil se\xe7in"],"sdk.layout.hamburgerMenu.language.label":["Dil"],"sdk.layout.menu.hamburger.close.label":["Kapat"],"sdk.layout.menu.hamburger.help.label":["Yardım"],"sdk.layout.menu.hamburger.help.label.closeButtonLabel":["Yardımı kapat"],"sdk.layout.menu.hamburger.share.label":["Paylaş"],"sdk.layout.menu.hamburger.title":["Men\xfc"],"sdk.layout.menu.hamburger.tooltip":["Men\xfcy\xfc a\xe7"],"sdk.layout.menu.language.close.label":["Kapat"],"sdk.layout.menu.measurements.close.label":["Kapat"],"sdk.layout.menu.measurements.label":["\xd6l\xe7\xfcmler"],"sdk.layout.navigation.common.product.label":["\xdcr\xfcn"],"sdk.layout.navigation.mobile.product.label":["\xdcr\xfcn"],"sdk.layout.navigation.steps.first.label":["İlk"],"sdk.layout.sidebar.disabledFinalizeButton.label":["Sonlandır"],"sdk.layout.sidebar.finalize.label":["Tamamla"],"sdk.layout.sidebar.finalizePage.label":["Tamamla"],"sdk.layout.sidebar.nextStep.label":["Sonraki adım"],"sdk.layout.sidebar.nextStepShort.label":["Sonraki"],"sdk.layout.sidebar.previousStep.label":["\xd6nceki adım"],"sdk.layout.sidebar.price.label":["Fiyat"],"sdk.layout.sidebar.totalPrice.label":["Toplam fiyat"],"sdk.layout.summary.button.label":["\xd6zet"],"sdk.layout.toolbar.mobile.tools.title":["Ara\xe7lar"],"sdk.layout.toolbar.mobile.units.label":["Birimler"],"sdk.measurements":["\xd6l\xe7\xfcmler"],"sdk.messages.error.configNotFound.message":["Yapılandırma bulunamadı. Silinmiş olabilir veya yanlış bir bağlantı girmiş olabilirsiniz."],"sdk.messages.error.configNotFound.title":["Yapılandırma bulunamadı"],"sdk.messages.error.configurator.backToHome.label":["Ana sayfaya d\xf6n"],"sdk.messages.error.configurator.message":["Hay aksi, bir şeyler ters gitti! L\xfctfen tekrar deneyin veya destek ile iletişime ge\xe7in."],"sdk.messages.error.configurator.title":["Yapılandırıcı hatası"],"sdk.messages.error.configuratorRoot.backToHome.label":["Ana sayfaya d\xf6n"],"sdk.messages.error.configuratorRoot.message":["Yapılandırıcı kullanılamıyor. L\xfctfen daha sonra tekrar deneyin."],"sdk.messages.error.configuratorRoot.title":["Yapılandırıcı kullanılamıyor"],"sdk.messages.error.gpuDisabled.message":["GPU hızlandırması devre dışı. Performans azalabilir. Daha iyi performans i\xe7in tarayıcı ayarlarınızda donanım hızlandırmasını etkinleştirin."],"sdk.messages.error.gpuDisabled.title":["GPU hızlandırması devre dışı"],"sdk.messages.error.notFound.backToHome.label":["Ana sayfaya d\xf6n"],"sdk.messages.error.webglNotSupported.message":["Tarayıcınız 3D render i\xe7in gerekli olan WebGL\'yi desteklemiyor. L\xfctfen farklı bir tarayıcı kullanmayı deneyin veya mevcut olanı g\xfcncelleyin."],"sdk.messages.error.webglNotSupported.title":["WebGL desteklenmiyor"],"sdk.messages.finalize.error":["Oops, bir hata oluştu"],"sdk.messages.navigation.goToHomepage.label":["Ana sayfaya git"],"sdk.messages.otherAction.error":["Oops, bir hata oluştu"],"sdk.messages.system.invalidDeployment.close.label":["Kapat"],"sdk.messages.system.invalidDeployment.message":["Bu dağıtım ge\xe7ersiz veya silinmiş."],"sdk.messages.system.invalidDeployment.title":["Ge\xe7ersiz dağıtım"],"sdk.messages.validation.uncaughtError.message":["Beklenmeyen bir hata oluştu. L\xfctfen tekrar deneyin."],"sdk.persist.system.error.dismiss":["Kapat"],"sdk.persist.system.error.message":["Bir yapılandırmayı g\xfcncellemeye \xe7alışırken bir hata oluştu"],"sdk.persist.system.error.recovered":["Yapılandırma g\xfcncellendi"],"sdk.presets.category.count.message":[["count"]," \xf6nceden ayarlanmış"],"sdk.presets.category.heading.title":["Kategoriler"],"sdk.presets.create.error.dismiss.label":["Kapat"],"sdk.presets.create.error.message":["Bu hazır ayardan yapılandırma başlatılamadı. L\xfctfen tekrar deneyin."],"sdk.presets.detail.close.label":["Kapat"],"sdk.presets.detail.learnMore.label":["Daha fazla bilgi"],"sdk.presets.detail.select.label":["Se\xe7"],"sdk.presets.preview.title":["\xd6nizleme"],"sdk.presets.select.button.label":["Se\xe7"],"sdk.presets.start.button.label":["Başla"],"sdk.preview.customize.title":["\xd6zelleştir"],"sdk.preview.start.button.label":["Başla"],"sdk.sketching.angle.apply.label":["Uygula"],"sdk.sketching.angle.cancel.label":["İptal"],"sdk.sketching.angle.control.label":["A\xe7ı"],"sdk.sketching.angle.control.text":["A\xe7ıyı ayarla"],"sdk.sketching.angle.control.title":["A\xe7ı belirle"],"sdk.sketching.angle.input.error":["L\xfctfen ge\xe7erli bir sayı girin!"],"sdk.sketching.dimension.apply.label":["Uygula"],"sdk.sketching.dimension.cancel.label":["İptal"],"sdk.sketching.dimension.depth.label":["Derinlik"],"sdk.sketching.dimension.depth.text":["Derinliği ayarla"],"sdk.sketching.dimension.depth.title":["Derinlik belirle"],"sdk.sketching.dimension.input.error":["L\xfctfen ge\xe7erli bir sayı girin!"],"sdk.sketching.dimension.length.label":["Uzunluk"],"sdk.sketching.dimension.length.text":["Uzunluğu ayarla"],"sdk.sketching.dimension.length.title":["Uzunluk belirle"],"sdk.sketching.dimension.width.label":["Genişlik"],"sdk.sketching.dimension.width.text":["Genişliği ayarla"],"sdk.sketching.dimension.width.title":["Genişlik belirle"],"sdk.sketching.draw.done.label":["Tamam"],"sdk.sketching.spotlight.label":["\xc7izime başlamak i\xe7in tıklayın"],"sdk.toolbar.actions.undoRedo.label":["Geri Al/Yinele"],"sdk.toolbar.camera.reset.label":["Kamerayı sıfırla"],"sdk.toolbar.camera.reset.labelAriaLabel":["Kamerayı varsayılan konuma sıfırla"],"sdk.toolbar.fullscreen.enter.label":["Tam ekran"],"sdk.toolbar.fullscreen.exit.label":["Tam ekrandan \xe7ık"],"sdk.toolbar.help.close.label":["Yardımı kapat"],"sdk.toolbar.help.label":["Yardım"],"sdk.toolbar.language.title":["Dil"],"sdk.toolbar.measurements.change.aria":["\xd6l\xe7\xfcmleri değiştir"],"sdk.toolbar.measurements.indicators.label":["\xd6l\xe7\xfcm g\xf6stergeleri"],"sdk.toolbar.measurements.input.aria":["\xd6l\xe7\xfcm girişini değiştir"],"sdk.toolbar.measurements.units.aria":["\xd6l\xe7\xfcm birimlerini değiştir"],"sdk.toolbar.mobile.fullscreen.enter.label":["Tam ekran"],"sdk.toolbar.mobile.fullscreen.exit.label":["Tam ekrandan \xe7ık"],"sdk.toolbar.mobile.fullscreen.title":["Tam ekran"],"sdk.toolbar.mobile.open.aria":["Mobil ara\xe7ları a\xe7"],"sdk.toolbar.mobile.viewControls.label":["G\xf6r\xfcn\xfcm kontrolleri"],"sdk.toolbar.share.allowEdit.label":["D\xfczenlemeye izin ver"],"sdk.toolbar.share.allowEditShort.label":["D\xfczenleme"],"sdk.toolbar.share.close.label":["Kapat"],"sdk.toolbar.share.copiedLinkButtonTitle":["Bağlantı kopyalandı"],"sdk.toolbar.share.copyLink.label":["Bağlantıyı kopyala"],"sdk.toolbar.share.copyLinkButtonTitle":["Bağlantıyı kopyala"],"sdk.toolbar.share.input.aria":["Paylaşım bağlantısı girişi"],"sdk.toolbar.share.label":["Paylaş"],"sdk.toolbar.share.linkCopied.label":["Bağlantı kopyalandı"],"sdk.toolbar.share.loading.label":["Y\xfckleniyor..."],"sdk.toolbar.share.open.label":["A\xe7"],"sdk.toolbar.share.section.label":["Paylaş"],"sdk.toolbar.undoRedo.redo.label":["Yinele"],"sdk.toolbar.undoRedo.undo.label":["Geri Al"],"sdk.toolbar.viewControls.title":["G\xf6r\xfcn\xfcm kontrolleri"],"sdk.totalPrice":["Toplam fiyat"]}');
|
|
1
|
+
export const messages=JSON.parse('{"sdk.admin.error.backToHome.label":["Ana sayfaya d\xf6n"],"sdk.admin.error.system.message":["Şu anda teknik zorluklar yaşıyoruz. L\xfctfen birka\xe7 dakika sonra tekrar deneyin. Sabrınız i\xe7in teşekk\xfcrler!"],"sdk.admin.error.system.title":["Sistem hatası"],"sdk.angleDimension.hintMessageTooLarge":["Mevcut değer ",["currentWithUnit"]," olup, izin verilen maksimum değer olan ",["limitWithUnit"]," değerinden b\xfcy\xfckt\xfcr."],"sdk.angleDimension.hintMessageTooSmall":["Mevcut değer ",["currentWithUnit"]," olup, izin verilen minimum değer olan ",["limitWithUnit"]," değerinden k\xfc\xe7\xfckt\xfcr."],"sdk.assistant.composer.disclaimer":["Yapay zek\xe2 yanılabilir. Sonucu kontrol edin."],"sdk.assistant.composer.notContinuable":["Bu konuşma burada okunabilir, ancak artık s\xfcrd\xfcr\xfclemez."],"sdk.assistant.composer.placeholder":["Sorun veya neyi değiştireceğimi s\xf6yleyin…"],"sdk.assistant.composer.send.label":["G\xf6nder"],"sdk.assistant.composer.stop.label":["Durdur"],"sdk.assistant.failure.busy":["Asistan h\xe2l\xe2 \xf6nceki bir mesaj \xfczerinde \xe7alışıyor."],"sdk.assistant.failure.notAvailable":["Asistan burada kullanılamıyor."],"sdk.assistant.failure.retry.label":["Tekrar dene"],"sdk.assistant.failure.unavailable":["Asistan şu anda kullanılamıyor."],"sdk.assistant.panel.close.label":["Asistanı kapat"],"sdk.assistant.panel.title":["Asistan"],"sdk.assistant.thread.greeting":["Merhaba. Bu tasarımla ilgili soruları yanıtlayabilir ve onu sizinle birlikte değiştirebilirim. Neye ihtiyacınız olduğunu s\xf6yleyin."],"sdk.assistant.thread.newReply.label":["Yeni yanıt"],"sdk.assistant.thread.thinking":["D\xfcş\xfcn\xfcyor…"],"sdk.assistant.tool.mistake.hint":["Asistan bir hata yaptı."],"sdk.assistant.tool.readDesign.label":["Tasarımı oku"],"sdk.assistant.tool.updateDesign.label":["Tasarımı g\xfcncelle"],"sdk.assistant.toolbarButton.label":["Asistan"],"sdk.chat.disclaimer.close.label":["Kapat"],"sdk.chat.disclaimer.dialog.title":["Asistan bildirimi"],"sdk.chat.disclaimer.full.message":["<0>Aşağıdaki sorumluluk reddi, bu web sitesinde bulunan AI chatbot\'un sınırlamaları ve kullanım y\xf6nergeleri hakkında kullanıcıları bilgilendirmek amacıyla hazırlanmıştır. Chatbot ile etkileşime ge\xe7meden \xf6nce l\xfctfen bu sorumluluk reddini dikkatlice okuyun.</0><1><2>Genel Bilgiler:</2> AI chatbot, OpenAI/ChatGPT tarafından desteklenen otomatik bir sistemdir. Bu web sitesinde sunulan \xfcr\xfcnler hakkında mevcut bilgilere dayanarak bilgi ve yardım sağlamak \xfczere tasarlanmıştır. AI chatbot aracılığıyla doğru bilgi sağlamaya \xe7alışsak da, sağlanan bilgilerin doğruluğunu, eksiksizliğini veya g\xfcncelliğini garanti edemeyiz. Yanıtları başlangı\xe7 noktası olarak kullanmanızı ve yanıtları bu bilgilerin sağlayıcısı (bu web sitesinin sahibi) veya mevcut \xfcr\xfcn belgelerinde doğrulamanızı \xf6neririz.</1><3><4>Kullanıcı Sorumluluğu:</4> AI chatbot kullanıcıları, etkileşimleri ve sağlanan bilgilere g\xfcvenmeleri konusunda tam sorumluluk taşırlar. Chatbot\'un yanıtlarını yorumlarken ve bunlara g\xf6re hareket ederken dikkatli olmak ve kendi takdirinizi kullanmak \xf6nemlidir. Bu web sitesinin sahibi veya chatbot teknolojisinin sağlayıcısı, chatbot kullanımından kaynaklanan eylemler, kayıplar veya zararlardan sorumlu tutulamaz.</3><5><6>Veri Gizliliği ve G\xfcvenliği:</6> Kullanıcı bilgilerinin gizliliğini ve g\xfcvenliğini \xf6nceliklendiriyoruz. Chatbot konuşmalarının sonu\xe7ları iyileştirmek i\xe7in bu web sitesinin sahibi ve teknoloji sağlayıcısı tarafından incelenebileceğini unutmayın. OpenAI/ChatGPT bu konuşmaların g\xfcnl\xfcklerini 30 g\xfcn boyunca saklarken, bu veriler AI modellerini eğitmek i\xe7in kullanılmaz. Konuşmalarınızda hassas veya kişisel bilgiler paylaşmayın.</5><7>Bu AI chatbot\'u kullanarak, yukarıdaki sorumluluk reddini kabul ettiğinizi ve anladığınızı belirtirsiniz. Bu sorumluluk reddinin herhangi bir b\xf6l\xfcm\xfcyle aynı fikirde değilseniz, chatbot\'u kullanmamanızı \xf6neririz.</7>"],"sdk.chat.disclaimer.inline.message":["Asistan deneyseldir ve yanlış bilgiler sağlayabilir."],"sdk.chat.disclaimer.seeMore.label":["Daha fazla bilgi"],"sdk.chat.header.desktop.title":["Asistan"],"sdk.chat.input.default.placeholder":["Mesaj yazın..."],"sdk.chat.input.footer.placeholder":["Mesaj yazın..."],"sdk.chat.mobile.assistant.label":["Asistan"],"sdk.chat.send.button.label":["Mesaj g\xf6nder"],"sdk.chat.system.error.message":["Asistanla iletişim kurarken bir hata oluştu. L\xfctfen tekrar deneyin."],"sdk.chat.welcome.greeting.message":["Merhaba! Ben sizin asistanınızım ve \xfcr\xfcn yapılandırması konusunda size yardımcı olacağım. Ne \xf6ğrenmek istersiniz?"],"sdk.collision.warning.tooltip":["\xd6ğeler \xe7ok yakın veya \xe7akışıyor"],"sdk.controls.dimension.angle.error":["Ge\xe7ersiz a\xe7ı"],"sdk.controls.dimension.angle.hint":["A\xe7ı girin"],"sdk.controls.dimension.angle.hintRange":["L\xfctfen ",["0"],["unitLabelWithSpace"]," ile ",["1"],["unitLabelWithSpace"]," arasında bir sayı girin."],"sdk.controls.dimension.angleSlider.error":["Ge\xe7ersiz a\xe7ı"],"sdk.controls.dimension.distance.error":["Ge\xe7ersiz mesafe"],"sdk.controls.dimension.distance.hint":["Mesafe girin"],"sdk.controls.dimension.distance.hintRange":["Mesafe ",["0"]," ile ",["1"]," arasında olmalıdır"],"sdk.controls.dimension.distanceSlider.error":["Ge\xe7ersiz mesafe"],"sdk.controls.dimension.generic.error":["Ge\xe7ersiz değer"],"sdk.controls.dimension.generic.hint":["Değer girin"],"sdk.controls.dimension.generic.hintRange":["Değer ",["min"]," ile ",["max"]," arasında olmalıdır"],"sdk.controls.dimension.genericSlider.error":["Ge\xe7ersiz değer"],"sdk.controls.dimension.indicator.apply":["Uygula"],"sdk.controls.dimension.indicator.cancel":["İptal"],"sdk.controls.dimension.offset.hint":["Ofset girin"],"sdk.controls.dimension.size.hint":["Boyut girin"],"sdk.controls.entity.add.close.label":["Kapat"],"sdk.controls.entity.add.nothingMessage":["Eklenecek bir şey yok"],"sdk.controls.entity.childDelete.label":["Sil"],"sdk.controls.entity.childSelect.label":["Se\xe7"],"sdk.controls.entity.delete.label":["Sil"],"sdk.controls.entity.replace.label":["Değiştir"],"sdk.controls.property.back.label":["Geri"],"sdk.controls.recipeGroup.notFound.message":["Bulunamadı"],"sdk.controls.recipeGroup.notFound.title":["Aradığınız grup artık mevcut değil. L\xfctfen başka bir grup se\xe7in."],"sdk.controls.tool.close.label":["Kapat"],"sdk.controls.units.feet.label":["ayak"],"sdk.controls.units.inch.label":["in\xe7"],"sdk.controls.upload.dragDrop.hint":["Dosyaları buraya s\xfcr\xfckleyin veya se\xe7mek i\xe7in tıklayın"],"sdk.controls.upload.failed.error":["Y\xfckleme başarısız"],"sdk.controls.upload.link.label":["Veya bir bağlantı yapıştırın"],"sdk.controls.upload.size.error":["Dosya \xe7ok b\xfcy\xfck"],"sdk.distanceDimension.hintMessageTooLarge":["Mevcut değer ",["0"]," olup, izin verilen maksimum değer olan ",["1"]," değerinden b\xfcy\xfckt\xfcr."],"sdk.distanceDimension.hintMessageTooSmall":["Mevcut değer ",["0"]," olup, izin verilen minimum değer olan ",["1"]," değerinden k\xfc\xe7\xfckt\xfcr."],"sdk.finalize.notConfigured.tooltip":["Tamamlama \xf6zelliği yapılandırılmamış."],"sdk.finalize.outOfSync.hint":["Yapılandırma senkronize değil. Bazı değişiklikler d\xfczg\xfcn şekilde kaydedilmedi."],"sdk.genericDimension.hintMessageTooLarge":["Mevcut değer ",["currentWithUnit"]," olup, izin verilen maksimum değer olan ",["limitWithUnit"]," değerinden b\xfcy\xfckt\xfcr."],"sdk.genericDimension.hintMessageTooSmall":["Mevcut değer ",["currentWithUnit"]," olup, izin verilen minimum değer olan ",["limitWithUnit"]," değerinden k\xfc\xe7\xfckt\xfcr."],"sdk.layout.banner.readonly.cancel.label":["İptal"],"sdk.layout.banner.readonly.clone.label":["D\xfczenlemek i\xe7in klonla"],"sdk.layout.banner.readonly.clone.message":["Bu yapılandırmanın d\xfczenleme i\xe7in bir kopyasını oluşturmak ister misiniz?"],"sdk.layout.banner.readonly.clone.title":["Yapılandırmayı klonla"],"sdk.layout.banner.readonly.editConfig.label":["Yapılandırmayı d\xfczenle"],"sdk.layout.banner.readonly.editMobile.label":["D\xfczenle"],"sdk.layout.banner.readonly.info.message":["Bu yapılandırma salt okunurdur. D\xfczenlemek i\xe7in bir kopya oluşturun."],"sdk.layout.button.closeConfigurator.label":["Yapılandırıcıyı kapat"],"sdk.layout.button.closePresetPreview.label":["\xd6nceden ayarlanmış \xf6nizlemeyi kapat"],"sdk.layout.button.desktopBack.label":["Geri"],"sdk.layout.button.desktopSidebarBack.label":["Geri"],"sdk.layout.button.mobileBack.label":["Geri"],"sdk.layout.button.mobileSidebarBack.label":["Geri"],"sdk.layout.button.presetBack.label":["Geri"],"sdk.layout.button.saveRecipe.label":["Tarifi kaydet"],"sdk.layout.button.saveTemplate.label":["Şablonu kaydet"],"sdk.layout.button.setTemplate.label":["Şablon olarak ayarla"],"sdk.layout.controls.mobile.view3d.label":["3D g\xf6r\xfcn\xfcm"],"sdk.layout.controls.mobile.viewOnly.message":["<0>Sadece g\xf6r\xfcnt\xfcleme modu.</0> Konfig\xfcrasyonu değiştirmek i\xe7in daha b\xfcy\xfck ekranlı bir cihaz kullanın."],"sdk.layout.controls.tablet.viewOnly.message":["<0>Sadece g\xf6r\xfcnt\xfcleme modu.</0> Konfig\xfcrasyonu değiştirmek i\xe7in daha b\xfcy\xfck ekranlı bir cihaz kullanın veya cihazınızın y\xf6n\xfcn\xfc değiştirmeyi deneyin."],"sdk.layout.finalize.moreActions":["More finalization options"],"sdk.layout.footer.price.label":["Toplam fiyat"],"sdk.layout.hamburgerMenu.language.dialogTitle":["Dil se\xe7in"],"sdk.layout.hamburgerMenu.language.label":["Dil"],"sdk.layout.menu.hamburger.close.label":["Kapat"],"sdk.layout.menu.hamburger.help.label":["Yardım"],"sdk.layout.menu.hamburger.help.label.closeButtonLabel":["Yardımı kapat"],"sdk.layout.menu.hamburger.share.label":["Paylaş"],"sdk.layout.menu.hamburger.title":["Men\xfc"],"sdk.layout.menu.hamburger.tooltip":["Men\xfcy\xfc a\xe7"],"sdk.layout.menu.language.close.label":["Kapat"],"sdk.layout.menu.measurements.close.label":["Kapat"],"sdk.layout.menu.measurements.label":["\xd6l\xe7\xfcmler"],"sdk.layout.navigation.common.product.label":["\xdcr\xfcn"],"sdk.layout.navigation.mobile.product.label":["\xdcr\xfcn"],"sdk.layout.navigation.steps.first.label":["İlk"],"sdk.layout.sidebar.disabledFinalizeButton.label":["Sonlandır"],"sdk.layout.sidebar.finalize.label":["Tamamla"],"sdk.layout.sidebar.finalizePage.label":["Tamamla"],"sdk.layout.sidebar.nextStep.label":["Sonraki adım"],"sdk.layout.sidebar.nextStepShort.label":["Sonraki"],"sdk.layout.sidebar.previousStep.label":["\xd6nceki adım"],"sdk.layout.sidebar.price.label":["Fiyat"],"sdk.layout.sidebar.totalPrice.label":["Toplam fiyat"],"sdk.layout.summary.button.label":["\xd6zet"],"sdk.layout.toolbar.mobile.tools.title":["Ara\xe7lar"],"sdk.layout.toolbar.mobile.units.label":["Birimler"],"sdk.measurements":["\xd6l\xe7\xfcmler"],"sdk.messages.error.configNotFound.message":["Yapılandırma bulunamadı. Silinmiş olabilir veya yanlış bir bağlantı girmiş olabilirsiniz."],"sdk.messages.error.configNotFound.title":["Yapılandırma bulunamadı"],"sdk.messages.error.configurator.backToHome.label":["Ana sayfaya d\xf6n"],"sdk.messages.error.configurator.message":["Hay aksi, bir şeyler ters gitti! L\xfctfen tekrar deneyin veya destek ile iletişime ge\xe7in."],"sdk.messages.error.configurator.title":["Yapılandırıcı hatası"],"sdk.messages.error.configuratorRoot.backToHome.label":["Ana sayfaya d\xf6n"],"sdk.messages.error.configuratorRoot.message":["Yapılandırıcı kullanılamıyor. L\xfctfen daha sonra tekrar deneyin."],"sdk.messages.error.configuratorRoot.title":["Yapılandırıcı kullanılamıyor"],"sdk.messages.error.gpuDisabled.message":["GPU hızlandırması devre dışı. Performans azalabilir. Daha iyi performans i\xe7in tarayıcı ayarlarınızda donanım hızlandırmasını etkinleştirin."],"sdk.messages.error.gpuDisabled.title":["GPU hızlandırması devre dışı"],"sdk.messages.error.notFound.backToHome.label":["Ana sayfaya d\xf6n"],"sdk.messages.error.webglNotSupported.message":["Tarayıcınız 3D render i\xe7in gerekli olan WebGL\'yi desteklemiyor. L\xfctfen farklı bir tarayıcı kullanmayı deneyin veya mevcut olanı g\xfcncelleyin."],"sdk.messages.error.webglNotSupported.title":["WebGL desteklenmiyor"],"sdk.messages.finalize.error":["Oops, bir hata oluştu"],"sdk.messages.navigation.goToHomepage.label":["Ana sayfaya git"],"sdk.messages.otherAction.error":["Oops, bir hata oluştu"],"sdk.messages.system.invalidDeployment.close.label":["Kapat"],"sdk.messages.system.invalidDeployment.message":["Bu dağıtım ge\xe7ersiz veya silinmiş."],"sdk.messages.system.invalidDeployment.title":["Ge\xe7ersiz dağıtım"],"sdk.messages.validation.uncaughtError.message":["Beklenmeyen bir hata oluştu. L\xfctfen tekrar deneyin."],"sdk.persist.system.error.dismiss":["Kapat"],"sdk.persist.system.error.message":["Bir yapılandırmayı g\xfcncellemeye \xe7alışırken bir hata oluştu"],"sdk.persist.system.error.recovered":["Yapılandırma g\xfcncellendi"],"sdk.presets.category.count.message":[["count"]," \xf6nceden ayarlanmış"],"sdk.presets.category.heading.title":["Kategoriler"],"sdk.presets.create.error.dismiss.label":["Kapat"],"sdk.presets.create.error.message":["Bu hazır ayardan yapılandırma başlatılamadı. L\xfctfen tekrar deneyin."],"sdk.presets.detail.close.label":["Kapat"],"sdk.presets.detail.learnMore.label":["Daha fazla bilgi"],"sdk.presets.detail.select.label":["Se\xe7"],"sdk.presets.preview.title":["\xd6nizleme"],"sdk.presets.select.button.label":["Se\xe7"],"sdk.presets.start.button.label":["Başla"],"sdk.preview.customize.title":["\xd6zelleştir"],"sdk.preview.start.button.label":["Başla"],"sdk.sketching.angle.apply.label":["Uygula"],"sdk.sketching.angle.cancel.label":["İptal"],"sdk.sketching.angle.control.label":["A\xe7ı"],"sdk.sketching.angle.control.text":["A\xe7ıyı ayarla"],"sdk.sketching.angle.control.title":["A\xe7ı belirle"],"sdk.sketching.angle.input.error":["L\xfctfen ge\xe7erli bir sayı girin!"],"sdk.sketching.dimension.apply.label":["Uygula"],"sdk.sketching.dimension.cancel.label":["İptal"],"sdk.sketching.dimension.depth.label":["Derinlik"],"sdk.sketching.dimension.depth.text":["Derinliği ayarla"],"sdk.sketching.dimension.depth.title":["Derinlik belirle"],"sdk.sketching.dimension.input.error":["L\xfctfen ge\xe7erli bir sayı girin!"],"sdk.sketching.dimension.length.label":["Uzunluk"],"sdk.sketching.dimension.length.text":["Uzunluğu ayarla"],"sdk.sketching.dimension.length.title":["Uzunluk belirle"],"sdk.sketching.dimension.width.label":["Genişlik"],"sdk.sketching.dimension.width.text":["Genişliği ayarla"],"sdk.sketching.dimension.width.title":["Genişlik belirle"],"sdk.sketching.draw.done.label":["Tamam"],"sdk.sketching.spotlight.label":["\xc7izime başlamak i\xe7in tıklayın"],"sdk.toolbar.actions.undoRedo.label":["Geri Al/Yinele"],"sdk.toolbar.camera.reset.label":["Kamerayı sıfırla"],"sdk.toolbar.camera.reset.labelAriaLabel":["Kamerayı varsayılan konuma sıfırla"],"sdk.toolbar.fullscreen.enter.label":["Tam ekran"],"sdk.toolbar.fullscreen.exit.label":["Tam ekrandan \xe7ık"],"sdk.toolbar.help.close.label":["Yardımı kapat"],"sdk.toolbar.help.label":["Yardım"],"sdk.toolbar.language.title":["Dil"],"sdk.toolbar.measurements.change.aria":["\xd6l\xe7\xfcmleri değiştir"],"sdk.toolbar.measurements.indicators.label":["\xd6l\xe7\xfcm g\xf6stergeleri"],"sdk.toolbar.measurements.input.aria":["\xd6l\xe7\xfcm girişini değiştir"],"sdk.toolbar.measurements.units.aria":["\xd6l\xe7\xfcm birimlerini değiştir"],"sdk.toolbar.mobile.fullscreen.enter.label":["Tam ekran"],"sdk.toolbar.mobile.fullscreen.exit.label":["Tam ekrandan \xe7ık"],"sdk.toolbar.mobile.fullscreen.title":["Tam ekran"],"sdk.toolbar.mobile.open.aria":["Mobil ara\xe7ları a\xe7"],"sdk.toolbar.mobile.viewControls.label":["G\xf6r\xfcn\xfcm kontrolleri"],"sdk.toolbar.share.allowEdit.label":["D\xfczenlemeye izin ver"],"sdk.toolbar.share.allowEditShort.label":["D\xfczenleme"],"sdk.toolbar.share.close.label":["Kapat"],"sdk.toolbar.share.copiedLinkButtonTitle":["Bağlantı kopyalandı"],"sdk.toolbar.share.copyLink.label":["Bağlantıyı kopyala"],"sdk.toolbar.share.copyLinkButtonTitle":["Bağlantıyı kopyala"],"sdk.toolbar.share.input.aria":["Paylaşım bağlantısı girişi"],"sdk.toolbar.share.label":["Paylaş"],"sdk.toolbar.share.linkCopied.label":["Bağlantı kopyalandı"],"sdk.toolbar.share.loading.label":["Y\xfckleniyor..."],"sdk.toolbar.share.open.label":["A\xe7"],"sdk.toolbar.share.section.label":["Paylaş"],"sdk.toolbar.undoRedo.redo.label":["Yinele"],"sdk.toolbar.undoRedo.undo.label":["Geri Al"],"sdk.toolbar.viewControls.title":["G\xf6r\xfcn\xfcm kontrolleri"],"sdk.totalPrice":["Toplam fiyat"]}');
|
|
@@ -1091,6 +1091,12 @@ export type PhoenixLayoutElement = {
|
|
|
1091
1091
|
feet?: string;
|
|
1092
1092
|
};
|
|
1093
1093
|
};
|
|
1094
|
+
} | {
|
|
1095
|
+
kind: 'assistantToolbarButton';
|
|
1096
|
+
props?: {
|
|
1097
|
+
showTitle?: boolean;
|
|
1098
|
+
icon?: string;
|
|
1099
|
+
};
|
|
1094
1100
|
} | {
|
|
1095
1101
|
kind: 'helpToolbarButton';
|
|
1096
1102
|
props?: {
|
|
@@ -5,8 +5,8 @@ import type { AssistantSpec } from '#package/application-spec';
|
|
|
5
5
|
* because the conventions it describes belong to this SDK version and not to the server. The part
|
|
6
6
|
* about changes is left out when the schema has no `Mutation` type, the part about adding
|
|
7
7
|
* entities when it has no `addChild` mutation, the part about replacing them when it has no
|
|
8
|
-
* `replaceEntity` mutation,
|
|
9
|
-
* no options edge. The last section explains the
|
|
8
|
+
* `replaceEntity` mutation, the part about the choices of a field when it has
|
|
9
|
+
* no options edge, and the part about custom changes when the manifest exposes no action. The last section explains the
|
|
10
10
|
* `query` and `apply` tools, which every run registers whatever the schema holds.
|
|
11
11
|
*/
|
|
12
12
|
export declare const generateAssistantPrompt: (assistant: NonNullable<AssistantSpec>) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let e=["How to read the GraphQL schema of this configurator:","- A configuration is a set of entities. `root` is the root entity, `entities` lists every entity or the ones with the given ids, and `selectedEntity` is the entity the user has selected, or the root entity when nothing is selected.","- Every entity has an `id` of the form `<Type>-<number>`, for example `Table-1`, and a `type` with its entity type name. Ids are assigned by the configurator: read them from the configuration and never make one up.","- A field whose name starts with `_` is computed by the configurator from other values. It can be read like any other field and never written.","- Numbers are in the units the configuration stores them in. A field description names the unit when the product defines one.",'- A text field that only takes fixed values lists them in its description as "One of: ...". Use exactly those values.',"- A field typed as another entity type or as a list of one is a relation: select fields on it to read the related entities.","- Field and type descriptions come from the team that built the configurator and say what a value means for the product."],t=["How changes work:","- Every field of the `Mutation` type is one change. Its description says what it changes and what it returns.","- The configurator checks the whole configuration after each change. A change that would leave it invalid fails with an error that names the entities at fault, and it is not applied. Later changes of the same request are then not run.","- The configurator may adjust other values in response to a change, so read what a mutation returns instead of assuming the values you sent."],
|
|
1
|
+
let e=["How to read the GraphQL schema of this configurator:","- A configuration is a set of entities. `root` is the root entity, `entities` lists every entity or the ones with the given ids, and `selectedEntity` is the entity the user has selected, or the root entity when nothing is selected.","- Every entity has an `id` of the form `<Type>-<number>`, for example `Table-1`, and a `type` with its entity type name. Ids are assigned by the configurator: read them from the configuration and never make one up.","- A field whose name starts with `_` is computed by the configurator from other values. It can be read like any other field and never written.","- Numbers are in the units the configuration stores them in. A field description names the unit when the product defines one.",'- A text field that only takes fixed values lists them in its description as "One of: ...". Use exactly those values.',"- A field typed as another entity type or as a list of one is a relation: select fields on it to read the related entities.","- Field and type descriptions come from the team that built the configurator and say what a value means for the product."],t=["How changes work:","- Every field of the `Mutation` type is one change. Its description says what it changes and what it returns.","- The configurator checks the whole configuration after each change. A change that would leave it invalid fails with an error that names the entities at fault, and it is not applied. Later changes of the same request are then not run.","- The configurator may adjust other values in response to a change, so read what a mutation returns instead of assuming the values you sent."],a=["How to add entities:","- Entities are added from recipes, the same ones the configurator offers the user. An entity type that can take children has a `meta` field; `meta { childRecipes }` lists its recipe groups and their recipes.","- List the recipes of the group first, pick one by its `key`, then call `addChild` with the id of the parent, the `groupId` and the `key`. Keys change with the configuration and the language, so never reuse one from memory.","- `dryRun` on a recipe shows what adding it would do without adding it: whether it is `ok`, the `changedEntities` it would add or modify, the `deletedEntityIds` it would remove, and the `errors` when it cannot be added. An entity whose id the configuration does not have yet is new. It is costly, so select it only on the recipes you are deciding between.","- Put each `addChild` in its own operation. The recipes of a group and what they add depend on the configuration before them, so after adding something, list the group again before adding from it once more."],n=["How to replace entities:","- An entity is replaced from recipes, the same ones the configurator offers the user. An entity type that can be replaced has a `meta` field; `meta { replaceRecipes }` lists its replace recipe groups and what the entity can be replaced with.","- List the recipes of the group first, pick one by its `key`, then call `replaceEntity` with the id of the entity, the `groupId` and the `key`. `dryRun` on a replace recipe shows what replacing would do without doing it: the replacement and everything else that changes are under `changedEntities`, and the replaced entity is among the `deletedEntityIds`.","- The replacement is a new entity with a new id, and its field values come from the recipe, so they can differ from those of the entity it replaces. Read the ids and values `replaceEntity` returns, and never use the old id again.","- Put each `replaceEntity` in its own operation. The recipes of a group and what they do depend on the configuration before them, so after replacing something, list the group of the replacement again before replacing once more."],i=["How to find the values a field can take:","- Some fields store a key whose choices the configurator holds elsewhere. Such a field has an edge under `meta` named after it: `meta { <field>Options }` lists its choices, each with the `value` to write and the `name` the user sees.","- Read the choices before you write such a field or name a choice to the user, and write the `value`, not the `name`. A value outside the list is rejected unless the edge description says the field is not checked.","- `dryRun` on an option shows what writing its value would do without writing it: whether it is `ok`, the `changedEntities` it would add or modify, the `deletedEntityIds` it would remove, and the `errors` when the value cannot be written. It is costly, so select it only on the options you are deciding between. It is null when the edge description says the options cannot be dry-run.","- The choices can depend on the entity and on its current state. Read them again after a change, unless the edge description says they are the same for all instances or do not change."],o=["How the custom changes of this configurator work:","- Besides the generic changes, the `Mutation` type has fields the team built for this product. Each runs one domain operation the configurator itself uses, so prefer it over composing the same change from generic mutations. Its description says what it does and what its arguments mean.","- Its arguments are checked against what the operation declares; an argument that does not fit, or a change the product does not allow, fails the field with a message that says what to send instead.","- It returns an object whose fields the description names; a field typed as an entity reads that entity after the change."],s=["How to use the `query` and `apply` tools:","- Both take `operations`, a list of GraphQL documents that run in order. Each document holds exactly one operation. To do several things, send several items in one call instead of several calls.","- Write values into the document as literals. Use `variables` only for a value that cannot be written as a literal.","- Select only the fields you need: results are returned whole.","- The result has one GraphQL result per operation, in the order sent. When an operation fails, its `errors` say why and the operations after it are not run.","- `query` reads the configuration the user has open and never changes it. Call it before you say anything about the configuration."],r=["- This configurator exposes no changes, so there is nothing for `apply` to run. Say so when the user asks you to change the configuration."],h=['- Mutations inside `query` answer "what if" questions. Each operation sees the changes of the ones before it, so a mutation followed by a query shows the configuration as it would be. Nothing is kept and the user sees no change.',"- `apply` makes the changes the user asked for. It is all or nothing: when any operation fails, nothing is changed; when all succeed, the user gets them as one undo step.","- `committed` in the result says whether the changes were kept. When it is false although no operation failed, `message` says why: the changes may be waiting for the approval of the user, the user may have changed the configuration meanwhile, or this session may not change the configuration at all. Without a `message`, the operations changed nothing. Never tell the user a change was made unless `committed` is true."];export const generateAssistantPrompt=d=>{let c=/^type Mutation\b/m.test(d.sdl);return[e,...c?[t]:[],.../^\s+addChild\(/m.test(d.sdl)?[a]:[],.../^\s+replaceEntity\(/m.test(d.sdl)?[n]:[],.../^type FieldOption\b/m.test(d.sdl)?[i]:[],...Object.keys(d.actions).length>0?[o]:[],[...s,...c?h:r]].map(e=>e.join("\n")).join("\n\n")};
|
package/dist/phoenix/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{bool as e,str as o}from"envalid";import{readFileSync as t}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 y}from"#package/legacy";import{readSpecProject as h}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 b,runCleanupEnvironmentCommand as L,runCreateEnvironmentCommand as I,runDataCommand as N,runDeployCommand as T,runDeploymentBuildEnvsCommand as w,runDevCommand as k,runDocsCommand as D,runExtractSourcesCommand as j,runFeedbackCommand as G,runFinishDeploymentCommand as C,runFixCommand as A,runInitCommand as K,runInspectAssetsCommand as V,runLinkCommand as M,runListEnvironmentsCommand as J,runLoginCommand as B,runLogoutCommand as F,runPrepareCiCommand as Y,runPrepareDeploymentCommand as q,runRegisterDeploymentCommand as x,runSceneCommand as H,runScreenshotCommand as W,runStateCommand as $,runStoryCommand as X,runSyncCommand as z,runUnlinkCommand as Q}from"./commands/index.js";import{DEFAULT_PHOENIX_REGION as Z,PHOENIX_REGIONS as ee,PUBLIC_PHOENIX_REGIONS as eo,getRegionServerUrl as et,getRegionStudioUrl as ei,resolveSignedInDevelopmentEnvironment as er}from"./services/index.js";import{getIsEditorEnabled as en}from"./utils/get-is-editor-enabled.js";import{createLogger as ea}from"./utils/index.js";let es=(e,o,t)=>{e?.info(`Using ${o?"application-spec":"domain-spec"} flow (${t})`)},el=(e,o,t)=>{let i=t?.logger??ea();if(void 0!==e)return i.detail(`Application spec: ${e} (from CLI flag)`),es(t?.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)`),es(t?.logger,e,"from environment variable"),e}return void 0!==o?(i.detail(`Application spec: ${o} (from package.json phoenix.applicationFlow)`),es(t?.logger,o,"from package.json phoenix.applicationFlow"),o):(i.detail("Application spec: false (default)"),es(t?.logger,!1,"default"),!1)},ep=t(s(a(c(import.meta.url)),"../../package.json"),"utf-8");if(!ep)throw Error("Project package.json is required, please provide it in the package.json file");let ed=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"})}).parse(JSON.parse(ep)),ec=async()=>{try{let e=await i("./package.json","utf-8"),o=JSON.parse(e);return{name:o.name,applicationFlow:o.phoenix?.applicationFlow}}catch{return{name:void 0,applicationFlow:void 0}}},eu=e=>{if(!(e instanceof Error))return String(e);let o=(e=>{if(!(e instanceof Error))return;if(e.message.length>0)return e.message;let o=(e instanceof AggregateError?e.errors:[]).find(e=>e instanceof Error&&e.message.length>0);return o instanceof Error?o.message:"code"in e&&"string"==typeof e.code?e.code:void 0})(e.cause);return void 0===o?e.message:`${e.message}: ${o}`};await u(E(process.argv)).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:"Enable or disable editor files generation (defaults to ENABLE_EDITOR env or true)"}).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)"}),async t=>{let i,r=f({PROJECT_SLUG:o({default:void 0}),ENVIRONMENT_SLUG:o({default:void 0}),ENABLE_EDITOR:e({default:!0}),DEBUG:e({default:!1}),BUILD_TARGET:o({choices:["frontend","webhook","both"],default:"both"}),FORCE_REBUILD:e({default:!1})})(),n=ea({debug:t.debug??r.DEBUG}),a=en(t.editor,r.ENABLE_EDITOR),s=t.force??r.FORCE_REBUILD,l=await ec(),p=el(t.applicationSpec,l.applicationFlow,{logger:n}),d=t.projectSlug??r.PROJECT_SLUG??l.name,c=t.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=t.onlyFrontend,E=t.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,await (p?U:y.runBuildCommand)({sdkVersion:ed.version,projectSlug:d,environmentSlug:c,cliUseWorkspace:t.workspace,enableEditor:a,buildTarget:i,force:s},{logger:n})}).command(["clean","cl"],"Clean build artifacts, reinstall dependencies, and rebuild specs",e=>e.option("workspace",{alias:"w",type:"boolean",description:"Override workspace mode (uses .phoenix.json config by default)"}).option("editor",{type:"boolean",description:"Enable or disable editor files generation (defaults to ENABLE_EDITOR env or true)"}).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 t=>{let i=f({PROJECT_SLUG:o({default:void 0}),ENVIRONMENT_SLUG:o({default:void 0}),ENABLE_EDITOR:e({default:!0}),DEBUG:e({default:!1})})(),r=ea({debug:t.debug??i.DEBUG}),n=en(t.editor,i.ENABLE_EDITOR),a=await ec(),s=el(t.applicationSpec,a.applicationFlow,{logger:r}),l=t.projectSlug??i.PROJECT_SLUG??a.name,p=t.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");await (s?b:y.runCleanCommand)({sdkVersion:ed.version,projectSlug:l,environmentSlug:p,cliUseWorkspace:t.workspace,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:"Enable or disable editor files generation (defaults to ENABLE_EDITOR env or true)"}).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 (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:eo,description:`Phoenix region of the workspace you are signed in to, used when .env has no SERVER_URL (default: ${Z})`}).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 t=>{let i=f({ENABLE_EDITOR:e({default:!0}),PROJECT_SLUG:o({default:void 0}),ENVIRONMENT_SLUG:o({default:void 0}),EDITOR_WS_PORT:o({default:"3020"}),DEBUG:e({default:!1}),WITH_LINGUI:e({default:!1}),PERSISTENCE_MODE:o({default:void 0}),FORCE_REBUILD:e({default:!1}),PHOENIX_TUI:e({default:!1}),SERVER_URL:o({default:void 0}),DEVELOPMENT_KEY:o({default:void 0}),PHOENIX_LOCAL:e({default:!1}),PHOENIX_REGION:o({choices:ee,default:void 0}),SKIP_UPLOAD:e({default:!1})})(),r=t.debug??i.DEBUG,n=ea({debug:r}),a=en(t.editor,i.ENABLE_EDITOR),s=t.editorWsPort??i.EDITOR_WS_PORT,l=t.force??i.FORCE_REBUILD,c=t.withLingui??i.WITH_LINGUI,u=t.persistence??i.PERSISTENCE_MODE,E=!u||"server"===u,v=t.tui??i.PHOENIX_TUI,m=await ec(),R=el(t.applicationSpec,m.applicationFlow,{logger:n}),S=t.local??i.PHOENIX_LOCAL,_=t.projectSlug??i.PROJECT_SLUG,U=E&&R&&!S&&!_?.length?await h(process.cwd()):void 0,{serverUrl:O,developmentKey:P,apiToken:b,projectSlug:L,environmentSlug:I}=await d({useServer:E,local:S,serverUrl:t.serverUrl??i.SERVER_URL,developmentKey:i.DEVELOPMENT_KEY,projectSlug:_?.length?_:U,environmentSlug:t.environmentSlug??i.ENVIRONMENT_SLUG}).with({useServer:!1},async({serverUrl:e,developmentKey:o,projectSlug:t,environmentSlug:i})=>({serverUrl:e,developmentKey:o,apiToken:void 0,projectSlug:t??m.name,environmentSlug:i??m.name})).with({local:!0},async({serverUrl:e,developmentKey:o,projectSlug:t,environmentSlug:i})=>({serverUrl:e?.length?e:"http://localhost:3000",developmentKey:o?.length?o:"dev_local-dev-key-12345",apiToken:void 0,projectSlug:t?.length?t:"local",environmentSlug:i?.length?i:"dev-local"})).with({developmentKey:p.string.minLength(1)},()=>U===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:o,projectSlug:t,environmentSlug:i})=>({serverUrl:e,developmentKey:o,apiToken:void 0,projectSlug:t,environmentSlug:i})).with({developmentKey:p.union(void 0,""),projectSlug:p.string.minLength(1)},()=>R,async({serverUrl:e,projectSlug:o})=>{let r=e?.length?e:et(t.region??i.PHOENIX_REGION??Z),a=await er({serverUrl:r,project:o});return n.info(`Developing in ${a.projectSlug}/${a.environmentSlug} of workspace "${a.workspaceName}" on ${r}`),{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,"")},()=>R,()=>{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 N={sdkVersion:ed.version,projectSlug:L,environmentSlug:I,cliUseWorkspace:t.workspace,enableEditor:a,editorWsPort:s,debug:r,withLingui:c,persistenceMode:u,force:l,tui:v,serverUrl:O,skipUpload:t.skipUpload??i.SKIP_UPLOAD};if(R){let e=P?{developmentKey:P}:b?{apiToken:b}:void 0;await k({...N,credential:e},{logger:n})}else await y.runDevCommand({...N,developmentKey:P},{logger:n})}).command(["link","l"],"Link local SDK for development",e=>e.option("sdk-path",{type:"string",description:"Path to the SDK repository",default:"../configurator-phoenix"}),async e=>{let o=ea();await M({sdkPath:e.sdkPath},{logger:o})}).command(["unlink","ul"],"Remove local SDK linking",()=>{},async()=>{let e=ea();await Q({logger:e})}).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:"Enable or disable editor files generation (defaults to ENABLE_EDITOR env or true)"}).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 t=>{let i=f({ENABLE_EDITOR:e({default:!0}),DEBUG:e({default:!1}),PROJECT_SLUG:o({default:void 0}),ENVIRONMENT_SLUG:o({default:void 0}),FORCE_REBUILD:e({default:!1})})(),r=ea({debug:t.debug??i.DEBUG}),n=en(t.editor,i.ENABLE_EDITOR),a=t.force??i.FORCE_REBUILD,s=await ec(),l=el(t.applicationSpec,s.applicationFlow,{logger:r}),p=t.projectSlug??i.PROJECT_SLUG??s.name,d=t.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");await (l?z:y.runSyncCommand)({sdkVersion:ed.version,projectSlug:p,environmentSlug:d,cliUseWorkspace:t.workspace,enableEditor:n,force:a,analyze:t.analyze},{logger:r})}).command("init [folder]","Start a Phoenix project: write package.json when the folder has none, a starter spec and pnpm-workspace.yaml with the pnpm settings the install needs. 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 o=ea({debug:e.debug??!1});try{await K({sdkVersion:ed.version,projectRoot:void 0===e.folder?void 0:l(e.folder)},{logger:o})}catch(e){o.error(e instanceof Error?e.message:String(e)),process.exit(1)}}).command(["story","st"],"Storybook example utilities",e=>X(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 o=>{let t=f({DEBUG:e({default:!1})})(),i=ea({debug:o.debug??t.DEBUG});await P({types:o.types,lint:o.lint,format:o.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 o=>{let t=f({DEBUG:e({default:!1})})(),i=ea({debug:o.debug??t.DEBUG});await A({lint:o.lint,format:o.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 o=ea();await O({version:e.ver,all:e.all,page:e.page,list:e.list},{logger:o})}).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 o=ea();await V({file:e.file,objects:e.objects,materials:e.materials,morphs:e.morphs,animations:e.animations,json:e.json},{logger:o})}).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 t=f({EDITOR_WS_PORT:o({default:"3020"}),SCREENSHOT_OUTPUT:o({default:"./screenshot.png"})})(),i=ea();await W({port:e.port??t.EDITOR_WS_PORT,output:e.output??t.SCREENSHOT_OUTPUT,width:e.width,height:e.height,format:e.format},{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 t=f({EDITOR_WS_PORT:o({default:"3020"})})(),i=ea();await $({port:e.port??t.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 t=f({EDITOR_WS_PORT:o({default:"3020"})})(),i=ea();await N({port:e.port??t.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 t=f({EDITOR_WS_PORT:o({default:"3020"})})(),i=ea();await H({port:e.port??t.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 o=ea();await D({read:e.read,category:e.category,list:e.list,search:e.search,dir:e.dir},{logger:o})}).command(["prepare:ci","pci","ci"],"Prepare CI environment by copying .env.ci to .env",()=>{},async()=>{let e=ea();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 o=>{let t=f({DEBUG:e({default:!1})})(),i=o.debug??t.DEBUG,r=ea({debug:i});await I({server:o.server,apiKey:o.apiKey,name:o.name,slug:o.slug,uuid:o.uuid,outFile:o.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 o=>{let t=f({DEBUG:e({default:!1})})(),i=o.debug??t.DEBUG,r=ea({debug:i});await J({server:o.server,apiKey:o.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 t=>{let i=f({DEBUG:e({default:!1}),ENVIRONMENT_API_KEY:o({default:void 0}),PROJECT_KEY:o({default:void 0}),PROJECT_SLUG:o({default:void 0}),ENVIRONMENT_SLUG:o({default:void 0}),SERVER_URL:o({default:void 0}),OUT_FILE:o({default:void 0})})(),r=t.debug??i.DEBUG,n=t.apiKey??i.ENVIRONMENT_API_KEY,a=t.projectKey??i.PROJECT_KEY,s=t.projectSlug??i.PROJECT_SLUG,l=await ec(),p=t.environmentSlug??i.ENVIRONMENT_SLUG??l.name,d=t.serverUrl??i.SERVER_URL,c=t.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=ea({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:eo,description:`Phoenix region the workspace lives in (default: ${Z})`}).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 t=f({PHOENIX_REGION:o({choices:ee,default:void 0})})(),i=e.region??t.PHOENIX_REGION??Z,r=ea();try{await B({customer:e.customer,serverUrl:e.serverUrl??et(i),studioUrl:e.studioUrl??ei(i,e.customer),open:e.open},{logger:r})}catch(e){r.error(eu(e)),process.exit(1)}}).command(["deploy"],"Upload this SDK-builder project and follow its build until it is live",e=>e.option("region",{choices:eo,description:`Phoenix region the workspace lives in (default: ${Z})`}).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 t=f({PHOENIX_REGION:o({choices:ee,default:void 0})})(),i=e.region??t.PHOENIX_REGION??Z,r=ea();try{await T({serverUrl:e.serverUrl??et(i),sdkVersion:ed.version,wait:e.wait,projectDir:process.cwd(),pollIntervalMs:3e3},{logger:r})}catch(e){r.error(eu(e)),process.exit(1)}}).command(["logout"],"Revoke the API token of an SDK-builder workspace and forget it on this computer",e=>e.option("region",{choices:eo,description:`Phoenix region to sign out of (default: ${Z})`}).option("serverUrl",{alias:"su",type:"string",description:"URL of the Phoenix server, instead of the region default"}),async e=>{let t=f({PHOENIX_REGION:o({choices:ee,default:void 0})})(),i=e.region??t.PHOENIX_REGION??Z,r=ea();try{await F({serverUrl:e.serverUrl??et(i)},{logger:r})}catch(e){r.error(eu(e)),process.exit(1)}}).command(["feedback <message>"],"Send feedback about the SDK, CLI, docs or Studio to the Phoenix team",e=>e.positional("message",{type:"string",demandOption:!0,description:"What you want to tell the Phoenix team"}).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:eo,description:`Phoenix region the workspace lives in (default: ${Z})`}).option("serverUrl",{alias:"su",type:"string",description:"URL of the Phoenix server, instead of the region default"}),async e=>{let t=f({PHOENIX_REGION:o({choices:ee,default:void 0}),PROJECT_SLUG:o({default:void 0})})(),i=ea(),a=e.region??t.PHOENIX_REGION??Z,s=e.projectSlug??t.PROJECT_SLUG,l=s?.length?s:await h(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 G({serverUrl:e.serverUrl??et(a),message:e.message,type:e.type,contact:e.contact,agent:e.agent,project:l,sdkVersion:ed.version,clientInfo:`${n()} ${r()}, Node.js ${process.versions.node}`},{logger:i})}catch(e){i.error(eu(e)),process.exit(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 o=>{let t=f({DEBUG:e({default:!1})})(),i=o.debug??t.DEBUG,r=ea({debug:i});await x({server:o.server,apiKey:o.apiKey,outFile:o.outFile,skipUpload:o.skipUpload,activate:o.activate,overrideSchema:o.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 o=>{let t=f({DEBUG:e({default:!1})})(),i=o.debug??t.DEBUG,r=ea({debug:i});await _({server:o.server,apiKey:o.apiKey,uuid:o.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 t=>{let i=f({DEBUG:e({default:!1}),ENVIRONMENT_API_KEY:o({default:void 0}),PROJECT_KEY:o({default:void 0}),PROJECT_SLUG:o({default:void 0}),PROJECT_REF:o({default:void 0}),PROJECT_SHA:o({default:void 0}),ENVIRONMENT_SLUG:o({default:void 0}),OUT_FILE:o({default:".env.generated"}),SKIP_UPLOAD:e({default:!1}),OVERRIDE_SCHEMA:e({default:!1}),SERVER_URL:o({default:void 0})})(),r=t.debug??i.DEBUG,n=t.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=t.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=t.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=t.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=t.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 ec(),c=ea({debug:r}),u=el(t.applicationSpec,d.applicationFlow,{logger:c});await (u?q:y.runPrepareDeploymentCommand)({apiKey:n,projectKey:a,projectSlug:s,projectRef:t.projectRef??i.PROJECT_REF,projectSha:t.projectSha??i.PROJECT_SHA,environmentSlug:l,outFile:t.outFile??i.OUT_FILE,skipUpload:t.skipUpload??i.SKIP_UPLOAD,overrideSchema:t.overrideSchema??i.OVERRIDE_SCHEMA,uploadLinksFile:t.uploadLinksFile??".upload-links.json",serverUrl:p,debug:r,projectVersion:ed.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 t=>{let i=f({DEBUG:e({default:!1}),PROJECT_SLUG:o({default:void 0}),ENVIRONMENT_SLUG:o({default:void 0}),SERVER_URL:o({default:void 0}),DEVELOPMENT_KEY:o({default:void 0}),PHOENIX_LOCAL:e({default:!1}),OUT_FILE:o({default:".env.generated"}),SKIP_UPLOAD:e({default:!1}),OVERRIDE_SCHEMA:e({default:!0})})(),r=t.debug??i.DEBUG,n=ea({debug:r}),a=t.local??i.PHOENIX_LOCAL,s=i.SERVER_URL,l=t.projectSlug??i.PROJECT_SLUG,p=t.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 ec(),u=el(t.applicationSpec,c.applicationFlow,{logger:n}),E={serverUrl:s,projectSlug:l,environmentSlug:p,outFile:t.outFile??i.OUT_FILE,skipUpload:t.skipUpload??i.SKIP_UPLOAD,overrideSchema:t.overrideSchema??i.OVERRIDE_SCHEMA,debug:r,projectVersion:ed.version};try{u?await R({...E,credential:{developmentKey:d}},{logger:n}):await y.prepareDevelopmentEnvironment({...E,developmentKey:d},{logger:n})}catch(e){n.error(`Development environment preparation failed: ${e instanceof Error?e.message:String(e)}`,e),process.exit(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 t=>{let i=f({DEBUG:e({default:!1}),ENVIRONMENT_SLUG:o({default:void 0}),PROJECT_KEY:o({default:"project_local-dev-key-12345"}),PROJECT_SLUG:o({default:"local"}),OUT_FILE:o({default:".env.generated"}),SKIP_UPLOAD:e({default:!1}),OVERRIDE_SCHEMA:e({default:!0}),SERVER_URL:o({default:"http://localhost:3000"}),LAMBDA_URL:o({default:"http://localhost:8080"}),ENVIRONMENT_API_KEY:o({default:"local-dev-key-12345"})})(),r=t.debug??i.DEBUG,n=t.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 ec(),s=t.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=t.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=ea({debug:r}),d=el(t.applicationSpec,a.applicationFlow,{logger:p});try{await (d?S:y.prepareLocalEnvironment)({apiKey:l,projectKey:n,projectSlug:t.projectSlug??i.PROJECT_SLUG,environmentSlug:s,outFile:t.outFile??i.OUT_FILE,skipUpload:t.skipUpload??i.SKIP_UPLOAD,overrideSchema:t.overrideSchema??i.OVERRIDE_SCHEMA,serverUrl:t.serverUrl??i.SERVER_URL,lambdaUrl:t.lambdaUrl??i.LAMBDA_URL,debug:r,projectVersion:ed.version},{logger:p})}catch(e){p.error(`Local environment preparation failed: ${e instanceof Error?e.message:String(e)}`,e),process.exit(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 o=ea();try{await j({archivePath:e.archive,targetDir:e.folder},{logger:o})}catch(e){o.error(e instanceof Error?e.message:String(e)),process.exit(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 t=>{let i=f({DEBUG:e({default:!1}),DEPLOYMENT_ID:o({default:void 0}),ENVIRONMENT_API_KEY:o({default:void 0}),PROJECT_KEY:o({default:void 0}),PROJECT_SLUG:o({default:void 0}),OUT_FILE:o({default:".env.generated"}),SERVER_URL:o({default:void 0})})(),r=t.debug??i.DEBUG,n=t.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=t.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=t.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=t.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=t.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=ea({debug:r});await w({uuid:n,apiKey:a,projectKey:s,projectSlug:l,outFile:t.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 t=>{let i=f({DEBUG:e({default:!1}),DEPLOYMENT_ID:o({default:void 0}),ENVIRONMENT_API_KEY:o({default:void 0}),PROJECT_KEY:o({default:void 0}),PROJECT_SLUG:o({default:void 0}),LAMBDA_URL:o({default:void 0}),SERVER_URL:o({default:void 0}),SKIP_UPLOAD:e({default:!1})})(),r=t.debug??i.DEBUG,n=t.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=t.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=t.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=t.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=t.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=t.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=ea({debug:r});await C({uuid:n,uploadLinksFile:t.uploadLinksFile??".upload-links.json",apiKey:a,projectKey:s,projectSlug:l,lambdaUrl:p,serverUrl:d,skipUpload:t.skipUpload??i.SKIP_UPLOAD,debug:r},{logger:c})}).demandCommand(1,"Please specify a command").help().alias("help","h").version(ed.version).alias("version","v").strict().parse();
|
|
2
|
+
import{bool as e,str as o}from"envalid";import{readFileSync as t}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 y}from"#package/legacy";import{readSpecProject as h}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 b,runCleanupEnvironmentCommand as L,runCreateEnvironmentCommand as I,runDataCommand as N,runDeployCommand as T,runDeploymentBuildEnvsCommand as w,runDevCommand as k,runDocsCommand as D,runExtractSourcesCommand as j,runFeedbackCommand as G,runFinishDeploymentCommand as C,runFixCommand as A,runInitCommand as K,runInspectAssetsCommand as V,runLinkCommand as M,runListEnvironmentsCommand as J,runLoginCommand as B,runLogoutCommand as F,runPrepareCiCommand as Y,runPrepareDeploymentCommand as x,runRegisterDeploymentCommand as q,runSceneCommand as H,runScreenshotCommand as W,runStateCommand as $,runStoryCommand as X,runSyncCommand as z,runUnlinkCommand as Q}from"./commands/index.js";import{DEFAULT_PHOENIX_REGION as Z,PHOENIX_REGIONS as ee,PUBLIC_PHOENIX_REGIONS as eo,getRegionServerUrl as et,getRegionStudioUrl as ei,resolveSignedInDevelopmentEnvironment as er}from"./services/index.js";import{getIsEditorEnabled as en}from"./utils/get-is-editor-enabled.js";import{createLogger as ea}from"./utils/index.js";let es=(e,o,t)=>{e?.info(`Using ${o?"application-spec":"domain-spec"} flow (${t})`)},el=(e,o,t)=>{let i=t?.logger??ea();if(void 0!==e)return i.detail(`Application spec: ${e} (from CLI flag)`),es(t?.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)`),es(t?.logger,e,"from environment variable"),e}return void 0!==o?(i.detail(`Application spec: ${o} (from package.json phoenix.applicationFlow)`),es(t?.logger,o,"from package.json phoenix.applicationFlow"),o):(i.detail("Application spec: false (default)"),es(t?.logger,!1,"default"),!1)},ep=t(s(a(c(import.meta.url)),"../../package.json"),"utf-8");if(!ep)throw Error("Project package.json is required, please provide it in the package.json file");let ed=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"})}).parse(JSON.parse(ep)),ec=async()=>{try{let e=await i("./package.json","utf-8"),o=JSON.parse(e);return{name:o.name,applicationFlow:o.phoenix?.applicationFlow}}catch{return{name:void 0,applicationFlow:void 0}}},eu=e=>{if(!(e instanceof Error))return String(e);let o=(e=>{if(!(e instanceof Error))return;if(e.message.length>0)return e.message;let o=(e instanceof AggregateError?e.errors:[]).find(e=>e instanceof Error&&e.message.length>0);return o instanceof Error?o.message:"code"in e&&"string"==typeof e.code?e.code:void 0})(e.cause);return void 0===o?e.message:`${e.message}: ${o}`};await u(E(process.argv)).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:"Enable or disable editor files generation (defaults to ENABLE_EDITOR env or true)"}).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 t=>{let i,r=f({PROJECT_SLUG:o({default:void 0}),ENVIRONMENT_SLUG:o({default:void 0}),ENABLE_EDITOR:e({default:!0}),DEBUG:e({default:!1}),BUILD_TARGET:o({choices:["frontend","webhook","both"],default:"both"}),FORCE_REBUILD:e({default:!1})})(),n=ea({debug:t.debug??r.DEBUG}),a=en(t.editor,r.ENABLE_EDITOR),s=t.force??r.FORCE_REBUILD,l=await ec(),p=el(t.applicationSpec,l.applicationFlow,{logger:n}),d=t.projectSlug??r.PROJECT_SLUG??l.name,c=t.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=t.onlyFrontend,E=t.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:ed.version,projectSlug:d,environmentSlug:c,cliUseWorkspace:t.workspace,enableEditor:a,buildTarget:i,force:s};await (p?U({...v,banner:t.banner},{logger:n}):y.runBuildCommand(v,{logger:n}))}).command(["clean","cl"],"Clean build artifacts, reinstall dependencies, and rebuild specs",e=>e.option("workspace",{alias:"w",type:"boolean",description:"Override workspace mode (uses .phoenix.json config by default)"}).option("editor",{type:"boolean",description:"Enable or disable editor files generation (defaults to ENABLE_EDITOR env or true)"}).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 t=>{let i=f({PROJECT_SLUG:o({default:void 0}),ENVIRONMENT_SLUG:o({default:void 0}),ENABLE_EDITOR:e({default:!0}),DEBUG:e({default:!1})})(),r=ea({debug:t.debug??i.DEBUG}),n=en(t.editor,i.ENABLE_EDITOR),a=await ec(),s=el(t.applicationSpec,a.applicationFlow,{logger:r}),l=t.projectSlug??i.PROJECT_SLUG??a.name,p=t.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");await (s?b:y.runCleanCommand)({sdkVersion:ed.version,projectSlug:l,environmentSlug:p,cliUseWorkspace:t.workspace,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:"Enable or disable editor files generation (defaults to ENABLE_EDITOR env or true)"}).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 (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:eo,description:`Phoenix region of the workspace you are signed in to, used when .env has no SERVER_URL (default: ${Z})`}).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 t=>{let i=f({ENABLE_EDITOR:e({default:!0}),PROJECT_SLUG:o({default:void 0}),ENVIRONMENT_SLUG:o({default:void 0}),EDITOR_WS_PORT:o({default:"3020"}),DEBUG:e({default:!1}),WITH_LINGUI:e({default:!1}),PERSISTENCE_MODE:o({default:void 0}),FORCE_REBUILD:e({default:!1}),PHOENIX_TUI:e({default:!1}),SERVER_URL:o({default:void 0}),DEVELOPMENT_KEY:o({default:void 0}),PHOENIX_LOCAL:e({default:!1}),PHOENIX_REGION:o({choices:ee,default:void 0}),SKIP_UPLOAD:e({default:!1})})(),r=t.debug??i.DEBUG,n=ea({debug:r}),a=en(t.editor,i.ENABLE_EDITOR),s=t.editorWsPort??i.EDITOR_WS_PORT,l=t.force??i.FORCE_REBUILD,c=t.withLingui??i.WITH_LINGUI,u=t.persistence??i.PERSISTENCE_MODE,E=!u||"server"===u,v=t.tui??i.PHOENIX_TUI,m=await ec(),R=el(t.applicationSpec,m.applicationFlow,{logger:n}),S=t.local??i.PHOENIX_LOCAL,_=t.projectSlug??i.PROJECT_SLUG,U=E&&R&&!S&&!_?.length?await h(process.cwd()):void 0,{serverUrl:O,developmentKey:P,apiToken:b,projectSlug:L,environmentSlug:I}=await d({useServer:E,local:S,serverUrl:t.serverUrl??i.SERVER_URL,developmentKey:i.DEVELOPMENT_KEY,projectSlug:_?.length?_:U,environmentSlug:t.environmentSlug??i.ENVIRONMENT_SLUG}).with({useServer:!1},async({serverUrl:e,developmentKey:o,projectSlug:t,environmentSlug:i})=>({serverUrl:e,developmentKey:o,apiToken:void 0,projectSlug:t??m.name,environmentSlug:i??m.name})).with({local:!0},async({serverUrl:e,developmentKey:o,projectSlug:t,environmentSlug:i})=>({serverUrl:e?.length?e:"http://localhost:3000",developmentKey:o?.length?o:"dev_local-dev-key-12345",apiToken:void 0,projectSlug:t?.length?t:"local",environmentSlug:i?.length?i:"dev-local"})).with({developmentKey:p.string.minLength(1)},()=>U===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:o,projectSlug:t,environmentSlug:i})=>({serverUrl:e,developmentKey:o,apiToken:void 0,projectSlug:t,environmentSlug:i})).with({developmentKey:p.union(void 0,""),projectSlug:p.string.minLength(1)},()=>R,async({serverUrl:e,projectSlug:o})=>{let r=e?.length?e:et(t.region??i.PHOENIX_REGION??Z),a=await er({serverUrl:r,project:o});return n.info(`Developing in ${a.projectSlug}/${a.environmentSlug} of workspace "${a.workspaceName}" on ${r}`),{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,"")},()=>R,()=>{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 N={sdkVersion:ed.version,projectSlug:L,environmentSlug:I,cliUseWorkspace:t.workspace,enableEditor:a,editorWsPort:s,debug:r,withLingui:c,persistenceMode:u,force:l,tui:v,serverUrl:O,skipUpload:t.skipUpload??i.SKIP_UPLOAD};if(R){let e=P?{developmentKey:P}:b?{apiToken:b}:void 0;await k({...N,credential:e},{logger:n})}else await y.runDevCommand({...N,developmentKey:P},{logger:n})}).command(["link","l"],"Link local SDK for development",e=>e.option("sdk-path",{type:"string",description:"Path to the SDK repository",default:"../configurator-phoenix"}),async e=>{let o=ea();await M({sdkPath:e.sdkPath},{logger:o})}).command(["unlink","ul"],"Remove local SDK linking",()=>{},async()=>{let e=ea();await Q({logger:e})}).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:"Enable or disable editor files generation (defaults to ENABLE_EDITOR env or true)"}).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 t=>{let i=f({ENABLE_EDITOR:e({default:!0}),DEBUG:e({default:!1}),PROJECT_SLUG:o({default:void 0}),ENVIRONMENT_SLUG:o({default:void 0}),FORCE_REBUILD:e({default:!1})})(),r=ea({debug:t.debug??i.DEBUG}),n=en(t.editor,i.ENABLE_EDITOR),a=t.force??i.FORCE_REBUILD,s=await ec(),l=el(t.applicationSpec,s.applicationFlow,{logger:r}),p=t.projectSlug??i.PROJECT_SLUG??s.name,d=t.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");await (l?z:y.runSyncCommand)({sdkVersion:ed.version,projectSlug:p,environmentSlug:d,cliUseWorkspace:t.workspace,enableEditor:n,force:a,analyze:t.analyze},{logger:r})}).command("init [folder]","Start a Phoenix project: write package.json when the folder has none, a starter spec and pnpm-workspace.yaml with the pnpm settings the install needs. 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 o=ea({debug:e.debug??!1});try{await K({sdkVersion:ed.version,projectRoot:void 0===e.folder?void 0:l(e.folder)},{logger:o})}catch(e){o.error(e instanceof Error?e.message:String(e)),process.exit(1)}}).command(["story","st"],"Storybook example utilities",e=>X(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 o=>{let t=f({DEBUG:e({default:!1})})(),i=ea({debug:o.debug??t.DEBUG});await P({types:o.types,lint:o.lint,format:o.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 o=>{let t=f({DEBUG:e({default:!1})})(),i=ea({debug:o.debug??t.DEBUG});await A({lint:o.lint,format:o.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 o=ea();await O({version:e.ver,all:e.all,page:e.page,list:e.list},{logger:o})}).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 o=ea();await V({file:e.file,objects:e.objects,materials:e.materials,morphs:e.morphs,animations:e.animations,json:e.json},{logger:o})}).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 t=f({EDITOR_WS_PORT:o({default:"3020"}),SCREENSHOT_OUTPUT:o({default:"./screenshot.png"})})(),i=ea();await W({port:e.port??t.EDITOR_WS_PORT,output:e.output??t.SCREENSHOT_OUTPUT,width:e.width,height:e.height,format:e.format},{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 t=f({EDITOR_WS_PORT:o({default:"3020"})})(),i=ea();await $({port:e.port??t.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 t=f({EDITOR_WS_PORT:o({default:"3020"})})(),i=ea();await N({port:e.port??t.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 t=f({EDITOR_WS_PORT:o({default:"3020"})})(),i=ea();await H({port:e.port??t.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 o=ea();await D({read:e.read,category:e.category,list:e.list,search:e.search,dir:e.dir},{logger:o})}).command(["prepare:ci","pci","ci"],"Prepare CI environment by copying .env.ci to .env",()=>{},async()=>{let e=ea();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 o=>{let t=f({DEBUG:e({default:!1})})(),i=o.debug??t.DEBUG,r=ea({debug:i});await I({server:o.server,apiKey:o.apiKey,name:o.name,slug:o.slug,uuid:o.uuid,outFile:o.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 o=>{let t=f({DEBUG:e({default:!1})})(),i=o.debug??t.DEBUG,r=ea({debug:i});await J({server:o.server,apiKey:o.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 t=>{let i=f({DEBUG:e({default:!1}),ENVIRONMENT_API_KEY:o({default:void 0}),PROJECT_KEY:o({default:void 0}),PROJECT_SLUG:o({default:void 0}),ENVIRONMENT_SLUG:o({default:void 0}),SERVER_URL:o({default:void 0}),OUT_FILE:o({default:void 0})})(),r=t.debug??i.DEBUG,n=t.apiKey??i.ENVIRONMENT_API_KEY,a=t.projectKey??i.PROJECT_KEY,s=t.projectSlug??i.PROJECT_SLUG,l=await ec(),p=t.environmentSlug??i.ENVIRONMENT_SLUG??l.name,d=t.serverUrl??i.SERVER_URL,c=t.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=ea({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:eo,description:`Phoenix region the workspace lives in (default: ${Z})`}).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 t=f({PHOENIX_REGION:o({choices:ee,default:void 0})})(),i=e.region??t.PHOENIX_REGION??Z,r=ea();try{await B({customer:e.customer,serverUrl:e.serverUrl??et(i),studioUrl:e.studioUrl??ei(i,e.customer),open:e.open},{logger:r})}catch(e){r.error(eu(e)),process.exit(1)}}).command(["deploy"],"Upload this SDK-builder project and follow its build until it is live",e=>e.option("region",{choices:eo,description:`Phoenix region the workspace lives in (default: ${Z})`}).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 t=f({PHOENIX_REGION:o({choices:ee,default:void 0})})(),i=e.region??t.PHOENIX_REGION??Z,r=ea();try{await T({serverUrl:e.serverUrl??et(i),sdkVersion:ed.version,wait:e.wait,projectDir:process.cwd(),pollIntervalMs:3e3},{logger:r})}catch(e){r.error(eu(e)),process.exit(1)}}).command(["logout"],"Revoke the API token of an SDK-builder workspace and forget it on this computer",e=>e.option("region",{choices:eo,description:`Phoenix region to sign out of (default: ${Z})`}).option("serverUrl",{alias:"su",type:"string",description:"URL of the Phoenix server, instead of the region default"}),async e=>{let t=f({PHOENIX_REGION:o({choices:ee,default:void 0})})(),i=e.region??t.PHOENIX_REGION??Z,r=ea();try{await F({serverUrl:e.serverUrl??et(i)},{logger:r})}catch(e){r.error(eu(e)),process.exit(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:eo,description:`Phoenix region the workspace lives in (default: ${Z})`}).option("serverUrl",{alias:"su",type:"string",description:"URL of the Phoenix server, instead of the region default"}),async e=>{let t=f({PHOENIX_REGION:o({choices:ee,default:void 0}),PROJECT_SLUG:o({default:void 0})})(),i=ea(),a=e.region??t.PHOENIX_REGION??Z,s=e.projectSlug??t.PROJECT_SLUG,l=s?.length?s:await h(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 G({serverUrl:e.serverUrl??et(a),message:e.message,file:e.file,type:e.type,contact:e.contact,agent:e.agent,project:l,sdkVersion:ed.version,clientInfo:`${n()} ${r()}, Node.js ${process.versions.node}`},{logger:i})}catch(e){i.error(eu(e)),process.exit(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 o=>{let t=f({DEBUG:e({default:!1})})(),i=o.debug??t.DEBUG,r=ea({debug:i});await q({server:o.server,apiKey:o.apiKey,outFile:o.outFile,skipUpload:o.skipUpload,activate:o.activate,overrideSchema:o.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 o=>{let t=f({DEBUG:e({default:!1})})(),i=o.debug??t.DEBUG,r=ea({debug:i});await _({server:o.server,apiKey:o.apiKey,uuid:o.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 t=>{let i=f({DEBUG:e({default:!1}),ENVIRONMENT_API_KEY:o({default:void 0}),PROJECT_KEY:o({default:void 0}),PROJECT_SLUG:o({default:void 0}),PROJECT_REF:o({default:void 0}),PROJECT_SHA:o({default:void 0}),ENVIRONMENT_SLUG:o({default:void 0}),OUT_FILE:o({default:".env.generated"}),SKIP_UPLOAD:e({default:!1}),OVERRIDE_SCHEMA:e({default:!1}),SERVER_URL:o({default:void 0})})(),r=t.debug??i.DEBUG,n=t.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=t.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=t.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=t.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=t.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 ec(),c=ea({debug:r}),u=el(t.applicationSpec,d.applicationFlow,{logger:c});await (u?x:y.runPrepareDeploymentCommand)({apiKey:n,projectKey:a,projectSlug:s,projectRef:t.projectRef??i.PROJECT_REF,projectSha:t.projectSha??i.PROJECT_SHA,environmentSlug:l,outFile:t.outFile??i.OUT_FILE,skipUpload:t.skipUpload??i.SKIP_UPLOAD,overrideSchema:t.overrideSchema??i.OVERRIDE_SCHEMA,uploadLinksFile:t.uploadLinksFile??".upload-links.json",serverUrl:p,debug:r,projectVersion:ed.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 t=>{let i=f({DEBUG:e({default:!1}),PROJECT_SLUG:o({default:void 0}),ENVIRONMENT_SLUG:o({default:void 0}),SERVER_URL:o({default:void 0}),DEVELOPMENT_KEY:o({default:void 0}),PHOENIX_LOCAL:e({default:!1}),OUT_FILE:o({default:".env.generated"}),SKIP_UPLOAD:e({default:!1}),OVERRIDE_SCHEMA:e({default:!0})})(),r=t.debug??i.DEBUG,n=ea({debug:r}),a=t.local??i.PHOENIX_LOCAL,s=i.SERVER_URL,l=t.projectSlug??i.PROJECT_SLUG,p=t.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 ec(),u=el(t.applicationSpec,c.applicationFlow,{logger:n}),E={serverUrl:s,projectSlug:l,environmentSlug:p,outFile:t.outFile??i.OUT_FILE,skipUpload:t.skipUpload??i.SKIP_UPLOAD,overrideSchema:t.overrideSchema??i.OVERRIDE_SCHEMA,debug:r,projectVersion:ed.version};try{u?await R({...E,credential:{developmentKey:d}},{logger:n}):await y.prepareDevelopmentEnvironment({...E,developmentKey:d},{logger:n})}catch(e){n.error(`Development environment preparation failed: ${e instanceof Error?e.message:String(e)}`,e),process.exit(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 t=>{let i=f({DEBUG:e({default:!1}),ENVIRONMENT_SLUG:o({default:void 0}),PROJECT_KEY:o({default:"project_local-dev-key-12345"}),PROJECT_SLUG:o({default:"local"}),OUT_FILE:o({default:".env.generated"}),SKIP_UPLOAD:e({default:!1}),OVERRIDE_SCHEMA:e({default:!0}),SERVER_URL:o({default:"http://localhost:3000"}),LAMBDA_URL:o({default:"http://localhost:8080"}),ENVIRONMENT_API_KEY:o({default:"local-dev-key-12345"})})(),r=t.debug??i.DEBUG,n=t.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 ec(),s=t.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=t.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=ea({debug:r}),d=el(t.applicationSpec,a.applicationFlow,{logger:p});try{await (d?S:y.prepareLocalEnvironment)({apiKey:l,projectKey:n,projectSlug:t.projectSlug??i.PROJECT_SLUG,environmentSlug:s,outFile:t.outFile??i.OUT_FILE,skipUpload:t.skipUpload??i.SKIP_UPLOAD,overrideSchema:t.overrideSchema??i.OVERRIDE_SCHEMA,serverUrl:t.serverUrl??i.SERVER_URL,lambdaUrl:t.lambdaUrl??i.LAMBDA_URL,debug:r,projectVersion:ed.version},{logger:p})}catch(e){p.error(`Local environment preparation failed: ${e instanceof Error?e.message:String(e)}`,e),process.exit(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 o=ea();try{await j({archivePath:e.archive,targetDir:e.folder},{logger:o})}catch(e){o.error(e instanceof Error?e.message:String(e)),process.exit(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 t=>{let i=f({DEBUG:e({default:!1}),DEPLOYMENT_ID:o({default:void 0}),ENVIRONMENT_API_KEY:o({default:void 0}),PROJECT_KEY:o({default:void 0}),PROJECT_SLUG:o({default:void 0}),OUT_FILE:o({default:".env.generated"}),SERVER_URL:o({default:void 0})})(),r=t.debug??i.DEBUG,n=t.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=t.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=t.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=t.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=t.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=ea({debug:r});await w({uuid:n,apiKey:a,projectKey:s,projectSlug:l,outFile:t.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 t=>{let i=f({DEBUG:e({default:!1}),DEPLOYMENT_ID:o({default:void 0}),ENVIRONMENT_API_KEY:o({default:void 0}),PROJECT_KEY:o({default:void 0}),PROJECT_SLUG:o({default:void 0}),LAMBDA_URL:o({default:void 0}),SERVER_URL:o({default:void 0}),SKIP_UPLOAD:e({default:!1})})(),r=t.debug??i.DEBUG,n=t.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=t.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=t.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=t.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=t.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=t.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=ea({debug:r});await C({uuid:n,uploadLinksFile:t.uploadLinksFile??".upload-links.json",apiKey:a,projectKey:s,projectSlug:l,lambdaUrl:p,serverUrl:d,skipUpload:t.skipUpload??i.SKIP_UPLOAD,debug:r},{logger:c})}).demandCommand(1,"Please specify a command").help().alias("help","h").version(ed.version).alias("version","v").strict().parse();
|
|
@@ -8,5 +8,10 @@ export interface BuildCommandProps {
|
|
|
8
8
|
readonly enableEditor?: boolean;
|
|
9
9
|
readonly buildTarget?: BundleBuildTarget;
|
|
10
10
|
readonly force?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Text for the banner comment of every frontend JavaScript file; it is public in the bundles. Without it the
|
|
13
|
+
* comment names the application version and, in a git checkout, the commit.
|
|
14
|
+
*/
|
|
15
|
+
readonly banner?: string;
|
|
11
16
|
}
|
|
12
17
|
export declare const runBuildCommand: (props: BuildCommandProps, context: CommandContext) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{rm as e}from"fs/promises";import{build as o}from"vite";import{getViteBuildConfigs as
|
|
1
|
+
import{rm as e}from"fs/promises";import{build as o}from"vite";import{composeDefaultBanner as i,getViteBuildConfigs as t}from"../services/index.js";import{checkBundleSizeBudgets as r,readGitCommit as s}from"../utils/index.js";import{buildWebhooks as n}from"../webhooks/index.js";import{generateProjectFilesAndInstallDependencies as c}from"./generate-project-files.js";export const runBuildCommand=async(d,a)=>{let{logger:l}=a,{sdkVersion:p,projectSlug:u,environmentSlug:m,cliUseWorkspace:b,enableEditor:f,buildTarget:h="both",force:g=!1,banner:w}=d;try{process.env.NODE_ENV="production",l.step("Building Phoenix project");let{templateFiles:d,applicationSpec:y}=await c({sdkVersion:p,projectSlug:u,environmentSlug:m,cliUseWorkspace:b,enableEditor:f,inlineTemplates:!0,force:g},a);if(l.success("Project files built successfully"),"frontend"===h||"both"===h){l.step("Cleaning frontend build directory");try{await e("./.phoenix/dist/frontend",{recursive:!0,force:!0}),l.debug("Frontend build directory cleaned")}catch(e){l.debug("No frontend build directory to clean")}l.step("Building Vite bundle");let r=void 0===w?await s({directory:process.cwd(),trackedFile:"package.json"}):void 0;for(let e of(void 0===w&&void 0===r&&l.debug("No git commit found for the banner comment; it names the application version only"),await t({enableEditor:f,templateFiles:d,sdkVersion:p,banner:w??i({applicationVersion:y?.appMetadata.applicationVersion,commit:r})})))await o(e);l.success("Vite build completed")}("webhook"===h||"both"===h)&&(l.step("Building webhooks"),await n({experimental:!0,webhookEntryPoint:"./.phoenix/.swc/.phoenix/webhook.js"}),l.success("Webhooks build completed")),void 0!==y&&await r({budgets:y.budgets,buildTarget:h},a),l.success("Build completed successfully!")}catch(e){l.error(`Build failed: ${e instanceof Error?e.message:String(e)}`,e),process.exit(1)}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{openAsBlob as e}from"node:fs";import{createApiBaseClient as t}from"#package/client";import{resolveApplicationSpecDeploymentData as i}from"../application-spec/index.js";import{createSourceArchive as
|
|
1
|
+
import{openAsBlob as e}from"node:fs";import{createApiBaseClient as t}from"#package/client";import{resolveApplicationSpecDeploymentData as i}from"../application-spec/index.js";import{createSourceArchive as o,getServerCredentials as r}from"../services/index.js";import{ensureWorkspaceInstallSettings as a}from"../utils/index.js";let s={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"},n=e=>new Promise(t=>setTimeout(t,e)),l=async(t,i)=>{let o=new FormData;for(let[e,i]of Object.entries(t.fields))o.append(e,i);o.append("file",await e(i,{type:"application/gzip"}),"sources.tgz");let r=await fetch(t.url,{method:"POST",body:o});if(!r.ok)throw Error(`Uploading the sources failed with HTTP ${r.status}: ${await r.text()}`)};export const runDeployCommand=async(e,{logger:d})=>{let u=await r(e.serverUrl),{pollIntervalMs:c}=e;if(!u)throw Error(`You are not signed in to ${e.serverUrl}. Run \`phoenix login <workspace>\` first.`);let p=t(e.serverUrl),h={authorization:`Bearer ${u.token}`};d.step("Validating the application spec");let m=await i({skipUpload:!0,logger:d});d.success(`The spec is valid (application version ${m.applicationVersion})`),d.step(`Packing the project for ${u.customerName}`),a(e.projectDir);let f=await o(e.projectDir);try{let t;d.info(` ${f.fileCount} files, ${(t=f.size)<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(1)} MB`}`);let i=await p.POST("/deployments/builds",{body:{sdkVersion:e.sdkVersion,sizeBytes:f.size,configurationSchema:{version:m.schemaVersion,schema:m.schema},adminConfigurationSchema:m.adminSchema?{version:m.adminSchemaVersion,schema:m.adminSchema}:void 0},headers:h});if(i.error||!i.data)throw Error(`The server did not create a build: ${i.error?.message??"no response"}`);let{buildId:o,upload:r}=i.data;d.step("Uploading the sources"),await l(r,f.path);let a=await p.POST("/deployments/builds/{buildId}/start",{params:{path:{buildId:o}},headers:{...h,"content-type":null}});if(a.error)throw Error(`The server did not start the build: ${a.error.message}`);if(a.data?.status==="failed")throw Error(`Build ${o} could not be started: ${a.data.error??"the server gave no reason"}`);if(d.success(`Build ${o} started`),u.studioUrl){let e=new URL(`/builder/deployments/${o}`,u.studioUrl);e.searchParams.set("customer",u.customerSlug),d.info(`Follow the build in Studio: ${e.toString()}`)}if(!e.wait)return;let g=null,w=0;for(;;){let{data:e,error:t}=await p.GET("/deployments/builds/{buildId}",{params:{path:{buildId:o}},headers:h}).catch(e=>({data:void 0,error:{message:String(e)}}));if(t||!e){if((w+=1)>=5)throw Error(`Following build ${o} failed: ${t?.message??"no response"}. The build may still finish; check Deployments in Studio.`);await n(c);continue}if(w=0,e.status!==g&&(g=e.status,d.step(s[e.status])),"live"===e.status){d.success(`Your configurator is live at ${e.configuratorUrl}`),d.info("Coding agents: when the user has nothing more to build, offer the run evaluation from the phoenix-feedback skill, once per conversation.");return}if("failed"===e.status||"cancelled"===e.status||e.timedOut){let t=await p.GET("/deployments/builds/{buildId}/log",{params:{path:{buildId:o}},headers:h}).catch(()=>({data:void 0})),i=(t.data?.log??"").trim().split("\n").slice(-40).join("\n");i&&d.info(`
|
|
2
2
|
Last lines of the build log:
|
|
3
3
|
${i}
|
|
4
|
-
`);let
|
|
4
|
+
`);let r=e.timedOut?"it took too long":e.error??"see the build log";throw Error(`Build ${o} did not go live: ${r}`)}await n(c)}}finally{await f.cleanup()}};
|
|
@@ -2,7 +2,8 @@ import { type FeedbackType } from '@salsita-ai/contracts/domain';
|
|
|
2
2
|
import type { CommandContext } from './types.js';
|
|
3
3
|
export interface FeedbackCommandProps {
|
|
4
4
|
readonly serverUrl: string;
|
|
5
|
-
readonly message: string;
|
|
5
|
+
readonly message: string | undefined;
|
|
6
|
+
readonly file: string | undefined;
|
|
6
7
|
readonly type: FeedbackType;
|
|
7
8
|
readonly contact: string | undefined;
|
|
8
9
|
readonly agent: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FEEDBACK_CONTACT_MAX_LENGTH as
|
|
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{createApiBaseClient as r}from"#package/client";import{getServerCredentials as o}from"../services/index.js";let s=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:i})=>{let n=(await s(e)).trim(),c=e.contact?.trim(),h=e.agent?.trim();if(0===n.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(n.length>a)throw Error(`The feedback message has ${n.length} characters, but at most ${a} are accepted. Shorten it and send it again.`);if(c&&c.length>t)throw Error(`The contact detail has ${c.length} characters, but at most ${t} are accepted. Shorten --contact and send the feedback again.`);let d=await o(e.serverUrl);if(!d)throw Error(`You are not signed in to ${e.serverUrl}, so the feedback was not sent. Run \`phoenix login <workspace>\` first, then send it again.`);let{error:f}=await r(e.serverUrl).POST("/feedback",{body:{message:n,type:e.type,clientVersion:e.sdkVersion,clientInfo:e.clientInfo,...c?{contact:c}:{},...h?{agent:h}:{},...e.project?{project:e.project}:{}},headers:{authorization:`Bearer ${d.token}`}});if(f)throw Error(`The server did not accept the feedback: ${f.message}`);i.success(`Feedback sent to the Phoenix team from workspace ${d.customerName}. Thank you.`)};
|
|
@@ -5,19 +5,37 @@ export interface LoginCommandProps {
|
|
|
5
5
|
readonly studioUrl: string;
|
|
6
6
|
readonly open: boolean;
|
|
7
7
|
}
|
|
8
|
+
type LoginOutcome = {
|
|
9
|
+
readonly signedIn: true;
|
|
10
|
+
} | {
|
|
11
|
+
readonly signedIn: false;
|
|
12
|
+
readonly message: string;
|
|
13
|
+
};
|
|
14
|
+
interface LoginCallback {
|
|
15
|
+
readonly code: string;
|
|
16
|
+
readonly tokenName: string | null;
|
|
17
|
+
readonly finish: (outcome: LoginOutcome) => Promise<void>;
|
|
18
|
+
}
|
|
8
19
|
interface LoginCallbackListener {
|
|
9
20
|
readonly port: number;
|
|
10
|
-
readonly
|
|
21
|
+
readonly callback: Promise<LoginCallback>;
|
|
11
22
|
readonly close: () => void;
|
|
12
23
|
}
|
|
24
|
+
interface LoginCallbackListenerProps {
|
|
25
|
+
readonly state: string;
|
|
26
|
+
readonly studioUrl: string;
|
|
27
|
+
readonly customer: string;
|
|
28
|
+
}
|
|
13
29
|
/**
|
|
14
|
-
* Receives the one-time code
|
|
15
|
-
* so another page cannot feed the CLI a code of its own.
|
|
30
|
+
* Receives Studio's answer on 127.0.0.1: the one-time code of an approval, or a denial. Only a callback carrying
|
|
31
|
+
* this session's state is accepted, so another page cannot feed the CLI a code of its own. The browser ends on a
|
|
32
|
+
* Studio page; its address is built from the CLI's own Studio URL, never from the request.
|
|
16
33
|
*/
|
|
17
|
-
export declare const startLoginCallbackListener: (
|
|
34
|
+
export declare const startLoginCallbackListener: (props: LoginCallbackListenerProps) => Promise<LoginCallbackListener>;
|
|
18
35
|
/**
|
|
19
|
-
* Signs the CLI in to an SDK-builder workspace: the user approves in Studio, Studio returns a
|
|
20
|
-
* CLI's loopback listener, and the CLI exchanges it with its PKCE verifier for an API token.
|
|
36
|
+
* Signs the CLI in to an SDK-builder workspace: the user names the token and approves in Studio, Studio returns a
|
|
37
|
+
* one-time code to this CLI's loopback listener, and the CLI exchanges it with its PKCE verifier for an API token.
|
|
38
|
+
* The browser waits on the callback meanwhile and ends on Studio's page for the outcome.
|
|
21
39
|
*/
|
|
22
40
|
export declare const runLoginCommand: (props: LoginCommandProps, { logger }: CommandContext) => Promise<void>;
|
|
23
41
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{spawn as e}from"node:child_process";import{createHash as t,randomBytes as r}from"node:crypto";import{createServer as o}from"node:http";import{hostname as n}from"node:os";import{createApiBaseClient as
|
|
1
|
+
import{spawn as e}from"node:child_process";import{createHash as t,randomBytes as r}from"node:crypto";import{createServer as o}from"node:http";import{hostname as n}from"node:os";import{createApiBaseClient as s}from"#package/client";import{getServerCredentials as i,saveServerCredentials as a}from"../services/index.js";let l={"&":"&","<":"<",">":">",'"':""","'":"'"},c=(e,t)=>`<!doctype html><html><head><meta charset="utf-8"><title>${e}</title></head><body style="font-family:system-ui,sans-serif;display:grid;place-items:center;height:100vh;margin:0"><main style="text-align:center"><h1>${e}</h1><p>${t.replace(/[&<>"']/g,e=>l[e]??e)}</p></main></body></html>`,d=(e,t,r,o)=>new Promise(n=>{e.destroyed?n():(e.once("close",n),e.writeHead(t,{...r,connection:"close"}).end(o))});export const startLoginCallbackListener=async e=>{let{state:t,studioUrl:r,customer:n}=e,s=(e,t)=>{let o=new URL(e,r);return o.searchParams.set("customer",n),t&&o.searchParams.set("name",t),o.toString()},i=null,a=!1,l=new Promise((e,t)=>{i={resolve:e,reject:t}}),m=o((e,r)=>{let o=new URL(e.url??"/","http://127.0.0.1"),n=o.searchParams.get("code"),l="access_denied"===o.searchParams.get("error");if("/callback"!==o.pathname)return void r.writeHead(404).end();if(o.searchParams.get("state")!==t||a||!n&&!l){d(r,400,{"content-type":"text/html"},c("Sign-in failed","This response does not belong to the waiting CLI. Run phoenix login again.")),a||i?.reject(Error("The sign-in response did not match this CLI session. Run `phoenix login` again."));return}if(a=!0,l||!n)return void d(r,302,{location:s("/builder/cli-login/denied",null)}).then(()=>{i?.reject(Error("The sign-in was denied in Studio. Run `phoenix login` again to sign in."))});let m=o.searchParams.get("name");i?.resolve({code:n,tokenName:m,finish:e=>e.signedIn?d(r,302,{location:s("/builder/cli-login/done",m)}):d(r,200,{"content-type":"text/html"},c("Sign-in failed",e.message))})}),h=await new Promise((e,t)=>{m.once("error",t),m.listen(0,"127.0.0.1",()=>{let r=m.address();null===r||"string"==typeof r?t(Error("The login callback listener did not get a port. Run `phoenix login` again.")):e(r.port)})}),u=setTimeout(()=>{i?.reject(Error("Nobody approved the sign-in within 5 minutes. Run `phoenix login` again."))},3e5);return{port:h,callback:l,close:()=>{clearTimeout(u),m.close()}}};let m=async(e,t)=>{try{let{error:r,response:o}=await s(e).DELETE("/auth/token",{headers:{authorization:`Bearer ${t}`,"content-type":null}});return r&&401!==o.status?r.message:null}catch(e){return e instanceof Error?e.message:String(e)}},h=async(e,t)=>{let{data:r,error:o}=await s(e.serverUrl).POST("/auth/token",{body:t});if(o||!r)throw Error(`The server did not accept the sign-in: ${o?.message??"no response"}`);if(r.customer.slug!==e.customer)throw await m(e.serverUrl,r.token),Error(`The sign-in was approved in workspace "${r.customer.slug}", not "${e.customer}". Check --region or --studioUrl and run \`phoenix login ${e.customer}\` again.`);let n=await i(e.serverUrl),l=await a(e.serverUrl,{token:r.token,userId:r.userId,customerSlug:r.customer.slug,customerName:r.customer.name,studioUrl:e.studioUrl,createdAt:new Date().toISOString()}),c=n?await m(e.serverUrl,n.token):null;return{customerName:r.customer.name,path:l,revokeError:c}};export const runLoginCommand=async(o,{logger:s})=>{let i=r(32).toString("base64url"),a=t("sha256").update(i).digest("base64url"),l=r(16).toString("base64url"),c=n(),d=`phoenix CLI on ${c}`,m=await startLoginCallbackListener({state:l,studioUrl:o.studioUrl,customer:o.customer});try{let t=new URL("/builder/cli-login",o.studioUrl);t.searchParams.set("customer",o.customer),t.searchParams.set("port",String(m.port)),t.searchParams.set("state",l),t.searchParams.set("challenge",a),t.searchParams.set("name",d),t.searchParams.set("host",c),t.searchParams.set("started",String(Date.now())),s.step(`Signing in to workspace "${o.customer}" on ${o.serverUrl}`),s.info(`Approve the CLI in your browser:
|
|
2
2
|
|
|
3
3
|
${t.toString()}
|
|
4
|
-
`),o.open&&(t=>{let[r,o]="darwin"===process.platform?["open",[t]]:"win32"===process.platform?["rundll32",["url.dll,FileProtocolHandler",t]]:["xdg-open",[t]];e(r,o,{stdio:"ignore",detached:!0}).on("error",()=>void 0).unref()})(t.toString());let r=await m.
|
|
4
|
+
`),o.open&&(t=>{let[r,o]="darwin"===process.platform?["open",[t]]:"win32"===process.platform?["rundll32",["url.dll,FileProtocolHandler",t]]:["xdg-open",[t]];e(r,o,{stdio:"ignore",detached:!0}).on("error",()=>void 0).unref()})(t.toString());let r=await m.callback;try{let e=await h(o,{code:r.code,codeVerifier:i,port:m.port,name:d});e.revokeError&&s.warn(`The server did not revoke the token this sign-in replaces (${e.revokeError}). It stays valid on the server. Contact Phoenix support to revoke it.`),await r.finish({signedIn:!0}),s.success(`Signed in to ${e.customerName}. The token is stored in ${e.path}; revoke it with phoenix logout.`)}catch(e){throw await r.finish({signedIn:!1,message:e instanceof Error?e.message:String(e)}),e}}finally{m.close()}};
|