This commit introduces a comprehensive set of new features including API key authentication with CLI management commands (get, reset, backfill), a Devii agentic assistant with WebSocket terminal and session bootstrap, an OpenAI-compatible LLM gateway service, and an admin service management panel. It also adds Playwright browser automation for bot support, configures internal gateway URLs, refactors content editing/deletion to support JSON API responses, and updates documentation across AGENTS.md, README.md, and the developer docs site.
45 lines
799 B
Python
45 lines
799 B
Python
# retoor <retoor@molodetz.nl>
|
|
|
|
from __future__ import annotations
|
|
|
|
import asyncio
|
|
import sys
|
|
|
|
RESET = "\033[0m"
|
|
BOLD = "\033[1m"
|
|
CYAN = "\033[36m"
|
|
GREEN = "\033[32m"
|
|
YELLOW = "\033[33m"
|
|
GREY = "\033[90m"
|
|
|
|
|
|
def _supports_color() -> bool:
|
|
return sys.stdout.isatty()
|
|
|
|
|
|
def paint(text: str, color: str) -> str:
|
|
if not _supports_color():
|
|
return text
|
|
return f"{color}{text}{RESET}"
|
|
|
|
|
|
def banner(text: str) -> None:
|
|
print(paint(text, BOLD + CYAN))
|
|
|
|
|
|
def assistant(text: str) -> None:
|
|
print(paint("agent> ", GREEN) + text)
|
|
|
|
|
|
def notice(text: str) -> None:
|
|
print(paint(text, GREY))
|
|
|
|
|
|
def warn(text: str) -> None:
|
|
print(paint(text, YELLOW))
|
|
|
|
|
|
async def prompt(label: str) -> str:
|
|
rendered = paint(label, BOLD + CYAN)
|
|
return await asyncio.to_thread(input, rendered)
|