xenfra 0.3.8__py3-none-any.whl → 0.3.9__py3-none-any.whl
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.
- xenfra/commands/deployments.py +27 -5
- {xenfra-0.3.8.dist-info → xenfra-0.3.9.dist-info}/METADATA +1 -1
- {xenfra-0.3.8.dist-info → xenfra-0.3.9.dist-info}/RECORD +5 -5
- {xenfra-0.3.8.dist-info → xenfra-0.3.9.dist-info}/WHEEL +0 -0
- {xenfra-0.3.8.dist-info → xenfra-0.3.9.dist-info}/entry_points.txt +0 -0
xenfra/commands/deployments.py
CHANGED
|
@@ -65,7 +65,7 @@ def show_patch_preview(patch_data: dict):
|
|
|
65
65
|
console.print()
|
|
66
66
|
|
|
67
67
|
|
|
68
|
-
def _stream_deployment(client: XenfraClient, project_name: str, git_repo: str, branch: str, framework: str, region: str, size: str):
|
|
68
|
+
def _stream_deployment(client: XenfraClient, project_name: str, git_repo: str, branch: str, framework: str, region: str, size: str, is_dockerized: bool = True):
|
|
69
69
|
"""
|
|
70
70
|
Creates deployment with real-time SSE streaming (no polling needed).
|
|
71
71
|
|
|
@@ -90,6 +90,7 @@ def _stream_deployment(client: XenfraClient, project_name: str, git_repo: str, b
|
|
|
90
90
|
framework=framework,
|
|
91
91
|
region=region,
|
|
92
92
|
size_slug=size,
|
|
93
|
+
is_dockerized=is_dockerized,
|
|
93
94
|
):
|
|
94
95
|
event_type = event.get("event", "message")
|
|
95
96
|
data = event.get("data", "")
|
|
@@ -429,10 +430,30 @@ def deploy(project_name, git_repo, branch, framework, region, size, no_heal):
|
|
|
429
430
|
else:
|
|
430
431
|
console.print("[cyan]Creating deployment...[/cyan]")
|
|
431
432
|
|
|
432
|
-
# Detect framework if not provided
|
|
433
|
+
# Detect framework if not provided (AI-powered Zen Mode)
|
|
433
434
|
if not framework:
|
|
434
|
-
console.print("[
|
|
435
|
-
|
|
435
|
+
console.print("[cyan]🔍 AI Auto-detecting project type...[/cyan]")
|
|
436
|
+
try:
|
|
437
|
+
from ..utils.codebase import scan_codebase
|
|
438
|
+
code_snippets = scan_codebase()
|
|
439
|
+
if code_snippets:
|
|
440
|
+
analysis = client.intelligence.analyze_codebase(code_snippets)
|
|
441
|
+
framework = analysis.framework
|
|
442
|
+
is_dockerized = analysis.is_dockerized
|
|
443
|
+
# Override port and size if AI has strong recommendations
|
|
444
|
+
if not size and analysis.instance_size:
|
|
445
|
+
size = "s-1vcpu-1gb" if analysis.instance_size == "basic" else "s-2vcpu-4gb"
|
|
446
|
+
|
|
447
|
+
mode_str = "Docker" if is_dockerized else "Bare Metal"
|
|
448
|
+
console.print(f"[green]✓ Detected {framework.upper()} project ({mode_str} Mode)[/green] (Port: {analysis.port})")
|
|
449
|
+
else:
|
|
450
|
+
console.print("[yellow]⚠ No code files found for AI analysis. Defaulting to 'fastapi'[/yellow]")
|
|
451
|
+
framework = "fastapi"
|
|
452
|
+
is_dockerized = True
|
|
453
|
+
except Exception as e:
|
|
454
|
+
console.print(f"[yellow]⚠ AI detection failed: {e}. Defaulting to 'fastapi'[/yellow]")
|
|
455
|
+
framework = "fastapi"
|
|
456
|
+
is_dockerized = True
|
|
436
457
|
|
|
437
458
|
# Create deployment with real-time streaming
|
|
438
459
|
try:
|
|
@@ -443,7 +464,8 @@ def deploy(project_name, git_repo, branch, framework, region, size, no_heal):
|
|
|
443
464
|
branch=branch,
|
|
444
465
|
framework=framework,
|
|
445
466
|
region=region,
|
|
446
|
-
|
|
467
|
+
size_slug=size,
|
|
468
|
+
is_dockerized=is_dockerized,
|
|
447
469
|
)
|
|
448
470
|
|
|
449
471
|
if status_result == "FAILED" and not no_heal:
|
|
@@ -2,7 +2,7 @@ xenfra/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
2
2
|
xenfra/commands/__init__.py,sha256=kTTwVnTvoxikyPUhQiyTAbnw4PYafktuE1----TqQoA,43
|
|
3
3
|
xenfra/commands/auth.py,sha256=ecReVCGl7Ys2d77mv_e4mCbs4ug6FLIb3S9dl2FUhr4,4178
|
|
4
4
|
xenfra/commands/auth_device.py,sha256=caD2UdveEZtAFjgjmnA-l5bjbbPONFjXJXgeJN7mhbk,6710
|
|
5
|
-
xenfra/commands/deployments.py,sha256=
|
|
5
|
+
xenfra/commands/deployments.py,sha256=SE6SeKl-waoMxO1kf16jLCMw-mQAnHn_w05iin2uCZw,39425
|
|
6
6
|
xenfra/commands/intelligence.py,sha256=_H0t9OJwPbd9E0r1tcMACrt6-UBPrrTII8M47kC_iHA,17496
|
|
7
7
|
xenfra/commands/projects.py,sha256=SAxF_pOr95K6uz35U-zENptKndKxJNZn6bcD45PHcpI,6696
|
|
8
8
|
xenfra/commands/security_cmd.py,sha256=EI5sjX2lcMxgMH-LCFmPVkc9YqadOrcoSgTiKknkVRY,7327
|
|
@@ -14,7 +14,7 @@ xenfra/utils/config.py,sha256=K2k7hxz94dzbxvCw_PDXtq4o1VlmJMTFktlL-F2g5rY,14786
|
|
|
14
14
|
xenfra/utils/errors.py,sha256=6G91YzzDDNkKHANTgfAMiOiMElEyi57wo6-FzRa4VuQ,4211
|
|
15
15
|
xenfra/utils/security.py,sha256=EA8CIPLt8Y-QP5uZ7c5NuC6ZLRV1aZS8NapS9ix_vok,11479
|
|
16
16
|
xenfra/utils/validation.py,sha256=cvuL_AEFJ2oCoP0abCqoOIABOwz79Gkf-jh_dcFIQlM,6912
|
|
17
|
-
xenfra-0.3.
|
|
18
|
-
xenfra-0.3.
|
|
19
|
-
xenfra-0.3.
|
|
20
|
-
xenfra-0.3.
|
|
17
|
+
xenfra-0.3.9.dist-info/WHEEL,sha256=KSLUh82mDPEPk0Bx0ScXlWL64bc8KmzIPNcpQZFV-6E,79
|
|
18
|
+
xenfra-0.3.9.dist-info/entry_points.txt,sha256=a_2cGhYK__X6eW05Ba8uB6RIM_61c2sHtXsPY8N0mic,45
|
|
19
|
+
xenfra-0.3.9.dist-info/METADATA,sha256=WpBPXhZW_cnDA1_rTvKpSMVFCY73yZ6gq3C7EOlfW2A,3898
|
|
20
|
+
xenfra-0.3.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|