import type { ProviderUsageLimitsUpdate, ServerProvider } from "@t3tools/contracts"; import type * as Effect from "effect/Effect"; import type * as Stream from "effect/Stream"; import type { ProviderMaintenanceCapabilities } from "../providerMaintenance.ts"; export interface ServerProviderShape { readonly maintenanceCapabilities: ProviderMaintenanceCapabilities; readonly getSnapshot: Effect.Effect; readonly refresh: Effect.Effect; readonly streamChanges: Stream.Stream; /** * Fold a runtime rate-limit update into the published snapshot without * waiting for the next status probe. Sparse: windows merge by id and an * update with no usable window leaves the snapshot untouched. */ readonly applyUsageLimits: ( update: ProviderUsageLimitsUpdate & { readonly checkedAt: string }, ) => Effect.Effect; }