@workflow/world-testing 4.0.1-beta.42 → 4.0.1-beta.44

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.
@@ -1,11 +1,6 @@
1
1
  {
2
2
  "version": "1.0.0",
3
3
  "steps": {
4
- "workflows/null-byte.ts": {
5
- "nullByteStep": {
6
- "stepId": "step//workflows/null-byte.ts//nullByteStep"
7
- }
8
- },
9
4
  "workflow/dist/internal/builtins.js": {
10
5
  "__builtin_response_array_buffer": {
11
6
  "stepId": "__builtin_response_array_buffer"
@@ -17,9 +12,14 @@
17
12
  "stepId": "__builtin_response_text"
18
13
  }
19
14
  },
20
- "workflow/dist/stdlib.js": {
21
- "fetch": {
22
- "stepId": "step//workflow/dist/stdlib.js//fetch"
15
+ "workflows/hooks.ts": {
16
+ "writeEvent": {
17
+ "stepId": "step//workflows/hooks.ts//writeEvent"
18
+ }
19
+ },
20
+ "workflows/addition.ts": {
21
+ "add": {
22
+ "stepId": "step//workflows/addition.ts//add"
23
23
  }
24
24
  },
25
25
  "workflows/noop.ts": {
@@ -27,6 +27,16 @@
27
27
  "stepId": "step//workflows/noop.ts//noop"
28
28
  }
29
29
  },
30
+ "workflows/null-byte.ts": {
31
+ "nullByteStep": {
32
+ "stepId": "step//workflows/null-byte.ts//nullByteStep"
33
+ }
34
+ },
35
+ "workflow/dist/stdlib.js": {
36
+ "fetch": {
37
+ "stepId": "step//workflow/dist/stdlib.js//fetch"
38
+ }
39
+ },
30
40
  "workflows/retriable-and-fatal.ts": {
31
41
  "stepThatFails": {
32
42
  "stepId": "step//workflows/retriable-and-fatal.ts//stepThatFails"
@@ -34,29 +44,19 @@
34
44
  "stepThatThrowsRetryableError": {
35
45
  "stepId": "step//workflows/retriable-and-fatal.ts//stepThatThrowsRetryableError"
36
46
  }
37
- },
38
- "workflows/hooks.ts": {
39
- "writeEvent": {
40
- "stepId": "step//workflows/hooks.ts//writeEvent"
41
- }
42
- },
43
- "workflows/addition.ts": {
44
- "add": {
45
- "stepId": "step//workflows/addition.ts//add"
46
- }
47
47
  }
48
48
  },
49
49
  "workflows": {
50
- "workflows/null-byte.ts": {
51
- "nullByteWorkflow": {
52
- "workflowId": "workflow//workflows/null-byte.ts//nullByteWorkflow",
50
+ "workflows/hooks.ts": {
51
+ "collectWithHook": {
52
+ "workflowId": "workflow//workflows/hooks.ts//collectWithHook",
53
53
  "graph": {
54
54
  "nodes": [
55
55
  {
56
56
  "id": "start",
57
57
  "type": "workflowStart",
58
58
  "data": {
59
- "label": "Start: nullByteWorkflow",
59
+ "label": "Start: collectWithHook",
60
60
  "nodeKind": "workflow_start"
61
61
  }
62
62
  },
@@ -64,9 +64,22 @@
64
64
  "id": "node_0",
65
65
  "type": "step",
66
66
  "data": {
67
- "label": "nullByteStep",
67
+ "label": "writeEvent",
68
68
  "nodeKind": "step",
69
- "stepId": "step//workflows/null-byte.ts//nullByteStep"
69
+ "stepId": "step//workflows/hooks.ts//writeEvent"
70
+ }
71
+ },
72
+ {
73
+ "id": "node_1",
74
+ "type": "step",
75
+ "data": {
76
+ "label": "writeEvent",
77
+ "nodeKind": "step",
78
+ "stepId": "step//workflows/hooks.ts//writeEvent"
79
+ },
80
+ "metadata": {
81
+ "loopId": "loop_0",
82
+ "loopIsAwait": true
70
83
  }
71
84
  },
72
85
  {
@@ -86,8 +99,20 @@
86
99
  "type": "default"
87
100
  },
88
101
  {
89
- "id": "e_node_0_end",
102
+ "id": "e_node_1_back_node_1",
103
+ "source": "node_1",
104
+ "target": "node_1",
105
+ "type": "loop"
106
+ },
107
+ {
108
+ "id": "e_node_0_node_1",
90
109
  "source": "node_0",
110
+ "target": "node_1",
111
+ "type": "default"
112
+ },
113
+ {
114
+ "id": "e_node_1_end",
115
+ "source": "node_1",
91
116
  "target": "end",
92
117
  "type": "default"
93
118
  }
@@ -95,16 +120,16 @@
95
120
  }
96
121
  }
97
122
  },
98
- "workflows/noop.ts": {
99
- "brokenWf": {
100
- "workflowId": "workflow//workflows/noop.ts//brokenWf",
123
+ "workflows/addition.ts": {
124
+ "addition": {
125
+ "workflowId": "workflow//workflows/addition.ts//addition",
101
126
  "graph": {
102
127
  "nodes": [
103
128
  {
104
129
  "id": "start",
105
130
  "type": "workflowStart",
106
131
  "data": {
107
- "label": "Start: brokenWf",
132
+ "label": "Start: addition",
108
133
  "nodeKind": "workflow_start"
109
134
  }
110
135
  },
@@ -112,18 +137,9 @@
112
137
  "id": "node_0",
113
138
  "type": "step",
114
139
  "data": {
115
- "label": "noop",
116
- "nodeKind": "step",
117
- "stepId": "step//workflows/noop.ts//noop"
118
- }
119
- },
120
- {
121
- "id": "node_1",
122
- "type": "step",
123
- "data": {
124
- "label": "noop",
140
+ "label": "add",
125
141
  "nodeKind": "step",
126
- "stepId": "step//workflows/noop.ts//noop"
142
+ "stepId": "step//workflows/addition.ts//add"
127
143
  }
128
144
  },
129
145
  {
@@ -143,14 +159,8 @@
143
159
  "type": "default"
144
160
  },
145
161
  {
146
- "id": "e_node_0_node_1",
162
+ "id": "e_node_0_end",
147
163
  "source": "node_0",
148
- "target": "node_1",
149
- "type": "default"
150
- },
151
- {
152
- "id": "e_node_1_end",
153
- "source": "node_1",
154
164
  "target": "end",
155
165
  "type": "default"
156
166
  }
@@ -158,16 +168,16 @@
158
168
  }
159
169
  }
160
170
  },
161
- "workflows/retriable-and-fatal.ts": {
162
- "retryableAndFatalErrorWorkflow": {
163
- "workflowId": "workflow//workflows/retriable-and-fatal.ts//retryableAndFatalErrorWorkflow",
171
+ "workflows/noop.ts": {
172
+ "brokenWf": {
173
+ "workflowId": "workflow//workflows/noop.ts//brokenWf",
164
174
  "graph": {
165
175
  "nodes": [
166
176
  {
167
177
  "id": "start",
168
178
  "type": "workflowStart",
169
179
  "data": {
170
- "label": "Start: retryableAndFatalErrorWorkflow",
180
+ "label": "Start: brokenWf",
171
181
  "nodeKind": "workflow_start"
172
182
  }
173
183
  },
@@ -175,9 +185,18 @@
175
185
  "id": "node_0",
176
186
  "type": "step",
177
187
  "data": {
178
- "label": "stepThatThrowsRetryableError",
188
+ "label": "noop",
179
189
  "nodeKind": "step",
180
- "stepId": "step//workflows/retriable-and-fatal.ts//stepThatThrowsRetryableError"
190
+ "stepId": "step//workflows/noop.ts//noop"
191
+ }
192
+ },
193
+ {
194
+ "id": "node_1",
195
+ "type": "step",
196
+ "data": {
197
+ "label": "noop",
198
+ "nodeKind": "step",
199
+ "stepId": "step//workflows/noop.ts//noop"
181
200
  }
182
201
  },
183
202
  {
@@ -197,8 +216,14 @@
197
216
  "type": "default"
198
217
  },
199
218
  {
200
- "id": "e_node_0_end",
219
+ "id": "e_node_0_node_1",
201
220
  "source": "node_0",
221
+ "target": "node_1",
222
+ "type": "default"
223
+ },
224
+ {
225
+ "id": "e_node_1_end",
226
+ "source": "node_1",
202
227
  "target": "end",
203
228
  "type": "default"
204
229
  }
@@ -206,16 +231,16 @@
206
231
  }
207
232
  }
208
233
  },
209
- "workflows/hooks.ts": {
210
- "collectWithHook": {
211
- "workflowId": "workflow//workflows/hooks.ts//collectWithHook",
234
+ "workflows/null-byte.ts": {
235
+ "nullByteWorkflow": {
236
+ "workflowId": "workflow//workflows/null-byte.ts//nullByteWorkflow",
212
237
  "graph": {
213
238
  "nodes": [
214
239
  {
215
240
  "id": "start",
216
241
  "type": "workflowStart",
217
242
  "data": {
218
- "label": "Start: collectWithHook",
243
+ "label": "Start: nullByteWorkflow",
219
244
  "nodeKind": "workflow_start"
220
245
  }
221
246
  },
@@ -223,22 +248,9 @@
223
248
  "id": "node_0",
224
249
  "type": "step",
225
250
  "data": {
226
- "label": "writeEvent",
227
- "nodeKind": "step",
228
- "stepId": "step//workflows/hooks.ts//writeEvent"
229
- }
230
- },
231
- {
232
- "id": "node_1",
233
- "type": "step",
234
- "data": {
235
- "label": "writeEvent",
251
+ "label": "nullByteStep",
236
252
  "nodeKind": "step",
237
- "stepId": "step//workflows/hooks.ts//writeEvent"
238
- },
239
- "metadata": {
240
- "loopId": "loop_0",
241
- "loopIsAwait": true
253
+ "stepId": "step//workflows/null-byte.ts//nullByteStep"
242
254
  }
243
255
  },
244
256
  {
@@ -258,20 +270,8 @@
258
270
  "type": "default"
259
271
  },
260
272
  {
261
- "id": "e_node_1_back_node_1",
262
- "source": "node_1",
263
- "target": "node_1",
264
- "type": "loop"
265
- },
266
- {
267
- "id": "e_node_0_node_1",
273
+ "id": "e_node_0_end",
268
274
  "source": "node_0",
269
- "target": "node_1",
270
- "type": "default"
271
- },
272
- {
273
- "id": "e_node_1_end",
274
- "source": "node_1",
275
275
  "target": "end",
276
276
  "type": "default"
277
277
  }
@@ -279,16 +279,16 @@
279
279
  }
280
280
  }
281
281
  },
282
- "workflows/addition.ts": {
283
- "addition": {
284
- "workflowId": "workflow//workflows/addition.ts//addition",
282
+ "workflows/retriable-and-fatal.ts": {
283
+ "retryableAndFatalErrorWorkflow": {
284
+ "workflowId": "workflow//workflows/retriable-and-fatal.ts//retryableAndFatalErrorWorkflow",
285
285
  "graph": {
286
286
  "nodes": [
287
287
  {
288
288
  "id": "start",
289
289
  "type": "workflowStart",
290
290
  "data": {
291
- "label": "Start: addition",
291
+ "label": "Start: retryableAndFatalErrorWorkflow",
292
292
  "nodeKind": "workflow_start"
293
293
  }
294
294
  },
@@ -296,9 +296,9 @@
296
296
  "id": "node_0",
297
297
  "type": "step",
298
298
  "data": {
299
- "label": "add",
299
+ "label": "stepThatThrowsRetryableError",
300
300
  "nodeKind": "step",
301
- "stepId": "step//workflows/addition.ts//add"
301
+ "stepId": "step//workflows/retriable-and-fatal.ts//stepThatThrowsRetryableError"
302
302
  }
303
303
  },
304
304
  {
@@ -25386,9 +25386,9 @@ __name(monotonicFactory, "monotonicFactory");
25386
25386
  var import_node_module = require("node:module");
25387
25387
  var import_node_path5 = require("node:path");
25388
25388
  // ../utils/dist/get-port.js
25389
+ var import_node_child_process = require("node:child_process");
25389
25390
  var import_promises = require("node:fs/promises");
25390
25391
  var import_node_util = require("node:util");
25391
- var import_node_child_process = require("node:child_process");
25392
25392
  var execFileAsync = (0, import_node_util.promisify)(import_node_child_process.execFile);
25393
25393
  function parsePort(value, radix = 10) {
25394
25394
  const port = parseInt(value, radix);
@@ -25468,7 +25468,6 @@ async function getLinuxPorts(pid) {
25468
25468
  }
25469
25469
  }
25470
25470
  catch {
25471
- continue;
25472
25471
  }
25473
25472
  }
25474
25473
  const ports = [];
@@ -41437,7 +41436,6 @@ var WorkflowRunStatusSchema = external_exports.enum([
41437
41436
  "running",
41438
41437
  "completed",
41439
41438
  "failed",
41440
- "paused",
41441
41439
  "cancelled"
41442
41440
  ]);
41443
41441
  var WorkflowRunBaseSchema = external_exports.object({
@@ -41460,8 +41458,7 @@ var WorkflowRunSchema = external_exports.discriminatedUnion("status", [
41460
41458
  WorkflowRunBaseSchema.extend({
41461
41459
  status: external_exports.enum([
41462
41460
  "pending",
41463
- "running",
41464
- "paused"
41461
+ "running"
41465
41462
  ]),
41466
41463
  output: external_exports.undefined(),
41467
41464
  error: external_exports.undefined(),
@@ -42166,20 +42163,6 @@ function createStorage(basedir) {
42166
42163
  });
42167
42164
  const resolveData = params?.resolveData ?? DEFAULT_RESOLVE_DATA_OPTION;
42168
42165
  return filterRunData(run, resolveData);
42169
- },
42170
- async pause(id, params) {
42171
- const run = await this.update(id, {
42172
- status: "paused"
42173
- });
42174
- const resolveData = params?.resolveData ?? DEFAULT_RESOLVE_DATA_OPTION;
42175
- return filterRunData(run, resolveData);
42176
- },
42177
- async resume(id, params) {
42178
- const run = await this.update(id, {
42179
- status: "running"
42180
- });
42181
- const resolveData = params?.resolveData ?? DEFAULT_RESOLVE_DATA_OPTION;
42182
- return filterRunData(run, resolveData);
42183
42166
  }
42184
42167
  },
42185
42168
  steps: {
@@ -42563,7 +42546,7 @@ __name(createLocalWorld, "createLocalWorld");
42563
42546
  var import_node_os = __toESM(require("node:os"), 1);
42564
42547
  var import_oidc2 = __toESM(require_dist(), 1);
42565
42548
  // ../world-vercel/dist/version.js
42566
- var version2 = "4.0.1-beta.25";
42549
+ var version2 = "4.0.1-beta.26";
42567
42550
  // ../world-vercel/dist/utils.js
42568
42551
  var DEFAULT_RESOLVE_DATA_OPTION2 = "all";
42569
42552
  function dateToStringReplacer(_key, value) {
@@ -43104,58 +43087,6 @@ async function cancelWorkflowRun(id, params, config3) {
43104
43087
  }
43105
43088
  }
43106
43089
  __name(cancelWorkflowRun, "cancelWorkflowRun");
43107
- async function pauseWorkflowRun(id, params, config3) {
43108
- const resolveData = params?.resolveData ?? DEFAULT_RESOLVE_DATA_OPTION2;
43109
- const remoteRefBehavior = resolveData === "none" ? "lazy" : "resolve";
43110
- const searchParams = new URLSearchParams();
43111
- searchParams.set("remoteRefBehavior", remoteRefBehavior);
43112
- const queryString = searchParams.toString();
43113
- const endpoint = `/v1/runs/${id}/pause${queryString ? `?${queryString}` : ""}`;
43114
- try {
43115
- const run = await makeRequest({
43116
- endpoint,
43117
- options: {
43118
- method: "PUT"
43119
- },
43120
- config: config3,
43121
- schema: remoteRefBehavior === "lazy" ? WorkflowRunWireWithRefsSchema : WorkflowRunWireSchema
43122
- });
43123
- return filterRunData2(run, resolveData);
43124
- }
43125
- catch (error45) {
43126
- if (error45 instanceof WorkflowAPIError && error45.status === 404) {
43127
- throw new WorkflowRunNotFoundError(id);
43128
- }
43129
- throw error45;
43130
- }
43131
- }
43132
- __name(pauseWorkflowRun, "pauseWorkflowRun");
43133
- async function resumeWorkflowRun(id, params, config3) {
43134
- const resolveData = params?.resolveData ?? DEFAULT_RESOLVE_DATA_OPTION2;
43135
- const remoteRefBehavior = resolveData === "none" ? "lazy" : "resolve";
43136
- const searchParams = new URLSearchParams();
43137
- searchParams.set("remoteRefBehavior", remoteRefBehavior);
43138
- const queryString = searchParams.toString();
43139
- const endpoint = `/v1/runs/${id}/resume${queryString ? `?${queryString}` : ""}`;
43140
- try {
43141
- const run = await makeRequest({
43142
- endpoint,
43143
- options: {
43144
- method: "PUT"
43145
- },
43146
- config: config3,
43147
- schema: remoteRefBehavior === "lazy" ? WorkflowRunWireWithRefsSchema : WorkflowRunWireSchema
43148
- });
43149
- return filterRunData2(run, resolveData);
43150
- }
43151
- catch (error45) {
43152
- if (error45 instanceof WorkflowAPIError && error45.status === 404) {
43153
- throw new WorkflowRunNotFoundError(id);
43154
- }
43155
- throw error45;
43156
- }
43157
- }
43158
- __name(resumeWorkflowRun, "resumeWorkflowRun");
43159
43090
  // ../world-vercel/dist/steps.js
43160
43091
  var StepWireSchema = StepSchema.omit({
43161
43092
  error: true
@@ -43267,9 +43198,7 @@ function createStorage2(config3) {
43267
43198
  get: /* @__PURE__ */ __name((id, params) => getWorkflowRun(id, params, config3), "get"),
43268
43199
  update: /* @__PURE__ */ __name((id, data) => updateWorkflowRun(id, data, config3), "update"),
43269
43200
  list: /* @__PURE__ */ __name((params) => listWorkflowRuns(params, config3), "list"),
43270
- cancel: /* @__PURE__ */ __name((id, params) => cancelWorkflowRun(id, params, config3), "cancel"),
43271
- pause: /* @__PURE__ */ __name((id, params) => pauseWorkflowRun(id, params, config3), "pause"),
43272
- resume: /* @__PURE__ */ __name((id, params) => resumeWorkflowRun(id, params, config3), "resume")
43201
+ cancel: /* @__PURE__ */ __name((id, params) => cancelWorkflowRun(id, params, config3), "cancel")
43273
43202
  },
43274
43203
  steps: {
43275
43204
  create: /* @__PURE__ */ __name((runId, data) => createStep(runId, data, config3), "create"),
@@ -44304,19 +44233,6 @@ async function nullByteWorkflow() {
44304
44233
  __name(nullByteWorkflow, "nullByteWorkflow");
44305
44234
  nullByteWorkflow.workflowId = "workflow//workflows/null-byte.ts//nullByteWorkflow";
44306
44235
  registerStepFunction("step//workflows/null-byte.ts//nullByteStep", nullByteStep);
44307
- // workflows/noop.ts
44308
- var count = 0;
44309
- async function noop(_i) {
44310
- count++;
44311
- return count;
44312
- }
44313
- __name(noop, "noop");
44314
- async function brokenWf() {
44315
- throw new Error("You attempted to execute workflow brokenWf function directly. To start a workflow, use start(brokenWf) from workflow/api");
44316
- }
44317
- __name(brokenWf, "brokenWf");
44318
- brokenWf.workflowId = "workflow//workflows/noop.ts//brokenWf";
44319
- registerStepFunction("step//workflows/noop.ts//noop", noop);
44320
44236
  // workflows/retriable-and-fatal.ts
44321
44237
  async function retryableAndFatalErrorWorkflow() {
44322
44238
  throw new Error("You attempted to execute workflow retryableAndFatalErrorWorkflow function directly. To start a workflow, use start(retryableAndFatalErrorWorkflow) from workflow/api");
@@ -44344,6 +44260,19 @@ async function stepThatFails() {
44344
44260
  __name(stepThatFails, "stepThatFails");
44345
44261
  registerStepFunction("step//workflows/retriable-and-fatal.ts//stepThatThrowsRetryableError", stepThatThrowsRetryableError);
44346
44262
  registerStepFunction("step//workflows/retriable-and-fatal.ts//stepThatFails", stepThatFails);
44263
+ // workflows/noop.ts
44264
+ var count = 0;
44265
+ async function noop(_i) {
44266
+ count++;
44267
+ return count;
44268
+ }
44269
+ __name(noop, "noop");
44270
+ async function brokenWf() {
44271
+ throw new Error("You attempted to execute workflow brokenWf function directly. To start a workflow, use start(brokenWf) from workflow/api");
44272
+ }
44273
+ __name(brokenWf, "brokenWf");
44274
+ brokenWf.workflowId = "workflow//workflows/noop.ts//brokenWf";
44275
+ registerStepFunction("step//workflows/noop.ts//noop", noop);
44347
44276
  // ../core/dist/logger.js
44348
44277
  var import_debug = __toESM(require_src2(), 1);
44349
44278
  function createLogger(namespace) {
@@ -44550,6 +44479,7 @@ var stepHandler = getWorldHandlers().createQueueHandler("__wkf_step_", async (me
44550
44479
  correlationId: stepId,
44551
44480
  eventData: {
44552
44481
  error: errorMessage,
44482
+ stack: step.error?.stack,
44553
44483
  fatal: true
44554
44484
  }
44555
44485
  });