├── .autocodercommands ├── ac_mod.md ├── ac_mod_plan.md ├── ac_target.md ├── ac_target_plan.md ├── hello.md └── tdd │ ├── act.md │ ├── plan.md │ ├── plan2.md │ └── plan3.md ├── .autocoderignore ├── .autocoderrules ├── add_custom_tool_to_baseagent.md ├── always_repsond_in_chinese.md ├── byzerllm_dynamic_prompt.md ├── byzerllm_prompt_decorator.md ├── command_file_manager_usage.md ├── context_pruner_usage.md ├── demo_or_test_initialization_order.md ├── event_system_usage.md ├── file_checkpoint_usage.md ├── file_monitor_usage.md ├── get_llm.md ├── index.md ├── index_filter_strategies.md ├── logger_best_practices.md ├── module_testing_and_demo_structure.md ├── save_json_as_md_usage.md ├── shadown_system_usage.md ├── to_ignore_files.md └── token_counter_service.md ├── .gitignore ├── .model_filters.yml.example ├── .vscode ├── launch.json ├── settings.json └── tasks.json ├── LICENSE ├── README.md ├── README_BYZER_DEMO.md ├── async_agent_runner ├── .ac.mod.md ├── Makefile ├── PROJECT_STATUS.md ├── README.md ├── cmd │ ├── cleanup.go │ ├── list.go │ └── root.go ├── examples │ ├── structured_test.md │ └── test.md ├── go.mod ├── go.sum ├── main.go ├── pkg │ ├── executor │ │ └── autocoder.go │ ├── markdown │ │ ├── processor.go │ │ └── processor_test.go │ └── worktree │ │ └── manager.go └── scripts │ ├── build.sh │ └── demo.sh ├── auto_coder_installer ├── .gitignore ├── Makefile ├── READE.md ├── auto-coder-installer-windows-cmd-2014-06-19.zip ├── cmd │ ├── install.go │ └── root.go ├── go.mod ├── go.sum ├── gui.exe.manifest ├── gui │ └── main.go └── main.go ├── demo_verbose_pruner.py ├── deploy.sh ├── docs ├── ac_module_article.md ├── ac_module_article_outline.md ├── ac_module_article_short.md ├── article_publishing_guide.md └── how_to_init_project.md ├── ide_plugins └── vscode │ └── auto-coder │ ├── .eslintrc.json │ ├── .gitignore │ ├── .vscode-test.mjs │ ├── .vscode │ ├── extensions.json │ ├── launch.json │ ├── settings.json │ └── tasks.json │ ├── .vscodeignore │ ├── CHANGELOG.md │ ├── Makefile │ ├── README.md │ ├── actions │ ├── 000_example.yml │ ├── 101_current_work.yml │ ├── 102_chat_action.yml │ ├── 103_chat_action.yml │ ├── 104_chat_action.yml │ ├── 105_chat_action.yml │ ├── 106_chat_action.yml │ ├── 107_chat_action.yml │ ├── 108_chat_action.yml │ ├── 109_chat_action.yml │ ├── 110_chat_action.yml │ ├── 111_chat_action.yml │ ├── 112_chat_action.yml │ ├── 113_chat_action.yml │ ├── 114_chat_action.yml │ ├── 115_chat_action.yml │ ├── 116_chat_action.yml │ ├── 117_chat_action.yml │ ├── 118_chat_action.yml │ ├── 119_chat_action.yml │ ├── 120_chat_action.yml │ ├── 121_chat_action.yml │ ├── 122_chat_action.yml │ ├── 123_chat_action.yml │ ├── 124_chat_action.yml │ ├── 125_chat_action.yml │ ├── 126_chat_action.yml │ ├── 127_chat_action.yml │ ├── 128_chat_action.yml │ ├── 129_chat_action.yml │ ├── 130_chat_action.yml │ ├── 131_chat_action.yml │ ├── 132_chat_action.yml │ ├── 133_chat_action.yml │ ├── 134_chat_action.yml │ ├── 135_chat_action.yml │ ├── 136_chat_action.yml │ ├── 137_chat_action.yml │ ├── 138_chat_action.yml │ ├── 139_chat_action.yml │ ├── 140_chat_action.yml │ ├── 141_chat_action.yml │ ├── 142_chat_action.yml │ ├── 143_chat_action.yml │ ├── 144_chat_action.yml │ ├── 145_chat_action.yml │ ├── 146_chat_action.yml │ ├── 147_chat_action.yml │ ├── 148_chat_action.yml │ ├── 149_chat_action.yml │ ├── 150_chat_action.yml │ ├── 151_chat_action.yml │ ├── 152_chat_action.yml │ ├── 153_chat_action.yml │ ├── 154_chat_action.yml │ ├── 155_chat_action.yml │ ├── 156_chat_action.yml │ ├── 157_chat_action.yml │ ├── 158_chat_action.yml │ ├── 159_chat_action.yml │ ├── 160_chat_action.yml │ ├── 161_chat_action.yml │ ├── 162_chat_action.yml │ ├── 163_chat_action.yml │ ├── 164_chat_action.yml │ ├── 165_chat_action.yml │ ├── 166_chat_action.yml │ ├── 167_chat_action.yml │ ├── 168_chat_action.yml │ ├── 169_chat_action.yml │ ├── 170_chat_action.yml │ ├── 171_chat_action.yml │ ├── 172_chat_action.yml │ ├── 173_chat_action.yml │ ├── 174_chat_action.yml │ ├── 175_chat_action.yml │ ├── 176_chat_action.yml │ ├── 177_chat_action.yml │ └── base │ │ ├── base.yml │ │ ├── enable_diff.yml │ │ ├── enable_index.yml │ │ ├── enable_rag_search.yml │ │ ├── enable_search_engine.yml │ │ ├── enable_wholefile.yml │ │ └── exclude_files.yml │ ├── images │ ├── create_req.png │ └── create_yaml.png │ ├── logo-128-128.png │ ├── logo.jpeg │ ├── notebooks │ └── test.ipynb │ ├── package-lock.json │ ├── package.json │ ├── postcss.config.js │ ├── src │ ├── extension.ts │ ├── test │ │ └── extension.test.ts │ └── web │ │ ├── ChatView.tsx │ │ ├── chatAnimation.css │ │ ├── coding.ts │ │ ├── create_yaml.tsx │ │ ├── dark.css │ │ ├── index.css │ │ ├── index.tsx │ │ ├── index_query.ts │ │ ├── types.ts │ │ └── utils.ts │ ├── tailwind.config.js │ ├── tsconfig.json │ ├── vsc-extension-quickstart.md │ └── webpack.config.js ├── logo └── auto-coder.jpeg ├── pc └── app-auto-coder │ ├── .eslintrc.json │ ├── .gitignore │ ├── forge.config.ts │ ├── forge.env.d.ts │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── index.css │ ├── main.ts │ ├── preload.ts │ └── renderer.ts │ ├── tsconfig.json │ ├── vite.base.config.ts │ ├── vite.main.config.ts │ ├── vite.preload.config.ts │ └── vite.renderer.config.ts ├── pytest.ini ├── requirements.txt ├── scripts ├── README.md ├── build_installer.py ├── run_test.sh ├── run_test_completion.sh ├── runtime_hook.py ├── to_cursor_rule.sh └── to_windsurf_rule.sh ├── setup.py ├── src └── autocoder │ ├── __init__.py │ ├── agent │ ├── .ac.mod.md │ ├── __init__.py │ ├── agentic_filter.py │ ├── auto_demand_organizer.py │ ├── auto_filegroup.py │ ├── auto_guess_query.py │ ├── auto_learn.py │ ├── auto_learn_from_commit.py │ ├── auto_review_commit.py │ ├── auto_tool.py │ ├── base_agentic │ │ ├── __init__.py │ │ ├── agent_hub.py │ │ ├── agentic_lang.py │ │ ├── agentic_tool_display.py │ │ ├── base_agent.py │ │ ├── default_tools.py │ │ ├── test_base_agent.py │ │ ├── tool_registry.py │ │ ├── tools │ │ │ ├── __init__.py │ │ │ ├── ask_followup_question_tool_resolver.py │ │ │ ├── attempt_completion_tool_resolver.py │ │ │ ├── base_tool_resolver.py │ │ │ ├── example_tool_resolver.py │ │ │ ├── execute_command_tool_resolver.py │ │ │ ├── list_files_tool_resolver.py │ │ │ ├── plan_mode_respond_tool_resolver.py │ │ │ ├── read_file_tool_resolver.py │ │ │ ├── replace_in_file_tool_resolver.py │ │ │ ├── search_files_tool_resolver.py │ │ │ ├── talk_to_group_tool_resolver.py │ │ │ ├── talk_to_tool_resolver.py │ │ │ ├── use_mcp_tool_resolver.py │ │ │ └── write_to_file_tool_resolver.py │ │ ├── types.py │ │ └── utils.py │ ├── coder.py │ ├── designer.py │ ├── entry_command_agent │ │ ├── README.md │ │ ├── __init__.py │ │ ├── auto_tool.py │ │ ├── chat.py │ │ ├── designer.py │ │ ├── generate_command.py │ │ ├── project_reader.py │ │ └── voice2text.py │ ├── planner.py │ └── project_reader.py │ ├── auto_coder.py │ ├── auto_coder_rag.py │ ├── auto_coder_runner.py │ ├── auto_coder_server.py │ ├── benchmark.py │ ├── chat │ ├── __init__.py │ ├── conf_command.py │ ├── models_command.py │ └── rules_command.py │ ├── chat_auto_coder.py │ ├── chat_auto_coder_lang.py │ ├── command_args.py │ ├── commands │ ├── __init__.py │ ├── auto_command.py │ ├── auto_web.py │ └── tools.py │ ├── common │ ├── JupyterClient.py │ ├── ShellClient.py │ ├── __init__.py │ ├── ac_style_command_parser │ │ ├── .ac.mod.md │ │ ├── __init__.py │ │ ├── parser.py │ │ └── test_parser.py │ ├── action_yml_file_manager.py │ ├── anything2images.py │ ├── anything2img.py │ ├── audio.py │ ├── auto_coder_lang.py │ ├── auto_configure.py │ ├── buildin_tokenizer.py │ ├── chunk_validation.py │ ├── cleaner.py │ ├── code_auto_execute.py │ ├── code_auto_generate.py │ ├── code_auto_generate_diff.py │ ├── code_auto_generate_editblock.py │ ├── code_auto_generate_strict_diff.py │ ├── code_auto_merge.py │ ├── code_auto_merge_diff.py │ ├── code_auto_merge_editblock.py │ ├── code_auto_merge_strict_diff.py │ ├── code_modification_ranker.py │ ├── command_completer.py │ ├── command_completer_v2.py │ ├── command_file_manager │ │ ├── README.md │ │ ├── __init__.py │ │ ├── examples.py │ │ ├── manager.py │ │ ├── models.py │ │ └── utils.py │ ├── command_generator.py │ ├── command_templates.py │ ├── computer_use.py │ ├── conf_import_export.py │ ├── conf_utils.py │ ├── conf_validator.py │ ├── const.py │ ├── conversations │ │ ├── .ac.mod.md │ │ ├── __init__.py │ │ ├── backup │ │ │ ├── __init__.py │ │ │ ├── backup_manager.py │ │ │ └── restore_manager.py │ │ ├── cache │ │ │ ├── __init__.py │ │ │ ├── base_cache.py │ │ │ ├── cache_manager.py │ │ │ └── memory_cache.py │ │ ├── config.py │ │ ├── exceptions.py │ │ ├── file_locker.py │ │ ├── get_conversation_manager.py │ │ ├── manager.py │ │ ├── models.py │ │ ├── search │ │ │ ├── __init__.py │ │ │ ├── filter_manager.py │ │ │ └── text_searcher.py │ │ └── storage │ │ │ ├── __init__.py │ │ │ ├── base_storage.py │ │ │ ├── file_storage.py │ │ │ └── index_manager.py │ ├── directory_cache │ │ ├── __init__.py │ │ ├── cache.py │ │ └── test_cache.py │ ├── file_checkpoint │ │ ├── __init__.py │ │ ├── backup.py │ │ ├── conversation_checkpoint.py │ │ ├── examples.py │ │ ├── manager.py │ │ ├── models.py │ │ ├── store.py │ │ ├── test_backup.py │ │ ├── test_manager.py │ │ ├── test_models.py │ │ ├── test_store.py │ │ ├── test_utils.py │ │ └── utils.py │ ├── file_monitor │ │ ├── .ac.mod.md │ │ ├── __init__.py │ │ ├── monitor.py │ │ └── test_file_monitor.py │ ├── files.py │ ├── git_utils.py │ ├── global_cancel.py │ ├── ignorefiles │ │ ├── __init__.py │ │ ├── ignore_file_utils.py │ │ └── test_ignore_file_utils.py │ ├── image_to_page.py │ ├── index_import_export.py │ ├── interpreter.py │ ├── llm_friendly_package.py │ ├── llm_friendly_package_README.md │ ├── llm_friendly_package_example.py │ ├── llm_friendly_package_test.py │ ├── mcp_hub.py │ ├── mcp_server.py │ ├── mcp_server_install.py │ ├── mcp_server_types.py │ ├── mcp_servers │ │ ├── __init__.py │ │ ├── mcp_server_gpt4o_mini_search.py │ │ └── mcp_server_perplexity.py │ ├── mcp_tools.py │ ├── memory_manager.py │ ├── model_speed_tester.py │ ├── openai_content.py │ ├── printer.py │ ├── pruner │ │ ├── .ac.mod.md │ │ ├── __init__.py │ │ ├── agentic_conversation_pruner.py │ │ ├── context_pruner.py │ │ ├── conversation_pruner.py │ │ ├── test_agentic_conversation_pruner.py │ │ └── test_context_pruner.py │ ├── pull_requests │ │ ├── .ac.mod.md │ │ ├── README.md │ │ ├── __init__.py │ │ ├── base_provider.py │ │ ├── config.py │ │ ├── example.py │ │ ├── exceptions.py │ │ ├── manager.py │ │ ├── models.py │ │ ├── providers │ │ │ ├── __init__.py │ │ │ ├── gitcode_provider.py │ │ │ ├── gitee_provider.py │ │ │ ├── github_provider.py │ │ │ └── gitlab_provider.py │ │ ├── test_module.py │ │ └── utils.py │ ├── rag_manager │ │ ├── README.md │ │ ├── __init__.py │ │ └── rag_manager.py │ ├── recall_validation.py │ ├── result_manager.py │ ├── rulefiles │ │ ├── __init__.py │ │ └── autocoderrules_utils.py │ ├── run_cmd.py │ ├── save_formatted_log.py │ ├── screenshots.py │ ├── search.py │ ├── search_replace.py │ ├── shells.py │ ├── stats_panel.py │ ├── stream_out_type.py │ ├── sys_prompt.py │ ├── test_run_cmd.py │ ├── text.py │ ├── token_cost_caculate.py │ ├── tokens │ │ ├── .ac.mod.md │ │ ├── __init__.py │ │ ├── counter.py │ │ ├── file_detector.py │ │ ├── filters.py │ │ └── models.py │ ├── types.py │ ├── utils_code_auto_generate.py │ └── v2 │ │ ├── __init__.py │ │ ├── agent │ │ ├── .ac.mod.md │ │ ├── __init__.py │ │ ├── agentic_edit.py │ │ ├── agentic_edit_tools │ │ │ ├── __init__.py │ │ │ ├── ac_mod_read_tool_resolver.py │ │ │ ├── ac_mod_write_tool_resolver.py │ │ │ ├── ask_followup_question_tool_resolver.py │ │ │ ├── attempt_completion_tool_resolver.py │ │ │ ├── base_tool_resolver.py │ │ │ ├── dangerous_command_checker.py │ │ │ ├── execute_command_tool_resolver.py │ │ │ ├── list_code_definition_names_tool_resolver.py │ │ │ ├── list_files_tool_resolver.py │ │ │ ├── plan_mode_respond_tool_resolver.py │ │ │ ├── read_file_tool_resolver.py │ │ │ ├── replace_in_file_tool_resolver.py │ │ │ ├── search_files_tool_resolver.py │ │ │ ├── test_execute_command_tool_resolver.py │ │ │ ├── test_search_files_tool_resolver.py │ │ │ ├── test_write_to_file_tool_resolver.py │ │ │ ├── tests │ │ │ │ └── test_todo_write_tool_resolver.py │ │ │ ├── todo_read_tool_resolver.py │ │ │ ├── todo_write_tool_resolver.py │ │ │ ├── use_mcp_tool_resolver.py │ │ │ ├── use_rag_tool_resolver.py │ │ │ └── write_to_file_tool_resolver.py │ │ ├── agentic_edit_types.py │ │ ├── agentic_tool_display.py │ │ └── runner │ │ │ ├── .ac.mod.md │ │ │ ├── __init__.py │ │ │ ├── base_runner.py │ │ │ ├── event_runner.py │ │ │ ├── sdk_runner.py │ │ │ ├── terminal_runner.py │ │ │ └── tool_display.py │ │ ├── code_agentic_editblock_manager.py │ │ ├── code_auto_generate.py │ │ ├── code_auto_generate_diff.py │ │ ├── code_auto_generate_editblock.py │ │ ├── code_auto_generate_strict_diff.py │ │ ├── code_auto_merge.py │ │ ├── code_auto_merge_diff.py │ │ ├── code_auto_merge_editblock.py │ │ ├── code_auto_merge_strict_diff.py │ │ ├── code_diff_manager.py │ │ ├── code_editblock_manager.py │ │ ├── code_manager.py │ │ └── code_strict_diff_manager.py │ ├── compilers │ ├── __init__.py │ ├── base_compiler.py │ ├── compiler_config_api.py │ ├── compiler_config_manager.py │ ├── compiler_factory.py │ ├── java_compiler.py │ ├── models.py │ ├── normal_compiler.py │ ├── provided_compiler.py │ ├── python_compiler.py │ ├── reactjs_compiler.py │ ├── shadow_compiler.py │ └── vue_compiler.py │ ├── data │ ├── byzerllm.md │ └── tokenizer.json │ ├── db │ ├── __init__.py │ └── store.py │ ├── dispacher │ ├── __init__.py │ └── actions │ │ ├── __init__.py │ │ ├── action.py │ │ ├── copilot.py │ │ └── plugins │ │ ├── __init__.py │ │ └── action_regex_project.py │ ├── events │ ├── README.md │ ├── __init__.py │ ├── event_content.py │ ├── event_manager.py │ ├── event_manager_singleton.py │ ├── event_store.py │ ├── event_types.py │ └── examples │ │ ├── completion_content_example.py │ │ └── error_content_example.py │ ├── helper │ ├── __init__.py │ ├── project_creator.py │ └── rag_doc_creator.py │ ├── index │ ├── __init__.py │ ├── entry.py │ ├── filter │ │ ├── __init__.py │ │ ├── normal_filter.py │ │ └── quick_filter.py │ ├── for_command.py │ ├── index.py │ ├── symbols_utils.py │ └── types.py │ ├── lang.py │ ├── linters │ ├── __init__.py │ ├── base_linter.py │ ├── linter_factory.py │ ├── models.py │ ├── normal_linter.py │ ├── python_linter.py │ ├── reactjs_linter.py │ ├── shadow_linter.py │ ├── test_python_linter.py │ ├── test_reactjs_linter.py │ ├── test_samples │ │ └── react_component.jsx │ ├── test_vue_linter.py │ └── vue_linter.py │ ├── memory │ ├── __init__.py │ ├── active_changes.py │ ├── active_context_manager.py │ ├── active_diagrams.py │ ├── active_documents.py │ ├── active_header.py │ ├── active_package.py │ ├── async_processor.py │ └── directory_mapper.py │ ├── models.py │ ├── plugins │ ├── README.md │ ├── README_zh.md │ ├── __init__.py │ ├── dynamic_completion_example.py │ ├── git_helper_plugin.py │ ├── sample_plugin.py │ ├── token_helper_plugin.py │ └── utils.py │ ├── privacy │ ├── __init__.py │ └── model_filter.py │ ├── pyproject │ └── __init__.py │ ├── rag │ ├── __init__.py │ ├── agentic_rag.py │ ├── api_server.py │ ├── cache │ │ ├── __init__.py │ │ ├── base_cache.py │ │ ├── byzer_storage_cache.py │ │ ├── cache_result_merge.py │ │ ├── failed_files_utils.py │ │ ├── file_monitor_cache.py │ │ ├── local_byzer_storage_cache.py │ │ ├── local_duckdb_storage_cache.py │ │ ├── rag_file_meta.py │ │ └── simple_cache.py │ ├── conversation_to_queries.py │ ├── doc_filter.py │ ├── document_retriever.py │ ├── lang.py │ ├── llm_wrapper.py │ ├── loaders │ │ ├── __init__.py │ │ ├── docx_loader.py │ │ ├── excel_loader.py │ │ ├── filter_utils.py │ │ ├── image_loader.py │ │ ├── pdf_loader.py │ │ └── ppt_loader.py │ ├── long_context_rag.py │ ├── qa_conversation_strategy.py │ ├── rag_config.py │ ├── rag_entry.py │ ├── relevant_utils.py │ ├── searchable.py │ ├── stream_event │ │ ├── __init__.py │ │ ├── event_writer.py │ │ └── types.py │ ├── test_doc_filter.py │ ├── test_long_context_rag.py │ ├── test_token_limiter.py │ ├── token_checker.py │ ├── token_counter.py │ ├── token_limiter.py │ ├── token_limiter_utils.py │ ├── tools │ │ ├── __init__.py │ │ ├── recall_tool.py │ │ └── search_tool.py │ ├── types.py │ ├── utils.py │ └── variable_holder.py │ ├── rags.py │ ├── regexproject │ └── __init__.py │ ├── run_context.py │ ├── sdk │ ├── .ac.mod.md │ ├── __init__.py │ ├── cli │ │ ├── __init__.py │ │ ├── __main__.py │ │ ├── completion_wrapper.py │ │ ├── formatters.py │ │ ├── handlers.py │ │ ├── install_completion.py │ │ ├── main.py │ │ └── options.py │ ├── constants.py │ ├── core │ │ ├── __init__.py │ │ ├── auto_coder_core.py │ │ └── bridge.py │ ├── exceptions.py │ ├── models │ │ ├── __init__.py │ │ ├── messages.py │ │ ├── options.py │ │ └── responses.py │ ├── session │ │ ├── __init__.py │ │ ├── session.py │ │ └── session_manager.py │ └── utils │ │ ├── __init__.py │ │ ├── formatters.py │ │ ├── io_utils.py │ │ └── validators.py │ ├── shadows │ ├── __init__.py │ └── shadow_manager.py │ ├── suffixproject │ └── __init__.py │ ├── tsproject │ └── __init__.py │ ├── utils │ ├── __init__.py │ ├── _markitdown.py │ ├── auto_coder_utils │ │ ├── __init__.py │ │ └── chat_stream_out.py │ ├── auto_project_type.py │ ├── chat_auto_coder_utils │ │ └── __init__.py │ ├── conversation_store.py │ ├── llm_client_interceptors.py │ ├── llms.py │ ├── log_capture.py │ ├── model_provider_selector.py │ ├── multi_turn.py │ ├── operate_config_api.py │ ├── print_table.py │ ├── project_structure.py │ ├── queue_communicate.py │ ├── request_event_queue.py │ ├── request_queue.py │ ├── rest.py │ ├── stream_thinking.py │ ├── thread_utils.py │ └── types.py │ └── version.py └── target └── lisp_interpreter.mi /.autocodercommands/ac_target.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% if path %} 4 | 运行脚本如下脚本: 5 | {{ path }} 6 | {% else %} 7 | 根据永续需求运行脚本, 8 | {% endif %} 9 | 如果脚本有错误,则需要修正相关的代码,直到再次运行没有错误为止,中间不允许停止。 10 | 11 | {% if query %} 12 | 下面是用户的额外要求: 13 | 14 | {{ query }} 15 | 16 | {% endif %} -------------------------------------------------------------------------------- /.autocodercommands/hello.md: -------------------------------------------------------------------------------- 1 | 和我说 hello {{name}} -------------------------------------------------------------------------------- /.autocodercommands/tdd/act.md: -------------------------------------------------------------------------------- 1 | 参考 docs/jobs/runner.md 文件,按 docs/jobs/design.md 中的阶段,一次实现一个阶段。 2 | 3 | 每个阶段的实现要求: 4 | 5 | 1. 先实现测试代码 6 | 2. 再实现业务代码 7 | 3. 运行测试,直到运行成功 8 | 4. 更新 docs/jobs/runner.md 文件,然后继续下一个步骤的实现。 -------------------------------------------------------------------------------- /.autocoderignore: -------------------------------------------------------------------------------- 1 | target 2 | -------------------------------------------------------------------------------- /.autocoderrules/always_repsond_in_chinese.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: 指定交互语言 3 | globs: ["**/*"] 4 | alwaysApply: true 5 | --- 6 | 7 | 1. Always respond in Chinese 8 | 2. Tell me what you are going to do before you actually do it every time. -------------------------------------------------------------------------------- /.autocoderrules/get_llm.md: -------------------------------------------------------------------------------- 1 | 2 | --- 3 | description: "本文档说明了在测试代码中获取和初始化LLM模型的标准方法,包括加载token统计、获取模型和配置参数的步骤。" 4 | globs: ["**/*.py"] 5 | alwaysApply: false 6 | --- 7 | 8 | # get_llm.md 使用指南 9 | ## 简介 10 | 本文档说明了在测试代码中获取和初始化LLM模型的标准方法,包括加载token统计、获取模型和配置参数的步骤。 11 | 12 | 在写测试的时候,需要对系统先做初始化才能完成组件的代码测试。 13 | 14 | ## 加载 token 统计 15 | 16 | ``` 17 | from autocoder.auto_coder_runner import load_tokenizer 18 | load_tokenizer() 19 | ``` 20 | 21 | 这个一般要放到最前面。 22 | 23 | ## 模型获取 24 | 25 | ``` 26 | from autocoder.utils.llms import get_single_llm 27 | llm = get_single_llm("v3_chat", product_mode="lite") 28 | ``` 29 | 30 | 这样就可以获取一个叫 v3_chat 的模型。 31 | 32 | ## 配置参数 33 | 34 | 一般需要根据被测试的对象,合理设置 AutoCoderArgs 的参数。 35 | 36 | 37 | ``` 38 | from autocoder.common import AutoCoderArgs 39 | args = AutoCoderArgs( 40 | source_dir=".", 41 | context_prune=True, 42 | context_prune_strategy="extract", 43 | conversation_prune_safe_zone_tokens=400, # 设置较小的token限制以触发抽取逻辑 44 | context_prune_sliding_window_size=10, 45 | context_prune_sliding_window_overlap=2, 46 | query="如何实现加法和减法运算?" 47 | ) 48 | ``` 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore Mac .DS_Store files 2 | .DS_Store 3 | **/.DS_Store 4 | .DS_Store? 5 | 6 | # Ignore files generated by the IDE 7 | .idea/ 8 | 9 | # Ignore compiled binaries 10 | *.exe 11 | *.dll 12 | *.so 13 | 14 | # Ignore build output directories 15 | /bin/ 16 | /build/ 17 | /dist/ 18 | 19 | # Ignore package manager directories 20 | /node_modules/ 21 | /vendor/ 22 | 23 | # Ignore log files 24 | *.log 25 | 26 | # Ignore temporary files 27 | *.tmp 28 | *.swp 29 | # Ignore Python cache files 30 | __pycache__/ 31 | output.txt 32 | screenshots/ 33 | ./output.txt 34 | 35 | .auto-coder/metadata.db 36 | notebooks/conversations.json 37 | notebooks/pandoc-3.2-x86_64-macOS.pkg 38 | docs/zh/.auto-coder/metadata.db 39 | ide_plugins/vscode/auto-coder/node_modules 40 | ide_plugins/vscode/auto-cocder/build 41 | ide_plugins/vscode/auto-coder/*.vsix 42 | ide_plugins/vscode/auto-coder/dist/ 43 | ide_plugins/vscode/auto-coder/package-lock.json 44 | .auto-coder/metadata.db 45 | ide_plugins/vscode/auto-coder/web/package-lock.json 46 | .auto-coder/ 47 | /actions/ 48 | /output.txt 49 | auto_coder_installer/bin 50 | **/node_modules/ 51 | **/*.vsix 52 | **/*/.ipynb_checkpoints 53 | 54 | output.png 55 | output.jpg 56 | output.svg 57 | notebooks/generated_image.png 58 | **/*.egg-info 59 | 60 | .cache/ 61 | /file*.py 62 | /notebooks/output* 63 | /notebooks/cache_test 64 | /notebooks/sample_code 65 | /notebooks/sample_code_byzer 66 | /notebooks/test_project 67 | /notebooks/*.txt 68 | /examples/test_project 69 | /package-lock.json/ 70 | .windsurfrules 71 | .cursor 72 | 73 | 74 | .auto-coder/ 75 | /actions/ 76 | /output.txt 77 | /examples/ 78 | /async_agent_runner/bin/ 79 | /async_agent_runner/examples/ -------------------------------------------------------------------------------- /.model_filters.yml.example: -------------------------------------------------------------------------------- 1 | # 模型过滤器配置示例 2 | # 此文件定义了特定模型的文件访问权限 3 | 4 | model_filters: 5 | # 模型特定配置 6 | doubao_v3_chat: 7 | rules: 8 | - pattern: "*.env" # 禁止访问所有 .env 文件 9 | permission: DENY # DENY 完全禁止访问 10 | - pattern: "**/secrets/**" 11 | permission: DENY_WRITE # DENY_WRITE 允许读取但禁止写入 12 | - pattern: "**/tests/**/*.py" 13 | permission: DENY_WRITE # 允许读取测试文件但禁止修改 14 | line_ranges: # 可选: 指定行范围限制 15 | - start: 100 # 从第100行开始 16 | end: 300 # 到第300行结束 17 | - pattern: "**/config.json" 18 | permission: ALLOW # ALLOW 显式允许访问(优先级高于DENY) 19 | 20 | qwen_32b_chat: 21 | rules: 22 | - pattern: "**/private/**" 23 | permission: DENY # 完全禁止访问private目录 24 | - pattern: "*.key" 25 | permission: DENY # 禁止访问所有.key文件 26 | - pattern: "**/config/**/*.json" 27 | permission: DENY_READ # DENY_READ 允许写入但禁止读取 28 | - pattern: "**/src/core/**" 29 | permission: DENY_WRITE # 允许读取核心代码但禁止修改 30 | line_ranges: 31 | - start: 1 # 可以指定多个行范围 32 | end: 50 33 | - start: 200 34 | end: 350 35 | 36 | # 默认规则(当没有模型特定规则时应用于所有模型) 37 | default_rules: 38 | - pattern: "**/node_modules/**" 39 | permission: DENY # 禁止访问node_modules目录 40 | - pattern: "**/.git/**" 41 | permission: DENY # 禁止访问.git目录 42 | - pattern: "*.lock" 43 | permission: DENY_WRITE # 允许读取但禁止修改lock文件 -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Run Extension", 6 | "type": "extensionHost", 7 | "request": "launch", 8 | "args": [ 9 | "--extensionDevelopmentPath=${workspaceFolder}" 10 | ], 11 | "outFiles": [ 12 | "${workspaceFolder}/dist/**/*.js" 13 | ], 14 | "preLaunchTask": "npm: watch" 15 | }, 16 | { 17 | "name": "Extension Tests", 18 | "type": "extensionHost", 19 | "request": "launch", 20 | "args": [ 21 | "--extensionDevelopmentPath=${workspaceFolder}", 22 | "--extensionTestsPath=${workspaceFolder}/out/test/suite/index" 23 | ], 24 | "outFiles": [ 25 | "${workspaceFolder}/out/test/**/*.js" 26 | ], 27 | "preLaunchTask": "npm: watch" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.testing.unittestArgs": [ 3 | "-v", 4 | "-s", 5 | "./tests", 6 | "-p", 7 | "test_*.py" 8 | ], 9 | "python.testing.autoTestDiscoverOnSaveEnabled": false, 10 | "python.testing.unittestEnabled": false, 11 | "python.testing.pytestEnabled": true, 12 | "testing.automaticallyOpenPeekView": "never", 13 | "[python]": { 14 | "editor.formatOnSave": false 15 | }, 16 | "python.testing.pytestArgs": [ 17 | "src" 18 | ] 19 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "type": "npm", 6 | "script": "compile", 7 | "path": "ide_plugins/vscode/auto-coder", 8 | "group": "build", 9 | "problemMatcher": [], 10 | "label": "npm: compile - ide_plugins/vscode/auto-coder", 11 | "detail": "webpack" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /async_agent_runner/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for async_agent_runner 2 | 3 | .PHONY: build install-user clean test help 4 | 5 | # 变量 6 | BINARY_NAME := async_agent_runner 7 | BUILD_DIR := bin 8 | INSTALL_DIR := $(HOME)/bin 9 | 10 | # 默认目标 11 | help: 12 | @echo "可用的 make 目标:" 13 | @echo " build - 构建二进制文件" 14 | @echo " install-user - 安装到用户目录 (~/bin)" 15 | @echo " clean - 清理构建文件" 16 | @echo " test - 运行测试" 17 | @echo " help - 显示此帮助信息" 18 | 19 | # 构建二进制文件 20 | build: 21 | @echo "🔨 构建 $(BINARY_NAME)..." 22 | @mkdir -p $(BUILD_DIR) 23 | @go build -ldflags="-s -w" -o $(BUILD_DIR)/$(BINARY_NAME) . 24 | @echo "✅ 构建完成: $(BUILD_DIR)/$(BINARY_NAME)" 25 | 26 | # 安装到用户目录 27 | install-user: build 28 | @echo "📦 安装 $(BINARY_NAME) 到 $(INSTALL_DIR)..." 29 | @mkdir -p $(INSTALL_DIR) 30 | @cp $(BUILD_DIR)/$(BINARY_NAME) $(INSTALL_DIR)/ 31 | @chmod +x $(INSTALL_DIR)/$(BINARY_NAME) 32 | @echo "✅ 安装完成" 33 | @echo "请确保 $(INSTALL_DIR) 在您的 PATH 中" 34 | 35 | # 清理构建文件 36 | clean: 37 | @echo "🧹 清理构建文件..." 38 | @rm -rf $(BUILD_DIR) 39 | @echo "✅ 清理完成" 40 | 41 | # 运行测试 42 | test: 43 | @echo "🧪 运行测试..." 44 | @go test ./... 45 | 46 | # 构建所有平台 47 | build-all: 48 | @echo "🔨 构建所有平台..." 49 | @mkdir -p $(BUILD_DIR) 50 | @GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o $(BUILD_DIR)/$(BINARY_NAME)-linux-amd64 . 51 | @GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-amd64 . 52 | @GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-arm64 . 53 | @GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o $(BUILD_DIR)/$(BINARY_NAME)-windows-amd64.exe . 54 | @echo "✅ 多平台构建完成" -------------------------------------------------------------------------------- /async_agent_runner/PROJECT_STATUS.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /async_agent_runner/cmd/cleanup.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/spf13/cobra" 7 | "github.com/williamzhu/auto-coder/async_agent_runner/pkg/worktree" 8 | ) 9 | 10 | // cleanupCmd represents the cleanup command 11 | var cleanupCmd = &cobra.Command{ 12 | Use: "cleanup", 13 | Short: "清理 worktree 目录", 14 | Long: `清理所有在工作目录中的 git worktree。 15 | 16 | 示例: 17 | async_agent_runner cleanup # 清理所有 worktree 18 | async_agent_runner cleanup --pattern abc # 只清理包含 'abc' 的 worktree`, 19 | RunE: func(cmd *cobra.Command, args []string) error { 20 | return runCleanup() 21 | }, 22 | } 23 | 24 | var cleanupPattern string 25 | 26 | func init() { 27 | rootCmd.AddCommand(cleanupCmd) 28 | cleanupCmd.Flags().StringVar(&cleanupPattern, "pattern", "", "清理匹配模式的 worktree") 29 | } 30 | 31 | func runCleanup() error { 32 | wtManager := worktree.NewManager(workdir, fromBranch) 33 | 34 | fmt.Printf("开始清理工作目录: %s\n", workdir) 35 | if cleanupPattern != "" { 36 | fmt.Printf("匹配模式: %s\n", cleanupPattern) 37 | } 38 | 39 | err := wtManager.CleanupAllWorktrees(cleanupPattern) 40 | if err != nil { 41 | return fmt.Errorf("清理失败: %v", err) 42 | } 43 | 44 | fmt.Println("清理完成") 45 | return nil 46 | } -------------------------------------------------------------------------------- /async_agent_runner/cmd/list.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | 7 | "github.com/spf13/cobra" 8 | "github.com/williamzhu/auto-coder/async_agent_runner/pkg/worktree" 9 | ) 10 | 11 | // listCmd represents the list command 12 | var listCmd = &cobra.Command{ 13 | Use: "list", 14 | Short: "列出所有 worktree", 15 | Long: `显示所有 git worktree 的状态和信息。 16 | 17 | 示例: 18 | async_agent_runner list # 列出所有 worktree 19 | async_agent_runner list --only-managed # 只显示在工作目录中的 worktree`, 20 | RunE: func(cmd *cobra.Command, args []string) error { 21 | return runList() 22 | }, 23 | } 24 | 25 | var onlyManaged bool 26 | 27 | func init() { 28 | rootCmd.AddCommand(listCmd) 29 | listCmd.Flags().BoolVar(&onlyManaged, "only-managed", false, "只显示在工作目录中的 worktree") 30 | } 31 | 32 | func runList() error { 33 | wtManager := worktree.NewManager(workdir, fromBranch) 34 | 35 | worktrees, err := wtManager.ListWorktrees() 36 | if err != nil { 37 | return fmt.Errorf("获取 worktree 列表失败: %v", err) 38 | } 39 | 40 | if len(worktrees) == 0 { 41 | fmt.Println("没有找到 worktree") 42 | return nil 43 | } 44 | 45 | fmt.Printf("找到 %d 个 worktree:\n\n", len(worktrees)) 46 | 47 | for i, wt := range worktrees { 48 | // 如果只显示管理的 worktree,过滤掉其他的 49 | if onlyManaged && !strings.HasPrefix(wt.Path, workdir) { 50 | continue 51 | } 52 | 53 | fmt.Printf("%d. 名称: %s\n", i+1, wt.Name) 54 | fmt.Printf(" 路径: %s\n", wt.Path) 55 | fmt.Printf(" 分支: %s\n", wt.Branch) 56 | 57 | // 标记是否是我们管理的 58 | if strings.HasPrefix(wt.Path, workdir) { 59 | fmt.Printf(" 状态: 由 async_agent_runner 管理\n") 60 | } else { 61 | fmt.Printf(" 状态: 外部 worktree\n") 62 | } 63 | fmt.Println() 64 | } 65 | 66 | return nil 67 | } -------------------------------------------------------------------------------- /async_agent_runner/examples/structured_test.md: -------------------------------------------------------------------------------- 1 | # 第一个任务:创建 Web 应用基础结构 2 | 3 | 创建一个基本的 React 应用,包含以下组件: 4 | 5 | - 主页面组件 6 | - 导航栏组件 7 | - 页脚组件 8 | 9 | 要求: 10 | - 使用 TypeScript 11 | - 应用 Tailwind CSS 12 | - 包含基本的路由设置 13 | 14 | # 第二个任务:实现用户认证功能 15 | 16 | 在现有应用基础上添加用户认证功能: 17 | 18 | ## 登录功能 19 | 20 | 实现用户登录表单,包含: 21 | - 用户名/邮箱输入 22 | - 密码输入 23 | - 记住我选项 24 | - 登录按钮 25 | 26 | ## 注册功能 27 | 28 | 实现用户注册表单,包含: 29 | - 用户名输入 30 | - 邮箱输入 31 | - 密码输入 32 | - 确认密码输入 33 | - 注册按钮 34 | 35 | ## 密码重置 36 | 37 | 实现密码重置功能: 38 | - 忘记密码链接 39 | - 邮箱验证 40 | - 新密码设置 41 | 42 | # 第三个任务:添加数据管理功能 43 | 44 | 实现数据的 CRUD 操作: 45 | 46 | ## 数据列表展示 47 | 48 | 创建数据列表页面: 49 | - 表格展示数据 50 | - 分页功能 51 | - 搜索功能 52 | - 排序功能 53 | 54 | ## 数据添加 55 | 56 | 实现数据添加功能: 57 | - 添加表单 58 | - 数据验证 59 | - 提交确认 60 | 61 | ## 数据编辑 62 | 63 | 实现数据编辑功能: 64 | - 编辑表单 65 | - 数据预填充 66 | - 保存更新 67 | 68 | ## 数据删除 69 | 70 | 实现数据删除功能: 71 | - 删除确认对话框 72 | - 批量删除选项 73 | 74 | # 第四个任务:优化和部署 75 | 76 | 完成应用的优化和部署: 77 | 78 | - 代码优化和性能调优 79 | - 单元测试编写 80 | - 构建配置优化 81 | - Docker 容器化 82 | - CI/CD 流水线设置 -------------------------------------------------------------------------------- /async_agent_runner/examples/test.md: -------------------------------------------------------------------------------- 1 | # 任务 1: 创建简单的 Hello World 程序 2 | 3 | 请创建一个简单的 Python 程序,输出 "Hello, World!"。 4 | 5 | 要求: 6 | - 文件名为 hello.py 7 | - 包含适当的注释 8 | - 使用标准的 print 函数 9 | 10 | === 11 | 12 | # 任务 2: 添加命令行参数支持 13 | 14 | 在之前的 hello.py 基础上,添加命令行参数支持。 15 | 16 | 要求: 17 | - 支持 --name 参数来指定问候的对象 18 | - 如果没有提供参数,默认问候 "World" 19 | - 添加帮助信息 20 | 21 | === 22 | 23 | # 任务 3: 创建单元测试 24 | 25 | 为 hello.py 程序创建单元测试。 26 | 27 | 要求: 28 | - 创建 test_hello.py 文件 29 | - 测试默认行为 30 | - 测试带参数的行为 31 | - 使用 pytest 框架 -------------------------------------------------------------------------------- /async_agent_runner/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/williamzhu/auto-coder/async_agent_runner 2 | 3 | go 1.22 4 | 5 | toolchain go1.24.4 6 | 7 | require ( 8 | github.com/inconshreveable/mousetrap v1.1.0 // indirect 9 | github.com/spf13/cobra v1.9.1 // indirect 10 | github.com/spf13/pflag v1.0.6 // indirect 11 | github.com/yuin/goldmark v1.7.12 // indirect 12 | ) 13 | -------------------------------------------------------------------------------- /async_agent_runner/go.sum: -------------------------------------------------------------------------------- 1 | github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= 2 | github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= 3 | github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= 4 | github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 5 | github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= 6 | github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= 7 | github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= 8 | github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= 9 | github.com/yuin/goldmark v1.7.12 h1:YwGP/rrea2/CnCtUHgjuolG/PnMxdQtPMO5PvaE2/nY= 10 | github.com/yuin/goldmark v1.7.12/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= 11 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 12 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 13 | -------------------------------------------------------------------------------- /async_agent_runner/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/williamzhu/auto-coder/async_agent_runner/cmd" 7 | ) 8 | 9 | func main() { 10 | if err := cmd.Execute(); err != nil { 11 | os.Exit(1) 12 | } 13 | } -------------------------------------------------------------------------------- /async_agent_runner/scripts/build.sh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /auto_coder_installer/.gitignore: -------------------------------------------------------------------------------- 1 | bin/ -------------------------------------------------------------------------------- /auto_coder_installer/Makefile: -------------------------------------------------------------------------------- 1 | BINARY_NAME=auto-coder-installer 2 | 3 | build: 4 | GOOS=darwin GOARCH=amd64 go build -o ./bin/${BINARY_NAME}-darwin main.go 5 | GOOS=linux GOARCH=amd64 go build -o ./bin/${BINARY_NAME}-linux main.go 6 | 7 | build-win: 8 | mkdir -p ./bin/${BINARY_NAME}-windows 9 | GOOS=windows GOARCH=amd64 go build -o ./bin/${BINARY_NAME}-windows/${BINARY_NAME}-windows.exe -ldflags="-H windowsgui" gui/main.go 10 | cp gui.exe.manifest ./bin/${BINARY_NAME}-windows/${BINARY_NAME}-windows.exe.manifest 11 | cd ./bin && zip -r ${BINARY_NAME}-windows.zip ${BINARY_NAME}-windows 12 | 13 | build-win-cmd: 14 | mkdir -p ./bin/${BINARY_NAME}-windows-cmd 15 | GOOS=windows GOARCH=amd64 go build -o ./bin/${BINARY_NAME}-windows-cmd/${BINARY_NAME}-windows.exe main.go 16 | cd ./bin && zip -r ${BINARY_NAME}-windows-cmd.zip ${BINARY_NAME}-windows-cmd 17 | 18 | clean: 19 | go clean 20 | rm -rf ./bin/* -------------------------------------------------------------------------------- /auto_coder_installer/READE.md: -------------------------------------------------------------------------------- 1 | # auto-coder 安装命令 2 | 3 | 目前提供了 windows 下的安装命令,可以在下列网址下载: https://gitee.com/allwefantasy/auto-coder/blob/master/auto_coder_installer/auto-coder-installer-windows-cmd-2014-06-19.zip 解压后,在 powershell 或者 cmd 中执行: 4 | 5 | ```shell 6 | auto-coder-installer-windows-cmd.exe install 7 | ``` 8 | 9 | 安装时长根据网速,此外,windows 版本默认不支持 byzerllm storage。 -------------------------------------------------------------------------------- /auto_coder_installer/auto-coder-installer-windows-cmd-2014-06-19.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allwefantasy/auto-coder/HEAD/auto_coder_installer/auto-coder-installer-windows-cmd-2014-06-19.zip -------------------------------------------------------------------------------- /auto_coder_installer/cmd/root.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "github.com/spf13/cobra" 7 | ) 8 | 9 | var rootCmd = &cobra.Command{ 10 | Use: "auto-coder-installer", 11 | Short: "Auto-Coder installation tool", 12 | Long: `This tool will install Miniconda, create an auto-coder environment, 13 | and install the latest auto-coder package.`, 14 | Run: func(cmd *cobra.Command, args []string) { 15 | fmt.Println("Use 'auto-coder-installer install' to begin installation.") 16 | }, 17 | } 18 | 19 | func Execute() { 20 | if err := rootCmd.Execute(); err != nil { 21 | fmt.Println(err) 22 | os.Exit(1) 23 | } 24 | } -------------------------------------------------------------------------------- /auto_coder_installer/go.mod: -------------------------------------------------------------------------------- 1 | module auto-coder/installer 2 | 3 | go 1.22.4 4 | 5 | require ( 6 | github.com/lxn/walk v0.0.0-20210112085537-c389da54e794 7 | github.com/spf13/cobra v1.8.1 8 | ) 9 | 10 | require ( 11 | github.com/akavel/rsrc v0.10.2 // indirect 12 | github.com/inconshreveable/mousetrap v1.1.0 // indirect 13 | github.com/lxn/win v0.0.0-20210218163916-a377121e959e // indirect 14 | github.com/spf13/pflag v1.0.5 // indirect 15 | golang.org/x/sys v0.21.0 // indirect 16 | gopkg.in/Knetic/govaluate.v3 v3.0.0 // indirect 17 | ) 18 | -------------------------------------------------------------------------------- /auto_coder_installer/gui.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | PerMonitorV2, PerMonitor 12 | True 13 | 14 | 15 | -------------------------------------------------------------------------------- /auto_coder_installer/gui/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "auto-coder/installer/cmd" 5 | 6 | "github.com/lxn/walk" 7 | . "github.com/lxn/walk/declarative" 8 | ) 9 | 10 | func main() { 11 | var window *walk.MainWindow 12 | 13 | MainWindow{ 14 | AssignTo: &window, 15 | Title: "Auto-Coder Installer", 16 | Size: Size{400, 300}, 17 | Layout: VBox{}, 18 | Children: []Widget{ 19 | PushButton{ 20 | Text: "Install Auto-Coder", 21 | OnClicked: func() { 22 | cmd.Execute() 23 | }, 24 | }, 25 | }, 26 | }.Create() 27 | 28 | window.Run() 29 | } 30 | -------------------------------------------------------------------------------- /auto_coder_installer/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "auto-coder/installer/cmd" 5 | ) 6 | 7 | func main() { 8 | cmd.Execute() 9 | } -------------------------------------------------------------------------------- /deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 项目名称 4 | project="auto_coder" 5 | 6 | # 使用Python一行命令提取版本号,减少对grep和cut的依赖 7 | version=$(python -c "with open('src/autocoder/version.py') as f: print([line.split('=')[1].strip().strip('\"') for line in f if '__version__' in line][0])") 8 | echo "Version: $version" 9 | 10 | # 清理dist目录 11 | echo "Clean dist" 12 | rm -rf ./dist/* 13 | 14 | # 卸载当前安装的项目版本 15 | echo "Uninstall ${project}" 16 | pip uninstall -y ${project} 17 | 18 | # 构建项目 19 | echo "Build ${project} ${version}" 20 | python setup.py sdist bdist_wheel 21 | cd ./dist/ 22 | 23 | # 安装新构建的项目版本 24 | echo "Install ${project} ${version}" 25 | pip install ${project}-${version}-py3-none-any.whl && cd - 26 | 27 | # 默认模式设定 28 | export MODE=${MODE:-"release"} 29 | 30 | # 发布模式下的操作 31 | if [[ ${MODE} == "release" ]]; then 32 | git tag v${version} 33 | git push origin v${version} # 请根据实际情况使用正确的远程仓库名 34 | echo "Upload ${project} ${version}" 35 | twine upload dist/* 36 | fi 37 | 38 | -------------------------------------------------------------------------------- /docs/ac_module_article_outline.md: -------------------------------------------------------------------------------- 1 | 2 | # AC Module 公众号文章大纲 3 | 4 | ## 文章标题 5 | AC Module: 和编程语言无关以AI为中心的自包含模块化组织 6 | 7 | ## 核心观点 8 | AC模块是一种新的模块化组织方式,专为AI时代设计,通过自包含的文档化模块实现跨语言、AI友好的代码组织。 9 | 10 | ## 文章结构框架 11 | 12 | ### 1. 引言:AI时代的代码组织挑战 13 | - 传统模块化的局限性 14 | - AI需要理解代码的新需求 15 | - 跨语言协作的复杂性 16 | 17 | ### 2. AC模块的核心理念 18 | - 以AI为中心的设计思想 19 | - 语言无关的模块定义 20 | - 自包含的文档化模块 21 | 22 | ### 3. AC模块的关键特性 23 | - Token限制约束下的精简设计 24 | - 完整的功能文档化 25 | - 标准化的模块结构 26 | - 依赖关系的清晰表达 27 | 28 | ### 4. AC模块的实际应用 29 | - 文件监控模块案例分析 30 | - 从传统代码到AC模块的转换 31 | - 实际开发中的使用体验 32 | 33 | ### 5. AC模块 vs 传统模块化 34 | - 与传统包管理的对比 35 | - 与微服务架构的对比 36 | - 与组件化开发的对比 37 | 38 | ### 6. AC模块的技术实现 39 | - .ac.mod.md文件格式 40 | - 模块发现和加载机制 41 | - 依赖管理策略 42 | 43 | ### 7. AC模块的价值与意义 44 | - 提升AI理解代码的能力 45 | - 降低跨语言开发复杂度 46 | - 促进代码复用和标准化 47 | 48 | ### 8. 未来展望 49 | - AC模块生态的发展方向 50 | - 与AI开发工具的集成 51 | - 社区标准化的可能性 52 | 53 | ## 目标读者 54 | - 软件架构师 55 | - AI/LLM应用开发者 56 | - 对模块化设计感兴趣的开发者 57 | - 技术管理者 58 | 59 | ## 文章特色 60 | - 理论与实践结合 61 | - 具体案例分析 62 | - 前瞻性思考 63 | - 易于理解的技术解释 64 | 65 | ## 预期效果 66 | - 让读者理解AC模块的价值 67 | - 启发对AI时代代码组织的思考 68 | - 推广AC模块的理念和实践 69 | -------------------------------------------------------------------------------- /docs/ac_module_article_short.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # AC Module:AI时代的模块化新思路 4 | 5 | ## 核心观点 6 | 7 | 在AI深度参与软件开发的今天,传统的代码组织方式已经不能满足AI理解和处理的需求。AC Module提出了一种全新的模块化理念:**以AI为中心,语言无关,自包含的文档化模块**。 8 | 9 | ## 问题背景 10 | 11 | 当你让AI帮你实现一个功能时,它面临着: 12 | - **信息碎片化**:功能散布在多个文件中 13 | - **文档与代码分离**:API文档可能过时 14 | - **Token限制**:复杂模块超出模型上下文窗口 15 | - **语言特定性**:不同语言有不同的模块化方式 16 | 17 | ## AC模块的解决方案 18 | 19 | ### 核心特性 20 | 1. **Token限制约束**:每个模块必须在大模型上下文窗口内 21 | 2. **标准化结构**:统一的文档格式和组织方式 22 | 3. **自包含文档**:一个`.ac.mod.md`文件包含所有信息 23 | 4. **语言无关**:相同的概念可以跨语言实现 24 | 25 | ### 实际案例对比 26 | 27 | **传统方式:** 28 | ``` 29 | src/file_monitor/ 30 | ├── __init__.py # 简单导入 31 | ├── monitor.py # 2000行实现 32 | ├── utils.py # 500行工具函数 33 | └── exceptions.py # 200行异常定义 34 | docs/api.md # 可能过时的文档 35 | tests/test_monitor.py # 分离的测试 36 | ``` 37 | 38 | **AC模块方式:** 39 | ``` 40 | src/file_monitor/ 41 | ├── __init__.py # 模块接口 42 | ├── monitor.py # 核心实现 43 | ├── test_file_monitor.py # 完整测试 44 | └── .ac.mod.md # 自包含文档 45 | ``` 46 | 47 | AI只需读取`.ac.mod.md`就能完全理解模块的功能、用法、依赖和验证方法。 48 | 49 | ## 核心价值 50 | 51 | 1. **提升AI理解能力**:一个文件包含所有必要信息 52 | 2. **降低跨语言复杂度**:统一的抽象层 53 | 3. **促进标准化**:强制文档驱动的设计思考 54 | 55 | ## 技术实现 56 | 57 | AC模块的核心是`.ac.mod.md`文件,包含: 58 | - 功能描述和使用场景 59 | - 完整的API文档和示例 60 | - 依赖关系的可视化图表 61 | - 功能验证命令 62 | 63 | ## 应用场景 64 | 65 | - **AI辅助开发**:AI直接基于文档生成代码 66 | - **代码审查**:快速理解模块设计 67 | - **新人入职**:通过AC模块了解项目架构 68 | 69 | ## 未来展望 70 | 71 | AC模块有潜力成为AI时代的标准模块化方式,推动: 72 | - 标准化工具链的建设 73 | - AI驱动的智能开发 74 | - 跨语言生态的统一 75 | 76 | ## 结语 77 | 78 | AC Module不仅是代码组织方式的创新,更是面向AI时代的软件工程思维转变。它告诉我们,好的模块化不仅要考虑代码的组织,更要考虑**知识的组织**。 79 | 80 | 在AI深度参与软件开发的时代,我们需要用AI的视角重新审视传统做法。AC模块只是开始,未来还会有更多面向AI的软件工程实践出现。 81 | 82 | **让我们一起拥抱AI驱动的软件开发新时代!** 83 | 84 | --- 85 | 86 | *关键词:AI开发、模块化、软件架构、大语言模型* 87 | 88 | -------------------------------------------------------------------------------- /docs/how_to_init_project.md: -------------------------------------------------------------------------------- 1 | 2 | 为了调用 auto-coder 库里的任何模块,比如测试或者写一个可执行脚本, 3 | 你需要按顺序准备做如下几件事 4 | 5 | ## 设置项目目录 6 | 7 | 你可以创建一个临时目录,然后将该临时目录设置为项目目录。 8 | 9 | import os 10 | os.chdir("/path/to/your/project") 11 | 12 | ## 设置运行模式为终端模式 13 | from autocoder.run_context import get_run_context, RunMode 14 | get_run_context().set_mode(RunMode.TERMINAL) 15 | 16 | ## 导入启动必要的模块 17 | import subprocess 18 | from autocoder.auto_coder_runner import ( 19 | load_tokenizer, 20 | initialize_system, 21 | InitializeSystemRequest, 22 | start as start_engine, 23 | stop as stop_engine, 24 | auto_command, 25 | configure, 26 | add_files, 27 | save_memory, 28 | get_memory, 29 | init_project_if_required 30 | ) 31 | 32 | def setup_environment(): 33 | """设置环境和初始化系统""" 34 | print("🚀 开始初始化 Auto-Coder 环境...") 35 | 36 | # 1. 加载 tokenizer 37 | print("📚 加载 tokenizer...") 38 | load_tokenizer() 39 | 40 | # 2. 启动引擎 41 | print("⚙️ 启动引擎...") 42 | start_engine() 43 | 44 | # 3. 基本配置 45 | print("🔧 配置基本参数...") 46 | configure("product_mode:lite", skip_print=True) 47 | configure("skip_build_index:true", skip_print=True) 48 | configure("skip_confirm:true", skip_print=True) 49 | configure("silence:false", skip_print=True) # 显示详细输出 50 | configure("auto_merge:editblock", skip_print=True) 51 | 52 | print("✅ 环境初始化完成!") 53 | 54 | 55 | ## 获取模型 get_llm 56 | 57 | from autocoder.utils.llms import get_single_llm 58 | llm = get_single_llm("模型名字", product_mode="lite") 59 | 60 | 61 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "@typescript-eslint/parser", 4 | "parserOptions": { 5 | "ecmaVersion": 6, 6 | "sourceType": "module" 7 | }, 8 | "plugins": [ 9 | "@typescript-eslint" 10 | ], 11 | "rules": { 12 | "@typescript-eslint/naming-convention": [ 13 | "warn", 14 | { 15 | "selector": "import", 16 | "format": [ "camelCase", "PascalCase" ] 17 | } 18 | ], 19 | "@typescript-eslint/semi": "warn", 20 | "curly": "warn", 21 | "eqeqeq": "warn", 22 | "no-throw-literal": "warn", 23 | "semi": "off" 24 | }, 25 | "ignorePatterns": [ 26 | "out", 27 | "dist", 28 | "**/*.d.ts" 29 | ] 30 | } -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore Mac .DS_Store files 2 | .DS_Store 3 | **/.DS_Store 4 | .DS_Store? 5 | 6 | # Ignore files generated by the IDE 7 | .idea/ 8 | 9 | # Ignore compiled binaries 10 | *.exe 11 | *.dll 12 | *.so 13 | 14 | # Ignore build output directories 15 | /bin/ 16 | /build/ 17 | /dist/ 18 | 19 | # Ignore package manager directories 20 | /node_modules/ 21 | /vendor/ 22 | 23 | # Ignore log files 24 | *.log 25 | 26 | # Ignore temporary files 27 | *.tmp 28 | *.swp 29 | # Ignore Python cache files 30 | __pycache__/ 31 | output.txt 32 | screenshots/ 33 | ./output.txt 34 | 35 | .auto-coder/metadata.db 36 | notebooks/conversations.json 37 | notebooks/pandoc-3.2-x86_64-macOS.pkg 38 | docs/zh/.auto-coder/metadata.db 39 | ide_plugins/vscode/auto-coder/node_modules 40 | ide_plugins/vscode/auto-cocder/build 41 | ide_plugins/vscode/auto-coder/*.vsix 42 | ide_plugins/vscode/auto-coder/dist/ 43 | ide_plugins/vscode/auto-coder/package-lock.json 44 | .auto-coder/metadata.db 45 | ide_plugins/vscode/auto-coder/web/package-lock.json 46 | .auto-coder 47 | output.txt 48 | auto_coder_installer/bin 49 | **/node_modules/ 50 | **/*.vsix -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/.vscode-test.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from '@vscode/test-cli'; 2 | 3 | export default defineConfig({ 4 | files: '${workspaceFolder}/out/test/**/*.test.js', 5 | }); 6 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher", "ms-vscode.extension-test-runner"] 5 | } 6 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [ 8 | { 9 | "name": "Run Extension", 10 | "type": "extensionHost", 11 | "request": "launch", 12 | "args": [ 13 | "--extensionDevelopmentPath=${workspaceFolder}" 14 | ], 15 | "outFiles": [ 16 | "${workspaceFolder}/dist/**/*.js" 17 | ], 18 | "preLaunchTask": "${defaultBuildTask}" 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.exclude": { 4 | "out": false, // set this to true to hide the "out" folder with the compiled JS files 5 | "dist": false // set this to true to hide the "dist" folder with the compiled JS files 6 | }, 7 | "search.exclude": { 8 | "out": true, // set this to false to include "out" folder in search results 9 | "dist": true // set this to false to include "dist" folder in search results 10 | }, 11 | // Turn off tsc task auto detection since we have the necessary tasks as npm scripts 12 | "typescript.tsc.autoDetect": "off" 13 | } 14 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$ts-webpack-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never", 13 | "group": "watchers" 14 | }, 15 | "group": { 16 | "kind": "build", 17 | "isDefault": true 18 | } 19 | }, 20 | { 21 | "type": "npm", 22 | "script": "watch-tests", 23 | "problemMatcher": "$tsc-watch", 24 | "isBackground": true, 25 | "presentation": { 26 | "reveal": "never", 27 | "group": "watchers" 28 | }, 29 | "group": "build" 30 | }, 31 | { 32 | "label": "tasks: watch-tests", 33 | "dependsOn": [ 34 | "npm: watch", 35 | "npm: watch-tests" 36 | ], 37 | "problemMatcher": [] 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/** 4 | node_modules/** 5 | src/** 6 | .gitignore 7 | .yarnrc 8 | webpack.config.js 9 | vsc-extension-quickstart.md 10 | **/tsconfig.json 11 | **/.eslintrc.json 12 | **/*.map 13 | **/*.ts 14 | **/.vscode-test.* 15 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to the "auto-coder" extension will be documented in this file. 4 | 5 | Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. 6 | 7 | ## [Unreleased] 8 | 9 | - Initial release -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all clean install build package 2 | 3 | # Variables 4 | VSCE := npx vsce 5 | NPM := npm 6 | 7 | # Default target 8 | all: clean install build package 9 | 10 | # Clean the project 11 | clean: 12 | @echo "Cleaning..." 13 | rm -rf node_modules 14 | rm -rf dist 15 | rm -f *.vsix 16 | 17 | # Install dependencies 18 | install: 19 | @echo "Installing dependencies..." 20 | $(NPM) install 21 | 22 | # Build the project 23 | build: 24 | @echo "Building..." 25 | $(NPM) run compile 26 | 27 | # Package the extension 28 | package: 29 | @echo "Packaging..." 30 | $(VSCE) package 31 | 32 | # Install and build 33 | dev: clean install build 34 | 35 | # Run tests 36 | test: 37 | @echo "Running tests..." 38 | $(NPM) test 39 | 40 | # Publish the extension (for maintainers only) 41 | publish: 42 | @echo "Publishing..." 43 | $(VSCE) publish 44 | 45 | # Help target 46 | help: 47 | @echo "Available targets:" 48 | @echo " all : Clean, install dependencies, build, and package" 49 | @echo " clean : Remove build artifacts and dependencies" 50 | @echo " install : Install dependencies" 51 | @echo " build : Compile the extension" 52 | @echo " package : Create a .vsix package" 53 | @echo " dev : Clean, install, and build (for development)" 54 | @echo " test : Run tests" 55 | @echo " publish : Publish the extension (for maintainers only)" 56 | @echo " help : Show this help message" 57 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/README.md: -------------------------------------------------------------------------------- 1 | # auto-coder README 2 | 3 | auto-coder is a Visual Studio Code extension based on [auto-coder](https://github.com/allwefantasy/auto-coder) that helps you to develop your project powered by AI. 4 | 5 | ## Features 6 | 7 | 1. right click the workspace folder in the explorer, and then click the `auto-coder: 创建需求` menu, then the auto-coder will create a yaml file in actions folder by executing a command in terminal. 8 | 2. right click the yaml file in the explorer, and then click the `auto-coder: 执行` menu, the yaml file will be executed in terminal. 9 | 10 | Make sure the terminal in vscode you have set the right python environment, which should have python command auto-coder installed. 11 | 12 | ## Requirements 13 | 14 | None 15 | 16 | ## Extension Settings 17 | 18 | 19 | 20 | ## Known Issues 21 | 22 | 23 | 24 | ## Release Notes 25 | 26 | Users appreciate release notes as you update your extension. 27 | 28 | ### 0.0.1 29 | 30 | Initial release of auto-coder 31 | 32 | --- 33 | 34 | **Enjoy!** 35 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/000_example.yml: -------------------------------------------------------------------------------- 1 | 2 | include_file: 3 | - ./base/base.yml 4 | - ./base/enable_index.yml 5 | - ./base/enable_wholefile.yml 6 | 7 | query: | 8 | YOUR QUERY HERE -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/102_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: false 3 | include_file: 4 | - ./base/base.yml 5 | query: create_yaml.tsx 要支持dark模式,跟随vscode的theme主题 6 | skip_build_index: true 7 | skip_confirm: true 8 | urls: 9 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 16 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/103_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: create_yaml.tsx 要支持dark模式,跟随vscode的theme主题 6 | skip_build_index: true 7 | skip_confirm: true 8 | urls: 9 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 16 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/104_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 写一个makefile 给 vscode插件打包 6 | skip_build_index: true 7 | skip_confirm: true 8 | urls: 9 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 16 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 17 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/105_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: "获取terminal的时候,检查是不是有叫 auto-coder-vscode 的terminal,如果没有新建一个并且名字改成auto-coder-vscode,\n\ 6 | \ 如果有则找到该terminal" 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 18 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/106_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: create_yaml.ts 支持新增参数human_as_model:true/false,默认false, auto_merge:editblock/wholefile/diff,默认editblock skip_build_index:true/false 6 | 默认false,skip_confirm:true/false 默认 true,include_file,可以让用户选择文件,默认./base/base.yml, 7 | 此外还有query,是一个富文本输入框,urls 允许用户添加多个路径,要使用路径选择组件. 8 | skip_build_index: true 9 | skip_confirm: true 10 | urls: 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 19 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/107_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: submitForm 中,遍历 actions目录里的文件,按 _ 分割文件,获取第一部分,然后转化成数字排序,得到最大的数字,然后加1,重新转化为三位数字,然后拼接 6 | _plugin_action.yml,得到一个新文件,然后写入获取到的message字段,形成Yaml,写入到新文件. 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/utils/__init__.py 19 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/108_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: submitForm 中,遍历 actions目录里的文件,按 _ 分割文件,获取第一部分,然后转化成数字排序,得到最大的数字,然后加1,重新转化为三位数字,然后拼接 6 | _plugin_action.yml,得到一个新文件,然后写入获取到的message字段,形成Yaml,写入到新文件. 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/utils/__init__.py 19 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/109_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: create_yaml里 form里的字段名需要用小写下划线而不是驼峰命名 6 | skip_build_index: true 7 | skip_confirm: true 8 | urls: 9 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 16 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 17 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/utils/__init__.py 18 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/110_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: create_yaml里 form里的字段名需要用小写下划线而不是驼峰命名 6 | skip_build_index: true 7 | skip_confirm: true 8 | urls: 9 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 16 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 17 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/utils/__init__.py 18 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/111_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: create_yaml里的include_file 改成数组类型 6 | skip_build_index: true 7 | skip_confirm: true 8 | urls: 9 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 16 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 17 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/utils/__init__.py 18 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/112_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: handleSubmitForm 要在vscode里打开刚创建的文件 6 | skip_build_index: true 7 | skip_confirm: true 8 | urls: 9 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 16 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 17 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/utils/__init__.py 18 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/113_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: handleSubmitForm 要在vscode里打开刚创建的文件 6 | skip_build_index: true 7 | skip_confirm: true 8 | urls: 9 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 16 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 17 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/utils/__init__.py 18 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/114_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: getOrCreateAutoCoderTerminal 里创建后,执行 conda activate auto-coder 6 | skip_build_index: true 7 | skip_confirm: true 8 | urls: 9 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 16 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 17 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/utils/__init__.py 18 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/115_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 监控vscode切换tab的实践,获得当前tab对应的文件路径,如果存在 .auto-coder目录,写入active_editor.json文件 6 | skip_build_index: true 7 | skip_confirm: true 8 | urls: 9 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 16 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 17 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/utils/__init__.py 18 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/116_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 'updateActiveEditorFile 改成获取当前activeTab 以及其他Tab, json文件格式为: {"activeFile":{"path":""},"filePaths":[{"path":""}]}' 6 | skip_build_index: true 7 | skip_confirm: true 8 | urls: 9 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 16 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 17 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/utils/__init__.py 18 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/117_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 修改updateActiveEditorFile files 部分改成當前打開的所有編輯器對應的路徑 6 | skip_build_index: true 7 | skip_confirm: true 8 | urls: 9 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 16 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 17 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/utils/__init__.py 18 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/118_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 添加一個菜單選項 auto-coder:chat 點擊後打開一個新頁面,參考 create_yaml 使用的技術,創建一個簡潔的聊天對話頁面 6 | skip_build_index: true 7 | skip_confirm: true 8 | urls: 9 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 16 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 17 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/utils/__init__.py 18 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/119_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 插件啟動時,啟動一個python進程,檢測一個可用端口,然後調用 auto-coder.serve --host 127.0.0.1 --port 8080 6 | 啟動 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/utils/__init__.py 19 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/120_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 彈出框讓用戶選擇一個合適的運行auto-coder的python環境. startAutoCoderServer 得到的端口要給到一個全局變量方便後續使用 6 | skip_build_index: true 7 | skip_confirm: true 8 | urls: 9 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 16 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 17 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/utils/__init__.py 18 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/121_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 'Chat 可以訪問使用類似 import requests 6 | 7 | import json 8 | 9 | 10 | v = requests.post(''http://127.0.0.1:8000/chat'', json={"query":"auto_coder_server 11 | 這個文件是幹嘛的"}) 12 | 13 | print(v.json()) 的方式進行聊天.其中 8000這裡需要改成 auto-coder 的端口' 14 | skip_build_index: true 15 | skip_confirm: true 16 | urls: 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 18 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 19 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 20 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 21 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 22 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 23 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 24 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 25 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/utils/__init__.py 26 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/122_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 'Chat 可以訪問使用類似 import requests 6 | 7 | import json 8 | 9 | 10 | v = requests.post(''http://127.0.0.1:8000/chat'', json={"query":"auto_coder_server 11 | 這個文件是幹嘛的"}) 12 | 13 | print(v.json()) 的方式進行聊天.其中 8000這裡需要改成 auto-coder 的端口. 該接口是異步的,你得到的結果類似這樣: {"request_id":"d80cbae4-fb86-4027-8b21-b3346839bd0e"} 14 | 接著通過request_id 像這樣獲取實際結果: v = requests.get(''http://127.0.0.1:8000/result/d80cbae4-fb86-4027-8b21-b3346839bd0e'') 15 | 16 | print(v.json()) 你需要不斷輪訓,直到 200 狀態碼,最後通過 json的result拿到實際值的' 17 | skip_build_index: true 18 | skip_confirm: true 19 | urls: 20 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 21 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 22 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 23 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 24 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 25 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 26 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 27 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 28 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/utils/__init__.py 29 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/123_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 'Chat 可以訪問使用類似 import requests 6 | 7 | import json 8 | 9 | 10 | v = requests.post(''http://127.0.0.1:8000/chat'', json={"query":"auto_coder_server 11 | 這個文件是幹嘛的"}) 12 | 13 | print(v.json()) 的方式進行聊天.其中 8000這裡需要改成 auto-coder 的端口. 該接口是異步的,你得到的結果類似這樣: {"request_id":"d80cbae4-fb86-4027-8b21-b3346839bd0e"} 14 | 接著通過request_id 像這樣獲取實際結果: v = requests.get(''http://127.0.0.1:8000/result/d80cbae4-fb86-4027-8b21-b3346839bd0e'') 15 | 16 | print(v.json()) 你需要不斷輪訓,直到 200 狀態碼,最後通過 json的result拿到實際值的' 17 | skip_build_index: true 18 | skip_confirm: true 19 | urls: 20 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 21 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 22 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 23 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 24 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 25 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 26 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 27 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 28 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/124_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: auto-coder-serve 是一个python 命令行 目前的启动方式不太合适,有没有更好的办法? 6 | skip_build_index: true 7 | skip_confirm: true 8 | urls: 9 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 17 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/125_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: child_process 要设置一个工作目录,为当前项目的目录 6 | skip_build_index: true 7 | skip_confirm: true 8 | urls: 9 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 17 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/126_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: ChatView 初始化时通过访问 /list_files 接口(你得到的json格式为 {"files":[]}),告诉用户可以询问这些文件相关内容 6 | skip_build_index: true 7 | skip_confirm: true 8 | urls: 9 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 17 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/127_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: chat页面输入框右侧多一个指令下拉款.指令为接口的所有名称,比如 /list_files, /add_files, 排除掉 /result. 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 20 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/128_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: chat页面指令下拉框默认是为/chat 点击发送后不需要重置,继续保持.对每个指令结合对后端接口的理解,完成和后端的交互. 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 20 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/129_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 'chat页面 Object literal may only specify known properties, and ''files'' does 6 | not exist in type ''{ query: string; }''.ts(2353)' 7 | query_suffix: python文件仅供参考,不允许修改 8 | skip_build_index: true 9 | skip_confirm: true 10 | urls: 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 18 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 20 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 21 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/130_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 当用户选择 /conf 指令时,右侧多出一个下拉框,里面展示 /set, /drop, /list 指令.如果用户选择了 /set 指令,当用户在右侧input框输入时,自动根据 6 | /extra/conf/list 里的内容进行补全. 7 | query_suffix: python文件仅供参考,不允许修改 8 | skip_build_index: true 9 | skip_confirm: true 10 | urls: 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 18 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 20 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 21 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/131_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: chatview页面中,当用户选择了/conf 以及对应的 /set子命令时,input 输入框需要监听用户输入,然后根据configOptions 6 | 做自动补全,用一个补全列表弹出框 7 | query_suffix: python文件仅供参考,不允许修改 8 | skip_build_index: true 9 | skip_confirm: true 10 | urls: 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 18 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 20 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 21 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/132_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: chatview页面中,补全款的位置不对,需要跟随在输入框里的光标位置 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 20 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/133_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: chatview页面中,增加一个页面加载状态,通过访问 http://127.0.0.1:${autoCoderServerPort}/list_files 6 | 状态码,如果是200则表示后端ready,可以展示 7 | query_suffix: python文件仅供参考,不允许修改 8 | skip_build_index: true 9 | skip_confirm: true 10 | urls: 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 18 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 20 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 21 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/134_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: chatview頁面,底部一個間距給到補全展示用 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 20 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/135_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: chatview頁面,底部的選項框,輸入框等元素要保持一個合適的間距 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 20 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/136_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: chatview頁面,底部的選項框,輸入框等元素要保持一個合適的間距 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 20 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/137_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: chatview頁面,底部的選項框,輸入框等元素要保持一個合適的間距 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 20 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/138_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: '在 utils.ts 裡實現輪訓http://127.0.0.1:${port}/extra/result/${requestId} 的邏輯,接口返回的格式為: 6 | {"result": result.value.value, "status": result.status.value} stauts 狀態為 running,completed,failed 7 | 三個,result字符串數組.,你可以join後保存狀態,以打字機效果最終呈現出來' 8 | query_suffix: python文件仅供参考,不允许修改 9 | skip_build_index: true 10 | skip_confirm: true 11 | urls: 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 18 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 19 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 20 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 21 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 22 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 23 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/139_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: chatview頁面中的 if (endpoint === '/chat' || endpoint === '/coding') 後面部分使用 utils中的pollResult 6 | 函數 7 | query_suffix: python文件仅供参考,不允许修改 8 | skip_build_index: true 9 | skip_confirm: true 10 | urls: 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 18 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 20 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 21 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 22 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/140_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: utils.ts 裡的 data 要搞成一個 interface,然後判別interface 類型 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 20 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 21 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/141_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: checkBackendReady 也放到 utils.ts裡去,然後通過回調來調用 setIsBackendReady 等 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 20 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 21 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/142_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 參考checkBackendReady,把fetchConfigOptions,fetchFileList 也遷移到 utils.ts裡去 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 20 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 21 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/types.ts 22 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/143_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: autoCoderId 用戶選擇一次後,持久化下來,就不用咋次選擇了 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 20 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 21 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/types.ts 22 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/144_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 如何允许用户修改 autoCoder.pythonEnvironmentPath 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 20 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 21 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/types.ts 22 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/145_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: vscode切换标签时,如何让 ChatView 保持状态 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 20 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 21 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/types.ts 22 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/146_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: if (endpoint === '/coding') { 后面的逻辑,主要放在 coding.ts 文件里.基本逻辑向 /code 接口发起请求,得到reuquest_id,然后监听接口/extra/event/get 6 | 获取事件,根据事件在对话框里提出问题.比如当监听到 code_start 事件,发送一个消息给用户,询问是否真的开始.用户回复y/n 后再调用/extra/event/reponse 7 | 进行回复. 8 | query_suffix: python文件仅供参考,不允许修改 9 | skip_build_index: true 10 | skip_confirm: true 11 | urls: 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 18 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 19 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 20 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 21 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 22 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 23 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/types.ts 24 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/coding.ts 25 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/147_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 实现 getUserResponse 方法 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 20 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 21 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/types.ts 22 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/coding.ts 23 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/148_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 实现 getUserResponse 方法 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 20 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 21 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/types.ts 22 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/coding.ts 23 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/149_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 在 coding.ts 获取messagesRef["messages"]长度似乎不会变,是因为闭包或者其他原因导致 messageRef 的值呗复制了而不是引用么?另外发现 6 | awaitingUserResponse为true,但是依然还是会执行 handleCoding 7 | query_suffix: python文件仅供参考,不允许修改 8 | skip_build_index: true 9 | skip_confirm: true 10 | urls: 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 18 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 19 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/chat_auto_coder.py 20 | - /Users/allwefantasy/projects/auto-coder/src/autocoder/auto_coder_server.py 21 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 22 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/types.ts 23 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/coding.ts 24 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/150_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: '在 coding.ts console.log("awaitingUserResponse: ", awaitingUserResponse) 打印为true,为什么 6 | handleCoding还是会执行' 7 | query_suffix: python文件仅供参考,不允许修改 8 | skip_build_index: true 9 | skip_confirm: true 10 | urls: 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 18 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 19 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 20 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/types.ts 21 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/coding.ts 22 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/153_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: ChatView 最好支持富文本格式 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 19 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/types.ts 20 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/coding.ts 21 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/154_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 'The current file is a CommonJS module whose imports will produce ''require'' 6 | calls; however, the referenced file is an ECMAScript module and cannot be imported 7 | with ''require''. Consider writing a dynamic ''import("markdown-to-jsx")'' call 8 | instead. To convert this file to an ECMAScript module, add the field "type": "module" 9 | to' 10 | query_suffix: python文件仅供参考,不允许修改 11 | skip_build_index: true 12 | skip_confirm: true 13 | urls: 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 15 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/156_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 有什么办法在 ChatView里内置markdown渲染么 我们现在无法使用 react-markdown 等库 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 11 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/157_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 开发一个markdown渲染组件,主要支持代码解析,然后放在 markdown.ts里 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 11 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/158_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: ChatView 里的聊天信息展示,发送后有适当的动态效果,让他看起来和现代聊天软件更像.此外要支持\n换行等 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 11 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/159_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: ChatView 的聊天信息,添加一个特殊的组件,一个日志实时展示的组件.不要引入第三方库 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 11 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/160_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: ChatView 的聊天信息,添加一个特殊的组件,一个日志实时展示的组件.不要引入第三方库 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 11 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/161_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: ChatView 的聊天信息,添加一个特殊的组件,一个日志实时展示的组件.不要引入第三方库 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 11 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/162_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: log_pane 需要右侧加一个最小化/最大化图标,点击可以最小化,再点击可以恢复原来大小 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 11 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/163_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: log_pane的最大化最小化图标要好看点,不要加背景色 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 11 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/164_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 新增一个 index_query.ts, 再里面实现 /index/build 指令的处理逻辑.通过 requestId 到/extra/logs 接口获取日志,如果返回的json字段里, 6 | logs字段为null,那么停止轮训,否则里面是数组,通过 addLogMessage 添加到界面上 7 | query_suffix: python文件仅供参考,不允许修改 8 | skip_build_index: true 9 | skip_confirm: true 10 | urls: 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 12 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/165_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: vscode extension如何添加logo 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 11 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/166_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: false 3 | include_file: 4 | - ./base/base.yml 5 | query: 把 id command_pane 改成 command_pane1 6 | query_suffix: python文件仅供参考,不允许修改 7 | silence: true 8 | skip_build_index: true 9 | skip_confirm: true 10 | urls: 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 12 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/167_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: false 3 | include_file: 4 | - ./base/base.yml 5 | query: 使用 pyinstaller 打包,需要requirement里的依赖都带上 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 11 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/168_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 修改 enable_whole file, 添加一个 wow = true 的配置 6 | query_suffix: python文件仅供参考,不允许修改 7 | silence: true 8 | skip_build_index: true 9 | skip_confirm: true 10 | urls: 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 12 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/169_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 通过findAvailablePort 目前依然会发生端口冲突 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 11 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/170_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 通过findAvailablePort 目前依然会发生端口冲突 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 19 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/types.ts 20 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/coding.ts 21 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index_query.ts 22 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/171_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: '添加一个 wow=true的配置 ' 6 | query_suffix: python文件仅供参考,不允许修改 7 | silence: true 8 | skip_build_index: true 9 | skip_confirm: true 10 | urls: 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 12 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/172_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: findAvailablePort 需要确保可用端口测试完后关闭 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 19 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/types.ts 20 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/coding.ts 21 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index_query.ts 22 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/173_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 添加一个新参数 wow:true 6 | query_suffix: python文件仅供参考,不允许修改 7 | silence: true 8 | skip_build_index: true 9 | skip_confirm: true 10 | urls: 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 12 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/174_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: 修改wow:true 6 | query_suffix: python文件仅供参考,不允许修改 7 | silence: true 8 | skip_build_index: true 9 | skip_confirm: true 10 | urls: 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 12 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/175_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: findAvailablePort 依然会找到一个被占用的端口 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 19 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/types.ts 20 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/coding.ts 21 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index_query.ts 22 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/176_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: chat 输入也要严格保持用户输入的文本格式 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 19 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/types.ts 20 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/coding.ts 21 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index_query.ts 22 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/177_chat_action.yml: -------------------------------------------------------------------------------- 1 | auto_merge: editblock 2 | human_as_model: true 3 | include_file: 4 | - ./base/base.yml 5 | query: chat input框也需要保持用户的输入格式,比如\n 6 | query_suffix: python文件仅供参考,不允许修改 7 | skip_build_index: true 8 | skip_confirm: true 9 | urls: 10 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/dark.css 11 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/create_yaml.tsx 12 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/test/extension.test.ts 13 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/extension.ts 14 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.tsx 15 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index.css 16 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/package.json 17 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/ChatView.tsx 18 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/utils.ts 19 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/types.ts 20 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/coding.ts 21 | - /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/src/web/index_query.ts 22 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/base/base.yml: -------------------------------------------------------------------------------- 1 | 2 | project_type: py 3 | source_dir: /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder 4 | target_file: /Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/output.txt 5 | 6 | model: deepseek_chat 7 | model_max_input_length: 30000 8 | enable_multi_round_generate: false 9 | 10 | execute: true 11 | auto_merge: true 12 | human_as_model: true -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/base/enable_diff.yml: -------------------------------------------------------------------------------- 1 | 2 | auto_merge: diff -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/base/enable_index.yml: -------------------------------------------------------------------------------- 1 | 2 | skip_build_index: false 3 | anti_quota_limit: 0 4 | index_filter_level: 1 5 | index_filter_workers: 4 6 | index_build_workers: 4 -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/base/enable_rag_search.yml: -------------------------------------------------------------------------------- 1 | 2 | collections: default 3 | enable_rag_search: | 4 | byzerllm 使用 openai_tts模型的 python 代码 -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/base/enable_search_engine.yml: -------------------------------------------------------------------------------- 1 | 2 | ## Get the search engine token in the environment variable 3 | ## 在环境变量中获取搜索引擎令牌 4 | ## Ask for Bing Search API Token. You can visit https://www.microsoft.com/en-us/bing/apis/bing-web-search-api to get the token. 5 | ## 申请 Bing 搜索API Token。你可以访问 https://www.microsoft.com/en-us/bing/apis/bing-web-search-api 获取 token。 6 | search_engine: bing 7 | search_engine_token: ENV -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/base/enable_wholefile.yml: -------------------------------------------------------------------------------- 1 | 2 | auto_merge: wholefile -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/actions/base/exclude_files.yml: -------------------------------------------------------------------------------- 1 | 2 | exclude_files: 3 | - human://所有包含xxxx目录的路径 4 | - regex://.*\.git.* -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/images/create_req.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allwefantasy/auto-coder/HEAD/ide_plugins/vscode/auto-coder/images/create_req.png -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/images/create_yaml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allwefantasy/auto-coder/HEAD/ide_plugins/vscode/auto-coder/images/create_yaml.png -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/logo-128-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allwefantasy/auto-coder/HEAD/ide_plugins/vscode/auto-coder/logo-128-128.png -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/logo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allwefantasy/auto-coder/HEAD/ide_plugins/vscode/auto-coder/logo.jpeg -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/notebooks/test.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "from PIL import Image\n", 10 | "\n", 11 | "def convert_and_resize_image(input_path, output_path, size=(128, 128)):\n", 12 | " # 打开JPEG图像\n", 13 | " with Image.open(input_path) as img:\n", 14 | " # 调整图像大小\n", 15 | " img_resized = img.resize(size, Image.LANCZOS)\n", 16 | " \n", 17 | " # 保存为PNG格式\n", 18 | " img_resized.save(output_path, 'PNG')\n", 19 | "\n", 20 | "# 使用示例\n", 21 | "input_image = '/Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/logo.jpeg' # 替换为您的输入JPEG文件路径\n", 22 | "output_image = '/Users/allwefantasy/projects/auto-coder/ide_plugins/vscode/auto-coder/logo-128-128.png' # 输出PNG文件的路径\n", 23 | "convert_and_resize_image(input_image, output_image)" 24 | ] 25 | } 26 | ], 27 | "metadata": { 28 | "kernelspec": { 29 | "display_name": "byzerllm", 30 | "language": "python", 31 | "name": "python3" 32 | }, 33 | "language_info": { 34 | "name": "python", 35 | "version": "3.10.11" 36 | } 37 | }, 38 | "nbformat": 4, 39 | "nbformat_minor": 2 40 | } 41 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/src/test/extension.test.ts: -------------------------------------------------------------------------------- 1 | import * as assert from 'assert'; 2 | 3 | // You can import and use all API from the 'vscode' module 4 | // as well as import your extension to test it 5 | import * as vscode from 'vscode'; 6 | // import * as myExtension from '../../extension'; 7 | 8 | suite('Extension Test Suite', () => { 9 | vscode.window.showInformationMessage('Start all tests.'); 10 | 11 | test('Sample test', () => { 12 | assert.strictEqual(-1, [1, 2, 3].indexOf(5)); 13 | assert.strictEqual(-1, [1, 2, 3].indexOf(0)); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/src/web/chatAnimation.css: -------------------------------------------------------------------------------- 1 | @keyframes fadeIn { 2 | from { opacity: 0; transform: translateY(20px); } 3 | to { opacity: 1; transform: translateY(0); } 4 | } 5 | 6 | .message-animation { 7 | animation: fadeIn 0.3s ease-out forwards; 8 | } -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/src/web/dark.css: -------------------------------------------------------------------------------- 1 | /* dark.css */ 2 | .dark { 3 | background-color: #1e1e1e; 4 | color: #d4d4d4; 5 | } 6 | 7 | .dark input { 8 | background-color: #3c3c3c; 9 | color: #d4d4d4; 10 | border-color: #4b5563; 11 | } 12 | 13 | .dark input:focus { 14 | border-color: #007acc; 15 | box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.25); 16 | } 17 | 18 | .dark button { 19 | background-color: #0e639c; 20 | } 21 | 22 | .dark button:hover { 23 | background-color: #1177bb; 24 | } 25 | 26 | .light { 27 | background-color: #ffffff; 28 | color: #000000; 29 | } 30 | 31 | .light input { 32 | background-color: #ffffff; 33 | color: #000000; 34 | border-color: #d1d5db; 35 | } 36 | 37 | .light input:focus { 38 | border-color: #3b82f6; 39 | box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25); 40 | } 41 | 42 | .light button { 43 | background-color: #3b82f6; 44 | } 45 | 46 | .light button:hover { 47 | background-color: #2563eb; 48 | } -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/src/web/index.css: -------------------------------------------------------------------------------- 1 | @import 'tailwindcss/base'; 2 | @import 'tailwindcss/components'; 3 | @import 'tailwindcss/utilities'; -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/src/web/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { createRoot } from 'react-dom/client'; 3 | import './index.css' 4 | import { CreateYAMLView } from './create_yaml'; 5 | import { ChatView } from './ChatView'; 6 | 7 | declare global { 8 | interface Window { 9 | acquireVsCodeApi(): any; 10 | vscodeColorTheme: boolean; 11 | view:string; 12 | } 13 | } 14 | 15 | document.addEventListener('DOMContentLoaded', () => { 16 | const container = document.getElementById('root'); 17 | const root = createRoot(container!); 18 | const colorTheme = window.vscodeColorTheme; 19 | const vscode = window.acquireVsCodeApi(); 20 | const isDarkMode = colorTheme; 21 | const view = window.view; 22 | 23 | if (view === 'chat') { 24 | root.render(); 25 | } else { 26 | root.render(); 27 | } 28 | }); -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/src/web/types.ts: -------------------------------------------------------------------------------- 1 | export interface PollResult { 2 | text: string; 3 | status: 'running' | 'completed' | 'failed'; 4 | } 5 | 6 | export interface StreamValue { 7 | value: string[]; 8 | } 9 | 10 | export interface DefaultValue { 11 | value: string; 12 | } 13 | 14 | export interface ResponseData { 15 | result: StreamValue | DefaultValue; 16 | status: 'running' | 'completed' | 'failed'; 17 | } -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html'], 4 | theme: { 5 | extend: {}, 6 | }, 7 | plugins: [], 8 | } 9 | 10 | -------------------------------------------------------------------------------- /ide_plugins/vscode/auto-coder/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "Node16", 4 | "target": "ES2022", 5 | "jsx": "react", 6 | "lib": [ 7 | "ES2022","DOM" 8 | ], 9 | "sourceMap": true, 10 | "rootDir": "src", 11 | "esModuleInterop": true, 12 | "strict": true, 13 | } 14 | } -------------------------------------------------------------------------------- /logo/auto-coder.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allwefantasy/auto-coder/HEAD/logo/auto-coder.jpeg -------------------------------------------------------------------------------- /pc/app-auto-coder/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es6": true, 5 | "node": true 6 | }, 7 | "extends": [ 8 | "eslint:recommended", 9 | "plugin:@typescript-eslint/eslint-recommended", 10 | "plugin:@typescript-eslint/recommended", 11 | "plugin:import/recommended", 12 | "plugin:import/electron", 13 | "plugin:import/typescript" 14 | ], 15 | "parser": "@typescript-eslint/parser" 16 | } 17 | -------------------------------------------------------------------------------- /pc/app-auto-coder/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | .DS_Store 18 | 19 | # Directory for instrumented libs generated by jscoverage/JSCover 20 | lib-cov 21 | 22 | # Coverage directory used by tools like istanbul 23 | coverage 24 | *.lcov 25 | 26 | # nyc test coverage 27 | .nyc_output 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (https://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # TypeScript v1 declaration files 40 | typings/ 41 | 42 | # TypeScript cache 43 | *.tsbuildinfo 44 | 45 | # Optional npm cache directory 46 | .npm 47 | 48 | # Optional eslint cache 49 | .eslintcache 50 | 51 | # Optional REPL history 52 | .node_repl_history 53 | 54 | # Output of 'npm pack' 55 | *.tgz 56 | 57 | # Yarn Integrity file 58 | .yarn-integrity 59 | 60 | # dotenv environment variables file 61 | .env 62 | .env.test 63 | 64 | # parcel-bundler cache (https://parceljs.org/) 65 | .cache 66 | 67 | # next.js build output 68 | .next 69 | 70 | # nuxt.js build output 71 | .nuxt 72 | 73 | # vuepress build output 74 | .vuepress/dist 75 | 76 | # Serverless directories 77 | .serverless/ 78 | 79 | # FuseBox cache 80 | .fusebox/ 81 | 82 | # DynamoDB Local files 83 | .dynamodb/ 84 | 85 | # Webpack 86 | .webpack/ 87 | 88 | # Vite 89 | .vite/ 90 | 91 | # Electron-Forge 92 | out/ 93 | -------------------------------------------------------------------------------- /pc/app-auto-coder/forge.env.d.ts: -------------------------------------------------------------------------------- 1 | export {}; // Make this a module 2 | 3 | declare global { 4 | // This allows TypeScript to pick up the magic constants that's auto-generated by Forge's Vite 5 | // plugin that tells the Electron app where to look for the Vite-bundled app code (depending on 6 | // whether you're running in development or production). 7 | const MAIN_WINDOW_VITE_DEV_SERVER_URL: string; 8 | const MAIN_WINDOW_VITE_NAME: string; 9 | 10 | namespace NodeJS { 11 | interface Process { 12 | // Used for hot reload after preload scripts. 13 | viteDevServers: Record; 14 | } 15 | } 16 | 17 | type VitePluginConfig = ConstructorParameters[0]; 18 | 19 | interface VitePluginRuntimeKeys { 20 | VITE_DEV_SERVER_URL: `${string}_VITE_DEV_SERVER_URL`; 21 | VITE_NAME: `${string}_VITE_NAME`; 22 | } 23 | } 24 | 25 | declare module 'vite' { 26 | interface ConfigEnv { 27 | root: string; 28 | forgeConfig: VitePluginConfig; 29 | forgeConfigSelf: VitePluginConfig[K][number]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /pc/app-auto-coder/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hello World! 6 | 7 | 8 | 9 |

