@workflow/world-testing 5.0.0-beta.26 → 5.0.0-beta.28

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.
@@ -44,17 +44,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
44
44
  mod
45
45
  ));
46
46
 
47
- // ../utils/dist/pluralize.js
48
- function pluralize(singular, plural, count2) {
49
- return count2 === 1 ? singular : plural;
50
- }
51
- var init_pluralize = __esm({
52
- "../utils/dist/pluralize.js"() {
53
- "use strict";
54
- __name(pluralize, "pluralize");
55
- }
56
- });
57
-
58
47
  // ../utils/dist/parse-name.js
59
48
  function parseName(tag, name) {
60
49
  if (typeof name !== "string") {
@@ -134,6 +123,17 @@ var init_parse_name = __esm({
134
123
  }
135
124
  });
136
125
 
126
+ // ../utils/dist/pluralize.js
127
+ function pluralize(singular, plural, count2) {
128
+ return count2 === 1 ? singular : plural;
129
+ }
130
+ var init_pluralize = __esm({
131
+ "../utils/dist/pluralize.js"() {
132
+ "use strict";
133
+ __name(pluralize, "pluralize");
134
+ }
135
+ });
136
+
137
137
  // ../utils/dist/promise.js
138
138
  function withResolvers() {
139
139
  let resolve;
@@ -313,6 +313,13 @@ var init_time = __esm({
313
313
  }
314
314
  });
315
315
 
316
+ // ../utils/dist/workflow-routes.js
317
+ var init_workflow_routes = __esm({
318
+ "../utils/dist/workflow-routes.js"() {
319
+ "use strict";
320
+ }
321
+ });
322
+
316
323
  // ../utils/dist/world-target.js
317
324
  var init_world_target = __esm({
318
325
  "../utils/dist/world-target.js"() {
@@ -324,10 +331,11 @@ var init_world_target = __esm({
324
331
  var init_dist = __esm({
325
332
  "../utils/dist/index.js"() {
326
333
  "use strict";
327
- init_pluralize();
328
334
  init_parse_name();
335
+ init_pluralize();
329
336
  init_promise();
330
337
  init_time();
338
+ init_workflow_routes();
331
339
  init_world_target();
332
340
  }
333
341
  });
@@ -515,8 +523,6 @@ Caused by: ${options.cause.stack}`;
515
523
  static {
516
524
  __name(this, "RuntimeDecryptionError");
517
525
  }
518
- /** Optional structured context about the failed encrypt/decrypt call. */
519
- context;
520
526
  constructor(message, options) {
521
527
  super(message, {
522
528
  cause: options?.cause,
@@ -16494,7 +16500,7 @@ var init_serialization = __esm({
16494
16500
  });
16495
16501
 
16496
16502
  // ../world/dist/events.js
16497
- var EventTypeSchema, BaseEventSchema, StepCompletedEventSchema, StepFailedEventSchema, StepRetryingEventSchema, StepStartedEventSchema, StepCreatedEventSchema, HookCreatedEventSchema, HookReceivedEventSchema, HookDisposedEventSchema, HookConflictEventSchema, WaitCreatedEventSchema, WaitCompletedEventSchema, AttributeWriterSchema, AttrSetEventSchema, RunCreatedEventSchema, RunStartedEventSchema, RunCompletedEventSchema, RunFailedEventSchema, RunCancelledEventSchema, CreateEventSchema, AllEventsSchema, EventSchema;
16503
+ var EventTypeSchema, TerminalRunEventTypeSchema, TERMINAL_RUN_EVENT_TYPES, BaseEventSchema, StepCompletedEventSchema, StepFailedEventSchema, StepRetryingEventSchema, StepStartedEventSchema, StepCreatedEventSchema, HookCreatedEventSchema, HookReceivedEventSchema, HookDisposedEventSchema, HookConflictEventSchema, WaitCreatedEventSchema, WaitCompletedEventSchema, AttributeWriterSchema, AttrSetEventSchema, RunCreatedEventSchema, RunStartedEventSchema, RunCompletedEventSchema, RunFailedEventSchema, RunCancelledEventSchema, CreateEventSchema, AllEventsSchema, EventSchema;
16498
16504
  var init_events = __esm({
16499
16505
  "../world/dist/events.js"() {
16500
16506
  "use strict";
@@ -16525,6 +16531,12 @@ var init_events = __esm({
16525
16531
  "wait_created",
16526
16532
  "wait_completed"
16527
16533
  ]);
16534
+ TerminalRunEventTypeSchema = EventTypeSchema.extract([
16535
+ "run_completed",
16536
+ "run_failed",
16537
+ "run_cancelled"
16538
+ ]);
16539
+ TERMINAL_RUN_EVENT_TYPES = TerminalRunEventTypeSchema.options;
16528
16540
  BaseEventSchema = external_exports.object({
16529
16541
  eventType: EventTypeSchema,
16530
16542
  correlationId: external_exports.string().optional(),
@@ -16753,134 +16765,8 @@ var init_events = __esm({
16753
16765
  }
16754
16766
  });
16755
16767
 
16756
- // ../world/dist/hooks.js
16757
- var HookSchema;
16758
- var init_hooks = __esm({
16759
- "../world/dist/hooks.js"() {
16760
- "use strict";
16761
- init_zod();
16762
- init_serialization();
16763
- HookSchema = external_exports.object({
16764
- runId: external_exports.string(),
16765
- hookId: external_exports.string(),
16766
- token: external_exports.string(),
16767
- ownerId: external_exports.string(),
16768
- projectId: external_exports.string(),
16769
- environment: external_exports.string(),
16770
- metadata: SerializedDataSchema.optional(),
16771
- createdAt: external_exports.coerce.date(),
16772
- // Optional in database for backwards compatibility, defaults to 1 (legacy) when reading
16773
- specVersion: external_exports.number().optional(),
16774
- isWebhook: external_exports.boolean().optional(),
16775
- isSystem: external_exports.boolean().optional()
16776
- });
16777
- }
16778
- });
16779
-
16780
- // ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/index.js
16781
- var init_classic = __esm({
16782
- "../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/index.js"() {
16783
- "use strict";
16784
- init_external();
16785
- init_external();
16786
- }
16787
- });
16788
-
16789
- // ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/index.js
16790
- var init_v4 = __esm({
16791
- "../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/index.js"() {
16792
- "use strict";
16793
- init_classic();
16794
- init_classic();
16795
- }
16796
- });
16797
-
16798
- // ../world/dist/queue.js
16799
- function resolveQueueNamespace(namespace) {
16800
- return namespace ?? process.env.WORKFLOW_QUEUE_NAMESPACE ?? void 0;
16801
- }
16802
- function getQueueTopicPrefix(kind, namespace) {
16803
- if (namespace !== void 0) {
16804
- QueueNamespace.parse(namespace);
16805
- return `__${namespace}_wkf_${kind}_`;
16806
- }
16807
- return `__wkf_${kind}_`;
16808
- }
16809
- var QueuePrefix, ValidQueueName, QueueNamespace, MessageId, TraceCarrierSchema, RunInputSchema, WorkflowInvokePayloadSchema, StepInvokePayloadSchema, HealthCheckPayloadSchema, QueuePayloadSchema;
16810
- var init_queue = __esm({
16811
- "../world/dist/queue.js"() {
16812
- "use strict";
16813
- init_v4();
16814
- QueuePrefix = external_exports.string().regex(/^__(?:[a-z][a-z0-9]*_)?wkf_(?:workflow|step)_$/, "Must match __wkf_{workflow|step}_ or __{namespace}_wkf_{workflow|step}_");
16815
- ValidQueueName = external_exports.string().regex(/^__(?:[a-z][a-z0-9]*_)?wkf_(?:workflow|step)_.+$/, "Must be a valid queue name with a recognized prefix");
16816
- QueueNamespace = external_exports.string().regex(/^[a-z][a-z0-9]*$/, "Must be lowercase alphanumeric, starting with a letter");
16817
- __name(resolveQueueNamespace, "resolveQueueNamespace");
16818
- __name(getQueueTopicPrefix, "getQueueTopicPrefix");
16819
- MessageId = external_exports.string().brand().describe("A stored queue message ID");
16820
- TraceCarrierSchema = external_exports.record(external_exports.string(), external_exports.string());
16821
- RunInputSchema = external_exports.object({
16822
- input: external_exports.unknown(),
16823
- deploymentId: external_exports.string(),
16824
- workflowName: external_exports.string(),
16825
- specVersion: external_exports.number(),
16826
- executionContext: external_exports.record(external_exports.string(), external_exports.any()).optional(),
16827
- /** Initial plaintext run attributes, for resilient run creation. */
16828
- attributes: external_exports.record(external_exports.string(), external_exports.string()).optional(),
16829
- /**
16830
- * Permits reserved `$`-prefixed keys in `attributes`, mirrored from the
16831
- * `start()` option so resilient run creation validates the same way as
16832
- * the original `run_created` attempt.
16833
- */
16834
- allowReservedAttributes: external_exports.literal(true).optional()
16835
- });
16836
- WorkflowInvokePayloadSchema = external_exports.object({
16837
- runId: external_exports.string(),
16838
- traceCarrier: TraceCarrierSchema.optional(),
16839
- requestedAt: external_exports.coerce.date().optional(),
16840
- /** Consecutive replay divergences in this recovery chain and latest position. */
16841
- replayDivergence: external_exports.object({
16842
- eventId: external_exports.string(),
16843
- count: external_exports.number().int().positive()
16844
- }).optional(),
16845
- /** Number of times this message has been re-enqueued due to server errors (5xx) */
16846
- serverErrorRetryCount: external_exports.number().int().optional(),
16847
- /** Step ID for inline step execution in combined handler. If provided, the flow execution
16848
- * will jump directly to execute the step with the given ID before doing an event replay. */
16849
- stepId: external_exports.string().optional(),
16850
- /** Step name, sent alongside stepId to avoid loading the event log just to resolve the name. */
16851
- stepName: external_exports.string().optional(),
16852
- /** Run creation data, only present on the first queue delivery from start() */
16853
- runInput: RunInputSchema.optional()
16854
- });
16855
- StepInvokePayloadSchema = external_exports.object({
16856
- workflowName: external_exports.string(),
16857
- workflowRunId: external_exports.string(),
16858
- workflowStartedAt: external_exports.number(),
16859
- stepId: external_exports.string(),
16860
- traceCarrier: TraceCarrierSchema.optional(),
16861
- requestedAt: external_exports.coerce.date().optional()
16862
- });
16863
- HealthCheckPayloadSchema = external_exports.object({
16864
- __healthCheck: external_exports.literal(true),
16865
- correlationId: external_exports.string()
16866
- });
16867
- QueuePayloadSchema = external_exports.union([
16868
- WorkflowInvokePayloadSchema,
16869
- StepInvokePayloadSchema,
16870
- HealthCheckPayloadSchema
16871
- ]);
16872
- }
16873
- });
16874
-
16875
- // ../world/dist/recovery.js
16876
- var init_recovery = __esm({
16877
- "../world/dist/recovery.js"() {
16878
- "use strict";
16879
- }
16880
- });
16881
-
16882
16768
  // ../world/dist/runs.js
16883
- var WorkflowRunStatusSchema, WorkflowRunBaseSchema, WorkflowRunSchema;
16769
+ var WorkflowRunStatusSchema, TerminalWorkflowRunStatusSchema, TERMINAL_WORKFLOW_RUN_STATUSES, WorkflowRunBaseSchema, WorkflowRunSchema;
16884
16770
  var init_runs = __esm({
16885
16771
  "../world/dist/runs.js"() {
16886
16772
  "use strict";
@@ -16893,6 +16779,12 @@ var init_runs = __esm({
16893
16779
  "failed",
16894
16780
  "cancelled"
16895
16781
  ]);
16782
+ TerminalWorkflowRunStatusSchema = WorkflowRunStatusSchema.extract([
16783
+ "completed",
16784
+ "failed",
16785
+ "cancelled"
16786
+ ]);
16787
+ TERMINAL_WORKFLOW_RUN_STATUSES = TerminalWorkflowRunStatusSchema.options;
16896
16788
  WorkflowRunBaseSchema = external_exports.object({
16897
16789
  runId: external_exports.string(),
16898
16790
  status: WorkflowRunStatusSchema,
@@ -16997,50 +16889,8 @@ var init_runs = __esm({
16997
16889
  }
16998
16890
  });
16999
16891
 
17000
- // ../world/dist/shared.js
17001
- var zodJsonSchema, StructuredErrorSchema;
17002
- var init_shared = __esm({
17003
- "../world/dist/shared.js"() {
17004
- "use strict";
17005
- init_zod();
17006
- zodJsonSchema = external_exports.lazy(() => {
17007
- return external_exports.union([
17008
- external_exports.string(),
17009
- external_exports.number(),
17010
- external_exports.boolean(),
17011
- external_exports.null(),
17012
- external_exports.array(zodJsonSchema),
17013
- external_exports.record(external_exports.string(), zodJsonSchema)
17014
- ]);
17015
- });
17016
- StructuredErrorSchema = external_exports.object({
17017
- message: external_exports.string(),
17018
- stack: external_exports.string().optional(),
17019
- code: external_exports.string().optional()
17020
- });
17021
- }
17022
- });
17023
-
17024
- // ../world/dist/spec-version.js
17025
- function isLegacySpecVersion(v) {
17026
- return v === void 0 || v === null || v <= SPEC_VERSION_LEGACY;
17027
- }
17028
- var SPEC_VERSION_LEGACY, SPEC_VERSION_SUPPORTS_EVENT_SOURCING, SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT, SPEC_VERSION_SUPPORTS_ATTRIBUTES, SPEC_VERSION_SUPPORTS_COMPRESSION, SPEC_VERSION_CURRENT;
17029
- var init_spec_version = __esm({
17030
- "../world/dist/spec-version.js"() {
17031
- "use strict";
17032
- SPEC_VERSION_LEGACY = 1;
17033
- SPEC_VERSION_SUPPORTS_EVENT_SOURCING = 2;
17034
- SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT = 3;
17035
- SPEC_VERSION_SUPPORTS_ATTRIBUTES = 4;
17036
- SPEC_VERSION_SUPPORTS_COMPRESSION = 5;
17037
- SPEC_VERSION_CURRENT = SPEC_VERSION_SUPPORTS_COMPRESSION;
17038
- __name(isLegacySpecVersion, "isLegacySpecVersion");
17039
- }
17040
- });
17041
-
17042
16892
  // ../world/dist/steps.js
17043
- var StepStatusSchema, StepSchema;
16893
+ var StepStatusSchema, StepSchema, TerminalStepStatusSchema, TERMINAL_STEP_STATUSES;
17044
16894
  var init_steps = __esm({
17045
16895
  "../world/dist/steps.js"() {
17046
16896
  "use strict";
@@ -17104,6 +16954,342 @@ var init_steps = __esm({
17104
16954
  // Optional in database for backwards compatibility, defaults to 1 (legacy) when reading
17105
16955
  specVersion: external_exports.number().optional()
17106
16956
  });
16957
+ TerminalStepStatusSchema = StepStatusSchema.extract([
16958
+ "completed",
16959
+ "failed",
16960
+ "cancelled"
16961
+ ]);
16962
+ TERMINAL_STEP_STATUSES = TerminalStepStatusSchema.options;
16963
+ }
16964
+ });
16965
+
16966
+ // ../world/dist/waits.js
16967
+ var WaitStatusSchema, WaitSchema;
16968
+ var init_waits = __esm({
16969
+ "../world/dist/waits.js"() {
16970
+ "use strict";
16971
+ init_zod();
16972
+ WaitStatusSchema = external_exports.enum([
16973
+ "waiting",
16974
+ "completed"
16975
+ ]);
16976
+ WaitSchema = external_exports.object({
16977
+ waitId: external_exports.string(),
16978
+ runId: external_exports.string(),
16979
+ status: WaitStatusSchema,
16980
+ resumeAt: external_exports.coerce.date().optional(),
16981
+ completedAt: external_exports.coerce.date().optional(),
16982
+ createdAt: external_exports.coerce.date(),
16983
+ updatedAt: external_exports.coerce.date(),
16984
+ specVersion: external_exports.number().optional()
16985
+ });
16986
+ }
16987
+ });
16988
+
16989
+ // ../world/dist/analytics.js
16990
+ var NullableDateSchema, NullableStringSchema, NullableBooleanSchema, AnalyticsRunSchema, AnalyticsStepSchema, AnalyticsEventSchema, AnalyticsHookSchema, AnalyticsWaitSchema;
16991
+ var init_analytics = __esm({
16992
+ "../world/dist/analytics.js"() {
16993
+ "use strict";
16994
+ init_zod();
16995
+ init_events();
16996
+ init_runs();
16997
+ init_steps();
16998
+ init_waits();
16999
+ NullableDateSchema = external_exports.coerce.date().nullable().optional();
17000
+ NullableStringSchema = external_exports.string().nullable().optional();
17001
+ NullableBooleanSchema = external_exports.boolean().nullable().optional();
17002
+ AnalyticsRunSchema = external_exports.object({
17003
+ runId: external_exports.string(),
17004
+ status: WorkflowRunStatusSchema,
17005
+ deploymentId: external_exports.string(),
17006
+ workflowName: external_exports.string(),
17007
+ specVersion: external_exports.coerce.number().optional(),
17008
+ attributes: external_exports.record(external_exports.string(), external_exports.string()).default({}),
17009
+ createdAt: external_exports.coerce.date(),
17010
+ updatedAt: external_exports.coerce.date(),
17011
+ startedAt: NullableDateSchema,
17012
+ completedAt: NullableDateSchema,
17013
+ errorCode: NullableStringSchema,
17014
+ workflowCoreVersion: NullableStringSchema,
17015
+ workflowEncryptionEnabled: NullableBooleanSchema
17016
+ });
17017
+ AnalyticsStepSchema = external_exports.object({
17018
+ runId: external_exports.string(),
17019
+ stepId: external_exports.string(),
17020
+ stepName: NullableStringSchema,
17021
+ status: StepStatusSchema,
17022
+ attempt: external_exports.number().optional(),
17023
+ createdAt: external_exports.coerce.date(),
17024
+ updatedAt: external_exports.coerce.date(),
17025
+ startedAt: NullableDateSchema,
17026
+ completedAt: NullableDateSchema,
17027
+ retryAfter: NullableDateSchema,
17028
+ errorCode: NullableStringSchema,
17029
+ workflowCoreVersion: NullableStringSchema,
17030
+ workflowEncryptionEnabled: NullableBooleanSchema
17031
+ });
17032
+ AnalyticsEventSchema = external_exports.object({
17033
+ runId: external_exports.string(),
17034
+ eventId: external_exports.string(),
17035
+ eventType: EventTypeSchema,
17036
+ correlationId: NullableStringSchema,
17037
+ entityId: NullableStringSchema,
17038
+ stepName: NullableStringSchema,
17039
+ workflowName: external_exports.string(),
17040
+ deploymentId: external_exports.string(),
17041
+ specVersion: external_exports.coerce.number().optional(),
17042
+ runCreatedAt: external_exports.coerce.date(),
17043
+ createdAt: external_exports.coerce.date(),
17044
+ region: NullableStringSchema,
17045
+ vercelId: NullableStringSchema,
17046
+ requestId: NullableStringSchema,
17047
+ resumeAt: NullableDateSchema,
17048
+ retryAfter: NullableDateSchema,
17049
+ errorCode: NullableStringSchema,
17050
+ workflowCoreVersion: NullableStringSchema,
17051
+ isWebhook: NullableBooleanSchema,
17052
+ isSystem: NullableBooleanSchema,
17053
+ workflowEncryptionEnabled: NullableBooleanSchema
17054
+ });
17055
+ AnalyticsHookSchema = external_exports.object({
17056
+ runId: external_exports.string(),
17057
+ hookId: external_exports.string(),
17058
+ status: external_exports.enum([
17059
+ "created",
17060
+ "received",
17061
+ "disposed",
17062
+ "conflict"
17063
+ ]),
17064
+ createdAt: external_exports.coerce.date(),
17065
+ updatedAt: external_exports.coerce.date(),
17066
+ receivedAt: NullableDateSchema,
17067
+ disposedAt: NullableDateSchema,
17068
+ isWebhook: NullableBooleanSchema,
17069
+ isSystem: NullableBooleanSchema,
17070
+ workflowCoreVersion: NullableStringSchema,
17071
+ workflowEncryptionEnabled: NullableBooleanSchema
17072
+ });
17073
+ AnalyticsWaitSchema = external_exports.object({
17074
+ runId: external_exports.string(),
17075
+ waitId: external_exports.string(),
17076
+ status: WaitStatusSchema,
17077
+ resumeAt: NullableDateSchema,
17078
+ createdAt: external_exports.coerce.date(),
17079
+ updatedAt: external_exports.coerce.date(),
17080
+ completedAt: NullableDateSchema,
17081
+ workflowCoreVersion: NullableStringSchema,
17082
+ workflowEncryptionEnabled: NullableBooleanSchema
17083
+ });
17084
+ }
17085
+ });
17086
+
17087
+ // ../world/dist/env-config.js
17088
+ function warnOnce(key, message) {
17089
+ if (warnedEnvValues.has(key)) return;
17090
+ warnedEnvValues.add(key);
17091
+ console.warn(`[workflow] ${message}`);
17092
+ }
17093
+ function envNumber(name, fallback, options = {}) {
17094
+ const raw = process.env[name];
17095
+ if (raw === void 0 || raw === "") return fallback;
17096
+ const { min = 0, max, integer: integer2 = false } = options;
17097
+ const parsed = Number(raw);
17098
+ if (!Number.isFinite(parsed) || integer2 && !Number.isInteger(parsed)) {
17099
+ warnOnce(`${name}=${raw}`, `Ignoring ${name}: not a ${integer2 ? "finite integer" : "finite number"}; using default ${fallback}`);
17100
+ return fallback;
17101
+ }
17102
+ if (parsed < min) {
17103
+ warnOnce(`${name}=${raw}`, `${name} below minimum ${min}; clamped`);
17104
+ return min;
17105
+ }
17106
+ if (max !== void 0 && parsed > max) {
17107
+ warnOnce(`${name}=${raw}`, `${name} above maximum ${max}; clamped`);
17108
+ return max;
17109
+ }
17110
+ return parsed;
17111
+ }
17112
+ var warnedEnvValues;
17113
+ var init_env_config = __esm({
17114
+ "../world/dist/env-config.js"() {
17115
+ "use strict";
17116
+ warnedEnvValues = /* @__PURE__ */ new Set();
17117
+ __name(warnOnce, "warnOnce");
17118
+ __name(envNumber, "envNumber");
17119
+ }
17120
+ });
17121
+
17122
+ // ../world/dist/hooks.js
17123
+ var HookSchema;
17124
+ var init_hooks = __esm({
17125
+ "../world/dist/hooks.js"() {
17126
+ "use strict";
17127
+ init_zod();
17128
+ init_serialization();
17129
+ HookSchema = external_exports.object({
17130
+ runId: external_exports.string(),
17131
+ hookId: external_exports.string(),
17132
+ token: external_exports.string(),
17133
+ ownerId: external_exports.string(),
17134
+ projectId: external_exports.string(),
17135
+ environment: external_exports.string(),
17136
+ metadata: SerializedDataSchema.optional(),
17137
+ createdAt: external_exports.coerce.date(),
17138
+ // Optional in database for backwards compatibility, defaults to 1 (legacy) when reading
17139
+ specVersion: external_exports.number().optional(),
17140
+ isWebhook: external_exports.boolean().optional(),
17141
+ isSystem: external_exports.boolean().optional()
17142
+ });
17143
+ }
17144
+ });
17145
+
17146
+ // ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/index.js
17147
+ var init_classic = __esm({
17148
+ "../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/index.js"() {
17149
+ "use strict";
17150
+ init_external();
17151
+ init_external();
17152
+ }
17153
+ });
17154
+
17155
+ // ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/index.js
17156
+ var init_v4 = __esm({
17157
+ "../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/index.js"() {
17158
+ "use strict";
17159
+ init_classic();
17160
+ init_classic();
17161
+ }
17162
+ });
17163
+
17164
+ // ../world/dist/queue.js
17165
+ function resolveQueueNamespace(namespace) {
17166
+ return namespace ?? process.env.WORKFLOW_QUEUE_NAMESPACE ?? void 0;
17167
+ }
17168
+ function getQueueTopicPrefix(kind, namespace) {
17169
+ if (namespace !== void 0) {
17170
+ QueueNamespace.parse(namespace);
17171
+ return `__${namespace}_wkf_${kind}_`;
17172
+ }
17173
+ return `__wkf_${kind}_`;
17174
+ }
17175
+ var QueuePrefix, ValidQueueName, QueueNamespace, MessageId, TraceCarrierSchema, RunInputSchema, WorkflowInvokePayloadSchema, StepInvokePayloadSchema, HealthCheckPayloadSchema, QueuePayloadSchema;
17176
+ var init_queue = __esm({
17177
+ "../world/dist/queue.js"() {
17178
+ "use strict";
17179
+ init_v4();
17180
+ QueuePrefix = external_exports.string().regex(/^__(?:[a-z][a-z0-9]*_)?wkf_(?:workflow|step)_$/, "Must match __wkf_{workflow|step}_ or __{namespace}_wkf_{workflow|step}_");
17181
+ ValidQueueName = external_exports.string().regex(/^__(?:[a-z][a-z0-9]*_)?wkf_(?:workflow|step)_.+$/, "Must be a valid queue name with a recognized prefix");
17182
+ QueueNamespace = external_exports.string().regex(/^[a-z][a-z0-9]*$/, "Must be lowercase alphanumeric, starting with a letter");
17183
+ __name(resolveQueueNamespace, "resolveQueueNamespace");
17184
+ __name(getQueueTopicPrefix, "getQueueTopicPrefix");
17185
+ MessageId = external_exports.string().brand().describe("A stored queue message ID");
17186
+ TraceCarrierSchema = external_exports.record(external_exports.string(), external_exports.string());
17187
+ RunInputSchema = external_exports.object({
17188
+ input: external_exports.unknown(),
17189
+ deploymentId: external_exports.string(),
17190
+ workflowName: external_exports.string(),
17191
+ specVersion: external_exports.number(),
17192
+ executionContext: external_exports.record(external_exports.string(), external_exports.any()).optional(),
17193
+ /** Initial plaintext run attributes, for resilient run creation. */
17194
+ attributes: external_exports.record(external_exports.string(), external_exports.string()).optional(),
17195
+ /**
17196
+ * Permits reserved `$`-prefixed keys in `attributes`, mirrored from the
17197
+ * `start()` option so resilient run creation validates the same way as
17198
+ * the original `run_created` attempt.
17199
+ */
17200
+ allowReservedAttributes: external_exports.literal(true).optional()
17201
+ });
17202
+ WorkflowInvokePayloadSchema = external_exports.object({
17203
+ runId: external_exports.string(),
17204
+ traceCarrier: TraceCarrierSchema.optional(),
17205
+ requestedAt: external_exports.coerce.date().optional(),
17206
+ /** Consecutive replay divergences in this recovery chain and latest position. */
17207
+ replayDivergence: external_exports.object({
17208
+ eventId: external_exports.string(),
17209
+ count: external_exports.number().int().positive()
17210
+ }).optional(),
17211
+ /** Number of times this message has been re-enqueued due to server errors (5xx) */
17212
+ serverErrorRetryCount: external_exports.number().int().optional(),
17213
+ /** Step ID for inline step execution in combined handler. If provided, the flow execution
17214
+ * will jump directly to execute the step with the given ID before doing an event replay. */
17215
+ stepId: external_exports.string().optional(),
17216
+ /** Step name, sent alongside stepId to avoid loading the event log just to resolve the name. */
17217
+ stepName: external_exports.string().optional(),
17218
+ /** Run creation data, only present on the first queue delivery from start() */
17219
+ runInput: RunInputSchema.optional()
17220
+ });
17221
+ StepInvokePayloadSchema = external_exports.object({
17222
+ workflowName: external_exports.string(),
17223
+ workflowRunId: external_exports.string(),
17224
+ workflowStartedAt: external_exports.number(),
17225
+ stepId: external_exports.string(),
17226
+ traceCarrier: TraceCarrierSchema.optional(),
17227
+ requestedAt: external_exports.coerce.date().optional()
17228
+ });
17229
+ HealthCheckPayloadSchema = external_exports.object({
17230
+ __healthCheck: external_exports.literal(true),
17231
+ correlationId: external_exports.string()
17232
+ });
17233
+ QueuePayloadSchema = external_exports.union([
17234
+ WorkflowInvokePayloadSchema,
17235
+ StepInvokePayloadSchema,
17236
+ HealthCheckPayloadSchema
17237
+ ]);
17238
+ }
17239
+ });
17240
+
17241
+ // ../world/dist/recovery.js
17242
+ var init_recovery = __esm({
17243
+ "../world/dist/recovery.js"() {
17244
+ "use strict";
17245
+ }
17246
+ });
17247
+
17248
+ // ../world/dist/shared.js
17249
+ var zodJsonSchema, PageInfoSchema, StructuredErrorSchema;
17250
+ var init_shared = __esm({
17251
+ "../world/dist/shared.js"() {
17252
+ "use strict";
17253
+ init_zod();
17254
+ zodJsonSchema = external_exports.lazy(() => {
17255
+ return external_exports.union([
17256
+ external_exports.string(),
17257
+ external_exports.number(),
17258
+ external_exports.boolean(),
17259
+ external_exports.null(),
17260
+ external_exports.array(zodJsonSchema),
17261
+ external_exports.record(external_exports.string(), zodJsonSchema)
17262
+ ]);
17263
+ });
17264
+ PageInfoSchema = external_exports.object({
17265
+ currentLookbackDays: external_exports.number(),
17266
+ maxLookbackDays: external_exports.number(),
17267
+ currentWindowStart: external_exports.coerce.date(),
17268
+ maxWindowStart: external_exports.coerce.date(),
17269
+ upgradeAvailable: external_exports.boolean()
17270
+ });
17271
+ StructuredErrorSchema = external_exports.object({
17272
+ message: external_exports.string(),
17273
+ stack: external_exports.string().optional(),
17274
+ code: external_exports.string().optional()
17275
+ });
17276
+ }
17277
+ });
17278
+
17279
+ // ../world/dist/spec-version.js
17280
+ function isLegacySpecVersion(v) {
17281
+ return v === void 0 || v === null || v <= SPEC_VERSION_LEGACY;
17282
+ }
17283
+ var SPEC_VERSION_LEGACY, SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT, SPEC_VERSION_SUPPORTS_ATTRIBUTES, SPEC_VERSION_SUPPORTS_COMPRESSION, SPEC_VERSION_CURRENT;
17284
+ var init_spec_version = __esm({
17285
+ "../world/dist/spec-version.js"() {
17286
+ "use strict";
17287
+ SPEC_VERSION_LEGACY = 1;
17288
+ SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT = 3;
17289
+ SPEC_VERSION_SUPPORTS_ATTRIBUTES = 4;
17290
+ SPEC_VERSION_SUPPORTS_COMPRESSION = 5;
17291
+ SPEC_VERSION_CURRENT = SPEC_VERSION_SUPPORTS_COMPRESSION;
17292
+ __name(isLegacySpecVersion, "isLegacySpecVersion");
17107
17293
  }
17108
17294
  });
17109
17295
 
@@ -17265,34 +17451,13 @@ var init_ulid = __esm({
17265
17451
  }
17266
17452
  });
17267
17453
 
17268
- // ../world/dist/waits.js
17269
- var WaitStatusSchema, WaitSchema;
17270
- var init_waits = __esm({
17271
- "../world/dist/waits.js"() {
17272
- "use strict";
17273
- init_zod();
17274
- WaitStatusSchema = external_exports.enum([
17275
- "waiting",
17276
- "completed"
17277
- ]);
17278
- WaitSchema = external_exports.object({
17279
- waitId: external_exports.string(),
17280
- runId: external_exports.string(),
17281
- status: WaitStatusSchema,
17282
- resumeAt: external_exports.coerce.date().optional(),
17283
- completedAt: external_exports.coerce.date().optional(),
17284
- createdAt: external_exports.coerce.date(),
17285
- updatedAt: external_exports.coerce.date(),
17286
- specVersion: external_exports.number().optional()
17287
- });
17288
- }
17289
- });
17290
-
17291
17454
  // ../world/dist/index.js
17292
17455
  var init_dist4 = __esm({
17293
17456
  "../world/dist/index.js"() {
17294
17457
  "use strict";
17458
+ init_analytics();
17295
17459
  init_attributes();
17460
+ init_env_config();
17296
17461
  init_events();
17297
17462
  init_hooks();
17298
17463
  init_queue();
@@ -18082,7 +18247,7 @@ function pollWritableLock(writable, state) {
18082
18247
  clearInterval(intervalId);
18083
18248
  state.writablePollingInterval = void 0;
18084
18249
  }
18085
- }, LOCK_POLL_INTERVAL_MS);
18250
+ }, getLockPollIntervalMs());
18086
18251
  state.writablePollingInterval = intervalId;
18087
18252
  }
18088
18253
  function pollReadableLock(readable, state) {
@@ -18101,7 +18266,7 @@ function pollReadableLock(readable, state) {
18101
18266
  clearInterval(intervalId);
18102
18267
  state.readablePollingInterval = void 0;
18103
18268
  }
18104
- }, LOCK_POLL_INTERVAL_MS);
18269
+ }, getLockPollIntervalMs());
18105
18270
  state.readablePollingInterval = intervalId;
18106
18271
  }
18107
18272
  async function flushablePipe(source, sink, state) {
@@ -18153,13 +18318,18 @@ async function flushablePipe(source, sink, state) {
18153
18318
  writer.releaseLock();
18154
18319
  }
18155
18320
  }
18156
- var LOCK_POLL_INTERVAL_MS;
18321
+ var LOCK_POLL_INTERVAL_MS, getLockPollIntervalMs;
18157
18322
  var init_flushable_stream = __esm({
18158
18323
  "../core/dist/flushable-stream.js"() {
18159
18324
  "use strict";
18160
18325
  init_dist2();
18161
18326
  init_dist();
18327
+ init_dist4();
18162
18328
  LOCK_POLL_INTERVAL_MS = 10;
18329
+ getLockPollIntervalMs = /* @__PURE__ */ __name(() => envNumber("WORKFLOW_LOCK_POLL_INTERVAL_MS", LOCK_POLL_INTERVAL_MS, {
18330
+ integer: true,
18331
+ min: 1
18332
+ }), "getLockPollIntervalMs");
18163
18333
  __name(createFlushableState, "createFlushableState");
18164
18334
  __name(isWritableUnlockedNotClosed, "isWritableUnlockedNotClosed");
18165
18335
  __name(isReadableUnlockedNotClosed, "isReadableUnlockedNotClosed");
@@ -18245,27 +18415,48 @@ var init_private = __esm({
18245
18415
  }
18246
18416
  });
18247
18417
 
18418
+ // ../core/dist/runtime/world-compatibility.js
18419
+ function assertWorldSupportsRuntimeProtocol(world) {
18420
+ if (world.specVersion === SPEC_VERSION_CURRENT) {
18421
+ return;
18422
+ }
18423
+ const supportedVersion = world.specVersion ?? "none";
18424
+ throw new WorkflowRuntimeError(`This Workflow runtime requires a World with matching spec version ${SPEC_VERSION_CURRENT}, but the configured World declares spec version ${supportedVersion}. Install a World package version compatible with the current Workflow runtime.`);
18425
+ }
18426
+ var init_world_compatibility = __esm({
18427
+ "../core/dist/runtime/world-compatibility.js"() {
18428
+ "use strict";
18429
+ init_dist2();
18430
+ init_dist4();
18431
+ __name(assertWorldSupportsRuntimeProtocol, "assertWorldSupportsRuntimeProtocol");
18432
+ }
18433
+ });
18434
+
18248
18435
  // ../core/dist/runtime/get-world-lazy.js
18249
18436
  async function getWorldLazy() {
18250
18437
  const g = globalThis;
18251
- if (g[WorldCacheKey]) return g[WorldCacheKey];
18438
+ if (g[WorldCacheKey]) {
18439
+ assertWorldSupportsRuntimeProtocol(g[WorldCacheKey]);
18440
+ return g[WorldCacheKey];
18441
+ }
18252
18442
  if (g[WorldCachePromiseKey]) {
18253
18443
  g[WorldCacheKey] = await g[WorldCachePromiseKey];
18444
+ assertWorldSupportsRuntimeProtocol(g[WorldCacheKey]);
18254
18445
  return g[WorldCacheKey];
18255
18446
  }
18256
18447
  const getWorldFn = g[GetWorldFnKey];
18257
- if (getWorldFn) return getWorldFn();
18258
- const worldPath = [
18259
- "./world",
18260
- "js"
18261
- ].join(".");
18262
- const { getWorld } = await import(worldPath);
18263
- return getWorld();
18448
+ if (getWorldFn) {
18449
+ const world = await getWorldFn();
18450
+ assertWorldSupportsRuntimeProtocol(world);
18451
+ return world;
18452
+ }
18453
+ throw new Error("Workflow world runtime was not initialized. Import from the host workflow entrypoints (`workflow`, `workflow/api`, or `workflow/runtime`) so @workflow/core/runtime/world-init can register getWorld before getWorldLazy() is used.");
18264
18454
  }
18265
18455
  var WorldCacheKey, WorldCachePromiseKey, GetWorldFnKey;
18266
18456
  var init_get_world_lazy = __esm({
18267
18457
  "../core/dist/runtime/get-world-lazy.js"() {
18268
18458
  "use strict";
18459
+ init_world_compatibility();
18269
18460
  WorldCacheKey = /* @__PURE__ */ Symbol.for("@workflow/world//cache");
18270
18461
  WorldCachePromiseKey = /* @__PURE__ */ Symbol.for("@workflow/world//cachePromise");
18271
18462
  GetWorldFnKey = /* @__PURE__ */ Symbol.for("@workflow/world//getWorldFn");
@@ -21940,6 +22131,7 @@ var EventConsumerResult;
21940
22131
  var init_events_consumer = __esm({
21941
22132
  "../core/dist/events-consumer.js"() {
21942
22133
  "use strict";
22134
+ init_dist4();
21943
22135
  init_logger();
21944
22136
  (function(EventConsumerResult2) {
21945
22137
  EventConsumerResult2[EventConsumerResult2["Consumed"] = 0] = "Consumed";
@@ -24056,7 +24248,7 @@ var version2;
24056
24248
  var init_version = __esm({
24057
24249
  "../core/dist/version.js"() {
24058
24250
  "use strict";
24059
- version2 = "5.0.0-beta.26";
24251
+ version2 = "5.0.0-beta.28";
24060
24252
  }
24061
24253
  });
24062
24254
 
@@ -25791,14 +25983,16 @@ function createReconnectingFramedStream(runId, name, startIndex) {
25791
25983
  currentStartIndex += consumedFrames;
25792
25984
  consumedFrames = 0;
25793
25985
  buffer2 = new Uint8Array(0);
25986
+ const maxReconnects = getFramedStreamMaxReconnects();
25987
+ const maxTotalReconnects = getFramedStreamMaxTotalReconnects();
25794
25988
  for (; ; ) {
25795
25989
  reconnectCount++;
25796
25990
  totalReconnectCount++;
25797
- if (reconnectCount > FRAMED_STREAM_MAX_RECONNECTS) {
25798
- throw new Error(`Stream "${name}" exceeded maximum reconnection attempts (${FRAMED_STREAM_MAX_RECONNECTS})`);
25991
+ if (reconnectCount > maxReconnects) {
25992
+ throw new Error(`Stream "${name}" exceeded maximum reconnection attempts (${maxReconnects})`);
25799
25993
  }
25800
- if (totalReconnectCount > FRAMED_STREAM_MAX_TOTAL_RECONNECTS) {
25801
- throw new Error(`Stream "${name}" exceeded maximum total reconnection attempts (${FRAMED_STREAM_MAX_TOTAL_RECONNECTS})`);
25994
+ if (totalReconnectCount > maxTotalReconnects) {
25995
+ throw new Error(`Stream "${name}" exceeded maximum total reconnection attempts (${maxTotalReconnects})`);
25802
25996
  }
25803
25997
  try {
25804
25998
  await connect();
@@ -26186,8 +26380,11 @@ function setupAbortStreamReader(controller, runId, streamName, ops) {
26186
26380
  });
26187
26381
  })
26188
26382
  ]);
26189
- reader.releaseLock();
26190
26383
  if (result.value && !result.done) {
26384
+ try {
26385
+ reader.releaseLock();
26386
+ } catch {
26387
+ }
26191
26388
  try {
26192
26389
  const ctxForKey = contextStorage.getStore();
26193
26390
  const data = await hydrateStepArguments(result.value, runId, ctxForKey?.encryptionKey);
@@ -26195,6 +26392,9 @@ function setupAbortStreamReader(controller, runId, streamName, ops) {
26195
26392
  } catch {
26196
26393
  controller.abort();
26197
26394
  }
26395
+ } else {
26396
+ void reader.cancel().catch(() => {
26397
+ });
26198
26398
  }
26199
26399
  } catch {
26200
26400
  }
@@ -26691,11 +26891,12 @@ function getStreamAndRequestRevivers(allRevivers) {
26691
26891
  }
26692
26892
  return extra;
26693
26893
  }
26694
- var defaultUlid, FRAME_HEADER_SIZE, MAX_FRAME_SIZE, WorkflowServerReadableStream, FRAMED_STREAM_MAX_RECONNECTS, FRAMED_STREAM_MAX_TOTAL_RECONNECTS, STREAM_FLUSH_INTERVAL_MS, WorkflowServerWritableStream, STREAM_AND_REQUEST_KEYS;
26894
+ var defaultUlid, FRAME_HEADER_SIZE, MAX_FRAME_SIZE, WorkflowServerReadableStream, FRAMED_STREAM_MAX_RECONNECTS, getFramedStreamMaxReconnects, FRAMED_STREAM_MAX_TOTAL_RECONNECTS, getFramedStreamMaxTotalReconnects, STREAM_FLUSH_INTERVAL_MS, getStreamFlushIntervalMs, WorkflowServerWritableStream, STREAM_AND_REQUEST_KEYS;
26695
26895
  var init_serialization2 = __esm({
26696
26896
  "../core/dist/serialization.js"() {
26697
26897
  "use strict";
26698
26898
  init_dist2();
26899
+ init_dist4();
26699
26900
  init_devalue();
26700
26901
  init_node();
26701
26902
  init_encryption();
@@ -26771,9 +26972,20 @@ var init_serialization2 = __esm({
26771
26972
  }
26772
26973
  };
26773
26974
  FRAMED_STREAM_MAX_RECONNECTS = 50;
26975
+ getFramedStreamMaxReconnects = /* @__PURE__ */ __name(() => envNumber("WORKFLOW_FRAMED_STREAM_MAX_RECONNECTS", FRAMED_STREAM_MAX_RECONNECTS, {
26976
+ integer: true,
26977
+ min: 1
26978
+ }), "getFramedStreamMaxReconnects");
26774
26979
  FRAMED_STREAM_MAX_TOTAL_RECONNECTS = 1e3;
26980
+ getFramedStreamMaxTotalReconnects = /* @__PURE__ */ __name(() => envNumber("WORKFLOW_FRAMED_STREAM_MAX_TOTAL_RECONNECTS", FRAMED_STREAM_MAX_TOTAL_RECONNECTS, {
26981
+ integer: true,
26982
+ min: 1
26983
+ }), "getFramedStreamMaxTotalReconnects");
26775
26984
  __name(createReconnectingFramedStream, "createReconnectingFramedStream");
26776
26985
  STREAM_FLUSH_INTERVAL_MS = 10;
26986
+ getStreamFlushIntervalMs = /* @__PURE__ */ __name(() => envNumber("WORKFLOW_STREAM_FLUSH_INTERVAL_MS", STREAM_FLUSH_INTERVAL_MS, {
26987
+ integer: true
26988
+ }), "getStreamFlushIntervalMs");
26777
26989
  WorkflowServerWritableStream = class extends WritableStream {
26778
26990
  static {
26779
26991
  __name(this, "WorkflowServerWritableStream");
@@ -26819,7 +27031,7 @@ var init_serialization2 = __esm({
26819
27031
  const chunksToFlush = buffer2.slice();
26820
27032
  const world = await worldPromise;
26821
27033
  if (resolvedFlushIntervalMs === void 0) {
26822
- resolvedFlushIntervalMs = world.streamFlushIntervalMs ?? STREAM_FLUSH_INTERVAL_MS;
27034
+ resolvedFlushIntervalMs = world.streamFlushIntervalMs ?? getStreamFlushIntervalMs();
26823
27035
  }
26824
27036
  if (typeof world.streams.writeMulti === "function" && chunksToFlush.length > 1) {
26825
27037
  await world.streams.writeMulti(runId, name, chunksToFlush);
@@ -26842,7 +27054,7 @@ var init_serialization2 = __esm({
26842
27054
  }, (err) => {
26843
27055
  for (const w of currentWaiters) w.reject(err);
26844
27056
  });
26845
- }, resolvedFlushIntervalMs ?? STREAM_FLUSH_INTERVAL_MS);
27057
+ }, resolvedFlushIntervalMs ?? getStreamFlushIntervalMs());
26846
27058
  }, "scheduleFlush");
26847
27059
  super({
26848
27060
  async write(chunk) {
@@ -27110,6 +27322,7 @@ init_version();
27110
27322
  init_get_world_lazy();
27111
27323
  init_helpers();
27112
27324
  init_wait_until();
27325
+ init_world_compatibility();
27113
27326
  var CROSS_DEPLOYMENT_CAPABILITY_PROBE_TIMEOUT_MS = 2e3;
27114
27327
  var ulid3 = monotonicFactory();
27115
27328
  var hasWarnedLatestNoOp = false;
@@ -27137,7 +27350,8 @@ async function start(workflow, argsOrOptions, options) {
27137
27350
  span?.setAttributes({
27138
27351
  ...WorkflowArgumentsCount(args.length)
27139
27352
  });
27140
- const world = opts?.world ?? await getWorldLazy();
27353
+ const world = opts.world ?? await getWorldLazy();
27354
+ assertWorldSupportsRuntimeProtocol(world);
27141
27355
  const currentDeploymentId = await world.getDeploymentId();
27142
27356
  let deploymentId = opts.deploymentId ?? currentDeploymentId;
27143
27357
  if (deploymentId === "latest") {
@@ -27173,7 +27387,7 @@ async function start(workflow, argsOrOptions, options) {
27173
27387
  const ops = [];
27174
27388
  const runId = `wrun_${ulid3()}`;
27175
27389
  const traceCarrier = await serializeTraceCarrier();
27176
- const specVersion = opts.specVersion ?? world.specVersion ?? SPEC_VERSION_SUPPORTS_EVENT_SOURCING;
27390
+ const specVersion = opts.specVersion ?? world.specVersion;
27177
27391
  const v1Compat = isLegacySpecVersion(specVersion);
27178
27392
  const allowReservedAttributes = opts.allowReservedAttributes === true;
27179
27393
  let attributes;
@@ -27297,7 +27511,7 @@ __name(start, "start");
27297
27511
  value: "start",
27298
27512
  configurable: true
27299
27513
  });
27300
- })(start, "step//@workflow/core/runtime/start@5.0.0-beta.26//start");
27514
+ })(start, "step//@workflow/core/runtime/start@5.0.0-beta.28//start");
27301
27515
 
27302
27516
  // ../core/dist/runtime/runs.js
27303
27517
  async function wakeUpRun(world, runId, options) {
@@ -27624,7 +27838,7 @@ var Run = class _Run {
27624
27838
  value: "wakeUp",
27625
27839
  configurable: true
27626
27840
  });
27627
- })(Run.prototype["wakeUp"], "step//@workflow/core/runtime/run@5.0.0-beta.26//Run#wakeUp");
27841
+ })(Run.prototype["wakeUp"], "step//@workflow/core/runtime/run@5.0.0-beta.28//Run#wakeUp");
27628
27842
  (function(__wf_fn, __wf_id) {
27629
27843
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27630
27844
  __wf_reg.set(__wf_id, __wf_fn);
@@ -27633,7 +27847,7 @@ var Run = class _Run {
27633
27847
  value: "cancel",
27634
27848
  configurable: true
27635
27849
  });
27636
- })(Run.prototype["cancel"], "step//@workflow/core/runtime/run@5.0.0-beta.26//Run#cancel");
27850
+ })(Run.prototype["cancel"], "step//@workflow/core/runtime/run@5.0.0-beta.28//Run#cancel");
27637
27851
  (function(__wf_fn, __wf_id) {
27638
27852
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27639
27853
  __wf_reg.set(__wf_id, __wf_fn);
@@ -27642,7 +27856,7 @@ var Run = class _Run {
27642
27856
  value: "getReadable",
27643
27857
  configurable: true
27644
27858
  });
27645
- })(Run.prototype["getReadable"], "step//@workflow/core/runtime/run@5.0.0-beta.26//Run#getReadable");
27859
+ })(Run.prototype["getReadable"], "step//@workflow/core/runtime/run@5.0.0-beta.28//Run#getReadable");
27646
27860
  (function(__wf_fn, __wf_id) {
27647
27861
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27648
27862
  __wf_reg.set(__wf_id, __wf_fn);
@@ -27651,7 +27865,7 @@ var Run = class _Run {
27651
27865
  value: "exists",
27652
27866
  configurable: true
27653
27867
  });
27654
- })(Object.getOwnPropertyDescriptor(Run.prototype, "exists").get, "step//@workflow/core/runtime/run@5.0.0-beta.26//Run#exists");
27868
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "exists").get, "step//@workflow/core/runtime/run@5.0.0-beta.28//Run#exists");
27655
27869
  (function(__wf_fn, __wf_id) {
27656
27870
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27657
27871
  __wf_reg.set(__wf_id, __wf_fn);
@@ -27660,7 +27874,7 @@ var Run = class _Run {
27660
27874
  value: "status",
27661
27875
  configurable: true
27662
27876
  });
27663
- })(Object.getOwnPropertyDescriptor(Run.prototype, "status").get, "step//@workflow/core/runtime/run@5.0.0-beta.26//Run#status");
27877
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "status").get, "step//@workflow/core/runtime/run@5.0.0-beta.28//Run#status");
27664
27878
  (function(__wf_fn, __wf_id) {
27665
27879
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27666
27880
  __wf_reg.set(__wf_id, __wf_fn);
@@ -27669,7 +27883,7 @@ var Run = class _Run {
27669
27883
  value: "returnValue",
27670
27884
  configurable: true
27671
27885
  });
27672
- })(Object.getOwnPropertyDescriptor(Run.prototype, "returnValue").get, "step//@workflow/core/runtime/run@5.0.0-beta.26//Run#returnValue");
27886
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "returnValue").get, "step//@workflow/core/runtime/run@5.0.0-beta.28//Run#returnValue");
27673
27887
  (function(__wf_fn, __wf_id) {
27674
27888
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27675
27889
  __wf_reg.set(__wf_id, __wf_fn);
@@ -27678,7 +27892,7 @@ var Run = class _Run {
27678
27892
  value: "workflowName",
27679
27893
  configurable: true
27680
27894
  });
27681
- })(Object.getOwnPropertyDescriptor(Run.prototype, "workflowName").get, "step//@workflow/core/runtime/run@5.0.0-beta.26//Run#workflowName");
27895
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "workflowName").get, "step//@workflow/core/runtime/run@5.0.0-beta.28//Run#workflowName");
27682
27896
  (function(__wf_fn, __wf_id) {
27683
27897
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27684
27898
  __wf_reg.set(__wf_id, __wf_fn);
@@ -27687,7 +27901,7 @@ var Run = class _Run {
27687
27901
  value: "createdAt",
27688
27902
  configurable: true
27689
27903
  });
27690
- })(Object.getOwnPropertyDescriptor(Run.prototype, "createdAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.26//Run#createdAt");
27904
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "createdAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.28//Run#createdAt");
27691
27905
  (function(__wf_fn, __wf_id) {
27692
27906
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27693
27907
  __wf_reg.set(__wf_id, __wf_fn);
@@ -27696,7 +27910,7 @@ var Run = class _Run {
27696
27910
  value: "startedAt",
27697
27911
  configurable: true
27698
27912
  });
27699
- })(Object.getOwnPropertyDescriptor(Run.prototype, "startedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.26//Run#startedAt");
27913
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "startedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.28//Run#startedAt");
27700
27914
  (function(__wf_fn, __wf_id) {
27701
27915
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27702
27916
  __wf_reg.set(__wf_id, __wf_fn);
@@ -27705,7 +27919,7 @@ var Run = class _Run {
27705
27919
  value: "completedAt",
27706
27920
  configurable: true
27707
27921
  });
27708
- })(Object.getOwnPropertyDescriptor(Run.prototype, "completedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.26//Run#completedAt");
27922
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "completedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.28//Run#completedAt");
27709
27923
  (function(__wf_cls, __wf_id) {
27710
27924
  var __wf_sym = /* @__PURE__ */ Symbol.for("workflow-class-registry"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
27711
27925
  __wf_reg.set(__wf_id, __wf_cls);
@@ -27715,7 +27929,7 @@ var Run = class _Run {
27715
27929
  enumerable: false,
27716
27930
  configurable: false
27717
27931
  });
27718
- })(Run, "class//@workflow/core/runtime/run@5.0.0-beta.26//Run");
27932
+ })(Run, "class//@workflow/core/runtime/run@5.0.0-beta.28//Run");
27719
27933
 
27720
27934
  // ../workflow/dist/stdlib.js
27721
27935
  async function fetch2(...args) {
@@ -28160,6 +28374,26 @@ __name(stepThatFails, "stepThatFails");
28160
28374
  });
28161
28375
  })(stepThatFails, "step//./workflows/retriable-and-fatal//stepThatFails");
28162
28376
 
28377
+ // workflows/signal-cost.ts
28378
+ async function trivialStep(input) {
28379
+ return input.index;
28380
+ }
28381
+ __name(trivialStep, "trivialStep");
28382
+ (function(__wf_fn, __wf_id) {
28383
+ var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
28384
+ __wf_reg.set(__wf_id, __wf_fn);
28385
+ __wf_fn.stepId = __wf_id;
28386
+ Object.defineProperty(__wf_fn, "name", {
28387
+ value: "trivialStep",
28388
+ configurable: true
28389
+ });
28390
+ })(trivialStep, "step//./workflows/signal-cost//trivialStep");
28391
+ async function signalCostWorkflow(input) {
28392
+ throw new Error("You attempted to execute workflow signalCostWorkflow function directly. To start a workflow, use start(signalCostWorkflow) from workflow/api");
28393
+ }
28394
+ __name(signalCostWorkflow, "signalCostWorkflow");
28395
+ signalCostWorkflow.workflowId = "workflow//./workflows/signal-cost//signalCostWorkflow";
28396
+
28163
28397
  // virtual-entry.js
28164
28398
  var __steps_registered = true;
28165
28399
  export {