auto-coder 0.1.270__tar.gz → 0.1.271__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.270 → auto_coder-0.1.271}/PKG-INFO +1 -1
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/auto_coder.egg-info/PKG-INFO +1 -1
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/commands/auto_command.py +33 -5
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/commands/tools.py +28 -15
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/auto_coder_lang.py +5 -1
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/command_generator.py +3 -1
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/files.py +44 -10
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/shells.py +68 -0
- auto_coder-0.1.271/src/autocoder/version.py +1 -0
- auto_coder-0.1.270/src/autocoder/version.py +0 -1
- {auto_coder-0.1.270 → auto_coder-0.1.271}/LICENSE +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/README.md +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/setup.cfg +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/setup.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/auto_coder.egg-info/SOURCES.txt +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/auto_coder.egg-info/dependency_links.txt +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/auto_coder.egg-info/entry_points.txt +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/auto_coder.egg-info/requires.txt +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/auto_coder.egg-info/top_level.txt +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/agent/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/agent/auto_demand_organizer.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/agent/auto_filegroup.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/agent/auto_guess_query.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/agent/auto_learn_from_commit.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/agent/auto_review_commit.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/agent/auto_tool.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/agent/coder.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/agent/designer.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/agent/planner.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/agent/project_reader.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/auto_coder.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/auto_coder_rag.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/auto_coder_rag_client_mcp.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/auto_coder_rag_mcp.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/auto_coder_runner.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/auto_coder_server.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/benchmark.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/chat/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/chat_auto_coder.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/chat_auto_coder_lang.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/command_args.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/commands/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/JupyterClient.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/ShellClient.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/anything2images.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/anything2img.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/audio.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/auto_configure.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/buildin_tokenizer.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/chunk_validation.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/cleaner.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/code_auto_execute.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/code_auto_generate.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/code_auto_generate_diff.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/code_auto_generate_editblock.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/code_auto_generate_strict_diff.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/code_auto_merge.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/code_auto_merge_diff.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/code_auto_merge_strict_diff.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/code_modification_ranker.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/command_completer.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/command_templates.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/conf_import_export.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/conf_validator.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/const.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/context_pruner.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/conversation_pruner.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/git_utils.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/global_cancel.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/image_to_page.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/index_import_export.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/interpreter.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/llm_rerank.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/mcp_hub.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/mcp_server.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/mcp_servers/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/mcp_servers/mcp_server_perplexity.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/mcp_tools.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/memory_manager.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/model_speed_test.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/printer.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/recall_validation.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/result_manager.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/screenshots.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/search.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/search_replace.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/stats_panel.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/sys_prompt.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/text.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/types.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/utils_code_auto_generate.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/data/byzerllm.md +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/data/tokenizer.json +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/db/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/db/store.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/dispacher/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/dispacher/actions/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/dispacher/actions/action.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/dispacher/actions/copilot.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/dispacher/actions/plugins/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/dispacher/actions/plugins/action_regex_project.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/dispacher/actions/plugins/action_translate.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/index/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/index/entry.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/index/filter/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/index/filter/normal_filter.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/index/filter/quick_filter.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/index/for_command.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/index/index.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/index/symbols_utils.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/index/types.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/lang.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/models.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/privacy/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/privacy/model_filter.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/pyproject/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/api_server.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/cache/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/cache/base_cache.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/cache/byzer_storage_cache.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/cache/file_monitor_cache.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/cache/simple_cache.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/doc_filter.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/document_retriever.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/llm_wrapper.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/loaders/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/loaders/docx_loader.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/loaders/excel_loader.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/loaders/pdf_loader.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/loaders/ppt_loader.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/long_context_rag.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/rag_config.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/rag_entry.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/raw_rag.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/relevant_utils.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/simple_directory_reader.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/simple_rag.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/stream_event/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/stream_event/event_writer.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/stream_event/types.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/token_checker.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/token_counter.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/token_limiter.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/types.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/utils.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/rag/variable_holder.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/regexproject/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/suffixproject/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/tsproject/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/_markitdown.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/auto_coder_utils/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/auto_coder_utils/chat_stream_out.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/auto_project_type.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/chat_auto_coder_utils/__init__.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/conversation_store.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/llm_client_interceptors.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/llms.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/log_capture.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/model_provider_selector.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/multi_turn.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/operate_config_api.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/print_table.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/project_structure.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/queue_communicate.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/request_event_queue.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/request_queue.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/rest.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/tests.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/thread_utils.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/types.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/tests/test_action_regex_project.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/tests/test_chat_auto_coder.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/tests/test_code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/tests/test_command_completer.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/tests/test_planner.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/tests/test_privacy.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/tests/test_queue_communicate.py +0 -0
- {auto_coder-0.1.270 → auto_coder-0.1.271}/tests/test_symbols_utils.py +0 -0
|
@@ -171,15 +171,21 @@ class CommandAutoTuner:
|
|
|
171
171
|
当前用户环境信息如下:
|
|
172
172
|
<os_info>
|
|
173
173
|
操作系统: {{ env_info.os_name }} {{ env_info.os_version }}
|
|
174
|
+
操作系统发行版: {{ os_distribution }}
|
|
174
175
|
Python版本: {{ env_info.python_version }}
|
|
175
176
|
终端类型: {{ env_info.shell_type }}
|
|
176
177
|
终端编码: {{ env_info.shell_encoding }}
|
|
178
|
+
|
|
179
|
+
{%- if shell_type %}
|
|
180
|
+
脚本类型:{{ shell_type }}
|
|
181
|
+
{%- endif %}
|
|
182
|
+
|
|
177
183
|
{%- if env_info.conda_env %}
|
|
178
184
|
Conda环境: {{ env_info.conda_env }}
|
|
179
185
|
{%- endif %}
|
|
180
186
|
{%- if env_info.virtualenv %}
|
|
181
187
|
虚拟环境: {{ env_info.virtualenv }}
|
|
182
|
-
{%- endif %}
|
|
188
|
+
{%- endif %}
|
|
183
189
|
</os_info>
|
|
184
190
|
|
|
185
191
|
我们的目标是根据用户输入和当前上下文,组合多个函数来完成用户的需求。
|
|
@@ -221,6 +227,7 @@ class CommandAutoTuner:
|
|
|
221
227
|
每个文件的tokens数,你可以根据这个信息来决定如何读取这个文件。比如对于很小的文件,那么可以直接全部读取,
|
|
222
228
|
而对于分析一个超大文件推荐组合 read_files 带上 line_ranges 参数来读取,或者组合 read_file_withread_file_with_keyword_ranges 等来读取,
|
|
223
229
|
每个函数你还可以使用多次来获取更多信息。
|
|
230
|
+
9. 根据操作系统,终端类型,脚本类型等各种信息,在涉及到路径或者脚本的时候,需要考虑平台差异性。
|
|
224
231
|
</function_combination_readme>
|
|
225
232
|
|
|
226
233
|
|
|
@@ -260,7 +267,13 @@ class CommandAutoTuner:
|
|
|
260
267
|
满足需求。
|
|
261
268
|
"""
|
|
262
269
|
|
|
263
|
-
env_info = detect_env()
|
|
270
|
+
env_info = detect_env()
|
|
271
|
+
shell_type = "bash"
|
|
272
|
+
if shells.is_running_in_cmd():
|
|
273
|
+
shell_type = "cmd"
|
|
274
|
+
elif shells.is_running_in_powershell():
|
|
275
|
+
shell_type = "powershell"
|
|
276
|
+
|
|
264
277
|
return {
|
|
265
278
|
"user_input": request.user_input,
|
|
266
279
|
"current_files": self.memory_config.memory["current_files"]["files"],
|
|
@@ -268,9 +281,10 @@ class CommandAutoTuner:
|
|
|
268
281
|
"available_commands": self._command_readme.prompt(),
|
|
269
282
|
"current_conf": json.dumps(self.memory_config.memory["conf"], indent=2),
|
|
270
283
|
"env_info": env_info,
|
|
271
|
-
"shell_type":
|
|
284
|
+
"shell_type": shell_type,
|
|
272
285
|
"shell_encoding": shells.get_terminal_encoding(),
|
|
273
|
-
"conversation_safe_zone_tokens": self.args.conversation_prune_safe_zone_tokens
|
|
286
|
+
"conversation_safe_zone_tokens": self.args.conversation_prune_safe_zone_tokens,
|
|
287
|
+
"os_distribution": shells.get_os_distribution()
|
|
274
288
|
}
|
|
275
289
|
|
|
276
290
|
@byzerllm.prompt()
|
|
@@ -1179,6 +1193,18 @@ class CommandAutoTuner:
|
|
|
1179
1193
|
此时会返回诸如 "ts,py,java,go,js,ts" 这样的字符串,表示项目类型。
|
|
1180
1194
|
</usage>
|
|
1181
1195
|
</command>
|
|
1196
|
+
|
|
1197
|
+
<command>
|
|
1198
|
+
<name>response_user</name>
|
|
1199
|
+
<description>响应用户。</description>
|
|
1200
|
+
<usage>
|
|
1201
|
+
如果你需要直接发送信息给用户,那么可以通过 response_user 函数来直接回复用户。
|
|
1202
|
+
|
|
1203
|
+
比如用户问你是谁?
|
|
1204
|
+
你可以通过如下方式来回答:
|
|
1205
|
+
response_user(response="你好,我是 auto-coder")
|
|
1206
|
+
</usage>
|
|
1207
|
+
</command>
|
|
1182
1208
|
</commands>
|
|
1183
1209
|
|
|
1184
1210
|
|
|
@@ -1224,7 +1250,9 @@ class CommandAutoTuner:
|
|
|
1224
1250
|
"get_project_related_files": self.tools.get_project_related_files,
|
|
1225
1251
|
"ask_user":self.tools.ask_user,
|
|
1226
1252
|
"read_file_with_keyword_ranges": self.tools.read_file_with_keyword_ranges,
|
|
1227
|
-
"get_project_type": self.project_type_analyzer.analyze,
|
|
1253
|
+
"get_project_type": self.project_type_analyzer.analyze,
|
|
1254
|
+
"response_user": self.tools.response_user,
|
|
1255
|
+
|
|
1228
1256
|
}
|
|
1229
1257
|
|
|
1230
1258
|
if command not in command_map:
|
|
@@ -28,6 +28,10 @@ from autocoder.utils.queue_communicate import (
|
|
|
28
28
|
import sys
|
|
29
29
|
import io
|
|
30
30
|
from autocoder.common import files as files_utils
|
|
31
|
+
from autocoder.common.printer import Printer
|
|
32
|
+
from prompt_toolkit import PromptSession
|
|
33
|
+
from prompt_toolkit.styles import Style
|
|
34
|
+
|
|
31
35
|
|
|
32
36
|
@byzerllm.prompt()
|
|
33
37
|
def detect_rm_command(command: str) -> Bool:
|
|
@@ -56,6 +60,7 @@ class AutoCommandTools:
|
|
|
56
60
|
self.args = args
|
|
57
61
|
self.llm = llm
|
|
58
62
|
self.result_manager = ResultManager()
|
|
63
|
+
self.printer = Printer()
|
|
59
64
|
|
|
60
65
|
def ask_user(self,question:str) -> str:
|
|
61
66
|
'''
|
|
@@ -91,35 +96,43 @@ class AutoCommandTools:
|
|
|
91
96
|
)
|
|
92
97
|
|
|
93
98
|
# 显示问题面板
|
|
94
|
-
console.print(question_panel)
|
|
99
|
+
console.print(question_panel)
|
|
95
100
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
session = PromptSession( message=self.printer.get_message_from_key('tool_ask_user'))
|
|
102
|
+
try:
|
|
103
|
+
answer = session.prompt()
|
|
104
|
+
except KeyboardInterrupt:
|
|
105
|
+
answer = ""
|
|
101
106
|
|
|
102
|
-
|
|
103
|
-
|
|
107
|
+
self.result_manager.append(content=answer, meta = {
|
|
108
|
+
"action": "ask_user",
|
|
109
|
+
"input": {
|
|
110
|
+
"question": question
|
|
111
|
+
}
|
|
112
|
+
})
|
|
104
113
|
|
|
105
|
-
|
|
106
|
-
|
|
114
|
+
return answer
|
|
115
|
+
|
|
116
|
+
def response_user(self, response: str):
|
|
117
|
+
console = Console()
|
|
118
|
+
answer_text = Text(response, style="italic")
|
|
107
119
|
answer_panel = Panel(
|
|
108
120
|
answer_text,
|
|
109
|
-
title="
|
|
121
|
+
title="",
|
|
110
122
|
border_style="green",
|
|
111
123
|
expand=False
|
|
112
124
|
)
|
|
113
125
|
console.print(answer_panel)
|
|
114
126
|
|
|
115
|
-
self.result_manager.append(content=
|
|
116
|
-
"action": "
|
|
127
|
+
self.result_manager.append(content=response, meta = {
|
|
128
|
+
"action": "response_user",
|
|
117
129
|
"input": {
|
|
118
|
-
"
|
|
130
|
+
"response": response
|
|
119
131
|
}
|
|
120
132
|
})
|
|
121
133
|
|
|
122
|
-
return
|
|
134
|
+
return response
|
|
135
|
+
|
|
123
136
|
|
|
124
137
|
def run_python_code(self, code: str) -> str:
|
|
125
138
|
"""
|
|
@@ -170,6 +170,8 @@ MESSAGES = {
|
|
|
170
170
|
"sorted_files_message": "Reordered files:\n{% for file in files %}- {{ file }}\n{% endfor %}",
|
|
171
171
|
"estimated_input_tokens_in_ranking": "estimate input token {{ estimated_input_tokens }} when ranking",
|
|
172
172
|
"file_snippet_procesed": "{{ file_path }} processed with tokens: {{ tokens }} => {{ snippet_tokens }}. Current total tokens: {{ total_tokens }}",
|
|
173
|
+
"tool_ask_user": "Your Reply: ",
|
|
174
|
+
"tool_ask_user_accept":"Your Response received",
|
|
173
175
|
|
|
174
176
|
},
|
|
175
177
|
"zh": {
|
|
@@ -337,7 +339,9 @@ MESSAGES = {
|
|
|
337
339
|
"rank_code_modification_title": "模型{{model_name}}对代码打分",
|
|
338
340
|
"sorted_files_message": "重新排序后的文件路径:\n{% for file in files %}- {{ file }}\n{% endfor %}",
|
|
339
341
|
"estimated_input_tokens_in_ranking": "排序预计输入token数: {{ estimated_input_tokens }}",
|
|
340
|
-
"file_snippet_procesed": "文件 {{ file_path }} 处理后token数: {{ tokens }} => {{ snippet_tokens }} 当前总token数: {{ total_tokens }}"
|
|
342
|
+
"file_snippet_procesed": "文件 {{ file_path }} 处理后token数: {{ tokens }} => {{ snippet_tokens }} 当前总token数: {{ total_tokens }}",
|
|
343
|
+
"tool_ask_user": "您的回复: ",
|
|
344
|
+
"tool_ask_user_accept":"收到您的回复",
|
|
341
345
|
}}
|
|
342
346
|
|
|
343
347
|
|
|
@@ -12,6 +12,7 @@ def _generate_shell_script(user_input: str) -> str:
|
|
|
12
12
|
环境信息如下:
|
|
13
13
|
|
|
14
14
|
操作系统: {{ env_info.os_name }} {{ env_info.os_version }}
|
|
15
|
+
操作系统发行版: {{ os_distribution }}
|
|
15
16
|
Python版本: {{ env_info.python_version }}
|
|
16
17
|
终端类型: {{ env_info.shell_type }}
|
|
17
18
|
终端编码: {{ env_info.shell_encoding }}
|
|
@@ -49,7 +50,8 @@ def _generate_shell_script(user_input: str) -> str:
|
|
|
49
50
|
return {
|
|
50
51
|
"env_info": env_info,
|
|
51
52
|
"shell_type": shell_type,
|
|
52
|
-
"shell_encoding": shells.get_terminal_encoding()
|
|
53
|
+
"shell_encoding": shells.get_terminal_encoding(),
|
|
54
|
+
"os_distribution": shells.get_os_distribution()
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
|
|
@@ -4,8 +4,7 @@ from typing import List, Dict, Union, Generator, Tuple
|
|
|
4
4
|
def read_file(file_path):
|
|
5
5
|
"""Read a file with automatic encoding detection.
|
|
6
6
|
|
|
7
|
-
Tries common encodings in sequence
|
|
8
|
-
cross-platform encoding issues between Windows and Linux systems.
|
|
7
|
+
Tries common encodings in sequence to handle cross-platform encoding issues.
|
|
9
8
|
|
|
10
9
|
Args:
|
|
11
10
|
file_path (str): Path to the file to read
|
|
@@ -16,7 +15,10 @@ def read_file(file_path):
|
|
|
16
15
|
Raises:
|
|
17
16
|
ValueError: If the file cannot be decoded with any of the tried encodings
|
|
18
17
|
"""
|
|
19
|
-
|
|
18
|
+
# Expanded list of encodings to try
|
|
19
|
+
encodings = ['utf-8', 'gbk', 'utf-16', 'latin-1',
|
|
20
|
+
'big5', 'shift_jis', 'euc-jp', 'iso-8859-1',
|
|
21
|
+
'cp1252', 'ascii']
|
|
20
22
|
|
|
21
23
|
for encoding in encodings:
|
|
22
24
|
try:
|
|
@@ -25,22 +27,54 @@ def read_file(file_path):
|
|
|
25
27
|
return content
|
|
26
28
|
except UnicodeDecodeError:
|
|
27
29
|
continue
|
|
30
|
+
except Exception as e:
|
|
31
|
+
# Log other errors but continue trying other encodings
|
|
32
|
+
continue
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
# If all encodings fail, try reading as binary and decode with 'replace'
|
|
35
|
+
try:
|
|
36
|
+
with open(file_path, 'rb') as f:
|
|
37
|
+
return f.read().decode('utf-8', errors='replace')
|
|
38
|
+
except Exception as e:
|
|
39
|
+
raise ValueError(get_message_with_format("file_decode_error",
|
|
40
|
+
file_path=file_path,
|
|
41
|
+
encodings=", ".join(encodings)))
|
|
32
42
|
|
|
33
43
|
def read_lines(file_path:str):
|
|
34
|
-
|
|
44
|
+
"""Read a file line by line with automatic encoding detection.
|
|
45
|
+
|
|
46
|
+
Args:
|
|
47
|
+
file_path (str): Path to the file to read
|
|
48
|
+
|
|
49
|
+
Returns:
|
|
50
|
+
List[str]: List of lines in the file
|
|
51
|
+
|
|
52
|
+
Raises:
|
|
53
|
+
ValueError: If the file cannot be decoded with any of the tried encodings
|
|
54
|
+
"""
|
|
55
|
+
# Expanded list of encodings to try
|
|
56
|
+
encodings = ['utf-8', 'gbk', 'utf-16', 'latin-1',
|
|
57
|
+
'big5', 'shift_jis', 'euc-jp', 'iso-8859-1',
|
|
58
|
+
'cp1252', 'ascii']
|
|
59
|
+
|
|
35
60
|
for encoding in encodings:
|
|
36
61
|
try:
|
|
37
62
|
with open(file_path, 'r', encoding=encoding) as f:
|
|
38
63
|
return f.readlines()
|
|
39
64
|
except UnicodeDecodeError:
|
|
40
65
|
continue
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
66
|
+
except Exception as e:
|
|
67
|
+
# Log other errors but continue trying other encodings
|
|
68
|
+
continue
|
|
69
|
+
|
|
70
|
+
# If all encodings fail, try reading as binary and decode with 'replace'
|
|
71
|
+
try:
|
|
72
|
+
with open(file_path, 'rb') as f:
|
|
73
|
+
return f.read().decode('utf-8', errors='replace').splitlines()
|
|
74
|
+
except Exception as e:
|
|
75
|
+
raise ValueError(get_message_with_format("file_decode_error",
|
|
76
|
+
file_path=file_path,
|
|
77
|
+
encodings=", ".join(encodings)))
|
|
44
78
|
|
|
45
79
|
|
|
46
80
|
|
|
@@ -5,6 +5,7 @@ import subprocess
|
|
|
5
5
|
import platform
|
|
6
6
|
import tempfile
|
|
7
7
|
import uuid
|
|
8
|
+
import re
|
|
8
9
|
from rich.console import Console
|
|
9
10
|
from rich.panel import Panel
|
|
10
11
|
from rich.text import Text
|
|
@@ -187,6 +188,71 @@ def _get_windows_terminal_name() -> str:
|
|
|
187
188
|
# 默认返回 cmd.exe
|
|
188
189
|
return 'cmd'
|
|
189
190
|
|
|
191
|
+
def get_os_distribution() -> str:
|
|
192
|
+
"""
|
|
193
|
+
获取操作系统发行版名称
|
|
194
|
+
|
|
195
|
+
Returns:
|
|
196
|
+
str: 操作系统发行版名称,如 'Ubuntu 22.04', 'CentOS 7', 'Windows 10' 等
|
|
197
|
+
"""
|
|
198
|
+
system = platform.system()
|
|
199
|
+
|
|
200
|
+
if system == 'Windows':
|
|
201
|
+
# Windows 系统版本
|
|
202
|
+
version = sys.getwindowsversion()
|
|
203
|
+
if version.major == 10 and version.build >= 22000:
|
|
204
|
+
return 'Windows 11'
|
|
205
|
+
elif version.major == 10:
|
|
206
|
+
return 'Windows 10'
|
|
207
|
+
elif version.major == 6:
|
|
208
|
+
if version.minor == 3:
|
|
209
|
+
return 'Windows 8.1'
|
|
210
|
+
elif version.minor == 2:
|
|
211
|
+
return 'Windows 8'
|
|
212
|
+
elif version.minor == 1:
|
|
213
|
+
return 'Windows 7'
|
|
214
|
+
elif version.minor == 0:
|
|
215
|
+
return 'Windows Vista'
|
|
216
|
+
elif version.major == 5:
|
|
217
|
+
if version.minor == 2:
|
|
218
|
+
return 'Windows Server 2003'
|
|
219
|
+
elif version.minor == 1:
|
|
220
|
+
return 'Windows XP'
|
|
221
|
+
return f'Windows {version.major}.{version.minor}'
|
|
222
|
+
|
|
223
|
+
elif system == 'Linux':
|
|
224
|
+
# Linux 发行版检测
|
|
225
|
+
try:
|
|
226
|
+
# 尝试读取 /etc/os-release
|
|
227
|
+
with open('/etc/os-release', 'r') as f:
|
|
228
|
+
os_release = f.read()
|
|
229
|
+
|
|
230
|
+
# 解析 NAME 和 VERSION_ID
|
|
231
|
+
name = re.search(r'NAME="([^"]+)"', os_release)
|
|
232
|
+
version = re.search(r'VERSION_ID="([^"]+)"', os_release)
|
|
233
|
+
|
|
234
|
+
if name and version:
|
|
235
|
+
return f"{name.group(1)} {version.group(1)}"
|
|
236
|
+
|
|
237
|
+
# 如果无法解析,尝试 lsb_release
|
|
238
|
+
try:
|
|
239
|
+
output = subprocess.check_output(['lsb_release', '-d'], stderr=subprocess.STDOUT)
|
|
240
|
+
return output.decode('utf-8').split(':')[1].strip()
|
|
241
|
+
except (subprocess.CalledProcessError, FileNotFoundError):
|
|
242
|
+
pass
|
|
243
|
+
|
|
244
|
+
# 最后尝试 uname
|
|
245
|
+
return platform.platform()
|
|
246
|
+
except Exception:
|
|
247
|
+
return platform.platform()
|
|
248
|
+
|
|
249
|
+
elif system == 'Darwin':
|
|
250
|
+
# macOS 版本
|
|
251
|
+
version = platform.mac_ver()[0]
|
|
252
|
+
return f'macOS {version}'
|
|
253
|
+
|
|
254
|
+
return platform.platform()
|
|
255
|
+
|
|
190
256
|
def _get_unix_terminal_name() -> str:
|
|
191
257
|
"""Linux/Mac 系统终端检测"""
|
|
192
258
|
# 从环境变量获取终端名称
|
|
@@ -238,6 +304,8 @@ def get_terminal_encoding() -> str:
|
|
|
238
304
|
return _get_unix_terminal_encoding()
|
|
239
305
|
|
|
240
306
|
def _get_windows_terminal_encoding() -> str:
|
|
307
|
+
# 添加发行版信息到环境变量
|
|
308
|
+
# os.environ['OS_DISTRIBUTION'] = get_os_distribution()
|
|
241
309
|
"""Windows 系统编码检测"""
|
|
242
310
|
try:
|
|
243
311
|
# 通过 chcp 命令获取代码页
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.271"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.270"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/code_auto_generate_editblock.py
RENAMED
|
File without changes
|
{auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/code_auto_generate_strict_diff.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/code_auto_merge_strict_diff.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/common/mcp_servers/mcp_server_perplexity.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/dispacher/actions/plugins/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/auto_coder_utils/chat_stream_out.py
RENAMED
|
File without changes
|
|
File without changes
|
{auto_coder-0.1.270 → auto_coder-0.1.271}/src/autocoder/utils/chat_auto_coder_utils/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|