@workflow/web 5.0.0-beta.16 → 5.0.0-beta.18
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/{highlighted-body-B3W2YXNL-QKf7Yrcl.js → highlighted-body-B3W2YXNL-BDAdDO0w.js} +1 -1
- package/build/client/assets/{home-C2tAadK2.js → home-CJauHJtz.js} +2 -2
- package/build/client/assets/index-C7C6cDW5.js +200 -0
- package/build/client/assets/{manifest-96e6bcc7.js → manifest-41c15b7c.js} +1 -1
- package/build/client/assets/{mermaid-3ZIDBTTL-DQJ4rkIZ.js → mermaid-3ZIDBTTL-CO5WTIpO.js} +554 -293
- package/build/client/assets/mermaid-3ZIDBTTL-DYmT7Gxj.css +1 -0
- package/build/client/assets/root-1hd8ZXAx.css +1 -0
- package/build/client/assets/{root-QCHdCGTF.js → root-YgrrwLRm.js} +1 -1
- package/build/client/assets/{run-detail-D4mcR51B.js → run-detail-QryL_6ec.js} +84 -156
- package/build/client/assets/server-build-NFow1VGe.css +1 -0
- package/build/client/assets/{workflow-graph-viewer-BEhdopGj.js → workflow-graph-viewer-DE9gHUqH.js} +1 -1
- package/build/client/assets/zstd-B5R2yJjB.wasm +0 -0
- package/build/client/assets/zstd-browser-decoder-Cf0Zee4U.js +27 -0
- package/build/server/assets/{app-BxW1wRWj.js → app-T6TeeAd2.js} +1 -1
- package/build/server/assets/{highlighted-body-B3W2YXNL-CP6Zp179.js → highlighted-body-B3W2YXNL-8kPdQ9EU.js} +2 -2
- package/build/server/assets/{index-Cxv7xPiz.js → index-Beyp1GBB.js} +27 -26
- package/build/server/assets/index-C7C6cDW5.js +200 -0
- package/build/server/assets/{mermaid-3ZIDBTTL-BMFjZDcW.js → mermaid-3ZIDBTTL-BCwBQ2L6.js} +2 -2
- package/build/server/assets/{server-build-B4JanZE6.js → server-build-Bz4qQd_8.js} +779 -323
- package/build/server/assets/{token-w6r7bnnd.js → token-BxHJXzbi.js} +2 -2
- package/build/server/assets/{token-util-Cw2FB_2n.js → token-util-BuFs3aOE.js} +2 -2
- package/build/server/assets/zstd-browser-decoder-xZ-YX1Lf.js +64 -0
- package/build/server/index.js +1 -1
- package/package.json +7 -7
- package/build/client/assets/mermaid-3ZIDBTTL-CVTQRy2j.css +0 -1
- package/build/client/assets/root-D1iC2mNY.css +0 -1
- package/build/client/assets/server-build-6KQbeuD8.css +0 -1
|
@@ -14,7 +14,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
14
14
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
15
15
|
var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
|
|
16
16
|
var _a2, _b, _c, _d, _listeners, _onabort, _reader, _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, canAdoptWithSpace_fn, canAdopt_fn, canAdoptType_fn, adoptWithSpace_fn, adopt_fn, canUsurpType_fn, canUsurp_fn, usurp_fn, flatten_fn, partsToRegExp_fn, parseGlob_fn, _Minimatch_instances, matchGlobstar_fn, matchGlobStarBodySections_fn, matchOne_fn, _worldPromise, _Run_instances, lazyWorldPromise_get, _encryptionKeyPromise, _resilientStart, getEncryptionKey_fn, getEncryptionKeyLazily_fn, pollReturnValue_fn;
|
|
17
|
-
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-
|
|
17
|
+
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-T6TeeAd2.js";
|
|
18
18
|
import require$$0$4, { PassThrough } from "node:stream";
|
|
19
19
|
import require$$0 from "util";
|
|
20
20
|
import require$$1 from "crypto";
|
|
@@ -30082,6 +30082,25 @@ function formatStepName(name2) {
|
|
|
30082
30082
|
function formatWorkflowName(name2) {
|
|
30083
30083
|
return formatParsedName(parseWorkflowName(name2), name2);
|
|
30084
30084
|
}
|
|
30085
|
+
function workflowDisplayName(name2) {
|
|
30086
|
+
var _a3;
|
|
30087
|
+
return ((_a3 = parseWorkflowName(name2)) == null ? void 0 : _a3.shortName) ?? shortNameFromSanitized("workflow", name2) ?? name2;
|
|
30088
|
+
}
|
|
30089
|
+
function shortNameFromSanitized(tag, name2) {
|
|
30090
|
+
var _a3;
|
|
30091
|
+
if (!name2.startsWith(`${tag}--`))
|
|
30092
|
+
return null;
|
|
30093
|
+
const segments = name2.split("--").filter(Boolean);
|
|
30094
|
+
const functionPart = segments.at(-1);
|
|
30095
|
+
let shortName = (functionPart == null ? void 0 : functionPart.split("-").filter(Boolean).at(-1)) ?? "";
|
|
30096
|
+
if (["default", "__default"].includes(shortName)) {
|
|
30097
|
+
const moduleShortName = (_a3 = segments.at(-2)) == null ? void 0 : _a3.split("-").filter(Boolean).at(-1);
|
|
30098
|
+
if (moduleShortName && moduleShortName !== tag) {
|
|
30099
|
+
shortName = moduleShortName;
|
|
30100
|
+
}
|
|
30101
|
+
}
|
|
30102
|
+
return shortName || null;
|
|
30103
|
+
}
|
|
30085
30104
|
function formatParsedName(parsed, fallback) {
|
|
30086
30105
|
if (!parsed)
|
|
30087
30106
|
return fallback;
|
|
@@ -34642,7 +34661,11 @@ const SerializationFormat$1 = {
|
|
|
34642
34661
|
/** devalue stringify/parse with TextEncoder/TextDecoder */
|
|
34643
34662
|
DEVALUE_V1: "devl",
|
|
34644
34663
|
/** Encrypted payload (inner payload has its own format prefix after decryption) */
|
|
34645
|
-
ENCRYPTED: "encr"
|
|
34664
|
+
ENCRYPTED: "encr",
|
|
34665
|
+
/** Gzip-compressed payload (inner payload has its own format prefix after decompression) */
|
|
34666
|
+
GZIP: "gzip",
|
|
34667
|
+
/** Zstandard-compressed payload (inner payload has its own format prefix after decompression) */
|
|
34668
|
+
ZSTD: "zstd"
|
|
34646
34669
|
};
|
|
34647
34670
|
const FORMAT_PREFIX_LENGTH$1 = 4;
|
|
34648
34671
|
new TextEncoder();
|
|
@@ -34688,6 +34711,71 @@ function isEncryptedData(data) {
|
|
|
34688
34711
|
const prefix = formatDecoder$1.decode(data.subarray(0, FORMAT_PREFIX_LENGTH$1));
|
|
34689
34712
|
return prefix === SerializationFormat$1.ENCRYPTED;
|
|
34690
34713
|
}
|
|
34714
|
+
function isCompressedData(data) {
|
|
34715
|
+
if (!(data instanceof Uint8Array) || data.length < FORMAT_PREFIX_LENGTH$1) {
|
|
34716
|
+
return false;
|
|
34717
|
+
}
|
|
34718
|
+
const prefix = formatDecoder$1.decode(data.subarray(0, FORMAT_PREFIX_LENGTH$1));
|
|
34719
|
+
return prefix === SerializationFormat$1.GZIP || prefix === SerializationFormat$1.ZSTD;
|
|
34720
|
+
}
|
|
34721
|
+
function getNodeZlib$1() {
|
|
34722
|
+
var _a3, _b2;
|
|
34723
|
+
try {
|
|
34724
|
+
return (_b2 = (_a3 = globalThis.process) == null ? void 0 : _a3.getBuiltinModule) == null ? void 0 : _b2.call(_a3, "node:zlib");
|
|
34725
|
+
} catch {
|
|
34726
|
+
return void 0;
|
|
34727
|
+
}
|
|
34728
|
+
}
|
|
34729
|
+
function decompressSyncIfAvailable(format2, payload) {
|
|
34730
|
+
try {
|
|
34731
|
+
const zlib = getNodeZlib$1();
|
|
34732
|
+
if (format2 === SerializationFormat$1.GZIP && (zlib == null ? void 0 : zlib.gunzipSync)) {
|
|
34733
|
+
return new Uint8Array(zlib.gunzipSync(payload));
|
|
34734
|
+
}
|
|
34735
|
+
if (format2 === SerializationFormat$1.ZSTD && (zlib == null ? void 0 : zlib.zstdDecompressSync)) {
|
|
34736
|
+
return new Uint8Array(zlib.zstdDecompressSync(payload));
|
|
34737
|
+
}
|
|
34738
|
+
} catch {
|
|
34739
|
+
}
|
|
34740
|
+
return void 0;
|
|
34741
|
+
}
|
|
34742
|
+
let zstdBrowserDecoder;
|
|
34743
|
+
function registerZstdDecoder(decoder2) {
|
|
34744
|
+
zstdBrowserDecoder = decoder2;
|
|
34745
|
+
}
|
|
34746
|
+
async function decompressAsync(format2, payload) {
|
|
34747
|
+
if (format2 === SerializationFormat$1.ZSTD) {
|
|
34748
|
+
const sync = decompressSyncIfAvailable(format2, payload);
|
|
34749
|
+
if (sync)
|
|
34750
|
+
return sync;
|
|
34751
|
+
if (zstdBrowserDecoder)
|
|
34752
|
+
return zstdBrowserDecoder(payload);
|
|
34753
|
+
throw new Error("zstd-compressed workflow data encountered but no zstd decoder is available. Node.js 22.15+ decodes natively; in the browser register one via registerZstdDecoder (the web o11y package does this).");
|
|
34754
|
+
}
|
|
34755
|
+
const transform2 = new DecompressionStream("gzip");
|
|
34756
|
+
const writer = transform2.writable.getWriter();
|
|
34757
|
+
const writePromise = writer.write(payload).then(() => writer.close());
|
|
34758
|
+
writePromise.catch(() => {
|
|
34759
|
+
});
|
|
34760
|
+
const chunks = [];
|
|
34761
|
+
let total = 0;
|
|
34762
|
+
const reader = transform2.readable.getReader();
|
|
34763
|
+
for (; ; ) {
|
|
34764
|
+
const { done, value } = await reader.read();
|
|
34765
|
+
if (done)
|
|
34766
|
+
break;
|
|
34767
|
+
chunks.push(value);
|
|
34768
|
+
total += value.length;
|
|
34769
|
+
}
|
|
34770
|
+
await writePromise;
|
|
34771
|
+
const out = new Uint8Array(total);
|
|
34772
|
+
let offset2 = 0;
|
|
34773
|
+
for (const chunk of chunks) {
|
|
34774
|
+
out.set(chunk, offset2);
|
|
34775
|
+
offset2 += chunk.length;
|
|
34776
|
+
}
|
|
34777
|
+
return out;
|
|
34778
|
+
}
|
|
34691
34779
|
function hydrateData(value, revivers) {
|
|
34692
34780
|
if (value instanceof Uint8Array) {
|
|
34693
34781
|
if (isEncryptedData(value)) {
|
|
@@ -34698,6 +34786,13 @@ function hydrateData(value, revivers) {
|
|
|
34698
34786
|
const str = new TextDecoder().decode(payload);
|
|
34699
34787
|
return parse$7(str, revivers);
|
|
34700
34788
|
}
|
|
34789
|
+
if (format2 === SerializationFormat$1.GZIP || format2 === SerializationFormat$1.ZSTD) {
|
|
34790
|
+
const inflated = decompressSyncIfAvailable(format2, payload);
|
|
34791
|
+
if (inflated === void 0) {
|
|
34792
|
+
return value;
|
|
34793
|
+
}
|
|
34794
|
+
return hydrateData(inflated, revivers);
|
|
34795
|
+
}
|
|
34701
34796
|
throw new Error(`Unsupported serialization format: ${format2}`);
|
|
34702
34797
|
}
|
|
34703
34798
|
if (Array.isArray(value)) {
|
|
@@ -34706,13 +34801,17 @@ function hydrateData(value, revivers) {
|
|
|
34706
34801
|
return value;
|
|
34707
34802
|
}
|
|
34708
34803
|
async function hydrateDataWithKey(value, revivers, key) {
|
|
34709
|
-
|
|
34804
|
+
let data = value;
|
|
34805
|
+
if (data instanceof Uint8Array && isEncryptedData(data) && key) {
|
|
34710
34806
|
const { decrypt: decrypt2 } = await Promise.resolve().then(() => encryption);
|
|
34711
|
-
const { payload } = decodeFormatPrefix$1(
|
|
34712
|
-
|
|
34713
|
-
return hydrateData(decrypted, revivers);
|
|
34807
|
+
const { payload } = decodeFormatPrefix$1(data);
|
|
34808
|
+
data = await decrypt2(key, payload);
|
|
34714
34809
|
}
|
|
34715
|
-
|
|
34810
|
+
if (data instanceof Uint8Array && isCompressedData(data)) {
|
|
34811
|
+
const { format: format2, payload } = decodeFormatPrefix$1(data);
|
|
34812
|
+
data = await decompressAsync(format2, payload);
|
|
34813
|
+
}
|
|
34814
|
+
return hydrateData(data, revivers);
|
|
34716
34815
|
}
|
|
34717
34816
|
const STREAM_ID_PREFIX = "strm_";
|
|
34718
34817
|
const STREAM_REF_TYPE$1 = "__workflow_stream_ref__";
|
|
@@ -34965,10 +35064,12 @@ const serializationFormat = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object
|
|
|
34965
35064
|
hydrateData,
|
|
34966
35065
|
hydrateDataWithKey,
|
|
34967
35066
|
hydrateResourceIO: hydrateResourceIO$1,
|
|
35067
|
+
isCompressedData,
|
|
34968
35068
|
isEncryptedData,
|
|
34969
35069
|
isExpiredStub,
|
|
34970
35070
|
isRunRef: isRunRef$1,
|
|
34971
35071
|
observabilityRevivers,
|
|
35072
|
+
registerZstdDecoder,
|
|
34972
35073
|
serializedClassToString,
|
|
34973
35074
|
serializedInstanceToRef,
|
|
34974
35075
|
serializedRunToRunRef,
|
|
@@ -49242,7 +49343,8 @@ const SPEC_VERSION_LEGACY = 1;
|
|
|
49242
49343
|
const SPEC_VERSION_SUPPORTS_EVENT_SOURCING = 2;
|
|
49243
49344
|
const SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT = 3;
|
|
49244
49345
|
const SPEC_VERSION_SUPPORTS_ATTRIBUTES = 4;
|
|
49245
|
-
const
|
|
49346
|
+
const SPEC_VERSION_SUPPORTS_COMPRESSION = 5;
|
|
49347
|
+
const SPEC_VERSION_CURRENT = SPEC_VERSION_SUPPORTS_COMPRESSION;
|
|
49246
49348
|
function isLegacySpecVersion(v2) {
|
|
49247
49349
|
return v2 === void 0 || v2 === null || v2 <= SPEC_VERSION_LEGACY;
|
|
49248
49350
|
}
|
|
@@ -49770,6 +49872,8 @@ function replaceEncryptedAndExpiredWithMarkers(resource) {
|
|
|
49770
49872
|
async function hydrateResourceIOWithKey(resource, key) {
|
|
49771
49873
|
const { hydrateDataWithKey: hydrateDataWithKey2 } = await Promise.resolve().then(() => serializationFormat);
|
|
49772
49874
|
const { importKey: importKey2 } = await Promise.resolve().then(() => encryption);
|
|
49875
|
+
const { ensureZstdDecoderRegistered } = await import("./zstd-browser-decoder-xZ-YX1Lf.js");
|
|
49876
|
+
ensureZstdDecoderRegistered();
|
|
49773
49877
|
const cryptoKey = await importKey2(key);
|
|
49774
49878
|
const revivers = getRevivers();
|
|
49775
49879
|
async function decryptField(value, rev, k2) {
|
|
@@ -52287,9 +52391,7 @@ function ReservedBadge() {
|
|
|
52287
52391
|
}
|
|
52288
52392
|
function AttributeRow({ attributeKey, value, removed = false }) {
|
|
52289
52393
|
const reserved = isReservedAttributeKey(attributeKey);
|
|
52290
|
-
return jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-3 py-
|
|
52291
|
-
color: reserved ? "var(--ds-gray-700)" : "var(--ds-gray-900)"
|
|
52292
|
-
}, children: [jsxRuntimeExports.jsx("span", { className: "truncate", children: attributeKey }), reserved && jsxRuntimeExports.jsx(ReservedBadge, {})] }), removed ? jsxRuntimeExports.jsx("span", { className: "shrink-0 text-label-12 italic", style: { color: "var(--ds-gray-700)" }, children: "removed" }) : jsxRuntimeExports.jsx("span", { className: "max-w-[60%] truncate text-right text-label-12 font-mono text-gray-1000", title: value, children: value })] });
|
|
52394
|
+
return jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-3 py-0.5", children: [jsxRuntimeExports.jsxs("span", { className: "flex min-w-0 items-center gap-1.5 text-label-13 text-gray-900", style: reserved ? { color: "var(--ds-gray-700)" } : void 0, children: [jsxRuntimeExports.jsx("span", { className: "truncate", children: attributeKey }), reserved && jsxRuntimeExports.jsx(ReservedBadge, {})] }), removed ? jsxRuntimeExports.jsx("span", { className: "shrink-0 text-copy-13 italic text-gray-700", children: "removed" }) : jsxRuntimeExports.jsx("span", { className: "max-w-[60%] truncate text-copy-13 text-gray-1000", title: value, children: value })] });
|
|
52293
52395
|
}
|
|
52294
52396
|
function sortAttributeKeys(keys2) {
|
|
52295
52397
|
return [...keys2].sort((a2, b2) => {
|
|
@@ -52304,7 +52406,7 @@ function RunAttributesCard({ attributes }) {
|
|
|
52304
52406
|
const keys2 = sortAttributeKeys(Object.keys(attributes));
|
|
52305
52407
|
if (keys2.length === 0)
|
|
52306
52408
|
return null;
|
|
52307
|
-
return jsxRuntimeExports.jsx(DetailCard, { summary:
|
|
52409
|
+
return jsxRuntimeExports.jsx(DetailCard, { summary: "Attributes", defaultOpen: true, contentClassName: "mb-4", children: jsxRuntimeExports.jsx("div", { className: "flex flex-col", children: keys2.map((key) => jsxRuntimeExports.jsx(AttributeRow, { attributeKey: key, value: attributes[key] }, key)) }) });
|
|
52308
52410
|
}
|
|
52309
52411
|
function isAttrSetEventData(data) {
|
|
52310
52412
|
if (data === null || typeof data !== "object")
|
|
@@ -52327,7 +52429,7 @@ function AttrSetEventBlock({ data }) {
|
|
|
52327
52429
|
return jsxRuntimeExports.jsx(CopyableDataBlock, { data });
|
|
52328
52430
|
}
|
|
52329
52431
|
const writerLabel = describeWriter(data.writer);
|
|
52330
|
-
return jsxRuntimeExports.jsxs("div", { className: "flex flex-col px-3 py-1", children: [jsxRuntimeExports.jsx("div", { className: "flex flex-col
|
|
52432
|
+
return jsxRuntimeExports.jsxs("div", { className: "flex flex-col px-3 py-1", children: [jsxRuntimeExports.jsx("div", { className: "flex flex-col", children: data.changes.map((change, index2) => jsxRuntimeExports.jsx(AttributeRow, { attributeKey: change.key, removed: change.value === null, value: change.value ?? void 0 }, `${change.key}:${index2}`)) }), writerLabel && jsxRuntimeExports.jsx("div", { className: "border-t py-1.5 text-label-12", style: {
|
|
52331
52433
|
borderColor: "var(--ds-gray-alpha-400)",
|
|
52332
52434
|
color: "var(--ds-gray-700)"
|
|
52333
52435
|
}, children: writerLabel })] });
|
|
@@ -83123,7 +83225,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
|
|
|
83123
83225
|
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 });
|
|
83124
83226
|
var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
|
|
83125
83227
|
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 }) });
|
|
83126
|
-
var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL-
|
|
83228
|
+
var cn$1 = /\n+$/, dn = reactExports.lazy(() => import("./highlighted-body-B3W2YXNL-8kPdQ9EU.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
|
|
83127
83229
|
let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
|
|
83128
83230
|
`).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
|
|
83129
83231
|
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 }) })] }) });
|
|
@@ -83445,7 +83547,7 @@ var Dt = ({ children: e, className: t, onDownload: o, onError: n }) => {
|
|
|
83445
83547
|
}, []), 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] });
|
|
83446
83548
|
};
|
|
83447
83549
|
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 }) })] });
|
|
83448
|
-
var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-
|
|
83550
|
+
var Jn = reactExports.lazy(() => import("./mermaid-3ZIDBTTL-BCwBQ2L6.js").then((e) => ({ default: e.Mermaid }))), Kn = /language-([^\s]+)/;
|
|
83449
83551
|
function ke(e, t) {
|
|
83450
83552
|
if (!(e != null && e.position || t != null && t.position)) return true;
|
|
83451
83553
|
if (!(e != null && e.position && (t != null && t.position))) return false;
|
|
@@ -84317,7 +84419,8 @@ const copyableBasicAttributes = /* @__PURE__ */ new Set([
|
|
|
84317
84419
|
"stepId",
|
|
84318
84420
|
"hookId",
|
|
84319
84421
|
"eventId",
|
|
84320
|
-
"deploymentId"
|
|
84422
|
+
"deploymentId",
|
|
84423
|
+
"moduleSpecifier"
|
|
84321
84424
|
]);
|
|
84322
84425
|
const AttributeBlock = ({ attribute, value, isLoading, inline = false, context }) => {
|
|
84323
84426
|
const decryptCtx = reactExports.useContext(DecryptClickContext);
|
|
@@ -84346,7 +84449,6 @@ const AttributeBlock = ({ attribute, value, isLoading, inline = false, context }
|
|
|
84346
84449
|
return jsxRuntimeExports.jsxs("div", { className: "relative", children: [typeof isLoading === "boolean" && isLoading && jsxRuntimeExports.jsx("div", { className: "absolute top-9 right-4", children: jsxRuntimeExports.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2", style: { borderColor: "var(--ds-gray-900)" } }) }), jsxRuntimeExports.jsxs("div", { className: "my-2 flex flex-col gap-0", children: [jsxRuntimeExports.jsx("span", { className: "text-label-14 text-gray-1000 font-medium first-letter:uppercase", children: attribute }), jsxRuntimeExports.jsx("span", { className: "text-xs", style: { color: "var(--ds-gray-1000)" }, children: displayValue })] }, attribute)] });
|
|
84347
84450
|
};
|
|
84348
84451
|
const AttributePanel = ({ data, moduleSpecifier, isLoading, error: error2, expiredAt, onStreamClick, onRunClick, onDecrypt, isDecrypting = false, resource }) => {
|
|
84349
|
-
const toast2 = useToast();
|
|
84350
84452
|
const displayData = reactExports.useMemo(() => {
|
|
84351
84453
|
const result = { ...data };
|
|
84352
84454
|
const execCtx = data.executionContext;
|
|
@@ -84408,13 +84510,6 @@ const AttributePanel = ({ data, moduleSpecifier, isLoading, error: error2, expir
|
|
|
84408
84510
|
const displayContext = reactExports.useMemo(() => ({
|
|
84409
84511
|
stepName: displayData.stepName
|
|
84410
84512
|
}), [displayData.stepName]);
|
|
84411
|
-
const handleCopyModuleSpecifier = reactExports.useCallback((value) => {
|
|
84412
|
-
navigator.clipboard.writeText(value).then(() => {
|
|
84413
|
-
toast2.success("moduleSpecifier copied");
|
|
84414
|
-
}).catch(() => {
|
|
84415
|
-
toast2.error("Failed to copy moduleSpecifier");
|
|
84416
|
-
});
|
|
84417
|
-
}, []);
|
|
84418
84513
|
const outerDecryptCtx = reactExports.useContext(DecryptClickContext);
|
|
84419
84514
|
const decryptValue = onDecrypt ? {
|
|
84420
84515
|
onDecrypt,
|
|
@@ -84424,17 +84519,8 @@ const AttributePanel = ({ data, moduleSpecifier, isLoading, error: error2, expir
|
|
|
84424
84519
|
return jsxRuntimeExports.jsx(ContextCardProvider, { children: jsxRuntimeExports.jsx(RunClickContext.Provider, { value: onRunClick, children: jsxRuntimeExports.jsx(StreamClickContext.Provider, { value: onStreamClick, children: jsxRuntimeExports.jsxs(DecryptClickContext.Provider, { value: decryptValue, children: [visibleBasicAttributes.length > 0 && jsxRuntimeExports.jsxs("div", { className: "flex flex-col overflow-hidden divide-y divide-gray-alpha-400 mb-3", children: [orderedBasicAttributes.map((attribute) => {
|
|
84425
84520
|
var _a3;
|
|
84426
84521
|
const displayValue = (_a3 = attributeToDisplayFn[attribute]) == null ? void 0 : _a3.call(attributeToDisplayFn, displayData[attribute]);
|
|
84427
|
-
const isModuleSpecifier = attribute === "moduleSpecifier";
|
|
84428
84522
|
const isCopyableBasicAttribute = copyableBasicAttributes.has(attribute) && typeof displayValue === "string";
|
|
84429
|
-
|
|
84430
|
-
return jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between py-2", children: [jsxRuntimeExports.jsx("span", { className: "text-label-14 text-gray-900", children: getAttributeDisplayName(attribute) }), isModuleSpecifier ? jsxRuntimeExports.jsx("button", { type: "button", className: "min-w-0 max-w-[70%] truncate text-right text-label-13 font-mono", style: {
|
|
84431
|
-
color: "var(--ds-gray-1000)",
|
|
84432
|
-
background: "transparent",
|
|
84433
|
-
border: "none",
|
|
84434
|
-
padding: 0
|
|
84435
|
-
}, title: moduleSpecifierValue, onClick: () => handleCopyModuleSpecifier(moduleSpecifierValue), children: moduleSpecifierValue }) : isCopyableBasicAttribute ? jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 max-w-[70%] items-center justify-end gap-1 text-right text-[13px] font-mono", style: {
|
|
84436
|
-
color: "var(--ds-gray-1000)"
|
|
84437
|
-
}, title: displayValue, children: [jsxRuntimeExports.jsx(MiddleTruncate, { value: displayValue, className: "flex-1" }), jsxRuntimeExports.jsx(CopyButton, { copyText: displayValue, ariaLabel: `Copy ${getAttributeDisplayName(attribute)}`, className: "shrink-0 -mr-1" })] }) : jsxRuntimeExports.jsx("span", { className: "text-right text-label-13 font-mono", children: displayValue })] }, attribute);
|
|
84523
|
+
return jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between py-2", children: [jsxRuntimeExports.jsx("span", { className: "text-label-14 text-gray-900", children: getAttributeDisplayName(attribute) }), isCopyableBasicAttribute ? jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 max-w-[70%] items-center justify-end gap-1 text-[13px] font-mono text-gray-1000", title: displayValue, children: [jsxRuntimeExports.jsx(MiddleTruncate, { value: displayValue, className: "text-right", style: { gridTemplateColumns: "minmax(0, 1fr)" } }), jsxRuntimeExports.jsx(CopyButton, { copyText: displayValue, ariaLabel: `Copy ${getAttributeDisplayName(attribute)}`, className: "shrink-0 -mr-1" })] }) : jsxRuntimeExports.jsx("span", { className: "text-right text-label-13 font-mono", children: displayValue })] }, attribute);
|
|
84438
84524
|
}), isLoading && resource === "sleep" && !displayData.resumeAt && jsxRuntimeExports.jsx("div", { className: "py-1", children: jsxRuntimeExports.jsxs("div", { className: "flex min-h-[32px] items-center justify-between gap-4 rounded-sm px-2.5 py-1", children: [jsxRuntimeExports.jsx("span", { className: "text-[14px] first-letter:uppercase", style: { color: "var(--ds-gray-700)" }, children: "resumeAt" }), jsxRuntimeExports.jsx(Skeleton$2, { className: "h-4 w-[55%]" })] }) })] }), error2 ? jsxRuntimeExports.jsx(ErrorCard, { title: "Failed to load resource details", details: error2.message, className: "my-4" }) : hasExpired ? jsxRuntimeExports.jsx(ExpiredDataMessage, {}) : resolvedAttributes.length > 0 ? jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: resolvedAttributes.map((attribute) => jsxRuntimeExports.jsx(AttributeBlock, { isLoading, attribute, value: displayData[attribute], context: displayContext }, attribute)) }) : null] }) }) }) });
|
|
84439
84525
|
};
|
|
84440
84526
|
const ERROR_EVENT_TYPES = /* @__PURE__ */ new Set(["step_failed", "step_retrying"]);
|
|
@@ -84841,127 +84927,127 @@ const TraceViewerContext = reactExports.createContext({
|
|
|
84841
84927
|
TraceViewerContext.displayName = "TraceViewerContext";
|
|
84842
84928
|
const useTraceViewer = () => reactExports.useContext(TraceViewerContext);
|
|
84843
84929
|
reactExports.createContext(null);
|
|
84844
|
-
const traceNode = "
|
|
84845
|
-
const childRow = "
|
|
84846
|
-
const spanNode = "
|
|
84847
|
-
const huge = "
|
|
84848
|
-
const spanName = "
|
|
84849
|
-
const spanSpacer = "
|
|
84850
|
-
const spanDuration = "
|
|
84851
|
-
const small = "
|
|
84852
|
-
const xHover = "
|
|
84853
|
-
const spanNodeEvent = "
|
|
84854
|
-
const eventDiamond = "
|
|
84855
|
-
const customEventColor = "
|
|
84856
|
-
const hoverInfo = "
|
|
84857
|
-
const eventName = "
|
|
84858
|
-
const eventTimestamp = "
|
|
84859
|
-
const alignStart = "
|
|
84860
|
-
const alignEnd = "
|
|
84861
|
-
const colorVercel = "
|
|
84862
|
-
const color0 = "
|
|
84863
|
-
const color1 = "
|
|
84864
|
-
const color2 = "
|
|
84865
|
-
const color3 = "
|
|
84866
|
-
const color4 = "
|
|
84867
|
-
const colorHighlight = "
|
|
84868
|
-
const unlit = "
|
|
84869
|
-
const mapContainer = "
|
|
84870
|
-
const spanDetailPanel = "
|
|
84871
|
-
const spanDetailPanelResizer = "
|
|
84872
|
-
const spanDetailPanelTop = "
|
|
84873
|
-
const spanDetailPanelBody = "
|
|
84874
|
-
const spanDetailPanelTopInfo = "
|
|
84875
|
-
const spanNameDetailPanel = "
|
|
84876
|
-
const spanDetailPanelTruncatedHeading = "
|
|
84877
|
-
const spanDetailPanelName = "
|
|
84878
|
-
const spanDetailPanelDuration = "
|
|
84879
|
-
const spanDetailPanelCorner = "
|
|
84880
|
-
const spanDetailPanelCornerInner = "
|
|
84881
|
-
const spanDetailPanelCloseVerticalRule = "
|
|
84882
|
-
const spanDetailPanelClose = "
|
|
84883
|
-
const spanDetailPanelAttribute = "
|
|
84884
|
-
const spanDetailPanelAttributeKey = "
|
|
84885
|
-
const spanDetailPanelAttributeValue = "
|
|
84886
|
-
const spanDetailPanelQuickLink = "
|
|
84887
|
-
const spanDetailPanelQuickLinkLabel = "
|
|
84888
|
-
const detailGroup = "
|
|
84889
|
-
const expanded = "
|
|
84890
|
-
const collapsed = "
|
|
84891
|
-
const ancestorGroup = "
|
|
84892
|
-
const detailHeading = "
|
|
84893
|
-
const buttonLink = "
|
|
84894
|
-
const note = "
|
|
84895
|
-
const skeleton = "
|
|
84896
|
-
const skeletonRounded = "
|
|
84897
|
-
const detailHeadingIcon = "
|
|
84898
|
-
const infraSpanDescription = "
|
|
84899
|
-
const ancestorNode = "
|
|
84900
|
-
const ancestorText = "
|
|
84901
|
-
const ancestorName = "
|
|
84902
|
-
const ancestorDuration = "
|
|
84903
|
-
const ancestorLineContainer = "
|
|
84904
|
-
const ancestorLine = "
|
|
84905
|
-
const zoomButtonGroup = "
|
|
84906
|
-
const zoomButton = "
|
|
84907
|
-
const divider = "
|
|
84908
|
-
const markersContainer = "
|
|
84909
|
-
const markers = "
|
|
84910
|
-
const marker = "
|
|
84911
|
-
const notch = "
|
|
84912
|
-
const markerLabel = "
|
|
84913
|
-
const markerClockTime = "
|
|
84914
|
-
const eventMarkersContainer = "
|
|
84915
|
-
const eventMarkers = "
|
|
84916
|
-
const eventMarker = "
|
|
84917
|
-
const cursorMarkerStickyParent = "
|
|
84918
|
-
const cursorMarkerLabelContainer = "
|
|
84919
|
-
const cursorMarkerLabel = "
|
|
84920
|
-
const cursorMarkerContainer = "
|
|
84921
|
-
const cursorMarker = "
|
|
84922
|
-
const cursorSelection = "
|
|
84923
|
-
const traceViewer = "
|
|
84924
|
-
const mapCanvas = "
|
|
84925
|
-
const zoomButtonTraceViewer = "
|
|
84926
|
-
const timeline = "
|
|
84927
|
-
const searchBar = "
|
|
84928
|
-
const searchInput = "
|
|
84929
|
-
const searchInputLabel = "
|
|
84930
|
-
const searchInputPrefix = "
|
|
84931
|
-
const mapThumb = "
|
|
84932
|
-
const spanDetailPanelTraceViewer = "
|
|
84933
|
-
const traceViewerContent = "
|
|
84934
|
-
const inert = "
|
|
84935
|
-
const hidden = "
|
|
84936
|
-
const mobile = "
|
|
84937
|
-
const spanRunning = "
|
|
84938
|
-
const spanPending = "
|
|
84939
|
-
const spanCompleted = "
|
|
84940
|
-
const spanCancelled = "
|
|
84941
|
-
const spanFailed = "
|
|
84942
|
-
const spanPendingStriped = "
|
|
84943
|
-
const hasQueuedTime = "
|
|
84944
|
-
const spanSleep = "
|
|
84945
|
-
const spanHook = "
|
|
84946
|
-
const segmentLayer = "
|
|
84947
|
-
const segment = "
|
|
84948
|
-
const segmentLabel = "
|
|
84949
|
-
const segmentTag = "
|
|
84950
|
-
const segQueued = "
|
|
84951
|
-
const segRunning = "
|
|
84952
|
-
const segFailed = "
|
|
84953
|
-
const segRetrying = "
|
|
84954
|
-
const segSucceeded = "
|
|
84955
|
-
const segWaiting = "
|
|
84956
|
-
const segSleeping = "
|
|
84957
|
-
const segReceived = "
|
|
84958
|
-
const boundaryMarker = "
|
|
84959
|
-
const boundaryLine = "
|
|
84960
|
-
const hasSegments = "
|
|
84961
|
-
const eventFailed = "
|
|
84962
|
-
const eventRetrying = "
|
|
84963
|
-
const eventHook = "
|
|
84964
|
-
const eventDefault = "
|
|
84930
|
+
const traceNode = "_traceNode_1ytrx_1";
|
|
84931
|
+
const childRow = "_childRow_1ytrx_5";
|
|
84932
|
+
const spanNode = "_spanNode_1ytrx_11";
|
|
84933
|
+
const huge = "_huge_1ytrx_31";
|
|
84934
|
+
const spanName = "_spanName_1ytrx_34";
|
|
84935
|
+
const spanSpacer = "_spanSpacer_1ytrx_40";
|
|
84936
|
+
const spanDuration = "_spanDuration_1ytrx_44";
|
|
84937
|
+
const small = "_small_1ytrx_62";
|
|
84938
|
+
const xHover = "_xHover_1ytrx_62";
|
|
84939
|
+
const spanNodeEvent = "_spanNodeEvent_1ytrx_118";
|
|
84940
|
+
const eventDiamond = "_eventDiamond_1ytrx_124";
|
|
84941
|
+
const customEventColor = "_customEventColor_1ytrx_140";
|
|
84942
|
+
const hoverInfo = "_hoverInfo_1ytrx_145";
|
|
84943
|
+
const eventName = "_eventName_1ytrx_149";
|
|
84944
|
+
const eventTimestamp = "_eventTimestamp_1ytrx_153";
|
|
84945
|
+
const alignStart = "_alignStart_1ytrx_174";
|
|
84946
|
+
const alignEnd = "_alignEnd_1ytrx_178";
|
|
84947
|
+
const colorVercel = "_colorVercel_1ytrx_205";
|
|
84948
|
+
const color0 = "_color0_1ytrx_213";
|
|
84949
|
+
const color1 = "_color1_1ytrx_220";
|
|
84950
|
+
const color2 = "_color2_1ytrx_227";
|
|
84951
|
+
const color3 = "_color3_1ytrx_234";
|
|
84952
|
+
const color4 = "_color4_1ytrx_241";
|
|
84953
|
+
const colorHighlight = "_colorHighlight_1ytrx_248";
|
|
84954
|
+
const unlit = "_unlit_1ytrx_256";
|
|
84955
|
+
const mapContainer = "_mapContainer_1ytrx_262";
|
|
84956
|
+
const spanDetailPanel = "_spanDetailPanel_1ytrx_329";
|
|
84957
|
+
const spanDetailPanelResizer = "_spanDetailPanelResizer_1ytrx_338";
|
|
84958
|
+
const spanDetailPanelTop = "_spanDetailPanelTop_1ytrx_353";
|
|
84959
|
+
const spanDetailPanelBody = "_spanDetailPanelBody_1ytrx_362";
|
|
84960
|
+
const spanDetailPanelTopInfo = "_spanDetailPanelTopInfo_1ytrx_375";
|
|
84961
|
+
const spanNameDetailPanel = "_spanNameDetailPanel_1ytrx_389";
|
|
84962
|
+
const spanDetailPanelTruncatedHeading = "_spanDetailPanelTruncatedHeading_1ytrx_395";
|
|
84963
|
+
const spanDetailPanelName = "_spanDetailPanelName_1ytrx_405";
|
|
84964
|
+
const spanDetailPanelDuration = "_spanDetailPanelDuration_1ytrx_416";
|
|
84965
|
+
const spanDetailPanelCorner = "_spanDetailPanelCorner_1ytrx_427";
|
|
84966
|
+
const spanDetailPanelCornerInner = "_spanDetailPanelCornerInner_1ytrx_437";
|
|
84967
|
+
const spanDetailPanelCloseVerticalRule = "_spanDetailPanelCloseVerticalRule_1ytrx_445";
|
|
84968
|
+
const spanDetailPanelClose = "_spanDetailPanelClose_1ytrx_445";
|
|
84969
|
+
const spanDetailPanelAttribute = "_spanDetailPanelAttribute_1ytrx_467";
|
|
84970
|
+
const spanDetailPanelAttributeKey = "_spanDetailPanelAttributeKey_1ytrx_484";
|
|
84971
|
+
const spanDetailPanelAttributeValue = "_spanDetailPanelAttributeValue_1ytrx_492";
|
|
84972
|
+
const spanDetailPanelQuickLink = "_spanDetailPanelQuickLink_1ytrx_503";
|
|
84973
|
+
const spanDetailPanelQuickLinkLabel = "_spanDetailPanelQuickLinkLabel_1ytrx_506";
|
|
84974
|
+
const detailGroup = "_detailGroup_1ytrx_519";
|
|
84975
|
+
const expanded = "_expanded_1ytrx_533";
|
|
84976
|
+
const collapsed = "_collapsed_1ytrx_534";
|
|
84977
|
+
const ancestorGroup = "_ancestorGroup_1ytrx_535";
|
|
84978
|
+
const detailHeading = "_detailHeading_1ytrx_539";
|
|
84979
|
+
const buttonLink = "_buttonLink_1ytrx_562";
|
|
84980
|
+
const note = "_note_1ytrx_581";
|
|
84981
|
+
const skeleton = "_skeleton_1ytrx_589";
|
|
84982
|
+
const skeletonRounded = "_skeletonRounded_1ytrx_595";
|
|
84983
|
+
const detailHeadingIcon = "_detailHeadingIcon_1ytrx_599";
|
|
84984
|
+
const infraSpanDescription = "_infraSpanDescription_1ytrx_603";
|
|
84985
|
+
const ancestorNode = "_ancestorNode_1ytrx_613";
|
|
84986
|
+
const ancestorText = "_ancestorText_1ytrx_629";
|
|
84987
|
+
const ancestorName = "_ancestorName_1ytrx_639";
|
|
84988
|
+
const ancestorDuration = "_ancestorDuration_1ytrx_644";
|
|
84989
|
+
const ancestorLineContainer = "_ancestorLineContainer_1ytrx_649";
|
|
84990
|
+
const ancestorLine = "_ancestorLine_1ytrx_649";
|
|
84991
|
+
const zoomButtonGroup = "_zoomButtonGroup_1ytrx_701";
|
|
84992
|
+
const zoomButton = "_zoomButton_1ytrx_701";
|
|
84993
|
+
const divider = "_divider_1ytrx_751";
|
|
84994
|
+
const markersContainer = "_markersContainer_1ytrx_758";
|
|
84995
|
+
const markers = "_markers_1ytrx_758";
|
|
84996
|
+
const marker = "_marker_1ytrx_758";
|
|
84997
|
+
const notch = "_notch_1ytrx_792";
|
|
84998
|
+
const markerLabel = "_markerLabel_1ytrx_798";
|
|
84999
|
+
const markerClockTime = "_markerClockTime_1ytrx_807";
|
|
85000
|
+
const eventMarkersContainer = "_eventMarkersContainer_1ytrx_816";
|
|
85001
|
+
const eventMarkers = "_eventMarkers_1ytrx_816";
|
|
85002
|
+
const eventMarker = "_eventMarker_1ytrx_816";
|
|
85003
|
+
const cursorMarkerStickyParent = "_cursorMarkerStickyParent_1ytrx_839";
|
|
85004
|
+
const cursorMarkerLabelContainer = "_cursorMarkerLabelContainer_1ytrx_848";
|
|
85005
|
+
const cursorMarkerLabel = "_cursorMarkerLabel_1ytrx_848";
|
|
85006
|
+
const cursorMarkerContainer = "_cursorMarkerContainer_1ytrx_898";
|
|
85007
|
+
const cursorMarker = "_cursorMarker_1ytrx_839";
|
|
85008
|
+
const cursorSelection = "_cursorSelection_1ytrx_916";
|
|
85009
|
+
const traceViewer = "_traceViewer_1ytrx_966";
|
|
85010
|
+
const mapCanvas = "_mapCanvas_1ytrx_972";
|
|
85011
|
+
const zoomButtonTraceViewer = "_zoomButtonTraceViewer_1ytrx_988";
|
|
85012
|
+
const timeline = "_timeline_1ytrx_1011";
|
|
85013
|
+
const searchBar = "_searchBar_1ytrx_1019";
|
|
85014
|
+
const searchInput = "_searchInput_1ytrx_1031";
|
|
85015
|
+
const searchInputLabel = "_searchInputLabel_1ytrx_1038";
|
|
85016
|
+
const searchInputPrefix = "_searchInputPrefix_1ytrx_1063";
|
|
85017
|
+
const mapThumb = "_mapThumb_1ytrx_1101";
|
|
85018
|
+
const spanDetailPanelTraceViewer = "_spanDetailPanelTraceViewer_1ytrx_1115";
|
|
85019
|
+
const traceViewerContent = "_traceViewerContent_1ytrx_1134";
|
|
85020
|
+
const inert = "_inert_1ytrx_1144";
|
|
85021
|
+
const hidden = "_hidden_1ytrx_1180";
|
|
85022
|
+
const mobile = "_mobile_1ytrx_1184";
|
|
85023
|
+
const spanRunning = "_spanRunning_1ytrx_1194";
|
|
85024
|
+
const spanPending = "_spanPending_1ytrx_1195";
|
|
85025
|
+
const spanCompleted = "_spanCompleted_1ytrx_1203";
|
|
85026
|
+
const spanCancelled = "_spanCancelled_1ytrx_1211";
|
|
85027
|
+
const spanFailed = "_spanFailed_1ytrx_1219";
|
|
85028
|
+
const spanPendingStriped = "_spanPendingStriped_1ytrx_1228";
|
|
85029
|
+
const hasQueuedTime = "_hasQueuedTime_1ytrx_1242";
|
|
85030
|
+
const spanSleep = "_spanSleep_1ytrx_1254";
|
|
85031
|
+
const spanHook = "_spanHook_1ytrx_1263";
|
|
85032
|
+
const segmentLayer = "_segmentLayer_1ytrx_1275";
|
|
85033
|
+
const segment = "_segment_1ytrx_1275";
|
|
85034
|
+
const segmentLabel = "_segmentLabel_1ytrx_1291";
|
|
85035
|
+
const segmentTag = "_segmentTag_1ytrx_1306";
|
|
85036
|
+
const segQueued = "_segQueued_1ytrx_1314";
|
|
85037
|
+
const segRunning = "_segRunning_1ytrx_1325";
|
|
85038
|
+
const segFailed = "_segFailed_1ytrx_1330";
|
|
85039
|
+
const segRetrying = "_segRetrying_1ytrx_1335";
|
|
85040
|
+
const segSucceeded = "_segSucceeded_1ytrx_1346";
|
|
85041
|
+
const segWaiting = "_segWaiting_1ytrx_1351";
|
|
85042
|
+
const segSleeping = "_segSleeping_1ytrx_1362";
|
|
85043
|
+
const segReceived = "_segReceived_1ytrx_1367";
|
|
85044
|
+
const boundaryMarker = "_boundaryMarker_1ytrx_1372";
|
|
85045
|
+
const boundaryLine = "_boundaryLine_1ytrx_1373";
|
|
85046
|
+
const hasSegments = "_hasSegments_1ytrx_1395";
|
|
85047
|
+
const eventFailed = "_eventFailed_1ytrx_1432";
|
|
85048
|
+
const eventRetrying = "_eventRetrying_1ytrx_1441";
|
|
85049
|
+
const eventHook = "_eventHook_1ytrx_1450";
|
|
85050
|
+
const eventDefault = "_eventDefault_1ytrx_1459";
|
|
84965
85051
|
const styles$2 = {
|
|
84966
85052
|
traceNode,
|
|
84967
85053
|
childRow,
|
|
@@ -85025,7 +85111,7 @@ const styles$2 = {
|
|
|
85025
85111
|
ancestorLineContainer,
|
|
85026
85112
|
ancestorLine,
|
|
85027
85113
|
zoomButtonGroup,
|
|
85028
|
-
"zoom-buttons-fade-in": "_zoom-buttons-fade-
|
|
85114
|
+
"zoom-buttons-fade-in": "_zoom-buttons-fade-in_1ytrx_1",
|
|
85029
85115
|
zoomButton,
|
|
85030
85116
|
divider,
|
|
85031
85117
|
markersContainer,
|
|
@@ -85044,7 +85130,7 @@ const styles$2 = {
|
|
|
85044
85130
|
cursorMarker,
|
|
85045
85131
|
cursorSelection,
|
|
85046
85132
|
traceViewer,
|
|
85047
|
-
"span-skeleton": "_span-
|
|
85133
|
+
"span-skeleton": "_span-skeleton_1ytrx_1",
|
|
85048
85134
|
mapCanvas,
|
|
85049
85135
|
zoomButtonTraceViewer,
|
|
85050
85136
|
timeline,
|
|
@@ -86437,7 +86523,7 @@ function computeStepSegmentsFromSpan(startMs, duration2, events2) {
|
|
|
86437
86523
|
"step_completed"
|
|
86438
86524
|
]);
|
|
86439
86525
|
if (marks.length === 0) {
|
|
86440
|
-
segments.push({ startFraction: 0, endFraction: 1, status: "
|
|
86526
|
+
segments.push({ startFraction: 0, endFraction: 1, status: "queued" });
|
|
86441
86527
|
return segments;
|
|
86442
86528
|
}
|
|
86443
86529
|
const firstFraction = timeToFraction(marks[0].time, startMs, duration2);
|
|
@@ -86462,7 +86548,7 @@ function computeStepSegmentsFromSpan(startMs, duration2, events2) {
|
|
|
86462
86548
|
});
|
|
86463
86549
|
} else {
|
|
86464
86550
|
const nextType = nextMark.type;
|
|
86465
|
-
const attemptStatus = nextType === "step_retrying" || nextType === "step_failed" ? "failed" : nextType === "step_completed" ? "succeeded" : "
|
|
86551
|
+
const attemptStatus = nextType === "step_retrying" || nextType === "step_failed" ? "failed" : nextType === "step_completed" ? "succeeded" : "retrying";
|
|
86466
86552
|
segments.push({
|
|
86467
86553
|
startFraction: markFrac,
|
|
86468
86554
|
endFraction: nextFrac,
|
|
@@ -86491,35 +86577,16 @@ function computeHookSegmentsFromSpan(startMs, duration2, events2) {
|
|
|
86491
86577
|
const segments = [];
|
|
86492
86578
|
if (duration2 <= 0)
|
|
86493
86579
|
return segments;
|
|
86494
|
-
const
|
|
86495
|
-
const received = sorted.find((e) => e.name === "hook_received");
|
|
86496
|
-
const disposed = sorted.find((e) => e.name === "hook_disposed");
|
|
86497
|
-
if (!received && !disposed) {
|
|
86498
|
-
segments.push({ startFraction: 0, endFraction: 1, status: "waiting" });
|
|
86499
|
-
return segments;
|
|
86500
|
-
}
|
|
86501
|
-
const receivedFrac = received ? timeToFraction(received.time, startMs, duration2) : null;
|
|
86580
|
+
const disposed = sortedEventMarks(events2, ["hook_disposed"])[0];
|
|
86502
86581
|
const disposedFrac = disposed ? timeToFraction(disposed.time, startMs, duration2) : null;
|
|
86503
|
-
|
|
86582
|
+
const waitingEnd = disposedFrac ?? 1;
|
|
86583
|
+
if (waitingEnd > 1e-3) {
|
|
86504
86584
|
segments.push({
|
|
86505
86585
|
startFraction: 0,
|
|
86506
|
-
endFraction:
|
|
86507
|
-
status: "waiting"
|
|
86508
|
-
});
|
|
86509
|
-
} else if (receivedFrac === null && disposedFrac !== null) {
|
|
86510
|
-
segments.push({
|
|
86511
|
-
startFraction: 0,
|
|
86512
|
-
endFraction: disposedFrac,
|
|
86586
|
+
endFraction: waitingEnd,
|
|
86513
86587
|
status: "waiting"
|
|
86514
86588
|
});
|
|
86515
86589
|
}
|
|
86516
|
-
if (receivedFrac !== null) {
|
|
86517
|
-
segments.push({
|
|
86518
|
-
startFraction: receivedFrac,
|
|
86519
|
-
endFraction: disposedFrac ?? 1,
|
|
86520
|
-
status: "received"
|
|
86521
|
-
});
|
|
86522
|
-
}
|
|
86523
86590
|
if (disposedFrac !== null && disposedFrac < 0.999) {
|
|
86524
86591
|
segments.push({
|
|
86525
86592
|
startFraction: disposedFrac,
|
|
@@ -86610,6 +86677,33 @@ function computeSpanSegments(span) {
|
|
|
86610
86677
|
return [];
|
|
86611
86678
|
}
|
|
86612
86679
|
}
|
|
86680
|
+
const MARKER_EVENT_NAMES = ["hook_received", "attr_set"];
|
|
86681
|
+
function computeSpanMarkers(span) {
|
|
86682
|
+
return sortedEventMarks(span.events, MARKER_EVENT_NAMES).map((mark2) => ({
|
|
86683
|
+
timeMs: mark2.time
|
|
86684
|
+
}));
|
|
86685
|
+
}
|
|
86686
|
+
function computeOffscreenMarkers(markers2, visibleStartMs, visibleEndMs) {
|
|
86687
|
+
let leftCount = 0;
|
|
86688
|
+
let rightCount = 0;
|
|
86689
|
+
let nearestLeft = Number.NEGATIVE_INFINITY;
|
|
86690
|
+
let nearestRight = Number.POSITIVE_INFINITY;
|
|
86691
|
+
for (const { timeMs } of markers2) {
|
|
86692
|
+
if (timeMs < visibleStartMs) {
|
|
86693
|
+
leftCount++;
|
|
86694
|
+
if (timeMs > nearestLeft)
|
|
86695
|
+
nearestLeft = timeMs;
|
|
86696
|
+
} else if (timeMs > visibleEndMs) {
|
|
86697
|
+
rightCount++;
|
|
86698
|
+
if (timeMs < nearestRight)
|
|
86699
|
+
nearestRight = timeMs;
|
|
86700
|
+
}
|
|
86701
|
+
}
|
|
86702
|
+
return {
|
|
86703
|
+
left: leftCount > 0 ? { count: leftCount, nearestMs: nearestLeft } : null,
|
|
86704
|
+
right: rightCount > 0 ? { count: rightCount, nearestMs: nearestRight } : null
|
|
86705
|
+
};
|
|
86706
|
+
}
|
|
86613
86707
|
const INITIAL_VISIBLE_ROWS = 60;
|
|
86614
86708
|
function getScrollParent(el) {
|
|
86615
86709
|
let node2 = (el == null ? void 0 : el.parentElement) ?? null;
|
|
@@ -86658,6 +86752,30 @@ function useRowWindow(ref, rowCount, rowHeight, overscan = 12) {
|
|
|
86658
86752
|
return range2;
|
|
86659
86753
|
}
|
|
86660
86754
|
const ROW_HEIGHT_PX = 40;
|
|
86755
|
+
function scrollRowIntoView(listEl, index2, rowHeight, opts) {
|
|
86756
|
+
const scroller = listEl ? getScrollParent(listEl) : null;
|
|
86757
|
+
if (!listEl || !scroller)
|
|
86758
|
+
return;
|
|
86759
|
+
const margin = (opts == null ? void 0 : opts.margin) ?? rowHeight;
|
|
86760
|
+
const listOffset = listEl.getBoundingClientRect().top - scroller.getBoundingClientRect().top + scroller.scrollTop;
|
|
86761
|
+
const rowTop = listOffset + index2 * rowHeight;
|
|
86762
|
+
const rowBottom = rowTop + rowHeight;
|
|
86763
|
+
const viewTop = scroller.scrollTop;
|
|
86764
|
+
const viewBottom = viewTop + scroller.clientHeight;
|
|
86765
|
+
let top = null;
|
|
86766
|
+
if (rowTop < viewTop) {
|
|
86767
|
+
top = rowTop - margin;
|
|
86768
|
+
} else if (rowBottom > viewBottom) {
|
|
86769
|
+
top = rowBottom + margin - scroller.clientHeight;
|
|
86770
|
+
}
|
|
86771
|
+
if (top === null)
|
|
86772
|
+
return;
|
|
86773
|
+
const max2 = scroller.scrollHeight - scroller.clientHeight;
|
|
86774
|
+
scroller.scrollTo({
|
|
86775
|
+
top: Math.max(0, Math.min(top, max2)),
|
|
86776
|
+
behavior: opts == null ? void 0 : opts.behavior
|
|
86777
|
+
});
|
|
86778
|
+
}
|
|
86661
86779
|
const eventStyles = {
|
|
86662
86780
|
run: { icon: WorkflowIcon, className: "text-blue-900" },
|
|
86663
86781
|
step: { icon: StepForwardIcon, className: "text-green-900" },
|
|
@@ -86789,6 +86907,51 @@ function SplitPane({ children: children2, className, defaultStartWidth = DEFAULT
|
|
|
86789
86907
|
}
|
|
86790
86908
|
return jsxRuntimeExports.jsxs("div", { ref: setContainerRef, className: cn$4("grid h-full min-h-0 content-start overflow-x-hidden overflow-y-auto", isDragging && "select-none", className), style: { gridTemplateColumns: colTemplate, height: "100%" }, children: [start2, gutter, end] });
|
|
86791
86909
|
}
|
|
86910
|
+
function projectMarkers(markers2, visibleStartMs, visibleEndMs) {
|
|
86911
|
+
const visibleDurationMs = visibleEndMs - visibleStartMs;
|
|
86912
|
+
if (visibleDurationMs <= 0)
|
|
86913
|
+
return [];
|
|
86914
|
+
return markers2.flatMap((m2) => {
|
|
86915
|
+
if (m2.timeMs < visibleStartMs || m2.timeMs > visibleEndMs) {
|
|
86916
|
+
return [];
|
|
86917
|
+
}
|
|
86918
|
+
return [
|
|
86919
|
+
{
|
|
86920
|
+
leftPct: (m2.timeMs - visibleStartMs) / visibleDurationMs * 100,
|
|
86921
|
+
timeMs: m2.timeMs
|
|
86922
|
+
}
|
|
86923
|
+
];
|
|
86924
|
+
});
|
|
86925
|
+
}
|
|
86926
|
+
const MARKER_MIN_GAP_PX = 16;
|
|
86927
|
+
function cullCollidingMarkers(projected, pixelWidth) {
|
|
86928
|
+
const kept = [];
|
|
86929
|
+
let lastKeptPct = Number.NEGATIVE_INFINITY;
|
|
86930
|
+
for (const m2 of projected) {
|
|
86931
|
+
const gapPx = (m2.leftPct - lastKeptPct) / 100 * pixelWidth;
|
|
86932
|
+
if (gapPx < MARKER_MIN_GAP_PX)
|
|
86933
|
+
continue;
|
|
86934
|
+
kept.push(m2);
|
|
86935
|
+
lastKeptPct = m2.leftPct;
|
|
86936
|
+
}
|
|
86937
|
+
return kept;
|
|
86938
|
+
}
|
|
86939
|
+
function MarkerTick({ className }) {
|
|
86940
|
+
return jsxRuntimeExports.jsx("span", { className: cn$4("block w-[3px] rounded-full bg-gray-1000", className) });
|
|
86941
|
+
}
|
|
86942
|
+
function MarkerLayer({ markers: markers2 }) {
|
|
86943
|
+
return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: markers2.map((m2) => jsxRuntimeExports.jsx("span", { className: "pointer-events-auto absolute top-0 bottom-0 z-10 flex w-8 -translate-x-1/2 items-center justify-center", style: { left: `clamp(8px, ${m2.leftPct}%, calc(100% - 8px))` }, children: jsxRuntimeExports.jsx(TimestampTooltip, { date: m2.timeMs, children: jsxRuntimeExports.jsx("span", { className: "flex h-6 w-8 items-center justify-center", children: jsxRuntimeExports.jsx(MarkerTick, { className: "h-3" }) }) }) }, m2.timeMs)) });
|
|
86944
|
+
}
|
|
86945
|
+
function OffscreenMarkerIndicator({ direction, count: count2, targetMs, onReveal }) {
|
|
86946
|
+
const Chevron = direction === "right" ? ArrowRight : ArrowLeft;
|
|
86947
|
+
const label = `${count2} marker${count2 === 1 ? "" : "s"} ${direction === "right" ? "ahead" : "behind"} — click to scroll to ${count2 === 1 ? "it" : "the nearest"}`;
|
|
86948
|
+
const chevron = jsxRuntimeExports.jsx("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center", children: jsxRuntimeExports.jsx(Chevron, { className: "size-3 text-gray-900" }) });
|
|
86949
|
+
const tick = jsxRuntimeExports.jsx(MarkerTick, { className: "h-3.5 shrink-0" });
|
|
86950
|
+
return jsxRuntimeExports.jsx("button", { type: "button", "aria-label": label, title: label, onClick: (e) => {
|
|
86951
|
+
e.stopPropagation();
|
|
86952
|
+
onReveal == null ? void 0 : onReveal(targetMs);
|
|
86953
|
+
}, className: cn$4("pointer-events-auto absolute top-1/2 z-20 flex h-6 -translate-y-1/2 cursor-pointer items-center rounded-[0.25rem] border border-gray-alpha-400 bg-background-100 shadow-sm hover:bg-gray-100", direction === "right" ? "right-0 pl-1.5" : "left-0 pr-1.5"), children: direction === "left" ? jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [chevron, tick] }) : jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [tick, chevron] }) });
|
|
86954
|
+
}
|
|
86792
86955
|
const runningStripes = "_runningStripes_62ud0_1";
|
|
86793
86956
|
const styles$1 = {
|
|
86794
86957
|
runningStripes
|
|
@@ -86799,7 +86962,7 @@ const TIMELINE_PADDING_PX = 16;
|
|
|
86799
86962
|
const SEGMENT_CLASSES = {
|
|
86800
86963
|
queued: "bg-gray-400 border border-gray-500",
|
|
86801
86964
|
retrying: "bg-gray-400 border border-gray-500",
|
|
86802
|
-
waiting: "bg-gray-
|
|
86965
|
+
waiting: "bg-gray-200 border border-gray-500",
|
|
86803
86966
|
running: "bg-blue-200 border border-blue-500",
|
|
86804
86967
|
completed: "bg-blue-200 border border-blue-500",
|
|
86805
86968
|
failed: "bg-red-200 border border-red-500",
|
|
@@ -86880,8 +87043,8 @@ function projectSegments(segments, spanStartMs, spanDurationMs, geometry) {
|
|
|
86880
87043
|
];
|
|
86881
87044
|
});
|
|
86882
87045
|
}
|
|
86883
|
-
function DurationLabel({ label }) {
|
|
86884
|
-
return jsxRuntimeExports.jsx("span", { className: "pointer-events-none absolute inset-0 flex items-center justify-start overflow-hidden px-1 text-[10px] font-mono font-medium leading-none whitespace-nowrap text-left text-gray-1000 tabular-nums opacity-0 group-hover/timeline-row:opacity-100", children: label });
|
|
87046
|
+
function DurationLabel({ label, className }) {
|
|
87047
|
+
return jsxRuntimeExports.jsx("span", { className: cn$4("pointer-events-none absolute inset-0 flex items-center justify-start overflow-hidden px-1 text-[10px] font-mono font-medium leading-none whitespace-nowrap text-left text-gray-1000 tabular-nums opacity-0 group-hover/timeline-row:opacity-100", className), children: label });
|
|
86885
87048
|
}
|
|
86886
87049
|
function BoundaryArrow({ direction }) {
|
|
86887
87050
|
const Icon2 = direction === "right" ? ArrowRight : ArrowLeft;
|
|
@@ -86896,15 +87059,18 @@ function LeadInConnector({ leftPct, widthPct, label }) {
|
|
|
86896
87059
|
width: `calc(${widthPct}% - 1px)`
|
|
86897
87060
|
}, children: [jsxRuntimeExports.jsx("div", { className: "absolute left-0 top-1/2 h-4 w-px -translate-y-1/2 bg-gray-500" }), jsxRuntimeExports.jsx("div", { className: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-gray-500" }), label ? jsxRuntimeExports.jsx(DurationLabel, { label }) : null] });
|
|
86898
87061
|
}
|
|
86899
|
-
function SegmentBar({ segments }) {
|
|
87062
|
+
function SegmentBar({ segments, showLabels = true }) {
|
|
86900
87063
|
return jsxRuntimeExports.jsx("div", { className: "relative h-6 w-full", children: segments.map((seg, i) => {
|
|
86901
87064
|
if (seg.status === "queued") {
|
|
86902
87065
|
const leadInLabel = formatDurationPrecise(seg.fullDurationMs);
|
|
86903
|
-
const showLeadInLabel = seg.pixelWidth >= Math.max(40, leadInLabel.length * 6 + 12);
|
|
86904
|
-
|
|
87066
|
+
const showLeadInLabel = showLabels && seg.pixelWidth >= Math.max(40, leadInLabel.length * 6 + 12);
|
|
87067
|
+
const isFullWidthQueued = segments.length === 1;
|
|
87068
|
+
return jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [jsxRuntimeExports.jsx(LeadInConnector, { leftPct: seg.leftPct, widthPct: seg.widthPct, label: showLeadInLabel ? leadInLabel : null }), isFullWidthQueued ? jsxRuntimeExports.jsx("div", { className: "absolute top-1/2 h-4 w-px -translate-y-1/2 bg-gray-500", style: {
|
|
87069
|
+
left: `calc(${seg.leftPct + seg.widthPct}% - 1.5px)`
|
|
87070
|
+
} }) : null] }, i);
|
|
86905
87071
|
}
|
|
86906
87072
|
const label = formatDurationPrecise(seg.fullDurationMs);
|
|
86907
|
-
const showLabel = seg.pixelWidth >= Math.max(40, label.length * 6 + 12);
|
|
87073
|
+
const showLabel = showLabels && seg.pixelWidth >= Math.max(40, label.length * 6 + 12);
|
|
86908
87074
|
return jsxRuntimeExports.jsxs("div", { className: cn$4("absolute h-full overflow-hidden rounded-[0.25rem]", SEGMENT_CLASSES[seg.status]), style: {
|
|
86909
87075
|
// 1px gap between adjacent segments, distributed equally.
|
|
86910
87076
|
left: `calc(${seg.leftPct}% + 0.5px)`,
|
|
@@ -86913,31 +87079,7 @@ function SegmentBar({ segments }) {
|
|
|
86913
87079
|
}, children: [ACTIVE_SEGMENT_STATUSES.has(seg.status) ? jsxRuntimeExports.jsx(RunningStripes, {}) : null, showLabel ? jsxRuntimeExports.jsx(DurationLabel, { label }) : null] }, i);
|
|
86914
87080
|
}) });
|
|
86915
87081
|
}
|
|
86916
|
-
function
|
|
86917
|
-
const date2 = new Date(ms2);
|
|
86918
|
-
return date2.toLocaleTimeString("en-US", {
|
|
86919
|
-
hour: "2-digit",
|
|
86920
|
-
minute: "2-digit",
|
|
86921
|
-
second: "2-digit",
|
|
86922
|
-
hour12: false
|
|
86923
|
-
}) + "." + date2.getMilliseconds().toString().padStart(3, "0");
|
|
86924
|
-
}
|
|
86925
|
-
function AttrSetMarkers({ span, viewStart, viewDuration }) {
|
|
86926
|
-
const markers2 = reactExports.useMemo(() => span.events.filter((e) => e.name === "attr_set"), [span.events]);
|
|
86927
|
-
if (markers2.length === 0 || viewDuration <= 0)
|
|
86928
|
-
return null;
|
|
86929
|
-
return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: markers2.map((event, index2) => {
|
|
86930
|
-
const timeMs = getHighResInMs(event.timestamp);
|
|
86931
|
-
const frac = (timeMs - viewStart) / viewDuration;
|
|
86932
|
-
if (frac < 0 || frac > 1)
|
|
86933
|
-
return null;
|
|
86934
|
-
return jsxRuntimeExports.jsxs(Tooltip$1, { children: [jsxRuntimeExports.jsx(TooltipTrigger$1, { asChild: true, children: jsxRuntimeExports.jsx("div", { "aria-label": "Attributes set", className: "absolute top-1/2 z-10 flex h-4 w-4 -translate-x-1/2 -translate-y-1/2 cursor-pointer items-center justify-center", style: { left: `${frac * 100}%` }, children: jsxRuntimeExports.jsx("div", { className: "h-2 w-2 rotate-45 rounded-[1px] border", style: {
|
|
86935
|
-
backgroundColor: "var(--ds-teal-400)",
|
|
86936
|
-
borderColor: "var(--ds-teal-900)"
|
|
86937
|
-
} }) }) }), jsxRuntimeExports.jsxs(TooltipContent$1, { children: ["Attributes set · ", formatMarkerTime(timeMs)] })] }, `attr-set-${index2}`);
|
|
86938
|
-
}) });
|
|
86939
|
-
}
|
|
86940
|
-
const TimelineBar = reactExports.memo(function TimelineBar2({ span, viewStart, viewDuration, containerWidth, isSelected, isDimmed, onSelect }) {
|
|
87082
|
+
const TimelineBar = reactExports.memo(function TimelineBar2({ span, viewStart, viewDuration, containerWidth, isSelected, isDimmed, onSelect, onRevealTime }) {
|
|
86941
87083
|
var _a3;
|
|
86942
87084
|
const startMs = getHighResInMs(span.startTime);
|
|
86943
87085
|
const endMs = getHighResInMs(span.endTime);
|
|
@@ -86945,6 +87087,10 @@ const TimelineBar = reactExports.memo(function TimelineBar2({ span, viewStart, v
|
|
|
86945
87087
|
const geometry = reactExports.useMemo(() => computeBarGeometry(startMs, endMs, viewStart, viewStart + viewDuration, containerWidth), [startMs, endMs, viewStart, viewDuration, containerWidth]);
|
|
86946
87088
|
const baseSegments = reactExports.useMemo(() => computeSpanSegments(span), [span]);
|
|
86947
87089
|
const segments = reactExports.useMemo(() => geometry.mode.kind === "full" ? projectSegments(baseSegments, startMs, totalDurationMs, geometry) : [], [geometry, baseSegments, startMs, totalDurationMs]);
|
|
87090
|
+
const baseMarkers = reactExports.useMemo(() => computeSpanMarkers(span), [span]);
|
|
87091
|
+
const markers2 = reactExports.useMemo(() => geometry.mode.kind === "full" ? cullCollidingMarkers(projectMarkers(baseMarkers, geometry.visibleStartMs, geometry.visibleEndMs), geometry.visiblePixelWidth) : [], [geometry, baseMarkers]);
|
|
87092
|
+
const offscreen = reactExports.useMemo(() => geometry.mode.kind === "full" ? computeOffscreenMarkers(baseMarkers, geometry.visibleStartMs, geometry.visibleEndMs) : { left: null, right: null }, [geometry, baseMarkers]);
|
|
87093
|
+
const hasMarkers = markers2.length > 0 || offscreen.left !== null || offscreen.right !== null;
|
|
86948
87094
|
const workflowStatus = (_a3 = span.attributes.data) == null ? void 0 : _a3.status;
|
|
86949
87095
|
const isErrored = span.status.code === 2 || workflowStatus === "failed";
|
|
86950
87096
|
const colors = getResourceColor(span.resource);
|
|
@@ -86955,7 +87101,11 @@ const TimelineBar = reactExports.memo(function TimelineBar2({ span, viewStart, v
|
|
|
86955
87101
|
const handleClick = reactExports.useCallback(() => {
|
|
86956
87102
|
onSelect(span.spanId);
|
|
86957
87103
|
}, [onSelect, span.spanId]);
|
|
86958
|
-
return jsxRuntimeExports.jsx("div", { role: "treeitem", "aria-selected": isSelected, "aria-expanded": isSelected, "aria-level": 1, className: cn$4("group/timeline-row h-10 relative flex items-center hover:bg-gray-100 aria-selected:bg-gray-100 aria-selected:hover:bg-gray-200 transition-opacity", isDimmed && "opacity-35"), onClick: handleClick, children: jsxRuntimeExports.jsxs("div", { className: "absolute inset-y-0", style: TIMELINE_INSET_STYLE, children: [jsxRuntimeExports.jsx("div", { className: "absolute top-1/2 h-6 -translate-y-1/2 rounded-[0.25rem]", style: getBarPositionStyle(geometry), children: geometry.mode.kind === "arrow" ? jsxRuntimeExports.jsx(BoundaryArrow, { direction: geometry.mode.direction }) : geometry.mode.kind === "tiny" ? jsxRuntimeExports.jsx("div", { className: "h-6 rounded-[0.25rem] border", style: { background: fallbackBg, borderColor: fallbackBorder } }) : segments.length > 0 ? jsxRuntimeExports.jsx(SegmentBar, { segments }) : jsxRuntimeExports.jsx(PlainBar, { bg: fallbackBg, border: fallbackBorder, label: showTotalLabel ? totalLabel : null }) }), jsxRuntimeExports.
|
|
87104
|
+
return jsxRuntimeExports.jsx("div", { role: "treeitem", "aria-selected": isSelected, "aria-expanded": isSelected, "aria-level": 1, className: cn$4("group/timeline-row h-10 relative flex items-center hover:bg-gray-100 aria-selected:bg-gray-100 aria-selected:hover:bg-gray-200 transition-opacity", isDimmed && "opacity-35"), onClick: handleClick, children: jsxRuntimeExports.jsxs("div", { className: "absolute inset-y-0", style: TIMELINE_INSET_STYLE, children: [jsxRuntimeExports.jsx("div", { className: "absolute top-1/2 h-6 -translate-y-1/2 overflow-hidden rounded-[0.25rem]", style: getBarPositionStyle(geometry), children: geometry.mode.kind === "arrow" ? jsxRuntimeExports.jsx(BoundaryArrow, { direction: geometry.mode.direction }) : geometry.mode.kind === "tiny" ? jsxRuntimeExports.jsx("div", { className: "h-6 rounded-[0.25rem] border", style: { background: fallbackBg, borderColor: fallbackBorder } }) : segments.length > 0 ? jsxRuntimeExports.jsx(SegmentBar, { segments, showLabels: !hasMarkers }) : jsxRuntimeExports.jsx(PlainBar, { bg: fallbackBg, border: fallbackBorder, label: showTotalLabel ? totalLabel : null }) }), hasMarkers ? jsxRuntimeExports.jsxs("div", { className: "pointer-events-none absolute top-1/2 h-6 -translate-y-1/2", style: getBarPositionStyle(geometry), children: [markers2.length > 0 ? jsxRuntimeExports.jsx(MarkerLayer, { markers: markers2 }) : null, offscreen.left ? jsxRuntimeExports.jsx(OffscreenMarkerIndicator, { direction: "left", count: offscreen.left.count, targetMs: offscreen.left.nearestMs, onReveal: onRevealTime }) : null, offscreen.right ? jsxRuntimeExports.jsx(OffscreenMarkerIndicator, { direction: "right", count: offscreen.right.count, targetMs: offscreen.right.nearestMs, onReveal: onRevealTime }) : null, showTotalLabel ? jsxRuntimeExports.jsx(DurationLabel, {
|
|
87105
|
+
label: totalLabel,
|
|
87106
|
+
// Shift clear of the left edge indicator so it isn't covered.
|
|
87107
|
+
className: offscreen.left ? "pl-10" : void 0
|
|
87108
|
+
}) : null] }) : null] }) });
|
|
86959
87109
|
});
|
|
86960
87110
|
const DELTA_CAP_HEIGHT_PX = 8;
|
|
86961
87111
|
const DELTA_ROW_OFFSET_PX = 8;
|
|
@@ -86971,7 +87121,7 @@ const DeltaIndicator = reactExports.memo(function DeltaIndicator2({ leftFrac, ri
|
|
|
86971
87121
|
function TimelineHeader({ markers: markers2, hoverInfo: hoverInfo2 }) {
|
|
86972
87122
|
return jsxRuntimeExports.jsx("div", { className: "relative bg-background-100 border-b border-gray-alpha-400 h-10 min-h-10 flex items-end px-4 pb-1", children: jsxRuntimeExports.jsxs("div", { className: "relative h-full flex-1", children: [markers2.map((m2) => jsxRuntimeExports.jsx("span", { className: "absolute bottom-1 font-mono text-xs font-normal leading-4 text-gray-900 whitespace-nowrap", style: { left: `${m2.position * 100}%` }, children: m2.label }, String(m2.value))), hoverInfo2 && jsxRuntimeExports.jsx("span", { className: "absolute top-1 pointer-events-none z-10 font-mono text-[11px] leading-4 text-gray-1000 whitespace-nowrap bg-background-100 border border-gray-alpha-400 rounded px-1 -translate-x-1/2", style: { left: `${hoverInfo2.fraction * 100}%` }, children: hoverInfo2.label })] }) });
|
|
86973
87123
|
}
|
|
86974
|
-
function Timeline({ spans, viewStart, viewEnd, markers: markers2, selectedId, searchResult, onSelect, hoverFraction, altHeld = false }) {
|
|
87124
|
+
function Timeline({ spans, viewStart, viewEnd, markers: markers2, selectedId, searchResult, onSelect, onRevealTime, hoverFraction, altHeld = false }) {
|
|
86975
87125
|
const containerRef = reactExports.useRef(null);
|
|
86976
87126
|
const [containerWidth, setContainerWidth] = reactExports.useState(0);
|
|
86977
87127
|
const viewDuration = viewEnd - viewStart;
|
|
@@ -86991,7 +87141,7 @@ function Timeline({ spans, viewStart, viewEnd, markers: markers2, selectedId, se
|
|
|
86991
87141
|
return jsxRuntimeExports.jsxs("div", { ref: containerRef, className: "relative h-full overflow-hidden", style: { minHeight: spans.length * ROW_HEIGHT_PX }, children: [jsxRuntimeExports.jsx("div", { "aria-hidden": true, className: "absolute inset-y-0 pointer-events-none", style: TIMELINE_INSET_STYLE, children: markers2.map((marker2) => (
|
|
86992
87142
|
// Skip the "0s" origin marker since the left edge already implies it.
|
|
86993
87143
|
Math.abs(marker2.value) > 1e-6 ? jsxRuntimeExports.jsx("div", { className: "absolute top-0 bottom-0 w-px bg-gray-alpha-300", style: { left: `${marker2.position * 100}%` } }, String(marker2.value)) : null
|
|
86994
|
-
)) }), hoverFraction != null && jsxRuntimeExports.jsx("div", { className: "absolute inset-y-0 pointer-events-none z-10", style: TIMELINE_INSET_STYLE, children: jsxRuntimeExports.jsx("div", { className: "absolute top-0 bottom-0 w-px bg-gray-alpha-500", style: { left: `${hoverFraction * 100}%` } }) }), jsxRuntimeExports.jsx("div", { style: { transform: `translateY(${start2 * ROW_HEIGHT_PX}px)` }, children: spans.slice(start2, end).map((span) => jsxRuntimeExports.jsx(TimelineBar, { span, viewStart, viewDuration, containerWidth: timelineWidth, isSelected: selectedId === span.spanId, isDimmed: isSpanDimmedBySearch(span.spanId, searchResult), onSelect }, span.spanId)) }), altHeld && jsxRuntimeExports.jsx("div", { "aria-hidden": true, className: "absolute inset-y-0 pointer-events-none", style: TIMELINE_INSET_STYLE, children: gaps.map((gap) => jsxRuntimeExports.jsx(DeltaIndicator, { leftFrac: gap.leftFrac, rightFrac: gap.rightFrac, label: formatDuration(gap.gapMs, true), rowIndex: gap.rowIndex }, gap.rowIndex)) })] });
|
|
87144
|
+
)) }), hoverFraction != null && jsxRuntimeExports.jsx("div", { className: "absolute inset-y-0 pointer-events-none z-10", style: TIMELINE_INSET_STYLE, children: jsxRuntimeExports.jsx("div", { className: "absolute top-0 bottom-0 w-px bg-gray-alpha-500", style: { left: `${hoverFraction * 100}%` } }) }), jsxRuntimeExports.jsx("div", { style: { transform: `translateY(${start2 * ROW_HEIGHT_PX}px)` }, children: spans.slice(start2, end).map((span) => jsxRuntimeExports.jsx(TimelineBar, { span, viewStart, viewDuration, containerWidth: timelineWidth, isSelected: selectedId === span.spanId, isDimmed: isSpanDimmedBySearch(span.spanId, searchResult), onSelect, onRevealTime }, span.spanId)) }), altHeld && jsxRuntimeExports.jsx("div", { "aria-hidden": true, className: "absolute inset-y-0 pointer-events-none", style: TIMELINE_INSET_STYLE, children: gaps.map((gap) => jsxRuntimeExports.jsx(DeltaIndicator, { leftFrac: gap.leftFrac, rightFrac: gap.rightFrac, label: formatDuration(gap.gapMs, true), rowIndex: gap.rowIndex }, gap.rowIndex)) })] });
|
|
86995
87145
|
}
|
|
86996
87146
|
const ActiveSpanContext = reactExports.createContext(null);
|
|
86997
87147
|
ActiveSpanContext.displayName = "ActiveSpanContext";
|
|
@@ -87037,6 +87187,7 @@ const useActiveSpan = () => {
|
|
|
87037
87187
|
return context;
|
|
87038
87188
|
};
|
|
87039
87189
|
const MIN_VIEWPORT_MS = 1e-3;
|
|
87190
|
+
const ZOOM_DEBOUNCE_MS = 150;
|
|
87040
87191
|
function useAnimatedViewport(initial) {
|
|
87041
87192
|
const [viewport, setViewportState] = reactExports.useState(initial);
|
|
87042
87193
|
const animRef = reactExports.useRef(null);
|
|
@@ -87113,6 +87264,7 @@ function NewTraceViewerContent({ trace: trace2, onLoadMore, hasMore, isLoadingMo
|
|
|
87113
87264
|
const { activeSpan, activeSpanId, setActiveSpan, clearActiveSpan } = useActiveSpan();
|
|
87114
87265
|
const sidebar = useSidebarData();
|
|
87115
87266
|
const selectedSpan = useSelectedSpanInfo();
|
|
87267
|
+
const reducedMotion = useReducedMotion();
|
|
87116
87268
|
const [searchQuery, setSearchQuery] = reactExports.useState("");
|
|
87117
87269
|
const deferredSearchQuery = reactExports.useDeferredValue(searchQuery);
|
|
87118
87270
|
const searchResult = reactExports.useMemo(() => searchSpans(trace2.spans, deferredSearchQuery), [trace2.spans, deferredSearchQuery]);
|
|
@@ -87148,10 +87300,29 @@ function NewTraceViewerContent({ trace: trace2, onLoadMore, hasMore, isLoadingMo
|
|
|
87148
87300
|
prevRootRef.current = { start: newStart, end: newEnd };
|
|
87149
87301
|
}, [root2.startTime, root2.duration, setViewport]);
|
|
87150
87302
|
const viewDuration = viewport.end - viewport.start;
|
|
87303
|
+
const viewportRef = reactExports.useRef(viewport);
|
|
87304
|
+
viewportRef.current = viewport;
|
|
87151
87305
|
const timeMarkers = reactExports.useMemo(() => computeTimeMarkers(viewDuration, viewport.start - root2.startTime), [viewDuration, viewport.start, root2.startTime]);
|
|
87152
87306
|
const resetZoom = reactExports.useCallback(() => {
|
|
87153
87307
|
animateTo({ start: root2.startTime, end: root2.startTime + root2.duration });
|
|
87154
87308
|
}, [animateTo, root2.startTime, root2.duration]);
|
|
87309
|
+
const handleRevealTime = reactExports.useCallback((timeMs) => {
|
|
87310
|
+
const rootS = root2.startTime;
|
|
87311
|
+
const rootE = root2.startTime + root2.duration;
|
|
87312
|
+
const { start: start2, end } = viewportRef.current;
|
|
87313
|
+
const duration2 = end - start2;
|
|
87314
|
+
let newStart = timeMs - duration2 / 2;
|
|
87315
|
+
let newEnd = timeMs + duration2 / 2;
|
|
87316
|
+
if (newStart < rootS) {
|
|
87317
|
+
newStart = rootS;
|
|
87318
|
+
newEnd = rootS + duration2;
|
|
87319
|
+
}
|
|
87320
|
+
if (newEnd > rootE) {
|
|
87321
|
+
newEnd = rootE;
|
|
87322
|
+
newStart = Math.max(rootS, rootE - duration2);
|
|
87323
|
+
}
|
|
87324
|
+
animateTo({ start: newStart, end: newEnd });
|
|
87325
|
+
}, [animateTo, root2.startTime, root2.duration]);
|
|
87155
87326
|
const ZOOM_FACTOR = 0.5;
|
|
87156
87327
|
const zoomBy = reactExports.useCallback((factor) => {
|
|
87157
87328
|
const rootS = root2.startTime;
|
|
@@ -87176,12 +87347,7 @@ function NewTraceViewerContent({ trace: trace2, onLoadMore, hasMore, isLoadingMo
|
|
|
87176
87347
|
}, [setViewport, root2.startTime, root2.duration]);
|
|
87177
87348
|
const zoomIn = reactExports.useCallback(() => zoomBy(ZOOM_FACTOR), [zoomBy]);
|
|
87178
87349
|
const zoomOut = reactExports.useCallback(() => zoomBy(1 / ZOOM_FACTOR), [zoomBy]);
|
|
87179
|
-
const
|
|
87180
|
-
if (spanId === activeSpanId) {
|
|
87181
|
-
clearActiveSpan();
|
|
87182
|
-
return;
|
|
87183
|
-
}
|
|
87184
|
-
setActiveSpan(spanId);
|
|
87350
|
+
const focusViewportOnSpan = reactExports.useCallback((spanId) => {
|
|
87185
87351
|
const span = trace2.spans.find((s2) => s2.spanId === spanId);
|
|
87186
87352
|
if (!span)
|
|
87187
87353
|
return;
|
|
@@ -87214,15 +87380,53 @@ function NewTraceViewerContent({ trace: trace2, onLoadMore, hasMore, isLoadingMo
|
|
|
87214
87380
|
newStart = Math.max(rootS, rootE - duration2);
|
|
87215
87381
|
}
|
|
87216
87382
|
animateTo({ start: newStart, end: newEnd });
|
|
87383
|
+
}, [animateTo, trace2.spans, root2.startTime, root2.duration]);
|
|
87384
|
+
const scrollSpanIntoView = reactExports.useCallback((spanId) => {
|
|
87385
|
+
var _a3;
|
|
87386
|
+
const index2 = trace2.spans.findIndex((s2) => s2.spanId === spanId);
|
|
87387
|
+
if (index2 === -1)
|
|
87388
|
+
return;
|
|
87389
|
+
const list2 = ((_a3 = scrollContainerRef.current) == null ? void 0 : _a3.querySelector("#event-list")) ?? null;
|
|
87390
|
+
scrollRowIntoView(list2, index2, ROW_HEIGHT_PX, {
|
|
87391
|
+
behavior: reducedMotion ? "auto" : "smooth"
|
|
87392
|
+
});
|
|
87393
|
+
}, [trace2.spans, reducedMotion]);
|
|
87394
|
+
const zoomTimerRef = reactExports.useRef(null);
|
|
87395
|
+
const cancelPendingZoom = reactExports.useCallback(() => {
|
|
87396
|
+
if (zoomTimerRef.current !== null) {
|
|
87397
|
+
clearTimeout(zoomTimerRef.current);
|
|
87398
|
+
zoomTimerRef.current = null;
|
|
87399
|
+
}
|
|
87400
|
+
}, []);
|
|
87401
|
+
reactExports.useEffect(() => cancelPendingZoom, [cancelPendingZoom]);
|
|
87402
|
+
const handleClearActiveSpan = reactExports.useCallback(() => {
|
|
87403
|
+
cancelPendingZoom();
|
|
87404
|
+
clearActiveSpan();
|
|
87405
|
+
}, [cancelPendingZoom, clearActiveSpan]);
|
|
87406
|
+
const handleSelectSpan = reactExports.useCallback((spanId) => {
|
|
87407
|
+
cancelPendingZoom();
|
|
87408
|
+
if (spanId === activeSpanId) {
|
|
87409
|
+
clearActiveSpan();
|
|
87410
|
+
return;
|
|
87411
|
+
}
|
|
87412
|
+
setActiveSpan(spanId);
|
|
87413
|
+
focusViewportOnSpan(spanId);
|
|
87217
87414
|
}, [
|
|
87218
|
-
|
|
87219
|
-
setActiveSpan,
|
|
87220
|
-
clearActiveSpan,
|
|
87415
|
+
cancelPendingZoom,
|
|
87221
87416
|
activeSpanId,
|
|
87222
|
-
|
|
87223
|
-
|
|
87224
|
-
|
|
87417
|
+
clearActiveSpan,
|
|
87418
|
+
setActiveSpan,
|
|
87419
|
+
focusViewportOnSpan
|
|
87225
87420
|
]);
|
|
87421
|
+
const navigateToSpan = reactExports.useCallback((spanId) => {
|
|
87422
|
+
setActiveSpan(spanId);
|
|
87423
|
+
scrollSpanIntoView(spanId);
|
|
87424
|
+
cancelPendingZoom();
|
|
87425
|
+
zoomTimerRef.current = setTimeout(() => {
|
|
87426
|
+
zoomTimerRef.current = null;
|
|
87427
|
+
focusViewportOnSpan(spanId);
|
|
87428
|
+
}, ZOOM_DEBOUNCE_MS);
|
|
87429
|
+
}, [setActiveSpan, scrollSpanIntoView, cancelPendingZoom, focusViewportOnSpan]);
|
|
87226
87430
|
const [altHeld, setAltHeld] = reactExports.useState(false);
|
|
87227
87431
|
reactExports.useEffect(() => {
|
|
87228
87432
|
const handleSidebarNavKey = (e) => {
|
|
@@ -87233,12 +87437,12 @@ function NewTraceViewerContent({ trace: trace2, onLoadMore, hasMore, isLoadingMo
|
|
|
87233
87437
|
const targetId = e.key === "k" ? prevSpanIdRef.current : nextSpanIdRef.current;
|
|
87234
87438
|
if (targetId) {
|
|
87235
87439
|
e.preventDefault();
|
|
87236
|
-
|
|
87440
|
+
navigateToSpanRef.current(targetId);
|
|
87237
87441
|
}
|
|
87238
87442
|
};
|
|
87239
87443
|
const onKeyDown = (e) => {
|
|
87240
87444
|
if (e.key === "Escape") {
|
|
87241
|
-
|
|
87445
|
+
handleClearActiveSpan();
|
|
87242
87446
|
} else if (e.key === "Alt") {
|
|
87243
87447
|
e.preventDefault();
|
|
87244
87448
|
setAltHeld(true);
|
|
@@ -87259,7 +87463,7 @@ function NewTraceViewerContent({ trace: trace2, onLoadMore, hasMore, isLoadingMo
|
|
|
87259
87463
|
window.removeEventListener("keyup", onKeyUp);
|
|
87260
87464
|
window.removeEventListener("blur", onBlur);
|
|
87261
87465
|
};
|
|
87262
|
-
}, [
|
|
87466
|
+
}, [handleClearActiveSpan]);
|
|
87263
87467
|
const timelineRef = reactExports.useRef(null);
|
|
87264
87468
|
const [hoverFraction, setHoverFraction] = reactExports.useState(null);
|
|
87265
87469
|
const hoverInfo2 = reactExports.useMemo(() => {
|
|
@@ -87375,25 +87579,25 @@ function NewTraceViewerContent({ trace: trace2, onLoadMore, hasMore, isLoadingMo
|
|
|
87375
87579
|
}, [activeSpanId, trace2.spans]);
|
|
87376
87580
|
const handleSelectPrevSpan = reactExports.useCallback(() => {
|
|
87377
87581
|
if (prevSpanId)
|
|
87378
|
-
|
|
87379
|
-
}, [prevSpanId,
|
|
87582
|
+
navigateToSpan(prevSpanId);
|
|
87583
|
+
}, [prevSpanId, navigateToSpan]);
|
|
87380
87584
|
const handleSelectNextSpan = reactExports.useCallback(() => {
|
|
87381
87585
|
if (nextSpanId)
|
|
87382
|
-
|
|
87383
|
-
}, [nextSpanId,
|
|
87586
|
+
navigateToSpan(nextSpanId);
|
|
87587
|
+
}, [nextSpanId, navigateToSpan]);
|
|
87384
87588
|
const prevSpanIdRef = reactExports.useRef(prevSpanId);
|
|
87385
87589
|
const nextSpanIdRef = reactExports.useRef(nextSpanId);
|
|
87386
|
-
const
|
|
87590
|
+
const navigateToSpanRef = reactExports.useRef(navigateToSpan);
|
|
87387
87591
|
prevSpanIdRef.current = prevSpanId;
|
|
87388
87592
|
nextSpanIdRef.current = nextSpanId;
|
|
87389
|
-
|
|
87593
|
+
navigateToSpanRef.current = navigateToSpan;
|
|
87390
87594
|
return jsxRuntimeExports.jsxs("div", { "data-pane": "pane-root", "data-has-detail": activeSpan ? "" : void 0, className: "grid w-full h-full max-h-full grid-cols-[minmax(100px,1fr)] data-[has-detail]:grid-cols-[minmax(100px,1fr)_clamp(280px,360px,100%)]", children: [jsxRuntimeExports.jsxs("div", { id: "trace-parent", className: "grid grid-rows-[1fr] h-full min-h-0 overflow-hidden relative bg-background-100", children: [jsxRuntimeExports.jsxs(SplitPane, { scrollContainerRef, startHeader: jsxRuntimeExports.jsxs("div", { className: "bg-background-100 border-b border-gray-alpha-400 h-10 min-h-10 flex items-center pl-4 pr-2 gap-1.5", children: [jsxRuntimeExports.jsx(Search, { className: "w-3.5 h-3.5 shrink-0 text-gray-800" }), jsxRuntimeExports.jsx("input", { id: "trace-viewer-search", name: "trace-viewer-search", type: "text", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), onKeyDown: (e) => {
|
|
87391
87595
|
if (e.key === "Escape" && searchQuery) {
|
|
87392
87596
|
e.preventDefault();
|
|
87393
87597
|
e.stopPropagation();
|
|
87394
87598
|
setSearchQuery("");
|
|
87395
87599
|
}
|
|
87396
|
-
}, placeholder: "Search spans...", "aria-label": "Search spans", className: "flex-1 min-w-0 bg-transparent text-sm text-gray-1000 placeholder:text-gray-800 outline-none" }), searchQuery && jsxRuntimeExports.jsx("button", { type: "button", "aria-label": "Clear search", onClick: () => setSearchQuery(""), className: "-mr-2 hidden h-full max-w-full shrink-0 cursor-pointer items-center rounded-r-md border-0 bg-transparent px-2.5 font-inherit text-base text-gray-900 no-underline transition-colors duration-150 ease-in hover:text-gray-1000 focus-visible:-outline-offset-1 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--ds-focus-color)] min-[961px]:flex", children: jsxRuntimeExports.jsx("kbd", { className: "inline-flex h-5 min-h-5 min-w-5 items-center justify-center rounded border border-gray-alpha-400 bg-background-100 px-1 font-sans text-[13px] font-medium leading-[1.7em] text-gray-900", children: "Esc" }) })] }), endHeader: jsxRuntimeExports.jsx(TimelineHeader, { markers: timeMarkers, hoverInfo: hoverInfo2 }), children: [jsxRuntimeExports.jsxs("div", { className: "block overflow-visible", children: [jsxRuntimeExports.jsx(EventList, { spans: trace2.spans, activeSpanId, searchResult, onSelectSpan: handleSelectSpan }), jsxRuntimeExports.jsx("div", { ref: loadMoreSentinelRef, className: "flex justify-center", children: isLoadingMore ? jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center gap-2 py-3 text-sm text-gray-800", children: [jsxRuntimeExports.jsx(Spinner, { size: 14 }), jsxRuntimeExports.jsx("span", { children: "Loading spans…" })] }) : null })] }), jsxRuntimeExports.jsx("div", { ref: timelineRef, className: "block min-h-0 overflow-visible relative", onDoubleClick: resetZoom, onMouseMove: handleTimelineMouseMove, onMouseLeave: handleTimelineMouseLeave, children: jsxRuntimeExports.jsx(Timeline, { spans: trace2.spans, viewStart: viewport.start, viewEnd: viewport.end, markers: timeMarkers, selectedId: activeSpanId, searchResult, onSelect: handleSelectSpan, hoverFraction, altHeld }) })] }), jsxRuntimeExports.jsxs("div", { className: "absolute right-3 bottom-3 z-[5] flex items-center border border-gray-alpha-400 rounded-md bg-background-100 shadow-sm overflow-hidden divide-x divide-gray-alpha-400", children: [jsxRuntimeExports.jsx(IconButton, { variant: "muted", size: "small", onClick: zoomOut, "aria-label": "Zoom out", children: jsxRuntimeExports.jsx(ZoomOut, { className: "w-4 h-4" }) }), jsxRuntimeExports.jsx(IconButton, { variant: "muted", size: "small", onClick: resetZoom, "aria-label": "Reset zoom", children: jsxRuntimeExports.jsx(RotateCcw, { className: "w-3.5 h-3.5" }) }), jsxRuntimeExports.jsx(IconButton, { variant: "muted", size: "small", onClick: zoomIn, "aria-label": "Zoom in", children: jsxRuntimeExports.jsx(ZoomIn, { className: "w-4 h-4" }) })] })] }), activeSpan ? jsxRuntimeExports.jsxs("aside", { className: "flex flex-col h-full max-h-full bg-background-100 border-l border-gray-alpha-400 overflow-auto", children: [jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2 shrink-0 px-4 pt-3 pb-3", children: [jsxRuntimeExports.jsx("span", { className: "text-label-14 font-medium text-gray-1000 truncate block", children: selectedSpanName }), jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-0.5 shrink-0", children: [jsxRuntimeExports.jsxs(Tooltip$1, { children: [jsxRuntimeExports.jsx(TooltipTrigger$1, { asChild: true, children: jsxRuntimeExports.jsx(IconButton, { "aria-label": "Navigate up", "aria-keyshortcuts": "K", onClick: handleSelectPrevSpan, disabled: !prevSpanId, children: jsxRuntimeExports.jsx(ChevronUp, { className: "w-4 h-4" }) }) }), prevSpanId ? jsxRuntimeExports.jsxs(TooltipContent$1, { children: ["Navigate up", jsxRuntimeExports.jsx(Kbd, { children: "K" })] }) : null] }), jsxRuntimeExports.jsxs(Tooltip$1, { children: [jsxRuntimeExports.jsx(TooltipTrigger$1, { asChild: true, children: jsxRuntimeExports.jsx(IconButton, { "aria-label": "Navigate down", "aria-keyshortcuts": "J", onClick: handleSelectNextSpan, disabled: !nextSpanId, children: jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4" }) }) }), nextSpanId ? jsxRuntimeExports.jsxs(TooltipContent$1, { children: ["Navigate down", jsxRuntimeExports.jsx(Kbd, { children: "J" })] }) : null] }), jsxRuntimeExports.jsx("div", { "aria-hidden": true, className: "w-px h-4 bg-gray-alpha-400 mx-1" }), jsxRuntimeExports.jsx(IconButton, { "aria-label": "Close span details", "aria-keyshortcuts": "Escape", onClick:
|
|
87600
|
+
}, placeholder: "Search spans...", "aria-label": "Search spans", className: "flex-1 min-w-0 bg-transparent text-sm text-gray-1000 placeholder:text-gray-800 outline-none" }), searchQuery && jsxRuntimeExports.jsx("button", { type: "button", "aria-label": "Clear search", onClick: () => setSearchQuery(""), className: "-mr-2 hidden h-full max-w-full shrink-0 cursor-pointer items-center rounded-r-md border-0 bg-transparent px-2.5 font-inherit text-base text-gray-900 no-underline transition-colors duration-150 ease-in hover:text-gray-1000 focus-visible:-outline-offset-1 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--ds-focus-color)] min-[961px]:flex", children: jsxRuntimeExports.jsx("kbd", { className: "inline-flex h-5 min-h-5 min-w-5 items-center justify-center rounded border border-gray-alpha-400 bg-background-100 px-1 font-sans text-[13px] font-medium leading-[1.7em] text-gray-900", children: "Esc" }) })] }), endHeader: jsxRuntimeExports.jsx(TimelineHeader, { markers: timeMarkers, hoverInfo: hoverInfo2 }), children: [jsxRuntimeExports.jsxs("div", { className: "block overflow-visible", children: [jsxRuntimeExports.jsx(EventList, { spans: trace2.spans, activeSpanId, searchResult, onSelectSpan: handleSelectSpan }), jsxRuntimeExports.jsx("div", { ref: loadMoreSentinelRef, className: "flex justify-center", children: isLoadingMore ? jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center gap-2 py-3 text-sm text-gray-800", children: [jsxRuntimeExports.jsx(Spinner, { size: 14 }), jsxRuntimeExports.jsx("span", { children: "Loading spans…" })] }) : null })] }), jsxRuntimeExports.jsx("div", { ref: timelineRef, className: "block min-h-0 overflow-visible relative", onDoubleClick: resetZoom, onMouseMove: handleTimelineMouseMove, onMouseLeave: handleTimelineMouseLeave, children: jsxRuntimeExports.jsx(Timeline, { spans: trace2.spans, viewStart: viewport.start, viewEnd: viewport.end, markers: timeMarkers, selectedId: activeSpanId, searchResult, onSelect: handleSelectSpan, onRevealTime: handleRevealTime, hoverFraction, altHeld }) })] }), jsxRuntimeExports.jsxs("div", { className: "absolute right-3 bottom-3 z-[5] flex items-center border border-gray-alpha-400 rounded-md bg-background-100 shadow-sm overflow-hidden divide-x divide-gray-alpha-400", children: [jsxRuntimeExports.jsx(IconButton, { variant: "muted", size: "small", onClick: zoomOut, "aria-label": "Zoom out", children: jsxRuntimeExports.jsx(ZoomOut, { className: "w-4 h-4" }) }), jsxRuntimeExports.jsx(IconButton, { variant: "muted", size: "small", onClick: resetZoom, "aria-label": "Reset zoom", children: jsxRuntimeExports.jsx(RotateCcw, { className: "w-3.5 h-3.5" }) }), jsxRuntimeExports.jsx(IconButton, { variant: "muted", size: "small", onClick: zoomIn, "aria-label": "Zoom in", children: jsxRuntimeExports.jsx(ZoomIn, { className: "w-4 h-4" }) })] })] }), activeSpan ? jsxRuntimeExports.jsxs("aside", { className: "flex flex-col h-full max-h-full bg-background-100 border-l border-gray-alpha-400 overflow-auto", children: [jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2 shrink-0 px-4 pt-3 pb-3", children: [jsxRuntimeExports.jsx("span", { className: "text-label-14 font-medium text-gray-1000 truncate block", children: selectedSpanName }), jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-0.5 shrink-0", children: [jsxRuntimeExports.jsxs(Tooltip$1, { children: [jsxRuntimeExports.jsx(TooltipTrigger$1, { asChild: true, children: jsxRuntimeExports.jsx(IconButton, { "aria-label": "Navigate up", "aria-keyshortcuts": "K", onClick: handleSelectPrevSpan, disabled: !prevSpanId, children: jsxRuntimeExports.jsx(ChevronUp, { className: "w-4 h-4" }) }) }), prevSpanId ? jsxRuntimeExports.jsxs(TooltipContent$1, { children: ["Navigate up", jsxRuntimeExports.jsx(Kbd, { children: "K" })] }) : null] }), jsxRuntimeExports.jsxs(Tooltip$1, { children: [jsxRuntimeExports.jsx(TooltipTrigger$1, { asChild: true, children: jsxRuntimeExports.jsx(IconButton, { "aria-label": "Navigate down", "aria-keyshortcuts": "J", onClick: handleSelectNextSpan, disabled: !nextSpanId, children: jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4" }) }) }), nextSpanId ? jsxRuntimeExports.jsxs(TooltipContent$1, { children: ["Navigate down", jsxRuntimeExports.jsx(Kbd, { children: "J" })] }) : null] }), jsxRuntimeExports.jsx("div", { "aria-hidden": true, className: "w-px h-4 bg-gray-alpha-400 mx-1" }), jsxRuntimeExports.jsx(IconButton, { "aria-label": "Close span details", "aria-keyshortcuts": "Escape", onClick: handleClearActiveSpan, children: jsxRuntimeExports.jsx(X$3, { className: "w-4 h-4" }) })] })] }), jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-y-auto", children: jsxRuntimeExports.jsx(ErrorBoundary$1, { children: jsxRuntimeExports.jsx(EntityDetailPanel, { run: sidebar.run, onStreamClick: sidebar.onStreamClick, onRunClick: sidebar.onRunClick, spanDetailData: sidebar.spanDetailData, spanDetailError: sidebar.spanDetailError, spanDetailLoading: sidebar.spanDetailLoading, onSpanSelect: sidebar.onSpanSelect, onWakeUpSleep: sidebar.onWakeUpSleep, onLoadEventData: sidebar.onLoadEventData, onResolveHook: sidebar.onResolveHook, encryptionKey: sidebar.encryptionKey, onDecrypt: sidebar.onDecrypt, isDecrypting: sidebar.isDecrypting, selectedSpan }) }) })] }) : null] });
|
|
87397
87601
|
}
|
|
87398
87602
|
const NewTraceViewer = ({ run: run2, events: events2, sidebarData, onLoadMore, hasMore, isLoadingMore, loading = false }) => {
|
|
87399
87603
|
const trace2 = reactExports.useMemo(() => {
|
|
@@ -91068,6 +91272,12 @@ const WorkflowSuspensionState = SemanticConvention$2("workflow.suspension.state"
|
|
|
91068
91272
|
const WorkflowSuspensionHookCount = SemanticConvention$2("workflow.suspension.hook_count");
|
|
91069
91273
|
const WorkflowSuspensionStepCount = SemanticConvention$2("workflow.suspension.step_count");
|
|
91070
91274
|
const WorkflowSuspensionWaitCount = SemanticConvention$2("workflow.suspension.wait_count");
|
|
91275
|
+
const SerializationOperation = SemanticConvention$2("workflow.serialization.operation");
|
|
91276
|
+
const SerializationCompressed = SemanticConvention$2("workflow.serialization.compressed");
|
|
91277
|
+
const SerializationCodec = SemanticConvention$2("workflow.serialization.codec");
|
|
91278
|
+
const SerializationUncompressedBytes = SemanticConvention$2("workflow.serialization.uncompressed_bytes");
|
|
91279
|
+
const SerializationStoredBytes = SemanticConvention$2("workflow.serialization.stored_bytes");
|
|
91280
|
+
const SerializationCompressionRatio = SemanticConvention$2("workflow.serialization.compression_ratio");
|
|
91071
91281
|
async function serializeTraceCarrier() {
|
|
91072
91282
|
const otel = await OtelApi.value;
|
|
91073
91283
|
if (!otel)
|
|
@@ -91151,6 +91361,19 @@ async function withOtel(fn2) {
|
|
|
91151
91361
|
return void 0;
|
|
91152
91362
|
return await fn2(otel);
|
|
91153
91363
|
}
|
|
91364
|
+
async function linkToTraceCarrier(carrier) {
|
|
91365
|
+
if (!carrier)
|
|
91366
|
+
return;
|
|
91367
|
+
const [context, otel] = await Promise.all([
|
|
91368
|
+
getSpanContextForTraceCarrier(carrier),
|
|
91369
|
+
OtelApi.value
|
|
91370
|
+
]);
|
|
91371
|
+
if (!context || !otel)
|
|
91372
|
+
return;
|
|
91373
|
+
if (!otel.trace.isSpanContextValid(context))
|
|
91374
|
+
return;
|
|
91375
|
+
return { context };
|
|
91376
|
+
}
|
|
91154
91377
|
function matchesDebugNamespace(namespace2, patternList) {
|
|
91155
91378
|
if (!patternList) {
|
|
91156
91379
|
return false;
|
|
@@ -91279,7 +91502,7 @@ const encryption = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
91279
91502
|
encrypt: encrypt$1,
|
|
91280
91503
|
importKey
|
|
91281
91504
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
91282
|
-
const version$1 = "5.0.0-beta.
|
|
91505
|
+
const version$1 = "5.0.0-beta.18";
|
|
91283
91506
|
const WorldCacheKey = Symbol.for("@workflow/world//cache");
|
|
91284
91507
|
const WorldCachePromiseKey = Symbol.for("@workflow/world//cachePromise");
|
|
91285
91508
|
const GetWorldFnKey$1 = Symbol.for("@workflow/world//getWorldFn");
|
|
@@ -92078,7 +92301,11 @@ const SerializationFormat = {
|
|
|
92078
92301
|
/** devalue stringify/parse with TextEncoder/TextDecoder */
|
|
92079
92302
|
DEVALUE_V1: "devl",
|
|
92080
92303
|
/** Encrypted payload (inner payload has its own format prefix) */
|
|
92081
|
-
ENCRYPTED: "encr"
|
|
92304
|
+
ENCRYPTED: "encr",
|
|
92305
|
+
/** Gzip-compressed payload (inner payload has its own format prefix) */
|
|
92306
|
+
GZIP: "gzip",
|
|
92307
|
+
/** Zstandard-compressed payload (inner payload has its own format prefix) */
|
|
92308
|
+
ZSTD: "zstd"
|
|
92082
92309
|
};
|
|
92083
92310
|
const encoder = new TextEncoder();
|
|
92084
92311
|
const decoder = new TextDecoder();
|
|
@@ -92197,6 +92424,148 @@ function decodeFormatPrefix(data) {
|
|
|
92197
92424
|
const payload = data.subarray(FORMAT_PREFIX_LENGTH);
|
|
92198
92425
|
return { format: str, payload };
|
|
92199
92426
|
}
|
|
92427
|
+
const COMPRESSION_MIN_BYTES = 1024;
|
|
92428
|
+
const COMPRESSION_MIN_SAVINGS_RATIO = 0.05;
|
|
92429
|
+
const ZSTD_LEVEL = 3;
|
|
92430
|
+
function isCompressionDisabledByEnv() {
|
|
92431
|
+
var _a3;
|
|
92432
|
+
try {
|
|
92433
|
+
return typeof process !== "undefined" && ((_a3 = process.env) == null ? void 0 : _a3.WORKFLOW_DISABLE_COMPRESSION) === "1";
|
|
92434
|
+
} catch {
|
|
92435
|
+
return false;
|
|
92436
|
+
}
|
|
92437
|
+
}
|
|
92438
|
+
function codecOverrideFromEnv() {
|
|
92439
|
+
var _a3;
|
|
92440
|
+
try {
|
|
92441
|
+
const v2 = (_a3 = process.env) == null ? void 0 : _a3.WORKFLOW_COMPRESSION_CODEC;
|
|
92442
|
+
return v2 === "gzip" || v2 === "zstd" ? v2 : void 0;
|
|
92443
|
+
} catch {
|
|
92444
|
+
return void 0;
|
|
92445
|
+
}
|
|
92446
|
+
}
|
|
92447
|
+
function getNodeZlib() {
|
|
92448
|
+
var _a3, _b2;
|
|
92449
|
+
try {
|
|
92450
|
+
return (_b2 = (_a3 = globalThis.process) == null ? void 0 : _a3.getBuiltinModule) == null ? void 0 : _b2.call(_a3, "node:zlib");
|
|
92451
|
+
} catch {
|
|
92452
|
+
return void 0;
|
|
92453
|
+
}
|
|
92454
|
+
}
|
|
92455
|
+
function isZstdAvailable() {
|
|
92456
|
+
const z2 = getNodeZlib();
|
|
92457
|
+
return typeof (z2 == null ? void 0 : z2.zstdCompressSync) === "function" && typeof (z2 == null ? void 0 : z2.zstdDecompressSync) === "function";
|
|
92458
|
+
}
|
|
92459
|
+
function isGzipAvailable() {
|
|
92460
|
+
return typeof CompressionStream === "function" && typeof DecompressionStream === "function";
|
|
92461
|
+
}
|
|
92462
|
+
async function pipeThroughTransform(data, transform2) {
|
|
92463
|
+
const writer = transform2.writable.getWriter();
|
|
92464
|
+
const writePromise = writer.write(data).then(() => writer.close());
|
|
92465
|
+
writePromise.catch(() => {
|
|
92466
|
+
});
|
|
92467
|
+
const chunks = [];
|
|
92468
|
+
let total = 0;
|
|
92469
|
+
const reader = transform2.readable.getReader();
|
|
92470
|
+
for (; ; ) {
|
|
92471
|
+
const { done, value } = await reader.read();
|
|
92472
|
+
if (done)
|
|
92473
|
+
break;
|
|
92474
|
+
chunks.push(value);
|
|
92475
|
+
total += value.length;
|
|
92476
|
+
}
|
|
92477
|
+
await writePromise;
|
|
92478
|
+
const out = new Uint8Array(total);
|
|
92479
|
+
let offset2 = 0;
|
|
92480
|
+
for (const chunk of chunks) {
|
|
92481
|
+
out.set(chunk, offset2);
|
|
92482
|
+
offset2 += chunk.length;
|
|
92483
|
+
}
|
|
92484
|
+
return out;
|
|
92485
|
+
}
|
|
92486
|
+
async function gzipBytes(data) {
|
|
92487
|
+
return pipeThroughTransform(data, new CompressionStream("gzip"));
|
|
92488
|
+
}
|
|
92489
|
+
async function gunzipBytes(data) {
|
|
92490
|
+
return pipeThroughTransform(data, new DecompressionStream("gzip"));
|
|
92491
|
+
}
|
|
92492
|
+
function zstdBytes(data) {
|
|
92493
|
+
var _a3;
|
|
92494
|
+
const z2 = getNodeZlib();
|
|
92495
|
+
const level = (_a3 = z2 == null ? void 0 : z2.constants) == null ? void 0 : _a3.ZSTD_c_compressionLevel;
|
|
92496
|
+
const opts = level !== void 0 ? { params: { [level]: ZSTD_LEVEL } } : void 0;
|
|
92497
|
+
return new Uint8Array(z2.zstdCompressSync(data, opts));
|
|
92498
|
+
}
|
|
92499
|
+
function unzstdBytes(data) {
|
|
92500
|
+
const z2 = getNodeZlib();
|
|
92501
|
+
if (!(z2 == null ? void 0 : z2.zstdDecompressSync)) {
|
|
92502
|
+
throw new Error("Compressed (zstd) workflow data encountered but node:zlib zstd support is not available in this runtime (requires Node.js 22.15+). In the browser, register a zstd decoder via registerZstdDecoder (serialization-format.ts).");
|
|
92503
|
+
}
|
|
92504
|
+
return new Uint8Array(z2.zstdDecompressSync(data));
|
|
92505
|
+
}
|
|
92506
|
+
function recordStats(stats2, codec2, uncompressedBytes, storedBytes) {
|
|
92507
|
+
if (!stats2)
|
|
92508
|
+
return;
|
|
92509
|
+
stats2.recorded = true;
|
|
92510
|
+
stats2.compressed = codec2 !== "none";
|
|
92511
|
+
stats2.codec = codec2;
|
|
92512
|
+
stats2.uncompressedBytes = uncompressedBytes;
|
|
92513
|
+
stats2.storedBytes = storedBytes;
|
|
92514
|
+
}
|
|
92515
|
+
function selectWriteCodec() {
|
|
92516
|
+
const override = codecOverrideFromEnv();
|
|
92517
|
+
if (override === "gzip")
|
|
92518
|
+
return isGzipAvailable() ? "gzip" : "none";
|
|
92519
|
+
if (isZstdAvailable())
|
|
92520
|
+
return "zstd";
|
|
92521
|
+
if (isGzipAvailable())
|
|
92522
|
+
return "gzip";
|
|
92523
|
+
return "none";
|
|
92524
|
+
}
|
|
92525
|
+
async function compress(data, enabled, stats2) {
|
|
92526
|
+
if (!(data instanceof Uint8Array))
|
|
92527
|
+
return data;
|
|
92528
|
+
if (!enabled || data.length < COMPRESSION_MIN_BYTES || isCompressionDisabledByEnv()) {
|
|
92529
|
+
recordStats(stats2, "none", data.length, data.length);
|
|
92530
|
+
return data;
|
|
92531
|
+
}
|
|
92532
|
+
const codec2 = selectWriteCodec();
|
|
92533
|
+
if (codec2 === "none") {
|
|
92534
|
+
recordStats(stats2, "none", data.length, data.length);
|
|
92535
|
+
return data;
|
|
92536
|
+
}
|
|
92537
|
+
const compressed = codec2 === "zstd" ? zstdBytes(data) : await gzipBytes(data);
|
|
92538
|
+
const format2 = codec2 === "zstd" ? SerializationFormat.ZSTD : SerializationFormat.GZIP;
|
|
92539
|
+
const wrappedLength = 4 + compressed.length;
|
|
92540
|
+
if (wrappedLength >= data.length * (1 - COMPRESSION_MIN_SAVINGS_RATIO)) {
|
|
92541
|
+
recordStats(stats2, "none", data.length, data.length);
|
|
92542
|
+
return data;
|
|
92543
|
+
}
|
|
92544
|
+
recordStats(stats2, codec2, data.length, wrappedLength);
|
|
92545
|
+
return encodeWithFormatPrefix(format2, compressed);
|
|
92546
|
+
}
|
|
92547
|
+
async function decompress$1(data, stats2) {
|
|
92548
|
+
if (!(data instanceof Uint8Array))
|
|
92549
|
+
return data;
|
|
92550
|
+
const prefix = peekFormatPrefix(data);
|
|
92551
|
+
if (prefix === SerializationFormat.ZSTD) {
|
|
92552
|
+
const { payload } = decodeFormatPrefix(data);
|
|
92553
|
+
const inflated = unzstdBytes(payload);
|
|
92554
|
+
recordStats(stats2, "zstd", inflated.length, data.length);
|
|
92555
|
+
return inflated;
|
|
92556
|
+
}
|
|
92557
|
+
if (prefix === SerializationFormat.GZIP) {
|
|
92558
|
+
if (!isGzipAvailable()) {
|
|
92559
|
+
throw new Error("Compressed (gzip) workflow data encountered but DecompressionStream is not available in this runtime. Node.js 18+, browsers, and edge runtimes all support it.");
|
|
92560
|
+
}
|
|
92561
|
+
const { payload } = decodeFormatPrefix(data);
|
|
92562
|
+
const inflated = await gunzipBytes(payload);
|
|
92563
|
+
recordStats(stats2, "gzip", inflated.length, data.length);
|
|
92564
|
+
return inflated;
|
|
92565
|
+
}
|
|
92566
|
+
recordStats(stats2, "none", data.length, data.length);
|
|
92567
|
+
return data;
|
|
92568
|
+
}
|
|
92200
92569
|
async function resolveEncryptionKey(key) {
|
|
92201
92570
|
return typeof key === "function" ? key() : key;
|
|
92202
92571
|
}
|
|
@@ -92255,7 +92624,8 @@ async function serialize$1(value, encryptionKey, options) {
|
|
|
92255
92624
|
try {
|
|
92256
92625
|
const payload = devalueCodec.serialize(value, "client", options);
|
|
92257
92626
|
const prefixed = encodeWithFormatPrefix(SerializationFormat.DEVALUE_V1, payload);
|
|
92258
|
-
|
|
92627
|
+
const compressed = await compress(prefixed, (options == null ? void 0 : options.compression) === true, options == null ? void 0 : options.compressionStats);
|
|
92628
|
+
return encrypt(compressed, encryptionKey);
|
|
92259
92629
|
} catch (error2) {
|
|
92260
92630
|
rethrowIfRuntimeError(error2);
|
|
92261
92631
|
const { message: message2, hint: hint2 } = formatSerializationError("client value", error2);
|
|
@@ -92263,7 +92633,7 @@ async function serialize$1(value, encryptionKey, options) {
|
|
|
92263
92633
|
}
|
|
92264
92634
|
}
|
|
92265
92635
|
async function deserialize$2(data, encryptionKey, options) {
|
|
92266
|
-
const decrypted = await decrypt(data, encryptionKey);
|
|
92636
|
+
const decrypted = await decompress$1(await decrypt(data, encryptionKey), options == null ? void 0 : options.compressionStats);
|
|
92267
92637
|
if (!(decrypted instanceof Uint8Array)) {
|
|
92268
92638
|
if (devalueCodec.deserializeLegacy) {
|
|
92269
92639
|
return devalueCodec.deserializeLegacy(decrypted, "client", options);
|
|
@@ -92280,7 +92650,8 @@ async function serialize(value, encryptionKey, options) {
|
|
|
92280
92650
|
try {
|
|
92281
92651
|
const payload = devalueCodec.serialize(value, "step", options);
|
|
92282
92652
|
const prefixed = encodeWithFormatPrefix(SerializationFormat.DEVALUE_V1, payload);
|
|
92283
|
-
|
|
92653
|
+
const compressed = await compress(prefixed, (options == null ? void 0 : options.compression) === true, options == null ? void 0 : options.compressionStats);
|
|
92654
|
+
return encrypt(compressed, encryptionKey);
|
|
92284
92655
|
} catch (error2) {
|
|
92285
92656
|
rethrowIfRuntimeError(error2);
|
|
92286
92657
|
const { message: message2, hint: hint2 } = formatSerializationError("step value", error2);
|
|
@@ -92288,7 +92659,7 @@ async function serialize(value, encryptionKey, options) {
|
|
|
92288
92659
|
}
|
|
92289
92660
|
}
|
|
92290
92661
|
async function deserialize$1(data, encryptionKey, options) {
|
|
92291
|
-
const decrypted = await decrypt(data, encryptionKey);
|
|
92662
|
+
const decrypted = await decompress$1(await decrypt(data, encryptionKey), options == null ? void 0 : options.compressionStats);
|
|
92292
92663
|
if (!(decrypted instanceof Uint8Array)) {
|
|
92293
92664
|
if (devalueCodec.deserializeLegacy) {
|
|
92294
92665
|
return devalueCodec.deserializeLegacy(decrypted, "step", options);
|
|
@@ -92414,6 +92785,26 @@ function unwrapSerializationCause(error2) {
|
|
|
92414
92785
|
}
|
|
92415
92786
|
return error2;
|
|
92416
92787
|
}
|
|
92788
|
+
async function recordCompression(stats2, operation) {
|
|
92789
|
+
if (!stats2.recorded)
|
|
92790
|
+
return;
|
|
92791
|
+
try {
|
|
92792
|
+
const span = await getActiveSpan();
|
|
92793
|
+
if (!span)
|
|
92794
|
+
return;
|
|
92795
|
+
const uncompressedBytes = stats2.uncompressedBytes ?? 0;
|
|
92796
|
+
const storedBytes = stats2.storedBytes ?? 0;
|
|
92797
|
+
span.setAttributes({
|
|
92798
|
+
...SerializationOperation(operation),
|
|
92799
|
+
...SerializationCompressed(stats2.compressed ?? false),
|
|
92800
|
+
...SerializationCodec(stats2.codec ?? "none"),
|
|
92801
|
+
...SerializationUncompressedBytes(uncompressedBytes),
|
|
92802
|
+
...SerializationStoredBytes(storedBytes),
|
|
92803
|
+
...stats2.compressed && uncompressedBytes > 0 ? SerializationCompressionRatio(1 - storedBytes / uncompressedBytes) : {}
|
|
92804
|
+
});
|
|
92805
|
+
} catch {
|
|
92806
|
+
}
|
|
92807
|
+
}
|
|
92417
92808
|
function getSerializeStream(reducers, cryptoKey) {
|
|
92418
92809
|
const encoder2 = new TextEncoder();
|
|
92419
92810
|
const keyState = { resolved: false, key: void 0 };
|
|
@@ -93586,16 +93977,21 @@ function getStepRevivers(global2 = globalThis, ops, runId, cryptoKey, deployment
|
|
|
93586
93977
|
async function maybeDecrypt(data, key) {
|
|
93587
93978
|
return decrypt(data, key);
|
|
93588
93979
|
}
|
|
93589
|
-
async function dehydrateWorkflowArguments(value, runId, key, ops = [], global2 = globalThis, v1Compat = false, framedByteStreams = false) {
|
|
93980
|
+
async function dehydrateWorkflowArguments(value, runId, key, ops = [], global2 = globalThis, v1Compat = false, framedByteStreams = false, compression = false) {
|
|
93590
93981
|
if (v1Compat) {
|
|
93591
93982
|
const str = stringify$2(value, getExternalReducers(global2, ops, runId, key, framedByteStreams));
|
|
93592
93983
|
return revive(str);
|
|
93593
93984
|
}
|
|
93594
93985
|
try {
|
|
93595
|
-
|
|
93986
|
+
const compressionStats = {};
|
|
93987
|
+
const result = await serialize$1(value, key, {
|
|
93596
93988
|
global: global2,
|
|
93597
|
-
extraReducers: getStreamAndRequestReducers(getExternalReducers(global2, ops, runId, key, framedByteStreams))
|
|
93989
|
+
extraReducers: getStreamAndRequestReducers(getExternalReducers(global2, ops, runId, key, framedByteStreams)),
|
|
93990
|
+
compression,
|
|
93991
|
+
compressionStats
|
|
93598
93992
|
});
|
|
93993
|
+
await recordCompression(compressionStats, "serialize");
|
|
93994
|
+
return result;
|
|
93599
93995
|
} catch (error2) {
|
|
93600
93996
|
const cause = unwrapSerializationCause(error2);
|
|
93601
93997
|
const { message: message2, hint: hint2 } = formatSerializationError("workflow arguments", cause);
|
|
@@ -93603,7 +93999,10 @@ async function dehydrateWorkflowArguments(value, runId, key, ops = [], global2 =
|
|
|
93603
93999
|
}
|
|
93604
94000
|
}
|
|
93605
94001
|
async function hydrateWorkflowArguments(value, _runId, key, global2 = globalThis, extraRevivers = {}) {
|
|
93606
|
-
|
|
94002
|
+
const compressionStats = {};
|
|
94003
|
+
const inflated = await decompress$1(await maybeDecrypt(value, key), compressionStats);
|
|
94004
|
+
await recordCompression(compressionStats, "deserialize");
|
|
94005
|
+
return deserialize(inflated, {
|
|
93607
94006
|
global: global2,
|
|
93608
94007
|
extraRevivers: {
|
|
93609
94008
|
...getStreamAndRequestRevivers(getWorkflowRevivers(global2)),
|
|
@@ -93612,24 +94011,33 @@ async function hydrateWorkflowArguments(value, _runId, key, global2 = globalThis
|
|
|
93612
94011
|
});
|
|
93613
94012
|
}
|
|
93614
94013
|
async function hydrateWorkflowReturnValue(value, runId, key, ops = [], global2 = globalThis, extraRevivers = {}) {
|
|
93615
|
-
|
|
94014
|
+
const compressionStats = {};
|
|
94015
|
+
const result = await deserialize$2(value, key, {
|
|
93616
94016
|
global: global2,
|
|
93617
94017
|
extraRevivers: {
|
|
93618
94018
|
...getStreamAndRequestRevivers(getExternalRevivers(global2, ops, runId, key)),
|
|
93619
94019
|
...extraRevivers
|
|
93620
|
-
}
|
|
94020
|
+
},
|
|
94021
|
+
compressionStats
|
|
93621
94022
|
});
|
|
94023
|
+
await recordCompression(compressionStats, "deserialize");
|
|
94024
|
+
return result;
|
|
93622
94025
|
}
|
|
93623
|
-
async function dehydrateStepArguments(value, _runId, key, global2 = globalThis, v1Compat = false) {
|
|
94026
|
+
async function dehydrateStepArguments(value, _runId, key, global2 = globalThis, v1Compat = false, compression = false) {
|
|
93624
94027
|
if (v1Compat) {
|
|
93625
94028
|
const str = stringify$2(value, getWorkflowReducers(global2));
|
|
93626
94029
|
return revive(str);
|
|
93627
94030
|
}
|
|
93628
94031
|
try {
|
|
93629
|
-
|
|
94032
|
+
const compressionStats = {};
|
|
94033
|
+
const result = await serialize(value, key, {
|
|
93630
94034
|
global: global2,
|
|
93631
|
-
extraReducers: getStreamAndRequestReducers(getWorkflowReducers(global2))
|
|
94035
|
+
extraReducers: getStreamAndRequestReducers(getWorkflowReducers(global2)),
|
|
94036
|
+
compression,
|
|
94037
|
+
compressionStats
|
|
93632
94038
|
});
|
|
94039
|
+
await recordCompression(compressionStats, "serialize");
|
|
94040
|
+
return result;
|
|
93633
94041
|
} catch (error2) {
|
|
93634
94042
|
const cause = unwrapSerializationCause(error2);
|
|
93635
94043
|
const { message: message2, hint: hint2 } = formatSerializationError("step arguments", cause);
|
|
@@ -93637,24 +94045,33 @@ async function dehydrateStepArguments(value, _runId, key, global2 = globalThis,
|
|
|
93637
94045
|
}
|
|
93638
94046
|
}
|
|
93639
94047
|
async function hydrateStepArguments(value, runId, key, ops = [], global2 = globalThis, extraRevivers = {}, deploymentId) {
|
|
93640
|
-
|
|
94048
|
+
const compressionStats = {};
|
|
94049
|
+
const result = await deserialize$1(value, key, {
|
|
93641
94050
|
global: global2,
|
|
93642
94051
|
extraRevivers: {
|
|
93643
94052
|
...getStreamAndRequestRevivers(getStepRevivers(global2, ops, runId, key, deploymentId)),
|
|
93644
94053
|
...extraRevivers
|
|
93645
|
-
}
|
|
94054
|
+
},
|
|
94055
|
+
compressionStats
|
|
93646
94056
|
});
|
|
94057
|
+
await recordCompression(compressionStats, "deserialize");
|
|
94058
|
+
return result;
|
|
93647
94059
|
}
|
|
93648
|
-
async function dehydrateStepReturnValue(value, runId, key, ops = [], global2 = globalThis, v1Compat = false, framedByteStreams = false) {
|
|
94060
|
+
async function dehydrateStepReturnValue(value, runId, key, ops = [], global2 = globalThis, v1Compat = false, framedByteStreams = false, compression = false) {
|
|
93649
94061
|
if (v1Compat) {
|
|
93650
94062
|
const str = stringify$2(value, getStepReducers(global2, ops, runId, key, framedByteStreams));
|
|
93651
94063
|
return revive(str);
|
|
93652
94064
|
}
|
|
93653
94065
|
try {
|
|
93654
|
-
|
|
94066
|
+
const compressionStats = {};
|
|
94067
|
+
const result = await serialize(value, key, {
|
|
93655
94068
|
global: global2,
|
|
93656
|
-
extraReducers: getStreamAndRequestReducers(getStepReducers(global2, ops, runId, key, framedByteStreams))
|
|
94069
|
+
extraReducers: getStreamAndRequestReducers(getStepReducers(global2, ops, runId, key, framedByteStreams)),
|
|
94070
|
+
compression,
|
|
94071
|
+
compressionStats
|
|
93657
94072
|
});
|
|
94073
|
+
await recordCompression(compressionStats, "serialize");
|
|
94074
|
+
return result;
|
|
93658
94075
|
} catch (error2) {
|
|
93659
94076
|
const cause = unwrapSerializationCause(error2);
|
|
93660
94077
|
const { message: message2, hint: hint2 } = formatSerializationError("step return value", cause);
|
|
@@ -93662,7 +94079,9 @@ async function dehydrateStepReturnValue(value, runId, key, ops = [], global2 = g
|
|
|
93662
94079
|
}
|
|
93663
94080
|
}
|
|
93664
94081
|
async function hydrateRunError(value, runId, key, ops = [], global2 = globalThis, extraRevivers = {}) {
|
|
93665
|
-
const
|
|
94082
|
+
const compressionStats = {};
|
|
94083
|
+
const decrypted = await decompress$1(await maybeDecrypt(value, key), compressionStats);
|
|
94084
|
+
await recordCompression(compressionStats, "deserialize");
|
|
93666
94085
|
if (!(decrypted instanceof Uint8Array)) {
|
|
93667
94086
|
return unflatten(decrypted, {
|
|
93668
94087
|
...getExternalRevivers(global2, ops, runId, key),
|
|
@@ -121719,7 +122138,7 @@ function createLocalWorld(args) {
|
|
|
121719
122138
|
const basedir = mergedConfig.dataDir;
|
|
121720
122139
|
const hooksDir = path$3.join(basedir, "hooks");
|
|
121721
122140
|
const taggedHookFiles = await listTaggedFiles(hooksDir, tag);
|
|
121722
|
-
const { HookSchema: HookSchema2 } = await import("./index-
|
|
122141
|
+
const { HookSchema: HookSchema2 } = await import("./index-Beyp1GBB.js");
|
|
121723
122142
|
await Promise.all(taggedHookFiles.map(async (hookFile) => {
|
|
121724
122143
|
const hook = await readJSON(path$3.join(hooksDir, hookFile), HookSchema2);
|
|
121725
122144
|
if (hook == null ? void 0 : hook.token) {
|
|
@@ -121872,8 +122291,8 @@ function requireGetVercelOidcToken() {
|
|
|
121872
122291
|
}
|
|
121873
122292
|
try {
|
|
121874
122293
|
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
|
|
121875
|
-
await import("./token-util-
|
|
121876
|
-
await import("./token-
|
|
122294
|
+
await import("./token-util-BuFs3aOE.js").then((n) => n.t),
|
|
122295
|
+
await import("./token-BxHJXzbi.js").then((n) => n.t)
|
|
121877
122296
|
]);
|
|
121878
122297
|
if (!token || isExpired(getTokenPayload(token), options == null ? void 0 : options.expirationBufferMs)) {
|
|
121879
122298
|
await refreshToken(options);
|
|
@@ -122600,6 +123019,16 @@ async function getSpanKind(field) {
|
|
|
122600
123019
|
return void 0;
|
|
122601
123020
|
return otel.SpanKind[field];
|
|
122602
123021
|
}
|
|
123022
|
+
async function injectTraceContextIntoHeaders(headers2) {
|
|
123023
|
+
const otel = await getOtelApi();
|
|
123024
|
+
if (!otel)
|
|
123025
|
+
return;
|
|
123026
|
+
const carrier = {};
|
|
123027
|
+
otel.propagation.inject(otel.context.active(), carrier);
|
|
123028
|
+
for (const [key, value] of Object.entries(carrier)) {
|
|
123029
|
+
headers2.set(key, value);
|
|
123030
|
+
}
|
|
123031
|
+
}
|
|
122603
123032
|
function SemanticConvention(...names) {
|
|
122604
123033
|
return (value) => Object.fromEntries(names.map((name2) => [name2, value]));
|
|
122605
123034
|
}
|
|
@@ -127148,7 +127577,7 @@ var QueueClient = class {
|
|
|
127148
127577
|
setApi(this, new ApiClient({ ...options, region }));
|
|
127149
127578
|
}
|
|
127150
127579
|
};
|
|
127151
|
-
const version = "5.0.0-beta.
|
|
127580
|
+
const version = "5.0.0-beta.17";
|
|
127152
127581
|
const HTTP_DEBUG_ENABLED = typeof process !== "undefined" && typeof process.env.DEBUG === "string" && (process.env.DEBUG.includes("workflow:") || process.env.DEBUG === "*");
|
|
127153
127582
|
function httpLog(method, endpoint, response2, ms2) {
|
|
127154
127583
|
if (HTTP_DEBUG_ENABLED) {
|
|
@@ -127260,6 +127689,7 @@ async function makeRequest({ endpoint, options = {}, config: config2 = {}, schem
|
|
|
127260
127689
|
...RpcService("workflow-server")
|
|
127261
127690
|
});
|
|
127262
127691
|
headers2.set("Accept", "application/cbor");
|
|
127692
|
+
await injectTraceContextIntoHeaders(headers2);
|
|
127263
127693
|
let body2;
|
|
127264
127694
|
if (data !== void 0) {
|
|
127265
127695
|
headers2.set("Content-Type", "application/cbor");
|
|
@@ -127909,14 +128339,20 @@ async function consumeListFrameStream(url2, headers2, config2, opName) {
|
|
|
127909
128339
|
}
|
|
127910
128340
|
return { events: events2, ...next2 ? { next: next2 } : {} };
|
|
127911
128341
|
}
|
|
127912
|
-
function
|
|
127913
|
-
const sp = new URLSearchParams();
|
|
128342
|
+
function appendListParams(sp, params) {
|
|
127914
128343
|
if (params.cursor)
|
|
127915
128344
|
sp.set("cursor", params.cursor);
|
|
127916
128345
|
if (params.limit !== void 0)
|
|
127917
128346
|
sp.set("limit", String(params.limit));
|
|
127918
128347
|
if (params.sortOrder)
|
|
127919
128348
|
sp.set("sortOrder", params.sortOrder);
|
|
128349
|
+
if (params.remoteRefBehavior) {
|
|
128350
|
+
sp.set("remoteRefBehavior", params.remoteRefBehavior);
|
|
128351
|
+
}
|
|
128352
|
+
}
|
|
128353
|
+
function paginationToQuery(params) {
|
|
128354
|
+
const sp = new URLSearchParams();
|
|
128355
|
+
appendListParams(sp, params);
|
|
127920
128356
|
const qs = sp.toString();
|
|
127921
128357
|
return qs ? `?${qs}` : "";
|
|
127922
128358
|
}
|
|
@@ -127929,12 +128365,7 @@ async function getEventsByCorrelationIdV4(correlationId, params = {}, config2) {
|
|
|
127929
128365
|
const { baseUrl, headers: headers2 } = await getHttpConfig(config2);
|
|
127930
128366
|
const sp = new URLSearchParams();
|
|
127931
128367
|
sp.set("correlationId", correlationId);
|
|
127932
|
-
|
|
127933
|
-
sp.set("cursor", params.cursor);
|
|
127934
|
-
if (params.limit !== void 0)
|
|
127935
|
-
sp.set("limit", String(params.limit));
|
|
127936
|
-
if (params.sortOrder)
|
|
127937
|
-
sp.set("sortOrder", params.sortOrder);
|
|
128368
|
+
appendListParams(sp, params);
|
|
127938
128369
|
const url2 = `${baseUrl}/v4/events?${sp.toString()}`;
|
|
127939
128370
|
return consumeListFrameStream(url2, headers2, config2, "listEventsByCorrelationId");
|
|
127940
128371
|
}
|
|
@@ -128290,7 +128721,8 @@ async function getWorkflowRunEvents(params, config2) {
|
|
|
128290
128721
|
const wirePagination = {
|
|
128291
128722
|
cursor: (pagination == null ? void 0 : pagination.cursor) ?? void 0,
|
|
128292
128723
|
limit: pagination == null ? void 0 : pagination.limit,
|
|
128293
|
-
sortOrder: pagination == null ? void 0 : pagination.sortOrder
|
|
128724
|
+
sortOrder: pagination == null ? void 0 : pagination.sortOrder,
|
|
128725
|
+
remoteRefBehavior: resolveData === "none" ? "lazy" : "resolve"
|
|
128294
128726
|
};
|
|
128295
128727
|
const result = await ("correlationId" in params ? getEventsByCorrelationIdV4(params.correlationId, wirePagination, config2) : getWorkflowRunEventsV4(params.runId, wirePagination, config2));
|
|
128296
128728
|
const events2 = result.events.map((listed) => buildEventFromV4(listed.event, listed.body, resolveData));
|
|
@@ -128621,11 +129053,14 @@ function createVercelWorld(config2) {
|
|
|
128621
129053
|
var _a3, _b2;
|
|
128622
129054
|
const projectId = ((_a3 = config2 == null ? void 0 : config2.projectConfig) == null ? void 0 : _a3.projectId) || process.env.VERCEL_PROJECT_ID;
|
|
128623
129055
|
return {
|
|
128624
|
-
// Spec
|
|
128625
|
-
//
|
|
128626
|
-
//
|
|
128627
|
-
//
|
|
128628
|
-
|
|
129056
|
+
// Spec v5: new runs may carry gzip-compressed payloads (compression is
|
|
129057
|
+
// entirely client-side — the workflow-server stores payloads opaquely
|
|
129058
|
+
// via RemoteRef and never deserializes them). Spec 5 is a superset of
|
|
129059
|
+
// spec 4, so native `attr_set` events and initial run attributes still
|
|
129060
|
+
// work. New runs are stamped with this version; the server must support
|
|
129061
|
+
// at least it — workflow-server declared spec-5 support in
|
|
129062
|
+
// vercel/workflow-server#520.
|
|
129063
|
+
specVersion: SPEC_VERSION_SUPPORTS_COMPRESSION,
|
|
128629
129064
|
// On Vercel the platform fails the function invocation when the
|
|
128630
129065
|
// process exits non-zero, and VQS redelivers the queue message via a
|
|
128631
129066
|
// fresh invocation. The core runtime uses this to decide whether
|
|
@@ -131363,7 +131798,15 @@ function requireSemver() {
|
|
|
131363
131798
|
var semverExports = requireSemver();
|
|
131364
131799
|
const semver = /* @__PURE__ */ getDefaultExportFromCjs(semverExports);
|
|
131365
131800
|
const FORMAT_VERSION_TABLE = [
|
|
131366
|
-
{ format: SerializationFormat.ENCRYPTED, minVersion: "4.2.0-beta.64" }
|
|
131801
|
+
{ format: SerializationFormat.ENCRYPTED, minVersion: "4.2.0-beta.64" },
|
|
131802
|
+
// TODO(release): verify this matches the actual version that ships payload
|
|
131803
|
+
// compression. If a "Version Packages (beta)" PR merges before this change,
|
|
131804
|
+
// bump to the next beta. A too-low cutoff makes new producers write
|
|
131805
|
+
// compressed payloads to consumers that cannot decompress them; too-high
|
|
131806
|
+
// merely delays the optimization (safe). gzip and zstd ship together, so
|
|
131807
|
+
// they share a min version — a run that can read one can read both.
|
|
131808
|
+
{ format: SerializationFormat.GZIP, minVersion: "5.0.0-beta.18" },
|
|
131809
|
+
{ format: SerializationFormat.ZSTD, minVersion: "5.0.0-beta.18" }
|
|
131367
131810
|
// Future entries:
|
|
131368
131811
|
// { format: SerializationFormat.CBOR, minVersion: '5.x.y' },
|
|
131369
131812
|
// { format: SerializationFormat.ENCRYPTED_V2, minVersion: '5.x.y' },
|
|
@@ -131446,9 +131889,10 @@ async function resumeHook$2(tokenOrHook, payload, encryptionKeyOverride) {
|
|
|
131446
131889
|
if (!capabilities.supportedFormats.has(SerializationFormat.ENCRYPTED)) {
|
|
131447
131890
|
encryptionKey = void 0;
|
|
131448
131891
|
}
|
|
131892
|
+
const compression = (workflowRun.specVersion ?? 0) >= SPEC_VERSION_SUPPORTS_COMPRESSION && capabilities.supportedFormats.has(SerializationFormat.GZIP);
|
|
131449
131893
|
const ops = [];
|
|
131450
131894
|
const v1Compat = isLegacySpecVersion(hook.specVersion);
|
|
131451
|
-
const dehydratedPayload = await dehydrateStepReturnValue(payload, hook.runId, encryptionKey, ops, globalThis, v1Compat, capabilities.framedByteStreams);
|
|
131895
|
+
const dehydratedPayload = await dehydrateStepReturnValue(payload, hook.runId, encryptionKey, ops, globalThis, v1Compat, capabilities.framedByteStreams, compression);
|
|
131452
131896
|
safeWaitUntil(Promise.all(ops), (err) => {
|
|
131453
131897
|
if (err === void 0)
|
|
131454
131898
|
return;
|
|
@@ -131470,12 +131914,9 @@ async function resumeHook$2(tokenOrHook, payload, encryptionKeyOverride) {
|
|
|
131470
131914
|
span == null ? void 0 : span.setAttributes({
|
|
131471
131915
|
...WorkflowName(workflowRun.workflowName)
|
|
131472
131916
|
});
|
|
131473
|
-
const
|
|
131474
|
-
if (
|
|
131475
|
-
|
|
131476
|
-
if (context) {
|
|
131477
|
-
(_d2 = span == null ? void 0 : span.addLink) == null ? void 0 : _d2.call(span, { context });
|
|
131478
|
-
}
|
|
131917
|
+
const originLink = await linkToTraceCarrier((_c2 = workflowRun.executionContext) == null ? void 0 : _c2.traceCarrier);
|
|
131918
|
+
if (originLink) {
|
|
131919
|
+
(_d2 = span == null ? void 0 : span.addLink) == null ? void 0 : _d2.call(span, originLink);
|
|
131479
131920
|
}
|
|
131480
131921
|
await world.queue(getWorkflowQueueName(workflowRun.workflowName), {
|
|
131481
131922
|
runId: hook.runId,
|
|
@@ -131561,6 +132002,7 @@ function normalizeAttributeChanges(attrs, options = {}) {
|
|
|
131561
132002
|
}
|
|
131562
132003
|
const CROSS_DEPLOYMENT_CAPABILITY_PROBE_TIMEOUT_MS = 2e3;
|
|
131563
132004
|
const ulid = monotonicFactory();
|
|
132005
|
+
let hasWarnedLatestNoOp = false;
|
|
131564
132006
|
async function start$1(workflow, argsOrOptions, options) {
|
|
131565
132007
|
"use step";
|
|
131566
132008
|
return await waitedUntil(() => {
|
|
@@ -131568,7 +132010,8 @@ async function start$1(workflow, argsOrOptions, options) {
|
|
|
131568
132010
|
if (!workflowName) {
|
|
131569
132011
|
throw new WorkflowRuntimeError(`'start' received an invalid workflow function. Ensure the Workflow SDK is configured correctly and the function includes a 'use workflow' directive.`, { slug: "start-invalid-workflow-function" });
|
|
131570
132012
|
}
|
|
131571
|
-
|
|
132013
|
+
const spanName2 = `workflow.start ${workflowDisplayName(workflowName)}`;
|
|
132014
|
+
return trace$2(spanName2, async (span) => {
|
|
131572
132015
|
var _a3, _b2;
|
|
131573
132016
|
span == null ? void 0 : span.setAttributes({
|
|
131574
132017
|
...WorkflowName(workflowName),
|
|
@@ -131588,22 +132031,32 @@ async function start$1(workflow, argsOrOptions, options) {
|
|
|
131588
132031
|
const currentDeploymentId = await world.getDeploymentId();
|
|
131589
132032
|
let deploymentId = opts.deploymentId ?? currentDeploymentId;
|
|
131590
132033
|
if (deploymentId === "latest") {
|
|
131591
|
-
if (
|
|
131592
|
-
|
|
132034
|
+
if (world.resolveLatestDeploymentId) {
|
|
132035
|
+
deploymentId = await world.resolveLatestDeploymentId();
|
|
132036
|
+
} else {
|
|
132037
|
+
if (!hasWarnedLatestNoOp) {
|
|
132038
|
+
hasWarnedLatestNoOp = true;
|
|
132039
|
+
runtimeLogger.warn("deploymentId: 'latest' has no effect in this world and was ignored. It is only supported by worlds with atomic deployments, such as Vercel. The run will target the current deployment.", { currentDeploymentId });
|
|
132040
|
+
}
|
|
132041
|
+
deploymentId = currentDeploymentId;
|
|
131593
132042
|
}
|
|
131594
|
-
deploymentId = await world.resolveLatestDeploymentId();
|
|
131595
132043
|
}
|
|
131596
132044
|
let framedByteStreams;
|
|
132045
|
+
let targetSupportsCompression;
|
|
131597
132046
|
if (deploymentId === currentDeploymentId) {
|
|
131598
132047
|
framedByteStreams = true;
|
|
132048
|
+
targetSupportsCompression = true;
|
|
131599
132049
|
} else if (typeof ((_a3 = world.streams) == null ? void 0 : _a3.get) !== "function") {
|
|
131600
132050
|
framedByteStreams = false;
|
|
132051
|
+
targetSupportsCompression = false;
|
|
131601
132052
|
} else {
|
|
131602
132053
|
const probe = await healthCheck(world, "workflow", {
|
|
131603
132054
|
deploymentId,
|
|
131604
132055
|
timeout: CROSS_DEPLOYMENT_CAPABILITY_PROBE_TIMEOUT_MS
|
|
131605
132056
|
}).catch(() => void 0);
|
|
131606
|
-
|
|
132057
|
+
const capabilities = getRunCapabilities(probe == null ? void 0 : probe.workflowCoreVersion);
|
|
132058
|
+
framedByteStreams = capabilities.framedByteStreams;
|
|
132059
|
+
targetSupportsCompression = capabilities.supportedFormats.has(SerializationFormat.GZIP);
|
|
131607
132060
|
}
|
|
131608
132061
|
const ops = [];
|
|
131609
132062
|
const runId = `wrun_${ulid()}`;
|
|
@@ -131635,7 +132088,8 @@ async function start$1(workflow, argsOrOptions, options) {
|
|
|
131635
132088
|
deploymentId
|
|
131636
132089
|
}));
|
|
131637
132090
|
const encryptionKey = rawKey ? await importKey(rawKey) : void 0;
|
|
131638
|
-
const
|
|
132091
|
+
const compression = targetSupportsCompression && specVersion >= SPEC_VERSION_SUPPORTS_COMPRESSION;
|
|
132092
|
+
const workflowArguments = await dehydrateWorkflowArguments(args, runId, encryptionKey, ops, globalThis, v1Compat, framedByteStreams, compression);
|
|
131639
132093
|
const executionContext = {
|
|
131640
132094
|
traceCarrier,
|
|
131641
132095
|
workflowCoreVersion: version$1,
|
|
@@ -153792,7 +154246,7 @@ const route4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
|
|
|
153792
154246
|
__proto__: null,
|
|
153793
154247
|
loader
|
|
153794
154248
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
153795
|
-
const serverManifest = { "entry": { "module": "/assets/entry.client-DOJDY_4b.js", "imports": ["/assets/index-BXZSIDEp.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-
|
|
154249
|
+
const serverManifest = { "entry": { "module": "/assets/entry.client-DOJDY_4b.js", "imports": ["/assets/index-BXZSIDEp.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-YgrrwLRm.js", "imports": ["/assets/index-BXZSIDEp.js", "/assets/mermaid-3ZIDBTTL-CO5WTIpO.js"], "css": ["/assets/root-1hd8ZXAx.css", "/assets/mermaid-3ZIDBTTL-DYmT7Gxj.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-CJauHJtz.js", "imports": ["/assets/index-BXZSIDEp.js", "/assets/workflow-graph-viewer-DE9gHUqH.js", "/assets/mermaid-3ZIDBTTL-CO5WTIpO.js", "/assets/index-B6-SzLmT.js"], "css": ["/assets/workflow-graph-viewer-DnlNuQQH.css", "/assets/mermaid-3ZIDBTTL-DYmT7Gxj.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-QryL_6ec.js", "imports": ["/assets/index-BXZSIDEp.js", "/assets/workflow-graph-viewer-DE9gHUqH.js", "/assets/mermaid-3ZIDBTTL-CO5WTIpO.js", "/assets/encryption-g14N5vQl.js", "/assets/index-B6-SzLmT.js"], "css": ["/assets/workflow-graph-viewer-DnlNuQQH.css", "/assets/mermaid-3ZIDBTTL-DYmT7Gxj.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-41c15b7c.js", "version": "41c15b7c", "sri": void 0 };
|
|
153796
154250
|
const assetsBuildDirectory = "build/client";
|
|
153797
154251
|
const basename = "/";
|
|
153798
154252
|
const future = { "unstable_optimizeDeps": false, "unstable_subResourceIntegrity": false, "unstable_trailingSlashAwareDataRequests": false, "unstable_previewServerPrerendering": false, "v8_middleware": false, "v8_splitRouteModules": false, "v8_viteEnvironmentApi": false };
|
|
@@ -153861,39 +154315,41 @@ const serverBuild = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
153861
154315
|
ssr
|
|
153862
154316
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
153863
154317
|
export {
|
|
153864
|
-
|
|
154318
|
+
Ks as $,
|
|
153865
154319
|
ATTRIBUTE_KEY_MAX_LENGTH as A,
|
|
153866
154320
|
BaseEventSchema as B,
|
|
153867
|
-
|
|
154321
|
+
getQueueTopicPrefix as C,
|
|
153868
154322
|
DEFAULT_TIMESTAMP_THRESHOLD_FUTURE_MS as D,
|
|
153869
154323
|
EVENT_DATA_REF_FIELDS as E,
|
|
153870
|
-
|
|
153871
|
-
|
|
154324
|
+
isLegacySpecVersion as F,
|
|
154325
|
+
parseQueueName as G,
|
|
153872
154326
|
HookSchema as H,
|
|
153873
|
-
|
|
153874
|
-
|
|
153875
|
-
|
|
154327
|
+
reenqueueActiveRuns as I,
|
|
154328
|
+
requiresNewerWorld as J,
|
|
154329
|
+
resolveQueueNamespace as K,
|
|
153876
154330
|
LegacySerializedDataSchemaV1 as L,
|
|
153877
154331
|
MessageId as M,
|
|
153878
154332
|
Nt as N,
|
|
153879
|
-
|
|
154333
|
+
stripEventDataRefs as O,
|
|
153880
154334
|
PaginatedResponseSchema as P,
|
|
153881
154335
|
QueuePayloadSchema as Q,
|
|
153882
154336
|
RESERVED_ATTRIBUTE_KEY_PREFIX as R,
|
|
153883
154337
|
SPEC_VERSION_CURRENT as S,
|
|
153884
|
-
|
|
153885
|
-
|
|
154338
|
+
ulidToDate as T,
|
|
154339
|
+
validateAttributeChanges as U,
|
|
153886
154340
|
ValidQueueName as V,
|
|
153887
154341
|
WaitSchema as W,
|
|
153888
|
-
|
|
153889
|
-
|
|
153890
|
-
|
|
153891
|
-
|
|
154342
|
+
validateAttributeKey as X,
|
|
154343
|
+
validateAttributeValue as Y,
|
|
154344
|
+
validateUlidTimestamp as Z,
|
|
154345
|
+
R as _,
|
|
153892
154346
|
ATTRIBUTE_MAX_PER_RUN as a,
|
|
153893
|
-
|
|
153894
|
-
|
|
153895
|
-
|
|
153896
|
-
|
|
154347
|
+
jsxRuntimeExports as a0,
|
|
154348
|
+
Qe as a1,
|
|
154349
|
+
registerZstdDecoder as a2,
|
|
154350
|
+
requireTokenUtil as a3,
|
|
154351
|
+
requireTokenError as a4,
|
|
154352
|
+
serverBuild as a5,
|
|
153897
154353
|
ATTRIBUTE_VALUE_MAX_BYTES as b,
|
|
153898
154354
|
AttributeChangeSchema as c,
|
|
153899
154355
|
AttributeChangesSchema as d,
|
|
@@ -153907,16 +154363,16 @@ export {
|
|
|
153907
154363
|
SPEC_VERSION_LEGACY as l,
|
|
153908
154364
|
SPEC_VERSION_SUPPORTS_ATTRIBUTES as m,
|
|
153909
154365
|
SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT as n,
|
|
153910
|
-
|
|
153911
|
-
|
|
153912
|
-
|
|
153913
|
-
|
|
153914
|
-
|
|
153915
|
-
|
|
153916
|
-
|
|
153917
|
-
|
|
153918
|
-
|
|
153919
|
-
|
|
153920
|
-
|
|
153921
|
-
|
|
154366
|
+
SPEC_VERSION_SUPPORTS_COMPRESSION as o,
|
|
154367
|
+
SPEC_VERSION_SUPPORTS_EVENT_SOURCING as p,
|
|
154368
|
+
SerializedDataSchema as q,
|
|
154369
|
+
StepInvokePayloadSchema as r,
|
|
154370
|
+
StepSchema as s,
|
|
154371
|
+
StepStatusSchema as t,
|
|
154372
|
+
WaitStatusSchema as u,
|
|
154373
|
+
WorkflowInvokePayloadSchema as v,
|
|
154374
|
+
WorkflowRunBaseSchema as w,
|
|
154375
|
+
WorkflowRunSchema as x,
|
|
154376
|
+
WorkflowRunStatusSchema as y,
|
|
154377
|
+
applyAttributeChanges as z
|
|
153922
154378
|
};
|