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

64 lines • 3.38 kB
/** * ╔══════════════════════════════════════════════════════════════════════╗ * ║ OVERMIND BRIDGE — BridgeProxy (Base Client SDK Proxy) ║ * ║ ║ * ║ [SCRIPT DE BASE - CLIENT SDK LOW-LEVEL TRANSPORT] ║ * ║ Couche basse : transport JSON-RPC 2.0 vers Overmind MCP Server. ║ * ║ Gère : reconnexion, health checks, circuit breaker, SSE streaming.║ * ║ ║ * ║ ARCHITECTURE ║ * ║ ───────────── ║ * ║ OverBridgeService → BridgeProxy → HTTP [::1]:3099/mcp ║ * ║ → Overmind MCP Server ║ * ╚══════════════════════════════════════════════════════════════════════╝ */ import type { BridgeConfig, CircuitBreakerConfig, CircuitState, HealthStatus, McpResponse } from './types.js'; import { type BridgeLogger } from './utils.js'; export declare class BridgeProxy { private rpcId; private readonly config; private readonly circuit; readonly log: BridgeLogger; constructor(config?: Partial<BridgeConfig>, circuitConfig?: Partial<CircuitBreakerConfig>, logger?: BridgeLogger); get mcpUrl(): string; get agentTimeout(): number; get defaultMcpServers(): import('./types.js').McpServerSpec[]; get circuitState(): CircuitState; /** * Force a circuit breaker reset and clear cached state. * * Fix #3: Called by OverBridgeService heartbeat after consecutive failures. * This allows the next call to bypass the 'open' circuit and attempt * a fresh connection instead of waiting for resetTimeoutMs. */ forceReconnect(): void; /** * Appelle un tool MCP via JSON-RPC 2.0 sur HTTP. * * TIMEOUT STRATEGY (3 couches) : * 1. AbortController sur le fetch initial * 2. Body reader avec deadline absolue * 3. Promise.race per-chunk (sécurité si le serveur ne produit plus) * * @param toolName Nom de l'outil MCP (ex: 'run_agent', 'memory_search') * @param args Arguments de l'outil * @param timeoutMs Timeout en ms (default: config.defaultTimeoutMs) */ call(toolName: string, args: Record<string, unknown>, timeoutMs?: number): Promise<McpResponse>; /** * Envoie un ping HTTP au serveur MCP. * Utilise un simple GET /health (plus léger que le handshake JSON-RPC complet). * Fallback: POST /mcp avec Accept SSE (si /health n'existe pas). */ ping(timeoutMs?: number): Promise<boolean>; healthCheck(): Promise<HealthStatus>; private _fetch; /** * Lecture du body response avec 3 couches de timeout : * 1. Deadline absolue (startRead + timeoutMs) * 2. Promise.race per-chunk * 3. reader.cancel() sur timeout */ private _readBody; } //# sourceMappingURL=BridgeProxy.d.ts.map