browse-code 0.2.15__tar.gz → 0.2.17__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.
- {browse_code-0.2.15 → browse_code-0.2.17}/PKG-INFO +1 -1
- browse_code-0.2.17/browse_code/__init__.py +1 -0
- {browse_code-0.2.15 → browse_code-0.2.17}/browse_code/cli.py +9 -0
- {browse_code-0.2.15 → browse_code-0.2.17}/browse_code/server.py +35 -8
- {browse_code-0.2.15 → browse_code-0.2.17}/browse_code.egg-info/PKG-INFO +1 -1
- {browse_code-0.2.15 → browse_code-0.2.17}/setup.py +1 -1
- browse_code-0.2.15/browse_code/__init__.py +0 -1
- {browse_code-0.2.15 → browse_code-0.2.17}/README.md +0 -0
- {browse_code-0.2.15 → browse_code-0.2.17}/browse_code/extension/content.js +0 -0
- {browse_code-0.2.15 → browse_code-0.2.17}/browse_code/extension/icon128.png +0 -0
- {browse_code-0.2.15 → browse_code-0.2.17}/browse_code/extension/icon16.png +0 -0
- {browse_code-0.2.15 → browse_code-0.2.17}/browse_code/extension/icon48.png +0 -0
- {browse_code-0.2.15 → browse_code-0.2.17}/browse_code/extension/manifest.json +0 -0
- {browse_code-0.2.15 → browse_code-0.2.17}/browse_code/extension/popup.html +0 -0
- {browse_code-0.2.15 → browse_code-0.2.17}/browse_code/extension/popup.js +0 -0
- {browse_code-0.2.15 → browse_code-0.2.17}/browse_code/extension/spoof.js +0 -0
- {browse_code-0.2.15 → browse_code-0.2.17}/browse_code.egg-info/SOURCES.txt +0 -0
- {browse_code-0.2.15 → browse_code-0.2.17}/browse_code.egg-info/dependency_links.txt +0 -0
- {browse_code-0.2.15 → browse_code-0.2.17}/browse_code.egg-info/entry_points.txt +0 -0
- {browse_code-0.2.15 → browse_code-0.2.17}/browse_code.egg-info/requires.txt +0 -0
- {browse_code-0.2.15 → browse_code-0.2.17}/browse_code.egg-info/top_level.txt +0 -0
- {browse_code-0.2.15 → browse_code-0.2.17}/pyproject.toml +0 -0
- {browse_code-0.2.15 → browse_code-0.2.17}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.17"
|
|
@@ -206,6 +206,15 @@ def main():
|
|
|
206
206
|
from server import app
|
|
207
207
|
|
|
208
208
|
import uvicorn
|
|
209
|
+
import sys
|
|
210
|
+
import asyncio
|
|
211
|
+
|
|
212
|
+
if sys.platform == "win32":
|
|
213
|
+
try:
|
|
214
|
+
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
|
215
|
+
except Exception:
|
|
216
|
+
pass
|
|
217
|
+
|
|
209
218
|
uvicorn.run(app, host=HOST, port=PORT, access_log=False)
|
|
210
219
|
|
|
211
220
|
|
|
@@ -189,7 +189,11 @@ def cleanup_background_processes():
|
|
|
189
189
|
for pid, data in BACKGROUND_PROCESSES.items():
|
|
190
190
|
if data['status'] == 'running':
|
|
191
191
|
try:
|
|
192
|
-
data['process']
|
|
192
|
+
proc = data['process']
|
|
193
|
+
if platform.system() == "Windows":
|
|
194
|
+
subprocess.run(f"taskkill /F /T /PID {proc.pid}", shell=True, capture_output=True)
|
|
195
|
+
else:
|
|
196
|
+
proc.terminate()
|
|
193
197
|
except:
|
|
194
198
|
pass
|
|
195
199
|
|
|
@@ -570,13 +574,36 @@ async def run_tool(data: ToolModel):
|
|
|
570
574
|
cmd = term_run_match.group(1).strip()
|
|
571
575
|
env = os.environ.copy()
|
|
572
576
|
env["FORCE_COLOR"] = "true"
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
577
|
+
|
|
578
|
+
pid = str(uuid.uuid4())[:8]
|
|
579
|
+
process = subprocess.Popen(cmd, shell=True, cwd=WORKSPACE_DIR, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, bufsize=1, env=env)
|
|
580
|
+
BACKGROUND_PROCESSES[pid] = {'process': process, 'logs': deque(maxlen=500), 'status': 'running'}
|
|
581
|
+
threading.Thread(target=stream_process_output, args=(pid, process), daemon=True).start()
|
|
582
|
+
|
|
583
|
+
# Wait up to 5 seconds to see if it finishes quickly
|
|
584
|
+
start_time = time.time()
|
|
585
|
+
while time.time() - start_time < 5.0:
|
|
586
|
+
if process.poll() is not None:
|
|
587
|
+
break
|
|
588
|
+
await asyncio.sleep(0.1)
|
|
589
|
+
|
|
590
|
+
# Give the log thread a tiny bit of time to flush if it just exited
|
|
591
|
+
await asyncio.sleep(0.1)
|
|
592
|
+
|
|
593
|
+
logs = "".join(list(BACKGROUND_PROCESSES[pid]['logs']))
|
|
594
|
+
|
|
595
|
+
if process.poll() is not None:
|
|
596
|
+
# Process finished quickly, treat as normal terminal_run
|
|
597
|
+
try:
|
|
598
|
+
del BACKGROUND_PROCESSES[pid]
|
|
599
|
+
except KeyError:
|
|
600
|
+
pass
|
|
601
|
+
output = strip_ansi(logs) if logs.strip() else "Executed."
|
|
602
|
+
result = {"output": truncate_output(output)}
|
|
603
|
+
else:
|
|
604
|
+
# Still running, auto-background it!
|
|
605
|
+
partial = strip_ansi(logs)
|
|
606
|
+
result = {"output": truncate_output(f"Status: ONGOING (Process auto-backgrounded after 5s)\nPID: {pid}\n\nOutput so far:\n{partial}\n\nInstruction: This process is still running. Use terminal_logs <pid='{pid}'> to check on it later, or terminal_kill to stop it.")}
|
|
580
607
|
|
|
581
608
|
elif term_bg_match:
|
|
582
609
|
cmd = term_bg_match.group(1).strip()
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name="browse_code",
|
|
5
|
-
version="0.2.
|
|
5
|
+
version="0.2.17",
|
|
6
6
|
description="Turn any AI chatbot into an autonomous coding agent",
|
|
7
7
|
long_description=open("README.md").read(),
|
|
8
8
|
long_description_content_type="text/markdown",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.15"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|