@workflow/web 5.0.0-beta.33 → 5.0.0-beta.35
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.
- package/build/client/assets/{arrow-up-right-B1QFlETT.js → arrow-up-right-B9knAxIp.js} +1 -1
- package/build/client/assets/{highlighted-body-B3W2YXNL-Br23zjGQ.js → highlighted-body-B3W2YXNL-nasOj6sE.js} +1 -1
- package/build/client/assets/{home-rmBMtWNr.js → home-BasVp7zv.js} +2 -2
- package/build/client/assets/{manifest-9dd3e2d8.js → manifest-47657566.js} +1 -1
- package/build/client/assets/{mermaid-3ZIDBTTL-CQtb_4FN.js → mermaid-3ZIDBTTL-g3vDTGSb.js} +17 -5
- package/build/client/assets/{root-CraFPjyT.js → root-DfwDd0Zj.js} +2 -2
- package/build/client/assets/{run-detail-BGHjSgVx.js → run-detail-BGMnsQO5.js} +6 -5
- package/build/client/assets/{workflow-graph-viewer-Cn2fThMy.js → workflow-graph-viewer-VUIB71kS.js} +1 -1
- package/build/client/assets/{zstd-browser-decoder-BjHfY5Rj.js → zstd-browser-decoder-B6lDon6D.js} +1 -1
- package/build/server/assets/{app-YT2nFLf8.js → app-BpmTURgx.js} +1 -1
- package/build/server/assets/{highlighted-body-B3W2YXNL-6aglRJd5.js → highlighted-body-B3W2YXNL-BGkarUSx.js} +2 -2
- package/build/server/assets/index-CETb4fkq.js +1164 -0
- package/build/server/assets/{index-DtD2dyVs.js → index-Dt3nkvmG.js} +58 -56
- package/build/server/assets/{mermaid-3ZIDBTTL-C_fIZXpA.js → mermaid-3ZIDBTTL-DUb3plqq.js} +2 -2
- package/build/server/assets/{server-build-riD1HycA.js → server-build-vDim5aBz.js} +459 -260
- package/build/server/assets/{token-ep3Bro6L.js → token-BaQZqFlF.js} +2 -2
- package/build/server/assets/{token-util-BjIqTaA8.js → token-util-DHXhfd_v.js} +2 -2
- package/build/server/assets/{zstd-browser-decoder-CX-ryJFu.js → zstd-browser-decoder-Bnx_AJNv.js} +2 -2
- package/build/server/index.js +1 -1
- package/package.json +8 -8
- package/build/server/assets/index-Dq5jTBN4.js +0 -1286
|
@@ -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-
|
|
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-BpmTURgx.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";
|
|
@@ -47781,6 +47781,8 @@ const z$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
|
|
|
47781
47781
|
xor: xor$1
|
|
47782
47782
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
47783
47783
|
const RESERVED_ATTRIBUTE_KEY_PREFIX = "$";
|
|
47784
|
+
const ROOT_RUN_ID_ATTRIBUTE = `${RESERVED_ATTRIBUTE_KEY_PREFIX}rootRunId`;
|
|
47785
|
+
const PARENT_RUN_ID_ATTRIBUTE = `${RESERVED_ATTRIBUTE_KEY_PREFIX}parentRunId`;
|
|
47784
47786
|
const ATTRIBUTE_KEY_MAX_LENGTH = 256;
|
|
47785
47787
|
const ATTRIBUTE_VALUE_MAX_BYTES = 256;
|
|
47786
47788
|
const ATTRIBUTE_MAX_PER_RUN = 64;
|
|
@@ -48030,6 +48032,17 @@ const stepLatencyTelemetryFields = {
|
|
|
48030
48032
|
// stso.
|
|
48031
48033
|
stepCount: number$3().int().positive().optional(),
|
|
48032
48034
|
eventCount: number$3().int().positive().optional(),
|
|
48035
|
+
// Run-started-to-first-step: milliseconds from the `run_started` response
|
|
48036
|
+
// landing (or, under turbo, the local run synthesis instant) until this
|
|
48037
|
+
// step's start POST was issued. A sub-window of ttfs. Only reported
|
|
48038
|
+
// alongside the same eligibility as ttfs.
|
|
48039
|
+
rsfs: number$3().optional(),
|
|
48040
|
+
// Synchronous workflow-function replay duration of only the FINAL replay
|
|
48041
|
+
// pass within the rsfs window (the pass that scheduled the first step),
|
|
48042
|
+
// excluding awaited network I/O — not accumulated across earlier
|
|
48043
|
+
// pre-first-step passes, so it is not "the replay portion of rsfs". Only
|
|
48044
|
+
// present alongside rsfs, and only for the run's first step.
|
|
48045
|
+
finalSchedulingReplay: number$3().optional(),
|
|
48033
48046
|
// Names of the runtime's optional startup-latency optimizations that were
|
|
48034
48047
|
// active for this measurement (e.g. 'turbo', 'lazyStepStart',
|
|
48035
48048
|
// 'optimisticStart'), so latency metrics can be segmented by them.
|
|
@@ -50156,7 +50169,7 @@ function replaceEncryptedAndExpiredWithMarkers(resource) {
|
|
|
50156
50169
|
}
|
|
50157
50170
|
async function hydrateResourceIOAsync(resource, key) {
|
|
50158
50171
|
const { hydrateDataWithKey: hydrateDataWithKey2 } = await Promise.resolve().then(() => serializationFormat);
|
|
50159
|
-
const { ensureZstdDecoderRegistered } = await import("./zstd-browser-decoder-
|
|
50172
|
+
const { ensureZstdDecoderRegistered } = await import("./zstd-browser-decoder-Bnx_AJNv.js");
|
|
50160
50173
|
ensureZstdDecoderRegistered();
|
|
50161
50174
|
const cryptoKey = key ? await Promise.resolve().then(() => encryption).then(({ importKey: importKey2 }) => importKey2(key)) : void 0;
|
|
50162
50175
|
const revivers = getRevivers();
|
|
@@ -52449,7 +52462,7 @@ const rowValueVariants = cva("min-w-0 flex-1 truncate text-right text-copy-13 te
|
|
|
52449
52462
|
variant: "default"
|
|
52450
52463
|
}
|
|
52451
52464
|
});
|
|
52452
|
-
const rowCopyValueVariants = cva("flex min-w-0 items-center justify-end gap-1 text-copy-13 text-gray-1000", {
|
|
52465
|
+
const rowCopyValueVariants = cva("flex min-w-0 flex-1 items-center justify-end gap-1 overflow-hidden text-copy-13 text-gray-1000", {
|
|
52453
52466
|
variants: {
|
|
52454
52467
|
variant: {
|
|
52455
52468
|
default: "",
|
|
@@ -83121,7 +83134,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
|
|
|
83121
83134
|
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
83135
|
var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
|
|
83123
83136
|
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-
|
|
83137
|
+
var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL-BGkarUSx.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
|
|
83125
83138
|
let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
|
|
83126
83139
|
`).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
|
|
83127
83140
|
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 +83456,7 @@ var Dt = ({ children: e, className: t, onDownload: o, onError: n }) => {
|
|
|
83443
83456
|
}, []), 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
83457
|
};
|
|
83445
83458
|
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-
|
|
83459
|
+
var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-DUb3plqq.js").then((e) => ({ default: e.Mermaid }))), Kn = /language-([^\s]+)/;
|
|
83447
83460
|
function ke(e, t) {
|
|
83448
83461
|
if (!(e != null && e.position || t != null && t.position)) return true;
|
|
83449
83462
|
if (!(e != null && e.position && (t != null && t.position))) return false;
|
|
@@ -84322,7 +84335,8 @@ const copyableBasicAttributes = /* @__PURE__ */ new Set([
|
|
|
84322
84335
|
"hookId",
|
|
84323
84336
|
"eventId",
|
|
84324
84337
|
"deploymentId",
|
|
84325
|
-
"moduleSpecifier"
|
|
84338
|
+
"moduleSpecifier",
|
|
84339
|
+
"token"
|
|
84326
84340
|
]);
|
|
84327
84341
|
const loadingSectionLabels = {
|
|
84328
84342
|
input: "Input",
|
|
@@ -86797,9 +86811,10 @@ const RESOURCE_COLORS = {
|
|
|
86797
86811
|
errorBg: "var(--ds-red-200)",
|
|
86798
86812
|
errorBorder: "var(--ds-red-500)"
|
|
86799
86813
|
},
|
|
86814
|
+
// Passive spans (hooks) stay gray — matches event-list icons and the minimap.
|
|
86800
86815
|
hook: {
|
|
86801
|
-
bg: "var(--ds-
|
|
86802
|
-
border: "var(--ds-
|
|
86816
|
+
bg: "var(--ds-gray-200)",
|
|
86817
|
+
border: "var(--ds-gray-500)",
|
|
86803
86818
|
errorBg: "var(--ds-red-200)",
|
|
86804
86819
|
errorBorder: "var(--ds-red-500)"
|
|
86805
86820
|
},
|
|
@@ -91321,6 +91336,15 @@ class ThrottleError extends WorkflowWorldError {
|
|
|
91321
91336
|
return isError(value) && value.name === "ThrottleError";
|
|
91322
91337
|
}
|
|
91323
91338
|
}
|
|
91339
|
+
class PreconditionFailedError extends WorkflowWorldError {
|
|
91340
|
+
constructor(message2, options) {
|
|
91341
|
+
super(message2, { status: 412, retryAfter: options == null ? void 0 : options.retryAfter });
|
|
91342
|
+
this.name = "PreconditionFailedError";
|
|
91343
|
+
}
|
|
91344
|
+
static is(value) {
|
|
91345
|
+
return isError(value) && value.name === "PreconditionFailedError";
|
|
91346
|
+
}
|
|
91347
|
+
}
|
|
91324
91348
|
class WorkflowRunCancelledError extends WorkflowError {
|
|
91325
91349
|
constructor(runId) {
|
|
91326
91350
|
super(`Workflow run "${runId}" cancelled`, {});
|
|
@@ -91753,7 +91777,7 @@ async function deserializeTraceCarrier(traceCarrier) {
|
|
|
91753
91777
|
}
|
|
91754
91778
|
const OtelApi = once$1(async () => {
|
|
91755
91779
|
try {
|
|
91756
|
-
return await import("./index-
|
|
91780
|
+
return await import("./index-CETb4fkq.js");
|
|
91757
91781
|
} catch {
|
|
91758
91782
|
runtimeLogger.info("OpenTelemetry not available, tracing will be disabled");
|
|
91759
91783
|
return null;
|
|
@@ -91763,8 +91787,35 @@ const Tracer = once$1(async () => {
|
|
|
91763
91787
|
const api2 = await OtelApi.value;
|
|
91764
91788
|
if (!api2)
|
|
91765
91789
|
return null;
|
|
91766
|
-
|
|
91790
|
+
const tracer = api2.trace.getTracer("workflow");
|
|
91791
|
+
logOtelDiagnosticOnce$1(api2, tracer);
|
|
91792
|
+
return tracer;
|
|
91767
91793
|
});
|
|
91794
|
+
let otelDiagLogged$1 = false;
|
|
91795
|
+
function logOtelDiagnosticOnce$1(otel, tracer) {
|
|
91796
|
+
var _a3, _b2, _c2, _d2, _e2;
|
|
91797
|
+
const debugEnabled = typeof process !== "undefined" && typeof process.env.DEBUG === "string" && (process.env.DEBUG.includes("workflow:") || process.env.DEBUG === "*");
|
|
91798
|
+
if (otelDiagLogged$1 || !debugEnabled)
|
|
91799
|
+
return;
|
|
91800
|
+
otelDiagLogged$1 = true;
|
|
91801
|
+
try {
|
|
91802
|
+
const g2 = globalThis[Symbol.for("opentelemetry.js.api.1")];
|
|
91803
|
+
const provider = otel.trace.getTracerProvider();
|
|
91804
|
+
const delegate = ((_a3 = provider.getDelegate) == null ? void 0 : _a3.call(provider)) ?? provider;
|
|
91805
|
+
const probe = tracer.startSpan("workflow.otel.probe.core");
|
|
91806
|
+
console.warn("[workflow:otel-diag] core", JSON.stringify({
|
|
91807
|
+
globalRegistrationVersion: (g2 == null ? void 0 : g2.version) ?? null,
|
|
91808
|
+
providerCtor: ((_b2 = provider == null ? void 0 : provider.constructor) == null ? void 0 : _b2.name) ?? null,
|
|
91809
|
+
delegateCtor: ((_c2 = delegate == null ? void 0 : delegate.constructor) == null ? void 0 : _c2.name) ?? null,
|
|
91810
|
+
tracerCtor: ((_d2 = tracer == null ? void 0 : tracer.constructor) == null ? void 0 : _d2.name) ?? null,
|
|
91811
|
+
probeCtor: ((_e2 = probe == null ? void 0 : probe.constructor) == null ? void 0 : _e2.name) ?? null,
|
|
91812
|
+
probeRecording: probe.isRecording()
|
|
91813
|
+
}));
|
|
91814
|
+
probe.end();
|
|
91815
|
+
} catch (error2) {
|
|
91816
|
+
console.warn("[workflow:otel-diag] core failed:", error2 instanceof Error ? error2.message : error2);
|
|
91817
|
+
}
|
|
91818
|
+
}
|
|
91768
91819
|
async function trace$2(spanName2, ...args) {
|
|
91769
91820
|
const [tracer, otel] = await Promise.all([Tracer.value, OtelApi.value]);
|
|
91770
91821
|
const { fn: fn2, opts } = typeof args[0] === "function" ? { fn: args[0], opts: {} } : { fn: args[1], opts: args[0] };
|
|
@@ -91978,7 +92029,7 @@ const encryption = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
91978
92029
|
encrypt: encrypt$1,
|
|
91979
92030
|
importKey
|
|
91980
92031
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
91981
|
-
const version$1 = "5.0.0-beta.
|
|
92032
|
+
const version$1 = "5.0.0-beta.35";
|
|
91982
92033
|
function assertWorldSupportsRuntimeProtocol(world) {
|
|
91983
92034
|
if (world.specVersion === SPEC_VERSION_CURRENT) {
|
|
91984
92035
|
return;
|
|
@@ -93470,7 +93521,7 @@ function getByteUnframingStream() {
|
|
|
93470
93521
|
}
|
|
93471
93522
|
});
|
|
93472
93523
|
}
|
|
93473
|
-
function recordReadTimeToFirstChunk(startEpochMs, runId, name2, startIndex) {
|
|
93524
|
+
function recordReadTimeToFirstChunk(startEpochMs, runId, name2, startIndex, connectMs) {
|
|
93474
93525
|
void (async () => {
|
|
93475
93526
|
await recordElapsedSpan("workflow.stream.read", startEpochMs, {
|
|
93476
93527
|
kind: await getSpanKind$2("CLIENT"),
|
|
@@ -93479,11 +93530,28 @@ function recordReadTimeToFirstChunk(startEpochMs, runId, name2, startIndex) {
|
|
|
93479
93530
|
"workflow.stream.name": name2,
|
|
93480
93531
|
"workflow.stream.operation": "read",
|
|
93481
93532
|
"workflow.stream.read.ttfc_ms": Date.now() - startEpochMs,
|
|
93533
|
+
...typeof connectMs === "number" ? { "workflow.stream.read.connect_ms": connectMs } : {},
|
|
93482
93534
|
...typeof startIndex === "number" ? { "workflow.stream.start_index": startIndex } : {}
|
|
93483
93535
|
}
|
|
93484
93536
|
});
|
|
93485
93537
|
})();
|
|
93486
93538
|
}
|
|
93539
|
+
function recordStreamReadComplete(startEpochMs, runId, name2, chunkCount, byteCount, reconnects) {
|
|
93540
|
+
void (async () => {
|
|
93541
|
+
await recordElapsedSpan("workflow.stream.read.complete", startEpochMs, {
|
|
93542
|
+
kind: await getSpanKind$2("CLIENT"),
|
|
93543
|
+
attributes: {
|
|
93544
|
+
"workflow.run.id": runId,
|
|
93545
|
+
"workflow.stream.name": name2,
|
|
93546
|
+
"workflow.stream.operation": "read_complete",
|
|
93547
|
+
"workflow.stream.read.total_ms": Date.now() - startEpochMs,
|
|
93548
|
+
"workflow.stream.read.chunks": chunkCount,
|
|
93549
|
+
"workflow.stream.read.bytes": byteCount,
|
|
93550
|
+
...typeof reconnects === "number" ? { "workflow.stream.read.reconnects": reconnects } : {}
|
|
93551
|
+
}
|
|
93552
|
+
});
|
|
93553
|
+
})();
|
|
93554
|
+
}
|
|
93487
93555
|
class WorkflowServerReadableStream extends ReadableStream {
|
|
93488
93556
|
constructor(runId, name2, startIndex) {
|
|
93489
93557
|
if (typeof name2 !== "string" || name2.length === 0) {
|
|
@@ -93491,6 +93559,9 @@ class WorkflowServerReadableStream extends ReadableStream {
|
|
|
93491
93559
|
}
|
|
93492
93560
|
let readStart;
|
|
93493
93561
|
let firstChunkReported = false;
|
|
93562
|
+
let connectMs;
|
|
93563
|
+
let chunksDelivered = 0;
|
|
93564
|
+
let bytesDelivered = 0;
|
|
93494
93565
|
super({
|
|
93495
93566
|
// @ts-expect-error Not sure why TypeScript is complaining about this
|
|
93496
93567
|
type: "bytes",
|
|
@@ -93500,7 +93571,9 @@ class WorkflowServerReadableStream extends ReadableStream {
|
|
|
93500
93571
|
if (readStart === void 0)
|
|
93501
93572
|
readStart = Date.now();
|
|
93502
93573
|
const world = await getWorldLazy();
|
|
93574
|
+
const connectStart = Date.now();
|
|
93503
93575
|
const stream = await world.streams.get(runId, name2, startIndex);
|
|
93576
|
+
connectMs = Date.now() - connectStart;
|
|
93504
93577
|
reader = __privateSet(this, _reader, stream.getReader());
|
|
93505
93578
|
}
|
|
93506
93579
|
if (!reader) {
|
|
@@ -93510,12 +93583,17 @@ class WorkflowServerReadableStream extends ReadableStream {
|
|
|
93510
93583
|
const result = await reader.read();
|
|
93511
93584
|
if (result.done) {
|
|
93512
93585
|
__privateSet(this, _reader, void 0);
|
|
93586
|
+
if (readStart !== void 0) {
|
|
93587
|
+
recordStreamReadComplete(readStart, runId, name2, chunksDelivered, bytesDelivered);
|
|
93588
|
+
}
|
|
93513
93589
|
controller.close();
|
|
93514
93590
|
} else {
|
|
93515
93591
|
if (!firstChunkReported && result.value.byteLength > 0 && readStart !== void 0) {
|
|
93516
93592
|
firstChunkReported = true;
|
|
93517
|
-
recordReadTimeToFirstChunk(readStart, runId, name2, startIndex);
|
|
93593
|
+
recordReadTimeToFirstChunk(readStart, runId, name2, startIndex, connectMs);
|
|
93518
93594
|
}
|
|
93595
|
+
chunksDelivered += 1;
|
|
93596
|
+
bytesDelivered += result.value.byteLength;
|
|
93519
93597
|
controller.enqueue(result.value);
|
|
93520
93598
|
}
|
|
93521
93599
|
},
|
|
@@ -93546,10 +93624,18 @@ function createReconnectingFramedStream(runId, name2, startIndex) {
|
|
|
93546
93624
|
let totalReconnectCount = 0;
|
|
93547
93625
|
let reader;
|
|
93548
93626
|
let buffer2 = new Uint8Array(0);
|
|
93627
|
+
let readStart;
|
|
93628
|
+
let connectMs;
|
|
93629
|
+
let firstChunkReported = false;
|
|
93630
|
+
let chunksDelivered = 0;
|
|
93631
|
+
let bytesDelivered = 0;
|
|
93549
93632
|
async function connect2() {
|
|
93550
93633
|
const world = await getWorldLazy();
|
|
93551
93634
|
const effectiveStartIndex = reconnectSupported ? currentStartIndex + consumedFrames : startIndex;
|
|
93635
|
+
const connectStart = Date.now();
|
|
93552
93636
|
const stream = await world.streams.get(runId, name2, effectiveStartIndex);
|
|
93637
|
+
if (connectMs === void 0)
|
|
93638
|
+
connectMs = Date.now() - connectStart;
|
|
93553
93639
|
reader = stream.getReader();
|
|
93554
93640
|
}
|
|
93555
93641
|
async function reconnect() {
|
|
@@ -93581,6 +93667,8 @@ function createReconnectingFramedStream(runId, name2, startIndex) {
|
|
|
93581
93667
|
}
|
|
93582
93668
|
return new ReadableStream({
|
|
93583
93669
|
pull: async (controller) => {
|
|
93670
|
+
if (readStart === void 0)
|
|
93671
|
+
readStart = Date.now();
|
|
93584
93672
|
for (; ; ) {
|
|
93585
93673
|
if (!reader) {
|
|
93586
93674
|
try {
|
|
@@ -93608,6 +93696,9 @@ function createReconnectingFramedStream(runId, name2, startIndex) {
|
|
|
93608
93696
|
}
|
|
93609
93697
|
if (result.done || !result.value) {
|
|
93610
93698
|
reader = void 0;
|
|
93699
|
+
if (readStart !== void 0) {
|
|
93700
|
+
recordStreamReadComplete(readStart, runId, name2, chunksDelivered, bytesDelivered, totalReconnectCount);
|
|
93701
|
+
}
|
|
93611
93702
|
controller.close();
|
|
93612
93703
|
return;
|
|
93613
93704
|
}
|
|
@@ -93627,6 +93718,12 @@ function createReconnectingFramedStream(runId, name2, startIndex) {
|
|
|
93627
93718
|
controller.enqueue(buffer2.slice(0, total));
|
|
93628
93719
|
buffer2 = buffer2.slice(total);
|
|
93629
93720
|
consumedFrames++;
|
|
93721
|
+
chunksDelivered++;
|
|
93722
|
+
bytesDelivered += total;
|
|
93723
|
+
if (!firstChunkReported && readStart !== void 0) {
|
|
93724
|
+
firstChunkReported = true;
|
|
93725
|
+
recordReadTimeToFirstChunk(readStart, runId, name2, startIndex, connectMs);
|
|
93726
|
+
}
|
|
93630
93727
|
emitted = true;
|
|
93631
93728
|
}
|
|
93632
93729
|
if (emitted) {
|
|
@@ -93649,7 +93746,7 @@ const STREAM_FLUSH_INTERVAL_MS = 10;
|
|
|
93649
93746
|
const getStreamFlushIntervalMs = () => envNumber("WORKFLOW_STREAM_FLUSH_INTERVAL_MS", STREAM_FLUSH_INTERVAL_MS, {
|
|
93650
93747
|
integer: true
|
|
93651
93748
|
});
|
|
93652
|
-
function recordStreamWriteFlush(startEpochMs, dispatchEpochMs, runId, name2, chunkCount, byteCount) {
|
|
93749
|
+
function recordStreamWriteFlush(startEpochMs, dispatchEpochMs, runId, name2, chunkCount, byteCount, rpcMs) {
|
|
93653
93750
|
void (async () => {
|
|
93654
93751
|
await recordElapsedSpan("workflow.stream.flush", startEpochMs, {
|
|
93655
93752
|
kind: await getSpanKind$2("CLIENT"),
|
|
@@ -93659,7 +93756,24 @@ function recordStreamWriteFlush(startEpochMs, dispatchEpochMs, runId, name2, chu
|
|
|
93659
93756
|
"workflow.stream.operation": "flush",
|
|
93660
93757
|
"workflow.stream.flush.buffer_dwell_ms": dispatchEpochMs - startEpochMs,
|
|
93661
93758
|
"workflow.stream.flush.chunks": chunkCount,
|
|
93662
|
-
"workflow.stream.flush.bytes": byteCount
|
|
93759
|
+
"workflow.stream.flush.bytes": byteCount,
|
|
93760
|
+
// Client-observed World write RPC duration (network hop included).
|
|
93761
|
+
// Same key as world-vercel's per-request span attribute so queries
|
|
93762
|
+
// work regardless of which layer emitted it.
|
|
93763
|
+
"workflow.stream.write.chunk_rtt": rpcMs
|
|
93764
|
+
}
|
|
93765
|
+
});
|
|
93766
|
+
})();
|
|
93767
|
+
}
|
|
93768
|
+
function recordStreamClose(startEpochMs, runId, name2) {
|
|
93769
|
+
void (async () => {
|
|
93770
|
+
await recordElapsedSpan("workflow.stream.close", startEpochMs, {
|
|
93771
|
+
kind: await getSpanKind$2("CLIENT"),
|
|
93772
|
+
attributes: {
|
|
93773
|
+
"workflow.run.id": runId,
|
|
93774
|
+
"workflow.stream.name": name2,
|
|
93775
|
+
"workflow.stream.operation": "close",
|
|
93776
|
+
"workflow.stream.close.rpc_ms": Date.now() - startEpochMs
|
|
93663
93777
|
}
|
|
93664
93778
|
});
|
|
93665
93779
|
})();
|
|
@@ -93713,6 +93827,7 @@ class WorkflowServerWritableStream extends WritableStream {
|
|
|
93713
93827
|
if (resolvedFlushIntervalMs === void 0) {
|
|
93714
93828
|
resolvedFlushIntervalMs = world.streamFlushIntervalMs ?? getStreamFlushIntervalMs();
|
|
93715
93829
|
}
|
|
93830
|
+
const rpcStartAt = Date.now();
|
|
93716
93831
|
try {
|
|
93717
93832
|
if (typeof world.streams.writeMulti === "function" && chunksToFlush.length > 1) {
|
|
93718
93833
|
await world.streams.writeMulti(runId, name2, chunksToFlush);
|
|
@@ -93728,7 +93843,7 @@ class WorkflowServerWritableStream extends WritableStream {
|
|
|
93728
93843
|
throw error2;
|
|
93729
93844
|
}
|
|
93730
93845
|
if (batchStart !== void 0) {
|
|
93731
|
-
recordStreamWriteFlush(batchStart, dispatchAt, runId, name2, chunksToFlush.length, chunksToFlush.reduce((sum, c) => sum + c.byteLength, 0));
|
|
93846
|
+
recordStreamWriteFlush(batchStart, dispatchAt, runId, name2, chunksToFlush.length, chunksToFlush.reduce((sum, c) => sum + c.byteLength, 0), Date.now() - rpcStartAt);
|
|
93732
93847
|
}
|
|
93733
93848
|
buffer2 = [];
|
|
93734
93849
|
};
|
|
@@ -93771,7 +93886,9 @@ class WorkflowServerWritableStream extends WritableStream {
|
|
|
93771
93886
|
await flush();
|
|
93772
93887
|
await ensureRunReady();
|
|
93773
93888
|
const world = await worldPromise;
|
|
93889
|
+
const closeStart = Date.now();
|
|
93774
93890
|
await world.streams.close(runId, name2);
|
|
93891
|
+
recordStreamClose(closeStart, runId, name2);
|
|
93775
93892
|
},
|
|
93776
93893
|
abort(reason) {
|
|
93777
93894
|
if (flushTimer) {
|
|
@@ -94789,6 +94906,171 @@ const getWorld = async () => {
|
|
|
94789
94906
|
};
|
|
94790
94907
|
const GetWorldFnKey = Symbol.for("@workflow/world//getWorldFn");
|
|
94791
94908
|
globalThis[GetWorldFnKey] ?? (globalThis[GetWorldFnKey] = getWorld);
|
|
94909
|
+
const ENCODING = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
94910
|
+
const DECODE_TABLE = (() => {
|
|
94911
|
+
const table2 = new Int8Array(128).fill(-1);
|
|
94912
|
+
for (let i = 0; i < ENCODING.length; i++) {
|
|
94913
|
+
table2[ENCODING.charCodeAt(i)] = i;
|
|
94914
|
+
}
|
|
94915
|
+
for (let i = 0; i < ENCODING.length; i++) {
|
|
94916
|
+
const lower2 = ENCODING[i].toLowerCase();
|
|
94917
|
+
if (lower2 !== ENCODING[i]) {
|
|
94918
|
+
table2[lower2.charCodeAt(0)] = i;
|
|
94919
|
+
}
|
|
94920
|
+
}
|
|
94921
|
+
return table2;
|
|
94922
|
+
})();
|
|
94923
|
+
const ULID_LENGTH = 26;
|
|
94924
|
+
const ULID_BYTE_LENGTH = 16;
|
|
94925
|
+
const TAG_BIT_MASK = 128;
|
|
94926
|
+
const REGION_MASK = 252;
|
|
94927
|
+
const VERSION_HIGH_MASK = 3;
|
|
94928
|
+
const VERSION_LOW_MASK = 224;
|
|
94929
|
+
const REGION_BYTE_INDEX = 6;
|
|
94930
|
+
const VERSION_LOW_BYTE_INDEX = 7;
|
|
94931
|
+
const VERSION_BIT_WIDTH = 5;
|
|
94932
|
+
const REGION_BIT_WIDTH = 6;
|
|
94933
|
+
const MAX_VERSION = (1 << VERSION_BIT_WIDTH) - 1;
|
|
94934
|
+
const MAX_REGION = (1 << REGION_BIT_WIDTH) - 1;
|
|
94935
|
+
function ulidToBytes(ulid2) {
|
|
94936
|
+
if (typeof ulid2 !== "string") {
|
|
94937
|
+
throw new TypeError(`Expected ULID string, got ${typeof ulid2}`);
|
|
94938
|
+
}
|
|
94939
|
+
if (ulid2.length !== ULID_LENGTH) {
|
|
94940
|
+
throw new Error(`Invalid ULID length: expected ${ULID_LENGTH}, got ${ulid2.length}`);
|
|
94941
|
+
}
|
|
94942
|
+
const values = new Uint8Array(ULID_LENGTH);
|
|
94943
|
+
for (let i = 0; i < ULID_LENGTH; i++) {
|
|
94944
|
+
const code2 = ulid2.charCodeAt(i);
|
|
94945
|
+
const v2 = code2 < 128 ? DECODE_TABLE[code2] : -1;
|
|
94946
|
+
if (v2 < 0) {
|
|
94947
|
+
throw new Error(`Invalid Crockford-Base32 character at index ${i}: ${JSON.stringify(ulid2[i])}`);
|
|
94948
|
+
}
|
|
94949
|
+
values[i] = v2;
|
|
94950
|
+
}
|
|
94951
|
+
if ((values[0] & 24) !== 0) {
|
|
94952
|
+
throw new Error(`Invalid ULID: top 2 bits must be zero (first char > '7'): ${JSON.stringify(ulid2[0])}`);
|
|
94953
|
+
}
|
|
94954
|
+
const out = new Uint8Array(ULID_BYTE_LENGTH);
|
|
94955
|
+
let bitBuf = values[0] & 7;
|
|
94956
|
+
let bitCount = 3;
|
|
94957
|
+
let outIdx = 0;
|
|
94958
|
+
for (let i = 1; i < ULID_LENGTH; i++) {
|
|
94959
|
+
bitBuf = bitBuf << 5 | values[i];
|
|
94960
|
+
bitCount += 5;
|
|
94961
|
+
while (bitCount >= 8) {
|
|
94962
|
+
bitCount -= 8;
|
|
94963
|
+
out[outIdx++] = bitBuf >> bitCount & 255;
|
|
94964
|
+
}
|
|
94965
|
+
}
|
|
94966
|
+
if (outIdx !== ULID_BYTE_LENGTH || bitCount !== 0) {
|
|
94967
|
+
throw new Error("Internal error: ULID bit packing did not consume cleanly");
|
|
94968
|
+
}
|
|
94969
|
+
return out;
|
|
94970
|
+
}
|
|
94971
|
+
function bytesToUlid(bytes) {
|
|
94972
|
+
if (bytes.length !== ULID_BYTE_LENGTH) {
|
|
94973
|
+
throw new Error(`Invalid byte length: expected ${ULID_BYTE_LENGTH}, got ${bytes.length}`);
|
|
94974
|
+
}
|
|
94975
|
+
let bitBuf = 0;
|
|
94976
|
+
let bitCount = 0;
|
|
94977
|
+
bitBuf = 0;
|
|
94978
|
+
bitCount = 2;
|
|
94979
|
+
let out = "";
|
|
94980
|
+
for (let i = 0; i < ULID_BYTE_LENGTH; i++) {
|
|
94981
|
+
bitBuf = bitBuf << 8 | bytes[i];
|
|
94982
|
+
bitCount += 8;
|
|
94983
|
+
while (bitCount >= 5) {
|
|
94984
|
+
bitCount -= 5;
|
|
94985
|
+
out += ENCODING[bitBuf >> bitCount & 31];
|
|
94986
|
+
}
|
|
94987
|
+
}
|
|
94988
|
+
if (out.length !== ULID_LENGTH || bitCount !== 0) {
|
|
94989
|
+
throw new Error("Internal error: ULID bit packing did not flush cleanly");
|
|
94990
|
+
}
|
|
94991
|
+
return out;
|
|
94992
|
+
}
|
|
94993
|
+
const REGION_IDS = {
|
|
94994
|
+
unknown: 0,
|
|
94995
|
+
iad1: 1,
|
|
94996
|
+
sfo1: 2,
|
|
94997
|
+
pdx1: 3,
|
|
94998
|
+
cle1: 4,
|
|
94999
|
+
yul1: 5,
|
|
95000
|
+
gru1: 6,
|
|
95001
|
+
dub1: 7,
|
|
95002
|
+
lhr1: 8,
|
|
95003
|
+
cdg1: 9,
|
|
95004
|
+
fra1: 10,
|
|
95005
|
+
bru1: 11,
|
|
95006
|
+
arn1: 12,
|
|
95007
|
+
hel1: 13,
|
|
95008
|
+
zrh1: 14,
|
|
95009
|
+
cpt1: 15,
|
|
95010
|
+
dxb1: 16,
|
|
95011
|
+
bom1: 17,
|
|
95012
|
+
sin1: 18,
|
|
95013
|
+
hkg1: 19,
|
|
95014
|
+
hnd1: 20,
|
|
95015
|
+
icn1: 21,
|
|
95016
|
+
kix1: 22,
|
|
95017
|
+
syd1: 23
|
|
95018
|
+
};
|
|
95019
|
+
const DEFAULT_REGION_CODE = "iad1";
|
|
95020
|
+
const REGION_CODES_BY_ID = new Map(Object.entries(REGION_IDS).filter((entry2) => entry2[0] !== "unknown").map(([code2, id2]) => [id2, code2]));
|
|
95021
|
+
function lookupRegion(regionId) {
|
|
95022
|
+
return REGION_CODES_BY_ID.get(regionId) ?? null;
|
|
95023
|
+
}
|
|
95024
|
+
function isKnownRegionCode(code2) {
|
|
95025
|
+
return code2 !== void 0 && code2 !== "unknown" && Object.hasOwn(REGION_IDS, code2);
|
|
95026
|
+
}
|
|
95027
|
+
const CURRENT_VERSION = 1;
|
|
95028
|
+
function isRegionCode(value) {
|
|
95029
|
+
return typeof value === "string" && value !== "unknown" && Object.hasOwn(REGION_IDS, value);
|
|
95030
|
+
}
|
|
95031
|
+
function encode(ulid2, region, options = {}) {
|
|
95032
|
+
let regionId;
|
|
95033
|
+
if (typeof region === "number") {
|
|
95034
|
+
if (!Number.isInteger(region) || region < 0 || region > MAX_REGION) {
|
|
95035
|
+
throw new RangeError(`regionId must be an integer in [0, ${MAX_REGION}]; got ${region}`);
|
|
95036
|
+
}
|
|
95037
|
+
regionId = region;
|
|
95038
|
+
} else if (isRegionCode(region)) {
|
|
95039
|
+
regionId = REGION_IDS[region];
|
|
95040
|
+
} else {
|
|
95041
|
+
throw new Error(`Unknown region: ${String(region)}`);
|
|
95042
|
+
}
|
|
95043
|
+
const version2 = options.version ?? CURRENT_VERSION;
|
|
95044
|
+
if (!Number.isInteger(version2) || version2 < 0 || version2 > MAX_VERSION) {
|
|
95045
|
+
throw new RangeError(`version must be an integer in [0, ${MAX_VERSION}]; got ${version2}`);
|
|
95046
|
+
}
|
|
95047
|
+
const bytes = ulidToBytes(ulid2);
|
|
95048
|
+
bytes[0] = bytes[0] | TAG_BIT_MASK;
|
|
95049
|
+
const regionShifted = (regionId & MAX_REGION) << 2;
|
|
95050
|
+
const versionHigh = version2 >> 3 & VERSION_HIGH_MASK;
|
|
95051
|
+
const versionLow = (version2 & 7) << 5;
|
|
95052
|
+
bytes[REGION_BYTE_INDEX] = bytes[REGION_BYTE_INDEX] & -256 | regionShifted | versionHigh;
|
|
95053
|
+
bytes[VERSION_LOW_BYTE_INDEX] = bytes[VERSION_LOW_BYTE_INDEX] & ~VERSION_LOW_MASK | versionLow;
|
|
95054
|
+
return bytesToUlid(bytes);
|
|
95055
|
+
}
|
|
95056
|
+
function decode(taggedUlid) {
|
|
95057
|
+
const bytes = ulidToBytes(taggedUlid);
|
|
95058
|
+
const tagged = (bytes[0] & TAG_BIT_MASK) !== 0;
|
|
95059
|
+
bytes[0] = bytes[0] & ~TAG_BIT_MASK;
|
|
95060
|
+
const ulid2 = bytesToUlid(bytes);
|
|
95061
|
+
if (!tagged) {
|
|
95062
|
+
return { tagged: false, ulid: ulid2, version: null, regionId: null, region: null };
|
|
95063
|
+
}
|
|
95064
|
+
const regionId = (bytes[REGION_BYTE_INDEX] & REGION_MASK) >> 2;
|
|
95065
|
+
const version2 = (bytes[REGION_BYTE_INDEX] & VERSION_HIGH_MASK) << 3 | (bytes[VERSION_LOW_BYTE_INDEX] & VERSION_LOW_MASK) >> 5;
|
|
95066
|
+
return {
|
|
95067
|
+
tagged: true,
|
|
95068
|
+
ulid: ulid2,
|
|
95069
|
+
version: version2,
|
|
95070
|
+
regionId,
|
|
95071
|
+
region: lookupRegion(regionId)
|
|
95072
|
+
};
|
|
95073
|
+
}
|
|
94792
95074
|
function waitUntil(promise2) {
|
|
94793
95075
|
void import("./index-DIXsjgfZ.js").then((n) => n.i).then(({ waitUntil: waitUntil2 }) => {
|
|
94794
95076
|
waitUntil2(promise2);
|
|
@@ -97635,6 +97917,17 @@ function normalizeAttributeChanges(attrs, options = {}) {
|
|
|
97635
97917
|
}
|
|
97636
97918
|
const CROSS_DEPLOYMENT_CAPABILITY_PROBE_TIMEOUT_MS = 2e3;
|
|
97637
97919
|
const ulid$2 = monotonicFactory();
|
|
97920
|
+
function resolveLineageAttributes() {
|
|
97921
|
+
var _a3;
|
|
97922
|
+
const store = contextStorage.getStore();
|
|
97923
|
+
const parentRunId = (_a3 = store == null ? void 0 : store.workflowMetadata) == null ? void 0 : _a3.workflowRunId;
|
|
97924
|
+
if (!parentRunId)
|
|
97925
|
+
return void 0;
|
|
97926
|
+
return {
|
|
97927
|
+
[ROOT_RUN_ID_ATTRIBUTE]: store.rootRunId ?? parentRunId,
|
|
97928
|
+
[PARENT_RUN_ID_ATTRIBUTE]: parentRunId
|
|
97929
|
+
};
|
|
97930
|
+
}
|
|
97638
97931
|
let hasWarnedLatestNoOp = false;
|
|
97639
97932
|
async function start$1(workflow, argsOrOptions, options) {
|
|
97640
97933
|
"use step";
|
|
@@ -97714,9 +98007,11 @@ async function start$1(workflow, argsOrOptions, options) {
|
|
|
97714
98007
|
});
|
|
97715
98008
|
attributes = Object.fromEntries(changes.map(({ key, value }) => [key, value]));
|
|
97716
98009
|
}
|
|
97717
|
-
const
|
|
97718
|
-
|
|
97719
|
-
|
|
98010
|
+
const lineage = specVersion >= SPEC_VERSION_SUPPORTS_ATTRIBUTES ? resolveLineageAttributes() : void 0;
|
|
98011
|
+
const runAttributes = lineage ? { ...lineage, ...attributes } : attributes;
|
|
98012
|
+
const attributeSeed = runAttributes ? {
|
|
98013
|
+
attributes: runAttributes,
|
|
98014
|
+
...allowReservedAttributes || lineage != null ? { allowReservedAttributes: true } : {}
|
|
97720
98015
|
} : {};
|
|
97721
98016
|
if (opts.replayedFromRunId !== void 0 && !workflowRunIdSchema.safeParse(opts.replayedFromRunId).success) {
|
|
97722
98017
|
throw new WorkflowRuntimeError(`replayedFromRunId must be a run ID (wrun_<ulid>); received ${JSON.stringify(String(opts.replayedFromRunId).slice(0, 64))}.`);
|
|
@@ -98502,6 +98797,18 @@ const config = once(() => {
|
|
|
98502
98797
|
const baseUrl = getBaseUrlFromEnv();
|
|
98503
98798
|
return { dataDir, baseUrl };
|
|
98504
98799
|
});
|
|
98800
|
+
function resolveRecoverActiveRuns(config2) {
|
|
98801
|
+
var _a3;
|
|
98802
|
+
if (config2.recoverActiveRuns !== void 0) {
|
|
98803
|
+
return config2.recoverActiveRuns;
|
|
98804
|
+
}
|
|
98805
|
+
const raw2 = (_a3 = process.env.WORKFLOW_LOCAL_RECOVER_ACTIVE_RUNS) == null ? void 0 : _a3.toLowerCase();
|
|
98806
|
+
if (raw2 === "0" || raw2 === "false")
|
|
98807
|
+
return false;
|
|
98808
|
+
if (raw2 === "1" || raw2 === "true")
|
|
98809
|
+
return true;
|
|
98810
|
+
return true;
|
|
98811
|
+
}
|
|
98505
98812
|
function resolveDirectBaseUrl(config2) {
|
|
98506
98813
|
return config2.baseUrl ?? process.env.WORKFLOW_LOCAL_BASE_URL ?? createWorkflowBaseUrl("http://localhost");
|
|
98507
98814
|
}
|
|
@@ -99042,7 +99349,7 @@ async function initDataDir(dataDir) {
|
|
|
99042
99349
|
let otelApiPromise$2 = null;
|
|
99043
99350
|
async function getOtelApi$2() {
|
|
99044
99351
|
if (!otelApiPromise$2) {
|
|
99045
|
-
otelApiPromise$2 = import("./index-
|
|
99352
|
+
otelApiPromise$2 = import("./index-CETb4fkq.js").catch(() => null);
|
|
99046
99353
|
}
|
|
99047
99354
|
return otelApiPromise$2;
|
|
99048
99355
|
}
|
|
@@ -127052,7 +127359,7 @@ function createWorld$1(args) {
|
|
|
127052
127359
|
const tag = mergedConfig.tag;
|
|
127053
127360
|
const queue = createQueue$2(mergedConfig);
|
|
127054
127361
|
const { clearCache: clearStorageCache, ...storage } = createStorage$1(mergedConfig.dataDir, tag);
|
|
127055
|
-
const recoverActiveRuns = mergedConfig
|
|
127362
|
+
const recoverActiveRuns = resolveRecoverActiveRuns(mergedConfig);
|
|
127056
127363
|
return {
|
|
127057
127364
|
specVersion: SPEC_VERSION_CURRENT,
|
|
127058
127365
|
...queue,
|
|
@@ -127088,7 +127395,7 @@ function createWorld$1(args) {
|
|
|
127088
127395
|
const basedir = mergedConfig.dataDir;
|
|
127089
127396
|
const hooksDir = path$3.join(basedir, "hooks");
|
|
127090
127397
|
const taggedHookFiles = await listTaggedFiles(hooksDir, tag);
|
|
127091
|
-
const { HookSchema: HookSchema2 } = await import("./index-
|
|
127398
|
+
const { HookSchema: HookSchema2 } = await import("./index-Dt3nkvmG.js");
|
|
127092
127399
|
await Promise.all(taggedHookFiles.map(async (hookFile) => {
|
|
127093
127400
|
const hook = await readJSON(path$3.join(hooksDir, hookFile), HookSchema2);
|
|
127094
127401
|
if (hook == null ? void 0 : hook.token) {
|
|
@@ -127271,8 +127578,8 @@ function requireGetVercelOidcToken() {
|
|
|
127271
127578
|
}
|
|
127272
127579
|
try {
|
|
127273
127580
|
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
|
|
127274
|
-
await import("./token-util-
|
|
127275
|
-
await import("./token-
|
|
127581
|
+
await import("./token-util-DHXhfd_v.js").then((n) => n.t),
|
|
127582
|
+
await import("./token-BaQZqFlF.js").then((n) => n.t)
|
|
127276
127583
|
]);
|
|
127277
127584
|
if (!token || isExpired(getTokenPayload(token), options == null ? void 0 : options.expirationBufferMs)) {
|
|
127278
127585
|
await refreshToken(options);
|
|
@@ -127899,7 +128206,7 @@ function getDefaultStreamDispatcher() {
|
|
|
127899
128206
|
let otelApiPromise$1 = null;
|
|
127900
128207
|
async function getOtelApi$1() {
|
|
127901
128208
|
if (!otelApiPromise$1) {
|
|
127902
|
-
otelApiPromise$1 = import("./index-
|
|
128209
|
+
otelApiPromise$1 = import("./index-CETb4fkq.js").catch((error2) => {
|
|
127903
128210
|
if (typeof process !== "undefined" && typeof process.env.DEBUG === "string" && (process.env.DEBUG.includes("workflow:") || process.env.DEBUG === "*")) {
|
|
127904
128211
|
console.warn("[workflow] @opentelemetry/api unavailable — world-vercel spans disabled:", error2 instanceof Error ? error2.message : error2);
|
|
127905
128212
|
}
|
|
@@ -127909,9 +128216,42 @@ async function getOtelApi$1() {
|
|
|
127909
128216
|
return otelApiPromise$1;
|
|
127910
128217
|
}
|
|
127911
128218
|
let tracerPromise = null;
|
|
128219
|
+
function workflowDebugEnabled() {
|
|
128220
|
+
return typeof process !== "undefined" && typeof process.env.DEBUG === "string" && (process.env.DEBUG.includes("workflow:") || process.env.DEBUG === "*");
|
|
128221
|
+
}
|
|
128222
|
+
let otelDiagLogged = false;
|
|
128223
|
+
function logOtelDiagnosticOnce(otel, tracer) {
|
|
128224
|
+
var _a3, _b2, _c2, _d2, _e2;
|
|
128225
|
+
if (otelDiagLogged || !workflowDebugEnabled())
|
|
128226
|
+
return;
|
|
128227
|
+
otelDiagLogged = true;
|
|
128228
|
+
try {
|
|
128229
|
+
const g2 = globalThis[Symbol.for("opentelemetry.js.api.1")];
|
|
128230
|
+
const provider = otel.trace.getTracerProvider();
|
|
128231
|
+
const delegate = ((_a3 = provider.getDelegate) == null ? void 0 : _a3.call(provider)) ?? provider;
|
|
128232
|
+
const probe = tracer.startSpan("workflow.otel.probe.world_vercel");
|
|
128233
|
+
console.warn("[workflow:otel-diag] world-vercel", JSON.stringify({
|
|
128234
|
+
globalRegistrationVersion: (g2 == null ? void 0 : g2.version) ?? null,
|
|
128235
|
+
providerCtor: ((_b2 = provider == null ? void 0 : provider.constructor) == null ? void 0 : _b2.name) ?? null,
|
|
128236
|
+
delegateCtor: ((_c2 = delegate == null ? void 0 : delegate.constructor) == null ? void 0 : _c2.name) ?? null,
|
|
128237
|
+
tracerCtor: ((_d2 = tracer == null ? void 0 : tracer.constructor) == null ? void 0 : _d2.name) ?? null,
|
|
128238
|
+
probeCtor: ((_e2 = probe == null ? void 0 : probe.constructor) == null ? void 0 : _e2.name) ?? null,
|
|
128239
|
+
probeRecording: probe.isRecording()
|
|
128240
|
+
}));
|
|
128241
|
+
probe.end();
|
|
128242
|
+
} catch (error2) {
|
|
128243
|
+
console.warn("[workflow:otel-diag] world-vercel failed:", error2 instanceof Error ? error2.message : error2);
|
|
128244
|
+
}
|
|
128245
|
+
}
|
|
127912
128246
|
async function getTracer() {
|
|
127913
128247
|
if (!tracerPromise) {
|
|
127914
|
-
tracerPromise = getOtelApi$1().then((otel) =>
|
|
128248
|
+
tracerPromise = getOtelApi$1().then((otel) => {
|
|
128249
|
+
if (!otel)
|
|
128250
|
+
return null;
|
|
128251
|
+
const tracer = otel.trace.getTracer("workflow");
|
|
128252
|
+
logOtelDiagnosticOnce(otel, tracer);
|
|
128253
|
+
return tracer;
|
|
128254
|
+
});
|
|
127915
128255
|
}
|
|
127916
128256
|
return tracerPromise;
|
|
127917
128257
|
}
|
|
@@ -128021,6 +128361,8 @@ function errorForResponse(status, message2, opts = {}) {
|
|
|
128021
128361
|
return new EntityConflictError(message2);
|
|
128022
128362
|
if (status === 410)
|
|
128023
128363
|
return new RunExpiredError(message2);
|
|
128364
|
+
if (status === 412)
|
|
128365
|
+
return new PreconditionFailedError(message2, { retryAfter });
|
|
128024
128366
|
if (status === 425)
|
|
128025
128367
|
return new TooEarlyError(message2, { retryAfter });
|
|
128026
128368
|
if (status === 429) {
|
|
@@ -128071,6 +128413,15 @@ async function instrumentedFetch(opts) {
|
|
|
128071
128413
|
const label = logLabel ?? url2;
|
|
128072
128414
|
return trace(spanName2 ?? `http ${method}`, { kind: await getSpanKind("CLIENT") }, async (span) => {
|
|
128073
128415
|
var _a3, _b2, _c2;
|
|
128416
|
+
if (spanName2 && HTTP_DEBUG_ENABLED && span) {
|
|
128417
|
+
const ctx = span.spanContext();
|
|
128418
|
+
console.warn("[workflow:otel-diag] span-open", JSON.stringify({
|
|
128419
|
+
spanName: spanName2,
|
|
128420
|
+
traceId: ctx.traceId,
|
|
128421
|
+
spanId: ctx.spanId,
|
|
128422
|
+
recording: span.isRecording()
|
|
128423
|
+
}));
|
|
128424
|
+
}
|
|
128074
128425
|
span == null ? void 0 : span.setAttributes(httpClientSpanAttributes({ method, url: url2, peerService }));
|
|
128075
128426
|
if (attributes)
|
|
128076
128427
|
span == null ? void 0 : span.setAttributes(attributes);
|
|
@@ -128125,7 +128476,7 @@ async function instrumentedFetch(opts) {
|
|
|
128125
128476
|
return response2;
|
|
128126
128477
|
});
|
|
128127
128478
|
}
|
|
128128
|
-
const version = "5.0.0-beta.
|
|
128479
|
+
const version = "5.0.0-beta.31";
|
|
128129
128480
|
const IDEMPOTENT_METHODS = /* @__PURE__ */ new Set(["GET", "HEAD"]);
|
|
128130
128481
|
const MAX_BODY_PARSE_RETRIES = 2;
|
|
128131
128482
|
const BODY_PARSE_RETRY_BASE_MS = 100;
|
|
@@ -128538,171 +128889,6 @@ function createAnalytics(config2) {
|
|
|
128538
128889
|
}
|
|
128539
128890
|
};
|
|
128540
128891
|
}
|
|
128541
|
-
const ENCODING = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
128542
|
-
const DECODE_TABLE = (() => {
|
|
128543
|
-
const table2 = new Int8Array(128).fill(-1);
|
|
128544
|
-
for (let i = 0; i < ENCODING.length; i++) {
|
|
128545
|
-
table2[ENCODING.charCodeAt(i)] = i;
|
|
128546
|
-
}
|
|
128547
|
-
for (let i = 0; i < ENCODING.length; i++) {
|
|
128548
|
-
const lower2 = ENCODING[i].toLowerCase();
|
|
128549
|
-
if (lower2 !== ENCODING[i]) {
|
|
128550
|
-
table2[lower2.charCodeAt(0)] = i;
|
|
128551
|
-
}
|
|
128552
|
-
}
|
|
128553
|
-
return table2;
|
|
128554
|
-
})();
|
|
128555
|
-
const ULID_LENGTH = 26;
|
|
128556
|
-
const ULID_BYTE_LENGTH = 16;
|
|
128557
|
-
const TAG_BIT_MASK = 128;
|
|
128558
|
-
const REGION_MASK = 252;
|
|
128559
|
-
const VERSION_HIGH_MASK = 3;
|
|
128560
|
-
const VERSION_LOW_MASK = 224;
|
|
128561
|
-
const REGION_BYTE_INDEX = 6;
|
|
128562
|
-
const VERSION_LOW_BYTE_INDEX = 7;
|
|
128563
|
-
const VERSION_BIT_WIDTH = 5;
|
|
128564
|
-
const REGION_BIT_WIDTH = 6;
|
|
128565
|
-
const MAX_VERSION = (1 << VERSION_BIT_WIDTH) - 1;
|
|
128566
|
-
const MAX_REGION = (1 << REGION_BIT_WIDTH) - 1;
|
|
128567
|
-
function ulidToBytes(ulid2) {
|
|
128568
|
-
if (typeof ulid2 !== "string") {
|
|
128569
|
-
throw new TypeError(`Expected ULID string, got ${typeof ulid2}`);
|
|
128570
|
-
}
|
|
128571
|
-
if (ulid2.length !== ULID_LENGTH) {
|
|
128572
|
-
throw new Error(`Invalid ULID length: expected ${ULID_LENGTH}, got ${ulid2.length}`);
|
|
128573
|
-
}
|
|
128574
|
-
const values = new Uint8Array(ULID_LENGTH);
|
|
128575
|
-
for (let i = 0; i < ULID_LENGTH; i++) {
|
|
128576
|
-
const code2 = ulid2.charCodeAt(i);
|
|
128577
|
-
const v2 = code2 < 128 ? DECODE_TABLE[code2] : -1;
|
|
128578
|
-
if (v2 < 0) {
|
|
128579
|
-
throw new Error(`Invalid Crockford-Base32 character at index ${i}: ${JSON.stringify(ulid2[i])}`);
|
|
128580
|
-
}
|
|
128581
|
-
values[i] = v2;
|
|
128582
|
-
}
|
|
128583
|
-
if ((values[0] & 24) !== 0) {
|
|
128584
|
-
throw new Error(`Invalid ULID: top 2 bits must be zero (first char > '7'): ${JSON.stringify(ulid2[0])}`);
|
|
128585
|
-
}
|
|
128586
|
-
const out = new Uint8Array(ULID_BYTE_LENGTH);
|
|
128587
|
-
let bitBuf = values[0] & 7;
|
|
128588
|
-
let bitCount = 3;
|
|
128589
|
-
let outIdx = 0;
|
|
128590
|
-
for (let i = 1; i < ULID_LENGTH; i++) {
|
|
128591
|
-
bitBuf = bitBuf << 5 | values[i];
|
|
128592
|
-
bitCount += 5;
|
|
128593
|
-
while (bitCount >= 8) {
|
|
128594
|
-
bitCount -= 8;
|
|
128595
|
-
out[outIdx++] = bitBuf >> bitCount & 255;
|
|
128596
|
-
}
|
|
128597
|
-
}
|
|
128598
|
-
if (outIdx !== ULID_BYTE_LENGTH || bitCount !== 0) {
|
|
128599
|
-
throw new Error("Internal error: ULID bit packing did not consume cleanly");
|
|
128600
|
-
}
|
|
128601
|
-
return out;
|
|
128602
|
-
}
|
|
128603
|
-
function bytesToUlid(bytes) {
|
|
128604
|
-
if (bytes.length !== ULID_BYTE_LENGTH) {
|
|
128605
|
-
throw new Error(`Invalid byte length: expected ${ULID_BYTE_LENGTH}, got ${bytes.length}`);
|
|
128606
|
-
}
|
|
128607
|
-
let bitBuf = 0;
|
|
128608
|
-
let bitCount = 0;
|
|
128609
|
-
bitBuf = 0;
|
|
128610
|
-
bitCount = 2;
|
|
128611
|
-
let out = "";
|
|
128612
|
-
for (let i = 0; i < ULID_BYTE_LENGTH; i++) {
|
|
128613
|
-
bitBuf = bitBuf << 8 | bytes[i];
|
|
128614
|
-
bitCount += 8;
|
|
128615
|
-
while (bitCount >= 5) {
|
|
128616
|
-
bitCount -= 5;
|
|
128617
|
-
out += ENCODING[bitBuf >> bitCount & 31];
|
|
128618
|
-
}
|
|
128619
|
-
}
|
|
128620
|
-
if (out.length !== ULID_LENGTH || bitCount !== 0) {
|
|
128621
|
-
throw new Error("Internal error: ULID bit packing did not flush cleanly");
|
|
128622
|
-
}
|
|
128623
|
-
return out;
|
|
128624
|
-
}
|
|
128625
|
-
const REGION_IDS = {
|
|
128626
|
-
unknown: 0,
|
|
128627
|
-
iad1: 1,
|
|
128628
|
-
sfo1: 2,
|
|
128629
|
-
pdx1: 3,
|
|
128630
|
-
cle1: 4,
|
|
128631
|
-
yul1: 5,
|
|
128632
|
-
gru1: 6,
|
|
128633
|
-
dub1: 7,
|
|
128634
|
-
lhr1: 8,
|
|
128635
|
-
cdg1: 9,
|
|
128636
|
-
fra1: 10,
|
|
128637
|
-
bru1: 11,
|
|
128638
|
-
arn1: 12,
|
|
128639
|
-
hel1: 13,
|
|
128640
|
-
zrh1: 14,
|
|
128641
|
-
cpt1: 15,
|
|
128642
|
-
dxb1: 16,
|
|
128643
|
-
bom1: 17,
|
|
128644
|
-
sin1: 18,
|
|
128645
|
-
hkg1: 19,
|
|
128646
|
-
hnd1: 20,
|
|
128647
|
-
icn1: 21,
|
|
128648
|
-
kix1: 22,
|
|
128649
|
-
syd1: 23
|
|
128650
|
-
};
|
|
128651
|
-
const DEFAULT_REGION_CODE = "iad1";
|
|
128652
|
-
const REGION_CODES_BY_ID = new Map(Object.entries(REGION_IDS).filter((entry2) => entry2[0] !== "unknown").map(([code2, id2]) => [id2, code2]));
|
|
128653
|
-
function lookupRegion(regionId) {
|
|
128654
|
-
return REGION_CODES_BY_ID.get(regionId) ?? null;
|
|
128655
|
-
}
|
|
128656
|
-
function isKnownRegionCode(code2) {
|
|
128657
|
-
return code2 !== void 0 && code2 !== "unknown" && Object.hasOwn(REGION_IDS, code2);
|
|
128658
|
-
}
|
|
128659
|
-
const CURRENT_VERSION = 1;
|
|
128660
|
-
function isRegionCode(value) {
|
|
128661
|
-
return typeof value === "string" && value !== "unknown" && Object.hasOwn(REGION_IDS, value);
|
|
128662
|
-
}
|
|
128663
|
-
function encode(ulid2, region, options = {}) {
|
|
128664
|
-
let regionId;
|
|
128665
|
-
if (typeof region === "number") {
|
|
128666
|
-
if (!Number.isInteger(region) || region < 0 || region > MAX_REGION) {
|
|
128667
|
-
throw new RangeError(`regionId must be an integer in [0, ${MAX_REGION}]; got ${region}`);
|
|
128668
|
-
}
|
|
128669
|
-
regionId = region;
|
|
128670
|
-
} else if (isRegionCode(region)) {
|
|
128671
|
-
regionId = REGION_IDS[region];
|
|
128672
|
-
} else {
|
|
128673
|
-
throw new Error(`Unknown region: ${String(region)}`);
|
|
128674
|
-
}
|
|
128675
|
-
const version2 = options.version ?? CURRENT_VERSION;
|
|
128676
|
-
if (!Number.isInteger(version2) || version2 < 0 || version2 > MAX_VERSION) {
|
|
128677
|
-
throw new RangeError(`version must be an integer in [0, ${MAX_VERSION}]; got ${version2}`);
|
|
128678
|
-
}
|
|
128679
|
-
const bytes = ulidToBytes(ulid2);
|
|
128680
|
-
bytes[0] = bytes[0] | TAG_BIT_MASK;
|
|
128681
|
-
const regionShifted = (regionId & MAX_REGION) << 2;
|
|
128682
|
-
const versionHigh = version2 >> 3 & VERSION_HIGH_MASK;
|
|
128683
|
-
const versionLow = (version2 & 7) << 5;
|
|
128684
|
-
bytes[REGION_BYTE_INDEX] = bytes[REGION_BYTE_INDEX] & -256 | regionShifted | versionHigh;
|
|
128685
|
-
bytes[VERSION_LOW_BYTE_INDEX] = bytes[VERSION_LOW_BYTE_INDEX] & ~VERSION_LOW_MASK | versionLow;
|
|
128686
|
-
return bytesToUlid(bytes);
|
|
128687
|
-
}
|
|
128688
|
-
function decode(taggedUlid) {
|
|
128689
|
-
const bytes = ulidToBytes(taggedUlid);
|
|
128690
|
-
const tagged = (bytes[0] & TAG_BIT_MASK) !== 0;
|
|
128691
|
-
bytes[0] = bytes[0] & ~TAG_BIT_MASK;
|
|
128692
|
-
const ulid2 = bytesToUlid(bytes);
|
|
128693
|
-
if (!tagged) {
|
|
128694
|
-
return { tagged: false, ulid: ulid2, version: null, regionId: null, region: null };
|
|
128695
|
-
}
|
|
128696
|
-
const regionId = (bytes[REGION_BYTE_INDEX] & REGION_MASK) >> 2;
|
|
128697
|
-
const version2 = (bytes[REGION_BYTE_INDEX] & VERSION_HIGH_MASK) << 3 | (bytes[VERSION_LOW_BYTE_INDEX] & VERSION_LOW_MASK) >> 5;
|
|
128698
|
-
return {
|
|
128699
|
-
tagged: true,
|
|
128700
|
-
ulid: ulid2,
|
|
128701
|
-
version: version2,
|
|
128702
|
-
regionId,
|
|
128703
|
-
region: lookupRegion(regionId)
|
|
128704
|
-
};
|
|
128705
|
-
}
|
|
128706
128892
|
const ulid = monotonicFactory();
|
|
128707
128893
|
let lastRunId;
|
|
128708
128894
|
function bumpAboveMetadata(ulidStr) {
|
|
@@ -132701,7 +132887,7 @@ function resolveTelemetryConfig(client2, send2) {
|
|
|
132701
132887
|
var otelApiPromise;
|
|
132702
132888
|
function getOtelApi() {
|
|
132703
132889
|
if (!otelApiPromise) {
|
|
132704
|
-
otelApiPromise = import("./index-
|
|
132890
|
+
otelApiPromise = import("./index-CETb4fkq.js").then(
|
|
132705
132891
|
(mod) => mod,
|
|
132706
132892
|
() => null
|
|
132707
132893
|
);
|
|
@@ -133803,11 +133989,7 @@ function getHeadersFromPayload(payload) {
|
|
|
133803
133989
|
const FLOW_TOPIC_PATTERN = /^__([a-z][a-z0-9]*_)?wkf_workflow_/;
|
|
133804
133990
|
let loggedSequentialReplays = false;
|
|
133805
133991
|
function isSequentialReplaysEnabled() {
|
|
133806
|
-
|
|
133807
|
-
if (explicit !== void 0 && explicit !== "") {
|
|
133808
|
-
return explicit === "1";
|
|
133809
|
-
}
|
|
133810
|
-
return process.env.WORKFLOW_SAFE_MODE === "1";
|
|
133992
|
+
return process.env.WORKFLOW_SEQUENTIAL_REPLAYS === "1";
|
|
133811
133993
|
}
|
|
133812
133994
|
function getPhysicalQueueName(queueName, payload) {
|
|
133813
133995
|
if (!isSequentialReplaysEnabled() || !FLOW_TOPIC_PATTERN.test(queueName)) {
|
|
@@ -134329,6 +134511,11 @@ function buildPostFrameMeta(input) {
|
|
|
134329
134511
|
meta2.stepCount = input.stepCount;
|
|
134330
134512
|
if (input.eventCount !== void 0)
|
|
134331
134513
|
meta2.eventCount = input.eventCount;
|
|
134514
|
+
if (input.rsfs !== void 0)
|
|
134515
|
+
meta2.rsfs = input.rsfs;
|
|
134516
|
+
if (input.finalSchedulingReplay !== void 0) {
|
|
134517
|
+
meta2.finalSchedulingReplay = input.finalSchedulingReplay;
|
|
134518
|
+
}
|
|
134332
134519
|
if (input.optimizations !== void 0) {
|
|
134333
134520
|
meta2.optimizations = input.optimizations;
|
|
134334
134521
|
}
|
|
@@ -134336,6 +134523,9 @@ function buildPostFrameMeta(input) {
|
|
|
134336
134523
|
meta2.sinceCursor = input.sinceCursor;
|
|
134337
134524
|
if (input.skipPreload !== void 0)
|
|
134338
134525
|
meta2.skipPreload = input.skipPreload;
|
|
134526
|
+
if (input.stateUpdatedAt !== void 0) {
|
|
134527
|
+
meta2.stateUpdatedAt = input.stateUpdatedAt;
|
|
134528
|
+
}
|
|
134339
134529
|
return meta2;
|
|
134340
134530
|
}
|
|
134341
134531
|
function errorFromV4Response(statusCode, responseHeaders, errorBody, opName, url2) {
|
|
@@ -134847,6 +135037,12 @@ function splitEventDataForV4(data) {
|
|
|
134847
135037
|
if (typeof eventData.eventCount === "number" && Number.isSafeInteger(eventData.eventCount) && eventData.eventCount > 0) {
|
|
134848
135038
|
meta2.eventCount = eventData.eventCount;
|
|
134849
135039
|
}
|
|
135040
|
+
if (typeof eventData.rsfs === "number") {
|
|
135041
|
+
meta2.rsfs = eventData.rsfs;
|
|
135042
|
+
}
|
|
135043
|
+
if (typeof eventData.finalSchedulingReplay === "number") {
|
|
135044
|
+
meta2.finalSchedulingReplay = eventData.finalSchedulingReplay;
|
|
135045
|
+
}
|
|
134850
135046
|
if (Array.isArray(eventData.optimizations) && eventData.optimizations.every((o) => typeof o === "string")) {
|
|
134851
135047
|
meta2.optimizations = eventData.optimizations;
|
|
134852
135048
|
}
|
|
@@ -134972,6 +135168,7 @@ async function createWorkflowRunEventInner(id2, data, params, config2) {
|
|
|
134972
135168
|
specVersion: data.specVersion ?? 2,
|
|
134973
135169
|
...data.correlationId ? { correlationId: data.correlationId } : {},
|
|
134974
135170
|
...(params == null ? void 0 : params.requestId) ? { vercelId: params.requestId } : {},
|
|
135171
|
+
...(params == null ? void 0 : params.stateUpdatedAt) !== void 0 ? { stateUpdatedAt: params.stateUpdatedAt } : {},
|
|
134975
135172
|
occurredAt: (params == null ? void 0 : params.occurredAt) ?? /* @__PURE__ */ new Date(),
|
|
134976
135173
|
// Opt-in inline-delta: forward the cursor the runtime held before
|
|
134977
135174
|
// this write so the server can return the authoritative event-log
|
|
@@ -158442,7 +158639,7 @@ const route4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
|
|
|
158442
158639
|
__proto__: null,
|
|
158443
158640
|
loader
|
|
158444
158641
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
158445
|
-
const serverManifest = { "entry": { "module": "/assets/entry.client-Q4eUIqMI.js", "imports": ["/assets/index-Q81MFBxC.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-
|
|
158642
|
+
const serverManifest = { "entry": { "module": "/assets/entry.client-Q4eUIqMI.js", "imports": ["/assets/index-Q81MFBxC.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-DfwDd0Zj.js", "imports": ["/assets/index-Q81MFBxC.js", "/assets/mermaid-3ZIDBTTL-g3vDTGSb.js", "/assets/arrow-up-right-B9knAxIp.js"], "css": ["/assets/root-CQggqXow.css", "/assets/mermaid-3ZIDBTTL-DDxQhcP4.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-BasVp7zv.js", "imports": ["/assets/index-Q81MFBxC.js", "/assets/workflow-graph-viewer-VUIB71kS.js", "/assets/mermaid-3ZIDBTTL-g3vDTGSb.js", "/assets/index-STTN0-2V.js"], "css": ["/assets/workflow-graph-viewer-DnlNuQQH.css", "/assets/mermaid-3ZIDBTTL-DDxQhcP4.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-BGMnsQO5.js", "imports": ["/assets/index-Q81MFBxC.js", "/assets/workflow-graph-viewer-VUIB71kS.js", "/assets/mermaid-3ZIDBTTL-g3vDTGSb.js", "/assets/arrow-up-right-B9knAxIp.js", "/assets/encryption-CLVP4klT.js", "/assets/index-STTN0-2V.js"], "css": ["/assets/run-detail-CWoGxu_0.css", "/assets/workflow-graph-viewer-DnlNuQQH.css", "/assets/mermaid-3ZIDBTTL-DDxQhcP4.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-47657566.js", "version": "47657566", "sri": void 0 };
|
|
158446
158643
|
const assetsBuildDirectory = "build/client";
|
|
158447
158644
|
const basename = "/";
|
|
158448
158645
|
const future = { "unstable_optimizeDeps": false, "unstable_subResourceIntegrity": false, "unstable_trailingSlashAwareDataRequests": false, "unstable_previewServerPrerendering": false, "v8_middleware": false, "v8_splitRouteModules": false, "v8_viteEnvironmentApi": false };
|
|
@@ -158511,74 +158708,76 @@ const serverBuild = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
158511
158708
|
ssr
|
|
158512
158709
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
158513
158710
|
export {
|
|
158514
|
-
|
|
158711
|
+
WAIT_EVENT_TYPES as $,
|
|
158515
158712
|
ATTRIBUTE_KEY_MAX_LENGTH as A,
|
|
158516
158713
|
BaseEventSchema as B,
|
|
158517
158714
|
CHILD_ENTITY_CREATION_EVENT_TYPES as C,
|
|
158518
158715
|
DEFAULT_TIMESTAMP_THRESHOLD_FUTURE_MS as D,
|
|
158519
158716
|
EVENT_DATA_PAYLOAD_FIELD_BY_EVENT_TYPE as E,
|
|
158520
|
-
|
|
158521
|
-
|
|
158717
|
+
SPEC_VERSION_SUPPORTS_COMPRESSION as F,
|
|
158718
|
+
STEP_EVENT_TYPES as G,
|
|
158522
158719
|
HookSchema as H,
|
|
158523
|
-
|
|
158524
|
-
|
|
158525
|
-
|
|
158720
|
+
SerializedDataSchema as I,
|
|
158721
|
+
StepInvokePayloadSchema as J,
|
|
158722
|
+
StepSchema as K,
|
|
158526
158723
|
LegacySerializedDataSchemaV1 as L,
|
|
158527
158724
|
MessageId as M,
|
|
158528
158725
|
Nt as N,
|
|
158529
|
-
|
|
158530
|
-
|
|
158726
|
+
StepStatusSchema as O,
|
|
158727
|
+
PARENT_RUN_ID_ATTRIBUTE as P,
|
|
158531
158728
|
QueuePayloadSchema as Q,
|
|
158532
158729
|
RESERVED_ATTRIBUTE_KEY_PREFIX as R,
|
|
158533
158730
|
SPEC_VERSION_CURRENT as S,
|
|
158534
158731
|
TERMINAL_RUN_EVENT_TYPES as T,
|
|
158535
|
-
|
|
158536
|
-
|
|
158537
|
-
|
|
158538
|
-
|
|
158539
|
-
|
|
158540
|
-
|
|
158541
|
-
|
|
158732
|
+
TERMINAL_STEP_EVENT_TYPES as U,
|
|
158733
|
+
TERMINAL_STEP_STATUSES as V,
|
|
158734
|
+
TERMINAL_WORKFLOW_RUN_STATUSES as W,
|
|
158735
|
+
TerminalRunEventTypeSchema as X,
|
|
158736
|
+
TerminalStepStatusSchema as Y,
|
|
158737
|
+
TerminalWorkflowRunStatusSchema as Z,
|
|
158738
|
+
ValidQueueName as _,
|
|
158542
158739
|
ATTRIBUTE_MAX_PER_RUN as a,
|
|
158543
|
-
|
|
158544
|
-
|
|
158545
|
-
|
|
158546
|
-
|
|
158547
|
-
|
|
158548
|
-
|
|
158549
|
-
|
|
158550
|
-
|
|
158551
|
-
|
|
158552
|
-
|
|
158553
|
-
|
|
158554
|
-
|
|
158555
|
-
|
|
158556
|
-
|
|
158557
|
-
|
|
158558
|
-
|
|
158559
|
-
|
|
158560
|
-
|
|
158561
|
-
|
|
158562
|
-
|
|
158563
|
-
|
|
158564
|
-
|
|
158565
|
-
|
|
158566
|
-
|
|
158567
|
-
|
|
158568
|
-
|
|
158569
|
-
|
|
158570
|
-
|
|
158571
|
-
|
|
158572
|
-
|
|
158573
|
-
|
|
158574
|
-
|
|
158575
|
-
|
|
158576
|
-
|
|
158577
|
-
|
|
158578
|
-
|
|
158579
|
-
|
|
158580
|
-
|
|
158581
|
-
|
|
158740
|
+
WaitSchema as a0,
|
|
158741
|
+
WaitStatusSchema as a1,
|
|
158742
|
+
WorkflowInvokePayloadSchema as a2,
|
|
158743
|
+
WorkflowRunBaseSchema as a3,
|
|
158744
|
+
WorkflowRunSchema as a4,
|
|
158745
|
+
WorkflowRunStatusSchema as a5,
|
|
158746
|
+
applyAttributeChanges as a6,
|
|
158747
|
+
envNumber as a7,
|
|
158748
|
+
getEventDataPayloadField as a8,
|
|
158749
|
+
getEventDataRefFields as a9,
|
|
158750
|
+
Qe as aA,
|
|
158751
|
+
registerZstdDecoder as aB,
|
|
158752
|
+
requireTokenUtil as aC,
|
|
158753
|
+
requireTokenError as aD,
|
|
158754
|
+
serverBuild as aE,
|
|
158755
|
+
getQueueTopicPrefix as aa,
|
|
158756
|
+
isChildEntityCreationEvent as ab,
|
|
158757
|
+
isChildEntityCreationEventType as ac,
|
|
158758
|
+
isHookEventRequiringExistence as ad,
|
|
158759
|
+
isHookLifecycleEventType as ae,
|
|
158760
|
+
isLegacySpecVersion as af,
|
|
158761
|
+
isStepEventType as ag,
|
|
158762
|
+
isTerminalRunEventType as ah,
|
|
158763
|
+
isTerminalStepEventType as ai,
|
|
158764
|
+
isTerminalStepStatus as aj,
|
|
158765
|
+
isTerminalWorkflowRunStatus as ak,
|
|
158766
|
+
isWaitEventType as al,
|
|
158767
|
+
parseQueueName as am,
|
|
158768
|
+
reenqueueActiveRuns as an,
|
|
158769
|
+
requiresNewerWorld as ao,
|
|
158770
|
+
resolveQueueNamespace as ap,
|
|
158771
|
+
stripEventDataRefs as aq,
|
|
158772
|
+
ulidToDate as ar,
|
|
158773
|
+
validateAttributeChanges as as,
|
|
158774
|
+
validateAttributeKey as at,
|
|
158775
|
+
validateAttributeValue as au,
|
|
158776
|
+
validateUlidTimestamp as av,
|
|
158777
|
+
workflowRunIdSchema as aw,
|
|
158778
|
+
R as ax,
|
|
158779
|
+
Ks as ay,
|
|
158780
|
+
jsxRuntimeExports as az,
|
|
158582
158781
|
ATTRIBUTE_VALUE_MAX_BYTES as b,
|
|
158583
158782
|
AnalyticsAttributeKeySchema as c,
|
|
158584
158783
|
AnalyticsEventSchema as d,
|
|
@@ -158597,11 +158796,11 @@ export {
|
|
|
158597
158796
|
HOOK_LIFECYCLE_EVENT_TYPES as q,
|
|
158598
158797
|
HealthCheckPayloadSchema as r,
|
|
158599
158798
|
HookCreatedEventSchema as s,
|
|
158600
|
-
|
|
158601
|
-
|
|
158602
|
-
|
|
158603
|
-
|
|
158604
|
-
|
|
158605
|
-
|
|
158606
|
-
|
|
158799
|
+
PaginatedResponseSchema as t,
|
|
158800
|
+
QueuePrefix as u,
|
|
158801
|
+
ROOT_RUN_ID_ATTRIBUTE as v,
|
|
158802
|
+
RunInputSchema as w,
|
|
158803
|
+
SPEC_VERSION_LEGACY as x,
|
|
158804
|
+
SPEC_VERSION_SUPPORTS_ATTRIBUTES as y,
|
|
158805
|
+
SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT as z
|
|
158607
158806
|
};
|