💖 Hello World!

10 |

Welcome to your Electron application.

11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /pc/app-auto-coder/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app-auto-coder", 3 | "productName": "app-auto-coder", 4 | "version": "1.0.0", 5 | "description": "My Electron application description", 6 | "main": ".vite/build/main.js", 7 | "scripts": { 8 | "start": "electron-forge start", 9 | "package": "electron-forge package", 10 | "make": "electron-forge make", 11 | "publish": "electron-forge publish", 12 | "lint": "eslint --ext .ts,.tsx ." 13 | }, 14 | "devDependencies": { 15 | "@electron-forge/cli": "^7.4.0", 16 | "@electron-forge/maker-deb": "^7.4.0", 17 | "@electron-forge/maker-rpm": "^7.4.0", 18 | "@electron-forge/maker-squirrel": "^7.4.0", 19 | "@electron-forge/maker-zip": "^7.4.0", 20 | "@electron-forge/plugin-auto-unpack-natives": "^7.4.0", 21 | "@electron-forge/plugin-fuses": "^7.4.0", 22 | "@electron-forge/plugin-vite": "^7.4.0", 23 | "@electron/fuses": "^1.8.0", 24 | "@typescript-eslint/eslint-plugin": "^5.62.0", 25 | "@typescript-eslint/parser": "^5.62.0", 26 | "electron": "31.0.1", 27 | "eslint": "^8.57.0", 28 | "eslint-plugin-import": "^2.29.1", 29 | "ts-node": "^10.9.2", 30 | "typescript": "~4.5.4", 31 | "vite": "^5.3.1" 32 | }, 33 | "keywords": [], 34 | "author": { 35 | "name": "WilliamZhu", 36 | "email": "allwefantasy@gmail.com" 37 | }, 38 | "license": "MIT", 39 | "dependencies": { 40 | "electron-squirrel-startup": "^1.0.1" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /pc/app-auto-coder/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, 3 | Arial, sans-serif; 4 | margin: auto; 5 | max-width: 38rem; 6 | padding: 2rem; 7 | } 8 | -------------------------------------------------------------------------------- /pc/app-auto-coder/src/preload.ts: -------------------------------------------------------------------------------- 1 | // See the Electron documentation for details on how to use preload scripts: 2 | // https://www.electronjs.org/docs/latest/tutorial/process-model#preload-scripts 3 | -------------------------------------------------------------------------------- /pc/app-auto-coder/src/renderer.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file will automatically be loaded by vite and run in the "renderer" context. 3 | * To learn more about the differences between the "main" and the "renderer" context in 4 | * Electron, visit: 5 | * 6 | * https://electronjs.org/docs/tutorial/application-architecture#main-and-renderer-processes 7 | * 8 | * By default, Node.js integration in this file is disabled. When enabling Node.js integration 9 | * in a renderer process, please be aware of potential security implications. You can read 10 | * more about security risks here: 11 | * 12 | * https://electronjs.org/docs/tutorial/security 13 | * 14 | * To enable Node.js integration in this file, open up `main.ts` and enable the `nodeIntegration` 15 | * flag: 16 | * 17 | * ``` 18 | * // Create the browser window. 19 | * mainWindow = new BrowserWindow({ 20 | * width: 800, 21 | * height: 600, 22 | * webPreferences: { 23 | * nodeIntegration: true 24 | * } 25 | * }); 26 | * ``` 27 | */ 28 | 29 | import './index.css'; 30 | 31 | console.log('👋 This message is being logged by "renderer.ts", included via Vite'); 32 | -------------------------------------------------------------------------------- /pc/app-auto-coder/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "module": "commonjs", 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "esModuleInterop": true, 8 | "noImplicitAny": true, 9 | "sourceMap": true, 10 | "baseUrl": ".", 11 | "outDir": "dist", 12 | "moduleResolution": "node", 13 | "resolveJsonModule": true 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /pc/app-auto-coder/vite.main.config.ts: -------------------------------------------------------------------------------- 1 | import type { ConfigEnv, UserConfig } from 'vite'; 2 | import { defineConfig, mergeConfig } from 'vite'; 3 | import { getBuildConfig, getBuildDefine, external, pluginHotRestart } from './vite.base.config'; 4 | 5 | // https://vitejs.dev/config 6 | export default defineConfig((env) => { 7 | const forgeEnv = env as ConfigEnv<'build'>; 8 | const { forgeConfigSelf } = forgeEnv; 9 | const define = getBuildDefine(forgeEnv); 10 | const config: UserConfig = { 11 | build: { 12 | lib: { 13 | entry: forgeConfigSelf.entry!, 14 | fileName: () => '[name].js', 15 | formats: ['cjs'], 16 | }, 17 | rollupOptions: { 18 | external, 19 | }, 20 | }, 21 | plugins: [pluginHotRestart('restart')], 22 | define, 23 | resolve: { 24 | // Load the Node.js entry. 25 | mainFields: ['module', 'jsnext:main', 'jsnext'], 26 | }, 27 | }; 28 | 29 | return mergeConfig(getBuildConfig(forgeEnv), config); 30 | }); 31 | -------------------------------------------------------------------------------- /pc/app-auto-coder/vite.preload.config.ts: -------------------------------------------------------------------------------- 1 | import type { ConfigEnv, UserConfig } from 'vite'; 2 | import { defineConfig, mergeConfig } from 'vite'; 3 | import { getBuildConfig, external, pluginHotRestart } from './vite.base.config'; 4 | 5 | // https://vitejs.dev/config 6 | export default defineConfig((env) => { 7 | const forgeEnv = env as ConfigEnv<'build'>; 8 | const { forgeConfigSelf } = forgeEnv; 9 | const config: UserConfig = { 10 | build: { 11 | rollupOptions: { 12 | external, 13 | // Preload scripts may contain Web assets, so use the `build.rollupOptions.input` instead `build.lib.entry`. 14 | input: forgeConfigSelf.entry!, 15 | output: { 16 | format: 'cjs', 17 | // It should not be split chunks. 18 | inlineDynamicImports: true, 19 | entryFileNames: '[name].js', 20 | chunkFileNames: '[name].js', 21 | assetFileNames: '[name].[ext]', 22 | }, 23 | }, 24 | }, 25 | plugins: [pluginHotRestart('reload')], 26 | }; 27 | 28 | return mergeConfig(getBuildConfig(forgeEnv), config); 29 | }); 30 | -------------------------------------------------------------------------------- /pc/app-auto-coder/vite.renderer.config.ts: -------------------------------------------------------------------------------- 1 | import type { ConfigEnv, UserConfig } from 'vite'; 2 | import { defineConfig } from 'vite'; 3 | import { pluginExposeRenderer } from './vite.base.config'; 4 | 5 | // https://vitejs.dev/config 6 | export default defineConfig((env) => { 7 | const forgeEnv = env as ConfigEnv<'renderer'>; 8 | const { root, mode, forgeConfigSelf } = forgeEnv; 9 | const name = forgeConfigSelf.name ?? ''; 10 | 11 | return { 12 | root, 13 | mode, 14 | base: './', 15 | build: { 16 | outDir: `.vite/renderer/${name}`, 17 | }, 18 | plugins: [pluginExposeRenderer(name)], 19 | resolve: { 20 | preserveSymlinks: true, 21 | }, 22 | clearScreen: false, 23 | } as UserConfig; 24 | }); 25 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | filterwarnings = 3 | ignore::Warning 4 | addopts = -s 5 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | contextlib2 2 | ninja 3 | jinja2 4 | rich 5 | # netifaces 6 | # accelerate 7 | # bitsandbytes>=0.39.0 8 | # transformers>=4.35.0 9 | # torch>=2.1.2 10 | # ray[default]>=2.9.1 11 | # sentencepiece 12 | # sentence-transformers 13 | # transformers_stream_generator 14 | # optimum 15 | # einops 16 | # pyarrow 17 | # datasets 18 | # langchain 19 | 20 | paramiko 21 | 22 | tqdm 23 | loguru 24 | pyjava>=0.6.21 25 | fastapi 26 | uvicorn 27 | retrying 28 | zhipuai 29 | dashscope 30 | tiktoken 31 | tabulate 32 | jupyter_client 33 | prompt-toolkit 34 | tokenizers 35 | aiofiles 36 | readerwriterlock 37 | 38 | # dependencies only for stable_diffusion 39 | # safetensors 40 | # pydantic 41 | # nltk 42 | # pillow 43 | # diffusers 44 | # lycoris 45 | # lycoris-lora 46 | ## the package above will downgrade the tokenizers, so here we need to force lock the version 47 | # tokenizers==0.13.3 48 | 49 | # camelot-py 50 | # llama_index 51 | byzerllm[saas]>=0.1.190 52 | patch 53 | diff_match_patch 54 | GitPython 55 | openai>=1.14.3 56 | anthropic 57 | google-generativeai 58 | protobuf 59 | azure-cognitiveservices-speech 60 | real_agent 61 | 62 | duckdb 63 | python-docx 64 | docx2txt 65 | pdf2image 66 | # Spire.Doc 67 | docx2pdf 68 | pypdf 69 | pyperclip 70 | colorama 71 | pylint 72 | reportlab 73 | pathspec 74 | # simpleaudio 75 | # pandoc 76 | # pypandoc 77 | openpyxl 78 | python-pptx 79 | watchfiles 80 | cairosvg 81 | matplotlib 82 | mammoth 83 | markdownify 84 | pdfminer.six 85 | puremagic 86 | pydub 87 | youtube-transcript-api 88 | SpeechRecognition 89 | pathvalidate 90 | pexpect 91 | mcp ; python_version >= '3.10' 92 | setuptools 93 | filelock 94 | argcomplete 95 | -------------------------------------------------------------------------------- /scripts/run_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 确保脚本可以在任何目录下执行 4 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 5 | PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" 6 | cd "$PROJECT_ROOT" 7 | 8 | # 设置环境变量 9 | export autocoder_auto_init=${autocoder_auto_init:-false} 10 | export auto_coder_log_stdout=${auto_coder_log_stdout:-true} 11 | 12 | echo "环境变量设置:" 13 | echo " - autocoder_auto_init=${autocoder_auto_init}" 14 | echo " - auto_coder_log_stdout=${auto_coder_log_stdout}" 15 | 16 | # 检查是否提供了参数 17 | if [ $# -eq 0 ]; then 18 | echo "用法: $0 [测试路径] [pytest参数]" 19 | echo "例如: $0 src/autocoder/rag/ -v" 20 | echo "未提供参数,将运行所有测试" 21 | python -m pytest -s --log-cli-level=INFO tests/ 22 | else 23 | # 运行pytest命令并传递所有参数 24 | echo "正在运行测试: $@" 25 | python -m pytest -s --log-cli-level=INFO "$@" 26 | fi -------------------------------------------------------------------------------- /scripts/runtime_hook.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # PyInstaller运行时钩子脚本 4 | import os 5 | import sys 6 | import site 7 | import importlib.util 8 | 9 | def ensure_package_imported(package_name): 10 | """确保包被正确导入""" 11 | try: 12 | importlib.import_module(package_name) 13 | return True 14 | except ImportError: 15 | return False 16 | 17 | # 添加打包后的目录到sys.path 18 | def setup_environment(): 19 | # 获取应用程序根目录 20 | if getattr(sys, 'frozen', False): 21 | # 运行在PyInstaller打包的环境中 22 | app_path = os.path.dirname(sys.executable) 23 | else: 24 | # 运行在普通Python环境中 25 | app_path = os.path.dirname(os.path.abspath(__file__)) 26 | 27 | # 添加关键路径 28 | paths_to_add = [ 29 | app_path, 30 | os.path.join(app_path, 'src'), 31 | os.path.join(app_path, 'autocoder'), 32 | ] 33 | 34 | for path in paths_to_add: 35 | if path not in sys.path and os.path.exists(path): 36 | sys.path.insert(0, path) 37 | 38 | # 设置环境变量 39 | os.environ['PYTHONPATH'] = os.pathsep.join(sys.path) 40 | 41 | # 初始化环境 42 | setup_environment() 43 | 44 | # 预加载关键模块 45 | key_packages = [ 46 | 'flask', 'jinja2', 'tiktoken', 'numpy', 'transformers' 47 | ] 48 | 49 | for package in key_packages: 50 | ensure_package_imported(package) 51 | -------------------------------------------------------------------------------- /scripts/to_cursor_rule.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 脚本功能:将.autocoderrules目录下的所有markdown文件复制到.cursor/rules目录 4 | # 如果有重名文件,强制替换 5 | 6 | # 获取当前工作目录 7 | CURRENT_DIR=$(pwd) 8 | 9 | # 源目录和目标目录 10 | SOURCE_DIR="${CURRENT_DIR}/.autocoderrules" 11 | TARGET_DIR="${CURRENT_DIR}/.cursor/rules" 12 | 13 | # 检查源目录是否存在 14 | if [ ! -d "$SOURCE_DIR" ]; then 15 | echo "错误: 源目录 $SOURCE_DIR 不存在!" 16 | exit 1 17 | fi 18 | 19 | # 检查目标目录是否存在,如果不存在则创建 20 | if [ ! -d "$TARGET_DIR" ]; then 21 | echo "目标目录 $TARGET_DIR 不存在,正在创建..." 22 | mkdir -p "$TARGET_DIR" 23 | if [ $? -ne 0 ]; then 24 | echo "错误: 无法创建目标目录 $TARGET_DIR!" 25 | exit 1 26 | fi 27 | fi 28 | 29 | echo "开始复制文件..." 30 | 31 | # 找到所有markdown文件并保存到临时数组 32 | files=($(find "$SOURCE_DIR" -type f -name "*.md")) 33 | TOTAL_FILES=${#files[@]} 34 | COPIED_FILES=0 35 | 36 | # 遍历所有找到的文件进行复制 37 | for file in "${files[@]}"; do 38 | # 获取文件名 39 | filename=$(basename "$file") 40 | 41 | # 复制文件到目标目录,强制覆盖已存在的文件 42 | cp -f "$file" "$TARGET_DIR/" 43 | 44 | if [ $? -eq 0 ]; then 45 | COPIED_FILES=$((COPIED_FILES + 1)) 46 | echo "已复制: $filename" 47 | else 48 | echo "复制失败: $filename" 49 | fi 50 | done 51 | 52 | echo "操作完成!" 53 | echo "总共找到 $TOTAL_FILES 个markdown文件" 54 | echo "成功复制 $COPIED_FILES 个文件到 $TARGET_DIR" 55 | 56 | # 给脚本执行权限 57 | chmod +x "$0" -------------------------------------------------------------------------------- /src/autocoder/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/agent/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/agent/base_agentic/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/agent/base_agentic/tools/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | 基础工具包,包含基础工具解析器和注册工具 3 | """ 4 | from .base_tool_resolver import BaseToolResolver 5 | from .talk_to_tool_resolver import TalkToToolResolver 6 | from .talk_to_group_tool_resolver import TalkToGroupToolResolver 7 | 8 | __all__ = [ 9 | "BaseToolResolver", 10 | "TalkToToolResolver", 11 | "TalkToGroupToolResolver" 12 | ] -------------------------------------------------------------------------------- /src/autocoder/agent/base_agentic/tools/attempt_completion_tool_resolver.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any, Optional 2 | from autocoder.agent.base_agentic.tools.base_tool_resolver import BaseToolResolver 3 | from autocoder.agent.base_agentic.types import AttemptCompletionTool, ToolResult # Import ToolResult from types 4 | from loguru import logger 5 | import typing 6 | from autocoder.common import AutoCoderArgs 7 | import os 8 | import tempfile 9 | 10 | if typing.TYPE_CHECKING: 11 | from ..base_agent import BaseAgent 12 | 13 | class AttemptCompletionToolResolver(BaseToolResolver): 14 | def __init__(self, agent: Optional['BaseAgent'], tool: AttemptCompletionTool, args: AutoCoderArgs): 15 | super().__init__(agent, tool, args) 16 | self.tool: AttemptCompletionTool = tool # For type hinting 17 | 18 | def resolve(self) -> ToolResult: 19 | """ 20 | Packages the completion result and optional command to signal task completion. 21 | """ 22 | result_text = self.tool.result 23 | command = self.tool.command 24 | 25 | logger.info(f"Resolving AttemptCompletionTool: Result='{result_text[:100]}...', Command='{command}'") 26 | 27 | if not result_text: 28 | return ToolResult(success=False, message="Error: Completion result cannot be empty.") 29 | 30 | # The actual presentation of the result happens outside the resolver. 31 | result_content = { 32 | "result": result_text, 33 | "command": command 34 | } 35 | 36 | # Indicate success in preparing the completion data 37 | return ToolResult(success=True, message="Task completion attempted.", content=result_content) 38 | -------------------------------------------------------------------------------- /src/autocoder/agent/base_agentic/tools/base_tool_resolver.py: -------------------------------------------------------------------------------- 1 | from abc import ABC, abstractmethod 2 | from typing import Any, Dict, Optional, TYPE_CHECKING 3 | from autocoder.common import AutoCoderArgs 4 | 5 | if TYPE_CHECKING: 6 | from autocoder.agent.base_agentic.base_agent import BaseAgent 7 | from autocoder.agent.base_agentic.types import BaseTool, ToolResult 8 | 9 | 10 | class BaseToolResolver(ABC): 11 | """ 12 | 工具解析器的基类,所有工具解析器都应该继承此类 13 | """ 14 | def __init__(self, agent: Optional['BaseAgent'], tool: 'BaseTool', args: AutoCoderArgs): 15 | """ 16 | 初始化解析器 17 | 18 | Args: 19 | agent: 代理实例,可能为None 20 | tool: 工具实例 21 | args: 其他需要的参数,如项目目录等 22 | """ 23 | self.agent = agent 24 | self.tool = tool 25 | self.args = args 26 | 27 | @abstractmethod 28 | def resolve(self) -> 'ToolResult': 29 | """ 30 | 执行工具逻辑,返回结果 31 | 32 | Returns: 33 | ToolResult对象,表示成功或失败以及消息 34 | """ 35 | pass -------------------------------------------------------------------------------- /src/autocoder/agent/base_agentic/tools/example_tool_resolver.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | from autocoder.common import AutoCoderArgs 3 | from autocoder.agent.base_agentic.tools.base_tool_resolver import BaseToolResolver 4 | from autocoder.agent.base_agentic.types import BaseTool, ToolResult 5 | from pydantic import BaseModel 6 | import typing 7 | 8 | if typing.TYPE_CHECKING: 9 | from ..base_agent import BaseAgent 10 | 11 | 12 | # 首先定义工具模型 13 | class ExampleTool(BaseTool): 14 | """示例工具,只是一个演示""" 15 | message: str 16 | times: int = 1 17 | 18 | 19 | # 然后定义对应的解析器 20 | class ExampleToolResolver(BaseToolResolver): 21 | """示例工具解析器""" 22 | def __init__(self, agent: Optional['BaseAgent'], tool: ExampleTool, args: AutoCoderArgs): 23 | super().__init__(agent, tool, args) 24 | self.tool: ExampleTool = tool # 类型提示 25 | 26 | def resolve(self) -> ToolResult: 27 | """ 28 | 执行工具逻辑 29 | 30 | Returns: 31 | 工具执行结果 32 | """ 33 | try: 34 | # 简单示例:重复消息N次 35 | result = self.tool.message * self.tool.times 36 | return ToolResult( 37 | success=True, 38 | message="成功执行示例工具", 39 | content=result 40 | ) 41 | except Exception as e: 42 | return ToolResult( 43 | success=False, 44 | message=f"执行示例工具时出错: {str(e)}", 45 | content=None 46 | ) -------------------------------------------------------------------------------- /src/autocoder/agent/base_agentic/tools/plan_mode_respond_tool_resolver.py: -------------------------------------------------------------------------------- 1 | import json 2 | from typing import Dict, Any, Optional 3 | import typing 4 | from autocoder.common import AutoCoderArgs 5 | from autocoder.agent.base_agentic.tools.base_tool_resolver import BaseToolResolver 6 | from autocoder.agent.base_agentic.types import PlanModeRespondTool, ToolResult # Import ToolResult from types 7 | from loguru import logger 8 | 9 | if typing.TYPE_CHECKING: 10 | from ..base_agent import BaseAgent 11 | 12 | class PlanModeRespondToolResolver(BaseToolResolver): 13 | def __init__(self, agent: Optional['BaseAgent'], tool: PlanModeRespondTool, args: AutoCoderArgs): 14 | super().__init__(agent, tool, args) 15 | self.tool: PlanModeRespondTool = tool # For type hinting 16 | 17 | def resolve(self) -> ToolResult: 18 | """ 19 | Packages the response and options for Plan Mode interaction. 20 | """ 21 | response_text = self.tool.response 22 | options = self.tool.options 23 | logger.info(f"Resolving PlanModeRespondTool: Response='{response_text[:100]}...', Options={options}") 24 | 25 | if not response_text: 26 | return ToolResult(success=False, message="Error: Plan mode response cannot be empty.") 27 | 28 | # The actual presentation happens outside the resolver. 29 | result_content = { 30 | "response": response_text, 31 | "options": options 32 | } 33 | 34 | # Indicate success in preparing the plan mode response data 35 | return ToolResult(success=True, message="Plan mode response prepared.", content=result_content) 36 | -------------------------------------------------------------------------------- /src/autocoder/agent/base_agentic/tools/use_mcp_tool_resolver.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any, Optional 2 | import typing 3 | from autocoder.agent.base_agentic.tools.base_tool_resolver import BaseToolResolver 4 | from autocoder.agent.base_agentic.types import UseMcpTool, ToolResult # Import ToolResult from types 5 | from autocoder.common import AutoCoderArgs 6 | from loguru import logger 7 | 8 | if typing.TYPE_CHECKING: 9 | from ..base_agent import BaseAgent 10 | 11 | 12 | class UseMcpToolResolver(BaseToolResolver): 13 | def __init__(self, agent: Optional['BaseAgent'], tool: UseMcpTool, args: AutoCoderArgs): 14 | super().__init__(agent, tool, args) 15 | self.tool: UseMcpTool = tool # For type hinting 16 | 17 | def resolve(self) -> ToolResult: 18 | """ 19 | Executes a tool via the Model Context Protocol (MCP) server. 20 | """ 21 | final_query = "" 22 | server_name = self.tool.server_name 23 | tool_name = self.tool.tool_name 24 | 25 | if server_name: 26 | final_query += f"{server_name}\n" 27 | 28 | if tool_name: 29 | final_query += f"{tool_name} is recommended for the following query:\n" 30 | 31 | final_query += f"{self.tool.query}" 32 | 33 | logger.info(f"Resolving UseMcpTool: Server='{server_name}', Tool='{tool_name}', Query='{final_query}'") 34 | 35 | mcp_server = get_mcp_server() 36 | response = mcp_server.send_request( 37 | McpRequest( 38 | query=final_query, 39 | model=self.args.inference_model or self.args.model, 40 | product_mode=self.args.product_mode 41 | ) 42 | ) 43 | return ToolResult(success=True, message=response.result) 44 | 45 | -------------------------------------------------------------------------------- /src/autocoder/agent/entry_command_agent/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Entry Command Agent 模块 3 | 4 | 该模块包含各种入口命令的代理实现,用于处理不同类型的用户命令。 5 | 6 | 目前包含的代理: 7 | - ChatAgent: 处理聊天命令的代理 8 | - ProjectReaderAgent: 处理项目阅读命令的代理 9 | - Voice2TextAgent: 处理语音转文字命令的代理 10 | - GenerateCommandAgent: 处理命令生成的代理 11 | - AutoToolAgent: 处理自动工具命令的代理 12 | - DesignerAgent: 处理设计命令的代理 13 | """ 14 | 15 | from .chat import ChatAgent 16 | from .project_reader import ProjectReaderAgent 17 | from .voice2text import Voice2TextAgent 18 | from .generate_command import GenerateCommandAgent 19 | from .auto_tool import AutoToolAgent 20 | from .designer import DesignerAgent 21 | 22 | __all__ = [ 23 | 'ChatAgent', 24 | 'ProjectReaderAgent', 25 | 'Voice2TextAgent', 26 | 'GenerateCommandAgent', 27 | 'AutoToolAgent', 28 | 'DesignerAgent' 29 | ] 30 | -------------------------------------------------------------------------------- /src/autocoder/agent/entry_command_agent/auto_tool.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | from rich.console import Console 7 | from rich.panel import Panel 8 | from rich.markdown import Markdown 9 | from rich.live import Live 10 | 11 | from autocoder.utils.request_queue import ( 12 | request_queue, 13 | RequestValue, 14 | DefaultValue, 15 | RequestOption, 16 | ) 17 | 18 | 19 | class AutoToolAgent: 20 | def __init__(self, args, llm, raw_args): 21 | self.args = args 22 | self.llm = llm 23 | self.raw_args = raw_args 24 | self.console = Console() 25 | 26 | def run(self): 27 | """执行 auto_tool 命令的主要逻辑""" 28 | from autocoder.agent.auto_tool import AutoTool 29 | 30 | auto_tool = AutoTool(self.args, self.llm) 31 | v = auto_tool.run(self.args.query) 32 | 33 | if self.args.request_id: 34 | request_queue.add_request( 35 | self.args.request_id, 36 | RequestValue( 37 | value=DefaultValue(value=v), status=RequestOption.COMPLETED 38 | ), 39 | ) 40 | 41 | markdown_content = v 42 | 43 | with Live( 44 | Panel("", title="Response", border_style="green", expand=False), 45 | refresh_per_second=4, 46 | auto_refresh=True, 47 | vertical_overflow="visible", 48 | console=Console(force_terminal=True, color_system="auto", height=None) 49 | ) as live: 50 | live.update( 51 | Panel( 52 | Markdown(markdown_content), 53 | title="Response", 54 | border_style="green", 55 | expand=False, 56 | ) 57 | ) 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/autocoder/agent/entry_command_agent/designer.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | from autocoder.utils.request_queue import ( 9 | request_queue, 10 | RequestValue, 11 | DefaultValue, 12 | RequestOption, 13 | ) 14 | 15 | 16 | class DesignerAgent: 17 | def __init__(self, args, llm, raw_args): 18 | self.args = args 19 | self.llm = llm 20 | self.raw_args = raw_args 21 | 22 | def run(self): 23 | """执行 designer 命令的主要逻辑""" 24 | from autocoder.agent.designer import SVGDesigner, SDDesigner, LogoDesigner 25 | 26 | if self.args.agent_designer_mode == "svg": 27 | designer = SVGDesigner(self.args, self.llm) 28 | designer.run(self.args.query) 29 | print("Successfully generated image in output.png") 30 | elif self.args.agent_designer_mode == "sd": 31 | designer = SDDesigner(self.args, self.llm) 32 | designer.run(self.args.query) 33 | print("Successfully generated image in output.jpg") 34 | elif self.args.agent_designer_mode.startswith("logo"): 35 | designer = LogoDesigner(self.args, self.llm) 36 | designer.run(self.args.query) 37 | print("Successfully generated image in output.png") 38 | 39 | if self.args.request_id: 40 | request_queue.add_request( 41 | self.args.request_id, 42 | RequestValue( 43 | value=DefaultValue( 44 | value="Successfully generated image"), 45 | status=RequestOption.COMPLETED, 46 | ), 47 | ) 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/autocoder/agent/entry_command_agent/generate_command.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | import os 6 | from rich.console import Console 7 | from rich.panel import Panel 8 | 9 | from autocoder.utils.request_queue import ( 10 | request_queue, 11 | RequestValue, 12 | DefaultValue, 13 | RequestOption, 14 | ) 15 | 16 | 17 | class GenerateCommandAgent: 18 | def __init__(self, args, llm, raw_args): 19 | self.args = args 20 | self.llm = llm 21 | self.raw_args = raw_args 22 | self.console = Console() 23 | 24 | def run(self): 25 | """执行 generate_command 命令的主要逻辑""" 26 | from autocoder.common.command_generator import generate_shell_script 27 | 28 | shell_script = generate_shell_script(self.args, self.llm) 29 | 30 | self.console.print( 31 | Panel( 32 | shell_script, 33 | title="Shell Script", 34 | border_style="magenta", 35 | ) 36 | ) 37 | 38 | with open(os.path.join(".auto-coder", "exchange.txt"), "w", encoding="utf-8") as f: 39 | f.write(shell_script) 40 | 41 | request_queue.add_request( 42 | self.args.request_id, 43 | RequestValue( 44 | value=DefaultValue(value=shell_script), 45 | status=RequestOption.COMPLETED, 46 | ), 47 | ) 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/autocoder/chat/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/common/ac_style_command_parser/__init__.py: -------------------------------------------------------------------------------- 1 | from .parser import ( 2 | CommandParser, 3 | parse_query, 4 | has_command, 5 | get_command_args, 6 | get_command_kwargs 7 | ) 8 | 9 | __all__ = [ 10 | "CommandParser", 11 | "parse_query", 12 | "has_command", 13 | "get_command_args", 14 | "get_command_kwargs" 15 | ] -------------------------------------------------------------------------------- /src/autocoder/common/buildin_tokenizer.py: -------------------------------------------------------------------------------- 1 | import pkg_resources 2 | from tokenizers import Tokenizer 3 | from typing import Optional 4 | 5 | class BuildinTokenizer: 6 | _instance: Optional['BuildinTokenizer'] = None 7 | _tokenizer: Optional[Tokenizer] = None 8 | 9 | def __new__(cls) -> 'BuildinTokenizer': 10 | if cls._instance is None: 11 | cls._instance = super(BuildinTokenizer, cls).__new__(cls) 12 | cls._instance._initialize() 13 | return cls._instance 14 | 15 | def _initialize(self) -> None: 16 | try: 17 | tokenizer_path = pkg_resources.resource_filename( 18 | "autocoder", "data/tokenizer.json" 19 | ) 20 | except FileNotFoundError: 21 | tokenizer_path = None 22 | 23 | if tokenizer_path: 24 | self._tokenizer = Tokenizer.from_file(tokenizer_path) 25 | else: 26 | raise ValueError("Cannot find tokenizer.json file in package data directory") 27 | 28 | def count_tokens(self, text: str) -> int: 29 | if not self._tokenizer: 30 | raise ValueError("Tokenizer is not initialized") 31 | 32 | encoded = self._tokenizer.encode('{"role":"user","content":"' + text + '"}') 33 | return len(encoded.ids) 34 | 35 | @property 36 | def tokenizer(self) -> Optional[Tokenizer]: 37 | return self._tokenizer -------------------------------------------------------------------------------- /src/autocoder/common/cleaner.py: -------------------------------------------------------------------------------- 1 | import re 2 | import os 3 | 4 | PYTHON_PREFIX = os.environ.get("CONDA_PREFIX", "/usr/local") 5 | 6 | SITE_PKG_ERROR_PREFIX = f'File {PYTHON_PREFIX}/lib/python3.10/' 7 | 8 | def get_error_header(traceback_str): 9 | lines = traceback_str.split('\n') 10 | for line in lines: 11 | if 'Error:' in line: 12 | return line 13 | return '' # Return None if no error message is found 14 | 15 | def clean_error_msg(error_str:str =''): 16 | filtered_error_msg = error_str.__str__().split('An error occurred while executing the following cell')[-1].split("\n------------------\n")[-1] 17 | raw_error_msg = "".join(filtered_error_msg) 18 | 19 | # Remove escape sequences for colored text 20 | ansi_escape = re.compile(r'\x1b\[[0-?]*[ -/]*[@-~]') 21 | error_msg = ansi_escape.sub('', raw_error_msg) 22 | 23 | error_str_out = '' 24 | error_msg_only_cell = error_msg.split(SITE_PKG_ERROR_PREFIX) 25 | 26 | error_str_out += f'{error_msg_only_cell[0]}\n' 27 | error_header = get_error_header(error_msg_only_cell[-1]) 28 | if error_header not in error_str_out: 29 | error_str_out += get_error_header(error_msg_only_cell[-1]) 30 | 31 | return error_str_out -------------------------------------------------------------------------------- /src/autocoder/common/command_file_manager/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | 命令管理模块 3 | 4 | 该模块提供了一种机制来管理和分析 .autocodercommands 目录中的命令文件。 5 | 主要功能包括: 6 | 1. 列出命令目录中的所有命令文件 7 | 2. 读取指定的命令文件内容 8 | 3. 分析命令文件,提取其中的Jinja2变量 9 | 4. 提供简单直观的API,便于集成到现有的项目中 10 | """ 11 | 12 | from autocoder.common.command_file_manager.models import ( 13 | CommandFile, JinjaVariable, CommandFileAnalysisResult, ListCommandsResult 14 | ) 15 | from autocoder.common.command_file_manager.manager import CommandManager 16 | from autocoder.common.command_file_manager.utils import ( 17 | extract_jinja2_variables, extract_jinja2_variables_with_metadata, 18 | analyze_command_file, is_command_file 19 | ) 20 | 21 | __all__ = [ 22 | 'CommandFile', 'JinjaVariable', 'CommandFileAnalysisResult', 'ListCommandsResult', 23 | 'CommandManager', 'extract_jinja2_variables', 'extract_jinja2_variables_with_metadata', 24 | 'analyze_command_file', 'is_command_file' 25 | ] 26 | -------------------------------------------------------------------------------- /src/autocoder/common/conf_utils.py: -------------------------------------------------------------------------------- 1 | import os 2 | import json 3 | import pkg_resources 4 | from autocoder.common import AutoCoderArgs 5 | 6 | ## 用于auto-coder 内部使用 7 | 8 | def load_tokenizer(): 9 | from autocoder.rag.variable_holder import VariableHolder 10 | from tokenizers import Tokenizer 11 | try: 12 | tokenizer_path = pkg_resources.resource_filename( 13 | "autocoder", "data/tokenizer.json" 14 | ) 15 | VariableHolder.TOKENIZER_PATH = tokenizer_path 16 | VariableHolder.TOKENIZER_MODEL = Tokenizer.from_file(tokenizer_path) 17 | except FileNotFoundError: 18 | tokenizer_path = None 19 | 20 | 21 | def save_memory(args: AutoCoderArgs,memory): 22 | with open(os.path.join(args.source_dir, ".auto-coder", "plugins", "chat-auto-coder", "memory.json"), "w",encoding="utf-8") as f: 23 | json.dump(memory, f, indent=2, ensure_ascii=False) 24 | 25 | def load_memory(args: AutoCoderArgs): 26 | memory_path = os.path.join(args.source_dir, ".auto-coder", "plugins", "chat-auto-coder", "memory.json") 27 | if os.path.exists(memory_path): 28 | with open(memory_path, "r", encoding="utf-8") as f: 29 | _memory = json.load(f) 30 | memory = _memory 31 | else: 32 | memory = {} 33 | return memory 34 | 35 | def get_memory(args: AutoCoderArgs): 36 | return load_memory(args) -------------------------------------------------------------------------------- /src/autocoder/common/conversations/backup/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Backup and restore functionality for conversation management. 3 | 4 | This package provides backup and restore capabilities for conversation data, 5 | including incremental and full backups, version management, and data recovery. 6 | """ 7 | 8 | from .backup_manager import BackupManager 9 | from .restore_manager import RestoreManager 10 | 11 | __all__ = [ 12 | 'BackupManager', 13 | 'RestoreManager', 14 | ] -------------------------------------------------------------------------------- /src/autocoder/common/conversations/cache/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Cache module for conversation management. 3 | 4 | This module provides caching functionality for conversations and messages, 5 | including memory-based caching with LRU eviction and TTL support. 6 | """ 7 | 8 | from .base_cache import BaseCache 9 | from .memory_cache import MemoryCache 10 | from .cache_manager import CacheManager 11 | 12 | __all__ = [ 13 | 'BaseCache', 14 | 'MemoryCache', 15 | 'CacheManager' 16 | ] -------------------------------------------------------------------------------- /src/autocoder/common/conversations/search/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Search and filtering module for conversations. 3 | 4 | This module provides text search and filtering capabilities for conversations 5 | and messages, supporting full-text search, keyword matching, and complex 6 | filtering operations. 7 | """ 8 | 9 | from .text_searcher import TextSearcher 10 | from .filter_manager import FilterManager 11 | 12 | __all__ = [ 13 | 'TextSearcher', 14 | 'FilterManager' 15 | ] -------------------------------------------------------------------------------- /src/autocoder/common/conversations/storage/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Storage module for conversation management. 3 | 4 | This module provides storage functionality for conversations and messages, 5 | including file-based storage and indexing capabilities. 6 | """ 7 | 8 | from .base_storage import BaseStorage 9 | from .file_storage import FileStorage 10 | from .index_manager import IndexManager 11 | 12 | __all__ = [ 13 | 'BaseStorage', 14 | 'FileStorage', 15 | 'IndexManager' 16 | ] -------------------------------------------------------------------------------- /src/autocoder/common/directory_cache/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/autocoder/common/file_checkpoint/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | 文件变更管理模块 3 | 4 | 该模块提供了一种可靠的机制来应用、记录和撤销对项目文件的修改。 5 | 主要功能包括: 6 | 1. 将影子系统中的文件变更安全地应用到用户的实际项目中 7 | 2. 记录每次变更的历史,支持多版本撤销功能 8 | 3. 提供简单直观的API,便于集成到现有的编辑流程中 9 | """ 10 | 11 | from autocoder.common.file_checkpoint.models import ( 12 | FileChange, ChangeRecord, ApplyResult, UndoResult, DiffResult 13 | ) 14 | from autocoder.common.file_checkpoint.manager import FileChangeManager 15 | from autocoder.common.file_checkpoint.store import FileChangeStore 16 | from autocoder.common.file_checkpoint.backup import FileBackupManager 17 | 18 | __all__ = [ 19 | 'FileChange', 'ChangeRecord', 'ApplyResult', 'UndoResult', 'DiffResult', 20 | 'FileChangeManager', 'FileChangeStore', 'FileBackupManager' 21 | ] 22 | -------------------------------------------------------------------------------- /src/autocoder/common/file_monitor/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | from .monitor import FileMonitor 4 | 5 | __all__ = ["FileMonitor"] 6 | -------------------------------------------------------------------------------- /src/autocoder/common/ignorefiles/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | from .ignore_file_utils import should_ignore 3 | 4 | __all__ = ["should_ignore"] 5 | -------------------------------------------------------------------------------- /src/autocoder/common/mcp_servers/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/common/pruner/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/common/pull_requests/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/common/pull_requests/config.py: -------------------------------------------------------------------------------- 1 | """ 2 | Pull Request 配置管理 3 | """ 4 | import os 5 | from typing import Dict, Any, Optional 6 | from .models import PRConfig, PlatformType 7 | from .exceptions import ConfigurationError 8 | 9 | 10 | def get_config(platform: str, **overrides) -> PRConfig: 11 | """ 12 | 获取平台配置 13 | 14 | Args: 15 | platform: 平台名称 16 | **overrides: 配置覆盖参数 17 | 18 | Returns: 19 | 配置对象 20 | """ 21 | # 从环境变量加载配置 22 | env_config = _load_from_env(platform) 23 | 24 | # 合并配置 25 | merged_config = {} 26 | if env_config: 27 | merged_config.update(env_config) 28 | merged_config.update(overrides) 29 | 30 | # 验证必需的配置 31 | if 'token' not in merged_config: 32 | raise ConfigurationError(f"平台 {platform} 缺少必需的 token 配置") 33 | 34 | return PRConfig(platform=PlatformType(platform), **merged_config) 35 | 36 | 37 | def _load_from_env(platform: str) -> Dict[str, Any]: 38 | """从环境变量加载配置""" 39 | env_mappings = { 40 | 'github': { 41 | 'token': 'GITHUB_TOKEN', 42 | 'base_url': 'GITHUB_BASE_URL' 43 | }, 44 | 'gitlab': { 45 | 'token': 'GITLAB_TOKEN', 46 | 'base_url': 'GITLAB_BASE_URL' 47 | }, 48 | 'gitee': { 49 | 'token': 'GITEE_TOKEN', 50 | 'base_url': 'GITEE_BASE_URL' 51 | }, 52 | 'gitcode': { 53 | 'token': 'GITCODE_TOKEN', 54 | 'base_url': 'GITCODE_BASE_URL' 55 | } 56 | } 57 | 58 | mapping = env_mappings.get(platform, {}) 59 | config = {} 60 | 61 | for key, env_var in mapping.items(): 62 | value = os.getenv(env_var) 63 | if value: 64 | config[key] = value 65 | 66 | return config -------------------------------------------------------------------------------- /src/autocoder/common/pull_requests/example.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/common/pull_requests/exceptions.py: -------------------------------------------------------------------------------- 1 | """ 2 | Pull Request 模块自定义异常类 3 | """ 4 | from typing import Optional 5 | 6 | class PRError(Exception): 7 | """Pull Request 操作基础异常""" 8 | def __init__(self, message: str, error_code: Optional[str] = None, platform: Optional[str] = None): 9 | self.message = message 10 | self.error_code = error_code 11 | self.platform = platform 12 | super().__init__(message) 13 | 14 | class AuthenticationError(PRError): 15 | """认证失败异常""" 16 | pass 17 | 18 | class RepositoryNotFoundError(PRError): 19 | """仓库不存在异常""" 20 | pass 21 | 22 | class BranchNotFoundError(PRError): 23 | """分支不存在异常""" 24 | pass 25 | 26 | class NetworkError(PRError): 27 | """网络错误异常""" 28 | pass 29 | 30 | class RateLimitError(PRError): 31 | """API 限流异常""" 32 | def __init__(self, message: str, retry_after: int = 60, **kwargs): 33 | self.retry_after = retry_after 34 | super().__init__(message, **kwargs) 35 | 36 | class ValidationError(PRError): 37 | """参数验证错误异常""" 38 | pass 39 | 40 | class PlatformNotSupportedError(PRError): 41 | """平台不支持异常""" 42 | pass 43 | 44 | class ConfigurationError(PRError): 45 | """配置错误异常""" 46 | pass -------------------------------------------------------------------------------- /src/autocoder/common/pull_requests/providers/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Pull Request 平台提供者模块 3 | """ 4 | from .github_provider import GitHubProvider 5 | from .gitlab_provider import GitLabProvider 6 | from .gitee_provider import GiteeProvider 7 | from .gitcode_provider import GitCodeProvider 8 | 9 | # 提供者映射 10 | PROVIDERS = { 11 | 'github': GitHubProvider, 12 | 'gitlab': GitLabProvider, 13 | 'gitee': GiteeProvider, 14 | 'gitcode': GitCodeProvider 15 | } 16 | 17 | __all__ = [ 18 | 'GitHubProvider', 19 | 'GitLabProvider', 20 | 'GiteeProvider', 21 | 'GitCodeProvider', 22 | 'PROVIDERS' 23 | ] -------------------------------------------------------------------------------- /src/autocoder/common/pull_requests/providers/gitcode_provider.py: -------------------------------------------------------------------------------- 1 | """ 2 | GitCode API 提供者实现 3 | """ 4 | from typing import List 5 | from .github_provider import GitHubProvider 6 | from ..models import RepoInfo, PRData, PRResult, PRInfo 7 | 8 | 9 | class GitCodeProvider(GitHubProvider): 10 | """GitCode API 提供者(基于GitHub提供者)""" 11 | 12 | def _get_auth_header(self) -> str: 13 | """获取认证头""" 14 | return f"Bearer {self.config.token}" 15 | 16 | def create_pr(self, repo_info: RepoInfo, pr_data: PRData) -> PRResult: 17 | """创建 Merge Request""" 18 | # 简化实现,实际应该调用GitCode API 19 | return super().create_pr(repo_info, pr_data) -------------------------------------------------------------------------------- /src/autocoder/common/pull_requests/providers/gitee_provider.py: -------------------------------------------------------------------------------- 1 | """ 2 | Gitee API 提供者实现 3 | """ 4 | from typing import List 5 | from .github_provider import GitHubProvider 6 | from ..models import RepoInfo, PRData, PRResult, PRInfo 7 | 8 | 9 | class GiteeProvider(GitHubProvider): 10 | """Gitee API 提供者(基于GitHub提供者)""" 11 | 12 | def _get_auth_header(self) -> str: 13 | """获取认证头""" 14 | # Gitee 使用 token 参数而不是 Authorization 头 15 | return "" 16 | 17 | def create_pr(self, repo_info: RepoInfo, pr_data: PRData) -> PRResult: 18 | """创建 Pull Request""" 19 | # 简化实现,实际应该调用Gitee API 20 | return super().create_pr(repo_info, pr_data) -------------------------------------------------------------------------------- /src/autocoder/common/pull_requests/providers/gitlab_provider.py: -------------------------------------------------------------------------------- 1 | """ 2 | GitLab API 提供者实现 3 | """ 4 | from typing import List 5 | from .github_provider import GitHubProvider 6 | from ..models import RepoInfo, PRData, PRResult, PRInfo 7 | 8 | 9 | class GitLabProvider(GitHubProvider): 10 | """GitLab API 提供者(基于GitHub提供者)""" 11 | 12 | def _get_auth_header(self) -> str: 13 | """获取认证头""" 14 | return f"Bearer {self.config.token}" 15 | 16 | def create_pr(self, repo_info: RepoInfo, pr_data: PRData) -> PRResult: 17 | """创建 Merge Request (GitLab的PR称为MR)""" 18 | # 简化实现,实际应该调用GitLab API 19 | return super().create_pr(repo_info, pr_data) 20 | 21 | def list_prs( 22 | self, 23 | repo_info: RepoInfo, 24 | state: str = "opened", # GitLab使用"opened"而不是"open" 25 | per_page: int = 30, 26 | page: int = 1 27 | ) -> List[PRInfo]: 28 | """列出仓库的MR""" 29 | return super().list_prs(repo_info, state, per_page, page) -------------------------------------------------------------------------------- /src/autocoder/common/pull_requests/test_module.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/common/rag_manager/__init__.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | from .rag_manager import RAGManager 3 | 4 | __all__ = ["RAGManager"] -------------------------------------------------------------------------------- /src/autocoder/common/rulefiles/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | """ 4 | AutoCoder 规则文件管理模块 5 | 6 | 提供读取、解析和监控 AutoCoder 规则文件的功能。 7 | """ 8 | 9 | from .autocoderrules_utils import ( 10 | get_rules, 11 | ) 12 | 13 | __all__ = [ 14 | 'get_rules', 15 | ] 16 | -------------------------------------------------------------------------------- /src/autocoder/common/stream_out_type.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | class AutoCommandStreamOutType(Enum): 4 | COMMAND_SUGGESTION = "command_suggestion" 5 | class IndexFilterStreamOutType(Enum): 6 | FILE_NUMBER_LIST = "file_number_list" 7 | 8 | class AgenticFilterStreamOutType(Enum): 9 | AGENTIC_FILTER = "agentic_filter" 10 | 11 | 12 | class CodeGenerateStreamOutType(Enum): 13 | CODE_GENERATE = "code_generate" 14 | 15 | class CodeRankStreamOutType(Enum): 16 | CODE_RANK = "code_rank" 17 | 18 | class LintStreamOutType(Enum): 19 | LINT = "lint" 20 | 21 | class UnmergedBlocksStreamOutType(Enum): 22 | UNMERGED_BLOCKS = "unmerged_blocks" 23 | 24 | class CompileStreamOutType(Enum): 25 | COMPILE = "compile" 26 | 27 | class ContextMissingCheckStreamOutType(Enum): 28 | CONTEXT_MISSING_CHECK = "context_missing_check" 29 | 30 | class IndexStreamOutType(Enum): 31 | INDEX_BUILD = "index_build" -------------------------------------------------------------------------------- /src/autocoder/common/text.py: -------------------------------------------------------------------------------- 1 | from difflib import SequenceMatcher 2 | 3 | class TextSimilarity: 4 | def __init__(self, text_a, text_b): 5 | self.text_a = text_a 6 | self.text_b = text_b 7 | self.lines_a = self._split_into_lines(text_a) 8 | self.lines_b = self._split_into_lines(text_b) 9 | self.m = len(self.lines_a) 10 | self.n = len(self.lines_b) 11 | 12 | def _split_into_lines(self, text): 13 | return text.splitlines() 14 | 15 | def _levenshtein_ratio(self, s1, s2): 16 | return SequenceMatcher(None, s1, s2).ratio() 17 | 18 | def get_best_matching_window(self): 19 | best_similarity = 0 20 | best_window = [] 21 | 22 | for i in range(self.n - self.m + 1): # 滑动窗口 23 | window_b = self.lines_b[i:i + self.m] 24 | similarity = self._levenshtein_ratio("\n".join(self.lines_a), "\n".join(window_b)) 25 | 26 | if similarity > best_similarity: 27 | best_similarity = similarity 28 | best_window = window_b 29 | 30 | return best_similarity, "\n".join(best_window) 31 | -------------------------------------------------------------------------------- /src/autocoder/common/tokens/models.py: -------------------------------------------------------------------------------- 1 | from typing import List, Dict, Optional 2 | from dataclasses import dataclass 3 | 4 | 5 | @dataclass 6 | class TokenResult: 7 | """单个文件的 token 统计结果""" 8 | file_path: str 9 | token_count: int 10 | char_count: int 11 | line_count: int 12 | success: bool = True 13 | error: Optional[str] = None 14 | 15 | 16 | @dataclass 17 | class DirectoryTokenResult: 18 | """目录的 token 统计结果""" 19 | directory_path: str 20 | total_tokens: int 21 | file_count: int 22 | skipped_count: int 23 | files: List[TokenResult] 24 | errors: List[str] = None 25 | 26 | def __post_init__(self): 27 | if self.errors is None: 28 | self.errors = [] 29 | -------------------------------------------------------------------------------- /src/autocoder/common/types.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | import pydantic 3 | from typing import List, Dict, Tuple,Any,Optional 4 | class Mode(Enum): 5 | MULTI_ROUND = "multi_round" 6 | SINGLE_ROUND = "single_round" 7 | 8 | class StepNum(pydantic.BaseModel): 9 | step_num:int= pydantic.Field(1,description="总共步骤数") 10 | content:int= pydantic.Field(1,description="详细的执行步骤,每个步骤需要包含一个shell/python 代码块") 11 | 12 | class CodeGenerateResult(pydantic.BaseModel): 13 | contents:List[str] 14 | conversations:List[List[Dict[str, Any]]] 15 | metadata:Dict[str, Any] = {} 16 | 17 | class MergeCodeWithoutEffect(pydantic.BaseModel): 18 | success_blocks: List[Tuple[str, str]] 19 | failed_blocks: List[Any] 20 | merged_blocks: Optional[Any] = None -------------------------------------------------------------------------------- /src/autocoder/common/v2/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/common/v2/agent/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/common/v2/agent/agentic_edit_tools/attempt_completion_tool_resolver.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any, Optional 2 | from autocoder.common.v2.agent.agentic_edit_tools.base_tool_resolver import BaseToolResolver 3 | from autocoder.common.v2.agent.agentic_edit_types import AttemptCompletionTool, ToolResult # Import ToolResult from types 4 | from loguru import logger 5 | import typing 6 | from autocoder.common import AutoCoderArgs 7 | 8 | if typing.TYPE_CHECKING: 9 | from autocoder.common.v2.agent.agentic_edit import AgenticEdit 10 | 11 | class AttemptCompletionToolResolver(BaseToolResolver): 12 | def __init__(self, agent: Optional['AgenticEdit'], tool: AttemptCompletionTool, args: AutoCoderArgs): 13 | super().__init__(agent, tool, args) 14 | self.tool: AttemptCompletionTool = tool # For type hinting 15 | 16 | def resolve(self) -> ToolResult: 17 | """ 18 | Packages the completion result and optional command to signal task completion. 19 | """ 20 | result_text = self.tool.result 21 | command = self.tool.command 22 | 23 | logger.info(f"Resolving AttemptCompletionTool: Result='{result_text[:100]}...', Command='{command}'") 24 | 25 | if not result_text: 26 | return ToolResult(success=False, message="Error: Completion result cannot be empty.") 27 | 28 | # The actual presentation of the result happens outside the resolver. 29 | result_content = { 30 | "result": result_text, 31 | "command": command 32 | } 33 | 34 | # Indicate success in preparing the completion data 35 | return ToolResult(success=True, message="Task completion attempted.", content=result_content) 36 | -------------------------------------------------------------------------------- /src/autocoder/common/v2/agent/agentic_edit_tools/base_tool_resolver.py: -------------------------------------------------------------------------------- 1 | from abc import ABC, abstractmethod 2 | from typing import Any, Dict, Optional 3 | from autocoder.common.v2.agent.agentic_edit_types import BaseTool, ToolResult # Import ToolResult from types 4 | from autocoder.common import AutoCoderArgs 5 | import typing 6 | 7 | if typing.TYPE_CHECKING: 8 | from autocoder.common.v2.agent.agentic_edit import AgenticEdit 9 | 10 | 11 | class BaseToolResolver(ABC): 12 | def __init__(self, agent: Optional['AgenticEdit'], tool: BaseTool, args: AutoCoderArgs): 13 | """ 14 | Initializes the resolver. 15 | 16 | Args: 17 | agent: The AutoCoder agent instance. 18 | tool: The Pydantic model instance representing the tool call. 19 | args: Additional arguments needed for execution (e.g., source_dir). 20 | """ 21 | self.agent = agent 22 | self.tool = tool 23 | self.args = args 24 | 25 | @abstractmethod 26 | def resolve(self) -> ToolResult: 27 | """ 28 | Executes the tool's logic. 29 | 30 | Returns: 31 | A ToolResult object indicating success or failure and a message. 32 | """ 33 | pass 34 | -------------------------------------------------------------------------------- /src/autocoder/common/v2/agent/agentic_edit_tools/plan_mode_respond_tool_resolver.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any, Optional 2 | import typing 3 | from autocoder.common import AutoCoderArgs 4 | from autocoder.common.v2.agent.agentic_edit_tools.base_tool_resolver import BaseToolResolver 5 | from autocoder.common.v2.agent.agentic_edit_types import PlanModeRespondTool, ToolResult # Import ToolResult from types 6 | from loguru import logger 7 | 8 | if typing.TYPE_CHECKING: 9 | from autocoder.common.v2.agent.agentic_edit import AgenticEdit 10 | 11 | class PlanModeRespondToolResolver(BaseToolResolver): 12 | def __init__(self, agent: Optional['AgenticEdit'], tool: PlanModeRespondTool, args: AutoCoderArgs): 13 | super().__init__(agent, tool, args) 14 | self.tool: PlanModeRespondTool = tool # For type hinting 15 | 16 | def resolve(self) -> ToolResult: 17 | """ 18 | Packages the response and options for Plan Mode interaction. 19 | """ 20 | response_text = self.tool.response 21 | options = self.tool.options 22 | logger.info(f"Resolving PlanModeRespondTool: Response='{response_text[:100]}...', Options={options}") 23 | 24 | if not response_text: 25 | return ToolResult(success=False, message="Error: Plan mode response cannot be empty.") 26 | 27 | # The actual presentation happens outside the resolver. 28 | result_content = { 29 | "response": response_text, 30 | "options": options 31 | } 32 | 33 | # Indicate success in preparing the plan mode response data 34 | return ToolResult(success=True, message="Plan mode response prepared.", content=result_content) 35 | -------------------------------------------------------------------------------- /src/autocoder/common/v2/agent/runner/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Runner 模块提供了多种运行模式,用于在不同环境下执行 AgenticEdit 代理。 3 | 4 | 这个模块包含三种主要的运行器: 5 | 1. TerminalRunner: 在终端环境中运行代理,提供格式化输出 6 | 2. EventRunner: 将代理事件转换为标准事件系统格式 7 | 3. SdkRunner: 提供生成器接口,适用于SDK环境 8 | 9 | 使用示例: 10 | ```python 11 | from autocoder.common.v2.agent.runner import TerminalRunner 12 | from autocoder.common.v2.agent.agentic_edit_types import AgenticEditRequest 13 | 14 | runner = TerminalRunner(llm=llm, args=args, ...) 15 | runner.run(AgenticEditRequest(user_input="请帮我实现一个HTTP服务器")) 16 | ``` 17 | """ 18 | 19 | from .base_runner import BaseRunner 20 | from .terminal_runner import TerminalRunner 21 | from .event_runner import EventRunner 22 | from .sdk_runner import SdkRunner 23 | from .tool_display import get_tool_display_message 24 | 25 | __all__ = [ 26 | "BaseRunner", 27 | "TerminalRunner", 28 | "EventRunner", 29 | "SdkRunner", 30 | "get_tool_display_message" 31 | ] 32 | -------------------------------------------------------------------------------- /src/autocoder/common/v2/agent/runner/sdk_runner.py: -------------------------------------------------------------------------------- 1 | """ 2 | SdkRunner 提供生成器接口,适用于SDK环境下的代理运行。 3 | 4 | 这个模块提供了一个简单的生成器接口,允许外部代码迭代处理代理事件。 5 | 它是三种运行模式中最轻量级的一种,适合集成到其他应用程序中。 6 | """ 7 | 8 | import logging 9 | from typing import Generator, Any 10 | 11 | from autocoder.common.v2.agent.agentic_edit_types import ( 12 | AgenticEditRequest, AgentEvent, CompletionEvent 13 | ) 14 | from .base_runner import BaseRunner 15 | 16 | logger = logging.getLogger(__name__) 17 | 18 | class SdkRunner(BaseRunner): 19 | """ 20 | 提供生成器接口的代理运行器,适用于SDK环境。 21 | 22 | 这个运行器返回一个事件生成器,允许外部代码迭代处理代理事件。 23 | 它是三种运行模式中最轻量级的一种,适合集成到其他应用程序中。 24 | """ 25 | 26 | def run(self, request: AgenticEditRequest) -> Generator[AgentEvent, None, None]: 27 | """ 28 | Runs the agentic edit process and yields events for external processing. 29 | """ 30 | try: 31 | event_stream = self.analyze(request) 32 | for agent_event in event_stream: 33 | if isinstance(agent_event, CompletionEvent): 34 | self.apply_changes() 35 | yield agent_event 36 | 37 | except Exception as e: 38 | logger.exception( 39 | "An unexpected error occurred during agent execution: {e}") 40 | raise e 41 | -------------------------------------------------------------------------------- /src/autocoder/compilers/shadow_compiler.py: -------------------------------------------------------------------------------- 1 | import os 2 | from typing import Optional 3 | from autocoder.shadows.shadow_manager import ShadowManager 4 | from autocoder.compilers.compiler_factory import CompilerFactory 5 | from autocoder.compilers.models import ProjectCompilationResult,FileCompilationResult 6 | 7 | class ShadowCompiler: 8 | """ 9 | 用于对ShadowManager管理的文件进行代码检查并将结果转换回项目路径的类。 10 | """ 11 | 12 | def __init__(self, shadow_manager: ShadowManager,verbose:bool=False): 13 | """ 14 | 使用ShadowManager实例初始化。 15 | 16 | 参数: 17 | shadow_manager (ShadowManager): 用于管理文件路径映射的实例 18 | verbose (bool): 是否启用详细输出 19 | """ 20 | self.shadow_manager = shadow_manager 21 | self.compiler = CompilerFactory.create_compiler(language="provided",config_path=os.path.join(self.shadow_manager.source_dir,".auto-coder","projects","compiler.yml")) 22 | 23 | def compile_shadow_file(self, shadow_path: str) -> FileCompilationResult: 24 | return FileCompilationResult( 25 | file_path=shadow_path, 26 | success=True, 27 | language="provided", 28 | errors=[], 29 | error_message=None, 30 | warning_count=0, 31 | error_count=0, 32 | info_count=0, 33 | execution_time_ms=0, 34 | output_file=None 35 | ) 36 | 37 | def compile_all_shadow_files(self,target_compiler_name:Optional[str]=None) -> ProjectCompilationResult: 38 | link_projects_dir = self.shadow_manager.create_link_project() 39 | result = self.compiler.compile_project(link_projects_dir,target_compiler_name) 40 | result.project_path = self.shadow_manager.source_dir 41 | return result 42 | 43 | -------------------------------------------------------------------------------- /src/autocoder/db/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/dispacher/__init__.py: -------------------------------------------------------------------------------- 1 | from autocoder.common import AutoCoderArgs 2 | from autocoder.dispacher.actions.copilot import ActionCopilot 3 | from autocoder.dispacher.actions.action import ( 4 | ActionTSProject, 5 | ActionPyProject, 6 | ActionSuffixProject, 7 | ) 8 | from autocoder.dispacher.actions.plugins.action_regex_project import ActionRegexProject 9 | from typing import Optional 10 | import byzerllm 11 | # from autocoder.common.conversations.get_conversation_manager import ( 12 | # get_conversation_manager, 13 | # get_conversation_manager_config, 14 | # reset_conversation_manager 15 | # ) 16 | 17 | 18 | class Dispacher: 19 | def __init__(self, args: AutoCoderArgs, llm: Optional[byzerllm.ByzerLLM] = None): 20 | self.args = args 21 | self.llm = llm 22 | 23 | def dispach(self): 24 | # manager = get_conversation_manager() 25 | # if not manager.get_current_conversation(): 26 | # manager.create_conversation(name="New Conversation", description="New Conversation") 27 | # manager.set_current_conversation(manager.get_current_conversation_id()) 28 | 29 | args = self.args 30 | actions = [ 31 | ActionTSProject(args=args, llm=self.llm), 32 | ActionPyProject(args=args, llm=self.llm), 33 | ActionCopilot(args=args, llm=self.llm), 34 | ActionRegexProject(args=args, llm=self.llm), 35 | ActionSuffixProject(args=args, llm=self.llm), 36 | ] 37 | for action in actions: 38 | if action.run(): 39 | return 40 | -------------------------------------------------------------------------------- /src/autocoder/dispacher/actions/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/dispacher/actions/plugins/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/events/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Event handling system for autocoder. 3 | This module provides a way for two systems to communicate through events. 4 | """ 5 | 6 | from .event_store import EventStore, JsonlEventStore 7 | from .event_types import Event, EventType, ResponseEvent 8 | from .event_manager import EventManager 9 | from .event_manager_singleton import EventManagerSingleton, get_event_manager 10 | from .event_content import ( 11 | BaseEventContent, StreamContent, ResultContent, 12 | AskUserContent, UserResponseContent, CodeContent, 13 | MarkdownContent, ErrorContent, CompletionContent, ContentType, StreamState, 14 | create_stream_thinking, create_stream_content, 15 | create_result, create_ask_user, create_user_response, 16 | create_completion, create_error 17 | ) 18 | 19 | __all__ = [ 20 | # Event store 21 | "EventStore", 22 | "JsonlEventStore", 23 | 24 | # Event types 25 | "Event", 26 | "EventType", 27 | "ResponseEvent", 28 | "EventManager", 29 | 30 | # Singleton 31 | "EventManagerSingleton", 32 | "get_event_manager", 33 | 34 | # Content models 35 | "BaseEventContent", 36 | "StreamContent", 37 | "ResultContent", 38 | "AskUserContent", 39 | "UserResponseContent", 40 | "CodeContent", 41 | "MarkdownContent", 42 | "ErrorContent", 43 | "CompletionContent", 44 | 45 | # Enums 46 | "ContentType", 47 | "StreamState", 48 | 49 | # Factory functions 50 | "create_stream_thinking", 51 | "create_stream_content", 52 | "create_result", 53 | "create_ask_user", 54 | "create_user_response", 55 | "create_completion", 56 | "create_error" 57 | ] -------------------------------------------------------------------------------- /src/autocoder/helper/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/index/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/index/filter/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/index/types.py: -------------------------------------------------------------------------------- 1 | import pydantic 2 | from typing import List 3 | 4 | class IndexItem(pydantic.BaseModel): 5 | module_name: str 6 | symbols: str 7 | last_modified: float 8 | md5: str # 新增文件内容的MD5哈希值字段 9 | 10 | 11 | class TargetFile(pydantic.BaseModel): 12 | file_path: str 13 | reason: str = pydantic.Field( 14 | ..., description="The reason why the file is the target file" 15 | ) 16 | 17 | 18 | class VerifyFileRelevance(pydantic.BaseModel): 19 | relevant_score: int 20 | reason: str 21 | 22 | 23 | class FileList(pydantic.BaseModel): 24 | file_list: List[TargetFile] 25 | 26 | class FileNumberList(pydantic.BaseModel): 27 | file_list: List[int] -------------------------------------------------------------------------------- /src/autocoder/linters/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/linters/test_samples/react_component.jsx: -------------------------------------------------------------------------------- 1 | 2 | import React from 'react'; 3 | 4 | function TestComponent(props) { 5 | const { name } = props; 6 | 7 | return ( 8 |
9 |

