Ajustes conforme relatorio de testes 2026-08-27
This commit is contained in:
BIN
scripts/__pycache__/select_line_policy.cpython-313.pyc
Normal file
BIN
scripts/__pycache__/select_line_policy.cpython-313.pyc
Normal file
Binary file not shown.
32
scripts/select_line_policy.py
Normal file
32
scripts/select_line_policy.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
POLICY_DIR = ROOT / "contas_mcp" / "servers" / "contas_mcp_server"
|
||||
ACTIVE = POLICY_DIR / "line_policy.py"
|
||||
CHOICES = {
|
||||
"alt1": POLICY_DIR / "line_policy_alt1.py",
|
||||
"alt2": POLICY_DIR / "line_policy_alt2.py",
|
||||
}
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description="Seleciona a política de linha ativa do Agent Contas.")
|
||||
parser.add_argument("policy", choices=sorted(CHOICES), help="alt1=linha autenticada apenas; alt2=linhas relacionadas autorizadas")
|
||||
args = parser.parse_args()
|
||||
source = CHOICES[args.policy]
|
||||
if not source.exists():
|
||||
raise SystemExit(f"Fonte de política não encontrado: {source}")
|
||||
shutil.copy2(source, ACTIVE)
|
||||
print(f"Política ativa: {args.policy}")
|
||||
print(f"Fonte: {source.relative_to(ROOT)}")
|
||||
print(f"Ativo: {ACTIVE.relative_to(ROOT)}")
|
||||
print("Reinicie o backend/MCP Server para carregar a política selecionada.")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in New Issue
Block a user