auto-coder 0.1.360__py3-none-any.whl → 0.1.361__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of auto-coder might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: auto-coder
3
- Version: 0.1.360
3
+ Version: 0.1.361
4
4
  Summary: AutoCoder: AutoCoder
5
5
  Author: allwefantasy
6
6
  Classifier: Programming Language :: Python :: 3.10
@@ -1,5 +1,5 @@
1
1
  autocoder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- autocoder/auto_coder.py,sha256=cXORqFnZ_wNSVJXs7nrt0tLR_ystIIBj3TVrhTgNlyQ,66919
2
+ autocoder/auto_coder.py,sha256=PjMhyZCMm8HFG9BAvj6xwQ4DoMielPRvzOVS3oa1ZTk,67060
3
3
  autocoder/auto_coder_lang.py,sha256=Rtupq6N3_HT7JRhDKdgCBcwRaiAnyCOR_Gsp4jUomrI,3229
4
4
  autocoder/auto_coder_rag.py,sha256=ru5o86IaKylyVRlVORmnrdf3Q1To2eWi2KLdT9FMW0k,37580
5
5
  autocoder/auto_coder_rag_client_mcp.py,sha256=QRxUbjc6A8UmDMQ8lXgZkjgqtq3lgKYeatJbDY6rSo0,6270
@@ -14,7 +14,7 @@ autocoder/command_parser.py,sha256=fx1g9E6GaM273lGTcJqaFQ-hoksS_Ik2glBMnVltPCE,1
14
14
  autocoder/lang.py,sha256=PFtATuOhHRnfpqHQkXr6p4C893JvpsgwTMif3l-GEi0,14321
15
15
  autocoder/models.py,sha256=Gu50IATQtZtgEir1PpCfwgH6o4ygw6XqqbQRj3lx5dU,13798
16
16
  autocoder/run_context.py,sha256=IUfSO6_gp2Wt1blFWAmOpN0b0nDrTTk4LmtCYUBIoro,1643
17
- autocoder/version.py,sha256=AJWkVCVcNxcQiTT91kp7mLT7D-FHFLU1zfRiNjiCFIE,23
17
+ autocoder/version.py,sha256=-eHH-Zoj_ykjiLWosogiY77V86O55hXvZbTnLHM8u8A,23
18
18
  autocoder/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  autocoder/agent/agentic_edit.py,sha256=XsfePZ-t6M-uBSdG1VLZXk1goqXk2HPeJ_A8IYyBuWQ,58896
20
20
  autocoder/agent/agentic_edit_types.py,sha256=oFcDd_cxJ2yH9Ed1uTpD3BipudgoIEWDMPb5pAkq4gI,3288
@@ -64,10 +64,10 @@ autocoder/common/buildin_tokenizer.py,sha256=L7d5t39ZFvUd6EoMPXUhYK1toD0FHlRH1jt
64
64
  autocoder/common/chunk_validation.py,sha256=BrR_ZWavW8IANuueEE7hS8NFAwEvm8TX34WnPx_1hs8,3030
65
65
  autocoder/common/cleaner.py,sha256=NU72i8C6o9m0vXExab7nao5bstBUsfJFcj11cXa9l4U,1089
66
66
  autocoder/common/code_auto_execute.py,sha256=4KXGmiGObr_B1d6tzV9dwS6MifCSc3Gm4j2d6ildBXQ,6867
67
- autocoder/common/code_auto_generate.py,sha256=gZ2TUcmXQkNZS_bpQb7Qi9uoYcSFXUjtLvZtrhp0CzI,12053
68
- autocoder/common/code_auto_generate_diff.py,sha256=WJEXW44USo1NA-EyH2lEbQBbt6FiXdJ_GQ8xXWjy_sc,19097
69
- autocoder/common/code_auto_generate_editblock.py,sha256=MQwkDUZlC8FBPEfmIn0wYZyOgD3b2OXQfysUsltnNXk,21809
70
- autocoder/common/code_auto_generate_strict_diff.py,sha256=oYRl43-mzXdPkM4SSsiari8xqfhJTm0Z3PLfa24e9as,17969
67
+ autocoder/common/code_auto_generate.py,sha256=6O7QiJe7514GCGuy4z-udzA2_h7TxEWHaJG7VyoCSSA,12151
68
+ autocoder/common/code_auto_generate_diff.py,sha256=WwMystn0cEFQMUKhIUa5EmNPzvnUMjKiPFpDb1nFb1A,19196
69
+ autocoder/common/code_auto_generate_editblock.py,sha256=JmnHqtt346hFFcLh-vb7_JYzb3PAsNCQZh2Owea9mVI,21906
70
+ autocoder/common/code_auto_generate_strict_diff.py,sha256=NSx1RYtNEQX2qFk1TfJlcTxiUB8Q4-PUxXk9TDV1-ak,18068
71
71
  autocoder/common/code_auto_merge.py,sha256=WaU-T-ZVn3QDaA_SrdkHciUPKDcTfVa-IbhHKBYEv5w,9961
