@workflow/world-testing 5.0.0-beta.20 → 5.0.0-beta.22

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.
@@ -9,9 +9,9 @@
9
9
  "stepId": "step//./workflows/retriable-and-fatal//stepThatThrowsRetryableError"
10
10
  }
11
11
  },
12
- "workflows/noop.ts": {
13
- "noop": {
14
- "stepId": "step//./workflows/noop//noop"
12
+ "workflows/hooks.ts": {
13
+ "writeEvent": {
14
+ "stepId": "step//./workflows/hooks//writeEvent"
15
15
  }
16
16
  },
17
17
  "workflows/null-byte.ts": {
@@ -19,11 +19,6 @@
19
19
  "stepId": "step//./workflows/null-byte//nullByteStep"
20
20
  }
21
21
  },
22
- "workflows/hooks.ts": {
23
- "writeEvent": {
24
- "stepId": "step//./workflows/hooks//writeEvent"
25
- }
26
- },
27
22
  "workflows/inline-execution.ts": {
28
23
  "add": {
29
24
  "stepId": "step//./workflows/inline-execution//add"
@@ -35,9 +30,9 @@
35
30
  "stepId": "step//./workflows/inline-execution//writeToStream"
36
31
  }
37
32
  },
38
- "workflows/addition.ts": {
39
- "add": {
40
- "stepId": "step//./workflows/addition//add"
33
+ "workflows/noop.ts": {
34
+ "noop": {
35
+ "stepId": "step//./workflows/noop//noop"
41
36
  }
42
37
  },
43
38
  "workflow/dist/stdlib.js": {
@@ -59,41 +54,46 @@
59
54
  "stepId": "__builtin_set_attributes"
60
55
  }
61
56
  },
57
+ "workflows/addition.ts": {
58
+ "add": {
59
+ "stepId": "step//./workflows/addition//add"
60
+ }
61
+ },
62
62
  "core/dist/runtime/start.js": {
63
63
  "start": {
64
- "stepId": "step//@workflow/core/runtime/start@5.0.0-beta.20//start"
64
+ "stepId": "step//@workflow/core/runtime/start@5.0.0-beta.22//start"
65
65
  }
66
66
  },
67
67
  "core/dist/runtime/run.js": {
68
68
  "Run#cancel": {
69
- "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#cancel"
69
+ "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#cancel"
70
70
  },
71
71
  "Run#completedAt": {
72
- "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#completedAt"
72
+ "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#completedAt"
73
73
  },
74
74
  "Run#createdAt": {
75
- "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#createdAt"
75
+ "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#createdAt"
76
76
  },
77
77
  "Run#exists": {
78
- "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#exists"
78
+ "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#exists"
79
79
  },
80
80
  "Run#getReadable": {
81
- "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#getReadable"
81
+ "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#getReadable"
82
82
  },
83
83
  "Run#returnValue": {
84
- "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#returnValue"
84
+ "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#returnValue"
85
85
  },
86
86
  "Run#startedAt": {
87
- "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#startedAt"
87
+ "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#startedAt"
88
88
  },
89
89
  "Run#status": {
90
- "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#status"
90
+ "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#status"
91
91
  },
92
92
  "Run#wakeUp": {
93
- "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#wakeUp"
93
+ "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#wakeUp"
94
94
  },
95
95
  "Run#workflowName": {
96
- "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#workflowName"
96
+ "stepId": "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#workflowName"
97
97
  }
98
98
  }
99
99
  },
@@ -131,16 +131,16 @@
131
131
  }
132
132
  }
133
133
  },
