@workflow/web 5.0.0-beta.33 → 5.0.0-beta.34

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.
@@ -2,8 +2,8 @@ import { createRequire as __wkfCreateRequire } from "node:module";
2
2
  if (typeof require === "undefined") {
3
3
  globalThis.require = __wkfCreateRequire(import.meta.url);
4
4
  }
5
- import { N as Nt } from "./server-build-riD1HycA.js";
6
- import "./app-YT2nFLf8.js";
5
+ import { N as Nt } from "./server-build-DIxG6FRI.js";
6
+ import "./app-i2AZJqU9.js";
7
7
  import "stream";
8
8
  import "express";
9
9
  import "node:stream";
@@ -18,7 +18,7 @@ import { createRequire as __wkfCreateRequire } from "node:module";
18
18
  if (typeof require === "undefined") {
19
19
  globalThis.require = __wkfCreateRequire(import.meta.url);
20
20
  }
21
- import { a as requireReact, S as ServerRouter, c as createReadableStreamFromReadable, r as reactExports, g as getDefaultExportFromCjs, R as React, b as ReactExports, w as withComponentProps, d as withErrorBoundaryProps, M as Meta, L as Links, e as ScrollRestoration, f as Scripts, O as Outlet, u as useNavigate, h as useSearchParams, i as Link$1, j as useRouteError, k as isRouteErrorResponse, l as useLocation, m as useParams } from "./app-YT2nFLf8.js";
21
+ import { a as requireReact, S as ServerRouter, c as createReadableStreamFromReadable, r as reactExports, g as getDefaultExportFromCjs, R as React, b as ReactExports, w as withComponentProps, d as withErrorBoundaryProps, M as Meta, L as Links, e as ScrollRestoration, f as Scripts, O as Outlet, u as useNavigate, h as useSearchParams, i as Link$1, j as useRouteError, k as isRouteErrorResponse, l as useLocation, m as useParams } from "./app-i2AZJqU9.js";
22
22
  import require$$0$4, { PassThrough } from "node:stream";
23
23
  import require$$0 from "util";
24
24
  import require$$1 from "crypto";
@@ -50156,7 +50156,7 @@ function replaceEncryptedAndExpiredWithMarkers(resource) {
50156
50156
  }
50157
50157
  async function hydrateResourceIOAsync(resource, key) {
50158
50158
  const { hydrateDataWithKey: hydrateDataWithKey2 } = await Promise.resolve().then(() => serializationFormat);
50159
- const { ensureZstdDecoderRegistered } = await import("./zstd-browser-decoder-CX-ryJFu.js");
50159
+ const { ensureZstdDecoderRegistered } = await import("./zstd-browser-decoder-Do5u42Eg.js");
50160
50160
  ensureZstdDecoderRegistered();
50161
50161
  const cryptoKey = key ? await Promise.resolve().then(() => encryption).then(({ importKey: importKey2 }) => importKey2(key)) : void 0;
50162
50162
  const revivers = getRevivers();
@@ -83121,7 +83121,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
83121
83121
  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 });
83122
83122
  var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
83123
83123
  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 }) });
83124
- var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL-6aglRJd5.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
83124
+ var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL-CLwuqern.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
83125
83125
  let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
