@workflow/world-testing 5.0.0-beta.30 → 5.0.0-beta.31

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.
@@ -15431,7 +15431,7 @@ var init_runs2 = __esm({
15431
15431
  errorCode: external_exports2.string().optional(),
15432
15432
  /**
15433
15433
  * Plaintext string-string metadata attached to the run via
15434
- * `experimental_setAttributes()` (or, in the future, materialized
15434
+ * `setAttributes()` (or, in the future, materialized
15435
15435
  * from `attr_set` events). Stored unencrypted alongside other
15436
15436
  * plaintext fields so observability surfaces can read it without
15437
15437
  * going through the decryption pipeline.
@@ -15856,7 +15856,8 @@ var init_queue2 = __esm({
15856
15856
  });
15857
15857
 
15858
15858
  // ../world/dist/recovery.js
15859
- async function reenqueueActiveRuns(runs, enqueue, label) {
15859
+ async function reenqueueActiveRuns(runs, enqueue, label, namespace) {
15860
+ const workflowQueuePrefix = getQueueTopicPrefix2("workflow", resolveQueueNamespace2(namespace));
15860
15861
  let reenqueued = 0;
15861
15862
  for (const status of ["pending", "running"]) {
15862
15863
  let cursor;
@@ -15869,7 +15870,7 @@ async function reenqueueActiveRuns(runs, enqueue, label) {
15869
15870
  });
15870
15871
  for (const run3 of page.data) {
15871
15872
  try {
15872
- const queueName = `__wkf_workflow_${run3.workflowName}`;
15873
+ const queueName = `${workflowQueuePrefix}${run3.workflowName}`;
15873
15874
  await enqueue(queueName, { runId: run3.runId });
15874
15875
  reenqueued++;
15875
15876
  } catch (err) {
@@ -15887,6 +15888,7 @@ async function reenqueueActiveRuns(runs, enqueue, label) {
15887
15888
  var init_recovery2 = __esm({
15888
15889
  "../world/dist/recovery.js"() {
15889
15890
  "use strict";
15891
+ init_queue2();
15890
15892
  __name(reenqueueActiveRuns, "reenqueueActiveRuns");
15891
15893
  }
15892
15894
  });
@@ -45574,7 +45576,7 @@ var version4;
45574
45576
  var init_version3 = __esm({
45575
45577
  "../core/dist/version.js"() {
45576
45578
  "use strict";
45577
- version4 = "5.0.0-beta.30";
45579
+ version4 = "5.0.0-beta.31";
45578
45580
  }
45579
45581
  });
45580
45582
 
@@ -71535,7 +71537,7 @@ var init_runs = __esm2({
71535
71537
  errorCode: external_exports.string().optional(),
71536
71538
  /**
71537
71539
  * Plaintext string-string metadata attached to the run via
71538
- * `experimental_setAttributes()` (or, in the future, materialized
71540
+ * `setAttributes()` (or, in the future, materialized
71539
71541
  * from `attr_set` events). Stored unencrypted alongside other
71540
71542
  * plaintext fields so observability surfaces can read it without
71541
71543
  * going through the decryption pipeline.
@@ -71952,6 +71954,7 @@ var init_queue = __esm2({
71952
71954
  var init_recovery = __esm2({
71953
71955
  "../world/dist/recovery.js"() {
71954
71956
  "use strict";
71957
+ init_queue();
71955
71958
  }
71956
71959
  });
71957
71960
  var zodJsonSchema;
@@ -79120,7 +79123,7 @@ var version2;
79120
79123
  var init_version = __esm2({
79121
79124
  "../core/dist/version.js"() {
79122
79125
  "use strict";
79123
- version2 = "5.0.0-beta.30";
79126
+ version2 = "5.0.0-beta.31";
79124
79127
  }
79125
79128
  });
79126
79129
  function getWorkflowQueueName(workflowName, namespace) {
@@ -82218,7 +82221,7 @@ init_dist2();
82218
82221
  init_dist4();
82219
82222
  function normalizeAttributeChanges(attrs, options = {}) {
82220
82223
  if (attrs === null || typeof attrs !== "object" || Array.isArray(attrs)) {
82221
- throw new FatalError(`experimental_setAttributes requires a plain object, got ${attrs === null ? "null" : Array.isArray(attrs) ? "array" : typeof attrs}`);
82224
+ throw new FatalError(`setAttributes requires a plain object, got ${attrs === null ? "null" : Array.isArray(attrs) ? "array" : typeof attrs}`);
82222
82225
  }
82223
82226
  const changes = Object.entries(attrs).map(([key, value]) => ({
82224
82227
  key,
@@ -82481,7 +82484,7 @@ __name2(start, "start");
82481
82484
  value: "start",
82482
82485
  configurable: true
82483
82486
  });
82484
- })(start, "step//@workflow/core/runtime/start@5.0.0-beta.30//start");
82487
+ })(start, "step//@workflow/core/runtime/start@5.0.0-beta.31//start");
82485
82488
  async function wakeUpRun(world, runId, options) {
82486
82489
  try {
82487
82490
  const run22 = await world.runs.get(runId, {
@@ -82817,7 +82820,7 @@ var Run = class _Run {
82817
82820
  value: "wakeUp",
82818
82821
  configurable: true
82819
82822
  });
82820
- })(Run.prototype["wakeUp"], "step//@workflow/core/runtime/run@5.0.0-beta.30//Run#wakeUp");
82823
+ })(Run.prototype["wakeUp"], "step//@workflow/core/runtime/run@5.0.0-beta.31//Run#wakeUp");
82821
82824
  (function(__wf_fn, __wf_id) {
82822
82825
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
82823
82826
  __wf_reg.set(__wf_id, __wf_fn);
@@ -82826,7 +82829,7 @@ var Run = class _Run {
82826
82829
  value: "cancel",
82827
82830
  configurable: true
82828
82831
  });
82829
- })(Run.prototype["cancel"], "step//@workflow/core/runtime/run@5.0.0-beta.30//Run#cancel");
82832
+ })(Run.prototype["cancel"], "step//@workflow/core/runtime/run@5.0.0-beta.31//Run#cancel");
82830
82833
  (function(__wf_fn, __wf_id) {
82831
82834
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
82832
82835
  __wf_reg.set(__wf_id, __wf_fn);
@@ -82835,7 +82838,7 @@ var Run = class _Run {
82835
82838
  value: "getReadable",
82836
82839
  configurable: true
82837
82840
  });
82838
- })(Run.prototype["getReadable"], "step//@workflow/core/runtime/run@5.0.0-beta.30//Run#getReadable");
82841
+ })(Run.prototype["getReadable"], "step//@workflow/core/runtime/run@5.0.0-beta.31//Run#getReadable");
82839
82842
  (function(__wf_fn, __wf_id) {
82840
82843
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
82841
82844
  __wf_reg.set(__wf_id, __wf_fn);
@@ -82844,7 +82847,7 @@ var Run = class _Run {
82844
82847
  value: "exists",
82845
82848
  configurable: true
82846
82849
  });
82847
- })(Object.getOwnPropertyDescriptor(Run.prototype, "exists").get, "step//@workflow/core/runtime/run@5.0.0-beta.30//Run#exists");
82850
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "exists").get, "step//@workflow/core/runtime/run@5.0.0-beta.31//Run#exists");
82848
82851
  (function(__wf_fn, __wf_id) {
82849
82852
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
82850
82853
  __wf_reg.set(__wf_id, __wf_fn);
@@ -82853,7 +82856,7 @@ var Run = class _Run {
82853
82856
  value: "status",
82854
82857
  configurable: true
82855
82858
  });
82856
- })(Object.getOwnPropertyDescriptor(Run.prototype, "status").get, "step//@workflow/core/runtime/run@5.0.0-beta.30//Run#status");
82859
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "status").get, "step//@workflow/core/runtime/run@5.0.0-beta.31//Run#status");
82857
82860
  (function(__wf_fn, __wf_id) {
82858
82861
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
82859
82862
  __wf_reg.set(__wf_id, __wf_fn);
@@ -82862,7 +82865,7 @@ var Run = class _Run {
82862
82865
  value: "returnValue",
82863
82866
  configurable: true
82864
82867
  });
82865
- })(Object.getOwnPropertyDescriptor(Run.prototype, "returnValue").get, "step//@workflow/core/runtime/run@5.0.0-beta.30//Run#returnValue");
82868
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "returnValue").get, "step//@workflow/core/runtime/run@5.0.0-beta.31//Run#returnValue");
82866
82869
  (function(__wf_fn, __wf_id) {
82867
82870
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
82868
82871
  __wf_reg.set(__wf_id, __wf_fn);
@@ -82871,7 +82874,7 @@ var Run = class _Run {
82871
82874
  value: "workflowName",
82872
82875
  configurable: true
82873
82876
  });
82874
- })(Object.getOwnPropertyDescriptor(Run.prototype, "workflowName").get, "step//@workflow/core/runtime/run@5.0.0-beta.30//Run#workflowName");
82877
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "workflowName").get, "step//@workflow/core/runtime/run@5.0.0-beta.31//Run#workflowName");
82875
82878
  (function(__wf_fn, __wf_id) {
82876
82879
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
82877
82880
  __wf_reg.set(__wf_id, __wf_fn);
@@ -82880,7 +82883,7 @@ var Run = class _Run {
82880
82883
  value: "createdAt",
82881
82884
  configurable: true
82882
82885
  });
82883
- })(Object.getOwnPropertyDescriptor(Run.prototype, "createdAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.30//Run#createdAt");
82886
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "createdAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.31//Run#createdAt");
82884
82887
  (function(__wf_fn, __wf_id) {
82885
82888
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
82886
82889
  __wf_reg.set(__wf_id, __wf_fn);
@@ -82889,7 +82892,7 @@ var Run = class _Run {
82889
82892
  value: "startedAt",
82890
82893
  configurable: true
82891
82894
  });
82892
- })(Object.getOwnPropertyDescriptor(Run.prototype, "startedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.30//Run#startedAt");
82895
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "startedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.31//Run#startedAt");
82893
82896
  (function(__wf_fn, __wf_id) {
82894
82897
  var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
82895
82898
  __wf_reg.set(__wf_id, __wf_fn);
@@ -82898,7 +82901,7 @@ var Run = class _Run {
82898
82901
  value: "completedAt",
82899
82902
  configurable: true
82900
82903
  });
82901
- })(Object.getOwnPropertyDescriptor(Run.prototype, "completedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.30//Run#completedAt");
82904
+ })(Object.getOwnPropertyDescriptor(Run.prototype, "completedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.31//Run#completedAt");
82902
82905
  (function(__wf_cls, __wf_id) {
82903
82906
  var __wf_sym = /* @__PURE__ */ Symbol.for("workflow-class-registry"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
82904
82907
  __wf_reg.set(__wf_id, __wf_cls);
@@ -82908,7 +82911,7 @@ var Run = class _Run {
82908
82911
  enumerable: false,
82909
82912
  configurable: false
82910
82913
  });
82911
- })(Run, "class//@workflow/core/runtime/run@5.0.0-beta.30//Run");
82914
+ })(Run, "class//@workflow/core/runtime/run@5.0.0-beta.31//Run");
82912
82915
  async function fetch2(...args) {
82913
82916
  return globalThis.fetch(...args);
82914
82917
  }
