import { A as Async, a as RuntimeOptions, b as Runtime, E as Exit, aJ as Task, ay as ScheduleResult, aD as SchedulerStats, R as RuntimeHooks, f as RuntimeEventRecord, h as RuntimeRegistry, k as Fiber } from '../effect-DbEMiMvv.js'; export { u as AbortablePromiseFinish, v as AbortablePromiseLabelStats, w as AbortablePromiseOptions, x as AbortablePromiseOutcome, y as AbortablePromiseStats, z as AbortablePromiseTimerWheel, D as AsyncWithPromise, H as CancelToken, I as Canceler, K as Cause, L as CausePrettyOptions, M as ContextNode, $ as FiberContext, l as FiberId, a1 as FiberInfo, a5 as FiberRunState, m as FiberStatus, ah as Interrupted, ai as InterruptibilityMode, J as JSONValue, al as None, am as NoopHooks, O as Option, as as RestoreInterruptibility, e as RuntimeEmitContext, d as RuntimeEvent, i as RuntimeFiber, g as RuntimeSpanLink, S as Scope, aF as ScopeId, aG as ScopeInfo, aH as Some, T as TraceContext, Z as ZIO, aM as abortablePromiseStats, aN as acquireRelease, aO as async, aP as asyncCatchAll, aQ as asyncFail, aR as asyncFlatMap, aS as asyncFold, aT as asyncInterruptible, aU as asyncMap, aV as asyncMapError, aW as asyncSucceed, aX as asyncSync, aY as asyncTotal, aZ as catchAll, a_ as ctxExtend, a$ as ctxToObject, b0 as emptyContext, b1 as end, b3 as fail, b4 as flatMap, b5 as fork, b6 as formatCause, b7 as fromPromiseAbortable, b8 as getBenchmarkBudget, b9 as getCurrentFiber, bc as interruptible, bd as isCause, bf as linkAbortController, bh as makeCancelToken, bj as makeRuntimeEventRecord, bk as map, bl as mapAsync, bm as mapError, bn as mapTryAsync, bo as none, bp as orElseOptional, bq as prettyCause, br as recordAbortablePromiseFinish, bs as recordAbortablePromiseStart, bt as resetAbortablePromiseStats, bv as runtimeEventRecordContext, bw as runtimeForCaller, bz as setAbortablePromisePerLabelTracking, bA as setBenchmarkBudget, bB as setCurrentFiber, bC as some, bD as succeed, bE as sync, bF as toPromise, bG as toPromiseByCaller, bH as uninterruptible, bI as uninterruptibleMask, bJ as unit, bK as unsafeGetCurrentRuntime, bL as unsafeRunAsync, bM as unsafeRunFoldWithEnv, bN as withAsyncPromise, bO as withCurrentFiber, bP as withScope, bQ as withScopeAsync } from '../effect-DbEMiMvv.js'; export { M as ManagedResource, R as Resource, R as ResourceDescriptor, S as Span, a as SpanContext, b as SpanEvent, c as SpanStatus, T as Tracer, d as TracerConfig, e as bracket, f as ensuring, m as makeResource, g as makeTracer, h as managed, i as managedAll, r as resource, j as resourceAll, k as resourceFromManaged, l as resourceSucceed, u as useManaged, n as useResource } from '../tracing-DIAUf2x8.js'; import { R as RuntimeClock, k as RuntimeTimerId, j as RuntimeClockEnv, a as LayerContext, S as ServiceTag, L as Layer, l as Schedule } from '../layer-CsNGeVee.js'; export { B as BuiltLayer, b as CircuitBreaker, c as CircuitBreakerConfig, d as CircuitBreakerError, e as CircuitBreakerState, C as CircuitBreakerStats, f as LayerErrorOf, g as LayerInputOf, h as LayerOutputOf, i as LayerScope, M as MissingLayerServiceError, m as ScheduleDecision, n as ScheduleDriver, o as ScheduleDriverDecision, p as ScheduleDriverOptions, q as ScheduleDriverSnapshot, r as ScheduleObserver, s as ScheduleObserverEvent, t as ScheduleStepContext, u as ServiceTagMap, v as ServicesOf, T as TestLayerProvider, w as andThenSchedule, x as buildLayer, y as composeAll, z as composeLayer, A as contramapSchedule, D as defineLayer, E as defineService, F as elapsed, G as exponential, H as fibonacci, I as fixed, J as forever, K as formatLayerError, N as getService, O as getServices, P as intersect, Q as jitter, U as jittered, V as jitteredSchedule, W as layer, X as layerEffect, Y as layerFail, Z as layerFrom, _ as layerFromContext, $ as layerSucceed, a0 as layerValue, a1 as linear, a2 as liveClock, a3 as makeCircuitBreaker, a4 as makeLayerScope, a5 as makeScheduleDriver, a6 as makeServiceTag, a7 as makeTestLayer, a8 as makeTestLayers, a9 as mapLayer, aa as mapSchedule, ab as maxDelay, ac as maxElapsed, ad as mergeAll, ae as mergeLayer, af as namedSchedule, ag as never, ah as once, ai as pollWithSchedule, aj as provide, ak as provideContext, al as provideLayer, am as provideLayerContext, an as recurs, ao as repeatWithSchedule, ap as repeatWithScheduleAlias, aq as retryWithSchedule, ar as retryWithScheduleAlias, as as runSchedule, at as runtimeClockFromEnv, au as scheduleDriver, av as serviceTag, aw as spaced, ax as takeSchedule, ay as tapDecision, az as union, aA as untilInput, aB as untilOutput, aC as upTo, aD as useService, aE as useServices, aF as whileInput, aG as whileOutput, aH as windowed } from '../layer-CsNGeVee.js'; import { JsonSchemaLike } from '../schema/index.js'; export { B as BrassEnv, C as Counter, E as EventBus, f as EventBusOptions, g as EventHandler, G as Gauge, H as Histogram, h as HistogramBuckets, I as InMemoryTracer, e as InMemoryTracerOptions, i as InMemoryTracerStats, a as MetricExemplar, b as MetricSnapshot, j as MetricType, k as MetricValue, M as MetricsRegistry, R as RuntimeSpan, l as RuntimeSpanEvent, d as RuntimeTraceIdGenerator, m as defaultTracer, n as makeMetrics, r as runtimeHooksToEventHandler } from '../tracer-CS3yOXZx.js'; type TimeoutError = { readonly _tag: "TimeoutError"; readonly ms: number; }; /** * Suspends the fiber for `ms` milliseconds. Cancellable via fiber interruption. */ declare function sleep(ms: number): Async; /** * Runs `effect` with a timeout of `ms` milliseconds. * - If the effect completes before the timeout, returns its result. * - If the timeout fires first, the effect is cancelled and a TimeoutError is returned. * * Works with ANY effect type (Async, FlatMap, Fold, etc.) by forking * the effect into a child fiber and interrupting it on timeout. */ declare function timeout(effect: Async, ms: number): Async; type RetryPolicy = { /** Maximum number of retry attempts (0 = no retries, just the initial attempt) */ readonly maxRetries: number; /** Base delay in ms for exponential backoff */ readonly baseDelayMs: number; /** Maximum delay cap in ms */ readonly maxDelayMs: number; /** Total time budget in ms (optional). Retries stop if elapsed time exceeds this. */ readonly maxElapsedMs?: number; /** Custom predicate: should this error trigger a retry? Default: always retry. */ readonly shouldRetry?: (error: unknown, attempt: number) => boolean; /** Jitter strategy. Default: "full" (random 0..delay). "none" = no jitter. */ readonly jitter?: "full" | "none"; }; type RetryState = { readonly attempt: number; readonly elapsedMs: number; readonly lastError: unknown; }; /** * Retries an effect according to the given policy. * Uses exponential backoff with full jitter by default. * * ```ts * const result = retry( * fetchData(), * { maxRetries: 3, baseDelayMs: 100, maxDelayMs: 5000 } * ); * ``` */ declare function retry(effect: Async, policy: RetryPolicy): Async; /** * Retry with a simple count (no backoff, immediate retry). * Useful for flaky operations that just need a few attempts. */ declare function retryN(effect: Async, n: number): Async; /** * Retry with exponential backoff and full jitter. * Convenience wrapper with sensible defaults. */ declare function retryWithBackoff(effect: Async, opts?: { maxRetries?: number; baseDelayMs?: number; maxDelayMs?: number; maxElapsedMs?: number; shouldRetry?: (error: unknown, attempt: number) => boolean; }): Async; type EffectSuccess = T extends Async ? A : never; type EffectFailure = T extends Async ? E : never; type EffectEnvironment = T extends Async ? R : never; type MakeRuntimeOptions = Omit, "env">; /** * Create a runtime with a compact options shape. * * This is an additive DX helper over `new Runtime({ env, ...options })`. */ declare function makeRuntime(env?: R, options?: MakeRuntimeOptions): Runtime; /** * Run an effect and resolve with its success value. * * Accepts either a plain environment or an existing Runtime. For advanced * lifecycle/hooks/scheduler behavior, pass the Runtime explicitly. */ declare function runPromise(effect: Async, envOrRuntime?: R | Runtime): Promise; /** * Run an effect and resolve with the full Exit, preserving typed failures and * Cause structure instead of throwing/rejecting. */ declare function runExit(effect: Async, envOrRuntime?: R | Runtime): Promise>; declare const runEffect: typeof runPromise; type Semaphore = { /** Current number of available permits. */ readonly available: () => number; /** Total number of permits (capacity). */ readonly capacity: number; /** Number of effects waiting for a permit. */ readonly waiting: () => number; /** Acquire a permit, run the effect, and release the permit. */ readonly withPermit: (effect: Async) => Async; /** Acquire a permit (manual). Must call release() when done. */ readonly acquire: () => Async; /** Release a permit (manual). */ readonly release: () => void; }; type SemaphoreStats = { readonly capacity: number; readonly available: number; readonly waiting: number; readonly acquired: number; readonly released: number; }; /** * Creates a counting semaphore with `n` permits. * * ```ts * const sem = makeSemaphore(5); // max 5 concurrent * * // Automatic acquire/release: * const result = await run(sem.withPermit(fetchData())); * * // Manual acquire/release: * await run(sem.acquire()); * try { ... } finally { sem.release(); } * ``` */ declare function makeSemaphore(n: number): Semaphore; type Ref = { /** Get the current value. */ readonly get: () => Async; /** Set a new value. */ readonly set: (value: A) => Async; /** Modify the value with a function and return the new value. */ readonly update: (f: (current: A) => A) => Async; /** Modify the value and return a derived result. */ readonly modify: (f: (current: A) => [B, A]) => Async; /** Get the current value synchronously (for non-effect contexts). */ readonly unsafeGet: () => A; }; /** * Creates a mutable reference with an initial value. * * ```ts * const counter = makeRef(0); * * // In effects: * await run(counter.update(n => n + 1)); * const value = await run(counter.get()); * * // Synchronous access (outside effects): * counter.unsafeGet(); * ``` */ declare function makeRef(initial: A): Ref; /** * Creates a derived Ref that applies a lens to a parent Ref. * * ```ts * const state = makeRef({ count: 0, name: "test" }); * const countRef = derivedRef(state, s => s.count, (s, c) => ({ ...s, count: c })); * ``` */ declare function derivedRef(parent: Ref, get: (a: A) => B, set: (a: A, b: B) => A): Ref; type FiberRef = { readonly id: number; readonly initial: A; readonly get: () => Async; readonly set: (value: A) => Async; readonly update: (f: (current: A) => A) => Async; readonly modify: (f: (current: A) => [B, A]) => Async; readonly locally: (value: A, effect: Async) => Async; readonly locallyWith: (f: (current: A) => A, effect: Async) => Async; readonly unsafeGet: () => A; readonly unsafeSet: (value: A) => void; }; declare function makeFiberRef(initial: A): FiberRef; declare function getFiberRef(ref: FiberRef): Async; declare function setFiberRef(ref: FiberRef, value: A): Async; declare function updateFiberRef(ref: FiberRef, f: (current: A) => A): Async; declare function modifyFiberRef(ref: FiberRef, f: (current: A) => [B, A]): Async; declare function locallyFiberRef(ref: FiberRef, value: A, effect: Async): Async; declare function locallyFiberRefWith(ref: FiberRef, f: (current: A) => A, effect: Async): Async; declare function unsafeGetFiberRef(ref: FiberRef): A; declare function unsafeSetFiberRef(ref: FiberRef, value: A): void; declare function fiberRefSnapshot(): ReadonlyMap; type ShutdownConfig = { /** Max time to wait for in-flight work to complete. Default: 30000ms */ readonly timeoutMs?: number; /** Called when shutdown starts. */ readonly onStart?: () => void; /** Called when shutdown completes. */ readonly onComplete?: (stats: ShutdownStats) => void; /** Called if shutdown times out. */ readonly onTimeout?: (stats: ShutdownStats) => void; }; type ShutdownStats = { readonly startedAt: number; readonly completedAt: number; readonly elapsedMs: number; readonly timedOut: boolean; }; /** * Performs a graceful shutdown of the runtime. * * 1. Signals the scheduler to stop accepting new work * 2. Waits for in-flight fibers to complete (up to timeoutMs) * 3. Calls the runtime's shutdown hook * 4. Reports stats * * ```ts * await gracefulShutdown(runtime, { * timeoutMs: 5000, * onStart: () => console.log("Shutting down..."), * onComplete: (stats) => console.log(`Done in ${stats.elapsedMs}ms`), * }); * ``` */ declare function gracefulShutdown(runtime: Runtime, config?: ShutdownConfig): Promise; /** * Registers process signal handlers for graceful shutdown. * Handles SIGTERM and SIGINT (Ctrl+C). * * ```ts * registerShutdownHooks(runtime, { * timeoutMs: 10000, * onComplete: () => process.exit(0), * onTimeout: () => process.exit(1), * }); * ``` */ declare function registerShutdownHooks(runtime: Runtime, config?: ShutdownConfig): () => void; type TestRuntimeOptions = { /** Back-compat alias for autoFlush. When false, scheduled tasks only run when flushed. */ readonly synchronous?: boolean; /** Automatically flush scheduled tasks in a microtask. Default: true. */ readonly autoFlush?: boolean; /** Initial virtual clock time in milliseconds. Default: 0. */ readonly initialTimeMs?: number; /** Safety limit for flushAll/runAllTimers. Default: 10_000. */ readonly maxSteps?: number; }; type TestScheduledTask = { readonly tag: string; readonly run: Task; }; declare class TestScheduler { private readonly options; private readonly queue; private readonly maxSteps; private autoFlushScheduled; private flushing; private enqueuedTasks; private executedTasks; private droppedTasks; private scheduledFlushes; private completedFlushes; constructor(options?: Pick); schedule(task: Task, tag?: string): ScheduleResult; scheduleBatch(tasks: Array<{ fn: Task; tag: string; }>): ScheduleResult[]; stats(): SchedulerStats; pending(): readonly TestScheduledTask[]; size(): number; flush(maxTasks?: number): number; flushAll(maxSteps?: number): number; private requestAutoFlush; } type TestClockTimerSnapshot = { readonly id: number; readonly dueAt: number; readonly delayMs: number; }; declare class TestClock implements RuntimeClock { private readonly flushScheduler; private readonly maxSteps; private nowMs; private nextId; private nextSeq; private readonly timers; constructor(initialTimeMs?: number, flushScheduler?: () => void, maxSteps?: number); now(): number; setTimeout(task: () => void, ms: number): RuntimeTimerId; clearTimeout(timer: RuntimeTimerId): void; pendingTimers(): readonly TestClockTimerSnapshot[]; adjust(ms: number): number; advance(ms: number): number; advanceTo(targetMs: number): number; runDue(): number; runAll(maxSteps?: number): number; clear(): void; private nextDueTimer; } type TestRuntime = { readonly env: R & RuntimeClockEnv; readonly runtime: Runtime; readonly scheduler: TestScheduler; readonly clock: TestClock; readonly run: (effect: Async) => Promise; readonly runExit: (effect: Async) => Promise>; readonly fork: (effect: Async) => ReturnType["fork"]>; readonly flush: (maxTasks?: number) => number; readonly flushAll: (maxSteps?: number) => number; readonly advance: (ms: number) => number; readonly advanceTo: (targetMs: number) => number; readonly runDueTimers: () => number; readonly runAllTimers: (maxSteps?: number) => number; }; /** * Creates a deterministic TypeScript test runtime. * * The returned runtime uses: * - a `TestScheduler` that can be flushed manually, * - a `TestClock` for virtual `sleep`, `timeout`, retry backoff, and `Runtime.delay`, * - the normal TS fiber interpreter, so tests exercise the same runtime model as production. */ declare function makeTestRuntime(env?: R, options?: TestRuntimeOptions): TestRuntime; /** * Asserts that an effect succeeds with a specific value. * * ```ts * await assertSucceeds(myEffect, 42); * ``` */ declare function assertSucceeds(effect: Async, expected: A, runtime?: Runtime): Promise; /** * Asserts that an effect fails with a specific error. * * ```ts * await assertFails(myEffect, "not found"); * ``` */ declare function assertFails(effect: Async, expectedError: E, runtime?: Runtime): Promise; /** * Asserts that an effect fails with an error matching a predicate. * * ```ts * await assertFailsWith(myEffect, (e) => e._tag === "NotFound"); * ``` */ declare function assertFailsWith(effect: Async, predicate: (error: E) => boolean, runtime?: Runtime): Promise; /** * Asserts that an effect completes within a time limit. * * ```ts * await assertCompletesWithin(myEffect, 100); // must finish in 100ms * ``` */ declare function assertCompletesWithin(effect: Async, maxMs: number, runtime?: Runtime): Promise; /** * Creates an effect that fails on the first N calls, then succeeds. * Useful for testing retry logic. * * ```ts * const flaky = flakyEffect(3, "success!", "temporary error"); * // Fails 3 times, then returns "success!" * ``` */ declare function flakyEffect(failCount: number, successValue: A, errorValue: E): Async; /** * Creates an effect that takes a specific amount of time to complete. * Useful for testing timeouts and concurrency. * * ```ts * const slow = delayedEffect(100, "done"); // completes after 100ms * ``` */ declare function delayedEffect(ms: number, value: A): Async; /** * Creates an effect that never completes (hangs forever). * Useful for testing timeouts and interruption. */ declare function neverEffect(): Async; type ConfigLayerSource = unknown | ((context: LayerContext) => unknown); type ConfigLayerOptions = { readonly name?: string; }; declare function makeConfigLayer(tag: ServiceTag, schema: JsonSchemaLike, source: ConfigLayerSource, options?: ConfigLayerOptions): Layer; declare const defineConfigLayer: typeof makeConfigLayer; declare const RuntimeService: ServiceTag>; type RuntimeLayerEnv = R | ((context: LayerContext) => R); type RuntimeLayerOptions = Omit, "env"> & { readonly tag?: ServiceTag>; }; declare function makeRuntimeLayer(env?: RuntimeLayerEnv, options?: RuntimeLayerOptions): Layer; type WorkerPoolConfig = { /** Number of worker threads. Default: number of CPUs - 1 */ readonly size?: number; /** Max queued tasks. Tasks beyond this are rejected. Default: 1000 */ readonly maxQueue?: number; /** Task timeout in ms. Default: 30000 */ readonly taskTimeoutMs?: number; }; type WorkerPoolError = { readonly _tag: "WorkerPoolFull"; readonly queued: number; } | { readonly _tag: "WorkerTaskTimeout"; readonly ms: number; } | { readonly _tag: "WorkerTaskError"; readonly message: string; } | { readonly _tag: "WorkerPoolClosed"; }; type WorkerPool = { /** Execute a function in a worker thread. */ readonly execute: (fn: () => A) => Async; /** Execute a serializable task (function source + args). */ readonly run: (taskSource: string, args?: any[]) => Async; /** Current pool stats. */ readonly stats: () => WorkerPoolStats; /** Shutdown the pool (terminate all workers). */ readonly shutdown: () => Promise; }; type WorkerPoolStats = { readonly size: number; readonly busy: number; readonly idle: number; readonly queued: number; readonly completed: number; readonly failed: number; readonly timedOut: number; }; /** * Creates a worker pool for CPU-intensive tasks. * * NOTE: This is a simplified implementation that uses setTimeout to simulate * async execution. For real worker_threads support, the pool would need to * spawn actual Worker instances. This provides the API contract and can be * upgraded to real threads when needed. * * ```ts * const pool = makeWorkerPool({ size: 4 }); * * const result = await run(pool.execute(() => heavyComputation())); * * await pool.shutdown(); * ``` */ declare function makeWorkerPool(config?: WorkerPoolConfig): WorkerPool; type RuntimeRecorderOptions = { readonly maxEvents?: number; }; type RuntimeRecorderStats = { readonly size: number; readonly capacity: number; readonly dropped: number; readonly firstSeq?: number; readonly lastSeq?: number; }; type RuntimeRecorderExplainOptions = { readonly maxEvents?: number; }; type RuntimeRecorder = RuntimeHooks & { readonly hooks: RuntimeHooks; readonly snapshot: () => readonly RuntimeEventRecord[]; readonly clear: () => void; readonly stats: () => RuntimeRecorderStats; readonly explain: (options?: RuntimeRecorderExplainOptions) => string; }; declare function makeRuntimeRecorder(options?: RuntimeRecorderOptions): RuntimeRecorder; type LogLevel = "debug" | "info" | "warn" | "error"; declare function consoleJsonLogger(): RuntimeHooks; declare function dumpAllFibers(reg: RuntimeRegistry): string; /** * Base type for tagged errors. All errors should extend this pattern: * * ```ts * type NetworkError = { _tag: "NetworkError"; url: string; status: number }; * type TimeoutError = { _tag: "TimeoutError"; ms: number }; * type AppError = NetworkError | TimeoutError; * ``` */ type TaggedError = { readonly _tag: string; }; /** * Catches a specific error by its `_tag` field and handles it. * Other errors pass through unchanged. * * ```ts * const result = catchTag(effect, "NetworkError", (e) => fallbackValue); * // e is narrowed to NetworkError * ``` */ declare function catchTag(effect: Async, tag: Tag, handler: (error: Extract) => Async, A | B>): Async, A | B>; /** * Catches multiple error tags with a single handler map. * * ```ts * const result = catchTags(effect, { * NetworkError: (e) => asyncSucceed(defaultValue), * TimeoutError: (e) => retry(effect), * }); * ``` */ declare function catchTags) => Async; }>>(effect: Async, handlers: Handlers): Async, A>; /** * Maps the error channel of an effect. * * ```ts * const result = mapError(effect, (e) => ({ _tag: "Wrapped", cause: e })); * ``` */ declare function mapError(effect: Async, f: (error: E) => E2): Async; /** * Wraps any error with a tag, making it part of a discriminated union. * * ```ts * const typed = tagError(fetchData(), "NetworkError", (e) => ({ url, cause: e })); * // Error type becomes { _tag: "NetworkError"; url: string; cause: unknown } * ``` */ declare function tagError>(effect: Async, tag: Tag, enrich?: (error: E) => Fields): Async; /** * If the effect fails, run the fallback instead. * * ```ts * const result = orElse(primary(), () => fallback()); * ``` */ declare function orElse(effect: Async, fallback: (error: E) => Async): Async; type SupervisorStrategy = "one-for-one" | "all-for-one"; type SupervisorEscalation = "ignore" | "shutdown"; type SupervisorRestartMode = "never" | "always" | "on-failure"; type SupervisedChildStatus = "running" | "restarting" | "succeeded" | "failed" | "interrupted"; type SupervisorRestartContext = { readonly supervisorId: number; readonly childId: number; readonly name?: string; readonly restartCount: number; readonly exit: Exit; }; type SupervisorRestartPolicy = SupervisorRestartMode | { readonly mode?: SupervisorRestartMode; readonly maxRestarts?: number; readonly withinMs?: number; readonly delayMs?: number | ((context: SupervisorRestartContext) => number); readonly schedule?: Schedule; }; type SupervisorEvent = { readonly type: "child-start" | "child-end" | "child-restart" | "child-escalate" | "shutdown"; readonly supervisorId: number; readonly childId?: number; readonly name?: string; readonly status?: SupervisedChildStatus; readonly restartCount?: number; readonly delayMs?: number; readonly exit?: Exit; readonly reason?: string; }; type SupervisorConfig = { readonly strategy?: SupervisorStrategy; readonly restart?: SupervisorRestartPolicy; readonly escalation?: SupervisorEscalation; readonly clock?: () => number; readonly onEvent?: (event: SupervisorEvent) => void; }; type SupervisedChildSpec = { readonly name?: string; readonly effect: Async | (() => Async); readonly restart?: SupervisorRestartPolicy; }; type SupervisedFiber = { readonly id: number; readonly name?: string; readonly current: () => Fiber | undefined; readonly status: () => SupervisedChildStatus; readonly restartCount: () => number; readonly interrupt: () => void; readonly join: (cb: (exit: Exit) => void) => void; }; declare class Supervisor { private readonly runtime; readonly id: number; private readonly records; private readonly strategy; private readonly restart; private readonly escalation; private readonly clock; private readonly onEvent?; private closed; constructor(runtime: Runtime, config?: SupervisorConfig); start(spec: SupervisedChildSpec): SupervisedFiber; startAll[]>(specs: Specs): { [K in keyof Specs]: Specs[K] extends SupervisedChildSpec ? SupervisedFiber : never; }; shutdown(): Async; private handle; private launch; private onChildExit; private restartAll; private scheduleRestart; private nextDelay; private escalate; private finish; private restartContext; private emit; private scheduleClock; } declare function makeSupervisor(runtime: Runtime, config?: SupervisorConfig): Supervisor; declare function supervise(runtime: Runtime, spec: SupervisedChildSpec, config?: SupervisorConfig): SupervisedFiber; declare function joinSupervised(fiber: SupervisedFiber): Async; export { Async, type ConfigLayerOptions, type ConfigLayerSource, type EffectEnvironment, type EffectFailure, type EffectSuccess, Exit, Fiber, type FiberRef, Layer, LayerContext, type LogLevel, type MakeRuntimeOptions, type Ref, type RetryPolicy, type RetryState, Runtime, RuntimeClock, RuntimeClockEnv, RuntimeEventRecord, RuntimeHooks, type RuntimeLayerEnv, type RuntimeLayerOptions, RuntimeOptions, type RuntimeRecorder, type RuntimeRecorderExplainOptions, type RuntimeRecorderOptions, type RuntimeRecorderStats, RuntimeRegistry, RuntimeService, RuntimeTimerId, Schedule, type Semaphore, type SemaphoreStats, ServiceTag, type ShutdownConfig, type ShutdownStats, type SupervisedChildSpec, type SupervisedChildStatus, type SupervisedFiber, Supervisor, type SupervisorConfig, type SupervisorEscalation, type SupervisorEvent, type SupervisorRestartContext, type SupervisorRestartMode, type SupervisorRestartPolicy, type SupervisorStrategy, type TaggedError, TestClock, type TestClockTimerSnapshot, type TestRuntime, type TestRuntimeOptions, type TestScheduledTask, TestScheduler, type TimeoutError, type WorkerPool, type WorkerPoolConfig, type WorkerPoolError, type WorkerPoolStats, assertCompletesWithin, assertFails, assertFailsWith, assertSucceeds, catchTag, catchTags, consoleJsonLogger, defineConfigLayer, delayedEffect, derivedRef, dumpAllFibers, fiberRefSnapshot, flakyEffect, getFiberRef, gracefulShutdown, joinSupervised, locallyFiberRef, locallyFiberRefWith, makeConfigLayer, makeFiberRef, makeRef, makeRuntime, makeRuntimeLayer, makeRuntimeRecorder, makeSemaphore, makeSupervisor, makeTestRuntime, makeWorkerPool, mapError as mapErrorTyped, modifyFiberRef, neverEffect, orElse, registerShutdownHooks, retry, retryN, retryWithBackoff, runEffect, runExit, runPromise, setFiberRef, sleep, supervise, tagError, timeout, unsafeGetFiberRef, unsafeSetFiberRef, updateFiberRef };