ErrorAI 1.3.0__tar.gz → 1.5.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.
Files changed (26) hide show
  1. {errorai-1.3.0 → errorai-1.5.0}/ErrorAI.egg-info/PKG-INFO +5 -1
  2. errorai-1.5.0/ErrorAI.egg-info/requires.txt +11 -0
  3. {errorai-1.3.0 → errorai-1.5.0}/PKG-INFO +5 -1
  4. {errorai-1.3.0 → errorai-1.5.0}/errorai/config.py +23 -4
  5. {errorai-1.3.0 → errorai-1.5.0}/errorai/runtime.py +31 -1
  6. {errorai-1.3.0 → errorai-1.5.0}/pyproject.toml +5 -1
  7. errorai-1.3.0/ErrorAI.egg-info/requires.txt +0 -5
  8. {errorai-1.3.0 → errorai-1.5.0}/ErrorAI.egg-info/SOURCES.txt +0 -0
  9. {errorai-1.3.0 → errorai-1.5.0}/ErrorAI.egg-info/dependency_links.txt +0 -0
  10. {errorai-1.3.0 → errorai-1.5.0}/ErrorAI.egg-info/entry_points.txt +0 -0
  11. {errorai-1.3.0 → errorai-1.5.0}/ErrorAI.egg-info/top_level.txt +0 -0
  12. {errorai-1.3.0 → errorai-1.5.0}/README.md +0 -0
  13. {errorai-1.3.0 → errorai-1.5.0}/errorai/__init__.py +0 -0
  14. {errorai-1.3.0 → errorai-1.5.0}/errorai/__main__.py +0 -0
  15. {errorai-1.3.0 → errorai-1.5.0}/errorai/bootstrap.py +0 -0
  16. {errorai-1.3.0 → errorai-1.5.0}/errorai/cli.py +0 -0
  17. {errorai-1.3.0 → errorai-1.5.0}/errorai/compat.py +0 -0
  18. {errorai-1.3.0 → errorai-1.5.0}/errorai/environment.py +0 -0
  19. {errorai-1.3.0 → errorai-1.5.0}/errorai/pipeline.py +0 -0
  20. {errorai-1.3.0 → errorai-1.5.0}/errorai/providers.py +0 -0
  21. {errorai-1.3.0 → errorai-1.5.0}/errorai/universal.py +0 -0
  22. {errorai-1.3.0 → errorai-1.5.0}/setup.cfg +0 -0
  23. {errorai-1.3.0 → errorai-1.5.0}/tests/test_bootstrap.py +0 -0
  24. {errorai-1.3.0 → errorai-1.5.0}/tests/test_config.py +0 -0
  25. {errorai-1.3.0 → errorai-1.5.0}/tests/test_runtime.py +0 -0
  26. {errorai-1.3.0 → errorai-1.5.0}/tests/test_safety.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ErrorAI
3
- Version: 1.3.0
3
+ Version: 1.5.0
4
4
  Summary: Python-only autonomous runtime that watches/analyzes errors with safe local auto-fix fallbacks.
5
5
  Author: Aswanth R
6
6
  License: MIT
@@ -13,6 +13,10 @@ Requires-Python: >=3.9
13
13
  Description-Content-Type: text/markdown
14
14
  Requires-Dist: platformdirs>=3.0
15
15
  Requires-Dist: onnxruntime>=1.18.0
16
+ Requires-Dist: optimum[onnxruntime]>=1.20.0
17
+ Requires-Dist: transformers>=4.40.0
18
+ Requires-Dist: huggingface_hub>=0.23.0
19
+ Requires-Dist: tomli>=2.0.1; python_version < "3.11"
16
20
  Provides-Extra: watch
17
21
  Requires-Dist: watchdog>=4.0.0; extra == "watch"
18
22
 
@@ -0,0 +1,11 @@
1
+ platformdirs>=3.0
2
+ onnxruntime>=1.18.0
3
+ optimum[onnxruntime]>=1.20.0
4
+ transformers>=4.40.0
5
+ huggingface_hub>=0.23.0
6
+
7
+ [:python_version < "3.11"]
8
+ tomli>=2.0.1
9
+
10
+ [watch]
11
+ watchdog>=4.0.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ErrorAI
3
- Version: 1.3.0
3
+ Version: 1.5.0
4
4
  Summary: Python-only autonomous runtime that watches/analyzes errors with safe local auto-fix fallbacks.
5
5
  Author: Aswanth R
6
6
  License: MIT
@@ -13,6 +13,10 @@ Requires-Python: >=3.9
13
13
  Description-Content-Type: text/markdown
14
14
  Requires-Dist: platformdirs>=3.0
15
15
  Requires-Dist: onnxruntime>=1.18.0
16
+ Requires-Dist: optimum[onnxruntime]>=1.20.0
17
+ Requires-Dist: transformers>=4.40.0
18
+ Requires-Dist: huggingface_hub>=0.23.0
19
+ Requires-Dist: tomli>=2.0.1; python_version < "3.11"
16
20
  Provides-Extra: watch
17
21
  Requires-Dist: watchdog>=4.0.0; extra == "watch"
18
22
 
@@ -3,8 +3,27 @@ from __future__ import annotations
3
3
  from dataclasses import dataclass, field, replace
4
4
  from pathlib import Path
5
5
  import os
6
+ import sys
6
7
  from typing import Any, Dict
7
8
 