72
72
  autocoder/common/code_auto_merge_diff.py,sha256=DcljWrtlejq2cb9Gj-jBjvUQzRbCE2uMNGg8SBOhEnk,19271
73
73
  autocoder/common/code_auto_merge_editblock.py,sha256=5PLH8Ey4GYsPNMGn36pSy_IgwgZ8-j1QF5FEv-THC-0,18397
@@ -136,10 +136,10 @@ autocoder/common/rulefiles/__init__.py,sha256=babSbPdFaXk1NvdHtH2zrJLb_tWd7d2ELI
136
136
  autocoder/common/rulefiles/autocoderrules_utils.py,sha256=JsB0BkdyygbTOEBfaAB2WA4RFU6Q3VamaFncmbbiLRE,10011
137
137
  autocoder/common/v2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
138
138
  autocoder/common/v2/code_agentic_editblock_manager.py,sha256=pAh918YMgmLenXmNKXlmDPgKyVJjOuk69901VEEQHm4,34980
139
- autocoder/common/v2/code_auto_generate.py,sha256=g6hbBCFfqZnBUvswv_eO9r8b7HwnpIVh9f1M9ICivYQ,11547
140
- autocoder/common/v2/code_auto_generate_diff.py,sha256=QJQk_D3l5yk3kczRF9-HwQgOLQYDlDhkGH72UtI-4Ks,15114
141
- autocoder/common/v2/code_auto_generate_editblock.py,sha256=JKeAul5S5xKWtB9Ma4XlJw9ImxnxXetfUSESME3StUk,15621
142
- autocoder/common/v2/code_auto_generate_strict_diff.py,sha256=k0aW21Gb40b8Z4-i5aHFgMtfoqK0ilFwQtv9C823X34,17968
139
+ autocoder/common/v2/code_auto_generate.py,sha256=PAySLU8ZnpdF8GelwSCiEbzv7sBbn-Vhakinf4i6udE,11646
140
+ autocoder/common/v2/code_auto_generate_diff.py,sha256=RWMJHxpQyD86ZOw0yYBFlKJLRsrrAWwRLJwu2rHfNXU,15213
141
+ autocoder/common/v2/code_auto_generate_editblock.py,sha256=qgTPox-0gLeNjzenzBM0B83Z-nzxYtT5BDCvllPLqps,15720
142
+ autocoder/common/v2/code_auto_generate_strict_diff.py,sha256=dbGyjBYWvjl_xT27Zxaq6Cgl7JuPZwYEGngPAyq3j9g,18066
143
143
  autocoder/common/v2/code_auto_merge.py,sha256=FZHrIZyFUkFmv4EbproXfIIUfGx_L3EPfvjldsYlplI,9345
144
144
  autocoder/common/v2/code_auto_merge_diff.py,sha256=DcljWrtlejq2cb9Gj-jBjvUQzRbCE2uMNGg8SBOhEnk,19271
145
145
  autocoder/common/v2/code_auto_merge_editblock.py,sha256=rVohrpjTzgvWEX09GNRAQ0fbjjNjcxeP1bqczhFT8F8,20741
@@ -149,7 +149,7 @@ autocoder/common/v2/code_editblock_manager.py,sha256=DMwJw-FAM6VyaBQV3p4xespHpgZ
149
149
  autocoder/common/v2/code_manager.py,sha256=C403bS-f6urixwitlKHcml-J03hci-UyNwHJOqBiY6Q,9182
150
150
  autocoder/common/v2/code_strict_diff_manager.py,sha256=Bys7tFAq4G03R1zUZuxrszBTvP4QB96jIw2y5BDLyRM,9424
151
151
  autocoder/common/v2/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
