Initial Commit

This commit is contained in:
2026-05-27 23:47:53 +01:00
parent fbc70f96e6
commit 9b28db724f
18103 changed files with 1600554 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
// Server-tier package — uses node:http (Node-only). Browser consumers cannot use this package.
// Errors
export {
NET_LIBP2P_SERVER_CODES,
NetLibp2pServerError,
type NetLibp2pServerErrorCode,
} from "./errors/errors.js";
// Health
export {
buildHealthResponse,
classifyHealthRequest,
HEALTH_PATHS,
type HealthKind,
type HealthPath,
type HealthResponse,
type HealthSnapshot,
handleHealth,
} from "./health/health.js";
// OTel
export {
adjustActivePeers,
type ConnectionOutcome,
recordConnection,
recordRelayedStream,
recordStartDuration,
withStartSpan,
withStopSpan,
} from "./otel/otel.js";
// Server
export { listenHttp } from "./server/health-listener.js";
export {
type PeerEventsBinding,
type PeerEventsContext,
unwirePeerEvents,
wirePeerEvents,
} from "./server/peer-events.js";
export { Libp2pServer } from "./server/server.js";
// Types
export type {
Libp2pServerConfig,
Libp2pServerEventMap,
Libp2pServerFactory,
Libp2pServerFactoryConfig,
Libp2pServerNodeLike,
Libp2pServerPeerConnectedEvent,
Libp2pServerPeerDisconnectedEvent,
Libp2pServerRelayStreamEvent,
Libp2pServerStartedEvent,
Libp2pServerStartResult,
Libp2pServerStoppedEvent,
ResolvedLibp2pServerConfig,
} from "./types/types.js";
// Schemas
export { Libp2pServerConfigSchema } from "./types/types.schemas.js";