134
- "workflows/noop.ts": {
135
- "brokenWf": {
136
- "workflowId": "workflow//./workflows/noop//brokenWf",
134
+ "workflows/hooks.ts": {
135
+ "collectWithHook": {
136
+ "workflowId": "workflow//./workflows/hooks//collectWithHook",
137
137
  "graph": {
138
138
  "nodes": [
139
139
  {
140
140
  "id": "start",
141
141
  "type": "workflowStart",
142
142
  "data": {
143
- "label": "Start: brokenWf",
143
+ "label": "Start: collectWithHook",
144
144
  "nodeKind": "workflow_start"
145
145
  }
146
146
  },
@@ -197,39 +197,6 @@
197
197
  }
198
198
  }
199
199
  },
200
- "workflows/hooks.ts": {
201
- "collectWithHook": {
202
- "workflowId": "workflow//./workflows/hooks//collectWithHook",
203
- "graph": {
204
- "nodes": [
205
- {
206
- "id": "start",
207
- "type": "workflowStart",
208
- "data": {
209
- "label": "Start: collectWithHook",
210
- "nodeKind": "workflow_start"
211
- }
212
- },
213
- {
214
- "id": "end",
215
- "type": "workflowEnd",
216
- "data": {
217
- "label": "Return",
218
- "nodeKind": "workflow_end"
219
- }
220
- }
221
- ],
222
- "edges": [
223
- {
224
- "id": "e_start_end",
225
- "source": "start",
226
- "target": "end",
227
- "type": "default"
228
- }
229
- ]
230
- }
231
- }
232
- },
233
200
  "workflows/inline-execution.ts": {
234
201
  "hookWorkflow": {
235
202
  "workflowId": "workflow//./workflows/inline-execution//hookWorkflow",
@@ -432,6 +399,39 @@
432
399
  }
433
400
  }
434
401
  },
402
+ "workflows/noop.ts": {
403
+ "brokenWf": {
404
+ "workflowId": "workflow//./workflows/noop//brokenWf",
405
+ "graph": {
406
+ "nodes": [
407
+ {
408
+ "id": "start",
409
+ "type": "workflowStart",
410
+ "data": {
411
+ "label": "Start: brokenWf",
412
+ "nodeKind": "workflow_start"
413
+ }
414
+ },
415
+ {
416
+ "id": "end",
417
+ "type": "workflowEnd",
418
+ "data": {
419
+ "label": "Return",
420
+ "nodeKind": "workflow_end"
421
+ }
422
+ }
423
+ ],
424
+ "edges": [
425
+ {
426
+ "id": "e_start_end",
427
+ "source": "start",
428
+ "target": "end",
429
+ "type": "default"
430
+ }
431
+ ]
432
+ }
433
+ }
434
+ },
435
435
  "workflows/addition.ts": {
436
436
  "addTenWorkflow": {
437
437
  "workflowId": "workflow//./workflows/addition//addTenWorkflow",
@@ -500,7 +500,7 @@
500
500
  "classes": {
501
501
  "core/dist/runtime/run.js": {
502
502
  "Run": {
503
- "classId": "class//@workflow/core/runtime/run@5.0.0-beta.20//Run"
503
+ "classId": "class//@workflow/core/runtime/run@5.0.0-beta.22//Run"
504
504
  }
505
505
  }
506
506
  }
@@ -16698,6 +16698,7 @@ var init_events = __esm({
16698
16698
  runId: external_exports.string(),
16699
16699
  eventId: external_exports.string(),
16700
16700
  createdAt: external_exports.coerce.date(),
16701
+ occurredAt: external_exports.coerce.date().optional(),
16701
16702
  specVersion: external_exports.number().optional()
16702
16703
  }));
16703
16704
  }
@@ -23995,7 +23996,7 @@ var version2;
23995
23996
  var init_version = __esm({
23996
23997
  "../core/dist/version.js"() {
23997
23998
  "use strict";
23998
- version2 = "5.0.0-beta.20";
23999
+ version2 = "5.0.0-beta.22";
23999
24000
  }
24000
24001
  });
24001
24002
 
@@ -25722,14 +25723,6 @@ function createReconnectingFramedStream(runId, name, startIndex) {
25722
25723
  }
25723
25724
  __name(connect, "connect");
25724
25725
  async function reconnect() {
25725
- reconnectCount++;
25726
- totalReconnectCount++;
25727
- if (reconnectCount > FRAMED_STREAM_MAX_RECONNECTS) {
25728
- throw new Error(`Stream "${name}" exceeded maximum reconnection attempts (${FRAMED_STREAM_MAX_RECONNECTS})`);
25729
- }
25730
- if (totalReconnectCount > FRAMED_STREAM_MAX_TOTAL_RECONNECTS) {
25731
- throw new Error(`Stream "${name}" exceeded maximum total reconnection attempts (${FRAMED_STREAM_MAX_TOTAL_RECONNECTS})`);
25732
- }
25733
25726
  if (reader) {
25734
25727
  await reader.cancel().catch(() => {
25735
25728
  });
@@ -25738,7 +25731,21 @@ function createReconnectingFramedStream(runId, name, startIndex) {
25738
25731
  currentStartIndex += consumedFrames;
25739
25732
  consumedFrames = 0;
25740
25733
  buffer2 = new Uint8Array(0);
25741
- await connect();
25734
+ for (; ; ) {
25735
+ reconnectCount++;
25736
+ totalReconnectCount++;
25737
+ if (reconnectCount > FRAMED_STREAM_MAX_RECONNECTS) {
25738
+ throw new Error(`Stream "${name}" exceeded maximum reconnection attempts (${FRAMED_STREAM_MAX_RECONNECTS})`);
25739
+ }
25740
+ if (totalReconnectCount > FRAMED_STREAM_MAX_TOTAL_RECONNECTS) {
25741
+ throw new Error(`Stream "${name}" exceeded maximum total reconnection attempts (${FRAMED_STREAM_MAX_TOTAL_RECONNECTS})`);
25742
+ }
25743
+ try {
25744
+ await connect();
25745
+ return;
25746
+ } catch {
25747
+ }
25748
+ }
25742
25749
  }
25743
25750
  __name(reconnect, "reconnect");
25744
25751
  return new ReadableStream({
@@ -26190,7 +26197,7 @@ function reviveAbortController(value, ops, runId) {
26190
26197
  }
26191
26198
  })());
26192
26199
  if (value.hookToken) {
26193
- ctx.ops.push((async () => {
26200
+ const hookResume = (async () => {
26194
26201
  try {
26195
26202
  const { resumeHook: resumeHookFn } = await Promise.resolve().then(() => (init_resume_hook(), resume_hook_exports));
26196
26203
  await resumeHookFn(value.hookToken, {
@@ -26199,7 +26206,8 @@ function reviveAbortController(value, ops, runId) {
26199
26206
  });
26200
26207
  } catch {
26201
26208
  }
26202
- })());
26209
+ })();
26210
+ ctx.preCompletionOps.push(hookResume);
26203
26211
  }
26204
26212
  }
26205
26213
  };
@@ -27171,7 +27179,7 @@ __name(start, "start");
27171
27179
  value: "start",
27172
27180
  configurable: true
27173
27181
  });
