UNPKG

overmind-mcp

Version:

Orchestrateur universel agents IA multi-modeles via MCP. Inclut le protocole 'Custom-Nickname' pour identifier vos agents avec des surnoms originaux (The Chaos Prophet, Shadow Sniper, etc.), l'isolation mémoire (Private Memory Context) et le support pour

82 lines • 3.81 kB
/** * HermesGatewayRunner — HTTP-based runner for the Hermes API Server. * * ╔══════════════════════════════════════════════════════════════════════╗ * ║ ARCHITECTURE (v3.5 — Gateway Integration) ║ * ║ ║ * ║ Replaces the subprocess spawn in HermesRunner with HTTP+SSE calls ║ * ║ to the Hermes API Server (gateway/platforms/api_server.py). ║ * ║ ║ * ║ BENEFITS over HermesRunner (spawn): ║ * ║ - No Python startup per call (~5-10s saved) ║ * ║ - SSE streaming output in real-time ║ * ║ - Native session management via X-Hermes-Session-Id header ║ * ║ - Proper abort via fetch AbortController ║ * ║ - Model/provider swap via config, not CLI flags ║ * ║ ║ * ║ ENDPOINTS USED: ║ * ║ POST /v1/chat/completions → main chat (streaming SSE or JSON) ║ * ║ GET /health → connectivity check ║ * ║ ║ * ║ FALLBACK: ║ * ║ If the API server is not running, falls back to HermesRunner ║ * ║ (subprocess spawn) for backward compatibility. ║ * ╚══════════════════════════════════════════════════════════════════════╝ */ export interface GatewayRunOptions { prompt: string; agentName?: string; sessionId?: string; autoResume?: boolean; model?: string; provider?: string; signal?: AbortSignal; silent?: boolean; /** Profile name for Hermes (maps to -p flag in spawn mode) */ profile?: string; } export interface GatewayRunResult { result: string; sessionId?: string; error?: string; rawOutput?: string; model?: string; /** How the run was executed */ transport: 'gateway-http' | 'fallback-spawn'; } /** * Runner that talks to the Hermes API Server via HTTP+SSE. * * Falls back to HermesRunner (subprocess spawn) if the API server is not * available — ensuring zero downtime during the migration. */ export declare class HermesGatewayRunner { private manager; constructor(); /** * Run a prompt against the Hermes API Server. * * If the server is not reachable, returns an error with transport='fallback-spawn' * so the caller can decide to use the old HermesRunner. */ runAgent(options: GatewayRunOptions): Promise<GatewayRunResult>; /** * Execute a chat completion against the API server. * * Uses streaming SSE to get real-time output, assembling the final * text from delta chunks. */ private executeChat; /** * Parse the SSE stream from /v1/chat/completions. * * Format (OpenAI-compatible): * data: {"choices":[{"delta":{"content":"hello"}}]} * data: {"choices":[{"delta":{"content":" world"}}]} * data: [DONE] * * Assembles full text, streams chunks to agent_lifecycle in real-time. */ private parseSSEStream; } //# sourceMappingURL=HermesGatewayRunner.d.ts.map