mirror of
https://github.com/johndoe6345789/AutoMetabuilder.git
synced 2026-04-24 13:54:59 +00:00
Introduce AutoMetabuilder core components and workflow packages:
- Implement core components: CLI argument parsing, environment loading, GitHub service creation, and logging configuration. - Add support for OpenAI client setup and model resolution. - Develop SDLC context loader from GitHub and repository files. - Implement workflow context and engine builders. - Introduce major workflow packages: `game_tick_loop` and `contextual_iterative_loop`. - Update localization files with new package descriptions and labels. - Streamline web navigation by loading items from a dedicated JSON file.
This commit is contained in:
30
backend/autometabuilder/web/routes/prompt.py
Normal file
30
backend/autometabuilder/web/routes/prompt.py
Normal file
@@ -0,0 +1,30 @@
|
||||
"""Prompt and workflow editing routes."""
|
||||
from __future__ import annotations
|
||||
|
||||
from flask import Blueprint, request
|
||||
|
||||
from ..data import build_prompt_yaml, write_prompt, write_workflow
|
||||
|
||||
prompt_bp = Blueprint("prompt", __name__)
|
||||
|
||||
|
||||
@prompt_bp.route("/api/prompt", methods=["POST"])
|
||||
def api_prompt() -> tuple[dict[str, str], int]:
|
||||
payload = request.get_json(force=True)
|
||||
content = payload.get("content")
|
||||
system = payload.get("system_content")
|
||||
user = payload.get("user_content")
|
||||
model = payload.get("model")
|
||||
mode = payload.get("prompt_mode", "builder")
|
||||
if mode == "raw" and content is not None:
|
||||
write_prompt(content)
|
||||
else:
|
||||
write_prompt(build_prompt_yaml(system, user, model))
|
||||
return {"status": "ok"}, 200
|
||||
|
||||
|
||||
@prompt_bp.route("/api/workflow", methods=["POST"])
|
||||
def api_workflow() -> tuple[dict[str, str], int]:
|
||||
payload = request.get_json(force=True)
|
||||
write_workflow(payload.get("content", ""))
|
||||
return {"status": "saved"}, 200
|
||||
16
backend/autometabuilder/web/routes/settings.py
Normal file
16
backend/autometabuilder/web/routes/settings.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""Settings persistence route."""
|
||||
from __future__ import annotations
|
||||
|
||||
from flask import Blueprint, request
|
||||
|
||||
from ..data import persist_env_vars
|
||||
|
||||
settings_bp = Blueprint("settings", __name__)
|
||||
|
||||
|
||||
@settings_bp.route("/api/settings", methods=["POST"])
|
||||
def api_settings() -> tuple[dict[str, str], int]:
|
||||
payload = request.get_json(force=True) or {}
|
||||
entries = payload.get("env", {}) or {}
|
||||
persist_env_vars(entries)
|
||||
return {"status": "ok"}, 200
|
||||
Reference in New Issue
Block a user