auto-coder 0.1.360__py3-none-any.whl → 0.1.362__py3-none-any.whl
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.
Potentially problematic release.
This version of auto-coder might be problematic. Click here for more details.
- {auto_coder-0.1.360.dist-info → auto_coder-0.1.362.dist-info}/METADATA +2 -1
- {auto_coder-0.1.360.dist-info → auto_coder-0.1.362.dist-info}/RECORD +28 -28
- autocoder/agent/auto_learn.py +249 -262
- autocoder/auto_coder.py +4 -4
- autocoder/auto_coder_runner.py +34 -12
- autocoder/commands/auto_command.py +227 -159
- autocoder/common/__init__.py +2 -2
- autocoder/common/code_auto_generate.py +2 -2
- autocoder/common/code_auto_generate_diff.py +2 -1
- autocoder/common/code_auto_generate_editblock.py +2 -3
- autocoder/common/code_auto_generate_strict_diff.py +2 -1
- autocoder/common/ignorefiles/ignore_file_utils.py +12 -8
- autocoder/common/result_manager.py +10 -2
- autocoder/common/rulefiles/autocoderrules_utils.py +145 -0
- autocoder/common/v2/agent/agentic_edit.py +74 -49
- autocoder/common/v2/agent/agentic_edit_tools/read_file_tool_resolver.py +15 -12
- autocoder/common/v2/code_auto_generate.py +2 -1
- autocoder/common/v2/code_auto_generate_diff.py +2 -1
- autocoder/common/v2/code_auto_generate_editblock.py +5 -2
- autocoder/common/v2/code_auto_generate_strict_diff.py +3 -2
- autocoder/index/index.py +14 -8
- autocoder/privacy/model_filter.py +297 -35
- autocoder/utils/_markitdown.py +22 -3
- autocoder/version.py +1 -1
- {auto_coder-0.1.360.dist-info → auto_coder-0.1.362.dist-info}/LICENSE +0 -0
- {auto_coder-0.1.360.dist-info → auto_coder-0.1.362.dist-info}/WHEEL +0 -0
- {auto_coder-0.1.360.dist-info → auto_coder-0.1.362.dist-info}/entry_points.txt +0 -0
- {auto_coder-0.1.360.dist-info → auto_coder-0.1.362.dist-info}/top_level.txt +0 -0
autocoder/auto_coder_runner.py
CHANGED
|
@@ -65,6 +65,7 @@ from loguru import logger as global_logger
|
|
|
65
65
|
from autocoder.utils.project_structure import EnhancedFileAnalyzer
|
|
66
66
|
from autocoder.common import SourceCodeList,SourceCode
|
|
67
67
|
from autocoder.common.file_monitor import FileMonitor
|
|
68
|
+
from filelock import FileLock
|
|
68
69
|
|
|
69
70
|
|
|
70
71
|
## 对外API,用于第三方集成 auto-coder 使用。
|
|
@@ -259,11 +260,24 @@ def configure_logger():
|
|
|
259
260
|
|
|
260
261
|
configure_logger()
|
|
261
262
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
263
|
+
def init_singleton_instances():
|
|
264
|
+
# 初始化文件监控系统
|
|
265
|
+
try:
|
|
266
|
+
FileMonitor(project_root).start()
|
|
267
|
+
except Exception as e:
|
|
268
|
+
global_logger.error(f"Failed to start file monitor: {e}")
|
|
269
|
+
global_logger.exception(e)
|
|
270
|
+
|
|
271
|
+
# 初始化规则文件管理器
|
|
272
|
+
from autocoder.common.rulefiles.autocoderrules_utils import get_rules
|
|
273
|
+
get_rules(project_root=project_root)
|
|
274
|
+
|
|
275
|
+
# 初始化忽略文件管理器
|
|
276
|
+
from autocoder.common.ignorefiles.ignore_file_utils import IgnoreFileManager
|
|
277
|
+
_ = IgnoreFileManager(project_root=project_root)
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
init_singleton_instances()
|
|
267
281
|
|
|
268
282
|
def initialize_system(args:InitializeSystemRequest):
|
|
269
283
|
from autocoder.utils.model_provider_selector import ModelProviderSelector
|
|
@@ -633,20 +647,28 @@ def get_symbol_list() -> List[SymbolItem]:
|
|
|
633
647
|
|
|
634
648
|
|
|
635
649
|
def save_memory():
|
|
636
|
-
|
|
637
|
-
|
|
650
|
+
memory_path = os.path.join(base_persist_dir, "memory.json")
|
|
651
|
+
lock_path = memory_path + ".lock"
|
|
652
|
+
|
|
653
|
+
with FileLock(lock_path, timeout=30):
|
|
654
|
+
with open(memory_path, "w", encoding="utf-8") as f:
|
|
655
|
+
json.dump(memory, f, indent=2, ensure_ascii=False)
|
|
656
|
+
|
|
638
657
|
load_memory()
|
|
639
658
|
|
|
640
659
|
|
|
641
660
|
def load_memory():
|
|
642
661
|
global memory
|
|
643
662
|
memory_path = os.path.join(base_persist_dir, "memory.json")
|
|
663
|
+
lock_path = memory_path + ".lock"
|
|
664
|
+
|
|
644
665
|
if os.path.exists(memory_path):
|
|
645
|
-
with
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
666
|
+
with FileLock(lock_path, timeout=30):
|
|
667
|
+
with open(memory_path, "r", encoding="utf-8") as f:
|
|
668
|
+
_memory = json.load(f)
|
|
669
|
+
# clear memory
|
|
670
|
+
memory.clear()
|
|
671
|
+
memory.update(_memory)
|
|
650
672
|
return memory
|
|
651
673
|
|
|
652
674
|
def get_memory():
|