@workflow/world-testing 5.0.0-beta.32 → 5.0.0-beta.33

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.
@@ -17090,7 +17090,7 @@ var init_waits = __esm({
17090
17090
  });
17091
17091
 
17092
17092
  // ../world/dist/analytics.js
17093
- var NullableDateSchema, NullableStringSchema, NullableBooleanSchema, AnalyticsRunSchema, AnalyticsStepSchema, AnalyticsEventSchema, AnalyticsHookSchema, AnalyticsWaitSchema;
17093
+ var NAIVE_DATETIME, UTCDateSchema, NullableDateSchema, NullableStringSchema, NullableBooleanSchema, AnalyticsRunSchema, AnalyticsStepSchema, AnalyticsEventSchema, AnalyticsHookSchema, AnalyticsWaitSchema, AnalyticsAttributeKeySchema;
17094
17094
  var init_analytics = __esm({
17095
17095
  "../world/dist/analytics.js"() {
17096
17096
  "use strict";
@@ -17099,7 +17099,14 @@ var init_analytics = __esm({
17099
17099
  init_runs();
17100
17100
  init_steps();
17101
17101
  init_waits();
17102
- NullableDateSchema = external_exports.coerce.date().nullable().optional();
17102
+ NAIVE_DATETIME = /^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(?:\.\d+)?$/;
17103
+ UTCDateSchema = external_exports.preprocess((value) => {
17104
+ if (typeof value === "string" && NAIVE_DATETIME.test(value)) {
17105
+ return `${value.replace(" ", "T")}Z`;
17106
+ }
17107
+ return value;
17108
+ }, external_exports.coerce.date());
17109
+ NullableDateSchema = UTCDateSchema.nullable().optional();
17103
17110
  NullableStringSchema = external_exports.string().nullable().optional();
17104
17111
  NullableBooleanSchema = external_exports.boolean().nullable().optional();
17105
17112
  AnalyticsRunSchema = external_exports.object({
@@ -17109,8 +17116,8 @@ var init_analytics = __esm({
17109
17116
  workflowName: external_exports.string(),
17110
17117
  specVersion: external_exports.coerce.number().optional(),
17111
17118
  attributes: external_exports.record(external_exports.string(), external_exports.string()).default({}),
17112
- createdAt: external_exports.coerce.date(),
17113
- updatedAt: external_exports.coerce.date(),
17119
+ createdAt: UTCDateSchema,
17120
+ updatedAt: UTCDateSchema,
17114
17121
  startedAt: NullableDateSchema,
17115
17122
  completedAt: NullableDateSchema,
17116
17123
  errorCode: NullableStringSchema,
@@ -17123,8 +17130,8 @@ var init_analytics = __esm({
17123
17130
  stepName: NullableStringSchema,
17124
17131
  status: StepStatusSchema,
17125
17132
  attempt: external_exports.number().optional(),
17126
- createdAt: external_exports.coerce.date(),
17127
- updatedAt: external_exports.coerce.date(),
17133
+ createdAt: UTCDateSchema,
17134
+ updatedAt: UTCDateSchema,
17128
17135
  startedAt: NullableDateSchema,
17129
17136
  completedAt: NullableDateSchema,
17130
17137
  retryAfter: NullableDateSchema,
@@ -17142,8 +17149,8 @@ var init_analytics = __esm({
17142
17149
  workflowName: external_exports.string(),
17143
17150
  deploymentId: external_exports.string(),
17144
17151
  specVersion: external_exports.coerce.number().optional(),
17145
- runCreatedAt: external_exports.coerce.date(),
17146
- createdAt: external_exports.coerce.date(),
17152
+ runCreatedAt: UTCDateSchema,
17153
+ createdAt: UTCDateSchema,
17147
17154
  region: NullableStringSchema,
17148
17155
  vercelId: NullableStringSchema,
17149
17156
  requestId: NullableStringSchema,
@@ -17164,8 +17171,8 @@ var init_analytics = __esm({
17164
17171
  "disposed",
17165
17172
  "conflict"
17166
17173
  ]),
17167
- createdAt: external_exports.coerce.date(),
17168
- updatedAt: external_exports.coerce.date(),
17174
+ createdAt: UTCDateSchema,
17175
+ updatedAt: UTCDateSchema,
17169
17176
  receivedAt: NullableDateSchema,
17170
17177
  disposedAt: NullableDateSchema,
17171
17178
  isWebhook: NullableBooleanSchema,
@@ -17178,12 +17185,18 @@ var init_analytics = __esm({
17178
17185
  waitId: external_exports.string(),
17179
17186
  status: WaitStatusSchema,
17180
17187
  resumeAt: NullableDateSchema,
17181
- createdAt: external_exports.coerce.date(),
17182
- updatedAt: external_exports.coerce.date(),
17188
+ createdAt: UTCDateSchema,
17189
+ updatedAt: UTCDateSchema,
17183
17190
  completedAt: NullableDateSchema,
17184
17191
  workflowCoreVersion: NullableStringSchema,
17185
17192
  workflowEncryptionEnabled: NullableBooleanSchema
17186
17193
  });
17194
+ AnalyticsAttributeKeySchema = external_exports.object({
17195
+ key: external_exports.string(),
17196
+ runCount: external_exports.coerce.number(),
17197
+ firstSeenAt: external_exports.coerce.date(),
17198
+ lastSeenAt: external_exports.coerce.date()
17199
+ });
17187
17200
  }
17188
17201
  });
17189
17202
 
@@ -24374,7 +24387,7 @@ var version2;
24374
24387
  var init_version = __esm({
24375
24388
  "../core/dist/version.js"() {
24376
24389
  "use strict";
24377
- version2 = "5.0.0-beta.32";
24390
+ version2 = "5.0.0-beta.33";
24378
24391
  }
24379
24392
  });
24380
24393
 
@@ -24464,7 +24477,7 @@ function parseHealthCheckResponse(chunks) {
24464
24477
  }
24465
24478
  async function healthCheck(world, endpoint, options) {
24466
24479
  const timeout = options?.timeout ?? DEFAULT_HEALTH_CHECK_TIMEOUT;
24467
- const correlationId = generateId();
24480
+ const correlationId = world.createRunId?.() ?? generateId();
24468
24481
  const streamName = getHealthCheckStreamName(correlationId);
24469
24482
  const queueName = `${getQueueTopicPrefix(endpoint, resolveQueueNamespace(options?.namespace))}health_check`;
24470
24483
  const startTime = Date.now();
@@ -27578,7 +27591,7 @@ async function start(workflow, argsOrOptions, options) {
27578
27591
  targetSupportsCompression = capabilities.supportedFormats.has(SerializationFormat.GZIP);
27579
27592
  }
27580
27593
  const ops = [];
27581
- const runId = `wrun_${ulid3()}`;
27594
+ const runId = `wrun_${world.createRunId ? world.createRunId(opts) : ulid3()}`;
27582
27595
  const traceCarrier = await serializeTraceCarrier();
27583
27596
  const specVersion = opts.specVersion ?? world.specVersion;
27584
27597
  const v1Compat = isLegacySpecVersion(specVersion);
@@ -27656,7 +27669,14 @@ async function start(workflow, argsOrOptions, options) {
27656
27669
  } : {}
27657
27670
  }, {
27658
27671
  deploymentId,
27659
- specVersion
27672
+ specVersion,
27673
+ // Forward any caller-supplied region hint so worlds with
27674
+ // per-region queue routing (e.g. world-vercel) can target the
27675
+ // matching queue. Worlds without a regional dimension ignore
27676
+ // this field.
27677
+ ...opts.region !== void 0 ? {
27678
+ region: opts.region
27679
+ } : {}
27660
27680
  })
27661
27681
  ]);
27662
27682
  if (queueResult.status === "rejected") {
@@ -27710,7 +27730,7 @@ __name(start, "start");
27710
27730
  value: "start",
27711
27731
  configurable: true
27712
27732
  });
27713
- })(start, "step//@workflow/core/runtime/start@5.0.0-beta.32//start");
27733
+ })(start, "step//@workflow/core/runtime/start@5.0.0-beta.33//start");
27714
27734
 
27715
27735
  // ../core/dist/runtime/runs.js
27716
27736
  async function wakeUpRun(world, runId, options) {
@@ -28046,7 +28066,7 @@ var Run = class _Run {
28046
28066
  value: "wakeUp",
28047
28067
  configurable: true
28048
28068
  });
28049
- })(Run.prototype["wakeUp"], "step//@workflow/core/runtime/run@5.0.0-beta.32//Run#wakeUp");
28069
+ })(Run.prototype["wakeUp"], "step//@workflow/core/runtime/run@5.0.0-beta.33//Run#wakeUp");
28050
28070
  (function(__wf_fn, __wf_id) {
28051
28071
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
28052
28072
  __wf_reg.set(__wf_id, __wf_fn);
@@ -28055,7 +28075,7 @@ var Run = class _Run {
28055
28075
  value: "cancel",
28056
28076
  configurable: true
28057
28077
  });
28058
- })(Run.prototype["cancel"], "step//@workflow/core/runtime/run@5.0.0-beta.32//Run#cancel");
28078
+ })(Run.prototype["cancel"], "step//@workflow/core/runtime/run@5.0.0-beta.33//Run#cancel");
28059
28079
  (function(__wf_fn, __wf_id) {
28060
28080
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
28061
28081
  __wf_reg.set(__wf_id, __wf_fn);
@@ -28064,7 +28084,7 @@ var Run = class _Run {
28064
28084
  value: "getReadable",
28065
28085
  configurable: true
28066
28086
  });
28067
- })(Run.prototype["getReadable"], "step//@workflow/core/runtime/run@5.0.0-beta.32//Run#getReadable");
28087
+ })(Run.prototype["getReadable"], "step//@workflow/core/runtime/run@5.0.0-beta.33//Run#getReadable");
28068
28088
  (function(__wf_fn, __wf_id) {
28069
28089
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
28070
28090
  __wf_reg.set(__wf_id, __wf_fn);
@@ -28073,7 +28093,7 @@ var Run = class _Run {
28073
28093
  value: "exists",
28074
28094
  configurable: true
28075
28095
  });
28076
- })(Object.getOwnPropertyDescriptor(Run.prototype, "exists").get, "step//@workflow/core/runtime/run@5.0.0-beta.32//Run#exists");
28096
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "exists").get, "step//@workflow/core/runtime/run@5.0.0-beta.33//Run#exists");
28077
28097
  (function(__wf_fn, __wf_id) {
28078
28098
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
28079
28099
  __wf_reg.set(__wf_id, __wf_fn);
@@ -28082,7 +28102,7 @@ var Run = class _Run {
28082
28102
  value: "status",
28083
28103
  configurable: true
28084
28104
  });
28085
- })(Object.getOwnPropertyDescriptor(Run.prototype, "status").get, "step//@workflow/core/runtime/run@5.0.0-beta.32//Run#status");
28105
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "status").get, "step//@workflow/core/runtime/run@5.0.0-beta.33//Run#status");
28086
28106
  (function(__wf_fn, __wf_id) {
28087
28107
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
28088
28108
  __wf_reg.set(__wf_id, __wf_fn);
@@ -28091,7 +28111,7 @@ var Run = class _Run {
28091
28111
  value: "returnValue",
28092
28112
  configurable: true
28093
28113
  });
28094
- })(Object.getOwnPropertyDescriptor(Run.prototype, "returnValue").get, "step//@workflow/core/runtime/run@5.0.0-beta.32//Run#returnValue");
28114
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "returnValue").get, "step//@workflow/core/runtime/run@5.0.0-beta.33//Run#returnValue");
28095
28115
  (function(__wf_fn, __wf_id) {
28096
28116
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
28097
28117
  __wf_reg.set(__wf_id, __wf_fn);
@@ -28100,7 +28120,7 @@ var Run = class _Run {
28100
28120
  value: "workflowName",
28101
28121
  configurable: true
28102
28122
  });
28103
- })(Object.getOwnPropertyDescriptor(Run.prototype, "workflowName").get, "step//@workflow/core/runtime/run@5.0.0-beta.32//Run#workflowName");
28123
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "workflowName").get, "step//@workflow/core/runtime/run@5.0.0-beta.33//Run#workflowName");
28104
28124
  (function(__wf_fn, __wf_id) {
28105
28125
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
28106
28126
  __wf_reg.set(__wf_id, __wf_fn);
@@ -28109,7 +28129,7 @@ var Run = class _Run {
28109
28129
  value: "createdAt",
28110
28130
  configurable: true
28111
28131
  });
28112
- })(Object.getOwnPropertyDescriptor(Run.prototype, "createdAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.32//Run#createdAt");
28132
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "createdAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.33//Run#createdAt");
28113
28133
  (function(__wf_fn, __wf_id) {
28114
28134
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
28115
28135
  __wf_reg.set(__wf_id, __wf_fn);
@@ -28118,7 +28138,7 @@ var Run = class _Run {
28118
28138
  value: "startedAt",
28119
28139
  configurable: true
28120
28140
  });
28121
- })(Object.getOwnPropertyDescriptor(Run.prototype, "startedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.32//Run#startedAt");
28141
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "startedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.33//Run#startedAt");
28122
28142
  (function(__wf_fn, __wf_id) {
28123
28143
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
28124
28144
  __wf_reg.set(__wf_id, __wf_fn);
@@ -28127,7 +28147,7 @@ var Run = class _Run {
28127
28147
  value: "completedAt",
28128
28148
  configurable: true
28129
28149
  });
28130
- })(Object.getOwnPropertyDescriptor(Run.prototype, "completedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.32//Run#completedAt");
28150
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "completedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.33//Run#completedAt");
28131
28151
  (function(__wf_cls, __wf_id) {
28132
28152
  var __wf_sym = /* @__PURE__ */ Symbol.for("workflow-class-registry"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
28133
28153
  __wf_reg.set(__wf_id, __wf_cls);
@@ -28137,7 +28157,7 @@ var Run = class _Run {
28137
28157
  enumerable: false,
28138
28158
  configurable: false
28139
28159
  });
28140
- })(Run, "class//@workflow/core/runtime/run@5.0.0-beta.32//Run");
28160
+ })(Run, "class//@workflow/core/runtime/run@5.0.0-beta.33//Run");
28141
28161
 
28142
28162
  // ../workflow/dist/stdlib.js
28143
28163
  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.32",
3
+ "version": "5.0.0-beta.33",
4
4
  "description": "Testing utilities and World implementation for Workflow SDK",
5
5
  "main": "dist/src/index.mjs",
6
6
  "files": [
@@ -21,16 +21,17 @@
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.32",
25
- "@workflow/core": "5.0.0-beta.32",
24
+ "@workflow/cli": "5.0.0-beta.33",
25
+ "@workflow/core": "5.0.0-beta.33",
26
26
  "@workflow/utils": "5.0.0-beta.6",
27
- "@workflow/world": "5.0.0-beta.19",
28
- "@workflow/world-local": "5.0.0-beta.27",
29
- "workflow": "5.0.0-beta.32"
27
+ "@workflow/world": "5.0.0-beta.20",
28
+ "@workflow/world-local": "5.0.0-beta.28",
29
+ "workflow": "5.0.0-beta.33"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/jsonlines": "0.1.5",
33
33
  "@types/node": "22.19.0",
34
+ "typescript": "^6.0.3",
34
35
  "vitest": "^4.0.18",
35
36
  "@workflow/tsconfig": "5.0.0-beta.0"
36
37
  },