@workflow/world-testing 5.0.0 → 5.0.1

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.
@@ -26042,6 +26042,88 @@ var init_slot_identity = __esm({
26042
26042
  }
26043
26043
  });
26044
26044
 
26045
+ // ../world/dist/snapshots.js
26046
+ var SnapshotMetadataSchema;
26047
+ var init_snapshots = __esm({
26048
+ "../world/dist/snapshots.js"() {
26049
+ "use strict";
26050
+ init_zod();
26051
+ SnapshotMetadataSchema = external_exports.object({
26052
+ /**
26053
+ * Pagination cursor for events.list() — the snapshot was taken at
26054
+ * this point in the event log. On restore, only events AFTER this
26055
+ * cursor need to be fetched.
26056
+ */
26057
+ eventsCursor: external_exports.string().nullable(),
26058
+ /** Timestamp when the snapshot was created */
26059
+ createdAt: external_exports.coerce.date(),
26060
+ /**
26061
+ * Number of events the run had processed when the snapshot was taken.
26062
+ * Restores see only the delta after `eventsCursor`, so guards that need
26063
+ * the TOTAL log size (the server-supplied max-events ceiling) add this
26064
+ * to the delta. Optional for snapshots written before the field existed
26065
+ * (treated as 0 — the ceiling degrades to delta-only for those, exactly
26066
+ * the pre-field behavior).
26067
+ */
26068
+ eventCount: external_exports.number().int().nonnegative().optional(),
26069
+ /**
26070
+ * Number of draws the run's seeded PRNG had consumed when the snapshot
26071
+ * was taken. On restore the runtime re-seeds from the run's BASE seed
26072
+ * and fast-forwards this many draws, so correlation-id generation
26073
+ * continues at the exact position full replay would have reached —
26074
+ * keeping ids identical across snapshot generations AND identical to a
26075
+ * no-snapshot run (which is what makes concurrent invocations restored
26076
+ * from different snapshots of the same run still collide on the world's
26077
+ * per-(runId, correlationId) dedup).
26078
+ */
26079
+ rngDraws: external_exports.number().int().nonnegative().optional(),
26080
+ /**
26081
+ * Snapshot-portable token of the engine's host-serde capture root: the
26082
+ * container of pristine intrinsics/samples/symbols captured before any
26083
+ * user code ran, whose box lives inside the snapshot's memory image. A
26084
+ * restore re-adopts it by this token so serde initialization executes
26085
+ * no guest code after user code has run. Required to restore (format
26086
+ * version >= 2); snapshots without it are treated as a miss.
26087
+ */
26088
+ serdeRootPtr: external_exports.number().int().optional(),
26089
+ /**
26090
+ * The monotonic correlation-id ULID factory's last output when the
26091
+ * snapshot was taken (undefined if the run had drawn none). The
26092
+ * factory's state lives host-side and does not survive into the memory
26093
+ * image; on restore the runtime continues the sequence from this value
26094
+ * (same-timestamp base32 increment), so a restored invocation emits
26095
+ * the exact ids a full replay would — keeping concurrent invocations
26096
+ * of the same run dedupable via per-(runId, correlationId) uniqueness.
26097
+ */
26098
+ lastUlid: external_exports.string().optional(),
26099
+ /**
26100
+ * Exact engine build (quickjs-wasi package version) that captured the
26101
+ * heap image. The image's own QJSS header is identical across builds,
26102
+ * so restoring under a different build would pass deserialization and
26103
+ * execute as undefined behavior in the interpreter — a real hazard
26104
+ * during a rolling deploy that bumps quickjs-wasi, when live snapshots
26105
+ * from the old build meet instances running the new one. Readers MUST
26106
+ * treat a mismatch (or absence) as a clean miss.
26107
+ */
26108
+ engineVersion: external_exports.string().optional(),
26109
+ /**
26110
+ * The deterministic replay clock's high-water mark (ms since epoch) at
26111
+ * capture. The clock lives host-side; without this a restored VM's
26112
+ * `Date.now()` regresses to the run-creation time until the first
26113
+ * delta event advances it, so restores initialize the clock to
26114
+ * `max(derived, clockMs)`.
26115
+ */
26116
+ clockMs: external_exports.number().optional(),
26117
+ /**
26118
+ * Snapshot format tag. A reader that doesn't recognize the version
26119
+ * treats the snapshot as a clean miss (full replay) instead of handing
26120
+ * an incompatible heap to the WASM engine.
26121
+ */
26122
+ formatVersion: external_exports.number().int().optional()
26123
+ });
26124
+ }
26125
+ });
26126
+
26045
26127
  // ../world/dist/spec-version.js
