auto-coder 0.1.344__tar.gz → 0.1.346__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.344 → auto_coder-0.1.346}/PKG-INFO +1 -1
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/auto_coder.egg-info/PKG-INFO +1 -1
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/auto_coder.egg-info/SOURCES.txt +1 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/auto_coder_runner.py +4 -5
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/agent/agentic_edit.py +49 -16
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/agent/agentic_edit_tools/ask_followup_question_tool_resolver.py +2 -2
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/agent/agentic_edit_tools/list_files_tool_resolver.py +19 -14
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/agent/agentic_edit_tools/search_files_tool_resolver.py +16 -13
- auto_coder-0.1.346/src/autocoder/common/v2/agent/ignore_utils.py +50 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/long_context_rag.py +4 -2
- auto_coder-0.1.346/src/autocoder/rag/qa_conversation_strategy.py +295 -0
- auto_coder-0.1.346/src/autocoder/version.py +1 -0
- auto_coder-0.1.344/src/autocoder/rag/qa_conversation_strategy.py +0 -145
- auto_coder-0.1.344/src/autocoder/version.py +0 -1
- {auto_coder-0.1.344 → auto_coder-0.1.346}/LICENSE +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/README.md +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/setup.cfg +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/setup.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/auto_coder.egg-info/dependency_links.txt +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/auto_coder.egg-info/entry_points.txt +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/auto_coder.egg-info/requires.txt +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/auto_coder.egg-info/top_level.txt +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/agent/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/agent/agentic_filter.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/agent/auto_demand_organizer.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/agent/auto_filegroup.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/agent/auto_guess_query.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/agent/auto_learn_from_commit.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/agent/auto_review_commit.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/agent/auto_tool.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/agent/coder.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/agent/designer.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/agent/planner.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/agent/project_reader.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/auto_coder.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/auto_coder_rag.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/auto_coder_server.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/benchmark.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/chat/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/chat_auto_coder.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/chat_auto_coder_lang.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/command_args.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/command_parser.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/commands/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/commands/auto_command.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/commands/auto_web.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/commands/tools.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/JupyterClient.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/ShellClient.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/action_yml_file_manager.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/anything2images.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/anything2img.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/audio.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/auto_coder_lang.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/auto_configure.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/buildin_tokenizer.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/chunk_validation.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/cleaner.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/code_auto_execute.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/code_auto_generate.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/code_auto_generate_diff.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/code_auto_generate_editblock.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/code_auto_generate_strict_diff.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/code_auto_merge.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/code_auto_merge_diff.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/code_auto_merge_strict_diff.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/code_modification_ranker.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/command_completer.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/command_generator.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/command_templates.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/computer_use.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/conf_import_export.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/conf_utils.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/conf_validator.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/const.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/context_pruner.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/conversation_pruner.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/files.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/git_utils.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/global_cancel.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/image_to_page.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/index_import_export.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/interpreter.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/llm_rerank.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/mcp_hub.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/mcp_server.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/mcp_server_install.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/mcp_server_types.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/mcp_servers/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/mcp_servers/mcp_server_gpt4o_mini_search.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/mcp_servers/mcp_server_perplexity.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/mcp_tools.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/memory_manager.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/model_speed_test.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/openai_content.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/printer.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/recall_validation.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/result_manager.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/screenshots.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/search.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/search_replace.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/shells.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/stats_panel.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/stream_out_type.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/sys_prompt.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/text.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/token_cost_caculate.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/types.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/utils_code_auto_generate.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/agent/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/agent/agentic_edit_conversation.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/agent/agentic_edit_tools/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/agent/agentic_edit_tools/attempt_completion_tool_resolver.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/agent/agentic_edit_tools/base_tool_resolver.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/agent/agentic_edit_tools/execute_command_tool_resolver.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/agent/agentic_edit_tools/list_code_definition_names_tool_resolver.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/agent/agentic_edit_tools/plan_mode_respond_tool_resolver.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/agent/agentic_edit_tools/read_file_tool_resolver.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/agent/agentic_edit_tools/replace_in_file_tool_resolver.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/agent/agentic_edit_tools/use_mcp_tool_resolver.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/agent/agentic_edit_tools/write_to_file_tool_resolver.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/agent/agentic_edit_types.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/agent/agentic_tool_display.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/code_agentic_editblock_manager.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/code_auto_generate.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/code_auto_generate_diff.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/code_auto_generate_editblock.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/code_auto_generate_strict_diff.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/code_auto_merge.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/code_auto_merge_diff.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/code_auto_merge_strict_diff.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/code_diff_manager.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/code_editblock_manager.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/code_manager.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/common/v2/code_strict_diff_manager.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/compilers/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/compilers/base_compiler.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/compilers/compiler_config_api.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/compilers/compiler_config_manager.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/compilers/compiler_factory.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/compilers/java_compiler.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/compilers/models.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/compilers/provided_compiler.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/compilers/python_compiler.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/compilers/reactjs_compiler.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/compilers/shadow_compiler.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/compilers/vue_compiler.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/data/byzerllm.md +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/data/tokenizer.json +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/db/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/db/store.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/dispacher/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/dispacher/actions/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/dispacher/actions/action.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/dispacher/actions/copilot.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/dispacher/actions/plugins/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/dispacher/actions/plugins/action_regex_project.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/events/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/events/event_content.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/events/event_manager.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/events/event_manager_singleton.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/events/event_store.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/events/event_types.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/helper/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/helper/project_creator.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/index/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/index/entry.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/index/filter/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/index/filter/normal_filter.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/index/filter/quick_filter.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/index/for_command.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/index/index.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/index/symbols_utils.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/index/types.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/lang.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/linters/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/linters/base_linter.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/linters/linter_factory.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/linters/models.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/linters/python_linter.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/linters/reactjs_linter.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/linters/shadow_linter.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/linters/vue_linter.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/memory/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/memory/active_context_manager.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/memory/active_package.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/memory/async_processor.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/memory/directory_mapper.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/models.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/plugins/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/plugins/dynamic_completion_example.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/plugins/git_helper_plugin.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/plugins/sample_plugin.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/plugins/token_helper_plugin.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/plugins/utils.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/privacy/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/privacy/model_filter.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/pyproject/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/api_server.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/cache/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/cache/base_cache.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/cache/byzer_storage_cache.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/cache/cache_result_merge.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/cache/file_monitor_cache.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/cache/local_byzer_storage_cache.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/cache/local_duckdb_storage_cache.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/cache/rag_file_meta.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/cache/simple_cache.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/conversation_to_queries.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/doc_filter.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/document_retriever.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/lang.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/llm_wrapper.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/loaders/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/loaders/docx_loader.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/loaders/excel_loader.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/loaders/pdf_loader.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/loaders/ppt_loader.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/rag_config.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/rag_entry.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/raw_rag.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/relevant_utils.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/searchable.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/simple_directory_reader.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/simple_rag.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/stream_event/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/stream_event/event_writer.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/stream_event/types.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/token_checker.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/token_counter.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/token_limiter.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/token_limiter_utils.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/types.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/utils.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/rag/variable_holder.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/regexproject/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/run_context.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/shadows/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/shadows/shadow_manager.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/suffixproject/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/tsproject/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/_markitdown.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/auto_coder_utils/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/auto_coder_utils/chat_stream_out.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/auto_project_type.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/chat_auto_coder_utils/__init__.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/conversation_store.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/llm_client_interceptors.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/llms.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/log_capture.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/model_provider_selector.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/multi_turn.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/operate_config_api.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/print_table.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/project_structure.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/queue_communicate.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/request_event_queue.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/request_queue.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/rest.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/stream_thinking.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/tests.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/thread_utils.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/src/autocoder/utils/types.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/tests/test_action_regex_project.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/tests/test_action_yml_file_manager.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/tests/test_chat_auto_coder.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/tests/test_code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/tests/test_command_completer.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/tests/test_planner.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/tests/test_plugins.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/tests/test_privacy.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/tests/test_queue_communicate.py +0 -0
- {auto_coder-0.1.344 → auto_coder-0.1.346}/tests/test_symbols_utils.py +0 -0
|
@@ -121,6 +121,7 @@ src/autocoder/common/v2/agent/agentic_edit.py
|
|
|
121
121
|
src/autocoder/common/v2/agent/agentic_edit_conversation.py
|
|
122
122
|
src/autocoder/common/v2/agent/agentic_edit_types.py
|
|
123
123
|
src/autocoder/common/v2/agent/agentic_tool_display.py
|
|
124
|
+
src/autocoder/common/v2/agent/ignore_utils.py
|
|
124
125
|
src/autocoder/common/v2/agent/agentic_edit_tools/__init__.py
|
|
125
126
|
src/autocoder/common/v2/agent/agentic_edit_tools/ask_followup_question_tool_resolver.py
|
|
126
127
|
src/autocoder/common/v2/agent/agentic_edit_tools/attempt_completion_tool_resolver.py
|
|
@@ -40,7 +40,7 @@ from rich.markdown import Markdown
|
|
|
40
40
|
from byzerllm.utils.nontext import Image
|
|
41
41
|
import git
|
|
42
42
|
from autocoder.common import git_utils
|
|
43
|
-
from autocoder.chat_auto_coder_lang import get_message
|
|
43
|
+
from autocoder.chat_auto_coder_lang import get_message,get_message_with_format
|
|
44
44
|
from autocoder.agent.auto_guess_query import AutoGuessQuery
|
|
45
45
|
from autocoder.common.mcp_server import get_mcp_server
|
|
46
46
|
from autocoder.common.mcp_server_types import (
|
|
@@ -273,8 +273,8 @@ def initialize_system(args:InitializeSystemRequest):
|
|
|
273
273
|
else:
|
|
274
274
|
print(f" {message}")
|
|
275
275
|
|
|
276
|
-
def init_project():
|
|
277
|
-
if not os.path.exists(".auto-coder"):
|
|
276
|
+
def init_project():
|
|
277
|
+
if not os.path.exists(".auto-coder") or not os.path.exists("actions"):
|
|
278
278
|
first_time[0] = True
|
|
279
279
|
print_status(get_message("not_initialized"), "warning")
|
|
280
280
|
init_choice = input(
|
|
@@ -295,8 +295,7 @@ def initialize_system(args:InitializeSystemRequest):
|
|
|
295
295
|
|
|
296
296
|
if not os.path.exists(base_persist_dir):
|
|
297
297
|
os.makedirs(base_persist_dir, exist_ok=True)
|
|
298
|
-
print_status(
|
|
299
|
-
base_persist_dir), "success")
|
|
298
|
+
print_status(get_message_with_format("created_dir",path=base_persist_dir), "success")
|
|
300
299
|
|
|
301
300
|
if first_time[0]:
|
|
302
301
|
configure_project_type()
|
|
@@ -221,7 +221,7 @@ class AgenticEdit:
|
|
|
221
221
|
{{files}}
|
|
222
222
|
</files>
|
|
223
223
|
|
|
224
|
-
====
|
|
224
|
+
====
|
|
225
225
|
|
|
226
226
|
TOOL USE
|
|
227
227
|
|
|
@@ -667,7 +667,35 @@ class AgenticEdit:
|
|
|
667
667
|
You can use the tool `read_file` to read these description files, which helps you decide exactly which files need detailed attention. Note that the `active.md` file does not contain information about all files within the directory—it only includes information
|
|
668
668
|
about the files that were recently changed.
|
|
669
669
|
{% endif %}
|
|
670
|
+
|
|
671
|
+
{% if extra_docs %}
|
|
672
|
+
====
|
|
673
|
+
|
|
674
|
+
RULES PROVIDED BY USER
|
|
675
|
+
|
|
676
|
+
The following rules are provided by the user, and you must follow them strictly.
|
|
677
|
+
|
|
678
|
+
{% for key, value in extra_docs.items() %}
|
|
679
|
+
### {{ key }}
|
|
680
|
+
{{ value }}
|
|
681
|
+
{% endfor %}
|
|
682
|
+
{% endif %}
|
|
670
683
|
"""
|
|
684
|
+
import os
|
|
685
|
+
extra_docs = {}
|
|
686
|
+
rules_dir = os.path.join(self.args.source_dir,".auto-coder", "autocoderrules")
|
|
687
|
+
if os.path.isdir(rules_dir):
|
|
688
|
+
for fname in os.listdir(rules_dir):
|
|
689
|
+
if fname.endswith(".md"):
|
|
690
|
+
fpath = os.path.join(rules_dir, fname)
|
|
691
|
+
try:
|
|
692
|
+
with open(fpath, "r", encoding="utf-8") as f:
|
|
693
|
+
content = f.read()
|
|
694
|
+
key = os.path.splitext(fname)[0]
|
|
695
|
+
extra_docs[key] = content
|
|
696
|
+
except Exception:
|
|
697
|
+
continue
|
|
698
|
+
|
|
671
699
|
env_info = detect_env()
|
|
672
700
|
shell_type = "bash"
|
|
673
701
|
if shells.is_running_in_cmd():
|
|
@@ -687,6 +715,7 @@ class AgenticEdit:
|
|
|
687
715
|
"files": self.files.to_str(),
|
|
688
716
|
"mcp_server_info": self.mcp_server_info,
|
|
689
717
|
"enable_active_context": self.args.enable_active_context,
|
|
718
|
+
"extra_docs": extra_docs,
|
|
690
719
|
}
|
|
691
720
|
|
|
692
721
|
# Removed _execute_command_result and execute_auto_command methods
|
|
@@ -736,8 +765,8 @@ class AgenticEdit:
|
|
|
736
765
|
Analyzes the user request, interacts with the LLM, parses responses,
|
|
737
766
|
executes tools, and yields structured events for visualization until completion or error.
|
|
738
767
|
"""
|
|
739
|
-
system_prompt = self._analyze.prompt(request)
|
|
740
|
-
# print(system_prompt)
|
|
768
|
+
system_prompt = self._analyze.prompt(request)
|
|
769
|
+
# print(system_prompt)
|
|
741
770
|
conversations = [
|
|
742
771
|
{"role": "system", "content": system_prompt},
|
|
743
772
|
] + self.conversation_manager.get_history()
|
|
@@ -747,13 +776,13 @@ class AgenticEdit:
|
|
|
747
776
|
self.conversation_manager.add_user_message(request.user_input)
|
|
748
777
|
logger.debug(
|
|
749
778
|
f"Initial conversation history size: {len(conversations)}")
|
|
750
|
-
|
|
779
|
+
|
|
751
780
|
tool_executed = False
|
|
752
781
|
while True:
|
|
753
782
|
global_cancel.check_and_raise()
|
|
754
783
|
logger.info(
|
|
755
784
|
f"Starting LLM interaction cycle. History size: {len(conversations)}")
|
|
756
|
-
|
|
785
|
+
|
|
757
786
|
assistant_buffer = ""
|
|
758
787
|
|
|
759
788
|
llm_response_gen = stream_chat_with_continue(
|
|
@@ -954,10 +983,10 @@ class AgenticEdit:
|
|
|
954
983
|
params['options'])
|
|
955
984
|
except json.JSONDecodeError:
|
|
956
985
|
logger.warning(
|
|
957
|
-
f"Could not decode JSON options for plan_mode_respond_tool: {params['options']}")
|
|
986
|
+
f"Could not decode JSON options for plan_mode_respond_tool: {params['options']}")
|
|
958
987
|
# Handle recursive for list_files
|
|
959
988
|
if tool_tag == 'list_files' and 'recursive' in params:
|
|
960
|
-
params['recursive'] = params['recursive'].lower() == 'true'
|
|
989
|
+
params['recursive'] = params['recursive'].lower() == 'true'
|
|
961
990
|
return tool_cls(**params)
|
|
962
991
|
else:
|
|
963
992
|
logger.error(f"Tool class not found for tag: {tool_tag}")
|
|
@@ -971,6 +1000,7 @@ class AgenticEdit:
|
|
|
971
1000
|
global_cancel.check_and_raise()
|
|
972
1001
|
|
|
973
1002
|
meta_holder.meta = metadata
|
|
1003
|
+
logger.info(f"metadata: {metadata.input_tokens_count}")
|
|
974
1004
|
if not content_chunk:
|
|
975
1005
|
continue
|
|
976
1006
|
buffer += content_chunk
|
|
@@ -995,7 +1025,7 @@ class AgenticEdit:
|
|
|
995
1025
|
break
|
|
996
1026
|
|
|
997
1027
|
# 2. Check for </tool_tag> if inside tool block
|
|
998
|
-
elif in_tool_block:
|
|
1028
|
+
elif in_tool_block:
|
|
999
1029
|
end_tag = f"</{current_tool_tag}>"
|
|
1000
1030
|
end_tool_pos = buffer.find(end_tag)
|
|
1001
1031
|
if end_tool_pos != -1:
|
|
@@ -1155,16 +1185,16 @@ class AgenticEdit:
|
|
|
1155
1185
|
event_manager.write_result(
|
|
1156
1186
|
content=content.to_dict(), metadata=metadata.to_dict())
|
|
1157
1187
|
elif isinstance(agent_event, PlanModeRespondEvent):
|
|
1158
|
-
metadata.path = "/agent/edit/plan_mode_respond"
|
|
1188
|
+
metadata.path = "/agent/edit/plan_mode_respond"
|
|
1159
1189
|
content = EventContentCreator.create_markdown_result(
|
|
1160
1190
|
content=agent_event.completion.response,
|
|
1161
1191
|
metadata={}
|
|
1162
|
-
)
|
|
1192
|
+
)
|
|
1163
1193
|
event_manager.write_result(
|
|
1164
1194
|
content=content.to_dict(), metadata=metadata.to_dict())
|
|
1165
1195
|
|
|
1166
|
-
elif isinstance(agent_event, TokenUsageEvent):
|
|
1167
|
-
last_meta: SingleOutputMeta = agent_event.usage
|
|
1196
|
+
elif isinstance(agent_event, TokenUsageEvent):
|
|
1197
|
+
last_meta: SingleOutputMeta = agent_event.usage
|
|
1168
1198
|
# Get model info for pricing
|
|
1169
1199
|
from autocoder.utils import llms as llm_utils
|
|
1170
1200
|
model_name = ",".join(llm_utils.get_llm_names(self.llm))
|
|
@@ -1181,7 +1211,7 @@ class AgenticEdit:
|
|
|
1181
1211
|
# Convert to millions
|
|
1182
1212
|
output_cost = (
|
|
1183
1213
|
last_meta.generated_tokens_count * output_price) / 1000000
|
|
1184
|
-
|
|
1214
|
+
|
|
1185
1215
|
get_event_manager(self.args.event_file).write_result(
|
|
1186
1216
|
EventContentCreator.create_result(content=EventContentCreator.ResultTokenStatContent(
|
|
1187
1217
|
model_name=model_name,
|
|
@@ -1191,7 +1221,7 @@ class AgenticEdit:
|
|
|
1191
1221
|
output_tokens=last_meta.generated_tokens_count,
|
|
1192
1222
|
input_cost=input_cost,
|
|
1193
1223
|
output_cost=output_cost
|
|
1194
|
-
).to_dict()),metadata=metadata.to_dict())
|
|
1224
|
+
).to_dict()), metadata=metadata.to_dict())
|
|
1195
1225
|
|
|
1196
1226
|
elif isinstance(agent_event, CompletionEvent):
|
|
1197
1227
|
# 在这里完成实际合并
|
|
@@ -1236,7 +1266,10 @@ class AgenticEdit:
|
|
|
1236
1266
|
except Exception as e:
|
|
1237
1267
|
logger.exception(
|
|
1238
1268
|
"An unexpected error occurred during agent execution:")
|
|
1239
|
-
metadata
|
|
1269
|
+
metadata = EventMetadata(
|
|
1270
|
+
action_file=self.args.file,
|
|
1271
|
+
is_streaming=False,
|
|
1272
|
+
stream_out_type="/agent/edit/error")
|
|
1240
1273
|
error_content = EventContentCreator.create_error(
|
|
1241
1274
|
error_code="AGENT_FATAL_ERROR",
|
|
1242
1275
|
error_message=f"An unexpected error occurred: {str(e)}",
|
|
@@ -1250,7 +1283,7 @@ class AgenticEdit:
|
|
|
1250
1283
|
def apply_changes(self):
|
|
1251
1284
|
"""
|
|
1252
1285
|
Apply all tracked file changes to the original project directory.
|
|
1253
|
-
"""
|
|
1286
|
+
"""
|
|
1254
1287
|
for (file_path, change) in self.get_all_file_changes().items():
|
|
1255
1288
|
with open(file_path, 'w', encoding='utf-8') as f:
|
|
1256
1289
|
f.write(change.content)
|
|
@@ -29,12 +29,12 @@ class AskFollowupQuestionToolResolver(BaseToolResolver):
|
|
|
29
29
|
This resolver doesn't directly ask the user but prepares the data for it.
|
|
30
30
|
"""
|
|
31
31
|
question = self.tool.question
|
|
32
|
-
options = self.tool.options
|
|
32
|
+
options = self.tool.options or []
|
|
33
33
|
options_text = "\n".join([f"{i+1}. {option}" for i, option in enumerate(options)])
|
|
34
34
|
if get_run_context().is_web():
|
|
35
35
|
answer = get_event_manager(
|
|
36
36
|
self.args.event_file).ask_user(prompt=question)
|
|
37
|
-
self.result_manager.append(content=answer + "\n" + options_text, meta={
|
|
37
|
+
self.result_manager.append(content=answer + ("\n" + options_text if options_text else ""), meta={
|
|
38
38
|
"action": "ask_user",
|
|
39
39
|
"input": {
|
|
40
40
|
"question": question
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import os
|
|
2
2
|
from typing import Dict, Any, Optional
|
|
3
3
|
from autocoder.common.v2.agent.agentic_edit_tools.base_tool_resolver import BaseToolResolver
|
|
4
|
-
from autocoder.common.v2.agent.agentic_edit_types import ListFilesTool, ToolResult
|
|
4
|
+
from autocoder.common.v2.agent.agentic_edit_types import ListFilesTool, ToolResult # Import ToolResult from types
|
|
5
5
|
from loguru import logger
|
|
6
6
|
import typing
|
|
7
7
|
from autocoder.common import AutoCoderArgs
|
|
8
8
|
|
|
9
|
+
from autocoder.common.v2.agent.ignore_utils import load_ignore_spec, should_ignore, DEFAULT_IGNORED_DIRS
|
|
10
|
+
|
|
9
11
|
if typing.TYPE_CHECKING:
|
|
10
12
|
from autocoder.common.v2.agent.agentic_edit import AgenticEdit
|
|
11
13
|
|
|
@@ -13,26 +15,25 @@ if typing.TYPE_CHECKING:
|
|
|
13
15
|
class ListFilesToolResolver(BaseToolResolver):
|
|
14
16
|
def __init__(self, agent: Optional['AgenticEdit'], tool: ListFilesTool, args: AutoCoderArgs):
|
|
15
17
|
super().__init__(agent, tool, args)
|
|
16
|
-
self.tool: ListFilesTool = tool
|
|
18
|
+
self.tool: ListFilesTool = tool # For type hinting
|
|
17
19
|
self.shadow_manager = self.agent.shadow_manager
|
|
18
20
|
|
|
19
21
|
def resolve(self) -> ToolResult:
|
|
20
22
|
list_path_str = self.tool.path
|
|
21
23
|
recursive = self.tool.recursive or False
|
|
22
24
|
source_dir = self.args.source_dir or "."
|
|
25
|
+
absolute_source_dir = os.path.abspath(source_dir)
|
|
23
26
|
absolute_list_path = os.path.abspath(os.path.join(source_dir, list_path_str))
|
|
24
27
|
|
|
28
|
+
# Load ignore spec from .autocoderignore if exists
|
|
29
|
+
ignore_spec = load_ignore_spec(absolute_source_dir)
|
|
30
|
+
|
|
25
31
|
# Security check: Allow listing outside source_dir IF the original path is outside?
|
|
26
|
-
|
|
27
|
-
# This needs careful consideration based on security requirements.
|
|
28
|
-
# Let's allow listing anywhere for now, but log a warning if outside source_dir.
|
|
29
|
-
is_outside_source = not absolute_list_path.startswith(os.path.abspath(source_dir))
|
|
32
|
+
is_outside_source = not absolute_list_path.startswith(absolute_source_dir)
|
|
30
33
|
if is_outside_source:
|
|
31
|
-
|
|
32
|
-
# Add more checks if needed, e.g., prevent listing sensitive system dirs
|
|
34
|
+
logger.warning(f"Listing path is outside the project source directory: {list_path_str}")
|
|
33
35
|
|
|
34
36
|
# Check if shadow directory exists for this path
|
|
35
|
-
shadow_paths = []
|
|
36
37
|
shadow_exists = False
|
|
37
38
|
shadow_dir_path = None
|
|
38
39
|
if self.shadow_manager:
|
|
@@ -57,17 +58,23 @@ class ListFilesToolResolver(BaseToolResolver):
|
|
|
57
58
|
try:
|
|
58
59
|
if recursive:
|
|
59
60
|
for root, dirs, files in os.walk(base_dir):
|
|
61
|
+
# Modify dirs in-place to skip ignored dirs early
|
|
62
|
+
dirs[:] = [d for d in dirs if not should_ignore(os.path.join(root, d), ignore_spec, DEFAULT_IGNORED_DIRS, absolute_source_dir)]
|
|
60
63
|
for name in files:
|
|
61
64
|
full_path = os.path.join(root, name)
|
|
65
|
+
if should_ignore(full_path, ignore_spec, DEFAULT_IGNORED_DIRS, absolute_source_dir):
|
|
66
|
+
continue
|
|
62
67
|
display_path = os.path.relpath(full_path, source_dir) if not is_outside_source else full_path
|
|
63
68
|
result.add(display_path)
|
|
64
|
-
for
|
|
65
|
-
full_path = os.path.join(root,
|
|
69
|
+
for d in dirs:
|
|
70
|
+
full_path = os.path.join(root, d)
|
|
66
71
|
display_path = os.path.relpath(full_path, source_dir) if not is_outside_source else full_path
|
|
67
72
|
result.add(display_path + "/")
|
|
68
73
|
else:
|
|
69
74
|
for item in os.listdir(base_dir):
|
|
70
75
|
full_path = os.path.join(base_dir, item)
|
|
76
|
+
if should_ignore(full_path, ignore_spec, DEFAULT_IGNORED_DIRS, absolute_source_dir):
|
|
77
|
+
continue
|
|
71
78
|
display_path = os.path.relpath(full_path, source_dir) if not is_outside_source else full_path
|
|
72
79
|
if os.path.isdir(full_path):
|
|
73
80
|
result.add(display_path + "/")
|
|
@@ -87,9 +94,7 @@ class ListFilesToolResolver(BaseToolResolver):
|
|
|
87
94
|
source_files_set = list_files_in_dir(absolute_list_path)
|
|
88
95
|
|
|
89
96
|
# Merge results, prioritizing shadow files if exist
|
|
90
|
-
merged_files = set()
|
|
91
97
|
if shadow_exists:
|
|
92
|
-
# Use shadow files + source files that are NOT shadowed
|
|
93
98
|
merged_files = shadow_files_set.union(
|
|
94
99
|
{f for f in source_files_set if f not in shadow_files_set}
|
|
95
100
|
)
|
|
@@ -102,4 +107,4 @@ class ListFilesToolResolver(BaseToolResolver):
|
|
|
102
107
|
return ToolResult(success=True, message=message, content=sorted(merged_files))
|
|
103
108
|
except Exception as e:
|
|
104
109
|
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)}")
|
|
110
|
+
return ToolResult(success=False, message=f"An unexpected error occurred while listing files: {str(e)}")
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
|
|
1
2
|
import os
|
|
2
3
|
import re
|
|
3
4
|
import glob
|
|
4
5
|
from typing import Dict, Any, Optional
|
|
5
6
|
from autocoder.common.v2.agent.agentic_edit_tools.base_tool_resolver import BaseToolResolver
|
|
6
|
-
from autocoder.common.v2.agent.agentic_edit_types import SearchFilesTool, ToolResult
|
|
7
|
+
from autocoder.common.v2.agent.agentic_edit_types import SearchFilesTool, ToolResult # Import ToolResult from types
|
|
7
8
|
from loguru import logger
|
|
8
9
|
from autocoder.common import AutoCoderArgs
|
|
9
10
|
import typing
|
|
10
11
|
|
|
12
|
+
from autocoder.common.v2.agent.ignore_utils import load_ignore_spec, should_ignore, DEFAULT_IGNORED_DIRS
|
|
13
|
+
|
|
11
14
|
if typing.TYPE_CHECKING:
|
|
12
15
|
from autocoder.common.v2.agent.agentic_edit import AgenticEdit
|
|
13
16
|
|
|
@@ -15,18 +18,22 @@ if typing.TYPE_CHECKING:
|
|
|
15
18
|
class SearchFilesToolResolver(BaseToolResolver):
|
|
16
19
|
def __init__(self, agent: Optional['AgenticEdit'], tool: SearchFilesTool, args: AutoCoderArgs):
|
|
17
20
|
super().__init__(agent, tool, args)
|
|
18
|
-
self.tool: SearchFilesTool = tool
|
|
21
|
+
self.tool: SearchFilesTool = tool
|
|
19
22
|
self.shadow_manager = self.agent.shadow_manager if self.agent else None
|
|
20
23
|
|
|
21
24
|
def resolve(self) -> ToolResult:
|
|
22
25
|
search_path_str = self.tool.path
|
|
23
26
|
regex_pattern = self.tool.regex
|
|
24
|
-
file_pattern = self.tool.file_pattern or "*"
|
|
27
|
+
file_pattern = self.tool.file_pattern or "*"
|
|
25
28
|
source_dir = self.args.source_dir or "."
|
|
29
|
+
absolute_source_dir = os.path.abspath(source_dir)
|
|
26
30
|
absolute_search_path = os.path.abspath(os.path.join(source_dir, search_path_str))
|
|
27
31
|
|
|
32
|
+
# Load ignore spec from .autocoderignore if exists
|
|
33
|
+
ignore_spec = load_ignore_spec(absolute_source_dir)
|
|
34
|
+
|
|
28
35
|
# Security check
|
|
29
|
-
if not absolute_search_path.startswith(
|
|
36
|
+
if not absolute_search_path.startswith(absolute_source_dir):
|
|
30
37
|
return ToolResult(success=False, message=f"Error: Access denied. Attempted to search outside the project directory: {search_path_str}")
|
|
31
38
|
|
|
32
39
|
# Determine search base directory: prefer shadow if exists
|
|
@@ -54,12 +61,11 @@ class SearchFilesToolResolver(BaseToolResolver):
|
|
|
54
61
|
compiled_regex = re.compile(regex_pattern)
|
|
55
62
|
search_glob_pattern = os.path.join(search_base_path, "**", file_pattern)
|
|
56
63
|
|
|
57
|
-
|
|
58
|
-
logger.info(f"Searching for regex '{regex_pattern}' in files matching '{file_pattern}' under '{search_base_path}' (shadow: {shadow_exists}), ignoring directories: {ignored_dirs}")
|
|
64
|
+
logger.info(f"Searching for regex '{regex_pattern}' in files matching '{file_pattern}' under '{search_base_path}' (shadow: {shadow_exists}) with ignore rules applied.")
|
|
59
65
|
|
|
60
66
|
for filepath in glob.glob(search_glob_pattern, recursive=True):
|
|
61
|
-
|
|
62
|
-
if
|
|
67
|
+
abs_path = os.path.abspath(filepath)
|
|
68
|
+
if should_ignore(abs_path, ignore_spec, DEFAULT_IGNORED_DIRS, absolute_source_dir):
|
|
63
69
|
continue
|
|
64
70
|
|
|
65
71
|
if os.path.isfile(filepath):
|
|
@@ -68,11 +74,9 @@ class SearchFilesToolResolver(BaseToolResolver):
|
|
|
68
74
|
lines = f.readlines()
|
|
69
75
|
for i, line in enumerate(lines):
|
|
70
76
|
if compiled_regex.search(line):
|
|
71
|
-
# Provide context (e.g., line number and surrounding lines)
|
|
72
77
|
context_start = max(0, i - 2)
|
|
73
78
|
context_end = min(len(lines), i + 3)
|
|
74
79
|
context = "".join([f"{j+1}: {lines[j]}" for j in range(context_start, context_end)])
|
|
75
|
-
# For shadow files, convert to project-relative path
|
|
76
80
|
if shadow_exists and self.shadow_manager:
|
|
77
81
|
try:
|
|
78
82
|
abs_project_path = self.shadow_manager.from_shadow_path(filepath)
|
|
@@ -87,10 +91,9 @@ class SearchFilesToolResolver(BaseToolResolver):
|
|
|
87
91
|
"match_line": line.strip(),
|
|
88
92
|
"context": context.strip()
|
|
89
93
|
})
|
|
90
|
-
# Limit results per file? Or overall? For now, collect all.
|
|
91
94
|
except Exception as e:
|
|
92
95
|
logger.warning(f"Could not read or process file {filepath}: {e}")
|
|
93
|
-
continue
|
|
96
|
+
continue
|
|
94
97
|
|
|
95
98
|
message = f"Search completed. Found {len(results)} matches."
|
|
96
99
|
logger.info(message)
|
|
@@ -101,4 +104,4 @@ class SearchFilesToolResolver(BaseToolResolver):
|
|
|
101
104
|
return ToolResult(success=False, message=f"Invalid regex pattern: {e}")
|
|
102
105
|
except Exception as e:
|
|
103
106
|
logger.error(f"Error during file search: {str(e)}")
|
|
104
|
-
return ToolResult(success=False, message=f"An unexpected error occurred during search: {str(e)}")
|
|
107
|
+
return ToolResult(success=False, message=f"An unexpected error occurred during search: {str(e)}")
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
import os
|
|
3
|
+
from typing import Optional, List
|
|
4
|
+
import pathspec
|
|
5
|
+
|
|
6
|
+
DEFAULT_IGNORED_DIRS = ['.git', '.auto-coder', 'node_modules', '.mvn', '.idea', '__pycache__', '.venv', 'venv', 'dist', 'build', '.gradle']
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def load_ignore_spec(source_dir: str) -> Optional[pathspec.PathSpec]:
|
|
10
|
+
"""
|
|
11
|
+
Loads .autocoderignore file from the source_dir if it exists.
|
|
12
|
+
Returns a PathSpec object or None if no ignore file.
|
|
13
|
+
"""
|
|
14
|
+
ignore_file_path = os.path.join(source_dir, ".autocoderignore")
|
|
15
|
+
if not os.path.isfile(ignore_file_path):
|
|
16
|
+
return None
|
|
17
|
+
try:
|
|
18
|
+
with open(ignore_file_path, "r") as f:
|
|
19
|
+
ignore_patterns = f.read().splitlines()
|
|
20
|
+
spec = pathspec.PathSpec.from_lines("gitwildmatch", ignore_patterns)
|
|
21
|
+
return spec
|
|
22
|
+
except Exception:
|
|
23
|
+
return None
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def should_ignore(path: str, ignore_spec: Optional[pathspec.PathSpec], ignored_dirs: List[str], source_dir: str) -> bool:
|
|
27
|
+
"""
|
|
28
|
+
Determine if a given path should be ignored based on ignore_spec and ignored_dirs.
|
|
29
|
+
- path: absolute path
|
|
30
|
+
- ignore_spec: PathSpec object or None
|
|
31
|
+
- ignored_dirs: list of directory names to ignore
|
|
32
|
+
- source_dir: root source directory absolute path
|
|
33
|
+
"""
|
|
34
|
+
rel_path = os.path.relpath(path, source_dir)
|
|
35
|
+
parts = rel_path.split(os.sep)
|
|
36
|
+
|
|
37
|
+
# Always ignore if any part matches ignored_dirs
|
|
38
|
+
for part in parts:
|
|
39
|
+
if part in ignored_dirs:
|
|
40
|
+
return True
|
|
41
|
+
|
|
42
|
+
# If ignore_spec exists, use it to check
|
|
43
|
+
if ignore_spec:
|
|
44
|
+
# pathspec expects posix style paths
|
|
45
|
+
rel_path_posix = rel_path.replace(os.sep, "/")
|
|
46
|
+
# Check both file and dir ignoring
|
|
47
|
+
if ignore_spec.match_file(rel_path_posix):
|
|
48
|
+
return True
|
|
49
|
+
|
|
50
|
+
return False
|
|
@@ -268,6 +268,9 @@ class LongContextRAG:
|
|
|
268
268
|
|
|
269
269
|
def _load_ignore_file(self):
|
|
270
270
|
serveignore_path = os.path.join(self.path, ".serveignore")
|
|
271
|
+
if not os.path.exists(serveignore_path):
|
|
272
|
+
serveignore_path = os.path.join(self.path, ".autocoderignore")
|
|
273
|
+
|
|
271
274
|
gitignore_path = os.path.join(self.path, ".gitignore")
|
|
272
275
|
|
|
273
276
|
if os.path.exists(serveignore_path):
|
|
@@ -838,8 +841,7 @@ class LongContextRAG:
|
|
|
838
841
|
self._print_rag_stats(rag_stat)
|
|
839
842
|
else:
|
|
840
843
|
|
|
841
|
-
qa_strategy = get_qa_strategy(
|
|
842
|
-
self.args.rag_qa_conversation_strategy)
|
|
844
|
+
qa_strategy = get_qa_strategy(self.args)
|
|
843
845
|
new_conversations = qa_strategy.create_conversation(
|
|
844
846
|
documents=[doc.source_code for doc in relevant_docs],
|
|
845
847
|
conversations=conversations, local_image_host=self.args.local_image_host
|