auto-coder 0.1.331__py3-none-any.whl → 0.1.332__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.

autocoder/index/entry.py CHANGED
@@ -30,6 +30,7 @@ from autocoder.common.action_yml_file_manager import ActionYmlFileManager
30
30
 
31
31
  from autocoder.events.event_manager_singleton import get_event_manager
32
32
  from autocoder.events import event_content as EventContentCreator
33
+ from autocoder.agent.agentic_filter import AgenticFilter
33
34
 
34
35
 
35
36
  def build_index_and_filter_files(
@@ -94,22 +95,46 @@ def build_index_and_filter_files(
94
95
  phase_end = time.monotonic()
95
96
  stats["timings"]["build_index"] = phase_end - phase_start
96
97
 
97
-
98
98
  if not args.skip_filter_index and args.index_filter_model:
99
+
99
100
  model_name = getattr(
100
101
  index_manager.index_filter_llm, 'default_model_name', None)
101
102
  if not model_name:
102
103
  model_name = "unknown(without default model name)"
103
- printer.print_in_terminal(
104
- "quick_filter_start", style="blue", model_name=model_name)
105
- quick_filter = QuickFilter(index_manager, stats, sources)
106
- quick_filter_result = quick_filter.filter(
107
- index_manager.read_index(), args.query)
108
104
 
109
- final_files.update(quick_filter_result.files)
105
+ if args.enable_agentic_filter:
106
+ from autocoder.agent.agentic_filter import AgenticFilterRequest, AgenticFilter, CommandConfig, MemoryConfig
107
+ from autocoder.common.conf_utils import load_memory
108
+
109
+ _memory = load_memory(args)
110
+
111
+ def save_memory_func():
112
+ pass
113
+
114
+ tuner = AgenticFilter(index_manager.index_filter_llm,
115
+ args=args,
116
+ conversation_history=[],
117
+ memory_config=MemoryConfig(
118
+ memory=_memory, save_memory_func=save_memory_func),
119
+ command_config=None)
120
+ response = tuner.analyze(
121
+ AgenticFilterRequest(user_input=args.query))
122
+ if response:
123
+ for file in response.files:
124
+ final_files[file.path] = TargetFile(
125
+ file_path=file.path, reason="Agentic Filter")
126
+ else:
127
+ printer.print_in_terminal(
128
+ "quick_filter_start", style="blue", model_name=model_name)
129
+
130
+ quick_filter = QuickFilter(index_manager, stats, sources)
131
+ quick_filter_result = quick_filter.filter(
132
+ index_manager.read_index(), args.query)
133
+
134
+ final_files.update(quick_filter_result.files)
110
135
 
111
- if quick_filter_result.file_positions:
112
- file_positions.update(quick_filter_result.file_positions)
136
+ if quick_filter_result.file_positions:
137
+ file_positions.update(quick_filter_result.file_positions)
113
138
 
114
139
  if not args.skip_filter_index and not args.index_filter_model:
115
140
  model_name = getattr(index_manager.llm, 'default_model_name', None)
@@ -352,7 +377,7 @@ def build_index_and_filter_files(
352
377
  ).to_dict()
353
378
  ),
354
379
  metadata=EventMetadata(
355
- action_file=args.file
380
+ action_file=args.file
356
381
  ).to_dict()
357
382
  )
358
383
 
@@ -16,6 +16,7 @@ from autocoder.linters.models import (
16
16
  IssuePosition,
17
17
  IssueSeverity
18
18
  )
19
+ from loguru import logger as global_logger
19
20
 
20
21
  class ShadowLinter:
21
22
  """
@@ -32,6 +33,7 @@ class ShadowLinter:
32
33
  """
33
34
  self.shadow_manager = shadow_manager
34
35
  self.verbose = verbose
36
+ self.logger = global_logger.bind(name="ShadowLinter")
35
37
 
36
38
  def lint_shadow_file(self, shadow_path: str, fix: bool = False) -> FileLintResult:
37
39
  """
@@ -117,8 +119,10 @@ class ShadowLinter:
117
119
 
118
120
  # 处理每个影子文件
119
121
  for shadow_path in shadow_files:
122
+ self.logger.info(f"正在检查文件: {shadow_path}")
120
123
  try:
121
124
  file_result = self.lint_shadow_file(shadow_path, fix=fix)
125
+ self.logger.info(f"检查完成: {shadow_path}")
122
126
  # lint_shadow_file现在总是返回有效的FileLintResult,不再需要检查None
123
127
  project_path = self.shadow_manager.from_shadow_path(shadow_path)
124
128
 
autocoder/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.1.331"
1
+ __version__ = "0.1.332"