@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
84 lines (83 loc) • 2.38 kB
TypeScript
/**
* Agent Coordinator - Manages coordination between agents in a network
*
* The Coordinator is responsible for:
* - Managing agent lifecycle and state
* - Coordinating task execution across multiple agents
* - Handling agent dependencies and execution order
* - Managing shared context and state between agents
*/
import type { Agent } from "../agent.js";
import type { AgentStatus, CoordinatorConfig, CoordinationResult, TaskAssignment } from "../../types/index.js";
/**
* Agent Coordinator - Orchestrates multi-agent execution
*/
export declare class AgentCoordinator {
private agents;
private config;
private emitter;
private activeExecutions;
private executionHistory;
private roundRobinCursor;
constructor(config?: Partial<CoordinatorConfig>);
/**
* Register an agent with the coordinator
*/
registerAgent(agent: Agent): void;
/**
* Unregister an agent
*/
unregisterAgent(agentId: string): void;
/**
* Get all registered agents
*/
getAgents(): Agent[];
/**
* Get agent status
*/
getAgentStatus(agentId: string): AgentStatus | undefined;
/**
* Execute a coordinated task across agents
*/
coordinate(task: string, options?: Partial<CoordinatorConfig>): Promise<CoordinationResult>;
/**
* Execute agents sequentially
*/
private executeSequential;
/**
* Execute agents in parallel
*/
private executeParallel;
/**
* Execute agents in a pipeline (output feeds into next)
*/
private executePipeline;
/**
* Execute using round-robin distribution
*/
private executeRoundRobin;
/**
* Execute using least busy agent
*/
private executeLeastBusy;
/**
* Execute an agent with timeout
*/
private executeAgentWithTimeout;
/**
* Execute multiple task assignments with dependencies
*/
executeWithDependencies(assignments: TaskAssignment[]): Promise<CoordinationResult>;
/**
* Update coordinator configuration
*/
updateConfig(config: Partial<CoordinatorConfig>): void;
/**
* Subscribe to coordinator events
*/
on(event: string, handler: (...args: unknown[]) => void): void;
/**
* Unsubscribe from coordinator events
*/
off(event: string, handler: (...args: unknown[]) => void): void;
}