@workflow/web 5.0.0-beta.43 → 5.0.0-beta.44

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.
Files changed (23) hide show
  1. package/build/client/assets/{arrow-up-right-D39pnGsD.js → arrow-up-right-AtCpRI70.js} +1 -1
  2. package/build/client/assets/{highlighted-body-B3W2YXNL-Dc1dLaUr.js → highlighted-body-B3W2YXNL-BPRwlr7r.js} +1 -1
  3. package/build/client/assets/{home-C6CuMqQu.js → home-BMHSjdeg.js} +3 -3
  4. package/build/client/assets/{loader-circle-BOxaTUjK.js → loader-circle-abAcDEYl.js} +1 -1
  5. package/build/client/assets/{manifest-157e28f1.js → manifest-a9a8ec99.js} +1 -1
  6. package/build/client/assets/{mermaid-3ZIDBTTL-gEw-Ch1C.js → mermaid-3ZIDBTTL-CrfHaTou.js} +368 -294
  7. package/build/client/assets/{root-BfhMCbkz.js → root-e8qlLJiK.js} +3 -3
  8. package/build/client/assets/{run-detail-BG_1K2Hq.js → run-detail-CrWq-9Tk.js} +54 -31
  9. package/build/client/assets/{workflow-graph-viewer-CxrWityD.js → workflow-graph-viewer-CFAXloBw.js} +1 -1
  10. package/build/client/assets/{zstd-browser-decoder-CAEVa0bm.js → zstd-browser-decoder-B9DmHkyE.js} +1 -1
  11. package/build/server/assets/{app-_xgEuKqE.js → app-wed_Qw3X.js} +986 -672
  12. package/build/server/assets/{highlighted-body-B3W2YXNL-B1Smd86a.js → highlighted-body-B3W2YXNL-imLU-Cvz.js} +1 -1
  13. package/build/server/assets/{index-Ck5CB_wQ.js → index-Dsr6TVhD.js} +1 -1
  14. package/build/server/assets/{index-CSsrecUx.js → index-DxLR22JW.js} +68 -64
  15. package/build/server/assets/{mermaid-3ZIDBTTL-CwYR558N.js → mermaid-3ZIDBTTL-CgaDjNgb.js} +1 -1
  16. package/build/server/assets/{token-COK7oHMh.js → token-CA6-cBL4.js} +1 -1
  17. package/build/server/assets/{token-util-BhmVdeCX.js → token-util-BNjC27Tj.js} +1 -1
  18. package/build/server/assets/{websocket-server-ByjlHAhQ.js → websocket-server-S8DMC969.js} +1 -1
  19. package/build/server/assets/{wrapper-DWeVTope.js → wrapper-DeK0m2tW.js} +3 -3
  20. package/build/server/assets/{ws-transport-BCfcEhAO.js → ws-transport-DdxSF5J6.js} +40 -22
  21. package/build/server/assets/{zstd-browser-decoder-D8JD_nwS.js → zstd-browser-decoder-Cd_DTxZV.js} +1 -1
  22. package/build/server/index.js +3 -3
  23. package/package.json +8 -8
