Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
#!/usr/bin/env python3
|
| 2 |
"""
|
| 3 |
-
|
| 4 |
-
|
| 5 |
"""
|
| 6 |
|
| 7 |
from http.server import HTTPServer, BaseHTTPRequestHandler
|
|
@@ -9,9 +9,11 @@ import subprocess
|
|
| 9 |
import sys
|
| 10 |
import os
|
| 11 |
import json
|
| 12 |
-
import io
|
| 13 |
-
from contextlib import redirect_stdout, redirect_stderr
|
| 14 |
from urllib.parse import parse_qs
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
class AntigravityHandler(BaseHTTPRequestHandler):
|
| 17 |
def do_GET(self):
|
|
@@ -20,14 +22,14 @@ class AntigravityHandler(BaseHTTPRequestHandler):
|
|
| 20 |
self.send_header('Content-type', 'text/html')
|
| 21 |
self.end_headers()
|
| 22 |
|
| 23 |
-
#
|
| 24 |
try:
|
| 25 |
result = subprocess.run(['antigravity', '--version'],
|
| 26 |
capture_output=True, text=True, timeout=5)
|
| 27 |
-
antigravity_status = "
|
| 28 |
-
antigravity_version = result.stdout.strip() if result.returncode == 0 else "
|
| 29 |
except Exception as e:
|
| 30 |
-
antigravity_status = "Error"
|
| 31 |
antigravity_version = str(e)
|
| 32 |
|
| 33 |
# System info
|
|
@@ -41,7 +43,7 @@ class AntigravityHandler(BaseHTTPRequestHandler):
|
|
| 41 |
<!DOCTYPE html>
|
| 42 |
<html>
|
| 43 |
<head>
|
| 44 |
-
<title>Antigravity VS Code
|
| 45 |
<style>
|
| 46 |
body {{
|
| 47 |
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
@@ -134,6 +136,17 @@ class AntigravityHandler(BaseHTTPRequestHandler):
|
|
| 134 |
background: #ffa947;
|
| 135 |
transform: translateY(-2px);
|
| 136 |
}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
.status {{
|
| 138 |
padding: 15px;
|
| 139 |
border-radius: 8px;
|
|
@@ -150,6 +163,11 @@ class AntigravityHandler(BaseHTTPRequestHandler):
|
|
| 150 |
color: #fb8500;
|
| 151 |
border: 1px solid #fb8500;
|
| 152 |
}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
.pre {{
|
| 154 |
background: #0d1117;
|
| 155 |
color: #79c0ff;
|
|
@@ -169,167 +187,124 @@ class AntigravityHandler(BaseHTTPRequestHandler):
|
|
| 169 |
margin: 10px 0;
|
| 170 |
border: 2px solid #1f6feb;
|
| 171 |
}}
|
| 172 |
-
.
|
| 173 |
-
width: 100%;
|
| 174 |
-
height: 250px;
|
| 175 |
background: #0d1117;
|
| 176 |
color: #79c0ff;
|
| 177 |
border: 1px solid #30363d;
|
| 178 |
-
border-radius: 8px;
|
| 179 |
padding: 12px;
|
| 180 |
-
font-family: 'Courier New', monospace;
|
| 181 |
-
font-size: 14px;
|
| 182 |
-
resize: vertical;
|
| 183 |
-
}}
|
| 184 |
-
.output-box {{
|
| 185 |
-
background: #0d1117;
|
| 186 |
-
color: #39ff14;
|
| 187 |
-
border: 1px solid #30363d;
|
| 188 |
border-radius: 8px;
|
| 189 |
-
|
| 190 |
-
margin: 15px 0;
|
| 191 |
-
min-height: 100px;
|
| 192 |
font-family: 'Courier New', monospace;
|
| 193 |
-
white-space: pre-wrap;
|
| 194 |
-
word-wrap: break-word;
|
| 195 |
-
max-height: 400px;
|
| 196 |
-
overflow-y: auto;
|
| 197 |
-
}}
|
| 198 |
-
.error-box {{
|
| 199 |
-
background: rgba(248, 81, 73, 0.15);
|
| 200 |
-
color: #f85149;
|
| 201 |
-
border: 1px solid #f85149;
|
| 202 |
-
}}
|
| 203 |
-
.success-box {{
|
| 204 |
-
background: rgba(63, 185, 80, 0.15);
|
| 205 |
-
color: #39ff14;
|
| 206 |
-
border: 1px solid #3fb950;
|
| 207 |
}}
|
| 208 |
</style>
|
| 209 |
</head>
|
| 210 |
<body>
|
| 211 |
<div class="container">
|
| 212 |
<div class="header">
|
| 213 |
-
<h1>
|
| 214 |
-
<div class="vscode-badge">
|
| 215 |
-
<p>
|
| 216 |
</div>
|
| 217 |
|
| 218 |
<div class="grid">
|
| 219 |
<div class="card">
|
| 220 |
-
<h3>
|
| 221 |
-
<div class="status {'success' if antigravity_status == '
|
| 222 |
-
Antigravity
|
| 223 |
</div>
|
| 224 |
<div><strong>Version:</strong> {antigravity_version}</div>
|
| 225 |
-
<div><strong>Platform:</strong> Ubuntu Docker Container</div>
|
| 226 |
<div><strong>Python:</strong> {sys.version.split()[0]}</div>
|
| 227 |
-
<div><strong>
|
|
|
|
| 228 |
</div>
|
| 229 |
|
| 230 |
<div class="card">
|
| 231 |
-
<h3>
|
| 232 |
-
<p>
|
| 233 |
-
<button onclick="
|
| 234 |
-
|
| 235 |
</button>
|
| 236 |
-
<button onclick="
|
| 237 |
-
🤖
|
| 238 |
</button>
|
| 239 |
-
<button onclick="
|
| 240 |
-
|
| 241 |
</button>
|
| 242 |
</div>
|
| 243 |
|
| 244 |
<div class="card">
|
| 245 |
-
<h3>
|
| 246 |
-
<
|
| 247 |
-
|
| 248 |
-
antigravity
|
| 249 |
-
antigravity --
|
| 250 |
-
antigravity --
|
| 251 |
-
antigravity --merge base left right output # Merge
|
| 252 |
-
antigravity --new-window # New editor window
|
| 253 |
-
antigravity --extensions-dir # Extension folder
|
| 254 |
-
antigravity --list-extensions # List extensions
|
| 255 |
-
antigravity --install-extension ext-id # Install extension</div>
|
| 256 |
</div>
|
| 257 |
|
| 258 |
<div class="card">
|
| 259 |
-
<h3>
|
| 260 |
-
<div class="terminal">{system_details}</div>
|
| 261 |
-
<div style="margin-top: 15px; font-size: 0.9em; color: #8b949e;">
|
| 262 |
-
<em>Container running on Hugging Face Spaces</em>
|
| 263 |
-
</div>
|
| 264 |
</div>
|
| 265 |
</div>
|
| 266 |
|
| 267 |
<div class="card" style="margin-top: 20px;">
|
| 268 |
-
<h3>
|
| 269 |
-
<p>
|
| 270 |
-
<
|
| 271 |
-
|
| 272 |
-
<li><strong>File Management:</strong> Open, edit, compare, and merge files</li>
|
| 273 |
-
<li><strong>Extensions:</strong> Install and manage VS Code extensions</li>
|
| 274 |
-
<li><strong>Web Interface:</strong> Run VS Code in your browser</li>
|
| 275 |
-
<li><strong>AI Assistant:</strong> Built-in chat and coding help</li>
|
| 276 |
-
<li><strong>Development Tools:</strong> Complete development environment</li>
|
| 277 |
-
</ul>
|
| 278 |
</div>
|
| 279 |
|
| 280 |
<div class="card" style="margin-top: 20px;">
|
| 281 |
-
<h3>
|
| 282 |
-
<
|
| 283 |
-
|
| 284 |
-
<
|
| 285 |
-
<
|
| 286 |
-
|
| 287 |
-
</
|
| 288 |
-
|
| 289 |
-
🔄 Clear
|
| 290 |
-
</button>
|
| 291 |
-
</form>
|
| 292 |
-
<div id="output"></div>
|
| 293 |
</div>
|
| 294 |
</div>
|
| 295 |
|
| 296 |
<script>
|
| 297 |
-
function
|
| 298 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 299 |
}}
|
| 300 |
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
if (!code.trim()) {{
|
| 310 |
-
alert('Please enter some Python code!');
|
| 311 |
-
return;
|
| 312 |
}}
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
data.output.replace(/</g, '<').replace(/>/g, '>');
|
| 326 |
-
outputDiv.className = outputClass;
|
| 327 |
-
}} catch (err) {{
|
| 328 |
-
alert('Error: ' + err.message);
|
| 329 |
}}
|
| 330 |
-
}})
|
| 331 |
-
|
| 332 |
-
}}
|
| 333 |
</script>
|
| 334 |
</body>
|
| 335 |
</html>
|
|
@@ -371,37 +346,75 @@ antigravity --install-extension ext-id # Install extension</div>
|
|
| 371 |
print(f"[Antigravity VS Code] {format % args}")
|
| 372 |
|
| 373 |
def do_POST(self):
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 379 |
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
|
|
|
|
|
|
| 384 |
|
| 385 |
try:
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
|
|
|
|
|
|
| 390 |
except Exception as e:
|
| 391 |
-
|
| 392 |
-
|
|
|
|
|
|
|
| 393 |
|
| 394 |
-
|
|
|
|
|
|
|
| 395 |
self.send_response(200)
|
| 396 |
self.send_header('Content-type', 'application/json')
|
| 397 |
self.end_headers()
|
| 398 |
|
| 399 |
-
|
| 400 |
-
'
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 404 |
self.wfile.write(json.dumps(response).encode())
|
|
|
|
| 405 |
else:
|
| 406 |
self.send_response(404)
|
| 407 |
self.end_headers()
|
|
|
|
| 1 |
#!/usr/bin/env python3
|
| 2 |
"""
|
| 3 |
+
Antigravity VS Code IDE Launcher - Dark Theme
|
| 4 |
+
Launches the actual Antigravity VS Code IDE with agents support
|
| 5 |
"""
|
| 6 |
|
| 7 |
from http.server import HTTPServer, BaseHTTPRequestHandler
|
|
|
|
| 9 |
import sys
|
| 10 |
import os
|
| 11 |
import json
|
|
|
|
|
|
|
| 12 |
from urllib.parse import parse_qs
|
| 13 |
+
import threading
|
| 14 |
+
import time
|
| 15 |
+
|
| 16 |
+
vscode_process = None
|
| 17 |
|
| 18 |
class AntigravityHandler(BaseHTTPRequestHandler):
|
| 19 |
def do_GET(self):
|
|
|
|
| 22 |
self.send_header('Content-type', 'text/html')
|
| 23 |
self.end_headers()
|
| 24 |
|
| 25 |
+
# Check Antigravity installation
|
| 26 |
try:
|
| 27 |
result = subprocess.run(['antigravity', '--version'],
|
| 28 |
capture_output=True, text=True, timeout=5)
|
| 29 |
+
antigravity_status = "✅ Installed" if result.returncode == 0 else "❌ Not Available"
|
| 30 |
+
antigravity_version = result.stdout.strip() if result.returncode == 0 else "Error"
|
| 31 |
except Exception as e:
|
| 32 |
+
antigravity_status = "❌ Error"
|
| 33 |
antigravity_version = str(e)
|
| 34 |
|
| 35 |
# System info
|
|
|
|
| 43 |
<!DOCTYPE html>
|
| 44 |
<html>
|
| 45 |
<head>
|
| 46 |
+
<title>Antigravity VS Code IDE</title>
|
| 47 |
<style>
|
| 48 |
body {{
|
| 49 |
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
|
|
| 136 |
background: #ffa947;
|
| 137 |
transform: translateY(-2px);
|
| 138 |
}}
|
| 139 |
+
.button.red {{
|
| 140 |
+
background: #f85149;
|
| 141 |
+
}}
|
| 142 |
+
.button.red:hover {{
|
| 143 |
+
background: #ff7b72;
|
| 144 |
+
transform: translateY(-2px);
|
| 145 |
+
}}
|
| 146 |
+
.button:disabled {{
|
| 147 |
+
opacity: 0.5;
|
| 148 |
+
cursor: not-allowed;
|
| 149 |
+
}}
|
| 150 |
.status {{
|
| 151 |
padding: 15px;
|
| 152 |
border-radius: 8px;
|
|
|
|
| 163 |
color: #fb8500;
|
| 164 |
border: 1px solid #fb8500;
|
| 165 |
}}
|
| 166 |
+
.error {{
|
| 167 |
+
background: rgba(248, 81, 73, 0.15);
|
| 168 |
+
color: #f85149;
|
| 169 |
+
border: 1px solid #f85149;
|
| 170 |
+
}}
|
| 171 |
.pre {{
|
| 172 |
background: #0d1117;
|
| 173 |
color: #79c0ff;
|
|
|
|
| 187 |
margin: 10px 0;
|
| 188 |
border: 2px solid #1f6feb;
|
| 189 |
}}
|
| 190 |
+
.command-box {{
|
|
|
|
|
|
|
| 191 |
background: #0d1117;
|
| 192 |
color: #79c0ff;
|
| 193 |
border: 1px solid #30363d;
|
|
|
|
| 194 |
padding: 12px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
border-radius: 8px;
|
| 196 |
+
margin: 10px 0;
|
|
|
|
|
|
|
| 197 |
font-family: 'Courier New', monospace;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
}}
|
| 199 |
</style>
|
| 200 |
</head>
|
| 201 |
<body>
|
| 202 |
<div class="container">
|
| 203 |
<div class="header">
|
| 204 |
+
<h1>⚡ Antigravity VS Code IDE</h1>
|
| 205 |
+
<div class="vscode-badge">Agents + Code Editor</div>
|
| 206 |
+
<p>Professional development environment with Antigravity agents</p>
|
| 207 |
</div>
|
| 208 |
|
| 209 |
<div class="grid">
|
| 210 |
<div class="card">
|
| 211 |
+
<h3>📊 System Status</h3>
|
| 212 |
+
<div class="status {'success' if antigravity_status == '✅ Installed' else 'warning'}">
|
| 213 |
+
Antigravity: {antigravity_status}
|
| 214 |
</div>
|
| 215 |
<div><strong>Version:</strong> {antigravity_version}</div>
|
|
|
|
| 216 |
<div><strong>Python:</strong> {sys.version.split()[0]}</div>
|
| 217 |
+
<div><strong>Platform:</strong> {sys.platform}</div>
|
| 218 |
+
<div><strong>Working Dir:</strong> {os.getcwd()}</div>
|
| 219 |
</div>
|
| 220 |
|
| 221 |
<div class="card">
|
| 222 |
+
<h3>🚀 Launch IDE</h3>
|
| 223 |
+
<p>Start Antigravity VS Code:</p>
|
| 224 |
+
<button onclick="launchIDE()" class="button green" style="width: 100%; margin-top: 10px;">
|
| 225 |
+
▶️ Launch Antigravity IDE
|
| 226 |
</button>
|
| 227 |
+
<button onclick="launchAgents()" class="button orange" style="width: 100%; margin-top: 10px;">
|
| 228 |
+
🤖 Launch Agents
|
| 229 |
</button>
|
| 230 |
+
<button onclick="launchChat()" class="button" style="width: 100%; margin-top: 10px;">
|
| 231 |
+
💬 AI Chat
|
| 232 |
</button>
|
| 233 |
</div>
|
| 234 |
|
| 235 |
<div class="card">
|
| 236 |
+
<h3>📝 Available Commands</h3>
|
| 237 |
+
<div class="pre" style="font-size: 12px;">antigravity --serve-web
|
| 238 |
+
antigravity chat
|
| 239 |
+
antigravity agents
|
| 240 |
+
antigravity --list-extensions
|
| 241 |
+
antigravity --help</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
</div>
|
| 243 |
|
| 244 |
<div class="card">
|
| 245 |
+
<h3>🖥️ System Details</h3>
|
| 246 |
+
<div class="terminal" style="font-size: 12px;">{system_details}</div>
|
|
|
|
|
|
|
|
|
|
| 247 |
</div>
|
| 248 |
</div>
|
| 249 |
|
| 250 |
<div class="card" style="margin-top: 20px;">
|
| 251 |
+
<h3>⚡ Antigravity Agents</h3>
|
| 252 |
+
<p>Use AI-powered agents to code, debug, and create:</p>
|
| 253 |
+
<div class="command-box">$ antigravity agents</div>
|
| 254 |
+
<p style="color: #8b949e; font-size: 14px;">Agents enable autonomous code generation, testing, and debugging with natural language commands.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 255 |
</div>
|
| 256 |
|
| 257 |
<div class="card" style="margin-top: 20px;">
|
| 258 |
+
<h3>📚 Quick Start</h3>
|
| 259 |
+
<ol style="color: #e6edf3;">
|
| 260 |
+
<li>Click <strong>"Launch Antigravity IDE"</strong> to open VS Code</li>
|
| 261 |
+
<li>Use <strong>"Launch Agents"</strong> to enable AI-powered coding</li>
|
| 262 |
+
<li>Type your requirements in natural language</li>
|
| 263 |
+
<li>Agents will generate and execute code automatically</li>
|
| 264 |
+
<li>Use AI Chat for questions and assistance</li>
|
| 265 |
+
</ol>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 266 |
</div>
|
| 267 |
</div>
|
| 268 |
|
| 269 |
<script>
|
| 270 |
+
function launchIDE() {{
|
| 271 |
+
fetch('/launch-ide', {{ method: 'POST' }})
|
| 272 |
+
.then(r => r.json())
|
| 273 |
+
.then(d => {{
|
| 274 |
+
if (d.success) {{
|
| 275 |
+
alert('✅ Antigravity VS Code IDE launched!\\n\\nCheck the terminal or open http://localhost:8000');
|
| 276 |
+
}} else {{
|
| 277 |
+
alert('❌ Error: ' + d.error);
|
| 278 |
+
}}
|
| 279 |
+
}})
|
| 280 |
+
.catch(e => alert('Error: ' + e));
|
| 281 |
}}
|
| 282 |
|
| 283 |
+
function launchAgents() {{
|
| 284 |
+
fetch('/launch-agents', {{ method: 'POST' }})
|
| 285 |
+
.then(r => r.json())
|
| 286 |
+
.then(d => {{
|
| 287 |
+
if (d.success) {{
|
| 288 |
+
alert('✅ Antigravity Agents launched!\\n\\n' + d.message);
|
| 289 |
+
}} else {{
|
| 290 |
+
alert('❌ Error: ' + d.error);
|
|
|
|
|
|
|
|
|
|
| 291 |
}}
|
| 292 |
+
}})
|
| 293 |
+
.catch(e => alert('Error: ' + e));
|
| 294 |
+
}}
|
| 295 |
+
|
| 296 |
+
function launchChat() {{
|
| 297 |
+
fetch('/launch-chat', {{ method: 'POST' }})
|
| 298 |
+
.then(r => r.json())
|
| 299 |
+
.then(d => {{
|
| 300 |
+
if (d.success) {{
|
| 301 |
+
alert('✅ AI Chat launched!\\n\\n' + d.message);
|
| 302 |
+
}} else {{
|
| 303 |
+
alert('❌ Error: ' + d.error);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 304 |
}}
|
| 305 |
+
}})
|
| 306 |
+
.catch(e => alert('Error: ' + e));
|
| 307 |
+
}}
|
| 308 |
</script>
|
| 309 |
</body>
|
| 310 |
</html>
|
|
|
|
| 346 |
print(f"[Antigravity VS Code] {format % args}")
|
| 347 |
|
| 348 |
def do_POST(self):
|
| 349 |
+
global vscode_process
|
| 350 |
+
|
| 351 |
+
if self.path == '/launch-ide':
|
| 352 |
+
self.send_response(200)
|
| 353 |
+
self.send_header('Content-type', 'application/json')
|
| 354 |
+
self.end_headers()
|
| 355 |
+
|
| 356 |
+
try:
|
| 357 |
+
# Launch Antigravity VS Code web interface
|
| 358 |
+
if vscode_process is None or vscode_process.poll() is not None:
|
| 359 |
+
vscode_process = subprocess.Popen(
|
| 360 |
+
['antigravity', '--serve-web'],
|
| 361 |
+
stdout=subprocess.PIPE,
|
| 362 |
+
stderr=subprocess.PIPE
|
| 363 |
+
)
|
| 364 |
+
time.sleep(2)
|
| 365 |
+
|
| 366 |
+
response = {
|
| 367 |
+
'success': True,
|
| 368 |
+
'message': 'Antigravity VS Code IDE launched on http://localhost:8000'
|
| 369 |
+
}
|
| 370 |
+
except Exception as e:
|
| 371 |
+
response = {
|
| 372 |
+
'success': False,
|
| 373 |
+
'error': str(e)
|
| 374 |
+
}
|
| 375 |
|
| 376 |
+
self.wfile.write(json.dumps(response).encode())
|
| 377 |
+
|
| 378 |
+
elif self.path == '/launch-agents':
|
| 379 |
+
self.send_response(200)
|
| 380 |
+
self.send_header('Content-type', 'application/json')
|
| 381 |
+
self.end_headers()
|
| 382 |
|
| 383 |
try:
|
| 384 |
+
result = subprocess.run(['antigravity', 'agents'],
|
| 385 |
+
capture_output=True, text=True, timeout=3)
|
| 386 |
+
response = {
|
| 387 |
+
'success': True,
|
| 388 |
+
'message': 'Antigravity Agents activated!\n' + result.stdout
|
| 389 |
+
}
|
| 390 |
except Exception as e:
|
| 391 |
+
response = {
|
| 392 |
+
'success': False,
|
| 393 |
+
'error': str(e)
|
| 394 |
+
}
|
| 395 |
|
| 396 |
+
self.wfile.write(json.dumps(response).encode())
|
| 397 |
+
|
| 398 |
+
elif self.path == '/launch-chat':
|
| 399 |
self.send_response(200)
|
| 400 |
self.send_header('Content-type', 'application/json')
|
| 401 |
self.end_headers()
|
| 402 |
|
| 403 |
+
try:
|
| 404 |
+
result = subprocess.run(['antigravity', 'chat'],
|
| 405 |
+
capture_output=True, text=True, timeout=3)
|
| 406 |
+
response = {
|
| 407 |
+
'success': True,
|
| 408 |
+
'message': 'AI Chat opened!\n' + result.stdout
|
| 409 |
+
}
|
| 410 |
+
except Exception as e:
|
| 411 |
+
response = {
|
| 412 |
+
'success': False,
|
| 413 |
+
'error': str(e)
|
| 414 |
+
}
|
| 415 |
+
|
| 416 |
self.wfile.write(json.dumps(response).encode())
|
| 417 |
+
|
| 418 |
else:
|
| 419 |
self.send_response(404)
|
| 420 |
self.end_headers()
|