@workflow/world-testing 4.1.0-beta.66 → 4.1.0-beta.67

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.
@@ -49142,7 +49142,7 @@ function createQueue(config3) {
49142
49142
  if (typeof result?.timeoutSeconds === "number") {
49143
49143
  timeoutSeconds = Math.min(result.timeoutSeconds, LOCAL_QUEUE_MAX_VISIBILITY);
49144
49144
  }
49145
- if (timeoutSeconds) {
49145
+ if (timeoutSeconds != null) {
49146
49146
  return Response.json({ timeoutSeconds }, { status: 503 });
49147
49147
  }
49148
49148
  return Response.json({ ok: true });
@@ -53076,7 +53076,7 @@ var RpcService3 = SemanticConvention3("rpc.service");
53076
53076
  var RpcMethod3 = SemanticConvention3("rpc.method");
53077
53077
 
53078
53078
  // ../world-vercel/dist/version.js
53079
- var version2 = "4.1.0-beta.39";
53079
+ var version2 = "4.1.0-beta.40";
53080
53080
 
53081
53081
  // ../world-vercel/dist/utils.js
53082
53082
  var WORKFLOW_SERVER_URL_OVERRIDE = "";
@@ -53388,7 +53388,7 @@ function createQueue2(config3) {
53388
53388
  attempt: metadata.deliveryCount
53389
53389
  });
53390
53390
  if (typeof result?.timeoutSeconds === "number") {
53391
- const delaySeconds = Math.min(result.timeoutSeconds, MAX_DELAY_SECONDS);
53391
+ const delaySeconds = result.timeoutSeconds > 0 ? Math.min(result.timeoutSeconds, MAX_DELAY_SECONDS) : void 0;
53392
53392
  await queue(queueName, payload, { deploymentId, delaySeconds });
53393
53393
  }
53394
53394
  });
@@ -56371,7 +56371,7 @@ async function handleSuspension({ suspension, world, run, span }) {
56371
56371
  ...WorkflowWaitsCreated(waitItems.length)
56372
56372
  });
56373
56373
  if (hasHookConflict) {
56374
- return { timeoutSeconds: 1 };
56374
+ return { timeoutSeconds: 0 };
56375
56375
  }
