@smthrs/plan 1.0.0-rc.12 → 1.0.0-rc.13
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/CHANGELOG.md +4 -0
- package/README.md +3 -3
- package/dist/cjs/Node.d.ts +8 -0
- package/dist/cjs/Node.d.ts.map +1 -1
- package/dist/cjs/Node.js +1 -0
- package/dist/cjs/Node.js.map +2 -2
- package/dist/esm/Node.d.ts +8 -0
- package/dist/esm/Node.d.ts.map +1 -1
- package/dist/esm/Node.js +8 -3
- package/dist/esm/Node.js.map +1 -1
- package/docs/api.md +2 -2
- package/docs/guides/diff-two-plans.md +1 -1
- package/docs/installation.md +1 -1
- package/package.json +8 -8
- package/src/Node.ts +8 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `Node.maximumArmDepth` exposes the existing eager branch construction limit so bounded patterns can reject unsupported declarations before planning. The limit and refusal behavior are unchanged. ([#4103](https://github.com/smithersai/smithers/issues/4103)).
|
|
8
|
+
|
|
5
9
|
### Fixed
|
|
6
10
|
|
|
7
11
|
- `Node.representationIdentity` writes the representation a sealed action's step key hashes as `effect@4.0.0-rc.115` wrote it, with the six built-in check ids `effect@4.0.4` renamed written back. A schema with `Schema.brand` re-keys once, because the brand is no longer part of the AST. ([#3839](https://github.com/smithersai/smithers/issues/3839)).
|
package/README.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Release candidate scope, host requirements and compatibility review are defined in the [library support policy](https://github.com/smithersai/smithers/blob/main/RELEASE_SUPPORT.md).
|
|
4
4
|
|
|
5
|
-
This package declares `effect` as
|
|
6
|
-
`effect` release
|
|
5
|
+
This package declares `effect` as an exact `4.0.5` peer dependency. Install one
|
|
6
|
+
`effect` release at that version so all Smithers packages share one Effect
|
|
7
7
|
runtime.
|
|
8
8
|
|
|
9
9
|
**Documentation:** https://github.com/smithersai/smithers/tree/main/packages/smithers/flows/plan/docs
|
|
@@ -36,7 +36,7 @@ supplies:
|
|
|
36
36
|
pnpm add @effect/platform-node @effect/platform-node-shared
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
Node.js 26.4.0 or later, and `effect`
|
|
39
|
+
Node.js 26.4.0 or later, and `effect` `4.0.5` as a peer. Recording a plan
|
|
40
40
|
is [`@smthrs/plan-store`](https://github.com/smithersai/smithers/tree/main/packages/smithers/flows/plan-store/docs), which owns the SQL
|
|
41
41
|
and brings [`@smthrs/database`](https://github.com/smithersai/smithers/tree/main/packages/smithers/flows/database/docs) with it.
|
|
42
42
|
|
package/dist/cjs/Node.d.ts
CHANGED
|
@@ -388,6 +388,14 @@ export declare const bindPlanned: {
|
|
|
388
388
|
<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>;
|
|
389
389
|
<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>;
|
|
390
390
|
};
|
|
391
|
+
/**
|
|
392
|
+
* Maximum eagerly nested branch arms. Arm construction precedes graph walking;
|
|
393
|
+
* this bound leaves native stack headroom for a typed refusal.
|
|
394
|
+
*
|
|
395
|
+
* @since 1.0.0
|
|
396
|
+
* @category constants
|
|
397
|
+
*/
|
|
398
|
+
export declare const maximumArmDepth = 512;
|
|
391
399
|
/**
|
|
392
400
|
* Decides between two arms, both of them static topology.
|
|
393
401
|
*
|
package/dist/cjs/Node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../src/Node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAA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IAAI,KAAK,CAAC,KACjD,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,CAA0C,CAAA"}
|
package/dist/cjs/Node.js
CHANGED
package/dist/cjs/Node.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Node.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Pure, pipeable nodes: the shape a flow body describes and nothing more.\n *\n * Building a node records an inspectable AST and executes nothing \u2014 the same\n * split as Bazel's `ctx.actions.run`, which declares an action rather than\n * running one. A plan is\n * always a DAG, so there is no loop node here and never will be: repetition\n * lives one level up, in what a flow settles with.\n *\n * A node also carries Effect's requirement channel, `R`, and carries it as a\n * PHANTOM: building a plan demands nothing, and every combinator here unions\n * `R` without ever reading it. What fills the channel is a call to something\n * whose code lives elsewhere \u2014 an action \u2014 so the type of a plan states which\n * implementations executing it will need, and the place that executes it is\n * where the compiler asks for them.\n *\n * Control flow is structure. {@link branch} takes both arms and evaluates each\n * ONCE, symbolically, so the exit condition and the handoff site are visible\n * topology before anything runs; its predicate is digested and runs later on\n * the real value. {@link map} is transformation only. The rule the authoring\n * note states, and this module encodes: **map transforms; branch decides.**\n *\n * Adapted from `@smthrs/core` (`packages/smithers/flows/core`) `Node.ts`.\n * `Dynamic` is gone \u2014 a model call is an ordinary action, and nothing\n * model-shaped belongs in this package \u2014 and node annotations are gone with\n * it, because the AST has to stay JSON serializable.\n *\n * @since 0.1.0\n */\n\nimport { dual } from \"effect/Function\"\nimport type * as Pipeable from \"effect/Pipeable\"\nimport type * as Schema from \"effect/Schema\"\nimport type * as SchemaAST from \"effect/SchemaAST\"\nimport type * as Types from \"effect/Types\"\nimport { GraphBuildError } from \"./GraphBuildError.ts\"\nimport * as internal from \"./internal/node.ts\"\nimport * as internalSchemaIdentity from \"./internal/SchemaIdentity.ts\"\nimport * as Planned from \"./Planned.ts\"\n\n/**\n * The runtime type identifier carried by every node.\n *\n * @since 0.1.0\n * @category type ids\n * @slop\n */\nexport const TypeId: TypeId = internal.TypeId\n\n/**\n * The type-level form of {@link TypeId}.\n *\n * @since 0.1.0\n * @category type ids\n * @slop\n */\nexport type TypeId = \"~@smthrs/plan/Node\"\n\n/**\n * The inspectable AST a node stores: closure-free, and JSON serializable for\n * every JSON payload an author puts in it.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Ast = internal.NodeAst\n\n/**\n * How a flow call joins the caller's plan: `inline` splices the callee's body\n * in, `boundary` makes it one child execution, and `handoff` names the next\n * trampoline round.\n *\n * This is the ONE call-mode vocabulary. {@link flowCall} takes it and\n * `@smthrs/flow`'s graph builder switches on it, so a second spelling in\n * either package would fork the moment one gained a mode.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport const CallMode = internal.CallMode\n\n/**\n * The value form of {@link CallMode}.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type CallMode = internal.CallMode\n\n/**\n * The serializable stand-in an AST keeps for a plan-time function: a digest of\n * its normalized source, hashed in place of a closure that could not be\n * shipped, stored, or compared.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type FunctionIdentity = Extract<Ast, { readonly _tag: \"Map\" }>[\"mapper\"]\n\n/**\n * Reads the inert AST reference created for a planned value.\n *\n * Structural lookalikes remain ordinary payload data. This accessor is the\n * only recognition path because the marker itself is deliberately private to\n * the AST cloner.\n *\n * @since 1.0.0\n * @category accessors\n */\nexport const plannedReference = internal.plannedReference\n\n/**\n * A pure graph-building value, covariant in what it will succeed and fail\n * with and in what it will need to run. It is a description: holding one has\n * run nothing.\n *\n * `R` is Effect's requirement channel, and it is PHANTOM here. Nothing at plan\n * time reads it: the AST, the graph built from it, its key material, and every\n * digest are identical whatever `R` says. It exists so a value that names an\n * implementation it does not carry \u2014 an action call \u2014 can say so in its type,\n * and so the place that finally has to run that implementation can demand it.\n * Building a plan therefore stays requirement-free; only executing one is not.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport interface Node<out A, out E = never, out R = never> extends Pipeable.Pipeable {\n readonly [TypeId]: {\n readonly _A: Types.Covariant<A>\n readonly _E: Types.Covariant<E>\n readonly _R: Types.Covariant<R>\n }\n readonly ast: Ast\n}\n\n/**\n * Any node, whatever it succeeds or fails with and whatever it requires.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Any = Node<unknown, unknown, any>\n\n/**\n * The success type of a node.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Success<N> = N extends Node<infer A, infer _E, infer _R> ? A : never\n\n/**\n * The error type of a node.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Error<N> = N extends Node<infer _A, infer E, infer _R> ? E : never\n\n/**\n * The requirements of a node: what has to be provided wherever it is finally\n * executed, and nothing that has to be provided to build it.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Services<N> = N extends Node<infer _A, infer _E, infer R> ? R : never\n\n/**\n * The node reference a branch arm's symbolic subject carries. Arms are built\n * before the graph assigns ids, so every reference an arm records names this\n * placeholder, and graph building rewrites it to the branch's own upstream\n * node \u2014 which is `first`, structurally, and therefore not a guess.\n *\n * @since 0.1.0\n * @category constants\n * @slop\n */\nexport const branchSubject = \"branch/subject\"\n\n/** @private */\nconst subjectsKey = Symbol.for(\"@smthrs/plan/Node/subjects/v1\")\nconst globals = globalThis as typeof globalThis & { [subjectsKey]?: { branch: number; catch: number } }\nconst subjects = globals[subjectsKey] ??= { branch: 0, catch: 0 }\n\n/**\n * The prefix of the node reference a catch failure arm's symbolic error\n * carries. Each {@link catch_} mints its own token under this prefix, so an\n * outer error captured inside a nested failure arm keeps naming the outer\n * catch, and graph building rewrites each token to the node that catch\n * protects.\n *\n * @since 0.1.0\n * @category constants\n * @slop\n */\nexport const catchSubject = \"catch/subject\"\n\n/**\n * The two arms of a decision plus the predicate that chooses between them.\n *\n * `if` runs at RUN time on the real value. `then` and `else` run at PLAN time,\n * once each, against a {@link module:Planned.Planned} placeholder \u2014 they\n * describe topology, so they may pass the value on but never compute on it.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport interface BranchOptions<A, B1, E1, R1, B2, E2, R2> {\n readonly if: (value: A) => boolean\n readonly then: (value: Planned.Planned<A>) => Node<B1, E1, R1>\n readonly else: (value: Planned.Planned<A>) => Node<B2, E2, R2>\n}\n\n/**\n * The statically planned recovery arm and optional schema selecting which\n * typed failures it handles.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport interface CatchOptions<E, B, E2, R2 = never, Handled = E> {\n readonly error?: Schema.Schema<Handled> | undefined\n readonly onFailure: (error: Planned.Planned<Handled>) => Node<B, E2, R2>\n}\n\n/**\n * Checks whether a value is a node.\n *\n * A node this package built is recognized by registration at construction. A\n * node that crossed a serialization boundary, an object sharing the node\n * prototype whose own `ast` is a well-formed AST, is recognized by that shape,\n * because `@smthrs/flow` hands a rehydrated AST back as a node and its side\n * tables are all a round trip loses. The {@link TypeId} marker is a public\n * string any object can carry, so it counts for nothing on its own: every\n * combinator that admits a node reads its `ast` as trusted topology, and an\n * object carrying the marker on any other prototype, one inheriting it from a\n * node, and one whose `ast` is missing, malformed, cyclic, or an accessor are\n * all refused with the same `GraphBuildError` as any other non-node. A proxy\n * is judged by the shape it forwards: one that forwards a node unchanged\n * passes, and one that diverges from it does not.\n *\n * @since 0.1.0\n * @category guards\n * @slop\n */\nexport const isNode = (value: unknown): value is Any => internal.isNode(value)\n\n/**\n * The inert value delivered by {@link succeed}. Planned references resolve to\n * their result type; other values follow the payload's JSON projection.\n * Invalid dates serialize to null. Members without a JSON representation are\n * omitted from objects and replaced with null in arrays.\n *\n * @since 1.0.0\n * @category models\n */\nexport type Succeed<A> = A extends Planned.Planned<infer Value> ? Value\n : A extends Date ? string | null\n : A extends { toJSON: (...args: any) => infer Value } ? Succeed<Value>\n : A extends (...args: any) => any ? undefined\n : A extends symbol ? undefined\n : A extends ReadonlyArray<unknown> ? { [K in keyof A]: SucceedArrayMember<A[K]> }\n : A extends object ? {\n [K in keyof A as K extends string | number ? [Succeed<A[K]>] extends [undefined] ? never : K : never]: Succeed<\n A[K]\n >\n }\n : A\n\n/** @private */\ntype SucceedArrayMember<A> = A extends Planned.Planned<infer Value> ? Value\n : A extends unknown ? Succeed<A> extends infer Value ? Value extends undefined ? null : Value\n : never\n : never\n\n/**\n * A node that succeeds with the constant's inert JSON projection.\n *\n * Dates produce strings (or null for invalid dates), URLs produce strings,\n * and callable object members are omitted. Use {@link map} to reconstruct a\n * domain value explicitly after this serialization boundary.\n *\n * @since 0.1.0\n * @category constructors\n */\nexport const succeed = <A>(value: A): Node<Succeed<A>> => internal.makeNode<Succeed<A>>(internal.succeed(value))\n\n/**\n * The inert error delivered by {@link fail}: the same JSON projection\n * {@link Succeed} describes, because a plan stores an error exactly as it\n * stores a value.\n *\n * @since 1.0.0\n * @category models\n */\nexport type Fail<E> = Succeed<E>\n\n/**\n * A node that fails with the constant's inert JSON projection, in the typed\n * error channel.\n *\n * It is how a plan states a refusal it already knows about \u2014 an unsupported\n * input, an exhausted budget, a compensation that has nothing left to undo \u2014\n * without an action that exists only to fail. {@link catch} recovers it exactly\n * as it recovers an action's failure, and an uncaught one is the flow's typed\n * failure.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const fail = <E>(error: E): Node<never, Fail<E>> => internal.makeNode<never, Fail<E>>(internal.fail(error))\n\n/**\n * Combines independent children into one node, keyed by name.\n *\n * Width is fixed here, at plan time. Fanning out over something a step\n * discovered is not this: end the round and carry the list in the next flow's\n * payload, where it is real data.\n *\n * @since 0.1.0\n * @category constructors\n * @slop\n */\nexport const all = <const Nodes extends Readonly<Record<string, Any>>>(\n nodes: Nodes\n): Node<\n Types.Simplify<{ readonly [K in keyof Nodes]: Success<Nodes[K]> }>,\n Error<Nodes[keyof Nodes]>,\n Services<Nodes[keyof Nodes]>\n> => internal.makeNode(internal.all(memberAsts(nodes, \"all\", \"invalid_all_member\")))\n\n/**\n * The member ASTs of a combination, keyed by name, refusing a non-node member.\n *\n * @private\n */\nconst memberAsts = (\n nodes: Readonly<Record<string, unknown>>,\n combinator: string,\n code: \"invalid_all_member\" | \"invalid_join\"\n): Record<string, Ast> => {\n const asts: Record<string, Ast> = Object.create(null) as Record<string, Ast>\n for (const [member, node] of Object.entries(nodes)) {\n if (!isNode(node)) {\n throw new GraphBuildError({\n code,\n node: member,\n path: [],\n message: `Node.${combinator} expected a Node at member \"${member}\"`\n })\n }\n Object.defineProperty(asts, member, {\n configurable: true,\n enumerable: true,\n value: node.ast,\n writable: true\n })\n }\n return asts\n}\n\n/**\n * Builds a join that settles early, refusing a member set it could never\n * decide on.\n *\n * @private\n */\nconst join = (mode: internal.RaceMode, count: number, nodes: Readonly<Record<string, unknown>>): Ast => {\n const asts = memberAsts(nodes, mode, \"invalid_join\")\n const width = Object.keys(asts).length\n if (!internal.isRaceCount(mode, count, width)) {\n throw new GraphBuildError({\n code: \"invalid_join\",\n node: mode,\n path: [],\n message: mode === \"quorum\"\n ? `Node.quorum needs a whole number of successes between 1 and its ${width} members, got ${String(count)}`\n : `Node.${mode} needs at least one member`\n })\n }\n return internal.race(mode, count, asts)\n}\n\n/**\n * The members of an early-settling join, keyed by name.\n *\n * @since 1.0.0\n * @category models\n */\nexport type Members = Readonly<Record<string, Any>>\n\n/**\n * Settles with the first member to settle, success or typed failure.\n *\n * The other members are interrupted. The winner is journaled, so a resumed run\n * settles the same member and never starts the others again.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const race = <const Nodes extends Members>(\n nodes: Nodes\n): Node<Success<Nodes[keyof Nodes]>, Error<Nodes[keyof Nodes]>, Services<Nodes[keyof Nodes]>> =>\n internal.makeNode(join(\"race\", 1, nodes))\n\n/**\n * Settles with the first member to succeed, ignoring typed failures while a\n * member is still running.\n *\n * It fails with the last failure when every member fails. The other members\n * are interrupted, and the winner is journaled as {@link race} journals it.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const any = <const Nodes extends Members>(\n nodes: Nodes\n): Node<Success<Nodes[keyof Nodes]>, Error<Nodes[keyof Nodes]>, Services<Nodes[keyof Nodes]>> =>\n internal.makeNode(join(\"any\", 1, nodes))\n\n/**\n * Succeeds once `count` members succeed, with exactly those members' values\n * keyed by name.\n *\n * It fails with the failure that leaves fewer than `count` members able to\n * succeed. Either way the members still running are interrupted, and the\n * members that decided are journaled as {@link race} journals its winner.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const quorum = <const Nodes extends Members>(\n count: number,\n nodes: Nodes\n): Node<\n Types.Simplify<{ readonly [K in keyof Nodes]?: Success<Nodes[K]> }>,\n Error<Nodes[keyof Nodes]>,\n Services<Nodes[keyof Nodes]>\n> => internal.makeNode(join(\"quorum\", count, nodes))\n\n/**\n * Transforms an eventual success value with a deferred pure function.\n *\n * The function is digested, not run: it executes later, on the real value.\n * This is where computation on a step result belongs \u2014 and only computation. A\n * `map` that decides what happens next is a `branch` written wrongly.\n *\n * @since 0.1.0\n * @category mapping\n * @slop\n */\nexport const map: {\n <A, B>(f: (a: A) => B): <E, R>(self: Node<A, E, R>) => Node<B, E, R>\n <A, E, R, B>(self: Node<A, E, R>, f: (a: A) => B): Node<B, E, R>\n} = dual(\n 2,\n <A, E, R, B>(self: Node<A, E, R>, f: (a: A) => B): Node<B, E, R> =>\n internal.makeNode<B, E, R>(internal.map(self.ast, (value) => f(value as A), f))\n)\n\n/**\n * Starts the entire next subtree only after this node succeeds, without\n * consuming its result. Failure or interruption prevents that subtree from\n * starting, including actions nested inside combinations or inline flows.\n *\n * Use {@link bindPlanned} to build a dependency from a symbolic result, or\n * {@link map} to compute on the eventual value.\n *\n * @since 0.1.0\n * @category sequencing\n * @slop\n */\nexport const andThen: {\n <B, E2, R2>(next: Node<B, E2, R2>): <A, E, R>(self: Node<A, E, R>) => Node<B, E | E2, R | R2>\n <A, E, R, B, E2, R2>(self: Node<A, E, R>, next: Node<B, E2, R2>): Node<B, E | E2, R | R2>\n} = dual(\n 2,\n <A, E, R, B, E2, R2>(\n self: Node<A, E, R>,\n next: Node<B, E2, R2>\n ): Node<B, E | E2, R | R2> => {\n if (!isNode(next)) {\n throw new GraphBuildError({\n code: \"invalid_continuation\",\n node: \"andThen/next\",\n path: [],\n message:\n \"Node.andThen expects a Node; use Node.bindPlanned for a symbolic builder or Node.map for value computation\"\n })\n }\n return internal.makeNode<B, E | E2, R | R2>(internal.andThenNode(self.ast, next.ast))\n }\n)\n\n/**\n * Builds a dependency using a symbolic reference to this node's future result.\n *\n * The builder runs during planning. Its argument is a {@link module:Planned.Planned}\n * reference, not the value the node will eventually produce. Pass references\n * into action payloads; use {@link branch} for decisions and {@link map} for\n * computation on real results. JavaScript truthiness and reference equality\n * cannot inspect a planned result. Enable type-aware ESLint's\n * `@typescript-eslint/strict-boolean-expressions` to reject planned conditions.\n * Independent descendants of the built subtree can start while this producer\n * is running; consumers of its reference wait for its value. Use\n * {@link andThen} when the whole next subtree must wait for success.\n *\n * @since 1.0.0\n * @category sequencing\n */\nexport const bindPlanned: {\n <A, B, E2, R2>(\n build: (reference: Planned.Planned<A>) => Node<B, E2, R2>\n ): <E, R>(self: Node<A, E, R>) => Node<B, E | E2, R | R2>\n <A, E, R, B, E2, R2>(\n self: Node<A, E, R>,\n build: (reference: Planned.Planned<A>) => Node<B, E2, R2>\n ): Node<B, E | E2, R | R2>\n} = dual(\n 2,\n <A, E, R, B, E2, R2>(\n self: Node<A, E, R>,\n build: (reference: Planned.Planned<A>) => Node<B, E2, R2>\n ): Node<B, E | E2, R | R2> =>\n internal.makeNode<B, E | E2, R | R2>(\n internal.andThen(self.ast, (value) => build(value as Planned.Planned<A>), build)\n )\n)\n\n// Arm builders run before the graph walker can enforce its topology bound.\n// Leave native stack headroom to construct the typed refusal and unwind.\nconst maximumArmDepth = 512\nlet armDepth = 0\n\n/**\n * Builds one arm, once, against the symbolic subject.\n *\n * @private\n */\nconst arm = <A, B, E, R>(\n build: (value: Planned.Planned<A>) => Node<B, E, R>,\n subject: Planned.Planned<A>,\n side: string\n): Ast => {\n if (armDepth >= maximumArmDepth) {\n throw new GraphBuildError({\n code: \"graph_too_deep\",\n node: `${branchSubject}/${side}`,\n path: [],\n message: \"Node.branch recursion needs a plan-time bound, such as a payload-derived round count. \" +\n \"Both arms are built before the run-time predicate is evaluated.\"\n })\n }\n armDepth++\n try {\n const node = build(subject)\n if (!isNode(node)) {\n throw new GraphBuildError({\n code: \"invalid_continuation\",\n node: `${branchSubject}/${side}`,\n path: [],\n message: `Node.branch expected its \"${side}\" arm to return a Node`\n })\n }\n return node.ast\n } finally {\n armDepth--\n }\n}\n\n/**\n * Decides between two arms, both of them static topology.\n *\n * Each arm builder is evaluated exactly once, here, against a\n * {@link module:Planned.Planned} placeholder, and the resulting ASTs are what\n * the node stores \u2014 so a plan shows the exit condition and both continuations\n * before it runs. The predicate is digested and evaluated at run time on the\n * real value, which is why none of the plan-time placeholder machinery leaks\n * into control flow.\n *\n * Both arms contribute their requirements, because both arms are topology the\n * plan carries. A run takes one of them, but which one is not known until the\n * predicate sees the real value, so an execution has to be able to take either.\n *\n * @since 0.1.0\n * @category sequencing\n * @slop\n */\nexport const branch: {\n <A, B1, E1, R1, B2, E2, R2>(\n options: BranchOptions<A, B1, E1, R1, B2, E2, R2>\n ): <E, R>(self: Node<A, E, R>) => Node<B1 | B2, E | E1 | E2, R | R1 | R2>\n <A, E, R, B1, E1, R1, B2, E2, R2>(\n self: Node<A, E, R>,\n options: BranchOptions<A, B1, E1, R1, B2, E2, R2>\n ): Node<B1 | B2, E | E1 | E2, R | R1 | R2>\n} = dual(\n 2,\n <A, E, R, B1, E1, R1, B2, E2, R2>(\n self: Node<A, E, R>,\n options: BranchOptions<A, B1, E1, R1, B2, E2, R2>\n ): Node<B1 | B2, E | E1 | E2, R | R1 | R2> => {\n const predicate = options.if\n const subjectToken = `${branchSubject}/${subjects.branch++}`\n const subject = Planned.make<A>(subjectToken)\n return internal.makeNode<B1 | B2, E | E1 | E2, R | R1 | R2>(\n internal.branch(\n subjectToken,\n self.ast,\n (value) => predicate(value as A),\n predicate,\n arm(options.then, subject, \"then\"),\n arm(options.else, subject, \"else\")\n )\n )\n }\n)\n\n/**\n * Recovers from matching typed failures with static failure topology.\n *\n * The protected graph and failure arm are both stored in the AST. The arm is\n * built once at plan time against a strict planned error placeholder. With no\n * schema the whole typed error channel is handled. A schema handles only the\n * values it accepts, so its overloads retain E: a refinement can reject values\n * without narrowing its TypeScript type. Runtime schema callbacks enter the\n * filter identity along with its JSON Schema. Uncaptured callbacks are local\n * to this process, just like uncaptured mappers.\n *\n * The failure arm contributes its requirements to the node's, for the same\n * reason a branch's arms do: it is topology the plan carries, and a run reaches\n * it whenever the protected graph fails.\n *\n * @since 0.1.0\n * @category sequencing\n * @slop\n */\nconst catch_: {\n <Handled, B, E2, R2>(\n options: CatchOptions<unknown, B, E2, R2, Handled> & {\n readonly error: Schema.Schema<Handled>\n }\n ): <A, E, R>(self: Node<A, E, R>) => Node<A | B, E | E2, R | R2>\n <E, B, E2, R2>(\n options: CatchOptions<E, B, E2, R2> & {\n readonly error?: undefined\n }\n ): <A, R>(self: Node<A, E, R>) => Node<A | B, E2, R | R2>\n <A, E, R, Handled, B, E2, R2>(\n self: Node<A, E, R>,\n options: CatchOptions<E, B, E2, R2, Handled> & {\n readonly error: Schema.Schema<Handled>\n }\n ): Node<A | B, E | E2, R | R2>\n <A, E, R, B, E2, R2>(\n self: Node<A, E, R>,\n options: CatchOptions<E, B, E2, R2> & {\n readonly error?: undefined\n }\n ): Node<A | B, E2, R | R2>\n} = dual(\n 2,\n <A, E, R, Handled, B, E2, R2>(\n self: Node<A, E, R>,\n options: CatchOptions<E, B, E2, R2, Handled>\n ): Node<A | B, E | E2, R | R2> => {\n const subjectToken = `${catchSubject}/${subjects.catch++}`\n const failure = options.onFailure(Planned.make<Handled>(subjectToken))\n if (!isNode(failure)) {\n throw new GraphBuildError({\n code: \"invalid_continuation\",\n node: catchSubject,\n path: [],\n message: \"Node.catch expected its failure arm to return a Node\"\n })\n }\n return internal.makeNode(internal.catch_(subjectToken, self.ast, failure.ast, options.error))\n }\n)\n\nexport { catch_ as catch }\n\n/**\n * Attaches a scheduling priority to a node, leaving the original unchanged.\n *\n * The scheduler runs ready work with a higher number first, so a priority\n * changes LATENCY and nothing else. It never enters key material: a node\n * ordered ahead of another still computes the same result, so re-keying it\n * would throw away a legitimate cache hit. Children inherit the value\n * lexically when the graph is built, and a child that states its own keeps it.\n *\n * @since 0.1.0\n * @category annotations\n * @slop\n */\nexport const priority: {\n (value: number): <A, E, R>(self: Node<A, E, R>) => Node<A, E, R>\n <A, E, R>(self: Node<A, E, R>, value: number): Node<A, E, R>\n} = dual(\n 2,\n <A, E, R>(self: Node<A, E, R>, value: number): Node<A, E, R> => {\n if (!Number.isSafeInteger(value)) {\n throw new GraphBuildError({\n code: \"invalid_priority\",\n node: self.ast._tag,\n path: [],\n message: `Node.priority expects a safe integer, received ${value}`\n })\n }\n return internal.makeNode<A, E, R>(internal.withPriority(self.ast, value))\n }\n)\n\n/**\n * Reads the scheduling priority a node carries, or `undefined` when it states\n * none and inherits from whatever encloses it.\n *\n * @since 0.1.0\n * @category accessors\n * @slop\n */\nexport const declaredPriority = (ast: Ast): number | undefined => ast.priority\n\n/**\n * Constructs the flow-call node used by `@smthrs/flow` without making flow\n * calls part of the public authoring surface of this package.\n *\n * Reserved for `@smthrs/flow`, which owns flow authoring. It is not part\n * of this package's authoring surface, and it validates nothing: an unknown\n * flow tag becomes a call node the graph keeps as a leaf.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const flowCall = <A = unknown, E = never, R = never>(\n declaration: unknown,\n flow: string,\n mode: CallMode,\n payload: unknown\n): Node<A, E, R> => internal.makeNode<A, E, R>(internal.flowCall(declaration, flow, mode, payload))\n\n/**\n * Constructs the action-call node used by `@smthrs/flow` without making\n * action calls part of the public authoring surface of this package.\n *\n * Reserved for `@smthrs/flow`, which owns action authoring. It is not part\n * of this package's authoring surface, and an unknown action tag becomes a\n * call node the graph keeps as a leaf.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const actionCall = <A = unknown, E = never, R = never>(\n declaration: unknown,\n action: string,\n payload: unknown\n): Node<A, E, R> => internal.makeNode<A, E, R>(internal.actionCall(declaration, action, payload))\n\n/**\n * Reads the flow or action declaration a call node names, so `@smthrs/flow`\n * can expand a call it recorded. It is `undefined` for an AST that was\n * rehydrated from JSON, because the declaration lives beside the AST rather\n * than inside it \u2014 a graph built from such an AST keeps the call as a leaf.\n *\n * Reserved for `@smthrs/flow`, which files the declaration when it builds\n * the call. Authors never call it.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const declaration = (\n ast: Extract<Ast, { readonly _tag: \"ActionCall\" | \"FlowCall\" }>\n): unknown => internal.declaration(ast)\n\n/**\n * Reads the continuation builder of a sequenced node, which graph building\n * evaluates once against a placeholder. It is `undefined` when the author\n * supplied a node directly \u2014 the topology is already in `next` \u2014 and for a\n * rehydrated AST, whose side table did not survive serialization.\n *\n * Reserved for `@smthrs/flow`'s graph walk. Authors never call it.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const continuation = (\n ast: Extract<Ast, { readonly _tag: \"AndThen\" }>\n): ((value: Planned.Planned<unknown>) => unknown) | undefined => internal.operation(ast)\n\n/**\n * Reads the deferred mapper of a {@link map} node, which a driver applies to\n * the real upstream value once it has one. It is `undefined` for every other\n * variant, and for a rehydrated AST whose side table did not survive\n * serialization.\n *\n * Reserved for `@smthrs/flow`'s interpreter. Authors never call it.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const mapper = (ast: Ast): ((value: unknown) => unknown) | undefined =>\n ast._tag === \"Map\" ? internal.operation(ast) : undefined\n\n/**\n * Reads the run-time predicate of a {@link branch} node, which a driver\n * evaluates on the real subject value to choose an arm. It is `undefined` for\n * every other variant, and for a rehydrated AST whose side table did not\n * survive serialization.\n *\n * Reserved for `@smthrs/flow`'s interpreter. Authors never call it.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const predicate = (ast: Ast): ((value: unknown) => boolean) | undefined =>\n ast._tag === \"Branch\" ? internal.predicate(ast) : undefined\n\n/**\n * Reads the optional schema selecting failures handled by a {@link catch_}.\n *\n * Reserved for `@smthrs/flow`'s interpreter. It is `undefined` for every\n * variant but `catch_`, and for a rehydrated AST whose side table did not\n * survive serialization.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const catchFilter = (ast: Ast): Schema.Top | undefined => ast._tag === \"Catch\" ? internal.filter(ast) : undefined\n\n/**\n * Identifies a plan-time function the AST does NOT store, a flow's `body`,\n * exactly as the AST identifies the mapper and continuation it does store.\n * A call that keeps its callee as a leaf still has to re-key when that\n * callee's body is edited, and this is the identity it folds in. Unannotated\n * functions fail closed with process-local identity; use {@link capture} to\n * declare inert captures and obtain deterministic identity.\n *\n * Reserved for `@smthrs/flow`, which folds a callee body's identity into a\n * call it keeps as a leaf. Authors never call it; it throws a `TypeError`\n * when handed anything but a function.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const functionIdentity = (operation: unknown): FunctionIdentity => internal.functionIdentity(operation)\n\n/**\n * The document a schema's identity is: JSON-Schema-shaped, and the same bytes\n * under every `effect` release this package supports.\n *\n * @since 1.0.0\n * @category engine\n */\nexport type SchemaIdentity = internalSchemaIdentity.Document\n\n/**\n * The one option a schema's identity is taken under: whether an object closes\n * over the keys it declares (`\"error\"`) or leaves others open (`\"ignore\"`,\n * the default). It has the meaning it has in `Schema.toJsonSchemaDocument`.\n *\n * @since 1.0.0\n * @category engine\n */\nexport type SchemaIdentityOptions = internalSchemaIdentity.Options\n\n/**\n * The refusal `schemaIdentity` and `representationIdentity` raise for a schema\n * a step key cannot be derived from. Its message is the one\n * `effect@4.0.0-rc.115` gave for the same schema, where it gave one.\n *\n * @since 1.0.0\n * @category errors\n */\nexport const SchemaIdentityError = internalSchemaIdentity.SchemaIdentityError\n\n/**\n * The type of {@link SchemaIdentityError}.\n *\n * @since 1.0.0\n * @category errors\n */\nexport type SchemaIdentityError = internalSchemaIdentity.SchemaIdentityError\n\n/**\n * Identifies a schema by the constraints it documents, so a call re-keys when\n * what its callee accepts or produces changes, and a catch re-keys when its\n * filter does.\n *\n * The document is what `Schema.toJsonSchemaDocument(schema, options)`\n * returned under `effect@4.0.0-rc.115`. It is printed by this package, not by\n * the installed `effect`, because a later release prints a different document\n * for the same schema and a moved identity re-keys every recorded step. Use\n * it wherever the document is hashed, compared or pinned; a JSON Schema shown\n * to a model or a person comes from `Schema.toJsonSchemaDocument`.\n *\n * Reserved for the packages that derive identities. Authors never call it; it\n * throws for a schema that has no JSON Schema form.\n *\n * @since 1.0.0\n * @category engine\n */\nexport const schemaIdentity = (schema: Schema.Top, options?: SchemaIdentityOptions): SchemaIdentity =>\n internalSchemaIdentity.schemaIdentity(schema, options)\n\n/**\n * Identifies a schema AST by its encoded representation, the material a\n * sealed action's step key folds in for its success and error schemas.\n *\n * The value is what `SchemaRepresentation.toJson(SchemaRepresentation.toRepresentation(ast))`\n * returned under `effect@4.0.0-rc.115`, so a later `effect` release does not\n * re-key recorded steps. The one exception is `Schema.brand`: from\n * `effect@4.0.4` on a brand is not part of the AST, so a declaration with a\n * brand re-keys once.\n *\n * Reserved for the packages that derive step keys. Authors never call it; it\n * throws for an AST that has no representation.\n *\n * @since 1.0.0\n * @category engine\n */\nexport const representationIdentity = (ast: SchemaAST.AST): Schema.Json =>\n internalSchemaIdentity.representationIdentity(ast)\n\n/**\n * Binds a frozen plain copy of inert captures as the callback's this receiver.\n *\n * Use a function expression to read the snapshot while keeping the ordinary\n * callback arguments: Node.capture({ factor: 3 }, function(value: number) {\n * return value * this.factor\n * }). Caller objects remain unchanged; lexical aliases still name originals\n * and must not be used as mutable semantic inputs. Nested captures retain the\n * inner callback's snapshot and compose the two identities.\n *\n * Admission walks original descriptors once, rejects built-in brands and\n * non-plain prototypes without evaluating getters, then uses structuredClone\n * to refuse Proxies. Hosts without that API refuse object capture. Only the\n * owned frozen copy enters identity and the wrapper. Sealed, non-extensible,\n * frozen and Immer ordinary data are supported equally. Unsupported values\n * raise a TypeError naming the path. See core docs/api.md#nodecapture for the\n * complete algorithm and the migration from original-object locking.\n *\n * @category constructors\n * @since 0.1.0\n * @slop\n */\nexport const capture = <C extends Readonly<Record<string, unknown>>, Args extends ReadonlyArray<unknown>, A>(\n captures: C,\n operation: (this: Readonly<C>, ...args: Args) => A\n): (...args: Args) => A => internal.capture(captures, operation)\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BA,sBAAqB;AAKrB,6BAAgC;AAChC,eAA0B;AAC1B,6BAAwC;AACxC,cAAyB;AASlB,MAAM,SAAiB,SAAS;AAkChC,MAAM,WAAW,SAAS;AAgC1B,MAAM,mBAAmB,SAAS;AA0ElC,MAAM,gBAAgB;AAG7B,MAAM,cAAc,uBAAO,IAAI,+BAA+B;AAC9D,MAAM,UAAU;AAChB,MAAM,WAAW,QAAQ,WAAW,MAAM,EAAE,QAAQ,GAAG,OAAO,EAAE;AAazD,MAAM,eAAe;AAoDrB,MAAM,SAAS,CAAC,UAAiC,SAAS,OAAO,KAAK;AAwCtE,MAAM,UAAU,CAAI,UAA+B,SAAS,SAAqB,SAAS,QAAQ,KAAK,CAAC;AAyBxG,MAAM,OAAO,CAAI,UAAmC,SAAS,SAAyB,SAAS,KAAK,KAAK,CAAC;AAa1G,MAAM,MAAM,CACjB,UAKG,SAAS,SAAS,SAAS,IAAI,WAAW,OAAO,OAAO,oBAAoB,CAAC,CAAC;AAOnF,MAAM,aAAa,CACjB,OACA,YACA,SACwB;AACxB,QAAM,OAA4B,uBAAO,OAAO,IAAI;AACpD,aAAW,C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CACE,MACA,SAC4B;AAC5B,QAAI,CAAC,OAAO,IAAI,GAAG;AACjB,YAAM,IAAI,uCAAgB;AAAA,QACxB,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM,CAAC;AAAA,QACP,SACE;AAAA,MACJ,CAAC;AAAA,IACH;AACA,WAAO,SAAS,SAA4B,SAAS,YAAY,KAAK,KAAK,KAAK,GAAG,CAAC;AAAA,EACtF;AACF;AAkBO,MAAM,kBAQT;AAAA,EACF;AAAA,EACA,CACE,MACA,UAEA,SAAS;AAAA,IACP,SAAS,QAAQ,KAAK,KAAK,CAAC,UAAU,MAAM,KAA2B,GAAG,KAAK;AAAA,EACjF;AACJ;
|
|
4
|
+
"sourcesContent": ["/**\n * Pure, pipeable nodes: the shape a flow body describes and nothing more.\n *\n * Building a node records an inspectable AST and executes nothing \u2014 the same\n * split as Bazel's `ctx.actions.run`, which declares an action rather than\n * running one. A plan is\n * always a DAG, so there is no loop node here and never will be: repetition\n * lives one level up, in what a flow settles with.\n *\n * A node also carries Effect's requirement channel, `R`, and carries it as a\n * PHANTOM: building a plan demands nothing, and every combinator here unions\n * `R` without ever reading it. What fills the channel is a call to something\n * whose code lives elsewhere \u2014 an action \u2014 so the type of a plan states which\n * implementations executing it will need, and the place that executes it is\n * where the compiler asks for them.\n *\n * Control flow is structure. {@link branch} takes both arms and evaluates each\n * ONCE, symbolically, so the exit condition and the handoff site are visible\n * topology before anything runs; its predicate is digested and runs later on\n * the real value. {@link map} is transformation only. The rule the authoring\n * note states, and this module encodes: **map transforms; branch decides.**\n *\n * Adapted from `@smthrs/core` (`packages/smithers/flows/core`) `Node.ts`.\n * `Dynamic` is gone \u2014 a model call is an ordinary action, and nothing\n * model-shaped belongs in this package \u2014 and node annotations are gone with\n * it, because the AST has to stay JSON serializable.\n *\n * @since 0.1.0\n */\n\nimport { dual } from \"effect/Function\"\nimport type * as Pipeable from \"effect/Pipeable\"\nimport type * as Schema from \"effect/Schema\"\nimport type * as SchemaAST from \"effect/SchemaAST\"\nimport type * as Types from \"effect/Types\"\nimport { GraphBuildError } from \"./GraphBuildError.ts\"\nimport * as internal from \"./internal/node.ts\"\nimport * as internalSchemaIdentity from \"./internal/SchemaIdentity.ts\"\nimport * as Planned from \"./Planned.ts\"\n\n/**\n * The runtime type identifier carried by every node.\n *\n * @since 0.1.0\n * @category type ids\n * @slop\n */\nexport const TypeId: TypeId = internal.TypeId\n\n/**\n * The type-level form of {@link TypeId}.\n *\n * @since 0.1.0\n * @category type ids\n * @slop\n */\nexport type TypeId = \"~@smthrs/plan/Node\"\n\n/**\n * The inspectable AST a node stores: closure-free, and JSON serializable for\n * every JSON payload an author puts in it.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Ast = internal.NodeAst\n\n/**\n * How a flow call joins the caller's plan: `inline` splices the callee's body\n * in, `boundary` makes it one child execution, and `handoff` names the next\n * trampoline round.\n *\n * This is the ONE call-mode vocabulary. {@link flowCall} takes it and\n * `@smthrs/flow`'s graph builder switches on it, so a second spelling in\n * either package would fork the moment one gained a mode.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport const CallMode = internal.CallMode\n\n/**\n * The value form of {@link CallMode}.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type CallMode = internal.CallMode\n\n/**\n * The serializable stand-in an AST keeps for a plan-time function: a digest of\n * its normalized source, hashed in place of a closure that could not be\n * shipped, stored, or compared.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type FunctionIdentity = Extract<Ast, { readonly _tag: \"Map\" }>[\"mapper\"]\n\n/**\n * Reads the inert AST reference created for a planned value.\n *\n * Structural lookalikes remain ordinary payload data. This accessor is the\n * only recognition path because the marker itself is deliberately private to\n * the AST cloner.\n *\n * @since 1.0.0\n * @category accessors\n */\nexport const plannedReference = internal.plannedReference\n\n/**\n * A pure graph-building value, covariant in what it will succeed and fail\n * with and in what it will need to run. It is a description: holding one has\n * run nothing.\n *\n * `R` is Effect's requirement channel, and it is PHANTOM here. Nothing at plan\n * time reads it: the AST, the graph built from it, its key material, and every\n * digest are identical whatever `R` says. It exists so a value that names an\n * implementation it does not carry \u2014 an action call \u2014 can say so in its type,\n * and so the place that finally has to run that implementation can demand it.\n * Building a plan therefore stays requirement-free; only executing one is not.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport interface Node<out A, out E = never, out R = never> extends Pipeable.Pipeable {\n readonly [TypeId]: {\n readonly _A: Types.Covariant<A>\n readonly _E: Types.Covariant<E>\n readonly _R: Types.Covariant<R>\n }\n readonly ast: Ast\n}\n\n/**\n * Any node, whatever it succeeds or fails with and whatever it requires.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Any = Node<unknown, unknown, any>\n\n/**\n * The success type of a node.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Success<N> = N extends Node<infer A, infer _E, infer _R> ? A : never\n\n/**\n * The error type of a node.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Error<N> = N extends Node<infer _A, infer E, infer _R> ? E : never\n\n/**\n * The requirements of a node: what has to be provided wherever it is finally\n * executed, and nothing that has to be provided to build it.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Services<N> = N extends Node<infer _A, infer _E, infer R> ? R : never\n\n/**\n * The node reference a branch arm's symbolic subject carries. Arms are built\n * before the graph assigns ids, so every reference an arm records names this\n * placeholder, and graph building rewrites it to the branch's own upstream\n * node \u2014 which is `first`, structurally, and therefore not a guess.\n *\n * @since 0.1.0\n * @category constants\n * @slop\n */\nexport const branchSubject = \"branch/subject\"\n\n/** @private */\nconst subjectsKey = Symbol.for(\"@smthrs/plan/Node/subjects/v1\")\nconst globals = globalThis as typeof globalThis & { [subjectsKey]?: { branch: number; catch: number } }\nconst subjects = globals[subjectsKey] ??= { branch: 0, catch: 0 }\n\n/**\n * The prefix of the node reference a catch failure arm's symbolic error\n * carries. Each {@link catch_} mints its own token under this prefix, so an\n * outer error captured inside a nested failure arm keeps naming the outer\n * catch, and graph building rewrites each token to the node that catch\n * protects.\n *\n * @since 0.1.0\n * @category constants\n * @slop\n */\nexport const catchSubject = \"catch/subject\"\n\n/**\n * The two arms of a decision plus the predicate that chooses between them.\n *\n * `if` runs at RUN time on the real value. `then` and `else` run at PLAN time,\n * once each, against a {@link module:Planned.Planned} placeholder \u2014 they\n * describe topology, so they may pass the value on but never compute on it.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport interface BranchOptions<A, B1, E1, R1, B2, E2, R2> {\n readonly if: (value: A) => boolean\n readonly then: (value: Planned.Planned<A>) => Node<B1, E1, R1>\n readonly else: (value: Planned.Planned<A>) => Node<B2, E2, R2>\n}\n\n/**\n * The statically planned recovery arm and optional schema selecting which\n * typed failures it handles.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport interface CatchOptions<E, B, E2, R2 = never, Handled = E> {\n readonly error?: Schema.Schema<Handled> | undefined\n readonly onFailure: (error: Planned.Planned<Handled>) => Node<B, E2, R2>\n}\n\n/**\n * Checks whether a value is a node.\n *\n * A node this package built is recognized by registration at construction. A\n * node that crossed a serialization boundary, an object sharing the node\n * prototype whose own `ast` is a well-formed AST, is recognized by that shape,\n * because `@smthrs/flow` hands a rehydrated AST back as a node and its side\n * tables are all a round trip loses. The {@link TypeId} marker is a public\n * string any object can carry, so it counts for nothing on its own: every\n * combinator that admits a node reads its `ast` as trusted topology, and an\n * object carrying the marker on any other prototype, one inheriting it from a\n * node, and one whose `ast` is missing, malformed, cyclic, or an accessor are\n * all refused with the same `GraphBuildError` as any other non-node. A proxy\n * is judged by the shape it forwards: one that forwards a node unchanged\n * passes, and one that diverges from it does not.\n *\n * @since 0.1.0\n * @category guards\n * @slop\n */\nexport const isNode = (value: unknown): value is Any => internal.isNode(value)\n\n/**\n * The inert value delivered by {@link succeed}. Planned references resolve to\n * their result type; other values follow the payload's JSON projection.\n * Invalid dates serialize to null. Members without a JSON representation are\n * omitted from objects and replaced with null in arrays.\n *\n * @since 1.0.0\n * @category models\n */\nexport type Succeed<A> = A extends Planned.Planned<infer Value> ? Value\n : A extends Date ? string | null\n : A extends { toJSON: (...args: any) => infer Value } ? Succeed<Value>\n : A extends (...args: any) => any ? undefined\n : A extends symbol ? undefined\n : A extends ReadonlyArray<unknown> ? { [K in keyof A]: SucceedArrayMember<A[K]> }\n : A extends object ? {\n [K in keyof A as K extends string | number ? [Succeed<A[K]>] extends [undefined] ? never : K : never]: Succeed<\n A[K]\n >\n }\n : A\n\n/** @private */\ntype SucceedArrayMember<A> = A extends Planned.Planned<infer Value> ? Value\n : A extends unknown ? Succeed<A> extends infer Value ? Value extends undefined ? null : Value\n : never\n : never\n\n/**\n * A node that succeeds with the constant's inert JSON projection.\n *\n * Dates produce strings (or null for invalid dates), URLs produce strings,\n * and callable object members are omitted. Use {@link map} to reconstruct a\n * domain value explicitly after this serialization boundary.\n *\n * @since 0.1.0\n * @category constructors\n */\nexport const succeed = <A>(value: A): Node<Succeed<A>> => internal.makeNode<Succeed<A>>(internal.succeed(value))\n\n/**\n * The inert error delivered by {@link fail}: the same JSON projection\n * {@link Succeed} describes, because a plan stores an error exactly as it\n * stores a value.\n *\n * @since 1.0.0\n * @category models\n */\nexport type Fail<E> = Succeed<E>\n\n/**\n * A node that fails with the constant's inert JSON projection, in the typed\n * error channel.\n *\n * It is how a plan states a refusal it already knows about \u2014 an unsupported\n * input, an exhausted budget, a compensation that has nothing left to undo \u2014\n * without an action that exists only to fail. {@link catch} recovers it exactly\n * as it recovers an action's failure, and an uncaught one is the flow's typed\n * failure.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const fail = <E>(error: E): Node<never, Fail<E>> => internal.makeNode<never, Fail<E>>(internal.fail(error))\n\n/**\n * Combines independent children into one node, keyed by name.\n *\n * Width is fixed here, at plan time. Fanning out over something a step\n * discovered is not this: end the round and carry the list in the next flow's\n * payload, where it is real data.\n *\n * @since 0.1.0\n * @category constructors\n * @slop\n */\nexport const all = <const Nodes extends Readonly<Record<string, Any>>>(\n nodes: Nodes\n): Node<\n Types.Simplify<{ readonly [K in keyof Nodes]: Success<Nodes[K]> }>,\n Error<Nodes[keyof Nodes]>,\n Services<Nodes[keyof Nodes]>\n> => internal.makeNode(internal.all(memberAsts(nodes, \"all\", \"invalid_all_member\")))\n\n/**\n * The member ASTs of a combination, keyed by name, refusing a non-node member.\n *\n * @private\n */\nconst memberAsts = (\n nodes: Readonly<Record<string, unknown>>,\n combinator: string,\n code: \"invalid_all_member\" | \"invalid_join\"\n): Record<string, Ast> => {\n const asts: Record<string, Ast> = Object.create(null) as Record<string, Ast>\n for (const [member, node] of Object.entries(nodes)) {\n if (!isNode(node)) {\n throw new GraphBuildError({\n code,\n node: member,\n path: [],\n message: `Node.${combinator} expected a Node at member \"${member}\"`\n })\n }\n Object.defineProperty(asts, member, {\n configurable: true,\n enumerable: true,\n value: node.ast,\n writable: true\n })\n }\n return asts\n}\n\n/**\n * Builds a join that settles early, refusing a member set it could never\n * decide on.\n *\n * @private\n */\nconst join = (mode: internal.RaceMode, count: number, nodes: Readonly<Record<string, unknown>>): Ast => {\n const asts = memberAsts(nodes, mode, \"invalid_join\")\n const width = Object.keys(asts).length\n if (!internal.isRaceCount(mode, count, width)) {\n throw new GraphBuildError({\n code: \"invalid_join\",\n node: mode,\n path: [],\n message: mode === \"quorum\"\n ? `Node.quorum needs a whole number of successes between 1 and its ${width} members, got ${String(count)}`\n : `Node.${mode} needs at least one member`\n })\n }\n return internal.race(mode, count, asts)\n}\n\n/**\n * The members of an early-settling join, keyed by name.\n *\n * @since 1.0.0\n * @category models\n */\nexport type Members = Readonly<Record<string, Any>>\n\n/**\n * Settles with the first member to settle, success or typed failure.\n *\n * The other members are interrupted. The winner is journaled, so a resumed run\n * settles the same member and never starts the others again.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const race = <const Nodes extends Members>(\n nodes: Nodes\n): Node<Success<Nodes[keyof Nodes]>, Error<Nodes[keyof Nodes]>, Services<Nodes[keyof Nodes]>> =>\n internal.makeNode(join(\"race\", 1, nodes))\n\n/**\n * Settles with the first member to succeed, ignoring typed failures while a\n * member is still running.\n *\n * It fails with the last failure when every member fails. The other members\n * are interrupted, and the winner is journaled as {@link race} journals it.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const any = <const Nodes extends Members>(\n nodes: Nodes\n): Node<Success<Nodes[keyof Nodes]>, Error<Nodes[keyof Nodes]>, Services<Nodes[keyof Nodes]>> =>\n internal.makeNode(join(\"any\", 1, nodes))\n\n/**\n * Succeeds once `count` members succeed, with exactly those members' values\n * keyed by name.\n *\n * It fails with the failure that leaves fewer than `count` members able to\n * succeed. Either way the members still running are interrupted, and the\n * members that decided are journaled as {@link race} journals its winner.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const quorum = <const Nodes extends Members>(\n count: number,\n nodes: Nodes\n): Node<\n Types.Simplify<{ readonly [K in keyof Nodes]?: Success<Nodes[K]> }>,\n Error<Nodes[keyof Nodes]>,\n Services<Nodes[keyof Nodes]>\n> => internal.makeNode(join(\"quorum\", count, nodes))\n\n/**\n * Transforms an eventual success value with a deferred pure function.\n *\n * The function is digested, not run: it executes later, on the real value.\n * This is where computation on a step result belongs \u2014 and only computation. A\n * `map` that decides what happens next is a `branch` written wrongly.\n *\n * @since 0.1.0\n * @category mapping\n * @slop\n */\nexport const map: {\n <A, B>(f: (a: A) => B): <E, R>(self: Node<A, E, R>) => Node<B, E, R>\n <A, E, R, B>(self: Node<A, E, R>, f: (a: A) => B): Node<B, E, R>\n} = dual(\n 2,\n <A, E, R, B>(self: Node<A, E, R>, f: (a: A) => B): Node<B, E, R> =>\n internal.makeNode<B, E, R>(internal.map(self.ast, (value) => f(value as A), f))\n)\n\n/**\n * Starts the entire next subtree only after this node succeeds, without\n * consuming its result. Failure or interruption prevents that subtree from\n * starting, including actions nested inside combinations or inline flows.\n *\n * Use {@link bindPlanned} to build a dependency from a symbolic result, or\n * {@link map} to compute on the eventual value.\n *\n * @since 0.1.0\n * @category sequencing\n * @slop\n */\nexport const andThen: {\n <B, E2, R2>(next: Node<B, E2, R2>): <A, E, R>(self: Node<A, E, R>) => Node<B, E | E2, R | R2>\n <A, E, R, B, E2, R2>(self: Node<A, E, R>, next: Node<B, E2, R2>): Node<B, E | E2, R | R2>\n} = dual(\n 2,\n <A, E, R, B, E2, R2>(\n self: Node<A, E, R>,\n next: Node<B, E2, R2>\n ): Node<B, E | E2, R | R2> => {\n if (!isNode(next)) {\n throw new GraphBuildError({\n code: \"invalid_continuation\",\n node: \"andThen/next\",\n path: [],\n message:\n \"Node.andThen expects a Node; use Node.bindPlanned for a symbolic builder or Node.map for value computation\"\n })\n }\n return internal.makeNode<B, E | E2, R | R2>(internal.andThenNode(self.ast, next.ast))\n }\n)\n\n/**\n * Builds a dependency using a symbolic reference to this node's future result.\n *\n * The builder runs during planning. Its argument is a {@link module:Planned.Planned}\n * reference, not the value the node will eventually produce. Pass references\n * into action payloads; use {@link branch} for decisions and {@link map} for\n * computation on real results. JavaScript truthiness and reference equality\n * cannot inspect a planned result. Enable type-aware ESLint's\n * `@typescript-eslint/strict-boolean-expressions` to reject planned conditions.\n * Independent descendants of the built subtree can start while this producer\n * is running; consumers of its reference wait for its value. Use\n * {@link andThen} when the whole next subtree must wait for success.\n *\n * @since 1.0.0\n * @category sequencing\n */\nexport const bindPlanned: {\n <A, B, E2, R2>(\n build: (reference: Planned.Planned<A>) => Node<B, E2, R2>\n ): <E, R>(self: Node<A, E, R>) => Node<B, E | E2, R | R2>\n <A, E, R, B, E2, R2>(\n self: Node<A, E, R>,\n build: (reference: Planned.Planned<A>) => Node<B, E2, R2>\n ): Node<B, E | E2, R | R2>\n} = dual(\n 2,\n <A, E, R, B, E2, R2>(\n self: Node<A, E, R>,\n build: (reference: Planned.Planned<A>) => Node<B, E2, R2>\n ): Node<B, E | E2, R | R2> =>\n internal.makeNode<B, E | E2, R | R2>(\n internal.andThen(self.ast, (value) => build(value as Planned.Planned<A>), build)\n )\n)\n\n/**\n * Maximum eagerly nested branch arms. Arm construction precedes graph walking;\n * this bound leaves native stack headroom for a typed refusal.\n *\n * @since 1.0.0\n * @category constants\n */\nexport const maximumArmDepth = 512\nlet armDepth = 0\n\n/**\n * Builds one arm, once, against the symbolic subject.\n *\n * @private\n */\nconst arm = <A, B, E, R>(\n build: (value: Planned.Planned<A>) => Node<B, E, R>,\n subject: Planned.Planned<A>,\n side: string\n): Ast => {\n if (armDepth >= maximumArmDepth) {\n throw new GraphBuildError({\n code: \"graph_too_deep\",\n node: `${branchSubject}/${side}`,\n path: [],\n message: \"Node.branch recursion needs a plan-time bound, such as a payload-derived round count. \" +\n \"Both arms are built before the run-time predicate is evaluated.\"\n })\n }\n armDepth++\n try {\n const node = build(subject)\n if (!isNode(node)) {\n throw new GraphBuildError({\n code: \"invalid_continuation\",\n node: `${branchSubject}/${side}`,\n path: [],\n message: `Node.branch expected its \"${side}\" arm to return a Node`\n })\n }\n return node.ast\n } finally {\n armDepth--\n }\n}\n\n/**\n * Decides between two arms, both of them static topology.\n *\n * Each arm builder is evaluated exactly once, here, against a\n * {@link module:Planned.Planned} placeholder, and the resulting ASTs are what\n * the node stores \u2014 so a plan shows the exit condition and both continuations\n * before it runs. The predicate is digested and evaluated at run time on the\n * real value, which is why none of the plan-time placeholder machinery leaks\n * into control flow.\n *\n * Both arms contribute their requirements, because both arms are topology the\n * plan carries. A run takes one of them, but which one is not known until the\n * predicate sees the real value, so an execution has to be able to take either.\n *\n * @since 0.1.0\n * @category sequencing\n * @slop\n */\nexport const branch: {\n <A, B1, E1, R1, B2, E2, R2>(\n options: BranchOptions<A, B1, E1, R1, B2, E2, R2>\n ): <E, R>(self: Node<A, E, R>) => Node<B1 | B2, E | E1 | E2, R | R1 | R2>\n <A, E, R, B1, E1, R1, B2, E2, R2>(\n self: Node<A, E, R>,\n options: BranchOptions<A, B1, E1, R1, B2, E2, R2>\n ): Node<B1 | B2, E | E1 | E2, R | R1 | R2>\n} = dual(\n 2,\n <A, E, R, B1, E1, R1, B2, E2, R2>(\n self: Node<A, E, R>,\n options: BranchOptions<A, B1, E1, R1, B2, E2, R2>\n ): Node<B1 | B2, E | E1 | E2, R | R1 | R2> => {\n const predicate = options.if\n const subjectToken = `${branchSubject}/${subjects.branch++}`\n const subject = Planned.make<A>(subjectToken)\n return internal.makeNode<B1 | B2, E | E1 | E2, R | R1 | R2>(\n internal.branch(\n subjectToken,\n self.ast,\n (value) => predicate(value as A),\n predicate,\n arm(options.then, subject, \"then\"),\n arm(options.else, subject, \"else\")\n )\n )\n }\n)\n\n/**\n * Recovers from matching typed failures with static failure topology.\n *\n * The protected graph and failure arm are both stored in the AST. The arm is\n * built once at plan time against a strict planned error placeholder. With no\n * schema the whole typed error channel is handled. A schema handles only the\n * values it accepts, so its overloads retain E: a refinement can reject values\n * without narrowing its TypeScript type. Runtime schema callbacks enter the\n * filter identity along with its JSON Schema. Uncaptured callbacks are local\n * to this process, just like uncaptured mappers.\n *\n * The failure arm contributes its requirements to the node's, for the same\n * reason a branch's arms do: it is topology the plan carries, and a run reaches\n * it whenever the protected graph fails.\n *\n * @since 0.1.0\n * @category sequencing\n * @slop\n */\nconst catch_: {\n <Handled, B, E2, R2>(\n options: CatchOptions<unknown, B, E2, R2, Handled> & {\n readonly error: Schema.Schema<Handled>\n }\n ): <A, E, R>(self: Node<A, E, R>) => Node<A | B, E | E2, R | R2>\n <E, B, E2, R2>(\n options: CatchOptions<E, B, E2, R2> & {\n readonly error?: undefined\n }\n ): <A, R>(self: Node<A, E, R>) => Node<A | B, E2, R | R2>\n <A, E, R, Handled, B, E2, R2>(\n self: Node<A, E, R>,\n options: CatchOptions<E, B, E2, R2, Handled> & {\n readonly error: Schema.Schema<Handled>\n }\n ): Node<A | B, E | E2, R | R2>\n <A, E, R, B, E2, R2>(\n self: Node<A, E, R>,\n options: CatchOptions<E, B, E2, R2> & {\n readonly error?: undefined\n }\n ): Node<A | B, E2, R | R2>\n} = dual(\n 2,\n <A, E, R, Handled, B, E2, R2>(\n self: Node<A, E, R>,\n options: CatchOptions<E, B, E2, R2, Handled>\n ): Node<A | B, E | E2, R | R2> => {\n const subjectToken = `${catchSubject}/${subjects.catch++}`\n const failure = options.onFailure(Planned.make<Handled>(subjectToken))\n if (!isNode(failure)) {\n throw new GraphBuildError({\n code: \"invalid_continuation\",\n node: catchSubject,\n path: [],\n message: \"Node.catch expected its failure arm to return a Node\"\n })\n }\n return internal.makeNode(internal.catch_(subjectToken, self.ast, failure.ast, options.error))\n }\n)\n\nexport { catch_ as catch }\n\n/**\n * Attaches a scheduling priority to a node, leaving the original unchanged.\n *\n * The scheduler runs ready work with a higher number first, so a priority\n * changes LATENCY and nothing else. It never enters key material: a node\n * ordered ahead of another still computes the same result, so re-keying it\n * would throw away a legitimate cache hit. Children inherit the value\n * lexically when the graph is built, and a child that states its own keeps it.\n *\n * @since 0.1.0\n * @category annotations\n * @slop\n */\nexport const priority: {\n (value: number): <A, E, R>(self: Node<A, E, R>) => Node<A, E, R>\n <A, E, R>(self: Node<A, E, R>, value: number): Node<A, E, R>\n} = dual(\n 2,\n <A, E, R>(self: Node<A, E, R>, value: number): Node<A, E, R> => {\n if (!Number.isSafeInteger(value)) {\n throw new GraphBuildError({\n code: \"invalid_priority\",\n node: self.ast._tag,\n path: [],\n message: `Node.priority expects a safe integer, received ${value}`\n })\n }\n return internal.makeNode<A, E, R>(internal.withPriority(self.ast, value))\n }\n)\n\n/**\n * Reads the scheduling priority a node carries, or `undefined` when it states\n * none and inherits from whatever encloses it.\n *\n * @since 0.1.0\n * @category accessors\n * @slop\n */\nexport const declaredPriority = (ast: Ast): number | undefined => ast.priority\n\n/**\n * Constructs the flow-call node used by `@smthrs/flow` without making flow\n * calls part of the public authoring surface of this package.\n *\n * Reserved for `@smthrs/flow`, which owns flow authoring. It is not part\n * of this package's authoring surface, and it validates nothing: an unknown\n * flow tag becomes a call node the graph keeps as a leaf.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const flowCall = <A = unknown, E = never, R = never>(\n declaration: unknown,\n flow: string,\n mode: CallMode,\n payload: unknown\n): Node<A, E, R> => internal.makeNode<A, E, R>(internal.flowCall(declaration, flow, mode, payload))\n\n/**\n * Constructs the action-call node used by `@smthrs/flow` without making\n * action calls part of the public authoring surface of this package.\n *\n * Reserved for `@smthrs/flow`, which owns action authoring. It is not part\n * of this package's authoring surface, and an unknown action tag becomes a\n * call node the graph keeps as a leaf.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const actionCall = <A = unknown, E = never, R = never>(\n declaration: unknown,\n action: string,\n payload: unknown\n): Node<A, E, R> => internal.makeNode<A, E, R>(internal.actionCall(declaration, action, payload))\n\n/**\n * Reads the flow or action declaration a call node names, so `@smthrs/flow`\n * can expand a call it recorded. It is `undefined` for an AST that was\n * rehydrated from JSON, because the declaration lives beside the AST rather\n * than inside it \u2014 a graph built from such an AST keeps the call as a leaf.\n *\n * Reserved for `@smthrs/flow`, which files the declaration when it builds\n * the call. Authors never call it.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const declaration = (\n ast: Extract<Ast, { readonly _tag: \"ActionCall\" | \"FlowCall\" }>\n): unknown => internal.declaration(ast)\n\n/**\n * Reads the continuation builder of a sequenced node, which graph building\n * evaluates once against a placeholder. It is `undefined` when the author\n * supplied a node directly \u2014 the topology is already in `next` \u2014 and for a\n * rehydrated AST, whose side table did not survive serialization.\n *\n * Reserved for `@smthrs/flow`'s graph walk. Authors never call it.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const continuation = (\n ast: Extract<Ast, { readonly _tag: \"AndThen\" }>\n): ((value: Planned.Planned<unknown>) => unknown) | undefined => internal.operation(ast)\n\n/**\n * Reads the deferred mapper of a {@link map} node, which a driver applies to\n * the real upstream value once it has one. It is `undefined` for every other\n * variant, and for a rehydrated AST whose side table did not survive\n * serialization.\n *\n * Reserved for `@smthrs/flow`'s interpreter. Authors never call it.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const mapper = (ast: Ast): ((value: unknown) => unknown) | undefined =>\n ast._tag === \"Map\" ? internal.operation(ast) : undefined\n\n/**\n * Reads the run-time predicate of a {@link branch} node, which a driver\n * evaluates on the real subject value to choose an arm. It is `undefined` for\n * every other variant, and for a rehydrated AST whose side table did not\n * survive serialization.\n *\n * Reserved for `@smthrs/flow`'s interpreter. Authors never call it.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const predicate = (ast: Ast): ((value: unknown) => boolean) | undefined =>\n ast._tag === \"Branch\" ? internal.predicate(ast) : undefined\n\n/**\n * Reads the optional schema selecting failures handled by a {@link catch_}.\n *\n * Reserved for `@smthrs/flow`'s interpreter. It is `undefined` for every\n * variant but `catch_`, and for a rehydrated AST whose side table did not\n * survive serialization.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const catchFilter = (ast: Ast): Schema.Top | undefined => ast._tag === \"Catch\" ? internal.filter(ast) : undefined\n\n/**\n * Identifies a plan-time function the AST does NOT store, a flow's `body`,\n * exactly as the AST identifies the mapper and continuation it does store.\n * A call that keeps its callee as a leaf still has to re-key when that\n * callee's body is edited, and this is the identity it folds in. Unannotated\n * functions fail closed with process-local identity; use {@link capture} to\n * declare inert captures and obtain deterministic identity.\n *\n * Reserved for `@smthrs/flow`, which folds a callee body's identity into a\n * call it keeps as a leaf. Authors never call it; it throws a `TypeError`\n * when handed anything but a function.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const functionIdentity = (operation: unknown): FunctionIdentity => internal.functionIdentity(operation)\n\n/**\n * The document a schema's identity is: JSON-Schema-shaped, and the same bytes\n * under every `effect` release this package supports.\n *\n * @since 1.0.0\n * @category engine\n */\nexport type SchemaIdentity = internalSchemaIdentity.Document\n\n/**\n * The one option a schema's identity is taken under: whether an object closes\n * over the keys it declares (`\"error\"`) or leaves others open (`\"ignore\"`,\n * the default). It has the meaning it has in `Schema.toJsonSchemaDocument`.\n *\n * @since 1.0.0\n * @category engine\n */\nexport type SchemaIdentityOptions = internalSchemaIdentity.Options\n\n/**\n * The refusal `schemaIdentity` and `representationIdentity` raise for a schema\n * a step key cannot be derived from. Its message is the one\n * `effect@4.0.0-rc.115` gave for the same schema, where it gave one.\n *\n * @since 1.0.0\n * @category errors\n */\nexport const SchemaIdentityError = internalSchemaIdentity.SchemaIdentityError\n\n/**\n * The type of {@link SchemaIdentityError}.\n *\n * @since 1.0.0\n * @category errors\n */\nexport type SchemaIdentityError = internalSchemaIdentity.SchemaIdentityError\n\n/**\n * Identifies a schema by the constraints it documents, so a call re-keys when\n * what its callee accepts or produces changes, and a catch re-keys when its\n * filter does.\n *\n * The document is what `Schema.toJsonSchemaDocument(schema, options)`\n * returned under `effect@4.0.0-rc.115`. It is printed by this package, not by\n * the installed `effect`, because a later release prints a different document\n * for the same schema and a moved identity re-keys every recorded step. Use\n * it wherever the document is hashed, compared or pinned; a JSON Schema shown\n * to a model or a person comes from `Schema.toJsonSchemaDocument`.\n *\n * Reserved for the packages that derive identities. Authors never call it; it\n * throws for a schema that has no JSON Schema form.\n *\n * @since 1.0.0\n * @category engine\n */\nexport const schemaIdentity = (schema: Schema.Top, options?: SchemaIdentityOptions): SchemaIdentity =>\n internalSchemaIdentity.schemaIdentity(schema, options)\n\n/**\n * Identifies a schema AST by its encoded representation, the material a\n * sealed action's step key folds in for its success and error schemas.\n *\n * The value is what `SchemaRepresentation.toJson(SchemaRepresentation.toRepresentation(ast))`\n * returned under `effect@4.0.0-rc.115`, so a later `effect` release does not\n * re-key recorded steps. The one exception is `Schema.brand`: from\n * `effect@4.0.4` on a brand is not part of the AST, so a declaration with a\n * brand re-keys once.\n *\n * Reserved for the packages that derive step keys. Authors never call it; it\n * throws for an AST that has no representation.\n *\n * @since 1.0.0\n * @category engine\n */\nexport const representationIdentity = (ast: SchemaAST.AST): Schema.Json =>\n internalSchemaIdentity.representationIdentity(ast)\n\n/**\n * Binds a frozen plain copy of inert captures as the callback's this receiver.\n *\n * Use a function expression to read the snapshot while keeping the ordinary\n * callback arguments: Node.capture({ factor: 3 }, function(value: number) {\n * return value * this.factor\n * }). Caller objects remain unchanged; lexical aliases still name originals\n * and must not be used as mutable semantic inputs. Nested captures retain the\n * inner callback's snapshot and compose the two identities.\n *\n * Admission walks original descriptors once, rejects built-in brands and\n * non-plain prototypes without evaluating getters, then uses structuredClone\n * to refuse Proxies. Hosts without that API refuse object capture. Only the\n * owned frozen copy enters identity and the wrapper. Sealed, non-extensible,\n * frozen and Immer ordinary data are supported equally. Unsupported values\n * raise a TypeError naming the path. See core docs/api.md#nodecapture for the\n * complete algorithm and the migration from original-object locking.\n *\n * @category constructors\n * @since 0.1.0\n * @slop\n */\nexport const capture = <C extends Readonly<Record<string, unknown>>, Args extends ReadonlyArray<unknown>, A>(\n captures: C,\n operation: (this: Readonly<C>, ...args: Args) => A\n): (...args: Args) => A => internal.capture(captures, operation)\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BA,sBAAqB;AAKrB,6BAAgC;AAChC,eAA0B;AAC1B,6BAAwC;AACxC,cAAyB;AASlB,MAAM,SAAiB,SAAS;AAkChC,MAAM,WAAW,SAAS;AAgC1B,MAAM,mBAAmB,SAAS;AA0ElC,MAAM,gBAAgB;AAG7B,MAAM,cAAc,uBAAO,IAAI,+BAA+B;AAC9D,MAAM,UAAU;AAChB,MAAM,WAAW,QAAQ,WAAW,MAAM,EAAE,QAAQ,GAAG,OAAO,EAAE;AAazD,MAAM,eAAe;AAoDrB,MAAM,SAAS,CAAC,UAAiC,SAAS,OAAO,KAAK;AAwCtE,MAAM,UAAU,CAAI,UAA+B,SAAS,SAAqB,SAAS,QAAQ,KAAK,CAAC;AAyBxG,MAA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,MAAM,WAAW,CACtBC,cACA,MACA,MACA,YACkB,SAAS,SAAkB,SAAS,SAASA,cAAa,MAAM,MAAM,OAAO,CAAC;AAc3F,MAAM,aAAa,CACxBA,cACA,QACA,YACkB,SAAS,SAAkB,SAAS,WAAWA,cAAa,QAAQ,OAAO,CAAC;AAezF,MAAM,cAAc,CACzB,QACY,SAAS,YAAY,GAAG;AAc/B,MAAM,eAAe,CAC1B,QAC+D,SAAS,UAAU,GAAG;AAchF,MAAM,SAAS,CAAC,QACrB,IAAI,SAAS,QAAQ,SAAS,UAAU,GAAG,IAAI;AAc1C,MAAM,YAAY,CAAC,QACxB,IAAI,SAAS,WAAW,SAAS,UAAU,GAAG,IAAI;AAa7C,MAAM,cAAc,CAAC,QAAqC,IAAI,SAAS,UAAU,SAAS,OAAO,GAAG,IAAI;AAkBxG,MAAM,mBAAmB,CAAC,cAAyC,SAAS,iBAAiB,SAAS;AA6BtG,MAAM,sBAAsB,uBAAuB;AA4BnD,MAAM,iBAAiB,CAAC,QAAoB,YACjD,uBAAuB,eAAe,QAAQ,OAAO;AAkBhD,MAAM,yBAAyB,CAAC,QACrC,uBAAuB,uBAAuB,GAAG;AAwB5C,MAAM,UAAU,CACrB,UACA,cACyB,SAAS,QAAQ,UAAU,SAAS;",
|
|
6
6
|
"names": ["predicate", "declaration"]
|
|
7
7
|
}
|
package/dist/esm/Node.d.ts
CHANGED
|
@@ -388,6 +388,14 @@ export declare const bindPlanned: {
|
|
|
388
388
|
<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>;
|
|
389
389
|
<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>;
|
|
390
390
|
};
|
|
391
|
+
/**
|
|
392
|
+
* Maximum eagerly nested branch arms. Arm construction precedes graph walking;
|
|
393
|
+
* this bound leaves native stack headroom for a typed refusal.
|
|
394
|
+
*
|
|
395
|
+
* @since 1.0.0
|
|
396
|
+
* @category constants
|
|
397
|
+
*/
|
|
398
|
+
export declare const maximumArmDepth = 512;
|
|
391
399
|
/**
|
|
392
400
|
* Decides between two arms, both of them static topology.
|
|
393
401
|
*
|
package/dist/esm/Node.d.ts.map
CHANGED
|
@@ -1 +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,SAAS,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAE1C,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAC9C,OAAO,KAAK,sBAAsB,MAAM,8BAA8B,CAAA;AACtE,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,EAAE,MAAwB,CAAA;AAE7C;;;;;;GAMG;AACH,MAAM,MAAM,MAAM,GAAG,oBAAoB,CAAA;AAEzC;;;;;;;GAOG;AACH,MAAM,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAA;AAElC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,6DAAoB,CAAA;AAEzC;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAA;AAExC;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC,QAAQ,CAAC,CAAA;AAE/E;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,2DAA4B,CAAA;A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;;;;;;;;;;GAeG;AACH,eAAO,MAAM,sBAAsB,GAAI,KAAK,SAAS,CAAC,GAAG,KAAG,MAAM,CAAC,IACf,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,OAAO,GAAI,CAAC,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,IAAI,SAAS,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,EACzG,UAAU,CAAC,EACX,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,IAAI,KAAK,CAAC,KACjD,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,CAA0C,CAAA"}
|
package/dist/esm/Node.js
CHANGED
|
@@ -281,9 +281,14 @@ export const andThen = dual(2, (self, next) => {
|
|
|
281
281
|
* @category sequencing
|
|
282
282
|
*/
|
|
283
283
|
export const bindPlanned = dual(2, (self, build) => internal.makeNode(internal.andThen(self.ast, (value) => build(value), build)));
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
284
|
+
/**
|
|
285
|
+
* Maximum eagerly nested branch arms. Arm construction precedes graph walking;
|
|
286
|
+
* this bound leaves native stack headroom for a typed refusal.
|
|
287
|
+
*
|
|
288
|
+
* @since 1.0.0
|
|
289
|
+
* @category constants
|
|
290
|
+
*/
|
|
291
|
+
export const maximumArmDepth = 512;
|
|
287
292
|
let armDepth = 0;
|
|
288
293
|
/**
|
|
289
294
|
* Builds one arm, once, against the symbolic subject.
|
package/dist/esm/Node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Node.js","sourceRoot":"","sources":["../../src/Node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAKtC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;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MAAM,WAAW,GAAG,CAAC,GAAQ,EAA0B,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AAExH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAkB,EAAoB,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAA;AAqB9G;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,mBAAmB,CAAA;AAU7E;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAkB,EAAE,OAA+B,EAAkB,EAAE,CACpG,sBAAsB,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAExD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAkB,EAAe,EAAE,CACxE,sBAAsB,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,QAAW,EACX,SAAkD,EAC5B,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA","sourcesContent":["/**\n * Pure, pipeable nodes: the shape a flow body describes and nothing more.\n *\n * Building a node records an inspectable AST and executes nothing — the same\n * split as Bazel's `ctx.actions.run`, which declares an action rather than\n * running one. A plan is\n * always a DAG, so there is no loop node here and never will be: repetition\n * lives one level up, in what a flow settles with.\n *\n * A node also carries Effect's requirement channel, `R`, and carries it as a\n * PHANTOM: building a plan demands nothing, and every combinator here unions\n * `R` without ever reading it. What fills the channel is a call to something\n * whose code lives elsewhere — an action — so the type of a plan states which\n * implementations executing it will need, and the place that executes it is\n * where the compiler asks for them.\n *\n * Control flow is structure. {@link branch} takes both arms and evaluates each\n * ONCE, symbolically, so the exit condition and the handoff site are visible\n * topology before anything runs; its predicate is digested and runs later on\n * the real value. {@link map} is transformation only. The rule the authoring\n * note states, and this module encodes: **map transforms; branch decides.**\n *\n * Adapted from `@smthrs/core` (`packages/smithers/flows/core`) `Node.ts`.\n * `Dynamic` is gone — a model call is an ordinary action, and nothing\n * model-shaped belongs in this package — and node annotations are gone with\n * it, because the AST has to stay JSON serializable.\n *\n * @since 0.1.0\n */\n\nimport { dual } from \"effect/Function\"\nimport type * as Pipeable from \"effect/Pipeable\"\nimport type * as Schema from \"effect/Schema\"\nimport type * as SchemaAST from \"effect/SchemaAST\"\nimport type * as Types from \"effect/Types\"\nimport { GraphBuildError } from \"./GraphBuildError.ts\"\nimport * as internal from \"./internal/node.ts\"\nimport * as internalSchemaIdentity from \"./internal/SchemaIdentity.ts\"\nimport * as Planned from \"./Planned.ts\"\n\n/**\n * The runtime type identifier carried by every node.\n *\n * @since 0.1.0\n * @category type ids\n * @slop\n */\nexport const TypeId: TypeId = internal.TypeId\n\n/**\n * The type-level form of {@link TypeId}.\n *\n * @since 0.1.0\n * @category type ids\n * @slop\n */\nexport type TypeId = \"~@smthrs/plan/Node\"\n\n/**\n * The inspectable AST a node stores: closure-free, and JSON serializable for\n * every JSON payload an author puts in it.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Ast = internal.NodeAst\n\n/**\n * How a flow call joins the caller's plan: `inline` splices the callee's body\n * in, `boundary` makes it one child execution, and `handoff` names the next\n * trampoline round.\n *\n * This is the ONE call-mode vocabulary. {@link flowCall} takes it and\n * `@smthrs/flow`'s graph builder switches on it, so a second spelling in\n * either package would fork the moment one gained a mode.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport const CallMode = internal.CallMode\n\n/**\n * The value form of {@link CallMode}.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type CallMode = internal.CallMode\n\n/**\n * The serializable stand-in an AST keeps for a plan-time function: a digest of\n * its normalized source, hashed in place of a closure that could not be\n * shipped, stored, or compared.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type FunctionIdentity = Extract<Ast, { readonly _tag: \"Map\" }>[\"mapper\"]\n\n/**\n * Reads the inert AST reference created for a planned value.\n *\n * Structural lookalikes remain ordinary payload data. This accessor is the\n * only recognition path because the marker itself is deliberately private to\n * the AST cloner.\n *\n * @since 1.0.0\n * @category accessors\n */\nexport const plannedReference = internal.plannedReference\n\n/**\n * A pure graph-building value, covariant in what it will succeed and fail\n * with and in what it will need to run. It is a description: holding one has\n * run nothing.\n *\n * `R` is Effect's requirement channel, and it is PHANTOM here. Nothing at plan\n * time reads it: the AST, the graph built from it, its key material, and every\n * digest are identical whatever `R` says. It exists so a value that names an\n * implementation it does not carry — an action call — can say so in its type,\n * and so the place that finally has to run that implementation can demand it.\n * Building a plan therefore stays requirement-free; only executing one is not.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport interface Node<out A, out E = never, out R = never> extends Pipeable.Pipeable {\n readonly [TypeId]: {\n readonly _A: Types.Covariant<A>\n readonly _E: Types.Covariant<E>\n readonly _R: Types.Covariant<R>\n }\n readonly ast: Ast\n}\n\n/**\n * Any node, whatever it succeeds or fails with and whatever it requires.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Any = Node<unknown, unknown, any>\n\n/**\n * The success type of a node.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Success<N> = N extends Node<infer A, infer _E, infer _R> ? A : never\n\n/**\n * The error type of a node.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Error<N> = N extends Node<infer _A, infer E, infer _R> ? E : never\n\n/**\n * The requirements of a node: what has to be provided wherever it is finally\n * executed, and nothing that has to be provided to build it.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Services<N> = N extends Node<infer _A, infer _E, infer R> ? R : never\n\n/**\n * The node reference a branch arm's symbolic subject carries. Arms are built\n * before the graph assigns ids, so every reference an arm records names this\n * placeholder, and graph building rewrites it to the branch's own upstream\n * node — which is `first`, structurally, and therefore not a guess.\n *\n * @since 0.1.0\n * @category constants\n * @slop\n */\nexport const branchSubject = \"branch/subject\"\n\n/** @private */\nconst subjectsKey = Symbol.for(\"@smthrs/plan/Node/subjects/v1\")\nconst globals = globalThis as typeof globalThis & { [subjectsKey]?: { branch: number; catch: number } }\nconst subjects = globals[subjectsKey] ??= { branch: 0, catch: 0 }\n\n/**\n * The prefix of the node reference a catch failure arm's symbolic error\n * carries. Each {@link catch_} mints its own token under this prefix, so an\n * outer error captured inside a nested failure arm keeps naming the outer\n * catch, and graph building rewrites each token to the node that catch\n * protects.\n *\n * @since 0.1.0\n * @category constants\n * @slop\n */\nexport const catchSubject = \"catch/subject\"\n\n/**\n * The two arms of a decision plus the predicate that chooses between them.\n *\n * `if` runs at RUN time on the real value. `then` and `else` run at PLAN time,\n * once each, against a {@link module:Planned.Planned} placeholder — they\n * describe topology, so they may pass the value on but never compute on it.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport interface BranchOptions<A, B1, E1, R1, B2, E2, R2> {\n readonly if: (value: A) => boolean\n readonly then: (value: Planned.Planned<A>) => Node<B1, E1, R1>\n readonly else: (value: Planned.Planned<A>) => Node<B2, E2, R2>\n}\n\n/**\n * The statically planned recovery arm and optional schema selecting which\n * typed failures it handles.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport interface CatchOptions<E, B, E2, R2 = never, Handled = E> {\n readonly error?: Schema.Schema<Handled> | undefined\n readonly onFailure: (error: Planned.Planned<Handled>) => Node<B, E2, R2>\n}\n\n/**\n * Checks whether a value is a node.\n *\n * A node this package built is recognized by registration at construction. A\n * node that crossed a serialization boundary, an object sharing the node\n * prototype whose own `ast` is a well-formed AST, is recognized by that shape,\n * because `@smthrs/flow` hands a rehydrated AST back as a node and its side\n * tables are all a round trip loses. The {@link TypeId} marker is a public\n * string any object can carry, so it counts for nothing on its own: every\n * combinator that admits a node reads its `ast` as trusted topology, and an\n * object carrying the marker on any other prototype, one inheriting it from a\n * node, and one whose `ast` is missing, malformed, cyclic, or an accessor are\n * all refused with the same `GraphBuildError` as any other non-node. A proxy\n * is judged by the shape it forwards: one that forwards a node unchanged\n * passes, and one that diverges from it does not.\n *\n * @since 0.1.0\n * @category guards\n * @slop\n */\nexport const isNode = (value: unknown): value is Any => internal.isNode(value)\n\n/**\n * The inert value delivered by {@link succeed}. Planned references resolve to\n * their result type; other values follow the payload's JSON projection.\n * Invalid dates serialize to null. Members without a JSON representation are\n * omitted from objects and replaced with null in arrays.\n *\n * @since 1.0.0\n * @category models\n */\nexport type Succeed<A> = A extends Planned.Planned<infer Value> ? Value\n : A extends Date ? string | null\n : A extends { toJSON: (...args: any) => infer Value } ? Succeed<Value>\n : A extends (...args: any) => any ? undefined\n : A extends symbol ? undefined\n : A extends ReadonlyArray<unknown> ? { [K in keyof A]: SucceedArrayMember<A[K]> }\n : A extends object ? {\n [K in keyof A as K extends string | number ? [Succeed<A[K]>] extends [undefined] ? never : K : never]: Succeed<\n A[K]\n >\n }\n : A\n\n/** @private */\ntype SucceedArrayMember<A> = A extends Planned.Planned<infer Value> ? Value\n : A extends unknown ? Succeed<A> extends infer Value ? Value extends undefined ? null : Value\n : never\n : never\n\n/**\n * A node that succeeds with the constant's inert JSON projection.\n *\n * Dates produce strings (or null for invalid dates), URLs produce strings,\n * and callable object members are omitted. Use {@link map} to reconstruct a\n * domain value explicitly after this serialization boundary.\n *\n * @since 0.1.0\n * @category constructors\n */\nexport const succeed = <A>(value: A): Node<Succeed<A>> => internal.makeNode<Succeed<A>>(internal.succeed(value))\n\n/**\n * The inert error delivered by {@link fail}: the same JSON projection\n * {@link Succeed} describes, because a plan stores an error exactly as it\n * stores a value.\n *\n * @since 1.0.0\n * @category models\n */\nexport type Fail<E> = Succeed<E>\n\n/**\n * A node that fails with the constant's inert JSON projection, in the typed\n * error channel.\n *\n * It is how a plan states a refusal it already knows about — an unsupported\n * input, an exhausted budget, a compensation that has nothing left to undo —\n * without an action that exists only to fail. {@link catch} recovers it exactly\n * as it recovers an action's failure, and an uncaught one is the flow's typed\n * failure.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const fail = <E>(error: E): Node<never, Fail<E>> => internal.makeNode<never, Fail<E>>(internal.fail(error))\n\n/**\n * Combines independent children into one node, keyed by name.\n *\n * Width is fixed here, at plan time. Fanning out over something a step\n * discovered is not this: end the round and carry the list in the next flow's\n * payload, where it is real data.\n *\n * @since 0.1.0\n * @category constructors\n * @slop\n */\nexport const all = <const Nodes extends Readonly<Record<string, Any>>>(\n nodes: Nodes\n): Node<\n Types.Simplify<{ readonly [K in keyof Nodes]: Success<Nodes[K]> }>,\n Error<Nodes[keyof Nodes]>,\n Services<Nodes[keyof Nodes]>\n> => internal.makeNode(internal.all(memberAsts(nodes, \"all\", \"invalid_all_member\")))\n\n/**\n * The member ASTs of a combination, keyed by name, refusing a non-node member.\n *\n * @private\n */\nconst memberAsts = (\n nodes: Readonly<Record<string, unknown>>,\n combinator: string,\n code: \"invalid_all_member\" | \"invalid_join\"\n): Record<string, Ast> => {\n const asts: Record<string, Ast> = Object.create(null) as Record<string, Ast>\n for (const [member, node] of Object.entries(nodes)) {\n if (!isNode(node)) {\n throw new GraphBuildError({\n code,\n node: member,\n path: [],\n message: `Node.${combinator} expected a Node at member \"${member}\"`\n })\n }\n Object.defineProperty(asts, member, {\n configurable: true,\n enumerable: true,\n value: node.ast,\n writable: true\n })\n }\n return asts\n}\n\n/**\n * Builds a join that settles early, refusing a member set it could never\n * decide on.\n *\n * @private\n */\nconst join = (mode: internal.RaceMode, count: number, nodes: Readonly<Record<string, unknown>>): Ast => {\n const asts = memberAsts(nodes, mode, \"invalid_join\")\n const width = Object.keys(asts).length\n if (!internal.isRaceCount(mode, count, width)) {\n throw new GraphBuildError({\n code: \"invalid_join\",\n node: mode,\n path: [],\n message: mode === \"quorum\"\n ? `Node.quorum needs a whole number of successes between 1 and its ${width} members, got ${String(count)}`\n : `Node.${mode} needs at least one member`\n })\n }\n return internal.race(mode, count, asts)\n}\n\n/**\n * The members of an early-settling join, keyed by name.\n *\n * @since 1.0.0\n * @category models\n */\nexport type Members = Readonly<Record<string, Any>>\n\n/**\n * Settles with the first member to settle, success or typed failure.\n *\n * The other members are interrupted. The winner is journaled, so a resumed run\n * settles the same member and never starts the others again.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const race = <const Nodes extends Members>(\n nodes: Nodes\n): Node<Success<Nodes[keyof Nodes]>, Error<Nodes[keyof Nodes]>, Services<Nodes[keyof Nodes]>> =>\n internal.makeNode(join(\"race\", 1, nodes))\n\n/**\n * Settles with the first member to succeed, ignoring typed failures while a\n * member is still running.\n *\n * It fails with the last failure when every member fails. The other members\n * are interrupted, and the winner is journaled as {@link race} journals it.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const any = <const Nodes extends Members>(\n nodes: Nodes\n): Node<Success<Nodes[keyof Nodes]>, Error<Nodes[keyof Nodes]>, Services<Nodes[keyof Nodes]>> =>\n internal.makeNode(join(\"any\", 1, nodes))\n\n/**\n * Succeeds once `count` members succeed, with exactly those members' values\n * keyed by name.\n *\n * It fails with the failure that leaves fewer than `count` members able to\n * succeed. Either way the members still running are interrupted, and the\n * members that decided are journaled as {@link race} journals its winner.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const quorum = <const Nodes extends Members>(\n count: number,\n nodes: Nodes\n): Node<\n Types.Simplify<{ readonly [K in keyof Nodes]?: Success<Nodes[K]> }>,\n Error<Nodes[keyof Nodes]>,\n Services<Nodes[keyof Nodes]>\n> => internal.makeNode(join(\"quorum\", count, nodes))\n\n/**\n * Transforms an eventual success value with a deferred pure function.\n *\n * The function is digested, not run: it executes later, on the real value.\n * This is where computation on a step result belongs — and only computation. A\n * `map` that decides what happens next is a `branch` written wrongly.\n *\n * @since 0.1.0\n * @category mapping\n * @slop\n */\nexport const map: {\n <A, B>(f: (a: A) => B): <E, R>(self: Node<A, E, R>) => Node<B, E, R>\n <A, E, R, B>(self: Node<A, E, R>, f: (a: A) => B): Node<B, E, R>\n} = dual(\n 2,\n <A, E, R, B>(self: Node<A, E, R>, f: (a: A) => B): Node<B, E, R> =>\n internal.makeNode<B, E, R>(internal.map(self.ast, (value) => f(value as A), f))\n)\n\n/**\n * Starts the entire next subtree only after this node succeeds, without\n * consuming its result. Failure or interruption prevents that subtree from\n * starting, including actions nested inside combinations or inline flows.\n *\n * Use {@link bindPlanned} to build a dependency from a symbolic result, or\n * {@link map} to compute on the eventual value.\n *\n * @since 0.1.0\n * @category sequencing\n * @slop\n */\nexport const andThen: {\n <B, E2, R2>(next: Node<B, E2, R2>): <A, E, R>(self: Node<A, E, R>) => Node<B, E | E2, R | R2>\n <A, E, R, B, E2, R2>(self: Node<A, E, R>, next: Node<B, E2, R2>): Node<B, E | E2, R | R2>\n} = dual(\n 2,\n <A, E, R, B, E2, R2>(\n self: Node<A, E, R>,\n next: Node<B, E2, R2>\n ): Node<B, E | E2, R | R2> => {\n if (!isNode(next)) {\n throw new GraphBuildError({\n code: \"invalid_continuation\",\n node: \"andThen/next\",\n path: [],\n message:\n \"Node.andThen expects a Node; use Node.bindPlanned for a symbolic builder or Node.map for value computation\"\n })\n }\n return internal.makeNode<B, E | E2, R | R2>(internal.andThenNode(self.ast, next.ast))\n }\n)\n\n/**\n * Builds a dependency using a symbolic reference to this node's future result.\n *\n * The builder runs during planning. Its argument is a {@link module:Planned.Planned}\n * reference, not the value the node will eventually produce. Pass references\n * into action payloads; use {@link branch} for decisions and {@link map} for\n * computation on real results. JavaScript truthiness and reference equality\n * cannot inspect a planned result. Enable type-aware ESLint's\n * `@typescript-eslint/strict-boolean-expressions` to reject planned conditions.\n * Independent descendants of the built subtree can start while this producer\n * is running; consumers of its reference wait for its value. Use\n * {@link andThen} when the whole next subtree must wait for success.\n *\n * @since 1.0.0\n * @category sequencing\n */\nexport const bindPlanned: {\n <A, B, E2, R2>(\n build: (reference: Planned.Planned<A>) => Node<B, E2, R2>\n ): <E, R>(self: Node<A, E, R>) => Node<B, E | E2, R | R2>\n <A, E, R, B, E2, R2>(\n self: Node<A, E, R>,\n build: (reference: Planned.Planned<A>) => Node<B, E2, R2>\n ): Node<B, E | E2, R | R2>\n} = dual(\n 2,\n <A, E, R, B, E2, R2>(\n self: Node<A, E, R>,\n build: (reference: Planned.Planned<A>) => Node<B, E2, R2>\n ): Node<B, E | E2, R | R2> =>\n internal.makeNode<B, E | E2, R | R2>(\n internal.andThen(self.ast, (value) => build(value as Planned.Planned<A>), build)\n )\n)\n\n// Arm builders run before the graph walker can enforce its topology bound.\n// Leave native stack headroom to construct the typed refusal and unwind.\nconst maximumArmDepth = 512\nlet armDepth = 0\n\n/**\n * Builds one arm, once, against the symbolic subject.\n *\n * @private\n */\nconst arm = <A, B, E, R>(\n build: (value: Planned.Planned<A>) => Node<B, E, R>,\n subject: Planned.Planned<A>,\n side: string\n): Ast => {\n if (armDepth >= maximumArmDepth) {\n throw new GraphBuildError({\n code: \"graph_too_deep\",\n node: `${branchSubject}/${side}`,\n path: [],\n message: \"Node.branch recursion needs a plan-time bound, such as a payload-derived round count. \" +\n \"Both arms are built before the run-time predicate is evaluated.\"\n })\n }\n armDepth++\n try {\n const node = build(subject)\n if (!isNode(node)) {\n throw new GraphBuildError({\n code: \"invalid_continuation\",\n node: `${branchSubject}/${side}`,\n path: [],\n message: `Node.branch expected its \"${side}\" arm to return a Node`\n })\n }\n return node.ast\n } finally {\n armDepth--\n }\n}\n\n/**\n * Decides between two arms, both of them static topology.\n *\n * Each arm builder is evaluated exactly once, here, against a\n * {@link module:Planned.Planned} placeholder, and the resulting ASTs are what\n * the node stores — so a plan shows the exit condition and both continuations\n * before it runs. The predicate is digested and evaluated at run time on the\n * real value, which is why none of the plan-time placeholder machinery leaks\n * into control flow.\n *\n * Both arms contribute their requirements, because both arms are topology the\n * plan carries. A run takes one of them, but which one is not known until the\n * predicate sees the real value, so an execution has to be able to take either.\n *\n * @since 0.1.0\n * @category sequencing\n * @slop\n */\nexport const branch: {\n <A, B1, E1, R1, B2, E2, R2>(\n options: BranchOptions<A, B1, E1, R1, B2, E2, R2>\n ): <E, R>(self: Node<A, E, R>) => Node<B1 | B2, E | E1 | E2, R | R1 | R2>\n <A, E, R, B1, E1, R1, B2, E2, R2>(\n self: Node<A, E, R>,\n options: BranchOptions<A, B1, E1, R1, B2, E2, R2>\n ): Node<B1 | B2, E | E1 | E2, R | R1 | R2>\n} = dual(\n 2,\n <A, E, R, B1, E1, R1, B2, E2, R2>(\n self: Node<A, E, R>,\n options: BranchOptions<A, B1, E1, R1, B2, E2, R2>\n ): Node<B1 | B2, E | E1 | E2, R | R1 | R2> => {\n const predicate = options.if\n const subjectToken = `${branchSubject}/${subjects.branch++}`\n const subject = Planned.make<A>(subjectToken)\n return internal.makeNode<B1 | B2, E | E1 | E2, R | R1 | R2>(\n internal.branch(\n subjectToken,\n self.ast,\n (value) => predicate(value as A),\n predicate,\n arm(options.then, subject, \"then\"),\n arm(options.else, subject, \"else\")\n )\n )\n }\n)\n\n/**\n * Recovers from matching typed failures with static failure topology.\n *\n * The protected graph and failure arm are both stored in the AST. The arm is\n * built once at plan time against a strict planned error placeholder. With no\n * schema the whole typed error channel is handled. A schema handles only the\n * values it accepts, so its overloads retain E: a refinement can reject values\n * without narrowing its TypeScript type. Runtime schema callbacks enter the\n * filter identity along with its JSON Schema. Uncaptured callbacks are local\n * to this process, just like uncaptured mappers.\n *\n * The failure arm contributes its requirements to the node's, for the same\n * reason a branch's arms do: it is topology the plan carries, and a run reaches\n * it whenever the protected graph fails.\n *\n * @since 0.1.0\n * @category sequencing\n * @slop\n */\nconst catch_: {\n <Handled, B, E2, R2>(\n options: CatchOptions<unknown, B, E2, R2, Handled> & {\n readonly error: Schema.Schema<Handled>\n }\n ): <A, E, R>(self: Node<A, E, R>) => Node<A | B, E | E2, R | R2>\n <E, B, E2, R2>(\n options: CatchOptions<E, B, E2, R2> & {\n readonly error?: undefined\n }\n ): <A, R>(self: Node<A, E, R>) => Node<A | B, E2, R | R2>\n <A, E, R, Handled, B, E2, R2>(\n self: Node<A, E, R>,\n options: CatchOptions<E, B, E2, R2, Handled> & {\n readonly error: Schema.Schema<Handled>\n }\n ): Node<A | B, E | E2, R | R2>\n <A, E, R, B, E2, R2>(\n self: Node<A, E, R>,\n options: CatchOptions<E, B, E2, R2> & {\n readonly error?: undefined\n }\n ): Node<A | B, E2, R | R2>\n} = dual(\n 2,\n <A, E, R, Handled, B, E2, R2>(\n self: Node<A, E, R>,\n options: CatchOptions<E, B, E2, R2, Handled>\n ): Node<A | B, E | E2, R | R2> => {\n const subjectToken = `${catchSubject}/${subjects.catch++}`\n const failure = options.onFailure(Planned.make<Handled>(subjectToken))\n if (!isNode(failure)) {\n throw new GraphBuildError({\n code: \"invalid_continuation\",\n node: catchSubject,\n path: [],\n message: \"Node.catch expected its failure arm to return a Node\"\n })\n }\n return internal.makeNode(internal.catch_(subjectToken, self.ast, failure.ast, options.error))\n }\n)\n\nexport { catch_ as catch }\n\n/**\n * Attaches a scheduling priority to a node, leaving the original unchanged.\n *\n * The scheduler runs ready work with a higher number first, so a priority\n * changes LATENCY and nothing else. It never enters key material: a node\n * ordered ahead of another still computes the same result, so re-keying it\n * would throw away a legitimate cache hit. Children inherit the value\n * lexically when the graph is built, and a child that states its own keeps it.\n *\n * @since 0.1.0\n * @category annotations\n * @slop\n */\nexport const priority: {\n (value: number): <A, E, R>(self: Node<A, E, R>) => Node<A, E, R>\n <A, E, R>(self: Node<A, E, R>, value: number): Node<A, E, R>\n} = dual(\n 2,\n <A, E, R>(self: Node<A, E, R>, value: number): Node<A, E, R> => {\n if (!Number.isSafeInteger(value)) {\n throw new GraphBuildError({\n code: \"invalid_priority\",\n node: self.ast._tag,\n path: [],\n message: `Node.priority expects a safe integer, received ${value}`\n })\n }\n return internal.makeNode<A, E, R>(internal.withPriority(self.ast, value))\n }\n)\n\n/**\n * Reads the scheduling priority a node carries, or `undefined` when it states\n * none and inherits from whatever encloses it.\n *\n * @since 0.1.0\n * @category accessors\n * @slop\n */\nexport const declaredPriority = (ast: Ast): number | undefined => ast.priority\n\n/**\n * Constructs the flow-call node used by `@smthrs/flow` without making flow\n * calls part of the public authoring surface of this package.\n *\n * Reserved for `@smthrs/flow`, which owns flow authoring. It is not part\n * of this package's authoring surface, and it validates nothing: an unknown\n * flow tag becomes a call node the graph keeps as a leaf.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const flowCall = <A = unknown, E = never, R = never>(\n declaration: unknown,\n flow: string,\n mode: CallMode,\n payload: unknown\n): Node<A, E, R> => internal.makeNode<A, E, R>(internal.flowCall(declaration, flow, mode, payload))\n\n/**\n * Constructs the action-call node used by `@smthrs/flow` without making\n * action calls part of the public authoring surface of this package.\n *\n * Reserved for `@smthrs/flow`, which owns action authoring. It is not part\n * of this package's authoring surface, and an unknown action tag becomes a\n * call node the graph keeps as a leaf.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const actionCall = <A = unknown, E = never, R = never>(\n declaration: unknown,\n action: string,\n payload: unknown\n): Node<A, E, R> => internal.makeNode<A, E, R>(internal.actionCall(declaration, action, payload))\n\n/**\n * Reads the flow or action declaration a call node names, so `@smthrs/flow`\n * can expand a call it recorded. It is `undefined` for an AST that was\n * rehydrated from JSON, because the declaration lives beside the AST rather\n * than inside it — a graph built from such an AST keeps the call as a leaf.\n *\n * Reserved for `@smthrs/flow`, which files the declaration when it builds\n * the call. Authors never call it.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const declaration = (\n ast: Extract<Ast, { readonly _tag: \"ActionCall\" | \"FlowCall\" }>\n): unknown => internal.declaration(ast)\n\n/**\n * Reads the continuation builder of a sequenced node, which graph building\n * evaluates once against a placeholder. It is `undefined` when the author\n * supplied a node directly — the topology is already in `next` — and for a\n * rehydrated AST, whose side table did not survive serialization.\n *\n * Reserved for `@smthrs/flow`'s graph walk. Authors never call it.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const continuation = (\n ast: Extract<Ast, { readonly _tag: \"AndThen\" }>\n): ((value: Planned.Planned<unknown>) => unknown) | undefined => internal.operation(ast)\n\n/**\n * Reads the deferred mapper of a {@link map} node, which a driver applies to\n * the real upstream value once it has one. It is `undefined` for every other\n * variant, and for a rehydrated AST whose side table did not survive\n * serialization.\n *\n * Reserved for `@smthrs/flow`'s interpreter. Authors never call it.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const mapper = (ast: Ast): ((value: unknown) => unknown) | undefined =>\n ast._tag === \"Map\" ? internal.operation(ast) : undefined\n\n/**\n * Reads the run-time predicate of a {@link branch} node, which a driver\n * evaluates on the real subject value to choose an arm. It is `undefined` for\n * every other variant, and for a rehydrated AST whose side table did not\n * survive serialization.\n *\n * Reserved for `@smthrs/flow`'s interpreter. Authors never call it.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const predicate = (ast: Ast): ((value: unknown) => boolean) | undefined =>\n ast._tag === \"Branch\" ? internal.predicate(ast) : undefined\n\n/**\n * Reads the optional schema selecting failures handled by a {@link catch_}.\n *\n * Reserved for `@smthrs/flow`'s interpreter. It is `undefined` for every\n * variant but `catch_`, and for a rehydrated AST whose side table did not\n * survive serialization.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const catchFilter = (ast: Ast): Schema.Top | undefined => ast._tag === \"Catch\" ? internal.filter(ast) : undefined\n\n/**\n * Identifies a plan-time function the AST does NOT store, a flow's `body`,\n * exactly as the AST identifies the mapper and continuation it does store.\n * A call that keeps its callee as a leaf still has to re-key when that\n * callee's body is edited, and this is the identity it folds in. Unannotated\n * functions fail closed with process-local identity; use {@link capture} to\n * declare inert captures and obtain deterministic identity.\n *\n * Reserved for `@smthrs/flow`, which folds a callee body's identity into a\n * call it keeps as a leaf. Authors never call it; it throws a `TypeError`\n * when handed anything but a function.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const functionIdentity = (operation: unknown): FunctionIdentity => internal.functionIdentity(operation)\n\n/**\n * The document a schema's identity is: JSON-Schema-shaped, and the same bytes\n * under every `effect` release this package supports.\n *\n * @since 1.0.0\n * @category engine\n */\nexport type SchemaIdentity = internalSchemaIdentity.Document\n\n/**\n * The one option a schema's identity is taken under: whether an object closes\n * over the keys it declares (`\"error\"`) or leaves others open (`\"ignore\"`,\n * the default). It has the meaning it has in `Schema.toJsonSchemaDocument`.\n *\n * @since 1.0.0\n * @category engine\n */\nexport type SchemaIdentityOptions = internalSchemaIdentity.Options\n\n/**\n * The refusal `schemaIdentity` and `representationIdentity` raise for a schema\n * a step key cannot be derived from. Its message is the one\n * `effect@4.0.0-rc.115` gave for the same schema, where it gave one.\n *\n * @since 1.0.0\n * @category errors\n */\nexport const SchemaIdentityError = internalSchemaIdentity.SchemaIdentityError\n\n/**\n * The type of {@link SchemaIdentityError}.\n *\n * @since 1.0.0\n * @category errors\n */\nexport type SchemaIdentityError = internalSchemaIdentity.SchemaIdentityError\n\n/**\n * Identifies a schema by the constraints it documents, so a call re-keys when\n * what its callee accepts or produces changes, and a catch re-keys when its\n * filter does.\n *\n * The document is what `Schema.toJsonSchemaDocument(schema, options)`\n * returned under `effect@4.0.0-rc.115`. It is printed by this package, not by\n * the installed `effect`, because a later release prints a different document\n * for the same schema and a moved identity re-keys every recorded step. Use\n * it wherever the document is hashed, compared or pinned; a JSON Schema shown\n * to a model or a person comes from `Schema.toJsonSchemaDocument`.\n *\n * Reserved for the packages that derive identities. Authors never call it; it\n * throws for a schema that has no JSON Schema form.\n *\n * @since 1.0.0\n * @category engine\n */\nexport const schemaIdentity = (schema: Schema.Top, options?: SchemaIdentityOptions): SchemaIdentity =>\n internalSchemaIdentity.schemaIdentity(schema, options)\n\n/**\n * Identifies a schema AST by its encoded representation, the material a\n * sealed action's step key folds in for its success and error schemas.\n *\n * The value is what `SchemaRepresentation.toJson(SchemaRepresentation.toRepresentation(ast))`\n * returned under `effect@4.0.0-rc.115`, so a later `effect` release does not\n * re-key recorded steps. The one exception is `Schema.brand`: from\n * `effect@4.0.4` on a brand is not part of the AST, so a declaration with a\n * brand re-keys once.\n *\n * Reserved for the packages that derive step keys. Authors never call it; it\n * throws for an AST that has no representation.\n *\n * @since 1.0.0\n * @category engine\n */\nexport const representationIdentity = (ast: SchemaAST.AST): Schema.Json =>\n internalSchemaIdentity.representationIdentity(ast)\n\n/**\n * Binds a frozen plain copy of inert captures as the callback's this receiver.\n *\n * Use a function expression to read the snapshot while keeping the ordinary\n * callback arguments: Node.capture({ factor: 3 }, function(value: number) {\n * return value * this.factor\n * }). Caller objects remain unchanged; lexical aliases still name originals\n * and must not be used as mutable semantic inputs. Nested captures retain the\n * inner callback's snapshot and compose the two identities.\n *\n * Admission walks original descriptors once, rejects built-in brands and\n * non-plain prototypes without evaluating getters, then uses structuredClone\n * to refuse Proxies. Hosts without that API refuse object capture. Only the\n * owned frozen copy enters identity and the wrapper. Sealed, non-extensible,\n * frozen and Immer ordinary data are supported equally. Unsupported values\n * raise a TypeError naming the path. See core docs/api.md#nodecapture for the\n * complete algorithm and the migration from original-object locking.\n *\n * @category constructors\n * @since 0.1.0\n * @slop\n */\nexport const capture = <C extends Readonly<Record<string, unknown>>, Args extends ReadonlyArray<unknown>, A>(\n captures: C,\n operation: (this: Readonly<C>, ...args: Args) => A\n): (...args: Args) => A => internal.capture(captures, operation)\n"]}
|
|
1
|
+
{"version":3,"file":"Node.js","sourceRoot":"","sources":["../../src/Node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAKtC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAC9C,OAAO,KAAK,sBAAsB,MAAM,8BAA8B,CAAA;AACtE,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC;;;;;;GAMG;AACH,MAAM,CAAC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;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAkB,EAAoB,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAA;AAqB9G;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,mBAAmB,CAAA;AAU7E;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAkB,EAAE,OAA+B,EAAkB,EAAE,CACpG,sBAAsB,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAExD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAkB,EAAe,EAAE,CACxE,sBAAsB,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,QAAW,EACX,SAAkD,EAC5B,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA","sourcesContent":["/**\n * Pure, pipeable nodes: the shape a flow body describes and nothing more.\n *\n * Building a node records an inspectable AST and executes nothing — the same\n * split as Bazel's `ctx.actions.run`, which declares an action rather than\n * running one. A plan is\n * always a DAG, so there is no loop node here and never will be: repetition\n * lives one level up, in what a flow settles with.\n *\n * A node also carries Effect's requirement channel, `R`, and carries it as a\n * PHANTOM: building a plan demands nothing, and every combinator here unions\n * `R` without ever reading it. What fills the channel is a call to something\n * whose code lives elsewhere — an action — so the type of a plan states which\n * implementations executing it will need, and the place that executes it is\n * where the compiler asks for them.\n *\n * Control flow is structure. {@link branch} takes both arms and evaluates each\n * ONCE, symbolically, so the exit condition and the handoff site are visible\n * topology before anything runs; its predicate is digested and runs later on\n * the real value. {@link map} is transformation only. The rule the authoring\n * note states, and this module encodes: **map transforms; branch decides.**\n *\n * Adapted from `@smthrs/core` (`packages/smithers/flows/core`) `Node.ts`.\n * `Dynamic` is gone — a model call is an ordinary action, and nothing\n * model-shaped belongs in this package — and node annotations are gone with\n * it, because the AST has to stay JSON serializable.\n *\n * @since 0.1.0\n */\n\nimport { dual } from \"effect/Function\"\nimport type * as Pipeable from \"effect/Pipeable\"\nimport type * as Schema from \"effect/Schema\"\nimport type * as SchemaAST from \"effect/SchemaAST\"\nimport type * as Types from \"effect/Types\"\nimport { GraphBuildError } from \"./GraphBuildError.ts\"\nimport * as internal from \"./internal/node.ts\"\nimport * as internalSchemaIdentity from \"./internal/SchemaIdentity.ts\"\nimport * as Planned from \"./Planned.ts\"\n\n/**\n * The runtime type identifier carried by every node.\n *\n * @since 0.1.0\n * @category type ids\n * @slop\n */\nexport const TypeId: TypeId = internal.TypeId\n\n/**\n * The type-level form of {@link TypeId}.\n *\n * @since 0.1.0\n * @category type ids\n * @slop\n */\nexport type TypeId = \"~@smthrs/plan/Node\"\n\n/**\n * The inspectable AST a node stores: closure-free, and JSON serializable for\n * every JSON payload an author puts in it.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Ast = internal.NodeAst\n\n/**\n * How a flow call joins the caller's plan: `inline` splices the callee's body\n * in, `boundary` makes it one child execution, and `handoff` names the next\n * trampoline round.\n *\n * This is the ONE call-mode vocabulary. {@link flowCall} takes it and\n * `@smthrs/flow`'s graph builder switches on it, so a second spelling in\n * either package would fork the moment one gained a mode.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport const CallMode = internal.CallMode\n\n/**\n * The value form of {@link CallMode}.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type CallMode = internal.CallMode\n\n/**\n * The serializable stand-in an AST keeps for a plan-time function: a digest of\n * its normalized source, hashed in place of a closure that could not be\n * shipped, stored, or compared.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type FunctionIdentity = Extract<Ast, { readonly _tag: \"Map\" }>[\"mapper\"]\n\n/**\n * Reads the inert AST reference created for a planned value.\n *\n * Structural lookalikes remain ordinary payload data. This accessor is the\n * only recognition path because the marker itself is deliberately private to\n * the AST cloner.\n *\n * @since 1.0.0\n * @category accessors\n */\nexport const plannedReference = internal.plannedReference\n\n/**\n * A pure graph-building value, covariant in what it will succeed and fail\n * with and in what it will need to run. It is a description: holding one has\n * run nothing.\n *\n * `R` is Effect's requirement channel, and it is PHANTOM here. Nothing at plan\n * time reads it: the AST, the graph built from it, its key material, and every\n * digest are identical whatever `R` says. It exists so a value that names an\n * implementation it does not carry — an action call — can say so in its type,\n * and so the place that finally has to run that implementation can demand it.\n * Building a plan therefore stays requirement-free; only executing one is not.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport interface Node<out A, out E = never, out R = never> extends Pipeable.Pipeable {\n readonly [TypeId]: {\n readonly _A: Types.Covariant<A>\n readonly _E: Types.Covariant<E>\n readonly _R: Types.Covariant<R>\n }\n readonly ast: Ast\n}\n\n/**\n * Any node, whatever it succeeds or fails with and whatever it requires.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Any = Node<unknown, unknown, any>\n\n/**\n * The success type of a node.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Success<N> = N extends Node<infer A, infer _E, infer _R> ? A : never\n\n/**\n * The error type of a node.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Error<N> = N extends Node<infer _A, infer E, infer _R> ? E : never\n\n/**\n * The requirements of a node: what has to be provided wherever it is finally\n * executed, and nothing that has to be provided to build it.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport type Services<N> = N extends Node<infer _A, infer _E, infer R> ? R : never\n\n/**\n * The node reference a branch arm's symbolic subject carries. Arms are built\n * before the graph assigns ids, so every reference an arm records names this\n * placeholder, and graph building rewrites it to the branch's own upstream\n * node — which is `first`, structurally, and therefore not a guess.\n *\n * @since 0.1.0\n * @category constants\n * @slop\n */\nexport const branchSubject = \"branch/subject\"\n\n/** @private */\nconst subjectsKey = Symbol.for(\"@smthrs/plan/Node/subjects/v1\")\nconst globals = globalThis as typeof globalThis & { [subjectsKey]?: { branch: number; catch: number } }\nconst subjects = globals[subjectsKey] ??= { branch: 0, catch: 0 }\n\n/**\n * The prefix of the node reference a catch failure arm's symbolic error\n * carries. Each {@link catch_} mints its own token under this prefix, so an\n * outer error captured inside a nested failure arm keeps naming the outer\n * catch, and graph building rewrites each token to the node that catch\n * protects.\n *\n * @since 0.1.0\n * @category constants\n * @slop\n */\nexport const catchSubject = \"catch/subject\"\n\n/**\n * The two arms of a decision plus the predicate that chooses between them.\n *\n * `if` runs at RUN time on the real value. `then` and `else` run at PLAN time,\n * once each, against a {@link module:Planned.Planned} placeholder — they\n * describe topology, so they may pass the value on but never compute on it.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport interface BranchOptions<A, B1, E1, R1, B2, E2, R2> {\n readonly if: (value: A) => boolean\n readonly then: (value: Planned.Planned<A>) => Node<B1, E1, R1>\n readonly else: (value: Planned.Planned<A>) => Node<B2, E2, R2>\n}\n\n/**\n * The statically planned recovery arm and optional schema selecting which\n * typed failures it handles.\n *\n * @since 0.1.0\n * @category models\n * @slop\n */\nexport interface CatchOptions<E, B, E2, R2 = never, Handled = E> {\n readonly error?: Schema.Schema<Handled> | undefined\n readonly onFailure: (error: Planned.Planned<Handled>) => Node<B, E2, R2>\n}\n\n/**\n * Checks whether a value is a node.\n *\n * A node this package built is recognized by registration at construction. A\n * node that crossed a serialization boundary, an object sharing the node\n * prototype whose own `ast` is a well-formed AST, is recognized by that shape,\n * because `@smthrs/flow` hands a rehydrated AST back as a node and its side\n * tables are all a round trip loses. The {@link TypeId} marker is a public\n * string any object can carry, so it counts for nothing on its own: every\n * combinator that admits a node reads its `ast` as trusted topology, and an\n * object carrying the marker on any other prototype, one inheriting it from a\n * node, and one whose `ast` is missing, malformed, cyclic, or an accessor are\n * all refused with the same `GraphBuildError` as any other non-node. A proxy\n * is judged by the shape it forwards: one that forwards a node unchanged\n * passes, and one that diverges from it does not.\n *\n * @since 0.1.0\n * @category guards\n * @slop\n */\nexport const isNode = (value: unknown): value is Any => internal.isNode(value)\n\n/**\n * The inert value delivered by {@link succeed}. Planned references resolve to\n * their result type; other values follow the payload's JSON projection.\n * Invalid dates serialize to null. Members without a JSON representation are\n * omitted from objects and replaced with null in arrays.\n *\n * @since 1.0.0\n * @category models\n */\nexport type Succeed<A> = A extends Planned.Planned<infer Value> ? Value\n : A extends Date ? string | null\n : A extends { toJSON: (...args: any) => infer Value } ? Succeed<Value>\n : A extends (...args: any) => any ? undefined\n : A extends symbol ? undefined\n : A extends ReadonlyArray<unknown> ? { [K in keyof A]: SucceedArrayMember<A[K]> }\n : A extends object ? {\n [K in keyof A as K extends string | number ? [Succeed<A[K]>] extends [undefined] ? never : K : never]: Succeed<\n A[K]\n >\n }\n : A\n\n/** @private */\ntype SucceedArrayMember<A> = A extends Planned.Planned<infer Value> ? Value\n : A extends unknown ? Succeed<A> extends infer Value ? Value extends undefined ? null : Value\n : never\n : never\n\n/**\n * A node that succeeds with the constant's inert JSON projection.\n *\n * Dates produce strings (or null for invalid dates), URLs produce strings,\n * and callable object members are omitted. Use {@link map} to reconstruct a\n * domain value explicitly after this serialization boundary.\n *\n * @since 0.1.0\n * @category constructors\n */\nexport const succeed = <A>(value: A): Node<Succeed<A>> => internal.makeNode<Succeed<A>>(internal.succeed(value))\n\n/**\n * The inert error delivered by {@link fail}: the same JSON projection\n * {@link Succeed} describes, because a plan stores an error exactly as it\n * stores a value.\n *\n * @since 1.0.0\n * @category models\n */\nexport type Fail<E> = Succeed<E>\n\n/**\n * A node that fails with the constant's inert JSON projection, in the typed\n * error channel.\n *\n * It is how a plan states a refusal it already knows about — an unsupported\n * input, an exhausted budget, a compensation that has nothing left to undo —\n * without an action that exists only to fail. {@link catch} recovers it exactly\n * as it recovers an action's failure, and an uncaught one is the flow's typed\n * failure.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const fail = <E>(error: E): Node<never, Fail<E>> => internal.makeNode<never, Fail<E>>(internal.fail(error))\n\n/**\n * Combines independent children into one node, keyed by name.\n *\n * Width is fixed here, at plan time. Fanning out over something a step\n * discovered is not this: end the round and carry the list in the next flow's\n * payload, where it is real data.\n *\n * @since 0.1.0\n * @category constructors\n * @slop\n */\nexport const all = <const Nodes extends Readonly<Record<string, Any>>>(\n nodes: Nodes\n): Node<\n Types.Simplify<{ readonly [K in keyof Nodes]: Success<Nodes[K]> }>,\n Error<Nodes[keyof Nodes]>,\n Services<Nodes[keyof Nodes]>\n> => internal.makeNode(internal.all(memberAsts(nodes, \"all\", \"invalid_all_member\")))\n\n/**\n * The member ASTs of a combination, keyed by name, refusing a non-node member.\n *\n * @private\n */\nconst memberAsts = (\n nodes: Readonly<Record<string, unknown>>,\n combinator: string,\n code: \"invalid_all_member\" | \"invalid_join\"\n): Record<string, Ast> => {\n const asts: Record<string, Ast> = Object.create(null) as Record<string, Ast>\n for (const [member, node] of Object.entries(nodes)) {\n if (!isNode(node)) {\n throw new GraphBuildError({\n code,\n node: member,\n path: [],\n message: `Node.${combinator} expected a Node at member \"${member}\"`\n })\n }\n Object.defineProperty(asts, member, {\n configurable: true,\n enumerable: true,\n value: node.ast,\n writable: true\n })\n }\n return asts\n}\n\n/**\n * Builds a join that settles early, refusing a member set it could never\n * decide on.\n *\n * @private\n */\nconst join = (mode: internal.RaceMode, count: number, nodes: Readonly<Record<string, unknown>>): Ast => {\n const asts = memberAsts(nodes, mode, \"invalid_join\")\n const width = Object.keys(asts).length\n if (!internal.isRaceCount(mode, count, width)) {\n throw new GraphBuildError({\n code: \"invalid_join\",\n node: mode,\n path: [],\n message: mode === \"quorum\"\n ? `Node.quorum needs a whole number of successes between 1 and its ${width} members, got ${String(count)}`\n : `Node.${mode} needs at least one member`\n })\n }\n return internal.race(mode, count, asts)\n}\n\n/**\n * The members of an early-settling join, keyed by name.\n *\n * @since 1.0.0\n * @category models\n */\nexport type Members = Readonly<Record<string, Any>>\n\n/**\n * Settles with the first member to settle, success or typed failure.\n *\n * The other members are interrupted. The winner is journaled, so a resumed run\n * settles the same member and never starts the others again.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const race = <const Nodes extends Members>(\n nodes: Nodes\n): Node<Success<Nodes[keyof Nodes]>, Error<Nodes[keyof Nodes]>, Services<Nodes[keyof Nodes]>> =>\n internal.makeNode(join(\"race\", 1, nodes))\n\n/**\n * Settles with the first member to succeed, ignoring typed failures while a\n * member is still running.\n *\n * It fails with the last failure when every member fails. The other members\n * are interrupted, and the winner is journaled as {@link race} journals it.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const any = <const Nodes extends Members>(\n nodes: Nodes\n): Node<Success<Nodes[keyof Nodes]>, Error<Nodes[keyof Nodes]>, Services<Nodes[keyof Nodes]>> =>\n internal.makeNode(join(\"any\", 1, nodes))\n\n/**\n * Succeeds once `count` members succeed, with exactly those members' values\n * keyed by name.\n *\n * It fails with the failure that leaves fewer than `count` members able to\n * succeed. Either way the members still running are interrupted, and the\n * members that decided are journaled as {@link race} journals its winner.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const quorum = <const Nodes extends Members>(\n count: number,\n nodes: Nodes\n): Node<\n Types.Simplify<{ readonly [K in keyof Nodes]?: Success<Nodes[K]> }>,\n Error<Nodes[keyof Nodes]>,\n Services<Nodes[keyof Nodes]>\n> => internal.makeNode(join(\"quorum\", count, nodes))\n\n/**\n * Transforms an eventual success value with a deferred pure function.\n *\n * The function is digested, not run: it executes later, on the real value.\n * This is where computation on a step result belongs — and only computation. A\n * `map` that decides what happens next is a `branch` written wrongly.\n *\n * @since 0.1.0\n * @category mapping\n * @slop\n */\nexport const map: {\n <A, B>(f: (a: A) => B): <E, R>(self: Node<A, E, R>) => Node<B, E, R>\n <A, E, R, B>(self: Node<A, E, R>, f: (a: A) => B): Node<B, E, R>\n} = dual(\n 2,\n <A, E, R, B>(self: Node<A, E, R>, f: (a: A) => B): Node<B, E, R> =>\n internal.makeNode<B, E, R>(internal.map(self.ast, (value) => f(value as A), f))\n)\n\n/**\n * Starts the entire next subtree only after this node succeeds, without\n * consuming its result. Failure or interruption prevents that subtree from\n * starting, including actions nested inside combinations or inline flows.\n *\n * Use {@link bindPlanned} to build a dependency from a symbolic result, or\n * {@link map} to compute on the eventual value.\n *\n * @since 0.1.0\n * @category sequencing\n * @slop\n */\nexport const andThen: {\n <B, E2, R2>(next: Node<B, E2, R2>): <A, E, R>(self: Node<A, E, R>) => Node<B, E | E2, R | R2>\n <A, E, R, B, E2, R2>(self: Node<A, E, R>, next: Node<B, E2, R2>): Node<B, E | E2, R | R2>\n} = dual(\n 2,\n <A, E, R, B, E2, R2>(\n self: Node<A, E, R>,\n next: Node<B, E2, R2>\n ): Node<B, E | E2, R | R2> => {\n if (!isNode(next)) {\n throw new GraphBuildError({\n code: \"invalid_continuation\",\n node: \"andThen/next\",\n path: [],\n message:\n \"Node.andThen expects a Node; use Node.bindPlanned for a symbolic builder or Node.map for value computation\"\n })\n }\n return internal.makeNode<B, E | E2, R | R2>(internal.andThenNode(self.ast, next.ast))\n }\n)\n\n/**\n * Builds a dependency using a symbolic reference to this node's future result.\n *\n * The builder runs during planning. Its argument is a {@link module:Planned.Planned}\n * reference, not the value the node will eventually produce. Pass references\n * into action payloads; use {@link branch} for decisions and {@link map} for\n * computation on real results. JavaScript truthiness and reference equality\n * cannot inspect a planned result. Enable type-aware ESLint's\n * `@typescript-eslint/strict-boolean-expressions` to reject planned conditions.\n * Independent descendants of the built subtree can start while this producer\n * is running; consumers of its reference wait for its value. Use\n * {@link andThen} when the whole next subtree must wait for success.\n *\n * @since 1.0.0\n * @category sequencing\n */\nexport const bindPlanned: {\n <A, B, E2, R2>(\n build: (reference: Planned.Planned<A>) => Node<B, E2, R2>\n ): <E, R>(self: Node<A, E, R>) => Node<B, E | E2, R | R2>\n <A, E, R, B, E2, R2>(\n self: Node<A, E, R>,\n build: (reference: Planned.Planned<A>) => Node<B, E2, R2>\n ): Node<B, E | E2, R | R2>\n} = dual(\n 2,\n <A, E, R, B, E2, R2>(\n self: Node<A, E, R>,\n build: (reference: Planned.Planned<A>) => Node<B, E2, R2>\n ): Node<B, E | E2, R | R2> =>\n internal.makeNode<B, E | E2, R | R2>(\n internal.andThen(self.ast, (value) => build(value as Planned.Planned<A>), build)\n )\n)\n\n/**\n * Maximum eagerly nested branch arms. Arm construction precedes graph walking;\n * this bound leaves native stack headroom for a typed refusal.\n *\n * @since 1.0.0\n * @category constants\n */\nexport const maximumArmDepth = 512\nlet armDepth = 0\n\n/**\n * Builds one arm, once, against the symbolic subject.\n *\n * @private\n */\nconst arm = <A, B, E, R>(\n build: (value: Planned.Planned<A>) => Node<B, E, R>,\n subject: Planned.Planned<A>,\n side: string\n): Ast => {\n if (armDepth >= maximumArmDepth) {\n throw new GraphBuildError({\n code: \"graph_too_deep\",\n node: `${branchSubject}/${side}`,\n path: [],\n message: \"Node.branch recursion needs a plan-time bound, such as a payload-derived round count. \" +\n \"Both arms are built before the run-time predicate is evaluated.\"\n })\n }\n armDepth++\n try {\n const node = build(subject)\n if (!isNode(node)) {\n throw new GraphBuildError({\n code: \"invalid_continuation\",\n node: `${branchSubject}/${side}`,\n path: [],\n message: `Node.branch expected its \"${side}\" arm to return a Node`\n })\n }\n return node.ast\n } finally {\n armDepth--\n }\n}\n\n/**\n * Decides between two arms, both of them static topology.\n *\n * Each arm builder is evaluated exactly once, here, against a\n * {@link module:Planned.Planned} placeholder, and the resulting ASTs are what\n * the node stores — so a plan shows the exit condition and both continuations\n * before it runs. The predicate is digested and evaluated at run time on the\n * real value, which is why none of the plan-time placeholder machinery leaks\n * into control flow.\n *\n * Both arms contribute their requirements, because both arms are topology the\n * plan carries. A run takes one of them, but which one is not known until the\n * predicate sees the real value, so an execution has to be able to take either.\n *\n * @since 0.1.0\n * @category sequencing\n * @slop\n */\nexport const branch: {\n <A, B1, E1, R1, B2, E2, R2>(\n options: BranchOptions<A, B1, E1, R1, B2, E2, R2>\n ): <E, R>(self: Node<A, E, R>) => Node<B1 | B2, E | E1 | E2, R | R1 | R2>\n <A, E, R, B1, E1, R1, B2, E2, R2>(\n self: Node<A, E, R>,\n options: BranchOptions<A, B1, E1, R1, B2, E2, R2>\n ): Node<B1 | B2, E | E1 | E2, R | R1 | R2>\n} = dual(\n 2,\n <A, E, R, B1, E1, R1, B2, E2, R2>(\n self: Node<A, E, R>,\n options: BranchOptions<A, B1, E1, R1, B2, E2, R2>\n ): Node<B1 | B2, E | E1 | E2, R | R1 | R2> => {\n const predicate = options.if\n const subjectToken = `${branchSubject}/${subjects.branch++}`\n const subject = Planned.make<A>(subjectToken)\n return internal.makeNode<B1 | B2, E | E1 | E2, R | R1 | R2>(\n internal.branch(\n subjectToken,\n self.ast,\n (value) => predicate(value as A),\n predicate,\n arm(options.then, subject, \"then\"),\n arm(options.else, subject, \"else\")\n )\n )\n }\n)\n\n/**\n * Recovers from matching typed failures with static failure topology.\n *\n * The protected graph and failure arm are both stored in the AST. The arm is\n * built once at plan time against a strict planned error placeholder. With no\n * schema the whole typed error channel is handled. A schema handles only the\n * values it accepts, so its overloads retain E: a refinement can reject values\n * without narrowing its TypeScript type. Runtime schema callbacks enter the\n * filter identity along with its JSON Schema. Uncaptured callbacks are local\n * to this process, just like uncaptured mappers.\n *\n * The failure arm contributes its requirements to the node's, for the same\n * reason a branch's arms do: it is topology the plan carries, and a run reaches\n * it whenever the protected graph fails.\n *\n * @since 0.1.0\n * @category sequencing\n * @slop\n */\nconst catch_: {\n <Handled, B, E2, R2>(\n options: CatchOptions<unknown, B, E2, R2, Handled> & {\n readonly error: Schema.Schema<Handled>\n }\n ): <A, E, R>(self: Node<A, E, R>) => Node<A | B, E | E2, R | R2>\n <E, B, E2, R2>(\n options: CatchOptions<E, B, E2, R2> & {\n readonly error?: undefined\n }\n ): <A, R>(self: Node<A, E, R>) => Node<A | B, E2, R | R2>\n <A, E, R, Handled, B, E2, R2>(\n self: Node<A, E, R>,\n options: CatchOptions<E, B, E2, R2, Handled> & {\n readonly error: Schema.Schema<Handled>\n }\n ): Node<A | B, E | E2, R | R2>\n <A, E, R, B, E2, R2>(\n self: Node<A, E, R>,\n options: CatchOptions<E, B, E2, R2> & {\n readonly error?: undefined\n }\n ): Node<A | B, E2, R | R2>\n} = dual(\n 2,\n <A, E, R, Handled, B, E2, R2>(\n self: Node<A, E, R>,\n options: CatchOptions<E, B, E2, R2, Handled>\n ): Node<A | B, E | E2, R | R2> => {\n const subjectToken = `${catchSubject}/${subjects.catch++}`\n const failure = options.onFailure(Planned.make<Handled>(subjectToken))\n if (!isNode(failure)) {\n throw new GraphBuildError({\n code: \"invalid_continuation\",\n node: catchSubject,\n path: [],\n message: \"Node.catch expected its failure arm to return a Node\"\n })\n }\n return internal.makeNode(internal.catch_(subjectToken, self.ast, failure.ast, options.error))\n }\n)\n\nexport { catch_ as catch }\n\n/**\n * Attaches a scheduling priority to a node, leaving the original unchanged.\n *\n * The scheduler runs ready work with a higher number first, so a priority\n * changes LATENCY and nothing else. It never enters key material: a node\n * ordered ahead of another still computes the same result, so re-keying it\n * would throw away a legitimate cache hit. Children inherit the value\n * lexically when the graph is built, and a child that states its own keeps it.\n *\n * @since 0.1.0\n * @category annotations\n * @slop\n */\nexport const priority: {\n (value: number): <A, E, R>(self: Node<A, E, R>) => Node<A, E, R>\n <A, E, R>(self: Node<A, E, R>, value: number): Node<A, E, R>\n} = dual(\n 2,\n <A, E, R>(self: Node<A, E, R>, value: number): Node<A, E, R> => {\n if (!Number.isSafeInteger(value)) {\n throw new GraphBuildError({\n code: \"invalid_priority\",\n node: self.ast._tag,\n path: [],\n message: `Node.priority expects a safe integer, received ${value}`\n })\n }\n return internal.makeNode<A, E, R>(internal.withPriority(self.ast, value))\n }\n)\n\n/**\n * Reads the scheduling priority a node carries, or `undefined` when it states\n * none and inherits from whatever encloses it.\n *\n * @since 0.1.0\n * @category accessors\n * @slop\n */\nexport const declaredPriority = (ast: Ast): number | undefined => ast.priority\n\n/**\n * Constructs the flow-call node used by `@smthrs/flow` without making flow\n * calls part of the public authoring surface of this package.\n *\n * Reserved for `@smthrs/flow`, which owns flow authoring. It is not part\n * of this package's authoring surface, and it validates nothing: an unknown\n * flow tag becomes a call node the graph keeps as a leaf.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const flowCall = <A = unknown, E = never, R = never>(\n declaration: unknown,\n flow: string,\n mode: CallMode,\n payload: unknown\n): Node<A, E, R> => internal.makeNode<A, E, R>(internal.flowCall(declaration, flow, mode, payload))\n\n/**\n * Constructs the action-call node used by `@smthrs/flow` without making\n * action calls part of the public authoring surface of this package.\n *\n * Reserved for `@smthrs/flow`, which owns action authoring. It is not part\n * of this package's authoring surface, and an unknown action tag becomes a\n * call node the graph keeps as a leaf.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const actionCall = <A = unknown, E = never, R = never>(\n declaration: unknown,\n action: string,\n payload: unknown\n): Node<A, E, R> => internal.makeNode<A, E, R>(internal.actionCall(declaration, action, payload))\n\n/**\n * Reads the flow or action declaration a call node names, so `@smthrs/flow`\n * can expand a call it recorded. It is `undefined` for an AST that was\n * rehydrated from JSON, because the declaration lives beside the AST rather\n * than inside it — a graph built from such an AST keeps the call as a leaf.\n *\n * Reserved for `@smthrs/flow`, which files the declaration when it builds\n * the call. Authors never call it.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const declaration = (\n ast: Extract<Ast, { readonly _tag: \"ActionCall\" | \"FlowCall\" }>\n): unknown => internal.declaration(ast)\n\n/**\n * Reads the continuation builder of a sequenced node, which graph building\n * evaluates once against a placeholder. It is `undefined` when the author\n * supplied a node directly — the topology is already in `next` — and for a\n * rehydrated AST, whose side table did not survive serialization.\n *\n * Reserved for `@smthrs/flow`'s graph walk. Authors never call it.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const continuation = (\n ast: Extract<Ast, { readonly _tag: \"AndThen\" }>\n): ((value: Planned.Planned<unknown>) => unknown) | undefined => internal.operation(ast)\n\n/**\n * Reads the deferred mapper of a {@link map} node, which a driver applies to\n * the real upstream value once it has one. It is `undefined` for every other\n * variant, and for a rehydrated AST whose side table did not survive\n * serialization.\n *\n * Reserved for `@smthrs/flow`'s interpreter. Authors never call it.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const mapper = (ast: Ast): ((value: unknown) => unknown) | undefined =>\n ast._tag === \"Map\" ? internal.operation(ast) : undefined\n\n/**\n * Reads the run-time predicate of a {@link branch} node, which a driver\n * evaluates on the real subject value to choose an arm. It is `undefined` for\n * every other variant, and for a rehydrated AST whose side table did not\n * survive serialization.\n *\n * Reserved for `@smthrs/flow`'s interpreter. Authors never call it.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const predicate = (ast: Ast): ((value: unknown) => boolean) | undefined =>\n ast._tag === \"Branch\" ? internal.predicate(ast) : undefined\n\n/**\n * Reads the optional schema selecting failures handled by a {@link catch_}.\n *\n * Reserved for `@smthrs/flow`'s interpreter. It is `undefined` for every\n * variant but `catch_`, and for a rehydrated AST whose side table did not\n * survive serialization.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const catchFilter = (ast: Ast): Schema.Top | undefined => ast._tag === \"Catch\" ? internal.filter(ast) : undefined\n\n/**\n * Identifies a plan-time function the AST does NOT store, a flow's `body`,\n * exactly as the AST identifies the mapper and continuation it does store.\n * A call that keeps its callee as a leaf still has to re-key when that\n * callee's body is edited, and this is the identity it folds in. Unannotated\n * functions fail closed with process-local identity; use {@link capture} to\n * declare inert captures and obtain deterministic identity.\n *\n * Reserved for `@smthrs/flow`, which folds a callee body's identity into a\n * call it keeps as a leaf. Authors never call it; it throws a `TypeError`\n * when handed anything but a function.\n *\n * @since 0.1.0\n * @category engine\n * @slop\n */\nexport const functionIdentity = (operation: unknown): FunctionIdentity => internal.functionIdentity(operation)\n\n/**\n * The document a schema's identity is: JSON-Schema-shaped, and the same bytes\n * under every `effect` release this package supports.\n *\n * @since 1.0.0\n * @category engine\n */\nexport type SchemaIdentity = internalSchemaIdentity.Document\n\n/**\n * The one option a schema's identity is taken under: whether an object closes\n * over the keys it declares (`\"error\"`) or leaves others open (`\"ignore\"`,\n * the default). It has the meaning it has in `Schema.toJsonSchemaDocument`.\n *\n * @since 1.0.0\n * @category engine\n */\nexport type SchemaIdentityOptions = internalSchemaIdentity.Options\n\n/**\n * The refusal `schemaIdentity` and `representationIdentity` raise for a schema\n * a step key cannot be derived from. Its message is the one\n * `effect@4.0.0-rc.115` gave for the same schema, where it gave one.\n *\n * @since 1.0.0\n * @category errors\n */\nexport const SchemaIdentityError = internalSchemaIdentity.SchemaIdentityError\n\n/**\n * The type of {@link SchemaIdentityError}.\n *\n * @since 1.0.0\n * @category errors\n */\nexport type SchemaIdentityError = internalSchemaIdentity.SchemaIdentityError\n\n/**\n * Identifies a schema by the constraints it documents, so a call re-keys when\n * what its callee accepts or produces changes, and a catch re-keys when its\n * filter does.\n *\n * The document is what `Schema.toJsonSchemaDocument(schema, options)`\n * returned under `effect@4.0.0-rc.115`. It is printed by this package, not by\n * the installed `effect`, because a later release prints a different document\n * for the same schema and a moved identity re-keys every recorded step. Use\n * it wherever the document is hashed, compared or pinned; a JSON Schema shown\n * to a model or a person comes from `Schema.toJsonSchemaDocument`.\n *\n * Reserved for the packages that derive identities. Authors never call it; it\n * throws for a schema that has no JSON Schema form.\n *\n * @since 1.0.0\n * @category engine\n */\nexport const schemaIdentity = (schema: Schema.Top, options?: SchemaIdentityOptions): SchemaIdentity =>\n internalSchemaIdentity.schemaIdentity(schema, options)\n\n/**\n * Identifies a schema AST by its encoded representation, the material a\n * sealed action's step key folds in for its success and error schemas.\n *\n * The value is what `SchemaRepresentation.toJson(SchemaRepresentation.toRepresentation(ast))`\n * returned under `effect@4.0.0-rc.115`, so a later `effect` release does not\n * re-key recorded steps. The one exception is `Schema.brand`: from\n * `effect@4.0.4` on a brand is not part of the AST, so a declaration with a\n * brand re-keys once.\n *\n * Reserved for the packages that derive step keys. Authors never call it; it\n * throws for an AST that has no representation.\n *\n * @since 1.0.0\n * @category engine\n */\nexport const representationIdentity = (ast: SchemaAST.AST): Schema.Json =>\n internalSchemaIdentity.representationIdentity(ast)\n\n/**\n * Binds a frozen plain copy of inert captures as the callback's this receiver.\n *\n * Use a function expression to read the snapshot while keeping the ordinary\n * callback arguments: Node.capture({ factor: 3 }, function(value: number) {\n * return value * this.factor\n * }). Caller objects remain unchanged; lexical aliases still name originals\n * and must not be used as mutable semantic inputs. Nested captures retain the\n * inner callback's snapshot and compose the two identities.\n *\n * Admission walks original descriptors once, rejects built-in brands and\n * non-plain prototypes without evaluating getters, then uses structuredClone\n * to refuse Proxies. Hosts without that API refuse object capture. Only the\n * owned frozen copy enters identity and the wrapper. Sealed, non-extensible,\n * frozen and Immer ordinary data are supported equally. Unsupported values\n * raise a TypeError naming the path. See core docs/api.md#nodecapture for the\n * complete algorithm and the migration from original-object locking.\n *\n * @category constructors\n * @since 0.1.0\n * @slop\n */\nexport const capture = <C extends Readonly<Record<string, unknown>>, Args extends ReadonlyArray<unknown>, A>(\n captures: C,\n operation: (this: Readonly<C>, ...args: Args) => A\n): (...args: Args) => A => internal.capture(captures, operation)\n"]}
|
package/docs/api.md
CHANGED
|
@@ -962,9 +962,9 @@ const representationIdentity: (ast: SchemaAST.AST) => Schema.Json
|
|
|
962
962
|
|
|
963
963
|
`flowCall` and `actionCall` validate nothing: an unknown tag becomes a call node the graph keeps as a leaf. `declaration`, `continuation`, `mapper`, `predicate`, and `catchFilter` answer `undefined` for the wrong variant and for an AST rehydrated from JSON, whose side tables did not survive serialization. `functionIdentity` throws a `TypeError` when handed anything but a function.
|
|
964
964
|
|
|
965
|
-
`schemaIdentity` returns the document a schema contributes to a step key: what the callee of a call accepts and produces, and what a `catch` filters on. The document has the shape of `Schema.toJsonSchemaDocument(schema, options)`, and this package prints it. `onExcessProperty` has the meaning and the default it has there; a step key takes the identity under `"error"`, which closes every object over the keys it declares. The installed `effect` does not, because
|
|
965
|
+
`schemaIdentity` returns the document a schema contributes to a step key: what the callee of a call accepts and produces, and what a `catch` filters on. The document has the shape of `Schema.toJsonSchemaDocument(schema, options)`, and this package prints it. `onExcessProperty` has the meaning and the default it has there; a step key takes the identity under `"error"`, which closes every object over the keys it declares. The installed `effect` does not, because a later Effect release can print a different document for the same schema: for a string, `effect@4.0.5` prints `minLength: 3` for `isMinLength(5)` where `effect@4.0.0-rc.115` printed `minLength: 5`, adds a `minimum` and a `maximum` to `Schema.Int`, and prints an `isPattern` pattern only when the expression has the `u` flag. A document that moved with the dependency would re-key every recorded step. `schemaIdentity` prints what `effect@4.0.0-rc.115` printed, under every release this package supports. Use it for identity only. A JSON Schema you show to a model or a person comes from `Schema.toJsonSchemaDocument`.
|
|
966
966
|
|
|
967
|
-
The identity has three limits. A built-in check such as `Schema.isMinLength` contributes the constraint its name and arguments state, so a `toJsonSchema` annotation passed to a built-in check is not read; one on a `Schema.makeFilter` check is. `Schema.brand` contributes nothing, because
|
|
967
|
+
The identity has three limits. A built-in check such as `Schema.isMinLength` contributes the constraint its name and arguments state, so a `toJsonSchema` annotation passed to a built-in check is not read; one on a `Schema.makeFilter` check is. `Schema.brand` contributes nothing, because a brand is not part of the schema in `effect@4.0.5`: a declaration that uses one schema with an `identifier`, or one recursive schema, both with and without a brand got two definitions under `effect@4.0.0-rc.115` and gets one now, so it re-keys once. And a codec's behavior contributes nothing, so an author who changes what a transformation does renames the declaration to re-key its calls. `schemaIdentity` throws `Node.SchemaIdentityError`, tagged `@smthrs/plan/SchemaIdentityError`, for a schema that has no JSON Schema form, such as a record keyed by a number.
|
|
968
968
|
|
|
969
969
|
`representationIdentity` returns what a sealed action's step key folds in for its success and error schemas: `SchemaRepresentation.toJson(SchemaRepresentation.toRepresentation(ast))` as `effect@4.0.0-rc.115` wrote it. A later release renamed six built-in checks, `isStartsWith`, `isEndsWith`, `isIncludes`, `isLengthBetween`, `isSizeBetween` and `isPropertiesLengthBetween`; the identity writes their rc.115 ids back. A brand cannot be written back, so a sealed action whose success or error schema carries `Schema.brand` re-keys once. `representationIdentity` throws for an AST that has no representation, such as one with a `Schema.makeFilter` check.
|
|
970
970
|
|
|
@@ -17,7 +17,7 @@ add this package and `@smthrs/flow` at the version of `@smthrs/flows` you have,
|
|
|
17
17
|
plus the platform package:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
npm install @smthrs/plan@1.0.0-rc.
|
|
20
|
+
npm install @smthrs/plan@1.0.0-rc.13 @smthrs/flow@1.0.0-rc.13 @effect/platform-node
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
The outputs below are real output from the release that install line names.
|
package/docs/installation.md
CHANGED
|
@@ -8,7 +8,7 @@ sidebar:
|
|
|
8
8
|
## Requirements
|
|
9
9
|
|
|
10
10
|
- Node.js 26.4.0 or later.
|
|
11
|
-
- `effect`
|
|
11
|
+
- `effect` `4.0.5`. The package's schemas, layers, and error classes are
|
|
12
12
|
Effect values, so it uses the one `effect` your application installs.
|
|
13
13
|
|
|
14
14
|
## Install
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smthrs/plan",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.13",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"smthrs": {
|
|
7
7
|
"group": "engine"
|
|
@@ -218,19 +218,19 @@
|
|
|
218
218
|
"tag": "next"
|
|
219
219
|
},
|
|
220
220
|
"dependencies": {
|
|
221
|
-
"@smthrs/crypto": "1.0.0-rc.
|
|
222
|
-
"@smthrs/keys": "1.0.0-rc.
|
|
223
|
-
"@smthrs/canonical": "1.0.0-rc.
|
|
221
|
+
"@smthrs/crypto": "1.0.0-rc.13",
|
|
222
|
+
"@smthrs/keys": "1.0.0-rc.13",
|
|
223
|
+
"@smthrs/canonical": "1.0.0-rc.13"
|
|
224
224
|
},
|
|
225
225
|
"devDependencies": {
|
|
226
226
|
"@effect/language-service": "0.87.2",
|
|
227
|
-
"@effect/platform-node": "4.0.
|
|
228
|
-
"@effect/vitest": "4.0.
|
|
227
|
+
"@effect/platform-node": "4.0.5",
|
|
228
|
+
"@effect/vitest": "4.0.5",
|
|
229
229
|
"@eslint/js": "9.39.5",
|
|
230
230
|
"@types/node": "26.4.1",
|
|
231
231
|
"@vitest/coverage-v8": "5.0.0",
|
|
232
232
|
"dprint": "0.57.1",
|
|
233
|
-
"effect": "4.0.
|
|
233
|
+
"effect": "4.0.5",
|
|
234
234
|
"esbuild": "0.28.2",
|
|
235
235
|
"eslint": "9.39.5",
|
|
236
236
|
"eslint-import-resolver-typescript": "4.4.5",
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
"fast-check": "4.9.0"
|
|
245
245
|
},
|
|
246
246
|
"peerDependencies": {
|
|
247
|
-
"effect": "
|
|
247
|
+
"effect": "4.0.5"
|
|
248
248
|
},
|
|
249
249
|
"scripts": {
|
|
250
250
|
"lint": "eslint src --max-warnings=0 && dprint check",
|
package/src/Node.ts
CHANGED
|
@@ -539,9 +539,14 @@ export const bindPlanned: {
|
|
|
539
539
|
)
|
|
540
540
|
)
|
|
541
541
|
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
542
|
+
/**
|
|
543
|
+
* Maximum eagerly nested branch arms. Arm construction precedes graph walking;
|
|
544
|
+
* this bound leaves native stack headroom for a typed refusal.
|
|
545
|
+
*
|
|
546
|
+
* @since 1.0.0
|
|
547
|
+
* @category constants
|
|
548
|
+
*/
|
|
549
|
+
export const maximumArmDepth = 512
|
|
545
550
|
let armDepth = 0
|
|
546
551
|
|
|
547
552
|
/**
|