@systemfsoftware/effect-daemon-spec 0.7.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,23 +1,32 @@
1
- import { Cause, Context, Duration, Effect, Layer, Metric, Option, Schedule, Schema, Scope, Stream } from "effect";
2
- //#region src/daemon-health.schema.d.ts
3
- declare const DynamicLimitExceeded_base: Schema.TaggedErrorClass<DynamicLimitExceeded, "DynamicLimitExceeded", {
4
- readonly _tag: Schema.tag<"DynamicLimitExceeded">;
5
- } & {
6
- limit: Schema.filter<typeof Schema.Int>;
7
- }>;
1
+ import { Cause, Context, Duration, Effect, Latch, Layer, Metric, Option, Schedule, Schema, Scope, Stream } from "effect";
2
+ //#region src/Backoff.d.ts
3
+ declare const cappedBackoff: (base: Duration.Input, cap: Duration.Input) => Schedule.Schedule<Duration.Duration>;
4
+ //#endregion
5
+ //#region src/Brands.d.ts
6
+ declare const WorkerTypeId: unique symbol;
7
+ type WorkerTypeId = typeof WorkerTypeId;
8
+ declare const SupervisorTypeId: unique symbol;
9
+ type SupervisorTypeId = typeof SupervisorTypeId;
10
+ declare const DynamicSpecTypeId: unique symbol;
11
+ type DynamicSpecTypeId = typeof DynamicSpecTypeId;
12
+ //#endregion
13
+ //#region src/DaemonHealth.schema.d.ts
14
+ declare const DynamicLimitExceeded_base: Schema.Class<DynamicLimitExceeded, Schema.TaggedStruct<"DynamicLimitExceeded", {
15
+ readonly limit: Schema.Int;
16
+ }>, import("effect/Cause").YieldableError>;
8
17
  declare class DynamicLimitExceeded extends DynamicLimitExceeded_base {}
9
18
  interface DaemonHealth {
10
19
  readonly name: string;
11
- readonly ready: Effect.Latch;
12
- readonly healthy: Effect.Latch;
13
- readonly paused: Effect.Latch;
20
+ readonly ready: Latch.Latch;
21
+ readonly healthy: Latch.Latch;
22
+ readonly paused: Latch.Latch;
14
23
  }
15
24
  interface SupervisorHealth {
16
25
  readonly name: string;
17
- readonly ready: Effect.Latch;
18
- readonly healthy: Effect.Latch;
19
- readonly paused: Effect.Latch;
20
- readonly children: ReadonlyArray<DaemonHealth | SupervisorHealth>;
26
+ readonly ready: Latch.Latch;
27
+ readonly healthy: Latch.Latch;
28
+ readonly paused: Latch.Latch;
29
+ readonly children: readonly (DaemonHealth | SupervisorHealth)[];
21
30
  }
