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,67 @@
// Server-tier package — uses node:http (Node-only). Browser consumers cannot use this package.
// Errors
export {
NET_TRYSTERO_SERVER_CODES,
NetTrysteroServerError,
type NetTrysteroServerErrorCode,
} 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 {
adjustActiveConnections,
type ConnectionOutcome,
type MessageRelayOutcome,
recordConnection,
recordMessageRelayed,
recordStartDuration,
withStartSpan,
withStopSpan,
} from "./otel/otel.js";
// Server
export { selectBrokerFactory } from "./server/broker-select.js";
export { listenHttp } from "./server/health-listener.js";
export {
buildPeerCallbacks,
type PeerEventsContext,
} from "./server/peer-events.js";
export { TrysteroServer } from "./server/server.js";
// Types
export type {
BrokerCallbacks,
BrokerFactory,
BrokerFactoryDeps,
BrokerLike,
BrokerSocketLike,
BrokerStartOptions,
ResolvedTrysteroServerConfig,
TrysteroServerConfig,
TrysteroServerEventMap,
TrysteroServerMode,
TrysteroServerModeOptions,
TrysteroServerMqttOptions,
TrysteroServerNostrOptions,
TrysteroServerPeerConnectedEvent,
TrysteroServerPeerDisconnectedEvent,
TrysteroServerPeerInfo,
TrysteroServerRelayErrorEvent,
TrysteroServerStartedEvent,
TrysteroServerStartResult,
TrysteroServerStoppedEvent,
} from "./types/types.js";
// Schemas
export {
TrysteroServerConfigSchema,
TrysteroServerMqttOptionsSchema,
TrysteroServerNostrOptionsSchema,
} from "./types/types.schemas.js";