import { MemoryEngine } from './memory.js';
import { type NexusNetRelayStatus } from './nexusnet-relay.js';
export interface TraceEntry {
    taskId: string;
    goal: string;
    findings: string[];
    confidence: number;
    timestamp: number;
}
export interface FederatedPeer {
    peerId: string;
    displayName: string;
    source: 'local' | 'relay' | 'manual';
    capabilities: string[];
    trust: 'low' | 'medium' | 'high';
    lastHeartbeat: number;
    active: boolean;
    health: 'active' | 'stale' | 'offline';
}
export interface FederationLearning {
    learningId: string;
    summary: string;
    sourcePeerId: string;
    timestamp: number;
    tags: string[];
}
export interface FederationSnapshot {
    localNode: {
        nodeId: string;
        displayName: string;
        startedAt: number;
    };
    knownPeers: FederatedPeer[];
    activePeerLinks: number;
    relayLearnings: FederationLearning[];
    tracesPublished: number;
    relay: NexusNetRelayStatus;
}
export declare class FederationEngine {
    private memory?;
    private state;
    private discoveryPromise?;
    constructor(memory?: MemoryEngine);
    discover(): Promise<void>;
    heartbeat(peerId: string, input?: {
        displayName?: string;
        source?: FederatedPeer['source'];
        capabilities?: string[];
        trust?: FederatedPeer['trust'];
    }): FederatedPeer;
    publishTrace(trace: TraceEntry): {
        id: string;
        url: string;
    };
    sync(): number;
    recordRelayLearning(summary: string, sourcePeerId: string, tags?: string[]): FederationLearning;
    getSnapshot(): FederationSnapshot;
    private loadState;
    private agePeers;
    private persist;
    private ensureMemory;
    private ensureDiscoveryStarted;
}
export declare function getDefaultFederation(): FederationEngine;
export declare const federation: FederationEngine;