@@ -88164,7 +88167,7 @@ async function executeStep(params) {
88164
88167
  encryptionKey,
88165
88168
  // Turbo optimistic start runs this body before `run_started` is
88166
88169
  // durable. Expose the barrier so a direct step-body world write
88167
- // (e.g. `experimental_setAttributes`) can order itself after the
88170
+ // (e.g. `setAttributes`) can order itself after the
88168
88171
  // run exists. Undefined on the await path (run already durable).
88169
88172
  runReadyBarrier: optimisticStart ? params.runReadyBarrier : void 0
88170
88173
  }, () => stepFn.apply(thisVal, args));
@@ -88798,7 +88801,7 @@ async function handleSuspension({ suspension, world, run: run3, span, requestId,
88798
88801
  message: err.message
88799
88802
  });
88800
88803
  } else if (isAttributeValidationFailure(err)) {
88801
- const fatal = new FatalError2(`experimental_setAttributes failed World validation: ${err instanceof Error ? err.message : String(err)}`);
88804
+ const fatal = new FatalError2(`setAttributes failed World validation: ${err instanceof Error ? err.message : String(err)}`);
88802
88805
  fatal.cause = err;
88803
88806
  throw fatal;
88804
88807
  } else {
@@ -93246,6 +93249,179 @@ if (typeof globalThis !== "undefined") {
93246
93249
  }
93247
93250
  }
