/** * Committee-Aware Agent Discovery * * Extends agent discovery with committee sharding awareness. Instead of * discovering all agents, discovers only the committee assigned to a wallet. * This enables parallel signing across committees for higher throughput. * * Committee assignments are read from the on-chain CommitteeRegistry contract. * Each committee has its own independent DKG, presignature pool, and signing * sessions. * * @example * ```typescript * const committee = new CommitteeDiscovery({ * rpcUrl: 'https://mainnet-rpc.sequence0.network', * registryAddress: '0x...', // AgentRegistry * committeeRegistryAddress: '0x...', // CommitteeRegistry * }); * * // Get the committee for a specific wallet * const committeeId = await committee.getCommitteeForWallet('wallet-abc123'); * * // Get agents in that committee * const agents = await committee.getCommitteeAgents(committeeId); * * // Select a healthy agent from the committee * const agentUrl = await committee.selectSigningAgent(committeeId); * ``` */ import { AgentInfo, DiscoveryOptions } from './discovery'; export interface CommitteeDiscoveryOptions extends DiscoveryOptions { /** CommitteeRegistry contract address */ committeeRegistryAddress: string; } export interface CommitteeInfo { /** Committee ID (0-based) */ committeeId: number; /** Agent peer IDs in this committee */ members: string[]; /** Signing threshold for this committee */ threshold: number; /** Current partition epoch */ epoch: number; } export interface CommitteeSummary { /** Number of committees */ numCommittees: number; /** Current partition epoch */ epoch: number; /** Per-committee info */ committees: { committeeId: number; memberCount: number; threshold: number; }[]; } export declare class CommitteeDiscovery { private rpcUrl; private committeeRegistryAddress; private discovery; private committeeCache; private cacheTtl; constructor(options: CommitteeDiscoveryOptions); /** * Get the committee ID assigned to a wallet. * Reads CommitteeRegistry.getWalletCommittee(walletId) on-chain. * * @param walletId - The wallet identifier * @returns Committee ID (0-based) */ getCommitteeForWallet(walletId: string): Promise; /** * Get agent endpoints for a specific committee. * Cross-references CommitteeRegistry members with AgentRegistry discovery. * * @param committeeId - Committee ID (0-based) * @returns Array of agent info for agents in this committee */ getCommitteeAgents(committeeId: number): Promise; /** * Select the best healthy agent from a committee for signing. * Performs health checks and randomly selects from healthy agents. * * @param committeeId - Committee ID (0-based) * @returns API URL of a healthy agent in the committee * @throws NetworkError if no healthy agents found in the committee */ selectSigningAgent(committeeId: number): Promise; /** * Get the number of committees in the current partition. */ getNumCommittees(): Promise; /** * Get the current partition epoch. */ getPartitionEpoch(): Promise; /** * Get all agents grouped by committee. * Returns a map of committeeId -> AgentInfo[]. */ getAllCommittees(): Promise>; /** * Invalidate all committee caches. * Call after a repartition event to force re-discovery. */ clearCache(): void; /** * Get the peer IDs of members in a specific committee from on-chain. */ private getCommitteeMembers; private ethCall; /** * Decode a dynamic string[] from ABI-encoded data. */ private decodeStringArray; } //# sourceMappingURL=committee.d.ts.map