152
- autocoder/common/v2/agent/agentic_edit.py,sha256=BY31ZsniFydN7sncDNQUmAkMJFT-4mhTcnzsmuRMPTM,98524
152
+ autocoder/common/v2/agent/agentic_edit.py,sha256=qS-wwyzxsCVTZOCyFdX1bGeLKpbT_lkO2O2FOaU2_4s,98891
153
153
  autocoder/common/v2/agent/agentic_edit_conversation.py,sha256=pFgWPWHKhZ4J9EcFmIdiGsrSolTZuYcH1qkgKdD8nwk,7726
154
154
  autocoder/common/v2/agent/agentic_edit_types.py,sha256=VJMrictg6hJ3mC45VgQGRd43DyDUPDUvPV1Rf3z72NI,4776
155
155
  autocoder/common/v2/agent/agentic_tool_display.py,sha256=WKirt-2V346KLnbHgH3NVJiK3xvriD9oaCWj2IdvzLU,7309
@@ -310,9 +310,9 @@ autocoder/utils/types.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
310
310
  autocoder/utils/auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
311
311
  autocoder/utils/auto_coder_utils/chat_stream_out.py,sha256=t902pKxQ5xM7zgIHiAOsTPLwxhE6VuvXAqPy751S7fg,14096
312
312
  autocoder/utils/chat_auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
313
- auto_coder-0.1.360.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
314
- auto_coder-0.1.360.dist-info/METADATA,sha256=X4RcgNPLlNFVBEANGjlIbrqSgeJcWK0v8ACJWkPMGAY,2751
315
- auto_coder-0.1.360.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
316
- auto_coder-0.1.360.dist-info/entry_points.txt,sha256=0nzHtHH4pNcM7xq4EBA2toS28Qelrvcbrr59GqD_0Ak,350
317
- auto_coder-0.1.360.dist-info/top_level.txt,sha256=Jqc0_uJSw2GwoFQAa9iJxYns-2mWla-9ok_Y3Gcznjk,10
318
- auto_coder-0.1.360.dist-info/RECORD,,
313
+ auto_coder-0.1.361.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
314
+ auto_coder-0.1.361.dist-info/METADATA,sha256=HIhJ-9ho4w9uArb53Llorxzoeqn99ge5WW9HItR2t9U,2751
315
+ auto_coder-0.1.361.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
316
+ auto_coder-0.1.361.dist-info/entry_points.txt,sha256=0nzHtHH4pNcM7xq4EBA2toS28Qelrvcbrr59GqD_0Ak,350
317
+ auto_coder-0.1.361.dist-info/top_level.txt,sha256=Jqc0_uJSw2GwoFQAa9iJxYns-2mWla-9ok_Y3Gcznjk,10
318
+ auto_coder-0.1.361.dist-info/RECORD,,
autocoder/auto_coder.py CHANGED
@@ -52,7 +52,7 @@ from autocoder.common.mcp_server_types import (
52
52
  McpRequest, McpInstallRequest, McpRemoveRequest, McpListRequest,
53
53
  McpListRunningRequest, McpRefreshRequest
54
54
  )
55
-
55
+ from autocoder.run_context import get_run_context,RunMode
56
56
  console = Console()
57
57
 
58
58
 
@@ -438,7 +438,7 @@ def main(input_args: Optional[List[str]] = None):
438
438
  llm.setup_sub_client("index_filter_model", index_filter_model)
439
439
 
440
440
 
441
- if args.human_as_model:
441
+ if get_run_context().mode != RunMode.WEB and args.human_as_model:
442
442
 