@@ -16912,9 +16912,9 @@ function requireReactDomServer_node_production() {
16912
16912
  function unsupportedSetOptimisticState() {
16913
16913
  throw Error("Cannot update optimistic state while rendering.");
16914
16914
  }
16915
- function createPostbackActionStateKey(permalink, componentKeyPath, hookIndex) {
16915
+ function createPostbackActionStateKey(permalink, componentKeyPath, hookIndex2) {
16916
16916
  if (void 0 !== permalink) return "p" + permalink;
16917
- permalink = JSON.stringify([componentKeyPath, null, hookIndex]);
16917
+ permalink = JSON.stringify([componentKeyPath, null, hookIndex2]);
16918
16918
  componentKeyPath = crypto2.createHash("md5");
16919
16919
  componentKeyPath.update(permalink);
16920
16920
  return "k" + componentKeyPath.digest("hex");
@@ -28574,9 +28574,9 @@ function requireReactDomServer_node_development() {
28574
28574
  function unsupportedSetOptimisticState() {
28575
28575
  throw Error("Cannot update optimistic state while rendering.");
28576
28576
  }
28577
- function createPostbackActionStateKey(permalink, componentKeyPath, hookIndex) {
28577
+ function createPostbackActionStateKey(permalink, componentKeyPath, hookIndex2) {
28578
28578
  if (void 0 !== permalink) return "p" + permalink;
28579
- permalink = JSON.stringify([componentKeyPath, null, hookIndex]);
28579
+ permalink = JSON.stringify([componentKeyPath, null, hookIndex2]);
28580
28580
  componentKeyPath = crypto2.createHash("md5");
28581
28581
  componentKeyPath.update(permalink);
28582
28582
  return "k" + componentKeyPath.digest("hex");
@@ -44191,7 +44191,7 @@ const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
44191
44191
  const safeDecodeAsync$1 = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
44192
44192
  const cuid$1 = /^[cC][^\s-]{8,}$/;
44193
44193
  const cuid2$1 = /^[0-9a-z]+$/;
44194
- const ulid$5 = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
44194
+ const ulid$3 = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
44195
44195
  const xid$1 = /^[0-9a-vA-V]{20}$/;
44196
44196
  const ksuid$1 = /^[A-Za-z0-9]{27}$/;
44197
44197
  const nanoid$1 = /^[a-zA-Z0-9_-]{21}$/;
@@ -44334,7 +44334,7 @@ const regexes = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
44334
44334
  sha512_hex,
44335
44335
  string: string$4,
44336
44336
  time: time$1,
44337
- ulid: ulid$5,
44337
+ ulid: ulid$3,
44338
44338
  undefined: _undefined$2,
44339
44339
  unicodeEmail,
44340
44340
  uppercase,
@@ -45165,7 +45165,7 @@ const $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def) => {
45165
45165
  $ZodStringFormat.init(inst, def);
45166
45166
  });
45167
45167
  const $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def) => {
45168
- def.pattern ?? (def.pattern = ulid$5);
45168
+ def.pattern ?? (def.pattern = ulid$3);
45169
45169
  $ZodStringFormat.init(inst, def);
45170
45170
  });
45171
45171
  const $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def) => {
@@ -55086,7 +55086,7 @@ const ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => {
55086
55086
  $ZodULID.init(inst, def);
55087
55087
  ZodStringFormat.init(inst, def);
55088
55088
  });
55089
- function ulid$4(params) {
55089
+ function ulid$2(params) {
55090
55090
  return /* @__PURE__ */ _ulid(ZodULID, params);
55091
55091
  }
55092
55092
  const ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => {
@@ -56096,7 +56096,7 @@ const _schemas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
56096
56096
  tuple,
56097
56097
  uint32,
56098
56098
  uint64,
56099
- ulid: ulid$4,
56099
+ ulid: ulid$2,
56100
56100
  undefined: _undefined,
56101
56101
  union,
56102
56102
  unknown: unknown$1,
@@ -56855,7 +56855,7 @@ const z$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
56855
56855
  tuple,
56856
56856
  uint32,
56857
56857
  uint64,
56858
- ulid: ulid$4,
56858
+ ulid: ulid$2,
56859
56859
  undefined: _undefined,
56860
56860
  union,
56861
56861
  unknown: unknown$1,
@@ -56987,7 +56987,11 @@ const EventTypeSchema = _enum([
56987
56987
  // Created by world when hook token already exists
56988
56988
  // Wait lifecycle events
56989
56989
  "wait_created",
56990
- "wait_completed"
56990
+ "wait_completed",
56991
+ // Sealed-log filler (specVersion >= 7): written ONLY by the World's backend
56992
+ // to occupy a slot whose writer allocated it and died. Carries no workflow
56993
+ // meaning; replay skips it (see EventsConsumer). Never user-creatable.
56994
+ "noop"
56991
56995
  ]);
56992
56996
  const RunEventTypeSchema = EventTypeSchema.extract([
56993
56997
  "run_created",
@@ -57065,6 +57069,9 @@ const WAIT_EVENT_TYPES = WaitEventTypeSchema.options;
57065
57069
  function isWaitEventType(eventType) {
57066
57070
  return WAIT_EVENT_TYPES.includes(eventType);
57067
57071
  }
57072
+ function isSealedNoopEvent$1(event) {
57073
+ return event.eventType === "noop";
57074
+ }
57068
57075
  const ChildEntityCreationEventTypeSchema = EventTypeSchema.extract([
57069
57076
  "step_created",
57070
57077
  "hook_created",
@@ -57144,7 +57151,7 @@ const stepLatencyTelemetryFields = {
57144
57151
  rsfs: number$3().optional(),
57145
57152
  // Synchronous workflow-function replay duration of only the FINAL replay
57146
57153
  // pass within the rsfs window (the pass that scheduled the first step),
57147
- // excluding awaited network I/O not accumulated across earlier
57154
+ // excluding awaited network I/O. Not accumulated across earlier
57148
57155
  // pre-first-step passes, so it is not "the replay portion of rsfs". Only
57149
57156
  // present alongside rsfs, and only for the run's first step.
57150
57157
  finalSchedulingReplay: number$3().optional(),
@@ -57204,7 +57211,7 @@ const StepStartedEventSchema = BaseEventSchema.extend({
57204
57211
  // handler is executing this step's body inline. Stamped on the lazy
57205
57212
  // step_started (and re-stamped on an owner-recovery bare start) so
57206
57213
  // that a wake replay can tell "this attempt is in flight in a live
57207
- // invocation" apart from "this attempt died with its process" the
57214
+ // invocation" apart from "this attempt died with its process": the
57208
57215
  // owner's queue message doubles as the liveness lease (a crash means
57209
57216
  // the queue redelivers that same messageId, which is allowed to
57210
57217
  // re-execute). Ownership derives from the step's LATEST step_started:
@@ -57260,6 +57267,12 @@ const HookConflictEventSchema = BaseEventSchema.extend({
57260
57267
  conflictingRunId: string$3().optional()
57261
57268
  })
57262
57269
  });
57270
+ const NoopEventSchema = BaseEventSchema.extend({
57271
+ eventType: literal("noop"),
57272
+ eventData: object$1({
57273
+ sealed: boolean$3().optional()
57274
+ }).passthrough().optional()
57275
+ });
57263
57276
  const WaitCreatedEventSchema = BaseEventSchema.extend({
57264
57277
  eventType: literal("wait_created"),
57265
57278
  correlationId: string$3(),
@@ -57306,7 +57319,7 @@ const RunCreatedEventSchema = BaseEventSchema.extend({
57306
57319
  * The run's X25519 public key (base64), stamped by SDKs that support
57307
57320
  * sealed (`encp`) envelopes. Persisted onto the run entity so that
57308
57321
  * cross-run writers can seal payloads to this run without holding its
57309
- * symmetric key. Not secret see `WorkflowRunBaseSchema`.
57322
+ * symmetric key. Not secret. See `WorkflowRunBaseSchema`.
57310
57323
  */
57311
57324
  encryptionPublicKey: string$3().optional()
57312
57325
  })
@@ -57401,7 +57414,9 @@ const AllEventsSchema = discriminatedUnion("eventType", [
57401
57414
  // World-only: created when hook token conflicts
57402
57415
  // Wait lifecycle events
57403
57416
  WaitCreatedEventSchema,
57404
- WaitCompletedEventSchema
57417
+ WaitCompletedEventSchema,
57418
+ NoopEventSchema
57419
+ // World-only: sealed-log filler for an abandoned slot
57405
57420
  ]);
57406
57421
  const EventSchema = AllEventsSchema.and(object$1({
57407
57422
  runId: string$3(),
@@ -57465,7 +57480,7 @@ const WorkflowRunBaseSchema = object$1({
57465
57480
  * ```
57466
57481
  */
57467
57482
  workflowName: string$3(),
57468
- // Optional in database for backwards compatibility, defaults to 1 (legacy) when reading
57483
+ // Optional in database for backward compatibility, defaults to 1 (legacy) when reading
57469
57484
  specVersion: number$3().optional(),
57470
57485
  executionContext: record(string$3(), any()).optional(),
57471
57486
  input: SerializedDataSchema.optional(),
@@ -57493,12 +57508,12 @@ const WorkflowRunBaseSchema = object$1({
57493
57508
  *
57494
57509
  * Defaults to `{}` after schema parsing so consumers always receive
57495
57510
  * a record regardless of world. World adapters need not initialize
57496
- * the field on disk `world-local` JSON files written before this
57511
+ * the field on disk: `world-local` JSON files written before this
57497
57512
  * field existed, and rows from any other adapter that omits the
57498
57513
  * column, both read as `{}` after Zod parses them.
57499
57514
  *
57500
57515
  * EXPERIMENTAL (MVP): the full Workflow Attributes feature replaces
57501
- * the direct-mutation MVP path with an event-sourced model — see
57516
+ * the direct-mutation MVP path with an event-sourced model. See
57502
57517
  * the attributes-mvp changelog entry.
57503
57518
  */
57504
57519
  attributes: record(string$3(), string$3()).default({}),
@@ -57506,12 +57521,12 @@ const WorkflowRunBaseSchema = object$1({
57506
57521
  * The run's X25519 public key, base64-encoded (~44 chars).
57507
57522
  *
57508
57523
  * Lets any party that can read this run seal a payload *to* it without
57509
- * being able to read the run's data used for cross-run writes such as a
57510
- * hook resumption from another deployment, or a child workflow writing into
57511
- * a forwarded stream. The matching private scalar is never stored: it is
57512
- * re-derived on demand from the deployment's own key material, so this
57513
- * field is not secret and its presence does not weaken the run's
57514
- * confidentiality.
57524
+ * being able to read the run's data. This is used for cross-run writes
57525
+ * such as a hook resumption from another deployment, or a child workflow
57526
+ * writing into a forwarded stream. The matching private scalar is never
57527
+ * stored: it is re-derived on demand from the deployment's own key
57528
+ * material, so this field is not secret and its presence does not weaken
57529
+ * the run's confidentiality.
57515
57530
  *
57516
57531
  * Stamped at run creation by SDKs that support sealed (`encp`) envelopes.
57517
57532
  * **Presence is the writer-side gate**: a run only carries a public key if
@@ -57768,7 +57783,9 @@ const AnalyticsAttributeKeySchema = object$1({
57768
57783
  lastSeenAt: date$2()
57769
57784
  });
57770
57785
  const ANALYTICS_EVENTS_GET_MANY_LIMIT = 100;
57771
- const warnedEnvValues = /* @__PURE__ */ new Set();
57786
+ const WarnedEnvValuesKey = Symbol.for("@workflow/world//warnedEnvValues/v1");
57787
+ const globalStore = globalThis;
57788
+ const warnedEnvValues = globalStore[WarnedEnvValuesKey] ?? (globalStore[WarnedEnvValuesKey] = /* @__PURE__ */ new Set());
57772
57789
  function warnOnce(key, message2) {
57773
57790
  if (warnedEnvValues.has(key))
57774
57791
  return;
@@ -57862,12 +57879,12 @@ const RunInputSchema = object$1({
57862
57879
  * two can disagree: if the message is consumed by a deployment in a
57863
57880
  * DIFFERENT environment, that consumer's `run_started` re-creates the run
57864
57881
  * under ITS tenant, so the same client-minted `wrun_` id ends up existing
57865
- * in two environments one stuck pending forever, the other executing.
57882
+ * in two environments: one stuck pending forever, the other executing.
57866
57883
  * Carrying the creator's environment lets the consumer compare it against
57867
57884
  * its own and refuse the delivery instead of forking the run.
57868
57885
  *
57869
57886
  * Absent for worlds with no environment dimension (local, Postgres), and
57870
- * for older SDKs consumers must treat it as advisory and skip the check
57887
+ * for older SDKs. Consumers must treat it as advisory and skip the check
57871
57888
  * when it is missing.
57872
57889
  */
57873
57890
  environment: string$3().optional()
@@ -57892,8 +57909,8 @@ const HookResumeInputSchema = object$1({
57892
57909
  hookId: string$3(),
57893
57910
  /**
57894
57911
  * The hook's token, written into the `hook_received` event's `eventData` so
57895
- * the consumer's re-ensured event carries the same token the producer would
57896
- * replay validates `eventData.token` against the `createHook` token.
57912
+ * the consumer's re-ensured event carries the same token the producer
57913
+ * would. Replay validates `eventData.token` against the `createHook` token.
57897
57914
  */
57898
57915
  token: string$3(),
57899
57916
  /** The serialized resume payload, reused verbatim from the direct write. */
@@ -57903,7 +57920,7 @@ const HookResumeInputSchema = object$1({
57903
57920
  * serialized bytes and forwarded verbatim on both the direct `events.create`
57904
57921
  * and this queue message. The consumer forwards it back to the server so both
57905
57922
  * writers of the same `resumeId` record an identical digest on the
57906
- * `(runId, resumeId)` constraint required because the v4 payload ref is not
57923
+ * `(runId, resumeId)` constraint, required because the v4 payload ref is not
57907
57924
  * content-stable server-side.
57908
57925
  */
57909
57926
  payloadDigest: string$3(),
@@ -57911,15 +57928,15 @@ const HookResumeInputSchema = object$1({
57911
57928
  * The deployment the run is pinned to, from the producer's resume context.
57912
57929
  * Lets the consumer detect a misrouted delivery with a cheap ambient
57913
57930
  * deployment-id comparison BEFORE its hoisted `hook_received` replay-preload
57914
- * write only a detected mismatch pays for the authoritative run fetch and
57931
+ * write: only a detected mismatch pays for the authoritative run fetch and
57915
57932
  * the deployment-affinity guard. Optional for queued-message compatibility:
57916
- * messages from older producers omit it and simply skip the pre-write
57933
+ * messages from older producers omit it and skip the pre-write
57917
57934
  * check (the authoritative guard before replay still protects them).
57918
57935
  */
57919
57936
  deploymentId: string$3().optional()
57920
57937
  });
57921
57938
  const HookResumeTimingSchema = object$1({
57922
- /** Epoch ms at entry into `resumeHook()` the start of the TTR window. */
57939
+ /** Epoch ms at entry into `resumeHook()`: the start of the TTR window. */
57923
57940
  resumeRequestedAtMs: number$3(),
57924
57941
  /** Epoch ms immediately before the queue publish was requested. */
57925
57942
  queuePublishRequestedAtMs: number$3(),
@@ -57955,10 +57972,41 @@ const WorkflowInvokePayloadSchema = object$1({
57955
57972
  serverErrorRetryCount: number$3().int().optional(),
57956
57973
  /** Number of times this message has been re-routed after a deployment mismatch */
57957
57974
  deploymentMismatchRetryCount: number$3().int().nonnegative().optional(),
57975
+ /**
57976
+ * The wait this message is the delayed continuation for, and which attempt
57977
+ * in that wait's chain it is.
57978
+ *
57979
+ * Present only on wait-continuation messages. It exists so the invocation a
57980
+ * continuation wakes can recognize itself as that continuation: if the wait
57981
+ * is STILL pending when it replays — the continuation arrived before its
57982
+ * deadline — then its own idempotency key is already spent, and re-enqueueing
57983
+ * under the same key is silently dropped by the world's dedupe window. The
57984
+ * attempt number is what makes the next key fresh, so an early delivery
57985
+ * costs one extra hop instead of losing the wait's timer permanently.
57986
+ *
57987
+ * Counted on the message for the same reason as
57988
+ * {@link WorkflowInvokePayloadSchema.shape.preconditionReinvocations}: the
57989
+ * budget has to survive across invocations, and a fresh enqueue resets
57990
+ * anything the queue tracks itself. Absent on the first continuation, so a
57991
+ * producer that predates this field is indistinguishable from attempt 0 and
57992
+ * a consumer that predates it simply ignores the field.
57993
+ */
57994
+ /**
57995
+ * `.catch(undefined)` for the reason `hookResumeTiming` has it: this field
57996
+ * must never be able to fail the parse of the invocation payload. A
57997
+ * malformed value would otherwise throw on every delivery of the message
57998
+ * and burn the run's delivery budget. Degrading to `undefined` reads as
57999
+ * "not a continuation", which costs at worst the pre-attempt behavior for
58000
+ * that one wait rather than killing the run.
58001
+ */
58002
+ waitContinuation: object$1({
58003
+ correlationId: string$3(),
58004
+ attempt: number$3().int().nonnegative()
58005
+ }).optional().catch(void 0),
57958
58006
  /** Step ID for inline step execution in combined handler. If provided, the flow execution
57959
58007
  * will jump directly to execute the step with the given ID before doing an event replay. */
57960
58008
  stepId: string$3().optional(),
57961
- /** Step name, sent alongside stepId to avoid loading the event log just to resolve the name. */
58009
+ /** Step name, sent alongside stepId to avoid loading the event log to resolve the name. */
57962
58010
  stepName: string$3().optional(),
57963
58011
  /** Run creation data, only present on the first queue delivery from start() */
57964
58012
  runInput: RunInputSchema.optional(),
@@ -57979,8 +58027,8 @@ const WorkflowInvokePayloadSchema = object$1({
57979
58027
  * Hook-resume TTR timing. Present on both `resumeHook()` dispatch paths
57980
58028
  * (unlike `hookInput`, which only rides the parallel fast path), and
57981
58029
  * forwarded onto a dispatched step message when the resuming invocation
57982
- * hands the next durable step to another invocation. Purely observational
57983
- * see {@link HookResumeTimingSchema}.
58030
+ * hands the next durable step to another invocation. Purely observational.
58031
+ * See {@link HookResumeTimingSchema}.
57984
58032
  *
57985
58033
  * `.catch(undefined)` because this field must never be able to fail the
57986
58034
  * parse of the invocation payload: a malformed value (a NaN boundary, a
@@ -58027,7 +58075,7 @@ const HookResumeContextSchema = object$1({
58027
58075
  // `@workflow/core` re-ensures the `hook_received` event from the queue
58028
58076
  // message's `hookInput` on replay, so `resumeHook()`'s parallel fast path is
58029
58077
  // safe to use. Because a run is pinned to its creating deployment, this
58030
- // marker is a reliable per-run attestation unlike inferring support from a
58078
+ // marker is a reliable per-run attestation, unlike inferring support from a
58031
58079
  // version compare against a predicted release cutoff. Absent on runs created
58032
58080
  // before the marker existed (fall back to the sequential path).
58033
58081
  hookResumeInputVersion: number$3().optional()
@@ -58050,7 +58098,7 @@ const HookSchema = object$1({
58050
58098
  environment: string$3(),
58051
58099
  metadata: SerializedDataSchema.optional(),
58052
58100
  createdAt: date$2(),
58053
- // Optional in database for backwards compatibility, defaults to 1 (legacy) when reading
58101
+ // Optional in database for backward compatibility, defaults to 1 (legacy) when reading
58054
58102
  specVersion: number$3().optional(),
58055
58103
  isWebhook: boolean$3().optional(),
58056
58104
  isSystem: boolean$3().optional(),
@@ -58062,9 +58110,9 @@ const HookSchema = object$1({
58062
58110
  // falls back to `runs.get`.
58063
58111
  resumeContext: HookResumeContextSchema.optional(),
58064
58112
  // Backend dedup capability, computed FRESH by the server on every by-token
58065
- // lookup RESPONSE-ONLY and TRANSIENT. Never persisted on the hook entity
58113
+ // lookup: RESPONSE-ONLY and TRANSIENT. Never persisted on the hook entity
58066
58114
  // and never part of `resumeContext`, so a server rollback or kill switch
58067
- // takes effect on the very next lookup (the field simply stops appearing).
58115
+ // takes effect on the next lookup (the field stops appearing).
58068
58116
  // `resumeHook()` gates its parallel fast path on this being present and
58069
58117
  // current. Absent against an older/rolled-back server or when the kill switch
58070
58118
  // is active.
@@ -58176,8 +58224,13 @@ const SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT = 3;
58176
58224
  const SPEC_VERSION_SUPPORTS_ATTRIBUTES = 4;
58177
58225
  const SPEC_VERSION_SUPPORTS_COMPRESSION = 5;
58178
58226
  const SPEC_VERSION_SUPPORTS_SLOT_IDENTITY = 6;
58179
- const SPEC_VERSION_CURRENT = SPEC_VERSION_SUPPORTS_SLOT_IDENTITY;
58180
- const SPEC_VERSION_MAX_SUPPORTED = SPEC_VERSION_SUPPORTS_SLOT_IDENTITY;
58227
+ const SPEC_VERSION_SUPPORTS_SEALED_LOG = 7;
58228
+ const SPEC_VERSION_CURRENT = SPEC_VERSION_SUPPORTS_SEALED_LOG;
58229
+ const SEALED_LOG_ENV_VAR = "WORKFLOW_SEALED_LOG";
58230
+ function mintedSpecVersion(env2 = process.env) {
58231
+ return envFlag(SEALED_LOG_ENV_VAR, true, env2) ? SPEC_VERSION_CURRENT : SPEC_VERSION_SUPPORTS_SLOT_IDENTITY;
58232
+ }
58233
+ const SPEC_VERSION_MAX_SUPPORTED = SPEC_VERSION_SUPPORTS_SEALED_LOG;
58181
58234
  function isLegacySpecVersion(v2) {
58182
58235
  return v2 === void 0 || v2 === null || v2 <= SPEC_VERSION_LEGACY;
58183
58236
  }
@@ -58330,13 +58383,13 @@ function monotonicFactory(prng) {
58330
58383
  return encodeTime(seed, TIME_LEN) + newRandom;
58331
58384
  };
58332
58385
  }
58333
- function ulid$3(seedTime, prng) {
58386
+ function ulid$1(seedTime, prng) {
58334
58387
  const currentPRNG = detectPRNG();
58335
58388
  const seed = Date.now();
58336
58389
  return encodeTime(seed, TIME_LEN) + encodeRandom(RANDOM_LEN, currentPRNG);
58337
58390
  }
58338
58391
  const UlidSchema = string$3().ulid();
58339
- const workflowRunIdSchema = templateLiteral(["wrun_", ulid$4()]);
58392
+ const workflowRunIdSchema = templateLiteral(["wrun_", ulid$2()]);
58340
58393
  const DEFAULT_TIMESTAMP_THRESHOLD_PAST_MS = 24 * 60 * 60 * 1e3;
58341
58394
  const DEFAULT_TIMESTAMP_THRESHOLD_FUTURE_MS = 5 * 60 * 1e3;
58342
58395
  function ulidToDate(maybeUlid) {
@@ -58465,6 +58518,218 @@ function looksLikeWorkflowIdSearchInput(query) {
58465
58518
  }
58466
58519
  return /\d/.test(trimmed);
58467
58520
  }
58521
+ function globalSingleton(name2, shapeVersion, create2) {
58522
+ const key = Symbol.for(`${name2}/v${shapeVersion}`);
58523
+ const store = globalThis;
58524
+ const existing = store[key];
58525
+ if (existing !== void 0) {
58526
+ return existing;
58527
+ }
58528
+ const created = create2();
58529
+ store[key] = created;
58530
+ return created;
58531
+ }
58532
+ function pluralize(singular, plural, count2) {
58533
+ return count2 === 1 ? singular : plural;
58534
+ }
58535
+ function withResolvers$1() {
58536
+ let resolve2;
58537
+ let reject;
58538
+ const promise2 = new Promise((_resolve, _reject) => {
58539
+ resolve2 = _resolve;
58540
+ reject = _reject;
58541
+ });
58542
+ return { promise: promise2, resolve: resolve2, reject };
58543
+ }
58544
+ function once$1(fn2) {
58545
+ const result = {
58546
+ get value() {
58547
+ const value = fn2();
58548
+ Object.defineProperty(result, "value", { value });
58549
+ return value;
58550
+ }
58551
+ };
58552
+ return result;
58553
+ }
58554
+ var ms$1;
58555
+ var hasRequiredMs;
58556
+ function requireMs() {
58557
+ if (hasRequiredMs) return ms$1;
58558
+ hasRequiredMs = 1;
58559
+ var s2 = 1e3;
58560
+ var m2 = s2 * 60;
58561
+ var h2 = m2 * 60;
58562
+ var d2 = h2 * 24;
58563
+ var w2 = d2 * 7;
58564
+ var y2 = d2 * 365.25;
58565
+ ms$1 = function(val, options) {
58566
+ options = options || {};
58567
+ var type = typeof val;
58568
+ if (type === "string" && val.length > 0) {
58569
+ return parse2(val);
58570
+ } else if (type === "number" && isFinite(val)) {
58571
+ return options.long ? fmtLong(val) : fmtShort(val);
58572
+ }
58573
+ throw new Error(
58574
+ "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
58575
+ );
58576
+ };
58577
+ function parse2(str) {
58578
+ str = String(str);
58579
+ if (str.length > 100) {
58580
+ return;
58581
+ }
58582
+ var match2 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
58583
+ str
58584
+ );
58585
+ if (!match2) {
58586
+ return;
58587
+ }
58588
+ var n = parseFloat(match2[1]);
58589
+ var type = (match2[2] || "ms").toLowerCase();
58590
+ switch (type) {
58591
+ case "years":
58592
+ case "year":
58593
+ case "yrs":
58594
+ case "yr":
58595
+ case "y":
58596
+ return n * y2;
58597
+ case "weeks":
58598
+ case "week":
58599
+ case "w":
58600
+ return n * w2;
58601
+ case "days":
58602
+ case "day":
58603
+ case "d":
58604
+ return n * d2;
58605
+ case "hours":
58606
+ case "hour":
58607
+ case "hrs":
58608
+ case "hr":
58609
+ case "h":
58610
+ return n * h2;
58611
+ case "minutes":
58612
+ case "minute":
58613
+ case "mins":
58614
+ case "min":
58615
+ case "m":
58616
+ return n * m2;
58617
+ case "seconds":
58618
+ case "second":
58619
+ case "secs":
58620
+ case "sec":
58621
+ case "s":
58622
+ return n * s2;
58623
+ case "milliseconds":
58624
+ case "millisecond":
58625
+ case "msecs":
58626
+ case "msec":
58627
+ case "ms":
58628
+ return n;
58629
+ default:
58630
+ return void 0;
58631
+ }
58632
+ }
58633
+ function fmtShort(ms2) {
58634
+ var msAbs = Math.abs(ms2);
58635
+ if (msAbs >= d2) {
58636
+ return Math.round(ms2 / d2) + "d";
58637
+ }
58638
+ if (msAbs >= h2) {
58639
+ return Math.round(ms2 / h2) + "h";
58640
+ }
58641
+ if (msAbs >= m2) {
58642
+ return Math.round(ms2 / m2) + "m";
58643
+ }
58644
+ if (msAbs >= s2) {
58645
+ return Math.round(ms2 / s2) + "s";
58646
+ }
58647
+ return ms2 + "ms";
58648
+ }
58649
+ function fmtLong(ms2) {
58650
+ var msAbs = Math.abs(ms2);
58651
+ if (msAbs >= d2) {
58652
+ return plural(ms2, msAbs, d2, "day");
58653
+ }
58654
+ if (msAbs >= h2) {
58655
+ return plural(ms2, msAbs, h2, "hour");
58656
+ }
58657
+ if (msAbs >= m2) {
58658
+ return plural(ms2, msAbs, m2, "minute");
58659
+ }
58660
+ if (msAbs >= s2) {
58661
+ return plural(ms2, msAbs, s2, "second");
58662
+ }
58663
+ return ms2 + " ms";
58664
+ }
58665
+ function plural(ms2, msAbs, n, name2) {
58666
+ var isPlural = msAbs >= n * 1.5;
58667
+ return Math.round(ms2 / n) + " " + name2 + (isPlural ? "s" : "");
58668
+ }
58669
+ return ms$1;
58670
+ }
58671
+ var msExports = requireMs();
58672
+ const ms = /* @__PURE__ */ getDefaultExportFromCjs(msExports);
58673
+ function parseDurationToDate(param) {
58674
+ if (typeof param === "string") {
58675
+ const durationMs = ms(param);
58676
+ if (typeof durationMs !== "number" || durationMs < 0) {
58677
+ throw new Error(`Invalid duration: "${param}". Expected a valid duration string like "1s", "1m", "1h", etc.`);
58678
+ }
58679
+ return new Date(Date.now() + durationMs);
58680
+ } else if (typeof param === "number") {
58681
+ if (param < 0 || !Number.isFinite(param)) {
58682
+ throw new Error(`Invalid duration: ${param}. Expected a non-negative finite number of milliseconds.`);
58683
+ }
58684
+ return new Date(Date.now() + param);
58685
+ } else if (param instanceof Date || param && typeof param === "object" && typeof param.getTime === "function") {
58686
+ return param instanceof Date ? param : new Date(param.getTime());
58687
+ } else {
58688
+ throw new Error(`Invalid duration parameter. Expected a duration string, number (milliseconds), or Date object.`);
58689
+ }
58690
+ }
58691
+ const WORKFLOW_ROUTE_BASE = "/.well-known/workflow/v1";
58692
+ const BASE_PATH_SYMBOL = Symbol.for("@workflow/core/basePath");
58693
+ const globalConfig = globalThis;
58694
+ function getWorkflowBasePath() {
58695
+ return globalConfig[BASE_PATH_SYMBOL] ?? "";
58696
+ }
58697
+ function createWorkflowBaseUrl(origin) {
58698
+ new URL(origin);
58699
+ return `${origin.replace(/[?#].*$/, "").replace(/\/+$/, "")}${getWorkflowBasePath()}`;
58700
+ }
58701
+ function createWorkflowUrl(baseUrl, route) {
58702
+ const url2 = new URL(baseUrl);
58703
+ url2.pathname = `${url2.pathname.replace(/\/+$/, "")}${WORKFLOW_ROUTE_BASE}/${getWorkflowRouteEndpoint(route)}`;
58704
+ url2.search = route.type === "health" ? "__health" : "";
58705
+ url2.hash = "";
58706
+ return url2.toString();
58707
+ }
58708
+ function getWorkflowRouteEndpoint(route) {
58709
+ switch (route.type) {
58710
+ case "flow":
58711
+ case "health":
58712
+ return "flow";
58713
+ case "manifest":
58714
+ return "manifest.json";
58715
+ case "webhook":
58716
+ return `webhook/${encodeURIComponent(route.token)}`;
58717
+ }
58718
+ throw new Error(`Unsupported workflow route: ${String(route.type)}`);
58719
+ }
58720
+ function createWorkflowHealthEndpoint() {
58721
+ return `${getWorkflowBasePath()}${WORKFLOW_ROUTE_BASE}/flow?__health`;
58722
+ }
58723
+ function resolveWorkflowTargetWorld(env2 = process.env) {
58724
+ const configuredWorld = env2.WORKFLOW_TARGET_WORLD;
58725
+ if (configuredWorld) {
58726
+ return configuredWorld;
58727
+ }
58728
+ return env2.VERCEL_DEPLOYMENT_ID ? "vercel" : "local";
58729
+ }
58730
+ function isVercelWorldTarget(targetWorld) {
58731
+ return targetWorld === "vercel" || targetWorld === "@workflow/world-vercel";
58732
+ }
58468
58733
  const UNDEFINED$2 = -1;
58469
58734
  const HOLE = -2;
58470
58735
  const NAN = -3;
@@ -59123,207 +59388,6 @@ function stringify_primitive(thing) {
59123
59388
  if (type === "bigint") return `["BigInt","${thing}"]`;
59124
59389
  return String(thing);
59125
59390
  }
59126
- function pluralize(singular, plural, count2) {
59127
- return count2 === 1 ? singular : plural;
59128
- }
59129
- function withResolvers$1() {
59130
- let resolve2;
59131
- let reject;
59132
- const promise2 = new Promise((_resolve, _reject) => {
59133
- resolve2 = _resolve;
59134
- reject = _reject;
59135
- });
59136
- return { promise: promise2, resolve: resolve2, reject };
59137
- }
59138
- function once$1(fn2) {
59139
- const result = {
59140
- get value() {
59141
- const value = fn2();
59142
- Object.defineProperty(result, "value", { value });
59143
- return value;
59144
- }
59145
- };
59146
- return result;
59147
- }
59148
- var ms$1;
59149
- var hasRequiredMs;
59150
- function requireMs() {
59151
- if (hasRequiredMs) return ms$1;
59152
- hasRequiredMs = 1;
59153
- var s2 = 1e3;
59154
- var m2 = s2 * 60;
59155
- var h2 = m2 * 60;
59156
- var d2 = h2 * 24;
59157
- var w2 = d2 * 7;
59158
- var y2 = d2 * 365.25;
59159
- ms$1 = function(val, options) {
59160
- options = options || {};
59161
- var type = typeof val;
59162
- if (type === "string" && val.length > 0) {
59163
- return parse2(val);
59164
- } else if (type === "number" && isFinite(val)) {
59165
- return options.long ? fmtLong(val) : fmtShort(val);
59166
- }
59167
- throw new Error(
59168
- "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
59169
- );
59170
- };
59171
- function parse2(str) {
59172
- str = String(str);
59173
- if (str.length > 100) {
59174
- return;
59175
- }
59176
- var match2 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
59177
- str
59178
- );
59179
- if (!match2) {
59180
- return;
59181
- }
59182
- var n = parseFloat(match2[1]);
59183
- var type = (match2[2] || "ms").toLowerCase();
59184
- switch (type) {
59185
- case "years":
59186
- case "year":
59187
- case "yrs":
59188
- case "yr":
59189
- case "y":
59190
- return n * y2;
59191
- case "weeks":
59192
- case "week":
59193
- case "w":
59194
- return n * w2;
59195
- case "days":
59196
- case "day":
59197
- case "d":
59198
- return n * d2;
59199
- case "hours":
59200
- case "hour":
59201
- case "hrs":
59202
- case "hr":
59203
- case "h":
59204
- return n * h2;
59205
- case "minutes":
59206
- case "minute":
59207
- case "mins":
59208
- case "min":
59209
- case "m":
59210
- return n * m2;
59211
- case "seconds":
59212
- case "second":
59213
- case "secs":
59214
- case "sec":
59215
- case "s":
59216
- return n * s2;
59217
- case "milliseconds":
59218
- case "millisecond":
59219
- case "msecs":
59220
- case "msec":
59221
- case "ms":
59222
- return n;
59223
- default:
59224
- return void 0;
59225
- }
59226
- }
59227
- function fmtShort(ms2) {
59228
- var msAbs = Math.abs(ms2);
59229
- if (msAbs >= d2) {
59230
- return Math.round(ms2 / d2) + "d";
59231
- }
59232
- if (msAbs >= h2) {
59233
- return Math.round(ms2 / h2) + "h";
59234
- }
59235
- if (msAbs >= m2) {
59236
- return Math.round(ms2 / m2) + "m";
59237
- }
59238
- if (msAbs >= s2) {
59239
- return Math.round(ms2 / s2) + "s";
59240
- }
59241
- return ms2 + "ms";
59242
- }
59243
- function fmtLong(ms2) {
59244
- var msAbs = Math.abs(ms2);
59245
- if (msAbs >= d2) {
59246
- return plural(ms2, msAbs, d2, "day");
59247
- }
59248
- if (msAbs >= h2) {
59249
- return plural(ms2, msAbs, h2, "hour");
59250
- }
59251
- if (msAbs >= m2) {
59252
- return plural(ms2, msAbs, m2, "minute");
59253
- }
59254
- if (msAbs >= s2) {
59255
- return plural(ms2, msAbs, s2, "second");
59256
- }
59257
- return ms2 + " ms";
59258
- }
59259
- function plural(ms2, msAbs, n, name2) {
59260
- var isPlural = msAbs >= n * 1.5;
59261
- return Math.round(ms2 / n) + " " + name2 + (isPlural ? "s" : "");
59262
- }
59263
- return ms$1;
59264
- }
59265
- var msExports = requireMs();
59266
- const ms = /* @__PURE__ */ getDefaultExportFromCjs(msExports);
59267
- function parseDurationToDate(param) {
59268
- if (typeof param === "string") {
59269
- const durationMs = ms(param);
59270
- if (typeof durationMs !== "number" || durationMs < 0) {
59271
- throw new Error(`Invalid duration: "${param}". Expected a valid duration string like "1s", "1m", "1h", etc.`);
59272
- }
59273
- return new Date(Date.now() + durationMs);
59274
- } else if (typeof param === "number") {
59275
- if (param < 0 || !Number.isFinite(param)) {
59276
- throw new Error(`Invalid duration: ${param}. Expected a non-negative finite number of milliseconds.`);
59277
- }
59278
- return new Date(Date.now() + param);
59279
- } else if (param instanceof Date || param && typeof param === "object" && typeof param.getTime === "function") {
59280
- return param instanceof Date ? param : new Date(param.getTime());
59281
- } else {
59282
- throw new Error(`Invalid duration parameter. Expected a duration string, number (milliseconds), or Date object.`);
59283
- }
59284
- }
59285
- const WORKFLOW_ROUTE_BASE = "/.well-known/workflow/v1";
59286
- const BASE_PATH_SYMBOL = Symbol.for("@workflow/core/basePath");
59287
- const globalConfig = globalThis;
59288
- function getWorkflowBasePath() {
59289
- return globalConfig[BASE_PATH_SYMBOL] ?? "";
59290
- }
59291
- function createWorkflowBaseUrl(origin) {
59292
- new URL(origin);
59293
- return `${origin.replace(/[?#].*$/, "").replace(/\/+$/, "")}${getWorkflowBasePath()}`;
59294
- }
59295
- function createWorkflowUrl(baseUrl, route) {
59296
- const url2 = new URL(baseUrl);
59297
- url2.pathname = `${url2.pathname.replace(/\/+$/, "")}${WORKFLOW_ROUTE_BASE}/${getWorkflowRouteEndpoint(route)}`;
59298
- url2.search = route.type === "health" ? "__health" : "";
59299
- url2.hash = "";
59300
- return url2.toString();
59301
- }
59302
- function getWorkflowRouteEndpoint(route) {
59303
- switch (route.type) {
59304
- case "flow":
59305
- case "health":
59306
- return "flow";
59307
- case "manifest":
59308
- return "manifest.json";
59309
- case "webhook":
59310
- return `webhook/${encodeURIComponent(route.token)}`;
59311
- }
59312
- throw new Error(`Unsupported workflow route: ${String(route.type)}`);
59313
- }
59314
- function createWorkflowHealthEndpoint() {
59315
- return `${getWorkflowBasePath()}${WORKFLOW_ROUTE_BASE}/flow?__health`;
59316
- }
59317
- function resolveWorkflowTargetWorld(env2 = process.env) {
59318
- const configuredWorld = env2.WORKFLOW_TARGET_WORLD;
59319
- if (configuredWorld) {
59320
- return configuredWorld;
59321
- }
59322
- return env2.VERCEL_DEPLOYMENT_ID ? "vercel" : "local";
59323
- }
59324
- function isVercelWorldTarget(targetWorld) {
59325
- return targetWorld === "vercel" || targetWorld === "@workflow/world-vercel";
59326
- }
59327
59391
  const BASE_URL = "https://workflow-sdk.dev/err";
59328
59392
  function isError(value) {
59329
59393
  return typeof value === "object" && value !== null && "name" in value && "message" in value;
@@ -59461,7 +59525,7 @@ class SerializationError extends WorkflowError {
59461
59525
  super(body2, { cause: options == null ? void 0 : options.cause });
59462
59526
  __publicField(this, "hint");
59463
59527
  /**
59464
- * Serialization errors are deterministic if a step returns a non-POJO,
59528
+ * Serialization errors are deterministic: if a step returns a non-POJO,
59465
59529
  * replaying the step will always produce the same non-serializable value.
59466
59530
  * Retrying is guaranteed to fail, so these errors are surfaced as fatal
59467
59531
  * and skip the step-retry loop. `FatalError.is()` recognizes any error
@@ -59826,7 +59890,7 @@ function importPublicKey(publicKey) {
59826
59890
  { name: "X25519" },
59827
59891
  /* extractable */
59828
59892
  true,
59829
- // Public keys carry no usages for X25519 the private key does the
59893
+ // Public keys carry no usages for X25519: the private key does the
59830
59894
  // deriving; the public key is only ever an argument to it.
59831
59895
  []
59832
59896
  );
@@ -60054,7 +60118,7 @@ const SerializationFormat$1 = {
60054
60118
  /** Encrypted payload (inner payload has its own format prefix) */
60055
60119
  ENCRYPTED: "encr",
60056
60120
  /**
60057
- * Sealed payload asymmetrically encrypted to a run's X25519 public key
60121
+ * Sealed payload: asymmetrically encrypted to a run's X25519 public key
60058
60122
  * (inner payload has its own format prefix).
60059
60123
  *
60060
60124
  * Used for *cross-run* writes (hook payloads, forwarded stream frames),
@@ -60218,7 +60282,7 @@ const SerializationFormat = {
60218
60282
  /** Encrypted payload (inner payload has its own format prefix after decryption) */
60219
60283
  ENCRYPTED: "encr",
60220
60284
  /**
60221
- * Sealed payload asymmetrically encrypted to a run's X25519 public key
60285
+ * Sealed payload: asymmetrically encrypted to a run's X25519 public key
60222
60286
  * (inner payload has its own format prefix after opening).
60223
60287
  *
60224
60288
  * Written by cross-run writers that hold only the recipient run's public
@@ -60312,17 +60376,19 @@ function decompressSyncIfAvailable(format2, payload) {
60312
60376
  }
60313
60377
  return void 0;
60314
60378
  }
60315
- let zstdBrowserDecoder;
60379
+ const zstd = globalSingleton("@workflow/core//zstd.decoder", 1, () => ({
60380
+ decoder: void 0
60381
+ }));
60316
60382
  function registerZstdDecoder(decoder2) {
60317
- zstdBrowserDecoder = decoder2;
60383
+ zstd.decoder = decoder2;
60318
60384
  }
60319
60385
  async function decompressAsync(format2, payload) {
60320
60386
  if (format2 === SerializationFormat.ZSTD) {
60321
60387
  const sync = decompressSyncIfAvailable(format2, payload);
60322
60388
  if (sync)
60323
60389
  return sync;
60324
- if (zstdBrowserDecoder)
60325
- return zstdBrowserDecoder(payload);
60390
+ if (zstd.decoder)
60391
+ return zstd.decoder(payload);
60326
60392
  throw new Error("zstd-compressed workflow data encountered but no zstd decoder is available. Node.js 22.15+ decodes natively; in the browser register one via registerZstdDecoder (the web o11y package does this).");
60327
60393
  }
60328
60394
  const transform2 = new DecompressionStream("gzip");
@@ -60466,7 +60532,7 @@ const observabilityRevivers = {
60466
60532
  // throws on the `["DOMException", ...]` tag and `hydrateStepIO`'s
60467
60533
  // try/catch leaves the raw flat-encoded string in the UI. AbortController
60468
60534
  // synthesizes a DOMException as the default `signal.reason` when abort()
60469
- // is called with no arg so any abort that round-trips through a step
60535
+ // is called with no arg, so any abort that round-trips through a step
60470
60536
  // boundary surfaces here. Reconstruct as a real DOMException when the
60471
60537
  // global is available (modern browsers + Node 18+), else fall back to
60472
60538
  // an Error preserving name/message/stack/cause for display.
@@ -60675,8 +60741,8 @@ function getWebRevivers() {
60675
60741
  // entry for each built-in Error subclass plus the workflow-specific
60676
60742
  // `FatalError` / `RetryableError` / `HookConflictError` /
60677
60743
  // `RuntimeDecryptionError` and `AggregateError`. Without
60678
- // matching revivers here, `devalue.unflatten` throws "Unknown type X"
60679
- // which surfaces in the web o11y UI as "Failed to load resource
60744
+ // matching revivers here, `devalue.unflatten` throws "Unknown type X",
60745
+ // which surfaces in the web o11y UI as "Failed to load resource
60680
60746
  // details: Unknown type FatalError".
60681
60747
  Error: (value) => {
60682
60748
  const opts = "cause" in value ? { cause: value.cause } : void 0;
@@ -60706,7 +60772,7 @@ function getWebRevivers() {
60706
60772
  // `FatalError` and `RetryableError` are not built-in browser globals,
60707
60773
  // so we can't resolve a constructor from globalThis. The web o11y UI
60708
60774
  // doesn't need `instanceof FatalError` to pass (no user code runs
60709
- // here) it just needs `name`, `message`, `stack`, and any extra
60775
+ // here). The web o11y UI needs `name`, `message`, `stack`, and any extra
60710
60776
  // enumerable fields to render. Construct a plain `Error` with `name`
60711
60777
  // set; ObjectInspector reads `constructor.name` for the displayed
60712
60778
  // class label, but we don't have the real class, so we emit a tagged
@@ -60904,7 +60970,7 @@ function replaceEncryptedAndExpiredWithMarkers(resource) {
60904
60970
  }
60905
60971
  async function hydrateResourceIOAsync(resource, key) {
60906
60972
  const { hydrateDataWithKey: hydrateDataWithKey2, deriveRunPayloadKeys: deriveRunPayloadKeys2 } = await Promise.resolve().then(() => serializationFormat);
60907
- const { ensureZstdDecoderRegistered } = await import("./zstd-browser-decoder-D8JD_nwS.js");
60973
+ const { ensureZstdDecoderRegistered } = await import("./zstd-browser-decoder-Cd_DTxZV.js");
60908
60974
  ensureZstdDecoderRegistered();
60909
60975
  const cryptoKey = key ? await deriveRunPayloadKeys2(key) : void 0;
60910
60976
  const revivers = getRevivers();
@@ -60957,6 +61023,10 @@ function hasEncryptedFields(resource) {
60957
61023
  }
60958
61024
  return false;
60959
61025
  }
61026
+ const SEALED_EVENT_MESSAGE = "No-op events are written by the backend to seal an abandoned log position";
61027
+ function isSealedNoopEvent(event) {
61028
+ return isSealedNoopEvent$1(event);
61029
+ }
60960
61030
  function __insertCSS(code2) {
60961
61031
  if (typeof document == "undefined") return;
60962
61032
  let head = document.head || document.getElementsByTagName("head")[0];
@@ -62862,7 +62932,7 @@ const RunClickContext = reactExports.createContext(void 0);
62862
62932
  function EncryptedInlineLabel() {
62863
62933
  const ctx = reactExports.useContext(DecryptClickContext);
62864
62934
  if (ctx) {
62865
- return jsxRuntimeExports.jsxs(Button$1, { size: "xs", className: "align-baseline gap-x-1", disabled: ctx.isDecrypting, onClick: (e) => {
62935
+ return jsxRuntimeExports.jsxs(Button$1, { size: "xs", className: "align-baseline gap-x-1", disabled: ctx.isDecrypting || ctx.isDecryptDisabled, title: ctx.isDecryptDisabled ? ctx.decryptDisabledReason : void 0, onClick: (e) => {
62866
62936
  e.stopPropagation();
62867
62937
  ctx.onDecrypt();
62868
62938
  }, children: [ctx.isDecrypting ? jsxRuntimeExports.jsx(Spinner, { size: 10 }) : jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3" }), jsxRuntimeExports.jsx("span", { children: "Decrypt" })] });
@@ -63135,7 +63205,7 @@ function collapseRefs(data) {
63135
63205
  }
63136
63206
  return result;
63137
63207
  }
63138
- function DataInspector({ data, expandLevel = 2, name: name2, onStreamClick, onRunClick, onDecrypt, isDecrypting = false }) {
63208
+ function DataInspector({ data, expandLevel = 2, name: name2, onStreamClick, onRunClick, onDecrypt, isDecrypting = false, isDecryptDisabled = false, decryptDisabledReason }) {
63139
63209
  const collapsedData = reactExports.useMemo(() => collapseRefs(data), [data]);
63140
63210
  const stableData = useStableInspectorData(collapsedData);
63141
63211
  let content2 = jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("style", { href: "wf-json-view", precedence: "default", children: JSON_VIEW_STYLES }), jsxRuntimeExports.jsx(JsonTree, { data: stableData, name: name2, expandLevel })] });
@@ -63146,7 +63216,12 @@ function DataInspector({ data, expandLevel = 2, name: name2, onStreamClick, onRu
63146
63216
  content2 = jsxRuntimeExports.jsx(RunClickContext.Provider, { value: onRunClick, children: content2 });
63147
63217
  }
63148
63218
  if (onDecrypt) {
63149
- content2 = jsxRuntimeExports.jsx(DecryptClickContext.Provider, { value: { onDecrypt, isDecrypting }, children: content2 });
63219
+ content2 = jsxRuntimeExports.jsx(DecryptClickContext.Provider, { value: {
63220
+ onDecrypt,
63221
+ isDecrypting,
63222
+ isDecryptDisabled,
63223
+ decryptDisabledReason
63224
+ }, children: content2 });
63150
63225
  }
63151
63226
  return content2;
63152
63227
  }
@@ -63231,7 +63306,7 @@ const encryptedPlaceholderPreview = `{
63231
63306
  }`;
63232
63307
  function EncryptedDataBlock() {
63233
63308
  const ctx = reactExports.useContext(DecryptClickContext);
63234
- return jsxRuntimeExports.jsxs("div", { className: "relative min-h-20 overflow-hidden rounded-md border border-gray-alpha-400 bg-background-100", children: [jsxRuntimeExports.jsx("pre", { "aria-hidden": "true", className: "pointer-events-none m-0 select-none p-3 font-mono text-label-12 text-gray-900 blur-[4px]", children: encryptedPlaceholderPreview }), jsxRuntimeExports.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: ctx ? jsxRuntimeExports.jsxs(Button$1, { onClick: ctx.onDecrypt, disabled: ctx.isDecrypting, size: "xs", children: [ctx.isDecrypting ? jsxRuntimeExports.jsx(Spinner, { size: 10 }) : jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3" }), jsxRuntimeExports.jsx("span", { children: "Decrypt" })] }) : jsxRuntimeExports.jsxs("span", { className: "inline-flex items-center gap-1 rounded border border-gray-alpha-400 bg-gray-100 px-1.5 py-0.5 text-button-12 font-medium text-gray-700", children: [jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3" }), "Encrypted"] }) })] });
63309
+ return jsxRuntimeExports.jsxs("div", { className: "relative min-h-20 overflow-hidden rounded-md border border-gray-alpha-400 bg-background-100", children: [jsxRuntimeExports.jsx("pre", { "aria-hidden": "true", className: "pointer-events-none m-0 select-none p-3 font-mono text-label-12 text-gray-900 blur-[4px]", children: encryptedPlaceholderPreview }), jsxRuntimeExports.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: ctx ? jsxRuntimeExports.jsxs(Button$1, { onClick: ctx.onDecrypt, disabled: ctx.isDecrypting || ctx.isDecryptDisabled, title: ctx.isDecryptDisabled ? ctx.decryptDisabledReason : void 0, size: "xs", children: [ctx.isDecrypting ? jsxRuntimeExports.jsx(Spinner, { size: 10 }) : jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3" }), jsxRuntimeExports.jsx("span", { children: "Decrypt" })] }) : jsxRuntimeExports.jsxs("span", { className: "inline-flex items-center gap-1 rounded border border-gray-alpha-400 bg-gray-100 px-1.5 py-0.5 text-button-12 font-medium text-gray-700", children: [jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3" }), "Encrypted"] }) })] });
63235
63310
  }
63236
63311
  const serializeForClipboard = (value) => {
63237
63312
  if (typeof value === "string")
@@ -64069,19 +64144,19 @@ function ContextCardTrigger({ content: content2, children: children2, side = "ri
64069
64144
  const Comp = asChild ? Root$6 : "div";
64070
64145
  return jsxRuntimeExports.jsxs(Comp, { className: cn$4("inline-flex cursor-pointer flex-[0_1_auto] overflow-hidden", className), onMouseEnter, onMouseLeave, onClick: handleClick, ref: triggerRef, children: [jsxRuntimeExports.jsx(Slottable$1, { children: children2 }), (portalRef == null ? void 0 : portalRef.current) && (localHover || persisting) ? reactDomExports.createPortal(jsxRuntimeExports.jsx("div", { className: cn$4("absolute top-0 p-3 left-0 max-w-max transition-[transform,width,height] duration-[250ms] ease-[easing-function:cubic-bezier(0.29,0.31,0.05,0.96)] will-change-[transform,width,height] motion-reduce:!transition-none", skipTransition && "!transition-none", noPadding && "p-0", rootVisible && visible && !ignoreCardPointerEvents ? "pointer-events-auto" : "pointer-events-none"), ref: contentRef, children: jsxRuntimeExports.jsx("div", { className: cn$4("min-w-max transition-all duration-150 ease-[easing-function:cubic-bezier(0.3,_0.57,_0.07,_0.95)] will-change-[transform,width,height] motion-reduce:!transition-none", skipTransition ? "!transition-none" : "transition-[transform,width,height] duration-[250ms] ease-[easing-function:cubic-bezier(0.29,0.31,0.05,0.96)] will-change-[transform,width,height] motion-reduce:!transition-none", visible ? "opacity-100" : "opacity-0"), ref: contentMeasureRef, children: content2 }) }, id2), portalRef.current) : null] });
64071
64146
  }
64072
- const STYLES$2 = `.wf-decrypt-btn{appearance:none;-webkit-appearance:none;border:none;display:inline-flex;align-items:center;justify-content:center;height:40px;padding:0 12px;border-radius:6px;font-size:14px;font-weight:500;line-height:20px;cursor:pointer;white-space:nowrap;gap:6px;transition:background 150ms}.wf-decrypt-idle{color:var(--ds-gray-1000);background:var(--ds-background-100);box-shadow:0 0 0 1px var(--ds-gray-400)}.wf-decrypt-idle:hover{background:var(--ds-gray-alpha-200)}.wf-decrypt-done{color:var(--ds-green-900);background:var(--ds-green-100);box-shadow:0 0 0 1px var(--ds-green-400);cursor:default}`;
64073
- function DecryptButton({ decrypted = false, loading = false, onClick }) {
64074
- return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("style", { dangerouslySetInnerHTML: { __html: STYLES$2 } }), jsxRuntimeExports.jsxs("button", { type: "button", onClick: decrypted ? void 0 : onClick, disabled: decrypted || loading, className: `wf-decrypt-btn ${decrypted ? "wf-decrypt-done" : "wf-decrypt-idle"}`, children: [loading ? jsxRuntimeExports.jsx(Spinner, { size: 14 }) : decrypted ? jsxRuntimeExports.jsxs("svg", { width: 14, height: 14, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntimeExports.jsx("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }), jsxRuntimeExports.jsx("path", { d: "M7 11V7a5 5 0 0 1 9.9-1" })] }) : jsxRuntimeExports.jsxs("svg", { width: 14, height: 14, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntimeExports.jsx("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }), jsxRuntimeExports.jsx("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })] }), loading ? "Decrypting…" : decrypted ? "Decrypted" : "Decrypt"] })] });
64147
+ const STYLES$2 = `.wf-decrypt-btn{appearance:none;-webkit-appearance:none;border:none;display:inline-flex;align-items:center;justify-content:center;height:40px;padding:0 12px;border-radius:6px;font-size:14px;font-weight:500;line-height:20px;cursor:pointer;white-space:nowrap;gap:6px;transition:background 150ms}.wf-decrypt-idle{color:var(--ds-gray-1000);background:var(--ds-background-100);box-shadow:0 0 0 1px var(--ds-gray-400)}.wf-decrypt-idle:hover{background:var(--ds-gray-alpha-200)}.wf-decrypt-btn:disabled{cursor:not-allowed;opacity:.5}.wf-decrypt-done{color:var(--ds-green-900);background:var(--ds-green-100);box-shadow:0 0 0 1px var(--ds-green-400);cursor:default}`;
64148
+ function DecryptButton({ decrypted = false, loading = false, disabled = false, disabledReason, onClick }) {
64149
+ return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("style", { dangerouslySetInnerHTML: { __html: STYLES$2 } }), jsxRuntimeExports.jsxs("button", { type: "button", onClick: decrypted ? void 0 : onClick, disabled: decrypted || loading || disabled, title: disabled ? disabledReason : void 0, className: `wf-decrypt-btn ${decrypted ? "wf-decrypt-done" : "wf-decrypt-idle"}`, children: [loading ? jsxRuntimeExports.jsx(Spinner, { size: 14 }) : decrypted ? jsxRuntimeExports.jsxs("svg", { width: 14, height: 14, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntimeExports.jsx("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }), jsxRuntimeExports.jsx("path", { d: "M7 11V7a5 5 0 0 1 9.9-1" })] }) : jsxRuntimeExports.jsxs("svg", { width: 14, height: 14, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntimeExports.jsx("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }), jsxRuntimeExports.jsx("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })] }), loading ? "Decrypting…" : decrypted ? "Decrypted" : "Decrypt"] })] });
64075
64150
  }
64076
64151
  const TooltipProvider = Provider$2;
64077
64152
  const Tooltip$1 = Root3$1;
64078
64153
  const TooltipTrigger$1 = Trigger$4;
64079
64154
  const TooltipContent$1 = reactExports.forwardRef(({ className, sideOffset = 8, showArrow = true, children: children2, ...props }, ref) => jsxRuntimeExports.jsx(Portal$6, { children: jsxRuntimeExports.jsxs(Content2$4, { ref, sideOffset, className: cn$4("z-[99999] flex items-center gap-1 rounded-[10px] bg-gray-1000 px-2 py-1.5 !text-label-13 text-background-100 shadow-md select-none", className), ...props, children: [children2, showArrow ? jsxRuntimeExports.jsx(Arrow2$1, { width: 11, height: 5, className: "fill-gray-1000" }) : null] }) }));
64080
64155
  TooltipContent$1.displayName = Content2$4.displayName;
64081
- function DuplicateEventTooltip({ isDuplicate = false, children: children2 }) {
64082
- if (!isDuplicate)
64156
+ function EventNoticeTooltip({ notice, children: children2 }) {
64157
+ if (!notice)
64083
64158
  return children2;
64084
- return jsxRuntimeExports.jsx(TooltipProvider, { delayDuration: 300, children: jsxRuntimeExports.jsxs(Tooltip$1, { children: [jsxRuntimeExports.jsx(TooltipTrigger$1, { asChild: true, children: children2 }), jsxRuntimeExports.jsx(TooltipContent$1, { className: "max-w-[264px] leading-snug", collisionPadding: 8, side: "top", children: DUPLICATE_EVENT_MESSAGE })] }) });
64159
+ return jsxRuntimeExports.jsx(TooltipProvider, { delayDuration: 300, children: jsxRuntimeExports.jsxs(Tooltip$1, { children: [jsxRuntimeExports.jsx(TooltipTrigger$1, { asChild: true, children: children2 }), jsxRuntimeExports.jsx(TooltipContent$1, { className: "max-w-[264px] leading-snug", collisionPadding: 8, side: "top", children: notice })] }) });
64085
64160
  }
64086
64161
  function isStructuredError(value) {
64087
64162
  return value != null && typeof value === "object" && (typeof value.message === "string" || typeof value.stack === "string");
@@ -64106,7 +64181,7 @@ ${stack}` : body2;
64106
64181
  borderBottom: "1px solid var(--ds-red-400)"
64107
64182
  }, children: [jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4 shrink-0" }), jsxRuntimeExports.jsx("p", {
64108
64183
  className: "text-label-12 font-semibold m-0 truncate",
64109
- // The full message or stack is in the body below; the header just
64184
+ // The full message or stack is in the body below; the header
64110
64185
  // shows the first line, single-line, with overflow
64111
64186
  // ellipsised so a long title doesn't push the copy button or
64112
64187
  // wrap into the framed hint/docs lines.
@@ -64231,27 +64306,27 @@ function ZoneDateTimeRow({ date: date2, zone }) {
64231
64306
  });
64232
64307
  return jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-3", children: [jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1.5", children: [jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center h-4 px-1.5 bg-gray-200 rounded-xs", children: jsxRuntimeExports.jsx("span", { className: "text-label-12-mono text-gray-900", children: formattedZone }) }), jsxRuntimeExports.jsx("span", { className: "text-label-13 text-gray-1000", children: formattedDate })] }), jsxRuntimeExports.jsx("span", { className: "tabular-nums text-label-12-mono text-gray-900", children: formattedTime })] });
64233
64308
  }
64234
- function RelativeTimeContextCardContent({ date: date2 }) {
64309
+ function RelativeTimeContextCardContent({ date: date2, prefix }) {
64235
64310
  const localTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
64236
64311
  const timeAgo = useTimeAgo(date2);
64237
- return jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-3 min-w-[300px]", children: [jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-3", children: jsxRuntimeExports.jsx("span", { className: "tabular-nums text-label-13 text-gray-900", children: timeAgo }) }), jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2", children: [jsxRuntimeExports.jsx(ZoneDateTimeRow, { date: date2, zone: "UTC" }), jsxRuntimeExports.jsx(ZoneDateTimeRow, { date: date2, zone: localTimezone })] })] });
64312
+ return jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-3 min-w-[300px]", children: [jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-3", children: jsxRuntimeExports.jsx("span", { className: "tabular-nums text-label-13 text-gray-900", children: prefix ? `${prefix} ${timeAgo}` : timeAgo }) }), jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2", children: [jsxRuntimeExports.jsx(ZoneDateTimeRow, { date: date2, zone: "UTC" }), jsxRuntimeExports.jsx(ZoneDateTimeRow, { date: date2, zone: localTimezone })] })] });
64238
64313
  }
64239
64314
  function DefaultTimeText({ date: date2 }) {
64240
64315
  const shortTimeAgo = useShortTimeAgo(date2);
64241
64316
  return jsxRuntimeExports.jsx("span", { className: "text-label-14 text-gray-900", children: shortTimeAgo });
64242
64317
  }
64243
- function RelativeTimeCard({ date: date2, children: _children, ...props }) {
64318
+ function RelativeTimeCard({ date: date2, children: _children, prefix, ...props }) {
64244
64319
  const children2 = _children === void 0 ? jsxRuntimeExports.jsx(DefaultTimeText, { date: date2 }) : _children;
64245
64320
  if (!date2)
64246
64321
  return children2;
64247
- return jsxRuntimeExports.jsx(ContextCardTrigger, { content: jsxRuntimeExports.jsx(RelativeTimeContextCardContent, { date: date2 }), ...props, children: children2 });
64322
+ return jsxRuntimeExports.jsx(ContextCardTrigger, { content: jsxRuntimeExports.jsx(RelativeTimeContextCardContent, { date: date2, prefix }), ...props, children: children2 });
64248
64323
  }
64249
- function TimestampTooltip({ date: date2, children: children2, side = "top" }) {
64324
+ function TimestampTooltip({ date: date2, children: children2, side = "top", prefix }) {
64250
64325
  const hasProvider = useHasContextCardProvider();
64251
64326
  const ts = date2 == null ? null : typeof date2 === "number" ? date2 : new Date(date2).getTime();
64252
64327
  if (ts == null || Number.isNaN(ts))
64253
64328
  return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: children2 });
64254
- const card = jsxRuntimeExports.jsx(RelativeTimeCard, { date: ts, side, asChild: true, children: children2 });
64329
+ const card = jsxRuntimeExports.jsx(RelativeTimeCard, { date: ts, side, prefix, asChild: true, children: children2 });
64255
64330
  return hasProvider ? card : jsxRuntimeExports.jsx(ContextCardProvider, { children: card });
64256
64331
  }
64257
64332
  const ERROR_EVENT_TYPES = /* @__PURE__ */ new Set([
@@ -64309,6 +64384,9 @@ function getStatusDotColor(eventType) {
64309
64384
  if (eventType === "step_started" || eventType === "run_started" || eventType === "workflow_started" || eventType === "hook_received") {
64310
64385
  return "var(--ds-blue-700)";
64311
64386
  }
64387
+ if (eventType === "noop") {
64388
+ return "var(--ds-gray-500)";
64389
+ }
64312
64390
  return "var(--ds-gray-600)";
64313
64391
  }
64314
64392
  function buildNameMaps(events2, run2) {
@@ -64318,7 +64396,7 @@ function buildNameMaps(events2, run2) {
64318
64396
  for (const event of events2) {
64319
64397
  if (event.eventType === "step_created" && event.correlationId) {
64320
64398
  const stepName = ((_a3 = event.eventData) == null ? void 0 : _a3.stepName) ?? "";
64321
- const parsed = parseStepName(String(stepName));
64399
+ const parsed = parseStepName(String(stepName)) ?? parseWorkflowName(String(stepName));
64322
64400
  correlationNameMap.set(event.correlationId, (parsed == null ? void 0 : parsed.shortName) ?? stepName);
64323
64401
  }
64324
64402
  }
@@ -64377,9 +64455,9 @@ function hasEncryptedValues(data) {
64377
64455
  return false;
64378
64456
  }
64379
64457
  function isRunLevel(eventType) {
64380
- return eventType === "run_created" || eventType === "run_started" || eventType === "run_completed" || eventType === "run_failed" || eventType === "run_cancelled" || eventType === "workflow_started" || eventType === "workflow_completed" || eventType === "workflow_failed" || // attr_set carries a dedup correlationId rather than a child entity ID,
64381
- // so it groups and labels with the run itself.
64382
- eventType === "attr_set";
64458
+ return eventType === "run_created" || eventType === "run_started" || eventType === "run_completed" || eventType === "run_failed" || eventType === "run_cancelled" || eventType === "workflow_started" || eventType === "workflow_completed" || eventType === "workflow_failed" || // attr_set and noop carry a dedup/positional correlationId rather than a
64459
+ // child entity ID, so they group and label with the run itself.
64460
+ eventType === "attr_set" || eventType === "noop";
64383
64461
  }
64384
64462
  const GUTTER_WIDTH = 36;
64385
64463
  const LANE_X = 20;
@@ -64587,6 +64665,8 @@ function EventRow$1({ event, index: index2, isFirst, isLast, isExpanded, onToggl
64587
64665
  }
64588
64666
  }, []);
64589
64667
  const rowGroupKey = isRunLevel(event.eventType) ? "__run__" : event.correlationId ?? void 0;
64668
+ const isSealed = isSealedNoopEvent(event);
64669
+ const rowNotice = isDuplicate ? DUPLICATE_EVENT_MESSAGE : isSealed ? SEALED_EVENT_MESSAGE : void 0;
64590
64670
  const statusDotColor = getStatusDotColor(event.eventType);
64591
64671
  const createdAt = new Date(event.createdAt);
64592
64672
  const occurredAt = parseEventDate(event.occurredAt);
@@ -64694,8 +64774,8 @@ function EventRow$1({ event, index: index2, isFirst, isLast, isExpanded, onToggl
64694
64774
  }, children: jsxRuntimeExports.jsx(ChevronRight, { className: "h-3 w-3 transition-transform", style: {
64695
64775
  color: "var(--ds-gray-900)",
64696
64776
  transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)"
64697
- } }) }), showSeparateEventOccurrenceTimestamps && jsxRuntimeExports.jsx("div", { className: "tabular-nums min-w-0 px-4", style: { color: "var(--ds-gray-900)", flex: "2 1 0%" }, children: occurredAt ? jsxRuntimeExports.jsx(TimestampTooltip, { date: occurredAt, children: jsxRuntimeExports.jsx("span", { children: formatEventTime(occurredAt) }) }) : "-" }), jsxRuntimeExports.jsx("div", { className: "tabular-nums min-w-0 px-4", style: { color: "var(--ds-gray-900)", flex: "2 1 0%" }, children: jsxRuntimeExports.jsx(TimestampTooltip, { date: displayedCreatedAt, children: jsxRuntimeExports.jsx("span", { children: formatEventTime(displayedCreatedAt) }) }) }), jsxRuntimeExports.jsx("div", { className: "font-medium min-w-0 px-4", style: { flex: "2 1 0%" }, children: jsxRuntimeExports.jsx(DuplicateEventTooltip, { isDuplicate, children: jsxRuntimeExports.jsxs("span", { className: "inline-flex items-center gap-1.5", style: {
64698
- color: isDuplicate ? "var(--ds-gray-700)" : "var(--ds-gray-900)"
64777
+ } }) }), showSeparateEventOccurrenceTimestamps && jsxRuntimeExports.jsx("div", { className: "tabular-nums min-w-0 px-4", style: { color: "var(--ds-gray-900)", flex: "2 1 0%" }, children: occurredAt ? jsxRuntimeExports.jsx(TimestampTooltip, { date: occurredAt, children: jsxRuntimeExports.jsx("span", { children: formatEventTime(occurredAt) }) }) : "-" }), jsxRuntimeExports.jsx("div", { className: "tabular-nums min-w-0 px-4", style: { color: "var(--ds-gray-900)", flex: "2 1 0%" }, children: jsxRuntimeExports.jsx(TimestampTooltip, { date: displayedCreatedAt, children: jsxRuntimeExports.jsx("span", { children: formatEventTime(displayedCreatedAt) }) }) }), jsxRuntimeExports.jsx("div", { className: "font-medium min-w-0 px-4", style: { flex: "2 1 0%" }, children: jsxRuntimeExports.jsx(EventNoticeTooltip, { notice: rowNotice, children: jsxRuntimeExports.jsxs("span", { className: "inline-flex items-center gap-1.5", style: {
64778
+ color: rowNotice ? "var(--ds-gray-700)" : "var(--ds-gray-900)"
64699
64779
  }, children: [jsxRuntimeExports.jsxs("span", { style: {
64700
64780
  position: "relative",
64701
64781
  display: "inline-flex",
@@ -64725,7 +64805,7 @@ function EventRow$1({ event, index: index2, isFirst, isLast, isExpanded, onToggl
64725
64805
  color: "var(--ds-red-900)"
64726
64806
  }, children: loadError }) : isLoading || loadedEventData === null && !hasAttemptedLoad && event.correlationId ? jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2 p-3", children: [jsxRuntimeExports.jsx(Skeleton$1, { className: "h-3", style: { width: "75%" } }), jsxRuntimeExports.jsx(Skeleton$1, { className: "h-3", style: { width: "50%" } }), jsxRuntimeExports.jsx(Skeleton$1, { className: "h-3", style: { width: "60%" } })] }) : jsxRuntimeExports.jsx("div", { className: "p-2 text-label-12", style: { color: "var(--ds-gray-900)" }, children: "No data" })] })] })] });
64727
64807
  }
64728
- function EventListViewInner({ events: events2, run: run2, onLoadEventData, hasMoreEvents = false, isLoadingMoreEvents = false, onLoadMoreEvents, encryptionKey, isLoading = false, sortOrder: sortOrderProp, onSortOrderChange, onDecrypt, isDecrypting = false, hasEncryptedData: hasEncryptedDataProp = false, onExactIdSearch, showSeparateEventOccurrenceTimestamps = false }) {
64808
+ function EventListViewInner({ events: events2, run: run2, onLoadEventData, hasMoreEvents = false, isLoadingMoreEvents = false, onLoadMoreEvents, encryptionKey, isLoading = false, sortOrder: sortOrderProp, onSortOrderChange, onDecrypt, isDecrypting = false, isDecryptDisabled = false, decryptDisabledReason, hasEncryptedData: hasEncryptedDataProp = false, onExactIdSearch, showSeparateEventOccurrenceTimestamps = false }) {
64729
64809
  const toast2 = useToast();
64730
64810
  const [internalSortOrder, setInternalSortOrder] = reactExports.useState("asc");
64731
64811
  const effectiveSortOrder = sortOrderProp ?? internalSortOrder;
@@ -64943,7 +65023,12 @@ function EventListViewInner({ events: events2, run: run2, onLoadEventData, hasMo
64943
65023
  if (isInitialLoad) {
64944
65024
  return jsxRuntimeExports.jsxs("div", { className: "h-full flex flex-col overflow-hidden", children: [jsxRuntimeExports.jsx("div", { style: { padding: 6 }, children: jsxRuntimeExports.jsx(Skeleton$1, { style: { height: 40, borderRadius: 6 } }) }), jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-0 h-10 border-b flex-shrink-0", style: { borderColor: "var(--ds-gray-alpha-200)" }, children: [jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", style: { width: GUTTER_WIDTH } }), jsxRuntimeExports.jsx("div", { className: "w-5 flex-shrink-0" }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "2 1 0%" }, children: jsxRuntimeExports.jsx(Skeleton$1, { className: "h-3", style: { width: 40 } }) }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "2 1 0%" }, children: jsxRuntimeExports.jsx(Skeleton$1, { className: "h-3", style: { width: 72 } }) }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "2 1 0%" }, children: jsxRuntimeExports.jsx(Skeleton$1, { className: "h-3", style: { width: 44 } }) }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "3 1 0%" }, children: jsxRuntimeExports.jsx(Skeleton$1, { className: "h-3", style: { width: 92 } }) }), jsxRuntimeExports.jsx("div", { className: "min-w-0 px-4", style: { flex: "3 1 0%" }, children: jsxRuntimeExports.jsx(Skeleton$1, { className: "h-3", style: { width: 60 } }) })] }), jsxRuntimeExports.jsx(RowsSkeleton, {})] });
64945
65025
  }
64946
- return jsxRuntimeExports.jsx(DecryptClickContext.Provider, { value: onDecrypt ? { onDecrypt, isDecrypting } : void 0, children: jsxRuntimeExports.jsxs("div", { className: "h-full flex flex-col overflow-hidden", children: [jsxRuntimeExports.jsx("style", { children: `@keyframes workflow-dot-pulse{0%{transform:scale(1);opacity:.7}70%,100%{transform:scale(2.2);opacity:0}}` }), jsxRuntimeExports.jsxs("div", { style: {
65026
+ return jsxRuntimeExports.jsx(DecryptClickContext.Provider, { value: onDecrypt ? {
65027
+ onDecrypt,
65028
+ isDecrypting,
65029
+ isDecryptDisabled,
65030
+ decryptDisabledReason
65031
+ } : void 0, children: jsxRuntimeExports.jsxs("div", { className: "h-full flex flex-col overflow-hidden", children: [jsxRuntimeExports.jsx("style", { children: `@keyframes workflow-dot-pulse{0%{transform:scale(1);opacity:.7}70%,100%{transform:scale(2.2);opacity:0}}` }), jsxRuntimeExports.jsxs("div", { style: {
64947
65032
  padding: 6,
64948
65033
  backgroundColor: "var(--ds-background-100)",
64949
65034
  display: "flex",
@@ -64978,7 +65063,7 @@ function EventListViewInner({ events: events2, run: run2, onLoadEventData, hasMo
64978
65063
  width: "100%",
64979
65064
  opacity: onExactIdSearch ? 1 : 0.5,
64980
65065
  cursor: onExactIdSearch ? "text" : "not-allowed"
64981
- } })] }), jsxRuntimeExports.jsx(MenuDropdown, { options: SORT_OPTIONS, value: effectiveSortOrder, onChange: handleSortOrderChange }), (hasEncryptedData || encryptionKey) && onDecrypt && jsxRuntimeExports.jsx(DecryptButton, { decrypted: !!encryptionKey, loading: isDecrypting, onClick: onDecrypt })] }), jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-0 text-label-13 font-medium h-10 border-b flex-shrink-0", style: {
65066
+ } })] }), jsxRuntimeExports.jsx(MenuDropdown, { options: SORT_OPTIONS, value: effectiveSortOrder, onChange: handleSortOrderChange }), (hasEncryptedData || encryptionKey) && onDecrypt && jsxRuntimeExports.jsx(DecryptButton, { decrypted: !!encryptionKey, loading: isDecrypting, disabled: isDecryptDisabled, disabledReason: decryptDisabledReason, onClick: onDecrypt })] }), jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-0 text-label-13 font-medium h-10 border-b flex-shrink-0", style: {
64982
65067
  borderColor: "var(--ds-gray-alpha-200)",
64983
65068
  color: "var(--ds-gray-900)",
64984
65069
  backgroundColor: "var(--ds-background-100)"
@@ -91755,7 +91840,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
91755
91840
  var et = ({ className: e, language: t, style: o, isIncomplete: n, ...s2 }) => jsxRuntimeExports.jsx("div", { className: f("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2", e), "data-incomplete": n || void 0, "data-language": t, "data-streamdown": "code-block", style: { contentVisibility: "auto", containIntrinsicSize: "auto 200px", ...o }, ...s2 });
91756
91841
  var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
91757
91842
  var ot = ({ language: e }) => jsxRuntimeExports.jsx("div", { className: "flex h-8 items-center text-muted-foreground text-xs", "data-language": e, "data-streamdown": "code-block-header", children: jsxRuntimeExports.jsx("span", { className: "ml-1 font-mono lowercase", children: e }) });
91758
- var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL-B1Smd86a.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
91843
+ var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL-imLU-Cvz.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
91759
91844
  let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
91760
91845
  `).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
91761
91846
  return jsxRuntimeExports.jsx(Se.Provider, { value: { code: e }, children: jsxRuntimeExports.jsxs(et, { isIncomplete: s2, language: t, children: [jsxRuntimeExports.jsx(ot, { language: t }), n ? jsxRuntimeExports.jsx("div", { className: "pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end", children: jsxRuntimeExports.jsx("div", { className: "pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur", "data-streamdown": "code-block-actions", children: n }) }) : null, jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: jsxRuntimeExports.jsx(Qe, { className: o, language: t, result: c, ...r2 }), children: jsxRuntimeExports.jsx(dn, { className: o, code: i, language: t, raw: c, ...r2 }) })] }) });
@@ -92077,7 +92162,7 @@ var Dt = ({ children: e, className: t, onDownload: o, onError: n }) => {
92077
92162
  }, []), jsxRuntimeExports.jsxs("div", { className: "relative", ref: i, children: [jsxRuntimeExports.jsx("button", { className: f("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50", t), disabled: c, onClick: () => r2(!s2), title: "Download table", type: "button", children: e != null ? e : jsxRuntimeExports.jsx(Z, { size: 14 }) }), s2 ? jsxRuntimeExports.jsxs("div", { className: "absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg", children: [jsxRuntimeExports.jsx("button", { className: "w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40", onClick: () => a2("csv"), title: "Download table as CSV", type: "button", children: "CSV" }), jsxRuntimeExports.jsx("button", { className: "w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40", onClick: () => a2("markdown"), title: "Download table as Markdown", type: "button", children: "Markdown" })] }) : null] });
92078
92163
  };
92079
92164
  var Vt = ({ children: e, className: t, showControls: o, ...n }) => jsxRuntimeExports.jsxs("div", { className: "my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2", "data-streamdown": "table-wrapper", children: [o ? jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-end gap-1", children: [jsxRuntimeExports.jsx(Ht, {}), jsxRuntimeExports.jsx(Dt, {})] }) : null, jsxRuntimeExports.jsx("div", { className: "border-collapse overflow-x-auto overscroll-y-auto rounded-md border border-border bg-background", children: jsxRuntimeExports.jsx("table", { className: f("w-full divide-y divide-border", t), "data-streamdown": "table", ...n, children: e }) })] });
92080
- var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-CwYR558N.js").then((e) => ({ default: e.Mermaid }))), Kn = /language-([^\s]+)/;
92165
+ var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-CgaDjNgb.js").then((e) => ({ default: e.Mermaid }))), Kn = /language-([^\s]+)/;
92081
92166
  function ke(e, t) {
92082
92167
  if (!(e != null && e.position || t != null && t.position)) return true;
92083
92168
  if (!(e != null && e.position && (t != null && t.position))) return false;
@@ -92835,7 +92920,7 @@ function stepToSpan(stepEvents, maxEndTime) {
92835
92920
  if (!step) {
92836
92921
  return null;
92837
92922
  }
92838
- const parsedName = parseStepName(String(step.stepName));
92923
+ const parsedName = parseStepName(String(step.stepName)) ?? parseWorkflowName(String(step.stepName));
92839
92924
  const attributes = {
92840
92925
  resource: "step",
92841
92926
  data: step
@@ -93048,7 +93133,7 @@ function buildTrace(run2, events2, now2, { isCompleteHistory = false } = {}) {
93048
93133
  const duplicateEventIds = findDuplicateEventIds(events2, {
93049
93134
  isCompleteHistory
93050
93135
  });
93051
- const actedOnEvents = duplicateEventIds.size === 0 ? events2 : events2.filter((event) => !duplicateEventIds.has(event.eventId));
93136
+ const actedOnEvents = events2.filter((event) => !duplicateEventIds.has(event.eventId) && !isSealedNoopEvent(event));
93052
93137
  const groupedEvents = groupEventsByCorrelation(actedOnEvents);
93053
93138
  const latestKnownTime = computeLatestKnownTime(actedOnEvents, run2);
93054
93139
  const { runSpan, spans } = buildSpans(run2, groupedEvents, now2, latestKnownTime);
@@ -95025,7 +95110,7 @@ const attributeToDisplayFn = {
95025
95110
  receivedCount: (value) => String(value),
95026
95111
  lastReceivedAt: localMillisecondTimeOrNull,
95027
95112
  disposedAt: localMillisecondTimeOrNull,
95028
- // Internal resume plumbing not surfaced in the UI
95113
+ // Internal resume plumbing, not surfaced in the UI
95029
95114
  resumeContext: (_value) => null,
95030
95115
  resumeId: (_value) => null,
95031
95116
  resumeCapabilities: (_value) => null,
@@ -95043,7 +95128,7 @@ const attributeToDisplayFn = {
95043
95128
  projectId: (_value) => null,
95044
95129
  environment: (_value) => null,
95045
95130
  executionContext: (_value) => null,
95046
- // Attributes string-string metadata attached to the run.
95131
+ // Attributes: string-string metadata attached to the run.
95047
95132
  // Rendered as key-value rows in its own collapsible section;
95048
95133
  // if empty/missing, hidden by the hasDisplayContent gate.
95049
95134
  attributes: (value) => {
@@ -95051,7 +95136,7 @@ const attributeToDisplayFn = {
95051
95136
  return null;
95052
95137
  return jsxRuntimeExports.jsx(RunAttributesCard, { attributes: value });
95053
95138
  },
95054
- // Dates wrapped with TimestampTooltip showing UTC/local + relative time
95139
+ // Dates: wrapped with TimestampTooltip showing UTC/local + relative time
95055
95140
  occurredAt: timestampWithTooltipOrNull,
95056
95141
  createdAt: timestampWithTooltipOrNull,
95057
95142
  startedAt: timestampWithTooltipOrNull,
@@ -95139,7 +95224,7 @@ const attributeToDisplayFn = {
95139
95224
  },
95140
95225
  // Internal encryption plumbing: the run's X25519 public key, used by
95141
95226
  // cross-run writers to seal payloads to this run. Not actionable for users
95142
- // and not secret hidden rather than rendered as 44 opaque base64 chars.
95227
+ // and not secret, so hidden rather than rendered as 44 opaque base64 chars.
95143
95228
  encryptionPublicKey: (_value) => null
95144
95229
  };
95145
95230
  const resolvableAttributes = [
@@ -95211,7 +95296,7 @@ const AttributeBlock = ({ attribute, value, isLoading, inline = false, context }
95211
95296
  }
95212
95297
  return jsxRuntimeExports.jsxs("div", { className: "relative", children: [typeof isLoading === "boolean" && isLoading && jsxRuntimeExports.jsx("div", { className: "absolute top-9 right-4", children: jsxRuntimeExports.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2", style: { borderColor: "var(--ds-gray-900)" } }) }), jsxRuntimeExports.jsxs("div", { className: "my-2 flex flex-col gap-0", children: [jsxRuntimeExports.jsx("span", { className: "text-label-14 text-gray-1000 font-medium first-letter:uppercase", children: attribute }), jsxRuntimeExports.jsx("span", { className: "text-label-12", style: { color: "var(--ds-gray-1000)" }, children: displayValue })] }, attribute)] });
95213
95298
  };
95214
- const AttributePanel = ({ data, moduleSpecifier, moduleSourceUrl, isLoading, error: error2, expiredAt, onStreamClick, onRunClick, onDecrypt, isDecrypting = false, resource }) => {
95299
+ const AttributePanel = ({ data, moduleSpecifier, moduleSourceUrl, isLoading, error: error2, expiredAt, onStreamClick, onRunClick, onDecrypt, isDecrypting = false, isDecryptDisabled = false, decryptDisabledReason, resource }) => {
95215
95300
  const displayData = reactExports.useMemo(() => {
95216
95301
  const result = { ...data };
95217
95302
  const execCtx = data.executionContext;
@@ -95277,6 +95362,8 @@ const AttributePanel = ({ data, moduleSpecifier, moduleSourceUrl, isLoading, err
95277
95362
  const decryptValue = onDecrypt ? {
95278
95363
  onDecrypt,
95279
95364
  isDecrypting,
95365
+ isDecryptDisabled,
95366
+ decryptDisabledReason,
95280
95367
  hasEncryptedData: outerDecryptCtx == null ? void 0 : outerDecryptCtx.hasEncryptedData
95281
95368
  } : outerDecryptCtx;
95282
95369
  return jsxRuntimeExports.jsx(ContextCardProvider, { children: jsxRuntimeExports.jsx(RunClickContext.Provider, { value: onRunClick, children: jsxRuntimeExports.jsx(StreamClickContext.Provider, { value: onStreamClick, children: jsxRuntimeExports.jsxs(DecryptClickContext.Provider, { value: decryptValue, children: [visibleBasicAttributes.length > 0 && jsxRuntimeExports.jsxs(CollapsibleRoot, { defaultOpen: true, children: [jsxRuntimeExports.jsx(CollapsibleTrigger, { children: "Metadata" }), jsxRuntimeExports.jsx(CollapsibleContent, { className: "mt-0 mb-2", children: jsxRuntimeExports.jsxs("div", { className: "flex flex-col", children: [orderedBasicAttributes.map((attribute) => {
@@ -95343,6 +95430,7 @@ function EventItem({ event, onLoadEventData, encryptionKey, showSeparateEventOcc
95343
95430
  setLoadedData(null);
95344
95431
  void loadEventData(true);
95345
95432
  }, [encryptionKey, loadEventData]);
95433
+ const rowNotice = isDuplicate ? DUPLICATE_EVENT_MESSAGE : isSealedNoopEvent(event) ? SEALED_EVENT_MESSAGE : void 0;
95346
95434
  const createdAt = new Date(event.createdAt);
95347
95435
  const occurredAt = parseDateValue(event.occurredAt);
95348
95436
  const displayedCreatedAt = showSeparateEventOccurrenceTimestamps ? createdAt : getEffectiveEventDate(event);
@@ -95355,7 +95443,7 @@ function EventItem({ event, onLoadEventData, encryptionKey, showSeparateEventOcc
95355
95443
  return jsxRuntimeExports.jsxs(CollapsibleRoot, { variant: "card", onOpenChange: canHaveData ? (open2) => {
95356
95444
  if (open2)
95357
95445
  handleExpand();
95358
- } : void 0, children: [jsxRuntimeExports.jsx(CollapsibleTrigger, { className: "px-3 py-2", children: jsxRuntimeExports.jsxs("div", { className: "flex w-full items-center justify-between gap-3", children: [jsxRuntimeExports.jsx(DuplicateEventTooltip, { isDuplicate, children: jsxRuntimeExports.jsx("span", { className: `text-label-12 font-mono ${isDuplicate ? "text-gray-700" : "text-gray-1000"}`, children: event.eventType }) }), jsxRuntimeExports.jsx("span", { className: "shrink-0 text-label-13 text-gray-900", children: displayedCreatedAtTime })] }) }), jsxRuntimeExports.jsxs(CollapsibleContent, { children: [jsxRuntimeExports.jsxs("div", { className: "flex flex-col bg-background-200 [&:has(+_*)]:border-b [&:has(+_*)]:border-gray-alpha-400", children: [showSeparateEventOccurrenceTimestamps && occurredAt && jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2 py-2 px-3", children: [jsxRuntimeExports.jsx("span", { className: "text-label-12 text-gray-900", children: "Occurred" }), jsxRuntimeExports.jsx(TimestampTooltip, { date: occurredAt, children: jsxRuntimeExports.jsx("span", { className: "max-w-[70%] truncate text-right text-label-12 font-mono", children: formatEventTimestamp(occurredAt) }) })] }), jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2 py-2 px-3", children: [jsxRuntimeExports.jsx("span", { className: "text-label-12 text-gray-900", children: "Event ID" }), jsxRuntimeExports.jsx("span", { className: "max-w-[70%] truncate text-right text-label-12 font-mono", children: event.eventId })] }), event.correlationId && jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2 py-2 px-3", children: [jsxRuntimeExports.jsx("span", { className: "text-label-12 text-gray-900", children: "Correlation ID" }), jsxRuntimeExports.jsx("span", { className: "max-w-[70%] truncate text-right text-label-12 font-mono", children: event.correlationId })] })] }), isLoading && jsxRuntimeExports.jsxs("div", { className: "p-3", children: [jsxRuntimeExports.jsx(Skeleton$1, { className: "h-4 w-[35%]" }), jsxRuntimeExports.jsx(Skeleton$1, { className: "mt-2 h-4 w-[90%]" }), jsxRuntimeExports.jsx(Skeleton$1, { className: "mt-2 h-4 w-[75%]" })] }), loadError && jsxRuntimeExports.jsx(ErrorCard, { title: "Failed to load event data", details: loadError, className: "mt-2" }), displayPayload != null && jsxRuntimeExports.jsx("div", { className: "[&>div]:border-none [&>div]:rounded-none", children: jsxRuntimeExports.jsx(EventDataBlock, { eventType: event.eventType, data: displayPayload }) })] })] });
95446
+ } : void 0, children: [jsxRuntimeExports.jsx(CollapsibleTrigger, { className: "px-3 py-2", children: jsxRuntimeExports.jsxs("div", { className: "flex w-full items-center justify-between gap-3", children: [jsxRuntimeExports.jsx(EventNoticeTooltip, { notice: rowNotice, children: jsxRuntimeExports.jsx("span", { className: `text-label-12 font-mono ${rowNotice ? "text-gray-700" : "text-gray-1000"}`, children: event.eventType }) }), jsxRuntimeExports.jsx("span", { className: "shrink-0 text-label-13 text-gray-900", children: displayedCreatedAtTime })] }) }), jsxRuntimeExports.jsxs(CollapsibleContent, { children: [jsxRuntimeExports.jsxs("div", { className: "flex flex-col bg-background-200 [&:has(+_*)]:border-b [&:has(+_*)]:border-gray-alpha-400", children: [showSeparateEventOccurrenceTimestamps && occurredAt && jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2 py-2 px-3", children: [jsxRuntimeExports.jsx("span", { className: "text-label-12 text-gray-900", children: "Occurred" }), jsxRuntimeExports.jsx(TimestampTooltip, { date: occurredAt, children: jsxRuntimeExports.jsx("span", { className: "max-w-[70%] truncate text-right text-label-12 font-mono", children: formatEventTimestamp(occurredAt) }) })] }), jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2 py-2 px-3", children: [jsxRuntimeExports.jsx("span", { className: "text-label-12 text-gray-900", children: "Event ID" }), jsxRuntimeExports.jsx("span", { className: "max-w-[70%] truncate text-right text-label-12 font-mono", children: event.eventId })] }), event.correlationId && jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2 py-2 px-3", children: [jsxRuntimeExports.jsx("span", { className: "text-label-12 text-gray-900", children: "Correlation ID" }), jsxRuntimeExports.jsx("span", { className: "max-w-[70%] truncate text-right text-label-12 font-mono", children: event.correlationId })] })] }), isLoading && jsxRuntimeExports.jsxs("div", { className: "p-3", children: [jsxRuntimeExports.jsx(Skeleton$1, { className: "h-4 w-[35%]" }), jsxRuntimeExports.jsx(Skeleton$1, { className: "mt-2 h-4 w-[90%]" }), jsxRuntimeExports.jsx(Skeleton$1, { className: "mt-2 h-4 w-[75%]" })] }), loadError && jsxRuntimeExports.jsx(ErrorCard, { title: "Failed to load event data", details: loadError, className: "mt-2" }), displayPayload != null && jsxRuntimeExports.jsx("div", { className: "[&>div]:border-none [&>div]:rounded-none", children: jsxRuntimeExports.jsx(EventDataBlock, { eventType: event.eventType, data: displayPayload }) })] })] });
95359
95447
  }
95360
95448
  function hasOnlyExpiredFields(data, eventType) {
95361
95449
  if (data === null || typeof data !== "object" || Array.isArray(data)) {
@@ -95550,7 +95638,7 @@ function useSelectedSpanDetail(selectedSpan, fetchSpanDetail) {
95550
95638
  function isHook(data) {
95551
95639
  return data !== null && typeof data === "object" && "hookId" in data;
95552
95640
  }
95553
- function EntityDetailPanel({ run: run2, onStreamClick, onRunClick, fetchSpanDetail, onWakeUpSleep, onLoadEventData, onResolveHook, encryptionKey, onDecrypt, isDecrypting = false, selectedSpan, showSeparateEventOccurrenceTimestamps = false, getModuleSourceUrl }) {
95641
+ function EntityDetailPanel({ run: run2, onStreamClick, onRunClick, fetchSpanDetail, onWakeUpSleep, onLoadEventData, onResolveHook, encryptionKey, onDecrypt, isDecrypting = false, isDecryptDisabled = false, decryptDisabledReason, selectedSpan, showSeparateEventOccurrenceTimestamps = false, getModuleSourceUrl }) {
95554
95642
  const toast2 = useToast();
95555
95643
  const [stoppingSleep, setStoppingSleep] = reactExports.useState(false);
95556
95644
  const [showResolveHookModal, setShowResolveHookModal] = reactExports.useState(false);
@@ -95708,7 +95796,13 @@ function EntityDetailPanel({ run: run2, onStreamClick, onRunClick, fetchSpanDeta
95708
95796
  return null;
95709
95797
  }
95710
95798
  const hasPendingActions = resource === "sleep" && canWakeUp || resource === "hook" && canResolveHook;
95711
- return jsxRuntimeExports.jsxs("div", { className: "flex h-full flex-col", children: [jsxRuntimeExports.jsx(DecryptClickContext.Provider, { value: onDecrypt ? { onDecrypt, isDecrypting, hasEncryptedData } : void 0, children: jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-y-auto px-4 pb-8", children: [hasPendingActions && jsxRuntimeExports.jsxs("div", { className: "mb-4 rounded-lg border p-2", style: {
95799
+ return jsxRuntimeExports.jsxs("div", { className: "flex h-full flex-col", children: [jsxRuntimeExports.jsx(DecryptClickContext.Provider, { value: onDecrypt ? {
95800
+ onDecrypt,
95801
+ isDecrypting,
95802
+ isDecryptDisabled,
95803
+ decryptDisabledReason,
95804
+ hasEncryptedData
95805
+ } : void 0, children: jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-y-auto px-4 pb-8", children: [hasPendingActions && jsxRuntimeExports.jsxs("div", { className: "mb-4 rounded-lg border p-2", style: {
95712
95806
  borderColor: "var(--ds-gray-300)",
95713
95807
  backgroundColor: "var(--ds-gray-100)"
95714
95808
  }, children: [jsxRuntimeExports.jsx("p", { className: "mb-2 px-1 text-label-13 font-medium uppercase tracking-wide", style: { color: "var(--ds-gray-700)" }, children: "Actions" }), jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2", children: [resource === "sleep" && canWakeUp && jsxRuntimeExports.jsxs("button", { type: "button", onClick: handleWakeUp, disabled: stoppingSleep, className: clsx("flex items-center justify-center gap-2 rounded-md px-3 py-2 text-button-14", "disabled:opacity-50 disabled:cursor-not-allowed transition-colors", stoppingSleep ? "opacity-50 cursor-not-allowed" : "cursor-pointer"), style: {
@@ -95717,7 +95811,7 @@ function EntityDetailPanel({ run: run2, onStreamClick, onRunClick, fetchSpanDeta
95717
95811
  }, children: [jsxRuntimeExports.jsx(Zap, { className: "h-4 w-4" }), stoppingSleep ? "Waking up..." : "Wake Up Sleep"] }), resource === "hook" && canResolveHook && jsxRuntimeExports.jsxs("button", { type: "button", onClick: () => setShowResolveHookModal(true), disabled: resolvingHook, className: clsx("flex items-center justify-center gap-2 rounded-md px-3 py-2 text-button-14", "disabled:opacity-50 disabled:cursor-not-allowed transition-colors", resolvingHook ? "opacity-50 cursor-not-allowed" : "cursor-pointer"), style: {
95718
95812
  background: "var(--ds-gray-1000)",
95719
95813
  color: "var(--ds-background-100)"
95720
- }, children: [jsxRuntimeExports.jsx(Send, { className: "h-4 w-4" }), "Resolve Hook"] })] })] }), jsxRuntimeExports.jsx(AttributePanel, { data: displayData, moduleSpecifier, moduleSourceUrl, expiredAt: run2.expiredAt, isLoading: loading, error: error2 ?? void 0, onStreamClick, onRunClick, onDecrypt, isDecrypting, resource }), rawEvents && jsxRuntimeExports.jsx(EventsList, { events: rawEvents, onLoadEventData, onStreamClick, onRunClick, encryptionKey, showSeparateEventOccurrenceTimestamps, duplicateEventIds: selectedSpan == null ? void 0 : selectedSpan.duplicateEventIds })] }) }), jsxRuntimeExports.jsx(ResolveHookModal, { isOpen: showResolveHookModal, onClose: () => setShowResolveHookModal(false), onSubmit: handleResolveHook, isSubmitting: resolvingHook })] });
95814
+ }, children: [jsxRuntimeExports.jsx(Send, { className: "h-4 w-4" }), "Resolve Hook"] })] })] }), jsxRuntimeExports.jsx(AttributePanel, { data: displayData, moduleSpecifier, moduleSourceUrl, expiredAt: run2.expiredAt, isLoading: loading, error: error2 ?? void 0, onStreamClick, onRunClick, onDecrypt, isDecrypting, isDecryptDisabled, decryptDisabledReason, resource }), rawEvents && jsxRuntimeExports.jsx(EventsList, { events: rawEvents, onLoadEventData, onStreamClick, onRunClick, encryptionKey, showSeparateEventOccurrenceTimestamps, duplicateEventIds: selectedSpan == null ? void 0 : selectedSpan.duplicateEventIds })] }) }), jsxRuntimeExports.jsx(ResolveHookModal, { isOpen: showResolveHookModal, onClose: () => setShowResolveHookModal(false), onSubmit: handleResolveHook, isSubmitting: resolvingHook })] });
95721
95815
  }
95722
95816
  const ActiveSpanContext = reactExports.createContext(null);
95723
95817
  ActiveSpanContext.displayName = "ActiveSpanContext";
@@ -96013,7 +96107,7 @@ function TraceDetailPanel({ containerRef, onNavigateToSpan, onClose }) {
96013
96107
  }, [selectedSpan == null ? void 0 : selectedSpan.data, selectedSpan == null ? void 0 : selectedSpan.resource]);
96014
96108
  if (!activeSpan)
96015
96109
  return null;
96016
- return jsxRuntimeExports.jsxs("aside", { ref: asideRef, id: DETAIL_PANEL_ID, className: "relative flex flex-col h-full max-h-full shrink-0 bg-background-100 border-l border-gray-alpha-400", style: { width: panelWidth }, children: [jsxRuntimeExports.jsx(DraggableBorder, { element: asideRef, position: "left", onWidthChange: handleResize, onReset: () => handleResize(PANEL_DEFAULT_WIDTH), "aria-label": "Resize span details panel", "aria-controls": DETAIL_PANEL_ID, "aria-valuemin": PANEL_MIN_WIDTH, "aria-valuemax": panelMaxWidth, "aria-valuenow": Math.min(Math.max(Math.round(panelWidth), PANEL_MIN_WIDTH), panelMaxWidth) }), jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2 shrink-0 px-4 py-[7.5px]", children: [jsxRuntimeExports.jsx("span", { className: "text-label-14 font-medium text-gray-1000 truncate block", children: selectedSpanName }), jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-0.5 shrink-0", children: [jsxRuntimeExports.jsxs(Tooltip$1, { children: [jsxRuntimeExports.jsx(TooltipTrigger$1, { asChild: true, children: jsxRuntimeExports.jsx(IconButton, { "aria-label": "Navigate up", "aria-keyshortcuts": "K", onClick: handleSelectPrev, disabled: !prevSpanId, children: jsxRuntimeExports.jsx(ChevronUp, { className: "w-4 h-4" }) }) }), prevSpanId ? jsxRuntimeExports.jsxs(TooltipContent$1, { children: ["Navigate up", jsxRuntimeExports.jsx(Kbd, { children: "K" })] }) : null] }), jsxRuntimeExports.jsxs(Tooltip$1, { children: [jsxRuntimeExports.jsx(TooltipTrigger$1, { asChild: true, children: jsxRuntimeExports.jsx(IconButton, { "aria-label": "Navigate down", "aria-keyshortcuts": "J", onClick: handleSelectNext, disabled: !nextSpanId, children: jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4" }) }) }), nextSpanId ? jsxRuntimeExports.jsxs(TooltipContent$1, { children: ["Navigate down", jsxRuntimeExports.jsx(Kbd, { children: "J" })] }) : null] }), jsxRuntimeExports.jsx("div", { "aria-hidden": true, className: "w-px h-4 bg-gray-alpha-400 mx-1" }), jsxRuntimeExports.jsx(IconButton, { "aria-label": "Close span details", "aria-keyshortcuts": "Escape", onClick: onClose, children: jsxRuntimeExports.jsx(X$3, { className: "w-4 h-4" }) })] })] }), jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-y-auto", children: jsxRuntimeExports.jsx(ErrorBoundary$1, { children: jsxRuntimeExports.jsx(EntityDetailPanel, { run: sidebar.run, onStreamClick: sidebar.onStreamClick, onRunClick: sidebar.onRunClick, fetchSpanDetail: sidebar.fetchSpanDetail, onWakeUpSleep: sidebar.onWakeUpSleep, onLoadEventData: sidebar.onLoadEventData, onResolveHook: sidebar.onResolveHook, encryptionKey: sidebar.encryptionKey, onDecrypt: sidebar.onDecrypt, isDecrypting: sidebar.isDecrypting, selectedSpan, showSeparateEventOccurrenceTimestamps: sidebar.showSeparateEventOccurrenceTimestamps, getModuleSourceUrl: sidebar.getModuleSourceUrl }) }) })] });
96110
+ return jsxRuntimeExports.jsxs("aside", { ref: asideRef, id: DETAIL_PANEL_ID, className: "relative flex flex-col h-full max-h-full shrink-0 bg-background-100 border-l border-gray-alpha-400", style: { width: panelWidth }, children: [jsxRuntimeExports.jsx(DraggableBorder, { element: asideRef, position: "left", onWidthChange: handleResize, onReset: () => handleResize(PANEL_DEFAULT_WIDTH), "aria-label": "Resize span details panel", "aria-controls": DETAIL_PANEL_ID, "aria-valuemin": PANEL_MIN_WIDTH, "aria-valuemax": panelMaxWidth, "aria-valuenow": Math.min(Math.max(Math.round(panelWidth), PANEL_MIN_WIDTH), panelMaxWidth) }), jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2 shrink-0 px-4 py-[7.5px]", children: [jsxRuntimeExports.jsx("span", { className: "text-label-14 font-medium text-gray-1000 truncate block", children: selectedSpanName }), jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-0.5 shrink-0", children: [jsxRuntimeExports.jsxs(Tooltip$1, { children: [jsxRuntimeExports.jsx(TooltipTrigger$1, { asChild: true, children: jsxRuntimeExports.jsx(IconButton, { "aria-label": "Navigate up", "aria-keyshortcuts": "K", onClick: handleSelectPrev, disabled: !prevSpanId, children: jsxRuntimeExports.jsx(ChevronUp, { className: "w-4 h-4" }) }) }), prevSpanId ? jsxRuntimeExports.jsxs(TooltipContent$1, { children: ["Navigate up", jsxRuntimeExports.jsx(Kbd, { children: "K" })] }) : null] }), jsxRuntimeExports.jsxs(Tooltip$1, { children: [jsxRuntimeExports.jsx(TooltipTrigger$1, { asChild: true, children: jsxRuntimeExports.jsx(IconButton, { "aria-label": "Navigate down", "aria-keyshortcuts": "J", onClick: handleSelectNext, disabled: !nextSpanId, children: jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4" }) }) }), nextSpanId ? jsxRuntimeExports.jsxs(TooltipContent$1, { children: ["Navigate down", jsxRuntimeExports.jsx(Kbd, { children: "J" })] }) : null] }), jsxRuntimeExports.jsx("div", { "aria-hidden": true, className: "w-px h-4 bg-gray-alpha-400 mx-1" }), jsxRuntimeExports.jsx(IconButton, { "aria-label": "Close span details", "aria-keyshortcuts": "Escape", onClick: onClose, children: jsxRuntimeExports.jsx(X$3, { className: "w-4 h-4" }) })] })] }), jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-y-auto", children: jsxRuntimeExports.jsx(ErrorBoundary$1, { children: jsxRuntimeExports.jsx(EntityDetailPanel, { run: sidebar.run, onStreamClick: sidebar.onStreamClick, onRunClick: sidebar.onRunClick, fetchSpanDetail: sidebar.fetchSpanDetail, onWakeUpSleep: sidebar.onWakeUpSleep, onLoadEventData: sidebar.onLoadEventData, onResolveHook: sidebar.onResolveHook, encryptionKey: sidebar.encryptionKey, onDecrypt: sidebar.onDecrypt, isDecrypting: sidebar.isDecrypting, isDecryptDisabled: sidebar.isDecryptDisabled, decryptDisabledReason: sidebar.decryptDisabledReason, selectedSpan, showSeparateEventOccurrenceTimestamps: sidebar.showSeparateEventOccurrenceTimestamps, getModuleSourceUrl: sidebar.getModuleSourceUrl }) }) })] });
96017
96111
  }
96018
96112
  const WorkflowIcon = () => {
96019
96113
  return jsxRuntimeExports.jsx("svg", { "aria-hidden": "true", "data-testid": "geist-icon", height: "16", strokeLinejoin: "round", viewBox: "0 0 16 16", width: "16", children: jsxRuntimeExports.jsx("path", { d: "M5.75 7L6.4209 7.33594L4.85254 10.4717C5.38789 10.771 5.75 11.3431 5.75 12V14C5.75 14.9665 4.96648 15.75 4 15.75H2C1.03352 15.75 0.25 14.9665 0.25 14V12C0.25 11.0335 1.03352 10.25 2 10.25H3.28711L5.0791 6.66504L5.75 7ZM14 10.25C14.9665 10.25 15.75 11.0335 15.75 12V14C15.75 14.9665 14.9665 15.75 14 15.75H12C11.1185 15.75 10.3909 15.098 10.2695 14.25H7V12.75H10.25V12C10.25 11.0335 11.0335 10.25 12 10.25H14ZM2 11.75C1.86192 11.75 1.75 11.8619 1.75 12V14C1.75 14.1381 1.86192 14.25 2 14.25H4C4.13808 14.25 4.25 14.1381 4.25 14V12C4.25 11.8619 4.13808 11.75 4 11.75H2ZM12 11.75C11.8619 11.75 11.75 11.8619 11.75 12V14C11.75 14.1381 11.8619 14.25 12 14.25H14C14.1381 14.25 14.25 14.1381 14.25 14V12C14.25 11.8619 14.1381 11.75 14 11.75H12ZM9 0.25C9.96649 0.25 10.75 1.03351 10.75 2V4C10.75 4.44642 10.5808 4.85197 10.3057 5.16113L12.2041 8.6416L10.8877 9.36035L8.91895 5.75H7C6.03351 5.75 5.25 4.96649 5.25 4V2C5.25 1.03351 6.03351 0.25 7 0.25H9ZM7 1.75C6.86193 1.75 6.75 1.86193 6.75 2V4C6.75 4.13807 6.86193 4.25 7 4.25H9C9.13807 4.25 9.25 4.13807 9.25 4V2C9.25 1.86193 9.13807 1.75 9 1.75H7Z", fill: "currentColor" }) });
@@ -96312,7 +96406,7 @@ const RESOURCE_CLASS_NAMES = {
96312
96406
  className: "border-green-500 bg-green-200",
96313
96407
  errorClassName: "border-red-500 bg-red-200"
96314
96408
  },
96315
- // Passive spans (hooks) stay gray matches event-list icons and the minimap.
96409
+ // Passive spans (hooks) stay gray; matches event-list icons and the minimap.
96316
96410
  hook: {
96317
96411
  className: "border-gray-500 bg-gray-200",
96318
96412
  errorClassName: "border-red-500 bg-red-200"
@@ -96510,7 +96604,8 @@ function computeSpanSegments(span) {
96510
96604
  const MARKER_EVENT_NAMES = ["hook_received", "attr_set"];
96511
96605
  function computeSpanMarkers(span) {
96512
96606
  return sortedEventMarks(span.events, MARKER_EVENT_NAMES).map((mark2) => ({
96513
- timeMs: mark2.time
96607
+ timeMs: mark2.time,
96608
+ kind: mark2.type
96514
96609
  }));
96515
96610
  }
96516
96611
  function computeOffscreenMarkers(markers, visibleStartMs, visibleEndMs) {
@@ -96640,6 +96735,10 @@ const EventList = ({ spans, activeSpanId, searchResult, onSelectSpan }) => {
96640
96735
  paddingBottom: (spans.length - end) * ROW_HEIGHT_PX
96641
96736
  }, children: spans.slice(start2, end).map((span) => jsxRuntimeExports.jsx(EventRow, { span, isSelected: span.spanId === activeSpanId, isDimmed: isSpanDimmedBySearch(span.spanId, searchResult), onSelectSpan }, span.spanId)) });
96642
96737
  };
96738
+ const MARKER_KIND_PREFIX = {
96739
+ hook_received: "Hook received",
96740
+ attr_set: "Attribute set"
96741
+ };
96643
96742
  function projectMarkers(markers, visibleStartMs, visibleEndMs) {
96644
96743
  const visibleDurationMs = visibleEndMs - visibleStartMs;
96645
96744
  if (visibleDurationMs <= 0)
@@ -96651,7 +96750,8 @@ function projectMarkers(markers, visibleStartMs, visibleEndMs) {
96651
96750
  return [
96652
96751
  {
96653
96752
  leftPct: (m2.timeMs - visibleStartMs) / visibleDurationMs * 100,
96654
- timeMs: m2.timeMs
96753
+ timeMs: m2.timeMs,
96754
+ kind: m2.kind
96655
96755
  }
96656
96756
  ];
96657
96757
  });
@@ -96673,7 +96773,7 @@ function MarkerTick({ className }) {
96673
96773
  return jsxRuntimeExports.jsx("span", { className: cn$4("block w-[3px] rounded-full bg-gray-1000", className) });
96674
96774
  }
96675
96775
  function MarkerLayer({ markers }) {
96676
- return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: markers.map((m2) => jsxRuntimeExports.jsx("span", { className: "pointer-events-auto absolute top-0 bottom-0 z-10 flex w-8 -translate-x-1/2 items-center justify-center", style: { left: `clamp(8px, ${m2.leftPct}%, calc(100% - 8px))` }, children: jsxRuntimeExports.jsx(TimestampTooltip, { date: m2.timeMs, children: jsxRuntimeExports.jsx("span", { className: "flex h-6 w-8 items-center justify-center", children: jsxRuntimeExports.jsx(MarkerTick, { className: "h-3" }) }) }) }, m2.timeMs)) });
96776
+ return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: markers.map((m2, index2) => jsxRuntimeExports.jsx("span", { className: "pointer-events-auto absolute top-0 bottom-0 z-10 flex w-8 -translate-x-1/2 items-center justify-center", style: { left: `clamp(8px, ${m2.leftPct}%, calc(100% - 8px))` }, children: jsxRuntimeExports.jsx(TimestampTooltip, { date: m2.timeMs, prefix: MARKER_KIND_PREFIX[m2.kind], children: jsxRuntimeExports.jsx("span", { className: "flex h-6 w-8 items-center justify-center", children: jsxRuntimeExports.jsx(MarkerTick, { className: "h-3" }) }) }) }, `${m2.timeMs}-${index2}`)) });
96677
96777
  }
96678
96778
  function OffscreenMarkerIndicator({ direction, count: count2, targetMs, onReveal }) {
96679
96779
  const Chevron = direction === "right" ? ArrowRight : ArrowLeft;
@@ -100182,8 +100282,8 @@ async function fetchHook$1(worldEnv, hookId, resolveData = "all") {
100182
100282
  async function cancelRun$3(worldEnv, runId) {
100183
100283
  return rpc("cancelRun", { worldEnv, runId });
100184
100284
  }
100185
- async function bulkCancelRuns$2(worldEnv, runIds) {
100186
- return rpc("bulkCancelRuns", { worldEnv, runIds });
100285
+ async function bulkCancelRuns$2(worldEnv, runIds2) {
100286
+ return rpc("bulkCancelRuns", { worldEnv, runIds: runIds2 });
100187
100287
  }
100188
100288
  async function recreateRun$2(worldEnv, runId, deploymentId) {
100189
100289
  return rpc("recreateRun", { worldEnv, runId, deploymentId });
@@ -100765,19 +100865,20 @@ const SerializationStoredBytes = SemanticConvention$2("workflow.serialization.st
100765
100865
  const SerializationCompressionRatio = SemanticConvention$2("workflow.serialization.compression_ratio");
100766
100866
  const SerializationGuestCodeExecutions = SemanticConvention$2("workflow.serialization.guest_code_executions");
100767
100867
  const SerializationGuestCodeDetails = SemanticConvention$2("workflow.serialization.guest_code_details");
100868
+ globalSingleton("@workflow/core//traceModeWarnings", 1, () => ({ unrecognized: /* @__PURE__ */ new Set() }));
100768
100869
  async function serializeTraceCarrier() {
100769
- const otel = await OtelApi.value;
100770
- if (!otel)
100870
+ const otel2 = await OtelApi.value;
100871
+ if (!otel2)
100771
100872
  return {};
100772
100873
  const carrier = {};
100773
- otel.propagation.inject(otel.context.active(), carrier);
100874
+ otel2.propagation.inject(otel2.context.active(), carrier);
100774
100875
  return carrier;
100775
100876
  }
100776
100877
  async function deserializeTraceCarrier(traceCarrier) {
100777
- const otel = await OtelApi.value;
100778
- if (!otel)
100878
+ const otel2 = await OtelApi.value;
100879
+ if (!otel2)
100779
100880
  return;
100780
- return otel.propagation.extract(otel.context.active(), traceCarrier);
100881
+ return otel2.propagation.extract(otel2.context.active(), traceCarrier);
100781
100882
  }
100782
100883
  const OtelApi = once$1(async () => {
100783
100884
  try {
@@ -100796,7 +100897,7 @@ const Tracer = once$1(async () => {
100796
100897
  return tracer;
100797
100898
  });
100798
100899
  let otelDiagLogged$1 = false;
100799
- function logOtelDiagnosticOnce$1(otel, tracer) {
100900
+ function logOtelDiagnosticOnce$1(otel2, tracer) {
100800
100901
  var _a3, _b2, _c2, _d2, _e2;
100801
100902
  const debugEnabled = typeof process !== "undefined" && typeof process.env.DEBUG === "string" && (process.env.DEBUG.includes("workflow:") || process.env.DEBUG === "*");
100802
100903
  if (otelDiagLogged$1 || !debugEnabled)
@@ -100804,7 +100905,7 @@ function logOtelDiagnosticOnce$1(otel, tracer) {
100804
100905
  otelDiagLogged$1 = true;
100805
100906
  try {
100806
100907
  const g2 = globalThis[Symbol.for("opentelemetry.js.api.1")];
100807
- const provider = otel.trace.getTracerProvider();
100908
+ const provider = otel2.trace.getTracerProvider();
100808
100909
  const delegate = ((_a3 = provider.getDelegate) == null ? void 0 : _a3.call(provider)) ?? provider;
100809
100910
  const probe = tracer.startSpan("workflow.otel.probe.core");
100810
100911
  console.warn("[workflow:otel-diag] core", JSON.stringify({
@@ -100821,25 +100922,25 @@ function logOtelDiagnosticOnce$1(otel, tracer) {
100821
100922
  }
100822
100923
  }
100823
100924
  async function trace$2(spanName, ...args) {
100824
- const [tracer, otel] = await Promise.all([Tracer.value, OtelApi.value]);
100925
+ const [tracer, otel2] = await Promise.all([Tracer.value, OtelApi.value]);
100825
100926
  const { fn: fn2, opts } = typeof args[0] === "function" ? { fn: args[0], opts: {} } : { fn: args[1], opts: args[0] };
100826
100927
  if (!fn2)
100827
100928
  throw new Error("Function to trace must be provided");
100828
- if (!tracer || !otel) {
100929
+ if (!tracer || !otel2) {
100829
100930
  return await fn2();
100830
100931
  }
100831
100932
  return tracer.startActiveSpan(spanName, opts, async (span) => {
100832
100933
  try {
100833
100934
  const result = await fn2(span);
100834
- span.setStatus({ code: otel.SpanStatusCode.OK });
100935
+ span.setStatus({ code: otel2.SpanStatusCode.OK });
100835
100936
  return result;
100836
100937
  } catch (e) {
100837
100938
  if (WorkflowSuspension.is(e)) {
100838
- span.setStatus({ code: otel.SpanStatusCode.OK });
100939
+ span.setStatus({ code: otel2.SpanStatusCode.OK });
100839
100940
  applyWorkflowSuspensionToSpan(e, span);
100840
100941
  } else {
100841
100942
  span.setStatus({
100842
- code: otel.SpanStatusCode.ERROR,
100943
+ code: otel2.SpanStatusCode.ERROR,
100843
100944
  message: e.message
100844
100945
  });
100845
100946
  }
@@ -100864,36 +100965,36 @@ function applyWorkflowSuspensionToSpan(error2, span) {
100864
100965
  });
100865
100966
  }
100866
100967
  async function getSpanContextForTraceCarrier(carrier) {
100867
- const [deserialized, otel] = await Promise.all([
100968
+ const [deserialized, otel2] = await Promise.all([
100868
100969
  deserializeTraceCarrier(carrier),
100869
100970
  OtelApi.value
100870
100971
  ]);
100871
- if (!deserialized || !otel)
100972
+ if (!deserialized || !otel2)
100872
100973
  return;
100873
- return otel.trace.getSpanContext(deserialized);
100974
+ return otel2.trace.getSpanContext(deserialized);
100874
100975
  }
100875
100976
  async function getActiveSpan() {
100876
- return await withOtel((otel) => otel.trace.getActiveSpan());
100977
+ return await withOtel((otel2) => otel2.trace.getActiveSpan());
100877
100978
  }
100878
100979
  async function getSpanKind$2(field) {
100879
100980
  return withOtel((x2) => x2.SpanKind[field]);
100880
100981
  }
100881
100982
  async function withOtel(fn2) {
100882
- const otel = await OtelApi.value;
100883
- if (!otel)
100983
+ const otel2 = await OtelApi.value;
100984
+ if (!otel2)
100884
100985
  return void 0;
100885
- return await fn2(otel);
100986
+ return await fn2(otel2);
100886
100987
  }
100887
100988
  async function linkToTraceCarrier(carrier) {
100888
100989
  if (!carrier)
100889
100990
  return;
100890
- const [context, otel] = await Promise.all([
100991
+ const [context, otel2] = await Promise.all([
100891
100992
  getSpanContextForTraceCarrier(carrier),
100892
100993
  OtelApi.value
100893
100994
  ]);
100894
- if (!context || !otel)
100995
+ if (!context || !otel2)
100895
100996
  return;
100896
- if (!otel.trace.isSpanContextValid(context))
100997
+ if (!otel2.trace.isSpanContextValid(context))
100897
100998
  return;
100898
100999
  return { context };
100899
101000
  }
@@ -101218,11 +101319,11 @@ async function flushablePipePerChunk(source, sink, state) {
101218
101319
  }
101219
101320
  function assertWorldSupportsRuntimeProtocol(world) {
101220
101321
  const declared = world.specVersion;
101221
- if (declared !== void 0 && declared !== null && declared >= SPEC_VERSION_CURRENT && declared <= SPEC_VERSION_MAX_SUPPORTED) {
101322
+ if (declared !== void 0 && declared !== null && declared >= SPEC_VERSION_SUPPORTS_SLOT_IDENTITY && declared <= SPEC_VERSION_MAX_SUPPORTED) {
101222
101323
  return;
101223
101324
  }
101224
101325
  const supportedVersion = declared ?? "none";
101225
- throw new WorkflowRuntimeError(`This Workflow runtime supports Worlds with spec version ${SPEC_VERSION_CURRENT} through ${SPEC_VERSION_MAX_SUPPORTED}, but the configured World declares spec version ${supportedVersion}. Install a World package version compatible with the current Workflow runtime.`);
101326
+ throw new WorkflowRuntimeError(`This Workflow runtime supports Worlds with spec version ${SPEC_VERSION_SUPPORTS_SLOT_IDENTITY} through ${SPEC_VERSION_MAX_SUPPORTED}, but the configured World declares spec version ${supportedVersion}. Install a World package version compatible with the current Workflow runtime.`);
101226
101327
  }
101227
101328
  const WorldCacheKey = Symbol.for("@workflow/world//cache");
101228
101329
  const WorldCachePromiseKey = Symbol.for("@workflow/world//cachePromise");
@@ -101260,9 +101361,9 @@ function withGuestCodeStats(stats2, fn2) {
101260
101361
  reportedProxies = previousProxies;
101261
101362
  }
101262
101363
  }
101263
- const useStepClosureFns = /* @__PURE__ */ new WeakSet();
101364
+ const useStepClosures = globalSingleton("@workflow/core//useStepClosures.fns", 1, () => ({ fns: /* @__PURE__ */ new WeakSet() }));
101264
101365
  function isUseStepClosureFn(fn2) {
101265
- return typeof fn2 === "function" && useStepClosureFns.has(fn2);
101366
+ return typeof fn2 === "function" && useStepClosures.fns.has(fn2);
101266
101367
  }
101267
101368
  function recordGuestCode(kind, detail) {
101268
101369
  if (!activeStats)
@@ -101710,7 +101811,7 @@ function getCommonReducers(_global = globalThis) {
101710
101811
  return {
101711
101812
  ArrayBuffer: (value) => types$3.isArrayBuffer(value) && arrayBufferToBase64(value, 0, arrayBufferByteLength(value)),
101712
101813
  BigInt: (value) => (
101713
- // String(bigint) is a spec-internal numeric conversion unlike
101814
+ // String(bigint) is a spec-internal numeric conversion: unlike
101714
101815
  // `value.toString()`, it never consults BigInt.prototype.
101715
101816
  typeof value === "bigint" && String(value)
101716
101817
  ),
@@ -101830,7 +101931,7 @@ function getCommonReducers(_global = globalThis) {
101830
101931
  errors: readProperty(value, "errors")
101831
101932
  };
101832
101933
  },
101833
- // Base Error reducer catch-all for any Error instance not matched by a
101934
+ // Base Error reducer: catch-all for any Error instance not matched by a
101834
101935
  // specific subclass reducer above (including user Error subclasses without
101835
101936
  // WORKFLOW_SERIALIZE). Preserves `name` so the error's identity is retained
101836
101937
  // even though the exact class cannot be reconstructed.
@@ -101850,7 +101951,7 @@ function getCommonReducers(_global = globalThis) {
101850
101951
  Float32Array: (value) => types$3.isFloat32Array(value) && viewToBase64(value),
101851
101952
  Float64Array: (value) => types$3.isFloat64Array(value) && viewToBase64(value),
101852
101953
  // Headers is a host class injected into the sandbox, so its (shared)
101853
- // prototype is reachable from workflow code iterate through the
101954
+ // prototype is reachable from workflow code; iterate through the
101854
101955
  // boot-captured iterator instead of a live Symbol.iterator lookup.
101855
101956
  Headers: (value) => isInstanceOfPrototype(value, Headers.prototype) && headersToEntries(value),
101856
101957
  Int8Array: (value) => types$3.isInt8Array(value) && viewToBase64(value),
@@ -101971,7 +102072,7 @@ function getCommonRevivers$1(global2 = globalThis) {
101971
102072
  error2.stack = value.stack;
101972
102073
  return error2;
101973
102074
  },
101974
- // Base Error reviver used for plain Error instances and unrecognized
102075
+ // Base Error reviver: used for plain Error instances and unrecognized
101975
102076
  // Error subclasses. Preserves `name` so the error's identity is retained.
101976
102077
  Error: (value) => {
101977
102078
  const opts = "cause" in value ? { cause: value.cause } : void 0;
@@ -102413,7 +102514,7 @@ class WorkflowAbortSignal {
102413
102514
  /**
102414
102515
  * @internal Sets aborted state and fires listeners.
102415
102516
  * Called by abort() on first-run, or by the events consumer on replay.
102416
- * Idempotent second call is a no-op.
102517
+ * Idempotent: second call is a no-op.
102417
102518
  */
102418
102519
  _setAborted(reason) {
102419
102520
  if (this.aborted)
@@ -103368,7 +103469,7 @@ function getWorkflowReducers(global2 = globalThis) {
103368
103469
  return {
103369
103470
  ...getAllBaseReducers(global2),
103370
103471
  // Readable/Writable streams from within the workflow execution environment
103371
- // are simply "handles" that can be passed around to other steps.
103472
+ // are "handles" that can be passed around to other steps.
103372
103473
  ReadableStream: (value) => {
103373
103474
  if (!isInstanceOfPrototype(value, readableStreamPrototype.value))
103374
103475
  return false;
@@ -103410,7 +103511,7 @@ function getWorkflowReducers(global2 = globalThis) {
103410
103511
  }
103411
103512
  return s2;
103412
103513
  },
103413
- // AbortController/AbortSignal in workflow context just read symbols (handles).
103514
+ // AbortController/AbortSignal in workflow context: read only symbols (handles).
103414
103515
  // In the workflow VM, global.AbortController is a class but global.AbortSignal
103415
103516
  // is a plain object (not a class), so instanceof checks won't work for signals.
103416
103517
  // Detect instances by the presence of the ABORT_STREAM_NAME symbol instead.
@@ -103767,7 +103868,7 @@ function getWorkflowRevivers(global2 = globalThis) {
103767
103868
  }
103768
103869
  return value;
103769
103870
  },
103770
- // Workflow function reviver for workflow context returns a function-like
103871
+ // Workflow function reviver for workflow context: returns a function-like
103771
103872
  // object with .workflowId that mimics what the SWC compiler produces,
103772
103873
  WorkflowFunction: (value) => Object.assign(() => {
103773
103874
  throw new SerializationError("Workflow functions cannot be called directly. Use start() to invoke them.", {
@@ -103800,7 +103901,7 @@ function getWorkflowRevivers(global2 = globalThis) {
103800
103901
  // that when the handle is later passed to a step (which reads
103801
103902
  // the actual bytes from the server) we know whether to unframe.
103802
103903
  // Defaults to undefined for streams whose serialized ref didn't
103803
- // carry the field those are treated as legacy raw bytes.
103904
+ // carry the field; those are treated as legacy raw bytes.
103804
103905
  [STREAM_FRAMING_SYMBOL]: {
103805
103906
  value: value.framing,
103806
103907
  writable: false
@@ -103837,9 +103938,9 @@ function getWorkflowRevivers(global2 = globalThis) {
103837
103938
  // AbortController/AbortSignal revived inside the workflow VM. Use the
103838
103939
  // real WorkflowAbortSignal class so addEventListener('abort', fn) actually
103839
103940
  // fires when the signal aborts (the previous no-op stub silently dropped
103840
- // listener registrations silent correctness bug for natural patterns
103941
+ // listener registrations, a silent correctness bug for natural patterns
103841
103942
  // like `signal.addEventListener('abort', fn)` after receiving a deserialized
103842
- // signal). The signal does not own a hook subscription here abort state
103943
+ // signal). The signal does not own a hook subscription here; abort state
103843
103944
  // is delivered via the existing replay machinery on the source side.
103844
103945
  AbortController: (value) => {
103845
103946
  const signal = new WorkflowAbortSignal(value.streamName, value.hookToken);
@@ -103876,7 +103977,7 @@ function getStepRevivers(global2 = globalThis, ops, runId, cryptoKey, deployment
103876
103977
  // arrow steps). The wrapper invokes the body via
103877
103978
  // `stepFn.apply(boundThis, args)` so the body sees the same
103878
103979
  // `this` it would have had in the workflow bundle. Property
103879
- // presence not truthiness is significant because
103980
+ // presence, not truthiness, is significant because
103880
103981
  // `bind(null)` and `bind(undefined)` are both legal and should
103881
103982
  // round-trip faithfully.
103882
103983
  // - `boundArgs`: prefilled args from
@@ -104192,8 +104293,13 @@ function getStreamAndRequestRevivers(allRevivers) {
104192
104293
  }
104193
104294
  return extra;
104194
104295
  }
104195
- `cinst_${ulid$3()}`;
104196
- const version$1 = "5.0.0-beta.43";
104296
+ `cinst_${ulid$1()}`;
104297
+ globalSingleton("@workflow/core//envWarnings", 1, () => ({
104298
+ replayTimeoutValues: /* @__PURE__ */ new Set(),
104299
+ maxInlineStepsValues: /* @__PURE__ */ new Set(),
104300
+ maxEventsValues: /* @__PURE__ */ new Set()
104301
+ }));
104302
+ const version$1 = "5.0.0-beta.44";
104197
104303
  const DEFAULT_HEALTH_CHECK_TIMEOUT = 3e4;
104198
104304
  const SAFE_WORKFLOW_NAME_PATTERN = /^[a-zA-Z0-9_\-./@]+$/;
104199
104305
  function getWorkflowQueueName(workflowName, namespace2) {
@@ -104350,9 +104456,9 @@ const UNWRITABLE_DIR_CODES = /* @__PURE__ */ new Set(["EROFS", "EACCES", "EPERM"
104350
104456
  function isUnwritableDirCode(code2) {
104351
104457
  return code2 !== void 0 && UNWRITABLE_DIR_CODES.has(code2);
104352
104458
  }
104353
- let warnedAboutVercelDeployment = false;
104459
+ const warnings = globalSingleton("@workflow/world-local//buildTargetWarnings", 1, () => ({ warnedAboutVercelDeployment: false }));
104354
104460
  function warnIfRunningInVercelDeployment(dataDir) {
104355
- if (warnedAboutVercelDeployment || !process.env.VERCEL_DEPLOYMENT_ID) {
104461
+ if (warnings.warnedAboutVercelDeployment || !process.env.VERCEL_DEPLOYMENT_ID) {
104356
104462
  return;
104357
104463
  }
104358
104464
  const resolvedDataDir = path$3.resolve(dataDir);
@@ -104360,7 +104466,7 @@ function warnIfRunningInVercelDeployment(dataDir) {
104360
104466
  if (resolvedDataDir === tmp || resolvedDataDir.startsWith(`${tmp}${path$3.sep}`)) {
104361
104467
  return;
104362
104468
  }
104363
- warnedAboutVercelDeployment = true;
104469
+ warnings.warnedAboutVercelDeployment = true;
104364
104470
  console.warn(`[workflow] Warning: the local (filesystem) world is running inside a Vercel deployment, writing to ${resolvedDataDir}. That filesystem is read-only, so workflow runs will fail before their first step. ` + SELECT_VERCEL_WORLD_ADVICE);
104365
104471
  }
104366
104472
  function parsePort$2(value, radix = 10) {
@@ -104635,7 +104741,16 @@ async function resolveBaseUrl$1(config2) {
104635
104741
  }
104636
104742
  throw new Error("Unable to resolve base URL for workflow queue.");
104637
104743
  }
104638
- const ulid$2 = monotonicFactory(() => Math.random());
104744
+ const fsState = globalSingleton("@workflow/world-local//fs", 1, () => ({
104745
+ ulid: monotonicFactory(() => Math.random()),
104746
+ // In-memory cache of created files to avoid expensive fs.access() calls.
104747
+ // Safe because we only write once per file path (no overwrites without an
104748
+ // explicit flag).
104749
+ createdFilesCache: /* @__PURE__ */ new Set(),
104750
+ // Writes repeatedly target a small fixed set of entity directories. Once one
104751
+ // exists in this process, avoid another recursive mkdir syscall per event.
104752
+ createdDirectoriesCache: /* @__PURE__ */ new Set()
104753
+ }));
104639
104754
  function truncateForError(value) {
104640
104755
  const s2 = typeof value === "string" ? value : String(value);
104641
104756
  const MAX = 48;
@@ -104682,11 +104797,9 @@ async function withWindowsRetry(fn2, maxRetries = 5) {
104682
104797
  }
104683
104798
  throw new Error("Retry loop exited unexpectedly");
104684
104799
  }
104685
- const createdFilesCache = /* @__PURE__ */ new Set();
104686
- const createdDirectoriesCache = /* @__PURE__ */ new Set();
104687
104800
  function clearCreatedFilesCache() {
104688
- createdFilesCache.clear();
104689
- createdDirectoriesCache.clear();
104801
+ fsState.createdFilesCache.clear();
104802
+ fsState.createdDirectoriesCache.clear();
104690
104803
  }
104691
104804
  const TAG_PATTERN = /\.[a-zA-Z][a-zA-Z0-9-]*$/;
104692
104805
  function stripTag(fileId) {
@@ -104740,12 +104853,12 @@ async function listTaggedFilesByExtension(dirPath, tag, extension2) {
104740
104853
  }
104741
104854
  async function ensureDir(dirPath) {
104742
104855
  const resolvedPath = path$3.resolve(dirPath);
104743
- if (createdDirectoriesCache.has(resolvedPath)) {
104856
+ if (fsState.createdDirectoriesCache.has(resolvedPath)) {
104744
104857
  return;
104745
104858
  }
104746
104859
  try {
104747
104860
  await promises.mkdir(resolvedPath, { recursive: true });
104748
- createdDirectoriesCache.add(resolvedPath);
104861
+ fsState.createdDirectoriesCache.add(resolvedPath);
104749
104862
  } catch (error2) {
104750
104863
  const code2 = error2.code;
104751
104864
  if (isUnwritableDirCode(code2) && !await isExistingDirectory(resolvedPath)) {
@@ -104768,7 +104881,7 @@ async function withEnsuredDirectory(dirPath, operation) {
104768
104881
  if (error2.code !== "ENOENT") {
104769
104882
  throw error2;
104770
104883
  }
104771
- createdDirectoriesCache.delete(path$3.resolve(dirPath));
104884
+ fsState.createdDirectoriesCache.delete(path$3.resolve(dirPath));
104772
104885
  await ensureDir(dirPath);
104773
104886
  return operation();
104774
104887
  }
@@ -104793,12 +104906,12 @@ async function writeJSON(filePath, data, opts) {
104793
104906
  }
104794
104907
  async function write(filePath, data, opts) {
104795
104908
  if (!(opts == null ? void 0 : opts.overwrite)) {
104796
- if (createdFilesCache.has(filePath)) {
104909
+ if (fsState.createdFilesCache.has(filePath)) {
104797
104910
  throw new EntityConflictError(`File ${filePath} already exists and 'overwrite' is false`);
104798
104911
  }
104799
104912
  try {
104800
104913
  await promises.access(filePath);
104801
- createdFilesCache.add(filePath);
104914
+ fsState.createdFilesCache.add(filePath);
104802
104915
  throw new EntityConflictError(`File ${filePath} already exists and 'overwrite' is false`);
104803
104916
  } catch (error2) {
104804
104917
  if (error2.code !== "ENOENT") {
@@ -104806,7 +104919,7 @@ async function write(filePath, data, opts) {
104806
104919
  }
104807
104920
  }
104808
104921
  }
104809
- const tempPath = `${filePath}.tmp.${ulid$2()}`;
104922
+ const tempPath = `${filePath}.tmp.${fsState.ulid()}`;
104810
104923
  let tempFileCreated = false;
104811
104924
  try {
104812
104925
  await withEnsuredDirectory(path$3.dirname(filePath), async () => {
@@ -104814,7 +104927,7 @@ async function write(filePath, data, opts) {
104814
104927
  tempFileCreated = true;
104815
104928
  await withWindowsRetry(() => promises.rename(tempPath, filePath));
104816
104929
  });
104817
- createdFilesCache.add(filePath);
104930
+ fsState.createdFilesCache.add(filePath);
104818
104931
  } catch (error2) {
104819
104932
  if (tempFileCreated) {
104820
104933
  await withWindowsRetry(() => promises.unlink(tempPath), 3).catch(() => {
@@ -104856,7 +104969,7 @@ async function deleteJSON(filePath) {
104856
104969
  }
104857
104970
  }
104858
104971
  async function writeExclusive(filePath, data) {
104859
- const tempPath = `${filePath}.tmp.${ulid$2()}`;
104972
+ const tempPath = `${filePath}.tmp.${fsState.ulid()}`;
104860
104973
  let tempFileCreated = false;
104861
104974
  try {
104862
104975
  return await withEnsuredDirectory(path$3.dirname(filePath), async () => {
@@ -105051,7 +105164,7 @@ async function paginatedFileSystemQuery(config2) {
105051
105164
  };
105052
105165
  }
105053
105166
  const PACKAGE_NAME = "@workflow/world-local";
105054
- let cachedPackageInfo = null;
105167
+ const packageInfo = globalSingleton("@workflow/world-local//packageInfo", 1, () => ({ cached: null }));
105055
105168
  function getModuleDir() {
105056
105169
  if (typeof import.meta.url === "string" && import.meta.url) {
105057
105170
  return path$3.dirname(fileURLToPath(import.meta.url));
@@ -105059,23 +105172,23 @@ function getModuleDir() {
105059
105172
  return null;
105060
105173
  }
105061
105174
  async function getPackageInfo() {
105062
- if (cachedPackageInfo) {
105063
- return cachedPackageInfo;
105175
+ if (packageInfo.cached) {
105176
+ return packageInfo.cached;
105064
105177
  }
105065
105178
  const moduleDir = getModuleDir();
105066
105179
  if (moduleDir) {
105067
105180
  try {
105068
105181
  const content2 = await readFile(path$3.join(moduleDir, "../package.json"), "utf-8");
105069
- cachedPackageInfo = JSON.parse(content2);
105070
- return cachedPackageInfo;
105182
+ packageInfo.cached = JSON.parse(content2);
105183
+ return packageInfo.cached;
105071
105184
  } catch {
105072
105185
  }
105073
105186
  }
105074
- cachedPackageInfo = {
105187
+ packageInfo.cached = {
105075
105188
  name: PACKAGE_NAME,
105076
105189
  version: "bundled"
105077
105190
  };
105078
- return cachedPackageInfo;
105191
+ return packageInfo.cached;
105079
105192
  }
105080
105193
  const VERSION_FILENAME = "version.txt";
105081
105194
  class DataDirAccessError extends Error {
@@ -105179,8 +105292,8 @@ async function readVersionFile(dataDir) {
105179
105292
  }
105180
105293
  async function writeVersionFile(dataDir, version2) {
105181
105294
  const versionFilePath = path$3.join(path$3.resolve(dataDir), VERSION_FILENAME);
105182
- const packageInfo = await getPackageInfo();
105183
- const content2 = formatVersionFile(packageInfo.name, version2);
105295
+ const packageInfo2 = await getPackageInfo();
105296
+ const content2 = formatVersionFile(packageInfo2.name, version2);
105184
105297
  await writeFile(versionFilePath, content2);
105185
105298
  }
105186
105299
  function getSuggestedDowngradeVersion(oldVersion, suggestedVersion) {
@@ -105191,8 +105304,8 @@ function getSuggestedDowngradeVersion(oldVersion, suggestedVersion) {
105191
105304
  }
105192
105305
  async function initDataDir(dataDir) {
105193
105306
  await ensureDataDir(dataDir);
105194
- const packageInfo = await getPackageInfo();
105195
- const currentVersion = parseVersion(packageInfo.version);
105307
+ const packageInfo2 = await getPackageInfo();
105308
+ const currentVersion = parseVersion(packageInfo2.version);
105196
105309
  const existingVersionInfo = await readVersionFile(dataDir);
105197
105310
  if (existingVersionInfo === null) {
105198
105311
  await writeVersionFile(dataDir, currentVersion);
@@ -105209,40 +105322,42 @@ async function initDataDir(dataDir) {
105209
105322
  const suggestedVersion = error2 instanceof DataDirVersionError ? error2.suggestedVersion : void 0;
105210
105323
  const downgradeTarget = getSuggestedDowngradeVersion(oldVersion, suggestedVersion);
105211
105324
  console.error(`[world-local] Failed to upgrade data directory from version ${formatVersion(oldVersion)} to ${formatVersion(currentVersion)}:`, error2 instanceof Error ? error2.message : error2);
105212
- console.error(`[world-local] Data is not compatible with the current version. Please downgrade to ${packageInfo.name}@${downgradeTarget}`);
105325
+ console.error(`[world-local] Data is not compatible with the current version. Please downgrade to ${packageInfo2.name}@${downgradeTarget}`);
105213
105326
  throw error2;
105214
105327
  }
105215
105328
  }
105216
- let otelApiPromise$2 = null;
105329
+ const otel$1 = globalSingleton("@workflow/world-local//telemetry", 1, () => ({
105330
+ apiPromise: null,
105331
+ tracerPromise: null
105332
+ }));
105217
105333
  async function getOtelApi$2() {
105218
- if (!otelApiPromise$2) {
105219
- otelApiPromise$2 = import("./index-CETb4fkq.js").catch(() => null);
105334
+ if (!otel$1.apiPromise) {
105335
+ otel$1.apiPromise = import("./index-CETb4fkq.js").catch(() => null);
105220
105336
  }
105221
- return otelApiPromise$2;
105337
+ return otel$1.apiPromise;
105222
105338
  }
105223
- let tracerPromise$1 = null;
105224
105339
  async function getTracer$1() {
105225
- if (!tracerPromise$1) {
105226
- tracerPromise$1 = getOtelApi$2().then((otel) => otel ? otel.trace.getTracer("workflow") : null);
105340
+ if (!otel$1.tracerPromise) {
105341
+ otel$1.tracerPromise = getOtelApi$2().then((otelApi) => otelApi ? otelApi.trace.getTracer("workflow") : null);
105227
105342
  }
105228
- return tracerPromise$1;
105343
+ return otel$1.tracerPromise;
105229
105344
  }
105230
105345
  async function trace$1(spanName, ...args) {
105231
- const [tracer, otel] = await Promise.all([getTracer$1(), getOtelApi$2()]);
105346
+ const [tracer, otel2] = await Promise.all([getTracer$1(), getOtelApi$2()]);
105232
105347
  const { fn: fn2, opts } = typeof args[0] === "function" ? { fn: args[0], opts: {} } : { fn: args[1], opts: args[0] };
105233
105348
  if (!fn2)
105234
105349
  throw new Error("Function to trace must be provided");
105235
- if (!tracer || !otel) {
105350
+ if (!tracer || !otel2) {
105236
105351
  return await fn2();
105237
105352
  }
105238
105353
  return tracer.startActiveSpan(spanName, opts, async (span) => {
105239
105354
  try {
105240
105355
  const result = await fn2(span);
105241
- span.setStatus({ code: otel.SpanStatusCode.OK });
105356
+ span.setStatus({ code: otel2.SpanStatusCode.OK });
105242
105357
  return result;
105243
105358
  } catch (e) {
105244
105359
  span.setStatus({
105245
- code: otel.SpanStatusCode.ERROR,
105360
+ code: otel2.SpanStatusCode.ERROR,
105246
105361
  message: e.message
105247
105362
  });
105248
105363
  throw e;
@@ -105252,10 +105367,10 @@ async function trace$1(spanName, ...args) {
105252
105367
  });
105253
105368
  }
105254
105369
  async function getSpanKind$1(field) {
105255
- const otel = await getOtelApi$2();
105256
- if (!otel)
105370
+ const otel2 = await getOtelApi$2();
105371
+ if (!otel2)
105257
105372
  return void 0;
105258
- return otel.SpanKind[field];
105373
+ return otel2.SpanKind[field];
105259
105374
  }
105260
105375
  function SemanticConvention$1(...names) {
105261
105376
  return (value) => Object.fromEntries(names.map((name2) => [name2, value]));
@@ -125483,7 +125598,7 @@ function requireResponse() {
125483
125598
  var request;
125484
125599
  var hasRequiredRequest;
125485
125600
  function requireRequest() {
125486
- var _signal, _dispatcher2, _headers, _state;
125601
+ var _signal, _dispatcher, _headers, _state;
125487
125602
  if (hasRequiredRequest) return request;
125488
125603
  hasRequiredRequest = 1;
125489
125604
  const { extractBody, mixinBody, cloneBody, bodyUnusable } = requireBody();
@@ -125553,7 +125668,7 @@ function requireRequest() {
125553
125668
  /** @type {AbortSignal} */
125554
125669
  __privateAdd(this, _signal);
125555
125670
  /** @type {import('../../dispatcher/dispatcher')} */
125556
- __privateAdd(this, _dispatcher2);
125671
+ __privateAdd(this, _dispatcher);
125557
125672
  /** @type {Headers} */
125558
125673
  __privateAdd(this, _headers);
125559
125674
  __privateAdd(this, _state);
@@ -125571,7 +125686,7 @@ function requireRequest() {
125571
125686
  const baseUrl = environmentSettingsObject.settingsObject.baseUrl;
125572
125687
  let signal = null;
125573
125688
  if (typeof input === "string") {
125574
- __privateSet(this, _dispatcher2, init2.dispatcher);
125689
+ __privateSet(this, _dispatcher, init2.dispatcher);
125575
125690
  let parsedURL;
125576
125691
  try {
125577
125692
  parsedURL = new URL(input, baseUrl);
@@ -125589,7 +125704,7 @@ function requireRequest() {
125589
125704
  assert2(webidl.is.Request(input));
125590
125705
  request2 = __privateGet(input, _state);
125591
125706
  signal = __privateGet(input, _signal);
125592
- __privateSet(this, _dispatcher2, init2.dispatcher || __privateGet(input, _dispatcher2));
125707
+ __privateSet(this, _dispatcher, init2.dispatcher || __privateGet(input, _dispatcher));
125593
125708
  }
125594
125709
  const origin = environmentSettingsObject.settingsObject.origin;
125595
125710
  let window2 = "client";
@@ -125966,7 +126081,7 @@ function requireRequest() {
125966
126081
  buildAbort(acRef)
125967
126082
  );
125968
126083
  }
125969
- return fromInnerRequest(clonedRequest, __privateGet(this, _dispatcher2), ac.signal, getHeadersGuard(__privateGet(this, _headers)));
126084
+ return fromInnerRequest(clonedRequest, __privateGet(this, _dispatcher), ac.signal, getHeadersGuard(__privateGet(this, _headers)));
125970
126085
  }
125971
126086
  [nodeUtil.inspect.custom](depth, options) {
125972
126087
  if (options.depth === null) {
@@ -126004,14 +126119,14 @@ function requireRequest() {
126004
126119
  * @param {Request} request
126005
126120
  */
126006
126121
  static getRequestDispatcher(request2) {
126007
- return __privateGet(request2, _dispatcher2);
126122
+ return __privateGet(request2, _dispatcher);
126008
126123
  }
126009
126124
  /**
126010
126125
  * @param {Request} request
126011
126126
  * @param {import('../../dispatcher/dispatcher')} newDispatcher
126012
126127
  */
126013
126128
  static setRequestDispatcher(request2, newDispatcher) {
126014
- __privateSet(request2, _dispatcher2, newDispatcher);
126129
+ __privateSet(request2, _dispatcher, newDispatcher);
126015
126130
  }
126016
126131
  /**
126017
126132
  * @param {Request} request
@@ -126035,7 +126150,7 @@ function requireRequest() {
126035
126150
  }
126036
126151
  };
126037
126152
  _signal = new WeakMap();
126038
- _dispatcher2 = new WeakMap();
126153
+ _dispatcher = new WeakMap();
126039
126154
  _headers = new WeakMap();
126040
126155
  _state = new WeakMap();
126041
126156
  let Request2 = _Request;
@@ -131206,7 +131321,7 @@ ${value}`;
131206
131321
  var eventsource;
131207
131322
  var hasRequiredEventsource;
131208
131323
  function requireEventsource() {
131209
- var _events, _url2, _withCredentials, _readyState, _request, _controller, _dispatcher2, _state, _EventSource_instances, connect_fn, reconnect_fn;
131324
+ var _events, _url2, _withCredentials, _readyState, _request, _controller, _dispatcher, _state, _EventSource_instances, connect_fn, reconnect_fn;
131210
131325
  if (hasRequiredEventsource) return eventsource;
131211
131326
  hasRequiredEventsource = 1;
131212
131327
  const { pipeline } = require$$0$5;
@@ -131249,7 +131364,7 @@ function requireEventsource() {
131249
131364
  __privateAdd(this, _readyState, CONNECTING);
131250
131365
  __privateAdd(this, _request, null);
131251
131366
  __privateAdd(this, _controller, null);
131252
- __privateAdd(this, _dispatcher2);
131367
+ __privateAdd(this, _dispatcher);
131253
131368
  /**
131254
131369
  * @type {import('./eventsource-stream').eventSourceSettings}
131255
131370
  */
@@ -131265,7 +131380,7 @@ function requireEventsource() {
131265
131380
  }
131266
131381
  url2 = webidl.converters.USVString(url2);
131267
131382
  eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, "eventSourceInitDict");
131268
- __privateSet(this, _dispatcher2, eventSourceInitDict.node.dispatcher || eventSourceInitDict.dispatcher);
131383
+ __privateSet(this, _dispatcher, eventSourceInitDict.node.dispatcher || eventSourceInitDict.dispatcher);
131269
131384
  __privateSet(this, _state, {
131270
131385
  lastEventId: "",
131271
131386
  reconnectionTime: eventSourceInitDict.node.reconnectionTime
@@ -131387,7 +131502,7 @@ function requireEventsource() {
131387
131502
  _readyState = new WeakMap();
131388
131503
  _request = new WeakMap();
131389
131504
  _controller = new WeakMap();
131390
- _dispatcher2 = new WeakMap();
131505
+ _dispatcher = new WeakMap();
131391
131506
  _state = new WeakMap();
131392
131507
  _EventSource_instances = new WeakSet();
131393
131508
  connect_fn = function() {
@@ -131395,7 +131510,7 @@ function requireEventsource() {
131395
131510
  __privateSet(this, _readyState, CONNECTING);
131396
131511
  const fetchParams = {
131397
131512
  request: __privateGet(this, _request),
131398
- dispatcher: __privateGet(this, _dispatcher2)
131513
+ dispatcher: __privateGet(this, _dispatcher)
131399
131514
  };
131400
131515
  const processEventSourceEndOfBody = (response2) => {
131401
131516
  if (!isNetworkError(response2)) {
@@ -131984,8 +132099,8 @@ function createQueue$2(config2) {
131984
132099
  };
131985
132100
  };
131986
132101
  const getDeploymentId = async () => {
131987
- const packageInfo = await getPackageInfo();
131988
- return `dpl_local@${packageInfo.version}`;
132102
+ const packageInfo2 = await getPackageInfo();
132103
+ return `dpl_local@${packageInfo2.version}`;
131989
132104
  };
131990
132105
  return {
131991
132106
  queue,
@@ -133075,17 +133190,17 @@ function requireSignalExit() {
133075
133190
  if (typeof EE !== "function") {
133076
133191
  EE = EE.EventEmitter;
133077
133192
  }
133078
- var emitter;
133193
+ var emitter2;
133079
133194
  if (process2.__signal_exit_emitter__) {
133080
- emitter = process2.__signal_exit_emitter__;
133195
+ emitter2 = process2.__signal_exit_emitter__;
133081
133196
  } else {
133082
- emitter = process2.__signal_exit_emitter__ = new EE();
133083
- emitter.count = 0;
133084
- emitter.emitted = {};
133197
+ emitter2 = process2.__signal_exit_emitter__ = new EE();
133198
+ emitter2.count = 0;
133199
+ emitter2.emitted = {};
133085
133200
  }
133086
- if (!emitter.infinite) {
133087
- emitter.setMaxListeners(Infinity);
133088
- emitter.infinite = true;
133201
+ if (!emitter2.infinite) {
133202
+ emitter2.setMaxListeners(Infinity);
133203
+ emitter2.infinite = true;
133089
133204
  }
133090
133205
  signalExit.exports = function(cb, opts) {
133091
133206
  if (!processOk(commonjsGlobal.process)) {
@@ -133101,12 +133216,12 @@ function requireSignalExit() {
133101
133216
  ev = "afterexit";
133102
133217
  }
133103
133218
  var remove2 = function() {
133104
- emitter.removeListener(ev, cb);
133105
- if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) {
133219
+ emitter2.removeListener(ev, cb);
133220
+ if (emitter2.listeners("exit").length === 0 && emitter2.listeners("afterexit").length === 0) {
133106
133221
  unload();
133107
133222
  }
133108
133223
  };
133109
- emitter.on(ev, cb);
133224
+ emitter2.on(ev, cb);
133110
133225
  return remove2;
133111
133226
  };
133112
133227
  var unload = function unload2() {
@@ -133122,15 +133237,15 @@ function requireSignalExit() {
133122
133237
  });
133123
133238
  process2.emit = originalProcessEmit;
133124
133239
  process2.reallyExit = originalProcessReallyExit;
133125
- emitter.count -= 1;
133240
+ emitter2.count -= 1;
133126
133241
  };
133127
133242
  signalExit.exports.unload = unload;
133128
133243
  var emit = function emit2(event, code2, signal) {
133129
- if (emitter.emitted[event]) {
133244
+ if (emitter2.emitted[event]) {
133130
133245
  return;
133131
133246
  }
133132
- emitter.emitted[event] = true;
133133
- emitter.emit(event, code2, signal);
133247
+ emitter2.emitted[event] = true;
133248
+ emitter2.emit(event, code2, signal);
133134
133249
  };
133135
133250
  var sigListeners = {};
133136
133251
  signals2.forEach(function(sig) {
@@ -133139,7 +133254,7 @@ function requireSignalExit() {
133139
133254
  return;
133140
133255
  }
133141
133256
  var listeners = process2.listeners(sig);
133142
- if (listeners.length === emitter.count) {
133257
+ if (listeners.length === emitter2.count) {
133143
133258
  unload();
133144
133259
  emit("exit", null, sig);
133145
133260
  emit("afterexit", null, sig);
@@ -133159,7 +133274,7 @@ function requireSignalExit() {
133159
133274
  return;
133160
133275
  }
133161
133276
  loaded = true;
133162
- emitter.count += 1;
133277
+ emitter2.count += 1;
133163
133278
  signals2 = signals2.filter(function(sig) {
133164
133279
  try {
133165
133280
  process2.on(sig, sigListeners[sig]);
@@ -133798,7 +133913,8 @@ function hookRecoveryMarkerPath(basedir, token, runId, hookId) {
133798
133913
  const key = createHash("sha256").update(`${token}\0${runId}\0${hookId}`).digest("hex");
133799
133914
  return path$3.join(basedir, "hooks", "tokens", `${key}.recovery.json`);
133800
133915
  }
133801
- const monotonicUlid$1 = monotonicFactory(() => Math.random());
133916
+ const ulids = globalSingleton("@workflow/world-local//storageMonotonicUlid", 1, () => ({ next: monotonicFactory(() => Math.random()) }));
133917
+ const monotonicUlid$1 = (seedTime) => ulids.next(seedTime);
133802
133918
  const getObjectCreatedAt = (idPrefix) => {
133803
133919
  const replaceRegex = new RegExp(`^${idPrefix}_`, "g");
133804
133920
  return (filename) => {
@@ -133902,19 +134018,19 @@ async function listHookByRunMarkers(basedir, runId) {
133902
134018
  async function deleteHookByRunMarkerFile(basedir, fileId) {
133903
134019
  await deleteJSON(path$3.join(byRunDir(basedir), `${fileId}.json`));
133904
134020
  }
133905
- const ensuredBasedirs = /* @__PURE__ */ new Map();
134021
+ const hookIndex = globalSingleton("@workflow/world-local//hookIndexEnsureCache", 1, () => ({ ensuredBasedirs: /* @__PURE__ */ new Map() }));
133906
134022
  function resetHookIndexEnsureCache() {
133907
- ensuredBasedirs.clear();
134023
+ hookIndex.ensuredBasedirs.clear();
133908
134024
  }
133909
134025
  async function ensureHookIndexes(basedir) {
133910
134026
  const key = path$3.resolve(basedir);
133911
- let pending = ensuredBasedirs.get(key);
134027
+ let pending = hookIndex.ensuredBasedirs.get(key);
133912
134028
  if (!pending) {
133913
134029
  pending = ensureHookIndexesImpl(key).catch((error2) => {
133914
- ensuredBasedirs.delete(key);
134030
+ hookIndex.ensuredBasedirs.delete(key);
133915
134031
  throw error2;
133916
134032
  });
133917
- ensuredBasedirs.set(key, pending);
134033
+ hookIndex.ensuredBasedirs.set(key, pending);
133918
134034
  }
133919
134035
  return pending;
133920
134036
  }
@@ -134218,6 +134334,35 @@ async function deleteAllHooksForRun(basedir, runId) {
134218
134334
  await deleteHookByRunMarkerFile(basedir, marker.fileId);
134219
134335
  }
134220
134336
  }
134337
+ const emitter = new EventEmitter();
134338
+ emitter.setMaxListeners(0);
134339
+ const RUN_STATUS_POLL_INTERVAL_MS = 100;
134340
+ function getRunStatusPollIntervalMs() {
134341
+ return envNumber("WORKFLOW_LOCAL_RUN_STATUS_POLL_INTERVAL_MS", RUN_STATUS_POLL_INTERVAL_MS, { integer: true, min: 1 });
134342
+ }
134343
+ function signalRunTerminal(runId) {
134344
+ emitter.emit(`run:${runId}`);
134345
+ }
134346
+ function waitForRunTerminalSignal(runId, timeoutMs, signal) {
134347
+ if (timeoutMs <= 0 || (signal == null ? void 0 : signal.aborted))
134348
+ return Promise.resolve();
134349
+ return new Promise((resolve2) => {
134350
+ const key = `run:${runId}`;
134351
+ let settled = false;
134352
+ const settle = () => {
134353
+ if (settled)
134354
+ return;
134355
+ settled = true;
134356
+ clearTimeout(timer2);
134357
+ emitter.off(key, settle);
134358
+ signal == null ? void 0 : signal.removeEventListener("abort", settle);
134359
+ resolve2();
134360
+ };
134361
+ const timer2 = setTimeout(settle, timeoutMs);
134362
+ emitter.once(key, settle);
134363
+ signal == null ? void 0 : signal.addEventListener("abort", settle, { once: true });
134364
+ });
134365
+ }
134221
134366
  async function publishLegacyHookReceived(basedir, runId, eventId, serializedEvent, eventPath, currentRun) {
134222
134367
  if (isTerminalWorkflowRunStatus(currentRun.status) || await isRunTerminalCommitted(basedir, runId)) {
134223
134368
  throw new RunExpiredError(`Workflow run "${runId}" is already in a terminal state`);
@@ -134264,6 +134409,7 @@ async function handleLegacyEvent(basedir, runId, data, currentRun, params) {
134264
134409
  };
134265
134410
  const runPath = resolveWithinBase(basedir, "runs", `${runId}.json`);
134266
134411
  await writeJSON(runPath, run2, { overwrite: true });
134412
+ signalRunTerminal(runId);
134267
134413
  await deleteAllHooksForRun(basedir, runId);
134268
134414
  return {
134269
134415
  event: void 0,
@@ -134294,9 +134440,9 @@ async function handleLegacyEvent(basedir, runId, data, currentRun, params) {
134294
134440
  throw new Error(`Event type '${data.eventType}' not supported for legacy runs (specVersion: ${currentRun.specVersion || "undefined"}). Please upgrade 'workflow' package.`);
134295
134441
  }
134296
134442
  }
134297
- const runFileLocks = /* @__PURE__ */ new Map();
134443
+ const runLocks = globalSingleton("@workflow/world-local//runFileLocks", 1, () => ({ byKey: /* @__PURE__ */ new Map() }));
134298
134444
  function withRunFileLock(key, fn2) {
134299
- const prev = runFileLocks.get(key);
134445
+ const prev = runLocks.byKey.get(key);
134300
134446
  const taskBox = {};
134301
134447
  const task = (async () => {
134302
134448
  if (prev)
@@ -134304,13 +134450,13 @@ function withRunFileLock(key, fn2) {
134304
134450
  try {
134305
134451
  return await fn2();
134306
134452
  } finally {
134307
- if (runFileLocks.get(key) === taskBox.task) {
134308
- runFileLocks.delete(key);
134453
+ if (runLocks.byKey.get(key) === taskBox.task) {
134454
+ runLocks.byKey.delete(key);
134309
134455
  }
134310
134456
  }
134311
134457
  })();
134312
134458
  taskBox.task = task;
134313
- runFileLocks.set(key, task);
134459
+ runLocks.byKey.set(key, task);
134314
134460
  return task;
134315
134461
  }
134316
134462
  function createRunsStorage(basedir, tag) {
@@ -134325,6 +134471,29 @@ function createRunsStorage(basedir, tag) {
134325
134471
  });
134326
134472
  return {
134327
134473
  get: get2,
134474
+ /**
134475
+ * Long poll for a terminal run status. See
134476
+ * `Storage['runs'].waitForTerminalStatus`.
134477
+ *
134478
+ * Reads the run, and while it is non-terminal waits for either an
134479
+ * in-process terminal signal or the short backstop interval before
134480
+ * reading again (see `run-status-signal.ts` for why both). Returns the
134481
+ * latest snapshot once `timeoutMs` is up, whatever its status, and
134482
+ * propagates `WorkflowRunNotFoundError` exactly as `get` does.
134483
+ */
134484
+ waitForTerminalStatus: (async (id2, params) => {
134485
+ var _a3;
134486
+ const deadline = Date.now() + ((params == null ? void 0 : params.timeoutMs) ?? 0);
134487
+ while (true) {
134488
+ const run2 = await get2(id2, params);
134489
+ if (isTerminalWorkflowRunStatus(run2.status))
134490
+ return run2;
134491
+ const remainingMs = deadline - Date.now();
134492
+ if (remainingMs <= 0 || ((_a3 = params == null ? void 0 : params.signal) == null ? void 0 : _a3.aborted))
134493
+ return run2;
134494
+ await waitForRunTerminalSignal(id2, Math.min(remainingMs, getRunStatusPollIntervalMs()), params == null ? void 0 : params.signal);
134495
+ }
134496
+ }),
134328
134497
  getMany: (async (ids, params) => {
134329
134498
  const uniqueIds = [...new Set(ids)];
134330
134499
  const runs = await Promise.all(uniqueIds.map(async (id2) => {
@@ -134551,6 +134720,9 @@ async function writeRunUnderLifecycleLock(basedir, runId, tag, proposed) {
134551
134720
  await writeJSON(taggedPath(basedir, "runs", runId, tag), next2, {
134552
134721
  overwrite: true
134553
134722
  });
134723
+ if (isTerminalWorkflowRunStatus(next2.status)) {
134724
+ signalRunTerminal(runId);
134725
+ }
134554
134726
  return next2;
134555
134727
  });
134556
134728
  }
@@ -135772,7 +135944,8 @@ function createStorage$1(basedir, tag) {
135772
135944
  clearCache: () => events2.clearCache()
135773
135945
  };
135774
135946
  }
135775
- const monotonicUlid = monotonicFactory(() => Math.random());
135947
+ const chunkIds = globalSingleton("@workflow/world-local//streamerMonotonicUlid", 1, () => ({ next: monotonicFactory(() => Math.random()) }));
135948
+ const monotonicUlid = (seedTime) => chunkIds.next(seedTime);
135776
135949
  const RunStreamsSchema = object$1({
135777
135950
  streams: array$1(string$3())
135778
135951
  });
@@ -135879,12 +136052,12 @@ function createStreamer$1(basedir, tag) {
135879
136052
  async writeMulti(_runId, name2, chunks) {
135880
136053
  if (chunks.length === 0)
135881
136054
  return;
135882
- const chunkIds = chunks.map(() => `chnk_${monotonicUlid()}`);
136055
+ const chunkIds2 = chunks.map(() => `chnk_${monotonicUlid()}`);
135883
136056
  const runId = await _runId;
135884
136057
  await registerStreamForRun(runId, name2);
135885
136058
  const chunkBuffers = chunks.map((chunk) => toBuffer(chunk));
135886
136059
  const writePromises = chunkBuffers.map(async (chunkBuffer, i) => {
135887
- const chunkId = chunkIds[i];
136060
+ const chunkId = chunkIds2[i];
135888
136061
  const serialized = serializeChunk({
135889
136062
  chunk: chunkBuffer,
135890
136063
  eof: false
@@ -136153,7 +136326,7 @@ function createWorld$2(args) {
136153
136326
  const { clearCache: clearStorageCache, ...storage } = createStorage$1(mergedConfig.dataDir, tag);
136154
136327
  const recoverActiveRuns = resolveRecoverActiveRuns(mergedConfig);
136155
136328
  return {
136156
- specVersion: SPEC_VERSION_CURRENT,
136329
+ specVersion: mintedSpecVersion(),
136157
136330
  capabilities: {
136158
136331
  hookRetention: { active: true },
136159
136332
  // world-local deduplicates concurrent `hook_received` writes sharing a
@@ -136195,7 +136368,7 @@ function createWorld$2(args) {
136195
136368
  const basedir = mergedConfig.dataDir;
136196
136369
  const hooksDir = path$3.join(basedir, "hooks");
136197
136370
  const taggedHookFiles = await listTaggedFiles(hooksDir, tag);
136198
- const { HookSchema: HookSchema2 } = await import("./index-CSsrecUx.js");
136371
+ const { HookSchema: HookSchema2 } = await import("./index-DxLR22JW.js");
136199
136372
  await Promise.all(taggedHookFiles.map(async (hookFile) => {
136200
136373
  const hook = await readJSON(path$3.join(hooksDir, hookFile), HookSchema2);
136201
136374
  if (hook == null ? void 0 : hook.token) {
@@ -136378,8 +136551,8 @@ function requireGetVercelOidcToken() {
136378
136551
  }
136379
136552
  try {
136380
136553
  const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
136381
- await import("./token-util-BhmVdeCX.js").then((n) => n.t),
136382
- await import("./token-COK7oHMh.js").then((n) => n.t)
136554
+ await import("./token-util-BNjC27Tj.js").then((n) => n.t),
136555
+ await import("./token-CA6-cBL4.js").then((n) => n.t)
136383
136556
  ]);
136384
136557
  if (!token || isExpired(getTokenPayload(token), options == null ? void 0 : options.expirationBufferMs)) {
136385
136558
  await refreshToken(options);
@@ -136942,10 +137115,13 @@ function requireDist() {
136942
137115
  return dist;
136943
137116
  }
136944
137117
  var distExports = requireDist();
136945
- let _dispatcher;
136946
- let _streamDispatcher;
136947
- let _streamCloseDispatcher;
136948
- let _nodeHttpAgents;
137118
+ const version = "5.0.0-beta.40";
137119
+ const pools = globalSingleton("@workflow/world-vercel//httpPools", 1, () => ({
137120
+ dispatcher: void 0,
137121
+ streamDispatcher: void 0,
137122
+ streamCloseDispatcher: void 0,
137123
+ nodeHttpAgents: void 0
137124
+ }));
136949
137125
  const BASE_AGENT_OPTIONS = {
136950
137126
  connections: 8,
136951
137127
  keepAliveTimeout: 1e4
@@ -136984,11 +137160,11 @@ const RETRY_AGENT_OPTIONS = {
136984
137160
  retryAfter: true,
136985
137161
  // Retry 5xx in-process (genuine transient blips recover fast), but NOT 429.
136986
137162
  // The Vercel firewall issues a challenge as a 429: our server-to-server
136987
- // client cannot solve a challenge, so in-process retries just re-trigger it
137163
+ // client cannot solve a challenge, so in-process retries re-trigger it
136988
137164
  // ~5× per request and amplify load against an already-overloaded firewall
136989
137165
  // during an incident. Letting 429 pass through surfaces it immediately to
136990
- // makeRequest which maps it to a ThrottleError carrying the
136991
- // `x-vercel-mitigated` / `x-vercel-id` headers and the queue does the
137166
+ // makeRequest, which maps it to a ThrottleError carrying the
137167
+ // `x-vercel-mitigated` / `x-vercel-id` headers, and the queue does the
136992
137168
  // (backed-off) retry instead. This is the long-standing "let 429s pass
136993
137169
  // through" intent. (undici default is [500, 502, 503, 504, 429].)
136994
137170
  statusCodes: [500, 502, 503, 504]
@@ -137107,7 +137283,17 @@ function createDispatcherRecycler(factory, label) {
137107
137283
  }
137108
137284
  };
137109
137285
  }
137110
- const eventsRecycler = createDispatcherRecycler(() => createEventsDispatcher(), "events transport");
137286
+ const eventsRecycler = globalSingleton(
137287
+ // Version-keyed for the same reason as the WS registry in `ws-transport.ts`:
137288
+ // this holds a recycler closed over *this* copy's `createEventsDispatcher`,
137289
+ // so an unversioned key would silently apply one published version's undici
137290
+ // and HTTP/2 options, and its failure accounting, to another's requests. The
137291
+ // plain connection pools above stay unversioned: sharing a keep-alive pool
137292
+ // across copies is the point, and they hold no module-local behavior.
137293
+ `@workflow/world-vercel//eventsDispatcherRecycler@${version}`,
137294
+ 1,
137295
+ () => createDispatcherRecycler(() => createEventsDispatcher(), "events transport")
137296
+ );
137111
137297
  function noteEventsTransportOutcome(dispatcher2, error2) {
137112
137298
  eventsRecycler.note(dispatcher2, error2);
137113
137299
  }
@@ -137121,11 +137307,11 @@ function getNodeHttpAgents(config2) {
137121
137307
  return void 0;
137122
137308
  if (!isNodeHttpEnabled())
137123
137309
  return void 0;
137124
- _nodeHttpAgents ?? (_nodeHttpAgents = createNodeHttpAgents({
137310
+ pools.nodeHttpAgents ?? (pools.nodeHttpAgents = createNodeHttpAgents({
137125
137311
  maxSockets: BASE_AGENT_OPTIONS.connections,
137126
137312
  keepAliveMs: BASE_AGENT_OPTIONS.keepAliveTimeout
137127
137313
  }));
137128
- return _nodeHttpAgents;
137314
+ return pools.nodeHttpAgents;
137129
137315
  }
137130
137316
  function getDispatcher(config2) {
137131
137317
  return resolveDispatcher(config2, getDefaultDispatcher);
@@ -137165,42 +137351,45 @@ function createStreamDispatcher(retryOptions, agentOverrides) {
137165
137351
  return new undiciExports.RetryAgent(new undiciExports.Agent({ ...STREAM_AGENT_OPTIONS, ...agentOverrides }), retryOptions);
137166
137352
  }
137167
137353
  function getDefaultDispatcher() {
137168
- _dispatcher ?? (_dispatcher = makeRetryDispatcher(DEFAULT_AGENT_OPTIONS, RETRY_AGENT_OPTIONS));
137169
- return _dispatcher;
137354
+ pools.dispatcher ?? (pools.dispatcher = makeRetryDispatcher(DEFAULT_AGENT_OPTIONS, RETRY_AGENT_OPTIONS));
137355
+ return pools.dispatcher;
137170
137356
  }
137171
137357
  function getDefaultStreamDispatcher() {
137172
- _streamDispatcher ?? (_streamDispatcher = createStreamDispatcher(STREAM_RETRY_OPTIONS));
137173
- return _streamDispatcher;
137358
+ pools.streamDispatcher ?? (pools.streamDispatcher = createStreamDispatcher(STREAM_RETRY_OPTIONS));
137359
+ return pools.streamDispatcher;
137174
137360
  }
137175
137361
  function getDefaultStreamCloseDispatcher() {
137176
- _streamCloseDispatcher ?? (_streamCloseDispatcher = createStreamDispatcher(STREAM_CLOSE_RETRY_OPTIONS));
137177
- return _streamCloseDispatcher;
137362
+ pools.streamCloseDispatcher ?? (pools.streamCloseDispatcher = createStreamDispatcher(STREAM_CLOSE_RETRY_OPTIONS));
137363
+ return pools.streamCloseDispatcher;
137178
137364
  }
137179
- let otelApiPromise$1 = null;
137365
+ const otel = globalSingleton("@workflow/world-vercel//telemetry", 1, () => ({
137366
+ // Lazy load OpenTelemetry API to make it optional
137367
+ apiPromise: null,
137368
+ tracerPromise: null
137369
+ }));
137180
137370
  async function getOtelApi$1() {
137181
- if (!otelApiPromise$1) {
137182
- otelApiPromise$1 = import("./index-CETb4fkq.js").catch((error2) => {
137371
+ if (!otel.apiPromise) {
137372
+ otel.apiPromise = import("./index-CETb4fkq.js").catch((error2) => {
137183
137373
  if (typeof process !== "undefined" && typeof process.env.DEBUG === "string" && (process.env.DEBUG.includes("workflow:") || process.env.DEBUG === "*")) {
137184
137374
  console.warn("[workflow] @opentelemetry/api unavailable — world-vercel spans disabled:", error2 instanceof Error ? error2.message : error2);
137185
137375
  }
137186
137376
  return null;
137187
137377
  });
137188
137378
  }
137189
- return otelApiPromise$1;
137379
+ return otel.apiPromise;
137190
137380
  }
137191
- let tracerPromise = null;
137192
137381
  function workflowDebugEnabled() {
137193
137382
  return typeof process !== "undefined" && typeof process.env.DEBUG === "string" && (process.env.DEBUG.includes("workflow:") || process.env.DEBUG === "*");
137194
137383
  }
137195
137384
  let otelDiagLogged = false;
137196
- function logOtelDiagnosticOnce(otel, tracer) {
137385
+ function logOtelDiagnosticOnce(otel2, tracer) {
137197
137386
  var _a3, _b2, _c2, _d2, _e2;
137198
137387
  if (otelDiagLogged || !workflowDebugEnabled())
137199
137388
  return;
137200
137389
  otelDiagLogged = true;
137201
137390
  try {
137202
137391
  const g2 = globalThis[Symbol.for("opentelemetry.js.api.1")];
137203
- const provider = otel.trace.getTracerProvider();
137392
+ const provider = otel2.trace.getTracerProvider();
137204
137393
  const delegate = ((_a3 = provider.getDelegate) == null ? void 0 : _a3.call(provider)) ?? provider;
137205
137394
  const probe = tracer.startSpan("workflow.otel.probe.world_vercel");
137206
137395
  console.warn("[workflow:otel-diag] world-vercel", JSON.stringify({
@@ -137217,33 +137406,33 @@ function logOtelDiagnosticOnce(otel, tracer) {
137217
137406
  }
137218
137407
  }
137219
137408
  async function getTracer() {
137220
- if (!tracerPromise) {
137221
- tracerPromise = getOtelApi$1().then((otel) => {
137222
- if (!otel)
137409
+ if (!otel.tracerPromise) {
137410
+ otel.tracerPromise = getOtelApi$1().then((otelApi) => {
137411
+ if (!otelApi)
137223
137412
  return null;
137224
- const tracer = otel.trace.getTracer("workflow");
137225
- logOtelDiagnosticOnce(otel, tracer);
137413
+ const tracer = otelApi.trace.getTracer("workflow");
137414
+ logOtelDiagnosticOnce(otelApi, tracer);
137226
137415
  return tracer;
137227
137416
  });
137228
137417
  }
137229
- return tracerPromise;
137418
+ return otel.tracerPromise;
137230
137419
  }
137231
137420
  async function trace(spanName, ...args) {
137232
- const [tracer, otel] = await Promise.all([getTracer(), getOtelApi$1()]);
137421
+ const [tracer, otel2] = await Promise.all([getTracer(), getOtelApi$1()]);
137233
137422
  const { fn: fn2, opts } = typeof args[0] === "function" ? { fn: args[0], opts: {} } : { fn: args[1], opts: args[0] };
137234
137423
  if (!fn2)
137235
137424
  throw new Error("Function to trace must be provided");
137236
- if (!tracer || !otel) {
137425
+ if (!tracer || !otel2) {
137237
137426
  return await fn2();
137238
137427
  }
137239
137428
  return tracer.startActiveSpan(spanName, opts, async (span) => {
137240
137429
  try {
137241
137430
  const result = await fn2(span);
137242
- span.setStatus({ code: otel.SpanStatusCode.OK });
137431
+ span.setStatus({ code: otel2.SpanStatusCode.OK });
137243
137432
  return result;
137244
137433
  } catch (e) {
137245
137434
  span.setStatus({
137246
- code: otel.SpanStatusCode.ERROR,
137435
+ code: otel2.SpanStatusCode.ERROR,
137247
137436
  message: e.message
137248
137437
  });
137249
137438
  throw e;
@@ -137253,17 +137442,17 @@ async function trace(spanName, ...args) {
137253
137442
  });
137254
137443
  }
137255
137444
  async function getSpanKind(field) {
137256
- const otel = await getOtelApi$1();
137257
- if (!otel)
137445
+ const otel2 = await getOtelApi$1();
137446
+ if (!otel2)
137258
137447
  return void 0;
137259
- return otel.SpanKind[field];
137448
+ return otel2.SpanKind[field];
137260
137449
  }
137261
137450
  async function injectTraceContextIntoHeaders(headers2) {
137262
- const otel = await getOtelApi$1();
137263
- if (!otel)
137451
+ const otel2 = await getOtelApi$1();
137452
+ if (!otel2)
137264
137453
  return;
137265
137454
  const carrier = {};
137266
- otel.propagation.inject(otel.context.active(), carrier);
137455
+ otel2.propagation.inject(otel2.context.active(), carrier);
137267
137456
  for (const [key, value] of Object.entries(carrier)) {
137268
137457
  headers2.set(key, value);
137269
137458
  }
@@ -137300,7 +137489,8 @@ const WorkflowWsReconnectAttempt = SemanticConvention("workflow.events.ws.reconn
137300
137489
  const REQUEST_TIMEOUT_MS = 6e4;
137301
137490
  const getRequestTimeoutMs = () => envNumber("WORKFLOW_REQUEST_TIMEOUT_MS", REQUEST_TIMEOUT_MS, {
137302
137491
  integer: true,
137303
- min: 1
137492
+ min: 1e4,
137493
+ max: 12e4
137304
137494
  });
137305
137495
  const HTTP_DEBUG_ENABLED = typeof process !== "undefined" && typeof process.env.DEBUG === "string" && (process.env.DEBUG.includes("workflow:") || process.env.DEBUG === "*");
137306
137496
  const DIAGNOSTIC_HEADERS = [
@@ -137502,7 +137692,6 @@ async function instrumentedFetch(opts) {
137502
137692
  return response2;
137503
137693
  });
137504
137694
  }
137505
- const version = "5.0.0-beta.39";
137506
137695
  const IDEMPOTENT_METHODS = /* @__PURE__ */ new Set(["GET", "HEAD"]);
137507
137696
  const MAX_BODY_PARSE_RETRIES = 2;
137508
137697
  const BODY_PARSE_RETRY_BASE_MS = 100;
@@ -138127,8 +138316,10 @@ function decode(taggedUlid) {
138127
138316
  region: lookupRegion(regionId)
138128
138317
  };
138129
138318
  }
138130
- const ulid$1 = monotonicFactory();
138131
- let lastRunId;
138319
+ const runIds = globalSingleton("@workflow/world-vercel//runIdFactory", 1, () => ({
138320
+ ulid: monotonicFactory(),
138321
+ lastRunId: void 0
138322
+ }));
138132
138323
  function bumpAboveMetadata(ulidStr) {
138133
138324
  const bytes = ulidToBytes(ulidStr);
138134
138325
  let i = 5;
@@ -138156,13 +138347,13 @@ function resolveRegion$1(options) {
138156
138347
  function createRunId(options) {
138157
138348
  const region = resolveRegion$1(options);
138158
138349
  const regionId = REGION_IDS[region];
138159
- let candidate = encode(ulid$1(), regionId);
138160
- if (lastRunId !== void 0) {
138161
- while (candidate <= lastRunId) {
138162
- candidate = encode(bumpAboveMetadata(lastRunId), regionId);
138350
+ let candidate = encode(runIds.ulid(), regionId);
138351
+ if (runIds.lastRunId !== void 0) {
138352
+ while (candidate <= runIds.lastRunId) {
138353
+ candidate = encode(bumpAboveMetadata(runIds.lastRunId), regionId);
138163
138354
  }
138164
138355
  }
138165
- lastRunId = candidate;
138356
+ runIds.lastRunId = candidate;
138166
138357
  return candidate;
138167
138358
  }
138168
138359
  function regionForRunId(runId) {
@@ -138182,6 +138373,14 @@ function describeRun(run2) {
138182
138373
  return { region: regionForRunId(runId) };
138183
138374
  }
138184
138375
  const KEY_BYTES = 32;
138376
+ class RunKeyFetchError extends Error {
138377
+ constructor(message2, status) {
138378
+ super(message2);
138379
+ __publicField(this, "status");
138380
+ this.name = "RunKeyFetchError";
138381
+ this.status = status;
138382
+ }
138383
+ }
138185
138384
  async function deriveRunKey(deploymentKey, projectId, runId) {
138186
138385
  if (deploymentKey.length !== KEY_BYTES) {
138187
138386
  throw new Error(`Invalid deployment key length: expected ${KEY_BYTES} bytes for AES-256, got ${deploymentKey.length} bytes`);
@@ -138229,7 +138428,7 @@ async function fetchRunKey(deploymentId, projectId, runId, options) {
138229
138428
  } catch {
138230
138429
  body2 = "<unable to read response body>";
138231
138430
  }
138232
- return new Error(`Failed to fetch run key for ${runId} (deployment ${deploymentId}): HTTP ${res.status} ${res.statusText}${body2 ? ` — ${body2}` : ""}`);
138431
+ return new RunKeyFetchError(`Failed to fetch run key for ${runId} (deployment ${deploymentId}): HTTP ${res.status} ${res.statusText}${body2 ? ` — ${body2}` : ""}`, res.status);
138233
138432
  }
138234
138433
  });
138235
138434
  const data = await response2.json();
@@ -138277,7 +138476,7 @@ function createGetEncryptionKeyForRun(projectId, teamId, token, dispatcher2) {
138277
138476
  };
138278
138477
  }
138279
138478
  async function getDeadline() {
138280
- const { getDeadline: getDeadline2 } = await import("./index-Ck5CB_wQ.js").then((n) => n.i);
138479
+ const { getDeadline: getDeadline2 } = await import("./index-Dsr6TVhD.js").then((n) => n.i);
138281
138480
  return getDeadline2();
138282
138481
  }
138283
138482
  const WORKFLOW_SERVER_SERVICE = {
@@ -138382,8 +138581,8 @@ function instrumentObject(prefix, o) {
138382
138581
  "workflow.batch.size": events2.length,
138383
138582
  // Sorted by type, so the same batch composition always renders
138384
138583
  // the same string. Map iteration is first-seen order, which
138385
- // depends on frame order a pre-claimed fold leads with a
138386
- // pair while a pure eager fold leads with its creates and an
138584
+ // depends on frame order (a pre-claimed fold leads with a
138585
+ // pair while a pure eager fold leads with its creates), and an
138387
138586
  // unstable string is not groupable as a telemetry dimension.
138388
138587
  "workflow.batch.shape": [...counts].sort(([a2], [b2]) => a2 < b2 ? -1 : a2 > b2 ? 1 : 0).map(([type, count2]) => `${type}:${count2}`).join(",")
138389
138588
  };
@@ -142173,11 +142372,11 @@ var INJECTED_CONTEXT_HEADERS = [
142173
142372
  async function injectTraceContext(headers2, telemetry) {
142174
142373
  if (isTracePropagationDisabled()) return;
142175
142374
  if (telemetry && !telemetry.isEnabled) return;
142176
- const otel = await getOtelApi();
142177
- if (!otel) return;
142375
+ const otel2 = await getOtelApi();
142376
+ if (!otel2) return;
142178
142377
  try {
142179
142378
  const carrier = {};
142180
- otel.propagation.inject(otel.context.active(), carrier);
142379
+ otel2.propagation.inject(otel2.context.active(), carrier);
142181
142380
  for (const name2 of INJECTED_CONTEXT_HEADERS) {
142182
142381
  const value = carrier[name2];
142183
142382
  if (value !== void 0) {
@@ -142187,10 +142386,10 @@ async function injectTraceContext(headers2, telemetry) {
142187
142386
  } catch {
142188
142387
  }
142189
142388
  }
142190
- function setSpanErrorSafely(otel, span, error2) {
142389
+ function setSpanErrorSafely(otel2, span, error2) {
142191
142390
  try {
142192
142391
  span.setStatus({
142193
- code: otel.SpanStatusCode.ERROR,
142392
+ code: otel2.SpanStatusCode.ERROR,
142194
142393
  message: error2 instanceof Error ? error2.message : String(error2)
142195
142394
  });
142196
142395
  } catch {
@@ -142205,11 +142404,11 @@ function endSpanSafely(span) {
142205
142404
  async function withSendSpan(queueName, fn2, telemetry) {
142206
142405
  if (isTracePropagationDisabled()) return fn2(null);
142207
142406
  if (telemetry && !telemetry.isEnabled) return fn2(null);
142208
- const otel = await getOtelApi();
142209
- if (!otel) return fn2(null);
142407
+ const otel2 = await getOtelApi();
142408
+ if (!otel2) return fn2(null);
142210
142409
  let started = null;
142211
142410
  try {
142212
- const tracer = (telemetry == null ? void 0 : telemetry.tracer) ?? otel.trace.getTracer("@vercel/queue");
142411
+ const tracer = (telemetry == null ? void 0 : telemetry.tracer) ?? otel2.trace.getTracer("@vercel/queue");
142213
142412
  const attributes = {
142214
142413
  "messaging.system": "vercel-queue",
142215
142414
  "messaging.destination.name": queueName
@@ -142220,16 +142419,16 @@ async function withSendSpan(queueName, fn2, telemetry) {
142220
142419
  }
142221
142420
  }
142222
142421
  const span2 = tracer.startSpan("vqs.send", {
142223
- kind: otel.SpanKind.PRODUCER,
142422
+ kind: otel2.SpanKind.PRODUCER,
142224
142423
  attributes
142225
142424
  });
142226
- started = { span: span2, ctx: otel.trace.setSpan(otel.context.active(), span2) };
142425
+ started = { span: span2, ctx: otel2.trace.setSpan(otel2.context.active(), span2) };
142227
142426
  } catch {
142228
142427
  }
142229
142428
  if (!started) return fn2(null);
142230
142429
  const { span, ctx } = started;
142231
142430
  try {
142232
- return await otel.context.with(
142431
+ return await otel2.context.with(
142233
142432
  ctx,
142234
142433
  () => fn2({
142235
142434
  setMessageId(messageId) {
@@ -142241,7 +142440,7 @@ async function withSendSpan(queueName, fn2, telemetry) {
142241
142440
  })
142242
142441
  );
142243
142442
  } catch (error2) {
142244
- setSpanErrorSafely(otel, span, error2);
142443
+ setSpanErrorSafely(otel2, span, error2);
142245
142444
  throw error2;
142246
142445
  } finally {
142247
142446
  endSpanSafely(span);
@@ -142253,13 +142452,13 @@ var CONSUMER_BAGGAGE_HEADER = "x-vercel-queue-baggage";
142253
142452
  async function withConsumerSpan(headers2, fn2, telemetry) {
142254
142453
  if (isTracePropagationDisabled()) return fn2();
142255
142454
  if (telemetry && !telemetry.isEnabled) return fn2();
142256
- const otel = await getOtelApi();
142257
- if (!otel) return fn2();
142455
+ const otel2 = await getOtelApi();
142456
+ if (!otel2) return fn2();
142258
142457
  let started = null;
142259
142458
  try {
142260
142459
  const carrier = headersToCarrier(headers2);
142261
- const links = extractProducerLink(otel, carrier);
142262
- const tracer = (telemetry == null ? void 0 : telemetry.tracer) ?? otel.trace.getTracer("@vercel/queue");
142460
+ const links = extractProducerLink(otel2, carrier);
142461
+ const tracer = (telemetry == null ? void 0 : telemetry.tracer) ?? otel2.trace.getTracer("@vercel/queue");
142263
142462
  const attributes = {
142264
142463
  "messaging.system": "vercel-queue",
142265
142464
  "messaging.operation": "process"
@@ -142270,25 +142469,25 @@ async function withConsumerSpan(headers2, fn2, telemetry) {
142270
142469
  }
142271
142470
  }
142272
142471
  const span2 = tracer.startSpan("vqs.process", {
142273
- kind: otel.SpanKind.CONSUMER,
142472
+ kind: otel2.SpanKind.CONSUMER,
142274
142473
  attributes,
142275
142474
  links
142276
142475
  });
142277
- started = { span: span2, ctx: otel.trace.setSpan(otel.context.active(), span2) };
142476
+ started = { span: span2, ctx: otel2.trace.setSpan(otel2.context.active(), span2) };
142278
142477
  } catch {
142279
142478
  }
142280
142479
  if (!started) return fn2();
142281
142480
  const { span, ctx } = started;
142282
142481
  try {
142283
- return await otel.context.with(ctx, fn2);
142482
+ return await otel2.context.with(ctx, fn2);
142284
142483
  } catch (error2) {
142285
- setSpanErrorSafely(otel, span, error2);
142484
+ setSpanErrorSafely(otel2, span, error2);
142286
142485
  throw error2;
142287
142486
  } finally {
142288
142487
  endSpanSafely(span);
142289
142488
  }
142290
142489
  }
142291
- function extractProducerLink(otel, carrier) {
142490
+ function extractProducerLink(otel2, carrier) {
142292
142491
  const traceparent = carrier[CONSUMER_TRACEPARENT_HEADER];
142293
142492
  if (!traceparent) return [];
142294
142493
  const standardCarrier = { traceparent };
@@ -142296,12 +142495,12 @@ function extractProducerLink(otel, carrier) {
142296
142495
  if (tracestate) standardCarrier.tracestate = tracestate;
142297
142496
  const baggage = carrier[CONSUMER_BAGGAGE_HEADER];
142298
142497
  if (baggage) standardCarrier.baggage = baggage;
142299
- const producerCtx = otel.propagation.extract(
142300
- otel.ROOT_CONTEXT,
142498
+ const producerCtx = otel2.propagation.extract(
142499
+ otel2.ROOT_CONTEXT,
142301
142500
  standardCarrier
142302
142501
  );
142303
- const producerSpanContext = otel.trace.getSpanContext(producerCtx);
142304
- if (!producerSpanContext || !otel.trace.isSpanContextValid(producerSpanContext)) {
142502
+ const producerSpanContext = otel2.trace.getSpanContext(producerCtx);
142503
+ if (!producerSpanContext || !otel2.trace.isSpanContextValid(producerSpanContext)) {
142305
142504
  return [];
142306
142505
  }
142307
142506
  return [{ context: producerSpanContext }];
@@ -143116,7 +143315,12 @@ function missingDeploymentIdMessage(operation) {
143116
143315
  return `${operation} requires VERCEL_DEPLOYMENT_ID, which Vercel sets in every deployment, so this process is not running inside one. The Vercel world is only selected automatically when that variable is set, so it was requested explicitly here — most often by WORKFLOW_TARGET_WORLD=vercel in a process that is not a deployment, such as a production server started locally or in CI. To use the local filesystem world instead, set WORKFLOW_TARGET_WORLD=local or unset it.`;
143117
143316
  }
143118
143317
  function isWsEventsTransportEnabled() {
143119
- return process.env.WORKFLOW_EVENTS_TRANSPORT === "ws";
143318
+ var _a3;
143319
+ return ((_a3 = process.env.WORKFLOW_EVENTS_TRANSPORT) == null ? void 0 : _a3.trim().toLowerCase()) !== "http";
143320
+ }
143321
+ function isWsEventsTransportStrict() {
143322
+ const raw2 = process.env.WORKFLOW_INTERNAL_EVENTS_TRANSPORT_STRICT;
143323
+ return raw2 === "1" || raw2 === "true";
143120
143324
  }
143121
143325
  class CborTransport {
143122
143326
  constructor() {
@@ -143218,14 +143422,14 @@ const wsEventsChannelForInvocation = (runId, config2) => {
143218
143422
  /**
143219
143423
  * Unawaited and failure-proof: callers treat the handshake as free. The
143220
143424
  * refcount therefore rises a microtask late, so a write racing the import
143221
- * finds no channel and goes over HTTP one frame, not the invocation,
143425
+ * finds no channel and goes over HTTP: one frame, not the invocation,
143222
143426
  * since `close` awaits this same promise and so cannot release ahead of
143223
143427
  * the claim it is releasing.
143224
143428
  */
143225
143429
  open() {
143226
143430
  if (!runId || !isWsEventsTransportEnabled())
143227
143431
  return;
143228
- claim = import("./ws-transport-BCfcEhAO.js").then(({ openWsChannel }) => openWsChannel(runId, config2)).catch(() => void 0);
143432
+ claim = import("./ws-transport-DdxSF5J6.js").then(({ openWsChannel }) => openWsChannel(runId, config2)).catch(() => void 0);
143229
143433
  },
143230
143434
  /**
143231
143435
  * Awaited, unlike the open: work scheduled after the handler returns is not
@@ -143233,8 +143437,8 @@ const wsEventsChannelForInvocation = (runId, config2) => {
143233
143437
  * stops the process exiting and keeps a server invocation pinned.
143234
143438
  *
143235
143439
  * Releases the claim the open returned rather than re-resolving the run,
143236
- * which is what keeps a channel this invocation never opened a later
143237
- * invocation's, registered under the same URL after ours was evicted out
143440
+ * which is what keeps a channel this invocation never opened (a later
143441
+ * invocation's, registered under the same URL after ours was evicted) out
143238
143442
  * of reach of our release.
143239
143443
  */
143240
143444
  async close() {
@@ -143281,7 +143485,7 @@ function getHeadersFromPayload(payload) {
143281
143485
  return Object.keys(headers2).length > 0 ? headers2 : void 0;
143282
143486
  }
143283
143487
  const FLOW_TOPIC_PATTERN = /^__([a-z][a-z0-9]*_)?wkf_workflow_/;
143284
- let loggedSequentialReplays = false;
143488
+ const queueLogs = globalSingleton("@workflow/world-vercel//queueLogLatches", 1, () => ({ loggedSequentialReplays: false }));
143285
143489
  function isSequentialReplaysEnabled() {
143286
143490
  return process.env.WORKFLOW_SEQUENTIAL_REPLAYS === "1";
143287
143491
  }
@@ -143289,8 +143493,8 @@ function getPhysicalQueueName(queueName, payload) {
143289
143493
  if (!isSequentialReplaysEnabled() || !FLOW_TOPIC_PATTERN.test(queueName)) {
143290
143494
  return queueName;
143291
143495
  }
143292
- if (!loggedSequentialReplays) {
143293
- loggedSequentialReplays = true;
143496
+ if (!queueLogs.loggedSequentialReplays) {
143497
+ queueLogs.loggedSequentialReplays = true;
143294
143498
  console.warn("[workflow] WORKFLOW_SEQUENTIAL_REPLAYS=1: routing flow messages to per-run queue topics");
143295
143499
  }
143296
143500
  if ("__healthCheck" in payload && typeof payload.correlationId === "string") {
@@ -143397,7 +143601,7 @@ function createQueue$1(config2) {
143397
143601
  }, {
143398
143602
  // Without an explicit retry directive, @vercel/queue leaves failed
143399
143603
  // handler messages invisible until the default 300s visibility timeout
143400
- // expires. Start retrying quickly, then back off by delivery count
143604
+ // expires. Start retrying after 1s, then back off by delivery count
143401
143605
  // with jitter so an outage or poison message cannot hot-loop or
143402
143606
  // redrive in lockstep. Workflow handlers are event-sourced and must
143403
143607
  // remain idempotent because queue retries can happen close together.
@@ -143527,7 +143731,7 @@ const EVENT_RETRY_ELIGIBILITY = {
143527
143731
  retryable: true,
143528
143732
  reason: "correlationId constraint reuses eventId (idempotent replay)"
143529
143733
  },
143530
- // NOT safe to retry see the module comment.
143734
+ // NOT safe to retry; see the module comment.
143531
143735
  step_started: {
143532
143736
  retryable: false,
143533
143737
  reason: "unconditional attempt increment → a retry double-counts attempts"
@@ -143544,6 +143748,12 @@ const EVENT_RETRY_ELIGIBILITY = {
143544
143748
  hook_conflict: {
143545
143749
  retryable: false,
143546
143750
  reason: "server-originated; never POSTed by the SDK"
143751
+ },
143752
+ // Server-originated sealed-log filler (specVersion 7); the SDK never
143753
+ // POSTs it. The server's read path writes it to seal an abandoned slot.
143754
+ noop: {
143755
+ retryable: false,
143756
+ reason: "server-originated; never POSTed by the SDK"
143547
143757
  }
143548
143758
  };
143549
143759
  const MAX_EVENT_POST_RETRIES = 2;
@@ -143568,11 +143778,11 @@ const TRANSIENT_CODES = /* @__PURE__ */ new Set([
143568
143778
  "UND_ERR_BODY_TIMEOUT",
143569
143779
  // Names (undici/Node surface these on the error or its cause).
143570
143780
  // `TimeoutError` is our own per-request deadline (`AbortSignal.timeout` in
143571
- // makeRequest) a genuinely ambiguous failure worth retrying. We deliberately
143781
+ // makeRequest), a genuinely ambiguous failure worth retrying. We deliberately
143572
143782
  // do NOT include `AbortError`: that is how an external/caller-supplied
143573
143783
  // cancellation surfaces (makeRequest composes the caller's signal via
143574
- // `AbortSignal.any`), and re-issuing a write the caller asked to cancel
143575
- // stalling the abort by the full backoff budget would be wrong.
143784
+ // `AbortSignal.any`), and re-issuing a write the caller asked to cancel
143785
+ // (stalling the abort by the full backoff budget) would be wrong.
143576
143786
  "TimeoutError",
143577
143787
  "RequestRetryError"
143578
143788
  ]);
@@ -143924,7 +144134,7 @@ async function fetchV4(url2, init2, config2, opName, attributes) {
143924
144134
  // Repeated transport failures retire the shared events pool and the next
143925
144135
  // request builds a fresh one. undici keeps a black-holed HTTP/2 session in
143926
144136
  // service indefinitely, so without this every request routed onto it fails
143927
- // until the compute instance is recycled see noteEventsTransportOutcome.
144137
+ // until the compute instance is recycled. See noteEventsTransportOutcome.
143928
144138
  onTransportOutcome: (error2) => noteEventsTransportOutcome(dispatcher2, error2),
143929
144139
  timeoutMs: null,
143930
144140
  logLabel: opName,
@@ -143988,7 +144198,10 @@ const CreateEventV4BodySchemas = {
143988
144198
  hook_disposed: CreateEventV4BodySchema,
143989
144199
  hook_conflict: CreateEventV4BodySchema,
143990
144200
  wait_created: CreateEventV4BodySchema,
143991
- wait_completed: CreateEventV4BodySchema
144201
+ wait_completed: CreateEventV4BodySchema,
144202
+ // Never POSTed by the SDK (server-originated sealed-log filler); present
144203
+ // only because the map is exhaustive over EventType.
144204
+ noop: CreateEventV4BodySchema
143992
144205
  };
143993
144206
  const MaxEventsHeaderSchema = number$2().int().positive();
143994
144207
  const EventStreamEndSchema = object$1({
@@ -144219,11 +144432,20 @@ async function postWorkflowRunEventV4(input, responseType, config2) {
144219
144432
  ...input.optimizations !== void 0 ? StepLatencyOptimizations(input.optimizations) : {}
144220
144433
  });
144221
144434
  }
144435
+ const STRICT_WS_EVENT_TYPES = /* @__PURE__ */ new Set(["step_completed"]);
144436
+ function assertWsFallbackAllowed(eventType) {
144437
+ if (!isWsEventsTransportStrict())
144438
+ return;
144439
+ if (!STRICT_WS_EVENT_TYPES.has(eventType))
144440
+ return;
144441
+ throw new Error(`world-vercel: ${eventType} fell back to the HTTP events transport while the WS gate was on. WORKFLOW_INTERNAL_EVENTS_TRANSPORT_STRICT is set, so this is a failure rather than a silent demotion: no channel was resolvable for this run at write time.`);
144442
+ }
144222
144443
  async function createWorkflowRunEventV4(input, config2) {
144223
144444
  if (isWsEventsTransportEnabled()) {
144224
144445
  const reply = await postEventFrameOverWs(input, config2);
144225
144446
  if (reply)
144226
144447
  return decodeCreateEventResponse(reply, input.eventType);
144448
+ assertWsFallbackAllowed(input.eventType);
144227
144449
  }
144228
144450
  const response2 = await postWorkflowRunEventV4(input, "materialized", config2);
144229
144451
  const contentType = response2.headers.get("content-type");
@@ -144329,7 +144551,7 @@ function wsReplyStatus(reply, endpoint) {
144329
144551
  return status;
144330
144552
  }
144331
144553
  async function postEventFrameOverWs(input, config2) {
144332
- const { resolveWsTransport } = await import("./ws-transport-BCfcEhAO.js");
144554
+ const { resolveWsTransport } = await import("./ws-transport-DdxSF5J6.js");
144333
144555
  const { runId } = input;
144334
144556
  const resolved = resolveWsTransport(runId, config2);
144335
144557
  if (!resolved)
@@ -144568,25 +144790,70 @@ async function createWorkflowRunV1(data, config2) {
144568
144790
  }
144569
144791
  async function getWorkflowRun(id2, params, config2) {
144570
144792
  const resolveData = (params == null ? void 0 : params.resolveData) ?? DEFAULT_RESOLVE_DATA_OPTION;
144793
+ try {
144794
+ return await readRun(id2, { resolveData }, config2);
144795
+ } catch (error2) {
144796
+ if (error2 instanceof WorkflowWorldError && error2.status === 404) {
144797
+ throw new WorkflowRunNotFoundError(id2);
144798
+ }
144799
+ throw error2;
144800
+ }
144801
+ }
144802
+ async function readRun(id2, params, config2) {
144803
+ const { resolveData, waitMs, signal } = params;
144571
144804
  const remoteRefBehavior = resolveData === "none" ? "lazy" : "resolve";
144572
144805
  const searchParams = new URLSearchParams();
144573
144806
  searchParams.set("remoteRefBehavior", remoteRefBehavior);
144807
+ if (waitMs !== void 0)
144808
+ searchParams.set("waitMs", String(waitMs));
144809
+ const path2 = waitMs === void 0 ? "" : "/status";
144574
144810
  const queryString = searchParams.toString();
144575
- const endpoint = `/v2/runs/${encodeURIComponent(id2)}${queryString ? `?${queryString}` : ""}`;
144811
+ const endpoint = `/v2/runs/${encodeURIComponent(id2)}${path2}${queryString ? `?${queryString}` : ""}`;
144812
+ const run2 = await makeRequest({
144813
+ endpoint,
144814
+ options: { method: "GET", ...signal ? { signal } : {} },
144815
+ config: config2,
144816
+ retryConnectTimeout: true,
144817
+ schema: remoteRefBehavior === "lazy" ? WorkflowRunWireWithRefsSchema : WorkflowRunWireSchema
144818
+ });
144819
+ return filterRunData(run2, resolveData);
144820
+ }
144821
+ const WAIT_TIMEOUT_HEADROOM_MS = 1e4;
144822
+ const LONG_POLL_UNSUPPORTED_TTL_MS = 5 * 60 * 1e3;
144823
+ const longPoll = globalSingleton("@workflow/world-vercel//runStatusLongPollSupport", 1, () => ({ unsupportedUntilByBaseUrl: /* @__PURE__ */ new Map() }));
144824
+ function isLongPollUnusable(error2) {
144825
+ if (error2.status === 404 || error2.status === 405 || error2.status === 501) {
144826
+ return true;
144827
+ }
144828
+ if (error2.status === 504)
144829
+ return true;
144830
+ return error2.status === void 0 && (error2.code === "TIMEOUT" || error2.code === "TRANSPORT");
144831
+ }
144832
+ async function waitForWorkflowRunTerminalStatus(id2, params, config2) {
144833
+ var _a3;
144834
+ const resolveData = (params == null ? void 0 : params.resolveData) ?? DEFAULT_RESOLVE_DATA_OPTION;
144835
+ const waitMs = Math.max(0, Math.min((params == null ? void 0 : params.timeoutMs) ?? 0, getRequestTimeoutMs() - WAIT_TIMEOUT_HEADROOM_MS));
144836
+ const { baseUrl } = getHttpUrl(config2);
144837
+ const unsupportedUntil = longPoll.unsupportedUntilByBaseUrl.get(baseUrl) ?? 0;
144838
+ if (waitMs === 0 || Date.now() < unsupportedUntil) {
144839
+ return getWorkflowRun(id2, { resolveData }, config2);
144840
+ }
144576
144841
  try {
144577
- const run2 = await makeRequest({
144578
- endpoint,
144579
- options: { method: "GET" },
144580
- config: config2,
144581
- retryConnectTimeout: true,
144582
- schema: remoteRefBehavior === "lazy" ? WorkflowRunWireWithRefsSchema : WorkflowRunWireSchema
144583
- });
144584
- return filterRunData(run2, resolveData);
144842
+ return await readRun(id2, {
144843
+ resolveData,
144844
+ waitMs,
144845
+ ...(params == null ? void 0 : params.signal) ? { signal: params.signal } : {}
144846
+ }, config2);
144585
144847
  } catch (error2) {
144586
- if (error2 instanceof WorkflowWorldError && error2.status === 404) {
144587
- throw new WorkflowRunNotFoundError(id2);
144848
+ if ((_a3 = params == null ? void 0 : params.signal) == null ? void 0 : _a3.aborted) {
144849
+ throw error2;
144588
144850
  }
144589
- throw error2;
144851
+ if (!(error2 instanceof WorkflowWorldError) || !isLongPollUnusable(error2)) {
144852
+ throw error2;
144853
+ }
144854
+ const run2 = await getWorkflowRun(id2, { resolveData }, config2);
144855
+ longPoll.unsupportedUntilByBaseUrl.set(baseUrl, Date.now() + LONG_POLL_UNSUPPORTED_TTL_MS);
144856
+ return run2;
144590
144857
  }
144591
144858
  }
144592
144859
  async function getWorkflowRuns(ids, params, config2) {
@@ -144627,20 +144894,20 @@ async function cancelWorkflowRunV1(id2, params, config2) {
144627
144894
  }
144628
144895
  }
144629
144896
  async function cancelWorkflowRuns(request2, config2) {
144630
- const { runIds, cancelReason } = BulkCancelWorkflowRunsRequestSchema.parse(request2);
144897
+ const { runIds: runIds2, cancelReason } = BulkCancelWorkflowRunsRequestSchema.parse(request2);
144631
144898
  const response2 = await makeRequest({
144632
144899
  endpoint: "/v4/runs/cancel",
144633
144900
  options: { method: "POST" },
144634
- data: cancelReason !== void 0 ? { runIds, cancelReason } : { runIds },
144901
+ data: cancelReason !== void 0 ? { runIds: runIds2, cancelReason } : { runIds: runIds2 },
144635
144902
  config: config2,
144636
144903
  schema: BulkCancelWorkflowRunsResultSchema
144637
144904
  });
144638
144905
  const resultByRunId = new Map(response2.results.map((result) => [result.runId, result]));
144639
- const isBijection = resultByRunId.size === response2.results.length && response2.results.length === runIds.length && runIds.every((runId) => resultByRunId.has(runId));
144906
+ const isBijection = resultByRunId.size === response2.results.length && response2.results.length === runIds2.length && runIds2.every((runId) => resultByRunId.has(runId));
144640
144907
  if (!isBijection) {
144641
- throw new WorkflowWorldError(`Bulk cancel response did not contain exactly one result per requested run ID (requested ${runIds.length}, received ${response2.results.length}).`);
144908
+ throw new WorkflowWorldError(`Bulk cancel response did not contain exactly one result per requested run ID (requested ${runIds2.length}, received ${response2.results.length}).`);
144642
144909
  }
144643
- const orderedResults = runIds.map((runId) => resultByRunId.get(runId));
144910
+ const orderedResults = runIds2.map((runId) => resultByRunId.get(runId));
144644
144911
  return { summary: response2.summary, results: orderedResults };
144645
144912
  }
144646
144913
  const ExperimentalSetAttributesResponseSchema = object$1({
@@ -144817,15 +145084,15 @@ async function createWorkflowRunEventBatch(runId, events2, params, config2) {
144817
145084
  // Under slot identity this is the source of the durable createdAt, so
144818
145085
  // the caller's logical time is what every replay observes.
144819
145086
  occurredAt: occurredAt ?? /* @__PURE__ */ new Date(),
144820
- // Per-event compute attribution (pre-claimed inline starts) rides the
145087
+ // Per-event compute attribution (pre-claimed inline starts); rides the
144821
145088
  // frame meta exactly like the single POST's CreateEventParams field.
144822
145089
  ...computeInstanceId !== void 0 ? { computeInstanceId } : {},
144823
- // Batch responses carry entities for bookkeeping, not payload reads
145090
+ // Batch responses carry entities for bookkeeping, not payload reads, so
144824
145091
  // default to lazy refs unless the caller explicitly asks for resolved
144825
145092
  // data (the same `resolveData` mapping the read paths use).
144826
145093
  remoteRefBehavior: (params == null ? void 0 : params.resolveData) === "all" ? "resolve" : "lazy",
144827
145094
  // Per-write request attribution, exactly like the single POST's
144828
- // `params.requestId` → `vercelId` threading stamped per frame so
145095
+ // `params.requestId` → `vercelId` threading, stamped per frame so
144829
145096
  // batched usage facts carry the same attribution.
144830
145097
  ...(params == null ? void 0 : params.requestId) ? { vercelId: params.requestId } : {},
144831
145098
  payload,
@@ -144859,7 +145126,7 @@ async function createWorkflowRunEvent(id2, data, params, config2) {
144859
145126
  const result = await withEventPostRetry(() => createWorkflowRunEventInner(id2, data, params, config2), data.eventType, {
144860
145127
  // The atomic lazy-resume shape is deduplicated server-side by the
144861
145128
  // (runId, resumeId) claim, so its POST is idempotent-on-retry even
144862
- // though plain hook_received is not see EVENT_RETRY_ELIGIBILITY.
145129
+ // though plain hook_received is not; see EVENT_RETRY_ELIGIBILITY.
144863
145130
  idempotentHookResume: data.eventType === "hook_received" && (params == null ? void 0 : params.resumeId) !== void 0 && (params == null ? void 0 : params.resumePayloadDigest) !== void 0
144864
145131
  });
144865
145132
  if (data.eventType === "run_created" && !result.run) {
@@ -144929,13 +145196,13 @@ async function createWorkflowRunEventInner(id2, data, params, config2) {
144929
145196
  // delta on the response (events/cursor/hasMore), letting the caller
144930
145197
  // skip a follow-up events.list. Outside turbo the runtime sends this on
144931
145198
  // every write, but a server may act on only some event types (or none);
144932
- // a response without a delta just means the runtime keeps its cursor
145199
+ // a response without a delta means the runtime keeps its cursor
144933
145200
  // and fetches when it next needs to.
144934
145201
  ...(params == null ? void 0 : params.sinceCursor) ? { sinceCursor: params.sinceCursor } : {},
144935
145202
  ...(params == null ? void 0 : params.resumeId) ? { resumeId: params.resumeId } : {},
144936
145203
  ...(params == null ? void 0 : params.resumePayloadDigest) ? { resumePayloadDigest: params.resumePayloadDigest } : {},
144937
- // Resilient step dispatch re-ensure marker (step_created only). Advisory
144938
- // the server MAY refuse it with 410 → RunExpiredError as
145204
+ // Resilient step dispatch re-ensure marker (step_created only).
145205
+ // Advisory: the server MAY refuse it with 410 → RunExpiredError as
144939
145206
  // defense-in-depth when it recorded a 412 rejection for this correlation
144940
145207
  // id and no step entity exists.
144941
145208
  ...(params == null ? void 0 : params.viaStepDispatch) ? { viaStepDispatch: true } : {},
@@ -145102,6 +145369,7 @@ function createStorage(config2) {
145102
145369
  // Storage interface with namespaced methods
145103
145370
  runs: {
145104
145371
  get: ((id2, params) => getWorkflowRun(id2, params, config2)),
145372
+ waitForTerminalStatus: ((id2, params) => waitForWorkflowRunTerminalStatus(id2, params, config2)),
145105
145373
  getMany: ((ids, params) => getWorkflowRuns(ids, params, config2)),
145106
145374
  list: ((params) => listWorkflowRuns(params, config2)),
145107
145375
  experimentalSetAttributes: (runId, changes, options) => experimentalSetAttributes(runId, changes, options, config2),
@@ -145268,7 +145536,7 @@ function createStreamer(config2) {
145268
145536
  url: url2.toString(),
145269
145537
  headers: httpConfig.headers,
145270
145538
  // Close is idempotent (unlike chunk appends), so its dispatcher
145271
- // retries 5xx required by the server's close-barrier protocol,
145539
+ // retries 5xx, as required by the server's close-barrier protocol,
145272
145540
  // which surfaces transient reconciliation states as retriable
145273
145541
  // 503s with the stream left durably closing.
145274
145542
  dispatcher: getStreamCloseDispatcher(config2),
@@ -145367,7 +145635,7 @@ function createWorld$1(config2) {
145367
145635
  // version that introduced slots: a bump has to move this declaration with
145368
145636
  // it, or the runtime's compatibility floor rises past the adapter shipped
145369
145637
  // alongside it and rejects it (see `assertWorldSupportsRuntimeProtocol`).
145370
- specVersion: SPEC_VERSION_CURRENT,
145638
+ specVersion: mintedSpecVersion(),
145371
145639
  capabilities: {
145372
145640
  hookRetention: { active: true },
145373
145641
  // Vercel Queues supports maxConcurrency-limited consumers, which
@@ -145377,8 +145645,8 @@ function createWorld$1(config2) {
145377
145645
  // Vercel deployments are atomic and immutable, so a deployment id names
145378
145646
  // one fixed build for its whole lifetime.
145379
145647
  deploymentAffinity: true
145380
- // NOTE: the backend half of resumeHook()'s parallel fast path that
145381
- // the server enforces the `(runId, resumeId)` dedup constraint is
145648
+ // NOTE: the backend half of resumeHook()'s parallel fast path (that
145649
+ // the server enforces the `(runId, resumeId)` dedup constraint) is
145382
145650
  // NO LONGER a static world capability here. It is attested per-lookup by
145383
145651
  // the server via `Hook.resumeCapabilities.hookResumeDedupVersion`
145384
145652
  // (response-only, recomputed every by-token read). This lets a server
@@ -145526,8 +145794,13 @@ const getWorld = async () => {
145526
145794
  };
145527
145795
  const GetWorldFnKey = Symbol.for("@workflow/world//getWorldFn");
145528
145796
  globalThis[GetWorldFnKey] ?? (globalThis[GetWorldFnKey] = getWorld);
145797
+ globalSingleton("@workflow/core//devServerPort", 1, () => ({
145798
+ getPort: void 0,
145799
+ cachedPort: void 0,
145800
+ inFlight: void 0
145801
+ }));
145529
145802
  function waitUntil(promise2) {
145530
- void import("./index-Ck5CB_wQ.js").then((n) => n.i).then(({ waitUntil: waitUntil2 }) => {
145803
+ void import("./index-Dsr6TVhD.js").then((n) => n.i).then(({ waitUntil: waitUntil2 }) => {
145531
145804
  waitUntil2(promise2);
145532
145805
  });
145533
145806
  }
@@ -145548,6 +145821,7 @@ async function waitedUntil(fn2) {
145548
145821
  }));
145549
145822
  return result;
145550
145823
  }
145824
+ globalSingleton("@workflow/core//stepSingleFlight", 1, () => ({ inFlight: /* @__PURE__ */ new Map() }));
145551
145825
  const WORKFLOW_VMS = ["node", "quickjs"];
145552
145826
  function getWorkflowVmFromEnv(env2 = process.env) {
145553
145827
  const raw2 = env2.WORKFLOW_VM;
@@ -145566,6 +145840,9 @@ for (let i = 0; i < chars.length; i++) {
145566
145840
  intToChar[i] = c;
145567
145841
  charToInt[c] = i;
145568
145842
  }
145843
+ globalSingleton("@workflow/core//sourceMapTracers", 1, () => ({
145844
+ byCode: /* @__PURE__ */ new Map()
145845
+ }));
145569
145846
  var alea$1 = { exports: {} };
145570
145847
  var alea = alea$1.exports;
145571
145848
  var hasRequiredAlea;
@@ -146243,6 +146520,9 @@ const BASE64_LOOKUP = new Uint8Array(128).fill(255);
146243
146520
  for (let i = 0; i < BASE64_CHARS.length; i++) {
146244
146521
  BASE64_LOOKUP[BASE64_CHARS.charCodeAt(i)] = i;
146245
146522
  }
146523
+ globalSingleton("@workflow/core//vmScriptCache", 1, () => ({
146524
+ byCode: /* @__PURE__ */ new Map()
146525
+ }));
146246
146526
  var re = { exports: {} };
146247
146527
  var constants;
146248
146528
  var hasRequiredConstants;
@@ -148184,7 +148464,7 @@ const FORMAT_VERSION_TABLE = [
148184
148464
  // bump to the next beta. A too-low cutoff makes new producers write
148185
148465
  // compressed payloads to consumers that cannot decompress them; too-high
148186
148466
  // merely delays the optimization (safe). gzip and zstd ship together, so
148187
- // they share a min version a run that can read one can read both.
148467
+ // they share a min version: a run that can read one can read both.
148188
148468
  { format: SerializationFormat$1.GZIP, minVersion: "5.0.0-beta.18" },
148189
148469
  { format: SerializationFormat$1.ZSTD, minVersion: "5.0.0-beta.18" },
148190
148470
  // TODO(release): verify this matches the actual version that ships sealed-box
@@ -148555,7 +148835,7 @@ function resolveLineageAttributes() {
148555
148835
  [PARENT_RUN_ID_ATTRIBUTE]: parentRunId
148556
148836
  };
148557
148837
  }
148558
- let hasWarnedLatestNoOp = false;
148838
+ const latestNoOpWarning = globalSingleton("@workflow/core//latestNoOpWarning", 1, () => ({ warned: false }));
148559
148839
  async function start$1(workflow, argsOrOptions, options) {
148560
148840
  "use step";
148561
148841
  return await waitedUntil(() => {
@@ -148588,8 +148868,8 @@ async function start$1(workflow, argsOrOptions, options) {
148588
148868
  if (world.resolveLatestDeploymentId) {
148589
148869
  deploymentId = await world.resolveLatestDeploymentId();
148590
148870
  } else {
148591
- if (!hasWarnedLatestNoOp) {
148592
- hasWarnedLatestNoOp = true;
148871
+ if (!latestNoOpWarning.warned) {
148872
+ latestNoOpWarning.warned = true;
148593
148873
  runtimeLogger.warn("deploymentId: 'latest' has no effect in this world and was ignored. It is only supported by worlds with atomic deployments, such as Vercel. The run will target the current deployment.", { currentDeploymentId });
148594
148874
  }
148595
148875
  deploymentId = currentDeploymentId;
@@ -148678,7 +148958,7 @@ async function start$1(workflow, argsOrOptions, options) {
148678
148958
  // resumeContext by the server) to decide whether the parallel fast
148679
148959
  // path is safe. For a cross-deployment start the consumer is the
148680
148960
  // target deployment, so we stamp the *target's* value carried back on
148681
- // the health-check probe never the caller's. Omitted when we could
148961
+ // the health-check probe, never the caller's. Omitted when we could
148682
148962
  // not attest the target (older target, timeout, or no probe channel),
148683
148963
  // which fails the resume gate closed to the sequential path.
148684
148964
  ...targetHookResumeInputVersion !== void 0 ? { hookResumeInputVersion: targetHookResumeInputVersion } : {},
@@ -148797,30 +149077,30 @@ async function cancelRun$2(world, runId, options) {
148797
149077
  }
148798
149078
  }
148799
149079
  const CANCEL_RUNS_FALLBACK_CONCURRENCY = 20;
148800
- async function cancelRuns(world, runIds, options) {
148801
- if (runIds.length === 0) {
149080
+ async function cancelRuns(world, runIds2, options) {
149081
+ if (runIds2.length === 0) {
148802
149082
  throw new Error("cancelRuns requires at least one run ID.");
148803
149083
  }
148804
- if (runIds.length > BULK_CANCEL_MAX_RUN_IDS) {
148805
- throw new Error(`cancelRuns accepts at most ${BULK_CANCEL_MAX_RUN_IDS} run IDs (received ${runIds.length}).`);
149084
+ if (runIds2.length > BULK_CANCEL_MAX_RUN_IDS) {
149085
+ throw new Error(`cancelRuns accepts at most ${BULK_CANCEL_MAX_RUN_IDS} run IDs (received ${runIds2.length}).`);
148806
149086
  }
148807
- if (new Set(runIds).size !== runIds.length) {
149087
+ if (new Set(runIds2).size !== runIds2.length) {
148808
149088
  throw new Error("cancelRuns requires unique run IDs (duplicates found).");
148809
149089
  }
148810
149090
  if (world.runs.cancelMany) {
148811
149091
  return world.runs.cancelMany({
148812
- runIds,
149092
+ runIds: runIds2,
148813
149093
  ...{}
148814
149094
  });
148815
149095
  }
148816
- const results = new Array(runIds.length);
149096
+ const results = new Array(runIds2.length);
148817
149097
  let nextIndex = 0;
148818
149098
  const worker = async () => {
148819
149099
  while (true) {
148820
149100
  const index2 = nextIndex++;
148821
- if (index2 >= runIds.length)
149101
+ if (index2 >= runIds2.length)
148822
149102
  return;
148823
- const runId = runIds[index2];
149103
+ const runId = runIds2[index2];
148824
149104
  try {
148825
149105
  await cancelRun$2(world, runId, options);
148826
149106
  results[index2] = { runId, outcome: "cancelled" };
@@ -148834,10 +149114,10 @@ async function cancelRuns(world, runIds, options) {
148834
149114
  }
148835
149115
  }
148836
149116
  };
148837
- const workerCount = Math.min(CANCEL_RUNS_FALLBACK_CONCURRENCY, runIds.length);
149117
+ const workerCount = Math.min(CANCEL_RUNS_FALLBACK_CONCURRENCY, runIds2.length);
148838
149118
  await Promise.all(Array.from({ length: workerCount }, () => worker()));
148839
149119
  const summary = {
148840
- requested: runIds.length,
149120
+ requested: runIds2.length,
148841
149121
  cancelled: 0,
148842
149122
  alreadyCancelled: 0,
148843
149123
  notCancellable: 0,
@@ -148954,6 +149234,20 @@ const PAYLOAD_TERMINAL_RUN_STATUSES = /* @__PURE__ */ new Set([
148954
149234
  function getReturnValuePollIntervalMs() {
148955
149235
  return envNumber("WORKFLOW_RETURN_VALUE_POLL_INTERVAL_MS", RETURN_VALUE_POLL_INTERVAL_MS, { integer: true, min: 1 });
148956
149236
  }
149237
+ const RETURN_VALUE_WAIT_TIMEOUT_MS = 5e4;
149238
+ function getReturnValueWaitTimeoutMs() {
149239
+ return envNumber("WORKFLOW_RETURN_VALUE_WAIT_MS", RETURN_VALUE_WAIT_TIMEOUT_MS, { integer: true, min: 1 });
149240
+ }
149241
+ const RETURN_VALUE_MAX_LONG_POLLS = 10;
149242
+ function getReturnValueMaxLongPolls() {
149243
+ return envNumber("WORKFLOW_RETURN_VALUE_MAX_LONG_POLLS", RETURN_VALUE_MAX_LONG_POLLS, { integer: true, min: 1 });
149244
+ }
149245
+ function isReturnValueLongPollEnabled() {
149246
+ const raw2 = process.env.WORKFLOW_RETURN_VALUE_LONG_POLL;
149247
+ if (raw2 === void 0 || raw2 === "")
149248
+ return true;
149249
+ return !(raw2 === "0" || raw2.toLowerCase() === "false");
149250
+ }
148957
149251
  const _Run = class _Run {
148958
149252
  constructor(runId, opts) {
148959
149253
  __privateAdd(this, _Run_instances);
@@ -149037,7 +149331,7 @@ const _Run = class _Run {
149037
149331
  }
149038
149332
  /**
149039
149333
  * The return value of the workflow run.
149040
- * Polls the workflow return value until it is completed.
149334
+ * Polls the workflow return value until the workflow run completes.
149041
149335
  */
149042
149336
  get returnValue() {
149043
149337
  "use step";
@@ -149170,13 +149464,24 @@ resolveTerminalReturnValue_fn = async function(run2) {
149170
149464
  throw new WorkflowRunNotCompletedError(this.runId, run2.status);
149171
149465
  };
149172
149466
  pollReturnValue_fn = async function() {
149467
+ var _a3;
149173
149468
  const world = await __privateGet(this, _Run_instances, lazyWorldPromise_get);
149174
149469
  let notFoundRetries = 0;
149175
149470
  const NOT_FOUND_MAX_RETRIES = __privateGet(this, _resilientStart) ? 3 : 0;
149176
149471
  const NOT_FOUND_DELAYS = [1e3, 3e3, 6e3];
149472
+ const waitForTerminalStatus = isReturnValueLongPollEnabled() ? (_a3 = world.runs.waitForTerminalStatus) == null ? void 0 : _a3.bind(world.runs) : void 0;
149473
+ let longPolls = 0;
149474
+ const maxLongPolls = getReturnValueMaxLongPolls();
149177
149475
  while (true) {
149476
+ const iterationStartedAt = Date.now();
149178
149477
  try {
149179
- const runMetadata = await world.runs.get(this.runId, {
149478
+ const useLongPoll = waitForTerminalStatus && longPolls < maxLongPolls;
149479
+ if (useLongPoll)
149480
+ longPolls++;
149481
+ const runMetadata = useLongPoll ? await waitForTerminalStatus(this.runId, {
149482
+ timeoutMs: getReturnValueWaitTimeoutMs(),
149483
+ resolveData: "none"
149484
+ }) : await world.runs.get(this.runId, {
149180
149485
  resolveData: "none"
149181
149486
  });
149182
149487
  if (runMetadata.status === "cancelled") {
@@ -149191,7 +149496,10 @@ pollReturnValue_fn = async function() {
149191
149496
  throw new WorkflowRunNotCompletedError(this.runId, runMetadata.status);
149192
149497
  } catch (error2) {
149193
149498
  if (WorkflowRunNotCompletedError.is(error2)) {
149194
- await new Promise((resolve2) => setTimeout(resolve2, getReturnValuePollIntervalMs()));
149499
+ const remainingIntervalMs = getReturnValuePollIntervalMs() - (Date.now() - iterationStartedAt);
149500
+ if (remainingIntervalMs > 0) {
149501
+ await new Promise((resolve2) => setTimeout(resolve2, remainingIntervalMs));
149502
+ }
149195
149503
  continue;
149196
149504
  }
149197
149505
  if (WorkflowRunNotFoundError.is(error2) && notFoundRetries < NOT_FOUND_MAX_RETRIES) {
@@ -149931,16 +150239,16 @@ async function cancelRun$1(worldEnv, runId) {
149931
150239
  });
149932
150240
  }
149933
150241
  }
149934
- async function bulkCancelRuns$1(worldEnv, runIds) {
150242
+ async function bulkCancelRuns$1(worldEnv, runIds2) {
149935
150243
  try {
149936
150244
  const world = await getWorldFromEnv(worldEnv);
149937
- const result = await cancelRuns(world, runIds);
150245
+ const result = await cancelRuns(world, runIds2);
149938
150246
  return createResponse(result);
149939
150247
  } catch (error2) {
149940
150248
  return createServerActionError(
149941
150249
  error2,
149942
150250
  "world.runs.cancelMany",
149943
- { runIdCount: runIds.length }
150251
+ { runIdCount: runIds2.length }
149944
150252
  );
149945
150253
  }
149946
150254
  }
@@ -155955,8 +156263,8 @@ function useWorkflowStreams(env2, runId, refreshInterval = STREAMS_REFRESH_INTER
155955
156263
  async function cancelRun(env2, runId) {
155956
156264
  await unwrapOrThrow(cancelRun$3(env2, runId));
155957
156265
  }
155958
- async function bulkCancelRuns(env2, runIds) {
155959
- return unwrapOrThrow(bulkCancelRuns$2(env2, runIds));
156266
+ async function bulkCancelRuns(env2, runIds2) {
156267
+ return unwrapOrThrow(bulkCancelRuns$2(env2, runIds2));
155960
156268
  }
155961
156269
  async function recreateRun(env2, runId) {
155962
156270
  return unwrapOrThrow(recreateRun$2(env2, runId));
@@ -172416,7 +172724,7 @@ const route4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
172416
172724
  __proto__: null,
172417
172725
  loader
172418
172726
  }, Symbol.toStringTag, { value: "Module" }));
172419
- const serverManifest = { "entry": { "module": "/assets/entry.client-LwI3HNYl.js", "imports": ["/assets/index-PFjW8YjQ.js"], "css": [] }, "routes": { "root": { "id": "root", "parentId": void 0, "path": "", "index": void 0, "caseSensitive": void 0, "hasAction": true, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": true, "module": "/assets/root-BfhMCbkz.js", "imports": ["/assets/index-PFjW8YjQ.js", "/assets/mermaid-3ZIDBTTL-gEw-Ch1C.js", "/assets/loader-circle-BOxaTUjK.js", "/assets/arrow-up-right-D39pnGsD.js"], "css": ["/assets/root-Bl5xphvU.css", "/assets/mermaid-3ZIDBTTL-D8CjRQta.css"], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/home": { "id": "routes/home", "parentId": "root", "path": void 0, "index": true, "caseSensitive": void 0, "hasAction": false, "hasLoader": false, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": false, "module": "/assets/home-C6CuMqQu.js", "imports": ["/assets/index-PFjW8YjQ.js", "/assets/workflow-graph-viewer-CxrWityD.js", "/assets/mermaid-3ZIDBTTL-gEw-Ch1C.js", "/assets/loader-circle-BOxaTUjK.js"], "css": ["/assets/workflow-graph-viewer-DnlNuQQH.css", "/assets/mermaid-3ZIDBTTL-D8CjRQta.css"], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/run-detail": { "id": "routes/run-detail", "parentId": "root", "path": "run/:runId", "index": void 0, "caseSensitive": void 0, "hasAction": false, "hasLoader": false, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": false, "module": "/assets/run-detail-BG_1K2Hq.js", "imports": ["/assets/index-PFjW8YjQ.js", "/assets/workflow-graph-viewer-CxrWityD.js", "/assets/mermaid-3ZIDBTTL-gEw-Ch1C.js", "/assets/arrow-up-right-D39pnGsD.js"], "css": ["/assets/run-detail-CWoGxu_0.css", "/assets/workflow-graph-viewer-DnlNuQQH.css", "/assets/mermaid-3ZIDBTTL-D8CjRQta.css"], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/api.rpc": { "id": "routes/api.rpc", "parentId": "root", "path": "api/rpc", "index": void 0, "caseSensitive": void 0, "hasAction": true, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": false, "hasErrorBoundary": false, "module": "/assets/api.rpc-l0sNRNKZ.js", "imports": [], "css": [], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/api.stream.$streamId": { "id": "routes/api.stream.$streamId", "parentId": "root", "path": "api/stream/:streamId", "index": void 0, "caseSensitive": void 0, "hasAction": false, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": false, "hasErrorBoundary": false, "module": "/assets/api.stream._streamId-l0sNRNKZ.js", "imports": [], "css": [], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 } }, "url": "/assets/manifest-157e28f1.js", "version": "157e28f1", "sri": void 0 };
172727
+ const serverManifest = { "entry": { "module": "/assets/entry.client-LwI3HNYl.js", "imports": ["/assets/index-PFjW8YjQ.js"], "css": [] }, "routes": { "root": { "id": "root", "parentId": void 0, "path": "", "index": void 0, "caseSensitive": void 0, "hasAction": true, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": true, "module": "/assets/root-e8qlLJiK.js", "imports": ["/assets/index-PFjW8YjQ.js", "/assets/mermaid-3ZIDBTTL-CrfHaTou.js", "/assets/loader-circle-abAcDEYl.js", "/assets/arrow-up-right-AtCpRI70.js"], "css": ["/assets/root-Bl5xphvU.css", "/assets/mermaid-3ZIDBTTL-D8CjRQta.css"], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/home": { "id": "routes/home", "parentId": "root", "path": void 0, "index": true, "caseSensitive": void 0, "hasAction": false, "hasLoader": false, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": false, "module": "/assets/home-BMHSjdeg.js", "imports": ["/assets/index-PFjW8YjQ.js", "/assets/workflow-graph-viewer-CFAXloBw.js", "/assets/mermaid-3ZIDBTTL-CrfHaTou.js", "/assets/loader-circle-abAcDEYl.js"], "css": ["/assets/workflow-graph-viewer-DnlNuQQH.css", "/assets/mermaid-3ZIDBTTL-D8CjRQta.css"], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/run-detail": { "id": "routes/run-detail", "parentId": "root", "path": "run/:runId", "index": void 0, "caseSensitive": void 0, "hasAction": false, "hasLoader": false, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": false, "module": "/assets/run-detail-CrWq-9Tk.js", "imports": ["/assets/index-PFjW8YjQ.js", "/assets/workflow-graph-viewer-CFAXloBw.js", "/assets/mermaid-3ZIDBTTL-CrfHaTou.js", "/assets/arrow-up-right-AtCpRI70.js"], "css": ["/assets/run-detail-CWoGxu_0.css", "/assets/workflow-graph-viewer-DnlNuQQH.css", "/assets/mermaid-3ZIDBTTL-D8CjRQta.css"], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/api.rpc": { "id": "routes/api.rpc", "parentId": "root", "path": "api/rpc", "index": void 0, "caseSensitive": void 0, "hasAction": true, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": false, "hasErrorBoundary": false, "module": "/assets/api.rpc-l0sNRNKZ.js", "imports": [], "css": [], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/api.stream.$streamId": { "id": "routes/api.stream.$streamId", "parentId": "root", "path": "api/stream/:streamId", "index": void 0, "caseSensitive": void 0, "hasAction": false, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": false, "hasErrorBoundary": false, "module": "/assets/api.stream._streamId-l0sNRNKZ.js", "imports": [], "css": [], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 } }, "url": "/assets/manifest-a9a8ec99.js", "version": "a9a8ec99", "sri": void 0 };
172420
172728
  const assetsBuildDirectory = "build/client";
172421
172729
  const basename = "/";
172422
172730
  const future = { "unstable_optimizeDeps": false, "unstable_subResourceIntegrity": false, "unstable_trailingSlashAwareDataRequests": false, "unstable_previewServerPrerendering": false, "v8_middleware": false, "v8_splitRouteModules": false, "v8_viteEnvironmentApi": false };
@@ -172625,7 +172933,7 @@ function createFetchHandler(basename2 = "/") {
172625
172933
  return (request2) => handler(request2, loadContext);
172626
172934
  }
172627
172935
  export {
172628
- SPEC_VERSION_SUPPORTS_COMPRESSION as $,
172936
+ SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT as $,
172629
172937
  ANALYTICS_EVENTS_GET_MANY_LIMIT as A,
172630
172938
  BULK_CANCEL_MAX_RUN_IDS as B,
172631
172939
  CHILD_ENTITY_CREATION_EVENT_TYPES as C,
@@ -172648,94 +172956,100 @@ export {
172648
172956
  RESERVED_ATTRIBUTE_KEY_PREFIX as T,
172649
172957
  ROOT_RUN_ID_ATTRIBUTE as U,
172650
172958
  RunInputSchema as V,
172651
- SPEC_VERSION_CURRENT as W,
172652
- SPEC_VERSION_LEGACY as X,
172653
- SPEC_VERSION_MAX_SUPPORTED as Y,
172654
- SPEC_VERSION_SUPPORTS_ATTRIBUTES as Z,
172655
- SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT as _,
172959
+ SEALED_LOG_ENV_VAR as W,
172960
+ SPEC_VERSION_CURRENT as X,
172961
+ SPEC_VERSION_LEGACY as Y,
172962
+ SPEC_VERSION_MAX_SUPPORTED as Z,
172963
+ SPEC_VERSION_SUPPORTS_ATTRIBUTES as _,
172656
172964
  ATTRIBUTE_KEY_MAX_LENGTH as a,
172657
- getHttpUrl as a$,
172658
- SPEC_VERSION_SUPPORTS_SLOT_IDENTITY as a0,
172659
- STEP_EVENT_TYPES as a1,
172660
- SerializedDataSchema as a2,
172661
- StepSchema as a3,
172662
- StepStatusSchema as a4,
172663
- StructuredErrorSchema as a5,
172664
- TERMINAL_RUN_EVENT_TYPES as a6,
172665
- TERMINAL_STEP_EVENT_TYPES as a7,
172666
- TERMINAL_STEP_STATUSES as a8,
172667
- TERMINAL_WORKFLOW_RUN_STATUSES as a9,
172668
- isSlotBody as aA,
172669
- isSlotEventId as aB,
172670
- isStepEventType as aC,
172671
- isTerminalRunEventType as aD,
172672
- isTerminalStepEventType as aE,
172673
- isTerminalStepStatus as aF,
172674
- isTerminalWorkflowRunStatus as aG,
172675
- isWaitEventType as aH,
172676
- parseQueueName as aI,
172677
- reenqueueActiveRuns as aJ,
172678
- requiresNewerWorld as aK,
172679
- resolveQueueNamespace as aL,
172680
- slotToEventId as aM,
172681
- stripEventDataRefs as aN,
172682
- ulidToDate as aO,
172683
- validateAttributeChanges as aP,
172684
- validateAttributeKey as aQ,
172685
- validateAttributeValue as aR,
172686
- validateUlidTimestamp as aS,
172687
- workflowRunIdSchema as aT,
172688
- reactExports as aU,
172689
- R as aV,
172690
- Ks as aW,
172691
- jsxRuntimeExports as aX,
172692
- Qe as aY,
172693
- registerZstdDecoder as aZ,
172694
- isWsEventsTransportEnabled as a_,
172695
- TerminalRunEventTypeSchema as aa,
172696
- TerminalStepStatusSchema as ab,
172697
- TerminalWorkflowRunStatusSchema as ac,
172698
- ValidQueueName as ad,
172699
- WAIT_EVENT_TYPES as ae,
172700
- WaitSchema as af,
172701
- WaitStatusSchema as ag,
172702
- WorkflowInvokePayloadSchema as ah,
172703
- WorkflowRunBaseSchema as ai,
172704
- WorkflowRunSchema as aj,
172705
- WorkflowRunStatusSchema as ak,
172706
- applyAttributeChanges as al,
172707
- entityEventClass as am,
172708
- envFlag as an,
172709
- envNumber as ao,
172710
- eventIdToSlot as ap,
172711
- getEventDataPayloadField as aq,
172712
- getEventDataRefFields as ar,
172713
- getMaxEventsPerRun as as,
172714
- getQueueTopicPrefix as at,
172715
- isChildEntityCreationEvent as au,
172716
- isChildEntityCreationEventType as av,
172717
- isHookEventRequiringExistence as aw,
172718
- isHookLifecycleEventType as ax,
172719
- isLegacySpecVersion as ay,
172720
- isNodeHttpEnabled as az,
172965
+ jsxRuntimeExports as a$,
172966
+ SPEC_VERSION_SUPPORTS_COMPRESSION as a0,
172967
+ SPEC_VERSION_SUPPORTS_SEALED_LOG as a1,
172968
+ SPEC_VERSION_SUPPORTS_SLOT_IDENTITY as a2,
172969
+ STEP_EVENT_TYPES as a3,
172970
+ SerializedDataSchema as a4,
172971
+ StepSchema as a5,
172972
+ StepStatusSchema as a6,
172973
+ StructuredErrorSchema as a7,
172974
+ TERMINAL_RUN_EVENT_TYPES as a8,
172975
+ TERMINAL_STEP_EVENT_TYPES as a9,
172976
+ isLegacySpecVersion as aA,
172977
+ isNodeHttpEnabled as aB,
172978
+ isSealedNoopEvent$1 as aC,
172979
+ isSlotBody as aD,
172980
+ isSlotEventId as aE,
172981
+ isStepEventType as aF,
172982
+ isTerminalRunEventType as aG,
172983
+ isTerminalStepEventType as aH,
172984
+ isTerminalStepStatus as aI,
172985
+ isTerminalWorkflowRunStatus as aJ,
172986
+ isWaitEventType as aK,
172987
+ mintedSpecVersion as aL,
172988
+ parseQueueName as aM,
172989
+ reenqueueActiveRuns as aN,
172990
+ requiresNewerWorld as aO,
172991
+ resolveQueueNamespace as aP,
172992
+ slotToEventId as aQ,
172993
+ stripEventDataRefs as aR,
172994
+ ulidToDate as aS,
172995
+ validateAttributeChanges as aT,
172996
+ validateAttributeKey as aU,
172997
+ validateAttributeValue as aV,
172998
+ validateUlidTimestamp as aW,
172999
+ workflowRunIdSchema as aX,
173000
+ reactExports as aY,
173001
+ R as aZ,
173002
+ Ks as a_,
173003
+ TERMINAL_STEP_STATUSES as aa,
173004
+ TERMINAL_WORKFLOW_RUN_STATUSES as ab,
173005
+ TerminalRunEventTypeSchema as ac,
173006
+ TerminalStepStatusSchema as ad,
173007
+ TerminalWorkflowRunStatusSchema as ae,
173008
+ ValidQueueName as af,
173009
+ WAIT_EVENT_TYPES as ag,
173010
+ WaitSchema as ah,
173011
+ WaitStatusSchema as ai,
173012
+ WorkflowInvokePayloadSchema as aj,
173013
+ WorkflowRunBaseSchema as ak,
173014
+ WorkflowRunSchema as al,
173015
+ WorkflowRunStatusSchema as am,
173016
+ applyAttributeChanges as an,
173017
+ entityEventClass as ao,
173018
+ envFlag as ap,
173019
+ envNumber as aq,
173020
+ eventIdToSlot as ar,
173021
+ getEventDataPayloadField as as,
173022
+ getEventDataRefFields as at,
173023
+ getMaxEventsPerRun as au,
173024
+ getQueueTopicPrefix as av,
173025
+ isChildEntityCreationEvent as aw,
173026
+ isChildEntityCreationEventType as ax,
173027
+ isHookEventRequiringExistence as ay,
173028
+ isHookLifecycleEventType as az,
172721
173029
  ATTRIBUTE_MAX_PER_RUN as b,
172722
- getHttpConfig as b0,
172723
- headersToRecord as b1,
172724
- getRequestTimeoutMs as b2,
172725
- injectTraceContextIntoHeaders as b3,
172726
- withHttpClientSpan as b4,
172727
- ErrorType as b5,
172728
- WorkflowWsReconnectAttempt as b6,
172729
- NetworkProtocolName as b7,
172730
- WorkflowEventsTransport as b8,
172731
- distExports as b9,
172732
- decodeFrames as ba,
172733
- getDefaultExportFromCjs as bb,
172734
- requireTokenUtil as bc,
172735
- requireTokenError as bd,
172736
- getAugmentedNamespace as be,
172737
- app as bf,
172738
- createFetchHandler as bg,
173030
+ Qe as b0,
173031
+ registerZstdDecoder as b1,
173032
+ isWsEventsTransportEnabled as b2,
173033
+ getHttpUrl as b3,
173034
+ globalSingleton as b4,
173035
+ version as b5,
173036
+ getHttpConfig as b6,
173037
+ headersToRecord as b7,
173038
+ getRequestTimeoutMs as b8,
173039
+ injectTraceContextIntoHeaders as b9,
173040
+ withHttpClientSpan as ba,
173041
+ ErrorType as bb,
173042
+ WorkflowWsReconnectAttempt as bc,
173043
+ NetworkProtocolName as bd,
173044
+ WorkflowEventsTransport as be,
173045
+ distExports as bf,
173046
+ decodeFrames as bg,
173047
+ getDefaultExportFromCjs as bh,
173048
+ requireTokenUtil as bi,
173049
+ requireTokenError as bj,
173050
+ getAugmentedNamespace as bk,
173051
+ app as bl,
173052
+ createFetchHandler as bm,
172739
173053
  ATTRIBUTE_VALUE_MAX_BYTES as c,
172740
173054
  AnalyticsAttributeKeySchema as d,
172741
173055
  AnalyticsEventSchema as e,