27174
- })(start, "step//@workflow/core/runtime/start@5.0.0-beta.20//start");
27182
+ })(start, "step//@workflow/core/runtime/start@5.0.0-beta.22//start");
27175
27183
  function isRetryableStartError(err) {
27176
27184
  if (ThrottleError.is(err)) return true;
27177
27185
  if (WorkflowWorldError.is(err) && err.status && err.status >= 500) return true;
@@ -27504,7 +27512,7 @@ var Run = class _Run {
27504
27512
  value: "wakeUp",
27505
27513
  configurable: true
27506
27514
  });
27507
- })(Run.prototype["wakeUp"], "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#wakeUp");
27515
+ })(Run.prototype["wakeUp"], "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#wakeUp");
27508
27516
  (function(__wf_fn, __wf_id) {
27509
27517
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27510
27518
  __wf_reg.set(__wf_id, __wf_fn);
@@ -27513,7 +27521,7 @@ var Run = class _Run {
27513
27521
  value: "cancel",
27514
27522
  configurable: true
27515
27523
  });
27516
- })(Run.prototype["cancel"], "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#cancel");
27524
+ })(Run.prototype["cancel"], "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#cancel");
27517
27525
  (function(__wf_fn, __wf_id) {
27518
27526
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27519
27527
  __wf_reg.set(__wf_id, __wf_fn);
@@ -27522,7 +27530,7 @@ var Run = class _Run {
27522
27530
  value: "getReadable",
27523
27531
  configurable: true
27524
27532
  });
27525
- })(Run.prototype["getReadable"], "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#getReadable");
27533
+ })(Run.prototype["getReadable"], "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#getReadable");
27526
27534
  (function(__wf_fn, __wf_id) {
27527
27535
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27528
27536
  __wf_reg.set(__wf_id, __wf_fn);
@@ -27531,7 +27539,7 @@ var Run = class _Run {
27531
27539
  value: "exists",
27532
27540
  configurable: true
27533
27541
  });
27534
- })(Object.getOwnPropertyDescriptor(Run.prototype, "exists").get, "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#exists");
27542
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "exists").get, "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#exists");
27535
27543
  (function(__wf_fn, __wf_id) {
27536
27544
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27537
27545
  __wf_reg.set(__wf_id, __wf_fn);
@@ -27540,7 +27548,7 @@ var Run = class _Run {
27540
27548
  value: "status",
27541
27549
  configurable: true
27542
27550
  });
27543
- })(Object.getOwnPropertyDescriptor(Run.prototype, "status").get, "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#status");
27551
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "status").get, "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#status");
27544
27552
  (function(__wf_fn, __wf_id) {
27545
27553
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27546
27554
  __wf_reg.set(__wf_id, __wf_fn);
@@ -27549,7 +27557,7 @@ var Run = class _Run {
27549
27557
  value: "returnValue",
27550
27558
  configurable: true
27551
27559
  });
27552
- })(Object.getOwnPropertyDescriptor(Run.prototype, "returnValue").get, "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#returnValue");
27560
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "returnValue").get, "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#returnValue");
27553
27561
  (function(__wf_fn, __wf_id) {
27554
27562
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27555
27563
  __wf_reg.set(__wf_id, __wf_fn);
@@ -27558,7 +27566,7 @@ var Run = class _Run {
27558
27566
  value: "workflowName",
27559
27567
  configurable: true
27560
27568
  });
27561
- })(Object.getOwnPropertyDescriptor(Run.prototype, "workflowName").get, "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#workflowName");
27569
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "workflowName").get, "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#workflowName");
27562
27570
  (function(__wf_fn, __wf_id) {
27563
27571
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27564
27572
  __wf_reg.set(__wf_id, __wf_fn);
@@ -27567,7 +27575,7 @@ var Run = class _Run {
27567
27575
  value: "createdAt",
27568
27576
  configurable: true
27569
27577
  });
27570
- })(Object.getOwnPropertyDescriptor(Run.prototype, "createdAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#createdAt");
27578
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "createdAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#createdAt");
27571
27579
  (function(__wf_fn, __wf_id) {
27572
27580
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27573
27581
  __wf_reg.set(__wf_id, __wf_fn);
@@ -27576,7 +27584,7 @@ var Run = class _Run {
27576
27584
  value: "startedAt",
27577
27585
  configurable: true
27578
27586
  });
27579
- })(Object.getOwnPropertyDescriptor(Run.prototype, "startedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#startedAt");
27587
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "startedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#startedAt");
27580
27588
  (function(__wf_fn, __wf_id) {
27581
27589
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27582
27590
  __wf_reg.set(__wf_id, __wf_fn);
@@ -27585,7 +27593,7 @@ var Run = class _Run {
27585
27593
  value: "completedAt",
27586
27594
  configurable: true
27587
27595
  });
27588
- })(Object.getOwnPropertyDescriptor(Run.prototype, "completedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.20//Run#completedAt");
27596
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "completedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.22//Run#completedAt");
27589
27597
  (function(__wf_cls, __wf_id) {
27590
27598
  var __wf_sym = /* @__PURE__ */ Symbol.for("workflow-class-registry"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27591
27599
  __wf_reg.set(__wf_id, __wf_cls);
@@ -27595,7 +27603,7 @@ var Run = class _Run {
27595
27603
  enumerable: false,
27596
27604
  configurable: false
27597
27605
  });
27598
- })(Run, "class//@workflow/core/runtime/run@5.0.0-beta.20//Run");
27606
+ })(Run, "class//@workflow/core/runtime/run@5.0.0-beta.22//Run");
27599
27607
 
27600
27608
  // ../workflow/dist/stdlib.js
27601
27609
  async function fetch2(...args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workflow/world-testing",
3
- "version": "5.0.0-beta.20",
3
+ "version": "5.0.0-beta.22",
4
4
  "description": "Testing utilities and World implementation for Workflow SDK",
5
5
  "main": "dist/src/index.mjs",
6
6
  "files": [
@@ -21,10 +21,10 @@
21
21
  "hono": "4.12.25",
22
22
  "jsonlines": "0.1.1",
23
23
  "zod": "4.3.6",
24
- "@workflow/cli": "5.0.0-beta.20",
25
- "@workflow/core": "5.0.0-beta.20",
26
- "@workflow/world": "5.0.0-beta.12",
27
- "workflow": "5.0.0-beta.20"
24
+ "@workflow/cli": "5.0.0-beta.22",
25
+ "@workflow/core": "5.0.0-beta.22",
26
+ "@workflow/world": "5.0.0-beta.13",
27
+ "workflow": "5.0.0-beta.22"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/jsonlines": "0.1.5",