deltafold 0.1.0 → 0.2.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,17 +1,56 @@
1
- import { _ as Any$1, a as Occurrence, c as shortcut_d_exports, g as change_d_exports, i as Coverage, l as rule_d_exports, n as package_d_exports, o as Plan, p as version_d_exports, r as history_d_exports, s as plan_d_exports, u as migration_d_exports, v as action_d_exports } from "./package-BfBYnaCz.js";
1
+ import { _ as Any$2, a as Occurrence, c as shortcut_d_exports, g as change_d_exports, i as Coverage, l as rule_d_exports, n as package_d_exports, o as Plan, p as version_d_exports, r as history_d_exports, s as plan_d_exports, u as migration_d_exports, v as action_d_exports } from "./package-BfBYnaCz.js";
2
2
  import { Cause, Context, Duration, Effect, Layer, Schema, Scope } from "effect";
3
3
  /** The union of an object type's property values. */
4
4
  type ValueOf<T> = T[keyof T];
5
+ /** Named Effect services that Promise callbacks declare. */
6
+ type ServiceMap$1 = {
7
+ readonly [name: string | symbol]: Context.Key<any, any>;
8
+ };
9
+ type NoServices$1 = Record<never, never>;
10
+ /** The `AbortSignal` aborted on interruption, and the declared services, resolved. */
11
+ type PromiseContext$1<S extends ServiceMap$1 = NoServices$1> = {
12
+ readonly signal: AbortSignal;
13
+ readonly services: { readonly [K in keyof S]: S[K]["Service"]; };
14
+ };
15
+ type ServiceIds$1<S extends ServiceMap$1> = ValueOf<{ [K in keyof S]: S[K] extends Context.Key<infer I, any> ? I : never; }>;
16
+ /** Recognizes a declared rejection: a schema, or a type guard. */
17
+ type ErrorGuard$1 = Schema.Top | ((cause: unknown) => cause is any);
18
+ type GuardedError$1<G> = G extends Schema.Top ? G["Type"] : G extends ((cause: unknown) => cause is infer E) ? E : never;
5
19
  declare namespace handler_d_exports {
6
- export { ActionId, Any, EffectApplyContext, EffectPhases, Error, ErrorGuard, Handler, Phase, Preparation, Prepared, PromiseApplyContext, PromiseContext, PromiseOptions$1 as PromiseOptions, PromisePhases, ServiceMap, Services, Skip, Step, UnexpectedHandlerError, effect$1 as effect, isHandler, prepared, promise, skip };
20
+ export { ActionId, Any$1 as Any, EffectApplyContext, EffectPhases, Error$1 as Error, ErrorGuard, Handler, ManualEffectOptions, ManualOptions, Performer, Phase, Preparation, Prepared, PromiseApplyContext, PromiseContext, PromiseOptions$2 as PromiseOptions, PromisePhases, ServiceMap, Services$1 as Services, Skip, Step, UnexpectedHandlerError, VerificationFailed, effect$2 as effect, isHandler, manual, manualEffect, prepared, promise$1 as promise, skip };
7
21
  }
22
+ type NoServices = NoServices$1;
23
+ type ServiceIds<S extends ServiceMap> = ServiceIds$1<S>;
24
+ type GuardedError<G> = GuardedError$1<G>;
25
+ /**
26
+ * Where a handler failure or interruption happened: the read-only prepare phase, or the
27
+ * apply phase that changes state. A manual handler has neither: the executor waits for a
28
+ * person in `confirmation`, then runs the handler's optional check in `verification`.
29
+ *
30
+ * @since @next
31
+ */
32
+ type Phase = "prepare" | "apply" | "confirmation" | "verification";
33
+ /**
34
+ * Who performs an action: a handler's apply phase, or a person whose confirmation the
35
+ * executor waits for.
36
+ *
37
+ * @since @next
38
+ */
39
+ type Performer = "automated" | "manual";
40
+ declare const VerificationFailed_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
41
+ readonly _tag: "VerificationFailed";
42
+ } & Readonly<A>;
8
43
  /**
9
- * Where a handler failure happened: the read-only prepare phase, or the apply phase that
10
- * changes state.
44
+ * A person confirmed manual work, and the handler's `verify` check returned `false`.
11
45
  *
12
46
  * @since @next
13
47
  */
14
- type Phase = "prepare" | "apply";
48
+ declare class VerificationFailed extends VerificationFailed_base<{
49
+ readonly actionId: string;
50
+ readonly kind: string;
51
+ }> {
52
+ get message(): string;
53
+ }
15
54
  declare const UnexpectedHandlerError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
16
55
  readonly _tag: "UnexpectedHandlerError";
17
56
  } & Readonly<A>;
@@ -76,16 +115,20 @@ declare function prepared<P>(value: P): Prepared<P>;
76
115
  */
77
116
  declare const skip: (reason: string) => Skip;
78
117
  /**
79
- * How an occurrence continues after its prepare phase: skipped, or applied by an effect
80
- * that already holds the prepared value.
118
+ * How an occurrence continues after its prepare phase: skipped, applied by an effect
119
+ * that already holds the prepared value, or confirmed by a person. `verify` checks
120
+ * confirmed work and fails when the check does not pass.
81
121
  *
82
122
  * @since @next
83
123
  */