22
31
  interface DynamicHandle<Args, R = never> {
23
32
  readonly health: SupervisorHealth;
@@ -30,108 +39,65 @@ type ChildRef = {
30
39
  readonly removed: Effect.Effect<void>;
31
40
  };
32
41
  //#endregion
33
- //#region src/backoff.kernel.d.ts
34
- declare const cappedBackoff: (base: Duration.DurationInput, cap: Duration.DurationInput) => Schedule.Schedule<Duration.Duration>;
42
+ //#region src/DaemonMetrics.d.ts
43
+ declare const supervisorRestartsCounter: Metric.Counter<number>;
44
+ declare const supervisorExhaustionsCounter: Metric.Counter<number>;
45
+ declare const supervisorChildrenGauge: Metric.Gauge<number>;
46
+ declare const healthStateGauge: Metric.Gauge<number>;
35
47
  //#endregion
36
- //#region src/brands.kernel.d.ts
37
- declare const WorkerTypeId: unique symbol;
38
- type WorkerTypeId = typeof WorkerTypeId;
39
- declare const SupervisorTypeId: unique symbol;
40
- type SupervisorTypeId = typeof SupervisorTypeId;
41
- declare const DynamicSpecTypeId: unique symbol;
42
- type DynamicSpecTypeId = typeof DynamicSpecTypeId;
43
- //#endregion
44
- //#region src/daemon-metrics.kernel.d.ts
45
- declare const supervisorRestartsCounter: Metric.Metric.Counter<number>;
46
- declare const supervisorExhaustionsCounter: Metric.Metric.Counter<number>;
47
- declare const supervisorChildrenGauge: Metric.Metric.Gauge<number>;
48
- declare const healthStateGauge: Metric.Metric.Gauge<number>;
49
- //#endregion
50
- //#region src/daemon-policy.schema.d.ts
48
+ //#region src/DaemonPolicy.schema.d.ts
51
49
  declare const IntensityConfig: Schema.Struct<{
52
- restarts: Schema.filter<typeof Schema.Int>;
53
- window: typeof Schema.DurationFromSelf;
50
+ readonly restarts: Schema.Int;
51
+ readonly window: Schema.Duration;
54
52
  }>;
55
53
  type IntensityConfig = typeof IntensityConfig.Type;
56
54
  declare const IntensityTypeId: unique symbol;
57
55
  type IntensityTypeId = typeof IntensityTypeId;
58
- declare const BoundedIntensity_base: Schema.TaggedClass<BoundedIntensity, "Bounded", {
59
- readonly _tag: Schema.tag<"Bounded">;
60
- } & Readonly<{
61
- restarts: Schema.filter<typeof Schema.Int>;
62
- window: typeof Schema.DurationFromSelf;
63
- }>>;
56
+ declare const BoundedIntensity_base: Schema.Class<BoundedIntensity, Schema.TaggedStruct<"Bounded", {
57
+ readonly restarts: Schema.Int;
58
+ readonly window: Schema.Duration;
59
+ }>, {}>;
64
60
  declare class BoundedIntensity extends BoundedIntensity_base {
65
61
  readonly [IntensityTypeId]: symbol;
66
62
  }
67
- declare const UnboundedIntensity_base: Schema.TaggedClass<UnboundedIntensity, "Unbounded", {
68
- readonly _tag: Schema.tag<"Unbounded">;
69
- }>;
63
+ declare const UnboundedIntensity_base: Schema.Class<UnboundedIntensity, Schema.TaggedStruct<"Unbounded", {}>, {}>;
70
64
  declare class UnboundedIntensity extends UnboundedIntensity_base {
71
65
  readonly [IntensityTypeId]: symbol;
72
66
  }
73
- declare const Intensity: Schema.Union<[typeof BoundedIntensity, typeof UnboundedIntensity]>;
67
+ declare const Intensity: Schema.Union<readonly [typeof BoundedIntensity, typeof UnboundedIntensity]>;
74
68
  type Intensity = typeof Intensity.Type;
75
- declare const ChildPolicyConfig_base: Schema.Class<ChildPolicyConfig, {
76
- restart: Schema.optional<Schema.Literal<["permanent", "transient", "temporary"]>>;
77
- intensity: Schema.optional<Schema.Struct<{
78
- restarts: Schema.filter<typeof Schema.Int>;
79
- window: typeof Schema.DurationFromSelf;
69
+ declare const ChildPolicyConfig_base: Schema.Class<ChildPolicyConfig, Schema.Struct<{
70
+ readonly restart: Schema.optional<Schema.Literals<readonly ["permanent", "transient", "temporary"]>>;
71
+ readonly intensity: Schema.optional<Schema.Struct<{
72
+ readonly restarts: Schema.Int;
73
+ readonly window: Schema.Duration;
80
74
  }>>;
81
- }, Schema.Struct.Encoded<{
82
- restart: Schema.optional<Schema.Literal<["permanent", "transient", "temporary"]>>;
83
- intensity: Schema.optional<Schema.Struct<{
84
- restarts: Schema.filter<typeof Schema.Int>;
85
- window: typeof Schema.DurationFromSelf;
86
- }>>;
87
- }>, never, {
88
- readonly restart?: "permanent" | "transient" | "temporary" | undefined;
89
- } & {
90
- readonly intensity?: {
91
- readonly restarts: number;
92
- readonly window: import("effect/Duration").Duration;
93
- } | undefined;
94
- }, {}, {}>;
75
+ }>, {}>;
95
76
  declare class ChildPolicyConfig extends ChildPolicyConfig_base {}
96
- declare const LockPolicyConfig_base: Schema.Class<LockPolicyConfig, {
97
- mode: Schema.optional<Schema.Literal<["none", "required", "optional"]>>;
98
- key: Schema.optional<typeof Schema.String>;
99
- }, Schema.Struct.Encoded<{
100
- mode: Schema.optional<Schema.Literal<["none", "required", "optional"]>>;
101
- key: Schema.optional<typeof Schema.String>;
102
- }>, never, {
103
- readonly mode?: "none" | "required" | "optional" | undefined;
104
- } & {
105
- readonly key?: string | undefined;
106
- }, {}, {}>;
77
+ declare const LockPolicyConfig_base: Schema.Class<LockPolicyConfig, Schema.Struct<{
78
+ readonly mode: Schema.optional<Schema.Literals<readonly ["none", "required", "optional"]>>;
79
+ readonly key: Schema.optional<Schema.String>;
80
+ }>, {}>;
107
81
  declare class LockPolicyConfig extends LockPolicyConfig_base {}
108
- declare const TickPolicyConfig_base: Schema.Class<TickPolicyConfig, {
109
- spanName: Schema.optional<typeof Schema.String>;
110
- tickTimeout: typeof Schema.DurationFromSelf;
111
- startLogLevel: Schema.optional<Schema.Literal<["debug", "info"]>>;
112
- }, Schema.Struct.Encoded<{
113
- spanName: Schema.optional<typeof Schema.String>;
114
- tickTimeout: typeof Schema.DurationFromSelf;
115
- startLogLevel: Schema.optional<Schema.Literal<["debug", "info"]>>;
116
- }>, never, {
117
- readonly tickTimeout: import("effect/Duration").Duration;
118
- } & {
119
- readonly spanName?: string | undefined;
120
- } & {
121
- readonly startLogLevel?: "debug" | "info" | undefined;
122
- }, {}, {}>;
82
+ declare const TickPolicyConfig_base: Schema.Class<TickPolicyConfig, Schema.Struct<{
83
+ readonly spanName: Schema.optional<Schema.String>;
84
+ readonly tickTimeout: Schema.Duration;
85
+ readonly startLogLevel: Schema.optional<Schema.Literals<readonly ["debug", "info"]>>;
86
+ }>, {}>;
123
87
  declare class TickPolicyConfig extends TickPolicyConfig_base {}
88
+ declare const MaxChildren: Schema.brand<Schema.Int, "MaxChildren">;
89
+ type MaxChildren = typeof MaxChildren.Type;
124
90
  //#endregion
125
- //#region src/daemon-reporter.adapter.d.ts
91
+ //#region src/DaemonReporterAdapter.d.ts
126
92
  interface DaemonReporterService {
127
93
  readonly onRestart: (name: string, cause: Cause.Cause<never>) => Effect.Effect<void>;
128
94
  readonly onExhausted: (name: string, cause: Cause.Cause<never>) => Effect.Effect<void>;
129
95
  }
130
- declare const DaemonReporter_base: Context.TagClass<DaemonReporter, "@systemfsoftware/effect-daemon-spec/daemon-reporter.adapter/DaemonReporter", DaemonReporterService>;
96
+ declare const DaemonReporter_base: Context.ServiceClass<DaemonReporter, "@systemfsoftware/effect-daemon-spec/DaemonReporterAdapter/DaemonReporter", DaemonReporterService>;
131
97
  declare class DaemonReporter extends DaemonReporter_base {}
132
98
  declare const Noop: Layer.Layer<DaemonReporter>;
133
99
  //#endregion
134
- //#region src/daemon-spec.schema.d.ts
100
+ //#region src/DaemonSpec.schema.d.ts
135
101
  type LockConfig = {
136
102
  mode: 'none';
137
103
  } | {
@@ -150,7 +116,7 @@ interface CommonOpts<L extends LockConfig> {
150
116
  readonly lock: L;
151
117
  }
152
118
  type PollOpts<A, E, R, L extends LockConfig> = CommonOpts<L> & {
153
- readonly interval: Duration.DurationInput;
119
+ readonly interval: Duration.Input;
154
120
  } & ({
155
121
  readonly prereq?: undefined;
156
122
  readonly work: Effect.Effect<A, E, R>;
@@ -161,7 +127,7 @@ type PollOpts<A, E, R, L extends LockConfig> = CommonOpts<L> & {
161
127
  interface TickPolicyHooks {
162
128
  readonly spanAttributes?: Effect.Effect<Record<string, string | number | boolean>>;
163
129
  readonly innerRetry?: Schedule.Schedule<unknown>;
164
- readonly trackDuration?: Metric.Metric.Histogram<Duration.Duration>;
130
+ readonly trackDuration?: Metric.Histogram<Duration.Duration>;
165
131
  }
166
132
  interface ReporterPolicyHooks {
167
133
  readonly onRestart?: (cause: Cause.Cause<never>) => Effect.Effect<void>;
@@ -170,7 +136,7 @@ interface ReporterPolicyHooks {
170
136
  type PollLoop<E, R> = {
171
137
  readonly _tag: 'Poll';
172
138
  readonly gate: Effect.Effect<Option.Option<Effect.Effect<void, E, R>>, E, R>;
173
- readonly interval: Duration.DurationInput;
139
+ readonly interval: Duration.Input;
174
140
  };
175
141
  type StreamLoop<E, R> = {
176
142
  readonly _tag: 'Stream';
@@ -194,7 +160,7 @@ interface Supervisor<E, R, L extends LockConfig = LockConfig> {
194
160
  readonly [SupervisorTypeId]: SupervisorTypeId;
195
161
  readonly name: string;
196
162
  readonly strategy: 'one_for_one' | 'one_for_all' | 'rest_for_one';
197
- readonly children: ReadonlyArray<Worker<E, R> | Supervisor<E, R>>;
163
+ readonly children: readonly (Worker<E, R> | Supervisor<E, R>)[];
198
164
  readonly supervision: Effect.Effect<SupervisionPolicy>;
199
165
  readonly lock: L;
200
166
  readonly reporter: ReporterPolicyHooks;
@@ -203,106 +169,83 @@ interface DynamicSpec<E, R, Args> {
203
169
  readonly [DynamicSpecTypeId]: DynamicSpecTypeId;
204
170
  readonly name: string;
205
171
  readonly child: (args: Args) => Worker<E, R>;
206
- readonly maxChildren: number;
172
+ readonly maxChildren: MaxChildren;
207
173
  }
208
174
  type Child<E, R> = Worker<E, R> | Supervisor<E, R>;
209
175
  interface SupervisionPolicy {
210
176
  readonly intensity: Intensity;
211
177
  readonly backoff: Schedule.Schedule<Duration.Duration>;
212
- readonly cooldown: Duration.DurationInput;
178
+ readonly cooldown: Duration.Input;
213
179
  }
214
180
  interface SupervisionConfig {
215
- readonly backoffBase: Duration.DurationInput;
181
+ readonly backoffBase: Duration.Input;
216
182
  readonly intensity: Intensity;
217
- readonly cooldown: Duration.DurationInput;
183
+ readonly cooldown: Duration.Input;
218
184
  }
219
185
  interface SupervisorOpts<E, R, L extends LockConfig> {
220
186
  readonly name: string;
221
- readonly children: ReadonlyArray<Child<E, R>>;
187
+ readonly children: readonly Child<E, R>[];
222
188
  readonly supervision: Effect.Effect<SupervisionPolicy>;
223
189
  readonly lock: L;
224
190
  readonly reporter?: ReporterPolicyHooks;
225
191
  }
226
192
  //#endregion
227
- //#region src/leader-lock.schema.d.ts
228
- declare const LeaderLockNotAcquired_base: Schema.TaggedErrorClass<LeaderLockNotAcquired, "LeaderLockNotAcquired", {
229
- readonly _tag: Schema.tag<"LeaderLockNotAcquired">;
230
- } & {
231
- key: typeof Schema.String;
232
- }>;
193
+ //#region src/LeaderLock.schema.d.ts
194
+ declare const LeaderLockNotAcquired_base: Schema.Class<LeaderLockNotAcquired, Schema.TaggedStruct<"LeaderLockNotAcquired", {
195
+ readonly key: Schema.String;
196
+ }>, import("effect/Cause").YieldableError>;
233
197
  declare class LeaderLockNotAcquired extends LeaderLockNotAcquired_base {}
234
- declare const LeaderLockInfraError_base: Schema.TaggedErrorClass<LeaderLockInfraError, "LeaderLockInfraError", {
235
- readonly _tag: Schema.tag<"LeaderLockInfraError">;
236
- } & {
237
- key: typeof Schema.String;
238
- cause: typeof Schema.Unknown;
239
- }>;
198
+ declare const LeaderLockInfraError_base: Schema.Class<LeaderLockInfraError, Schema.TaggedStruct<"LeaderLockInfraError", {
199
+ readonly key: Schema.String;
200
+ readonly cause: Schema.Unknown;
201
+ }>, import("effect/Cause").YieldableError>;
240
202
  declare class LeaderLockInfraError extends LeaderLockInfraError_base {}
241
203
  type LeaderLockAcquireError = LeaderLockNotAcquired | LeaderLockInfraError;
242
204
  //#endregion
243
- //#region src/lock-primitive.schema.d.ts
244
- declare const LockPrimitiveError_base: Schema.TaggedErrorClass<LockPrimitiveError, "LockPrimitiveError", {
245
- readonly _tag: Schema.tag<"LockPrimitiveError">;
246
- } & {
247
- key: typeof Schema.String;
248
- cause: typeof Schema.Unknown;
249
- }>;
205
+ //#region src/LockPrimitive.schema.d.ts
206
+ declare const LockPrimitiveError_base: Schema.Class<LockPrimitiveError, Schema.TaggedStruct<"LockPrimitiveError", {
207
+ readonly key: Schema.String;
208
+ readonly cause: Schema.Unknown;
209
+ }>, import("effect/Cause").YieldableError>;
250
210
  declare class LockPrimitiveError extends LockPrimitiveError_base {}
251
211
  //#endregion
252
- //#region src/leader-lock.adapter.d.ts
212
+ //#region src/LeaderLockAdapter.d.ts
253
213
  interface LeaderLockService {
254
214
  readonly withLock: <A, E, R>(key: string, self: Effect.Effect<A, E, R>) => Effect.Effect<Option.Option<A>, E | LeaderLockInfraError, R>;
255
215
  }
256
- declare const LeaderLock_base: Context.TagClass<LeaderLock, "@systemfsoftware/effect-daemon-spec/leader-lock.adapter/LeaderLock", LeaderLockService>;
216
+ declare const LeaderLock_base: Context.ServiceClass<LeaderLock, "@systemfsoftware/effect-daemon-spec/LeaderLockAdapter/LeaderLock", LeaderLockService>;
257
217
  declare class LeaderLock extends LeaderLock_base {
258
218
  static readonly Noop: Layer.Layer<LeaderLock>;
259
219
  }
260
220
  interface LockPrimitiveService {
261
221
  readonly tryAcquire: (key: string) => Effect.Effect<boolean, LockPrimitiveError, Scope.Scope>;
262
222
  }
263
- declare const LockPrimitive_base: Context.TagClass<LockPrimitive, "@systemfsoftware/effect-daemon-spec/leader-lock.adapter/LockPrimitive", LockPrimitiveService>;
223
+ declare const LockPrimitive_base: Context.ServiceClass<LockPrimitive, "@systemfsoftware/effect-daemon-spec/LeaderLockAdapter/LockPrimitive", LockPrimitiveService>;
264
224
  declare class LockPrimitive extends LockPrimitive_base {}
265
225
  declare const LeaderLockFromPrimitive: Layer.Layer<LeaderLock, never, LockPrimitive>;
266
226
  //#endregion
267
- //#region src/internal/with-leader-lock.executor.d.ts
227
+ //#region src/internal/BuildDynamicExecutor.d.ts
228
+ declare const dynamic$1: <E, R, Args>(spec: DynamicSpec<E, R, Args>) => Effect.Effect<DynamicHandle<Args, R | LeaderLock | DaemonReporter | Scope.Scope>, never, R | LeaderLock | DaemonReporter | Scope.Scope>;
229
+ //#endregion
230
+ //#region src/internal/WithLeaderLockExecutor.d.ts
268
231
  interface LeaderLockOptions {
269
232
  readonly key: string;
270
233
  readonly mode: 'required' | 'optional';
271
234
  readonly acquireRetryBackoff?: Schedule.Schedule<Duration.Duration>;
272
235
  }
273
- declare const WithLeaderLockExecutorDeps_base: Context.TagClass<WithLeaderLockExecutorDeps, "@systemfsoftware/effect-daemon-spec/internal/with-leader-lock.executor/WithLeaderLockExecutorDeps", {
274
- readonly withLock: LeaderLock["Type"]["withLock"];
275
- }>;
276
- declare class WithLeaderLockExecutorDeps extends WithLeaderLockExecutorDeps_base {}
277
- declare function withLeaderLock<A, E, R>(self: Effect.Effect<A, E, R>, options: LeaderLockOptions): Effect.Effect<A | void, E | LeaderLockAcquireError, R | WithLeaderLockExecutorDeps>;
278
- //#endregion
279
- //#region src/daemon-worker.executor.d.ts
280
- declare const worker: {
281
- <E, R>(w: Worker<E, R, {
282
- mode: 'none';
283
- }>): Effect.Effect<DaemonHealth, never, R | Scope.Scope>;
284
- <E, R>(w: Worker<E, R, LockConfig>): Effect.Effect<DaemonHealth, never, R | WithLeaderLockExecutorDeps | Scope.Scope>;
285
- };
236
+ declare function withLeaderLock<A, E, R>(self: Effect.Effect<A, E, R>, options: LeaderLockOptions, lock: LeaderLock['Service']): Effect.Effect<A | void, E | LeaderLockAcquireError, R>;
286
237
  //#endregion
287
- //#region src/internal/supervisor-body.executor.d.ts
288
- declare const SupervisorBodyExecutorDeps_base: Context.TagClass<SupervisorBodyExecutorDeps, "@systemfsoftware/effect-daemon-spec/internal/supervisor-body.executor/SupervisorBodyExecutorDeps", {
289
- readonly onRestart: DaemonReporter["Type"]["onRestart"];
290
- readonly onExhausted: DaemonReporter["Type"]["onExhausted"];
291
- }>;
292
- declare class SupervisorBodyExecutorDeps extends SupervisorBodyExecutorDeps_base {}
293
- declare const supervisor: <E, R>(s: Supervisor<E, R, LockConfig>) => Effect.Effect<SupervisorHealth, never, R | SupervisorBodyExecutorDeps | WithLeaderLockExecutorDeps | Scope.Scope>;
238
+ //#region src/SupervisionCustom.d.ts
239
+ declare const custom: <P>(policy: P) => Effect.Effect<P>;
294
240
  //#endregion
295
- //#region src/internal/supervision-leader.state.d.ts
296
- declare const LeaderConfig_base: Context.ReferenceClass<LeaderConfig, "@systemfsoftware/effect-daemon-spec/LeaderConfig", SupervisionConfig>;
297
- declare class LeaderConfig extends LeaderConfig_base {}
241
+ //#region src/internal/SupervisionLeader.d.ts
242
+ declare const LeaderConfig: Context.Reference<SupervisionConfig>;
298
243
  //#endregion
299
- //#region src/internal/supervision-task.state.d.ts
300
- declare const TaskConfig_base: Context.ReferenceClass<TaskConfig, "@systemfsoftware/effect-daemon-spec/TaskConfig", SupervisionConfig>;
301
- declare class TaskConfig extends TaskConfig_base {}
244
+ //#region src/internal/SupervisionTask.d.ts
245
+ declare const TaskConfig: Context.Reference<SupervisionConfig>;
302
246
  //#endregion
303
- //#region src/internal/supervision-worker.state.d.ts
304
- declare const WorkerConfig_base: Context.ReferenceClass<WorkerConfig, "@systemfsoftware/effect-daemon-spec/WorkerConfig", SupervisionConfig>;
305
- declare class WorkerConfig extends WorkerConfig_base {}
247
+ //#region src/internal/SupervisionWorker.d.ts
248
+ declare const WorkerConfig: Context.Reference<SupervisionConfig>;
306
249
  //#endregion
307
250
  //#region src/mod.d.ts
308
251
  declare const poll: <A, E, R, L extends LockConfig>(opts: PollOpts<A, E, R, L>) => Worker<E, R, L>;
@@ -313,42 +256,55 @@ declare const subscription: <A, E, R, L extends LockConfig>(opts: CommonOpts<L>
313
256
  readonly acquire: Effect.Effect<A, E, R>;
314
257
  }) => Worker<E, R, L>;
315
258
  declare const Daemon: {
316
- readonly poll: <A, E, R, L extends LockConfig>(opts: PollOpts<A, E, R, L>) => Worker<E, R, L>;
317
- readonly stream: <A, E, R, L extends LockConfig>(opts: CommonOpts<L> & {
318
- readonly stream: Stream.Stream<A, E, R>;
319
- }) => Worker<E, R, L>;
320
- readonly subscription: <A, E, R, L extends LockConfig>(opts: CommonOpts<L> & {
321
- readonly acquire: Effect.Effect<A, E, R>;
322
- }) => Worker<E, R, L>;
259
+ readonly poll: typeof poll;
260
+ readonly stream: typeof stream;
261
+ readonly subscription: typeof subscription;
262
+ };
263
+ /**
264
+ * Boots a worker. The leader-lock capability is acquired here, at the composition
265
+ * root, and handed down as part of the lock binding: the executor behind this
266
+ * entry point never sees the tag. A worker whose lock is `{ mode: 'none' }`
267
+ * takes no lock at all.
268
+ */
269
+ declare const worker: {
270
+ <E, R>(w: Worker<E, R, {
271
+ mode: 'none';
272
+ }>): Effect.Effect<DaemonHealth, never, R | Scope.Scope>;
273
+ <E, R>(w: Worker<E, R, LockConfig>): Effect.Effect<DaemonHealth, never, R | LeaderLock | Scope.Scope>;
323
274
  };
275
+ /**
276
+ * The supervisor: acquires the `DaemonReporter` and — unless the lock mode is none —
277
+ * the `LeaderLock` capabilities at the composition root, then hands them down to the
278
+ * supervisor body via the lock binding. The body itself only ever sees the service
279
+ * values.
280
+ */
281
+ declare const supervisor: <E, R>(s: Supervisor<E, R, LockConfig>) => Effect.Effect<SupervisorHealth, never, R | DaemonReporter | LeaderLock | Scope.Scope>;
324
282
  declare const run: {
325
283
  readonly worker: {
326
284
  <E, R>(w: Worker<E, R, {
327
- mode: "none";
328
- }>): Effect.Effect<DaemonHealth, never, R | import("effect/Scope").Scope>;
329
- <E, R>(w: Worker<E, R, LockConfig>): Effect.Effect<DaemonHealth, never, R | WithLeaderLockExecutorDeps | import("effect/Scope").Scope>;
285
+ mode: 'none';
286
+ }>): Effect.Effect<DaemonHealth, never, R | Scope.Scope>;
287
+ <E, R>(w: Worker<E, R, LockConfig>): Effect.Effect<DaemonHealth, never, R | LeaderLock | Scope.Scope>;
330
288
  };
331
- readonly supervisor: <E, R>(s: Supervisor<E, R, LockConfig>) => Effect.Effect<SupervisorHealth, never, R | SupervisorBodyExecutorDeps | WithLeaderLockExecutorDeps | import("effect/Scope").Scope>;
332
- readonly dynamic: <E, R, Args>(spec: DynamicSpec<E, R, Args>) => Effect.Effect<DynamicHandle<Args, R | WithLeaderLockExecutorDeps | SupervisorBodyExecutorDeps | import("effect/Scope").Scope>, never, R | WithLeaderLockExecutorDeps | SupervisorBodyExecutorDeps | import("effect/Scope").Scope>;
289
+ readonly supervisor: typeof supervisor;
290
+ readonly dynamic: typeof dynamic$1;
333
291
  };
334
- declare const leader: (cap: Duration.DurationInput) => Effect.Effect<SupervisionPolicy>;
335
- declare const task: (budget: Duration.DurationInput) => Effect.Effect<SupervisionPolicy>;
336
- declare const supervision: (cap: Duration.DurationInput) => Effect.Effect<SupervisionPolicy>;
292
+ declare const leader: (cap: Duration.Input) => Effect.Effect<SupervisionPolicy>;
293
+ declare const task: (budget: Duration.Input) => Effect.Effect<SupervisionPolicy>;
294
+ declare const supervision: (cap: Duration.Input) => Effect.Effect<SupervisionPolicy>;
337
295
  declare const Supervision: {
338
- readonly leader: (cap: Duration.DurationInput) => Effect.Effect<SupervisionPolicy>;
339
- readonly worker: (cap: Duration.DurationInput) => Effect.Effect<SupervisionPolicy>;
340
- readonly task: (budget: Duration.DurationInput) => Effect.Effect<SupervisionPolicy>;
341
- readonly custom: <P>(policy: P) => Effect.Effect<P>;
296
+ readonly leader: typeof leader;
297
+ readonly worker: typeof supervision;
298
+ readonly task: typeof task;
299
+ readonly custom: typeof custom;
342
300
  };
343
301
  declare const dynamic: <E, R, Args>(opts: {
344
302
  readonly name: string;
345
303
  readonly child: (args: Args) => Worker<E, R>;
346
- readonly maxChildren?: number;
304
+ readonly maxChildren?: MaxChildren;
347
305
  }) => DynamicSpec<E, R, Args>;
348
306
  declare const oneForAll: <E, R, L extends LockConfig = LockConfig>(opts: SupervisorOpts<E, R, L>) => Supervisor<E, R, L>;
349
307
  declare const oneForOne: <E, R, L extends LockConfig = LockConfig>(opts: SupervisorOpts<E, R, L>) => Supervisor<E, R, L>;
350
308
  declare const restForOne: <E, R, L extends LockConfig = LockConfig>(opts: SupervisorOpts<E, R, L>) => Supervisor<E, R, L>;
351
- declare const WithLeaderLockExecutorLive: Layer.Layer<WithLeaderLockExecutorDeps, never, LeaderLock>;
352
- declare const SupervisorBodyExecutorLive: Layer.Layer<SupervisorBodyExecutorDeps, never, DaemonReporter>;
353
309
  //#endregion
354
- export { BoundedIntensity, Child, ChildPolicyConfig, ChildRef, CommonOpts, Daemon, DaemonHealth, DaemonReporter, DaemonReporterService, DynamicHandle, DynamicLimitExceeded, DynamicSpec, DynamicSpecTypeId, Intensity, IntensityConfig, LeaderConfig, LeaderLock, LeaderLockAcquireError, LeaderLockFromPrimitive, LeaderLockInfraError, LeaderLockNotAcquired, type LeaderLockOptions, LeaderLockService, LockConfig, LockPolicyConfig, LockPrimitive, LockPrimitiveError, LockPrimitiveService, LoopShape, Noop, PollLoop, PollOpts, ReporterPolicyHooks, StreamLoop, SubscriptionLoop, Supervision, SupervisionConfig, SupervisionPolicy, Supervisor, SupervisorBodyExecutorDeps, SupervisorBodyExecutorLive, SupervisorHealth, SupervisorOpts, SupervisorTypeId, TaskConfig, TickPolicyConfig, TickPolicyHooks, UnboundedIntensity, WithLeaderLockExecutorDeps, WithLeaderLockExecutorLive, Worker, WorkerConfig, WorkerTypeId, cappedBackoff, dynamic, healthStateGauge, leader, oneForAll, oneForOne, poll, restForOne, run, stream, subscription, supervision, supervisor, supervisorChildrenGauge, supervisorExhaustionsCounter, supervisorRestartsCounter, task, withLeaderLock, worker };
310
+ export { BoundedIntensity, Child, ChildPolicyConfig, ChildRef, CommonOpts, Daemon, DaemonHealth, DaemonReporter, DaemonReporterService, DynamicHandle, DynamicLimitExceeded, DynamicSpec, DynamicSpecTypeId, Intensity, IntensityConfig, LeaderConfig, LeaderLock, LeaderLockAcquireError, LeaderLockFromPrimitive, LeaderLockInfraError, LeaderLockNotAcquired, type LeaderLockOptions, LeaderLockService, LockConfig, LockPolicyConfig, LockPrimitive, LockPrimitiveError, LockPrimitiveService, LoopShape, MaxChildren, Noop, PollLoop, PollOpts, ReporterPolicyHooks, StreamLoop, SubscriptionLoop, Supervision, SupervisionConfig, SupervisionPolicy, Supervisor, SupervisorHealth, SupervisorOpts, SupervisorTypeId, TaskConfig, TickPolicyConfig, TickPolicyHooks, UnboundedIntensity, Worker, WorkerConfig, WorkerTypeId, cappedBackoff, dynamic, healthStateGauge, leader, oneForAll, oneForOne, poll, restForOne, run, stream, subscription, supervision, supervisor, supervisorChildrenGauge, supervisorExhaustionsCounter, supervisorRestartsCounter, task, withLeaderLock, worker };