/** * Coordination engine for agent discovery, delegation, and handoffs. * Provides scoring algorithm and discovery method for ranking agents * by capability overlap and liveness. */ import type { BlackboardEngine } from "./blackboard.js"; import type { AgentRecord, AgentScore, LivenessThresholds, DiscoverInput, DiscoverResult, DelegationInput, DelegationResult, DelegationMetadata, DelegationUrgency, BlackboardEntry, CreateHandoffInput, HandoffRecord, TwiningConfig } from "../utils/types.js"; import type { IAgentStore, IBlackboardStore, IDecisionStore, IHandoffStore } from "../storage/interfaces.js"; /** * Score an agent against required capabilities and liveness. * Pure function — no side effects, fully testable in isolation. * * Weighting: 70% capability overlap + 30% liveness score. */ export declare function scoreAgent(agent: AgentRecord, requiredCapabilities: string[], livenessThresholds: LivenessThresholds, now?: Date): AgentScore; /** Default timeout durations per urgency level. */ export declare const DELEGATION_TIMEOUTS: Record; /** * Parse delegation metadata from a blackboard entry's detail field. * Returns null for non-delegation entries or malformed JSON. */ export declare function parseDelegationMetadata(entry: BlackboardEntry): DelegationMetadata | null; /** * Check if a delegation has expired. * Returns true when now >= expires_at (boundary inclusive). */ export declare function isDelegationExpired(metadata: DelegationMetadata, now?: Date): boolean; export declare class CoordinationEngine { private readonly agentStore; private readonly handoffStore; private readonly blackboardEngine; private readonly decisionStore; private readonly blackboardStore; private readonly config; constructor(agentStore: IAgentStore, handoffStore: IHandoffStore, blackboardEngine: BlackboardEngine, decisionStore: IDecisionStore, blackboardStore: IBlackboardStore, config: TwiningConfig); /** Discover and rank agents by capability match and liveness. */ discover(input: DiscoverInput): Promise; /** Post a delegation request to the blackboard. */ postDelegation(input: DelegationInput): Promise; /** * Assemble a context snapshot from active decisions and blackboard * warnings/findings. Used by createHandoff when auto_snapshot is true. */ private assembleContextSnapshot; /** Create a handoff record between agents. */ createHandoff(input: CreateHandoffInput): Promise; /** Acknowledge receipt of a handoff. */ acknowledgeHandoff(handoffId: string, agentId: string): Promise; } //# sourceMappingURL=coordination.d.ts.map