auto-coder 0.1.373__tar.gz → 0.1.375__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.
Potentially problematic release.
This version of auto-coder might be problematic. Click here for more details.
- {auto_coder-0.1.373 → auto_coder-0.1.375}/PKG-INFO +2 -2
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/auto_coder.egg-info/PKG-INFO +2 -2
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/auto_coder.egg-info/SOURCES.txt +4 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/auto_coder.egg-info/requires.txt +1 -1
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/base_agent.py +193 -44
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/default_tools.py +38 -6
- auto_coder-0.1.375/src/autocoder/agent/base_agentic/tools/list_files_tool_resolver.py +150 -0
- auto_coder-0.1.375/src/autocoder/agent/base_agentic/tools/read_file_tool_resolver.py +117 -0
- auto_coder-0.1.375/src/autocoder/agent/base_agentic/tools/replace_in_file_tool_resolver.py +265 -0
- auto_coder-0.1.375/src/autocoder/agent/base_agentic/tools/search_files_tool_resolver.py +179 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/tools/talk_to_group_tool_resolver.py +5 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/tools/talk_to_tool_resolver.py +5 -0
- auto_coder-0.1.375/src/autocoder/agent/base_agentic/tools/write_to_file_tool_resolver.py +171 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/auto_coder_rag.py +68 -11
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_edit_tools/replace_in_file_tool_resolver.py +47 -141
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_edit_tools/write_to_file_tool_resolver.py +47 -102
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/index/index.py +1 -1
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/linters/linter_factory.py +4 -1
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/linters/normal_linter.py +2 -4
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/linters/python_linter.py +18 -115
- auto_coder-0.1.375/src/autocoder/rag/agentic_rag.py +217 -0
- auto_coder-0.1.375/src/autocoder/rag/tools/__init__.py +10 -0
- auto_coder-0.1.375/src/autocoder/rag/tools/recall_tool.py +162 -0
- auto_coder-0.1.375/src/autocoder/rag/tools/search_tool.py +125 -0
- auto_coder-0.1.375/src/autocoder/version.py +2 -0
- auto_coder-0.1.375/tests/test_planner.py +12 -0
- auto_coder-0.1.373/src/autocoder/agent/base_agentic/tools/list_files_tool_resolver.py +0 -110
- auto_coder-0.1.373/src/autocoder/agent/base_agentic/tools/read_file_tool_resolver.py +0 -54
- auto_coder-0.1.373/src/autocoder/agent/base_agentic/tools/replace_in_file_tool_resolver.py +0 -156
- auto_coder-0.1.373/src/autocoder/agent/base_agentic/tools/search_files_tool_resolver.py +0 -134
- auto_coder-0.1.373/src/autocoder/agent/base_agentic/tools/write_to_file_tool_resolver.py +0 -58
- auto_coder-0.1.373/src/autocoder/version.py +0 -2
- auto_coder-0.1.373/tests/test_planner.py +0 -49
- {auto_coder-0.1.373 → auto_coder-0.1.375}/LICENSE +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/README.md +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/setup.cfg +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/setup.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/auto_coder.egg-info/dependency_links.txt +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/auto_coder.egg-info/entry_points.txt +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/auto_coder.egg-info/top_level.txt +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/agentic_filter.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/auto_demand_organizer.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/auto_filegroup.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/auto_guess_query.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/auto_learn.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/auto_learn_from_commit.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/auto_review_commit.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/auto_tool.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/agent_hub.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/agentic_lang.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/agentic_tool_display.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/test_base_agent.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/tool_registry.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/tools/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/tools/ask_followup_question_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/tools/attempt_completion_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/tools/base_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/tools/example_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/tools/execute_command_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/tools/plan_mode_respond_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/tools/use_mcp_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/types.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/base_agentic/utils.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/coder.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/designer.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/planner.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/agent/project_reader.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/auto_coder.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/auto_coder_runner.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/auto_coder_server.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/benchmark.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/chat/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/chat/conf_command.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/chat/models_command.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/chat/rules_command.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/chat_auto_coder.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/chat_auto_coder_lang.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/command_args.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/command_parser.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/commands/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/commands/auto_command.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/commands/auto_web.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/commands/tools.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/JupyterClient.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/ShellClient.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/action_yml_file_manager.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/anything2images.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/anything2img.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/audio.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/auto_coder_lang.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/auto_configure.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/buildin_tokenizer.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/chunk_validation.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/cleaner.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/code_auto_execute.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/code_auto_generate.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/code_auto_generate_diff.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/code_auto_generate_editblock.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/code_auto_generate_strict_diff.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/code_auto_merge.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/code_auto_merge_diff.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/code_auto_merge_strict_diff.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/code_modification_ranker.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/command_completer.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/command_completer_v2.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/command_file_manager/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/command_file_manager/examples.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/command_file_manager/manager.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/command_file_manager/models.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/command_file_manager/utils.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/command_generator.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/command_templates.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/computer_use.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/conf_import_export.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/conf_utils.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/conf_validator.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/const.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/context_pruner.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/conversation_pruner.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/conversations/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/conversations/compatibility.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/conversations/conversation_manager.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/conversations/example.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/directory_cache/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/directory_cache/cache.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/directory_cache/test_cache.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/file_checkpoint/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/file_checkpoint/backup.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/file_checkpoint/conversation_checkpoint.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/file_checkpoint/examples.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/file_checkpoint/manager.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/file_checkpoint/models.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/file_checkpoint/store.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/file_checkpoint/test_backup.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/file_checkpoint/test_manager.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/file_checkpoint/test_models.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/file_checkpoint/test_store.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/file_checkpoint/test_utils.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/file_checkpoint/utils.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/file_monitor/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/file_monitor/monitor.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/files.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/git_utils.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/global_cancel.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/ignorefiles/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/ignorefiles/ignore_file_utils.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/ignorefiles/test_ignore_file_utils.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/image_to_page.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/index_import_export.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/interpreter.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/mcp_hub.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/mcp_server.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/mcp_server_install.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/mcp_server_types.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/mcp_servers/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/mcp_servers/mcp_server_gpt4o_mini_search.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/mcp_servers/mcp_server_perplexity.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/mcp_tools.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/memory_manager.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/model_speed_tester.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/openai_content.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/printer.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/recall_validation.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/result_manager.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/rulefiles/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/rulefiles/autocoderrules_utils.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/run_cmd.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/save_formatted_log.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/screenshots.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/search.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/search_replace.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/shells.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/stats_panel.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/stream_out_type.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/sys_prompt.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/test_run_cmd.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/text.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/token_cost_caculate.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/types.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/utils_code_auto_generate.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_edit.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_edit_tools/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_edit_tools/ask_followup_question_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_edit_tools/attempt_completion_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_edit_tools/base_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_edit_tools/execute_command_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_edit_tools/list_code_definition_names_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_edit_tools/list_files_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_edit_tools/list_package_info_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_edit_tools/plan_mode_respond_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_edit_tools/read_file_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_edit_tools/search_files_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_edit_tools/test_search_files_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_edit_tools/test_write_to_file_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_edit_tools/use_mcp_tool_resolver.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_edit_types.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/agent/agentic_tool_display.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/code_agentic_editblock_manager.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/code_auto_generate.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/code_auto_generate_diff.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/code_auto_generate_editblock.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/code_auto_generate_strict_diff.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/code_auto_merge.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/code_auto_merge_diff.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/code_auto_merge_strict_diff.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/code_diff_manager.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/code_editblock_manager.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/code_manager.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/common/v2/code_strict_diff_manager.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/compilers/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/compilers/base_compiler.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/compilers/compiler_config_api.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/compilers/compiler_config_manager.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/compilers/compiler_factory.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/compilers/java_compiler.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/compilers/models.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/compilers/normal_compiler.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/compilers/provided_compiler.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/compilers/python_compiler.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/compilers/reactjs_compiler.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/compilers/shadow_compiler.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/compilers/vue_compiler.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/data/byzerllm.md +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/data/tokenizer.json +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/db/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/db/store.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/dispacher/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/dispacher/actions/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/dispacher/actions/action.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/dispacher/actions/copilot.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/dispacher/actions/plugins/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/dispacher/actions/plugins/action_regex_project.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/events/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/events/event_content.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/events/event_manager.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/events/event_manager_singleton.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/events/event_store.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/events/event_types.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/helper/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/helper/project_creator.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/helper/rag_doc_creator.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/index/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/index/entry.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/index/filter/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/index/filter/normal_filter.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/index/filter/quick_filter.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/index/for_command.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/index/symbols_utils.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/index/types.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/lang.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/linters/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/linters/base_linter.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/linters/models.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/linters/reactjs_linter.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/linters/shadow_linter.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/linters/vue_linter.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/memory/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/memory/active_context_manager.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/memory/active_package.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/memory/async_processor.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/memory/directory_mapper.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/models.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/plugins/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/plugins/dynamic_completion_example.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/plugins/git_helper_plugin.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/plugins/sample_plugin.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/plugins/token_helper_plugin.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/plugins/utils.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/privacy/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/privacy/model_filter.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/pyproject/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/api_server.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/cache/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/cache/base_cache.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/cache/byzer_storage_cache.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/cache/cache_result_merge.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/cache/failed_files_utils.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/cache/file_monitor_cache.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/cache/local_byzer_storage_cache.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/cache/local_duckdb_storage_cache.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/cache/rag_file_meta.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/cache/simple_cache.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/conversation_to_queries.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/doc_filter.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/document_retriever.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/lang.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/llm_wrapper.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/loaders/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/loaders/docx_loader.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/loaders/excel_loader.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/loaders/filter_utils.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/loaders/image_loader.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/loaders/pdf_loader.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/loaders/ppt_loader.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/long_context_rag.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/qa_conversation_strategy.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/rag_config.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/rag_entry.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/raw_rag.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/relevant_utils.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/searchable.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/stream_event/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/stream_event/event_writer.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/stream_event/types.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/test_doc_filter.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/test_long_context_rag.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/test_token_limiter.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/token_checker.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/token_counter.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/token_limiter.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/token_limiter_utils.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/types.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/utils.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/rag/variable_holder.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/regexproject/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/run_context.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/shadows/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/shadows/shadow_manager.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/suffixproject/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/tsproject/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/_markitdown.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/auto_coder_utils/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/auto_coder_utils/chat_stream_out.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/auto_project_type.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/chat_auto_coder_utils/__init__.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/conversation_store.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/llm_client_interceptors.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/llms.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/log_capture.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/model_provider_selector.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/multi_turn.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/operate_config_api.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/print_table.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/project_structure.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/queue_communicate.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/request_event_queue.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/request_queue.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/rest.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/stream_thinking.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/thread_utils.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/src/autocoder/utils/types.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/tests/test_action_regex_project.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/tests/test_action_yml_file_manager.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/tests/test_chat_auto_coder.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/tests/test_code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/tests/test_command_completer.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/tests/test_plugins.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/tests/test_privacy.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/tests/test_queue_communicate.py +0 -0
- {auto_coder-0.1.373 → auto_coder-0.1.375}/tests/test_symbols_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: auto-coder
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.375
|
|
4
4
|
Summary: AutoCoder: AutoCoder
|
|
5
5
|
Author: allwefantasy
|
|
6
6
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -28,7 +28,7 @@ Requires-Dist: prompt-toolkit
|
|
|
28
28
|
Requires-Dist: tokenizers
|
|
29
29
|
Requires-Dist: aiofiles
|
|
30
30
|
Requires-Dist: readerwriterlock
|
|
31
|
-
Requires-Dist: byzerllm[saas]>=0.1.
|
|
31
|
+
Requires-Dist: byzerllm[saas]>=0.1.185
|
|
32
32
|
Requires-Dist: patch
|
|
33
33
|
Requires-Dist: diff_match_patch
|
|
34
34
|
Requires-Dist: GitPython
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: auto-coder
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.375
|
|
4
4
|
Summary: AutoCoder: AutoCoder
|
|
5
5
|
Author: allwefantasy
|
|
6
6
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -28,7 +28,7 @@ Requires-Dist: prompt-toolkit
|
|
|
28
28
|
Requires-Dist: tokenizers
|
|
29
29
|
Requires-Dist: aiofiles
|
|
30
30
|
Requires-Dist: readerwriterlock
|
|
31
|
-
Requires-Dist: byzerllm[saas]>=0.1.
|
|
31
|
+
Requires-Dist: byzerllm[saas]>=0.1.185
|
|
32
32
|
Requires-Dist: patch
|
|
33
33
|
Requires-Dist: diff_match_patch
|
|
34
34
|
Requires-Dist: GitPython
|
|
@@ -265,6 +265,7 @@ src/autocoder/privacy/__init__.py
|
|
|
265
265
|
src/autocoder/privacy/model_filter.py
|
|
266
266
|
src/autocoder/pyproject/__init__.py
|
|
267
267
|
src/autocoder/rag/__init__.py
|
|
268
|
+
src/autocoder/rag/agentic_rag.py
|
|
268
269
|
src/autocoder/rag/api_server.py
|
|
269
270
|
src/autocoder/rag/conversation_to_queries.py
|
|
270
271
|
src/autocoder/rag/doc_filter.py
|
|
@@ -308,6 +309,9 @@ src/autocoder/rag/loaders/ppt_loader.py
|
|
|
308
309
|
src/autocoder/rag/stream_event/__init__.py
|
|
309
310
|
src/autocoder/rag/stream_event/event_writer.py
|
|
310
311
|
src/autocoder/rag/stream_event/types.py
|
|
312
|
+
src/autocoder/rag/tools/__init__.py
|
|
313
|
+
src/autocoder/rag/tools/recall_tool.py
|
|
314
|
+
src/autocoder/rag/tools/search_tool.py
|
|
311
315
|
src/autocoder/regexproject/__init__.py
|
|
312
316
|
src/autocoder/shadows/__init__.py
|
|
313
317
|
src/autocoder/shadows/shadow_manager.py
|
|
@@ -24,7 +24,7 @@ from autocoder.common.printer import Printer
|
|
|
24
24
|
from autocoder.utils.auto_project_type import ProjectTypeAnalyzer
|
|
25
25
|
from autocoder.common.mcp_server import get_mcp_server, McpServerInfoRequest
|
|
26
26
|
from autocoder.common.file_monitor.monitor import FileMonitor
|
|
27
|
-
from autocoder.common.rulefiles.autocoderrules_utils import
|
|
27
|
+
from autocoder.common.rulefiles.autocoderrules_utils import get_required_and_index_rules
|
|
28
28
|
from autocoder.auto_coder_runner import load_tokenizer
|
|
29
29
|
from autocoder.linters.shadow_linter import ShadowLinter
|
|
30
30
|
from autocoder.compilers.shadow_compiler import ShadowCompiler
|
|
@@ -34,6 +34,10 @@ from autocoder.events.event_types import Event, EventType, EventMetadata
|
|
|
34
34
|
from autocoder.events import event_content as EventContentCreator
|
|
35
35
|
from autocoder.memory.active_context_manager import ActiveContextManager
|
|
36
36
|
from autocoder.common.action_yml_file_manager import ActionYmlFileManager
|
|
37
|
+
from autocoder.common.file_checkpoint.models import FileChange as CheckpointFileChange
|
|
38
|
+
from autocoder.common.file_checkpoint.manager import FileChangeManager as CheckpointFileChangeManager
|
|
39
|
+
from autocoder.linters.normal_linter import NormalLinter
|
|
40
|
+
from autocoder.compilers.normal_compiler import NormalCompiler
|
|
37
41
|
|
|
38
42
|
from .types import (
|
|
39
43
|
BaseTool, ToolResult, AgentRequest, FileChangeEntry,
|
|
@@ -64,6 +68,7 @@ class BaseAgent(ABC):
|
|
|
64
68
|
files: SourceCodeList,
|
|
65
69
|
args: AutoCoderArgs,
|
|
66
70
|
conversation_history: Optional[List[Dict[str, Any]]] = None,
|
|
71
|
+
default_tools_list: Optional[List[str]] = None
|
|
67
72
|
):
|
|
68
73
|
"""
|
|
69
74
|
初始化代理
|
|
@@ -102,9 +107,21 @@ class BaseAgent(ABC):
|
|
|
102
107
|
|
|
103
108
|
# 5. 初始化其他组件
|
|
104
109
|
self.project_type_analyzer = ProjectTypeAnalyzer(args=args, llm=self.llm)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
self.
|
|
110
|
+
# self.shadow_manager = ShadowManager(
|
|
111
|
+
# args.source_dir, args.event_file, args.ignore_clean_shadows)
|
|
112
|
+
self.shadow_manager = None
|
|
113
|
+
# self.shadow_linter = ShadowLinter(self.shadow_manager, verbose=False)
|
|
114
|
+
self.shadow_compiler = None
|
|
115
|
+
# self.shadow_compiler = ShadowCompiler(self.shadow_manager, verbose=False)
|
|
116
|
+
self.shadow_linter = None
|
|
117
|
+
|
|
118
|
+
self.checkpoint_manager = CheckpointFileChangeManager(
|
|
119
|
+
project_dir=args.source_dir,
|
|
120
|
+
backup_dir=os.path.join(args.source_dir,".auto-coder","checkpoint"),
|
|
121
|
+
store_dir=os.path.join(args.source_dir,".auto-coder","checkpoint_store"),
|
|
122
|
+
max_history=50)
|
|
123
|
+
self.linter = NormalLinter(args.source_dir,verbose=False)
|
|
124
|
+
self.compiler = NormalCompiler(args.source_dir,verbose=False)
|
|
108
125
|
|
|
109
126
|
|
|
110
127
|
|
|
@@ -138,7 +155,7 @@ class BaseAgent(ABC):
|
|
|
138
155
|
self._chat_lock = threading.RLock() # 保护 private_chats
|
|
139
156
|
# 自动注册到AgentHub
|
|
140
157
|
AgentHub.register_agent(self)
|
|
141
|
-
register_default_tools(params=self._render_context())
|
|
158
|
+
register_default_tools(params=self._render_context(), default_tools_list=default_tools_list)
|
|
142
159
|
|
|
143
160
|
|
|
144
161
|
def who_am_i(self, role: str) -> 'BaseAgent':
|
|
@@ -536,28 +553,7 @@ class BaseAgent(ABC):
|
|
|
536
553
|
|
|
537
554
|
{{ case_info.doc }}
|
|
538
555
|
{% endfor %}
|
|
539
|
-
|
|
540
|
-
====
|
|
541
|
-
|
|
542
|
-
ACT MODE V.S. PLAN MODE
|
|
543
|
-
|
|
544
|
-
In each user message, the environment_details will specify the current mode. There are two modes:
|
|
545
|
-
|
|
546
|
-
- ACT MODE: In this mode, you have access to all tools EXCEPT the plan_mode_respond tool.
|
|
547
|
-
- In ACT MODE, you use tools to accomplish the user's task. Once you've completed the user's task, you use the attempt_completion tool to present the result of the task to the user.
|
|
548
|
-
- PLAN MODE: In this special mode, you have access to the plan_mode_respond tool.
|
|
549
|
-
- In PLAN MODE, the goal is to gather information and get context to create a detailed plan for accomplishing the task, which the user will review and approve before they switch you to ACT MODE to implement the solution.
|
|
550
|
-
- In PLAN MODE, when you need to converse with the user or present a plan, you should use the plan_mode_respond tool to deliver your response directly, rather than using <thinking> tags to analyze when to respond. Do not talk about using plan_mode_respond - just use it directly to share your thoughts and provide helpful answers.
|
|
551
|
-
|
|
552
|
-
## What is PLAN MODE?
|
|
553
|
-
|
|
554
|
-
- While you are usually in ACT MODE, the user may switch to PLAN MODE in order to have a back and forth with you to plan how to best accomplish the task.
|
|
555
|
-
- When starting in PLAN MODE, depending on the user's request, you may need to do some information gathering e.g. using read_file or search_files to get more context about the task. You may also ask the user clarifying questions to get a better understanding of the task. You may return mermaid diagrams to visually display your understanding.
|
|
556
|
-
- Once you've gained more context about the user's request, you should architect a detailed plan for how you will accomplish the task. Returning mermaid diagrams may be helpful here as well.
|
|
557
|
-
- Then you might ask the user if they are pleased with this plan, or if they would like to make any changes. Think of this as a brainstorming session where you can discuss the task and plan the best way to accomplish it.
|
|
558
|
-
- If at any point a mermaid diagram would make your plan clearer to help the user quickly see the structure, you are encouraged to include a Mermaid code block in the response. (Note: if you use colors in your mermaid diagrams, be sure to use high contrast colors so the text is readable.)
|
|
559
|
-
- Finally once it seems like you've reached a good plan, ask the user to switch you back to ACT MODE to implement the solution.
|
|
560
|
-
|
|
556
|
+
|
|
561
557
|
{% if enable_active_context_in_generate %}
|
|
562
558
|
====
|
|
563
559
|
|
|
@@ -623,16 +619,20 @@ class BaseAgent(ABC):
|
|
|
623
619
|
{% if extra_docs %}
|
|
624
620
|
====
|
|
625
621
|
|
|
626
|
-
RULES PROVIDED BY USER
|
|
622
|
+
RULES OR DOCUMENTS PROVIDED BY USER
|
|
627
623
|
|
|
628
624
|
The following rules are provided by the user, and you must follow them strictly.
|
|
629
625
|
|
|
626
|
+
<user_rule_or_document_files>
|
|
630
627
|
{% for key, value in extra_docs.items() %}
|
|
631
|
-
<
|
|
628
|
+
<user_rule_or_document_file>
|
|
632
629
|
##File: {{ key }}
|
|
633
630
|
{{ value }}
|
|
634
|
-
</
|
|
635
|
-
{% endfor %}
|
|
631
|
+
</user_rule_or_document_file>
|
|
632
|
+
{% endfor %}
|
|
633
|
+
</user_rule_or_document_files>
|
|
634
|
+
|
|
635
|
+
Make sure you always start your task by using the read_file tool to get the relevant RULE files listed in index.md based on the user's specific requirements.
|
|
636
636
|
{% endif %}
|
|
637
637
|
|
|
638
638
|
====
|
|
@@ -675,7 +675,7 @@ class BaseAgent(ABC):
|
|
|
675
675
|
tool_case_docs = ToolRegistry.get_all_tools_case_docs()
|
|
676
676
|
tool_guidelines = ToolRegistry.get_all_tool_use_guidelines()
|
|
677
677
|
|
|
678
|
-
extra_docs =
|
|
678
|
+
extra_docs = get_required_and_index_rules()
|
|
679
679
|
|
|
680
680
|
env_info = detect_env()
|
|
681
681
|
shell_type = "bash"
|
|
@@ -763,6 +763,10 @@ class BaseAgent(ABC):
|
|
|
763
763
|
|
|
764
764
|
iteration_count = 0
|
|
765
765
|
tool_executed = False
|
|
766
|
+
|
|
767
|
+
should_yield_completion_event = False
|
|
768
|
+
completion_event = None
|
|
769
|
+
|
|
766
770
|
while True:
|
|
767
771
|
iteration_count += 1
|
|
768
772
|
logger.info(f"Starting LLM interaction cycle #{iteration_count}")
|
|
@@ -770,10 +774,14 @@ class BaseAgent(ABC):
|
|
|
770
774
|
last_message = conversations[-1]
|
|
771
775
|
if last_message["role"] == "assistant":
|
|
772
776
|
logger.info(f"Last message is assistant, skipping LLM interaction cycle")
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
+
if should_yield_completion_event:
|
|
778
|
+
if completion_event is None:
|
|
779
|
+
yield CompletionEvent(completion=AttemptCompletionTool(
|
|
780
|
+
result=last_message["content"],
|
|
781
|
+
command=""
|
|
782
|
+
), completion_xml="")
|
|
783
|
+
else:
|
|
784
|
+
yield completion_event
|
|
777
785
|
break
|
|
778
786
|
logger.info(
|
|
779
787
|
f"Starting LLM interaction cycle. History size: {len(conversations)}")
|
|
@@ -834,11 +842,13 @@ class BaseAgent(ABC):
|
|
|
834
842
|
logger.info(
|
|
835
843
|
"AttemptCompletionTool received. Finalizing session.")
|
|
836
844
|
logger.info(f"Completion result: {tool_obj.result[:50]}...")
|
|
837
|
-
|
|
845
|
+
completion_event = CompletionEvent(completion=tool_obj, completion_xml=tool_xml)
|
|
838
846
|
logger.info(
|
|
839
847
|
"AgenticEdit analyze loop finished due to AttemptCompletion.")
|
|
840
848
|
save_formatted_log(self.args.source_dir, json.dumps(conversations, ensure_ascii=False), "agentic_conversation")
|
|
841
|
-
|
|
849
|
+
mark_event_should_finish = True
|
|
850
|
+
should_yield_completion_event = True
|
|
851
|
+
continue
|
|
842
852
|
|
|
843
853
|
if isinstance(tool_obj, PlanModeRespondTool):
|
|
844
854
|
logger.info(
|
|
@@ -848,7 +858,7 @@ class BaseAgent(ABC):
|
|
|
848
858
|
logger.info(
|
|
849
859
|
"AgenticEdit analyze loop finished due to PlanModeRespond.")
|
|
850
860
|
save_formatted_log(self.args.source_dir, json.dumps(conversations, ensure_ascii=False), "agentic_conversation")
|
|
851
|
-
|
|
861
|
+
continue
|
|
852
862
|
|
|
853
863
|
# Resolve the tool
|
|
854
864
|
resolver_cls = ToolRegistry.get_resolver_for_tool(tool_obj)
|
|
@@ -1184,7 +1194,7 @@ class BaseAgent(ABC):
|
|
|
1184
1194
|
base_url = "/agent/base"
|
|
1185
1195
|
|
|
1186
1196
|
try:
|
|
1187
|
-
event_stream = self.
|
|
1197
|
+
event_stream = self.agentic_run(request)
|
|
1188
1198
|
for agent_event in event_stream:
|
|
1189
1199
|
content = None
|
|
1190
1200
|
metadata = EventMetadata(
|
|
@@ -1308,6 +1318,148 @@ class BaseAgent(ABC):
|
|
|
1308
1318
|
event_manager.write_error(
|
|
1309
1319
|
content=error_content.to_dict(), metadata=metadata.to_dict())
|
|
1310
1320
|
raise e
|
|
1321
|
+
|
|
1322
|
+
def run_with_generator(self, request: AgentRequest):
|
|
1323
|
+
start_time = time.time()
|
|
1324
|
+
project_name = os.path.basename(os.path.abspath(self.args.source_dir))
|
|
1325
|
+
yield ("thinking",agentic_lang.get_message_with_format("agent_start", project_name=project_name))
|
|
1326
|
+
|
|
1327
|
+
# 添加token累计变量
|
|
1328
|
+
total_input_tokens = 0
|
|
1329
|
+
total_output_tokens = 0
|
|
1330
|
+
total_input_cost = 0.0
|
|
1331
|
+
total_output_cost = 0.0
|
|
1332
|
+
model_name = ""
|
|
1333
|
+
|
|
1334
|
+
try:
|
|
1335
|
+
event_stream = self.agentic_run(request)
|
|
1336
|
+
for event in event_stream:
|
|
1337
|
+
if isinstance(event, TokenUsageEvent):
|
|
1338
|
+
# 获取模型信息以计算价格
|
|
1339
|
+
from autocoder.utils import llms as llm_utils
|
|
1340
|
+
model_name = ",".join(llm_utils.get_llm_names(self.llm))
|
|
1341
|
+
model_info = llm_utils.get_model_info(
|
|
1342
|
+
model_name, self.args.product_mode) or {}
|
|
1343
|
+
input_price = model_info.get(
|
|
1344
|
+
"input_price", 0.0) if model_info else 0.0
|
|
1345
|
+
output_price = model_info.get(
|
|
1346
|
+
"output_price", 0.0) if model_info else 0.0
|
|
1347
|
+
|
|
1348
|
+
# 计算成本
|
|
1349
|
+
last_meta = event.usage
|
|
1350
|
+
input_cost = (last_meta.input_tokens_count *
|
|
1351
|
+
input_price) / 1000000 # 转换为百万
|
|
1352
|
+
output_cost = (
|
|
1353
|
+
last_meta.generated_tokens_count * output_price) / 1000000
|
|
1354
|
+
|
|
1355
|
+
# 累计token使用情况
|
|
1356
|
+
total_input_tokens += last_meta.input_tokens_count
|
|
1357
|
+
total_output_tokens += last_meta.generated_tokens_count
|
|
1358
|
+
total_input_cost += input_cost
|
|
1359
|
+
total_output_cost += output_cost
|
|
1360
|
+
|
|
1361
|
+
# 记录日志
|
|
1362
|
+
logger.info(agentic_lang.get_message_with_format(
|
|
1363
|
+
"token_usage_log",
|
|
1364
|
+
model=model_name,
|
|
1365
|
+
input_tokens=last_meta.input_tokens_count,
|
|
1366
|
+
output_tokens=last_meta.generated_tokens_count,
|
|
1367
|
+
input_cost=input_cost,
|
|
1368
|
+
output_cost=output_cost))
|
|
1369
|
+
|
|
1370
|
+
elif isinstance(event, LLMThinkingEvent):
|
|
1371
|
+
# 以较不显眼的样式呈现思考内容
|
|
1372
|
+
yield ("thinking",f"{event.text}")
|
|
1373
|
+
elif isinstance(event, LLMOutputEvent):
|
|
1374
|
+
# 打印常规LLM输出
|
|
1375
|
+
yield ("thinking",event.text)
|
|
1376
|
+
elif isinstance(event, ToolCallEvent):
|
|
1377
|
+
# 跳过显示完成工具的调用
|
|
1378
|
+
if hasattr(event.tool, "result") and hasattr(event.tool, "command"):
|
|
1379
|
+
continue # 不显示完成工具的调用
|
|
1380
|
+
|
|
1381
|
+
tool_name = type(event.tool).__name__
|
|
1382
|
+
# 使用工具展示函数(需要自行实现)
|
|
1383
|
+
display_content = get_tool_display_message(event.tool)
|
|
1384
|
+
yield ("thinking", agentic_lang.get_message_with_format("tool_operation_title", tool_name=tool_name))
|
|
1385
|
+
yield ("thinking",display_content)
|
|
1386
|
+
|
|
1387
|
+
elif isinstance(event, ToolResultEvent):
|
|
1388
|
+
# 跳过显示完成工具的结果
|
|
1389
|
+
if event.tool_name == "AttemptCompletionTool":
|
|
1390
|
+
continue
|
|
1391
|
+
|
|
1392
|
+
result = event.result
|
|
1393
|
+
success_status = agentic_lang.get_message("success_status") if result.success else agentic_lang.get_message("failure_status")
|
|
1394
|
+
base_content = agentic_lang.get_message_with_format("status", status=success_status) + "\n"
|
|
1395
|
+
base_content += agentic_lang.get_message_with_format("message", message=result.message) + "\n"
|
|
1396
|
+
|
|
1397
|
+
# 格式化内容函数
|
|
1398
|
+
def _format_content(content):
|
|
1399
|
+
if len(content) > 200:
|
|
1400
|
+
return f"{content[:100]}\n...\n{content[-100:]}"
|
|
1401
|
+
else:
|
|
1402
|
+
return content
|
|
1403
|
+
|
|
1404
|
+
# 首先准备基本信息面板
|
|
1405
|
+
panel_content = [base_content]
|
|
1406
|
+
syntax_content = None
|
|
1407
|
+
|
|
1408
|
+
if result.content is not None:
|
|
1409
|
+
content_str = ""
|
|
1410
|
+
try:
|
|
1411
|
+
if isinstance(result.content, (dict, list)):
|
|
1412
|
+
import json
|
|
1413
|
+
content_str = json.dumps(
|
|
1414
|
+
result.content, indent=2, ensure_ascii=False)
|
|
1415
|
+
syntax_content = _format_content(content_str)
|
|
1416
|
+
elif isinstance(result.content, str) and ('\n' in result.content or result.content.strip().startswith('<')):
|
|
1417
|
+
syntax_content = _format_content(result.content)
|
|
1418
|
+
else:
|
|
1419
|
+
content_str = str(result.content)
|
|
1420
|
+
# 直接附加简单字符串内容
|
|
1421
|
+
panel_content.append(
|
|
1422
|
+
_format_content(content_str))
|
|
1423
|
+
except Exception as e:
|
|
1424
|
+
logger.warning(agentic_lang.get_message_with_format("format_tool_error", error=str(e)))
|
|
1425
|
+
panel_content.append(
|
|
1426
|
+
# 备用
|
|
1427
|
+
_format_content(str(result.content)))
|
|
1428
|
+
|
|
1429
|
+
# 打印基本信息面板
|
|
1430
|
+
yield ("thinking",_format_content("\n".join(panel_content)))
|
|
1431
|
+
# 单独打印语法高亮内容(如果存在)
|
|
1432
|
+
if syntax_content:
|
|
1433
|
+
yield ("thinking",syntax_content)
|
|
1434
|
+
|
|
1435
|
+
elif isinstance(event, CompletionEvent):
|
|
1436
|
+
yield ("result",event.completion.result)
|
|
1437
|
+
if event.completion.command:
|
|
1438
|
+
yield ("result", agentic_lang.get_message_with_format("suggested_command", command=event.completion.command))
|
|
1439
|
+
elif isinstance(event, ErrorEvent):
|
|
1440
|
+
yield ("result", agentic_lang.get_message("error_title"))
|
|
1441
|
+
yield ("result", agentic_lang.get_message_with_format("error_content", message=event.message))
|
|
1442
|
+
|
|
1443
|
+
time.sleep(0.1) # 小延迟以获得更好的视觉流
|
|
1444
|
+
|
|
1445
|
+
except Exception as e:
|
|
1446
|
+
logger.exception(agentic_lang.get_message("unexpected_error"))
|
|
1447
|
+
yield ("result",agentic_lang.get_message("fatal_error_title"))
|
|
1448
|
+
yield ("result",agentic_lang.get_message_with_format("fatal_error_content", error=str(e)))
|
|
1449
|
+
raise e
|
|
1450
|
+
finally:
|
|
1451
|
+
# 在结束时打印累计的token使用情况
|
|
1452
|
+
duration = time.time() - start_time
|
|
1453
|
+
yield ("result","\n" + self.printer.get_message_from_key_with_format("code_generation_complete",
|
|
1454
|
+
duration=duration,
|
|
1455
|
+
input_tokens=total_input_tokens,
|
|
1456
|
+
output_tokens=total_output_tokens,
|
|
1457
|
+
input_cost=total_input_cost,
|
|
1458
|
+
output_cost=total_output_cost,
|
|
1459
|
+
speed=0.0,
|
|
1460
|
+
model_names=model_name,
|
|
1461
|
+
sampling_count=1))
|
|
1462
|
+
yield ("result", "\n" + agentic_lang.get_message("agent_execution_complete"))
|
|
1311
1463
|
|
|
1312
1464
|
def run_in_terminal(self, request: AgentRequest):
|
|
1313
1465
|
"""
|
|
@@ -1402,10 +1554,7 @@ class BaseAgent(ABC):
|
|
|
1402
1554
|
|
|
1403
1555
|
# 格式化内容函数
|
|
1404
1556
|
def _format_content(content):
|
|
1405
|
-
|
|
1406
|
-
return f"{content[:100]}\n...\n{content[-100:]}"
|
|
1407
|
-
else:
|
|
1408
|
-
return content
|
|
1557
|
+
return content[:200]
|
|
1409
1558
|
|
|
1410
1559
|
# 首先准备基本信息面板
|
|
1411
1560
|
panel_content = [base_content]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Default tools initialization module
|
|
3
3
|
Used to initialize and register default tools
|
|
4
4
|
"""
|
|
5
|
-
from typing import Dict,
|
|
5
|
+
from typing import Dict, Optional, List, Any
|
|
6
6
|
from loguru import logger
|
|
7
7
|
import byzerllm
|
|
8
8
|
from .tool_registry import ToolRegistry
|
|
@@ -502,10 +502,30 @@ def register_default_tools_case_doc(params: Dict[str, Any]):
|
|
|
502
502
|
|
|
503
503
|
logger.info(f"处理了 {len(DEFAULT_TOOLS_CASE_DOC)} 个默认工具用例文档")
|
|
504
504
|
|
|
505
|
-
|
|
506
|
-
|
|
505
|
+
def get_default_tool_names():
|
|
506
|
+
return [
|
|
507
|
+
"execute_command",
|
|
508
|
+
"read_file",
|
|
509
|
+
"write_to_file",
|
|
510
|
+
"replace_in_file",
|
|
511
|
+
"search_files",
|
|
512
|
+
"list_files",
|
|
513
|
+
"ask_followup_question",
|
|
514
|
+
"attempt_completion",
|
|
515
|
+
"plan_mode_respond",
|
|
516
|
+
"use_mcp_tool",
|
|
517
|
+
"talk_to",
|
|
518
|
+
"talk_to_group"
|
|
519
|
+
]
|
|
520
|
+
|
|
521
|
+
def register_default_tools(params: Dict[str, Any], default_tools_list: Optional[List[str]] = None):
|
|
507
522
|
"""
|
|
508
|
-
Register
|
|
523
|
+
Register default tools
|
|
524
|
+
|
|
525
|
+
Args:
|
|
526
|
+
params: Parameters for tool generators
|
|
527
|
+
default_tools_list: Optional list of tool names to register. If provided, only tools in this list will be registered.
|
|
528
|
+
If None, all default tools will be registered.
|
|
509
529
|
"""
|
|
510
530
|
tool_desc_gen = ToolDescGenerators(params)
|
|
511
531
|
tool_examples_gen = ToolExampleGenerators(params)
|
|
@@ -661,12 +681,24 @@ def register_default_tools(params: Dict[str, Any]):
|
|
|
661
681
|
"case_docs": []
|
|
662
682
|
}
|
|
663
683
|
}
|
|
664
|
-
#
|
|
684
|
+
# 先使用统一的工具注册方法注册工具
|
|
685
|
+
registered_count = 0
|
|
665
686
|
for tool_tag, tool_info in DEFAULT_TOOLS.items():
|
|
687
|
+
# attempt_completion 工具是必须注册的
|
|
688
|
+
if tool_tag == "attempt_completion":
|
|
689
|
+
ToolRegistry.register_unified_tool(tool_tag, tool_info)
|
|
690
|
+
registered_count += 1
|
|
691
|
+
continue
|
|
692
|
+
|
|
693
|
+
# 如果提供了工具列表,则只注册列表中的工具
|
|
694
|
+
if default_tools_list is not None and tool_tag not in default_tools_list:
|
|
695
|
+
continue
|
|
696
|
+
|
|
666
697
|
ToolRegistry.register_unified_tool(tool_tag, tool_info)
|
|
698
|
+
registered_count += 1
|
|
667
699
|
|
|
668
700
|
logger.info(
|
|
669
|
-
f"Registered {
|
|
701
|
+
f"Registered {registered_count} default tools using unified registration")
|
|
670
702
|
|
|
671
703
|
# 然后注册默认工具用例文档
|
|
672
704
|
# 这样可以确保在注册用例文档时,所有工具已经注册完成
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from autocoder.agent.base_agentic.tools.base_tool_resolver import BaseToolResolver
|
|
3
|
+
from autocoder.agent.base_agentic.types import ListFilesTool, ToolResult # Import ToolResult from types
|
|
4
|
+
from typing import Optional, Dict, Any, List, Set, Union
|
|
5
|
+
import fnmatch
|
|
6
|
+
import re
|
|
7
|
+
import json
|
|
8
|
+
from loguru import logger
|
|
9
|
+
import typing
|
|
10
|
+
from autocoder.common import AutoCoderArgs
|
|
11
|
+
|
|
12
|
+
from autocoder.common.ignorefiles.ignore_file_utils import should_ignore
|
|
13
|
+
|
|
14
|
+
if typing.TYPE_CHECKING:
|
|
15
|
+
from ..base_agent import BaseAgent
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ListFilesToolResolver(BaseToolResolver):
|
|
19
|
+
def __init__(self, agent: Optional['BaseAgent'], tool: ListFilesTool, args: AutoCoderArgs):
|
|
20
|
+
super().__init__(agent, tool, args)
|
|
21
|
+
self.tool: ListFilesTool = tool # For type hinting
|
|
22
|
+
self.shadow_manager = self.agent.shadow_manager
|
|
23
|
+
|
|
24
|
+
def list_files_in_dir(self, base_dir: str, recursive: bool, source_dir: str, is_outside_source: bool) -> Set[str]:
|
|
25
|
+
"""Helper function to list files in a directory"""
|
|
26
|
+
result = set()
|
|
27
|
+
try:
|
|
28
|
+
if recursive:
|
|
29
|
+
for root, dirs, files in os.walk(base_dir):
|
|
30
|
+
# Modify dirs in-place to skip ignored dirs early
|
|
31
|
+
dirs[:] = [d for d in dirs if not should_ignore(os.path.join(root, d))]
|
|
32
|
+
for name in files:
|
|
33
|
+
full_path = os.path.join(root, name)
|
|
34
|
+
if should_ignore(full_path):
|
|
35
|
+
continue
|
|
36
|
+
display_path = os.path.relpath(full_path, source_dir) if not is_outside_source else full_path
|
|
37
|
+
result.add(display_path)
|
|
38
|
+
for d in dirs:
|
|
39
|
+
full_path = os.path.join(root, d)
|
|
40
|
+
display_path = os.path.relpath(full_path, source_dir) if not is_outside_source else full_path
|
|
41
|
+
result.add(display_path + "/")
|
|
42
|
+
else:
|
|
43
|
+
for item in os.listdir(base_dir):
|
|
44
|
+
full_path = os.path.join(base_dir, item)
|
|
45
|
+
if should_ignore(full_path):
|
|
46
|
+
continue
|
|
47
|
+
display_path = os.path.relpath(full_path, source_dir) if not is_outside_source else full_path
|
|
48
|
+
if os.path.isdir(full_path):
|
|
49
|
+
result.add(display_path + "/")
|
|
50
|
+
else:
|
|
51
|
+
result.add(display_path)
|
|
52
|
+
except Exception as e:
|
|
53
|
+
logger.warning(f"Error listing files in {base_dir}: {e}")
|
|
54
|
+
return result
|
|
55
|
+
|
|
56
|
+
def list_files_with_shadow(self, list_path_str: str, recursive: bool, source_dir: str, absolute_source_dir: str, absolute_list_path: str) -> Union[ToolResult, List[str]]:
|
|
57
|
+
"""List files using shadow manager for path translation"""
|
|
58
|
+
# Security check: Allow listing outside source_dir IF the original path is outside?
|
|
59
|
+
is_outside_source = not absolute_list_path.startswith(absolute_source_dir)
|
|
60
|
+
if is_outside_source:
|
|
61
|
+
logger.warning(f"Listing path is outside the project source directory: {list_path_str}")
|
|
62
|
+
|
|
63
|
+
# Check if shadow directory exists for this path
|
|
64
|
+
shadow_exists = False
|
|
65
|
+
shadow_dir_path = None
|
|
66
|
+
if self.shadow_manager:
|
|
67
|
+
try:
|
|
68
|
+
shadow_dir_path = self.shadow_manager.to_shadow_path(absolute_list_path)
|
|
69
|
+
if os.path.exists(shadow_dir_path) and os.path.isdir(shadow_dir_path):
|
|
70
|
+
shadow_exists = True
|
|
71
|
+
except Exception as e:
|
|
72
|
+
logger.warning(f"Error checking shadow path for {absolute_list_path}: {e}")
|
|
73
|
+
|
|
74
|
+
# Validate that at least one of the directories exists
|
|
75
|
+
if not os.path.exists(absolute_list_path) and not shadow_exists:
|
|
76
|
+
return ToolResult(success=False, message=f"Error: Path not found: {list_path_str}")
|
|
77
|
+
if os.path.exists(absolute_list_path) and not os.path.isdir(absolute_list_path):
|
|
78
|
+
return ToolResult(success=False, message=f"Error: Path is not a directory: {list_path_str}")
|
|
79
|
+
if shadow_exists and not os.path.isdir(shadow_dir_path):
|
|
80
|
+
return ToolResult(success=False, message=f"Error: Shadow path is not a directory: {shadow_dir_path}")
|
|
81
|
+
|
|
82
|
+
# Collect files from shadow and/or source directory
|
|
83
|
+
shadow_files_set = set()
|
|
84
|
+
if shadow_exists:
|
|
85
|
+
shadow_files_set = self.list_files_in_dir(shadow_dir_path, recursive, source_dir, is_outside_source)
|
|
86
|
+
|
|
87
|
+
source_files_set = set()
|
|
88
|
+
if os.path.exists(absolute_list_path) and os.path.isdir(absolute_list_path):
|
|
89
|
+
source_files_set = self.list_files_in_dir(absolute_list_path, recursive, source_dir, is_outside_source)
|
|
90
|
+
|
|
91
|
+
# Merge results, prioritizing shadow files if exist
|
|
92
|
+
if shadow_exists:
|
|
93
|
+
merged_files = shadow_files_set.union(
|
|
94
|
+
{f for f in source_files_set if f not in shadow_files_set}
|
|
95
|
+
)
|
|
96
|
+
else:
|
|
97
|
+
merged_files = source_files_set
|
|
98
|
+
|
|
99
|
+
try:
|
|
100
|
+
message = f"Successfully listed contents of '{list_path_str}' (Recursive: {recursive}). Found {len(merged_files)} items."
|
|
101
|
+
logger.info(message)
|
|
102
|
+
return sorted(merged_files)
|
|
103
|
+
except Exception as e:
|
|
104
|
+
logger.error(f"Error listing files in '{list_path_str}': {str(e)}")
|
|
105
|
+
return ToolResult(success=False, message=f"An unexpected error occurred while listing files: {str(e)}")
|
|
106
|
+
|
|
107
|
+
def list_files_normal(self, list_path_str: str, recursive: bool, source_dir: str, absolute_source_dir: str, absolute_list_path: str) -> Union[ToolResult, List[str]]:
|
|
108
|
+
"""List files directly without using shadow manager"""
|
|
109
|
+
# Security check: Allow listing outside source_dir IF the original path is outside?
|
|
110
|
+
is_outside_source = not absolute_list_path.startswith(absolute_source_dir)
|
|
111
|
+
if is_outside_source:
|
|
112
|
+
logger.warning(f"Listing path is outside the project source directory: {list_path_str}")
|
|
113
|
+
|
|
114
|
+
# Validate that the directory exists
|
|
115
|
+
if not os.path.exists(absolute_list_path):
|
|
116
|
+
return ToolResult(success=False, message=f"Error: Path not found: {list_path_str}")
|
|
117
|
+
if not os.path.isdir(absolute_list_path):
|
|
118
|
+
return ToolResult(success=False, message=f"Error: Path is not a directory: {list_path_str}")
|
|
119
|
+
|
|
120
|
+
# Collect files from the directory
|
|
121
|
+
files_set = self.list_files_in_dir(absolute_list_path, recursive, source_dir, is_outside_source)
|
|
122
|
+
|
|
123
|
+
try:
|
|
124
|
+
message = f"Successfully listed contents of '{list_path_str}' (Recursive: {recursive}). Found {len(files_set)} items."
|
|
125
|
+
logger.info(message)
|
|
126
|
+
return sorted(files_set)
|
|
127
|
+
except Exception as e:
|
|
128
|
+
logger.error(f"Error listing files in '{list_path_str}': {str(e)}")
|
|
129
|
+
return ToolResult(success=False, message=f"An unexpected error occurred while listing files: {str(e)}")
|
|
130
|
+
|
|
131
|
+
def resolve(self) -> ToolResult:
|
|
132
|
+
"""Resolve the list files tool by calling the appropriate implementation"""
|
|
133
|
+
list_path_str = self.tool.path
|
|
134
|
+
recursive = self.tool.recursive or False
|
|
135
|
+
source_dir = self.args.source_dir or "."
|
|
136
|
+
absolute_source_dir = os.path.abspath(source_dir)
|
|
137
|
+
absolute_list_path = os.path.abspath(os.path.join(source_dir, list_path_str))
|
|
138
|
+
|
|
139
|
+
# Choose the appropriate implementation based on whether shadow_manager is available
|
|
140
|
+
if self.shadow_manager:
|
|
141
|
+
result = self.list_files_with_shadow(list_path_str, recursive, source_dir, absolute_source_dir, absolute_list_path)
|
|
142
|
+
else:
|
|
143
|
+
result = self.list_files_normal(list_path_str, recursive, source_dir, absolute_source_dir, absolute_list_path)
|
|
144
|
+
|
|
145
|
+
# Handle the case where the implementation returns a sorted list instead of a ToolResult
|
|
146
|
+
if isinstance(result, list):
|
|
147
|
+
message = f"Successfully listed contents of '{list_path_str}' (Recursive: {recursive}). Found {len(result)} items."
|
|
148
|
+
return ToolResult(success=True, message=message, content=result)
|
|
149
|
+
else:
|
|
150
|
+
return result
|