xenfra 0.3.8__tar.gz → 0.4.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: xenfra
3
- Version: 0.3.8
3
+ Version: 0.4.0
4
4
  Summary: A 'Zen Mode' infrastructure engine for Python developers.
5
5
  Author: xenfra-cloud
6
6
  Author-email: xenfra-cloud <xenfracloud@gmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "xenfra"
3
- version = "0.3.8"
3
+ version = "0.4.0"
4
4
  description = "A 'Zen Mode' infrastructure engine for Python developers."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -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", "")
@@ -355,6 +356,7 @@ def deploy(project_name, git_repo, branch, framework, region, size, no_heal):
355
356
  # Resolve values with precedence: 1. CLI Flag, 2. xenfra.yaml, 3. Default
356
357
  project_name = project_name or config.get("name") or os.path.basename(os.getcwd())
357
358
  framework = framework or config.get("framework")
359
+ is_dockerized = config.get("is_dockerized", True)
358
360
  region = region or config.get("region") or "nyc3"
359
361
 
360
362
  # Resolve size slug (complex mapping)
@@ -429,10 +431,30 @@ def deploy(project_name, git_repo, branch, framework, region, size, no_heal):
429
431
  else:
430
432
  console.print("[cyan]Creating deployment...[/cyan]")
431
433
 
432
- # Detect framework if not provided
434
+ # Detect framework if not provided (AI-powered Zen Mode)
433
435
  if not framework:
434
- console.print("[dim]Auto-detecting framework...[/dim]")
435
- framework = "fastapi" # Default for now
436
+ console.print("[cyan]🔍 AI Auto-detecting project type...[/cyan]")
437
+ try:
438
+ from ..utils.codebase import scan_codebase
439
+ code_snippets = scan_codebase()
440
+ if code_snippets:
441
+ analysis = client.intelligence.analyze_codebase(code_snippets)
442
+ framework = analysis.framework
443
+ is_dockerized = analysis.is_dockerized
444
+ # Override port and size if AI has strong recommendations
445
+ if not size and analysis.instance_size:
446
+ size = "s-1vcpu-1gb" if analysis.instance_size == "basic" else "s-2vcpu-4gb"
447
+
448
+ mode_str = "Docker" if is_dockerized else "Bare Metal"
449
+ console.print(f"[green]✓ Detected {framework.upper()} project ({mode_str} Mode)[/green] (Port: {analysis.port})")
450
+ else:
451
+ console.print("[yellow]⚠ No code files found for AI analysis. Defaulting to 'fastapi'[/yellow]")
452
+ framework = "fastapi"
453
+ is_dockerized = True
454
+ except Exception as e:
455
+ console.print(f"[yellow]⚠ AI detection failed: {e}. Defaulting to 'fastapi'[/yellow]")
456
+ framework = "fastapi"
457
+ is_dockerized = True
436
458
 
437
459
  # Create deployment with real-time streaming
438
460
  try:
@@ -443,7 +465,8 @@ def deploy(project_name, git_repo, branch, framework, region, size, no_heal):
443
465
  branch=branch,
444
466
  framework=framework,
445
467
  region=region,
446
- size=size,
468
+ size_slug=size,
469
+ is_dockerized=is_dockerized,
447
470
  )
448
471
 
449
472
  if status_result == "FAILED" and not no_heal:
File without changes
File without changes
File without changes
File without changes