83126
83126
  `).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
83127
83127
  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 }) })] }) });
@@ -83443,7 +83443,7 @@ var Dt = ({ children: e, className: t, onDownload: o, onError: n }) => {
83443
83443
  }, []), 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] });
83444
83444
  };
83445
83445
  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 }) })] });
83446
- var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-C_fIZXpA.js").then((e) => ({ default: e.Mermaid }))), Kn = /language-([^\s]+)/;
83446
+ var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-D9aZdQJZ.js").then((e) => ({ default: e.Mermaid }))), Kn = /language-([^\s]+)/;
83447
83447
  function ke(e, t) {
83448
83448
  if (!(e != null && e.position || t != null && t.position)) return true;
83449
83449
  if (!(e != null && e.position && (t != null && t.position))) return false;
@@ -91753,7 +91753,7 @@ async function deserializeTraceCarrier(traceCarrier) {
91753
91753
  }
91754
91754
  const OtelApi = once$1(async () => {
91755
91755
  try {
91756
- return await import("./index-Dq5jTBN4.js");
91756
+ return await import("./index-CETb4fkq.js");
91757
91757
  } catch {
91758
91758
  runtimeLogger.info("OpenTelemetry not available, tracing will be disabled");
91759
91759
  return null;
@@ -91763,8 +91763,35 @@ const Tracer = once$1(async () => {
91763
91763
  const api2 = await OtelApi.value;
91764
91764
  if (!api2)
91765
91765
  return null;
91766
- return api2.trace.getTracer("workflow");
91766
+ const tracer = api2.trace.getTracer("workflow");
91767
+ logOtelDiagnosticOnce$1(api2, tracer);
91768
+ return tracer;
91767
91769
  });
91770
+ let otelDiagLogged$1 = false;
91771
+ function logOtelDiagnosticOnce$1(otel, tracer) {
91772
+ var _a3, _b2, _c2, _d2, _e2;
91773
+ const debugEnabled = typeof process !== "undefined" && typeof process.env.DEBUG === "string" && (process.env.DEBUG.includes("workflow:") || process.env.DEBUG === "*");
91774
+ if (otelDiagLogged$1 || !debugEnabled)
91775
+ return;
91776
+ otelDiagLogged$1 = true;
91777
+ try {
91778
+ const g2 = globalThis[Symbol.for("opentelemetry.js.api.1")];
91779
+ const provider = otel.trace.getTracerProvider();
91780
+ const delegate = ((_a3 = provider.getDelegate) == null ? void 0 : _a3.call(provider)) ?? provider;
91781
+ const probe = tracer.startSpan("workflow.otel.probe.core");
91782
+ console.warn("[workflow:otel-diag] core", JSON.stringify({
91783
+ globalRegistrationVersion: (g2 == null ? void 0 : g2.version) ?? null,
91784
+ providerCtor: ((_b2 = provider == null ? void 0 : provider.constructor) == null ? void 0 : _b2.name) ?? null,
91785
+ delegateCtor: ((_c2 = delegate == null ? void 0 : delegate.constructor) == null ? void 0 : _c2.name) ?? null,
91786
+ tracerCtor: ((_d2 = tracer == null ? void 0 : tracer.constructor) == null ? void 0 : _d2.name) ?? null,
91787
+ probeCtor: ((_e2 = probe == null ? void 0 : probe.constructor) == null ? void 0 : _e2.name) ?? null,
91788
+ probeRecording: probe.isRecording()
91789
+ }));
91790
+ probe.end();
91791
+ } catch (error2) {
91792
+ console.warn("[workflow:otel-diag] core failed:", error2 instanceof Error ? error2.message : error2);
91793
+ }
91794
+ }
91768
91795
  async function trace$2(spanName2, ...args) {
91769
91796
  const [tracer, otel] = await Promise.all([Tracer.value, OtelApi.value]);
91770
91797
  const { fn: fn2, opts } = typeof args[0] === "function" ? { fn: args[0], opts: {} } : { fn: args[1], opts: args[0] };
@@ -91978,7 +92005,7 @@ const encryption = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
91978
92005
  encrypt: encrypt$1,
91979
92006
  importKey
91980
92007
  }, Symbol.toStringTag, { value: "Module" }));
91981
- const version$1 = "5.0.0-beta.33";
92008
+ const version$1 = "5.0.0-beta.34";
91982
92009
  function assertWorldSupportsRuntimeProtocol(world) {
91983
92010
  if (world.specVersion === SPEC_VERSION_CURRENT) {
91984
92011
  return;
@@ -93470,7 +93497,7 @@ function getByteUnframingStream() {
93470
93497
  }
93471
93498
  });
93472
93499
  }
93473
- function recordReadTimeToFirstChunk(startEpochMs, runId, name2, startIndex) {
93500
+ function recordReadTimeToFirstChunk(startEpochMs, runId, name2, startIndex, connectMs) {
93474
93501
  void (async () => {
93475
93502
  await recordElapsedSpan("workflow.stream.read", startEpochMs, {
93476
93503
  kind: await getSpanKind$2("CLIENT"),
@@ -93479,11 +93506,28 @@ function recordReadTimeToFirstChunk(startEpochMs, runId, name2, startIndex) {
93479
93506
  "workflow.stream.name": name2,
93480
93507
  "workflow.stream.operation": "read",
93481
93508
  "workflow.stream.read.ttfc_ms": Date.now() - startEpochMs,
93509
+ ...typeof connectMs === "number" ? { "workflow.stream.read.connect_ms": connectMs } : {},
93482
93510
  ...typeof startIndex === "number" ? { "workflow.stream.start_index": startIndex } : {}
93483
93511
  }
93484
93512
  });
93485
93513
  })();
93486
93514
  }
93515
+ function recordStreamReadComplete(startEpochMs, runId, name2, chunkCount, byteCount, reconnects) {
93516
+ void (async () => {
93517
+ await recordElapsedSpan("workflow.stream.read.complete", startEpochMs, {
93518
+ kind: await getSpanKind$2("CLIENT"),
93519
+ attributes: {
93520
+ "workflow.run.id": runId,
93521
+ "workflow.stream.name": name2,
93522
+ "workflow.stream.operation": "read_complete",
93523
+ "workflow.stream.read.total_ms": Date.now() - startEpochMs,
93524
+ "workflow.stream.read.chunks": chunkCount,
93525
+ "workflow.stream.read.bytes": byteCount,
93526
+ ...typeof reconnects === "number" ? { "workflow.stream.read.reconnects": reconnects } : {}
93527
+ }
93528
+ });
93529
+ })();
93530
+ }
93487
93531
  class WorkflowServerReadableStream extends ReadableStream {
93488
93532
  constructor(runId, name2, startIndex) {
93489
93533
  if (typeof name2 !== "string" || name2.length === 0) {
@@ -93491,6 +93535,9 @@ class WorkflowServerReadableStream extends ReadableStream {
93491
93535
  }
93492
93536
  let readStart;
93493
93537
  let firstChunkReported = false;
93538
+ let connectMs;
93539
+ let chunksDelivered = 0;
93540
+ let bytesDelivered = 0;
93494
93541
  super({
93495
93542
  // @ts-expect-error Not sure why TypeScript is complaining about this
93496
93543
  type: "bytes",
@@ -93500,7 +93547,9 @@ class WorkflowServerReadableStream extends ReadableStream {
93500
93547
  if (readStart === void 0)
93501
93548
  readStart = Date.now();
93502
93549
  const world = await getWorldLazy();
93550
+ const connectStart = Date.now();
93503
93551
  const stream = await world.streams.get(runId, name2, startIndex);
93552
+ connectMs = Date.now() - connectStart;
93504
93553
  reader = __privateSet(this, _reader, stream.getReader());
93505
93554
  }
93506
93555
  if (!reader) {
@@ -93510,12 +93559,17 @@ class WorkflowServerReadableStream extends ReadableStream {
93510
93559
  const result = await reader.read();
93511
93560
  if (result.done) {
93512
93561
  __privateSet(this, _reader, void 0);
93562
+ if (readStart !== void 0) {
93563
+ recordStreamReadComplete(readStart, runId, name2, chunksDelivered, bytesDelivered);
93564
+ }
93513
93565
  controller.close();
93514
93566
  } else {
93515
93567
  if (!firstChunkReported && result.value.byteLength > 0 && readStart !== void 0) {
93516
93568
  firstChunkReported = true;
93517
- recordReadTimeToFirstChunk(readStart, runId, name2, startIndex);
93569
+ recordReadTimeToFirstChunk(readStart, runId, name2, startIndex, connectMs);
93518
93570
  }
93571
+ chunksDelivered += 1;
93572
+ bytesDelivered += result.value.byteLength;
93519
93573
  controller.enqueue(result.value);
93520
93574
  }
93521
93575
  },
@@ -93546,10 +93600,18 @@ function createReconnectingFramedStream(runId, name2, startIndex) {
93546
93600
  let totalReconnectCount = 0;
93547
93601
  let reader;
93548
93602
  let buffer2 = new Uint8Array(0);
93603
+ let readStart;
93604
+ let connectMs;
93605
+ let firstChunkReported = false;
93606
+ let chunksDelivered = 0;
93607
+ let bytesDelivered = 0;
93549
93608
  async function connect2() {
93550
93609
  const world = await getWorldLazy();
93551
93610
  const effectiveStartIndex = reconnectSupported ? currentStartIndex + consumedFrames : startIndex;
93611
+ const connectStart = Date.now();
93552
93612
  const stream = await world.streams.get(runId, name2, effectiveStartIndex);
93613
+ if (connectMs === void 0)
93614
+ connectMs = Date.now() - connectStart;
93553
93615
  reader = stream.getReader();
93554
93616
  }
93555
93617
  async function reconnect() {
@@ -93581,6 +93643,8 @@ function createReconnectingFramedStream(runId, name2, startIndex) {
93581
93643
  }
93582
93644
  return new ReadableStream({
93583
93645
  pull: async (controller) => {
93646
+ if (readStart === void 0)
93647
+ readStart = Date.now();
93584
93648
  for (; ; ) {
93585
93649
  if (!reader) {
93586
93650
  try {
@@ -93608,6 +93672,9 @@ function createReconnectingFramedStream(runId, name2, startIndex) {
93608
93672
  }
93609
93673
  if (result.done || !result.value) {
93610
93674
  reader = void 0;
93675
+ if (readStart !== void 0) {
93676
+ recordStreamReadComplete(readStart, runId, name2, chunksDelivered, bytesDelivered, totalReconnectCount);
93677
+ }
93611
93678
  controller.close();
93612
93679
  return;
93613
93680
  }
@@ -93627,6 +93694,12 @@ function createReconnectingFramedStream(runId, name2, startIndex) {
93627
93694
  controller.enqueue(buffer2.slice(0, total));
93628
93695
  buffer2 = buffer2.slice(total);
93629
93696
  consumedFrames++;
93697
+ chunksDelivered++;
93698
+ bytesDelivered += total;
93699
+ if (!firstChunkReported && readStart !== void 0) {
93700
+ firstChunkReported = true;
93701
+ recordReadTimeToFirstChunk(readStart, runId, name2, startIndex, connectMs);
93702
+ }
93630
93703
  emitted = true;
93631
93704
  }
93632
93705
  if (emitted) {
@@ -93649,7 +93722,7 @@ const STREAM_FLUSH_INTERVAL_MS = 10;
93649
93722
  const getStreamFlushIntervalMs = () => envNumber("WORKFLOW_STREAM_FLUSH_INTERVAL_MS", STREAM_FLUSH_INTERVAL_MS, {
93650
93723
  integer: true
93651
93724
  });
93652
- function recordStreamWriteFlush(startEpochMs, dispatchEpochMs, runId, name2, chunkCount, byteCount) {
93725
+ function recordStreamWriteFlush(startEpochMs, dispatchEpochMs, runId, name2, chunkCount, byteCount, rpcMs) {
93653
93726
  void (async () => {
93654
93727
  await recordElapsedSpan("workflow.stream.flush", startEpochMs, {
93655
93728
  kind: await getSpanKind$2("CLIENT"),
@@ -93659,7 +93732,24 @@ function recordStreamWriteFlush(startEpochMs, dispatchEpochMs, runId, name2, chu
93659
93732
  "workflow.stream.operation": "flush",
93660
93733
  "workflow.stream.flush.buffer_dwell_ms": dispatchEpochMs - startEpochMs,
93661
93734
  "workflow.stream.flush.chunks": chunkCount,
93662
- "workflow.stream.flush.bytes": byteCount
93735
+ "workflow.stream.flush.bytes": byteCount,
93736
+ // Client-observed World write RPC duration (network hop included).
93737
+ // Same key as world-vercel's per-request span attribute so queries
93738
+ // work regardless of which layer emitted it.
93739
+ "workflow.stream.write.chunk_rtt": rpcMs
93740
+ }
93741
+ });
93742
+ })();
93743
+ }
93744
+ function recordStreamClose(startEpochMs, runId, name2) {
93745
+ void (async () => {
93746
+ await recordElapsedSpan("workflow.stream.close", startEpochMs, {
93747
+ kind: await getSpanKind$2("CLIENT"),
93748
+ attributes: {
93749
+ "workflow.run.id": runId,
93750
+ "workflow.stream.name": name2,
93751
+ "workflow.stream.operation": "close",
93752
+ "workflow.stream.close.rpc_ms": Date.now() - startEpochMs
93663
93753
  }
93664
93754
  });
93665
93755
  })();
@@ -93713,6 +93803,7 @@ class WorkflowServerWritableStream extends WritableStream {
93713
93803
  if (resolvedFlushIntervalMs === void 0) {
93714
93804
  resolvedFlushIntervalMs = world.streamFlushIntervalMs ?? getStreamFlushIntervalMs();
93715
93805
  }
93806
+ const rpcStartAt = Date.now();
93716
93807
  try {
93717
93808
  if (typeof world.streams.writeMulti === "function" && chunksToFlush.length > 1) {
93718
93809
  await world.streams.writeMulti(runId, name2, chunksToFlush);
@@ -93728,7 +93819,7 @@ class WorkflowServerWritableStream extends WritableStream {
93728
93819
  throw error2;
93729
93820
  }
93730
93821
  if (batchStart !== void 0) {
93731
- recordStreamWriteFlush(batchStart, dispatchAt, runId, name2, chunksToFlush.length, chunksToFlush.reduce((sum, c) => sum + c.byteLength, 0));
93822
+ recordStreamWriteFlush(batchStart, dispatchAt, runId, name2, chunksToFlush.length, chunksToFlush.reduce((sum, c) => sum + c.byteLength, 0), Date.now() - rpcStartAt);
93732
93823
  }
93733
93824
  buffer2 = [];
93734
93825
  };
@@ -93771,7 +93862,9 @@ class WorkflowServerWritableStream extends WritableStream {
93771
93862
  await flush();
93772
93863
  await ensureRunReady();
93773
93864
  const world = await worldPromise;
93865
+ const closeStart = Date.now();
93774
93866
  await world.streams.close(runId, name2);
93867
+ recordStreamClose(closeStart, runId, name2);
93775
93868
  },
93776
93869
  abort(reason) {
93777
93870
  if (flushTimer) {
@@ -99042,7 +99135,7 @@ async function initDataDir(dataDir) {
99042
99135
  let otelApiPromise$2 = null;
99043
99136
  async function getOtelApi$2() {
99044
99137
  if (!otelApiPromise$2) {
99045
- otelApiPromise$2 = import("./index-Dq5jTBN4.js").catch(() => null);
99138
+ otelApiPromise$2 = import("./index-CETb4fkq.js").catch(() => null);
99046
99139
  }
99047
99140
  return otelApiPromise$2;
99048
99141
  }
@@ -127088,7 +127181,7 @@ function createWorld$1(args) {
127088
127181
  const basedir = mergedConfig.dataDir;
127089
127182
  const hooksDir = path$3.join(basedir, "hooks");
127090
127183
  const taggedHookFiles = await listTaggedFiles(hooksDir, tag);
127091
- const { HookSchema: HookSchema2 } = await import("./index-DtD2dyVs.js");
127184
+ const { HookSchema: HookSchema2 } = await import("./index-CDZXmART.js");
127092
127185
  await Promise.all(taggedHookFiles.map(async (hookFile) => {
127093
127186
  const hook = await readJSON(path$3.join(hooksDir, hookFile), HookSchema2);
127094
127187
  if (hook == null ? void 0 : hook.token) {
@@ -127271,8 +127364,8 @@ function requireGetVercelOidcToken() {
127271
127364
  }
127272
127365
  try {
127273
127366
  const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
127274
- await import("./token-util-BjIqTaA8.js").then((n) => n.t),
127275
- await import("./token-ep3Bro6L.js").then((n) => n.t)
127367
+ await import("./token-util-DXRPWBKh.js").then((n) => n.t),
127368
+ await import("./token-Ni6JMJBG.js").then((n) => n.t)
127276
127369
  ]);
127277
127370
  if (!token || isExpired(getTokenPayload(token), options == null ? void 0 : options.expirationBufferMs)) {
127278
127371
  await refreshToken(options);
@@ -127899,7 +127992,7 @@ function getDefaultStreamDispatcher() {
127899
127992
  let otelApiPromise$1 = null;
127900
127993
  async function getOtelApi$1() {
127901
127994
  if (!otelApiPromise$1) {
127902
- otelApiPromise$1 = import("./index-Dq5jTBN4.js").catch((error2) => {
127995
+ otelApiPromise$1 = import("./index-CETb4fkq.js").catch((error2) => {
127903
127996
  if (typeof process !== "undefined" && typeof process.env.DEBUG === "string" && (process.env.DEBUG.includes("workflow:") || process.env.DEBUG === "*")) {
127904
127997
  console.warn("[workflow] @opentelemetry/api unavailable — world-vercel spans disabled:", error2 instanceof Error ? error2.message : error2);
127905
127998
  }
@@ -127909,9 +128002,42 @@ async function getOtelApi$1() {
127909
128002
  return otelApiPromise$1;
127910
128003
  }
127911
128004
  let tracerPromise = null;
128005
+ function workflowDebugEnabled() {
128006
+ return typeof process !== "undefined" && typeof process.env.DEBUG === "string" && (process.env.DEBUG.includes("workflow:") || process.env.DEBUG === "*");
128007
+ }
128008
+ let otelDiagLogged = false;
128009
+ function logOtelDiagnosticOnce(otel, tracer) {
128010
+ var _a3, _b2, _c2, _d2, _e2;
128011
+ if (otelDiagLogged || !workflowDebugEnabled())
128012
+ return;
128013
+ otelDiagLogged = true;
128014
+ try {
128015
+ const g2 = globalThis[Symbol.for("opentelemetry.js.api.1")];
128016
+ const provider = otel.trace.getTracerProvider();
128017
+ const delegate = ((_a3 = provider.getDelegate) == null ? void 0 : _a3.call(provider)) ?? provider;
128018
+ const probe = tracer.startSpan("workflow.otel.probe.world_vercel");
128019
+ console.warn("[workflow:otel-diag] world-vercel", JSON.stringify({
128020
+ globalRegistrationVersion: (g2 == null ? void 0 : g2.version) ?? null,
128021
+ providerCtor: ((_b2 = provider == null ? void 0 : provider.constructor) == null ? void 0 : _b2.name) ?? null,
128022
+ delegateCtor: ((_c2 = delegate == null ? void 0 : delegate.constructor) == null ? void 0 : _c2.name) ?? null,
128023
+ tracerCtor: ((_d2 = tracer == null ? void 0 : tracer.constructor) == null ? void 0 : _d2.name) ?? null,
128024
+ probeCtor: ((_e2 = probe == null ? void 0 : probe.constructor) == null ? void 0 : _e2.name) ?? null,
128025
+ probeRecording: probe.isRecording()
128026
+ }));
128027
+ probe.end();
128028
+ } catch (error2) {
128029
+ console.warn("[workflow:otel-diag] world-vercel failed:", error2 instanceof Error ? error2.message : error2);
128030
+ }
128031
+ }
127912
128032
  async function getTracer() {
127913
128033
  if (!tracerPromise) {
127914
- tracerPromise = getOtelApi$1().then((otel) => otel ? otel.trace.getTracer("workflow") : null);
128034
+ tracerPromise = getOtelApi$1().then((otel) => {
128035
+ if (!otel)
128036
+ return null;
128037
+ const tracer = otel.trace.getTracer("workflow");
128038
+ logOtelDiagnosticOnce(otel, tracer);
128039
+ return tracer;
128040
+ });
127915
128041
  }
127916
128042
  return tracerPromise;
127917
128043
  }
@@ -128071,6 +128197,15 @@ async function instrumentedFetch(opts) {
128071
128197
  const label = logLabel ?? url2;
128072
128198
  return trace(spanName2 ?? `http ${method}`, { kind: await getSpanKind("CLIENT") }, async (span) => {
128073
128199
  var _a3, _b2, _c2;
128200
+ if (spanName2 && HTTP_DEBUG_ENABLED && span) {
128201
+ const ctx = span.spanContext();
128202
+ console.warn("[workflow:otel-diag] span-open", JSON.stringify({
128203
+ spanName: spanName2,
128204
+ traceId: ctx.traceId,
128205
+ spanId: ctx.spanId,
128206
+ recording: span.isRecording()
128207
+ }));
128208
+ }
128074
128209
  span == null ? void 0 : span.setAttributes(httpClientSpanAttributes({ method, url: url2, peerService }));
128075
128210
  if (attributes)
128076
128211
  span == null ? void 0 : span.setAttributes(attributes);
@@ -128125,7 +128260,7 @@ async function instrumentedFetch(opts) {
128125
128260
  return response2;
128126
128261
  });
128127
128262
  }
128128
- const version = "5.0.0-beta.29";
128263
+ const version = "5.0.0-beta.30";
128129
128264
  const IDEMPOTENT_METHODS = /* @__PURE__ */ new Set(["GET", "HEAD"]);
128130
128265
  const MAX_BODY_PARSE_RETRIES = 2;
128131
128266
  const BODY_PARSE_RETRY_BASE_MS = 100;
@@ -132701,7 +132836,7 @@ function resolveTelemetryConfig(client2, send2) {
132701
132836
  var otelApiPromise;
132702
132837
  function getOtelApi() {
132703
132838
  if (!otelApiPromise) {
132704
- otelApiPromise = import("./index-Dq5jTBN4.js").then(
132839
+ otelApiPromise = import("./index-CETb4fkq.js").then(
132705
132840
  (mod) => mod,
132706
132841
  () => null
132707
132842
  );
@@ -2,8 +2,8 @@ import { createRequire as __wkfCreateRequire } from "node:module";
2
2
  if (typeof require === "undefined") {
3
3
  globalThis.require = __wkfCreateRequire(import.meta.url);
4
4
  }
5
- import { g as getDefaultExportFromCjs } from "./app-YT2nFLf8.js";
6
- import { aB as requireTokenError, aA as requireTokenUtil } from "./server-build-riD1HycA.js";
5
+ import { g as getDefaultExportFromCjs } from "./app-i2AZJqU9.js";
6
+ import { aB as requireTokenError, aA as requireTokenUtil } from "./server-build-DIxG6FRI.js";
7
7
  function _mergeNamespaces(n, m) {
8
8
  for (var i = 0; i < m.length; i++) {
9
9
  const e = m[i];
@@ -2,8 +2,8 @@ import { createRequire as __wkfCreateRequire } from "node:module";
2
2
  if (typeof require === "undefined") {
3
3
  globalThis.require = __wkfCreateRequire(import.meta.url);
4
4
  }
5
- import { g as getDefaultExportFromCjs } from "./app-YT2nFLf8.js";
6
- import { aA as requireTokenUtil } from "./server-build-riD1HycA.js";
5
+ import { g as getDefaultExportFromCjs } from "./app-i2AZJqU9.js";
6
+ import { aA as requireTokenUtil } from "./server-build-DIxG6FRI.js";
7
7
  function _mergeNamespaces(n, m) {
8
8
  for (var i = 0; i < m.length; i++) {
9
9
  const e = m[i];
@@ -2,8 +2,8 @@ import { createRequire as __wkfCreateRequire } from "node:module";
2
2
  if (typeof require === "undefined") {
3
3
  globalThis.require = __wkfCreateRequire(import.meta.url);
4
4
  }
5
- import { az as registerZstdDecoder } from "./server-build-riD1HycA.js";
6
- import "./app-YT2nFLf8.js";
5
+ import { az as registerZstdDecoder } from "./server-build-DIxG6FRI.js";
6
+ import "./app-i2AZJqU9.js";
7
7
  import "stream";
8
8
  import "express";
9
9
  import "node:stream";
@@ -2,7 +2,7 @@ import { createRequire as __wkfCreateRequire } from "node:module";
2
2
  if (typeof require === "undefined") {
3
3
  globalThis.require = __wkfCreateRequire(import.meta.url);
4
4
  }
5
- import { n } from "./assets/app-YT2nFLf8.js";
5
+ import { n } from "./assets/app-i2AZJqU9.js";
6
6
  import "express";
7
7
  import "stream";
8
8
  export {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@workflow/web",
3
3
  "description": "Workflow Observability UI",
4
- "version": "5.0.0-beta.33",
4
+ "version": "5.0.0-beta.34",
5
5
  "type": "module",
6
6
  "private": false,
7
7
  "files": [
@@ -74,12 +74,12 @@
74
74
  "typescript": "^6.0.3",
75
75
  "vite": "^6",
76
76
  "vitest": "^3",
77
- "@workflow/core": "5.0.0-beta.33",
77
+ "@workflow/core": "5.0.0-beta.34",
78
78
  "@workflow/errors": "5.0.0-beta.10",
79
79
  "@workflow/utils": "5.0.0-beta.6",
80
- "@workflow/web-shared": "5.0.0-beta.33",
80
+ "@workflow/web-shared": "5.0.0-beta.34",
81
81
  "@workflow/world": "5.0.0-beta.20",
82
- "@workflow/world-vercel": "5.0.0-beta.29"
82
+ "@workflow/world-vercel": "5.0.0-beta.30"
83
83
  },
84
84
  "scripts": {
85
85
  "dev": "react-router dev",