-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
47 lines (38 loc) · 1.36 KB
/
main.py
File metadata and controls
47 lines (38 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python3
"""
Warp Engine - Main Entry Point for Deployment
This is the entry point for cloud deployment platforms.
"""
import os
import sys
from pathlib import Path
# Add src to Python path
project_root = Path(__file__).parent
src_path = project_root / "src"
sys.path.insert(0, str(src_path))
# Set up environment
os.environ.setdefault("WARP_ENGINE_HOST", "0.0.0.0")
os.environ.setdefault("WARP_ENGINE_PORT", "8787")
def main():
"""Main entry point for deployment."""
try:
from warpengine.server.engine_service import run_service
# Get host and port from environment
host = os.environ.get("WARP_ENGINE_HOST", "0.0.0.0")
port = int(os.environ.get("WARP_ENGINE_PORT", "8787"))
print(f"🚀 Starting Warp Engine Service on {host}:{port}")
print(f"📊 API: http://{host}:{port}/")
print(f"🔌 WebSocket: ws://{host}:{port}/ws")
print(f"🔧 MCP Transport: stdio")
# Start the service
run_service(host=host, port=port)
except ImportError as e:
print(f"❌ Import Error: {e}")
print("Make sure all dependencies are installed:")
print("pip install -r requirements.txt")
sys.exit(1)
except Exception as e:
print(f"❌ Error starting service: {e}")
sys.exit(1)
if __name__ == "__main__":
main()