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

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: auto-coder
3
- Version: 0.1.315
3
+ Version: 0.1.316
4
4
  Summary: AutoCoder: AutoCoder
5
5
  Author: allwefantasy
6
6
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
@@ -14,7 +14,7 @@ autocoder/command_parser.py,sha256=fx1g9E6GaM273lGTcJqaFQ-hoksS_Ik2glBMnVltPCE,1
14
14
  autocoder/lang.py,sha256=U6AjVV8Rs1uLyjFCZ8sT6WWuNUxMBqkXXIOs4S120uk,14511
15
15
  autocoder/models.py,sha256=AyoZ-Pzy0oyYUmWCxOIRiOImsqboSfRET7LO9-UOuxI,11172
16
16
  autocoder/run_context.py,sha256=IUfSO6_gp2Wt1blFWAmOpN0b0nDrTTk4LmtCYUBIoro,1643
17
- autocoder/version.py,sha256=oUd9EIHW9z0ngi8UCDssrSs_Hmr8M7ImViaqI7Br3bc,23
17
+ autocoder/version.py,sha256=_LOQhVW4b9WlpFZvJsLKm3nuje6D26KFvC5q5q8Gdec,23
18
18
  autocoder/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  autocoder/agent/auto_demand_organizer.py,sha256=URAq0gSEiHeV_W4zwhOI_83kHz0Ryfj1gcfh5jwCv_w,6501
20
20
  autocoder/agent/auto_filegroup.py,sha256=pBsAkBcpFTff-9L5OwI8xhf2xPKpl-aZwz-skF2B6dc,6296
@@ -30,7 +30,7 @@ autocoder/chat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  autocoder/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  autocoder/commands/auto_command.py,sha256=fZ4TNU4YA9qdoVHmZX0rb6sV_N-DEcgSLaC5s3PGSHA,64200
32
32
  autocoder/commands/auto_web.py,sha256=Cc0eb6JN3SvFy3GD_lpSLvIqj7F1eFDTcwg1t-zDcKg,39024
33
- autocoder/commands/tools.py,sha256=nLXzcmwwOaMjgTUjad4usq1W0VH79jard1irxsNrRLk,31576
33
+ autocoder/commands/tools.py,sha256=SlMhPICWjDsloi05CfDMawCtJmbffOCjUNj_-ve-w40,31836
34
34
  autocoder/common/JupyterClient.py,sha256=O-wi6pXeAEYhAY24kDa0BINrLYvKS6rKyWe98pDClS0,2816
35
35
  autocoder/common/ShellClient.py,sha256=fM1q8t_XMSbLBl2zkCNC2J9xuyKN3eXzGm6hHhqL2WY,2286
36
36
  autocoder/common/__init__.py,sha256=sIbE0Gm30MkCmZ9ClQeKx1Hw-vjdcVF65hO5TschS1Y,14070
@@ -205,9 +205,9 @@ autocoder/utils/types.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
205
205
  autocoder/utils/auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
206
206
  autocoder/utils/auto_coder_utils/chat_stream_out.py,sha256=xuBeWD0YOckqRo8JB1WkVIMOYH6c24m7JfV4svBfPDo,15113
207
207
  autocoder/utils/chat_auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
208
- auto_coder-0.1.315.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
209
- auto_coder-0.1.315.dist-info/METADATA,sha256=niXHfYClyecwZuoE1EB8cKAMzYv1Vkk7etV96vseDPo,2747
210
- auto_coder-0.1.315.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
211
- auto_coder-0.1.315.dist-info/entry_points.txt,sha256=0nzHtHH4pNcM7xq4EBA2toS28Qelrvcbrr59GqD_0Ak,350
212
- auto_coder-0.1.315.dist-info/top_level.txt,sha256=Jqc0_uJSw2GwoFQAa9iJxYns-2mWla-9ok_Y3Gcznjk,10
213
- auto_coder-0.1.315.dist-info/RECORD,,
208
+ auto_coder-0.1.316.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
209
+ auto_coder-0.1.316.dist-info/METADATA,sha256=hgK7lCK6JmHXcZ3nllBgaAG-nC-j-Y8fNh52fEAOBjo,2747
210
+ auto_coder-0.1.316.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
211
+ auto_coder-0.1.316.dist-info/entry_points.txt,sha256=0nzHtHH4pNcM7xq4EBA2toS28Qelrvcbrr59GqD_0Ak,350
212
+ auto_coder-0.1.316.dist-info/top_level.txt,sha256=Jqc0_uJSw2GwoFQAa9iJxYns-2mWla-9ok_Y3Gcznjk,10
213
+ auto_coder-0.1.316.dist-info/RECORD,,
@@ -164,7 +164,7 @@ class AutoCommandTools:
164
164
  # 如果是在web模式下,则使用event_manager事件来询问用户
