@glubean/sdk 0.5.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contract-artifacts.d.ts +39 -21
- package/dist/contract-artifacts.d.ts.map +1 -1
- package/dist/contract-artifacts.js +80 -24
- package/dist/contract-artifacts.js.map +1 -1
- package/dist/contract-core.d.ts +10 -21
- package/dist/contract-core.d.ts.map +1 -1
- package/dist/contract-core.js +26 -812
- package/dist/contract-core.js.map +1 -1
- package/dist/contract-http/adapter.d.ts +13 -0
- package/dist/contract-http/adapter.d.ts.map +1 -1
- package/dist/contract-http/adapter.js +191 -23
- package/dist/contract-http/adapter.js.map +1 -1
- package/dist/contract-http/factory.d.ts +2 -2
- package/dist/contract-http/factory.d.ts.map +1 -1
- package/dist/contract-http/factory.js +5 -0
- package/dist/contract-http/factory.js.map +1 -1
- package/dist/contract-http/inbound-match.d.ts +47 -0
- package/dist/contract-http/inbound-match.d.ts.map +1 -0
- package/dist/contract-http/inbound-match.js +136 -0
- package/dist/contract-http/inbound-match.js.map +1 -0
- package/dist/contract-http/inbound-verify.d.ts +46 -0
- package/dist/contract-http/inbound-verify.d.ts.map +1 -0
- package/dist/contract-http/inbound-verify.js +101 -0
- package/dist/contract-http/inbound-verify.js.map +1 -0
- package/dist/contract-http/inbound.d.ts +45 -0
- package/dist/contract-http/inbound.d.ts.map +1 -0
- package/dist/contract-http/inbound.js +89 -0
- package/dist/contract-http/inbound.js.map +1 -0
- package/dist/contract-http/index.d.ts +5 -0
- package/dist/contract-http/index.d.ts.map +1 -1
- package/dist/contract-http/index.js +3 -0
- package/dist/contract-http/index.js.map +1 -1
- package/dist/contract-http/openapi.d.ts +0 -7
- package/dist/contract-http/openapi.d.ts.map +1 -1
- package/dist/contract-http/openapi.js +20 -14
- package/dist/contract-http/openapi.js.map +1 -1
- package/dist/contract-http/types.d.ts +106 -2
- package/dist/contract-http/types.d.ts.map +1 -1
- package/dist/contract-http/types.js +33 -0
- package/dist/contract-http/types.js.map +1 -1
- package/dist/contract-types.d.ts +148 -446
- package/dist/contract-types.d.ts.map +1 -1
- package/dist/data-path.d.ts.map +1 -1
- package/dist/data-path.js +10 -2
- package/dist/data-path.js.map +1 -1
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +7 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +14 -0
- package/dist/internal.js.map +1 -1
- package/dist/load/artifact.d.ts +376 -0
- package/dist/load/artifact.d.ts.map +1 -0
- package/dist/load/artifact.js +14 -0
- package/dist/load/artifact.js.map +1 -0
- package/dist/load/builder.d.ts +80 -0
- package/dist/load/builder.d.ts.map +1 -0
- package/dist/load/builder.js +262 -0
- package/dist/load/builder.js.map +1 -0
- package/dist/load/context.d.ts +81 -0
- package/dist/load/context.d.ts.map +1 -0
- package/dist/load/context.js +2 -0
- package/dist/load/context.js.map +1 -0
- package/dist/load/duration.d.ts +9 -0
- package/dist/load/duration.d.ts.map +1 -0
- package/dist/load/duration.js +22 -0
- package/dist/load/duration.js.map +1 -0
- package/dist/load/events.d.ts +132 -0
- package/dist/load/events.d.ts.map +1 -0
- package/dist/load/events.js +2 -0
- package/dist/load/events.js.map +1 -0
- package/dist/load/feeder.d.ts +118 -0
- package/dist/load/feeder.d.ts.map +1 -0
- package/dist/load/feeder.js +170 -0
- package/dist/load/feeder.js.map +1 -0
- package/dist/load/index.d.ts +32 -0
- package/dist/load/index.d.ts.map +1 -0
- package/dist/load/index.js +7 -0
- package/dist/load/index.js.map +1 -0
- package/dist/load/progress.d.ts +56 -0
- package/dist/load/progress.d.ts.map +1 -0
- package/dist/load/progress.js +2 -0
- package/dist/load/progress.js.map +1 -0
- package/dist/load/projection.d.ts +36 -0
- package/dist/load/projection.d.ts.map +1 -0
- package/dist/load/projection.js +47 -0
- package/dist/load/projection.js.map +1 -0
- package/dist/load/runner.d.ts +201 -0
- package/dist/load/runner.d.ts.map +1 -0
- package/dist/load/runner.js +78 -0
- package/dist/load/runner.js.map +1 -0
- package/dist/load/scenario.d.ts +130 -0
- package/dist/load/scenario.d.ts.map +1 -0
- package/dist/load/scenario.js +9 -0
- package/dist/load/scenario.js.map +1 -0
- package/dist/load/step.d.ts +42 -0
- package/dist/load/step.d.ts.map +1 -0
- package/dist/load/step.js +2 -0
- package/dist/load/step.js.map +1 -0
- package/dist/{contract-flow-poll.d.ts → poll-primitives.d.ts} +8 -81
- package/dist/poll-primitives.d.ts.map +1 -0
- package/dist/{contract-flow-poll.js → poll-primitives.js} +10 -64
- package/dist/poll-primitives.js.map +1 -0
- package/dist/{contract-flow-condition.d.ts → predicates.d.ts} +34 -71
- package/dist/predicates.d.ts.map +1 -0
- package/dist/{contract-flow-condition.js → predicates.js} +86 -80
- package/dist/predicates.js.map +1 -0
- package/dist/test/builder.js +2 -2
- package/dist/test/builder.js.map +1 -1
- package/dist/test/utils.d.ts +7 -0
- package/dist/test/utils.d.ts.map +1 -1
- package/dist/test/utils.js +22 -17
- package/dist/test/utils.js.map +1 -1
- package/dist/types.d.ts +42 -14
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/workflow/builder.d.ts +386 -0
- package/dist/workflow/builder.d.ts.map +1 -0
- package/dist/workflow/builder.js +1150 -0
- package/dist/workflow/builder.js.map +1 -0
- package/dist/workflow/execute.d.ts +277 -0
- package/dist/workflow/execute.d.ts.map +1 -0
- package/dist/workflow/execute.js +1489 -0
- package/dist/workflow/execute.js.map +1 -0
- package/dist/workflow/index.d.ts +11 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +15 -0
- package/dist/workflow/index.js.map +1 -0
- package/dist/workflow/project.d.ts +18 -0
- package/dist/workflow/project.d.ts.map +1 -0
- package/dist/workflow/project.js +321 -0
- package/dist/workflow/project.js.map +1 -0
- package/dist/workflow/retry.d.ts +13 -0
- package/dist/workflow/retry.d.ts.map +1 -0
- package/dist/workflow/retry.js +15 -0
- package/dist/workflow/retry.js.map +1 -0
- package/dist/workflow/types.d.ts +512 -0
- package/dist/workflow/types.d.ts.map +1 -0
- package/dist/workflow/types.js +2 -0
- package/dist/workflow/types.js.map +1 -0
- package/package.json +9 -2
- package/dist/contract-flow-condition.d.ts.map +0 -1
- package/dist/contract-flow-condition.js.map +0 -1
- package/dist/contract-flow-poll.d.ts.map +0 -1
- package/dist/contract-flow-poll.js.map +0 -1
- package/dist/contract-http/flow-helpers.d.ts +0 -12
- package/dist/contract-http/flow-helpers.d.ts.map +0 -1
- package/dist/contract-http/flow-helpers.js +0 -34
- package/dist/contract-http/flow-helpers.js.map +0 -1
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
import type { ContractCaseRef } from "../contract-types.js";
|
|
2
|
+
import type { BranchPredicate, PredicateScope } from "../predicates.js";
|
|
3
|
+
import type { ActionProjection, BranchCaseValue, BuiltWorkflow, CheckProjection, NodeMetaInput, RetryMeta, WorkflowContext, WorkflowMeta, WorkflowSetup, WorkflowTeardown } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* A branch-family side: STRICT-S convergence (addendum §9 #1) — the sub-chain
|
|
6
|
+
* must return to the trunk's State, so a side that forgets `...s` is caught at
|
|
7
|
+
* the branch line instead of exploding as runtime `undefined` downstream. The
|
|
8
|
+
* managed-shape rule (§9 #3): sides don't invent shape, they fill slots the
|
|
9
|
+
* trunk pre-declared (optional fields / one tagged-union FIELD — never a
|
|
10
|
+
* whole-state union).
|
|
11
|
+
*/
|
|
12
|
+
export type StrictSide<State> = (b: WorkflowBuilder<State>) => ChainedWorkflowBuilder<State>;
|
|
13
|
+
/** Phantom brand for builders that came off a CHAIN CALL (not the raw side
|
|
14
|
+
* parameter). Closes the block-body strict-S bypass (codex S2.8 R1 P1):
|
|
15
|
+
* `then: b => { b.compute(reshape); return b; }` returned the parameter — the
|
|
16
|
+
* type held while the collected nodes reshaped state. A strict side must now
|
|
17
|
+
* return the chain itself (`b.compute(...)`, or `const c = b.x(); return c`),
|
|
18
|
+
* never the bare parameter. Purely type-level — no runtime field exists.
|
|
19
|
+
* (A deliberately forked chain — building twice off `b` and returning one —
|
|
20
|
+
* still collects both; that is `as never` territory, same as every other
|
|
21
|
+
* type-layer bypass.) */
|
|
22
|
+
declare const CHAINED: unique symbol;
|
|
23
|
+
export interface ChainedWorkflowBuilder<State> extends WorkflowBuilder<State> {
|
|
24
|
+
readonly [CHAINED]: true;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* `.branch()` options (addendum §9) — a declarative `when` (L2, statically
|
|
28
|
+
* projectable → `full`) XOR a runtime `whenRuntime` (opaque, requires
|
|
29
|
+
* `message`). `then`/`else` are STRICT-S sub-builders over the same state.
|
|
30
|
+
*/
|
|
31
|
+
export type BranchOpts<State> = {
|
|
32
|
+
when: (w: PredicateScope<State>) => BranchPredicate<State>;
|
|
33
|
+
whenRuntime?: never;
|
|
34
|
+
message?: string;
|
|
35
|
+
then: StrictSide<State>;
|
|
36
|
+
else?: StrictSide<State>;
|
|
37
|
+
} | {
|
|
38
|
+
when?: never;
|
|
39
|
+
whenRuntime: (ctx: WorkflowContext, state: State) => boolean | Promise<boolean>;
|
|
40
|
+
message: string;
|
|
41
|
+
then: StrictSide<State>;
|
|
42
|
+
else?: StrictSide<State>;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* `.switch()` options (addendum §9 #4) — the full heir of flow's
|
|
46
|
+
* switchOn/switchCond: value mode (`on` lens + literal case table) XOR
|
|
47
|
+
* predicate mode (ordered L2 predicates, first-match). One method, option-key
|
|
48
|
+
* split. Every case is STRICT-S; `default` is OPTIONAL = identity pass-through.
|
|
49
|
+
* Case predicates are L2-only (a clean decision table — an opaque N-way gate
|
|
50
|
+
* is a nested `branch` with `whenRuntime`, not a switch).
|
|
51
|
+
*/
|
|
52
|
+
export type SwitchOpts<State> = {
|
|
53
|
+
/** value mode: pure lens state → a JSON-scalar discriminant. */
|
|
54
|
+
on: (state: State) => BranchCaseValue | undefined;
|
|
55
|
+
cases: ReadonlyArray<{
|
|
56
|
+
value: BranchCaseValue;
|
|
57
|
+
then: StrictSide<State>;
|
|
58
|
+
label?: string;
|
|
59
|
+
}>;
|
|
60
|
+
default?: StrictSide<State>;
|
|
61
|
+
} | {
|
|
62
|
+
on?: never;
|
|
63
|
+
/** predicate mode: ordered, possibly-overlapping L2 predicates; first-match. */
|
|
64
|
+
cases: ReadonlyArray<{
|
|
65
|
+
when: (w: PredicateScope<State>) => BranchPredicate<State>;
|
|
66
|
+
then: StrictSide<State>;
|
|
67
|
+
label?: string;
|
|
68
|
+
}>;
|
|
69
|
+
default?: StrictSide<State>;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* `.route()` options (addendum §9 #5) — the N-way TERMINAL tree. Cases are
|
|
73
|
+
* UNCONSTRAINED (`(b) => WorkflowBuilder<any>`): no downstream trunk exists to
|
|
74
|
+
* lie to, so strict-S has nothing to protect. `default` is REQUIRED (a
|
|
75
|
+
* no-match must be defined). After `.route()` only `.teardown()/.build()`.
|
|
76
|
+
*/
|
|
77
|
+
export type RouteOpts<State> = {
|
|
78
|
+
on: (state: State) => BranchCaseValue | undefined;
|
|
79
|
+
cases: ReadonlyArray<{
|
|
80
|
+
value: BranchCaseValue;
|
|
81
|
+
then: (b: WorkflowBuilder<State>) => WorkflowBuilder<any>;
|
|
82
|
+
label?: string;
|
|
83
|
+
}>;
|
|
84
|
+
default: (b: WorkflowBuilder<State>) => WorkflowBuilder<any>;
|
|
85
|
+
} | {
|
|
86
|
+
on?: never;
|
|
87
|
+
cases: ReadonlyArray<{
|
|
88
|
+
when: (w: PredicateScope<State>) => BranchPredicate<State>;
|
|
89
|
+
then: (b: WorkflowBuilder<State>) => WorkflowBuilder<any>;
|
|
90
|
+
label?: string;
|
|
91
|
+
}>;
|
|
92
|
+
default: (b: WorkflowBuilder<State>) => WorkflowBuilder<any>;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* What `.route()` returns: the workflow is a terminal tree now — paths own
|
|
96
|
+
* their futures, no trunk continues. Only cleanup and finalization remain.
|
|
97
|
+
* `teardown` is typed against the TRUNK State: at runtime it receives the
|
|
98
|
+
* taken leaf's state (the union of leaf states) — common trunk fields stay
|
|
99
|
+
* accessible without narrowing, which §9 accepts as the contained compromise
|
|
100
|
+
* at the last station.
|
|
101
|
+
*/
|
|
102
|
+
export interface TerminalWorkflowBuilder<State> {
|
|
103
|
+
teardown(fn: WorkflowTeardown<State>, opts?: {
|
|
104
|
+
timeout?: number;
|
|
105
|
+
note?: string;
|
|
106
|
+
}): TerminalWorkflowBuilder<State>;
|
|
107
|
+
build(): BuiltWorkflow<State>;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* `.poll()` exit predicate (proposal §6.7) — a declarative `until` over the
|
|
111
|
+
* RESPONSE (L2, statically projectable → `full`) XOR a runtime `untilRuntime`
|
|
112
|
+
* (opaque, requires `message`; gets ctx + response + state). Mirrors branch's
|
|
113
|
+
* `when`/`whenRuntime` split: the two forms cannot share one key because both
|
|
114
|
+
* are functions and the builder cannot soundly tell them apart.
|
|
115
|
+
*/
|
|
116
|
+
export type PollUntil<State, Res> = {
|
|
117
|
+
until: (w: PredicateScope<Res>) => BranchPredicate<Res>;
|
|
118
|
+
untilRuntime?: never;
|
|
119
|
+
message?: string;
|
|
120
|
+
} | {
|
|
121
|
+
until?: never;
|
|
122
|
+
untilRuntime: (ctx: WorkflowContext, res: Res, state: State) => boolean | Promise<boolean>;
|
|
123
|
+
message: string;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* `.poll()` bounds — validated at build time (`validatePollBounds`): a total
|
|
127
|
+
* stop condition (`timeout` | `maxAttempts`) AND a finite single-attempt budget
|
|
128
|
+
* (`timeout` | `perAttemptTimeout`) are BOTH required, so a poll can never hang
|
|
129
|
+
* unbounded. `every` defaults to 1s; `backoff` to 1 (fixed interval).
|
|
130
|
+
*/
|
|
131
|
+
export interface PollBounds {
|
|
132
|
+
/** Interval between attempts (ms). Default 1000. */
|
|
133
|
+
every?: number;
|
|
134
|
+
/** Multiplier applied to the interval after each attempt (>= 1). Default 1. */
|
|
135
|
+
backoff?: number;
|
|
136
|
+
/** Total wall-clock bound (ms). */
|
|
137
|
+
timeout?: number;
|
|
138
|
+
/** Per-attempt budget (ms) — required when `timeout` is absent. */
|
|
139
|
+
perAttemptTimeout?: number;
|
|
140
|
+
/** Max attempts (>= 1). */
|
|
141
|
+
maxAttempts?: number;
|
|
142
|
+
}
|
|
143
|
+
/** `.poll()` options when the polled case needs NO logical input. */
|
|
144
|
+
export type PollOpts<State, NewState, CaseOutput, RawOutcome, AcceptKey, Accept extends ReadonlyArray<AcceptKey> = never> = PollUntil<State, CallResponse<Accept, CaseOutput, RawOutcome>> & PollBounds & {
|
|
145
|
+
/** Pure lens folding the SATISFYING response into the next state. */
|
|
146
|
+
out?: (state: State, res: CallResponse<Accept, CaseOutput, RawOutcome>) => NewState;
|
|
147
|
+
/** Accepted alternate outcome keys (poll-on-status needs this). */
|
|
148
|
+
accept?: Accept;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* `.poll()` options for an INBOUND case ref (inbound-contract-design §9.3):
|
|
152
|
+
* the counterparty calls US, so there is no `until` (matched IS the exit),
|
|
153
|
+
* no `in`/`accept` (nothing is sent). `via` selects the live ReceiverHandle
|
|
154
|
+
* from state; `correlate` pins WHICH instance (=== compare, both lenses
|
|
155
|
+
* required together). `timeout` defaults from the case's `expect.within`.
|
|
156
|
+
*/
|
|
157
|
+
export type InboundPollOpts<State, NewState = State, Event = unknown> = PollBounds & {
|
|
158
|
+
/** Pure lens: state → ReceiverHandle (put the handle in state during setup). */
|
|
159
|
+
via: (state: State) => unknown;
|
|
160
|
+
correlate?: {
|
|
161
|
+
/** Lens over the PARSED delivery body. */
|
|
162
|
+
event: (event: Event) => unknown;
|
|
163
|
+
/** Lens over workflow state. */
|
|
164
|
+
state: (state: State) => unknown;
|
|
165
|
+
};
|
|
166
|
+
/** Pure lens folding the parsed, schema-validated event into the next state. */
|
|
167
|
+
out?: (state: State, event: Event) => NewState;
|
|
168
|
+
until?: never;
|
|
169
|
+
untilRuntime?: never;
|
|
170
|
+
in?: never;
|
|
171
|
+
accept?: never;
|
|
172
|
+
message?: never;
|
|
173
|
+
};
|
|
174
|
+
/** `.poll()` options when the polled case REQUIRES input — `in` is mandatory. */
|
|
175
|
+
export type PollOptsWithInput<State, NewState, CaseInputs, CaseOutput, RawOutcome, AcceptKey, Accept extends ReadonlyArray<AcceptKey> = never> = PollOpts<State, NewState, CaseOutput, RawOutcome, AcceptKey, Accept> & {
|
|
176
|
+
/** Pure lens: workflow state → the case's logical input (required). */
|
|
177
|
+
in: (state: State) => CaseInputs;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* vNext `workflow()` authoring builder (Phase 1 surface). Emits the runtime node
|
|
181
|
+
* graph (`./types`); execution + projection live elsewhere. Group / use / each /
|
|
182
|
+
* pick come in later phases — the IR already reserves them.
|
|
183
|
+
*
|
|
184
|
+
* No backward compatibility: this is a fresh self-consistent surface (2026-06-09).
|
|
185
|
+
*/
|
|
186
|
+
/**
|
|
187
|
+
* `out`'s `res` type: the typed PRIMARY outcome by default, widened to the raw
|
|
188
|
+
* multi-status outcome ONLY when `accept` is set (the caller must then narrow on
|
|
189
|
+
* status). Mirrors `contract.flow().step` (codex slice-1 P2 parity).
|
|
190
|
+
*/
|
|
191
|
+
type CallResponse<Accept, CaseOutput, RawOutcome> = [Accept] extends [never] ? CaseOutput : RawOutcome;
|
|
192
|
+
/** Step bindings when the called case needs NO logical input. */
|
|
193
|
+
export interface CallBindings<State, NewState, CaseOutput, RawOutcome, AcceptKey, Accept extends ReadonlyArray<AcceptKey> = never> {
|
|
194
|
+
/** Pure lens folding the response into the next state. */
|
|
195
|
+
out?: (state: State, res: CallResponse<Accept, CaseOutput, RawOutcome>) => NewState;
|
|
196
|
+
/** Accepted alternate outcome keys to branch on (adapter-specific; HTTP: statuses). */
|
|
197
|
+
accept?: Accept;
|
|
198
|
+
/** Explicit-intent retry (§17 #7) — `reason` is required (documents why replay is safe). */
|
|
199
|
+
retry?: RetryMeta;
|
|
200
|
+
}
|
|
201
|
+
/** Step bindings when the called case REQUIRES input — `in` is mandatory. */
|
|
202
|
+
export interface CallBindingsWithInput<State, NewState, CaseInputs, CaseOutput, RawOutcome, AcceptKey, Accept extends ReadonlyArray<AcceptKey> = never> extends CallBindings<State, NewState, CaseOutput, RawOutcome, AcceptKey, Accept> {
|
|
203
|
+
/** Pure lens: workflow state → the case's logical input (required). */
|
|
204
|
+
in: (state: State) => CaseInputs;
|
|
205
|
+
}
|
|
206
|
+
export interface WorkflowBuilder<State> {
|
|
207
|
+
/** Merge workflow-level metadata (id is fixed at creation). */
|
|
208
|
+
meta(meta: Omit<Partial<WorkflowMeta>, "id" | "templateId" | "groupId" | "parallel">): ChainedWorkflowBuilder<State>;
|
|
209
|
+
/** The one I/O-capable initializer; its return is the initial state.
|
|
210
|
+
* `timeout` (ms, §17 #4) is TERMINAL — a timed-out setup fails the run. */
|
|
211
|
+
setup<S>(fn: WorkflowSetup<S>, opts?: {
|
|
212
|
+
timeout?: number;
|
|
213
|
+
note?: string;
|
|
214
|
+
}): ChainedWorkflowBuilder<S>;
|
|
215
|
+
/** Always-run cleanup (see lifecycle decision in the plan's self-consistency
|
|
216
|
+
* corpus). `timeout` (ms, §17 #4) is TERMINAL — logged, never masks the cause. */
|
|
217
|
+
teardown(fn: WorkflowTeardown<State>, opts?: {
|
|
218
|
+
timeout?: number;
|
|
219
|
+
note?: string;
|
|
220
|
+
}): ChainedWorkflowBuilder<State>;
|
|
221
|
+
/**
|
|
222
|
+
* Use a reusable contract interaction. First arg: node id or `{...NodeMeta}`.
|
|
223
|
+
* Preserves the case's generics (codex slice-1 P2): when the case requires
|
|
224
|
+
* input, `in` is mandatory; `out`'s `res` and `accept` are typed from the ref.
|
|
225
|
+
*/
|
|
226
|
+
call<CaseInputs, CaseOutput, AcceptKey, RawOutcome, Accept extends ReadonlyArray<AcceptKey> = never, NewState = State>(idOrMeta: NodeMetaInput, ref: ContractCaseRef<CaseInputs, CaseOutput, AcceptKey, RawOutcome>, ...rest: [CaseInputs] extends [void] ? [bindings?: CallBindings<State, NewState, CaseOutput, RawOutcome, AcceptKey, Accept>] : [bindings: CallBindingsWithInput<State, NewState, CaseInputs, CaseOutput, RawOutcome, AcceptKey, Accept>]): ChainedWorkflowBuilder<NewState>;
|
|
227
|
+
/**
|
|
228
|
+
* Arbitrary ASYNC state-producing glue (graded partial w/ hints, else opaque).
|
|
229
|
+
* A void-returning action PRESERVES the state type; a value-returning one
|
|
230
|
+
* transitions it (codex slice-1 P2 — uses the `Promise<void>` overload trick
|
|
231
|
+
* so a value-returning action can't be swallowed by the void overload).
|
|
232
|
+
*/
|
|
233
|
+
action(idOrMeta: NodeMetaInput, fn: (ctx: WorkflowContext, state: State) => Promise<void>, opts?: {
|
|
234
|
+
project?: ActionProjection;
|
|
235
|
+
retry?: RetryMeta;
|
|
236
|
+
}): ChainedWorkflowBuilder<State>;
|
|
237
|
+
action<NewState>(idOrMeta: NodeMetaInput, fn: (ctx: WorkflowContext, state: State) => Promise<NewState>, opts?: {
|
|
238
|
+
project?: ActionProjection;
|
|
239
|
+
retry?: RetryMeta;
|
|
240
|
+
}): ChainedWorkflowBuilder<NewState>;
|
|
241
|
+
/** Arbitrary assertion (graded partial w/ asserts hint, else opaque/trace). */
|
|
242
|
+
/**
|
|
243
|
+
* DECLARATIVE check (phase4 §7 / addendum §2): assertions as DATA — each
|
|
244
|
+
* item is an L2 predicate over state, projects individually (grade: full)
|
|
245
|
+
* and emits its own assertion event with soft semantics (§17 #5). Cheaper
|
|
246
|
+
* than inline at runtime: pure evaluation, no user code. Opaque logic
|
|
247
|
+
* belongs in the inline form below.
|
|
248
|
+
*/
|
|
249
|
+
check(idOrMeta: NodeMetaInput, opts: {
|
|
250
|
+
expect: (w: PredicateScope<State>) => BranchPredicate<State>[];
|
|
251
|
+
}): ChainedWorkflowBuilder<State>;
|
|
252
|
+
check(idOrMeta: NodeMetaInput, fn: (ctx: WorkflowContext, state: State) => void | Promise<void>, opts?: {
|
|
253
|
+
project?: CheckProjection;
|
|
254
|
+
}): ChainedWorkflowBuilder<State>;
|
|
255
|
+
/**
|
|
256
|
+
* Pure SYNCHRONOUS state transform. First arg: node id or `{...NodeMeta}`.
|
|
257
|
+
* Async callbacks are rejected at RUNTIME (the impl throws) — route async work
|
|
258
|
+
* through `.action()` (codex slice-1 P2).
|
|
259
|
+
*/
|
|
260
|
+
compute<NewState = State>(idOrMeta: NodeMetaInput, fn: (state: State) => NewState): ChainedWorkflowBuilder<NewState>;
|
|
261
|
+
/**
|
|
262
|
+
* 2-way branch (§6.6): run `then` when the predicate holds, else `else`. ONLY the
|
|
263
|
+
* taken side executes; the other is reported `skipped` (§17 #6). Declarative `when`
|
|
264
|
+
* projects to `full`; runtime `whenRuntime` is opaque and needs a `message`. The
|
|
265
|
+
* branch does not change the State type — sub-graph state writes apply at runtime.
|
|
266
|
+
*/
|
|
267
|
+
/**
|
|
268
|
+
* Apply a reusable FRAGMENT in-chain (phase4 §1): a fragment is a plain
|
|
269
|
+
* typed function over the builder; `.use(f)` is `f(this)` without breaking
|
|
270
|
+
* the chain. Zero new semantics — the fragment's nodes land on the trunk
|
|
271
|
+
* exactly as if hand-written. The fragment must return ITS OWN chain (the
|
|
272
|
+
* CHAINED brand rejects the bare parameter at the type level, and a
|
|
273
|
+
* runtime check rejects a chain from a DIFFERENT builder). A fragment
|
|
274
|
+
* meant for reuse parameterizes its node ids (build() enforces global
|
|
275
|
+
* uniqueness).
|
|
276
|
+
*/
|
|
277
|
+
use<NewState>(fragment: (b: WorkflowBuilder<State>) => ChainedWorkflowBuilder<NewState>): ChainedWorkflowBuilder<NewState>;
|
|
278
|
+
/**
|
|
279
|
+
* A DISPLAY-ONLY grouping bracket (phase4 §2, owner-decided): members run
|
|
280
|
+
* exactly as if the wrapper were absent — same order, same state flow, same
|
|
281
|
+
* fail-stop. The group only adds a collapsible node_start/node_end bracket
|
|
282
|
+
* for CLI/Cloud rendering (status = failed > skipped > passed aggregate;
|
|
283
|
+
* grade = worst member). TYPE-TRANSPARENT, not strict-S: a group is a
|
|
284
|
+
* linear trunk segment, so state may evolve through it (strict-S is a
|
|
285
|
+
* property of CONVERGENCE points — branch sides — not segments). The body
|
|
286
|
+
* cannot declare setup/teardown; the group node takes no timeout/retry.
|
|
287
|
+
*/
|
|
288
|
+
group<NewState>(idOrMeta: NodeMetaInput, body: (b: WorkflowBuilder<State>) => ChainedWorkflowBuilder<NewState>): ChainedWorkflowBuilder<NewState>;
|
|
289
|
+
branch(idOrMeta: NodeMetaInput, opts: BranchOpts<State>): ChainedWorkflowBuilder<State>;
|
|
290
|
+
/**
|
|
291
|
+
* N-way CONVERGING dispatch (addendum §9 #4) — the heir of flow's
|
|
292
|
+
* switchOn/switchCond. Value mode (`on` lens + literal case table, ===) XOR
|
|
293
|
+
* predicate mode (ordered L2 predicates, first-match). Every case is
|
|
294
|
+
* STRICT-S; `default` is optional = identity pass-through. Only the taken
|
|
295
|
+
* case executes; the rest are reported skipped (§17 #6).
|
|
296
|
+
*/
|
|
297
|
+
switch(idOrMeta: NodeMetaInput, opts: SwitchOpts<State>): ChainedWorkflowBuilder<State>;
|
|
298
|
+
/**
|
|
299
|
+
* N-way TERMINAL tree (addendum §9 #5) — paths own their futures; no trunk
|
|
300
|
+
* continues. Cases are unconstrained (`(b) => WorkflowBuilder<any>`);
|
|
301
|
+
* `default` is REQUIRED. Returns a terminal builder allowing only
|
|
302
|
+
* `.teardown()/.build()`. teardown sees the taken leaf's runtime state
|
|
303
|
+
* (typed against the trunk State — §9's contained compromise).
|
|
304
|
+
*/
|
|
305
|
+
route(idOrMeta: NodeMetaInput, opts: RouteOpts<State>): TerminalWorkflowBuilder<State>;
|
|
306
|
+
/**
|
|
307
|
+
* Bounded poll-until (§6.7, §17 #3): repeat ONE contract case until the exit
|
|
308
|
+
* predicate over the RESPONSE holds. Declarative `until` projects to `full`;
|
|
309
|
+
* runtime `untilRuntime` is opaque and needs a `message`. Bounds are validated
|
|
310
|
+
* at build time (total stop condition AND finite per-attempt budget). Probe
|
|
311
|
+
* attempts' assertion noise is quarantined; only the satisfying attempt's
|
|
312
|
+
* evidence (and any in-budget deliberate failure) lands on the run.
|
|
313
|
+
*/
|
|
314
|
+
/**
|
|
315
|
+
* Inbound await (inbound-contract-design §9.3): the polled case has
|
|
316
|
+
* `direction: "inbound"` — the counterparty calls US. One attempt scans
|
|
317
|
+
* `via(state).deliveries()` through the adapter matcher; matched claims
|
|
318
|
+
* the delivery and exits (no `until`). Authentication decides failure,
|
|
319
|
+
* content decides attribution (§9.4a): forged/stale/non-JSON deliveries
|
|
320
|
+
* FAIL the node; mismatched shapes are probes. `timeout` defaults from
|
|
321
|
+
* the case's `expect.within`.
|
|
322
|
+
*/
|
|
323
|
+
poll<Event = unknown, NewState = State>(idOrMeta: NodeMetaInput, ref: ContractCaseRef<any, any, any, any> & {
|
|
324
|
+
direction: "inbound";
|
|
325
|
+
}, opts: InboundPollOpts<State, NewState, Event>): ChainedWorkflowBuilder<NewState>;
|
|
326
|
+
poll<CaseInputs, CaseOutput, AcceptKey, RawOutcome, Accept extends ReadonlyArray<AcceptKey> = never, NewState = State>(idOrMeta: NodeMetaInput, ref: ContractCaseRef<CaseInputs, CaseOutput, AcceptKey, RawOutcome> & {
|
|
327
|
+
direction?: undefined;
|
|
328
|
+
}, ...rest: [CaseInputs] extends [void] ? [opts: PollOpts<State, NewState, CaseOutput, RawOutcome, AcceptKey, Accept>] : [opts: PollOptsWithInput<State, NewState, CaseInputs, CaseOutput, RawOutcome, AcceptKey, Accept>]): ChainedWorkflowBuilder<NewState>;
|
|
329
|
+
/**
|
|
330
|
+
* Bounded poll over an ARBITRARY async attempt (addendum §4 — the webhook/
|
|
331
|
+
* inbox customer): `.poll`'s twin where the probe is a function instead of a
|
|
332
|
+
* contract case. Same bounds validation, same per-attempt quarantine
|
|
333
|
+
* (§17 #3, with `ctx.signal` = the attempt's budget abort), same `until`
|
|
334
|
+
* split (L2 over the probed value XOR untilRuntime + message). The attempt
|
|
335
|
+
* is statically opaque, so the grade caps at `partial` (L2 until) /
|
|
336
|
+
* `opaque` (untilRuntime) — §6.7's ladder.
|
|
337
|
+
*/
|
|
338
|
+
pollAction<Res, NewState = State>(idOrMeta: NodeMetaInput, fn: (ctx: WorkflowContext, state: State) => Res | Promise<Res>, opts: PollUntil<State, Res> & PollBounds & {
|
|
339
|
+
/** Pure lens folding the SATISFYING probe result into the next state. */
|
|
340
|
+
out?: (state: State, res: Res) => NewState;
|
|
341
|
+
/** Dataflow hints for the opaque attempt (projection only). */
|
|
342
|
+
project?: ActionProjection;
|
|
343
|
+
}): ChainedWorkflowBuilder<NewState>;
|
|
344
|
+
/**
|
|
345
|
+
* Finalize into a `BuiltWorkflow`: the Workflow IR + a one-element `Test[]`
|
|
346
|
+
* (a simple-shaped wrapper Test carrying the IR; the host run-loop drives the
|
|
347
|
+
* graph via `runWorkflow`), registered for discovery. Idempotent — repeat
|
|
348
|
+
* calls return the same handle. The builder auto-builds on a microtask
|
|
349
|
+
* (mirrors `contract.flow()`), so an exported, never-built builder is still
|
|
350
|
+
* discovered and registered.
|
|
351
|
+
*/
|
|
352
|
+
build(): BuiltWorkflow<State>;
|
|
353
|
+
}
|
|
354
|
+
declare function workflowFn(idOrMeta: string | WorkflowMeta): WorkflowBuilder<undefined>;
|
|
355
|
+
/**
|
|
356
|
+
* Template meta for `workflow.each` (addendum §3). `id` is a TEMPLATE — the
|
|
357
|
+
* engine interpolates `$field` / `$index` per row (the test.each engine,
|
|
358
|
+
* reused wholesale). The engine owns id templating / tagging / groupId; the
|
|
359
|
+
* factory only authors the body.
|
|
360
|
+
*/
|
|
361
|
+
export interface WorkflowEachMeta<T> extends Omit<WorkflowMeta, "groupId" | "parallel" | "templateId"> {
|
|
362
|
+
/** Template id, e.g. "checkout-$region". */
|
|
363
|
+
id: string;
|
|
364
|
+
/** Row fields auto-tagged as `field:value` per member. */
|
|
365
|
+
tagFields?: string | ReadonlyArray<Extract<keyof T, string>>;
|
|
366
|
+
/** Members of this group may run in parallel. */
|
|
367
|
+
parallel?: boolean;
|
|
368
|
+
/** Keep only rows passing this predicate (applied before building). */
|
|
369
|
+
filter?: (row: T, index: number) => boolean;
|
|
370
|
+
}
|
|
371
|
+
/** The per-row authoring factory: the engine creates the builder (templated
|
|
372
|
+
* id + tags + groupId) and hands it in with the fully-typed row. */
|
|
373
|
+
export type WorkflowEachFactory<T> = (wf: WorkflowBuilder<undefined>, row: T) => unknown;
|
|
374
|
+
declare function workflowEach<T extends Record<string, unknown>>(table: readonly T[] | Record<string, T>): (meta: WorkflowEachMeta<T>, factory: WorkflowEachFactory<T>) => BuiltWorkflow[];
|
|
375
|
+
/** Create a workflow builder. `id` is required (string or `WorkflowMeta`).
|
|
376
|
+
* `workflow.each(table)(metaTemplate, factory)` authors data-driven matrices
|
|
377
|
+
* (addendum §3). There is deliberately NO `workflow.pick`: random selection
|
|
378
|
+
* is a test-layer idea — a workflow's declaration inventory must be
|
|
379
|
+
* deterministic (canonicalHash, one version × N runs), and "hand-run one
|
|
380
|
+
* member" is already covered because every each member is an addressable
|
|
381
|
+
* test (`glubean run -t checkout-us`). Owner decision 2026-06-12. */
|
|
382
|
+
export declare const workflow: typeof workflowFn & {
|
|
383
|
+
each: typeof workflowEach;
|
|
384
|
+
};
|
|
385
|
+
export {};
|
|
386
|
+
//# sourceMappingURL=builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/workflow/builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,KAAK,EACV,eAAe,EAEf,cAAc,EACf,MAAM,kBAAkB,CAAC;AA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