443
443
  def intercept_callback(
444
444
  llm, model: str, input_value: List[Dict[str, Any]]
@@ -1157,7 +1157,7 @@ def main(input_args: Optional[List[str]] = None):
1157
1157
  loaded_conversations = pre_conversations + \
1158
1158
  chat_history["ask_conversation"]
1159
1159
 
1160
- if args.human_as_model:
1160
+ if get_run_context().mode != RunMode.WEB and args.human_as_model:
1161
1161
  console = Console()
1162
1162
 
1163
1163
  @byzerllm.prompt()
@@ -17,7 +17,7 @@ from autocoder.utils import llms as llm_utils
17
17
  from autocoder.common import SourceCodeList
18
18
  from autocoder.privacy.model_filter import ModelPathFilter
19
19
  from autocoder.memory.active_context_manager import ActiveContextManager
20
-
20
+ from autocoder.run_context import get_run_context,RunMode
21
21
 
22
22
  class CodeAutoGenerate:
23
23
  def __init__(
@@ -211,7 +211,7 @@ class CodeAutoGenerate:
211
211
  generate_mode="wholefile"
212
212
  )
213
213
 
214
- if not self.args.human_as_model:
214
+ if not self.args.human_as_model or get_run_context().mode == RunMode.WEB:
215
215
  with ThreadPoolExecutor(max_workers=len(self.llms) * self.generate_times_same_model) as executor:
216
216
  futures = []
217
217
  count = 0
@@ -17,6 +17,7 @@ from autocoder.utils import llms as llm_utils
17
17
  from autocoder.common import SourceCodeList
18
18
  from autocoder.memory.active_context_manager import ActiveContextManager
19
19
  from autocoder.common.rulefiles.autocoderrules_utils import get_rules
20
+ from autocoder.run_context import get_run_context,RunMode
20
21
 
21
22
  class CodeAutoGenerateDiff:
22
23
  def __init__(
@@ -404,7 +405,7 @@ class CodeAutoGenerateDiff:
404
405
  generate_mode="diff"
405
406
  )
406
407
 
407
- if not self.args.human_as_model:
408
+ if not self.args.human_as_model or get_run_context().mode == RunMode.WEB:
408
409
  with ThreadPoolExecutor(max_workers=len(self.llms) * self.generate_times_same_model) as executor:
409
410
  futures = []
410
411
  count = 0
@@ -21,8 +21,7 @@ from autocoder.utils import llms as llm_utils
21
21
  from autocoder.common import SourceCodeList
22
22
  from autocoder.memory.active_context_manager import ActiveContextManager
23
23
  from autocoder.common.rulefiles.autocoderrules_utils import get_rules
24
-
25
-
24
+ from autocoder.run_context import get_run_context,RunMode
26
25
 
27
26
  class CodeAutoGenerateEditBlock:
28
27
  def __init__(
@@ -518,7 +517,7 @@ class CodeAutoGenerateEditBlock:
518
517
  generate_mode="editblock"
519
518
  )
520
519
 
521
- if not self.args.human_as_model:
520
+ if not self.args.human_as_model or get_run_context().mode == RunMode.WEB:
522
521
  with ThreadPoolExecutor(max_workers=len(self.llms) * self.generate_times_same_model) as executor:
523
522
  futures = []
524
523
  count = 0
@@ -17,6 +17,7 @@ from autocoder.common import SourceCodeList
17
17
  from autocoder.privacy.model_filter import ModelPathFilter
18
18
  from autocoder.memory.active_context_manager import ActiveContextManager
19
19
  from autocoder.common.rulefiles.autocoderrules_utils import get_rules
20
+ from autocoder.run_context import get_run_context,RunMode
20
21
 
21
22
  class CodeAutoGenerateStrictDiff:
22
23
  def __init__(
@@ -379,7 +380,7 @@ class CodeAutoGenerateStrictDiff:
379
380
  generate_mode="strict_diff"
380
381
  )
381
382
 
382
- if not self.args.human_as_model:
383
+ if not self.args.human_as_model or get_run_context().mode == RunMode.WEB:
383
384
  with ThreadPoolExecutor(max_workers=len(self.llms) * self.generate_times_same_model) as executor:
384
385
  futures = []
385
386
  count = 0
@@ -595,14 +595,36 @@ class AgenticEdit:
595
595
  - If at any point a mermaid diagram would make your plan clearer to help the user quickly see the structure, you are encouraged to include a Mermaid code block in the response. (Note: if you use colors in your mermaid diagrams, be sure to use high contrast colors so the text is readable.)
596
596
  - Finally once it seems like you've reached a good plan, ask the user to switch you back to ACT MODE to implement the solution.
597
597
 
598
+ {% if enable_active_context_in_generate %}
599
+ ====
600
+
601
+ PROJECT PACKAGE CONTEXT
602
+
603
+ Each directory can contain a short **`active.md`** summary file located under the mirrored path inside
604
+ `{{ current_project }}/.auto-coder/active-context/`.
605
+
606
+ * **Purpose** – captures only the files that have **recently changed** in that directory. It is *not* a full listing.
607
+ * **Example** – for `{{ current_project }}/src/abc/bbc`, the summary is
608
+ `{{ current_project }}/.auto-coder/active-context/src/abc/bbc/active.md`.
609
+
610
+ **Reading a summary**
611
+
612
+ ```xml
613
+ <read_file>
614
+ <path>.auto-coder/active-context/src/abc/bbc/active.md</path>
615
+ </read_file>
616
+ ```
617
+
618
+ Use these summaries to quickly decide which files deserve a deeper look with tools like
619
+ `read_file`, `search_files`, or `list_code_definition_names`.
620
+
621
+ {% endif %}
598
622
  ====
599
623
 
600
624
  CAPABILITIES
601
625
 
602
- - You have access to tools that let you execute CLI commands on the user's computer, list files, view source code definitions, regex search${
603
- supportsComputerUse ? ", use the browser" : ""
604
- }, read and edit files, and ask follow-up questions. These tools help you effectively accomplish a wide range of tasks, such as writing code, making edits or improvements to existing files, understanding the current state of a project, performing system operations, and much more.
605
- - When the user initially gives you a task, a recursive list of all filepaths in the current working directory ('${cwd.toPosix()}') will be included in environment_details. This provides an overview of the project's file structure, offering key insights into the project from directory/file names (how developers conceptualize and organize their code) and file extensions (the language used). This can also guide decision-making on which files to explore further. If you need to further explore directories such as outside the current working directory, you can use the list_files tool. If you pass 'true' for the recursive parameter, it will list files recursively. Otherwise, it will list files at the top level, which is better suited for generic directories where you don't necessarily need the nested structure, like the Desktop.
626
+ - You have access to tools that let you execute CLI commands on the user's computer, list files, view source code definitions, regex search, read and edit files, and ask follow-up questions. These tools help you effectively accomplish a wide range of tasks, such as writing code, making edits or improvements to existing files, understanding the current state of a project, performing system operations, and much more.
627
+ - When the user initially gives you a task, a recursive list of all filepaths in the current working directory ('{{ current_project }}') will be included in environment_details. This provides an overview of the project's file structure, offering key insights into the project from directory/file names (how developers conceptualize and organize their code) and file extensions (the language used). This can also guide decision-making on which files to explore further. If you need to further explore directories such as outside the current working directory, you can use the list_files tool. If you pass 'true' for the recursive parameter, it will list files recursively. Otherwise, it will list files at the top level, which is better suited for generic directories where you don't necessarily need the nested structure, like the Desktop.
606
628
  - You can use search_files to perform regex searches across files in a specified directory, outputting context-rich results that include surrounding lines. This is particularly useful for understanding code patterns, finding specific implementations, or identifying areas that need refactoring.
