alpiecode 4.0.0__tar.gz → 5.0.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.
- {alpiecode-4.0.0 → alpiecode-5.0.0}/PKG-INFO +1 -1
- {alpiecode-4.0.0 → alpiecode-5.0.0}/pyproject.toml +1 -1
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/alpiecode.egg-info/PKG-INFO +1 -1
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/cli.py +4 -3
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/prompt.py +12 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/tools.py +47 -9
- {alpiecode-4.0.0 → alpiecode-5.0.0}/README.md +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/setup.cfg +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/alpiecode/__init__.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/alpiecode.egg-info/SOURCES.txt +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/alpiecode.egg-info/dependency_links.txt +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/alpiecode.egg-info/entry_points.txt +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/alpiecode.egg-info/requires.txt +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/alpiecode.egg-info/top_level.txt +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/__init__.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/agent.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/backends/__init__.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/backends/base.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/backends/local_backend.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/backends/openai_backend.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/cache.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/client.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/compaction.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/config.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/context.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/doctor.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/executor.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/extension/alpiecode.vsix +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/github.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/guardian.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/ipython_ext.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/local_model.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/media.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/memory.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/orchestrator.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/server.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/session.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/updater.py +0 -0
- {alpiecode-4.0.0 → alpiecode-5.0.0}/src/codeagent/vscode_installer.py +0 -0
|
@@ -48,13 +48,16 @@ def _normalize_args():
|
|
|
48
48
|
|
|
49
49
|
flags = []
|
|
50
50
|
positionals = []
|
|
51
|
+
value_flags = {"--workdir", "--image", "--video", "--url", "--github", "--max-turns", "--host", "--port"}
|
|
51
52
|
|
|
52
53
|
i = 0
|
|
53
54
|
while i < len(sub_args):
|
|
54
55
|
arg = sub_args[i]
|
|
55
56
|
if arg.startswith("-"):
|
|
56
57
|
flags.append(arg)
|
|
57
|
-
if
|
|
58
|
+
if "=" in arg:
|
|
59
|
+
pass # e.g. --complexity=low already contains its value
|
|
60
|
+
elif arg in value_flags and i + 1 < len(sub_args) and not sub_args[i + 1].startswith("-"):
|
|
58
61
|
flags.append(sub_args[i + 1])
|
|
59
62
|
i += 1
|
|
60
63
|
else:
|
|
@@ -76,7 +79,6 @@ def main():
|
|
|
76
79
|
common.add_argument("--max-turns", type=int, default=None, help="Override max turns")
|
|
77
80
|
common.add_argument("--thinking", "--reasoning", dest="thinking", action="store_true", help="Enable VLM reasoning mode")
|
|
78
81
|
common.add_argument("--no-thinking", "--non-thinking", dest="no_thinking", action="store_true", help="Disable VLM reasoning mode")
|
|
79
|
-
common.add_argument("--complexity", choices=["low", "medium", "high"], default=None, help="Task complexity: low (fast, 10 turns), medium (balanced, 20 turns), high (thorough, 40 turns)")
|
|
80
82
|
common.add_argument("--no-update", action="store_true", help="Skip automatic update check")
|
|
81
83
|
common.add_argument("--quiet", action="store_true", help="Suppress per-turn logging")
|
|
82
84
|
|
|
@@ -167,7 +169,6 @@ def main():
|
|
|
167
169
|
image_path=args.image,
|
|
168
170
|
video_path=getattr(args, "video", None),
|
|
169
171
|
url=getattr(args, "url", None),
|
|
170
|
-
complexity=getattr(args, "complexity", None),
|
|
171
172
|
github_repo=getattr(args, "github", None),
|
|
172
173
|
)
|
|
173
174
|
|
|
@@ -148,6 +148,12 @@ NEVER write partial code. Write it ALL in one go.
|
|
|
148
148
|
- bash for running code, compiling, testing
|
|
149
149
|
- Do NOT use bash just to list files or explore — start coding instead
|
|
150
150
|
|
|
151
|
+
## Testing Web Servers & REST APIs — CRITICAL
|
|
152
|
+
- For FastAPI or Flask APIs, ALWAYS test endpoints using in-process test clients:
|
|
153
|
+
- FastAPI: `from fastapi.testclient import TestClient; client = TestClient(app); res = client.get('/api/items')`
|
|
154
|
+
- Flask: `client = app.test_client(); res = client.get('/api/items')`
|
|
155
|
+
- NEVER start background servers with `&`, `sleep`, or `curl`. TestClient runs in 0.05s and tests all routes without daemon processes!
|
|
156
|
+
|
|
151
157
|
## Safety
|
|
152
158
|
- Never commit, push, or open pull requests unless asked
|
|
153
159
|
- Never write secrets, API keys, or tokens into files
|
|
@@ -215,6 +221,12 @@ For multi-file projects, build in dependency order:
|
|
|
215
221
|
- Use web_search only when you genuinely need external documentation
|
|
216
222
|
- bash for running, compiling, testing
|
|
217
223
|
|
|
224
|
+
## Testing Web Servers & REST APIs — CRITICAL
|
|
225
|
+
- For FastAPI or Flask APIs, ALWAYS test endpoints using in-process test clients:
|
|
226
|
+
- FastAPI: `from fastapi.testclient import TestClient; client = TestClient(app); res = client.get('/api/items')`
|
|
227
|
+
- Flask: `client = app.test_client(); res = client.get('/api/items')`
|
|
228
|
+
- NEVER start background servers with `&`, `sleep`, or `curl`. TestClient runs in 0.05s and tests all routes without daemon processes!
|
|
229
|
+
|
|
218
230
|
## Diagnosing Failures
|
|
219
231
|
1. Read the full error output carefully
|
|
220
232
|
2. Identify the root cause (not just the symptom)
|
|
@@ -302,16 +302,45 @@ TOOLS = [
|
|
|
302
302
|
# ── Tool implementations ──────────────────────────────────────────────
|
|
303
303
|
|
|
304
304
|
def _build_venv_env(workdir: Path) -> dict:
|
|
305
|
-
"""Build an environment dict with
|
|
305
|
+
"""Build an environment dict with virtualenv bin prepended to PATH."""
|
|
306
|
+
import sys
|
|
306
307
|
env = os.environ.copy()
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
308
|
+
path_sep = ";" if os.name == "nt" else ":"
|
|
309
|
+
|
|
310
|
+
# 1. Check if workdir has its own .venv
|
|
311
|
+
venv_dir = workdir / ".venv"
|
|
312
|
+
# 2. Otherwise fallback to active virtualenv from sys.prefix
|
|
313
|
+
if not venv_dir.is_dir() and sys.prefix != getattr(sys, "base_prefix", sys.prefix):
|
|
314
|
+
venv_dir = Path(sys.prefix)
|
|
315
|
+
|
|
316
|
+
all_paths = []
|
|
317
|
+
if venv_dir.is_dir():
|
|
318
|
+
bin_dir = venv_dir / ("Scripts" if os.name == "nt" else "bin")
|
|
319
|
+
if not bin_dir.is_dir():
|
|
320
|
+
bin_dir = venv_dir / ("bin" if os.name == "nt" else "Scripts")
|
|
321
|
+
if bin_dir.is_dir():
|
|
322
|
+
all_paths.append(str(bin_dir))
|
|
323
|
+
env["VIRTUAL_ENV"] = str(venv_dir)
|
|
324
|
+
env.pop("PYTHONHOME", None)
|
|
325
|
+
|
|
326
|
+
# Include user tools (uv, local bin, cargo)
|
|
327
|
+
user_home = Path.home()
|
|
328
|
+
extra_paths = [
|
|
329
|
+
str(user_home / ".local" / "bin"),
|
|
330
|
+
str(user_home / ".cargo" / "bin"),
|
|
331
|
+
"/usr/local/bin",
|
|
332
|
+
"/usr/bin",
|
|
333
|
+
"/bin",
|
|
334
|
+
]
|
|
335
|
+
for p in extra_paths:
|
|
336
|
+
if p not in all_paths and os.path.exists(p):
|
|
337
|
+
all_paths.append(p)
|
|
338
|
+
|
|
339
|
+
current_path = env.get("PATH", "")
|
|
340
|
+
if current_path:
|
|
341
|
+
all_paths.append(current_path)
|
|
342
|
+
|
|
343
|
+
env["PATH"] = path_sep.join(all_paths)
|
|
315
344
|
return env
|
|
316
345
|
|
|
317
346
|
|
|
@@ -384,6 +413,15 @@ def _bash(workdir: Path, command: str) -> str:
|
|
|
384
413
|
import shutil
|
|
385
414
|
env = _build_venv_env(workdir)
|
|
386
415
|
|
|
416
|
+
# Auto-translate pip install -> uv pip install if pip binary is absent but uv is available
|
|
417
|
+
if "pip install" in command or "pip3 install" in command:
|
|
418
|
+
has_pip = shutil.which("pip", path=env.get("PATH")) or shutil.which("pip3", path=env.get("PATH"))
|
|
419
|
+
if not has_pip:
|
|
420
|
+
uv_bin = shutil.which("uv", path=env.get("PATH")) or shutil.which("uv")
|
|
421
|
+
if uv_bin:
|
|
422
|
+
command = re.sub(r"(?:[^\s;&|]*/)?(?:python3?|py)(?:\.exe)?\s+-m\s+pip3?\s+install\b", f"{uv_bin} pip install", command)
|
|
423
|
+
command = re.sub(r"(?:[^\s;&|]*/)?pip3?\s+install\b", f"{uv_bin} pip install", command)
|
|
424
|
+
|
|
387
425
|
# Cross-platform shell resolution
|
|
388
426
|
if shutil.which("bash"):
|
|
389
427
|
shell_cmd = ["bash", "-c", command]
|
|
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
|
|
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
|
|
File without changes
|