165
165
  if get_run_context().is_web():
166
166
  try:
167
- answer = get_event_manager(
167
+ get_event_manager(
168
168
  self.args.event_file).write_result(
169
169
  EventContentCreator.create_result(
170
170
  EventContentCreator.ResultSummaryContent(
@@ -178,15 +178,15 @@ class AutoCommandTools:
178
178
  "response": response
179
179
  }
180
180
  })
181
- except Exception as e:
182
- error_message = f"Error: {str(e)}\n\n完整异常堆栈信息:\n{traceback.format_exc()}"
181
+ except Exception as e:
182
+ error_message = f"Error: {str(e)}\n\n完整异常堆栈信息:\n{traceback.format_exc()}"
183
183
  self.result_manager.append(content=f"Error: {error_message}", meta={
184
184
  "action": "response_user",
185
185
  "input": {
186
186
  "response": response
187
187
  }
188
188
  })
189
- return answer
189
+ return response
190
190
 
191
191
  console = Console()
192
192
  answer_text = Text(response, style="italic")
@@ -331,9 +331,19 @@ class AutoCommandTools:
331
331
  注意,这个工具无法返回所有文件的信息,因为有些文件可能没有被索引。
332
332
  尽量避免使用该工具。
333
333
  """
334
- index_manager = self._get_index()
335
- s = index_manager.read_index_as_str()
336
- index_data = json.loads(s)
334
+ try:
335
+ index_manager = self._get_index()
336
+ s = index_manager.read_index_as_str()
337
+ index_data = json.loads(s)
338
+ except Exception as e:
339
+ v = f"Error: {str(e)}\n\n完整异常堆栈信息:\n{traceback.format_exc()}"
340
+ self.result_manager.add_result(content=v, meta={
341
+ "action": "get_project_map",
342
+ "input": {
343
+ "file_paths": file_paths
344
+ }
345
+ })
346
+ return v
337
347
 
338
348
  final_result = []
339
349
 
@@ -778,21 +788,21 @@ class AutoCommandTools:
778
788
  def lint_code(self, path: str, language: Optional[str] = None, fix: bool = False, verbose: bool = False) -> str:
779
789
  """
780
790
  对代码进行质量检查,支持多种编程语言。
781
-
791
+
782
792
  参数说明:
783
793
  path (str): 要检查的文件路径或项目目录
784
794
  language (str, optional): 明确指定语言类型,如'python', 'javascript', 'typescript', 'react', 'vue'等
785
795
  如果不指定,将尝试根据文件扩展名或项目结构自动检测
786
796
  fix (bool): 是否自动修复可修复的问题,默认为False
787
797
  verbose (bool): 是否显示详细输出,默认为False
788
-
798
+
789
799
  返回值:
790
800
  格式化后的lint结果,包含错误和警告信息
791
-
801
+
792
802
  支持的语言:
793
803
  - 前端: JavaScript, TypeScript, React, Vue (使用ESLint)
794
804
  - Python: 使用pylint, flake8, black
795
-
805
+
796
806
  说明:
797
807
  - 对于前端代码,需要Node.js环境
798
808
  - 对于Python代码,需要pylint/flake8/black
@@ -804,18 +814,19 @@ class AutoCommandTools:
804
814
  try:
805
815
  # 检查是否是目录或文件
806
816
  is_directory = os.path.isdir(path)
807
-
817
+
808
818
  # 根据路径类型执行相应的lint操作
809
819
  if is_directory:
810
820
  # 对整个项目进行lint
811
- result = lint_project(path, language=language, fix=fix, verbose=verbose)
821
+ result = lint_project(
822
+ path, language=language, fix=fix, verbose=verbose)
812
823
  else:
813
824
  # 对单个文件进行lint
814
825
  result = lint_file(path, fix=fix, verbose=verbose)
815
-
826
+
816
827
  # 格式化结果
817
828
  formatted_result = format_lint_result(result, language=language)
818
-
829
+
819
830
  # 记录操作结果
820
831
  self.result_manager.add_result(content=formatted_result, meta={
821
832
  "action": "lint_code",
@@ -827,12 +838,12 @@ class AutoCommandTools:
827
838
  },
828
839
  "result": result
829
840
  })
830
-
841
+
831
842
  return formatted_result
832
-
843
+
833
844
  except Exception as e:
834
845
  error_message = f"Linting failed: {str(e)}\n\n完整异常堆栈信息:\n{traceback.format_exc()}"
835
-
846
+
836
847
  self.result_manager.add_result(content=error_message, meta={
837
848
  "action": "lint_code",
838
849
  "input": {
@@ -843,5 +854,5 @@ class AutoCommandTools:
843
854
  },
844
855
  "error": error_message
845
856
  })
846
-
857
+
847
858
  return error_message
autocoder/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.1.315"
1
+ __version__ = "0.1.316"