607
629
  - You can use the list_code_definition_names tool to get an overview of source code definitions for all files at the top level of a specified directory. This can be particularly useful when you need to understand the broader context and relationships between certain parts of the code. You may need to call this tool multiple times to understand various parts of the codebase related to the task.
608
630
  - For example, when asked to make edits or improvements you might analyze the file structure in the initial environment_details to get an overview of the project, then use list_code_definition_names to get further insight using source code definitions for files located in relevant directories, then read_file to examine the contents of relevant files, analyze the code and suggest improvements or make necessary edits, then use the replace_in_file tool to implement changes. If you refactored code that could affect other parts of the codebase, you could use search_files to ensure you update other files as needed.
@@ -613,7 +635,7 @@ class AgenticEdit:
613
635
  RULES
614
636
 
615
637
  - Your current working directory is: {{current_project}}
616
- - You cannot \`cd\` into a different directory to complete a task. You are stuck operating from '${cwd.toPosix()}', so be sure to pass in the correct 'path' parameter when using tools that require a path.
638
+ - You cannot \`cd\` into a different directory to complete a task. You are stuck operating from '{{ current_project }}', so be sure to pass in the correct 'path' parameter when using tools that require a path.
617
639
  - Do not use the ~ character or $HOME to refer to the home directory.
618
640
  - Before using the execute_command tool, you must first think about the SYSTEM INFORMATION context provided to understand the user's environment and tailor your commands to ensure they are compatible with their system. You must also consider if the command you need to run should be executed in a specific directory outside of the current working directory '${cwd.toPosix()}', and if so prepend with \`cd\`'ing into that directory && then executing the command (as one command since you are stuck operating from '${cwd.toPosix()}'). For example, if you needed to run \`npm install\` in a project outside of '${cwd.toPosix()}', you would need to prepend with a \`cd\` i.e. pseudocode for this would be \`cd (path to project) && (command, in this case npm install)\`.
619
641
  - When using the search_files tool, craft your regex patterns carefully to balance specificity and flexibility. Based on the user's task you may use it to find code patterns, TODO comments, function definitions, or any text-based information across the project. The results include context, so analyze the surrounding code to better understand the matches. Leverage the search_files tool in combination with other tools for more comprehensive analysis. For example, use it to find specific code patterns, then use read_file to examine the full context of interesting matches before using replace_in_file to make informed changes.
@@ -634,6 +656,21 @@ class AgenticEdit:
634
656
  - When using the replace_in_file tool, you must include complete lines in your SEARCH blocks, not partial lines. The system requires exact line matches and cannot match partial lines. For example, if you want to match a line containing "const x = 5;", your SEARCH block must include the entire line, not just "x = 5" or other fragments.
635
657
  - When using the replace_in_file tool, if you use multiple SEARCH/REPLACE blocks, list them in the order they appear in the file. For example if you need to make changes to both line 10 and line 50, first include the SEARCH/REPLACE block for line 10, followed by the SEARCH/REPLACE block for line 50.
636
658
  - It is critical you wait for the user's response after each tool use, in order to confirm the success of the tool use. For example, if asked to make a todo app, you would create a file, wait for the user's response it was created successfully, then create another file if needed, wait for the user's response it was created successfully, etc.
659
+
660
+ {% if extra_docs %}
661
+ ====
662
+
663
+ RULES PROVIDED BY USER
664
+
665
+ The following rules are provided by the user, and you must follow them strictly.
666
+
667
+ {% for key, value in extra_docs.items() %}
668
+ <user_rule>
669
+ ##File: {{ key }}
670
+ {{ value }}
671
+ </user_rule>
672
+ {% endfor %}
673
+ {% endif %}
637
674
 
638
675
  ====
639
676
 
@@ -654,29 +691,7 @@ class AgenticEdit:
654
691
  2. Work through these goals sequentially, utilizing available tools one at a time as necessary. Each goal should correspond to a distinct step in your problem-solving process. You will be informed on the work completed and what's remaining as you go.
655
692
  3. Remember, you have extensive capabilities with access to a wide range of tools that can be used in powerful and clever ways as necessary to accomplish each goal. Before calling a tool, do some analysis within <thinking></thinking> tags. First, analyze the file structure provided in environment_details to gain context and insights for proceeding effectively. Then, think about which of the provided tools is the most relevant tool to accomplish the user's task. Next, go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool use. BUT, if one of the values for a required parameter is missing, DO NOT invoke the tool (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters using the ask_followup_question tool. DO NOT ask for more information on optional parameters if it is not provided.
656
693
  4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. \`open index.html\` to show the website you've built.
657
- 5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance.
658
-
659
- {% if enable_active_context %}
660
- **Very Important Notice**
661
- Each directory has a description file stored separately. For example, the description for the directory `{{ current_project }}/src/abc/bbc` can be found in the file `{{ current_project }}/.auto-coder/active-context/src/abc/bbc/active.md`.
662
- You can use the tool `read_file` to read these description files, which helps you decide exactly which files need detailed attention. Note that the `active.md` file does not contain information about all files within the directory—it only includes information
663
- about the files that were recently changed.
664
- {% endif %}
665
-
666
- {% if extra_docs %}
667
- ====
668
-
669
- RULES PROVIDED BY USER
670
-
671
- The following rules are provided by the user, and you must follow them strictly.
672
-
673
- {% for key, value in extra_docs.items() %}
674
- <user_rule>
675
- ##File: {{ key }}
676
- {{ value }}
677
- </user_rule>
678
- {% endfor %}
679
- {% endif %}
694
+ 5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance.
680
695
  """
681
696
  import os
682
697
  extra_docs = get_rules()
@@ -699,7 +714,7 @@ class AgenticEdit:
699
714
  "home_dir": os.path.expanduser("~"),
700
715
  "files": self.files.to_str(),
701
716
  "mcp_server_info": self.mcp_server_info,
702
- "enable_active_context": self.args.enable_active_context,
717
+ "enable_active_context_in_generate": self.args.enable_active_context_in_generate,
703
718
  "extra_docs": extra_docs,
704
719
  }
705
720
 
@@ -762,7 +777,7 @@ class AgenticEdit:
762
777
  logger.info("Adding initial files context to conversation")
763
778
  conversations.append({
764
779
  "role":"user","content":f'''
765
- Below are some files the user is focused on, and the content is up to date. These entries show the file paths along with their full text content, which can help you better understand the user's needs. If the information is insufficient, you can use tools such as read_file to retrieve more details.
780
+ The following are context files that the user is currently focusing on. These files are presented with their complete paths and up-to-date content, providing essential context to help you better understand the user's needs. If you need more detailed information about specific files or directories not shown here, you can use tools like read_file, search_files, or list_files to explore the codebase further.
766
781
  <files>
767
782
  {self.files.to_str()}
768
783
  </files>'''
@@ -17,6 +17,7 @@ from autocoder.common import SourceCodeList
17
17
  from autocoder.memory.active_context_manager import ActiveContextManager
18
18
  from loguru import logger
19
19
  from autocoder.common.rulefiles.autocoderrules_utils import get_rules
20
+ from autocoder.run_context import get_run_context,RunMode
20
21
 
21
22
  class CodeAutoGenerate:
22
23
  def __init__(
@@ -199,7 +200,7 @@ class CodeAutoGenerate:
199
200
  generate_mode="diff"
200
201
  )
201
202
 
202
- if not self.args.human_as_model:
203
+ if not self.args.human_as_model or get_run_context().mode == RunMode.WEB:
203
204
  with ThreadPoolExecutor(max_workers=len(self.llms) * self.generate_times_same_model) as executor:
204
205
  futures = []
205
206
  count = 0
@@ -16,6 +16,7 @@ from autocoder.utils import llms as llm_utils
16
16
  from autocoder.common import SourceCodeList
17
17
  from autocoder.memory.active_context_manager import ActiveContextManager
18
18
  from autocoder.common.rulefiles.autocoderrules_utils import get_rules
19
+ from autocoder.run_context import get_run_context,RunMode
19
20
 
20
21
  class CodeAutoGenerateDiff:
21
22
  def __init__(
@@ -301,7 +302,7 @@ class CodeAutoGenerateDiff:
301
302
  generate_mode="diff"
302
303
  )
303
304
 
304
- if not self.args.human_as_model:
305
+ if not self.args.human_as_model or get_run_context().mode == RunMode.WEB:
305
306
  with ThreadPoolExecutor(max_workers=len(self.llms) * self.generate_times_same_model) as executor:
306
307
  futures = []
307
308
  count = 0
@@ -17,6 +17,7 @@ from autocoder.common import SourceCodeList
17
17
  from autocoder.memory.active_context_manager import ActiveContextManager
18
18
  from autocoder.common.rulefiles.autocoderrules_utils import get_rules
19
19
  from loguru import logger
20
+ from autocoder.run_context import get_run_context,RunMode
20
21
 
21
22
 
22
23
 
@@ -318,7 +319,7 @@ class CodeAutoGenerateEditBlock:
318
319
  generate_mode="editblock"
319
320
  )
320
321
 
321
- if not self.args.human_as_model:
322
+ if not self.args.human_as_model or get_run_context().mode == RunMode.WEB:
322
323
  with ThreadPoolExecutor(max_workers=len(self.llms) * self.generate_times_same_model) as executor:
323
324
  futures = []
324
325
  count = 0
@@ -16,7 +16,8 @@ from autocoder.utils import llms as llm_utils
16
16
  from autocoder.common import SourceCodeList
17
17
  from autocoder.privacy.model_filter import ModelPathFilter
18
18
  from autocoder.memory.active_context_manager import ActiveContextManager
19
- from autocoder.common.rulefiles.autocoderrules_utils import get_rules
19
+ from autocoder.common.rulefiles.autocoderrules_utils import get_rule
20
+ from autocoder.run_context import get_run_context,RunMode
20
21
  class CodeAutoGenerateStrictDiff:
21
22
  def __init__(
22
23
  self, llm: byzerllm.ByzerLLM, args: AutoCoderArgs, action=None
@@ -375,7 +376,7 @@ class CodeAutoGenerateStrictDiff:
375
376
  generate_mode="strict_diff"
376
377
  )
377
378
 
378
- if not self.args.human_as_model:
379
+ if not self.args.human_as_model or get_run_context().mode == RunMode.WEB:
379
380
  with ThreadPoolExecutor(max_workers=len(self.llms) * self.generate_times_same_model) as executor:
380
381
  futures = []
381
382
  count = 0
autocoder/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.1.360"
1
+ __version__ = "0.1.361"