26046
26128
  function isLegacySpecVersion(v) {
26047
26129
  return v === void 0 || v === null || v <= SPEC_VERSION_LEGACY;
@@ -26097,6 +26179,7 @@ var init_dist4 = __esm({
26097
26179
  init_serialization();
26098
26180
  init_shared();
26099
26181
  init_slot_identity();
26182
+ init_snapshots();
26100
26183
  init_spec_version();
26101
26184
  init_steps();
26102
26185
  init_ulid();
@@ -26281,9 +26364,15 @@ function headersToEntries(value) {
26281
26364
  recordProxy(value);
26282
26365
  return Array.from(value);
26283
26366
  }
26284
- return [
26285
- ...headersIterator(value)
26286
- ];
26367
+ try {
26368
+ return [
26369
+ ...headersIterator(value)
26370
+ ];
26371
+ } catch (error61) {
26372
+ if (!(error61 instanceof TypeError)) throw error61;
26373
+ recordGuestCode("method", "Headers[Symbol.iterator]");
26374
+ return Array.from(value);
26375
+ }
26287
26376
  }
26288
26377
  function mapToEntries(value) {
26289
26378
  return [
@@ -27206,7 +27295,7 @@ function isZstdAvailable() {
27206
27295
  function isGzipAvailable() {
27207
27296
  return typeof CompressionStream === "function" && typeof DecompressionStream === "function";
27208
27297
  }
27209
- async function pipeThroughTransform(data2, transform2) {
27298
+ async function pipeThroughTransform(data2, transform2, maxOutputBytes) {
27210
27299
  const writer = transform2.writable.getWriter();
27211
27300
  const writePromise = writer.write(data2).then(() => writer.close());
27212
27301
  writePromise.catch(() => {
@@ -27219,6 +27308,11 @@ async function pipeThroughTransform(data2, transform2) {
27219
27308
  if (done) break;
27220
27309
  chunks.push(value);
27221
27310
  total += value.length;
27311
+ if (maxOutputBytes !== void 0 && total > maxOutputBytes) {
27312
+ await reader.cancel().catch(() => {
27313
+ });
27314
+ throw new DecompressedSizeLimitError(maxOutputBytes);
27315
+ }
27222
27316
  }
27223
27317
  await writePromise;
27224
27318
  const out = new Uint8Array(total);
@@ -27232,25 +27326,51 @@ async function pipeThroughTransform(data2, transform2) {
27232
27326
  async function gzipBytes(data2) {
27233
27327
  return pipeThroughTransform(data2, new CompressionStream("gzip"));
27234
27328
  }
27235
- async function gunzipBytes(data2) {
27236
- return pipeThroughTransform(data2, new DecompressionStream("gzip"));
27329
+ async function gunzipBytes(data2, maxOutputBytes) {
27330
+ return pipeThroughTransform(data2, new DecompressionStream("gzip"), maxOutputBytes);
27237
27331
  }
27238
- function zstdBytes(data2) {
27239
- const z2 = getNodeZlib();
27332
+ function zstdOpts(z2) {
27240
27333
  const level = z2?.constants?.ZSTD_c_compressionLevel;
27241
- const opts = level !== void 0 ? {
27334
+ return level !== void 0 ? {
27242
27335
  params: {
27243
27336
  [level]: ZSTD_LEVEL
27244
27337
  }
27245
27338
  } : void 0;
27246
- return new Uint8Array(z2.zstdCompressSync(data2, opts));
27247
27339
  }
27248
- function unzstdBytes(data2) {
27340
+ function zstdBytes(data2) {
27341
+ const z2 = getNodeZlib();
27342
+ return new Uint8Array(z2.zstdCompressSync(data2, zstdOpts(z2)));
27343
+ }
27344
+ function zstdBytesAsync(data2) {
27345
+ const z2 = getNodeZlib();
27346
+ if (typeof z2?.zstdCompress !== "function") {
27347
+ return Promise.resolve(zstdBytes(data2));
27348
+ }
27349
+ return new Promise((resolve, reject) => {
27350
+ z2.zstdCompress(data2, zstdOpts(z2), (err, result) => {
27351
+ if (err) reject(err);
27352
+ else resolve(new Uint8Array(result));
27353
+ });
27354
+ });
27355
+ }
27356
+ function unzstdBytes(data2, maxOutputBytes) {
27249
27357
  const z2 = getNodeZlib();
27250
27358
  if (!z2?.zstdDecompressSync) {
27251
27359
  throw new Error("Compressed (zstd) workflow data encountered but node:zlib zstd support is not available in this runtime (requires Node.js 22.15+). In the browser, register a zstd decoder via registerZstdDecoder (serialization-format.ts).");
27252
27360
  }
27253
- return new Uint8Array(z2.zstdDecompressSync(data2));
27361
+ if (maxOutputBytes === void 0) {
27362
+ return new Uint8Array(z2.zstdDecompressSync(data2));
27363
+ }
27364
+ try {
27365
+ return new Uint8Array(z2.zstdDecompressSync(data2, {
27366
+ maxOutputLength: maxOutputBytes
27367
+ }));
27368
+ } catch (err) {
27369
+ if (err?.code === "ERR_BUFFER_TOO_LARGE") {
27370
+ throw new DecompressedSizeLimitError(maxOutputBytes);
27371
+ }
27372
+ throw err;
27373
+ }
27254
27374
  }
27255
27375
  function recordStats(stats, codec2, uncompressedBytes, storedBytes) {
27256
27376
  if (!stats) return;
@@ -27267,7 +27387,7 @@ function selectWriteCodec() {
27267
27387
  if (isGzipAvailable()) return "gzip";
27268
27388
  return "none";
27269
27389
  }
27270
- async function compress(data2, enabled, stats) {
27390
+ async function compress(data2, enabled, stats, opts) {
27271
27391
  if (!(data2 instanceof Uint8Array)) return data2;
27272
27392
  if (!enabled || data2.length < COMPRESSION_MIN_BYTES || isCompressionDisabledByEnv()) {
27273
27393
  recordStats(stats, "none", data2.length, data2.length);
@@ -27278,7 +27398,7 @@ async function compress(data2, enabled, stats) {
27278
27398
  recordStats(stats, "none", data2.length, data2.length);
27279
27399
  return data2;
27280
27400
  }
27281
- const compressed = codec2 === "zstd" ? zstdBytes(data2) : await gzipBytes(data2);
27401
+ const compressed = codec2 === "zstd" ? opts?.preferAsync ? await zstdBytesAsync(data2) : zstdBytes(data2) : await gzipBytes(data2);
27282
27402
  const format = codec2 === "zstd" ? SerializationFormat.ZSTD : SerializationFormat.GZIP;
27283
27403
  const wrappedLength = 4 + compressed.length;
27284
27404
  if (wrappedLength >= data2.length * (1 - COMPRESSION_MIN_SAVINGS_RATIO)) {
@@ -27288,12 +27408,12 @@ async function compress(data2, enabled, stats) {
27288
27408
  recordStats(stats, codec2, data2.length, wrappedLength);
27289
27409
  return encodeWithFormatPrefix(format, compressed);
27290
27410
  }
27291
- async function decompress(data2, stats) {
27411
+ async function decompress(data2, stats, opts) {
27292
27412
  if (!(data2 instanceof Uint8Array)) return data2;
27293
27413
  const prefix = peekFormatPrefix(data2);
27294
27414
  if (prefix === SerializationFormat.ZSTD) {
27295
27415
  const { payload } = decodeFormatPrefix(data2);
27296
- const inflated = unzstdBytes(payload);
27416
+ const inflated = unzstdBytes(payload, opts?.maxOutputBytes);
27297
27417
  recordStats(stats, "zstd", inflated.length, data2.length);
27298
27418
  return inflated;
27299
27419
  }
@@ -27302,14 +27422,14 @@ async function decompress(data2, stats) {
27302
27422
  throw new Error("Compressed (gzip) workflow data encountered but DecompressionStream is not available in this runtime. Node.js 18+, browsers, and edge runtimes all support it.");
27303
27423
  }
27304
27424
  const { payload } = decodeFormatPrefix(data2);
27305
- const inflated = await gunzipBytes(payload);
27425
+ const inflated = await gunzipBytes(payload, opts?.maxOutputBytes);
27306
27426
  recordStats(stats, "gzip", inflated.length, data2.length);
27307
27427
  return inflated;
27308
27428
  }
27309
27429
  recordStats(stats, "none", data2.length, data2.length);
27310
27430
  return data2;
27311
27431
  }
27312
- var COMPRESSION_MIN_BYTES, COMPRESSION_MIN_SAVINGS_RATIO, ZSTD_LEVEL;
27432
+ var COMPRESSION_MIN_BYTES, COMPRESSION_MIN_SAVINGS_RATIO, ZSTD_LEVEL, DecompressedSizeLimitError;
27313
27433
  var init_compression = __esm({
27314
27434
  "../core/dist/serialization/compression.js"() {
27315
27435
  "use strict";
@@ -27326,7 +27446,20 @@ var init_compression = __esm({
27326
27446
  __name(pipeThroughTransform, "pipeThroughTransform");
27327
27447
  __name(gzipBytes, "gzipBytes");
27328
27448
  __name(gunzipBytes, "gunzipBytes");
27449
+ DecompressedSizeLimitError = class extends Error {
27450
+ static {
27451
+ __name(this, "DecompressedSizeLimitError");
27452
+ }
27453
+ maxOutputBytes;
27454
+ constructor(maxOutputBytes) {
27455
+ super(`Decompressed payload exceeds ${maxOutputBytes} bytes`);
27456
+ this.maxOutputBytes = maxOutputBytes;
27457
+ this.name = "DecompressedSizeLimitError";
27458
+ }
27459
+ };
27460
+ __name(zstdOpts, "zstdOpts");
27329
27461
  __name(zstdBytes, "zstdBytes");
27462
+ __name(zstdBytesAsync, "zstdBytesAsync");
27330
27463
  __name(unzstdBytes, "unzstdBytes");
27331
27464
  __name(recordStats, "recordStats");
27332
27465
  __name(selectWriteCodec, "selectWriteCodec");
@@ -27615,7 +27748,7 @@ function SemanticConvention(...names) {
27615
27748
  value
27616
27749
  ]));
27617
27750
  }
27618
- var WorkflowName, WorkflowOperation, WorkflowRunId, WorkflowRunStatus, WorkflowStartedAt, WorkflowEventsCount, WorkflowExecutionMode, WorkflowDynamic, WorkflowDynamicSourceHash, WorkflowDynamicCodeBytes, WorkflowDynamicCodeStorage, WorkflowBundleCompileCacheHit, WorkflowReplayLoadSource, WorkflowParkedEventsCount, WorkflowParkedEventId, WorkflowParkedEventType, WorkflowArgumentsCount, WorkflowResultType, WorkflowTracePropagated, WorkflowVm, QuickJSOutcome, QuickJSEventsPreloaded, QuickJSEventsFetchedCount, QuickJSEventsFetchedPages, QuickJSPendingOpsCount, QuickJSInlineSteps, WorkflowTraceMode, WorkflowTurbo, WorkflowErrorName, WorkflowErrorMessage, WorkflowErrorCode, WorkflowStepsCreated, WorkflowHooksCreated, WorkflowWaitsCreated, WorkflowStepsFailedSerialization, WorkflowOwnedRecoverySteps, WorkflowBackstopWakesArmed, WorkflowDispatchRepublishSkipped, WorkflowRouteType, WorkflowRouteHandlerCached, WorkflowRouteInvocationCount, WorkflowRouteEntrypointAgeMs, WorkflowRouteModuleBodyInitMs, FaasInstance, StepName, StepId, StepAttempt, StepStatus, StepMaxRetries, StepTracePropagated, StepTtfsMs, StepStsoMs, StepRsfsMs, StepFinalSchedulingReplayMs, StepLatencyOptimizations, StepStartStrategy, StepSkipped, StepSkipReason, StepArgumentsCount, StepResultType, StepErrorName, StepErrorMessage, StepFatalError, StepRetryExhausted, StepRetryTimeoutSeconds, StepRetryWillRetry, MessagingSystem, MessagingDestinationName, MessagingMessageId, MessagingOperationType, MessagingBatchMessageCount, QueueOverheadMs, DeploymentId, WorkflowRunPinnedDeploymentId, WorkflowDeploymentMismatchRetryCount, WorkflowDeploymentMismatchRecovered, WorkflowRunSpecVersion, WorkflowRunSpecVersionSource, WorkflowCapabilityProbeLatencyMs, WorkflowCapabilityProbeCached, WorkflowCapabilityProbeError, HookToken, HookId, HookFound, HookResilientResume, HookResumeCommitted, HookWakePublished, HookResilientResumeMaterialized, HookResumeSetupSource, StepResilientDispatchRecovered, StepResilientDispatchMaterialized, StepDispatchPrologue, ResumeTotalMs, ResumeProducerPrepMs, ResumeQueueDeliveryMs, ResumeSetupMs, ResumeReplayMs, ResumeStepDispatchMs, ResumeStepClaimMs, ResumeStepPrepareMs, ResumeTrigger, ResumeStrategy, ResumeSetupSource, ResumeStepExecution, WebhookHandlersTriggered, WorkflowSuspensionState, WorkflowSuspensionHookCount, WorkflowSuspensionStepCount, WorkflowSuspensionWaitCount, HttpRequestMethod, HttpRoute, UrlFull, ServerAddress, ServerPort, HttpResponseStatusCode, ErrorType, WorldParseFormat, WorkflowEventsPagesLoaded, QueueDeserializeTimeMs, QueueExecutionTimeMs, QueueSerializeTimeMs, SerializationOperation, SerializationCompressed, SerializationCodec, SerializationUncompressedBytes, SerializationStoredBytes, SerializationCompressionRatio, SerializationGuestCodeExecutions, SerializationGuestCodeDetails, PeerService, RpcSystem, RpcService, RpcMethod, ErrorRetryable, ErrorCategory;
27751
+ var WorkflowName, WorkflowOperation, WorkflowRunId, WorkflowRunStatus, WorkflowStartedAt, WorkflowEventsCount, WorkflowExecutionMode, WorkflowDynamic, WorkflowDynamicSourceHash, WorkflowDynamicCodeBytes, WorkflowDynamicCodeStorage, WorkflowBundleCompileCacheHit, WorkflowReplayLoadSource, WorkflowParkedEventsCount, WorkflowParkedEventId, WorkflowParkedEventType, WorkflowArgumentsCount, WorkflowResultType, WorkflowTracePropagated, WorkflowVm, QuickJSOutcome, QuickJSEventsPreloaded, QuickJSEventsFetchedCount, QuickJSEventsFetchedPages, QuickJSPendingOpsCount, QuickJSInlineSteps, QuickJSSnapshotRestored, QuickJSSnapshotDeltaEvents, QuickJSSnapshotRestoreMs, QuickJSSnapshotFallbackReason, QuickJSSnapshotSaveMs, QuickJSSnapshotPlaintextBytes, QuickJSSnapshotStoredBytes, WorkflowTraceMode, WorkflowTurbo, WorkflowErrorName, WorkflowErrorMessage, WorkflowErrorCode, WorkflowStepsCreated, WorkflowHooksCreated, WorkflowWaitsCreated, WorkflowStepsFailedSerialization, WorkflowOwnedRecoverySteps, WorkflowBackstopWakesArmed, WorkflowDispatchRepublishSkipped, WorkflowRouteType, WorkflowRouteHandlerCached, WorkflowRouteInvocationCount, WorkflowRouteEntrypointAgeMs, WorkflowRouteModuleBodyInitMs, FaasInstance, StepName, StepId, StepAttempt, StepStatus, StepMaxRetries, StepTracePropagated, StepTtfsMs, StepStsoMs, StepRsfsMs, StepFinalSchedulingReplayMs, StepLatencyOptimizations, StepStartStrategy, StepSkipped, StepSkipReason, StepArgumentsCount, StepResultType, StepErrorName, StepErrorMessage, StepFatalError, StepRetryExhausted, StepRetryTimeoutSeconds, StepRetryWillRetry, MessagingSystem, MessagingDestinationName, MessagingMessageId, MessagingOperationType, MessagingBatchMessageCount, QueueOverheadMs, DeploymentId, WorkflowRunPinnedDeploymentId, WorkflowDeploymentMismatchRetryCount, WorkflowDeploymentMismatchRecovered, WorkflowRunSpecVersion, WorkflowRunSpecVersionSource, WorkflowCapabilityProbeLatencyMs, WorkflowCapabilityProbeCached, WorkflowCapabilityProbeError, HookToken, HookId, HookFound, HookResilientResume, HookResumeCommitted, HookWakePublished, HookResilientResumeMaterialized, HookResumeSetupSource, StepResilientDispatchRecovered, StepResilientDispatchMaterialized, StepDispatchPrologue, ResumeTotalMs, ResumeProducerPrepMs, ResumeQueueDeliveryMs, ResumeSetupMs, ResumeReplayMs, ResumeStepDispatchMs, ResumeStepClaimMs, ResumeStepPrepareMs, ResumeTrigger, ResumeStrategy, ResumeSetupSource, ResumeStepExecution, WebhookHandlersTriggered, WorkflowSuspensionState, WorkflowSuspensionHookCount, WorkflowSuspensionStepCount, WorkflowSuspensionWaitCount, HttpRequestMethod, HttpRoute, UrlFull, ServerAddress, ServerPort, HttpResponseStatusCode, ErrorType, WorldParseFormat, WorkflowEventsPagesLoaded, QueueDeserializeTimeMs, QueueExecutionTimeMs, QueueSerializeTimeMs, SerializationOperation, SerializationCompressed, SerializationCodec, SerializationUncompressedBytes, SerializationStoredBytes, SerializationCompressionRatio, SerializationGuestCodeExecutions, SerializationGuestCodeDetails, PeerService, RpcSystem, RpcService, RpcMethod, ErrorRetryable, ErrorCategory;
27619
27752
  var init_semantic_conventions = __esm({
27620
27753
  "../core/dist/telemetry/semantic-conventions.js"() {
27621
27754
  "use strict";
@@ -27646,6 +27779,13 @@ var init_semantic_conventions = __esm({
27646
27779
  QuickJSEventsFetchedPages = SemanticConvention("workflow.vm.events.fetched_pages");
27647
27780
  QuickJSPendingOpsCount = SemanticConvention("workflow.vm.pending_ops_count");
27648
27781
  QuickJSInlineSteps = SemanticConvention("quickjs.inline_steps");
27782
+ QuickJSSnapshotRestored = SemanticConvention("workflow.quickjs.snapshot.restored");
27783
+ QuickJSSnapshotDeltaEvents = SemanticConvention("workflow.quickjs.snapshot.delta_events");
27784
+ QuickJSSnapshotRestoreMs = SemanticConvention("workflow.quickjs.snapshot.restore_ms");
27785
+ QuickJSSnapshotFallbackReason = SemanticConvention("workflow.quickjs.snapshot.fallback_reason");
27786
+ QuickJSSnapshotSaveMs = SemanticConvention("workflow.quickjs.snapshot.save_ms");
27787
+ QuickJSSnapshotPlaintextBytes = SemanticConvention("workflow.quickjs.snapshot.plaintext_bytes");
27788
+ QuickJSSnapshotStoredBytes = SemanticConvention("workflow.quickjs.snapshot.stored_bytes");
27649
27789
  WorkflowTraceMode = SemanticConvention("workflow.trace.mode");
27650
27790
  WorkflowTurbo = SemanticConvention("workflow.turbo");
27651
27791
  WorkflowErrorName = SemanticConvention("workflow.error.name");
@@ -29982,7 +30122,7 @@ var init_telemetry = __esm({
29982
30122
 
29983
30123
  // ../core/dist/logger.js
29984
30124
  function matchesDebugNamespace(namespace, patternList) {
29985
- if (!patternList) {
30125
+ if (typeof patternList !== "string" || !patternList) {
29986
30126
  return false;
29987
30127
  }
29988
30128
  let enabled = false;
@@ -32379,7 +32519,7 @@ var version2;
32379
32519
  var init_version = __esm({
32380
32520
  "../core/dist/version.js"() {
32381
32521
  "use strict";
32382
- version2 = "5.0.0";
32522
+ version2 = "5.0.1";
32383
32523
  }
32384
32524
  });
32385
32525
 
@@ -46760,14 +46900,27 @@ function parse6(input2, options) {
46760
46900
  __name(parse6, "parse");
46761
46901
 
46762
46902
  // ../core/dist/runtime/dynamic-workflow.js
46903
+ function dynamicStartRefusal(message, options) {
46904
+ return Object.assign(new WorkflowRuntimeError(message, options), {
46905
+ fatal: true
46906
+ });
46907
+ }
46908
+ __name(dynamicStartRefusal, "dynamicStartRefusal");
46909
+ function dynamicStartRefusalFrom(error61) {
46910
+ return dynamicStartRefusal(error61 instanceof Error ? error61.message : String(error61), {
46911
+ cause: error61
46912
+ });
46913
+ }
46914
+ __name(dynamicStartRefusalFrom, "dynamicStartRefusalFrom");
46763
46915
  var DYNAMIC_WORKFLOW_SOURCE_MAX_BYTES = 128 * 1024;
46764
46916
  var DYNAMIC_WORKFLOW_CODE_INLINE_MAX_BYTES = 24 * 1024;
46765
46917
  var SAFE_DYNAMIC_IDENTIFIER = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;
46918
+ var DYNAMIC_WORKFLOW_EXPORT_NAME_MAX_LENGTH = 64;
46766
46919
  var SAFE_DYNAMIC_EXPORT_NAME = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
46767
46920
  var UNSUPPORTED_DYNAMIC_MODULE_SYNTAX = /^[ \t]*(?:import(?:\s+[\w$]|\s*(?:[*{(]|['"]))|export(?:\s+(?:async\s+)?(?:function|const|let|var|class|default)\b|\s*[{*]))/m;
46768
46921
  function assertDynamicWorkflowIdentifier(kind, value) {
46769
46922
  if (!SAFE_DYNAMIC_IDENTIFIER.test(value)) {
46770
- throw new WorkflowRuntimeError(`Invalid dynamic workflow ${kind} ${JSON.stringify(value)}. Use a valid JavaScript identifier: letters, digits, "_" and "$", not starting with a digit.`);
46923
+ throw dynamicStartRefusal(`Invalid dynamic workflow ${kind} ${JSON.stringify(value)}. Use a valid JavaScript identifier: letters, digits, "_" and "$", not starting with a digit.`);
46771
46924
  }
46772
46925
  }
46773
46926
  __name(assertDynamicWorkflowIdentifier, "assertDynamicWorkflowIdentifier");
@@ -46787,7 +46940,7 @@ async function sha256Hex(input2) {
46787
46940
  }
46788
46941
  __name(sha256Hex, "sha256Hex");
46789
46942
  var DYNAMIC_WORKFLOW_ECMA_VERSION = 2024;
46790
- function parseDynamicWorkflowSource(source) {
46943
+ function parseDynamicWorkflowSource(source, exportName) {
46791
46944
  try {
46792
46945
  return parse6(source, {
46793
46946
  ecmaVersion: DYNAMIC_WORKFLOW_ECMA_VERSION,
@@ -46795,7 +46948,7 @@ function parseDynamicWorkflowSource(source) {
46795
46948
  });
46796
46949
  } catch (error61) {
46797
46950
  const message = error61 instanceof Error ? error61.message : String(error61);
46798
- throw new WorkflowRuntimeError(`Dynamic workflow source is not valid JavaScript: ${message}. The source is evaluated as-is, so it cannot contain TypeScript syntax or module declarations.`);
46951
+ throw dynamicStartRefusal(`Dynamic workflow source is not valid JavaScript: ${message}. The source is evaluated as-is, so it cannot contain TypeScript syntax or module declarations. If the error is at an \`await\`, declare the function as \`async function ${exportName}(...)\`.`);
46799
46952
  }
46800
46953
  }
46801
46954
  __name(parseDynamicWorkflowSource, "parseDynamicWorkflowSource");
@@ -46807,37 +46960,77 @@ function assertGeneratedWorkflowCodeParses(workflowCode) {
46807
46960
  });
46808
46961
  } catch (error61) {
46809
46962
  const message = error61 instanceof Error ? error61.message : String(error61);
46810
- throw new WorkflowRuntimeError(`Generated dynamic workflow code is not valid JavaScript: ${message}.`);
46963
+ throw dynamicStartRefusal(`Generated dynamic workflow code is not valid JavaScript: ${message}.`);
46811
46964
  }
46812
46965
  }
46813
46966
  __name(assertGeneratedWorkflowCodeParses, "assertGeneratedWorkflowCodeParses");
46814
46967
  function validateDynamicWorkflowSource(source, exportName) {
46815
46968
  const byteLength = new TextEncoder().encode(source).byteLength;
46816
46969
  if (byteLength > DYNAMIC_WORKFLOW_SOURCE_MAX_BYTES) {
46817
- throw new WorkflowRuntimeError(`Dynamic workflow source is ${byteLength} bytes, over the ${DYNAMIC_WORKFLOW_SOURCE_MAX_BYTES}-byte limit.`);
46970
+ throw dynamicStartRefusal(`Dynamic workflow source is ${byteLength} bytes, over the ${DYNAMIC_WORKFLOW_SOURCE_MAX_BYTES}-byte limit.`);
46818
46971
  }
46819
46972
  if (UNSUPPORTED_DYNAMIC_MODULE_SYNTAX.test(source)) {
46820
- throw new WorkflowRuntimeError("Dynamic workflow source cannot use `import` or `export`. Reach registered steps through the injected `steps` object instead.");
46821
- }
46822
- const program = parseDynamicWorkflowSource(source);
46823
- const declarations = program.body.filter((node2) => node2.type === "FunctionDeclaration" && node2.id.name === exportName);
46824
- const declaration = declarations.length === 1 ? declarations[0] : void 0;
46825
- if (!declaration || !declaration.async || declaration.generator) {
46826
- throw new WorkflowRuntimeError(`Dynamic workflow source must declare \`async function ${exportName}(...)\` at top level.`);
46973
+ throw dynamicStartRefusal("Dynamic workflow source cannot use `import` or `export`. Reach registered steps through the injected `steps` object instead.");
46827
46974
  }
46975
+ const program = parseDynamicWorkflowSource(source, exportName);
46976
+ const declaration = findWorkflowDeclaration(program, exportName);
46828
46977
  const firstStatement = declaration.body.body[0];
46829
46978
  if (firstStatement?.type !== "ExpressionStatement" || firstStatement.directive !== "use workflow") {
46830
- throw new WorkflowRuntimeError(`Dynamic workflow function ${JSON.stringify(exportName)} must open with a "use workflow" directive.`);
46979
+ throw dynamicStartRefusal(`Dynamic workflow function ${JSON.stringify(exportName)} must open with a "use workflow" directive.`);
46831
46980
  }
46832
- if (/(?:"use step"|'use step')/.test(source)) {
46833
- throw new WorkflowRuntimeError('Dynamic workflow source cannot declare "use step" functions. Register the step with the deployment and expose it through `experimental_dynamic.steps` instead.');
46981
+ if (hasDirective(program, "use step")) {
46982
+ throw dynamicStartRefusal('Dynamic workflow source cannot declare "use step" functions. Register the step with the deployment and expose it through `experimental_dynamic.steps` instead.');
46834
46983
  }
46835
46984
  }
46836
46985
  __name(validateDynamicWorkflowSource, "validateDynamicWorkflowSource");
46986
+ function findWorkflowDeclaration(program, exportName) {
46987
+ const expected = `Dynamic workflow source must declare \`async function ${exportName}(...)\` at top level`;
46988
+ const declarations = program.body.filter((node2) => node2.type === "FunctionDeclaration" && node2.id.name === exportName);
46989
+ const [declaration] = declarations;
46990
+ let problem = "";
46991
+ if (declarations.length > 1) {
46992
+ problem = ` exactly once, but declares \`function ${exportName}\` ${declarations.length} times`;
46993
+ } else if (declaration?.generator) {
46994
+ problem = `, but \`${exportName}\` is a generator function`;
46995
+ } else if (declaration && !declaration.async) {
46996
+ problem = `, but \`${exportName}\` is not async`;
46997
+ }
46998
+ if (!declaration || problem) {
46999
+ throw dynamicStartRefusal(`${expected}${problem}.`);
47000
+ }
47001
+ return declaration;
47002
+ }
47003
+ __name(findWorkflowDeclaration, "findWorkflowDeclaration");
47004
+ function hasDirective(program, directive) {
47005
+ const pending = [
47006
+ program
47007
+ ];
47008
+ while (pending.length > 0) {
47009
+ const node2 = pending.pop();
47010
+ if (node2.directive === directive) return true;
47011
+ for (const child of childNodes(node2)) pending.push(child);
47012
+ }
47013
+ return false;
47014
+ }
47015
+ __name(hasDirective, "hasDirective");
47016
+ function childNodes(node2) {
47017
+ const children = [];
47018
+ for (const value of Object.values(node2)) {
47019
+ for (const child of Array.isArray(value) ? value : [
47020
+ value
47021
+ ]) {
47022
+ if (child && typeof child === "object" && "type" in child) {
47023
+ children.push(child);
47024
+ }
47025
+ }
47026
+ }
47027
+ return children;
47028
+ }
47029
+ __name(childNodes, "childNodes");
46837
47030
  function resolveStepId(alias, value) {
46838
47031
  const stepId = value && typeof value === "object" || typeof value === "function" ? value.stepId : void 0;
46839
47032
  if (typeof stepId !== "string" || stepId.length === 0) {
46840
- throw new WorkflowRuntimeError(`Dynamic workflow step ${JSON.stringify(alias)} must be an imported step function or an object with a non-empty \`stepId\`.`);
47033
+ throw dynamicStartRefusal(`Dynamic workflow step ${JSON.stringify(alias)} must be an imported step function or an object with a non-empty \`stepId\`.`);
46841
47034
  }
46842
47035
  return stepId;
46843
47036
  }
@@ -46848,13 +47041,16 @@ function dynamicWorkflowName(metadata) {
46848
47041
  __name(dynamicWorkflowName, "dynamicWorkflowName");
46849
47042
  async function compileDynamicWorkflow(source, options) {
46850
47043
  const exportName = options.exportName ?? "workflow";
47044
+ if (exportName.length > DYNAMIC_WORKFLOW_EXPORT_NAME_MAX_LENGTH) {
47045
+ throw dynamicStartRefusal(`Dynamic workflow exportName is ${exportName.length} characters, over the ${DYNAMIC_WORKFLOW_EXPORT_NAME_MAX_LENGTH}-character limit. It becomes part of the workflow id and queue name.`);
47046
+ }
46851
47047
  assertDynamicWorkflowIdentifier("exportName", exportName);
46852
47048
  if (!SAFE_DYNAMIC_EXPORT_NAME.test(exportName)) {
46853
- throw new WorkflowRuntimeError(`Invalid dynamic workflow exportName ${JSON.stringify(exportName)}. Use letters, digits, and "_", not starting with a digit; "$" cannot appear in workflow queue names.`);
47049
+ throw dynamicStartRefusal(`Invalid dynamic workflow exportName ${JSON.stringify(exportName)}. Use letters, digits, and "_", not starting with a digit; "$" cannot appear in workflow queue names.`);
46854
47050
  }
46855
47051
  validateDynamicWorkflowSource(source, exportName);
46856
47052
  if (!options.steps || Object.keys(options.steps).length === 0) {
46857
- throw new WorkflowRuntimeError("Dynamic workflow options must expose at least one registered step through `experimental_dynamic.steps`.");
47053
+ throw dynamicStartRefusal("Dynamic workflow options must expose at least one registered step through `experimental_dynamic.steps`.");
46858
47054
  }
46859
47055
  const stepEntries = Object.entries(options.steps).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([alias, value]) => {
46860
47056
  assertDynamicWorkflowIdentifier("step alias", alias);
@@ -47025,6 +47221,16 @@ function getWorkflowVmFromEnv(env = process.env) {
47025
47221
  throw new WorkflowRuntimeError(`Invalid WORKFLOW_VM value: "${raw}". Expected one of: ${WORKFLOW_VMS.join(", ")}.`);
47026
47222
  }
47027
47223
  __name(getWorkflowVmFromEnv, "getWorkflowVmFromEnv");
47224
+ function getSnapshotThresholdFromEnv(env = process.env) {
47225
+ const raw = env.WORKFLOW_SNAPSHOT_THRESHOLD;
47226
+ if (raw === void 0 || raw === "") return void 0;
47227
+ const parsed = /^\d+$/.test(raw) ? Number(raw) : Number.NaN;
47228
+ if (!Number.isSafeInteger(parsed)) {
47229
+ throw new WorkflowRuntimeError(`Invalid WORKFLOW_SNAPSHOT_THRESHOLD value: "${raw}". Expected a non-negative integer (0 disables snapshotting).`);
47230
+ }
47231
+ return parsed;
47232
+ }
47233
+ __name(getSnapshotThresholdFromEnv, "getSnapshotThresholdFromEnv");
47028
47234
 
47029
47235
  // ../core/dist/runtime/start.js
47030
47236
  init_wait_until();
@@ -47121,7 +47327,7 @@ async function probeCrossDeployment(world, options) {
47121
47327
  __name(probeCrossDeployment, "probeCrossDeployment");
47122
47328
  function assertDynamicWorkflowsEnabled() {
47123
47329
  if (!isDynamicWorkflowsEnabled()) {
47124
- throw new WorkflowRuntimeError(`Dynamic workflows are disabled on this deployment, so no run was created. Set ${DYNAMIC_WORKFLOWS_ENV}=1 on the deployment to enable them.`);
47330
+ throw dynamicStartRefusal(`Dynamic workflows are disabled on this deployment, so no run was created. Set ${DYNAMIC_WORKFLOWS_ENV}=1 on the deployment to enable them.`);
47125
47331
  }
47126
47332
  }
47127
47333
  __name(assertDynamicWorkflowsEnabled, "assertDynamicWorkflowsEnabled");
@@ -47139,7 +47345,7 @@ async function start(workflow, argsOrOptions, options) {
47139
47345
  if (typeof workflow === "string") {
47140
47346
  const dynamicOptions = opts.experimental_dynamic;
47141
47347
  if (!dynamicOptions) {
47142
- throw new WorkflowRuntimeError("'start' was given workflow source but no `experimental_dynamic` options. Pass `{ experimental_dynamic: { steps } }` to declare which registered steps the source may call.");
47348
+ throw dynamicStartRefusal("'start' was given workflow source but no `experimental_dynamic` options. Pass `{ experimental_dynamic: { steps } }` to declare which registered steps the source may call.");
47143
47349
  }
47144
47350
  const compiled = await compileDynamicWorkflow(workflow, dynamicOptions);
47145
47351
  assertDynamicWorkflowsEnabled();
@@ -47200,12 +47406,12 @@ async function start(workflow, argsOrOptions, options) {
47200
47406
  }
47201
47407
  const crossDeployment = deploymentId !== currentDeploymentId;
47202
47408
  if (dynamicWorkflow && crossDeployment) {
47203
- const current2 = currentDeploymentId === void 0 ? "an unknown current deployment" : JSON.stringify(currentDeploymentId);
47204
- throw new WorkflowRuntimeError(`Dynamic workflows can only start on the current deployment. This start targets ${JSON.stringify(deploymentId)} from ${current2}, so no run was created.`);
47409
+ const message = `Dynamic workflows can only start on the current deployment. This start targets ${JSON.stringify(deploymentId)} from ${currentDeploymentId === void 0 ? "an unknown current deployment" : JSON.stringify(currentDeploymentId)}, so no run was created.`;
47410
+ throw currentDeploymentId === void 0 ? new WorkflowRuntimeError(message) : dynamicStartRefusal(message);
47205
47411
  }
47206
47412
  const runId = `wrun_${world.createRunId ? world.createRunId(opts) : ulid3()}`;
47207
47413
  if (dynamicWorkflow && !world.capabilities?.dynamicWorkflowCode) {
47208
- throw new WorkflowRuntimeError("Dynamic workflows require a World that declares `capabilities.dynamicWorkflowCode`. This World does not, so no run was created.");
47414
+ throw dynamicStartRefusal("Dynamic workflows require a World that declares `capabilities.dynamicWorkflowCode`. This World does not, so no run was created.");
47209
47415
  }
47210
47416
  let framedByteStreams;
47211
47417
  let targetSupportsCompression;
@@ -47321,6 +47527,7 @@ async function start(workflow, argsOrOptions, options) {
47321
47527
  encryptionPublicKey = rawKey ? bytesToBase64((await deriveRunKeyPair(rawKey)).publicKey) : void 0;
47322
47528
  }
47323
47529
  const workflowVm = getWorkflowVmFromEnv();
47530
+ const snapshotThreshold = getSnapshotThresholdFromEnv();
47324
47531
  const executionContext = {
47325
47532
  traceCarrier,
47326
47533
  workflowCoreVersion: version2,
@@ -47333,6 +47540,9 @@ async function start(workflow, argsOrOptions, options) {
47333
47540
  ...workflowVm ? {
47334
47541
  workflowVm
47335
47542
  } : {},
47543
+ ...snapshotThreshold !== void 0 ? {
47544
+ snapshotThreshold
47545
+ } : {},
47336
47546
  ...opts.replayedFromRunId ? {
47337
47547
  replayedFromRunId: opts.replayedFromRunId
47338
47548
  } : {},
@@ -47341,7 +47551,11 @@ async function start(workflow, argsOrOptions, options) {
47341
47551
  } : {}
47342
47552
  };
47343
47553
  if (dynamicWorkflow) {
47344
- world.validateRunExecutionContext?.(executionContext);
47554
+ try {
47555
+ world.validateRunExecutionContext?.(executionContext);
47556
+ } catch (err) {
47557
+ throw dynamicStartRefusalFrom(err);
47558
+ }
47345
47559
  }
47346
47560
  const compression = targetSupportsCompression && specVersion >= SPEC_VERSION_SUPPORTS_COMPRESSION;
47347
47561
  const workflowArguments = await dehydrateWorkflowArguments(args, runId, encryptionKey, ops, globalThis, v1Compat, framedByteStreams, compression);
@@ -47373,24 +47587,31 @@ async function start(workflow, argsOrOptions, options) {
47373
47587
  } : {}
47374
47588
  } : {};
47375
47589
  const creatorEnvironment = world.getEnvironment?.();
47590
+ const runCreated = world.events.create(runId, {
47591
+ eventType: "run_created",
47592
+ specVersion,
47593
+ eventData: {
47594
+ deploymentId,
47595
+ workflowName,
47596
+ input: workflowArguments,
47597
+ executionContext,
47598
+ ...encryptionPublicKey ? {
47599
+ encryptionPublicKey
47600
+ } : {},
47601
+ ...attributeSeed,
47602
+ ...dynamicWorkflowSeed
47603
+ }
47604
+ }, {
47605
+ v1Compat
47606
+ });
47607
+ if (dynamicWorkflow) {
47608
+ const { run: run2 } = await runCreated;
47609
+ if (run2.dynamicWorkflowCode === void 0) {
47610
+ throw new WorkflowRuntimeError(`Workflow run ${runId} was created, but this deployment's Workflow backend did not store its dynamic workflow code, so the run can never be replayed. It was not queued, so it will not execute. Dynamic workflows require a backend with encrypted dynamic-source storage; upgrade it, or start a workflow function from the build-time manifest instead.`);
47611
+ }
47612
+ }
47376
47613
  const [runCreatedResult, queueResult] = await Promise.allSettled([
47377
- world.events.create(runId, {
47378
- eventType: "run_created",
47379
- specVersion,
47380
- eventData: {
47381
- deploymentId,
47382
- workflowName,
47383
- input: workflowArguments,
47384
- executionContext,
47385
- ...encryptionPublicKey ? {
47386
- encryptionPublicKey
47387
- } : {},
47388
- ...attributeSeed,
47389
- ...dynamicWorkflowSeed
47390
- }
47391
- }, {
47392
- v1Compat
47393
- }),
47614
+ runCreated,
47394
47615
  world.queue(queueName, {
47395
47616
  runId,
47396
47617
  traceCarrier,
@@ -47444,9 +47665,6 @@ async function start(workflow, argsOrOptions, options) {
47444
47665
  if (!v1Compat && result.run.runId !== runId) {
47445
47666
  throw new WorkflowRuntimeError(`Server returned different runId than requested: expected ${runId}, got ${result.run.runId}`);
47446
47667
  }
47447
- if (dynamicWorkflow && result.run.dynamicWorkflowCode === void 0) {
47448
- throw new WorkflowRuntimeError(`Workflow run ${runId} was created, but this deployment's Workflow backend did not store its dynamic workflow code, so the run can never be replayed. Dynamic workflows require a backend with encrypted dynamic-source storage; upgrade it, or start a workflow function from the build-time manifest instead.`);
47449
- }
47450
47668
  }
47451
47669
  safeWaitUntil(Promise.all(ops), (err) => {
47452
47670
  runtimeLogger.warn("Background flush of workflow argument streams failed", {
@@ -47474,7 +47692,7 @@ __name(start, "start");
47474
47692
  value: "start",
47475
47693
  configurable: true
47476
47694
  });
47477
- })(start, "step//@workflow/core/runtime/start@5.0.0//start");
47695
+ })(start, "step//@workflow/core/runtime/start@5.0.1//start");
47478
47696
 
47479
47697
  // ../core/dist/runtime/runs.js
47480
47698
  async function wakeUpRun(world, runId, options) {
@@ -47948,7 +48166,7 @@ var Run = class _Run {
47948
48166
  value: "wakeUp",
47949
48167
  configurable: true
47950
48168
  });
47951
- })(Run.prototype["wakeUp"], "step//@workflow/core/runtime/run@5.0.0//Run#wakeUp");
48169
+ })(Run.prototype["wakeUp"], "step//@workflow/core/runtime/run@5.0.1//Run#wakeUp");
47952
48170
  (function(__wf_fn, __wf_id) {
47953
48171
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
47954
48172
  __wf_reg.set(__wf_id, __wf_fn);
@@ -47957,7 +48175,7 @@ var Run = class _Run {
47957
48175
  value: "cancel",
47958
48176
  configurable: true
47959
48177
  });
47960
- })(Run.prototype["cancel"], "step//@workflow/core/runtime/run@5.0.0//Run#cancel");
48178
+ })(Run.prototype["cancel"], "step//@workflow/core/runtime/run@5.0.1//Run#cancel");
47961
48179
  (function(__wf_fn, __wf_id) {
47962
48180
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
47963
48181
  __wf_reg.set(__wf_id, __wf_fn);
@@ -47966,7 +48184,7 @@ var Run = class _Run {
47966
48184
  value: "getReadable",
47967
48185
  configurable: true
47968
48186
  });
47969
- })(Run.prototype["getReadable"], "step//@workflow/core/runtime/run@5.0.0//Run#getReadable");
48187
+ })(Run.prototype["getReadable"], "step//@workflow/core/runtime/run@5.0.1//Run#getReadable");
47970
48188
  (function(__wf_fn, __wf_id) {
47971
48189
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
47972
48190
  __wf_reg.set(__wf_id, __wf_fn);
@@ -47975,7 +48193,7 @@ var Run = class _Run {
47975
48193
  value: "getWritable",
47976
48194
  configurable: true
47977
48195
  });
47978
- })(Run.prototype["getWritable"], "step//@workflow/core/runtime/run@5.0.0//Run#getWritable");
48196
+ })(Run.prototype["getWritable"], "step//@workflow/core/runtime/run@5.0.1//Run#getWritable");
47979
48197
  (function(__wf_fn, __wf_id) {
47980
48198
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
47981
48199
  __wf_reg.set(__wf_id, __wf_fn);
@@ -47984,7 +48202,7 @@ var Run = class _Run {
47984
48202
  value: "exists",
47985
48203
  configurable: true
47986
48204
  });
47987
- })(Object.getOwnPropertyDescriptor(Run.prototype, "exists").get, "step//@workflow/core/runtime/run@5.0.0//Run#exists");
48205
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "exists").get, "step//@workflow/core/runtime/run@5.0.1//Run#exists");
47988
48206
  (function(__wf_fn, __wf_id) {
47989
48207
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
47990
48208
  __wf_reg.set(__wf_id, __wf_fn);
@@ -47993,7 +48211,7 @@ var Run = class _Run {
47993
48211
  value: "status",
47994
48212
  configurable: true
47995
48213
  });
47996
- })(Object.getOwnPropertyDescriptor(Run.prototype, "status").get, "step//@workflow/core/runtime/run@5.0.0//Run#status");
48214
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "status").get, "step//@workflow/core/runtime/run@5.0.1//Run#status");
47997
48215
  (function(__wf_fn, __wf_id) {
47998
48216
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
47999
48217
  __wf_reg.set(__wf_id, __wf_fn);
@@ -48002,7 +48220,7 @@ var Run = class _Run {
48002
48220
  value: "returnValue",
48003
48221
  configurable: true
48004
48222
  });
48005
- })(Object.getOwnPropertyDescriptor(Run.prototype, "returnValue").get, "step//@workflow/core/runtime/run@5.0.0//Run#returnValue");
48223
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "returnValue").get, "step//@workflow/core/runtime/run@5.0.1//Run#returnValue");
48006
48224
  (function(__wf_fn, __wf_id) {
48007
48225
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
48008
48226
  __wf_reg.set(__wf_id, __wf_fn);
@@ -48011,7 +48229,7 @@ var Run = class _Run {
48011
48229
  value: "workflowName",
48012
48230
  configurable: true
48013
48231
  });
48014
- })(Object.getOwnPropertyDescriptor(Run.prototype, "workflowName").get, "step//@workflow/core/runtime/run@5.0.0//Run#workflowName");
48232
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "workflowName").get, "step//@workflow/core/runtime/run@5.0.1//Run#workflowName");
48015
48233
  (function(__wf_fn, __wf_id) {
48016
48234
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
48017
48235
  __wf_reg.set(__wf_id, __wf_fn);
@@ -48020,7 +48238,7 @@ var Run = class _Run {
48020
48238
  value: "createdAt",
48021
48239
  configurable: true
48022
48240
  });
48023
- })(Object.getOwnPropertyDescriptor(Run.prototype, "createdAt").get, "step//@workflow/core/runtime/run@5.0.0//Run#createdAt");
48241
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "createdAt").get, "step//@workflow/core/runtime/run@5.0.1//Run#createdAt");
48024
48242
  (function(__wf_fn, __wf_id) {
48025
48243
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
48026
48244
  __wf_reg.set(__wf_id, __wf_fn);
@@ -48029,7 +48247,7 @@ var Run = class _Run {
48029
48247
  value: "startedAt",
48030
48248
  configurable: true
48031
48249
  });
48032
- })(Object.getOwnPropertyDescriptor(Run.prototype, "startedAt").get, "step//@workflow/core/runtime/run@5.0.0//Run#startedAt");
48250
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "startedAt").get, "step//@workflow/core/runtime/run@5.0.1//Run#startedAt");
48033
48251
  (function(__wf_fn, __wf_id) {
48034
48252
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
48035
48253
  __wf_reg.set(__wf_id, __wf_fn);
@@ -48038,7 +48256,7 @@ var Run = class _Run {
48038
48256
  value: "completedAt",
48039
48257
  configurable: true
48040
48258
  });
48041
- })(Object.getOwnPropertyDescriptor(Run.prototype, "completedAt").get, "step//@workflow/core/runtime/run@5.0.0//Run#completedAt");
48259
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "completedAt").get, "step//@workflow/core/runtime/run@5.0.1//Run#completedAt");
48042
48260
  (function(__wf_cls, __wf_id) {
48043
48261
  var __wf_sym = /* @__PURE__ */ Symbol.for("workflow-class-registry"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
48044
48262
  __wf_reg.set(__wf_id, __wf_cls);
@@ -48048,7 +48266,7 @@ var Run = class _Run {
48048
48266
  enumerable: false,
48049
48267
  configurable: false
48050
48268
  });
48051
- })(Run, "class//@workflow/core/runtime/run@5.0.0//Run");
48269
+ })(Run, "class//@workflow/core/runtime/run@5.0.1//Run");
48052
48270
 
48053
48271
  // ../workflow/dist/stdlib.js
48054
48272
  async function fetch2(...args) {