auto-coder 0.1.305__tar.gz → 0.1.307__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.305 → auto_coder-0.1.307}/PKG-INFO +1 -1
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/auto_coder.egg-info/PKG-INFO +1 -1
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/auto_coder.egg-info/SOURCES.txt +5 -1
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/agent/auto_demand_organizer.py +13 -20
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/agent/auto_filegroup.py +10 -16
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/agent/auto_learn_from_commit.py +25 -33
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/agent/auto_review_commit.py +15 -64
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/auto_coder.py +6 -8
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/auto_coder_runner.py +153 -8
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/chat_auto_coder.py +9 -1
- auto_coder-0.1.307/src/autocoder/chat_auto_coder_lang.py +573 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/commands/auto_command.py +31 -7
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/__init__.py +6 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/action_yml_file_manager.py +75 -37
- auto_coder-0.1.307/src/autocoder/common/auto_coder_lang.py +755 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/code_auto_generate.py +104 -16
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/code_auto_generate_diff.py +101 -10
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/code_auto_generate_editblock.py +103 -9
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/code_auto_generate_strict_diff.py +99 -9
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/code_auto_merge.py +8 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/code_auto_merge_diff.py +8 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/code_auto_merge_editblock.py +7 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/code_auto_merge_strict_diff.py +5 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/code_modification_ranker.py +9 -3
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/command_completer.py +12 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/command_generator.py +5 -4
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/git_utils.py +86 -63
- auto_coder-0.1.307/src/autocoder/common/stream_out_type.py +14 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/utils_code_auto_generate.py +29 -3
- auto_coder-0.1.307/src/autocoder/dispacher/__init__.py +29 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/dispacher/actions/action.py +0 -132
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/index/filter/quick_filter.py +6 -3
- auto_coder-0.1.307/src/autocoder/memory/__init__.py +7 -0
- auto_coder-0.1.307/src/autocoder/memory/active_context_manager.py +649 -0
- auto_coder-0.1.307/src/autocoder/memory/active_package.py +469 -0
- auto_coder-0.1.307/src/autocoder/memory/async_processor.py +161 -0
- auto_coder-0.1.307/src/autocoder/memory/directory_mapper.py +67 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/auto_coder_utils/chat_stream_out.py +5 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/project_structure.py +35 -1
- auto_coder-0.1.307/src/autocoder/version.py +1 -0
- auto_coder-0.1.305/src/autocoder/chat_auto_coder_lang.py +0 -299
- auto_coder-0.1.305/src/autocoder/common/auto_coder_lang.py +0 -419
- auto_coder-0.1.305/src/autocoder/common/stream_out_type.py +0 -7
- auto_coder-0.1.305/src/autocoder/dispacher/__init__.py +0 -30
- auto_coder-0.1.305/src/autocoder/dispacher/actions/plugins/action_translate.py +0 -214
- auto_coder-0.1.305/src/autocoder/version.py +0 -1
- {auto_coder-0.1.305 → auto_coder-0.1.307}/LICENSE +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/README.md +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/setup.cfg +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/setup.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/auto_coder.egg-info/dependency_links.txt +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/auto_coder.egg-info/entry_points.txt +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/auto_coder.egg-info/requires.txt +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/auto_coder.egg-info/top_level.txt +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/agent/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/agent/auto_guess_query.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/agent/auto_tool.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/agent/coder.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/agent/designer.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/agent/planner.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/agent/project_reader.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/auto_coder_rag.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/auto_coder_server.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/benchmark.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/chat/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/command_args.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/command_parser.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/commands/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/commands/auto_web.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/commands/tools.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/JupyterClient.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/ShellClient.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/anything2images.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/anything2img.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/audio.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/auto_configure.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/buildin_tokenizer.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/chunk_validation.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/cleaner.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/code_auto_execute.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/command_templates.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/computer_use.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/conf_import_export.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/conf_validator.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/const.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/context_pruner.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/conversation_pruner.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/files.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/global_cancel.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/image_to_page.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/index_import_export.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/interpreter.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/llm_rerank.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/mcp_hub.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/mcp_server.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/mcp_servers/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/mcp_servers/mcp_server_gpt4o_mini_search.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/mcp_servers/mcp_server_perplexity.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/mcp_tools.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/memory_manager.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/model_speed_test.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/printer.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/recall_validation.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/result_manager.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/screenshots.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/search.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/search_replace.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/shells.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/stats_panel.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/sys_prompt.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/text.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/common/types.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/data/byzerllm.md +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/data/tokenizer.json +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/db/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/db/store.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/dispacher/actions/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/dispacher/actions/copilot.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/dispacher/actions/plugins/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/dispacher/actions/plugins/action_regex_project.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/events/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/events/event_content.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/events/event_manager.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/events/event_manager_singleton.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/events/event_store.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/events/event_types.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/index/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/index/entry.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/index/filter/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/index/filter/normal_filter.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/index/for_command.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/index/index.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/index/symbols_utils.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/index/types.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/lang.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/models.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/plugins/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/plugins/dynamic_completion_example.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/plugins/git_helper_plugin.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/plugins/sample_plugin.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/plugins/token_helper_plugin.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/plugins/utils.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/privacy/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/privacy/model_filter.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/pyproject/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/api_server.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/cache/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/cache/base_cache.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/cache/byzer_storage_cache.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/cache/cache_result_merge.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/cache/file_monitor_cache.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/cache/local_byzer_storage_cache.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/cache/local_duckdb_storage_cache.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/cache/rag_file_meta.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/cache/simple_cache.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/conversation_to_queries.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/doc_filter.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/document_retriever.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/lang.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/llm_wrapper.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/loaders/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/loaders/docx_loader.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/loaders/excel_loader.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/loaders/pdf_loader.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/loaders/ppt_loader.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/long_context_rag.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/qa_conversation_strategy.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/rag_config.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/rag_entry.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/raw_rag.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/relevant_utils.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/searchable.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/simple_directory_reader.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/simple_rag.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/stream_event/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/stream_event/event_writer.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/stream_event/types.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/token_checker.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/token_counter.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/token_limiter.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/token_limiter_utils.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/types.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/utils.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/rag/variable_holder.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/regexproject/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/run_context.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/suffixproject/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/tsproject/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/_markitdown.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/auto_coder_utils/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/auto_project_type.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/chat_auto_coder_utils/__init__.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/conversation_store.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/llm_client_interceptors.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/llms.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/log_capture.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/model_provider_selector.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/multi_turn.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/operate_config_api.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/print_table.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/queue_communicate.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/request_event_queue.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/request_queue.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/rest.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/stream_thinking.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/tests.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/thread_utils.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/src/autocoder/utils/types.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/tests/test_action_regex_project.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/tests/test_action_yml_file_manager.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/tests/test_chat_auto_coder.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/tests/test_code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/tests/test_command_completer.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/tests/test_planner.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/tests/test_plugins.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/tests/test_privacy.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/tests/test_queue_communicate.py +0 -0
- {auto_coder-0.1.305 → auto_coder-0.1.307}/tests/test_symbols_utils.py +0 -0
|
@@ -106,7 +106,6 @@ src/autocoder/dispacher/actions/action.py
|
|
|
106
106
|
src/autocoder/dispacher/actions/copilot.py
|
|
107
107
|
src/autocoder/dispacher/actions/plugins/__init__.py
|
|
108
108
|
src/autocoder/dispacher/actions/plugins/action_regex_project.py
|
|
109
|
-
src/autocoder/dispacher/actions/plugins/action_translate.py
|
|
110
109
|
src/autocoder/events/__init__.py
|
|
111
110
|
src/autocoder/events/event_content.py
|
|
112
111
|
src/autocoder/events/event_manager.py
|
|
@@ -122,6 +121,11 @@ src/autocoder/index/types.py
|
|
|
122
121
|
src/autocoder/index/filter/__init__.py
|
|
123
122
|
src/autocoder/index/filter/normal_filter.py
|
|
124
123
|
src/autocoder/index/filter/quick_filter.py
|
|
124
|
+
src/autocoder/memory/__init__.py
|
|
125
|
+
src/autocoder/memory/active_context_manager.py
|
|
126
|
+
src/autocoder/memory/active_package.py
|
|
127
|
+
src/autocoder/memory/async_processor.py
|
|
128
|
+
src/autocoder/memory/directory_mapper.py
|
|
125
129
|
src/autocoder/plugins/__init__.py
|
|
126
130
|
src/autocoder/plugins/dynamic_completion_example.py
|
|
127
131
|
src/autocoder/plugins/git_helper_plugin.py
|
|
@@ -6,6 +6,8 @@ import byzerllm
|
|
|
6
6
|
import pydantic
|
|
7
7
|
import git
|
|
8
8
|
|
|
9
|
+
from autocoder.common.action_yml_file_manager import ActionYmlFileManager
|
|
10
|
+
|
|
9
11
|
|
|
10
12
|
class DemandItem(pydantic.BaseModel):
|
|
11
13
|
"""单个需求项"""
|
|
@@ -44,6 +46,7 @@ class AutoDemandOrganizer:
|
|
|
44
46
|
file_size_limit: 最多分析多少历史任务
|
|
45
47
|
"""
|
|
46
48
|
self.project_dir = project_dir
|
|
49
|
+
self.action_file_manager = ActionYmlFileManager(project_dir)
|
|
47
50
|
self.actions_dir = os.path.join(project_dir, "actions")
|
|
48
51
|
self.llm = llm
|
|
49
52
|
self.file_size_limit = file_size_limit
|
|
@@ -162,26 +165,16 @@ class AutoDemandOrganizer:
|
|
|
162
165
|
|
|
163
166
|
if query and urls:
|
|
164
167
|
commit_diff = ""
|
|
165
|
-
if not self.skip_diff:
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
parent = commit.parents[0]
|
|
176
|
-
commit_diff = repo.git.diff(
|
|
177
|
-
parent.hexsha, commit.hexsha)
|
|
178
|
-
else:
|
|
179
|
-
commit_diff = repo.git.show(commit.hexsha)
|
|
180
|
-
break
|
|
181
|
-
except git.exc.GitCommandError as e:
|
|
182
|
-
logger.error(f"Git命令执行错误: {str(e)}")
|
|
183
|
-
except Exception as e:
|
|
184
|
-
logger.error(f"获取commit diff时出错: {str(e)}")
|
|
168
|
+
if not self.skip_diff:
|
|
169
|
+
commit_id = self.action_file_manager.get_commit_id_from_file(yaml_file)
|
|
170
|
+
commit = repo.commit(commit_id)
|
|
171
|
+
if commit:
|
|
172
|
+
if commit.parents:
|
|
173
|
+
parent = commit.parents[0]
|
|
174
|
+
commit_diff = repo.git.diff(
|
|
175
|
+
parent.hexsha, commit.hexsha)
|
|
176
|
+
else:
|
|
177
|
+
commit_diff = repo.git.show(commit.hexsha)
|
|
185
178
|
|
|
186
179
|
querie_with_urls_and_diffs.append((query, urls, commit_diff))
|
|
187
180
|
|
|
@@ -4,6 +4,7 @@ import yaml
|
|
|
4
4
|
from loguru import logger
|
|
5
5
|
import byzerllm
|
|
6
6
|
import pydantic
|
|
7
|
+
from autocoder.common.action_yml_file_manager import ActionYmlFileManager
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class FileGroup(pydantic.BaseModel):
|
|
@@ -40,6 +41,7 @@ class AutoFileGroup:
|
|
|
40
41
|
actions_dir: 包含YAML文件的目录
|
|
41
42
|
"""
|
|
42
43
|
self.project_dir = project_dir
|
|
44
|
+
self.action_manager = ActionYmlFileManager(project_dir)
|
|
43
45
|
self.actions_dir = os.path.join(project_dir, "actions")
|
|
44
46
|
self.llm = llm
|
|
45
47
|
self.file_size_limit = file_size_limit
|
|
@@ -152,23 +154,15 @@ class AutoFileGroup:
|
|
|
152
154
|
commit_diff = ""
|
|
153
155
|
if not self.skip_diff:
|
|
154
156
|
# 计算文件的MD5用于匹配commit
|
|
155
|
-
|
|
156
|
-
|
|
157
|
+
commit_id = self.action_manager.get_commit_id_from_file(yaml_file)
|
|
158
|
+
commit = repo.commit(commit_id)
|
|
157
159
|
# 查找对应的commit
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
parent.hexsha, commit.hexsha)
|
|
165
|
-
else:
|
|
166
|
-
commit_diff = repo.git.show(commit.hexsha)
|
|
167
|
-
break
|
|
168
|
-
except git.exc.GitCommandError as e:
|
|
169
|
-
logger.error(f"Git命令执行错误: {str(e)}")
|
|
170
|
-
except Exception as e:
|
|
171
|
-
logger.error(f"获取commit diff时出错: {str(e)}")
|
|
160
|
+
if commit and commit.parents:
|
|
161
|
+
parent = commit.parents[0]
|
|
162
|
+
commit_diff = repo.git.diff(
|
|
163
|
+
parent.hexsha, commit.hexsha)
|
|
164
|
+
else:
|
|
165
|
+
commit_diff = repo.git.show(commit.hexsha)
|
|
172
166
|
|
|
173
167
|
querie_with_urls_and_diffs.append((query, urls, commit_diff))
|
|
174
168
|
|
|
@@ -37,6 +37,7 @@ class AutoLearnFromCommit:
|
|
|
37
37
|
skip_diff: 是否跳过获取 diff 信息
|
|
38
38
|
"""
|
|
39
39
|
self.project_dir = args.source_dir
|
|
40
|
+
self.args = args
|
|
40
41
|
self.actions_dir = os.path.join(args.source_dir, "actions")
|
|
41
42
|
self.llm = llm
|
|
42
43
|
self.skip_diff = skip_diff
|
|
@@ -120,40 +121,30 @@ class AutoLearnFromCommit:
|
|
|
120
121
|
if not self.skip_diff:
|
|
121
122
|
# 使用 ActionManager 获取 commit ID
|
|
122
123
|
commit_id = self.action_manager.get_commit_id_from_file(action_file)
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
before_content = repo.git.show(f"{parent.hexsha}:{file_path}")
|
|
138
|
-
except git.exc.GitCommandError:
|
|
139
|
-
pass # 文件可能是新增的
|
|
124
|
+
commit = repo.commit(commit_id)
|
|
125
|
+
if commit and commit.parents:
|
|
126
|
+
parent = commit.parents[0]
|
|
127
|
+
# 获取所有文件的前后内容
|
|
128
|
+
for diff_item in parent.diff(commit):
|
|
129
|
+
file_path = diff_item.a_path if diff_item.a_path else diff_item.b_path
|
|
130
|
+
|
|
131
|
+
# 获取变更前内容
|
|
132
|
+
before_content = None
|
|
133
|
+
try:
|
|
134
|
+
if diff_item.a_blob:
|
|
135
|
+
before_content = repo.git.show(f"{parent.hexsha}:{file_path}")
|
|
136
|
+
except git.exc.GitCommandError:
|
|
137
|
+
pass # 文件可能是新增的
|
|
140
138
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
139
|
+
# 获取变更后内容
|
|
140
|
+
after_content = None
|
|
141
|
+
try:
|
|
142
|
+
if diff_item.b_blob:
|
|
143
|
+
after_content = repo.git.show(f"{commit.hexsha}:{file_path}")
|
|
144
|
+
except git.exc.GitCommandError:
|
|
145
|
+
pass # 文件可能被删除
|
|
148
146
|
|
|
149
|
-
|
|
150
|
-
break
|
|
151
|
-
except git.exc.GitCommandError as e:
|
|
152
|
-
printer = Printer()
|
|
153
|
-
printer.print_in_terminal("git_command_error", style="red", error=str(e))
|
|
154
|
-
except Exception as e:
|
|
155
|
-
printer = Printer()
|
|
156
|
-
printer.print_in_terminal("get_commit_changes_error", style="red", error=str(e))
|
|
147
|
+
changes[file_path] = (before_content, after_content)
|
|
157
148
|
|
|
158
149
|
querie_with_urls_and_changes.append((query, urls, changes))
|
|
159
150
|
|
|
@@ -267,7 +258,8 @@ class AutoLearnFromCommit:
|
|
|
267
258
|
v = stream_chat_with_continue(
|
|
268
259
|
llm=self.llm,
|
|
269
260
|
conversations=new_conversations,
|
|
270
|
-
llm_config={}
|
|
261
|
+
llm_config={},
|
|
262
|
+
args=self.args
|
|
271
263
|
)
|
|
272
264
|
return v, commit_file_name
|
|
273
265
|
except Exception as e:
|
|
@@ -9,6 +9,7 @@ from autocoder.common.printer import Printer
|
|
|
9
9
|
from autocoder.common import AutoCoderArgs
|
|
10
10
|
from autocoder.common.utils_code_auto_generate import stream_chat_with_continue
|
|
11
11
|
import hashlib
|
|
12
|
+
from autocoder.common.action_yml_file_manager import ActionYmlFileManager
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
def load_yaml_config(yaml_file: str) -> Dict:
|
|
@@ -36,10 +37,12 @@ class AutoReviewCommit:
|
|
|
36
37
|
skip_diff: 是否跳过获取 diff 信息
|
|
37
38
|
"""
|
|
38
39
|
self.project_dir = args.source_dir
|
|
40
|
+
self.args = args
|
|
39
41
|
self.actions_dir = os.path.join(args.source_dir, "actions")
|
|
40
42
|
self.llm = llm
|
|
41
43
|
self.skip_diff = skip_diff
|
|
42
44
|
self.console = console or Console()
|
|
45
|
+
self.action_yml_manager = ActionYmlFileManager(source_dir=args.source_dir)
|
|
43
46
|
|
|
44
47
|
@byzerllm.prompt()
|
|
45
48
|
def review(self, querie_with_urls_and_changes: List[Tuple[str, List[str], Dict[str, Tuple[str, str]]]], query: str) -> Generator[str,None,None]:
|
|
@@ -140,66 +143,16 @@ class AutoReviewCommit:
|
|
|
140
143
|
action_files = sorted(action_files, key=get_seq)
|
|
141
144
|
action_files.reverse()
|
|
142
145
|
|
|
146
|
+
if not action_files:
|
|
147
|
+
return []
|
|
148
|
+
|
|
143
149
|
action_file = action_files[0]
|
|
144
|
-
|
|
145
150
|
querie_with_urls_and_changes = []
|
|
146
|
-
repo = git.Repo(self.project_dir)
|
|
147
|
-
|
|
148
|
-
# 收集所有query、urls和对应的文件变化
|
|
149
|
-
for yaml_file in [action_file]:
|
|
150
|
-
yaml_path = os.path.join(self.actions_dir, yaml_file)
|
|
151
|
-
config = load_yaml_config(yaml_path)
|
|
152
151
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
urls = config.get('urls', [])
|
|
158
|
-
|
|
159
|
-
if query:
|
|
160
|
-
changes = {}
|
|
161
|
-
if not self.skip_diff:
|
|
162
|
-
# 计算文件的MD5用于匹配commit
|
|
163
|
-
with open(yaml_path, 'r', encoding='utf-8') as f:
|
|
164
|
-
yaml_content = f.read()
|
|
165
|
-
file_md5 = hashlib.md5(yaml_content.encode("utf-8")).hexdigest()
|
|
166
|
-
response_id = f"auto_coder_{yaml_file}_{file_md5}"
|
|
167
|
-
# 查找对应的commit
|
|
168
|
-
try:
|
|
169
|
-
for commit in repo.iter_commits():
|
|
170
|
-
if response_id in commit.message:
|
|
171
|
-
if commit.parents:
|
|
172
|
-
parent = commit.parents[0]
|
|
173
|
-
# 获取所有文件的前后内容
|
|
174
|
-
for diff_item in parent.diff(commit):
|
|
175
|
-
file_path = diff_item.a_path if diff_item.a_path else diff_item.b_path
|
|
176
|
-
|
|
177
|
-
# 获取变更前内容
|
|
178
|
-
before_content = None
|
|
179
|
-
try:
|
|
180
|
-
if diff_item.a_blob:
|
|
181
|
-
before_content = repo.git.show(f"{parent.hexsha}:{file_path}")
|
|
182
|
-
except git.exc.GitCommandError:
|
|
183
|
-
pass # 文件可能是新增的
|
|
184
|
-
|
|
185
|
-
# 获取变更后内容
|
|
186
|
-
after_content = None
|
|
187
|
-
try:
|
|
188
|
-
if diff_item.b_blob:
|
|
189
|
-
after_content = repo.git.show(f"{commit.hexsha}:{file_path}")
|
|
190
|
-
except git.exc.GitCommandError:
|
|
191
|
-
pass # 文件可能被删除
|
|
192
|
-
|
|
193
|
-
changes[file_path] = (before_content, after_content)
|
|
194
|
-
break
|
|
195
|
-
except git.exc.GitCommandError as e:
|
|
196
|
-
printer = Printer()
|
|
197
|
-
printer.print_in_terminal("git_command_error", style="red", error=str(e))
|
|
198
|
-
except Exception as e:
|
|
199
|
-
printer = Printer()
|
|
200
|
-
printer.print_in_terminal("get_commit_changes_error", style="red", error=str(e))
|
|
201
|
-
|
|
202
|
-
querie_with_urls_and_changes.append((query, urls, changes))
|
|
152
|
+
# 使用ActionYmlFileManager获取提交变更
|
|
153
|
+
changes = self.action_yml_manager.get_commit_changes(action_file)
|
|
154
|
+
if changes:
|
|
155
|
+
querie_with_urls_and_changes = changes
|
|
203
156
|
|
|
204
157
|
return querie_with_urls_and_changes
|
|
205
158
|
|
|
@@ -288,14 +241,11 @@ class AutoReviewCommit:
|
|
|
288
241
|
printer = Printer()
|
|
289
242
|
commit_file_name = None
|
|
290
243
|
if commit_id:
|
|
244
|
+
# 利用ActionYmlFileManager获取文件名
|
|
291
245
|
repo = git.Repo(self.project_dir)
|
|
292
246
|
commit = repo.commit(commit_id)
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
commit_file_info = msg.split("_")[0]
|
|
296
|
-
if commit_file_info.startswith("auto_coder_"):
|
|
297
|
-
commit_file_name = "_".join(msg.split("_",)[0:-1])
|
|
298
|
-
|
|
247
|
+
commit_file_name = self.action_yml_manager.get_file_name_from_commit_msg(commit.message)
|
|
248
|
+
|
|
299
249
|
if not commit_file_name:
|
|
300
250
|
raise ValueError(printer.get_message_from_key_with_format("no_commit_file_name",commit_id=commit_id))
|
|
301
251
|
|
|
@@ -315,7 +265,8 @@ class AutoReviewCommit:
|
|
|
315
265
|
v = stream_chat_with_continue(
|
|
316
266
|
llm=self.llm,
|
|
317
267
|
conversations=new_conversations,
|
|
318
|
-
llm_config={}
|
|
268
|
+
llm_config={},
|
|
269
|
+
args=self.args
|
|
319
270
|
)
|
|
320
271
|
return v
|
|
321
272
|
except Exception as e:
|
|
@@ -27,7 +27,6 @@ from autocoder.utils.rest import HttpDoc
|
|
|
27
27
|
from byzerllm.apps.byzer_storage.env import get_latest_byzer_retrieval_lib
|
|
28
28
|
from autocoder.command_args import parse_args
|
|
29
29
|
from autocoder.rag.api_server import serve, ServerArgs
|
|
30
|
-
from autocoder.utils import open_yaml_file_in_editor, get_last_yaml_file
|
|
31
30
|
from autocoder.utils.request_queue import (
|
|
32
31
|
request_queue,
|
|
33
32
|
RequestValue,
|
|
@@ -120,12 +119,10 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
120
119
|
# args.request_id = str(uuid.uuid4())
|
|
121
120
|
|
|
122
121
|
if raw_args.command == "revert":
|
|
123
|
-
repo_path = args.source_dir
|
|
124
|
-
|
|
125
122
|
file_name = os.path.basename(args.file)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
action_file_manager = ActionYmlFileManager(source_dir=args.source_dir)
|
|
124
|
+
revert_result = action_file_manager.revert_file(file_name)
|
|
125
|
+
|
|
129
126
|
if revert_result:
|
|
130
127
|
print(f"Successfully reverted changes for {args.file}")
|
|
131
128
|
else:
|
|
@@ -945,7 +942,7 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
945
942
|
|
|
946
943
|
console = Console()
|
|
947
944
|
|
|
948
|
-
shell_script = generate_shell_script(args
|
|
945
|
+
shell_script = generate_shell_script(args, llm)
|
|
949
946
|
|
|
950
947
|
console.print(
|
|
951
948
|
Panel(
|
|
@@ -1340,7 +1337,8 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
1340
1337
|
v = stream_chat_with_continue(
|
|
1341
1338
|
llm=chat_llm,
|
|
1342
1339
|
conversations=loaded_conversations,
|
|
1343
|
-
llm_config={}
|
|
1340
|
+
llm_config={},
|
|
1341
|
+
args=args
|
|
1344
1342
|
)
|
|
1345
1343
|
|
|
1346
1344
|
|
|
@@ -17,6 +17,7 @@ from contextlib import contextmanager
|
|
|
17
17
|
from typing import List, Dict, Any, Optional
|
|
18
18
|
from autocoder.common import AutoCoderArgs
|
|
19
19
|
from pydantic import BaseModel
|
|
20
|
+
from autocoder.common.action_yml_file_manager import ActionYmlFileManager
|
|
20
21
|
from autocoder.common.result_manager import ResultManager
|
|
21
22
|
from autocoder.version import __version__
|
|
22
23
|
from autocoder.auto_coder import main as auto_coder_main
|
|
@@ -49,10 +50,12 @@ from autocoder.utils.llms import get_single_llm
|
|
|
49
50
|
import pkg_resources
|
|
50
51
|
from autocoder.common.printer import Printer
|
|
51
52
|
from autocoder.utils.thread_utils import run_in_raw_thread
|
|
53
|
+
from autocoder.memory.active_context_manager import ActiveContextManager
|
|
52
54
|
from autocoder.common.command_completer import CommandCompleter,FileSystemModel as CCFileSystemModel,MemoryConfig as CCMemoryModel
|
|
53
55
|
from autocoder.common.conf_validator import ConfigValidator
|
|
54
56
|
from autocoder import command_parser as CommandParser
|
|
55
57
|
from loguru import logger
|
|
58
|
+
from autocoder.utils.project_structure import EnhancedFileAnalyzer
|
|
56
59
|
|
|
57
60
|
class SymbolItem(BaseModel):
|
|
58
61
|
symbol_name: str
|
|
@@ -168,9 +171,10 @@ def configure_project_type():
|
|
|
168
171
|
print_info(get_message("examples"))
|
|
169
172
|
|
|
170
173
|
print_warning(f"{get_message('default_type')}\n")
|
|
171
|
-
|
|
174
|
+
|
|
175
|
+
extensions = get_all_extensions(project_root) or "py"
|
|
172
176
|
project_type = prompt(
|
|
173
|
-
get_message("enter_project_type"), default=
|
|
177
|
+
get_message("enter_project_type"), default=extensions, style=style
|
|
174
178
|
).strip()
|
|
175
179
|
|
|
176
180
|
if project_type:
|
|
@@ -186,6 +190,32 @@ def configure_project_type():
|
|
|
186
190
|
return project_type
|
|
187
191
|
|
|
188
192
|
|
|
193
|
+
def get_all_extensions(directory: str = ".") -> str:
|
|
194
|
+
"""获取指定目录下所有文件的后缀名,多个按逗号分隔,并且带."""
|
|
195
|
+
args = AutoCoderArgs(
|
|
196
|
+
source_dir=directory,
|
|
197
|
+
# 其他必要参数设置为默认值
|
|
198
|
+
target_file="",
|
|
199
|
+
git_url="",
|
|
200
|
+
project_type="",
|
|
201
|
+
conversation_prune_safe_zone_tokens=0
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
analyzer = EnhancedFileAnalyzer(
|
|
205
|
+
args=args,
|
|
206
|
+
llm=None, # 如果只是获取后缀名,可以不需要LLM
|
|
207
|
+
config=None # 使用默认配置
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
# 获取分析结果
|
|
211
|
+
analysis_result = analyzer.analyze_extensions()
|
|
212
|
+
|
|
213
|
+
# 合并 code 和 config 的后缀名
|
|
214
|
+
all_extensions = set(analysis_result["code"] + analysis_result["config"])
|
|
215
|
+
|
|
216
|
+
# 转换为逗号分隔的字符串
|
|
217
|
+
return ",".join(sorted(all_extensions))
|
|
218
|
+
|
|
189
219
|
def initialize_system(args:InitializeSystemRequest):
|
|
190
220
|
from autocoder.utils.model_provider_selector import ModelProviderSelector
|
|
191
221
|
from autocoder import models as models_module
|
|
@@ -666,9 +696,7 @@ def revert():
|
|
|
666
696
|
|
|
667
697
|
if "Successfully reverted changes" in s:
|
|
668
698
|
result_manager.append(content=s, meta={"action": "revert","success":False, "input":{
|
|
669
|
-
}})
|
|
670
|
-
|
|
671
|
-
os.remove(file_path)
|
|
699
|
+
}})
|
|
672
700
|
else:
|
|
673
701
|
result_manager.append(content=s, meta={"action": "revert","success":False, "input":{
|
|
674
702
|
}})
|
|
@@ -1399,12 +1427,33 @@ def commit(query: str):
|
|
|
1399
1427
|
with open(os.path.join(execute_file), "w",encoding="utf-8") as f:
|
|
1400
1428
|
f.write(yaml_content)
|
|
1401
1429
|
|
|
1402
|
-
|
|
1403
|
-
|
|
1430
|
+
args.file = execute_file
|
|
1431
|
+
|
|
1404
1432
|
file_name = os.path.basename(execute_file)
|
|
1405
1433
|
commit_result = git_utils.commit_changes(
|
|
1406
1434
|
".", f"{commit_message}\nauto_coder_{file_name}"
|
|
1407
1435
|
)
|
|
1436
|
+
|
|
1437
|
+
printer = Printer()
|
|
1438
|
+
|
|
1439
|
+
action_yml_file_manager = ActionYmlFileManager(args.source_dir)
|
|
1440
|
+
action_file_name = os.path.basename(args.file)
|
|
1441
|
+
add_updated_urls = []
|
|
1442
|
+
commit_result.changed_files
|
|
1443
|
+
for file in commit_result.changed_files:
|
|
1444
|
+
add_updated_urls.append(os.path.join(args.source_dir, file))
|
|
1445
|
+
|
|
1446
|
+
args.add_updated_urls = add_updated_urls
|
|
1447
|
+
update_yaml_success = action_yml_file_manager.update_yaml_field(action_file_name, "add_updated_urls", add_updated_urls)
|
|
1448
|
+
if not update_yaml_success:
|
|
1449
|
+
printer.print_in_terminal("yaml_save_error", style="red", yaml_file=action_file_name)
|
|
1450
|
+
|
|
1451
|
+
if args.enable_active_context:
|
|
1452
|
+
active_context_manager = ActiveContextManager(llm, args.source_dir)
|
|
1453
|
+
task_id = active_context_manager.process_changes(args)
|
|
1454
|
+
printer.print_in_terminal("active_context_background_task",
|
|
1455
|
+
style="blue",
|
|
1456
|
+
task_id=task_id)
|
|
1408
1457
|
git_utils.print_commit_info(commit_result=commit_result)
|
|
1409
1458
|
if commit_message:
|
|
1410
1459
|
printer.print_in_terminal("commit_message", style="green", model_name=target_model, message=commit_message)
|
|
@@ -1417,7 +1466,7 @@ def commit(query: str):
|
|
|
1417
1466
|
|
|
1418
1467
|
|
|
1419
1468
|
@run_in_raw_thread()
|
|
1420
|
-
def coding(query: str):
|
|
1469
|
+
def coding(query: str):
|
|
1421
1470
|
console = Console()
|
|
1422
1471
|
is_apply = query.strip().startswith("/apply")
|
|
1423
1472
|
if is_apply:
|
|
@@ -1756,6 +1805,102 @@ def design(query: str):
|
|
|
1756
1805
|
os.remove(execute_file)
|
|
1757
1806
|
|
|
1758
1807
|
|
|
1808
|
+
@run_in_raw_thread()
|
|
1809
|
+
def active_context(query: str):
|
|
1810
|
+
"""
|
|
1811
|
+
管理活动上下文任务,支持列表、查询等操作
|
|
1812
|
+
|
|
1813
|
+
Args:
|
|
1814
|
+
query: 命令参数,例如 "list" 列出所有任务
|
|
1815
|
+
"""
|
|
1816
|
+
# 解析命令
|
|
1817
|
+
commands_infos = CommandParser.parse_query(query)
|
|
1818
|
+
command = "list" # 默认命令是列出所有任务
|
|
1819
|
+
|
|
1820
|
+
if len(commands_infos) > 0:
|
|
1821
|
+
if "list" in commands_infos:
|
|
1822
|
+
command = "list"
|
|
1823
|
+
if "run" in commands_infos:
|
|
1824
|
+
command = "run"
|
|
1825
|
+
|
|
1826
|
+
args = get_final_config()
|
|
1827
|
+
printer = Printer()
|
|
1828
|
+
# 获取LLM实例
|
|
1829
|
+
llm = get_single_llm(args.model,product_mode=args.product_mode)
|
|
1830
|
+
action_file_manager = ActionYmlFileManager(args.source_dir)
|
|
1831
|
+
|
|
1832
|
+
# 获取配置和参数
|
|
1833
|
+
|
|
1834
|
+
|
|
1835
|
+
active_context_manager = ActiveContextManager(llm, args.source_dir)
|
|
1836
|
+
if command == "run":
|
|
1837
|
+
file_name = commands_infos["run"]["args"][-1]
|
|
1838
|
+
args.file = action_file_manager.get_full_path_by_file_name(file_name)
|
|
1839
|
+
## 因为更新了args.file
|
|
1840
|
+
active_context_manager = ActiveContextManager(llm, args.source_dir)
|
|
1841
|
+
task_id = active_context_manager.process_changes(args)
|
|
1842
|
+
printer.print_in_terminal("active_context_background_task",
|
|
1843
|
+
style="blue",
|
|
1844
|
+
task_id=task_id)
|
|
1845
|
+
|
|
1846
|
+
# 处理不同的命令
|
|
1847
|
+
if command == "list":
|
|
1848
|
+
# 获取所有任务
|
|
1849
|
+
all_tasks = active_context_manager.get_all_tasks()
|
|
1850
|
+
|
|
1851
|
+
if not all_tasks:
|
|
1852
|
+
console = Console()
|
|
1853
|
+
console.print("[yellow]没有找到任何活动上下文任务[/yellow]")
|
|
1854
|
+
return
|
|
1855
|
+
|
|
1856
|
+
# 创建表格
|
|
1857
|
+
table = Table(title="活动上下文任务列表")
|
|
1858
|
+
table.add_column("任务ID", style="cyan")
|
|
1859
|
+
table.add_column("状态", style="green")
|
|
1860
|
+
table.add_column("开始时间", style="yellow")
|
|
1861
|
+
table.add_column("完成时间", style="yellow")
|
|
1862
|
+
table.add_column("文件", style="blue")
|
|
1863
|
+
|
|
1864
|
+
# 添加任务数据
|
|
1865
|
+
for task in all_tasks:
|
|
1866
|
+
status = task.get("status", "未知")
|
|
1867
|
+
status_display = status
|
|
1868
|
+
|
|
1869
|
+
# 根据状态设置不同的显示样式
|
|
1870
|
+
if status == "completed":
|
|
1871
|
+
status_display = "[green]已完成[/green]"
|
|
1872
|
+
elif status == "running":
|
|
1873
|
+
status_display = "[blue]运行中[/blue]"
|
|
1874
|
+
elif status == "queued":
|
|
1875
|
+
position = task.get("queue_position", 0)
|
|
1876
|
+
status_display = f"[yellow]排队中 (位置: {position})[/yellow]"
|
|
1877
|
+
elif status == "failed":
|
|
1878
|
+
status_display = "[red]失败[/red]"
|
|
1879
|
+
|
|
1880
|
+
# 格式化时间
|
|
1881
|
+
start_time = task.get("start_time", "")
|
|
1882
|
+
start_time_str = start_time.strftime("%Y-%m-%d %H:%M:%S") if start_time else "未知"
|
|
1883
|
+
|
|
1884
|
+
completion_time = task.get("completion_time", "")
|
|
1885
|
+
completion_time_str = completion_time.strftime("%Y-%m-%d %H:%M:%S") if completion_time else "-"
|
|
1886
|
+
|
|
1887
|
+
# 获取文件名
|
|
1888
|
+
file_name = task.get("file_name", "未知")
|
|
1889
|
+
|
|
1890
|
+
# 添加到表格
|
|
1891
|
+
table.add_row(
|
|
1892
|
+
task.get("task_id", "未知"),
|
|
1893
|
+
status_display,
|
|
1894
|
+
start_time_str,
|
|
1895
|
+
completion_time_str,
|
|
1896
|
+
file_name
|
|
1897
|
+
)
|
|
1898
|
+
|
|
1899
|
+
# 显示表格
|
|
1900
|
+
console = Console()
|
|
1901
|
+
console.print(table)
|
|
1902
|
+
|
|
1903
|
+
|
|
1759
1904
|
def voice_input():
|
|
1760
1905
|
conf = memory.get("conf", {})
|
|
1761
1906
|
yaml_config = {
|
|
@@ -49,6 +49,7 @@ from autocoder.auto_coder_runner import (
|
|
|
49
49
|
completer,
|
|
50
50
|
summon,
|
|
51
51
|
get_memory,
|
|
52
|
+
active_context,
|
|
52
53
|
)
|
|
53
54
|
|
|
54
55
|
# Create a global plugin manager
|
|
@@ -63,6 +64,7 @@ original_functions = {
|
|
|
63
64
|
"voice_input": voice_input,
|
|
64
65
|
"auto_command": auto_command,
|
|
65
66
|
"execute_shell_command": execute_shell_command,
|
|
67
|
+
"active_context": active_context,
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
|
|
@@ -149,6 +151,7 @@ def show_help():
|
|
|
149
151
|
print(f" \033[94m/lib\033[0m - \033[92m{get_message('lib_desc')}\033[0m")
|
|
150
152
|
print(f" \033[94m/models\033[0m - \033[92m{get_message('models_desc')}\033[0m")
|
|
151
153
|
print(f" \033[94m/plugins\033[0m - \033[92m{get_message('plugins_desc')}\033[0m")
|
|
154
|
+
print(f" \033[94m/active_context\033[0m - \033[92m{get_message('active_context_desc')}\033[0m")
|
|
152
155
|
print(f" \033[94m/exit\033[0m - \033[92m{get_message('exit_desc')}\033[0m")
|
|
153
156
|
print()
|
|
154
157
|
|
|
@@ -423,13 +426,14 @@ def main():
|
|
|
423
426
|
)
|
|
424
427
|
|
|
425
428
|
# Replace original functions with wrapped versions
|
|
426
|
-
global ask, coding, chat, design, voice_input, auto_command, execute_shell_command
|
|
429
|
+
global ask, coding, chat, design, voice_input, auto_command, execute_shell_command, active_context
|
|
427
430
|
ask = wrapped_functions.get("ask", ask)
|
|
428
431
|
coding = wrapped_functions.get("coding", coding)
|
|
429
432
|
chat = wrapped_functions.get("chat", chat)
|
|
430
433
|
design = wrapped_functions.get("design", design)
|
|
431
434
|
voice_input = wrapped_functions.get("voice_input", voice_input)
|
|
432
435
|
auto_command = wrapped_functions.get("auto_command", auto_command)
|
|
436
|
+
active_context = wrapped_functions.get("active_context", active_context)
|
|
433
437
|
execute_shell_command = wrapped_functions.get(
|
|
434
438
|
"execute_shell_command", execute_shell_command
|
|
435
439
|
)
|
|
@@ -620,6 +624,10 @@ def main():
|
|
|
620
624
|
print("Please enter your query.")
|
|
621
625
|
else:
|
|
622
626
|
mcp(query)
|
|
627
|
+
|
|
628
|
+
elif user_input.startswith("/active_context"):
|
|
629
|
+
query = user_input[len("/active_context") :].strip()
|
|
630
|
+
active_context(query)
|
|
623
631
|
|
|
624
632
|
elif user_input.startswith("/auto"):
|
|
625
633
|
query = user_input[len("/auto") :].strip()
|