Effect infrastructure
Shared Effect v4 building blocks for HTTP clients, React glue, realtime pub/sub, and telemetry capture.
These five packages give apps a consistent Effect v4 foundation: typed HTTP client helpers, a React↔Effect runtime bridge, in-process realtime pub/sub, and telemetry/observability capture — so each app wires the same primitives instead of re-deriving them.
@repo/effect-http
Small, dependency-light helpers shared by the monorepo's typed Effect HTTP
clients (CvmClient, LilaClient, ImagesClient, AiHeroHttpClient, etc.).
It standardizes the error-shape conventions (*HttpError / *NetworkError /
*DecodeError) those clients already follow, without unifying the error
types themselves — each client keeps its own tagged errors.
httpClientErrorLabel— turns a client's tagged error into a user-facing string, matching on the tag suffix so wording is shared across clientstransientRetry— exponential-backoffSchedulefor transient failures (network blips, 5xx, rate limits), for use withEffect.retrymakeJsonTransport(JsonTransport,TransportErrors) — builds a typed JSONget/posttransport from a caller-supplied set of error constructors
@repo/react-effect
The React-side bridge to Effect: a ManagedRuntime boundary plus hooks so
components can run Effects, queries, actions, and streams without each
component wiring its own runtime. No README yet — treat src/index.ts as
the source of truth for the public surface.
createRuntimeBoundary,RuntimeProvider/useRuntime— provides a scopedManagedRuntimeto a component subtreeuseManagedRuntime— lower-level runtime-creation hookuseEffectQuery,useEffectAction,useEffectStream(+StreamStatus) — data-fetching, mutation, and streaming hooks over EffectcreateEffectStore(EffectStore) — Effect-backed store glue, independent of any specific runtime instanceWithRuntime(under@repo/react-effect/test/with-runtime) — test helper for rendering components that need a runtime in scope
@repo/realtime
In-process pub/sub built on Effect's PubSub, used by the chess (lila-*)
realtime path. EventBus fans out domain game events; SignalBus layers a
small per-game buffer on top so WebRTC signaling (offer/answer/ICE/ping) can
be replayed to a client that reconnects mid-negotiation. Depends on
@repo/chess-domain for its event/signal types, so it is chess-specific
rather than a general-purpose bus.
EventBus—Context.Servicewrapping an unboundedPubSubofChessGame.GameEvent;publish,subscribe,subscribeForGame, and asubscribeScopedvariant that registers the subscription eagerly to avoid missing events published before a forked consumer starts drainingSignalBus— layers onEventBus; buffers up to 40 signals per game (capped at 256 tracked games, LRU-evicted) for reconnect catch-up
@repo/observability
A Sentry (@sentry/nextjs) + Logtail (@logtail/next) wrapper for Next.js
apps. Unlike the other packages here it has no exports map or src/
directory — its files sit at the package root and are imported by direct
subpath (e.g. @repo/observability/client), matching the Sentry Next.js
convention of separate client/server/edge config entry points. Only
keys.ts uses Effect (Schema for env validation via @t3-oss/env-nextjs);
the rest is plain Sentry/Logtail glue, not Effect-native.
client.ts/server.ts/edge.ts— Sentry init per Next.js runtimeinstrumentation.ts—initializeSentry(options)for a Next.jsinstrumentation.tshooknext-config.ts— wraps a Next config with Logtail + Sentry's webpack/build pluginlog.ts—log, a console/Logtail logger switched onNODE_ENVerror.ts,sentry-options.ts,keys.ts— error capture helper, shared Sentry init options, and validated env (createEnv)status/— a status-page React component
@repo/telemetry
Effect v4 telemetry capture and OTLP export for the agent runtime: a custom
Tracer and Logger that capture every span/log event and forward it to
pluggable sinks (a DB-backed sink lives in @repo/db; a no-op sink covers
tests), plus process metrics and OTLP/JSON serialization. The same capture
pipeline feeds both in-app telemetry views and an external OTLP backend.
Sink implementations (SpanSinkDbLayer / LogSinkDbLayer) are not bundled here — the caller
provides them, keeping @repo/telemetry free of a DB dependency.
TelemetryTracerLayer— installs a span-capturingTracer; depends on aSpanSinkCapturingLoggerLayer— installs a log-capturingLogger; depends on aLogSinkrpcRequests,rpcErrors,rpcLatencyMs,activeSessions— module-level EffectMetrics (counter/histogram/gauge)httpRequestCounterMiddleware(name, description)— Effect HTTP middleware incrementing a per-service request countertoOtlpTracesPayload— maps captured spans to an OTLP/HTTP JSON traces payloadtelemetryResourceConfig— resolves the OTelResourcefromOTEL_*env varsObservability.layer({ endpoint, resource })(also./prometheusentry point) — one composed layer bundling the capturing logger, capturing tracer, runtime metrics, and the OTLP metrics/logger exporters
See the packages overview and the architecture guide.