56376
56376
  if (minTimeoutSeconds !== null) {
56377
56377
  return { timeoutSeconds: minTimeoutSeconds };
@@ -57596,7 +57596,8 @@ async function runWorkflow(workflowCode2, workflowRun, events, encryptionKey) {
57596
57596
  if (!startedAt) {
57597
57597
  throw new Error(`Workflow run "${workflowRun.runId}" has no "startedAt" timestamp (should not happen)`);
57598
57598
  }
57599
- const port = await getPort();
57599
+ const isVercel = process.env.VERCEL_URL !== void 0;
57600
+ const port = isVercel ? void 0 : await getPort();
57600
57601
  const { context: context2, globalThis: vmGlobalThis, updateTimestamp } = createContext({
57601
57602
  seed: `${workflowRun.runId}:${workflowRun.workflowName}:${+startedAt}`,
57602
57603
  fixedTimestamp: +startedAt
@@ -57655,7 +57656,7 @@ async function runWorkflow(workflowCode2, workflowRun, events, encryptionKey) {
57655
57656
  vmGlobalThis[WORKFLOW_CREATE_HOOK] = createHook;
57656
57657
  vmGlobalThis[WORKFLOW_SLEEP] = sleep;
57657
57658
  vmGlobalThis[WORKFLOW_GET_STREAM_ID] = (namespace) => getWorkflowRunStreamId(workflowRun.runId, namespace);
57658
- const url2 = process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : `http://localhost:${port ?? 3e3}`;
57659
+ const url2 = isVercel ? `https://${process.env.VERCEL_URL}` : `http://localhost:${port ?? 3e3}`;
57659
57660
  const ctx = {
57660
57661
  workflowRunId: workflowRun.runId,
57661
57662
  workflowStartedAt: new vmGlobalThis.Date(+startedAt),
@@ -58076,8 +58077,9 @@ var stepHandler = getWorldHandlers().createQueueHandler("__wkf_step_", async (me
58076
58077
  return await withTraceContext(traceContext, async () => {
58077
58078
  const stepName = metadata.queueName.slice("__wkf_step_".length);
58078
58079
  const world = getWorld();
58080
+ const isVercel = process.env.VERCEL_URL !== void 0;
58079
58081
  const [port, spanKind] = await Promise.all([
58080
- getPort(),
58082
+ isVercel ? void 0 : getPort(),
58081
58083
  getSpanKind("CONSUMER")
58082
58084
  ]);
58083
58085
  return trace2(`STEP ${stepName}`, { kind: spanKind, links: spanLinks }, async (span) => {
@@ -58262,7 +58264,7 @@ var stepHandler = getWorldHandlers().createQueueHandler("__wkf_step_", async (me
58262
58264
  workflowStartedAt: /* @__PURE__ */ new Date(+workflowStartedAt),
58263
58265
  // TODO: there should be a getUrl method on the world interface itself. This
58264
58266
  // solution only works for vercel + local worlds.
58265
- url: process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : `http://localhost:${port ?? 3e3}`
58267
+ url: isVercel ? `https://${process.env.VERCEL_URL}` : `http://localhost:${port ?? 3e3}`
58266
58268
  },
58267
58269
  ops,
58268
58270
  closureVars: hydratedInput.closureVars,
@@ -58939,7 +58941,7 @@ function getWritable(options = {}) {
58939
58941
  __name(getWritable, "getWritable");
58940
58942
 
58941
58943
  // ../workflow/dist/stdlib.js
58942
- var fetch = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//workflow@4.2.0-beta.65//fetch");
58944
+ var fetch = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//workflow@4.2.0-beta.66//fetch");
58943
58945
 
58944
58946
  // ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.js
58945
58947
  var NEVER = Object.freeze({
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "version": "1.0.0",
3
3
  "steps": {
4
- "workflow/dist/stdlib.js": {
5
- "fetch": {
6
- "stepId": "step//workflow@4.2.0-beta.65//fetch"
7
- }
8
- },
9
- "workflows/hooks.ts": {
10
- "writeEvent": {
11
- "stepId": "step//./workflows/hooks//writeEvent"
4
+ "workflow/dist/internal/builtins.js": {
5
+ "__builtin_response_array_buffer": {
6
+ "stepId": "__builtin_response_array_buffer"
7
+ },
8
+ "__builtin_response_json": {
9
+ "stepId": "__builtin_response_json"
10
+ },
11
+ "__builtin_response_text": {
12
+ "stepId": "__builtin_response_text"
12
13
  }
13
14
  },
14
15
  "workflows/addition.ts": {
@@ -16,25 +17,24 @@
16
17
  "stepId": "step//./workflows/addition//add"
17
18
  }
18
19
  },
19
- "workflows/noop.ts": {
20
- "noop": {
21
- "stepId": "step//./workflows/noop//noop"
22
- }
23
- },
24
20
  "workflows/null-byte.ts": {
25
21
  "nullByteStep": {
26
22
  "stepId": "step//./workflows/null-byte//nullByteStep"
27
23
  }
28
24
  },
29
- "workflow/dist/internal/builtins.js": {
30
- "__builtin_response_array_buffer": {
31
- "stepId": "__builtin_response_array_buffer"
32
- },
33
- "__builtin_response_json": {
34
- "stepId": "__builtin_response_json"
35
- },
36
- "__builtin_response_text": {
37
- "stepId": "__builtin_response_text"
25
+ "workflow/dist/stdlib.js": {
26
+ "fetch": {
27
+ "stepId": "step//workflow@4.2.0-beta.66//fetch"
28
+ }
29
+ },
30
+ "workflows/hooks.ts": {
31
+ "writeEvent": {
32
+ "stepId": "step//./workflows/hooks//writeEvent"
33
+ }
34
+ },
35
+ "workflows/noop.ts": {
36
+ "noop": {
37
+ "stepId": "step//./workflows/noop//noop"
38
38
  }
39
39
  },
40
40
  "workflows/retriable-and-fatal.ts": {
@@ -47,16 +47,16 @@
47
47
  }
48
48
  },
49
49
  "workflows": {
50
- "workflows/hooks.ts": {
51
- "collectWithHook": {
52
- "workflowId": "workflow//./workflows/hooks//collectWithHook",
50
+ "workflows/addition.ts": {
51
+ "addition": {
52
+ "workflowId": "workflow//./workflows/addition//addition",
53
53
  "graph": {
54
54
  "nodes": [
55
55
  {
56
56
  "id": "start",
57
57
  "type": "workflowStart",
58
58
  "data": {
59
- "label": "Start: collectWithHook",
59
+ "label": "Start: addition",
60
60
  "nodeKind": "workflow_start"
61
61
  }
62
62
  },
@@ -80,16 +80,16 @@
80
80
  }
81
81
  }
82
82
  },
83
- "workflows/addition.ts": {
84
- "addition": {
85
- "workflowId": "workflow//./workflows/addition//addition",
83
+ "workflows/null-byte.ts": {
84
+ "nullByteWorkflow": {
85
+ "workflowId": "workflow//./workflows/null-byte//nullByteWorkflow",
86
86
  "graph": {
87
87
  "nodes": [
88
88
  {
89
89
  "id": "start",
90
90
  "type": "workflowStart",
91
91
  "data": {
92
- "label": "Start: addition",
92
+ "label": "Start: nullByteWorkflow",
93
93
  "nodeKind": "workflow_start"
94
94
  }
95
95
  },
@@ -113,16 +113,16 @@
113
113
  }
114
114
  }
115
115
  },
116
- "workflows/noop.ts": {
117
- "brokenWf": {
118
- "workflowId": "workflow//./workflows/noop//brokenWf",
116
+ "workflows/hooks.ts": {
117
+ "collectWithHook": {
118
+ "workflowId": "workflow//./workflows/hooks//collectWithHook",
119
119
  "graph": {
120
120
  "nodes": [
121
121
  {
122
122
  "id": "start",
123
123
  "type": "workflowStart",
124
124
  "data": {
125
- "label": "Start: brokenWf",
125
+ "label": "Start: collectWithHook",
126
126
  "nodeKind": "workflow_start"
127
127
  }
128
128
  },
@@ -146,16 +146,16 @@
146
146
  }
147
147
  }
148
148
  },
149
- "workflows/null-byte.ts": {
150
- "nullByteWorkflow": {
151
- "workflowId": "workflow//./workflows/null-byte//nullByteWorkflow",
149
+ "workflows/noop.ts": {
150
+ "brokenWf": {
151
+ "workflowId": "workflow//./workflows/noop//brokenWf",
152
152
  "graph": {
153
153
  "nodes": [
154
154
  {
155
155
  "id": "start",
156
156
  "type": "workflowStart",
157
157
  "data": {
158
- "label": "Start: nullByteWorkflow",
158
+ "label": "Start: brokenWf",
159
159
  "nodeKind": "workflow_start"
160
160
  }
161
161
  },