@voltro/workflow 0.84.0 → 0.86.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/CHANGELOG.md +1215 -0
- package/THIRD-PARTY-NOTICES.md +5 -151
- package/dist/admission.js +140 -0
- package/dist/admissionDrainer.js +705 -0
- package/dist/admissionGate.js +115 -0
- package/dist/admissionStore.js +347 -0
- package/dist/admissionSubmission.js +297 -0
- package/dist/admissionTables.js +137 -0
- package/dist/admissionTransaction.js +21 -0
- package/dist/awaitEvent.js +82 -0
- package/dist/budgetHold.js +136 -0
- package/dist/cancelOnPlan.js +75 -0
- package/dist/cancelOnSweep.js +188 -0
- package/dist/cancelPendingStart.js +50 -0
- package/dist/cluster.d.ts +304 -280
- package/dist/cluster.js +8 -2
- package/dist/clusterCron.js +11 -0
- package/dist/clusterDiagnostics.js +20 -0
- package/dist/clusterDiagnosticsSql.js +145 -0
- package/dist/clusterLayer.js +110 -0
- package/dist/clusterMigrationGate.js +61 -0
- package/dist/clusterRunnerLayer.js +21 -0
- package/dist/clusterTestSuite.d.ts +11 -11
- package/dist/clusterTestSuite.js +257 -257
- package/dist/controlMonitor.js +13 -0
- package/dist/controlRequest.js +367 -0
- package/dist/executionRefusal.js +162 -0
- package/dist/failureHandoff.js +183 -0
- package/dist/failureMessage.js +12 -0
- package/dist/failureRecovery.js +50 -0
- package/dist/failureReportStore.js +60 -0
- package/dist/flowControl.js +142 -0
- package/dist/forwardStartReceipts.js +41 -0
- package/dist/inMemoryLayer.js +7 -0
- package/dist/inMemoryRecorder.js +56 -0
- package/dist/index.d.ts +456 -360
- package/dist/index.js +49 -5
- package/dist/inspectWorkflow.js +101 -0
- package/dist/journalEncryption.js +147 -0
- package/dist/messages.js +92 -0
- package/dist/nondeterminism.js +51 -0
- package/dist/parentClosure.js +141 -0
- package/dist/parentClosureRecovery.js +54 -0
- package/dist/pendingSubmission.js +85 -0
- package/dist/prepareSubmissionDispatch.js +17 -0
- package/dist/preparedExecution.js +14 -0
- package/dist/primitives.d.ts +56 -31
- package/dist/primitives.js +225 -2
- package/dist/queuedCancellationRequest.js +364 -0
- package/dist/queuedControl.js +21 -0
- package/dist/recorder.js +11 -0
- package/dist/residentExecutionEvidence.js +64 -0
- package/dist/retryPolicy.js +57 -0
- package/dist/runEventsTable.js +17 -0
- package/dist/runGeneration.js +345 -0
- package/dist/runRecording.js +615 -0
- package/dist/runStepsTable.js +28 -0
- package/dist/runnerStorageGuard.js +29 -0
- package/dist/runsTable.js +42 -0
- package/dist/scheduleDeclaration.js +44 -0
- package/dist/signalHint.js +23 -0
- package/dist/signals.js +70 -0
- package/dist/signalsSuspending.js +57 -0
- package/dist/sqliteWorkflowOwnership.js +26 -0
- package/dist/stalenessSweep.js +191 -0
- package/dist/startContextsTable.js +20 -0
- package/dist/startReceipt.js +143 -0
- package/dist/submissionRecovery.js +122 -0
- package/dist/submissionRejection.js +10 -0
- package/dist/submissionRetry.js +71 -0
- package/dist/suspensionUnavailable.js +9 -0
- package/dist/updates.js +87 -0
- package/dist/watermarkTable.js +9 -0
- package/dist/webCrypto.js +17 -0
- package/dist/workflowDelivery.js +24 -0
- package/dist/workflowJournal.js +124 -0
- package/dist/workflowJournalReset.js +111 -0
- package/dist/workflowReadSelections.js +12 -0
- package/dist/workflowRestartDispatch.js +29 -0
- package/dist/workflowRestartObservation.js +60 -0
- package/dist/workflowRestartPreparation.js +109 -0
- package/dist/workflowRestartReservation.js +426 -0
- package/dist/workflowResumeDispatch.js +29 -0
- package/package.json +6 -9
- package/dist/cluster-i3frC3Da.js +0 -646
- package/dist/clusterDiagnostics-CGUtnJkX.js +0 -2084
- package/dist/journalEncryption--n5VDdYO.js +0 -148
- package/dist/primitives-Btjhjm8P.js +0 -483
- package/dist/src-DP-lKqaG.js +0 -3867
package/dist/cluster.d.ts
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Config } from 'effect';
|
|
2
2
|
import { Context } from 'effect';
|
|
3
3
|
import { Cron } from 'effect';
|
|
4
4
|
import { DataStore } from '@voltro/database';
|
|
5
5
|
import { Duration } from 'effect';
|
|
6
6
|
import { Effect } from 'effect';
|
|
7
7
|
import { Layer } from 'effect';
|
|
8
|
-
import { MalformedMessage } from '
|
|
9
|
-
import { MessageStorage } from '
|
|
8
|
+
import { MalformedMessage } from 'effect/cluster/ClusterError';
|
|
9
|
+
import { MessageStorage } from 'effect/cluster';
|
|
10
10
|
import { MysqlCharset } from '@voltro/database/sql';
|
|
11
|
-
import { PersistenceError } from '
|
|
11
|
+
import { PersistenceError } from 'effect/cluster/ClusterError';
|
|
12
12
|
import { QueryDescriptor } from '@voltro/database';
|
|
13
|
+
import { RateLimiter } from 'effect/persistence';
|
|
13
14
|
import { Row } from '@voltro/database';
|
|
14
15
|
import { Schema } from 'effect';
|
|
15
|
-
import { Sharding } from '
|
|
16
|
-
import { SqlClient } from '
|
|
17
|
-
import { SqlClient as SqlClient_2 } from '
|
|
18
|
-
import { SqlError } from '
|
|
19
|
-
import { SqlError as SqlError_2 } from '
|
|
20
|
-
import { Workflow } from '
|
|
21
|
-
import { WorkflowEngine } from '
|
|
16
|
+
import { Sharding } from 'effect/cluster';
|
|
17
|
+
import { SqlClient } from 'effect/sql';
|
|
18
|
+
import { SqlClient as SqlClient_2 } from 'effect/sql/SqlClient';
|
|
19
|
+
import { SqlError } from 'effect/sql';
|
|
20
|
+
import { SqlError as SqlError_2 } from 'effect/sql/SqlError';
|
|
21
|
+
import { Workflow } from 'effect/workflow';
|
|
22
|
+
import { WorkflowEngine } from 'effect/workflow';
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* The cluster's own activity primary-key format — an activity RPC's
|
|
@@ -79,31 +80,25 @@ declare const bindWorkflowResumeJournalInTransaction: (tx: Store, id: string, ob
|
|
|
79
80
|
kind: "settled";
|
|
80
81
|
request: {
|
|
81
82
|
readonly id: string;
|
|
82
|
-
readonly cause?: {
|
|
83
|
-
readonly detail?: {
|
|
84
|
-
readonly [x: string]: unknown;
|
|
85
|
-
} | undefined;
|
|
86
|
-
readonly reason: string;
|
|
87
|
-
} | null | undefined;
|
|
88
83
|
readonly result: {
|
|
89
|
-
readonly status: "failed" | "cancelled" | "succeeded";
|
|
90
84
|
readonly kind: "confirmed" | "already-terminal";
|
|
85
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
86
|
+
readonly completedAt: number;
|
|
91
87
|
readonly output: unknown;
|
|
92
|
-
readonly errorMessage: string | null;
|
|
93
88
|
readonly errorTag: string | null;
|
|
94
|
-
readonly
|
|
89
|
+
readonly errorMessage: string | null;
|
|
95
90
|
} | {
|
|
96
|
-
readonly status: "running";
|
|
97
91
|
readonly kind: "confirmed";
|
|
98
|
-
readonly
|
|
92
|
+
readonly status: "running";
|
|
99
93
|
readonly enteredAt: number;
|
|
94
|
+
readonly generation: string;
|
|
100
95
|
} | null;
|
|
96
|
+
readonly operation: "resume" | "cancel" | "terminate";
|
|
101
97
|
readonly generation: string;
|
|
102
98
|
readonly runId: string;
|
|
103
99
|
readonly requestedAt: number;
|
|
104
100
|
readonly executionId: string;
|
|
105
101
|
readonly workflowName: string;
|
|
106
|
-
readonly operation: "resume" | "cancel" | "terminate";
|
|
107
102
|
readonly dispatchAttempts: number;
|
|
108
103
|
readonly owner: {
|
|
109
104
|
readonly tenantId: string | null;
|
|
@@ -113,36 +108,36 @@ declare const bindWorkflowResumeJournalInTransaction: (tx: Store, id: string, ob
|
|
|
113
108
|
readonly replyId: string;
|
|
114
109
|
readonly restartToken: string | null;
|
|
115
110
|
} | null;
|
|
116
|
-
};
|
|
117
|
-
} | {
|
|
118
|
-
kind: "unknown";
|
|
119
|
-
request: {
|
|
120
|
-
readonly id: string;
|
|
121
111
|
readonly cause?: {
|
|
112
|
+
readonly reason: string;
|
|
122
113
|
readonly detail?: {
|
|
123
114
|
readonly [x: string]: unknown;
|
|
124
115
|
} | undefined;
|
|
125
|
-
readonly reason: string;
|
|
126
116
|
} | null | undefined;
|
|
117
|
+
};
|
|
118
|
+
} | {
|
|
119
|
+
kind: "unknown";
|
|
120
|
+
request: {
|
|
121
|
+
readonly id: string;
|
|
127
122
|
readonly result: {
|
|
128
|
-
readonly status: "failed" | "cancelled" | "succeeded";
|
|
129
123
|
readonly kind: "confirmed" | "already-terminal";
|
|
124
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
125
|
+
readonly completedAt: number;
|
|
130
126
|
readonly output: unknown;
|
|
131
|
-
readonly errorMessage: string | null;
|
|
132
127
|
readonly errorTag: string | null;
|
|
133
|
-
readonly
|
|
128
|
+
readonly errorMessage: string | null;
|
|
134
129
|
} | {
|
|
135
|
-
readonly status: "running";
|
|
136
130
|
readonly kind: "confirmed";
|
|
137
|
-
readonly
|
|
131
|
+
readonly status: "running";
|
|
138
132
|
readonly enteredAt: number;
|
|
133
|
+
readonly generation: string;
|
|
139
134
|
} | null;
|
|
135
|
+
readonly operation: "resume" | "cancel" | "terminate";
|
|
140
136
|
readonly generation: string;
|
|
141
137
|
readonly runId: string;
|
|
142
138
|
readonly requestedAt: number;
|
|
143
139
|
readonly executionId: string;
|
|
144
140
|
readonly workflowName: string;
|
|
145
|
-
readonly operation: "resume" | "cancel" | "terminate";
|
|
146
141
|
readonly dispatchAttempts: number;
|
|
147
142
|
readonly owner: {
|
|
148
143
|
readonly tenantId: string | null;
|
|
@@ -152,36 +147,36 @@ declare const bindWorkflowResumeJournalInTransaction: (tx: Store, id: string, ob
|
|
|
152
147
|
readonly replyId: string;
|
|
153
148
|
readonly restartToken: string | null;
|
|
154
149
|
} | null;
|
|
155
|
-
};
|
|
156
|
-
} | {
|
|
157
|
-
kind: "superseded";
|
|
158
|
-
request: {
|
|
159
|
-
readonly id: string;
|
|
160
150
|
readonly cause?: {
|
|
151
|
+
readonly reason: string;
|
|
161
152
|
readonly detail?: {
|
|
162
153
|
readonly [x: string]: unknown;
|
|
163
154
|
} | undefined;
|
|
164
|
-
readonly reason: string;
|
|
165
155
|
} | null | undefined;
|
|
156
|
+
};
|
|
157
|
+
} | {
|
|
158
|
+
kind: "superseded";
|
|
159
|
+
request: {
|
|
160
|
+
readonly id: string;
|
|
166
161
|
readonly result: {
|
|
167
|
-
readonly status: "failed" | "cancelled" | "succeeded";
|
|
168
162
|
readonly kind: "confirmed" | "already-terminal";
|
|
163
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
164
|
+
readonly completedAt: number;
|
|
169
165
|
readonly output: unknown;
|
|
170
|
-
readonly errorMessage: string | null;
|
|
171
166
|
readonly errorTag: string | null;
|
|
172
|
-
readonly
|
|
167
|
+
readonly errorMessage: string | null;
|
|
173
168
|
} | {
|
|
174
|
-
readonly status: "running";
|
|
175
169
|
readonly kind: "confirmed";
|
|
176
|
-
readonly
|
|
170
|
+
readonly status: "running";
|
|
177
171
|
readonly enteredAt: number;
|
|
172
|
+
readonly generation: string;
|
|
178
173
|
} | null;
|
|
174
|
+
readonly operation: "resume" | "cancel" | "terminate";
|
|
179
175
|
readonly generation: string;
|
|
180
176
|
readonly runId: string;
|
|
181
177
|
readonly requestedAt: number;
|
|
182
178
|
readonly executionId: string;
|
|
183
179
|
readonly workflowName: string;
|
|
184
|
-
readonly operation: "resume" | "cancel" | "terminate";
|
|
185
180
|
readonly dispatchAttempts: number;
|
|
186
181
|
readonly owner: {
|
|
187
182
|
readonly tenantId: string | null;
|
|
@@ -191,36 +186,36 @@ declare const bindWorkflowResumeJournalInTransaction: (tx: Store, id: string, ob
|
|
|
191
186
|
readonly replyId: string;
|
|
192
187
|
readonly restartToken: string | null;
|
|
193
188
|
} | null;
|
|
194
|
-
};
|
|
195
|
-
} | {
|
|
196
|
-
kind: "not-suspended";
|
|
197
|
-
request: {
|
|
198
|
-
readonly id: string;
|
|
199
189
|
readonly cause?: {
|
|
190
|
+
readonly reason: string;
|
|
200
191
|
readonly detail?: {
|
|
201
192
|
readonly [x: string]: unknown;
|
|
202
193
|
} | undefined;
|
|
203
|
-
readonly reason: string;
|
|
204
194
|
} | null | undefined;
|
|
195
|
+
};
|
|
196
|
+
} | {
|
|
197
|
+
kind: "not-suspended";
|
|
198
|
+
request: {
|
|
199
|
+
readonly id: string;
|
|
205
200
|
readonly result: {
|
|
206
|
-
readonly status: "failed" | "cancelled" | "succeeded";
|
|
207
201
|
readonly kind: "confirmed" | "already-terminal";
|
|
202
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
203
|
+
readonly completedAt: number;
|
|
208
204
|
readonly output: unknown;
|
|
209
|
-
readonly errorMessage: string | null;
|
|
210
205
|
readonly errorTag: string | null;
|
|
211
|
-
readonly
|
|
206
|
+
readonly errorMessage: string | null;
|
|
212
207
|
} | {
|
|
213
|
-
readonly status: "running";
|
|
214
208
|
readonly kind: "confirmed";
|
|
215
|
-
readonly
|
|
209
|
+
readonly status: "running";
|
|
216
210
|
readonly enteredAt: number;
|
|
211
|
+
readonly generation: string;
|
|
217
212
|
} | null;
|
|
213
|
+
readonly operation: "resume" | "cancel" | "terminate";
|
|
218
214
|
readonly generation: string;
|
|
219
215
|
readonly runId: string;
|
|
220
216
|
readonly requestedAt: number;
|
|
221
217
|
readonly executionId: string;
|
|
222
218
|
readonly workflowName: string;
|
|
223
|
-
readonly operation: "resume" | "cancel" | "terminate";
|
|
224
219
|
readonly dispatchAttempts: number;
|
|
225
220
|
readonly owner: {
|
|
226
221
|
readonly tenantId: string | null;
|
|
@@ -230,36 +225,36 @@ declare const bindWorkflowResumeJournalInTransaction: (tx: Store, id: string, ob
|
|
|
230
225
|
readonly replyId: string;
|
|
231
226
|
readonly restartToken: string | null;
|
|
232
227
|
} | null;
|
|
233
|
-
};
|
|
234
|
-
} | {
|
|
235
|
-
kind: "bound";
|
|
236
|
-
request: {
|
|
237
|
-
readonly id: string;
|
|
238
228
|
readonly cause?: {
|
|
229
|
+
readonly reason: string;
|
|
239
230
|
readonly detail?: {
|
|
240
231
|
readonly [x: string]: unknown;
|
|
241
232
|
} | undefined;
|
|
242
|
-
readonly reason: string;
|
|
243
233
|
} | null | undefined;
|
|
234
|
+
};
|
|
235
|
+
} | {
|
|
236
|
+
kind: "bound";
|
|
237
|
+
request: {
|
|
238
|
+
readonly id: string;
|
|
244
239
|
readonly result: {
|
|
245
|
-
readonly status: "failed" | "cancelled" | "succeeded";
|
|
246
240
|
readonly kind: "confirmed" | "already-terminal";
|
|
241
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
242
|
+
readonly completedAt: number;
|
|
247
243
|
readonly output: unknown;
|
|
248
|
-
readonly errorMessage: string | null;
|
|
249
244
|
readonly errorTag: string | null;
|
|
250
|
-
readonly
|
|
245
|
+
readonly errorMessage: string | null;
|
|
251
246
|
} | {
|
|
252
|
-
readonly status: "running";
|
|
253
247
|
readonly kind: "confirmed";
|
|
254
|
-
readonly
|
|
248
|
+
readonly status: "running";
|
|
255
249
|
readonly enteredAt: number;
|
|
250
|
+
readonly generation: string;
|
|
256
251
|
} | null;
|
|
252
|
+
readonly operation: "resume" | "cancel" | "terminate";
|
|
257
253
|
readonly generation: string;
|
|
258
254
|
readonly runId: string;
|
|
259
255
|
readonly requestedAt: number;
|
|
260
256
|
readonly executionId: string;
|
|
261
257
|
readonly workflowName: string;
|
|
262
|
-
readonly operation: "resume" | "cancel" | "terminate";
|
|
263
258
|
readonly dispatchAttempts: number;
|
|
264
259
|
readonly owner: {
|
|
265
260
|
readonly tenantId: string | null;
|
|
@@ -269,36 +264,36 @@ declare const bindWorkflowResumeJournalInTransaction: (tx: Store, id: string, ob
|
|
|
269
264
|
readonly replyId: string;
|
|
270
265
|
readonly restartToken: string | null;
|
|
271
266
|
} | null;
|
|
272
|
-
};
|
|
273
|
-
} | {
|
|
274
|
-
kind: "waiting-journal";
|
|
275
|
-
request: {
|
|
276
|
-
readonly id: string;
|
|
277
267
|
readonly cause?: {
|
|
268
|
+
readonly reason: string;
|
|
278
269
|
readonly detail?: {
|
|
279
270
|
readonly [x: string]: unknown;
|
|
280
271
|
} | undefined;
|
|
281
|
-
readonly reason: string;
|
|
282
272
|
} | null | undefined;
|
|
273
|
+
};
|
|
274
|
+
} | {
|
|
275
|
+
kind: "waiting-journal";
|
|
276
|
+
request: {
|
|
277
|
+
readonly id: string;
|
|
283
278
|
readonly result: {
|
|
284
|
-
readonly status: "failed" | "cancelled" | "succeeded";
|
|
285
279
|
readonly kind: "confirmed" | "already-terminal";
|
|
280
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
281
|
+
readonly completedAt: number;
|
|
286
282
|
readonly output: unknown;
|
|
287
|
-
readonly errorMessage: string | null;
|
|
288
283
|
readonly errorTag: string | null;
|
|
289
|
-
readonly
|
|
284
|
+
readonly errorMessage: string | null;
|
|
290
285
|
} | {
|
|
291
|
-
readonly status: "running";
|
|
292
286
|
readonly kind: "confirmed";
|
|
293
|
-
readonly
|
|
287
|
+
readonly status: "running";
|
|
294
288
|
readonly enteredAt: number;
|
|
289
|
+
readonly generation: string;
|
|
295
290
|
} | null;
|
|
291
|
+
readonly operation: "resume" | "cancel" | "terminate";
|
|
296
292
|
readonly generation: string;
|
|
297
293
|
readonly runId: string;
|
|
298
294
|
readonly requestedAt: number;
|
|
299
295
|
readonly executionId: string;
|
|
300
296
|
readonly workflowName: string;
|
|
301
|
-
readonly operation: "resume" | "cancel" | "terminate";
|
|
302
297
|
readonly dispatchAttempts: number;
|
|
303
298
|
readonly owner: {
|
|
304
299
|
readonly tenantId: string | null;
|
|
@@ -308,6 +303,12 @@ declare const bindWorkflowResumeJournalInTransaction: (tx: Store, id: string, ob
|
|
|
308
303
|
readonly replyId: string;
|
|
309
304
|
readonly restartToken: string | null;
|
|
310
305
|
} | null;
|
|
306
|
+
readonly cause?: {
|
|
307
|
+
readonly reason: string;
|
|
308
|
+
readonly detail?: {
|
|
309
|
+
readonly [x: string]: unknown;
|
|
310
|
+
} | undefined;
|
|
311
|
+
} | null | undefined;
|
|
311
312
|
};
|
|
312
313
|
}>;
|
|
313
314
|
|
|
@@ -323,13 +324,13 @@ export declare interface ClusterCronSpec {
|
|
|
323
324
|
readonly execute: () => Promise<void>;
|
|
324
325
|
/** Skip a firing whose scheduled time is older than this — the
|
|
325
326
|
* cluster's built-in backfill guard. Defaults to "1 day". */
|
|
326
|
-
readonly skipIfOlderThan?: Duration.
|
|
327
|
+
readonly skipIfOlderThan?: Duration.Input;
|
|
327
328
|
}
|
|
328
329
|
|
|
329
330
|
declare class ClusterDiagnostics extends ClusterDiagnostics_base {
|
|
330
331
|
}
|
|
331
332
|
|
|
332
|
-
declare const ClusterDiagnostics_base: Context.
|
|
333
|
+
declare const ClusterDiagnostics_base: Context.ServiceClass<ClusterDiagnostics, "@voltro/workflow/ClusterDiagnostics", ClusterDiagnosticsOps>;
|
|
333
334
|
|
|
334
335
|
declare interface ClusterDiagnosticsOps {
|
|
335
336
|
/** This runner's advertised address — what keys its locks and its runner row. */
|
|
@@ -383,6 +384,9 @@ export declare interface ClusterDiagnosticsOptions {
|
|
|
383
384
|
readonly hasShard?: (shardId: string) => boolean;
|
|
384
385
|
}
|
|
385
386
|
|
|
387
|
+
/** `SqlRunnerStorage`'s postgres lock namespace, as `pg_locks.classid` shows it. */
|
|
388
|
+
export declare const clusterLockNamespaceOid: (prefix?: string) => number;
|
|
389
|
+
|
|
386
390
|
declare interface ClusterMessageState {
|
|
387
391
|
/** The rpc tag — `run` for the workflow itself, `activity/<name>/<attempt>` for a step. */
|
|
388
392
|
readonly tag: string | null;
|
|
@@ -477,31 +481,25 @@ declare const dispatchWorkflowResume: (options: {
|
|
|
477
481
|
kind: "settled";
|
|
478
482
|
request: {
|
|
479
483
|
readonly id: string;
|
|
480
|
-
readonly cause?: {
|
|
481
|
-
readonly detail?: {
|
|
482
|
-
readonly [x: string]: unknown;
|
|
483
|
-
} | undefined;
|
|
484
|
-
readonly reason: string;
|
|
485
|
-
} | null | undefined;
|
|
486
484
|
readonly result: {
|
|
487
|
-
readonly status: "failed" | "cancelled" | "succeeded";
|
|
488
485
|
readonly kind: "confirmed" | "already-terminal";
|
|
486
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
487
|
+
readonly completedAt: number;
|
|
489
488
|
readonly output: unknown;
|
|
490
|
-
readonly errorMessage: string | null;
|
|
491
489
|
readonly errorTag: string | null;
|
|
492
|
-
readonly
|
|
490
|
+
readonly errorMessage: string | null;
|
|
493
491
|
} | {
|
|
494
|
-
readonly status: "running";
|
|
495
492
|
readonly kind: "confirmed";
|
|
496
|
-
readonly
|
|
493
|
+
readonly status: "running";
|
|
497
494
|
readonly enteredAt: number;
|
|
495
|
+
readonly generation: string;
|
|
498
496
|
} | null;
|
|
497
|
+
readonly operation: "resume" | "cancel" | "terminate";
|
|
499
498
|
readonly generation: string;
|
|
500
499
|
readonly runId: string;
|
|
501
500
|
readonly requestedAt: number;
|
|
502
501
|
readonly executionId: string;
|
|
503
502
|
readonly workflowName: string;
|
|
504
|
-
readonly operation: "resume" | "cancel" | "terminate";
|
|
505
503
|
readonly dispatchAttempts: number;
|
|
506
504
|
readonly owner: {
|
|
507
505
|
readonly tenantId: string | null;
|
|
@@ -511,36 +509,36 @@ declare const dispatchWorkflowResume: (options: {
|
|
|
511
509
|
readonly replyId: string;
|
|
512
510
|
readonly restartToken: string | null;
|
|
513
511
|
} | null;
|
|
514
|
-
};
|
|
515
|
-
} | {
|
|
516
|
-
kind: "unknown";
|
|
517
|
-
request: {
|
|
518
|
-
readonly id: string;
|
|
519
512
|
readonly cause?: {
|
|
513
|
+
readonly reason: string;
|
|
520
514
|
readonly detail?: {
|
|
521
515
|
readonly [x: string]: unknown;
|
|
522
516
|
} | undefined;
|
|
523
|
-
readonly reason: string;
|
|
524
517
|
} | null | undefined;
|
|
518
|
+
};
|
|
519
|
+
} | {
|
|
520
|
+
kind: "unknown";
|
|
521
|
+
request: {
|
|
522
|
+
readonly id: string;
|
|
525
523
|
readonly result: {
|
|
526
|
-
readonly status: "failed" | "cancelled" | "succeeded";
|
|
527
524
|
readonly kind: "confirmed" | "already-terminal";
|
|
525
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
526
|
+
readonly completedAt: number;
|
|
528
527
|
readonly output: unknown;
|
|
529
|
-
readonly errorMessage: string | null;
|
|
530
528
|
readonly errorTag: string | null;
|
|
531
|
-
readonly
|
|
529
|
+
readonly errorMessage: string | null;
|
|
532
530
|
} | {
|
|
533
|
-
readonly status: "running";
|
|
534
531
|
readonly kind: "confirmed";
|
|
535
|
-
readonly
|
|
532
|
+
readonly status: "running";
|
|
536
533
|
readonly enteredAt: number;
|
|
534
|
+
readonly generation: string;
|
|
537
535
|
} | null;
|
|
536
|
+
readonly operation: "resume" | "cancel" | "terminate";
|
|
538
537
|
readonly generation: string;
|
|
539
538
|
readonly runId: string;
|
|
540
539
|
readonly requestedAt: number;
|
|
541
540
|
readonly executionId: string;
|
|
542
541
|
readonly workflowName: string;
|
|
543
|
-
readonly operation: "resume" | "cancel" | "terminate";
|
|
544
542
|
readonly dispatchAttempts: number;
|
|
545
543
|
readonly owner: {
|
|
546
544
|
readonly tenantId: string | null;
|
|
@@ -550,36 +548,36 @@ declare const dispatchWorkflowResume: (options: {
|
|
|
550
548
|
readonly replyId: string;
|
|
551
549
|
readonly restartToken: string | null;
|
|
552
550
|
} | null;
|
|
553
|
-
};
|
|
554
|
-
} | {
|
|
555
|
-
kind: "superseded";
|
|
556
|
-
request: {
|
|
557
|
-
readonly id: string;
|
|
558
551
|
readonly cause?: {
|
|
552
|
+
readonly reason: string;
|
|
559
553
|
readonly detail?: {
|
|
560
554
|
readonly [x: string]: unknown;
|
|
561
555
|
} | undefined;
|
|
562
|
-
readonly reason: string;
|
|
563
556
|
} | null | undefined;
|
|
557
|
+
};
|
|
558
|
+
} | {
|
|
559
|
+
kind: "superseded";
|
|
560
|
+
request: {
|
|
561
|
+
readonly id: string;
|
|
564
562
|
readonly result: {
|
|
565
|
-
readonly status: "failed" | "cancelled" | "succeeded";
|
|
566
563
|
readonly kind: "confirmed" | "already-terminal";
|
|
564
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
565
|
+
readonly completedAt: number;
|
|
567
566
|
readonly output: unknown;
|
|
568
|
-
readonly errorMessage: string | null;
|
|
569
567
|
readonly errorTag: string | null;
|
|
570
|
-
readonly
|
|
568
|
+
readonly errorMessage: string | null;
|
|
571
569
|
} | {
|
|
572
|
-
readonly status: "running";
|
|
573
570
|
readonly kind: "confirmed";
|
|
574
|
-
readonly
|
|
571
|
+
readonly status: "running";
|
|
575
572
|
readonly enteredAt: number;
|
|
573
|
+
readonly generation: string;
|
|
576
574
|
} | null;
|
|
575
|
+
readonly operation: "resume" | "cancel" | "terminate";
|
|
577
576
|
readonly generation: string;
|
|
578
577
|
readonly runId: string;
|
|
579
578
|
readonly requestedAt: number;
|
|
580
579
|
readonly executionId: string;
|
|
581
580
|
readonly workflowName: string;
|
|
582
|
-
readonly operation: "resume" | "cancel" | "terminate";
|
|
583
581
|
readonly dispatchAttempts: number;
|
|
584
582
|
readonly owner: {
|
|
585
583
|
readonly tenantId: string | null;
|
|
@@ -589,36 +587,36 @@ declare const dispatchWorkflowResume: (options: {
|
|
|
589
587
|
readonly replyId: string;
|
|
590
588
|
readonly restartToken: string | null;
|
|
591
589
|
} | null;
|
|
592
|
-
};
|
|
593
|
-
} | {
|
|
594
|
-
kind: "not-suspended";
|
|
595
|
-
request: {
|
|
596
|
-
readonly id: string;
|
|
597
590
|
readonly cause?: {
|
|
591
|
+
readonly reason: string;
|
|
598
592
|
readonly detail?: {
|
|
599
593
|
readonly [x: string]: unknown;
|
|
600
594
|
} | undefined;
|
|
601
|
-
readonly reason: string;
|
|
602
595
|
} | null | undefined;
|
|
596
|
+
};
|
|
597
|
+
} | {
|
|
598
|
+
kind: "not-suspended";
|
|
599
|
+
request: {
|
|
600
|
+
readonly id: string;
|
|
603
601
|
readonly result: {
|
|
604
|
-
readonly status: "failed" | "cancelled" | "succeeded";
|
|
605
602
|
readonly kind: "confirmed" | "already-terminal";
|
|
603
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
604
|
+
readonly completedAt: number;
|
|
606
605
|
readonly output: unknown;
|
|
607
|
-
readonly errorMessage: string | null;
|
|
608
606
|
readonly errorTag: string | null;
|
|
609
|
-
readonly
|
|
607
|
+
readonly errorMessage: string | null;
|
|
610
608
|
} | {
|
|
611
|
-
readonly status: "running";
|
|
612
609
|
readonly kind: "confirmed";
|
|
613
|
-
readonly
|
|
610
|
+
readonly status: "running";
|
|
614
611
|
readonly enteredAt: number;
|
|
612
|
+
readonly generation: string;
|
|
615
613
|
} | null;
|
|
614
|
+
readonly operation: "resume" | "cancel" | "terminate";
|
|
616
615
|
readonly generation: string;
|
|
617
616
|
readonly runId: string;
|
|
618
617
|
readonly requestedAt: number;
|
|
619
618
|
readonly executionId: string;
|
|
620
619
|
readonly workflowName: string;
|
|
621
|
-
readonly operation: "resume" | "cancel" | "terminate";
|
|
622
620
|
readonly dispatchAttempts: number;
|
|
623
621
|
readonly owner: {
|
|
624
622
|
readonly tenantId: string | null;
|
|
@@ -628,36 +626,36 @@ declare const dispatchWorkflowResume: (options: {
|
|
|
628
626
|
readonly replyId: string;
|
|
629
627
|
readonly restartToken: string | null;
|
|
630
628
|
} | null;
|
|
631
|
-
};
|
|
632
|
-
} | {
|
|
633
|
-
kind: "waiting-journal";
|
|
634
|
-
request: {
|
|
635
|
-
readonly id: string;
|
|
636
629
|
readonly cause?: {
|
|
630
|
+
readonly reason: string;
|
|
637
631
|
readonly detail?: {
|
|
638
632
|
readonly [x: string]: unknown;
|
|
639
633
|
} | undefined;
|
|
640
|
-
readonly reason: string;
|
|
641
634
|
} | null | undefined;
|
|
635
|
+
};
|
|
636
|
+
} | {
|
|
637
|
+
kind: "waiting-journal";
|
|
638
|
+
request: {
|
|
639
|
+
readonly id: string;
|
|
642
640
|
readonly result: {
|
|
643
|
-
readonly status: "failed" | "cancelled" | "succeeded";
|
|
644
641
|
readonly kind: "confirmed" | "already-terminal";
|
|
642
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
643
|
+
readonly completedAt: number;
|
|
645
644
|
readonly output: unknown;
|
|
646
|
-
readonly errorMessage: string | null;
|
|
647
645
|
readonly errorTag: string | null;
|
|
648
|
-
readonly
|
|
646
|
+
readonly errorMessage: string | null;
|
|
649
647
|
} | {
|
|
650
|
-
readonly status: "running";
|
|
651
648
|
readonly kind: "confirmed";
|
|
652
|
-
readonly
|
|
649
|
+
readonly status: "running";
|
|
653
650
|
readonly enteredAt: number;
|
|
651
|
+
readonly generation: string;
|
|
654
652
|
} | null;
|
|
653
|
+
readonly operation: "resume" | "cancel" | "terminate";
|
|
655
654
|
readonly generation: string;
|
|
656
655
|
readonly runId: string;
|
|
657
656
|
readonly requestedAt: number;
|
|
658
657
|
readonly executionId: string;
|
|
659
658
|
readonly workflowName: string;
|
|
660
|
-
readonly operation: "resume" | "cancel" | "terminate";
|
|
661
659
|
readonly dispatchAttempts: number;
|
|
662
660
|
readonly owner: {
|
|
663
661
|
readonly tenantId: string | null;
|
|
@@ -667,36 +665,36 @@ declare const dispatchWorkflowResume: (options: {
|
|
|
667
665
|
readonly replyId: string;
|
|
668
666
|
readonly restartToken: string | null;
|
|
669
667
|
} | null;
|
|
670
|
-
};
|
|
671
|
-
} | {
|
|
672
|
-
kind: "already-terminal";
|
|
673
|
-
request: {
|
|
674
|
-
readonly id: string;
|
|
675
668
|
readonly cause?: {
|
|
669
|
+
readonly reason: string;
|
|
676
670
|
readonly detail?: {
|
|
677
671
|
readonly [x: string]: unknown;
|
|
678
672
|
} | undefined;
|
|
679
|
-
readonly reason: string;
|
|
680
673
|
} | null | undefined;
|
|
674
|
+
};
|
|
675
|
+
} | {
|
|
676
|
+
kind: "already-terminal";
|
|
677
|
+
request: {
|
|
678
|
+
readonly id: string;
|
|
681
679
|
readonly result: {
|
|
682
|
-
readonly status: "failed" | "cancelled" | "succeeded";
|
|
683
680
|
readonly kind: "confirmed" | "already-terminal";
|
|
681
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
682
|
+
readonly completedAt: number;
|
|
684
683
|
readonly output: unknown;
|
|
685
|
-
readonly errorMessage: string | null;
|
|
686
684
|
readonly errorTag: string | null;
|
|
687
|
-
readonly
|
|
685
|
+
readonly errorMessage: string | null;
|
|
688
686
|
} | {
|
|
689
|
-
readonly status: "running";
|
|
690
687
|
readonly kind: "confirmed";
|
|
691
|
-
readonly
|
|
688
|
+
readonly status: "running";
|
|
692
689
|
readonly enteredAt: number;
|
|
690
|
+
readonly generation: string;
|
|
693
691
|
} | null;
|
|
692
|
+
readonly operation: "resume" | "cancel" | "terminate";
|
|
694
693
|
readonly generation: string;
|
|
695
694
|
readonly runId: string;
|
|
696
695
|
readonly requestedAt: number;
|
|
697
696
|
readonly executionId: string;
|
|
698
697
|
readonly workflowName: string;
|
|
699
|
-
readonly operation: "resume" | "cancel" | "terminate";
|
|
700
698
|
readonly dispatchAttempts: number;
|
|
701
699
|
readonly owner: {
|
|
702
700
|
readonly tenantId: string | null;
|
|
@@ -706,6 +704,12 @@ declare const dispatchWorkflowResume: (options: {
|
|
|
706
704
|
readonly replyId: string;
|
|
707
705
|
readonly restartToken: string | null;
|
|
708
706
|
} | null;
|
|
707
|
+
readonly cause?: {
|
|
708
|
+
readonly reason: string;
|
|
709
|
+
readonly detail?: {
|
|
710
|
+
readonly [x: string]: unknown;
|
|
711
|
+
} | undefined;
|
|
712
|
+
} | null | undefined;
|
|
709
713
|
};
|
|
710
714
|
run: Readonly<Record<string, unknown>>;
|
|
711
715
|
} | {
|
|
@@ -713,31 +717,25 @@ declare const dispatchWorkflowResume: (options: {
|
|
|
713
717
|
request: {
|
|
714
718
|
dispatchAttempts: number;
|
|
715
719
|
id: string;
|
|
716
|
-
cause?: {
|
|
717
|
-
readonly detail?: {
|
|
718
|
-
readonly [x: string]: unknown;
|
|
719
|
-
} | undefined;
|
|
720
|
-
readonly reason: string;
|
|
721
|
-
} | null | undefined;
|
|
722
720
|
result: {
|
|
723
|
-
readonly status: "failed" | "cancelled" | "succeeded";
|
|
724
721
|
readonly kind: "confirmed" | "already-terminal";
|
|
722
|
+
readonly status: "failed" | "cancelled" | "succeeded";
|
|
723
|
+
readonly completedAt: number;
|
|
725
724
|
readonly output: unknown;
|
|
726
|
-
readonly errorMessage: string | null;
|
|
727
725
|
readonly errorTag: string | null;
|
|
728
|
-
readonly
|
|
726
|
+
readonly errorMessage: string | null;
|
|
729
727
|
} | {
|
|
730
|
-
readonly status: "running";
|
|
731
728
|
readonly kind: "confirmed";
|
|
732
|
-
readonly
|
|
729
|
+
readonly status: "running";
|
|
733
730
|
readonly enteredAt: number;
|
|
731
|
+
readonly generation: string;
|
|
734
732
|
} | null;
|
|
733
|
+
operation: "resume" | "cancel" | "terminate";
|
|
735
734
|
generation: string;
|
|
736
735
|
runId: string;
|
|
737
736
|
requestedAt: number;
|
|
738
737
|
executionId: string;
|
|
739
738
|
workflowName: string;
|
|
740
|
-
operation: "resume" | "cancel" | "terminate";
|
|
741
739
|
owner: {
|
|
742
740
|
readonly tenantId: string | null;
|
|
743
741
|
} | null;
|
|
@@ -746,6 +744,12 @@ declare const dispatchWorkflowResume: (options: {
|
|
|
746
744
|
readonly replyId: string;
|
|
747
745
|
readonly restartToken: string | null;
|
|
748
746
|
} | null;
|
|
747
|
+
cause?: {
|
|
748
|
+
readonly reason: string;
|
|
749
|
+
readonly detail?: {
|
|
750
|
+
readonly [x: string]: unknown;
|
|
751
|
+
} | undefined;
|
|
752
|
+
} | null | undefined;
|
|
749
753
|
};
|
|
750
754
|
journal: {
|
|
751
755
|
kind: "changed";
|
|
@@ -774,6 +778,26 @@ export declare interface FailedActivityRef {
|
|
|
774
778
|
readonly attempt: number;
|
|
775
779
|
}
|
|
776
780
|
|
|
781
|
+
/** The exit as the cluster journals it: the rpc WIRE form (`RpcMessage.ExitEncoded`),
|
|
782
|
+
* whose failure carries the cause as a list of reasons — not `Schema.Exit`'s
|
|
783
|
+
* own `_id`-tagged encoding. */
|
|
784
|
+
export declare const JournalExit: Schema.Union<readonly [Schema.Struct<{
|
|
785
|
+
readonly _tag: Schema.Literal<"Success">;
|
|
786
|
+
readonly value: Schema.Unknown;
|
|
787
|
+
}>, Schema.Struct<{
|
|
788
|
+
readonly _tag: Schema.Literal<"Failure">;
|
|
789
|
+
readonly cause: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
790
|
+
readonly _tag: Schema.Literal<"Fail">;
|
|
791
|
+
readonly error: Schema.Unknown;
|
|
792
|
+
}>, Schema.Struct<{
|
|
793
|
+
readonly _tag: Schema.Literal<"Die">;
|
|
794
|
+
readonly defect: Schema.Unknown;
|
|
795
|
+
}>, Schema.Struct<{
|
|
796
|
+
readonly _tag: Schema.Literal<"Interrupt">;
|
|
797
|
+
readonly fiberId: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
798
|
+
}>]>>;
|
|
799
|
+
}>]>;
|
|
800
|
+
|
|
777
801
|
/**
|
|
778
802
|
* Build the cluster-cron layer for one schedule. Returns a
|
|
779
803
|
* `Layer<never, never, Sharding>` — the framework provides `Sharding`
|
|
@@ -831,7 +855,7 @@ export declare const parseShardLockMode: (raw?: string | undefined) => ShardLock
|
|
|
831
855
|
* "wake". Run it on the workflow runtime (`workflowRuntime.runPromise`), which
|
|
832
856
|
* carries `Sharding`; it opens the storage-read latch so a message just enqueued
|
|
833
857
|
* by another replica is picked up immediately instead of on the next poll tick.
|
|
834
|
-
* Lives here so a boot path doesn't import
|
|
858
|
+
* Lives here so a boot path doesn't import `effect/cluster` (and its ~420ms
|
|
835
859
|
* load) just to reach the `Sharding` tag.
|
|
836
860
|
*/
|
|
837
861
|
export declare const pollWorkflowStorage: Effect.Effect<void, never, Sharding.Sharding>;
|
|
@@ -854,26 +878,13 @@ declare const prepareWorkflowRestart: (options: {
|
|
|
854
878
|
kind: "reserved";
|
|
855
879
|
request: {
|
|
856
880
|
readonly id: string;
|
|
857
|
-
readonly tenantId: string | null;
|
|
858
|
-
readonly token: string;
|
|
859
|
-
readonly generation: string;
|
|
860
881
|
readonly runId: string;
|
|
861
|
-
readonly requestedAt: Date;
|
|
862
|
-
readonly executionId: string;
|
|
863
882
|
readonly workflowName: string;
|
|
864
|
-
readonly
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
readonly kind: "from-step";
|
|
868
|
-
readonly stepName: string;
|
|
869
|
-
};
|
|
870
|
-
readonly dispatchAttempts: number;
|
|
871
|
-
readonly enteredGeneration: string | null;
|
|
883
|
+
readonly executionId: string;
|
|
884
|
+
readonly generation: string;
|
|
885
|
+
readonly token: string;
|
|
872
886
|
readonly ledgerId: string;
|
|
873
|
-
readonly
|
|
874
|
-
readonly runId: string;
|
|
875
|
-
readonly executionId: string;
|
|
876
|
-
} | null;
|
|
887
|
+
readonly tenantId: string | null;
|
|
877
888
|
readonly delivery: {
|
|
878
889
|
readonly requestId: string;
|
|
879
890
|
readonly restartToken: string | null;
|
|
@@ -882,6 +893,19 @@ declare const prepareWorkflowRestart: (options: {
|
|
|
882
893
|
readonly requestId: string;
|
|
883
894
|
readonly replyId: string;
|
|
884
895
|
}[];
|
|
896
|
+
readonly selection: {
|
|
897
|
+
readonly kind: "failed-steps";
|
|
898
|
+
} | {
|
|
899
|
+
readonly kind: "from-step";
|
|
900
|
+
readonly stepName: string;
|
|
901
|
+
};
|
|
902
|
+
readonly eviction: {
|
|
903
|
+
readonly executionId: string;
|
|
904
|
+
readonly runId: string;
|
|
905
|
+
} | null;
|
|
906
|
+
readonly requestedAt: Date;
|
|
907
|
+
readonly dispatchAttempts: number;
|
|
908
|
+
readonly enteredGeneration: string | null;
|
|
885
909
|
};
|
|
886
910
|
reused: boolean;
|
|
887
911
|
decision?: never;
|
|
@@ -926,26 +950,13 @@ declare const prepareWorkflowRestartCommand: (options: Omit<Parameters<typeof pr
|
|
|
926
950
|
kind: "reserved";
|
|
927
951
|
request: {
|
|
928
952
|
readonly id: string;
|
|
929
|
-
readonly tenantId: string | null;
|
|
930
|
-
readonly token: string;
|
|
931
|
-
readonly generation: string;
|
|
932
953
|
readonly runId: string;
|
|
933
|
-
readonly requestedAt: Date;
|
|
934
|
-
readonly executionId: string;
|
|
935
954
|
readonly workflowName: string;
|
|
936
|
-
readonly
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
readonly kind: "from-step";
|
|
940
|
-
readonly stepName: string;
|
|
941
|
-
};
|
|
942
|
-
readonly dispatchAttempts: number;
|
|
943
|
-
readonly enteredGeneration: string | null;
|
|
955
|
+
readonly executionId: string;
|
|
956
|
+
readonly generation: string;
|
|
957
|
+
readonly token: string;
|
|
944
958
|
readonly ledgerId: string;
|
|
945
|
-
readonly
|
|
946
|
-
readonly runId: string;
|
|
947
|
-
readonly executionId: string;
|
|
948
|
-
} | null;
|
|
959
|
+
readonly tenantId: string | null;
|
|
949
960
|
readonly delivery: {
|
|
950
961
|
readonly requestId: string;
|
|
951
962
|
readonly restartToken: string | null;
|
|
@@ -954,6 +965,19 @@ declare const prepareWorkflowRestartCommand: (options: Omit<Parameters<typeof pr
|
|
|
954
965
|
readonly requestId: string;
|
|
955
966
|
readonly replyId: string;
|
|
956
967
|
}[];
|
|
968
|
+
readonly selection: {
|
|
969
|
+
readonly kind: "failed-steps";
|
|
970
|
+
} | {
|
|
971
|
+
readonly kind: "from-step";
|
|
972
|
+
readonly stepName: string;
|
|
973
|
+
};
|
|
974
|
+
readonly eviction: {
|
|
975
|
+
readonly executionId: string;
|
|
976
|
+
readonly runId: string;
|
|
977
|
+
} | null;
|
|
978
|
+
readonly requestedAt: Date;
|
|
979
|
+
readonly dispatchAttempts: number;
|
|
980
|
+
readonly enteredGeneration: string | null;
|
|
957
981
|
};
|
|
958
982
|
reused: boolean;
|
|
959
983
|
decision?: never;
|
|
@@ -999,26 +1023,13 @@ declare const readWorkflowRestartCommandInTransaction: (tx: AdmissionDataStore,
|
|
|
999
1023
|
readonly selection: WorkflowRestartSelection;
|
|
1000
1024
|
}) => Promise<{
|
|
1001
1025
|
readonly id: string;
|
|
1002
|
-
readonly tenantId: string | null;
|
|
1003
|
-
readonly token: string;
|
|
1004
|
-
readonly generation: string;
|
|
1005
1026
|
readonly runId: string;
|
|
1006
|
-
readonly requestedAt: Date;
|
|
1007
|
-
readonly executionId: string;
|
|
1008
1027
|
readonly workflowName: string;
|
|
1009
|
-
readonly
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
readonly kind: "from-step";
|
|
1013
|
-
readonly stepName: string;
|
|
1014
|
-
};
|
|
1015
|
-
readonly dispatchAttempts: number;
|
|
1016
|
-
readonly enteredGeneration: string | null;
|
|
1028
|
+
readonly executionId: string;
|
|
1029
|
+
readonly generation: string;
|
|
1030
|
+
readonly token: string;
|
|
1017
1031
|
readonly ledgerId: string;
|
|
1018
|
-
readonly
|
|
1019
|
-
readonly runId: string;
|
|
1020
|
-
readonly executionId: string;
|
|
1021
|
-
} | null;
|
|
1032
|
+
readonly tenantId: string | null;
|
|
1022
1033
|
readonly delivery: {
|
|
1023
1034
|
readonly requestId: string;
|
|
1024
1035
|
readonly restartToken: string | null;
|
|
@@ -1027,6 +1038,19 @@ declare const readWorkflowRestartCommandInTransaction: (tx: AdmissionDataStore,
|
|
|
1027
1038
|
readonly requestId: string;
|
|
1028
1039
|
readonly replyId: string;
|
|
1029
1040
|
}[];
|
|
1041
|
+
readonly selection: {
|
|
1042
|
+
readonly kind: "failed-steps";
|
|
1043
|
+
} | {
|
|
1044
|
+
readonly kind: "from-step";
|
|
1045
|
+
readonly stepName: string;
|
|
1046
|
+
};
|
|
1047
|
+
readonly eviction: {
|
|
1048
|
+
readonly executionId: string;
|
|
1049
|
+
readonly runId: string;
|
|
1050
|
+
} | null;
|
|
1051
|
+
readonly requestedAt: Date;
|
|
1052
|
+
readonly dispatchAttempts: number;
|
|
1053
|
+
readonly enteredGeneration: string | null;
|
|
1030
1054
|
} | undefined>;
|
|
1031
1055
|
|
|
1032
1056
|
/** Internal owner check after a generation has been captured. Command recovery
|
|
@@ -1035,26 +1059,13 @@ declare const readWorkflowRestartReservationInTransaction: (tx: AdmissionDataSto
|
|
|
1035
1059
|
readonly generation: string;
|
|
1036
1060
|
}) => Promise<{
|
|
1037
1061
|
readonly id: string;
|
|
1038
|
-
readonly tenantId: string | null;
|
|
1039
|
-
readonly token: string;
|
|
1040
|
-
readonly generation: string;
|
|
1041
1062
|
readonly runId: string;
|
|
1042
|
-
readonly requestedAt: Date;
|
|
1043
|
-
readonly executionId: string;
|
|
1044
1063
|
readonly workflowName: string;
|
|
1045
|
-
readonly
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
readonly kind: "from-step";
|
|
1049
|
-
readonly stepName: string;
|
|
1050
|
-
};
|
|
1051
|
-
readonly dispatchAttempts: number;
|
|
1052
|
-
readonly enteredGeneration: string | null;
|
|
1064
|
+
readonly executionId: string;
|
|
1065
|
+
readonly generation: string;
|
|
1066
|
+
readonly token: string;
|
|
1053
1067
|
readonly ledgerId: string;
|
|
1054
|
-
readonly
|
|
1055
|
-
readonly runId: string;
|
|
1056
|
-
readonly executionId: string;
|
|
1057
|
-
} | null;
|
|
1068
|
+
readonly tenantId: string | null;
|
|
1058
1069
|
readonly delivery: {
|
|
1059
1070
|
readonly requestId: string;
|
|
1060
1071
|
readonly restartToken: string | null;
|
|
@@ -1063,6 +1074,19 @@ declare const readWorkflowRestartReservationInTransaction: (tx: AdmissionDataSto
|
|
|
1063
1074
|
readonly requestId: string;
|
|
1064
1075
|
readonly replyId: string;
|
|
1065
1076
|
}[];
|
|
1077
|
+
readonly selection: {
|
|
1078
|
+
readonly kind: "failed-steps";
|
|
1079
|
+
} | {
|
|
1080
|
+
readonly kind: "from-step";
|
|
1081
|
+
readonly stepName: string;
|
|
1082
|
+
};
|
|
1083
|
+
readonly eviction: {
|
|
1084
|
+
readonly executionId: string;
|
|
1085
|
+
readonly runId: string;
|
|
1086
|
+
} | null;
|
|
1087
|
+
readonly requestedAt: Date;
|
|
1088
|
+
readonly dispatchAttempts: number;
|
|
1089
|
+
readonly enteredGeneration: string | null;
|
|
1066
1090
|
} | undefined>;
|
|
1067
1091
|
|
|
1068
1092
|
/** Observe the persisted run delivery without decoding it against a possibly
|
|
@@ -1128,35 +1152,35 @@ export declare interface RedriveTarget {
|
|
|
1128
1152
|
}
|
|
1129
1153
|
|
|
1130
1154
|
declare const Request_2: Schema.Struct<{
|
|
1131
|
-
id:
|
|
1132
|
-
runId:
|
|
1133
|
-
workflowName:
|
|
1134
|
-
executionId:
|
|
1135
|
-
generation:
|
|
1136
|
-
token:
|
|
1137
|
-
ledgerId:
|
|
1138
|
-
tenantId: Schema.NullOr<
|
|
1139
|
-
delivery: Schema.Struct<{
|
|
1140
|
-
requestId:
|
|
1141
|
-
restartToken: Schema.NullOr<
|
|
1155
|
+
readonly id: Schema.NonEmptyString;
|
|
1156
|
+
readonly runId: Schema.NonEmptyString;
|
|
1157
|
+
readonly workflowName: Schema.NonEmptyString;
|
|
1158
|
+
readonly executionId: Schema.NonEmptyString;
|
|
1159
|
+
readonly generation: Schema.NonEmptyString;
|
|
1160
|
+
readonly token: Schema.NonEmptyString;
|
|
1161
|
+
readonly ledgerId: Schema.NonEmptyString;
|
|
1162
|
+
readonly tenantId: Schema.NullOr<Schema.NonEmptyString>;
|
|
1163
|
+
readonly delivery: Schema.Struct<{
|
|
1164
|
+
readonly requestId: Schema.NonEmptyString;
|
|
1165
|
+
readonly restartToken: Schema.NullOr<Schema.NonEmptyString>;
|
|
1142
1166
|
}>;
|
|
1143
|
-
replies: Schema
|
|
1144
|
-
requestId:
|
|
1145
|
-
replyId:
|
|
1167
|
+
readonly replies: Schema.$Array<Schema.Struct<{
|
|
1168
|
+
readonly requestId: Schema.NonEmptyString;
|
|
1169
|
+
readonly replyId: Schema.NonEmptyString;
|
|
1146
1170
|
}>>;
|
|
1147
|
-
selection: Schema.Union<[Schema.Struct<{
|
|
1148
|
-
kind: Schema.Literal<
|
|
1171
|
+
readonly selection: Schema.Union<readonly [Schema.Struct<{
|
|
1172
|
+
readonly kind: Schema.Literal<"failed-steps">;
|
|
1149
1173
|
}>, Schema.Struct<{
|
|
1150
|
-
kind: Schema.Literal<
|
|
1151
|
-
stepName: Schema.
|
|
1174
|
+
readonly kind: Schema.Literal<"from-step">;
|
|
1175
|
+
readonly stepName: Schema.NonEmptyString;
|
|
1152
1176
|
}>]>;
|
|
1153
|
-
eviction: Schema.NullOr<Schema.Struct<{
|
|
1154
|
-
executionId:
|
|
1155
|
-
runId:
|
|
1177
|
+
readonly eviction: Schema.NullOr<Schema.Struct<{
|
|
1178
|
+
readonly executionId: Schema.NonEmptyString;
|
|
1179
|
+
readonly runId: Schema.String;
|
|
1156
1180
|
}>>;
|
|
1157
|
-
requestedAt:
|
|
1158
|
-
dispatchAttempts: Schema.
|
|
1159
|
-
enteredGeneration: Schema.NullOr<
|
|
1181
|
+
readonly requestedAt: Schema.Date;
|
|
1182
|
+
readonly dispatchAttempts: Schema.Number;
|
|
1183
|
+
readonly enteredGeneration: Schema.NullOr<Schema.NonEmptyString>;
|
|
1160
1184
|
}>;
|
|
1161
1185
|
|
|
1162
1186
|
/** Private dispatch composition. Capacity is mandatory, outside the resident
|
|
@@ -1189,7 +1213,7 @@ declare const resetReservedWorkflowJournal: (input: {
|
|
|
1189
1213
|
* event at all". */
|
|
1190
1214
|
declare interface ResolvedCancelOn {
|
|
1191
1215
|
readonly event: string;
|
|
1192
|
-
readonly schema: Schema.
|
|
1216
|
+
readonly schema: Schema.Top;
|
|
1193
1217
|
readonly match: (event: unknown, payload: unknown) => boolean;
|
|
1194
1218
|
readonly withinMs?: number;
|
|
1195
1219
|
readonly reason: string;
|
|
@@ -1294,7 +1318,7 @@ export declare const resolveRunnerIdentity: (opts: {
|
|
|
1294
1318
|
* `VOLTRO_WORKFLOW_RUNNER_STORAGE` (or an explicit `override`) forces the
|
|
1295
1319
|
* choice. The load-bearing case is `'memory'` on a real SQL dialect: it keeps
|
|
1296
1320
|
* the single-process durable engine (workflow run state stays SQL-backed via
|
|
1297
|
-
*
|
|
1321
|
+
* `effect/cluster`'s `SqlMessageStorage`) but SKIPS `SqlRunnerStorage`
|
|
1298
1322
|
* entirely — no `cluster_runners` / `cluster_locks` table, and none of its
|
|
1299
1323
|
* `GET_LOCK` advisory-lock acquisition. That unblocks a managed MySQL /
|
|
1300
1324
|
* MariaDB reached through a connection-load-balancing Service or a
|
|
@@ -1385,23 +1409,23 @@ export declare interface RunnerIdentity {
|
|
|
1385
1409
|
}
|
|
1386
1410
|
|
|
1387
1411
|
/**
|
|
1388
|
-
* Runner-storage backend for
|
|
1412
|
+
* Runner-storage backend for `effect/cluster.SingleRunner`.
|
|
1389
1413
|
*
|
|
1390
1414
|
* - `'sql'` — durable across crashes + multi-instance scale-out.
|
|
1391
1415
|
* Used for postgres / mysql / mariadb / mssql.
|
|
1392
1416
|
* - `'memory'` — durable replay within the SAME process; no
|
|
1393
1417
|
* horizontal scale-out. Used for `sqlite` because
|
|
1394
|
-
*
|
|
1418
|
+
* `effect/cluster.SqlRunnerStorage` has no SQLite
|
|
1395
1419
|
* lock-acquisition branch (`pg_advisory_lock` and
|
|
1396
1420
|
* `GET_LOCK` aren't available there).
|
|
1397
1421
|
*/
|
|
1398
1422
|
export declare type RunnerStorage = 'sql' | 'memory';
|
|
1399
1423
|
|
|
1400
|
-
declare const Selection: Schema.Union<[Schema.Struct<{
|
|
1401
|
-
kind: Schema.Literal<
|
|
1424
|
+
declare const Selection: Schema.Union<readonly [Schema.Struct<{
|
|
1425
|
+
readonly kind: Schema.Literal<"failed-steps">;
|
|
1402
1426
|
}>, Schema.Struct<{
|
|
1403
|
-
kind: Schema.Literal<
|
|
1404
|
-
stepName: Schema.
|
|
1427
|
+
readonly kind: Schema.Literal<"from-step">;
|
|
1428
|
+
readonly stepName: Schema.NonEmptyString;
|
|
1405
1429
|
}>]>;
|
|
1406
1430
|
|
|
1407
1431
|
declare interface ShardLockHolder {
|
|
@@ -1424,7 +1448,7 @@ declare interface ShardLockHolder {
|
|
|
1424
1448
|
}
|
|
1425
1449
|
|
|
1426
1450
|
/**
|
|
1427
|
-
* How
|
|
1451
|
+
* How `effect/cluster`'s `SqlRunnerStorage` coordinates shard ownership across
|
|
1428
1452
|
* a fleet of runners:
|
|
1429
1453
|
*
|
|
1430
1454
|
* - `'advisory'` — session-scoped DB advisory locks (`GET_LOCK` on
|
|
@@ -1459,7 +1483,7 @@ declare interface UnreadMessage extends ClusterMessageState {
|
|
|
1459
1483
|
readonly unreadForMs: number;
|
|
1460
1484
|
}
|
|
1461
1485
|
|
|
1462
|
-
export declare const workflowEngineLayer: (options: WorkflowEngineLayerOptions) => Layer.Layer<WorkflowEngine.WorkflowEngine | Sharding.Sharding | MessageStorage.MessageStorage | ClusterDiagnostics | WorkflowResumeDispatcher | WorkflowRestartDispatcher>;
|
|
1486
|
+
export declare const workflowEngineLayer: (options: WorkflowEngineLayerOptions) => Layer.Layer<WorkflowEngine.WorkflowEngine | RateLimiter.RateLimiter | Sharding.Sharding | MessageStorage.MessageStorage | ClusterDiagnostics | WorkflowResumeDispatcher | WorkflowRestartDispatcher>;
|
|
1463
1487
|
|
|
1464
1488
|
export declare interface WorkflowEngineLayerOptions {
|
|
1465
1489
|
/**
|
|
@@ -1469,7 +1493,7 @@ export declare interface WorkflowEngineLayerOptions {
|
|
|
1469
1493
|
* runs through it for sqlite, the layer's resource lifecycle keeps
|
|
1470
1494
|
* the cluster's accounting clean.
|
|
1471
1495
|
*/
|
|
1472
|
-
readonly sqlClientLayer: Layer.Layer<SqlClient.SqlClient,
|
|
1496
|
+
readonly sqlClientLayer: Layer.Layer<SqlClient.SqlClient, Config.ConfigError | SqlError.SqlError, never>;
|
|
1473
1497
|
/** SQL ownership for shared primaries; memory for local/embedded stores. */
|
|
1474
1498
|
readonly runnerStorage: RunnerStorage;
|
|
1475
1499
|
/**
|
|
@@ -1501,7 +1525,7 @@ export declare interface WorkflowEngineLayerOptions {
|
|
|
1501
1525
|
* lease-expiry problem, NOT a polling one: a dead runner keeps its shards
|
|
1502
1526
|
* until its heartbeat goes stale, so the floor is the lease TTL.
|
|
1503
1527
|
*
|
|
1504
|
-
* - `failoverLeaseSeconds` (default 35,
|
|
1528
|
+
* - `failoverLeaseSeconds` (default 35, `effect/cluster`
|
|
1505
1529
|
* `shardLockExpiration`) — how long after a runner's last heartbeat its
|
|
1506
1530
|
* shards become claimable. Lower = faster failover on a hard crash, at the
|
|
1507
1531
|
* cost of false-positive reclaims if a healthy runner is paused longer than
|
|
@@ -1518,7 +1542,7 @@ export declare interface WorkflowEngineLayerOptions {
|
|
|
1518
1542
|
readonly failoverLeaseSeconds?: number;
|
|
1519
1543
|
readonly failoverHeartbeatSeconds?: number;
|
|
1520
1544
|
/**
|
|
1521
|
-
* NEW-MESSAGE latency across replicas (default 10,
|
|
1545
|
+
* NEW-MESSAGE latency across replicas (default 10, `effect/cluster`
|
|
1522
1546
|
* `entityMessagePollInterval`). DISTINCT from failover: this is how long a
|
|
1523
1547
|
* freshly-triggered workflow can wait before the replica that OWNS its shard
|
|
1524
1548
|
* picks it up. When the triggering replica owns the shard it's immediate
|
|
@@ -1547,10 +1571,10 @@ export declare interface WorkflowEngineLayerOptions {
|
|
|
1547
1571
|
export declare class WorkflowRestartDispatcher extends WorkflowRestartDispatcher_base {
|
|
1548
1572
|
}
|
|
1549
1573
|
|
|
1550
|
-
declare const WorkflowRestartDispatcher_base: Context.
|
|
1574
|
+
declare const WorkflowRestartDispatcher_base: Context.ServiceClass<WorkflowRestartDispatcher, "@voltro/workflow/WorkflowRestartDispatcher", {
|
|
1551
1575
|
readonly prepare: (options: Omit<Parameters<typeof prepareWorkflowRestartCommand>[0], "observe">) => Effect.Effect<Awaited<ReturnType<typeof prepareWorkflowRestartCommand>>, unknown>;
|
|
1552
|
-
readonly dispatch: (options: Parameters<typeof dispatchWorkflowRestart>[0]) => Effect.Effect<Effect.
|
|
1553
|
-
readonly observe: (target: WorkflowRestartObservationTarget) => Effect.Effect<Effect.
|
|
1576
|
+
readonly dispatch: (options: Parameters<typeof dispatchWorkflowRestart>[0]) => Effect.Effect<Effect.Success<ReturnType<typeof dispatchWorkflowRestart>>, Effect.Error<ReturnType<typeof dispatchWorkflowRestart>>>;
|
|
1577
|
+
readonly observe: (target: WorkflowRestartObservationTarget) => Effect.Effect<Effect.Success<ReturnType<typeof observeWorkflowRestartReplies>>, Effect.Error<ReturnType<typeof observeWorkflowRestartReplies>>>;
|
|
1554
1578
|
}>;
|
|
1555
1579
|
|
|
1556
1580
|
declare interface WorkflowRestartObservationTarget {
|
|
@@ -1570,8 +1594,8 @@ declare type WorkflowRestartSelection = typeof Selection.Type;
|
|
|
1570
1594
|
export declare class WorkflowResumeDispatcher extends WorkflowResumeDispatcher_base {
|
|
1571
1595
|
}
|
|
1572
1596
|
|
|
1573
|
-
declare const WorkflowResumeDispatcher_base: Context.
|
|
1574
|
-
readonly dispatch: (options: Parameters<typeof dispatchWorkflowResume>[0]) => Effect.Effect<Effect.
|
|
1597
|
+
declare const WorkflowResumeDispatcher_base: Context.ServiceClass<WorkflowResumeDispatcher, "@voltro/workflow/WorkflowResumeDispatcher", {
|
|
1598
|
+
readonly dispatch: (options: Parameters<typeof dispatchWorkflowResume>[0]) => Effect.Effect<Effect.Success<ReturnType<typeof dispatchWorkflowResume>>, Effect.Error<ReturnType<typeof dispatchWorkflowResume>>>;
|
|
1575
1599
|
}>;
|
|
1576
1600
|
|
|
1577
1601
|
/** Raw engine evidence, before workflow-result decoding. Server-only consumers
|