9
+
10
+ def _default_project_root() -> Path:
11
+ """Prefer the directory of the script actually being run.
12
+
13
+ Path.cwd() is wrong in IDLE (and many IDEs): "Run Module" does not chdir
14
+ into the script's folder, it just sets sys.argv[0] to the script path.
15
+ Falling back to cwd() there means the running file is almost never
16
+ considered "inside" project_root, and every fix silently gets blocked by
17
+ Applier.can_edit().
18
+ """
19
+ try:
20
+ candidate = sys.argv[0]
21
+ if candidate and Path(candidate).is_file():
22
+ return Path(candidate).resolve().parent
23
+ except Exception:
24
+ pass
25
+ return Path.cwd()
26
+
8
27
  try:
9
28
  import tomllib
10
29
  except ModuleNotFoundError: # pragma: no cover - py<3.11 fallback
@@ -25,7 +44,7 @@ class RuntimeConfig:
25
44
  auto_watch: bool = True
26
45
  safe_mode: bool = True
27
46
  dry_run: bool = True
28
- project_root: Path = field(default_factory=lambda: Path.cwd())
47
+ project_root: Path = field(default_factory=_default_project_root)
29
48
  ignore_patterns: tuple[str, ...] = (
30
49
  ".git",
31
50
  "__pycache__",
@@ -42,10 +61,10 @@ class RuntimeConfig:
42
61
  class ModelConfig:
43
62
  provider: str = "onnx"
44
63
  name: str = "onnx-qwen2.5-coder-0.5b"
45
- repo_id: str = "onnx-community/Qwen2.5-Coder-0.5B-Instruct-ONNX"
64
+ repo_id: str = "onnx-community/Qwen2.5-Coder-0.5B-Instruct"
46
65
  model_url: str = (
47
- "https://huggingface.co/onnx-community/Qwen2.5-Coder-0.5B-Instruct-ONNX/resolve/main/"
48
- "model.onnx"
66
+ "https://huggingface.co/onnx-community/Qwen2.5-Coder-0.5B-Instruct/resolve/main/"
67
+ "onnx/model.onnx"
49
68
  )
50
69
  context_window: int = 4096
51
70
  temperature: float = 0.1
@@ -191,10 +191,38 @@ class RuntimeManager:
191
191
  filename = frame.filename
192
192
  line = linecache.getline(filename, frame.lineno).strip() if filename else ""
193
193
  analysis = self.analyzer.analyze_exception(exc_type, exc_value, exc_tb)
194
- plan = self.planner.plan_line_fix(line or frame.line or "", analysis["message"])
194
+ try:
195
+ plan = self.planner.plan_line_fix(line or frame.line or "", analysis["message"])
196
+ except Exception as provider_exc:
197
+ # Never let a broken/missing model provider raise out of an
198
+ # exception hook -- that can crash the interpreter (or IDLE's
199
+ # subprocess) while it's in the middle of handling an exception.
200
+ self.reporter.log(
201
+ "provider.error",
202
+ {"analysis": analysis, "error": f"{type(provider_exc).__name__}: {provider_exc}"},
203
+ )
204
+ print(f"[errorai] Model provider failed ({type(provider_exc).__name__}: {provider_exc})")
205
+ return False
206
+
195
207
  if not plan or not filename or "<" in filename:
196
208
  self.reporter.log("exception.analyzed", {"analysis": analysis, "fixed": False})
209
+ print(f"[errorai] Caught {analysis['type']}: {analysis['message']}")
210
+ print("[errorai] No automatic fix rule matched this error.")
197
211
  return False
212
+
213
+ print(f"[errorai] Caught {analysis['type']}: {analysis['message']}")
214
+ print(f"[errorai] Suggested fix -> {plan}")
215
+
216
+ if self.capabilities and self.capabilities.can_prompt_user:
217
+ try:
218
+ answer = input("[errorai] Should I fix it [Y/N]: ").strip().lower()
219
+ except (EOFError, OSError):
220
+ answer = "n"
221
+ if answer not in {"y", "yes"}:
222
+ self.reporter.log("exception.declined", {"analysis": analysis})
223
+ print("[errorai] Skipped.")
224
+ return False
225
+
198
226
  result = self.applier.apply_line_change(Path(filename), frame.lineno, plan)
199
227
  self.reporter.log(
200
228
  "exception.handled",
@@ -209,6 +237,8 @@ class RuntimeManager:
209
237
  print("[errorai] suggested fix (dry-run, not applied):")
210
238
  print(result.preview)
211
239
  print("[errorai] set dry_run = false in .errorai.toml to auto-apply")
240
+ elif result.changed:
241
+ print(f"[errorai] Applied fix to {filename}:{frame.lineno}")
212
242
  return result.changed
213
243
 
214
244
  def status_report(self) -> dict[str, Any]:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ErrorAI"
7
- version = "1.3.0"
7
+ version = "1.5.0"
8
8
  description = "Python-only autonomous runtime that watches/analyzes errors with safe local auto-fix fallbacks."
9
9
  readme = "README.md"
10
10
  authors = [
@@ -21,6 +21,10 @@ requires-python = ">=3.9"
21
21
  dependencies = [
22
22
  "platformdirs>=3.0",
23
23
  "onnxruntime>=1.18.0",
24
+ "optimum[onnxruntime]>=1.20.0",
25
+ "transformers>=4.40.0",
26
+ "huggingface_hub>=0.23.0",
27
+ "tomli>=2.0.1; python_version < '3.11'",
24
28
  ]
25
29
 
26
30
  [project.optional-dependencies]
@@ -1,5 +0,0 @@
1
- platformdirs>=3.0
2
- onnxruntime>=1.18.0
3
-
4
- [watch]
5
- watchdog>=4.0.0
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