import { TrustLevel } from './trust-level.js'; import { FederationNodeState, SuspensionReason, TransitionReason } from '../value-objects/federation-node-state.js'; export interface FederationNodeCapabilities { readonly agentTypes: readonly string[]; readonly maxConcurrentSessions: number; readonly supportedProtocols: readonly string[]; readonly complianceModes: readonly string[]; } export interface FederationNodeMetadata { readonly organizationId?: string; readonly region?: string; readonly version?: string; readonly [key: string]: unknown; } /** Last-transition record kept on the entity for the audit trail. */ export interface FederationNodeStateRecord { readonly state: FederationNodeState; readonly changedAt: Date; readonly reason?: SuspensionReason; readonly correlationId?: string; } export interface FederationNodeProps { readonly nodeId: string; readonly publicKey: string; readonly endpoint: string; readonly capabilities: FederationNodeCapabilities; readonly trustLevel: TrustLevel; readonly trustScore: number; readonly lastSeen: Date; readonly metadata: FederationNodeMetadata; /** Phase 2: peer state. Defaults to ACTIVE if unset. */ readonly state?: FederationNodeState; /** Phase 2: when the current state was entered. Defaults to now. */ readonly stateChangedAt?: Date; /** Phase 2: why we entered the current non-ACTIVE state. */ readonly stateReason?: SuspensionReason; /** Phase 2: caller correlation key for the last transition. */ readonly stateCorrelationId?: string; } export declare class FederationNode { readonly nodeId: string; readonly publicKey: string; readonly endpoint: string; readonly capabilities: FederationNodeCapabilities; private _trustLevel; private _trustScore; private _lastSeen; private readonly _metadata; private _state; private _stateChangedAt; private _stateReason?; private _stateCorrelationId?; constructor(props: FederationNodeProps); get trustLevel(): TrustLevel; get trustScore(): number; get lastSeen(): Date; get metadata(): FederationNodeMetadata; /** Current peer state (ADR-097 Phase 2). */ get state(): FederationNodeState; /** When the current state was entered. */ get stateChangedAt(): Date; /** Last-transition record for the audit trail. */ get stateRecord(): FederationNodeStateRecord; /** Convenience predicate: is this peer accepting outbound sends? */ get isActive(): boolean; /** Convenience predicate: is this peer terminally evicted? */ get isEvicted(): boolean; updateTrustLevel(level: TrustLevel): void; updateTrustScore(score: number): void; markSeen(): void; isStale(maxAgeMs: number): boolean; /** * Transition this peer to SUSPENDED. Legal from ACTIVE only — calling * from SUSPENDED or EVICTED returns false (the entity is already at or * past the breaker threshold, so a duplicate trip is a no-op). * * Returns true if the state changed, false if the call was rejected * (illegal transition). The breaker treats false as "already handled." */ suspend(reason: TransitionReason, now?: Date): boolean; /** * Transition this peer to EVICTED. Legal from ACTIVE or SUSPENDED. * EVICTED is terminal under normal flow — only `reactivate` (operator- * initiated) can move the peer back to ACTIVE. */ evict(reason: TransitionReason, now?: Date): boolean; /** * Transition back to ACTIVE. Legal from SUSPENDED (after cooldown + * probe success — the breaker is responsible for those checks; this * entity does not gate on time) or from EVICTED (operator override). * * `correlationId` lets the caller record *why* they're reactivating * (probe ID, operator ticket, etc.) for the audit trail. */ reactivate(correlationId?: string, now?: Date): boolean; private _transition; toProps(): FederationNodeProps; static create(props: Omit & { trustLevel?: TrustLevel; trustScore?: number; lastSeen?: Date; }): FederationNode; } //# sourceMappingURL=federation-node.d.ts.map