@workflow/world-testing 4.1.22 → 4.1.23

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.
@@ -33710,9 +33710,9 @@ var require_redirect = __commonJS({
33710
33710
  var require_response_error = __commonJS({
33711
33711
  "../../node_modules/.pnpm/undici@7.28.0/node_modules/undici/lib/interceptor/response-error.js"(exports2, module2) {
33712
33712
  "use strict";
33713
- var DecoratorHandler = require_decorator_handler();
33713
+ var DecoratorHandler2 = require_decorator_handler();
33714
33714
  var { ResponseError } = require_errors();
33715
- var ResponseErrorHandler = class extends DecoratorHandler {
33715
+ var ResponseErrorHandler = class extends DecoratorHandler2 {
33716
33716
  static {
33717
33717
  __name(this, "ResponseErrorHandler");
33718
33718
  }
@@ -33820,8 +33820,8 @@ var require_dump = __commonJS({
33820
33820
  "../../node_modules/.pnpm/undici@7.28.0/node_modules/undici/lib/interceptor/dump.js"(exports2, module2) {
33821
33821
  "use strict";
33822
33822
  var { InvalidArgumentError, RequestAbortedError } = require_errors();
33823
- var DecoratorHandler = require_decorator_handler();
33824
- var DumpHandler = class extends DecoratorHandler {
33823
+ var DecoratorHandler2 = require_decorator_handler();
33824
+ var DumpHandler = class extends DecoratorHandler2 {
33825
33825
  static {
33826
33826
  __name(this, "DumpHandler");
33827
33827
  }
@@ -33911,7 +33911,7 @@ var require_dns = __commonJS({
33911
33911
  "use strict";
33912
33912
  var { isIP } = require("node:net");
33913
33913
  var { lookup } = require("node:dns");
33914
- var DecoratorHandler = require_decorator_handler();
33914
+ var DecoratorHandler2 = require_decorator_handler();
33915
33915
  var { InvalidArgumentError, InformationalError } = require_errors();
33916
33916
  var maxInt = Math.pow(2, 31) - 1;
33917
33917
  function hasSafeIterator(headers) {
@@ -34220,7 +34220,7 @@ var require_dns = __commonJS({
34220
34220
  return new DNSDispatchHandler(this, meta3, opts);
34221
34221
  }
34222
34222
  };
34223
- var DNSDispatchHandler = class extends DecoratorHandler {
34223
+ var DNSDispatchHandler = class extends DecoratorHandler2 {
34224
34224
  static {
34225
34225
  __name(this, "DNSDispatchHandler");
34226
34226
  }
@@ -36150,7 +36150,7 @@ var require_decompress = __commonJS({
36150
36150
  "use strict";
36151
36151
  var { createInflate, createGunzip, createBrotliDecompress, createZstdDecompress } = require("node:zlib");
36152
36152
  var { pipeline } = require("node:stream");
36153
- var DecoratorHandler = require_decorator_handler();
36153
+ var DecoratorHandler2 = require_decorator_handler();
36154
36154
  var { runtimeFeatures } = require_runtime_features();
36155
36155
  var supportedEncodings = {
36156
36156
  gzip: createGunzip,
@@ -36169,7 +36169,7 @@ var require_decompress = __commonJS({
36169
36169
  /** @type {boolean} */
36170
36170
  false
36171
36171
  );
36172
- var DecompressHandler = class extends DecoratorHandler {
36172
+ var DecompressHandler = class extends DecoratorHandler2 {
36173
36173
  static {
36174
36174
  __name(this, "DecompressHandler");
36175
36175
  }
@@ -44146,7 +44146,7 @@ var require_undici = __commonJS({
44146
44146
  var mockErrors = require_mock_errors();
44147
44147
  var RetryHandler = require_retry_handler();
44148
44148
  var { getGlobalDispatcher, setGlobalDispatcher } = require_global2();
44149
- var DecoratorHandler = require_decorator_handler();
44149
+ var DecoratorHandler2 = require_decorator_handler();
44150
44150
  var RedirectHandler = require_redirect_handler();
44151
44151
  Object.assign(Dispatcher.prototype, api);
44152
44152
  module2.exports.Dispatcher = Dispatcher;
@@ -44161,7 +44161,7 @@ var require_undici = __commonJS({
44161
44161
  module2.exports.RetryAgent = RetryAgent2;
44162
44162
  module2.exports.H2CClient = H2CClient;
44163
44163
  module2.exports.RetryHandler = RetryHandler;
44164
- module2.exports.DecoratorHandler = DecoratorHandler;
44164
+ module2.exports.DecoratorHandler = DecoratorHandler2;
44165
44165
  module2.exports.RedirectHandler = RedirectHandler;
44166
44166
  module2.exports.interceptors = {
44167
44167
  redirect: require_redirect(),
@@ -50526,7 +50526,7 @@ init_dist();
50526
50526
  init_node();
50527
50527
 
50528
50528
  // ../core/dist/version.js
50529
- var version2 = "4.8.7";
50529
+ var version2 = "4.8.8";
50530
50530
 
50531
50531
  // ../core/dist/runtime/world.js
50532
50532
  var import_node_module = require("node:module");
@@ -53893,6 +53893,7 @@ init_zod();
53893
53893
  init_dist();
53894
53894
  var import_undici2 = __toESM(require_undici(), 1);
53895
53895
  var _dispatcher;
53896
+ var _queueDispatcher;
53896
53897
  var _streamDispatcher;
53897
53898
  var _streamCloseDispatcher;
53898
53899
  var _nodeHttpAgents;
@@ -53947,6 +53948,61 @@ function getAgentOptions() {
53947
53948
  };
53948
53949
  }
53949
53950
  __name(getAgentOptions, "getAgentOptions");
53951
+ var QUEUE_AGENT_CONNECTIONS = 64;
53952
+ var QUEUE_REQUEST_TIMEOUT_MS = 3e4;
53953
+ var getQueueRequestTimeoutMs = /* @__PURE__ */ __name(() => envNumber("WORKFLOW_VERCEL_QUEUE_TIMEOUT_MS", QUEUE_REQUEST_TIMEOUT_MS, {
53954
+ integer: true,
53955
+ min: 5e3,
53956
+ max: 12e4
53957
+ }), "getQueueRequestTimeoutMs");
53958
+ function getQueueAgentOptions() {
53959
+ const timeoutMs = getQueueRequestTimeoutMs();
53960
+ return {
53961
+ ...getAgentOptions(),
53962
+ connections: envNumber("WORKFLOW_VERCEL_QUEUE_CONNECTIONS", QUEUE_AGENT_CONNECTIONS, { integer: true, min: 1, max: 1024 }),
53963
+ headersTimeout: timeoutMs,
53964
+ bodyTimeout: timeoutMs
53965
+ };
53966
+ }
53967
+ __name(getQueueAgentOptions, "getQueueAgentOptions");
53968
+ var ForwardingHandler = import_undici2.DecoratorHandler;
53969
+ function deadlineInterceptor(timeoutMs) {
53970
+ class DeadlineHandler extends ForwardingHandler {
53971
+ static {
53972
+ __name(this, "DeadlineHandler");
53973
+ }
53974
+ #expired = false;
53975
+ #controller;
53976
+ #timer;
53977
+ constructor(handler) {
53978
+ super(handler);
53979
+ this.#timer = setTimeout(() => {
53980
+ this.#expired = true;
53981
+ this.#abort();
53982
+ }, timeoutMs);
53983
+ this.#timer.unref?.();
53984
+ }
53985
+ #abort() {
53986
+ this.#controller?.abort(new Error(`Queue request exceeded its ${timeoutMs}ms deadline`));
53987
+ }
53988
+ onRequestStart(controller, context2) {
53989
+ this.#controller = controller;
53990
+ super.onRequestStart(controller, context2);
53991
+ if (this.#expired)
53992
+ this.#abort();
53993
+ }
53994
+ onResponseEnd(controller, trailers) {
53995
+ clearTimeout(this.#timer);
53996
+ super.onResponseEnd(controller, trailers);
53997
+ }
53998
+ onResponseError(controller, error48) {
53999
+ clearTimeout(this.#timer);
54000
+ super.onResponseError(controller, error48);
54001
+ }
54002
+ }
54003
+ return (dispatch) => (opts, handler) => dispatch(opts, new DeadlineHandler(handler));
54004
+ }
54005
+ __name(deadlineInterceptor, "deadlineInterceptor");
53950
54006
  function getEventsAgentOptions() {
53951
54007
  return {
53952
54008
  ...getBaseAgentOptions(),
@@ -54137,7 +54193,7 @@ function getDispatcher(config3) {
54137
54193
  }
54138
54194
  __name(getDispatcher, "getDispatcher");
54139
54195
  function getQueueDispatcher(config3) {
54140
- return config3?.dispatcher ?? getDefaultDispatcher();
54196
+ return resolveDispatcher(config3, getDefaultQueueDispatcher);
54141
54197
  }
54142
54198
  __name(getQueueDispatcher, "getQueueDispatcher");
54143
54199
  function getEventsDispatcher(config3) {
@@ -54174,6 +54230,15 @@ function createStreamDispatcher(retryOptions, agentOverrides) {
54174
54230
  return new import_undici2.RetryAgent(new import_undici2.Agent({ ...getStreamAgentOptions(), ...agentOverrides }), retryOptions);
54175
54231
  }
54176
54232
  __name(createStreamDispatcher, "createStreamDispatcher");
54233
+ function createQueueDispatcher() {
54234
+ return new import_undici2.RetryAgent(new import_undici2.Agent(getQueueAgentOptions()).compose(deadlineInterceptor(getQueueRequestTimeoutMs())), getRetryAgentOptions());
54235
+ }
54236
+ __name(createQueueDispatcher, "createQueueDispatcher");
54237
+ function getDefaultQueueDispatcher() {
54238
+ _queueDispatcher ??= createQueueDispatcher();
54239
+ return _queueDispatcher;
54240
+ }
54241
+ __name(getDefaultQueueDispatcher, "getDefaultQueueDispatcher");
54177
54242
  function getDefaultDispatcher() {
54178
54243
  _dispatcher ??= new import_undici2.RetryAgent(new import_undici2.Agent(getAgentOptions()), getRetryAgentOptions());
54179
54244
  return _dispatcher;
@@ -61638,7 +61703,7 @@ var import_oidc3 = __toESM(require_dist(), 1);
61638
61703
  init_dist();
61639
61704
 
61640
61705
  // ../world-vercel/dist/version.js
61641
- var version3 = "4.7.3";
61706
+ var version3 = "4.7.4";
61642
61707
 
61643
61708
  // ../world-vercel/dist/utils.js
61644
61709
  var WORKFLOW_SERVER_URL_OVERRIDE = "";
@@ -1,6 +1,14 @@
1
1
  {
2
2
  "version": "1.0.0",
3
3
  "steps": {
4
+ "workflows/retriable-and-fatal.ts": {
5
+ "stepThatFails": {
6
+ "stepId": "step//./workflows/retriable-and-fatal//stepThatFails"
7
+ },
8
+ "stepThatThrowsRetryableError": {
9
+ "stepId": "step//./workflows/retriable-and-fatal//stepThatThrowsRetryableError"
10
+ }
11
+ },
4
12
  "workflows/hooks.ts": {
5
13
  "writeEvent": {
6
14
  "stepId": "step//./workflows/hooks//writeEvent"
@@ -11,14 +19,6 @@
11
19
  "stepId": "step//./workflows/addition//add"
12
20
  }
13
21
  },
14
- "workflows/retriable-and-fatal.ts": {
15
- "stepThatFails": {
16
- "stepId": "step//./workflows/retriable-and-fatal//stepThatFails"
17
- },
18
- "stepThatThrowsRetryableError": {
19
- "stepId": "step//./workflows/retriable-and-fatal//stepThatThrowsRetryableError"
20
- }
21
- },
22
22
  "workflows/event-limit.ts": {
23
23
  "tick": {
24
24
  "stepId": "step//./workflows/event-limit//tick"
@@ -29,16 +29,6 @@
29
29
  "stepId": "step//./workflows/noop//noop"
30
30
  }
31
31
  },
32
- "workflows/null-byte.ts": {
33
- "nullByteStep": {
34
- "stepId": "step//./workflows/null-byte//nullByteStep"
35
- }
36
- },
37
- "workflow/dist/stdlib.js": {
38
- "fetch": {
39
- "stepId": "step//workflow@4.8.7//fetch"
40
- }
41
- },
42
32
  "workflow/dist/internal/builtins.js": {
43
33
  "__builtin_response_array_buffer": {
44
34
  "stepId": "__builtin_response_array_buffer"
@@ -49,19 +39,29 @@
49
39
  "__builtin_response_text": {
50
40
  "stepId": "__builtin_response_text"
51
41
  }
42
+ },
43
+ "workflows/null-byte.ts": {
44
+ "nullByteStep": {
45
+ "stepId": "step//./workflows/null-byte//nullByteStep"
46
+ }
47
+ },
48
+ "workflow/dist/stdlib.js": {
49
+ "fetch": {
50
+ "stepId": "step//workflow@4.8.8//fetch"
51
+ }
52
52
  }
53
53
  },
54
54
  "workflows": {
55
- "workflows/hooks.ts": {
56
- "collectWithHook": {
57
- "workflowId": "workflow//./workflows/hooks//collectWithHook",
55
+ "workflows/retriable-and-fatal.ts": {
56
+ "retryableAndFatalErrorWorkflow": {
57
+ "workflowId": "workflow//./workflows/retriable-and-fatal//retryableAndFatalErrorWorkflow",
58
58
  "graph": {
59
59
  "nodes": [
60
60
  {
61
61
  "id": "start",
62
62
  "type": "workflowStart",
63
63
  "data": {
64
- "label": "Start: collectWithHook",
64
+ "label": "Start: retryableAndFatalErrorWorkflow",
65
65
  "nodeKind": "workflow_start"
66
66
  }
67
67
  },
@@ -69,22 +69,9 @@
69
69
  "id": "node_0",
70
70
  "type": "step",
71
71
  "data": {
72
- "label": "writeEvent",
73
- "nodeKind": "step",
74
- "stepId": "step//./workflows/hooks//writeEvent"
75
- }
76
- },
77
- {
78
- "id": "node_1",
79
- "type": "step",
80
- "data": {
81
- "label": "writeEvent",
72
+ "label": "stepThatThrowsRetryableError",
82
73
  "nodeKind": "step",
83
- "stepId": "step//./workflows/hooks//writeEvent"
84
- },
85
- "metadata": {
86
- "loopId": "loop_0",
87
- "loopIsAwait": true
74
+ "stepId": "step//./workflows/retriable-and-fatal//stepThatThrowsRetryableError"
88
75
  }
89
76
  },
90
77
  {
@@ -104,20 +91,8 @@
104
91
  "type": "default"
105
92
  },
106
93
  {
107
- "id": "e_node_1_back_node_1",
108
- "source": "node_1",
109
- "target": "node_1",
110
- "type": "loop"
111
- },
112
- {
113
- "id": "e_node_0_node_1",
94
+ "id": "e_node_0_end",
114
95
  "source": "node_0",
115
- "target": "node_1",
116
- "type": "default"
117
- },
118
- {
119
- "id": "e_node_1_end",
120
- "source": "node_1",
121
96
  "target": "end",
122
97
  "type": "default"
123
98
  }
@@ -125,16 +100,16 @@
125
100
  }
126
101
  }
127
102
  },
128
- "workflows/addition.ts": {
129
- "addition": {
130
- "workflowId": "workflow//./workflows/addition//addition",
103
+ "workflows/hooks.ts": {
104
+ "collectWithHook": {
105
+ "workflowId": "workflow//./workflows/hooks//collectWithHook",
131
106
  "graph": {
132
107
  "nodes": [
133
108
  {
134
109
  "id": "start",
135
110
  "type": "workflowStart",
136
111
  "data": {
137
- "label": "Start: addition",
112
+ "label": "Start: collectWithHook",
138
113
  "nodeKind": "workflow_start"
139
114
  }
140
115
  },
@@ -142,9 +117,22 @@
142
117
  "id": "node_0",
143
118
  "type": "step",
144
119
  "data": {
145
- "label": "add",
120
+ "label": "writeEvent",
146
121
  "nodeKind": "step",
147
- "stepId": "step//./workflows/addition//add"
122
+ "stepId": "step//./workflows/hooks//writeEvent"
123
+ }
124
+ },
125
+ {
126
+ "id": "node_1",
127
+ "type": "step",
128
+ "data": {
129
+ "label": "writeEvent",
130
+ "nodeKind": "step",
131
+ "stepId": "step//./workflows/hooks//writeEvent"
132
+ },
133
+ "metadata": {
134
+ "loopId": "loop_0",
135
+ "loopIsAwait": true
148
136
  }
149
137
  },
150
138
  {
@@ -164,8 +152,20 @@
164
152
  "type": "default"
165
153
  },
166
154
  {
167
- "id": "e_node_0_end",
155
+ "id": "e_node_1_back_node_1",
156
+ "source": "node_1",
157
+ "target": "node_1",
158
+ "type": "loop"
159
+ },
160
+ {
161
+ "id": "e_node_0_node_1",
168
162
  "source": "node_0",
163
+ "target": "node_1",
164
+ "type": "default"
165
+ },
166
+ {
167
+ "id": "e_node_1_end",
168
+ "source": "node_1",
169
169
  "target": "end",
170
170
  "type": "default"
171
171
  }
@@ -173,16 +173,16 @@
173
173
  }
174
174
  }
175
175
  },
176
- "workflows/retriable-and-fatal.ts": {
177
- "retryableAndFatalErrorWorkflow": {
178
- "workflowId": "workflow//./workflows/retriable-and-fatal//retryableAndFatalErrorWorkflow",
176
+ "workflows/addition.ts": {
177
+ "addition": {
178
+ "workflowId": "workflow//./workflows/addition//addition",
179
179
  "graph": {
180
180
  "nodes": [
181
181
  {
182
182
  "id": "start",
183
183
  "type": "workflowStart",
184
184
  "data": {
185
- "label": "Start: retryableAndFatalErrorWorkflow",
185
+ "label": "Start: addition",
186
186
  "nodeKind": "workflow_start"
187
187
  }
188
188
  },
@@ -190,9 +190,9 @@
190
190
  "id": "node_0",
191
191
  "type": "step",
192
192
  "data": {
193
- "label": "stepThatThrowsRetryableError",
193
+ "label": "add",
194
194
  "nodeKind": "step",
195
- "stepId": "step//./workflows/retriable-and-fatal//stepThatThrowsRetryableError"
195
+ "stepId": "step//./workflows/addition//add"
196
196
  }
197
197
  },
198
198
  {