feat(production): sync all modified production files to git
Includes updates across gateway, router, node-worker, memory-service, aurora-service, swapper, sofiia-console UI and node2 infrastructure: - gateway-bot: Dockerfile, http_api.py, druid/aistalk prompts, doc_service - services/router: main.py, router-config.yml, fabric_metrics, memory_retrieval, offload_client, prompt_builder - services/node-worker: worker.py, main.py, config.py, fabric_metrics - services/memory-service: Dockerfile, database.py, main.py, requirements - services/aurora-service: main.py (+399), kling.py, quality_report.py - services/swapper-service: main.py, swapper_config_node2.yaml - services/sofiia-console: static/index.html (console UI update) - config: agent_registry, crewai_agents/teams, router_agents - ops/fabric_preflight.sh: updated preflight checks - router-config.yml, docker-compose.node2.yml: infra updates - docs: NODA1-AGENT-ARCHITECTURE, fabric_contract updated Made-with: Cursor
This commit is contained in:
@@ -748,6 +748,11 @@ BRAND_REGISTRY_URL = os.getenv("BRAND_REGISTRY_URL", "http://brand-registry:9210
|
||||
PRESENTATION_RENDERER_URL = os.getenv("PRESENTATION_RENDERER_URL", "http://presentation-renderer:9212").rstrip("/")
|
||||
ARTIFACT_REGISTRY_URL = os.getenv("ARTIFACT_REGISTRY_URL", "http://artifact-registry:9220").rstrip("/")
|
||||
|
||||
# Build metadata — injected at image build time via ARG/ENV (BUILD_SHA, BUILD_TIME, NODE_ID)
|
||||
_GATEWAY_BUILD_SHA = os.environ.get("BUILD_SHA", "dev")
|
||||
_GATEWAY_BUILD_TIME = os.environ.get("BUILD_TIME", "local")
|
||||
_GATEWAY_NODE_ID = os.environ.get("NODE_ID", "NODA1")
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -985,6 +990,36 @@ SOFIIA_CONFIG = load_agent_config(
|
||||
default_prompt="Ти — Sophia (Софія), Chief AI Architect та Technical Sovereign екосистеми DAARION.city. Координуєш R&D, архітектуру, безпеку та еволюцію платформи.",
|
||||
)
|
||||
|
||||
# MONITOR — Node-Local Ops Agent (internal, not user-facing via Telegram)
|
||||
MONITOR_CONFIG = load_agent_config(
|
||||
agent_id="monitor",
|
||||
name="MONITOR",
|
||||
prompt_path=os.getenv(
|
||||
"MONITOR_PROMPT_PATH",
|
||||
str(Path(__file__).parent / "monitor_prompt.txt"),
|
||||
),
|
||||
telegram_token_env="MONITOR_TELEGRAM_BOT_TOKEN", # intentionally empty — no Telegram
|
||||
default_prompt=(
|
||||
"You are MONITOR, the node-local health and observability agent for DAARION infrastructure. "
|
||||
"You perform health checks, alert triage, and safe ops diagnostics. Internal use only."
|
||||
),
|
||||
)
|
||||
|
||||
# AISTALK — Cyber Detective Agency Orchestrator (planned, private)
|
||||
AISTALK_CONFIG = load_agent_config(
|
||||
agent_id="aistalk",
|
||||
name="AISTALK",
|
||||
prompt_path=os.getenv(
|
||||
"AISTALK_PROMPT_PATH",
|
||||
str(Path(__file__).parent / "aistalk_prompt.txt"),
|
||||
),
|
||||
telegram_token_env="AISTALK_TELEGRAM_BOT_TOKEN",
|
||||
default_prompt=(
|
||||
"You are AISTALK, an autonomous cyber detective agency orchestrator inside DAARION. "
|
||||
"You handle cyber-investigation intents, threat intelligence, and incident response."
|
||||
),
|
||||
)
|
||||
|
||||
# Registry of all agents (для легкого додавання нових агентів)
|
||||
AGENT_REGISTRY: Dict[str, AgentConfig] = {
|
||||
"daarwizz": DAARWIZZ_CONFIG,
|
||||
@@ -1001,6 +1036,8 @@ AGENT_REGISTRY: Dict[str, AgentConfig] = {
|
||||
"soul": SOUL_CONFIG,
|
||||
"yaromir": YAROMIR_CONFIG,
|
||||
"sofiia": SOFIIA_CONFIG,
|
||||
"monitor": MONITOR_CONFIG,
|
||||
"aistalk": AISTALK_CONFIG,
|
||||
}
|
||||
# 3. Створіть endpoint (опціонально, якщо потрібен окремий webhook):
|
||||
# @router.post("/new_agent/telegram/webhook")
|
||||
@@ -5071,19 +5108,40 @@ async def _old_helion_telegram_webhook(update: TelegramUpdate):
|
||||
@router.get("/health")
|
||||
async def health():
|
||||
"""Health check endpoint"""
|
||||
# Static metadata for agents that don't have Telegram — used by Sofiia console UI badges
|
||||
_AGENT_META: Dict[str, Dict] = {
|
||||
"monitor": {"badges": ["per-node", "ops"], "visibility": "internal", "telegram_mode": "off"},
|
||||
"aistalk": {"badges": ["cyber", "private"], "visibility": "private", "lifecycle_status": "planned"},
|
||||
"sofiia": {"badges": ["supervisor", "architect"]},
|
||||
"helion": {"badges": ["cto", "dao"]},
|
||||
}
|
||||
|
||||
agents_info = {}
|
||||
for agent_id, config in AGENT_REGISTRY.items():
|
||||
meta = _AGENT_META.get(agent_id, {})
|
||||
agents_info[agent_id] = {
|
||||
"name": config.name,
|
||||
"prompt_loaded": len(config.system_prompt) > 0,
|
||||
"telegram_token_configured": config.get_telegram_token() is not None
|
||||
"telegram_token_configured": config.get_telegram_token() is not None,
|
||||
"badges": meta.get("badges", []),
|
||||
"visibility": meta.get("visibility", "public"),
|
||||
"telegram_mode": meta.get("telegram_mode", "on"),
|
||||
"lifecycle_status": meta.get("lifecycle_status", "active"),
|
||||
}
|
||||
|
||||
|
||||
# Required per-node agents check
|
||||
required_agents = ["monitor"]
|
||||
required_missing = [aid for aid in required_agents if aid not in agents_info]
|
||||
|
||||
return {
|
||||
"status": "healthy",
|
||||
"agents": agents_info,
|
||||
"agents_count": len(AGENT_REGISTRY),
|
||||
"required_missing": required_missing,
|
||||
"timestamp": datetime.utcnow().isoformat(),
|
||||
"build_sha": _GATEWAY_BUILD_SHA,
|
||||
"build_time": _GATEWAY_BUILD_TIME,
|
||||
"node_id": _GATEWAY_NODE_ID,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user