import crypto from 'node:crypto'; import { type EndpointHelloPayload } from '@xopcai/endpoint-tools-protocol'; import type { EndpointPrincipal } from '../storage/sqlite/index.js'; export interface EndpointAuthenticatorDeps { getPrincipal(id: string): EndpointPrincipal | undefined; bindEndpoint(endpointId: string, principalId: string, boundAt?: number): boolean; touchPrincipal(id: string, seenAt?: number): void; now?: () => number; } export declare class EndpointAuthenticationError extends Error { } export declare function parseEndpointPublicKey(encoded: string): crypto.KeyObject; export declare class EndpointAuthenticator { private readonly deps; private readonly usedNonces; private readonly now; constructor(deps: EndpointAuthenticatorDeps); authenticate(payload: EndpointHelloPayload): EndpointPrincipal; private pruneNonces; }