Hello, {name}!

10 |

This is a test React component.

11 |
12 | ); 13 | } 14 | 15 | export default TestComponent; 16 | -------------------------------------------------------------------------------- /src/autocoder/memory/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/plugins/utils.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | def load_json_file(file_path: str) -> dict: 4 | with open(file_path, 'r') as f: 5 | return json.load(f) 6 | 7 | def save_json_file(file_path: str, data: dict): 8 | with open(file_path, 'w') as f: 9 | json.dump(data, f, ensure_ascii=False, indent=4) 10 | -------------------------------------------------------------------------------- /src/autocoder/privacy/__init__.py: -------------------------------------------------------------------------------- 1 | from .model_filter import ModelPathFilter 2 | 3 | __all__ = ["ModelPathFilter"] -------------------------------------------------------------------------------- /src/autocoder/rag/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/rag/cache/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/rag/cache/base_cache.py: -------------------------------------------------------------------------------- 1 | from pydantic import BaseModel 2 | from typing import List, Tuple,Dict,Optional,Any 3 | from abc import ABC, abstractmethod 4 | 5 | # New model class for file information 6 | class FileInfo(BaseModel): 7 | file_path: str 8 | relative_path: str 9 | modify_time: float 10 | file_md5: str 11 | 12 | # New model class for cache items 13 | class CacheItem(BaseModel): 14 | file_path: str 15 | relative_path: str 16 | content: List[Dict[str, Any]] # Serialized SourceCode objects 17 | modify_time: float 18 | md5: str 19 | 20 | class DeleteEvent(BaseModel): 21 | file_paths: List[str] 22 | 23 | class AddOrUpdateEvent(BaseModel): 24 | file_infos: List[FileInfo] 25 | 26 | class BaseCacheManager(ABC): 27 | @abstractmethod 28 | def get_cache(self,options:Optional[Dict[str,Any]]=None) -> Dict[str, Dict]: 29 | pass 30 | -------------------------------------------------------------------------------- /src/autocoder/rag/cache/failed_files_utils.py: -------------------------------------------------------------------------------- 1 | 2 | import os 3 | import json 4 | from loguru import logger 5 | 6 | def load_failed_files(failed_files_path: str) -> set: 7 | """ 8 | Load the set of failed file paths from a JSON file. 9 | 10 | Args: 11 | failed_files_path: Path to the JSON file storing failed files. 12 | 13 | Returns: 14 | A set of failed file paths. 15 | """ 16 | directory = os.path.dirname(failed_files_path) 17 | if not os.path.exists(directory): 18 | os.makedirs(directory, exist_ok=True) 19 | if os.path.exists(failed_files_path): 20 | try: 21 | with open(failed_files_path, "r", encoding="utf-8") as f: 22 | return set(json.load(f)) 23 | except Exception: 24 | return set() 25 | return set() 26 | 27 | def save_failed_files(failed_files_path: str, failed_files: set) -> None: 28 | """ 29 | Save the set of failed file paths to a JSON file. 30 | 31 | Args: 32 | failed_files_path: Path to the JSON file. 33 | failed_files: A set of failed file paths. 34 | """ 35 | try: 36 | with open(failed_files_path, "w", encoding="utf-8") as f: 37 | json.dump(list(failed_files), f, ensure_ascii=False, indent=2) 38 | except Exception as e: 39 | logger.error(f"Error saving failed files list: {e}") 40 | -------------------------------------------------------------------------------- /src/autocoder/rag/loaders/__init__.py: -------------------------------------------------------------------------------- 1 | from .pdf_loader import extract_text_from_pdf 2 | from .docx_loader import extract_text_from_docx 3 | from .excel_loader import extract_text_from_excel 4 | from .ppt_loader import extract_text_from_ppt 5 | 6 | __all__ = ['extract_text_from_pdf', 'extract_text_from_docx', 'extract_text_from_excel', 'extract_text_from_ppt'] -------------------------------------------------------------------------------- /src/autocoder/rag/loaders/docx_loader.py: -------------------------------------------------------------------------------- 1 | from io import BytesIO 2 | import traceback 3 | 4 | def extract_text_from_docx_old(docx_path): 5 | import docx2txt 6 | with open(docx_path, "rb") as f: 7 | docx_content = f.read() 8 | docx_file = BytesIO(docx_content) 9 | text = docx2txt.process(docx_file) 10 | return text 11 | 12 | 13 | def extract_text_from_docx(docx_path): 14 | try: 15 | from autocoder.utils._markitdown import MarkItDown 16 | md_converter = MarkItDown() 17 | result = md_converter.convert(docx_path) 18 | return result.text_content 19 | except (BaseException, Exception) as e: 20 | traceback.print_exc() 21 | return extract_text_from_docx_old(docx_path) 22 | -------------------------------------------------------------------------------- /src/autocoder/rag/loaders/excel_loader.py: -------------------------------------------------------------------------------- 1 | from typing import List, Tuple 2 | from openpyxl import load_workbook 3 | from jinja2 import Template 4 | 5 | def extract_text_from_excel(excel_path) -> List[Tuple[str, str]]: 6 | sheet_list = [] 7 | wb = load_workbook(excel_path) 8 | tmpl = Template( 9 | """{% for row in rows %} 10 | {% for cell in row %}"{{ cell }}"{% if not loop.last %},{% endif %}{% endfor %}{% if not loop.last %}{% endif %}{% endfor %} 11 | """ 12 | ) 13 | for ws in wb: 14 | rows = list(ws.iter_rows(values_only=True)) 15 | if not rows: 16 | continue 17 | # 过滤掉rows中全是null的行 18 | rows = [row for row in rows if any(row)] 19 | # 所有的None都转换成空字符串 20 | rows = [[cell if cell is not None else "" for cell in row] for row in rows] 21 | content = tmpl.render(rows=rows) 22 | sheet_list.append([excel_path + f"#{ws.title}", content]) 23 | wb.close() 24 | return sheet_list -------------------------------------------------------------------------------- /src/autocoder/rag/loaders/pdf_loader.py: -------------------------------------------------------------------------------- 1 | from io import BytesIO 2 | from pypdf import PdfReader 3 | import traceback 4 | 5 | 6 | def extract_text_from_pdf_old(file_path): 7 | with open(file_path, "rb") as f: 8 | pdf_content = f.read() 9 | pdf_file = BytesIO(pdf_content) 10 | pdf_reader = PdfReader(pdf_file) 11 | text = "" 12 | for page in pdf_reader.pages: 13 | text += page.extract_text() 14 | return text 15 | 16 | def extract_text_from_pdf(file_path, llm=None, product_mode="lite"): 17 | try: 18 | from autocoder.utils._markitdown import MarkItDown 19 | md_converter = MarkItDown(llm=llm, product_mode=product_mode) 20 | result = md_converter.convert(file_path) 21 | return result.text_content 22 | except (BaseException, Exception) as e: 23 | traceback.print_exc() 24 | return extract_text_from_pdf_old(file_path) 25 | -------------------------------------------------------------------------------- /src/autocoder/rag/rag_config.py: -------------------------------------------------------------------------------- 1 | import os 2 | from pydantic import BaseModel 3 | from typing import Optional 4 | 5 | class RagConfig(BaseModel): 6 | filter_config: Optional[str] = None 7 | answer_config: Optional[str] = None 8 | 9 | class RagConfigManager: 10 | def __init__(self, path: str): 11 | self.config_dir = os.path.join(path, ".rag_config") 12 | 13 | def load_config(self) -> RagConfig: 14 | filter_config = self._load_file("filter_config") 15 | answer_config = self._load_file("answer_config") 16 | return RagConfig(filter_config=filter_config, answer_config=answer_config) 17 | 18 | def _load_file(self, filename: str) -> Optional[str]: 19 | file_path = os.path.join(self.config_dir, filename) 20 | if os.path.exists(file_path): 21 | with open(file_path, 'r') as file: 22 | return file.read().strip() 23 | return None -------------------------------------------------------------------------------- /src/autocoder/rag/stream_event/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/rag/stream_event/event_writer.py: -------------------------------------------------------------------------------- 1 | import os 2 | from autocoder.rag.stream_event.types import Event 3 | 4 | def write_event(event: Event,base_path: str="events"): 5 | os.makedirs(base_path, exist_ok=True) 6 | with open(f"{base_path}/{event.request_id}.jsonl", "a") as f: 7 | f.write(event.model_dump_json() + "\n") 8 | 9 | def get_event_file_path(request_id: str,base_path: str="events") -> str: 10 | return f"{base_path}/{request_id}.jsonl" 11 | 12 | -------------------------------------------------------------------------------- /src/autocoder/rag/stream_event/types.py: -------------------------------------------------------------------------------- 1 | from typing import List, Dict, Any 2 | from enum import Enum 3 | from pydantic import BaseModel 4 | 5 | class EventType(Enum): 6 | START = "start" 7 | THOUGHT = "thought" 8 | CHUNK = "chunk" 9 | DONE = "done" 10 | ERROR = "error" 11 | 12 | class Event(BaseModel): 13 | request_id: str 14 | event_type: EventType 15 | content: str 16 | index: int -------------------------------------------------------------------------------- /src/autocoder/rag/token_limiter_utils.py: -------------------------------------------------------------------------------- 1 | import pydantic 2 | from typing import List 3 | from autocoder.common import SourceCode 4 | 5 | class TokenLimiterResult(pydantic.BaseModel): 6 | # 注意, docs 只保留结果文档 7 | docs: List[SourceCode] 8 | # 注意, raw_docs 保留所有文档 9 | raw_docs: List[SourceCode] 10 | input_tokens_counts: List[int] 11 | generated_tokens_counts: List[int] 12 | durations: List[float] 13 | model_name: str = "unknown" -------------------------------------------------------------------------------- /src/autocoder/rag/tools/__init__.py: -------------------------------------------------------------------------------- 1 | # 导出 SearchTool 相关类和函数 2 | from .search_tool import SearchTool, SearchToolResolver, register_search_tool 3 | 4 | # 导出 RecallTool 相关类和函数 5 | from .recall_tool import RecallTool, RecallToolResolver, register_recall_tool 6 | 7 | __all__ = [ 8 | 'SearchTool', 'SearchToolResolver', 'register_search_tool', 9 | 'RecallTool', 'RecallToolResolver', 'register_recall_tool' 10 | ] -------------------------------------------------------------------------------- /src/autocoder/rag/variable_holder.py: -------------------------------------------------------------------------------- 1 | class VariableHolder: 2 | TOKENIZER_PATH = None 3 | TOKENIZER_MODEL = None 4 | -------------------------------------------------------------------------------- /src/autocoder/sdk/cli/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Auto-Coder CLI 模块 3 | 4 | 提供命令行接口,允许用户通过终端使用 Auto-Coder 的核心功能。 5 | """ 6 | 7 | from .main import AutoCoderCLI 8 | from .options import CLIOptions, CLIResult 9 | 10 | # 导出main函数作为入口点 11 | def main(): 12 | """CLI主入口点函数""" 13 | return AutoCoderCLI.main() 14 | 15 | __all__ = ["AutoCoderCLI", "CLIOptions", "CLIResult", "main"] 16 | -------------------------------------------------------------------------------- /src/autocoder/sdk/cli/__main__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | CLI 模块主入口点 4 | """ 5 | 6 | import sys 7 | import argparse 8 | from pathlib import Path 9 | 10 | def main(): 11 | """主入口点,路由到不同的 CLI 功能""" 12 | 13 | # 检查是否是自动补全相关的命令 14 | if len(sys.argv) > 1 and sys.argv[1] in ["install", "uninstall", "test"]: 15 | # 路由到自动补全安装工具 16 | from .install_completion import main as install_main 17 | install_main() 18 | return 19 | 20 | # 默认显示自动补全工具的帮助 21 | from .install_completion import main as install_main 22 | install_main() 23 | 24 | if __name__ == "__main__": 25 | main() 26 | 27 | -------------------------------------------------------------------------------- /src/autocoder/sdk/cli/completion_wrapper.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | #!/usr/bin/env python3 4 | """ 5 | Auto-Coder CLI 自动补全包装器 6 | 7 | 提供一个独立的补全脚本,不依赖于特定的 shell 环境 8 | """ 9 | 10 | import sys 11 | import os 12 | 13 | def main(): 14 | """主函数,处理自动补全请求""" 15 | try: 16 | # 设置环境变量以启用 argcomplete 17 | os.environ.setdefault('_ARGCOMPLETE_COMPLETE', 'complete') 18 | 19 | # 导入并运行 CLI 20 | from autocoder.sdk.cli.main import AutoCoderCLI 21 | 22 | # 模拟 auto-coder.run 命令 23 | sys.argv[0] = 'auto-coder.run' 24 | 25 | # 解析参数(这会触发自动补全) 26 | AutoCoderCLI.parse_args() 27 | 28 | except SystemExit: 29 | # argcomplete 会调用 sys.exit,这是正常的 30 | pass 31 | except Exception as e: 32 | # 在补全过程中出现错误,静默处理 33 | pass 34 | 35 | if __name__ == '__main__': 36 | main() 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/autocoder/sdk/core/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | """ 6 | Auto-Coder SDK 核心模块 7 | 8 | 封装现有的auto_coder_runner功能,提供统一的查询接口。 9 | """ 10 | 11 | from .auto_coder_core import AutoCoderCore 12 | from .bridge import AutoCoderBridge 13 | 14 | __all__ = [ 15 | "AutoCoderCore", 16 | "AutoCoderBridge" 17 | ] 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/autocoder/sdk/models/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | """ 4 | Auto-Coder SDK 数据模型 5 | 6 | 包含所有数据结构定义,提供类型安全的接口。 7 | """ 8 | 9 | from .options import AutoCodeOptions 10 | from .messages import Message 11 | from .responses import CLIResult, SessionInfo 12 | 13 | __all__ = [ 14 | "AutoCodeOptions", 15 | "Message", 16 | "CLIResult", 17 | "SessionInfo" 18 | ] 19 | 20 | -------------------------------------------------------------------------------- /src/autocoder/sdk/session/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | """ 12 | Auto-Coder SDK 会话管理模块 13 | 14 | 管理会话的创建、保存和加载,维护对话历史和上下文。 15 | """ 16 | 17 | from .session import Session 18 | from .session_manager import SessionManager 19 | 20 | __all__ = [ 21 | "Session", 22 | "SessionManager" 23 | ] 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/autocoder/sdk/session/session_manager.py: -------------------------------------------------------------------------------- 1 | """ 2 | Auto-Coder SDK 会话管理器 3 | 4 | 负责会话的创建、管理和存储。 5 | """ 6 | 7 | import os 8 | from typing import List, Optional 9 | from pathlib import Path 10 | 11 | from ..models.options import AutoCodeOptions 12 | from ..models.responses import SessionInfo 13 | from ..exceptions import SessionNotFoundError 14 | from .session import Session 15 | 16 | 17 | class SessionManager: 18 | """简化的会话管理器""" 19 | 20 | def __init__(self, storage_path: str = None): 21 | """ 22 | 初始化会话管理器 23 | 24 | Args: 25 | storage_path: 存储路径,如果为None则使用默认路径 26 | """ 27 | self.storage_path = storage_path or os.getcwd() 28 | 29 | def create_session(self, options: AutoCodeOptions = None) -> Session: 30 | """ 31 | 创建新会话 32 | 33 | Args: 34 | options: 配置选项 35 | 36 | Returns: 37 | Session: 新创建的会话 38 | """ 39 | if options is None: 40 | options = AutoCodeOptions(cwd=self.storage_path) 41 | return Session(options=options) 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/autocoder/sdk/utils/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | """ 5 | Auto-Coder SDK 工具模块 6 | 7 | 提供通用的验证功能、格式化工具、IO工具等。 8 | """ 9 | 10 | from .validators import validate_options, validate_session_id 11 | from .formatters import format_output, format_stream_output 12 | from .io_utils import read_stdin, write_stdout, ensure_directory 13 | 14 | __all__ = [ 15 | "validate_options", 16 | "validate_session_id", 17 | "format_output", 18 | "format_stream_output", 19 | "read_stdin", 20 | "write_stdout", 21 | "ensure_directory" 22 | ] 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/autocoder/shadows/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/utils/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | from typing import Optional 3 | import subprocess 4 | import shutil 5 | from loguru import logger 6 | from autocoder.common.action_yml_file_manager import ActionYmlFileManager 7 | 8 | def get_last_yaml_file(actions_dir:str)->Optional[str]: 9 | """ 10 | 获取最新的 YAML 文件 11 | 12 | Args: 13 | actions_dir: actions 目录路径 14 | 15 | Returns: 16 | Optional[str]: 最新的 YAML 文件名,如果没有则返回 None 17 | """ 18 | # 兼容已有代码,创建临时 ActionYmlFileManager 19 | action_manager = ActionYmlFileManager(os.path.dirname(actions_dir)) 20 | return action_manager.get_latest_action_file() 21 | 22 | def open_yaml_file_in_editor(new_file:str): 23 | try: 24 | if os.environ.get("TERMINAL_EMULATOR") == "JetBrains-JediTerm": 25 | subprocess.run(["idea", new_file]) 26 | else: 27 | if shutil.which("code"): 28 | subprocess.run(["code", "-r", new_file]) 29 | elif shutil.which("idea"): 30 | subprocess.run(["idea", new_file]) 31 | except Exception as e: 32 | logger.info( 33 | f"Error opening editor, you can manually open the file: {new_file}" 34 | ) -------------------------------------------------------------------------------- /src/autocoder/utils/auto_coder_utils/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/utils/chat_auto_coder_utils/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/utils/conversation_store.py: -------------------------------------------------------------------------------- 1 | import os 2 | import json 3 | from autocoder.common import AutoCoderArgs 4 | 5 | 6 | def store_code_model_conversation( 7 | args: AutoCoderArgs, instruction: str, conversations: any, model: str 8 | ): 9 | persit_dir = os.path.join( 10 | args.source_dir, ".auto-coder", "human_as_model_conversation" 11 | ) 12 | os.makedirs(persit_dir, exist_ok=True) 13 | 14 | if args.human_as_model: 15 | model = "human" 16 | 17 | with open(os.path.join(persit_dir, "data.jsonl"), "a") as f: 18 | content = { 19 | "instruction": instruction, 20 | "conversations": conversations, 21 | "model": model, 22 | "yaml_file": args.file, 23 | } 24 | f.write(json.dumps(content, ensure_ascii=False) + "\n") 25 | 26 | 27 | def load_code_model_conversation_from_store(args: AutoCoderArgs): 28 | persit_dir = os.path.join( 29 | args.source_dir, ".auto-coder", "human_as_model_conversation" 30 | ) 31 | conversation_file = os.path.join(persit_dir, "data.jsonl") 32 | 33 | if not os.path.exists(conversation_file): 34 | return [] 35 | 36 | conversations = [] 37 | with open(conversation_file, "r",encoding="utf-8") as f: 38 | for line in f: 39 | conversations.append(json.loads(line)) 40 | 41 | return conversations 42 | -------------------------------------------------------------------------------- /src/autocoder/utils/llm_client_interceptors.py: -------------------------------------------------------------------------------- 1 | from byzerllm.utils.client import EventCallbackResult,EventName 2 | from prompt_toolkit import prompt 3 | from prompt_toolkit.formatted_text import FormattedText 4 | from typing import List,Dict,Any 5 | from loguru import logger 6 | from autocoder.db.store import Store 7 | 8 | 9 | def token_counter_interceptor(llm,model,response) -> EventCallbackResult: 10 | store = Store() 11 | v = response[0] 12 | if "metadata" in v: 13 | metadata = v["metadata"] 14 | input_tokens_count = metadata.get("input_tokens_count",0) 15 | generated_tokens_count = metadata.get("generated_tokens_count",0) 16 | # logger.info(f"{model} consume Input tokens count: {input_tokens_count}, Generated tokens count: {generated_tokens_count}") 17 | store.update_token_counter(project=None,input_tokens_count=input_tokens_count,generated_tokens_count = generated_tokens_count) 18 | return True,None 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/autocoder/utils/log_capture.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import queue 3 | import threading 4 | from contextlib import contextmanager 5 | import io 6 | 7 | class TeeStream: 8 | def __init__(self, stream, queue): 9 | self.stream = stream 10 | self.queue = queue 11 | 12 | def write(self, msg): 13 | self.stream.write(msg) 14 | self.queue.put(msg) 15 | 16 | def flush(self): 17 | self.stream.flush() 18 | 19 | def fileno(self): 20 | return self.stream.fileno() 21 | 22 | class LogCapture: 23 | request_logs = {} 24 | 25 | @classmethod 26 | def get_log_capture(cls, request_id): 27 | return cls.request_logs.get(request_id) 28 | 29 | def __init__(self, request_id:str): 30 | self.log_queue = queue.Queue() 31 | self.finished = False 32 | self.request_logs[request_id] = self 33 | 34 | def run_async(self, target, args=()): 35 | thread = threading.Thread(target=target, args=args) 36 | thread.daemon = True 37 | thread.start() 38 | 39 | @contextmanager 40 | def capture(self): 41 | old_stdout, old_stderr = sys.stdout, sys.stderr 42 | stdout_tee = TeeStream(old_stdout, self.log_queue) 43 | stderr_tee = TeeStream(old_stderr, self.log_queue) 44 | sys.stdout = sys.stderr = stdout_tee 45 | try: 46 | yield self.log_queue 47 | finally: 48 | self.finished = True 49 | sys.stdout, sys.stderr = old_stdout, old_stderr 50 | 51 | def get_captured_logs(self): 52 | if self.finished: 53 | return None 54 | v = [] 55 | while not self.log_queue.empty(): 56 | v.append(self.log_queue.get()) 57 | return v 58 | -------------------------------------------------------------------------------- /src/autocoder/utils/multi_turn.py: -------------------------------------------------------------------------------- 1 | 2 | def multi_turn(func,*args,**kwargs): 3 | conversation = [] 4 | func.prompt(args,kwargs) -------------------------------------------------------------------------------- /src/autocoder/utils/print_table.py: -------------------------------------------------------------------------------- 1 | import tabulate 2 | from autocoder.db.store import TokenCounter 3 | from typing import List 4 | def print_table(token_counters:List[TokenCounter]): 5 | headers = TokenCounter.model_fields.keys() 6 | table_data = [[getattr(counter, name) for name in headers] for counter in token_counters] 7 | table_output = tabulate.tabulate(table_data, headers, tablefmt="grid") 8 | print(table_output,flush=True) -------------------------------------------------------------------------------- /src/autocoder/utils/types.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/autocoder/version.py: -------------------------------------------------------------------------------- 1 | __version__ = "1.0.0" 2 | 3 | -------------------------------------------------------------------------------- /target/lisp_interpreter.mi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allwefantasy/auto-coder/HEAD/target/lisp_interpreter.mi --------------------------------------------------------------------------------