@workflow/world-testing 5.0.0-beta.24 → 5.0.0-beta.25
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.
|
@@ -19204,7 +19204,7 @@ var version4;
|
|
|
19204
19204
|
var init_version3 = __esm({
|
|
19205
19205
|
"../core/dist/version.js"() {
|
|
19206
19206
|
"use strict";
|
|
19207
|
-
version4 = "5.0.0-beta.
|
|
19207
|
+
version4 = "5.0.0-beta.25";
|
|
19208
19208
|
}
|
|
19209
19209
|
});
|
|
19210
19210
|
|
|
@@ -25537,7 +25537,7 @@ function attachAbortListenerOnce2(signal, streamName, runId, cryptoKey, ops) {
|
|
|
25537
25537
|
})());
|
|
25538
25538
|
}, { once: true });
|
|
25539
25539
|
}
|
|
25540
|
-
function getExternalReducers2(global2 = globalThis, ops, runId, cryptoKey, framedByteStreams = false) {
|
|
25540
|
+
function getExternalReducers2(global2 = globalThis, ops, runId, cryptoKey, framedByteStreams = false, runReadyBarrier) {
|
|
25541
25541
|
return {
|
|
25542
25542
|
...getAllBaseReducers2(global2),
|
|
25543
25543
|
ReadableStream: /* @__PURE__ */ __name((value) => {
|
|
@@ -25551,7 +25551,7 @@ function getExternalReducers2(global2 = globalThis, ops, runId, cryptoKey, frame
|
|
|
25551
25551
|
const streamId = (global2[STABLE_ULID2] || defaultUlid2)();
|
|
25552
25552
|
const name = `strm_${streamId}`;
|
|
25553
25553
|
const type = getStreamType2(value);
|
|
25554
|
-
const writable = new WorkflowServerWritableStream2(runId, name);
|
|
25554
|
+
const writable = new WorkflowServerWritableStream2(runId, name, runReadyBarrier);
|
|
25555
25555
|
if (type === "bytes") {
|
|
25556
25556
|
if (framedByteStreams) {
|
|
25557
25557
|
ops.push(value.pipeThrough(getByteFramingStream2()).pipeTo(writable));
|
|
@@ -25559,7 +25559,7 @@ function getExternalReducers2(global2 = globalThis, ops, runId, cryptoKey, frame
|
|
|
25559
25559
|
ops.push(value.pipeTo(writable));
|
|
25560
25560
|
}
|
|
25561
25561
|
} else {
|
|
25562
|
-
ops.push(value.pipeThrough(getSerializeStream2(getExternalReducers2(global2, ops, runId, cryptoKey, framedByteStreams), cryptoKey)).pipeTo(writable));
|
|
25562
|
+
ops.push(value.pipeThrough(getSerializeStream2(getExternalReducers2(global2, ops, runId, cryptoKey, framedByteStreams, runReadyBarrier), cryptoKey)).pipeTo(writable));
|
|
25563
25563
|
}
|
|
25564
25564
|
const s = { name };
|
|
25565
25565
|
if (type)
|
|
@@ -25668,7 +25668,7 @@ function getWorkflowReducers2(global2 = globalThis) {
|
|
|
25668
25668
|
}, "AbortSignal")
|
|
25669
25669
|
};
|
|
25670
25670
|
}
|
|
25671
|
-
function getStepReducers2(global2 = globalThis, ops, runId, cryptoKey, framedByteStreams = false) {
|
|
25671
|
+
function getStepReducers2(global2 = globalThis, ops, runId, cryptoKey, framedByteStreams = false, runReadyBarrier) {
|
|
25672
25672
|
return {
|
|
25673
25673
|
...getAllBaseReducers2(global2),
|
|
25674
25674
|
ReadableStream: /* @__PURE__ */ __name((value) => {
|
|
@@ -25687,7 +25687,7 @@ function getStepReducers2(global2 = globalThis, ops, runId, cryptoKey, framedByt
|
|
|
25687
25687
|
name = `strm_${streamId}`;
|
|
25688
25688
|
type = getStreamType2(value);
|
|
25689
25689
|
framing = type === "bytes" && framedByteStreams ? "framed-v1" : framing;
|
|
25690
|
-
const writable = new WorkflowServerWritableStream2(runId, name);
|
|
25690
|
+
const writable = new WorkflowServerWritableStream2(runId, name, runReadyBarrier);
|
|
25691
25691
|
if (type === "bytes") {
|
|
25692
25692
|
if (framing === "framed-v1") {
|
|
25693
25693
|
ops.push(value.pipeThrough(getByteFramingStream2()).pipeTo(writable));
|
|
@@ -25695,7 +25695,7 @@ function getStepReducers2(global2 = globalThis, ops, runId, cryptoKey, framedByt
|
|
|
25695
25695
|
ops.push(value.pipeTo(writable));
|
|
25696
25696
|
}
|
|
25697
25697
|
} else {
|
|
25698
|
-
ops.push(value.pipeThrough(getSerializeStream2(getStepReducers2(global2, ops, runId, cryptoKey, framedByteStreams), cryptoKey)).pipeTo(writable));
|
|
25698
|
+
ops.push(value.pipeThrough(getSerializeStream2(getStepReducers2(global2, ops, runId, cryptoKey, framedByteStreams, runReadyBarrier), cryptoKey)).pipeTo(writable));
|
|
25699
25699
|
}
|
|
25700
25700
|
}
|
|
25701
25701
|
const s = { name };
|
|
@@ -26304,16 +26304,16 @@ async function hydrateStepArguments2(value, runId, key, ops = [], global2 = glob
|
|
|
26304
26304
|
await recordCompression2(compressionStats, "deserialize");
|
|
26305
26305
|
return result;
|
|
26306
26306
|
}
|
|
26307
|
-
async function dehydrateStepReturnValue2(value, runId, key, ops = [], global2 = globalThis, v1Compat = false, framedByteStreams = false, compression = false) {
|
|
26307
|
+
async function dehydrateStepReturnValue2(value, runId, key, ops = [], global2 = globalThis, v1Compat = false, framedByteStreams = false, compression = false, runReadyBarrier) {
|
|
26308
26308
|
if (v1Compat) {
|
|
26309
|
-
const str = stringify2(value, getStepReducers2(global2, ops, runId, key, framedByteStreams));
|
|
26309
|
+
const str = stringify2(value, getStepReducers2(global2, ops, runId, key, framedByteStreams, runReadyBarrier));
|
|
26310
26310
|
return revive2(str);
|
|
26311
26311
|
}
|
|
26312
26312
|
try {
|
|
26313
26313
|
const compressionStats = {};
|
|
26314
26314
|
const result = await serialize3(value, key, {
|
|
26315
26315
|
global: global2,
|
|
26316
|
-
extraReducers: getStreamAndRequestReducers2(getStepReducers2(global2, ops, runId, key, framedByteStreams)),
|
|
26316
|
+
extraReducers: getStreamAndRequestReducers2(getStepReducers2(global2, ops, runId, key, framedByteStreams, runReadyBarrier)),
|
|
26317
26317
|
compression,
|
|
26318
26318
|
compressionStats
|
|
26319
26319
|
});
|
|
@@ -26514,7 +26514,16 @@ var init_serialization4 = __esm({
|
|
|
26514
26514
|
static {
|
|
26515
26515
|
__name(this, "WorkflowServerWritableStream");
|
|
26516
26516
|
}
|
|
26517
|
-
|
|
26517
|
+
/**
|
|
26518
|
+
* @param runReadyBarrier Turbo mode only: a promise that resolves once the
|
|
26519
|
+
* backgrounded `run_started` has landed. When the step body runs
|
|
26520
|
+
* optimistically (before `run_started` is durable), the first chunk write to
|
|
26521
|
+
* a brand-new stream would otherwise reach the World before the run exists
|
|
26522
|
+
* and be rejected as run-not-found. Awaiting this once before the first
|
|
26523
|
+
* flush/close orders the write after the run's creation. `undefined` outside
|
|
26524
|
+
* turbo and on the await path, where the run was already durable.
|
|
26525
|
+
*/
|
|
26526
|
+
constructor(runId, name, runReadyBarrier) {
|
|
26518
26527
|
if (typeof runId !== "string") {
|
|
26519
26528
|
throw new WorkflowRuntimeError2(`"runId" must be a string, got "${typeof runId}"`);
|
|
26520
26529
|
}
|
|
@@ -26522,6 +26531,16 @@ var init_serialization4 = __esm({
|
|
|
26522
26531
|
throw new WorkflowRuntimeError2(`"name" is required, got "${name}"`);
|
|
26523
26532
|
}
|
|
26524
26533
|
const worldPromise = getWorldLazy2();
|
|
26534
|
+
let pendingRunReady = runReadyBarrier;
|
|
26535
|
+
const ensureRunReady = /* @__PURE__ */ __name(async () => {
|
|
26536
|
+
if (pendingRunReady) {
|
|
26537
|
+
try {
|
|
26538
|
+
await pendingRunReady;
|
|
26539
|
+
} catch {
|
|
26540
|
+
}
|
|
26541
|
+
pendingRunReady = void 0;
|
|
26542
|
+
}
|
|
26543
|
+
}, "ensureRunReady");
|
|
26525
26544
|
let buffer3 = [];
|
|
26526
26545
|
let flushTimer = null;
|
|
26527
26546
|
let flushPromise = null;
|
|
@@ -26533,6 +26552,7 @@ var init_serialization4 = __esm({
|
|
|
26533
26552
|
}
|
|
26534
26553
|
if (buffer3.length === 0)
|
|
26535
26554
|
return;
|
|
26555
|
+
await ensureRunReady();
|
|
26536
26556
|
const chunksToFlush = buffer3.slice();
|
|
26537
26557
|
const world = await worldPromise;
|
|
26538
26558
|
if (resolvedFlushIntervalMs === void 0) {
|
|
@@ -26582,6 +26602,7 @@ var init_serialization4 = __esm({
|
|
|
26582
26602
|
flushPromise = null;
|
|
26583
26603
|
}
|
|
26584
26604
|
await flush();
|
|
26605
|
+
await ensureRunReady();
|
|
26585
26606
|
const world = await worldPromise;
|
|
26586
26607
|
await world.streams.close(runId, name);
|
|
26587
26608
|
},
|
|
@@ -79586,7 +79607,7 @@ var version2;
|
|
|
79586
79607
|
var init_version = __esm2({
|
|
79587
79608
|
"../core/dist/version.js"() {
|
|
79588
79609
|
"use strict";
|
|
79589
|
-
version2 = "5.0.0-beta.
|
|
79610
|
+
version2 = "5.0.0-beta.25";
|
|
79590
79611
|
}
|
|
79591
79612
|
});
|
|
79592
79613
|
function getWorkflowQueueName(workflowName, namespace) {
|
|
@@ -81524,7 +81545,7 @@ function attachAbortListenerOnce(signal, streamName, runId, cryptoKey, ops) {
|
|
|
81524
81545
|
});
|
|
81525
81546
|
}
|
|
81526
81547
|
__name(attachAbortListenerOnce, "attachAbortListenerOnce");
|
|
81527
|
-
function getExternalReducers(global2 = globalThis, ops, runId, cryptoKey, framedByteStreams = false) {
|
|
81548
|
+
function getExternalReducers(global2 = globalThis, ops, runId, cryptoKey, framedByteStreams = false, runReadyBarrier) {
|
|
81528
81549
|
return {
|
|
81529
81550
|
...getAllBaseReducers(global2),
|
|
81530
81551
|
ReadableStream: /* @__PURE__ */ __name2((value) => {
|
|
@@ -81537,7 +81558,7 @@ function getExternalReducers(global2 = globalThis, ops, runId, cryptoKey, framed
|
|
|
81537
81558
|
const streamId = (global2[STABLE_ULID] || defaultUlid)();
|
|
81538
81559
|
const name = `strm_${streamId}`;
|
|
81539
81560
|
const type = getStreamType(value);
|
|
81540
|
-
const writable = new WorkflowServerWritableStream(runId, name);
|
|
81561
|
+
const writable = new WorkflowServerWritableStream(runId, name, runReadyBarrier);
|
|
81541
81562
|
if (type === "bytes") {
|
|
81542
81563
|
if (framedByteStreams) {
|
|
81543
81564
|
ops.push(value.pipeThrough(getByteFramingStream()).pipeTo(writable));
|
|
@@ -81545,7 +81566,7 @@ function getExternalReducers(global2 = globalThis, ops, runId, cryptoKey, framed
|
|
|
81545
81566
|
ops.push(value.pipeTo(writable));
|
|
81546
81567
|
}
|
|
81547
81568
|
} else {
|
|
81548
|
-
ops.push(value.pipeThrough(getSerializeStream(getExternalReducers(global2, ops, runId, cryptoKey, framedByteStreams), cryptoKey)).pipeTo(writable));
|
|
81569
|
+
ops.push(value.pipeThrough(getSerializeStream(getExternalReducers(global2, ops, runId, cryptoKey, framedByteStreams, runReadyBarrier), cryptoKey)).pipeTo(writable));
|
|
81549
81570
|
}
|
|
81550
81571
|
const s = {
|
|
81551
81572
|
name
|
|
@@ -81653,7 +81674,7 @@ function getWorkflowReducers(global2 = globalThis) {
|
|
|
81653
81674
|
};
|
|
81654
81675
|
}
|
|
81655
81676
|
__name(getWorkflowReducers, "getWorkflowReducers");
|
|
81656
|
-
function getStepReducers(global2 = globalThis, ops, runId, cryptoKey, framedByteStreams = false) {
|
|
81677
|
+
function getStepReducers(global2 = globalThis, ops, runId, cryptoKey, framedByteStreams = false, runReadyBarrier) {
|
|
81657
81678
|
return {
|
|
81658
81679
|
...getAllBaseReducers(global2),
|
|
81659
81680
|
ReadableStream: /* @__PURE__ */ __name2((value) => {
|
|
@@ -81671,7 +81692,7 @@ function getStepReducers(global2 = globalThis, ops, runId, cryptoKey, framedByte
|
|
|
81671
81692
|
name = `strm_${streamId}`;
|
|
81672
81693
|
type = getStreamType(value);
|
|
81673
81694
|
framing = type === "bytes" && framedByteStreams ? "framed-v1" : framing;
|
|
81674
|
-
const writable = new WorkflowServerWritableStream(runId, name);
|
|
81695
|
+
const writable = new WorkflowServerWritableStream(runId, name, runReadyBarrier);
|
|
81675
81696
|
if (type === "bytes") {
|
|
81676
81697
|
if (framing === "framed-v1") {
|
|
81677
81698
|
ops.push(value.pipeThrough(getByteFramingStream()).pipeTo(writable));
|
|
@@ -81679,7 +81700,7 @@ function getStepReducers(global2 = globalThis, ops, runId, cryptoKey, framedByte
|
|
|
81679
81700
|
ops.push(value.pipeTo(writable));
|
|
81680
81701
|
}
|
|
81681
81702
|
} else {
|
|
81682
|
-
ops.push(value.pipeThrough(getSerializeStream(getStepReducers(global2, ops, runId, cryptoKey, framedByteStreams), cryptoKey)).pipeTo(writable));
|
|
81703
|
+
ops.push(value.pipeThrough(getSerializeStream(getStepReducers(global2, ops, runId, cryptoKey, framedByteStreams, runReadyBarrier), cryptoKey)).pipeTo(writable));
|
|
81683
81704
|
}
|
|
81684
81705
|
}
|
|
81685
81706
|
const s = {
|
|
@@ -82200,16 +82221,16 @@ async function hydrateStepArguments(value, runId, key, ops = [], global2 = globa
|
|
|
82200
82221
|
return result;
|
|
82201
82222
|
}
|
|
82202
82223
|
__name(hydrateStepArguments, "hydrateStepArguments");
|
|
82203
|
-
async function dehydrateStepReturnValue(value, runId, key, ops = [], global2 = globalThis, v1Compat = false, framedByteStreams = false, compression = false) {
|
|
82224
|
+
async function dehydrateStepReturnValue(value, runId, key, ops = [], global2 = globalThis, v1Compat = false, framedByteStreams = false, compression = false, runReadyBarrier) {
|
|
82204
82225
|
if (v1Compat) {
|
|
82205
|
-
const str = stringify(value, getStepReducers(global2, ops, runId, key, framedByteStreams));
|
|
82226
|
+
const str = stringify(value, getStepReducers(global2, ops, runId, key, framedByteStreams, runReadyBarrier));
|
|
82206
82227
|
return revive(str);
|
|
82207
82228
|
}
|
|
82208
82229
|
try {
|
|
82209
82230
|
const compressionStats = {};
|
|
82210
82231
|
const result = await serialize2(value, key, {
|
|
82211
82232
|
global: global2,
|
|
82212
|
-
extraReducers: getStreamAndRequestReducers(getStepReducers(global2, ops, runId, key, framedByteStreams)),
|
|
82233
|
+
extraReducers: getStreamAndRequestReducers(getStepReducers(global2, ops, runId, key, framedByteStreams, runReadyBarrier)),
|
|
82213
82234
|
compression,
|
|
82214
82235
|
compressionStats
|
|
82215
82236
|
});
|
|
@@ -82367,7 +82388,16 @@ var init_serialization2 = __esm2({
|
|
|
82367
82388
|
static {
|
|
82368
82389
|
__name2(this, "WorkflowServerWritableStream");
|
|
82369
82390
|
}
|
|
82370
|
-
|
|
82391
|
+
/**
|
|
82392
|
+
* @param runReadyBarrier Turbo mode only: a promise that resolves once the
|
|
82393
|
+
* backgrounded `run_started` has landed. When the step body runs
|
|
82394
|
+
* optimistically (before `run_started` is durable), the first chunk write to
|
|
82395
|
+
* a brand-new stream would otherwise reach the World before the run exists
|
|
82396
|
+
* and be rejected as run-not-found. Awaiting this once before the first
|
|
82397
|
+
* flush/close orders the write after the run's creation. `undefined` outside
|
|
82398
|
+
* turbo and on the await path, where the run was already durable.
|
|
82399
|
+
*/
|
|
82400
|
+
constructor(runId, name, runReadyBarrier) {
|
|
82371
82401
|
if (typeof runId !== "string") {
|
|
82372
82402
|
throw new WorkflowRuntimeError(`"runId" must be a string, got "${typeof runId}"`);
|
|
82373
82403
|
}
|
|
@@ -82375,6 +82405,16 @@ var init_serialization2 = __esm2({
|
|
|
82375
82405
|
throw new WorkflowRuntimeError(`"name" is required, got "${name}"`);
|
|
82376
82406
|
}
|
|
82377
82407
|
const worldPromise = getWorldLazy();
|
|
82408
|
+
let pendingRunReady = runReadyBarrier;
|
|
82409
|
+
const ensureRunReady = /* @__PURE__ */ __name2(async () => {
|
|
82410
|
+
if (pendingRunReady) {
|
|
82411
|
+
try {
|
|
82412
|
+
await pendingRunReady;
|
|
82413
|
+
} catch {
|
|
82414
|
+
}
|
|
82415
|
+
pendingRunReady = void 0;
|
|
82416
|
+
}
|
|
82417
|
+
}, "ensureRunReady");
|
|
82378
82418
|
let buffer22 = [];
|
|
82379
82419
|
let flushTimer = null;
|
|
82380
82420
|
let flushPromise = null;
|
|
@@ -82385,6 +82425,7 @@ var init_serialization2 = __esm2({
|
|
|
82385
82425
|
flushTimer = null;
|
|
82386
82426
|
}
|
|
82387
82427
|
if (buffer22.length === 0) return;
|
|
82428
|
+
await ensureRunReady();
|
|
82388
82429
|
const chunksToFlush = buffer22.slice();
|
|
82389
82430
|
const world = await worldPromise;
|
|
82390
82431
|
if (resolvedFlushIntervalMs === void 0) {
|
|
@@ -82434,6 +82475,7 @@ var init_serialization2 = __esm2({
|
|
|
82434
82475
|
flushPromise = null;
|
|
82435
82476
|
}
|
|
82436
82477
|
await flush();
|
|
82478
|
+
await ensureRunReady();
|
|
82437
82479
|
const world = await worldPromise;
|
|
82438
82480
|
await world.streams.close(runId, name);
|
|
82439
82481
|
},
|
|
@@ -82823,7 +82865,7 @@ __name2(start, "start");
|
|
|
82823
82865
|
value: "start",
|
|
82824
82866
|
configurable: true
|
|
82825
82867
|
});
|
|
82826
|
-
})(start, "step//@workflow/core/runtime/start@5.0.0-beta.
|
|
82868
|
+
})(start, "step//@workflow/core/runtime/start@5.0.0-beta.25//start");
|
|
82827
82869
|
function isRetryableStartError(err) {
|
|
82828
82870
|
if (ThrottleError.is(err)) return true;
|
|
82829
82871
|
if (WorkflowWorldError.is(err) && err.status && err.status >= 500) return true;
|
|
@@ -83157,7 +83199,7 @@ var Run = class _Run {
|
|
|
83157
83199
|
value: "wakeUp",
|
|
83158
83200
|
configurable: true
|
|
83159
83201
|
});
|
|
83160
|
-
})(Run.prototype["wakeUp"], "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
83202
|
+
})(Run.prototype["wakeUp"], "step//@workflow/core/runtime/run@5.0.0-beta.25//Run#wakeUp");
|
|
83161
83203
|
(function(__wf_fn, __wf_id) {
|
|
83162
83204
|
var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
83163
83205
|
__wf_reg.set(__wf_id, __wf_fn);
|
|
@@ -83166,7 +83208,7 @@ var Run = class _Run {
|
|
|
83166
83208
|
value: "cancel",
|
|
83167
83209
|
configurable: true
|
|
83168
83210
|
});
|
|
83169
|
-
})(Run.prototype["cancel"], "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
83211
|
+
})(Run.prototype["cancel"], "step//@workflow/core/runtime/run@5.0.0-beta.25//Run#cancel");
|
|
83170
83212
|
(function(__wf_fn, __wf_id) {
|
|
83171
83213
|
var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
83172
83214
|
__wf_reg.set(__wf_id, __wf_fn);
|
|
@@ -83175,7 +83217,7 @@ var Run = class _Run {
|
|
|
83175
83217
|
value: "getReadable",
|
|
83176
83218
|
configurable: true
|
|
83177
83219
|
});
|
|
83178
|
-
})(Run.prototype["getReadable"], "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
83220
|
+
})(Run.prototype["getReadable"], "step//@workflow/core/runtime/run@5.0.0-beta.25//Run#getReadable");
|
|
83179
83221
|
(function(__wf_fn, __wf_id) {
|
|
83180
83222
|
var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
83181
83223
|
__wf_reg.set(__wf_id, __wf_fn);
|
|
@@ -83184,7 +83226,7 @@ var Run = class _Run {
|
|
|
83184
83226
|
value: "exists",
|
|
83185
83227
|
configurable: true
|
|
83186
83228
|
});
|
|
83187
|
-
})(Object.getOwnPropertyDescriptor(Run.prototype, "exists").get, "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
83229
|
+
})(Object.getOwnPropertyDescriptor(Run.prototype, "exists").get, "step//@workflow/core/runtime/run@5.0.0-beta.25//Run#exists");
|
|
83188
83230
|
(function(__wf_fn, __wf_id) {
|
|
83189
83231
|
var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
83190
83232
|
__wf_reg.set(__wf_id, __wf_fn);
|
|
@@ -83193,7 +83235,7 @@ var Run = class _Run {
|
|
|
83193
83235
|
value: "status",
|
|
83194
83236
|
configurable: true
|
|
83195
83237
|
});
|
|
83196
|
-
})(Object.getOwnPropertyDescriptor(Run.prototype, "status").get, "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
83238
|
+
})(Object.getOwnPropertyDescriptor(Run.prototype, "status").get, "step//@workflow/core/runtime/run@5.0.0-beta.25//Run#status");
|
|
83197
83239
|
(function(__wf_fn, __wf_id) {
|
|
83198
83240
|
var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
83199
83241
|
__wf_reg.set(__wf_id, __wf_fn);
|
|
@@ -83202,7 +83244,7 @@ var Run = class _Run {
|
|
|
83202
83244
|
value: "returnValue",
|
|
83203
83245
|
configurable: true
|
|
83204
83246
|
});
|
|
83205
|
-
})(Object.getOwnPropertyDescriptor(Run.prototype, "returnValue").get, "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
83247
|
+
})(Object.getOwnPropertyDescriptor(Run.prototype, "returnValue").get, "step//@workflow/core/runtime/run@5.0.0-beta.25//Run#returnValue");
|
|
83206
83248
|
(function(__wf_fn, __wf_id) {
|
|
83207
83249
|
var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
83208
83250
|
__wf_reg.set(__wf_id, __wf_fn);
|
|
@@ -83211,7 +83253,7 @@ var Run = class _Run {
|
|
|
83211
83253
|
value: "workflowName",
|
|
83212
83254
|
configurable: true
|
|
83213
83255
|
});
|
|
83214
|
-
})(Object.getOwnPropertyDescriptor(Run.prototype, "workflowName").get, "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
83256
|
+
})(Object.getOwnPropertyDescriptor(Run.prototype, "workflowName").get, "step//@workflow/core/runtime/run@5.0.0-beta.25//Run#workflowName");
|
|
83215
83257
|
(function(__wf_fn, __wf_id) {
|
|
83216
83258
|
var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
83217
83259
|
__wf_reg.set(__wf_id, __wf_fn);
|
|
@@ -83220,7 +83262,7 @@ var Run = class _Run {
|
|
|
83220
83262
|
value: "createdAt",
|
|
83221
83263
|
configurable: true
|
|
83222
83264
|
});
|
|
83223
|
-
})(Object.getOwnPropertyDescriptor(Run.prototype, "createdAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
83265
|
+
})(Object.getOwnPropertyDescriptor(Run.prototype, "createdAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.25//Run#createdAt");
|
|
83224
83266
|
(function(__wf_fn, __wf_id) {
|
|
83225
83267
|
var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
83226
83268
|
__wf_reg.set(__wf_id, __wf_fn);
|
|
@@ -83229,7 +83271,7 @@ var Run = class _Run {
|
|
|
83229
83271
|
value: "startedAt",
|
|
83230
83272
|
configurable: true
|
|
83231
83273
|
});
|
|
83232
|
-
})(Object.getOwnPropertyDescriptor(Run.prototype, "startedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
83274
|
+
})(Object.getOwnPropertyDescriptor(Run.prototype, "startedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.25//Run#startedAt");
|
|
83233
83275
|
(function(__wf_fn, __wf_id) {
|
|
83234
83276
|
var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
83235
83277
|
__wf_reg.set(__wf_id, __wf_fn);
|
|
@@ -83238,7 +83280,7 @@ var Run = class _Run {
|
|
|
83238
83280
|
value: "completedAt",
|
|
83239
83281
|
configurable: true
|
|
83240
83282
|
});
|
|
83241
|
-
})(Object.getOwnPropertyDescriptor(Run.prototype, "completedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
83283
|
+
})(Object.getOwnPropertyDescriptor(Run.prototype, "completedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.25//Run#completedAt");
|
|
83242
83284
|
(function(__wf_cls, __wf_id) {
|
|
83243
83285
|
var __wf_sym = /* @__PURE__ */ Symbol.for("workflow-class-registry"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
83244
83286
|
__wf_reg.set(__wf_id, __wf_cls);
|
|
@@ -83248,7 +83290,7 @@ var Run = class _Run {
|
|
|
83248
83290
|
enumerable: false,
|
|
83249
83291
|
configurable: false
|
|
83250
83292
|
});
|
|
83251
|
-
})(Run, "class//@workflow/core/runtime/run@5.0.0-beta.
|
|
83293
|
+
})(Run, "class//@workflow/core/runtime/run@5.0.0-beta.25//Run");
|
|
83252
83294
|
async function fetch2(...args) {
|
|
83253
83295
|
return globalThis.fetch(...args);
|
|
83254
83296
|
}
|
|
@@ -84458,6 +84500,10 @@ function hasTag(fileId, tag) {
|
|
|
84458
84500
|
return fileId.endsWith(`.${tag}`);
|
|
84459
84501
|
}
|
|
84460
84502
|
__name(hasTag, "hasTag");
|
|
84503
|
+
function isUntagged(fileId) {
|
|
84504
|
+
return !TAG_PATTERN.test(fileId);
|
|
84505
|
+
}
|
|
84506
|
+
__name(isUntagged, "isUntagged");
|
|
84461
84507
|
function taggedPath(basedir, entityDir, fileId, tag) {
|
|
84462
84508
|
assertSafeEntityId("fileId", fileId);
|
|
84463
84509
|
if (tag !== void 0)
|
|
@@ -85199,34 +85245,54 @@ function createQueue(config4) {
|
|
|
85199
85245
|
await semaphore.acquire();
|
|
85200
85246
|
}
|
|
85201
85247
|
const MAX_LOCAL_SAFETY_LIMIT = 256;
|
|
85248
|
+
let delivery = 0;
|
|
85202
85249
|
try {
|
|
85203
|
-
for (let
|
|
85250
|
+
for (let loop = 0; loop < MAX_LOCAL_SAFETY_LIMIT; loop++) {
|
|
85204
85251
|
const headers = {
|
|
85205
85252
|
...opts?.headers,
|
|
85206
85253
|
"content-type": "application/json",
|
|
85207
85254
|
"x-vqs-queue-name": queueName,
|
|
85208
85255
|
"x-vqs-message-id": messageId,
|
|
85209
|
-
"x-vqs-message-attempt": String(
|
|
85256
|
+
"x-vqs-message-attempt": String(delivery + 1)
|
|
85210
85257
|
};
|
|
85211
85258
|
const directHandler = directHandlers.get(prefix);
|
|
85212
85259
|
let response;
|
|
85213
|
-
|
|
85214
|
-
|
|
85215
|
-
|
|
85216
|
-
|
|
85217
|
-
|
|
85218
|
-
|
|
85219
|
-
|
|
85220
|
-
|
|
85221
|
-
|
|
85222
|
-
|
|
85223
|
-
|
|
85224
|
-
|
|
85225
|
-
|
|
85226
|
-
|
|
85227
|
-
|
|
85260
|
+
try {
|
|
85261
|
+
if (directHandler) {
|
|
85262
|
+
const req = new Request(`http://localhost/.well-known/workflow/v1/${pathname}`, {
|
|
85263
|
+
method: "POST",
|
|
85264
|
+
headers,
|
|
85265
|
+
body
|
|
85266
|
+
});
|
|
85267
|
+
response = await directHandler(req);
|
|
85268
|
+
} else {
|
|
85269
|
+
const baseUrl = await resolveBaseUrl(config4);
|
|
85270
|
+
response = await fetch(`${baseUrl}/.well-known/workflow/v1/${pathname}`, {
|
|
85271
|
+
method: "POST",
|
|
85272
|
+
duplex: "half",
|
|
85273
|
+
dispatcher: httpAgent,
|
|
85274
|
+
headers,
|
|
85275
|
+
body
|
|
85276
|
+
});
|
|
85277
|
+
}
|
|
85278
|
+
} catch (err) {
|
|
85279
|
+
const name = err?.name;
|
|
85280
|
+
if (closeSignal.aborted || name === "AbortError" || name === "ResponseAborted") {
|
|
85281
|
+
return;
|
|
85282
|
+
}
|
|
85283
|
+
if (isDetachedArrayBufferQueueError(err))
|
|
85284
|
+
throw err;
|
|
85285
|
+
console.error(`[world-local] Queue delivery failed at the transport (loop ${loop + 1}), retrying`, {
|
|
85286
|
+
queueName,
|
|
85287
|
+
messageId,
|
|
85288
|
+
...runId && { runId },
|
|
85289
|
+
...stepId && { stepId },
|
|
85290
|
+
error: String(err)
|
|
85228
85291
|
});
|
|
85292
|
+
await setTimeout2(5e3, void 0, { signal: closeSignal });
|
|
85293
|
+
continue;
|
|
85229
85294
|
}
|
|
85295
|
+
delivery++;
|
|
85230
85296
|
const text = await response.text();
|
|
85231
85297
|
if (response.ok) {
|
|
85232
85298
|
try {
|
|
@@ -85244,7 +85310,7 @@ function createQueue(config4) {
|
|
|
85244
85310
|
}
|
|
85245
85311
|
return;
|
|
85246
85312
|
}
|
|
85247
|
-
console.error(`[world-local] Queue message failed (attempt ${
|
|
85313
|
+
console.error(`[world-local] Queue message failed (attempt ${delivery}, HTTP ${response.status})`, {
|
|
85248
85314
|
queueName,
|
|
85249
85315
|
messageId,
|
|
85250
85316
|
...runId && { runId },
|
|
@@ -87031,13 +87097,14 @@ function createLocalWorld(args) {
|
|
|
87031
87097
|
if (!recoverActiveRuns) {
|
|
87032
87098
|
return;
|
|
87033
87099
|
}
|
|
87034
|
-
const
|
|
87100
|
+
const fileIdFilter = tag ? (fileId) => hasTag(fileId, tag) : isUntagged;
|
|
87101
|
+
const recoveryRuns = {
|
|
87035
87102
|
...storage.runs,
|
|
87036
87103
|
list: /* @__PURE__ */ __name(((params) => storage.runs.list({
|
|
87037
87104
|
...params,
|
|
87038
|
-
fileIdFilter
|
|
87105
|
+
fileIdFilter
|
|
87039
87106
|
})), "list")
|
|
87040
|
-
}
|
|
87107
|
+
};
|
|
87041
87108
|
await reenqueueActiveRuns(recoveryRuns, queue.queue, "world-local");
|
|
87042
87109
|
},
|
|
87043
87110
|
async close() {
|
|
@@ -87096,34 +87163,69 @@ import { webcrypto } from "node:crypto";
|
|
|
87096
87163
|
// ../world-vercel/dist/http-client.js
|
|
87097
87164
|
var import_undici2 = __toESM(require_undici(), 1);
|
|
87098
87165
|
var _dispatcher;
|
|
87166
|
+
var _eventsDispatcher;
|
|
87167
|
+
var _streamDispatcher;
|
|
87168
|
+
var BASE_AGENT_OPTIONS = {
|
|
87169
|
+
connections: 8,
|
|
87170
|
+
keepAliveTimeout: 1e4,
|
|
87171
|
+
// HTTP/1.1 pipelining is disabled (pipelining: 1) because it causes
|
|
87172
|
+
// head-of-line blocking that deadlocks the webhook respondWith mechanism.
|
|
87173
|
+
pipelining: 1
|
|
87174
|
+
};
|
|
87175
|
+
var DEFAULT_AGENT_OPTIONS = {
|
|
87176
|
+
...BASE_AGENT_OPTIONS,
|
|
87177
|
+
allowH2: false
|
|
87178
|
+
};
|
|
87179
|
+
var EVENTS_AGENT_OPTIONS = {
|
|
87180
|
+
...BASE_AGENT_OPTIONS,
|
|
87181
|
+
allowH2: true
|
|
87182
|
+
};
|
|
87183
|
+
var RETRY_AGENT_OPTIONS = {
|
|
87184
|
+
// Observe Retry-After header if received
|
|
87185
|
+
retryAfter: true
|
|
87186
|
+
// By default, we observe re-try headers, and also separately
|
|
87187
|
+
// re-try on these status codes: 429 / 500 / 502 / 503 / 504.
|
|
87188
|
+
// TODO: We might want to let 429s pass through, so that we can do
|
|
87189
|
+
// runtime retry-after handling through the queue.
|
|
87190
|
+
};
|
|
87191
|
+
var STREAM_RETRY_OPTIONS = {
|
|
87192
|
+
retryAfter: true,
|
|
87193
|
+
methods: ["PUT"],
|
|
87194
|
+
statusCodes: [429]
|
|
87195
|
+
};
|
|
87099
87196
|
function getDispatcher(config4) {
|
|
87100
87197
|
return config4?.dispatcher ?? getDefaultDispatcher();
|
|
87101
87198
|
}
|
|
87102
87199
|
__name(getDispatcher, "getDispatcher");
|
|
87200
|
+
function getEventsDispatcher(config4) {
|
|
87201
|
+
return config4?.dispatcher ?? getDefaultEventsDispatcher();
|
|
87202
|
+
}
|
|
87203
|
+
__name(getEventsDispatcher, "getEventsDispatcher");
|
|
87204
|
+
function getStreamDispatcher(config4) {
|
|
87205
|
+
return config4?.dispatcher ?? getDefaultStreamDispatcher();
|
|
87206
|
+
}
|
|
87207
|
+
__name(getStreamDispatcher, "getStreamDispatcher");
|
|
87103
87208
|
function getDefaultDispatcher() {
|
|
87104
87209
|
if (!_dispatcher) {
|
|
87105
|
-
_dispatcher = new import_undici2.RetryAgent(new import_undici2.Agent(
|
|
87106
|
-
connections: 8,
|
|
87107
|
-
keepAliveTimeout: 1e4,
|
|
87108
|
-
// H2 is specifically incompatible with SvelteKit on Vercel prod. Everything else
|
|
87109
|
-
// runs fine.
|
|
87110
|
-
// TODO: Investigate/fix the failure on SvelteKit so we can re-enable H2.
|
|
87111
|
-
allowH2: false,
|
|
87112
|
-
// HTTP/1.1 pipelining is disabled (pipelining: 1) because it causes
|
|
87113
|
-
// head-of-line blocking that deadlocks the webhook respondWith mechanism.
|
|
87114
|
-
pipelining: 1
|
|
87115
|
-
}), {
|
|
87116
|
-
// Observe Retry-After header if received
|
|
87117
|
-
retryAfter: true
|
|
87118
|
-
// By default, we observe re-try headers, and also separately
|
|
87119
|
-
// re-try on these status codes: 429 / 500 / 502 / 503 / 504.
|
|
87120
|
-
// TODO: We might want to let 429s pass through, so that we can do
|
|
87121
|
-
// runtime retry-after handling through the queue.
|
|
87122
|
-
});
|
|
87210
|
+
_dispatcher = new import_undici2.RetryAgent(new import_undici2.Agent(DEFAULT_AGENT_OPTIONS), RETRY_AGENT_OPTIONS);
|
|
87123
87211
|
}
|
|
87124
87212
|
return _dispatcher;
|
|
87125
87213
|
}
|
|
87126
87214
|
__name(getDefaultDispatcher, "getDefaultDispatcher");
|
|
87215
|
+
function getDefaultEventsDispatcher() {
|
|
87216
|
+
if (!_eventsDispatcher) {
|
|
87217
|
+
_eventsDispatcher = new import_undici2.RetryAgent(new import_undici2.Agent(EVENTS_AGENT_OPTIONS), RETRY_AGENT_OPTIONS);
|
|
87218
|
+
}
|
|
87219
|
+
return _eventsDispatcher;
|
|
87220
|
+
}
|
|
87221
|
+
__name(getDefaultEventsDispatcher, "getDefaultEventsDispatcher");
|
|
87222
|
+
function getDefaultStreamDispatcher() {
|
|
87223
|
+
if (!_streamDispatcher) {
|
|
87224
|
+
_streamDispatcher = new import_undici2.RetryAgent(new import_undici2.Agent(EVENTS_AGENT_OPTIONS), STREAM_RETRY_OPTIONS);
|
|
87225
|
+
}
|
|
87226
|
+
return _streamDispatcher;
|
|
87227
|
+
}
|
|
87228
|
+
__name(getDefaultStreamDispatcher, "getDefaultStreamDispatcher");
|
|
87127
87229
|
|
|
87128
87230
|
// ../world-vercel/dist/encryption.js
|
|
87129
87231
|
var KEY_BYTES = 32;
|
|
@@ -94331,7 +94433,7 @@ import os from "node:os";
|
|
|
94331
94433
|
import { inspect } from "node:util";
|
|
94332
94434
|
|
|
94333
94435
|
// ../world-vercel/dist/version.js
|
|
94334
|
-
var version5 = "5.0.0-beta.
|
|
94436
|
+
var version5 = "5.0.0-beta.21";
|
|
94335
94437
|
|
|
94336
94438
|
// ../world-vercel/dist/utils.js
|
|
94337
94439
|
var HTTP_DEBUG_ENABLED = typeof process !== "undefined" && typeof process.env.DEBUG === "string" && (process.env.DEBUG.includes("workflow:") || process.env.DEBUG === "*");
|
|
@@ -94951,7 +95053,7 @@ async function fetchV4(url3, init, config4) {
|
|
|
94951
95053
|
headers: init.headers,
|
|
94952
95054
|
body: init.body,
|
|
94953
95055
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- undici dispatcher type doesn't match @types/node's RequestInit
|
|
94954
|
-
dispatcher:
|
|
95056
|
+
dispatcher: getEventsDispatcher(config4)
|
|
94955
95057
|
});
|
|
94956
95058
|
}
|
|
94957
95059
|
__name(fetchV4, "fetchV4");
|
|
@@ -95847,7 +95949,9 @@ function createStreamer2(config4) {
|
|
|
95847
95949
|
const response = await fetch(url3, {
|
|
95848
95950
|
method: "PUT",
|
|
95849
95951
|
body: chunk,
|
|
95850
|
-
headers: httpConfig.headers
|
|
95952
|
+
headers: httpConfig.headers,
|
|
95953
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- undici dispatcher type doesn't match @types/node's RequestInit
|
|
95954
|
+
dispatcher: getStreamDispatcher(config4)
|
|
95851
95955
|
});
|
|
95852
95956
|
const text = await response.text();
|
|
95853
95957
|
if (!response.ok) {
|
|
@@ -95867,7 +95971,9 @@ function createStreamer2(config4) {
|
|
|
95867
95971
|
const response = await fetch(url3, {
|
|
95868
95972
|
method: "PUT",
|
|
95869
95973
|
body,
|
|
95870
|
-
headers: httpConfig.headers
|
|
95974
|
+
headers: httpConfig.headers,
|
|
95975
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- undici dispatcher type doesn't match @types/node's RequestInit
|
|
95976
|
+
dispatcher: getStreamDispatcher(config4)
|
|
95871
95977
|
});
|
|
95872
95978
|
const text = await response.text();
|
|
95873
95979
|
if (!response.ok) {
|
|
@@ -95882,7 +95988,9 @@ function createStreamer2(config4) {
|
|
|
95882
95988
|
const url3 = getStreamUrl(name, resolvedRunId, httpConfig);
|
|
95883
95989
|
const response = await fetch(url3, {
|
|
95884
95990
|
method: "PUT",
|
|
95885
|
-
headers: httpConfig.headers
|
|
95991
|
+
headers: httpConfig.headers,
|
|
95992
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- undici dispatcher type doesn't match @types/node's RequestInit
|
|
95993
|
+
dispatcher: getStreamDispatcher(config4)
|
|
95886
95994
|
});
|
|
95887
95995
|
const text = await response.text();
|
|
95888
95996
|
if (!response.ok) {
|
|
@@ -96562,13 +96670,14 @@ async function executeStep(params) {
|
|
|
96562
96670
|
return { type: "failed" };
|
|
96563
96671
|
}
|
|
96564
96672
|
const preCompletionOps = [];
|
|
96673
|
+
const ops = [];
|
|
96674
|
+
let opsSettled = true;
|
|
96565
96675
|
try {
|
|
96566
96676
|
const attempt = step.attempt;
|
|
96567
96677
|
if (!step.startedAt) {
|
|
96568
96678
|
throw new WorkflowRuntimeError2(`Step "${stepId}" has no "startedAt" timestamp`);
|
|
96569
96679
|
}
|
|
96570
96680
|
const stepStartedAt = step.startedAt;
|
|
96571
|
-
const ops = [];
|
|
96572
96681
|
const encryptionKey = params.encryptionKey ?? await getEncryptionKey();
|
|
96573
96682
|
const hydratedInput = await trace3("step.hydrate", {}, async (hydrateSpan) => {
|
|
96574
96683
|
const startTime = Date.now();
|
|
@@ -96603,7 +96712,12 @@ async function executeStep(params) {
|
|
|
96603
96712
|
ops,
|
|
96604
96713
|
preCompletionOps,
|
|
96605
96714
|
closureVars: hydratedInput.closureVars,
|
|
96606
|
-
encryptionKey
|
|
96715
|
+
encryptionKey,
|
|
96716
|
+
// Turbo optimistic start runs this body before `run_started` is
|
|
96717
|
+
// durable. Expose the barrier so a direct step-body world write
|
|
96718
|
+
// (e.g. `experimental_setAttributes`) can order itself after the
|
|
96719
|
+
// run exists. Undefined on the await path (run already durable).
|
|
96720
|
+
runReadyBarrier: optimisticStart ? params.runReadyBarrier : void 0
|
|
96607
96721
|
}, () => stepFn.apply(thisVal, args));
|
|
96608
96722
|
});
|
|
96609
96723
|
const executionTimeMs = Date.now() - executionStartTime;
|
|
@@ -96612,7 +96726,20 @@ async function executeStep(params) {
|
|
|
96612
96726
|
});
|
|
96613
96727
|
result = await trace3("step.dehydrate", {}, async (dehydrateSpan) => {
|
|
96614
96728
|
const startTime = Date.now();
|
|
96615
|
-
const dehydrated = await dehydrateStepReturnValue2(
|
|
96729
|
+
const dehydrated = await dehydrateStepReturnValue2(
|
|
96730
|
+
result,
|
|
96731
|
+
workflowRunId,
|
|
96732
|
+
encryptionKey,
|
|
96733
|
+
ops,
|
|
96734
|
+
globalThis,
|
|
96735
|
+
false,
|
|
96736
|
+
false,
|
|
96737
|
+
compression,
|
|
96738
|
+
// Turbo optimistic start: a returned stream is piped to the server
|
|
96739
|
+
// after the body but within this same op flush, so gate its first
|
|
96740
|
+
// write on the run-ready barrier. Undefined on the await path.
|
|
96741
|
+
optimisticStart ? params.runReadyBarrier : void 0
|
|
96742
|
+
);
|
|
96616
96743
|
const durationMs = Date.now() - startTime;
|
|
96617
96744
|
dehydrateSpan?.setAttributes({
|
|
96618
96745
|
...QueueSerializeTimeMs2(durationMs),
|
|
@@ -96620,7 +96747,6 @@ async function executeStep(params) {
|
|
|
96620
96747
|
});
|
|
96621
96748
|
return dehydrated;
|
|
96622
96749
|
});
|
|
96623
|
-
let opsSettled = true;
|
|
96624
96750
|
if (ops.length > 0) {
|
|
96625
96751
|
const opsPromise = Promise.all(ops);
|
|
96626
96752
|
safeWaitUntil2(opsPromise, (err) => {
|
|
@@ -96649,45 +96775,6 @@ async function executeStep(params) {
|
|
|
96649
96775
|
await Promise.all(preCompletionOps).catch(() => {
|
|
96650
96776
|
});
|
|
96651
96777
|
}
|
|
96652
|
-
let stepCompleted409 = false;
|
|
96653
|
-
const completedResult = await world.events.create(workflowRunId, {
|
|
96654
|
-
eventType: "step_completed",
|
|
96655
|
-
specVersion: SPEC_VERSION_CURRENT2,
|
|
96656
|
-
correlationId: stepId,
|
|
96657
|
-
eventData: {
|
|
96658
|
-
stepName,
|
|
96659
|
-
workflowName,
|
|
96660
|
-
result
|
|
96661
|
-
}
|
|
96662
|
-
}, params.inlineDeltaSinceCursor !== void 0 ? { sinceCursor: params.inlineDeltaSinceCursor } : void 0).catch((err) => {
|
|
96663
|
-
if (EntityConflictError2.is(err)) {
|
|
96664
|
-
runtimeLogger2.info("Tried completing step, but step has already finished.", {
|
|
96665
|
-
workflowRunId,
|
|
96666
|
-
stepId,
|
|
96667
|
-
stepName,
|
|
96668
|
-
message: err.message
|
|
96669
|
-
});
|
|
96670
|
-
stepCompleted409 = true;
|
|
96671
|
-
return void 0;
|
|
96672
|
-
}
|
|
96673
|
-
throw err;
|
|
96674
|
-
});
|
|
96675
|
-
if (stepCompleted409) {
|
|
96676
|
-
return { type: "skipped" };
|
|
96677
|
-
}
|
|
96678
|
-
const inlineDelta = completedResult ? extractInlineDelta(completedResult, params.inlineDeltaSinceCursor !== void 0) : void 0;
|
|
96679
|
-
span?.setAttributes({
|
|
96680
|
-
...StepStatus2("completed"),
|
|
96681
|
-
...StepResultType2(typeof result)
|
|
96682
|
-
});
|
|
96683
|
-
if (ops.length > 0) {
|
|
96684
|
-
stepLogger2.debug("Step has pending ops", {
|
|
96685
|
-
workflowRunId,
|
|
96686
|
-
stepName,
|
|
96687
|
-
opsCount: ops.length
|
|
96688
|
-
});
|
|
96689
|
-
}
|
|
96690
|
-
return { type: "completed", hasPendingOps: !opsSettled, inlineDelta };
|
|
96691
96778
|
} catch (err) {
|
|
96692
96779
|
if (optimisticStart) {
|
|
96693
96780
|
const reconcile = await reconcileOptimisticStart();
|
|
@@ -96848,6 +96935,51 @@ async function executeStep(params) {
|
|
|
96848
96935
|
});
|
|
96849
96936
|
return { type: "retry", timeoutSeconds };
|
|
96850
96937
|
}
|
|
96938
|
+
let completedResult;
|
|
96939
|
+
try {
|
|
96940
|
+
completedResult = await world.events.create(workflowRunId, {
|
|
96941
|
+
eventType: "step_completed",
|
|
96942
|
+
specVersion: SPEC_VERSION_CURRENT2,
|
|
96943
|
+
correlationId: stepId,
|
|
96944
|
+
eventData: {
|
|
96945
|
+
stepName,
|
|
96946
|
+
workflowName,
|
|
96947
|
+
result
|
|
96948
|
+
}
|
|
96949
|
+
}, params.inlineDeltaSinceCursor !== void 0 ? { sinceCursor: params.inlineDeltaSinceCursor } : void 0);
|
|
96950
|
+
} catch (err) {
|
|
96951
|
+
if (EntityConflictError2.is(err)) {
|
|
96952
|
+
runtimeLogger2.info("Tried completing step, but step has already finished.", {
|
|
96953
|
+
workflowRunId,
|
|
96954
|
+
stepId,
|
|
96955
|
+
stepName,
|
|
96956
|
+
message: err.message
|
|
96957
|
+
});
|
|
96958
|
+
return { type: "skipped" };
|
|
96959
|
+
}
|
|
96960
|
+
if (RunExpiredError.is(err)) {
|
|
96961
|
+
stepLogger2.info("Workflow run already completed, skipping step", {
|
|
96962
|
+
workflowRunId,
|
|
96963
|
+
stepId,
|
|
96964
|
+
message: err.message
|
|
96965
|
+
});
|
|
96966
|
+
return { type: "gone" };
|
|
96967
|
+
}
|
|
96968
|
+
throw err;
|
|
96969
|
+
}
|
|
96970
|
+
const inlineDelta = extractInlineDelta(completedResult, params.inlineDeltaSinceCursor !== void 0);
|
|
96971
|
+
span?.setAttributes({
|
|
96972
|
+
...StepStatus2("completed"),
|
|
96973
|
+
...StepResultType2(typeof result)
|
|
96974
|
+
});
|
|
96975
|
+
if (ops.length > 0) {
|
|
96976
|
+
stepLogger2.debug("Step has pending ops", {
|
|
96977
|
+
workflowRunId,
|
|
96978
|
+
stepName,
|
|
96979
|
+
opsCount: ops.length
|
|
96980
|
+
});
|
|
96981
|
+
}
|
|
96982
|
+
return { type: "completed", hasPendingOps: !opsSettled, inlineDelta };
|
|
96851
96983
|
});
|
|
96852
96984
|
}
|
|
96853
96985
|
__name(executeStep, "executeStep");
|
|
@@ -117072,10 +117204,10 @@ var Run = class _Run {
|
|
|
117072
117204
|
return this.getReadable();
|
|
117073
117205
|
}
|
|
117074
117206
|
};
|
|
117075
|
-
Run.prototype["wakeUp"] = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.
|
|
117076
|
-
Run.prototype["cancel"] = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.
|
|
117077
|
-
Run.prototype["getReadable"] = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.
|
|
117078
|
-
var __step_Run$exists = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.
|
|
117207
|
+
Run.prototype["wakeUp"] = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.25//Run#wakeUp");
|
|
117208
|
+
Run.prototype["cancel"] = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.25//Run#cancel");
|
|
117209
|
+
Run.prototype["getReadable"] = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.25//Run#getReadable");
|
|
117210
|
+
var __step_Run$exists = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.25//Run#exists");
|
|
117079
117211
|
Object.defineProperty(Run.prototype, "exists", {
|
|
117080
117212
|
get() {
|
|
117081
117213
|
return __step_Run$exists.call(this);
|
|
@@ -117083,7 +117215,7 @@ Object.defineProperty(Run.prototype, "exists", {
|
|
|
117083
117215
|
configurable: true,
|
|
117084
117216
|
enumerable: false
|
|
117085
117217
|
});
|
|
117086
|
-
var __step_Run$status = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.
|
|
117218
|
+
var __step_Run$status = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.25//Run#status");
|
|
117087
117219
|
Object.defineProperty(Run.prototype, "status", {
|
|
117088
117220
|
get() {
|
|
117089
117221
|
return __step_Run$status.call(this);
|
|
@@ -117091,7 +117223,7 @@ Object.defineProperty(Run.prototype, "status", {
|
|
|
117091
117223
|
configurable: true,
|
|
117092
117224
|
enumerable: false
|
|
117093
117225
|
});
|
|
117094
|
-
var __step_Run$returnValue = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.
|
|
117226
|
+
var __step_Run$returnValue = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.25//Run#returnValue");
|
|
117095
117227
|
Object.defineProperty(Run.prototype, "returnValue", {
|
|
117096
117228
|
get() {
|
|
117097
117229
|
return __step_Run$returnValue.call(this);
|
|
@@ -117099,7 +117231,7 @@ Object.defineProperty(Run.prototype, "returnValue", {
|
|
|
117099
117231
|
configurable: true,
|
|
117100
117232
|
enumerable: false
|
|
117101
117233
|
});
|
|
117102
|
-
var __step_Run$workflowName = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.
|
|
117234
|
+
var __step_Run$workflowName = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.25//Run#workflowName");
|
|
117103
117235
|
Object.defineProperty(Run.prototype, "workflowName", {
|
|
117104
117236
|
get() {
|
|
117105
117237
|
return __step_Run$workflowName.call(this);
|
|
@@ -117107,7 +117239,7 @@ Object.defineProperty(Run.prototype, "workflowName", {
|
|
|
117107
117239
|
configurable: true,
|
|
117108
117240
|
enumerable: false
|
|
117109
117241
|
});
|
|
117110
|
-
var __step_Run$createdAt = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.
|
|
117242
|
+
var __step_Run$createdAt = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.25//Run#createdAt");
|
|
117111
117243
|
Object.defineProperty(Run.prototype, "createdAt", {
|
|
117112
117244
|
get() {
|
|
117113
117245
|
return __step_Run$createdAt.call(this);
|
|
@@ -117115,7 +117247,7 @@ Object.defineProperty(Run.prototype, "createdAt", {
|
|
|
117115
117247
|
configurable: true,
|
|
117116
117248
|
enumerable: false
|
|
117117
117249
|
});
|
|
117118
|
-
var __step_Run$startedAt = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.
|
|
117250
|
+
var __step_Run$startedAt = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.25//Run#startedAt");
|
|
117119
117251
|
Object.defineProperty(Run.prototype, "startedAt", {
|
|
117120
117252
|
get() {
|
|
117121
117253
|
return __step_Run$startedAt.call(this);
|
|
@@ -117123,7 +117255,7 @@ Object.defineProperty(Run.prototype, "startedAt", {
|
|
|
117123
117255
|
configurable: true,
|
|
117124
117256
|
enumerable: false
|
|
117125
117257
|
});
|
|
117126
|
-
var __step_Run$completedAt = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.
|
|
117258
|
+
var __step_Run$completedAt = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.25//Run#completedAt");
|
|
117127
117259
|
Object.defineProperty(Run.prototype, "completedAt", {
|
|
117128
117260
|
get() {
|
|
117129
117261
|
return __step_Run$completedAt.call(this);
|
|
@@ -117140,7 +117272,7 @@ Object.defineProperty(Run.prototype, "completedAt", {
|
|
|
117140
117272
|
enumerable: false,
|
|
117141
117273
|
configurable: false
|
|
117142
117274
|
});
|
|
117143
|
-
})(Run, "class//@workflow/core/runtime/run@5.0.0-beta.
|
|
117275
|
+
})(Run, "class//@workflow/core/runtime/run@5.0.0-beta.25//Run");
|
|
117144
117276
|
|
|
117145
117277
|
// ../core/dist/workflow/create-hook.js
|
|
117146
117278
|
aliasSerializationClass(RUN_CLASS_ID, Run);
|