auto-coder-web 0.1.12__tar.gz → 0.1.14__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/PKG-INFO +2 -2
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/README.md +1 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web/auto_coder_runner.py +76 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web/proxy.py +8 -0
- auto_coder_web-0.1.14/src/auto_coder_web/version.py +1 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web/web/asset-manifest.json +3 -3
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web/web/index.html +1 -1
- auto_coder_web-0.1.12/src/auto_coder_web/web/static/js/main.a7061d2f.js → auto_coder_web-0.1.14/src/auto_coder_web/web/static/js/main.34adf43b.js +3 -3
- auto_coder_web-0.1.12/src/auto_coder_web/web/static/js/main.a7061d2f.js.map → auto_coder_web-0.1.14/src/auto_coder_web/web/static/js/main.34adf43b.js.map +1 -1
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web.egg-info/PKG-INFO +2 -2
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web.egg-info/SOURCES.txt +3 -3
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web.egg-info/requires.txt +1 -1
- auto_coder_web-0.1.12/src/auto_coder_web/version.py +0 -1
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/setup.cfg +0 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/setup.py +0 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web/__init__.py +0 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web/file_group.py +0 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web/file_manager.py +0 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web/json_file_storage.py +0 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web/terminal.py +0 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web/web/favicon.ico +0 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web/web/logo192.png +0 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web/web/logo512.png +0 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web/web/manifest.json +0 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web/web/robots.txt +0 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web/web/static/css/main.10e5dd19.css +0 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web/web/static/css/main.10e5dd19.css.map +0 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web/web/static/js/453.d855a71b.chunk.js +0 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web/web/static/js/453.d855a71b.chunk.js.map +0 -0
- /auto_coder_web-0.1.12/src/auto_coder_web/web/static/js/main.a7061d2f.js.LICENSE.txt → /auto_coder_web-0.1.14/src/auto_coder_web/web/static/js/main.34adf43b.js.LICENSE.txt +0 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web.egg-info/dependency_links.txt +0 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web.egg-info/entry_points.txt +0 -0
- {auto_coder_web-0.1.12 → auto_coder_web-0.1.14}/src/auto_coder_web.egg-info/top_level.txt +0 -0
@@ -1,13 +1,13 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: auto_coder_web
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.14
|
4
4
|
Summary: auto-coder.web: A Python Project
|
5
5
|
Author: allwefantasy
|
6
6
|
Classifier: Programming Language :: Python :: 3.9
|
7
7
|
Classifier: Programming Language :: Python :: 3.10
|
8
8
|
Classifier: Programming Language :: Python :: 3.11
|
9
9
|
Description-Content-Type: text/markdown
|
10
|
-
Requires-Dist: auto-coder>=0.1.
|
10
|
+
Requires-Dist: auto-coder>=0.1.203
|
11
11
|
Requires-Dist: aiofiles
|
12
12
|
Requires-Dist: psutil
|
13
13
|
Requires-Dist: sse-starlette
|
@@ -10,6 +10,7 @@ import sys
|
|
10
10
|
import io
|
11
11
|
import subprocess
|
12
12
|
import byzerllm
|
13
|
+
import hashlib
|
13
14
|
from contextlib import contextmanager
|
14
15
|
from byzerllm.utils.langutil import asyncfy_with_semaphore
|
15
16
|
from autocoder.common import AutoCoderArgs
|
@@ -29,6 +30,7 @@ from autocoder.utils.queue_communicate import (
|
|
29
30
|
CommunicateEventType,
|
30
31
|
)
|
31
32
|
from autocoder.utils.log_capture import LogCapture
|
33
|
+
from autocoder.common import git_utils
|
32
34
|
from threading import Thread
|
33
35
|
from byzerllm.utils import format_str_jinja2
|
34
36
|
from autocoder.index.symbols_utils import (
|
@@ -315,6 +317,80 @@ class AutoCoderRunner:
|
|
315
317
|
self.save_memory()
|
316
318
|
return {"message": f"Deleted configuration: {key}"}
|
317
319
|
|
320
|
+
def convert_yaml_to_config(self, yaml_file: str):
|
321
|
+
"""Convert YAML file to AutoCoderArgs configuration"""
|
322
|
+
from autocoder.auto_coder import AutoCoderArgs, load_include_files, Template
|
323
|
+
args = AutoCoderArgs()
|
324
|
+
with open(yaml_file, "r") as f:
|
325
|
+
config = yaml.safe_load(f)
|
326
|
+
config = load_include_files(config, yaml_file)
|
327
|
+
for key, value in config.items():
|
328
|
+
if key != "file": # 排除 --file 参数本身
|
329
|
+
# key: ENV {{VARIABLE_NAME}}
|
330
|
+
if isinstance(value, str) and value.startswith("ENV"):
|
331
|
+
template = Template(value.removeprefix("ENV").strip())
|
332
|
+
value = template.render(os.environ)
|
333
|
+
setattr(args, key, value)
|
334
|
+
return args
|
335
|
+
|
336
|
+
def commit(self):
|
337
|
+
"""Commit changes using git"""
|
338
|
+
try:
|
339
|
+
def prepare_commit_yaml():
|
340
|
+
auto_coder_main(["next", "chat_action"])
|
341
|
+
|
342
|
+
prepare_commit_yaml()
|
343
|
+
|
344
|
+
latest_yaml_file = get_last_yaml_file("actions")
|
345
|
+
|
346
|
+
if latest_yaml_file:
|
347
|
+
try:
|
348
|
+
execute_file = os.path.join("actions", latest_yaml_file)
|
349
|
+
yaml_config = {
|
350
|
+
"include_file": ["./base/base.yml"],
|
351
|
+
"auto_merge": self.memory.get("conf", {}).get("auto_merge", "editblock"),
|
352
|
+
"human_as_model": self.memory.get("conf", {}).get("human_as_model", "false") == "true",
|
353
|
+
"skip_build_index": self.memory.get("conf", {}).get("skip_build_index", "true") == "true",
|
354
|
+
"skip_confirm": self.memory.get("conf", {}).get("skip_confirm", "true") == "true",
|
355
|
+
"silence": self.memory.get("conf", {}).get("silence", "true") == "true",
|
356
|
+
"include_project_structure": self.memory.get("conf", {}).get("include_project_structure", "true") == "true",
|
357
|
+
}
|
358
|
+
|
359
|
+
conf = self.memory.get("conf", {})
|
360
|
+
for key, value in conf.items():
|
361
|
+
converted_value = self.convert_config_value(key, value)
|
362
|
+
if converted_value is not None:
|
363
|
+
yaml_config[key] = converted_value
|
364
|
+
|
365
|
+
yaml_config["urls"] = self.memory["current_files"]["files"] + self.get_llm_friendly_package_docs(
|
366
|
+
return_paths=True
|
367
|
+
)
|
368
|
+
args = self.convert_yaml_to_config(execute_file)
|
369
|
+
llm = byzerllm.ByzerLLM.from_default_model(args.code_model or args.model)
|
370
|
+
uncommitted_changes = git_utils.get_uncommitted_changes(".")
|
371
|
+
commit_message = git_utils.generate_commit_message.with_llm(
|
372
|
+
llm).run(uncommitted_changes)
|
373
|
+
|
374
|
+
yaml_config["query"] = commit_message
|
375
|
+
yaml_content = self.convert_yaml_config_to_str(yaml_config=yaml_config)
|
376
|
+
with open(execute_file, "w") as f:
|
377
|
+
f.write(yaml_content)
|
378
|
+
|
379
|
+
file_content = open(execute_file).read()
|
380
|
+
md5 = hashlib.md5(file_content.encode('utf-8')).hexdigest()
|
381
|
+
file_name = os.path.basename(execute_file)
|
382
|
+
commit_result = git_utils.commit_changes(".", f"auto_coder_{file_name}_{md5}")
|
383
|
+
|
384
|
+
return {"status": True, "message": "Changes committed successfully", "commit_info": commit_result}
|
385
|
+
except Exception as e:
|
386
|
+
if execute_file:
|
387
|
+
os.remove(execute_file)
|
388
|
+
return {"status": False, "message": f"Failed to commit: {str(e)}"}
|
389
|
+
else:
|
390
|
+
return {"status": False, "message": "No changes to commit"}
|
391
|
+
except Exception as e:
|
392
|
+
return {"status": False, "message": f"Failed to commit: {str(e)}"}
|
393
|
+
|
318
394
|
def get_config(self) -> Dict[str, str]:
|
319
395
|
"""Get current configuration
|
320
396
|
|
@@ -585,6 +585,14 @@ class ProxyServer:
|
|
585
585
|
request_id, request.event, request.response)
|
586
586
|
return {"message": "success"}
|
587
587
|
|
588
|
+
@self.app.post("/api/commit")
|
589
|
+
async def commit():
|
590
|
+
try:
|
591
|
+
result = self.auto_coder_runner.commit()
|
592
|
+
return result
|
593
|
+
except Exception as e:
|
594
|
+
raise HTTPException(status_code=500, detail=str(e))
|
595
|
+
|
588
596
|
@self.app.get("/api/output/{request_id}")
|
589
597
|
async def get_terminal_logs(request_id: str):
|
590
598
|
return self.auto_coder_runner.get_logs(request_id)
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.1.14"
|
@@ -1,15 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"files": {
|
3
3
|
"main.css": "/static/css/main.10e5dd19.css",
|
4
|
-
"main.js": "/static/js/main.
|
4
|
+
"main.js": "/static/js/main.34adf43b.js",
|
5
5
|
"static/js/453.d855a71b.chunk.js": "/static/js/453.d855a71b.chunk.js",
|
6
6
|
"index.html": "/index.html",
|
7
7
|
"main.10e5dd19.css.map": "/static/css/main.10e5dd19.css.map",
|
8
|
-
"main.
|
8
|
+
"main.34adf43b.js.map": "/static/js/main.34adf43b.js.map",
|
9
9
|
"453.d855a71b.chunk.js.map": "/static/js/453.d855a71b.chunk.js.map"
|
10
10
|
},
|
11
11
|
"entrypoints": [
|
12
12
|
"static/css/main.10e5dd19.css",
|
13
|
-
"static/js/main.
|
13
|
+
"static/js/main.34adf43b.js"
|
14
14
|
]
|
15
15
|
}
|
@@ -1 +1 @@
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><script defer="defer" src="/static/js/main.
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><script defer="defer" src="/static/js/main.34adf43b.js"></script><link href="/static/css/main.10e5dd19.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|