import type Database from 'better-sqlite3'; import type { Contract, ContractParticipant, ContractWithParticipants } from '../schema.js'; /** * Repository for contract (cross-process communication channel) operations. */ export declare class ContractRepository { private db; constructor(db: Database.Database); /** * Upsert a contract by (protocol, normalizedKey). Returns the contract ID. */ upsertContract(protocol: string, key: string, normalizedKey: string, description?: string): number; /** * Add a participant to a contract. Returns the participant ID. * Skips if the (contract_id, definition_id) pair already exists. */ addParticipant(contractId: number, definitionId: number, moduleId: number | null, role: string): number; /** * Get all contracts. */ getAll(): Contract[]; /** * Get a contract with its participants. */ getWithParticipants(contractId: number): ContractWithParticipants | null; /** * Get all contracts with their participants. */ getAllWithParticipants(): ContractWithParticipants[]; /** * Get contracts by protocol. */ getByProtocol(protocol: string): Contract[]; /** * Get matched contracts (contracts with participants having complementary roles). */ getMatchedContracts(): ContractWithParticipants[]; /** * Get unmatched contracts (one-sided — only one role). */ getUnmatchedContracts(): ContractWithParticipants[]; /** * Get participants for a specific module. */ getParticipantsByModule(moduleId: number): Array; /** * Get total contract count. */ getCount(): number; /** * Get protocol breakdown: count of contracts per protocol. */ getProtocolBreakdown(): Array<{ protocol: string; count: number; }>; /** * Get participant count. */ getParticipantCount(): number; /** * Get communication topology between process groups. * Groups contracts by the process groups of their participants' modules. */ getTopologyBetweenGroups(moduleToGroup: Map): Array<{ fromGroupLabel: string; toGroupLabel: string; contractCount: number; protocols: string[]; }>; /** * Find a contract by protocol and normalizedKey. */ findByProtocolAndKey(protocol: string, normalizedKey: string): Contract | null; /** * Get participants for a contract with definition and module details. */ getParticipantsWithDetails(contractId: number): Array; /** * Backfill NULL module_ids by looking up definition → module_members. * Useful when contracts were extracted before modules existed, * or for standalone `contracts extract` runs. */ backfillModuleIds(): number; /** * Delete a single contract and its participants. */ deleteContract(contractId: number): void; /** * Delete all contracts and participants. */ clear(): void; } //# sourceMappingURL=contract-repository.d.ts.map