@smthrs/plan 0.0.0-stage → 1.0.0-rc.4

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.
Files changed (199) hide show
  1. package/CHANGELOG.md +183 -0
  2. package/LICENSE +21 -0
  3. package/README.md +228 -2
  4. package/dist/cjs/CachePolicy.d.ts +131 -0
  5. package/dist/cjs/CachePolicy.d.ts.map +1 -0
  6. package/dist/cjs/CachePolicy.js +50 -0
  7. package/dist/cjs/CachePolicy.js.map +7 -0
  8. package/dist/cjs/Effects.d.ts +240 -0
  9. package/dist/cjs/Effects.d.ts.map +1 -0
  10. package/dist/cjs/Effects.js +76 -0
  11. package/dist/cjs/Effects.js.map +7 -0
  12. package/dist/cjs/FileSet.d.ts +288 -0
  13. package/dist/cjs/FileSet.d.ts.map +1 -0
  14. package/dist/cjs/FileSet.js +191 -0
  15. package/dist/cjs/FileSet.js.map +7 -0
  16. package/dist/cjs/GraphBuildError.d.ts +122 -0
  17. package/dist/cjs/GraphBuildError.d.ts.map +1 -0
  18. package/dist/cjs/GraphBuildError.js +71 -0
  19. package/dist/cjs/GraphBuildError.js.map +7 -0
  20. package/dist/cjs/KeyMaterial.d.ts +102 -0
  21. package/dist/cjs/KeyMaterial.d.ts.map +1 -0
  22. package/dist/cjs/KeyMaterial.js +64 -0
  23. package/dist/cjs/KeyMaterial.js.map +7 -0
  24. package/dist/cjs/Node.d.ts +606 -0
  25. package/dist/cjs/Node.d.ts.map +1 -0
  26. package/dist/cjs/Node.js +207 -0
  27. package/dist/cjs/Node.js.map +7 -0
  28. package/dist/cjs/Placement.d.ts +117 -0
  29. package/dist/cjs/Placement.d.ts.map +1 -0
  30. package/dist/cjs/Placement.js +46 -0
  31. package/dist/cjs/Placement.js.map +7 -0
  32. package/dist/cjs/Plan.d.ts +440 -0
  33. package/dist/cjs/Plan.d.ts.map +1 -0
  34. package/dist/cjs/Plan.js +508 -0
  35. package/dist/cjs/Plan.js.map +7 -0
  36. package/dist/cjs/PlanDiff.d.ts +58 -0
  37. package/dist/cjs/PlanDiff.d.ts.map +1 -0
  38. package/dist/cjs/PlanDiff.js +124 -0
  39. package/dist/cjs/PlanDiff.js.map +7 -0
  40. package/dist/cjs/Planned.d.ts +121 -0
  41. package/dist/cjs/Planned.d.ts.map +1 -0
  42. package/dist/cjs/Planned.js +72 -0
  43. package/dist/cjs/Planned.js.map +7 -0
  44. package/dist/cjs/Repetition.d.ts +31 -0
  45. package/dist/cjs/Repetition.d.ts.map +1 -0
  46. package/dist/cjs/Repetition.js +36 -0
  47. package/dist/cjs/Repetition.js.map +7 -0
  48. package/dist/cjs/Scheduling.d.ts +89 -0
  49. package/dist/cjs/Scheduling.d.ts.map +1 -0
  50. package/dist/cjs/Scheduling.js +76 -0
  51. package/dist/cjs/Scheduling.js.map +7 -0
  52. package/dist/cjs/StepKey.d.ts +333 -0
  53. package/dist/cjs/StepKey.d.ts.map +1 -0
  54. package/dist/cjs/StepKey.js +311 -0
  55. package/dist/cjs/StepKey.js.map +7 -0
  56. package/dist/cjs/index.d.ts +91 -0
  57. package/dist/cjs/index.d.ts.map +1 -0
  58. package/dist/cjs/index.js +59 -0
  59. package/dist/cjs/index.js.map +7 -0
  60. package/dist/cjs/internal/ConflictAnnotation.d.ts +59 -0
  61. package/dist/cjs/internal/ConflictAnnotation.d.ts.map +1 -0
  62. package/dist/cjs/internal/ConflictAnnotation.js +247 -0
  63. package/dist/cjs/internal/ConflictAnnotation.js.map +7 -0
  64. package/dist/cjs/internal/EffectCandidates.d.ts +19 -0
  65. package/dist/cjs/internal/EffectCandidates.d.ts.map +1 -0
  66. package/dist/cjs/internal/EffectCandidates.js +92 -0
  67. package/dist/cjs/internal/EffectCandidates.js.map +7 -0
  68. package/dist/cjs/internal/JsonMirror.d.ts +34 -0
  69. package/dist/cjs/internal/JsonMirror.d.ts.map +1 -0
  70. package/dist/cjs/internal/JsonMirror.js +195 -0
  71. package/dist/cjs/internal/JsonMirror.js.map +7 -0
  72. package/dist/cjs/internal/effects.d.ts +245 -0
  73. package/dist/cjs/internal/effects.d.ts.map +1 -0
  74. package/dist/cjs/internal/effects.js +290 -0
  75. package/dist/cjs/internal/effects.js.map +7 -0
  76. package/dist/cjs/internal/node.d.ts +526 -0
  77. package/dist/cjs/internal/node.d.ts.map +1 -0
  78. package/dist/cjs/internal/node.js +312 -0
  79. package/dist/cjs/internal/node.js.map +7 -0
  80. package/dist/cjs/package.json +1 -0
  81. package/dist/cjs/test/PlanFixtures.d.ts +127 -0
  82. package/dist/cjs/test/PlanFixtures.d.ts.map +1 -0
  83. package/dist/cjs/test/PlanFixtures.js +59 -0
  84. package/dist/cjs/test/PlanFixtures.js.map +7 -0
  85. package/dist/esm/CachePolicy.d.ts +131 -0
  86. package/dist/esm/CachePolicy.d.ts.map +1 -0
  87. package/dist/esm/CachePolicy.js +117 -0
  88. package/dist/esm/CachePolicy.js.map +1 -0
  89. package/dist/esm/Effects.d.ts +240 -0
  90. package/dist/esm/Effects.d.ts.map +1 -0
  91. package/dist/esm/Effects.js +167 -0
  92. package/dist/esm/Effects.js.map +1 -0
  93. package/dist/esm/FileSet.d.ts +288 -0
  94. package/dist/esm/FileSet.d.ts.map +1 -0
  95. package/dist/esm/FileSet.js +324 -0
  96. package/dist/esm/FileSet.js.map +1 -0
  97. package/dist/esm/GraphBuildError.d.ts +122 -0
  98. package/dist/esm/GraphBuildError.d.ts.map +1 -0
  99. package/dist/esm/GraphBuildError.js +146 -0
  100. package/dist/esm/GraphBuildError.js.map +1 -0
  101. package/dist/esm/KeyMaterial.d.ts +102 -0
  102. package/dist/esm/KeyMaterial.d.ts.map +1 -0
  103. package/dist/esm/KeyMaterial.js +85 -0
  104. package/dist/esm/KeyMaterial.js.map +1 -0
  105. package/dist/esm/Node.d.ts +606 -0
  106. package/dist/esm/Node.d.ts.map +1 -0
  107. package/dist/esm/Node.js +521 -0
  108. package/dist/esm/Node.js.map +1 -0
  109. package/dist/esm/Placement.d.ts +117 -0
  110. package/dist/esm/Placement.d.ts.map +1 -0
  111. package/dist/esm/Placement.js +65 -0
  112. package/dist/esm/Placement.js.map +1 -0
  113. package/dist/esm/Plan.d.ts +440 -0
  114. package/dist/esm/Plan.d.ts.map +1 -0
  115. package/dist/esm/Plan.js +673 -0
  116. package/dist/esm/Plan.js.map +1 -0
  117. package/dist/esm/PlanDiff.d.ts +58 -0
  118. package/dist/esm/PlanDiff.d.ts.map +1 -0
  119. package/dist/esm/PlanDiff.js +159 -0
  120. package/dist/esm/PlanDiff.js.map +1 -0
  121. package/dist/esm/Planned.d.ts +121 -0
  122. package/dist/esm/Planned.d.ts.map +1 -0
  123. package/dist/esm/Planned.js +147 -0
  124. package/dist/esm/Planned.js.map +1 -0
  125. package/dist/esm/Repetition.d.ts +31 -0
  126. package/dist/esm/Repetition.d.ts.map +1 -0
  127. package/dist/esm/Repetition.js +24 -0
  128. package/dist/esm/Repetition.js.map +1 -0
  129. package/dist/esm/Scheduling.d.ts +89 -0
  130. package/dist/esm/Scheduling.d.ts.map +1 -0
  131. package/dist/esm/Scheduling.js +82 -0
  132. package/dist/esm/Scheduling.js.map +1 -0
  133. package/dist/esm/StepKey.d.ts +333 -0
  134. package/dist/esm/StepKey.d.ts.map +1 -0
  135. package/dist/esm/StepKey.js +478 -0
  136. package/dist/esm/StepKey.js.map +1 -0
  137. package/dist/esm/index.d.ts +91 -0
  138. package/dist/esm/index.d.ts.map +1 -0
  139. package/dist/esm/index.js +91 -0
  140. package/dist/esm/index.js.map +1 -0
  141. package/dist/esm/internal/ConflictAnnotation.d.ts +59 -0
  142. package/dist/esm/internal/ConflictAnnotation.d.ts.map +1 -0
  143. package/dist/esm/internal/ConflictAnnotation.js +332 -0
  144. package/dist/esm/internal/ConflictAnnotation.js.map +1 -0
  145. package/dist/esm/internal/EffectCandidates.d.ts +19 -0
  146. package/dist/esm/internal/EffectCandidates.d.ts.map +1 -0
  147. package/dist/esm/internal/EffectCandidates.js +86 -0
  148. package/dist/esm/internal/EffectCandidates.js.map +1 -0
  149. package/dist/esm/internal/JsonMirror.d.ts +34 -0
  150. package/dist/esm/internal/JsonMirror.d.ts.map +1 -0
  151. package/dist/esm/internal/JsonMirror.js +204 -0
  152. package/dist/esm/internal/JsonMirror.js.map +1 -0
  153. package/dist/esm/internal/effects.d.ts +245 -0
  154. package/dist/esm/internal/effects.d.ts.map +1 -0
  155. package/dist/esm/internal/effects.js +459 -0
  156. package/dist/esm/internal/effects.js.map +1 -0
  157. package/dist/esm/internal/node.d.ts +526 -0
  158. package/dist/esm/internal/node.d.ts.map +1 -0
  159. package/dist/esm/internal/node.js +564 -0
  160. package/dist/esm/internal/node.js.map +1 -0
  161. package/dist/esm/test/PlanFixtures.d.ts +127 -0
  162. package/dist/esm/test/PlanFixtures.d.ts.map +1 -0
  163. package/dist/esm/test/PlanFixtures.js +60 -0
  164. package/dist/esm/test/PlanFixtures.js.map +1 -0
  165. package/docs/README.md +165 -0
  166. package/docs/api.md +1475 -0
  167. package/docs/concepts/authoring-ast.md +203 -0
  168. package/docs/concepts/effects-and-conflicts.md +135 -0
  169. package/docs/concepts/plan-value.md +168 -0
  170. package/docs/concepts/step-keys.md +179 -0
  171. package/docs/guides/author-a-node-graph.md +182 -0
  172. package/docs/guides/compile-a-plan.md +146 -0
  173. package/docs/guides/declare-file-effects.md +143 -0
  174. package/docs/guides/diff-two-plans.md +101 -0
  175. package/docs/installation.md +71 -0
  176. package/docs/quickstart.md +128 -0
  177. package/docs/testing.md +73 -0
  178. package/docs/troubleshooting.md +314 -0
  179. package/package.json +254 -3
  180. package/src/CachePolicy.ts +143 -0
  181. package/src/Effects.ts +284 -0
  182. package/src/FileSet.ts +411 -0
  183. package/src/GraphBuildError.ts +158 -0
  184. package/src/KeyMaterial.ts +106 -0
  185. package/src/Node.ts +871 -0
  186. package/src/Placement.ts +99 -0
  187. package/src/Plan.ts +868 -0
  188. package/src/PlanDiff.ts +199 -0
  189. package/src/Planned.ts +208 -0
  190. package/src/Repetition.ts +33 -0
  191. package/src/Scheduling.ts +154 -0
  192. package/src/StepKey.ts +710 -0
  193. package/src/index.ts +103 -0
  194. package/src/internal/ConflictAnnotation.ts +374 -0
  195. package/src/internal/EffectCandidates.ts +89 -0
  196. package/src/internal/JsonMirror.ts +255 -0
  197. package/src/internal/effects.ts +543 -0
  198. package/src/internal/node.ts +858 -0
  199. package/src/test/PlanFixtures.ts +76 -0
