@workflow/world-testing 5.0.3 → 5.0.4

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.
@@ -27444,7 +27444,7 @@ async function compress(data2, mode, stats, opts) {
27444
27444
  recordStats(stats, "none", data2.length, data2.length);
27445
27445
  return data2;
27446
27446
  }
27447
- const compressed = codec2 === "zstd" ? opts?.preferAsync ? await zstdBytesAsync(data2) : zstdBytes(data2) : await gzipBytes(data2);
27447
+ const compressed = codec2 === "zstd" ? opts?.preferAsync && data2.length >= COMPRESSION_ASYNC_MIN_BYTES ? await zstdBytesAsync(data2) : zstdBytes(data2) : await gzipBytes(data2);
27448
27448
  const format = codec2 === "zstd" ? SerializationFormat.ZSTD : SerializationFormat.GZIP;
27449
27449
  const wrappedLength = 4 + compressed.length;
27450
27450
  if (wrappedLength >= data2.length * (1 - COMPRESSION_MIN_SAVINGS_RATIO)) {
@@ -27475,7 +27475,7 @@ async function decompress(data2, stats, opts) {
27475
27475
  recordStats(stats, "none", data2.length, data2.length);
27476
27476
  return data2;
27477
27477
  }
27478
- var COMPRESSION_MIN_BYTES, COMPRESSION_MIN_SAVINGS_RATIO, ZSTD_LEVEL, DecompressedSizeLimitError;
27478
+ var COMPRESSION_MIN_BYTES, COMPRESSION_MIN_SAVINGS_RATIO, COMPRESSION_ASYNC_MIN_BYTES, ZSTD_LEVEL, DecompressedSizeLimitError;
27479
27479
  var init_compression = __esm({
27480
27480
  "../core/dist/serialization/compression.js"() {
27481
27481
  "use strict";
@@ -27483,6 +27483,7 @@ var init_compression = __esm({
27483
27483
  init_types();
27484
27484
  COMPRESSION_MIN_BYTES = 1024;
27485
27485
  COMPRESSION_MIN_SAVINGS_RATIO = 0.05;
27486
+ COMPRESSION_ASYNC_MIN_BYTES = 256 * 1024;
27486
27487
  ZSTD_LEVEL = 3;
27487
27488
  __name(isCompressionDisabledByEnv, "isCompressionDisabledByEnv");
27488
27489
  __name(codecOverrideFromEnv, "codecOverrideFromEnv");
@@ -30295,7 +30296,9 @@ async function serialize(value, encryptionKey, options) {
30295
30296
  try {
30296
30297
  const payload = devalueCodec.serialize(value, "client", options);
30297
30298
  const prefixed = encodeWithFormatPrefix(SerializationFormat.DEVALUE_V1, payload);
30298
- const compressed = await compress(prefixed, options?.compression ?? false, options?.compressionStats);
30299
+ const compressed = await compress(prefixed, options?.compression ?? false, options?.compressionStats, {
30300
+ preferAsync: true
30301
+ });
30299
30302
  return encrypt2(compressed, encryptionKey);
30300
30303
  } catch (error61) {
30301
30304
  rethrowIfRuntimeError(error61);
@@ -32594,7 +32597,7 @@ var version2;
32594
32597
  var init_version = __esm({
32595
32598
  "../core/dist/version.js"() {
32596
32599
  "use strict";
32597
- version2 = "5.2.0";
32600
+ version2 = "5.2.1";
32598
32601
  }
32599
32602
  });
32600
32603
 
@@ -47622,9 +47625,13 @@ async function start(workflow, argsOrOptions, options) {
47622
47625
  }
47623
47626
  const workflowVm = getWorkflowVmFromEnv();
47624
47627
  const snapshotThreshold = getSnapshotThresholdFromEnv();
47628
+ const queueNamespace = resolveQueueNamespace(opts.namespace);
47625
47629
  const executionContext = {
47626
47630
  traceCarrier,
47627
47631
  workflowCoreVersion: version2,
47632
+ ...queueNamespace ? {
47633
+ queueNamespace
47634
+ } : {},
47628
47635
  ...targetNodeVersion ? {
47629
47636
  nodeVersion: targetNodeVersion
47630
47637
  } : {},
@@ -47655,7 +47662,8 @@ async function start(workflow, argsOrOptions, options) {
47655
47662
  }
47656
47663
  }
47657
47664
  const compression = specVersion >= SPEC_VERSION_SUPPORTS_COMPRESSION ? targetCompression : false;
47658
- const workflowArguments = await dehydrateWorkflowArguments(args, runId, encryptionKey, ops, globalThis, v1Compat, framedByteStreams, compression);
47665
+ const argumentCompression = opts.compressArguments === false ? false : compression;
47666
+ const workflowArguments = await dehydrateWorkflowArguments(args, runId, encryptionKey, ops, globalThis, v1Compat, framedByteStreams, argumentCompression);
47659
47667
  let dynamicWorkflowCode;
47660
47668
  let dynamicWorkflowCodeRef;
47661
47669
  if (dynamicWorkflow) {
@@ -47789,7 +47797,7 @@ __name(start, "start");
47789
47797
  value: "start",
47790
47798
  configurable: true
47791
47799
  });
47792
- })(start, "step//@workflow/core/runtime/start@5.2.0//start");
47800
+ })(start, "step//@workflow/core/runtime/start@5.2.1//start");
47793
47801
 
47794
47802
  // ../core/dist/runtime/runs.js
47795
47803
  async function wakeUpRun(world, runId, options) {
@@ -48263,7 +48271,7 @@ var Run = class _Run {
48263
48271
  value: "wakeUp",
48264
48272
  configurable: true
48265
48273
  });
48266
- })(Run.prototype["wakeUp"], "step//@workflow/core/runtime/run@5.2.0//Run#wakeUp");
48274
+ })(Run.prototype["wakeUp"], "step//@workflow/core/runtime/run@5.2.1//Run#wakeUp");
48267
48275
  (function(__wf_fn, __wf_id) {
48268
48276
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
48269
48277
  __wf_reg.set(__wf_id, __wf_fn);
@@ -48272,7 +48280,7 @@ var Run = class _Run {
48272
48280
  value: "cancel",
48273
48281
  configurable: true
48274
48282
  });
48275
- })(Run.prototype["cancel"], "step//@workflow/core/runtime/run@5.2.0//Run#cancel");
48283
+ })(Run.prototype["cancel"], "step//@workflow/core/runtime/run@5.2.1//Run#cancel");
48276
48284
  (function(__wf_fn, __wf_id) {
48277
48285
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
48278
48286
  __wf_reg.set(__wf_id, __wf_fn);
@@ -48281,7 +48289,7 @@ var Run = class _Run {
48281
48289
  value: "getReadable",
48282
48290
  configurable: true
48283
48291
  });
48284
- })(Run.prototype["getReadable"], "step//@workflow/core/runtime/run@5.2.0//Run#getReadable");
48292
+ })(Run.prototype["getReadable"], "step//@workflow/core/runtime/run@5.2.1//Run#getReadable");
48285
48293
  (function(__wf_fn, __wf_id) {
48286
48294
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
48287
48295
  __wf_reg.set(__wf_id, __wf_fn);
@@ -48290,7 +48298,7 @@ var Run = class _Run {
48290
48298
  value: "getWritable",
48291
48299
  configurable: true
48292
48300
  });
48293
- })(Run.prototype["getWritable"], "step//@workflow/core/runtime/run@5.2.0//Run#getWritable");
48301
+ })(Run.prototype["getWritable"], "step//@workflow/core/runtime/run@5.2.1//Run#getWritable");
48294
48302
  (function(__wf_fn, __wf_id) {
48295
48303
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
48296
48304
  __wf_reg.set(__wf_id, __wf_fn);
@@ -48299,7 +48307,7 @@ var Run = class _Run {
48299
48307
  value: "exists",
48300
48308
  configurable: true
48301
48309
  });
48302
- })(Object.getOwnPropertyDescriptor(Run.prototype, "exists").get, "step//@workflow/core/runtime/run@5.2.0//Run#exists");
48310
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "exists").get, "step//@workflow/core/runtime/run@5.2.1//Run#exists");
48303
48311
  (function(__wf_fn, __wf_id) {
48304
48312
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
48305
48313
  __wf_reg.set(__wf_id, __wf_fn);
@@ -48308,7 +48316,7 @@ var Run = class _Run {
48308
48316
  value: "status",
48309
48317
  configurable: true
48310
48318
  });
48311
- })(Object.getOwnPropertyDescriptor(Run.prototype, "status").get, "step//@workflow/core/runtime/run@5.2.0//Run#status");
48319
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "status").get, "step//@workflow/core/runtime/run@5.2.1//Run#status");
48312
48320
  (function(__wf_fn, __wf_id) {
48313
48321
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
48314
48322
  __wf_reg.set(__wf_id, __wf_fn);
@@ -48317,7 +48325,7 @@ var Run = class _Run {
48317
48325
  value: "returnValue",
48318
48326
  configurable: true
48319
48327
  });
48320
- })(Object.getOwnPropertyDescriptor(Run.prototype, "returnValue").get, "step//@workflow/core/runtime/run@5.2.0//Run#returnValue");
48328
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "returnValue").get, "step//@workflow/core/runtime/run@5.2.1//Run#returnValue");
48321
48329
  (function(__wf_fn, __wf_id) {
48322
48330
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
48323
48331
  __wf_reg.set(__wf_id, __wf_fn);
@@ -48326,7 +48334,7 @@ var Run = class _Run {
48326
48334
  value: "workflowName",
48327
48335
  configurable: true
48328
48336
  });
48329
- })(Object.getOwnPropertyDescriptor(Run.prototype, "workflowName").get, "step//@workflow/core/runtime/run@5.2.0//Run#workflowName");
48337
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "workflowName").get, "step//@workflow/core/runtime/run@5.2.1//Run#workflowName");
48330
48338
  (function(__wf_fn, __wf_id) {
48331
48339
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
48332
48340
  __wf_reg.set(__wf_id, __wf_fn);
@@ -48335,7 +48343,7 @@ var Run = class _Run {
48335
48343
  value: "createdAt",
48336
48344
  configurable: true
48337
48345
  });
48338
- })(Object.getOwnPropertyDescriptor(Run.prototype, "createdAt").get, "step//@workflow/core/runtime/run@5.2.0//Run#createdAt");
48346
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "createdAt").get, "step//@workflow/core/runtime/run@5.2.1//Run#createdAt");
48339
48347
  (function(__wf_fn, __wf_id) {
48340
48348
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
48341
48349
  __wf_reg.set(__wf_id, __wf_fn);
@@ -48344,7 +48352,7 @@ var Run = class _Run {
48344
48352
  value: "startedAt",
48345
48353
  configurable: true
48346
48354
  });
48347
- })(Object.getOwnPropertyDescriptor(Run.prototype, "startedAt").get, "step//@workflow/core/runtime/run@5.2.0//Run#startedAt");
48355
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "startedAt").get, "step//@workflow/core/runtime/run@5.2.1//Run#startedAt");
48348
48356
  (function(__wf_fn, __wf_id) {
48349
48357
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
48350
48358
  __wf_reg.set(__wf_id, __wf_fn);
@@ -48353,7 +48361,7 @@ var Run = class _Run {
48353
48361
  value: "completedAt",
48354
48362
  configurable: true
48355
48363
  });
48356
- })(Object.getOwnPropertyDescriptor(Run.prototype, "completedAt").get, "step//@workflow/core/runtime/run@5.2.0//Run#completedAt");
48364
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "completedAt").get, "step//@workflow/core/runtime/run@5.2.1//Run#completedAt");
48357
48365
  (function(__wf_cls, __wf_id) {
48358
48366
  var __wf_sym = /* @__PURE__ */ Symbol.for("workflow-class-registry"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
48359
48367
  __wf_reg.set(__wf_id, __wf_cls);
@@ -48363,7 +48371,7 @@ var Run = class _Run {
48363
48371
  enumerable: false,
48364
48372
  configurable: false
48365
48373
  });
48366
- })(Run, "class//@workflow/core/runtime/run@5.2.0//Run");
48374
+ })(Run, "class//@workflow/core/runtime/run@5.2.1//Run");
48367
48375
 
48368
48376
  // ../workflow/dist/stdlib.js
48369
48377
  async function fetch2(...args) {