84
124
  type Step<E, R> = Skip | {
85
125
  readonly _tag: "Apply";
86
126
  readonly apply: Effect.Effect<void, E, R>;
127
+ } | {
128
+ readonly _tag: "Confirm";
129
+ readonly verify: Effect.Effect<void, E, R> | undefined;
87
130
  };
88
- declare const TypeId = "~deltafold/Handler";
131
+ declare const TypeId$1 = "~deltafold/Handler";
89
132
  /**
90
133
  * Implements one action instance. `E` and `R` are the errors and Effect services of both
91
134
  * phases together. A prepared value stays inside the handler, so handlers with
@@ -93,9 +136,11 @@ declare const TypeId = "~deltafold/Handler";
93
136
  *
94
137
  * @since @next
95
138
  */
96
- type Handler<out A extends Any$1, out E = never, out R = never> = {
97
- readonly [TypeId]: typeof TypeId;
139
+ type Handler<out A extends Any$2, out E = never, out R = never> = {
140
+ readonly [TypeId$1]: typeof TypeId$1;
98
141
  readonly action: A;
142
+ /** A `manual` handler has no phases of its own: a person does the work. */
143
+ readonly performer: Performer;
99
144
  /** Whether the handler has a prepare phase. */
100
145
  readonly prepares: boolean;
101
146
  /**
@@ -110,19 +155,19 @@ type Handler<out A extends Any$1, out E = never, out R = never> = {
110
155
  *
111
156
  * @since @next
112
157
  */
113
- type Any = Handler<Any$1, any, any>;
158
+ type Any$1 = Handler<Any$2, any, any>;
114
159
  /**
115
160
  * The errors of a handler or a union of handlers.
116
161
  *
117
162
  * @since @next
118
163
  */
119
- type Error<H> = H extends Handler<any, infer E, any> ? E : never;
164
+ type Error$1<H> = H extends Handler<any, infer E, any> ? E : never;
120
165
  /**
121
166
  * The Effect services of a handler or a union of handlers.
122
167
  *
123
168
  * @since @next
124
169
  */
125
- type Services<H> = H extends Handler<any, any, infer R> ? R : never;
170
+ type Services$1<H> = H extends Handler<any, any, infer R> ? R : never;
126
171
  /**
127
172
  * The action identifiers implemented by a handler or a union of handlers.
128
173
  *
@@ -130,26 +175,20 @@ type Services<H> = H extends Handler<any, any, infer R> ? R : never;
130
175
  */
131
176
  type ActionId<H> = H extends Handler<infer A, any, any> ? A["id"] : never;
132
177
  /** @since @next */
133
- declare const isHandler: (value: unknown) => value is Any;
178
+ declare const isHandler: (value: unknown) => value is Any$1;
134
179
  /**
135
180
  * Named Effect services that a Promise handler declares.
136
181
  *
137
182
  * @since @next
138
183
  */
139
- type ServiceMap = {
140
- readonly [name: string | symbol]: Context.Key<any, any>;
141
- };
142
- type NoServices = Record<never, never>;
184
+ type ServiceMap = ServiceMap$1;
143
185
  /**
144
186
  * The second argument of Promise handler callbacks: the `AbortSignal` that
145
187
  * `Effect.tryPromise` aborts on interruption, and the declared services, resolved.
146
188
  *
147
189
  * @since @next
148
190
  */
149
- type PromiseContext<S extends ServiceMap = NoServices> = {
150
- readonly signal: AbortSignal;
151
- readonly services: { readonly [K in keyof S]: S[K]["Service"]; };
152
- };
191
+ type PromiseContext<S extends ServiceMap = NoServices> = PromiseContext$1<S>;
153
192
  /**
154
193
  * The second argument of a Promise apply phase: the Promise context and the action
155
194
  * payload.
@@ -170,7 +209,6 @@ type PromisePhases<Payload, T extends Preparation<unknown>, S extends ServiceMap
170
209
  readonly prepare: (payload: Payload, context: PromiseContext<S>) => PromiseLike<T> | T;
171
210
  readonly apply: (prepared: PreparedValue<T>, context: PromiseApplyContext<Payload, S>) => PromiseLike<unknown>;
172
211
  };
173
- type ServiceIds<S extends ServiceMap> = ValueOf<{ [K in keyof S]: S[K] extends Context.Key<infer I, any> ? I : never; }>;
174
212
  /**
175
213
  * Recognizes a declared rejection: a schema, or a type guard such as an `instanceof`
176
214
  * check. Guards must declare their parameter type, for example
@@ -178,10 +216,9 @@ type ServiceIds<S extends ServiceMap> = ValueOf<{ [K in keyof S]: S[K] extends C
178
216
  *
179
217
  * @since @next
180
218
  */
181
- type ErrorGuard = Schema.Top | ((cause: unknown) => cause is any);
182
- type GuardedError<G> = G extends Schema.Top ? G["Type"] : G extends ((cause: unknown) => cause is infer E) ? E : never;
219
+ type ErrorGuard = ErrorGuard$1;
183
220
  /** @since @next */
184
- type PromiseOptions$1<S extends ServiceMap, G extends ReadonlyArray<ErrorGuard>> = {
221
+ type PromiseOptions$2<S extends ServiceMap, G extends ReadonlyArray<ErrorGuard>> = {
185
222
  /** Effect services resolved for the callbacks and added to the handler requirements. */
186
223
  readonly services?: S;
187
224
  /**
@@ -191,7 +228,7 @@ type PromiseOptions$1<S extends ServiceMap, G extends ReadonlyArray<ErrorGuard>>
191
228
  */
192
229
  readonly errors?: G;
193
230
  };
194
- type PromiseHandler<A extends Any$1, S extends ServiceMap, G> = Handler<A, GuardedError<G> | UnexpectedHandlerError, ServiceIds<S>>;
231
+ type PromiseHandler<A extends Any$2, S extends ServiceMap, G> = Handler<A, GuardedError<G> | UnexpectedHandlerError, ServiceIds<S>>;
195
232
  /**
196
233
  * Implements an action with Promise callbacks. The callbacks run lazily through
197
234
  * `Effect.tryPromise`, and receive its `AbortSignal` and the declared services.
@@ -226,8 +263,8 @@ type PromiseHandler<A extends Any$1, S extends ServiceMap, G> = Handler<A, Guard
226
263
  *
227
264
  * @since @next
228
265
  */
229
- declare function promise<A extends Any$1, const S extends ServiceMap = NoServices, const G extends ReadonlyArray<ErrorGuard> = []>(action: A, apply: (payload: A["payload"], context: PromiseContext<S>) => PromiseLike<unknown>, options?: PromiseOptions$1<S, G>): PromiseHandler<A, S, G[number]>;
230
- declare function promise<A extends Any$1, T extends Preparation<unknown> = Skip, const S extends ServiceMap = NoServices, const G extends ReadonlyArray<ErrorGuard> = []>(action: A, phases: PromisePhases<A["payload"], T, S>, options?: PromiseOptions$1<S, G>): PromiseHandler<A, S, G[number]>;
266
+ declare function promise$1<A extends Any$2, const S extends ServiceMap = NoServices, const G extends ReadonlyArray<ErrorGuard> = []>(action: A, apply: (payload: A["payload"], context: PromiseContext<S>) => PromiseLike<unknown>, options?: PromiseOptions$2<S, G>): PromiseHandler<A, S, G[number]>;
267
+ declare function promise$1<A extends Any$2, T extends Preparation<unknown> = Skip, const S extends ServiceMap = NoServices, const G extends ReadonlyArray<ErrorGuard> = []>(action: A, phases: PromisePhases<A["payload"], T, S>, options?: PromiseOptions$2<S, G>): PromiseHandler<A, S, G[number]>;
231
268
  /**
232
269
  * The second argument of an Effect apply phase.
233
270
  *
@@ -271,10 +308,169 @@ type EffectPhases<Payload, T extends Preparation<unknown>, E1, R1, E2, R2> = {
271
308
  *
272
309
  * @since @next
273
310
  */
274
- declare function effect$1<A extends Any$1, E = never, R = never>(action: A, apply: (payload: A["payload"]) => Effect.Effect<unknown, E, R>): Handler<A, E, Exclude<R, Scope.Scope>>;
275
- declare function effect$1<A extends Any$1, T extends Preparation<unknown> = Skip, E1 = never, R1 = never, E2 = never, R2 = never>(action: A, phases: EffectPhases<A["payload"], T, E1, R1, E2, R2>): Handler<A, E1 | E2, Exclude<R1 | R2, Scope.Scope>>;
311
+ declare function effect$2<A extends Any$2, E = never, R = never>(action: A, apply: (payload: A["payload"]) => Effect.Effect<unknown, E, R>): Handler<A, E, Exclude<R, Scope.Scope>>;
312
+ declare function effect$2<A extends Any$2, T extends Preparation<unknown> = Skip, E1 = never, R1 = never, E2 = never, R2 = never>(action: A, phases: EffectPhases<A["payload"], T, E1, R1, E2, R2>): Handler<A, E1 | E2, Exclude<R1 | R2, Scope.Scope>>;
313
+ /** @since @next */
314
+ type ManualOptions<Payload, S extends ServiceMap, G extends ReadonlyArray<ErrorGuard>> = {
315
+ /** Effect services resolved for `verify` and added to the handler requirements. */
316
+ readonly services?: S;
317
+ /** Guards for rejections of `verify` that keep their own type. */
318
+ readonly errors?: G;
319
+ /**
320
+ * Read-only check that runs after the person confirms. Returning `false` fails the
321
+ * occurrence with `VerificationFailed`. A passing check is evidence that the work is
322
+ * in place, not proof of how it was done.
323
+ */
324
+ readonly verify?: (payload: Payload, context: PromiseContext<S>) => boolean | PromiseLike<boolean>;
325
+ };
326
+ /**
327
+ * Declares that a person performs the action. A manual handler has no prepare or apply
328
+ * phase. In a real run the executor asks its `interaction` to confirm the work, showing
329
+ * the occurrence's own instruction or description, and never completes the occurrence
330
+ * on its own. A dry run reports that a person would be asked. The optional `verify`
331
+ * check is a Promise callback that runs only after the confirmation.
332
+ *
333
+ * The same action can have a manual handler in one environment and an automated one in
334
+ * another.
335
+ *
336
+ * @example
337
+ * ```ts
338
+ * Handler.manual(rotateApiKey, {
339
+ * services: { keys: KeyStore },
340
+ * verify: (payload, { services: { keys } }) => keys.isFresh(payload.service),
341
+ * });
342
+ * ```
343
+ *
344
+ * @since @next
345
+ */
346
+ declare function manual<A extends Any$2>(action: A): Handler<A>;
347
+ declare function manual<A extends Any$2, const S extends ServiceMap = NoServices, const G extends ReadonlyArray<ErrorGuard> = []>(action: A, options: ManualOptions<A["payload"], S, G>): Handler<A, GuardedError<G[number]> | UnexpectedHandlerError | VerificationFailed, ServiceIds<S>>;
348
+ /** @since @next */
349
+ type ManualEffectOptions<Payload, E, R> = {
350
+ /**
351
+ * Read-only check that runs after the person confirms. Succeeding with `false` fails
352
+ * the occurrence with `VerificationFailed`. It runs in the occurrence's `Scope`.
353
+ */
354
+ readonly verify?: (payload: Payload) => Effect.Effect<boolean, E, R>;
355
+ };
356
+ /**
357
+ * `Handler.manual` with an Effect `verify` check, which keeps its own errors and
358
+ * services.
359
+ *
360
+ * @since @next
361
+ */
362
+ declare function manualEffect<A extends Any$2>(action: A): Handler<A>;
363
+ declare function manualEffect<A extends Any$2, E = never, R = never>(action: A, options: ManualEffectOptions<A["payload"], E, R>): Handler<A, E | VerificationFailed, Exclude<R, Scope.Scope>>;
364
+ declare namespace interaction_d_exports {
365
+ export { Answer, Any, Error, Interaction, PromiseOptions$1 as PromiseOptions, Request, Services, UnexpectedInteractionError, effect$1 as effect, isInteraction, promise };
366
+ }
367
+ /**
368
+ * What a person says about manual work. There is no other answer: free-form input never
369
+ * reaches a report.
370
+ *
371
+ * @since @next
372
+ */
373
+ type Answer = "confirmed" | "declined";
374
+ /**
375
+ * A request to confirm manual work. The occurrence carries the action, its description,
376
+ * and the migration instruction that declared it, which is what to show the person.
377
+ *
378
+ * @since @next
379
+ */
380
+ type Request<A extends Any$2 = Any$2> = {
381
+ readonly occurrence: Occurrence<A>;
382
+ };
383
+ declare const UnexpectedInteractionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
384
+ readonly _tag: "UnexpectedInteractionError";
385
+ } & Readonly<A>;
386
+ /**
387
+ * A Promise interaction rejected with a value that none of its declared error guards
388
+ * recognized (`rejected`), or an interaction answered with something other than
389
+ * `"confirmed"` or `"declined"` (`invalid-answer`). An invalid answer is never kept: it
390
+ * may be text that the person typed.
391
+ *
392
+ * @since @next
393
+ */
394
+ declare class UnexpectedInteractionError extends UnexpectedInteractionError_base<{
395
+ readonly occurrenceId: string;
396
+ readonly reason: "rejected" | "invalid-answer";
397
+ /** The rejection. Always `undefined` for an invalid answer. */
398
+ readonly cause: unknown;
399
+ }> {
400
+ get message(): string;
401
+ }
402
+ declare const TypeId = "~deltafold/Interaction";
403
+ /**
404
+ * Asks a person to confirm the manual work of a plan. The executor has no terminal or
405
+ * user interface of its own: the consumer running the plan supplies one of these.
406
+ *
407
+ * Parallel branches can ask at the same time. An interaction that owns one terminal
408
+ * serializes its own prompts. A failure or a decline elsewhere stops new actions but
409
+ * does not withdraw a request that was already made; only cancellation does.
410
+ *
411
+ * @since @next
412
+ */
413
+ type Interaction<out E = never, out R = never> = {
414
+ readonly [TypeId]: typeof TypeId;
415
+ readonly confirm: (request: Request) => Effect.Effect<Answer, E, R>;
416
+ };
417
+ /**
418
+ * Any interaction.
419
+ *
420
+ * @since @next
421
+ */
422
+ type Any = Interaction<any, any>;
423
+ /**
424
+ * The errors of an interaction.
425
+ *
426
+ * @since @next
427
+ */
428
+ type Error<I> = I extends Interaction<infer E, any> ? E : never;
429
+ /**
430
+ * The Effect services of an interaction.
431
+ *
432
+ * @since @next
433
+ */
434
+ type Services<I> = I extends Interaction<any, infer R> ? R : never;
435
+ /** @since @next */
436
+ declare const isInteraction: (value: unknown) => value is Any;
437
+ /** @since @next */
438
+ type PromiseOptions$1<S extends ServiceMap$1, G extends ReadonlyArray<ErrorGuard$1>> = {
439
+ /** Effect services resolved for the callback and added to the run's requirements. */
440
+ readonly services?: S;
441
+ /** Guards for rejections that keep their own type. */
442
+ readonly errors?: G;
443
+ };
444
+ /**
445
+ * Confirms manual work with a Promise callback. It receives `{ signal, services }`: an
446
+ * `AbortSignal` that aborts when the run is cancelled, so it can stop asking, and the
447
+ * declared services.
448
+ *
449
+ * @example
450
+ * ```ts
451
+ * // The migration's instruction for this action, or the action's description.
452
+ * const textOf = ({ action, instruction }: Plan.Occurrence) =>
453
+ * instruction?.content
454
+ * .map((part) => (part._tag === "Text" ? part.text : part.action.description))
455
+ * .join("") ?? action.description;
456
+ *
457
+ * const interaction = Interaction.promise(async ({ occurrence }, { signal }) =>
458
+ * (await ask(textOf(occurrence), { signal })) ? "confirmed" : "declined",
459
+ * );
460
+ * ```
461
+ *
462
+ * @since @next
463
+ */
464
+ declare const promise: <const S extends ServiceMap$1 = NoServices$1, const G extends ReadonlyArray<ErrorGuard$1> = []>(confirm: (request: Request, context: PromiseContext$1<S>) => PromiseLike<Answer>, options?: PromiseOptions$1<S, G>) => Interaction<GuardedError$1<G[number]> | UnexpectedInteractionError, ServiceIds$1<S>>;
465
+ /**
466
+ * Confirms manual work with an Effect, which keeps its own errors and services and
467
+ * stops through Effect interruption when the run is cancelled.
468
+ *
469
+ * @since @next
470
+ */
471
+ declare const effect$1: <E = never, R = never>(confirm: (request: Request) => Effect.Effect<Answer, E, R>) => Interaction<E | UnexpectedInteractionError, R>;
276
472
  declare namespace executor_d_exports {
277
- export { CoverageIssue, Errors, ExecutionError, ExecutionFailed, ExecutionInterrupted, HandlerCoverageError, InterruptReason, OccurrenceReport, Options, Outcome, PromiseOptions, Report, Requirements, Uncovered, effect, runPromise };
473
+ export { CoverageIssue, Errors, ExecutionError, ExecutionFailed, ExecutionInterrupted, HandlerCoverageError, InteractionUnavailable, InterruptReason, OccurrenceReport, Options, Outcome, PromiseOptions, Report, Requirements, Uncovered, effect, runPromise };
278
474
  }
279
475
  /**
280
476
  * What happened to one occurrence, or what a dry run predicts.
@@ -283,9 +479,23 @@ declare namespace executor_d_exports {
283
479
  */
284
480
  type Outcome<E = unknown> = {
285
481
  readonly _tag: "Completed";
482
+ readonly performer: "automated";
483
+ } | {
484
+ readonly _tag: "Completed";
485
+ readonly performer: "manual";
486
+ /**
487
+ * What supports completion. `asserted`: the person said so and nothing checked
488
+ * it. `verified`: the person said so and the handler's `verify` check passed.
489
+ * Neither proves how the work was done.
490
+ */
491
+ readonly confirmation: "asserted" | "verified";
286
492
  } | {
287
493
  readonly _tag: "Skipped";
288
494
  readonly reason: string;
495
+ } |
496
+ /** The person asked to confirm manual work answered that it is not done. */
497
+ {
498
+ readonly _tag: "Declined";
289
499
  } | {
290
500
  readonly _tag: "Failed";
291
501
  readonly phase: Phase;
@@ -308,28 +518,34 @@ type Outcome<E = unknown> = {
308
518
  {
309
519
  readonly _tag: "Unattempted";
310
520
  } |
311
- /** `evaluated`: whether a prepare phase ran and decided to apply. */
521
+ /**
522
+ * `evaluated`: whether a prepare phase ran and decided to apply. A `manual` occurrence
523
+ * would wait for a person; a dry run never asks.
524
+ */
312
525
  {
313
526
  readonly _tag: "WouldExecute";
314
527
  readonly evaluated: boolean;
528
+ readonly performer: Performer;
315
529
  } | {
316
530
  readonly _tag: "WouldSkip";
317
531
  readonly reason: string;
318
532
  } | {
319
533
  readonly _tag: "Undetermined";
320
534
  readonly reason: string;
535
+ /** A `manual` occurrence would wait for a person if it executes. */
536
+ readonly performer: Performer;
321
537
  } | {
322
538
  readonly _tag: "PreparationFailed";
323
539
  readonly error: E | undefined;
324
540
  readonly cause: Cause.Cause<E>;
325
541
  };
326
542
  /** @since @next */
327
- type OccurrenceReport<A extends Any$1 = Any$1, E = unknown> = {
543
+ type OccurrenceReport<A extends Any$2 = Any$2, E = unknown> = {
328
544
  readonly occurrence: Occurrence<A>;
329
545
  readonly outcome: Outcome<E>;
330
546
  };
331
547
  /** @since @next */
332
- type Report<A extends Any$1 = Any$1, E = unknown> = {
548
+ type Report<A extends Any$2 = Any$2, E = unknown> = {
333
549
  readonly _tag: "Report";
334
550
  readonly mode: "execute" | "dry-run";
335
551
  readonly status: "completed" | "failed" | "interrupted" | "not-started" | "would-complete" | "would-fail";
@@ -339,8 +555,8 @@ type Report<A extends Any$1 = Any$1, E = unknown> = {
339
555
  /** Every occurrence in plan order. */
340
556
  readonly occurrences: ReadonlyArray<OccurrenceReport<A, E>>;
341
557
  /**
342
- * Whether any apply phase started. A started apply phase may have partially changed
343
- * state.
558
+ * Whether any apply phase started or any person was asked to do manual work. Either
559
+ * may have partially changed state.
344
560
  */
345
561
  readonly bodiesStarted: boolean;
346
562
  /** Progress is not persisted. Rerunning the plan repeats completed actions. */
@@ -376,22 +592,41 @@ declare const HandlerCoverageBase: new <A extends Record<string, any> = {}>(args
376
592
  *
377
593
  * @since @next
378
594
  */
379
- declare class HandlerCoverageError<A extends Any$1 = Any$1> extends HandlerCoverageBase<{
595
+ declare class HandlerCoverageError<A extends Any$2 = Any$2> extends HandlerCoverageBase<{
380
596
  readonly issues: ReadonlyArray<CoverageIssue>;
381
597
  readonly report: Report<A, never>;
382
598
  }> {
383
599
  get message(): string;
384
600
  }
601
+ declare const InteractionUnavailableBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Cause.YieldableError & {
602
+ readonly _tag: "InteractionUnavailable";
603
+ } & Readonly<A>;
604
+ /**
605
+ * The plan has manual handlers, and the run has no `interaction` to ask a person. The
606
+ * run fails before any handler phase or prompt.
607
+ *
608
+ * @since @next
609
+ */
610
+ declare class InteractionUnavailable<A extends Any$2 = Any$2> extends InteractionUnavailableBase<{
611
+ /** The occurrences that a manual handler covers, in plan order. */
612
+ readonly occurrences: ReadonlyArray<Occurrence<A>>;
613
+ readonly report: Report<A, never>;
614
+ }> {
615
+ get message(): string;
616
+ }
385
617
  declare const ExecutionFailedBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Cause.YieldableError & {
386
618
  readonly _tag: "ExecutionFailed";
387
619
  } & Readonly<A>;
388
620
  /**
389
- * An occurrence failed. Execution stopped admitting new actions; started ones settled.
621
+ * An occurrence failed, or a person declined manual work. Execution stopped admitting
622
+ * new actions; started ones settled.
390
623
  *
391
624
  * @since @next
392
625
  */
393
- declare class ExecutionFailed<A extends Any$1 = Any$1, E = unknown> extends ExecutionFailedBase<{
626
+ declare class ExecutionFailed<A extends Any$2 = Any$2, E = unknown> extends ExecutionFailedBase<{
394
627
  readonly failures: ReadonlyArray<OccurrenceReport<A, E>>;
628
+ /** Manual occurrences that a person declined. */
629
+ readonly declined: ReadonlyArray<OccurrenceReport<A, E>>;
395
630
  readonly report: Report<A, E>;
396
631
  }> {
397
632
  get message(): string;
@@ -412,23 +647,23 @@ type InterruptReason = "cancelled" | "timeout" | "handler";
412
647
  *
413
648
  * @since @next
414
649
  */
415
- declare class ExecutionInterrupted<A extends Any$1 = Any$1, E = unknown> extends ExecutionInterruptedBase<{
650
+ declare class ExecutionInterrupted<A extends Any$2 = Any$2, E = unknown> extends ExecutionInterruptedBase<{
416
651
  readonly reason: InterruptReason;
417
652
  readonly report: Report<A, E>;
418
653
  }> {
419
654
  get message(): string;
420
655
  }
421
656
  /** @since @next */
422
- type ExecutionError<A extends Any$1, E> = HandlerCoverageError<A> | ExecutionFailed<A, E> | ExecutionInterrupted<A, E>;
657
+ type ExecutionError<A extends Any$2, E> = HandlerCoverageError<A> | InteractionUnavailable<A> | ExecutionFailed<A, E> | ExecutionInterrupted<A, E>;
423
658
  /**
424
659
  * Action identifiers of a statically covered plan that no handler in the array
425
660
  * implements.
426
661
  *
427
662
  * @since @next
428
663
  */
429
- type Uncovered<A extends Any$1, H, C extends Coverage> = "runtime" extends C ? never : A extends Any$1 ? string extends A["id"] ? never : A["id"] extends ActionId<H> ? never : A["id"] : never;
664
+ type Uncovered<A extends Any$2, H, C extends Coverage> = "runtime" extends C ? never : A extends Any$2 ? string extends A["id"] ? never : A["id"] extends ActionId<H> ? never : A["id"] : never;
430
665
  /** Rejects a handler array that leaves statically known actions uncovered, naming them. */
431
- type CoverageCheck<A extends Any$1, H, C extends Coverage> = [Uncovered<A, H, C>] extends [never] ? unknown : {
666
+ type CoverageCheck<A extends Any$2, H, C extends Coverage> = [Uncovered<A, H, C>] extends [never] ? unknown : {
432
667
  readonly handlers: `Missing a handler for action "${Uncovered<A, H, C>}"`;
433
668
  };
434
669
  /**
@@ -436,16 +671,23 @@ type CoverageCheck<A extends Any$1, H, C extends Coverage> = [Uncovered<A, H, C>
436
671
  *
437
672
  * @since @next
438
673
  */
439
- type Errors<H> = Error<H>;
674
+ type Errors<H, I = never> = Error$1<H> | Error<I>;
440
675
  /**
441
- * Effect services an execution requires: the services of its handlers.
676
+ * Effect services an execution requires: the services of its handlers and of its
677
+ * interaction.
442
678
  *
443
679
  * @since @next
444
680
  */
445
- type Requirements<H> = Services<H>;
681
+ type Requirements<H, I = never> = Services$1<H> | Services<I>;
446
682
  /** @since @next */
447
- type Options<H extends Any> = {
683
+ type Options<H extends Any$1, I extends Any = never> = {
448
684
  readonly handlers?: ReadonlyArray<H>;
685
+ /**
686
+ * Asks a person to confirm the work of manual handlers. A run whose plan has manual
687
+ * handlers fails with `InteractionUnavailable` before it starts when this is absent.
688
+ * A dry run never asks and does not need it.
689
+ */
690
+ readonly interaction?: I;
449
691
  /**
450
692
  * Run prepare phases without running any apply phase. A prepare phase that may
451
693
  * depend on an earlier action is reported `Undetermined`, because the dry run does
@@ -454,8 +696,10 @@ type Options<H extends Any> = {
454
696
  readonly dryRun?: boolean;
455
697
  /**
456
698
  * Limit for each phase of an occurrence: the prepare phase and the apply phase each
457
- * get the full limit. Exceeding it interrupts that action and stops admitting new
458
- * ones. It applies to dry-run prepare phases too.
699
+ * get the full limit, and so does the verification of manual work. Exceeding it
700
+ * interrupts that action and stops admitting new ones. It applies to dry-run prepare
701
+ * phases too. It never limits the wait for a person to confirm manual work; cancel
702
+ * the run to end that wait.
459
703
  */
460
704
  readonly timeout?: Duration.Input;
461
705
  /**
@@ -465,7 +709,8 @@ type Options<H extends Any> = {
465
709
  readonly settleTimeout?: Duration.Input;
466
710
  };
467
711
  /**
468
- * Runs a plan as an Effect. Coverage is checked before any handler phase runs. Steps
712
+ * Runs a plan as an Effect. Coverage, and the interaction that manual handlers need,
713
+ * are checked before any handler phase runs. Steps
469
714
  * are sequential barriers; parallel groups run their branches concurrently. On failure,
470
715
  * no new action starts, and actions already running settle before the effect fails
471
716
  * with the partial report.
@@ -481,25 +726,27 @@ type Options<H extends Any> = {
481
726
  *
482
727
  * @since @next
483
728
  */
484
- declare const effect: <A extends Any$1, C extends Coverage, H extends Any = never>(plan: Plan<A, C>, options: Options<H> & CoverageCheck<A, H, C>) => Effect.Effect<Report<A, Errors<H>>, ExecutionError<A, Errors<H>>, Requirements<H>>;
729
+ declare const effect: <A extends Any$2, C extends Coverage, H extends Any$1 = never, I extends Any = never>(plan: Plan<A, C>, options: Options<H, I> & CoverageCheck<A, H, C>) => Effect.Effect<Report<A, Errors<H, I>>, ExecutionError<A, Errors<H, I>>, Requirements<H, I>>;
485
730
  type ServicesOption<R, LE> = [R] extends [never] ? {
486
- /** Handlers without Effect services need none. */
731
+ /** Handlers and interactions without Effect services need none. */
487
732
  readonly services?: Context.Context<never> | Layer.Layer<never, LE>;
488
733
  } : {
489
- /** Supplies the handlers' Effect services. */
734
+ /** Supplies the Effect services of the handlers and the interaction. */
490
735
  readonly services: Context.Context<R> | Layer.Layer<R, LE>;
491
736
  };
492
737
  /** @since @next */
493
- type PromiseOptions<H extends Any> = Options<H> & {
738
+ type PromiseOptions<H extends Any$1, I extends Any = never> = Options<H, I> & {
494
739
  /**
495
- * Explicit cancellation. Aborting stops admission, interrupts running actions, and
496
- * rejects with `ExecutionInterrupted` and the partial report.
740
+ * Explicit cancellation. Aborting stops admission, interrupts running actions and
741
+ * pending confirmations, and rejects with `ExecutionInterrupted` and the partial
742
+ * report.
497
743
  */
498
744
  readonly signal?: AbortSignal;
499
745
  };
500
746
  /**
501
747
  * Runs a plan and returns a Promise. It rejects with `HandlerCoverageError`,
502
- * `ExecutionFailed`, or `ExecutionInterrupted`, each carrying the partial report.
748
+ * `InteractionUnavailable`, `ExecutionFailed`, or `ExecutionInterrupted`, each carrying
749
+ * the partial report.
503
750
  * Building a supplied services layer can also reject with the layer's own error,
504
751
  * without a report.
505
752
  *
@@ -512,6 +759,6 @@ type PromiseOptions<H extends Any> = Options<H> & {
512
759
  *
513
760
  * @since @next
514
761
  */
515
- declare const runPromise: <A extends Any$1, C extends Coverage, H extends Any = never, LE = never>(plan: Plan<A, C>, options: PromiseOptions<H> & ServicesOption<Requirements<H>, LE> & CoverageCheck<A, H, C>) => Promise<Report<A, Errors<H>>>;
516
- export { action_d_exports as Action, change_d_exports as Change, executor_d_exports as Executor, handler_d_exports as Handler, history_d_exports as History, migration_d_exports as Migration, package_d_exports as Package, plan_d_exports as Plan, rule_d_exports as Rule, shortcut_d_exports as Shortcut, version_d_exports as Version };
762
+ declare const runPromise: <A extends Any$2, C extends Coverage, H extends Any$1 = never, I extends Any = never, LE = never>(plan: Plan<A, C>, options: PromiseOptions<H, I> & ServicesOption<Requirements<H, I>, LE> & CoverageCheck<A, H, C>) => Promise<Report<A, Errors<H, I>>>;
763
+ export { action_d_exports as Action, change_d_exports as Change, executor_d_exports as Executor, handler_d_exports as Handler, history_d_exports as History, interaction_d_exports as Interaction, migration_d_exports as Migration, package_d_exports as Package, plan_d_exports as Plan, rule_d_exports as Rule, shortcut_d_exports as Shortcut, version_d_exports as Version };
517
764
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["Action.Any","PromiseOptions","effect","Handler.Phase","Action.Any","Plan.Coverage","Handler.ActionId","Handler.Error","Handler.Services","Handler.Any","Plan.Plan"],"sources":["../src/types.ts","../src/features/execution/handler.ts","../src/features/execution/executor.ts"],"mappings":";;;KACY,QAAQ,KAAK,QAAQ;;;;;;;;;;KCWrB;;;;;;;;;;;cASC,+BAA+B;WAClC;WACA;WACA,OAAO;WACP;;MAEI;;cAKR;;;;;;;KAQM,aAAa;YACd,2BAA2B;WAC5B;WACA,OAAO;;;;;;;;KASL;YACD,2BAA2B;WAC5B;WACA;;;;;;;KAQE,YAAY,KAAK,SAAS,KAAK;;KAGtC,cAAc,KAAK,UAAU,eAAe,KAAK;;;;;;;iBAQtC,YAAY;iBACZ,SAAS,GAAG,OAAO,IAAI,SAAS;;;;;;cAUnC,OAAI,mBAAqB;;;;;;;KAkB1B,KAAK,GAAG,KACjB;WACW;WAAwB,OAAO,OAAO,aAAa,GAAG;;cAO9D;;;;;;;;KASM,YAAY,UAAUA,WAAgB,eAAe;YACtD,gBAAgB;WACjB,QAAQ;;WAER;;;;;;WAMA,UAAU,OAAO,MAAM,UAAU,OAAO,OAAO,KAAK,GAAG,IAAI,GAAG;;;;;;;KAQ5D,MAAM,QAAQA;;;;;;KAOd,MAAM,KAAK,UAAU,mBAAmB,UAAU;;;;;;KAOlD,SAAS,KAAK,UAAU,wBAAwB,KAAK;;;;;;KAOrD,SAAS,KAAK,UAAU,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UC,UACV,UAAUI,aACV,YAAU,MAEJC,KAAU,GAAG,IAAE,SACZ,eAAe,KAAK,eAAe,aAAa,IAAI,MAAM,cAAc,GAAG,GAAG,OACrF,QAAQ,OAAO,GAAG,OAAO"}
1
+ {"version":3,"file":"index.d.ts","names":["ServiceMap","NoServices","PromiseContext","ServiceIds","ErrorGuard","GuardedError","Callback.NoServices","Callback.ServiceIds","Callback.GuardedError","TypeId","Action.Any","Any","Error","Services","Callback.ServiceMap","Callback.PromiseContext","Callback.ErrorGuard","PromiseOptions","promise","effect","Action.Any","PromiseOptions","Callback.ServiceMap","Callback.ErrorGuard","Callback.NoServices","Callback.PromiseContext","Callback.GuardedError","Callback.ServiceIds","effect","Handler.Phase","Handler.Performer","Action.Any","Plan.Coverage","Handler.ActionId","Handler.Error","Interaction.Error","Handler.Services","Interaction.Services","Handler.Any","Interaction.Any","Plan.Plan"],"sources":["../src/types.ts","../src/features/execution/promise-callback.ts","../src/features/execution/handler.ts","../src/features/execution/interaction.ts","../src/features/execution/executor.ts"],"mappings":";;;KACY,QAAQ,KAAK,QAAQ;;KCKrBA;YAAyB,wBAAwB,QAAQ;;KAGzDC,eAAa;;KAGbC,iBAAe,UAAUF,eAAaC;WACxC,QAAQ;WACR,sBAAsB,WAAW,IAAI,EAAE;;KAGrCE,aAAW,UAAUH,gBAAc,WAC7C,WAAW,IAAI,EAAE,WAAW,QAAQ,UAAU,UAAU;;KAI9CI,eAAa,OAAO,QAAQ,mBAAmB;KAE/CC,eAAa,KAAK,UAAU,OAAO,MAC5C,YACA,YAAY,mBAAmB,eAAe,KAC7C;;;;KCrBC,aAAaC;KACb,WAAW,UAAU,cAAcC,aAAoB;KACvD,aAAa,KAAKC,eAAsB;;;;;;;;KASjC;;;;;;;KAQA;;;;;;;;;cAOC,2BAA2B;WAC9B;WACA;;MAEI;;;;;;;;;;;;cAYD,+BAA+B;WAClC;WACA;WACA,OAAO;WACP;;MAEI;;cAKR;;;;;;;KAQM,aAAa;YACd,2BAA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