@@ -0,0 +1,606 @@
1
+ /**
2
+ * Pure, pipeable nodes: the shape a flow body describes and nothing more.
3
+ *
4
+ * Building a node records an inspectable AST and executes nothing — the same
5
+ * split as Bazel's `ctx.actions.run`, which declares an action rather than
6
+ * running one. A plan is
7
+ * always a DAG, so there is no loop node here and never will be: repetition
8
+ * lives one level up, in what a flow settles with.
9
+ *
10
+ * A node also carries Effect's requirement channel, `R`, and carries it as a
11
+ * PHANTOM: building a plan demands nothing, and every combinator here unions
12
+ * `R` without ever reading it. What fills the channel is a call to something
13
+ * whose code lives elsewhere — an action — so the type of a plan states which
14
+ * implementations executing it will need, and the place that executes it is
15
+ * where the compiler asks for them.
16
+ *
17
+ * Control flow is structure. {@link branch} takes both arms and evaluates each
18
+ * ONCE, symbolically, so the exit condition and the handoff site are visible
19
+ * topology before anything runs; its predicate is digested and runs later on
20
+ * the real value. {@link map} is transformation only. The rule the authoring
21
+ * note states, and this module encodes: **map transforms; branch decides.**
22
+ *
23
+ * Adapted from `@smthrs/core` (`packages/smithers/flows/core`) `Node.ts`.
24
+ * `Dynamic` is gone — a model call is an ordinary action, and nothing
25
+ * model-shaped belongs in this package — and node annotations are gone with
26
+ * it, because the AST has to stay JSON serializable.
27
+ *
28
+ * @since 0.1.0
29
+ */
30
+ import type * as Pipeable from "effect/Pipeable";
31
+ import type * as Schema from "effect/Schema";
32
+ import type * as Types from "effect/Types";
33
+ import * as internal from "./internal/node.ts";
34
+ import * as Planned from "./Planned.ts";
35
+ /**
36
+ * The runtime type identifier carried by every node.
37
+ *
38
+ * @since 0.1.0
39
+ * @category type ids
40
+ * @slop
41
+ */
42
+ export declare const TypeId: TypeId;
43
+ /**
44
+ * The type-level form of {@link TypeId}.
45
+ *
46
+ * @since 0.1.0
47
+ * @category type ids
48
+ * @slop
49
+ */
50
+ export type TypeId = "~@smthrs/plan/Node";
51
+ /**
52
+ * The inspectable AST a node stores: closure-free, and JSON serializable for
53
+ * every JSON payload an author puts in it.
54
+ *
55
+ * @since 0.1.0
56
+ * @category models
57
+ * @slop
58
+ */
59
+ export type Ast = internal.NodeAst;
60
+ /**
61
+ * How a flow call joins the caller's plan: `inline` splices the callee's body
62
+ * in, `boundary` makes it one child execution, and `handoff` names the next
63
+ * trampoline round.
64
+ *
65
+ * This is the ONE call-mode vocabulary. {@link flowCall} takes it and
66
+ * `@smthrs/flow`'s graph builder switches on it, so a second spelling in
67
+ * either package would fork the moment one gained a mode.
68
+ *
69
+ * @since 0.1.0
70
+ * @category models
71
+ * @slop
72
+ */
73
+ export declare const CallMode: Schema.Literals<readonly ["inline", "boundary", "handoff"]>;
74
+ /**
75
+ * The value form of {@link CallMode}.
76
+ *
77
+ * @since 0.1.0
78
+ * @category models
79
+ * @slop
80
+ */
81
+ export type CallMode = internal.CallMode;
82
+ /**
83
+ * The serializable stand-in an AST keeps for a plan-time function: a digest of
84
+ * its normalized source, hashed in place of a closure that could not be
85
+ * shipped, stored, or compared.
86
+ *
87
+ * @since 0.1.0
88
+ * @category models
89
+ * @slop
90
+ */
91
+ export type FunctionIdentity = Extract<Ast, {
92
+ readonly _tag: "Map";
93
+ }>["mapper"];
94
+ /**
95
+ * Reads the inert AST reference created for a planned value.
96
+ *
97
+ * Structural lookalikes remain ordinary payload data. This accessor is the
98
+ * only recognition path because the marker itself is deliberately private to
99
+ * the AST cloner.
100
+ *
101
+ * @since 1.0.0
102
+ * @category accessors
103
+ */
104
+ export declare const plannedReference: (value: unknown) => internal.PlannedReference | undefined;
105
+ /**
106
+ * A pure graph-building value, covariant in what it will succeed and fail
107
+ * with and in what it will need to run. It is a description: holding one has
108
+ * run nothing.
109
+ *
110
+ * `R` is Effect's requirement channel, and it is PHANTOM here. Nothing at plan
111
+ * time reads it: the AST, the graph built from it, its key material, and every
112
+ * digest are identical whatever `R` says. It exists so a value that names an
113
+ * implementation it does not carry — an action call — can say so in its type,
114
+ * and so the place that finally has to run that implementation can demand it.
115
+ * Building a plan therefore stays requirement-free; only executing one is not.
116
+ *
117
+ * @since 0.1.0
118
+ * @category models
119
+ * @slop
120
+ */
121
+ export interface Node<out A, out E = never, out R = never> extends Pipeable.Pipeable {
122
+ readonly [TypeId]: {
123
+ readonly _A: Types.Covariant<A>;
124
+ readonly _E: Types.Covariant<E>;
125
+ readonly _R: Types.Covariant<R>;
126
+ };
127
+ readonly ast: Ast;
128
+ }
129
+ /**
130
+ * Any node, whatever it succeeds or fails with and whatever it requires.
131
+ *
132
+ * @since 0.1.0
133
+ * @category models
134
+ * @slop
135
+ */
136
+ export type Any = Node<unknown, unknown, any>;
137
+ /**
138
+ * The success type of a node.
139
+ *
140
+ * @since 0.1.0
141
+ * @category models
142
+ * @slop
143
+ */
144
+ export type Success<N> = N extends Node<infer A, infer _E, infer _R> ? A : never;
145
+ /**
146
+ * The error type of a node.
147
+ *
148
+ * @since 0.1.0
149
+ * @category models
150
+ * @slop
151
+ */
152
+ export type Error<N> = N extends Node<infer _A, infer E, infer _R> ? E : never;
153
+ /**
154
+ * The requirements of a node: what has to be provided wherever it is finally
155
+ * executed, and nothing that has to be provided to build it.
156
+ *
157
+ * @since 0.1.0
158
+ * @category models
159
+ * @slop
160
+ */
161
+ export type Services<N> = N extends Node<infer _A, infer _E, infer R> ? R : never;
162
+ /**
163
+ * The node reference a branch arm's symbolic subject carries. Arms are built
164
+ * before the graph assigns ids, so every reference an arm records names this
165
+ * placeholder, and graph building rewrites it to the branch's own upstream
166
+ * node — which is `first`, structurally, and therefore not a guess.
167
+ *
168
+ * @since 0.1.0
169
+ * @category constants
170
+ * @slop
171
+ */
172
+ export declare const branchSubject = "branch/subject";
173
+ /**
174
+ * The prefix of the node reference a catch failure arm's symbolic error
175
+ * carries. Each {@link catch_} mints its own token under this prefix, so an
176
+ * outer error captured inside a nested failure arm keeps naming the outer
177
+ * catch, and graph building rewrites each token to the node that catch
178
+ * protects.
179
+ *
180
+ * @since 0.1.0
181
+ * @category constants
182
+ * @slop
183
+ */
184
+ export declare const catchSubject = "catch/subject";
185
+ /**
186
+ * The two arms of a decision plus the predicate that chooses between them.
187
+ *
188
+ * `if` runs at RUN time on the real value. `then` and `else` run at PLAN time,
189
+ * once each, against a {@link module:Planned.Planned} placeholder — they
190
+ * describe topology, so they may pass the value on but never compute on it.
191
+ *
192
+ * @since 0.1.0
193
+ * @category models
194
+ * @slop
195
+ */
196
+ export interface BranchOptions<A, B1, E1, R1, B2, E2, R2> {
197
+ readonly if: (value: A) => boolean;
198
+ readonly then: (value: Planned.Planned<A>) => Node<B1, E1, R1>;
199
+ readonly else: (value: Planned.Planned<A>) => Node<B2, E2, R2>;
200
+ }
201
+ /**
202
+ * The statically planned recovery arm and optional schema selecting which
203
+ * typed failures it handles.
204
+ *
205
+ * @since 0.1.0
206
+ * @category models
207
+ * @slop
208
+ */
209
+ export interface CatchOptions<E, B, E2, R2 = never, Handled = E> {
210
+ readonly error?: Schema.Schema<Handled> | undefined;
211
+ readonly onFailure: (error: Planned.Planned<Handled>) => Node<B, E2, R2>;
212
+ }
213
+ /**
214
+ * Checks whether a value is a node.
215
+ *
216
+ * A node this package built is recognized by registration at construction. A
217
+ * node that crossed a serialization boundary, an object sharing the node
218
+ * prototype whose own `ast` is a well-formed AST, is recognized by that shape,
219
+ * because `@smthrs/flow` hands a rehydrated AST back as a node and its side
220
+ * tables are all a round trip loses. The {@link TypeId} marker is a public
221
+ * string any object can carry, so it counts for nothing on its own: every
222
+ * combinator that admits a node reads its `ast` as trusted topology, and an
223
+ * object carrying the marker on any other prototype, one inheriting it from a
224
+ * node, and one whose `ast` is missing, malformed, cyclic, or an accessor are
225
+ * all refused with the same `GraphBuildError` as any other non-node. A proxy
226
+ * is judged by the shape it forwards: one that forwards a node unchanged
227
+ * passes, and one that diverges from it does not.
228
+ *
229
+ * @since 0.1.0
230
+ * @category guards
231
+ * @slop
232
+ */
233
+ export declare const isNode: (value: unknown) => value is Any;
234
+ /**
235
+ * The inert value delivered by {@link succeed}. Planned references resolve to
236
+ * their result type; other values follow the payload's JSON projection.
237
+ * Invalid dates serialize to null. Members without a JSON representation are
238
+ * omitted from objects and replaced with null in arrays.
239
+ *
240
+ * @since 1.0.0
241
+ * @category models
242
+ */
243
+ export type Succeed<A> = A extends Planned.Planned<infer Value> ? Value : A extends Date ? string | null : A extends {
244
+ toJSON: (...args: any) => infer Value;
245
+ } ? Succeed<Value> : A extends (...args: any) => any ? undefined : A extends symbol ? undefined : A extends ReadonlyArray<unknown> ? {
246
+ [K in keyof A]: SucceedArrayMember<A[K]>;
247
+ } : A extends object ? {
248
+ [K in keyof A as K extends string | number ? [Succeed<A[K]>] extends [undefined] ? never : K : never]: Succeed<A[K]>;
249
+ } : A;
250
+ /** @private */
251
+ type SucceedArrayMember<A> = A extends Planned.Planned<infer Value> ? Value : A extends unknown ? Succeed<A> extends infer Value ? Value extends undefined ? null : Value : never : never;
252
+ /**
253
+ * A node that succeeds with the constant's inert JSON projection.
254
+ *
255
+ * Dates produce strings (or null for invalid dates), URLs produce strings,
256
+ * and callable object members are omitted. Use {@link map} to reconstruct a
257
+ * domain value explicitly after this serialization boundary.
258
+ *
259
+ * @since 0.1.0
260
+ * @category constructors
261
+ */
262
+ export declare const succeed: <A>(value: A) => Node<Succeed<A>>;
263
+ /**
264
+ * The inert error delivered by {@link fail}: the same JSON projection
265
+ * {@link Succeed} describes, because a plan stores an error exactly as it
266
+ * stores a value.
267
+ *
268
+ * @since 1.0.0
269
+ * @category models
270
+ */
271
+ export type Fail<E> = Succeed<E>;
272
+ /**
273
+ * A node that fails with the constant's inert JSON projection, in the typed
274
+ * error channel.
275
+ *
276
+ * It is how a plan states a refusal it already knows about — an unsupported
277
+ * input, an exhausted budget, a compensation that has nothing left to undo —
278
+ * without an action that exists only to fail. {@link catch} recovers it exactly
279
+ * as it recovers an action's failure, and an uncaught one is the flow's typed
280
+ * failure.
281
+ *
282
+ * @since 1.0.0
283
+ * @category constructors
284
+ */
285
+ export declare const fail: <E>(error: E) => Node<never, Fail<E>>;
286
+ /**
287
+ * Combines independent children into one node, keyed by name.
288
+ *
289
+ * Width is fixed here, at plan time. Fanning out over something a step
290
+ * discovered is not this: end the round and carry the list in the next flow's
291
+ * payload, where it is real data.
292
+ *
293
+ * @since 0.1.0
294
+ * @category constructors
295
+ * @slop
296
+ */
297
+ export declare const all: <const Nodes extends Readonly<Record<string, Any>>>(nodes: Nodes) => Node<Types.Simplify<{ readonly [K in keyof Nodes]: Success<Nodes[K]>; }>, Error<Nodes[keyof Nodes]>, Services<Nodes[keyof Nodes]>>;
298
+ /**
299
+ * The members of an early-settling join, keyed by name.
300
+ *
301
+ * @since 1.0.0
302
+ * @category models
303
+ */
304
+ export type Members = Readonly<Record<string, Any>>;
305
+ /**
306
+ * Settles with the first member to settle, success or typed failure.
307
+ *
308
+ * The other members are interrupted. The winner is journaled, so a resumed run
309
+ * settles the same member and never starts the others again.
310
+ *
311
+ * @since 1.0.0
312
+ * @category constructors
313
+ */
314
+ export declare const race: <const Nodes extends Members>(nodes: Nodes) => Node<Success<Nodes[keyof Nodes]>, Error<Nodes[keyof Nodes]>, Services<Nodes[keyof Nodes]>>;
315
+ /**
316
+ * Settles with the first member to succeed, ignoring typed failures while a
317
+ * member is still running.
318
+ *
319
+ * It fails with the last failure when every member fails. The other members
320
+ * are interrupted, and the winner is journaled as {@link race} journals it.
321
+ *
322
+ * @since 1.0.0
323
+ * @category constructors
324
+ */
325
+ export declare const any: <const Nodes extends Members>(nodes: Nodes) => Node<Success<Nodes[keyof Nodes]>, Error<Nodes[keyof Nodes]>, Services<Nodes[keyof Nodes]>>;
326
+ /**
327
+ * Succeeds once `count` members succeed, with exactly those members' values
328
+ * keyed by name.
329
+ *
330
+ * It fails with the failure that leaves fewer than `count` members able to
331
+ * succeed. Either way the members still running are interrupted, and the
332
+ * members that decided are journaled as {@link race} journals its winner.
333
+ *
334
+ * @since 1.0.0
335
+ * @category constructors
336
+ */
337
+ export declare const quorum: <const Nodes extends Members>(count: number, nodes: Nodes) => Node<Types.Simplify<{ readonly [K in keyof Nodes]?: Success<Nodes[K]>; }>, Error<Nodes[keyof Nodes]>, Services<Nodes[keyof Nodes]>>;
338
+ /**
339
+ * Transforms an eventual success value with a deferred pure function.
340
+ *
341
+ * The function is digested, not run: it executes later, on the real value.
342
+ * This is where computation on a step result belongs — and only computation. A
343
+ * `map` that decides what happens next is a `branch` written wrongly.
344
+ *
345
+ * @since 0.1.0
346
+ * @category mapping
347
+ * @slop
348
+ */
349
+ export declare const map: {
350
+ <A, B>(f: (a: A) => B): <E, R>(self: Node<A, E, R>) => Node<B, E, R>;
351
+ <A, E, R, B>(self: Node<A, E, R>, f: (a: A) => B): Node<B, E, R>;
352
+ };
353
+ /**
354
+ * Starts the entire next subtree only after this node succeeds, without
355
+ * consuming its result. Failure or interruption prevents that subtree from
356
+ * starting, including actions nested inside combinations or inline flows.
357
+ *
358
+ * Use {@link bindPlanned} to build a dependency from a symbolic result, or
359
+ * {@link map} to compute on the eventual value.
360
+ *
361
+ * @since 0.1.0
362
+ * @category sequencing
363
+ * @slop
364
+ */
365
+ export declare const andThen: {
366
+ <B, E2, R2>(next: Node<B, E2, R2>): <A, E, R>(self: Node<A, E, R>) => Node<B, E | E2, R | R2>;
367
+ <A, E, R, B, E2, R2>(self: Node<A, E, R>, next: Node<B, E2, R2>): Node<B, E | E2, R | R2>;
368
+ };
369
+ /**
370
+ * Builds a dependency using a symbolic reference to this node's future result.
371
+ *
372
+ * The builder runs during planning. Its argument is a {@link module:Planned.Planned}
373
+ * reference, not the value the node will eventually produce. Pass references
374
+ * into action payloads; use {@link branch} for decisions and {@link map} for
375
+ * computation on real results. JavaScript truthiness and reference equality
376
+ * cannot inspect a planned result. Enable type-aware ESLint's
377
+ * `@typescript-eslint/strict-boolean-expressions` to reject planned conditions.
378
+ * Independent descendants of the built subtree can start while this producer
379
+ * is running; consumers of its reference wait for its value. Use
380
+ * {@link andThen} when the whole next subtree must wait for success.
381
+ *
382
+ * @since 1.0.0
383
+ * @category sequencing
384
+ */
385
+ export declare const bindPlanned: {
386
+ <A, B, E2, R2>(build: (reference: Planned.Planned<A>) => Node<B, E2, R2>): <E, R>(self: Node<A, E, R>) => Node<B, E | E2, R | R2>;
387
+ <A, E, R, B, E2, R2>(self: Node<A, E, R>, build: (reference: Planned.Planned<A>) => Node<B, E2, R2>): Node<B, E | E2, R | R2>;
388
+ };
389
+ /**
390
+ * Decides between two arms, both of them static topology.
391
+ *
392
+ * Each arm builder is evaluated exactly once, here, against a
393
+ * {@link module:Planned.Planned} placeholder, and the resulting ASTs are what
394
+ * the node stores — so a plan shows the exit condition and both continuations
395
+ * before it runs. The predicate is digested and evaluated at run time on the
396
+ * real value, which is why none of the plan-time placeholder machinery leaks
397
+ * into control flow.
398
+ *
399
+ * Both arms contribute their requirements, because both arms are topology the
400
+ * plan carries. A run takes one of them, but which one is not known until the
401
+ * predicate sees the real value, so an execution has to be able to take either.
402
+ *
403
+ * @since 0.1.0
404
+ * @category sequencing
405
+ * @slop
406
+ */
407
+ export declare const branch: {
408
+ <A, B1, E1, R1, B2, E2, R2>(options: BranchOptions<A, B1, E1, R1, B2, E2, R2>): <E, R>(self: Node<A, E, R>) => Node<B1 | B2, E | E1 | E2, R | R1 | R2>;
409
+ <A, E, R, B1, E1, R1, B2, E2, R2>(self: Node<A, E, R>, options: BranchOptions<A, B1, E1, R1, B2, E2, R2>): Node<B1 | B2, E | E1 | E2, R | R1 | R2>;
410
+ };
411
+ /**
412
+ * Recovers from matching typed failures with static failure topology.
413
+ *
414
+ * The protected graph and failure arm are both stored in the AST. The arm is
415
+ * built once at plan time against a strict planned error placeholder. With no
416
+ * schema the whole typed error channel is handled. A schema handles only the
417
+ * values it accepts, so its overloads retain E: a refinement can reject values
418
+ * without narrowing its TypeScript type. Runtime schema callbacks enter the
419
+ * filter identity along with its JSON Schema. Uncaptured callbacks are local
420
+ * to this process, just like uncaptured mappers.
421
+ *
422
+ * The failure arm contributes its requirements to the node's, for the same
423
+ * reason a branch's arms do: it is topology the plan carries, and a run reaches
424
+ * it whenever the protected graph fails.
425
+ *
426
+ * @since 0.1.0
427
+ * @category sequencing
428
+ * @slop
429
+ */
430
+ declare const catch_: {
431
+ <Handled, B, E2, R2>(options: CatchOptions<unknown, B, E2, R2, Handled> & {
432
+ readonly error: Schema.Schema<Handled>;
433
+ }): <A, E, R>(self: Node<A, E, R>) => Node<A | B, E | E2, R | R2>;
434
+ <E, B, E2, R2>(options: CatchOptions<E, B, E2, R2> & {
435
+ readonly error?: undefined;
436
+ }): <A, R>(self: Node<A, E, R>) => Node<A | B, E2, R | R2>;
437
+ <A, E, R, Handled, B, E2, R2>(self: Node<A, E, R>, options: CatchOptions<E, B, E2, R2, Handled> & {
438
+ readonly error: Schema.Schema<Handled>;
439
+ }): Node<A | B, E | E2, R | R2>;
440
+ <A, E, R, B, E2, R2>(self: Node<A, E, R>, options: CatchOptions<E, B, E2, R2> & {
441
+ readonly error?: undefined;
442
+ }): Node<A | B, E2, R | R2>;
443
+ };
444
+ export { catch_ as catch };
445
+ /**
446
+ * Attaches a scheduling priority to a node, leaving the original unchanged.
447
+ *
448
+ * The scheduler runs ready work with a higher number first, so a priority
449
+ * changes LATENCY and nothing else. It never enters key material: a node
450
+ * ordered ahead of another still computes the same result, so re-keying it
451
+ * would throw away a legitimate cache hit. Children inherit the value
452
+ * lexically when the graph is built, and a child that states its own keeps it.
453
+ *
454
+ * @since 0.1.0
455
+ * @category annotations
456
+ * @slop
457
+ */
458
+ export declare const priority: {
459
+ (value: number): <A, E, R>(self: Node<A, E, R>) => Node<A, E, R>;
460
+ <A, E, R>(self: Node<A, E, R>, value: number): Node<A, E, R>;
461
+ };
462
+ /**
463
+ * Reads the scheduling priority a node carries, or `undefined` when it states
464
+ * none and inherits from whatever encloses it.
465
+ *
466
+ * @since 0.1.0
467
+ * @category accessors
468
+ * @slop
469
+ */
470
+ export declare const declaredPriority: (ast: Ast) => number | undefined;
471
+ /**
472
+ * Constructs the flow-call node used by `@smthrs/flow` without making flow
473
+ * calls part of the public authoring surface of this package.
474
+ *
475
+ * Reserved for `@smthrs/flow`, which owns flow authoring. It is not part
476
+ * of this package's authoring surface, and it validates nothing: an unknown
477
+ * flow tag becomes a call node the graph keeps as a leaf.
478
+ *
479
+ * @since 0.1.0
480
+ * @category engine
481
+ * @slop
482
+ */
483
+ export declare const flowCall: <A = unknown, E = never, R = never>(declaration: unknown, flow: string, mode: CallMode, payload: unknown) => Node<A, E, R>;
484
+ /**
485
+ * Constructs the action-call node used by `@smthrs/flow` without making
486
+ * action calls part of the public authoring surface of this package.
487
+ *
488
+ * Reserved for `@smthrs/flow`, which owns action authoring. It is not part
489
+ * of this package's authoring surface, and an unknown action tag becomes a
490
+ * call node the graph keeps as a leaf.
491
+ *
492
+ * @since 0.1.0
493
+ * @category engine
494
+ * @slop
495
+ */
496
+ export declare const actionCall: <A = unknown, E = never, R = never>(declaration: unknown, action: string, payload: unknown) => Node<A, E, R>;
497
+ /**
498
+ * Reads the flow or action declaration a call node names, so `@smthrs/flow`
499
+ * can expand a call it recorded. It is `undefined` for an AST that was
500
+ * rehydrated from JSON, because the declaration lives beside the AST rather
501
+ * than inside it — a graph built from such an AST keeps the call as a leaf.
502
+ *
503
+ * Reserved for `@smthrs/flow`, which files the declaration when it builds
504
+ * the call. Authors never call it.
505
+ *
506
+ * @since 0.1.0
507
+ * @category engine
508
+ * @slop
509
+ */
510
+ export declare const declaration: (ast: Extract<Ast, {
511
+ readonly _tag: "ActionCall" | "FlowCall";
512
+ }>) => unknown;
513
+ /**
514
+ * Reads the continuation builder of a sequenced node, which graph building
515
+ * evaluates once against a placeholder. It is `undefined` when the author
516
+ * supplied a node directly — the topology is already in `next` — and for a
517
+ * rehydrated AST, whose side table did not survive serialization.
518
+ *
519
+ * Reserved for `@smthrs/flow`'s graph walk. Authors never call it.
520
+ *
521
+ * @since 0.1.0
522
+ * @category engine
523
+ * @slop
524
+ */
525
+ export declare const continuation: (ast: Extract<Ast, {
526
+ readonly _tag: "AndThen";
527
+ }>) => ((value: Planned.Planned<unknown>) => unknown) | undefined;
528
+ /**
529
+ * Reads the deferred mapper of a {@link map} node, which a driver applies to
530
+ * the real upstream value once it has one. It is `undefined` for every other
531
+ * variant, and for a rehydrated AST whose side table did not survive
532
+ * serialization.
533
+ *
534
+ * Reserved for `@smthrs/flow`'s interpreter. Authors never call it.
535
+ *
536
+ * @since 0.1.0
537
+ * @category engine
538
+ * @slop
539
+ */
540
+ export declare const mapper: (ast: Ast) => ((value: unknown) => unknown) | undefined;
541
+ /**
542
+ * Reads the run-time predicate of a {@link branch} node, which a driver
543
+ * evaluates on the real subject value to choose an arm. It is `undefined` for
544
+ * every other variant, and for a rehydrated AST whose side table did not
545
+ * survive serialization.
546
+ *
547
+ * Reserved for `@smthrs/flow`'s interpreter. Authors never call it.
548
+ *
549
+ * @since 0.1.0
550
+ * @category engine
551
+ * @slop
552
+ */
553
+ export declare const predicate: (ast: Ast) => ((value: unknown) => boolean) | undefined;
554
+ /**
555
+ * Reads the optional schema selecting failures handled by a {@link catch_}.
556
+ *
557
+ * Reserved for `@smthrs/flow`'s interpreter. It is `undefined` for every
558
+ * variant but `catch_`, and for a rehydrated AST whose side table did not
559
+ * survive serialization.
560
+ *
561
+ * @since 0.1.0
562
+ * @category engine
563
+ * @slop
564
+ */
565
+ export declare const catchFilter: (ast: Ast) => Schema.Top | undefined;
566
+ /**
567
+ * Identifies a plan-time function the AST does NOT store, a flow's `body`,
568
+ * exactly as the AST identifies the mapper and continuation it does store.
569
+ * A call that keeps its callee as a leaf still has to re-key when that
570
+ * callee's body is edited, and this is the identity it folds in. Unannotated
571
+ * functions fail closed with process-local identity; use {@link capture} to
572
+ * declare inert captures and obtain deterministic identity.
573
+ *
574
+ * Reserved for `@smthrs/flow`, which folds a callee body's identity into a
575
+ * call it keeps as a leaf. Authors never call it; it throws a `TypeError`
576
+ * when handed anything but a function.
577
+ *
578
+ * @since 0.1.0
579
+ * @category engine
580
+ * @slop
581
+ */
582
+ export declare const functionIdentity: (operation: unknown) => FunctionIdentity;
583
+ /**
584
+ * Binds a frozen plain copy of inert captures as the callback's this receiver.
585
+ *
586
+ * Use a function expression to read the snapshot while keeping the ordinary
587
+ * callback arguments: Node.capture({ factor: 3 }, function(value: number) {
588
+ * return value * this.factor
589
+ * }). Caller objects remain unchanged; lexical aliases still name originals
590
+ * and must not be used as mutable semantic inputs. Nested captures retain the
591
+ * inner callback's snapshot and compose the two identities.
592
+ *
593
+ * Admission walks original descriptors once, rejects built-in brands and
594
+ * non-plain prototypes without evaluating getters, then uses structuredClone
595
+ * to refuse Proxies. Hosts without that API refuse object capture. Only the
596
+ * owned frozen copy enters identity and the wrapper. Sealed, non-extensible,
597
+ * frozen and Immer ordinary data are supported equally. Unsupported values
598
+ * raise a TypeError naming the path. See core docs/api.md#nodecapture for the
599
+ * complete algorithm and the migration from original-object locking.
600
+ *
601
+ * @category constructors
602
+ * @since 0.1.0
603
+ * @slop
604
+ */
605
+ export declare const capture: <C extends Readonly<Record<string, unknown>>, Args extends ReadonlyArray<unknown>, A>(captures: C, operation: (this: Readonly<C>, ...args: Args) => A) => (...args: Args) => A;
606
+ //# sourceMappingURL=Node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../src/Node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAE1C,OAAO,KAAK,QAAQ,MAAM,o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