@workflow/web 5.0.0-beta.7 → 5.0.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. package/build/client/assets/{highlighted-body-B3W2YXNL-Cq4feDhL.js → highlighted-body-B3W2YXNL-ijzNrESJ.js} +1 -1
  2. package/build/client/assets/{home-B-DWbULo.js → home-MRChHR_P.js} +8 -16
  3. package/build/client/assets/{manifest-21016363.js → manifest-b100514d.js} +1 -1
  4. package/build/client/assets/{mermaid-3ZIDBTTL-PK-k2mDG.js → mermaid-3ZIDBTTL-3cOa-aZ5.js} +305 -123
  5. package/build/client/assets/{root-DDT0W3fG.js → root-3uuTxUQN.js} +1 -1
  6. package/build/client/assets/root-BYtlAgHl.css +1 -0
  7. package/build/client/assets/{run-detail-COyTZwjr.js → run-detail-8qGjUNCj.js} +969 -886
  8. package/build/client/assets/server-build-ByHD2s6b.css +1 -0
  9. package/build/client/assets/{workflow-graph-viewer-CVUKAMV1.js → workflow-graph-viewer-DaYMiBT9.js} +50 -41
  10. package/build/server/assets/{app-CASBD2Jz.js → app-BEgkHdDF.js} +1 -1
  11. package/build/server/assets/{highlighted-body-B3W2YXNL-DtYGrm0G.js → highlighted-body-B3W2YXNL-B4fAdNsB.js} +2 -2
  12. package/build/server/assets/index-DltGJ3CV.js +89 -0
  13. package/build/server/assets/{mermaid-3ZIDBTTL-D37Y2lwn.js → mermaid-3ZIDBTTL-C6M7jb0V.js} +2 -2
  14. package/build/server/assets/{server-build-BZS28Q46.js → server-build-Ctg6FoI8.js} +2017 -1544
  15. package/build/server/assets/{token-98GkKm4t.js → token-BNjLoJXz.js} +2 -2
  16. package/build/server/assets/{token-util-CHxt50WW.js → token-util-DwTdh-aG.js} +2 -2
  17. package/build/server/index.js +1 -1
  18. package/package.json +7 -7
  19. package/build/client/assets/root-B527kgKt.css +0 -1
  20. package/build/client/assets/server-build-BUmla00D.css +0 -1
  21. package/build/server/assets/index-B_Gtun0B.js +0 -80
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/encryption-C69WMRfh.js","assets/index-Byi8AWfe.js","assets/index-BsV8i_Jn.js","assets/highlighted-body-B3W2YXNL-Cq4feDhL.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/encryption-C69WMRfh.js","assets/index-Byi8AWfe.js","assets/index-BsV8i_Jn.js","assets/highlighted-body-B3W2YXNL-ijzNrESJ.js"])))=>i.map(i=>d[i]);
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -15311,6 +15311,10 @@ function _instanceof(cls, params = {}) {
15311
15311
  function date(params) {
15312
15312
  return /* @__PURE__ */ _coercedDate(ZodDate, params);
15313
15313
  }
15314
+ object({
15315
+ key: string$2(),
15316
+ value: union([string$2(), _null()])
15317
+ });
15314
15318
  const BinarySerializedDataSchema = _instanceof(Uint8Array);
15315
15319
  const LegacySerializedDataSchemaV1 = any();
15316
15320
  const SerializedDataSchema = union([
@@ -15634,7 +15638,7 @@ const WorkflowRunBaseSchema = object({
15634
15638
  // Optional in database for backwards compatibility, defaults to 1 (legacy) when reading
15635
15639
  specVersion: number$2().optional(),
15636
15640
  executionContext: record(string$2(), any()).optional(),
15637
- input: SerializedDataSchema,
15641
+ input: SerializedDataSchema.optional(),
15638
15642
  output: SerializedDataSchema.optional(),
15639
15643
  /**
15640
15644
  * The thrown value from a run_failed event, serialized via the workflow
@@ -15650,6 +15654,24 @@ const WorkflowRunBaseSchema = object({
15650
15654
  * without needing to decrypt the full error payload.
15651
15655
  */
15652
15656
  errorCode: string$2().optional(),
15657
+ /**
15658
+ * Plaintext string-string metadata attached to the run via
15659
+ * `experimental_setAttributes()` (or, in the future, materialized
15660
+ * from `attr_set` events). Stored unencrypted alongside other
15661
+ * plaintext fields so observability surfaces can read it without
15662
+ * going through the decryption pipeline.
15663
+ *
15664
+ * Defaults to `{}` after schema parsing so consumers always receive
15665
+ * a record regardless of world. World adapters need not initialize
15666
+ * the field on disk — `world-local` JSON files written before this
15667
+ * field existed, and rows from any other adapter that omits the
15668
+ * column, both read as `{}` after Zod parses them.
15669
+ *
15670
+ * EXPERIMENTAL (MVP): the full Workflow Attributes feature replaces
15671
+ * the direct-mutation MVP path with an event-sourced model — see
15672
+ * the attributes-mvp changelog entry.
15673
+ */
15674
+ attributes: record(string$2(), string$2()).default({}),
15653
15675
  expiredAt: date().optional(),
15654
15676
  startedAt: date().optional(),
15655
15677
  completedAt: date().optional(),
@@ -15734,7 +15756,7 @@ object({
15734
15756
  */
15735
15757
  stepName: string$2(),
15736
15758
  status: StepStatusSchema,
15737
- input: SerializedDataSchema,
15759
+ input: SerializedDataSchema.optional(),
15738
15760
  output: SerializedDataSchema.optional(),
15739
15761
  /**
15740
15762
  * The thrown value from a step_retrying or step_failed event, serialized
@@ -17000,6 +17022,87 @@ const geistTheme = {
17000
17022
  };
17001
17023
  const inspectorThemeLight = geistTheme;
17002
17024
  const inspectorThemeDark = geistTheme;
17025
+ const falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
17026
+ const cx = clsx;
17027
+ const cva = (base, config2) => (props) => {
17028
+ var _config_compoundVariants;
17029
+ if ((config2 === null || config2 === void 0 ? void 0 : config2.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
17030
+ const { variants, defaultVariants } = config2;
17031
+ const getVariantClassNames = Object.keys(variants).map((variant) => {
17032
+ const variantProp = props === null || props === void 0 ? void 0 : props[variant];
17033
+ const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
17034
+ if (variantProp === null) return null;
17035
+ const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
17036
+ return variants[variant][variantKey];
17037
+ });
17038
+ const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
17039
+ let [key, value] = param;
17040
+ if (value === void 0) {
17041
+ return acc;
17042
+ }
17043
+ acc[key] = value;
17044
+ return acc;
17045
+ }, {});
17046
+ const getCompoundVariantClassNames = config2 === null || config2 === void 0 ? void 0 : (_config_compoundVariants = config2.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
17047
+ let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
17048
+ return Object.entries(compoundVariantOptions).every((param2) => {
17049
+ let [key, value] = param2;
17050
+ return Array.isArray(value) ? value.includes({
17051
+ ...defaultVariants,
17052
+ ...propsWithoutUndefined
17053
+ }[key]) : {
17054
+ ...defaultVariants,
17055
+ ...propsWithoutUndefined
17056
+ }[key] === value;
17057
+ }) ? [
17058
+ ...acc,
17059
+ cvClass,
17060
+ cvClassName
17061
+ ] : acc;
17062
+ }, []);
17063
+ return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
17064
+ };
17065
+ const buttonVariants$1 = cva([
17066
+ "outline-none m-0 border-0 align-baseline no-underline group/trigger",
17067
+ "relative cursor-pointer select-none transform translate-z-0",
17068
+ "inline-flex max-w-full items-center justify-center gap-x-1 whitespace-nowrap rounded-md font-medium",
17069
+ "!text-gray-100",
17070
+ "bg-gray-1000",
17071
+ "transition-[border-color,background,color,transform,box-shadow] duration-150 ease-in-out",
17072
+ // Geist invert hover: literal fallbacks (no token dep, so it resolves in any
17073
+ // consuming app), darkened via ancestor theme class without a registered variant.
17074
+ "hover:bg-[var(--themed-hover-bg,_hsl(0,_0%,_22%))]",
17075
+ "[.dark-theme_&]:hover:bg-[var(--themed-hover-bg,_hsl(0,_0%,_80%))]",
17076
+ "[[data-theme=dark]_&]:hover:bg-[var(--themed-hover-bg,_hsl(0,_0%,_80%))]",
17077
+ // Geist focus ring as arbitrary properties (no bare `outline`/ambiguous
17078
+ // arbitrary-color utilities, which differ between Tailwind v3 and v4).
17079
+ "focus-visible:[outline:2px_solid_var(--ds-focus-color)] focus-visible:[outline-offset:2px]",
17080
+ // disabled styles
17081
+ "disabled:cursor-not-allowed aria-disabled:cursor-not-allowed",
17082
+ "disabled:bg-gray-100 disabled:!text-gray-700 disabled:hover:bg-gray-100",
17083
+ "aria-disabled:bg-gray-100 aria-disabled:text-gray-700 aria-disabled:hover:bg-gray-100"
17084
+ ], {
17085
+ variants: {
17086
+ variant: {
17087
+ default: "",
17088
+ secondary: "border border-gray-alpha-400 [--themed-bg:_var(--ds-background-100)] [--themed-fg:_var(--ds-gray-1000)] [--themed-hover-bg:_var(--ds-gray-alpha-200)]",
17089
+ ghost: "[--themed-bg:_transparent] [--themed-fg:_var(--ds-gray-1000)] [--themed-hover-bg:_var(--ds-gray-alpha-100)]"
17090
+ },
17091
+ size: {
17092
+ default: "h-10 px-4 text-[14px]",
17093
+ sm: "h-8 px-3 text-[14px]",
17094
+ xs: "h-6 px-1.5 py-0.5 text-button-12 rounded-[4px]",
17095
+ icon: "h-8 w-8"
17096
+ }
17097
+ },
17098
+ defaultVariants: {
17099
+ variant: "default",
17100
+ size: "default"
17101
+ }
17102
+ });
17103
+ function Button$1({ className, variant, size: size2, type = "button", ...props }) {
17104
+ return jsxRuntimeExports.jsx("button", { type, className: cn$4(buttonVariants$1({ variant, size: size2, className })), ...props });
17105
+ }
17003
17106
  const STREAM_REF_TYPE = "__workflow_stream_ref__";
17004
17107
  const CLASS_INSTANCE_REF_TYPE = "__workflow_class_instance_ref__";
17005
17108
  const RUN_REF_TYPE = "__workflow_run_ref__";
@@ -17049,16 +17152,10 @@ const RunClickContext = reactExports.createContext(void 0);
17049
17152
  function EncryptedInlineLabel() {
17050
17153
  const ctx = reactExports.useContext(DecryptClickContext);
17051
17154
  if (ctx) {
17052
- return jsxRuntimeExports.jsxs("button", { type: "button", className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[11px] cursor-pointer", style: {
17053
- backgroundColor: "var(--ds-gray-100)",
17054
- color: "var(--ds-gray-700)",
17055
- border: "1px solid var(--ds-gray-400)",
17056
- fontStyle: "italic",
17057
- opacity: ctx.isDecrypting ? 0.6 : 1
17058
- }, disabled: ctx.isDecrypting, onClick: (e) => {
17155
+ return jsxRuntimeExports.jsxs(Button$1, { size: "xs", className: "align-baseline gap-x-1", disabled: ctx.isDecrypting, onClick: (e) => {
17059
17156
  e.stopPropagation();
17060
17157
  ctx.onDecrypt();
17061
- }, title: "Click to decrypt", children: [ctx.isDecrypting ? jsxRuntimeExports.jsx(Spinner, { size: 12 }) : jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3", style: { display: "inline", flexShrink: 0 } }), jsxRuntimeExports.jsx("span", { children: ctx.isDecrypting ? "Decrypting…" : "Decrypt" })] });
17158
+ }, children: [ctx.isDecrypting ? jsxRuntimeExports.jsx(Spinner, { size: 10 }) : jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3" }), jsxRuntimeExports.jsx("span", { children: "Decrypt" })] });
17062
17159
  }
17063
17160
  return jsxRuntimeExports.jsxs("span", { style: { color: "var(--ds-gray-600)", fontStyle: "italic" }, children: [jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3", style: {
17064
17161
  display: "inline",
@@ -17304,6 +17401,9 @@ function isDeepEqual(a2, b2, seen2 = /* @__PURE__ */ new WeakMap()) {
17304
17401
  }
17305
17402
  return true;
17306
17403
  }
17404
+ function Skeleton$1({ className, style: style2, ...props }) {
17405
+ return jsxRuntimeExports.jsx("div", { ...props, className: cn$4("rounded-md", className), style: { backgroundColor: "var(--ds-gray-200)", ...style2 } });
17406
+ }
17307
17407
  function __insertCSS(code2) {
17308
17408
  if (typeof document == "undefined") return;
17309
17409
  let head = document.head || document.getElementsByTagName("head")[0];
@@ -18393,9 +18493,6 @@ const ToastContext = reactExports.createContext(defaultAdapter);
18393
18493
  function useToast() {
18394
18494
  return reactExports.useContext(ToastContext);
18395
18495
  }
18396
- function Skeleton$1({ className, style: style2, ...props }) {
18397
- return jsxRuntimeExports.jsx("div", { ...props, className: cn$4("rounded-md", className), style: { backgroundColor: "var(--ds-gray-200)", ...style2 } });
18398
- }
18399
18496
  const convert = (
18400
18497
  // Note: overloads in JSDoc can’t yet use different `@template`s.
18401
18498
  /**
@@ -43158,7 +43255,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
43158
43255
  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 });
43159
43256
  var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
43160
43257
  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 }) });
43161
- var cn$1 = /\n+$/, dn = reactExports.lazy(() => __vitePreload(() => import("./highlighted-body-B3W2YXNL-Cq4feDhL.js"), true ? __vite__mapDeps([3,2]) : void 0).then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
43258
+ var cn$1 = /\n+$/, dn = reactExports.lazy(() => __vitePreload(() => import("./highlighted-body-B3W2YXNL-ijzNrESJ.js"), true ? __vite__mapDeps([3,2]) : void 0).then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
43162
43259
  let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
43163
43260
  `).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
43164
43261
  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 }) })] }) });
@@ -43922,6 +44019,14 @@ var Nt = ({ chart: e, className: t, config: o, fullscreen: n = false, showContro
43922
44019
  let T2 = l || d2;
43923
44020
  return jsxRuntimeExports.jsx("div", { className: f("size-full", t), "data-streamdown": "mermaid", ref: w2, children: jsxRuntimeExports.jsx(So, { className: f(n ? "size-full overflow-hidden" : "overflow-hidden", t), fullscreen: n, maxZoom: 3, minZoom: 0.5, showControls: s2, zoomStep: 0.1, children: jsxRuntimeExports.jsx("div", { "aria-label": "Mermaid chart", className: f("flex justify-center", n ? "size-full items-center" : null), dangerouslySetInnerHTML: { __html: T2 }, role: "img" }) }) });
43924
44021
  };
44022
+ const SidebarDataContext = reactExports.createContext(null);
44023
+ SidebarDataContext.displayName = "SidebarDataContext";
44024
+ function SidebarDataProvider({ value, children: children2 }) {
44025
+ return jsxRuntimeExports.jsx(SidebarDataContext.Provider, { value, children: children2 });
44026
+ }
44027
+ function useSidebarDataOptional() {
44028
+ return reactExports.useContext(SidebarDataContext);
44029
+ }
43925
44030
  const MAP_HEIGHT = 56;
43926
44031
  const TIMELINE_PADDING = 8;
43927
44032
  const ROW_PADDING = 2;
@@ -45151,14 +45256,6 @@ reactExports.memo(function MiniMap({ timelineRef, rows, scale }) {
45151
45256
  height: MAP_HEIGHT - 4
45152
45257
  } })] });
45153
45258
  });
45154
- const SidebarDataContext = reactExports.createContext(null);
45155
- SidebarDataContext.displayName = "SidebarDataContext";
45156
- function SidebarDataProvider({ value, children: children2 }) {
45157
- return jsxRuntimeExports.jsx(SidebarDataContext.Provider, { value, children: children2 });
45158
- }
45159
- function useSidebarDataOptional() {
45160
- return reactExports.useContext(SidebarDataContext);
45161
- }
45162
45259
  const ChunkRow = ReactExports.memo(function ChunkRow2({ chunk, index: index2 }) {
45163
45260
  return jsxRuntimeExports.jsx("div", { className: "text-[11px] rounded-md border p-3", style: {
45164
45261
  borderColor: "var(--ds-gray-300)",
@@ -45194,6 +45291,128 @@ function StreamViewer({ streamId: _streamId, chunks, isLive, error, isLoading, o
45194
45291
  color: "var(--ds-gray-600)"
45195
45292
  }, children: isLive ? "Waiting for stream data..." : "Stream is empty" }) : jsxRuntimeExports.jsx(Yr, { ref: virtuosoRef, totalCount: chunks.length, overscan: 10, endReached: () => onScrollEnd == null ? void 0 : onScrollEnd(), itemContent: (index2) => jsxRuntimeExports.jsx("div", { style: { paddingBottom: 8 }, children: jsxRuntimeExports.jsx(ChunkRow, { chunk: chunks[index2], index: index2 }) }), style: { flex: 1, minHeight: 0 } }) })] });
45196
45293
  }
45294
+ const ATTR_FILTER_REGEX = /(?:^|\s)(?<pair>(?<key>[\w.]+):(?<value>\S*))/g;
45295
+ function parseSpanSearchQuery(rawQuery) {
45296
+ var _a3, _b, _c;
45297
+ const attributes = [];
45298
+ for (const match of rawQuery.matchAll(ATTR_FILTER_REGEX)) {
45299
+ const key = (_b = (_a3 = match.groups) == null ? void 0 : _a3.key) == null ? void 0 : _b.trim();
45300
+ if (!key)
45301
+ continue;
45302
+ attributes.push({
45303
+ key,
45304
+ value: (((_c = match.groups) == null ? void 0 : _c.value) ?? "").toLocaleLowerCase()
45305
+ });
45306
+ }
45307
+ const text2 = rawQuery.replace(ATTR_FILTER_REGEX, " ").replace(/\s{2,}/g, " ").trim().toLocaleLowerCase();
45308
+ return { text: text2, attributes };
45309
+ }
45310
+ function isSpanDimmedBySearch(spanId, result) {
45311
+ return result.isActive && !result.matchedSpanIds.has(spanId);
45312
+ }
45313
+ function searchSpans(spans, rawQuery) {
45314
+ const query = parseSpanSearchQuery(rawQuery);
45315
+ const isActive = Boolean(query.text || query.attributes.length);
45316
+ const matchingSpans = isActive ? spans.filter((span) => spanMatchesQuery(span, query)) : spans;
45317
+ return {
45318
+ isActive,
45319
+ matchedSpanIds: new Set(matchingSpans.map((span) => span.spanId)),
45320
+ matchingSpans,
45321
+ query
45322
+ };
45323
+ }
45324
+ function spanMatchesQuery(span, query) {
45325
+ if (query.text && !spanMatchesText(span, query.text)) {
45326
+ return false;
45327
+ }
45328
+ return query.attributes.every(({ key, value }) => spanMatchesAttribute(span, key, value));
45329
+ }
45330
+ function spanMatchesText(span, text2) {
45331
+ return [
45332
+ span.name,
45333
+ span.spanId,
45334
+ span.resource,
45335
+ span.library.name,
45336
+ span.library.version
45337
+ ].filter((value) => typeof value === "string").some((value) => value.toLocaleLowerCase().includes(text2));
45338
+ }
45339
+ function spanMatchesAttribute(span, key, expectedValue) {
45340
+ const candidates = getSearchValues(span, key);
45341
+ if (!candidates.length)
45342
+ return false;
45343
+ if (!expectedValue) {
45344
+ return candidates.some((value) => value != null);
45345
+ }
45346
+ return candidates.some((value) => valueToSearchString(value).toLocaleLowerCase().includes(expectedValue));
45347
+ }
45348
+ function getSearchValues(span, key) {
45349
+ const candidates = [];
45350
+ const normalizedKey = key.toLocaleLowerCase();
45351
+ switch (normalizedKey) {
45352
+ case "id":
45353
+ case "spanid":
45354
+ case "span.id":
45355
+ candidates.push(span.spanId);
45356
+ break;
45357
+ case "name":
45358
+ candidates.push(span.name);
45359
+ break;
45360
+ case "resource":
45361
+ candidates.push(span.resource);
45362
+ break;
45363
+ case "library":
45364
+ case "library.name":
45365
+ candidates.push(span.library.name);
45366
+ break;
45367
+ case "library.version":
45368
+ candidates.push(span.library.version);
45369
+ break;
45370
+ case "status":
45371
+ case "status.code":
45372
+ candidates.push(span.status.code);
45373
+ break;
45374
+ }
45375
+ candidates.push(getOwnProperty(span.attributes, key));
45376
+ candidates.push(getPathValue(span.attributes, key));
45377
+ if (!normalizedKey.startsWith("data.")) {
45378
+ candidates.push(getPathValue(span.attributes.data, key));
45379
+ }
45380
+ return candidates.filter((value) => value !== void 0);
45381
+ }
45382
+ function getOwnProperty(source, key) {
45383
+ if (!source || typeof source !== "object")
45384
+ return void 0;
45385
+ if (!Object.hasOwn(source, key))
45386
+ return void 0;
45387
+ return source[key];
45388
+ }
45389
+ function getPathValue(source, path2) {
45390
+ if (!source || typeof source !== "object")
45391
+ return void 0;
45392
+ let current = source;
45393
+ for (const segment2 of path2.split(".")) {
45394
+ if (!segment2)
45395
+ return void 0;
45396
+ current = getOwnProperty(current, segment2);
45397
+ if (current === void 0)
45398
+ return void 0;
45399
+ }
45400
+ return current;
45401
+ }
45402
+ function valueToSearchString(value) {
45403
+ if (value instanceof Date)
45404
+ return value.toISOString();
45405
+ if (typeof value === "string")
45406
+ return value;
45407
+ if (value == null || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
45408
+ return String(value);
45409
+ }
45410
+ try {
45411
+ return JSON.stringify(value);
45412
+ } catch {
45413
+ return String(value);
45414
+ }
45415
+ }
45197
45416
  function computeRootBounds(spans) {
45198
45417
  let minStart = Number.POSITIVE_INFINITY;
45199
45418
  let maxEnd = Number.NEGATIVE_INFINITY;
@@ -45623,7 +45842,7 @@ function SegmentBar({ segments }) {
45623
45842
  }, children: showLabel ? jsxRuntimeExports.jsx(DurationLabel, { label }) : null }, `${seg.status}-${i}`);
45624
45843
  }) });
45625
45844
  }
45626
- const TimelineBar = reactExports.memo(function TimelineBar2({ span, viewStart, viewDuration, containerWidth, isSelected, onSelect }) {
45845
+ const TimelineBar = reactExports.memo(function TimelineBar2({ span, viewStart, viewDuration, containerWidth, isSelected, isDimmed, onSelect }) {
45627
45846
  var _a3;
45628
45847
  const startMs = getHighResInMs(span.startTime);
45629
45848
  const endMs = getHighResInMs(span.endTime);
@@ -45641,7 +45860,7 @@ const TimelineBar = reactExports.memo(function TimelineBar2({ span, viewStart, v
45641
45860
  const handleClick = reactExports.useCallback(() => {
45642
45861
  onSelect(span.spanId);
45643
45862
  }, [onSelect, span.spanId]);
45644
- return jsxRuntimeExports.jsx("div", { role: "treeitem", "aria-selected": isSelected, "aria-expanded": isSelected, "aria-level": 1, className: "group/timeline-row h-10 relative flex items-center hover:bg-gray-100 aria-selected:bg-gray-100 aria-selected:hover:bg-gray-200", onClick: handleClick, children: jsxRuntimeExports.jsx("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", 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 }) }) }) });
45863
+ 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.jsx("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 }) }) }) });
45645
45864
  });
45646
45865
  const DELTA_ROW_HEIGHT_PX = 40;
45647
45866
  const DELTA_CAP_HEIGHT_PX = 8;
@@ -45658,7 +45877,7 @@ const DeltaIndicator = reactExports.memo(function DeltaIndicator2({ leftFrac, ri
45658
45877
  function TimelineHeader({ markers: markers2, hoverInfo: hoverInfo2 }) {
45659
45878
  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 }, `${m2.position}-${m2.label}`)), 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 })] }) });
45660
45879
  }
45661
- function Timeline({ spans, viewStart, viewEnd, markers: markers2, selectedId, onSelect, hoverFraction, altHeld = false }) {
45880
+ function Timeline({ spans, viewStart, viewEnd, markers: markers2, selectedId, searchResult, onSelect, hoverFraction, altHeld = false }) {
45662
45881
  const containerRef = reactExports.useRef(null);
45663
45882
  const [containerWidth, setContainerWidth] = reactExports.useState(0);
45664
45883
  const viewDuration = viewEnd - viewStart;
@@ -45677,7 +45896,7 @@ function Timeline({ spans, viewStart, viewEnd, markers: markers2, selectedId, on
45677
45896
  return jsxRuntimeExports.jsxs("div", { ref: containerRef, className: "relative h-full overflow-hidden", children: [jsxRuntimeExports.jsx("div", { "aria-hidden": true, className: "absolute inset-y-0 pointer-events-none", style: TIMELINE_INSET_STYLE, children: markers2.map((marker2) => (
45678
45897
  // Skip the "0s" origin marker since the left edge already implies it.
45679
45898
  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}%` } }, `${marker2.position}-${marker2.label}`) : null
45680
- )) }), 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}%` } }) }), spans.map((span) => jsxRuntimeExports.jsx(TimelineBar, { span, viewStart, viewDuration, containerWidth: timelineWidth, isSelected: selectedId === span.spanId, 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)) })] });
45899
+ )) }), 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}%` } }) }), spans.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)) })] });
45681
45900
  }
45682
45901
  const ActiveSpanContext = reactExports.createContext(null);
45683
45902
  ActiveSpanContext.displayName = "ActiveSpanContext";
@@ -45879,46 +46098,6 @@ function getElementRef(element2) {
45879
46098
  }
45880
46099
  return element2.props.ref || element2.ref;
45881
46100
  }
45882
- const falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
45883
- const cx = clsx;
45884
- const cva = (base, config2) => (props) => {
45885
- var _config_compoundVariants;
45886
- if ((config2 === null || config2 === void 0 ? void 0 : config2.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
45887
- const { variants, defaultVariants } = config2;
45888
- const getVariantClassNames = Object.keys(variants).map((variant) => {
45889
- const variantProp = props === null || props === void 0 ? void 0 : props[variant];
45890
- const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
45891
- if (variantProp === null) return null;
45892
- const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
45893
- return variants[variant][variantKey];
45894
- });
45895
- const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
45896
- let [key, value] = param;
45897
- if (value === void 0) {
45898
- return acc;
45899
- }
45900
- acc[key] = value;
45901
- return acc;
45902
- }, {});
45903
- const getCompoundVariantClassNames = config2 === null || config2 === void 0 ? void 0 : (_config_compoundVariants = config2.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
45904
- let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
45905
- return Object.entries(compoundVariantOptions).every((param2) => {
45906
- let [key, value] = param2;
45907
- return Array.isArray(value) ? value.includes({
45908
- ...defaultVariants,
45909
- ...propsWithoutUndefined
45910
- }[key]) : {
45911
- ...defaultVariants,
45912
- ...propsWithoutUndefined
45913
- }[key] === value;
45914
- }) ? [
45915
- ...acc,
45916
- cvClass,
45917
- cvClassName
45918
- ] : acc;
45919
- }, []);
45920
- return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
45921
- };
45922
46101
  const buttonVariants = cva(
45923
46102
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
45924
46103
  {
@@ -48264,7 +48443,7 @@ const mermaid3ZIDBTTL = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
48264
48443
  Mermaid: Nt
48265
48444
  }, Symbol.toStringTag, { value: "Module" }));
48266
48445
  export {
48267
- StreamClickContext as $,
48446
+ Button$1 as $,
48268
48447
  Anchor as A,
48269
48448
  Button as B,
48270
48449
  Content as C,
@@ -48278,70 +48457,73 @@ export {
48278
48457
  Ks as K,
48279
48458
  LoaderCircle as L,
48280
48459
  Spinner as M,
48281
- Skeleton$1 as N,
48282
- DecryptClickContext as O,
48460
+ cn$4 as N,
48461
+ Skeleton$1 as O,
48283
48462
  Primitive as P,
48284
48463
  Qe as Q,
48285
48464
  R,
48286
48465
  ServerConfigProvider as S,
48287
48466
  Tooltip as T,
48288
- isEncryptedMarker as U,
48467
+ DecryptClickContext as U,
48289
48468
  VISUALLY_HIDDEN_STYLES as V,
48290
- formatDuration as W,
48291
- DataInspector as X,
48469
+ isEncryptedMarker as W,
48470
+ formatDuration as X,
48292
48471
  Yr as Y,
48293
- RunClickContext as Z,
48472
+ DataInspector as Z,
48294
48473
  _r as _,
48295
48474
  TooltipTrigger as a,
48296
- isExpiredMarker as a0,
48297
- isDoStreamStep as a1,
48298
- extractConversation as a2,
48299
- Lock as a3,
48300
- EVENT_DATA_REF_FIELDS as a4,
48301
- clsx as a5,
48302
- cn$4 as a6,
48303
- getSpanDurationMs as a7,
48304
- getHighResInMs as a8,
48305
- ActiveSpanProvider as a9,
48306
- offset as aA,
48307
- shift as aB,
48308
- limitShift as aC,
48309
- flip as aD,
48310
- size as aE,
48311
- arrow as aF,
48312
- hide as aG,
48313
- autoUpdate as aH,
48314
- cancelRun as aI,
48315
- reenqueueRun as aJ,
48316
- wakeUpRun as aK,
48317
- resumeHook as aL,
48318
- recreateRun as aM,
48319
- useActiveSpan as aa,
48320
- useSidebarDataOptional as ab,
48321
- computeRootBounds as ac,
48322
- computeTimeMarkers as ad,
48323
- TIMELINE_PADDING_PX as ae,
48324
- Timeline as af,
48325
- TimelineHeader as ag,
48326
- SidebarDataProvider as ah,
48327
- hydrateResourceIOWithKey as ai,
48328
- hydrateResourceIO as aj,
48329
- fetchHook as ak,
48330
- fetchStep as al,
48331
- hasEncryptedFields as am,
48332
- fetchStreams as an,
48333
- Slot as ao,
48334
- Slottable as ap,
48335
- buttonVariants as aq,
48336
- isEncryptedData as ar,
48337
- hydrateData as as,
48338
- getWebRevivers as at,
48339
- LIVE_UPDATE_INTERVAL_MS as au,
48340
- fetchEvent as av,
48341
- getEncryptionKeyForRun as aw,
48342
- StreamViewer as ax,
48343
- composeRefs as ay,
48344
- useFloating as az,
48475
+ Lock as a0,
48476
+ RunClickContext as a1,
48477
+ StreamClickContext as a2,
48478
+ isExpiredMarker as a3,
48479
+ isDoStreamStep as a4,
48480
+ extractConversation as a5,
48481
+ hasEncryptedFields as a6,
48482
+ EVENT_DATA_REF_FIELDS as a7,
48483
+ useSidebarDataOptional as a8,
48484
+ clsx as a9,
48485
+ StreamViewer as aA,
48486
+ composeRefs as aB,
48487
+ useFloating as aC,
48488
+ offset as aD,
48489
+ shift as aE,
48490
+ limitShift as aF,
48491
+ flip as aG,
48492
+ size as aH,
48493
+ arrow as aI,
48494
+ hide as aJ,
48495
+ autoUpdate as aK,
48496
+ cancelRun as aL,
48497
+ reenqueueRun as aM,
48498
+ wakeUpRun as aN,
48499
+ resumeHook as aO,
48500
+ recreateRun as aP,
48501
+ isSpanDimmedBySearch as aa,
48502
+ getSpanDurationMs as ab,
48503
+ getHighResInMs as ac,
48504
+ ActiveSpanProvider as ad,
48505
+ useActiveSpan as ae,
48506
+ searchSpans as af,
48507
+ computeRootBounds as ag,
48508
+ computeTimeMarkers as ah,
48509
+ TIMELINE_PADDING_PX as ai,
48510
+ Timeline as aj,
48511
+ TimelineHeader as ak,
48512
+ SidebarDataProvider as al,
48513
+ hydrateResourceIOWithKey as am,
48514
+ hydrateResourceIO as an,
48515
+ fetchHook as ao,
48516
+ fetchStep as ap,
48517
+ fetchStreams as aq,
48518
+ Slot as ar,
48519
+ Slottable as as,
48520
+ buttonVariants as at,
48521
+ isEncryptedData as au,
48522
+ hydrateData as av,
48523
+ getWebRevivers as aw,
48524
+ LIVE_UPDATE_INTERVAL_MS as ax,
48525
+ fetchEvent as ay,
48526
+ getEncryptionKeyForRun as az,
48345
48527
  TooltipContent as b,
48346
48528
  createLucideIcon as c,
48347
48529
  cn as d,
@@ -1,5 +1,5 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports, w as withComponentProps, x as withErrorBoundaryProps, M as Meta, L as Links, S as ScrollRestoration, y as Scripts, O as Outlet, z as useRouteError, i as isRouteErrorResponse, A as Link, B as useNavigate, C as useSearchParams } from "./index-BsV8i_Jn.js";
2
- import { c as createLucideIcon, u as useServerConfig, T as Tooltip, a as TooltipTrigger, b as TooltipContent, r as runHealthCheck, t as toast, B as Button, L as LoaderCircle, d as cn, e as Toaster$1, S as ServerConfigProvider, f as TooltipProvider } from "./mermaid-3ZIDBTTL-PK-k2mDG.js";
2
+ import { c as createLucideIcon, u as useServerConfig, T as Tooltip, a as TooltipTrigger, b as TooltipContent, r as runHealthCheck, t as toast, B as Button, L as LoaderCircle, d as cn, e as Toaster$1, S as ServerConfigProvider, f as TooltipProvider } from "./mermaid-3ZIDBTTL-3cOa-aZ5.js";
3
3
  var M = (e, i, s, u, m, a, l, h) => {
4
4
  let d = document.documentElement, w = ["light", "dark"];
5
5
  function p(n) {