93248
93251
 
93252
+ // ../core/dist/symbols.js
93253
+ var WORKFLOW_CREATE_HOOK = /* @__PURE__ */ Symbol.for("WORKFLOW_CREATE_HOOK");
93254
+ var WORKFLOW_SLEEP = /* @__PURE__ */ Symbol.for("WORKFLOW_SLEEP");
93255
+ var WORKFLOW_GET_STREAM_ID = /* @__PURE__ */ Symbol.for("WORKFLOW_GET_STREAM_ID");
93256
+ var STREAM_NAME_SYMBOL = /* @__PURE__ */ Symbol.for("WORKFLOW_STREAM_NAME");
93257
+ var WORKFLOW_CLASS_REGISTRY = /* @__PURE__ */ Symbol.for("workflow-class-registry");
93258
+
93259
+ // ../core/dist/sleep.js
93260
+ async function sleep(param) {
93261
+ const sleepFn = globalThis[WORKFLOW_SLEEP];
93262
+ if (!sleepFn) {
93263
+ throwNotInWorkflowContext("sleep()", "https://workflow-sdk.dev/docs/api-reference/workflow/sleep", sleep);
93264
+ }
93265
+ return sleepFn(param);
93266
+ }
93267
+ __name(sleep, "sleep");
93268
+
93269
+ // ../core/dist/class-serialization.js
93270
+ function getRegistry(global = globalThis) {
93271
+ const g = global;
93272
+ let registry2 = g[WORKFLOW_CLASS_REGISTRY];
93273
+ if (!registry2) {
93274
+ registry2 = /* @__PURE__ */ new Map();
93275
+ g[WORKFLOW_CLASS_REGISTRY] = registry2;
93276
+ }
93277
+ return registry2;
93278
+ }
93279
+ __name(getRegistry, "getRegistry");
93280
+ var RUN_CLASS_ID = "class//workflow//Run";
93281
+ function aliasSerializationClass(classId, cls, global = globalThis) {
93282
+ getRegistry(global).set(classId, cls);
93283
+ }
93284
+ __name(aliasSerializationClass, "aliasSerializationClass");
93285
+
93286
+ // ../serde/dist/index.js
93287
+ var WORKFLOW_SERIALIZE = /* @__PURE__ */ Symbol.for("workflow-serialize");
93288
+ var WORKFLOW_DESERIALIZE = /* @__PURE__ */ Symbol.for("workflow-deserialize");
93289
+
93290
+ // ../core/dist/runtime/run.js
93291
+ var Run = class _Run {
93292
+ static {
93293
+ __name(this, "Run");
93294
+ }
93295
+ static [WORKFLOW_SERIALIZE](instance) {
93296
+ return {
93297
+ runId: instance.runId,
93298
+ resilientStart: instance.#resilientStart
93299
+ };
93300
+ }
93301
+ static [WORKFLOW_DESERIALIZE](data) {
93302
+ return new _Run(data.runId, {
93303
+ resilientStart: data.resilientStart
93304
+ });
93305
+ }
93306
+ /**
93307
+ * The ID of the workflow run.
93308
+ */
93309
+ runId;
93310
+ /**
93311
+ * When true, run_created failed and the run may not exist yet (the
93312
+ * resilient start path will create it via run_started). pollReturnValue
93313
+ * retries on WorkflowRunNotFoundError only when this flag is set so
93314
+ * that normal runs fail fast on 404.
93315
+ * @internal
93316
+ */
93317
+ #resilientStart = false;
93318
+ constructor(runId, opts) {
93319
+ this.runId = runId;
93320
+ this.#resilientStart = opts?.resilientStart ?? false;
93321
+ }
93322
+ /**
93323
+ * The readable stream of the workflow run.
93324
+ */
93325
+ get readable() {
93326
+ return this.getReadable();
93327
+ }
93328
+ };
93329
+ Run.prototype["wakeUp"] = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.31//Run#wakeUp");
93330
+ Run.prototype["cancel"] = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.31//Run#cancel");
93331
+ Run.prototype["getReadable"] = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.31//Run#getReadable");
93332
+ var __step_Run$exists = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.31//Run#exists");
93333
+ Object.defineProperty(Run.prototype, "exists", {
93334
+ get() {
93335
+ return __step_Run$exists.call(this);
93336
+ },
93337
+ configurable: true,
93338
+ enumerable: false
93339
+ });
93340
+ var __step_Run$status = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.31//Run#status");
93341
+ Object.defineProperty(Run.prototype, "status", {
93342
+ get() {
93343
+ return __step_Run$status.call(this);
93344
+ },
93345
+ configurable: true,
93346
+ enumerable: false
93347
+ });
93348
+ var __step_Run$returnValue = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.31//Run#returnValue");
93349
+ Object.defineProperty(Run.prototype, "returnValue", {
93350
+ get() {
93351
+ return __step_Run$returnValue.call(this);
93352
+ },
93353
+ configurable: true,
93354
+ enumerable: false
93355
+ });
93356
+ var __step_Run$workflowName = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.31//Run#workflowName");
93357
+ Object.defineProperty(Run.prototype, "workflowName", {
93358
+ get() {
93359
+ return __step_Run$workflowName.call(this);
93360
+ },
93361
+ configurable: true,
93362
+ enumerable: false
93363
+ });
93364
+ var __step_Run$createdAt = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.31//Run#createdAt");
93365
+ Object.defineProperty(Run.prototype, "createdAt", {
93366
+ get() {
93367
+ return __step_Run$createdAt.call(this);
93368
+ },
93369
+ configurable: true,
93370
+ enumerable: false
93371
+ });
93372
+ var __step_Run$startedAt = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.31//Run#startedAt");
93373
+ Object.defineProperty(Run.prototype, "startedAt", {
93374
+ get() {
93375
+ return __step_Run$startedAt.call(this);
93376
+ },
93377
+ configurable: true,
93378
+ enumerable: false
93379
+ });
93380
+ var __step_Run$completedAt = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.31//Run#completedAt");
93381
+ Object.defineProperty(Run.prototype, "completedAt", {
93382
+ get() {
93383
+ return __step_Run$completedAt.call(this);
93384
+ },
93385
+ configurable: true,
93386
+ enumerable: false
93387
+ });
93388
+ (function(__wf_cls, __wf_id) {
93389
+ var __wf_sym = /* @__PURE__ */ Symbol.for("workflow-class-registry"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
93390
+ __wf_reg.set(__wf_id, __wf_cls);
93391
+ Object.defineProperty(__wf_cls, "classId", {
93392
+ value: __wf_id,
93393
+ writable: false,
93394
+ enumerable: false,
93395
+ configurable: false
93396
+ });
93397
+ })(Run, "class//@workflow/core/runtime/run@5.0.0-beta.31//Run");
93398
+
93399
+ // ../core/dist/workflow/create-hook.js
93400
+ aliasSerializationClass(RUN_CLASS_ID, Run);
93401
+ function createHook(options) {
93402
+ const createHookFn = globalThis[WORKFLOW_CREATE_HOOK];
93403
+ if (!createHookFn) {
93404
+ throwNotInWorkflowContext("createHook()", "https://workflow-sdk.dev/docs/api-reference/workflow/create-hook", createHook);
93405
+ }
93406
+ return createHookFn(options);
93407
+ }
93408
+ __name(createHook, "createHook");
93409
+
93410
+ // ../core/dist/workflow/define-hook.js
93411
+ function defineHook() {
93412
+ function resume(_token, _payload) {
93413
+ throwUnavailableInWorkflowContext("defineHook().resume()", "https://workflow-sdk.dev/docs/api-reference/workflow-api/resume-hook", resume);
93414
+ }
93415
+ __name(resume, "resume");
93416
+ return {
93417
+ create(options) {
93418
+ return createHook(options);
93419
+ },
93420
+ resume
93421
+ };
93422
+ }
93423
+ __name(defineHook, "defineHook");
93424
+
93249
93425
  // ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/external.js
93250
93426
  var external_exports = {};
93251
93427
  __export(external_exports, {
@@ -108683,7 +108859,7 @@ var WorkflowRunBaseSchema = external_exports.object({
108683
108859
  errorCode: external_exports.string().optional(),
108684
108860
  /**
108685
108861
  * Plaintext string-string metadata attached to the run via
108686
- * \`experimental_setAttributes()\` (or, in the future, materialized
108862
+ * \`setAttributes()\` (or, in the future, materialized
108687
108863
  * from \`attr_set\` events). Stored unencrypted alongside other
108688
108864
  * plaintext fields so observability surfaces can read it without
108689
108865
  * going through the decryption pipeline.
@@ -109015,179 +109191,6 @@ var workflowRunIdSchema = external_exports.templateLiteral([
109015
109191
  var DEFAULT_TIMESTAMP_THRESHOLD_PAST_MS = 24 * 60 * 60 * 1e3;
109016
109192
  var DEFAULT_TIMESTAMP_THRESHOLD_FUTURE_MS = 5 * 60 * 1e3;
109017
109193
 
109018
- // ../core/dist/symbols.js
109019
- var WORKFLOW_CREATE_HOOK = /* @__PURE__ */ Symbol.for("WORKFLOW_CREATE_HOOK");
109020
- var WORKFLOW_SLEEP = /* @__PURE__ */ Symbol.for("WORKFLOW_SLEEP");
109021
- var WORKFLOW_GET_STREAM_ID = /* @__PURE__ */ Symbol.for("WORKFLOW_GET_STREAM_ID");
109022
- var STREAM_NAME_SYMBOL = /* @__PURE__ */ Symbol.for("WORKFLOW_STREAM_NAME");
109023
- var WORKFLOW_CLASS_REGISTRY = /* @__PURE__ */ Symbol.for("workflow-class-registry");
109024
-
109025
- // ../core/dist/sleep.js
109026
- async function sleep(param) {
109027
- const sleepFn = globalThis[WORKFLOW_SLEEP];
109028
- if (!sleepFn) {
109029
- throwNotInWorkflowContext("sleep()", "https://workflow-sdk.dev/docs/api-reference/workflow/sleep", sleep);
109030
- }
109031
- return sleepFn(param);
109032
- }
109033
- __name(sleep, "sleep");
109034
-
109035
- // ../core/dist/class-serialization.js
109036
- function getRegistry(global = globalThis) {
109037
- const g = global;
109038
- let registry2 = g[WORKFLOW_CLASS_REGISTRY];
109039
- if (!registry2) {
109040
- registry2 = /* @__PURE__ */ new Map();
109041
- g[WORKFLOW_CLASS_REGISTRY] = registry2;
109042
- }
109043
- return registry2;
109044
- }
109045
- __name(getRegistry, "getRegistry");
109046
- var RUN_CLASS_ID = "class//workflow//Run";
109047
- function aliasSerializationClass(classId, cls, global = globalThis) {
109048
- getRegistry(global).set(classId, cls);
109049
- }
109050
- __name(aliasSerializationClass, "aliasSerializationClass");
109051
-
109052
- // ../serde/dist/index.js
109053
- var WORKFLOW_SERIALIZE = /* @__PURE__ */ Symbol.for("workflow-serialize");
109054
- var WORKFLOW_DESERIALIZE = /* @__PURE__ */ Symbol.for("workflow-deserialize");
109055
-
109056
- // ../core/dist/runtime/run.js
109057
- var Run = class _Run {
109058
- static {
109059
- __name(this, "Run");
109060
- }
109061
- static [WORKFLOW_SERIALIZE](instance) {
109062
- return {
109063
- runId: instance.runId,
109064
- resilientStart: instance.#resilientStart
109065
- };
109066
- }
109067
- static [WORKFLOW_DESERIALIZE](data) {
109068
- return new _Run(data.runId, {
109069
- resilientStart: data.resilientStart
109070
- });
109071
- }
109072
- /**
109073
- * The ID of the workflow run.
109074
- */
109075
- runId;
109076
- /**
109077
- * When true, run_created failed and the run may not exist yet (the
109078
- * resilient start path will create it via run_started). pollReturnValue
109079
- * retries on WorkflowRunNotFoundError only when this flag is set so
109080
- * that normal runs fail fast on 404.
109081
- * @internal
109082
- */
109083
- #resilientStart = false;
109084
- constructor(runId, opts) {
109085
- this.runId = runId;
109086
- this.#resilientStart = opts?.resilientStart ?? false;
109087
- }
109088
- /**
109089
- * The readable stream of the workflow run.
109090
- */
109091
- get readable() {
109092
- return this.getReadable();
109093
- }
109094
- };
109095
- Run.prototype["wakeUp"] = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.30//Run#wakeUp");
109096
- Run.prototype["cancel"] = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.30//Run#cancel");
109097
- Run.prototype["getReadable"] = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.30//Run#getReadable");
109098
- var __step_Run$exists = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.30//Run#exists");
109099
- Object.defineProperty(Run.prototype, "exists", {
109100
- get() {
109101
- return __step_Run$exists.call(this);
109102
- },
109103
- configurable: true,
109104
- enumerable: false
109105
- });
109106
- var __step_Run$status = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.30//Run#status");
109107
- Object.defineProperty(Run.prototype, "status", {
109108
- get() {
109109
- return __step_Run$status.call(this);
109110
- },
109111
- configurable: true,
109112
- enumerable: false
109113
- });
109114
- var __step_Run$returnValue = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.30//Run#returnValue");
109115
- Object.defineProperty(Run.prototype, "returnValue", {
109116
- get() {
109117
- return __step_Run$returnValue.call(this);
109118
- },
109119
- configurable: true,
109120
- enumerable: false
109121
- });
109122
- var __step_Run$workflowName = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.30//Run#workflowName");
109123
- Object.defineProperty(Run.prototype, "workflowName", {
109124
- get() {
109125
- return __step_Run$workflowName.call(this);
109126
- },
109127
- configurable: true,
109128
- enumerable: false
109129
- });
109130
- var __step_Run$createdAt = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.30//Run#createdAt");
109131
- Object.defineProperty(Run.prototype, "createdAt", {
109132
- get() {
109133
- return __step_Run$createdAt.call(this);
109134
- },
109135
- configurable: true,
109136
- enumerable: false
109137
- });
109138
- var __step_Run$startedAt = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.30//Run#startedAt");
109139
- Object.defineProperty(Run.prototype, "startedAt", {
109140
- get() {
109141
- return __step_Run$startedAt.call(this);
109142
- },
109143
- configurable: true,
109144
- enumerable: false
109145
- });
109146
- var __step_Run$completedAt = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//@workflow/core/runtime/run@5.0.0-beta.30//Run#completedAt");
109147
- Object.defineProperty(Run.prototype, "completedAt", {
109148
- get() {
109149
- return __step_Run$completedAt.call(this);
109150
- },
109151
- configurable: true,
109152
- enumerable: false
109153
- });
109154
- (function(__wf_cls, __wf_id) {
109155
- var __wf_sym = /* @__PURE__ */ Symbol.for("workflow-class-registry"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
109156
- __wf_reg.set(__wf_id, __wf_cls);
109157
- Object.defineProperty(__wf_cls, "classId", {
109158
- value: __wf_id,
109159
- writable: false,
109160
- enumerable: false,
109161
- configurable: false
109162
- });
109163
- })(Run, "class//@workflow/core/runtime/run@5.0.0-beta.30//Run");
109164
-
109165
- // ../core/dist/workflow/create-hook.js
109166
- aliasSerializationClass(RUN_CLASS_ID, Run);
109167
- function createHook(options) {
109168
- const createHookFn = globalThis[WORKFLOW_CREATE_HOOK];
109169
- if (!createHookFn) {
109170
- throwNotInWorkflowContext("createHook()", "https://workflow-sdk.dev/docs/api-reference/workflow/create-hook", createHook);
109171
- }
109172
- return createHookFn(options);
109173
- }
109174
- __name(createHook, "createHook");
109175
-
109176
- // ../core/dist/workflow/define-hook.js
109177
- function defineHook() {
109178
- function resume(_token, _payload) {
109179
- throwUnavailableInWorkflowContext("defineHook().resume()", "https://workflow-sdk.dev/docs/api-reference/workflow-api/resume-hook", resume);
109180
- }
109181
- __name(resume, "resume");
109182
- return {
109183
- create(options) {
109184
- return createHook(options);
109185
- },
109186
- resume
109187
- };
109188
- }
109189
- __name(defineHook, "defineHook");
109190
-
109191
109194
  // ../core/dist/workflow/writable-stream.js
109192
109195
  function getWritable(options = {}) {
109193
109196
  const { namespace } = options;