@mark1russell7/workflow-runner 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +37 -2
- package/build/engine-bAZZ3ZT9.d.ts +303 -0
- package/build/engine-bAZZ3ZT9.d.ts.map +1 -0
- package/build/index.d.ts +14 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +1125 -0
- package/build/index.js.map +1 -0
- package/build/service.d.ts +31 -0
- package/build/service.d.ts.map +1 -0
- package/build/service.js +56 -0
- package/build/service.js.map +1 -0
- package/package.json +53 -3
- package/src/engine.ts +795 -0
- package/src/index.ts +16 -0
- package/src/machines.ts +98 -0
- package/src/record.ts +126 -0
- package/src/service.ts +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mark Russell
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @mark1russell7/workflow-runner
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This package runs a workflow document of `@mark1russell7/workflow`. Each step is one call of a procedure. The runner keeps one append-only record for each run.
|
|
4
|
+
|
|
5
|
+
## Use
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { memoryStore, workflowRunner } from "@mark1russell7/workflow-runner";
|
|
9
|
+
import { realClock } from "@mark1russell7/algebra/clock";
|
|
10
|
+
|
|
11
|
+
const runner = workflowRunner({
|
|
12
|
+
procedures: { "git.clone": { idempotent: true } },
|
|
13
|
+
call: async ({ procedure, inputs, key }) => host.call(procedure, inputs, key),
|
|
14
|
+
access: ({ from, access, target }) => grants.check(from, access, target),
|
|
15
|
+
redact: (value) => secrets.redact(value),
|
|
16
|
+
store: memoryStore(),
|
|
17
|
+
clock: realClock,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const result = await runner.start({ doc, owner: "technical", trigger: { kind: "manual", id: "m-1" } });
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## The ports
|
|
24
|
+
|
|
25
|
+
| Port | Task |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| `procedures` | The facts of each procedure: its workspace inputs, and `idempotent` when it removes a second call with the same key. |
|
|
28
|
+
| `call` | The host does one call. A secret input stays a reference, and the host reads its value. |
|
|
29
|
+
| `access` | The grant check. A deny, a throw and an unknown procedure each refuse the effect. |
|
|
30
|
+
| `redact` | The host removes each secret value from a value before the record. |
|
|
31
|
+
| `store` | The store of the records. An append at a wrong place gives `RecordConflict`. |
|
|
32
|
+
| `clock` | The clock of the time limits and the retry waits. |
|
|
33
|
+
|
|
34
|
+
## The record
|
|
35
|
+
|
|
36
|
+
The record of a run is also the log of its resume. `runner.resume(run)` answers each recorded effect from the record, then it runs live. A call with a start and no end calls again only for an idempotent procedure. Else the run ends as `in-doubt`.
|
|
37
|
+
|
|
38
|
+
The decision D225 in `docs/DECISIONS.md` gives the reasons and the case against.
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { Clock } from "@mark1russell7/algebra/clock";
|
|
2
|
+
import { Machine } from "@mark1russell7/coeval";
|
|
3
|
+
import { ProcedureInfo } from "@mark1russell7/workflow";
|
|
4
|
+
/** The final status of a run. */
|
|
5
|
+
type RunStatus = "succeeded" | "failed" | "refused" | "invalid" | "in-doubt" | "cancelled";
|
|
6
|
+
/** The final status of a step. */
|
|
7
|
+
type StepStatus = "succeeded" | "skipped" | "failed" | "timed-out" | "refused" | "in-doubt" | "cancelled";
|
|
8
|
+
/** The event that started a run. `id` makes the run id: the same event gives the same run. */
|
|
9
|
+
interface TriggerEvent {
|
|
10
|
+
/** The kind of the trigger: `manual`, `schedule`, `event`, `feed` or `call`. */
|
|
11
|
+
readonly kind: string;
|
|
12
|
+
/** The id of the event, for example the id of a delivery or the time of a schedule boundary. */
|
|
13
|
+
readonly id: string;
|
|
14
|
+
/** The data of the event. A reference reads it as `event.data`. */
|
|
15
|
+
readonly data?: unknown;
|
|
16
|
+
/** For an event: the name of the event, for example `push`. A reference reads it as `event.event`. */
|
|
17
|
+
readonly event?: string;
|
|
18
|
+
/** For an event: its type, for example `opened`. A reference reads it as `event.type`. */
|
|
19
|
+
readonly type?: string;
|
|
20
|
+
/** For a feed: the workspace that the feed reads. */
|
|
21
|
+
readonly from?: string;
|
|
22
|
+
/** For a feed: the collection that the feed reads. */
|
|
23
|
+
readonly collection?: string;
|
|
24
|
+
/** For a call: the workspace of the caller. */
|
|
25
|
+
readonly caller?: string;
|
|
26
|
+
/**
|
|
27
|
+
* For a call: the count of the runs above this run in the chain of calls. A start by a person, a schedule or a source has
|
|
28
|
+
* the depth 0. The host gives the depth of the calling run plus 1.
|
|
29
|
+
*/
|
|
30
|
+
readonly depth?: number;
|
|
31
|
+
}
|
|
32
|
+
/** The outcome of one effect, after the redaction of the host. */
|
|
33
|
+
type Outcome = {
|
|
34
|
+
readonly ok: true;
|
|
35
|
+
readonly value: unknown;
|
|
36
|
+
} | {
|
|
37
|
+
readonly ok: false;
|
|
38
|
+
readonly code: string;
|
|
39
|
+
readonly why: string;
|
|
40
|
+
};
|
|
41
|
+
/** One entry of the record of a run. The record is append-only, and it is also the log of a resume. */
|
|
42
|
+
type RunEntry = {
|
|
43
|
+
readonly type: "start";
|
|
44
|
+
readonly run: string;
|
|
45
|
+
readonly docHash: string;
|
|
46
|
+
readonly doc: unknown;
|
|
47
|
+
readonly owner: string;
|
|
48
|
+
readonly workspace: unknown;
|
|
49
|
+
readonly trigger: TriggerEvent;
|
|
50
|
+
readonly inputs: unknown;
|
|
51
|
+
readonly time: number;
|
|
52
|
+
} | {
|
|
53
|
+
readonly type: "grant";
|
|
54
|
+
readonly at: string;
|
|
55
|
+
readonly from: string;
|
|
56
|
+
readonly access: "read" | "write";
|
|
57
|
+
readonly target: string;
|
|
58
|
+
readonly ok: boolean;
|
|
59
|
+
readonly why: string;
|
|
60
|
+
readonly time: number;
|
|
61
|
+
} | {
|
|
62
|
+
readonly type: "transition";
|
|
63
|
+
readonly machine: "workflow.run" | "workflow.step";
|
|
64
|
+
readonly instance: string;
|
|
65
|
+
readonly from: string;
|
|
66
|
+
readonly on: string;
|
|
67
|
+
readonly to: string;
|
|
68
|
+
readonly time: number;
|
|
69
|
+
readonly due?: number;
|
|
70
|
+
} | {
|
|
71
|
+
readonly type: "rows";
|
|
72
|
+
readonly job: string;
|
|
73
|
+
readonly rows: readonly unknown[];
|
|
74
|
+
readonly time: number;
|
|
75
|
+
} | {
|
|
76
|
+
readonly type: "effect-start";
|
|
77
|
+
readonly at: string;
|
|
78
|
+
readonly key: string;
|
|
79
|
+
readonly try: number;
|
|
80
|
+
readonly procedure: string;
|
|
81
|
+
readonly payload: unknown;
|
|
82
|
+
readonly time: number;
|
|
83
|
+
} | {
|
|
84
|
+
readonly type: "effect-end";
|
|
85
|
+
readonly at: string;
|
|
86
|
+
readonly outcome: Outcome;
|
|
87
|
+
readonly time: number;
|
|
88
|
+
} | {
|
|
89
|
+
readonly type: "step-end";
|
|
90
|
+
readonly instance: string;
|
|
91
|
+
readonly status: StepStatus;
|
|
92
|
+
readonly value?: unknown;
|
|
93
|
+
readonly time: number;
|
|
94
|
+
} | {
|
|
95
|
+
readonly type: "job-end";
|
|
96
|
+
readonly instance: string;
|
|
97
|
+
readonly status: StepStatus;
|
|
98
|
+
readonly outputs?: unknown;
|
|
99
|
+
readonly time: number;
|
|
100
|
+
} | {
|
|
101
|
+
readonly type: "end";
|
|
102
|
+
readonly status: RunStatus;
|
|
103
|
+
readonly why: string;
|
|
104
|
+
readonly time: number;
|
|
105
|
+
} | {
|
|
106
|
+
readonly type: "lease";
|
|
107
|
+
readonly holder: string;
|
|
108
|
+
readonly until: number;
|
|
109
|
+
readonly time: number;
|
|
110
|
+
};
|
|
111
|
+
/** The answer of a store to an append that another writer took first. */
|
|
112
|
+
declare class RecordConflict extends Error {
|
|
113
|
+
/** The count of the entries that the store holds. */
|
|
114
|
+
readonly length: number;
|
|
115
|
+
/**
|
|
116
|
+
* This constructor makes the error.
|
|
117
|
+
*
|
|
118
|
+
* @param run - The run id.
|
|
119
|
+
* @param seq - The place that the writer asked for.
|
|
120
|
+
* @param length - The count of the entries that the store holds.
|
|
121
|
+
*/
|
|
122
|
+
constructor(run: string, seq: number, length: number);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The store of the records of the runs. An append gives the place of the entry. When the record has another length,
|
|
126
|
+
* the store refuses with `RecordConflict`. Thus two runners cannot write one run (a fenced append).
|
|
127
|
+
*/
|
|
128
|
+
interface RunStore {
|
|
129
|
+
/** This function appends one entry at the place `seq`, or it refuses with `RecordConflict`. */
|
|
130
|
+
readonly append: (run: string, seq: number, entry: RunEntry) => Promise<void> | void;
|
|
131
|
+
/** This function gives the entries of a run in their order. A run with no record gives an empty list. */
|
|
132
|
+
readonly read: (run: string) => Promise<readonly RunEntry[]> | readonly RunEntry[];
|
|
133
|
+
/** This function gives the ids of the runs with no `end` entry. The recovery of a runner reads it. */
|
|
134
|
+
readonly open?: () => Promise<readonly string[]> | readonly string[];
|
|
135
|
+
}
|
|
136
|
+
/** The answer of a resume of a run that another runner holds: its lease is live. */
|
|
137
|
+
declare class RunHeld extends Error {
|
|
138
|
+
/** The holder of the lease. */
|
|
139
|
+
readonly holder: string;
|
|
140
|
+
/** The wall time at the end of the lease, in milliseconds. */
|
|
141
|
+
readonly until: number;
|
|
142
|
+
/**
|
|
143
|
+
* This constructor makes the error.
|
|
144
|
+
*
|
|
145
|
+
* @param run - The run id.
|
|
146
|
+
* @param holder - The holder of the lease.
|
|
147
|
+
* @param until - The wall time at the end of the lease.
|
|
148
|
+
*/
|
|
149
|
+
constructor(run: string, holder: string, until: number);
|
|
150
|
+
}
|
|
151
|
+
/** A store in memory, for tests and for a host with no durable store. Each entry is a copy as JSON. */
|
|
152
|
+
declare function memoryStore(): RunStore & {
|
|
153
|
+
readonly runs: () => readonly string[];
|
|
154
|
+
};
|
|
155
|
+
/** The facts of one procedure for the runner: the facts of the check, and the removal of a second call. */
|
|
156
|
+
interface RunnerProcedure extends ProcedureInfo {
|
|
157
|
+
/**
|
|
158
|
+
* `true` when the procedure removes a second call with the same key. Then the runner calls again after a crash or a
|
|
159
|
+
* time limit. Without it, an effect with no outcome ends the step as `in-doubt`.
|
|
160
|
+
*/
|
|
161
|
+
readonly idempotent?: boolean;
|
|
162
|
+
}
|
|
163
|
+
/** One call of a procedure, for the host. */
|
|
164
|
+
interface ProcedureCall {
|
|
165
|
+
/** The path of the procedure, for example `["git", "clone"]`. */
|
|
166
|
+
readonly procedure: readonly string[];
|
|
167
|
+
/** The inputs. A secret stays a reference: the host reads its value. */
|
|
168
|
+
readonly inputs: Readonly<Record<string, unknown>>;
|
|
169
|
+
/** The idempotency key: the same for each try and each resume of one effect. */
|
|
170
|
+
readonly key: string;
|
|
171
|
+
/** The number of the try, from 1. */
|
|
172
|
+
readonly try: number;
|
|
173
|
+
/** The workspace that runs the workflow. */
|
|
174
|
+
readonly workspace: string;
|
|
175
|
+
/**
|
|
176
|
+
* The depth of the run in a chain of calls. A host that starts a workflow from this call gives it this depth plus 1.
|
|
177
|
+
* The host takes the depth from this field, not from the inputs of the call.
|
|
178
|
+
*/
|
|
179
|
+
readonly depth: number;
|
|
180
|
+
/** The signal of the time limit of the step. */
|
|
181
|
+
readonly signal: AbortSignal;
|
|
182
|
+
}
|
|
183
|
+
/** One question to the grant check. */
|
|
184
|
+
interface AccessRequest {
|
|
185
|
+
readonly from: string;
|
|
186
|
+
readonly access: "read" | "write";
|
|
187
|
+
readonly target: string;
|
|
188
|
+
}
|
|
189
|
+
/** The answer of the grant check. */
|
|
190
|
+
interface AccessAnswer {
|
|
191
|
+
readonly ok: boolean;
|
|
192
|
+
readonly why: string;
|
|
193
|
+
}
|
|
194
|
+
/** The limits of the runner. A document over a limit is `invalid`, and an outcome over its limit fails its step. */
|
|
195
|
+
interface RunnerLimits {
|
|
196
|
+
/** The most rows of one matrix. The default is 256. */
|
|
197
|
+
readonly matrix?: number;
|
|
198
|
+
/** The most tries of one step. The default is 10. */
|
|
199
|
+
readonly tries?: number;
|
|
200
|
+
/** The most bytes of one outcome as JSON. The default is 1000000. */
|
|
201
|
+
readonly outcomeBytes?: number;
|
|
202
|
+
/** The most job instances that run at the same time. The default is 8. */
|
|
203
|
+
readonly jobs?: number;
|
|
204
|
+
/** The time of a lease on a run, in milliseconds. The runner renews it after each third of this time. The default is 60000. */
|
|
205
|
+
readonly lease?: number;
|
|
206
|
+
/** The most depth of a call trigger. A deeper chain of calls is refused. The default is 8. */
|
|
207
|
+
readonly callDepth?: number;
|
|
208
|
+
}
|
|
209
|
+
/** The ports of the runner. The runner names no host: the host gives each port. */
|
|
210
|
+
interface RunnerOptions {
|
|
211
|
+
/** The facts of each procedure, by its path with dots. A call of a procedure that is not here is refused. */
|
|
212
|
+
readonly procedures: Readonly<Record<string, RunnerProcedure>>;
|
|
213
|
+
/** The host does one call. A throw is the failure of the call. */
|
|
214
|
+
readonly call: (call: ProcedureCall) => Promise<unknown>;
|
|
215
|
+
/** The grant check. A throw is a refusal. */
|
|
216
|
+
readonly access: (request: AccessRequest) => AccessAnswer | Promise<AccessAnswer>;
|
|
217
|
+
/**
|
|
218
|
+
* The redaction of the host: it removes the value of each secret from a value. The runner gives it each outcome, each
|
|
219
|
+
* error text, each payload and the trigger event, before the record and before a later step reads them.
|
|
220
|
+
*/
|
|
221
|
+
readonly redact: (value: unknown) => unknown;
|
|
222
|
+
/** The store of the records. */
|
|
223
|
+
readonly store: RunStore;
|
|
224
|
+
/** The clock of the time limits and the retry waits. */
|
|
225
|
+
readonly clock: Clock;
|
|
226
|
+
/** The wall time of the record, in milliseconds. The default is `Date.now`. A due time of a retry uses it. */
|
|
227
|
+
readonly wall?: () => number;
|
|
228
|
+
/** The machine of the documents. The default is `workflowMachine()`. */
|
|
229
|
+
readonly machine?: Machine;
|
|
230
|
+
/** The namespaces of calls, besides `procedure`. */
|
|
231
|
+
readonly callNamespaces?: readonly string[];
|
|
232
|
+
/** The limits. */
|
|
233
|
+
readonly limits?: RunnerLimits;
|
|
234
|
+
/**
|
|
235
|
+
* The id of this runner in the leases of the runs. A runner with the same id resumes its runs at once after a restart.
|
|
236
|
+
* Another runner waits for the end of the lease. The default is a new random id.
|
|
237
|
+
*/
|
|
238
|
+
readonly holder?: string;
|
|
239
|
+
}
|
|
240
|
+
/** A request to start a run. */
|
|
241
|
+
interface StartRequest {
|
|
242
|
+
/** The workflow document. */
|
|
243
|
+
readonly doc: unknown;
|
|
244
|
+
/** The workspace that holds the document, from the store of the host. The field `workspace` of the document must be the same. */
|
|
245
|
+
readonly owner: string;
|
|
246
|
+
/** The event that starts the run. */
|
|
247
|
+
readonly trigger: TriggerEvent;
|
|
248
|
+
/** The inputs of the run. */
|
|
249
|
+
readonly inputs?: Readonly<Record<string, unknown>>;
|
|
250
|
+
}
|
|
251
|
+
/** The end of a run. */
|
|
252
|
+
interface RunResult {
|
|
253
|
+
readonly run: string;
|
|
254
|
+
readonly status: RunStatus;
|
|
255
|
+
readonly why: string;
|
|
256
|
+
readonly entries: readonly RunEntry[];
|
|
257
|
+
}
|
|
258
|
+
/** The runner of a workflow. */
|
|
259
|
+
interface WorkflowRunner {
|
|
260
|
+
/** This function gives the run id of a request: the same document, owner and event give the same id. */
|
|
261
|
+
readonly runIdOf: (request: StartRequest) => string;
|
|
262
|
+
/** This function starts a run. A request with a run id that has a record resumes that run. */
|
|
263
|
+
readonly start: (request: StartRequest) => Promise<RunResult>;
|
|
264
|
+
/**
|
|
265
|
+
* This function resumes a run from its record. The record holds the document, thus a changed document makes no change.
|
|
266
|
+
* A live lease of another runner gives the error `RunHeld`.
|
|
267
|
+
*/
|
|
268
|
+
readonly resume: (run: string) => Promise<RunResult>;
|
|
269
|
+
/** This function resumes each open run of the store with no live lease of another runner. The store must give `open`. */
|
|
270
|
+
readonly recover: (options?: RecoverOptions) => Promise<RecoverReport>;
|
|
271
|
+
}
|
|
272
|
+
/** The options of a recovery. */
|
|
273
|
+
interface RecoverOptions {
|
|
274
|
+
/** The most runs that resume at the same time. The default is 4. */
|
|
275
|
+
readonly concurrency?: number;
|
|
276
|
+
}
|
|
277
|
+
/** The report of a recovery: the runs that ended, the runs that another runner holds, and the runs that failed to resume. */
|
|
278
|
+
interface RecoverReport {
|
|
279
|
+
readonly resumed: readonly {
|
|
280
|
+
readonly run: string;
|
|
281
|
+
readonly status: RunStatus;
|
|
282
|
+
readonly why: string;
|
|
283
|
+
}[];
|
|
284
|
+
readonly held: readonly {
|
|
285
|
+
readonly run: string;
|
|
286
|
+
readonly holder: string;
|
|
287
|
+
readonly until: number;
|
|
288
|
+
}[];
|
|
289
|
+
readonly failed: readonly {
|
|
290
|
+
readonly run: string;
|
|
291
|
+
readonly why: string;
|
|
292
|
+
}[];
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* This function makes a runner of workflows. The runner records each run in the store, and each record is the log of
|
|
296
|
+
* a resume. It refuses an effect that the grant check does not permit, and it records each answer.
|
|
297
|
+
*
|
|
298
|
+
* @param options - The ports and the limits.
|
|
299
|
+
* @returns The runner.
|
|
300
|
+
*/
|
|
301
|
+
declare function workflowRunner(options: RunnerOptions): WorkflowRunner;
|
|
302
|
+
export { RunStatus as _, RecoverReport as a, TriggerEvent as b, RunnerOptions as c, WorkflowRunner as d, workflowRunner as f, RunHeld as g, RunEntry as h, RecoverOptions as i, RunnerProcedure as l, RecordConflict as m, AccessRequest as n, RunResult as o, Outcome as p, ProcedureCall as r, RunnerLimits as s, AccessAnswer as t, StartRequest as u, RunStore as v, memoryStore as x, StepStatus as y };
|
|
303
|
+
//# sourceMappingURL=engine-bAZZ3ZT9.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-bAZZ3ZT9.d.ts","names":[],"sources":["../src/record.ts","../src/engine.ts"],"mappings":";;;;KACY;;KAGA;;UAGK;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;;;WAKA;;;KAIC;WAAqB;WAAmB;;WAA8B;WAAoB;WAAuB;;;KAGjH;WAEG;WACA;WACA;WACA;WACA;WACA;WACA,SAAS;WACT;WACA;;WAEA;WAAwB;WAAqB;WAAuB;WAAmC;WAAyB;WAAsB;WAAsB;;WAC5K;WAA6B;WAAoD;WAA2B;WAAuB;WAAqB;WAAqB;WAAuB;;WACpM;WAAuB;WAAsB;WAAmC;;WAChF;WAA+B;WAAqB;WAAsB;WAAsB;WAA4B;WAA2B;;WACvJ;WAA6B;WAAqB,SAAS;WAAkB;;WAC7E;WAA2B;WAA2B,QAAQ;WAAqB;WAA0B;;WAC7G;WAA0B;WAA2B,QAAQ;WAAqB;WAA4B;;WAC9G;WAAsB,QAAQ;WAAoB;WAAsB;;WACxE;WAAwB;WAAyB;WAAwB;;;cAG3E,uBAAuB;;WAEzB;;;;;;;;EAST,YAAY,aAAa,aAAa;;;;;;UAWvB;;WAEN,SAAS,aAAa,aAAa,OAAO,aAAa;;WAEvD,OAAO,gBAAgB,iBAAiB,uBAAuB;;WAE/D,aAAa;;;cAIX,gBAAgB;;WAElB;;WAEA;;;;;;;;EAST,YAAY,aAAa,gBAAgB;;;iBAS3B,eAAe;WAAsB;;;UCrGpC,wBAAwB;;;;;WAK9B;;;UAIM;;WAEN;;WAEA,QAAQ,SAAS;;WAEjB;;WAEA;;WAEA;;;;;WAKA;;WAEA,QAAQ;;;UAIF;WACN;WACA;WACA;;;UAIM;WACN;WACA;;;UAIM;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;UAIM;;WAEN,YAAY,SAAS,eAAe;;WAEpC,OAAO,MAAM,kBAAkB;;WAE/B,SAAS,SAAS,kBAAkB,eAAe,QAAQ;;;;;WAK3D,SAAS;;WAET,OAAO;;WAEP,OAAO;;WAEP;;WAEA,UAAU;;WAEV;;WAEA,SAAS;;;;;WAKT;;;UAIM;;WAEN;;WAEA;;WAEA,SAAS;;WAET,SAAS,SAAS;;;UAIZ;WACN;WACA,QAAQ;WACR;WACA,kBAAkB;;;UAIZ;;WAEN,UAAU,SAAS;;WAEnB,QAAQ,SAAS,iBAAiB,QAAQ;;;;;WAK1C,SAAS,gBAAgB,QAAQ;;WAEjC,UAAU,UAAU,mBAAmB,QAAQ;;;UAIzC;;WAEN;;;UAIM;WACN;aAA6B;aAAsB,QAAQ;aAAoB;;WAC/E;aAA0B;aAAsB;aAAyB;;WACzE;aAA4B;aAAsB;;;;;;;;;;iBAsI7C,eAAe,SAAS,gBAAgB"}
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { _ as RunStatus, a as RecoverReport, b as TriggerEvent, c as RunnerOptions, d as WorkflowRunner, f as workflowRunner, g as RunHeld, h as RunEntry, i as RecoverOptions, l as RunnerProcedure, m as RecordConflict, n as AccessRequest, o as RunResult, p as Outcome, r as ProcedureCall, s as RunnerLimits, t as AccessAnswer, u as StartRequest, v as RunStore, x as memoryStore, y as StepStatus } from "./engine-bAZZ3ZT9.js";
|
|
2
|
+
import { Machine } from "@mark1russell7/algebra";
|
|
3
|
+
/**
|
|
4
|
+
* The state machine of a run. A run is queued, then it runs. It ends with one status. The runner records each
|
|
5
|
+
* transition, and a test checks the record against this machine.
|
|
6
|
+
*/
|
|
7
|
+
export declare const RUN_MACHINE: Machine;
|
|
8
|
+
/**
|
|
9
|
+
* The state machine of one step of one job instance. A failed try waits for its retry. A refusal and a doubt end the
|
|
10
|
+
* step at once: no retry and no `continue` changes them.
|
|
11
|
+
*/
|
|
12
|
+
export declare const STEP_MACHINE: Machine;
|
|
13
|
+
export { type AccessAnswer, type AccessRequest, type Outcome, type ProcedureCall, RecordConflict, type RecoverOptions, type RecoverReport, type RunEntry, RunHeld, type RunResult, type RunStatus, type RunStore, type RunnerLimits, type RunnerOptions, type RunnerProcedure, type StartRequest, type StepStatus, type TriggerEvent, type WorkflowRunner, memoryStore, workflowRunner };
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/machines.ts"],"mappings":";;;;;;qBAQa,aAAa;;;;;qBA4Cb,cAAc"}
|