alpiecode 0.9.8__tar.gz → 0.9.9__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-0.9.8 → alpiecode-0.9.9}/PKG-INFO +1 -1
- {alpiecode-0.9.8 → alpiecode-0.9.9}/pyproject.toml +1 -1
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/alpiecode.egg-info/PKG-INFO +1 -1
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/tools.py +41 -3
- {alpiecode-0.9.8 → alpiecode-0.9.9}/README.md +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/setup.cfg +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/alpiecode.egg-info/SOURCES.txt +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/alpiecode.egg-info/dependency_links.txt +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/alpiecode.egg-info/entry_points.txt +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/alpiecode.egg-info/requires.txt +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/alpiecode.egg-info/top_level.txt +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/__init__.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/agent.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/backends/__init__.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/backends/base.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/backends/local_backend.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/backends/openai_backend.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/cache.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/cli.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/client.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/compaction.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/config.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/context.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/executor.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/extension/alpiecode.vsix +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/github.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/guardian.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/local_model.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/media.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/memory.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/orchestrator.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/prompt.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/server.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/session.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/updater.py +0 -0
- {alpiecode-0.9.8 → alpiecode-0.9.9}/src/codeagent/vscode_installer.py +0 -0
|
@@ -334,6 +334,24 @@ def _smart_truncate(text: str, max_chars: int = 6000) -> str:
|
|
|
334
334
|
)
|
|
335
335
|
|
|
336
336
|
|
|
337
|
+
|
|
338
|
+
def _extract_script_path(command: str) -> str:
|
|
339
|
+
"""Extract the script file path from a bash command, if any."""
|
|
340
|
+
import re as _re
|
|
341
|
+
patterns = [
|
|
342
|
+
r"python3?\s+(?:-[a-zA-Z]+\s+)*([^\s|>&;]+\.py)",
|
|
343
|
+
r"node\s+([^\s|>&;]+\.js)",
|
|
344
|
+
r"ruby\s+([^\s|>&;]+\.rb)",
|
|
345
|
+
r"\./([^\s|>&;]+)",
|
|
346
|
+
r"bash\s+([^\s|>&;]+\.sh)",
|
|
347
|
+
]
|
|
348
|
+
for pat in patterns:
|
|
349
|
+
m = _re.search(pat, command)
|
|
350
|
+
if m:
|
|
351
|
+
return m.group(1)
|
|
352
|
+
return ""
|
|
353
|
+
|
|
354
|
+
|
|
337
355
|
def _bash(workdir: Path, command: str) -> str:
|
|
338
356
|
"""Run a shell command with guardian safety gate.
|
|
339
357
|
|
|
@@ -391,13 +409,33 @@ def _bash(workdir: Path, command: str) -> str:
|
|
|
391
409
|
"exit_code": result.returncode,
|
|
392
410
|
})
|
|
393
411
|
|
|
394
|
-
#
|
|
412
|
+
# ── Smart Guardrail 1: Failed command — inject actionable hints ──
|
|
395
413
|
if result.returncode != 0:
|
|
396
|
-
|
|
414
|
+
script_file = _extract_script_path(command)
|
|
415
|
+
hint = (
|
|
397
416
|
f"⚠️ COMMAND FAILED (exit_code={result.returncode}). "
|
|
398
417
|
f"Read the error output carefully and fix the ROOT CAUSE.\n"
|
|
399
|
-
+ output
|
|
400
418
|
)
|
|
419
|
+
if script_file:
|
|
420
|
+
hint += (
|
|
421
|
+
f"💡 HINT: Use read_file to examine \'{script_file}\' around the "
|
|
422
|
+
f"failing line before making edits. Do NOT guess — read first.\n"
|
|
423
|
+
)
|
|
424
|
+
output = hint + output
|
|
425
|
+
|
|
426
|
+
# ── Smart Guardrail 2: Silent success — script ran but no output ──
|
|
427
|
+
elif result.returncode == 0 and not stdout.strip() and not stderr.strip():
|
|
428
|
+
script_file = _extract_script_path(command)
|
|
429
|
+
if script_file:
|
|
430
|
+
output += (
|
|
431
|
+
"\n\n⚠️ WARNING: Command succeeded (exit_code=0) but produced "
|
|
432
|
+
"NO OUTPUT. This usually means:\n"
|
|
433
|
+
" 1. The main execution block (if __name__ == \'__main__\') is missing or broken\n"
|
|
434
|
+
" 2. An exception is being silently caught with a bare \'except: pass\'\n"
|
|
435
|
+
" 3. The print/output statements were accidentally removed\n"
|
|
436
|
+
f"→ Use read_file to check \'{script_file}\' — especially the main block "
|
|
437
|
+
"at the bottom of the file. Do NOT re-run the same command."
|
|
438
|
+
)
|
|
401
439
|
|
|
402
440
|
return output
|
|
403
441
|
except subprocess.TimeoutExpired:
|
|
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
|