@tangle-network/sandbox-ui 2.0.21 → 2.0.22

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.
@@ -1,7 +1,7 @@
1
1
  import { i as e, t } from "./rolldown-runtime-CwxnZyOB.js";
2
- import { A as n, C as r, D as i, E as a, I as o, O as s, Q as c, T as l, _ as u, a as d, at as f, b as p, c as m, d as h, f as g, g as _, h as v, i as y, k as b, l as x, n as S, ot as C, p as w, s as T, st as E, t as D, v as O, w as k, y as A } from "./latest-events-iiWwpIck-BTK0vSlR.js";
3
- // node_modules/.pnpm/@tangle-network+charts@2.0.17_@xyflow+react@12.12.0_@types+react-dom@19.3.0_@types+reac_8e3190d6d56297d136c67efaea3d6d83/node_modules/@tangle-network/charts/dist/motion-DILryczn.js
4
- var j = "[transition:color_var(--motion-control),background-color_var(--motion-control),border-color_var(--motion-control),box-shadow_var(--motion-control),transform_var(--motion-control),scale_var(--motion-control),opacity_var(--motion-control)] motion-reduce:transition-none", M = /* @__PURE__ */ e(E(), 1), N = /* @__PURE__ */ e(C()), P = f();
2
+ import { G as n, K as r, O as i, S as a, T as o, W as s, X as c, Y as l, Z as u, _ as d, a as f, b as p, c as m, ct as h, d as g, f as _, g as v, h as y, i as b, j as x, l as S, lt as C, m as w, n as T, p as E, s as D, st as O, t as k, x as A } from "./latest-events-CabhXynX-Dp_vs0Px.js";
3
+ // node_modules/.pnpm/@tangle-network+charts@3.0.3_@tangle-network+brand@1.31.3_react@19.3.1__@xyflow+react@1_0426ef703f5a4daff255264764f45251/node_modules/@tangle-network/charts/dist/motion-DILryczn.js
4
+ var j = "[transition:color_var(--motion-control),background-color_var(--motion-control),border-color_var(--motion-control),box-shadow_var(--motion-control),transform_var(--motion-control),scale_var(--motion-control),opacity_var(--motion-control)] motion-reduce:transition-none", M = /* @__PURE__ */ e(C(), 1), N = /* @__PURE__ */ e(h()), P = O();
5
5
  function F(e) {
6
6
  if (typeof e == "string" || typeof e == "number") return "" + e;
7
7
  let t = "";
@@ -4093,7 +4093,7 @@ function lc({ domNode: e, nodeId: t, getStoreItems: n, onChange: r, onEnd: i })
4093
4093
  }
4094
4094
  // node_modules/.pnpm/use-sync-external-store@1.7.0_react@19.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
4095
4095
  var uc = /* @__PURE__ */ t(((e) => {
4096
- var t = E();
4096
+ var t = C();
4097
4097
  function n(e, t) {
4098
4098
  return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
4099
4099
  }
@@ -4133,7 +4133,7 @@ var uc = /* @__PURE__ */ t(((e) => {
4133
4133
  })), dc = /* @__PURE__ */ t(((e, t) => {
4134
4134
  t.exports = uc();
4135
4135
  })), fc = /* @__PURE__ */ t(((e) => {
4136
- var t = E(), n = dc();
4136
+ var t = C(), n = dc();
4137
4137
  function r(e, t) {
4138
4138
  return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
4139
4139
  }
@@ -7582,7 +7582,7 @@ function mf({ nodeId: e, position: t, variant: n = Qs.Handle, className: r, styl
7582
7582
  });
7583
7583
  }
7584
7584
  (0, M.memo)(mf);
7585
- // node_modules/.pnpm/@tangle-network+charts@2.0.17_@xyflow+react@12.12.0_@types+react-dom@19.3.0_@types+reac_8e3190d6d56297d136c67efaea3d6d83/node_modules/@tangle-network/charts/dist/AgentGraphCanvas-B74GN1o6.js
7585
+ // node_modules/.pnpm/@tangle-network+charts@3.0.3_@tangle-network+brand@1.31.3_react@19.3.1__@xyflow+react@1_0426ef703f5a4daff255264764f45251/node_modules/@tangle-network/charts/dist/AgentGraphCanvas-DDvaU9Rg.js
7586
7586
  var hf = {
7587
7587
  name: "chevron-down",
7588
7588
  size: 24,
@@ -7592,9 +7592,9 @@ var hf = {
7592
7592
  }]]
7593
7593
  };
7594
7594
  hf.node;
7595
- var gf = o(hf);
7595
+ var gf = x(hf);
7596
7596
  function _f(e) {
7597
- let t = c(e), n = e === "needs-you" ? "waiting" : e === "waiting" || e === "idle" || e === "unknown" ? "queued" : e === "stopped" ? "succeeded" : e;
7597
+ let t = s(e), n = e === "needs-you" ? "waiting" : e === "waiting" || e === "idle" || e === "unknown" ? "queued" : e === "stopped" ? "succeeded" : e;
7598
7598
  return {
7599
7599
  ...t,
7600
7600
  color: `var(${t.token})`,
@@ -7606,9 +7606,9 @@ function vf({ status: e, size: t }) {
7606
7606
  "aria-hidden": !0,
7607
7607
  "data-motion": "essential",
7608
7608
  className: "ag-running-dot",
7609
- style: _,
7610
- onAnimationStart: k
7611
- }) : /* @__PURE__ */ (0, P.jsx)(n, {
7609
+ style: i,
7610
+ onAnimationStart: n
7611
+ }) : /* @__PURE__ */ (0, P.jsx)(a, {
7612
7612
  status: e,
7613
7613
  size: t,
7614
7614
  "aria-hidden": !0
@@ -7618,10 +7618,10 @@ function yf(e) {
7618
7618
  return e === "needs-you" || e === "failed" ? {
7619
7619
  borderColor: _f(e).color,
7620
7620
  borderWidth: e === "needs-you" ? 1.5 : 1
7621
- } : { borderColor: h };
7621
+ } : { borderColor: g };
7622
7622
  }
7623
7623
  function bf(e) {
7624
- let t = O(e.costUsd ?? void 0), n = p(e.tokens);
7624
+ let t = y(e.costUsd ?? void 0), n = d(e.tokens);
7625
7625
  return [
7626
7626
  e.label,
7627
7627
  e.role,
@@ -7648,31 +7648,28 @@ function Cf({ direction: e, source: t = !0 }) {
7648
7648
  className: Sf
7649
7649
  })] });
7650
7650
  }
7651
- function wf({ agent: e, selected: t, direction: n, now: r, onOpen: i, parentLabel: a, handles: o = !1 }) {
7652
- let s = b(r), c = v(e, s), l = _f(e.status);
7651
+ function wf({ agent: e, selected: t, direction: n, now: r, onOpen: i, parentLabel: a, handles: s = !1 }) {
7652
+ let c = u(r), l = o(e, c), f = _f(e.status);
7653
7653
  return /* @__PURE__ */ (0, P.jsxs)("div", {
7654
7654
  "data-status": e.status,
7655
- "data-activity": c ? "quiet" : void 0,
7655
+ "data-activity": l ? "quiet" : void 0,
7656
7656
  "data-selected": t || void 0,
7657
7657
  title: bf(e),
7658
7658
  className: `ag-agent-card relative flex h-full w-full flex-col gap-0.5 rounded-[var(--radius-card)] border bg-card px-3 py-2 text-left ${j}`,
7659
7659
  style: {
7660
- boxShadow: g,
7660
+ boxShadow: _,
7661
7661
  ...yf(e.status),
7662
- ...t ? w : {}
7662
+ ...t ? E : {}
7663
7663
  },
7664
7664
  children: [
7665
- o && /* @__PURE__ */ (0, P.jsx)(Cf, { direction: n }),
7665
+ s && /* @__PURE__ */ (0, P.jsx)(Cf, { direction: n }),
7666
7666
  /* @__PURE__ */ (0, P.jsxs)("div", {
7667
7667
  className: "flex min-w-0 items-center gap-2",
7668
7668
  children: [
7669
- /* @__PURE__ */ (0, P.jsx)("span", {
7670
- className: "grayscale hover:grayscale-0",
7671
- children: /* @__PURE__ */ (0, P.jsx)(S, {
7672
- agent: e,
7673
- layout: "tree",
7674
- size: 18
7675
- })
7669
+ /* @__PURE__ */ (0, P.jsx)(T, {
7670
+ agent: e,
7671
+ layout: "tree",
7672
+ size: 24
7676
7673
  }),
7677
7674
  /* @__PURE__ */ (0, P.jsxs)("span", {
7678
7675
  className: "min-w-0 flex-1 truncate text-sm font-semibold leading-[18px]",
@@ -7682,34 +7679,49 @@ function wf({ agent: e, selected: t, direction: n, now: r, onOpen: i, parentLabe
7682
7679
  }), e.label]
7683
7680
  }),
7684
7681
  /* @__PURE__ */ (0, P.jsx)("span", {
7685
- className: "text-xs text-muted-foreground tabular-nums",
7682
+ className: "text-[13px] text-muted-foreground tabular-nums",
7686
7683
  title: e.costUsd == null ? "Cost not reported" : "Cost",
7687
- children: O(e.costUsd ?? void 0) ?? "—"
7684
+ children: y(e.costUsd ?? void 0) ?? "—"
7688
7685
  })
7689
7686
  ]
7690
7687
  }),
7691
7688
  /* @__PURE__ */ (0, P.jsx)("p", {
7692
- className: "m-0 line-clamp-2 min-h-4 text-xs text-foreground leading-4",
7693
- children: (e.status === "failed" ? e.result ?? e.turn : e.turn) || "—"
7689
+ "data-agent-identity": "",
7690
+ className: "m-0 truncate text-[13px] leading-[18px] text-muted-foreground",
7691
+ title: [e.harness, e.model].filter(Boolean).join(" · "),
7692
+ children: [e.harness, e.model ? p(e.model) : null].filter(Boolean).join(" · ") || "Identity not recorded"
7693
+ }),
7694
+ e.status === "failed" && /* @__PURE__ */ (0, P.jsx)("p", {
7695
+ className: "m-0 line-clamp-2 text-[13px] leading-4",
7696
+ children: e.result ?? e.turn ?? "Failure cause not recorded"
7694
7697
  }),
7695
7698
  /* @__PURE__ */ (0, P.jsxs)("div", {
7696
- className: "mt-auto flex items-center justify-between gap-1 text-xs",
7697
- style: { color: c ? "var(--surface-warning-text)" : l.color },
7698
- children: [/* @__PURE__ */ (0, P.jsxs)("span", {
7699
- className: "flex items-center gap-1",
7700
- children: [/* @__PURE__ */ (0, P.jsx)(vf, {
7701
- status: e.status,
7702
- size: 16
7703
- }), c?.label ?? l.label]
7704
- }), e.status === "needs-you" && /* @__PURE__ */ (0, P.jsx)("button", {
7705
- type: "button",
7706
- className: "ag-live-respond nodrag nopan",
7707
- disabled: !i,
7708
- onClick: (e) => {
7709
- e.stopPropagation(), i?.();
7710
- },
7711
- children: "Respond"
7712
- })]
7699
+ className: "mt-auto flex items-center justify-between gap-1 text-[13px]",
7700
+ style: { color: l ? "var(--surface-warning-text)" : f.color },
7701
+ children: [
7702
+ /* @__PURE__ */ (0, P.jsxs)("span", {
7703
+ className: "flex items-center gap-1",
7704
+ children: [/* @__PURE__ */ (0, P.jsx)(vf, {
7705
+ status: e.status,
7706
+ size: 16
7707
+ }), l?.label ?? f.label]
7708
+ }),
7709
+ /* @__PURE__ */ (0, P.jsx)("span", {
7710
+ "data-agent-tokens": "",
7711
+ title: e.tokens == null ? "Tokens not recorded" : "Tokens",
7712
+ className: "text-muted-foreground tabular-nums whitespace-nowrap",
7713
+ children: d(e.tokens) ?? "—"
7714
+ }),
7715
+ e.status === "needs-you" && /* @__PURE__ */ (0, P.jsx)("button", {
7716
+ type: "button",
7717
+ className: "ag-live-respond nodrag nopan",
7718
+ disabled: !i,
7719
+ onClick: (e) => {
7720
+ e.stopPropagation(), i?.();
7721
+ },
7722
+ children: "Respond"
7723
+ })
7724
+ ]
7713
7725
  })
7714
7726
  ]
7715
7727
  });
@@ -7723,24 +7735,28 @@ function Tf({ data: e }) {
7723
7735
  function Ef({ data: e }) {
7724
7736
  let { frame: t, direction: n } = e;
7725
7737
  return /* @__PURE__ */ (0, P.jsxs)("div", {
7726
- className: "relative h-full w-full rounded-2xl border",
7738
+ className: "ag-team-frame relative h-full w-full rounded-2xl border",
7727
7739
  style: {
7728
7740
  background: "color-mix(in srgb, hsl(var(--muted-foreground)) 7%, transparent)",
7729
7741
  borderColor: "hsl(var(--foreground) / 0.08)"
7730
7742
  },
7731
7743
  children: [/* @__PURE__ */ (0, P.jsx)(Cf, { direction: n }), /* @__PURE__ */ (0, P.jsxs)("button", {
7732
7744
  type: "button",
7733
- className: "nodrag nopan absolute right-3 top-2 flex h-16 w-8 flex-col items-center justify-center gap-1 rounded text-sm text-muted-foreground hover:bg-muted focus-visible:outline",
7745
+ className: `nodrag nopan absolute top-2 flex h-16 items-center justify-center gap-2 rounded text-sm text-muted-foreground hover:bg-muted focus-visible:outline ${e.groupParents ? "right-3 w-8 flex-col" : "left-3 right-3 justify-start"}`,
7734
7746
  "aria-label": `${t.collapsed ? "Expand" : "Collapse"} ${e.label} team`,
7735
7747
  "aria-expanded": !t.collapsed,
7736
7748
  title: `${e.label} · ${t.group.memberIds.length} agents`,
7737
7749
  onClick: (t) => {
7738
7750
  t.stopPropagation(), e.onToggle();
7739
7751
  },
7740
- children: [/* @__PURE__ */ (0, P.jsx)(gf, {
7741
- size: 16,
7742
- className: t.collapsed ? "-rotate-90" : void 0
7743
- }), /* @__PURE__ */ (0, P.jsx)("span", { children: t.group.memberIds.length })]
7752
+ children: [
7753
+ /* @__PURE__ */ (0, P.jsx)(gf, {
7754
+ size: 16,
7755
+ className: t.collapsed ? "-rotate-90" : void 0
7756
+ }),
7757
+ !e.groupParents && /* @__PURE__ */ (0, P.jsxs)("strong", { children: [e.label, " team"] }),
7758
+ /* @__PURE__ */ (0, P.jsx)("span", { children: t.group.memberIds.length })
7759
+ ]
7744
7760
  })]
7745
7761
  });
7746
7762
  }
@@ -7815,44 +7831,44 @@ var Mf = /* @__PURE__ */ new Set(["succeeded", "stopped"]);
7815
7831
  function Nf(e) {
7816
7832
  return e.length <= 52 ? e : `${e.slice(0, 32)} … ${e.slice(-17)}`;
7817
7833
  }
7818
- function Pf({ agent: e, selected: t, direction: n = "TB", now: i, handles: o = !1, onOpen: s, parentLabel: c, renderEventIcon: l }) {
7819
- let u = b(i), d = (0, M.useRef)(null);
7820
- a(d, e.status);
7821
- let f = Mf.has(e.status), p = e.status === "failed", m = v(e, u), h = _f(e.status), _ = [e.model ? r(e.model) : void 0, e.effort].filter(Boolean).join(" · "), y = (e.events ?? []).slice(-3), x = Number.isFinite(e.costUsd) ? O(e.costUsd) : void 0, C = [
7822
- x,
7823
- !p && e.startedAt != null ? `${A(e.startedAt, u, !1)} elapsed` : void 0,
7834
+ function Pf({ agent: e, selected: t, direction: n = "TB", now: r, handles: i = !1, onOpen: a, parentLabel: s, renderEventIcon: c }) {
7835
+ let d = u(r), f = (0, M.useRef)(null);
7836
+ l(f, e.status);
7837
+ let m = Mf.has(e.status), h = e.status === "failed", g = o(e, d), b = _f(e.status), x = [e.model ? p(e.model) : void 0, e.effort].filter(Boolean).join(" · "), S = (e.events ?? []).slice(-3), C = Number.isFinite(e.costUsd) ? y(e.costUsd) : void 0, w = [
7838
+ C,
7839
+ !h && e.startedAt != null ? `${v(e.startedAt, d, !1)} elapsed` : void 0,
7824
7840
  Number.isFinite(e.commits) ? `${e.commits} ${e.commits === 1 ? "commit" : "commits"}` : void 0
7825
7841
  ].filter(Boolean).join(" · ") || "—";
7826
7842
  return /* @__PURE__ */ (0, P.jsxs)("div", {
7827
7843
  className: "ag-live-slot",
7828
- children: [o && /* @__PURE__ */ (0, P.jsx)(Cf, { direction: n }), /* @__PURE__ */ (0, P.jsxs)("div", {
7829
- ref: d,
7830
- className: `ag-live-card${f ? " ag-live-chip" : ""}`,
7844
+ children: [i && /* @__PURE__ */ (0, P.jsx)(Cf, { direction: n }), /* @__PURE__ */ (0, P.jsxs)("div", {
7845
+ ref: f,
7846
+ className: `ag-live-card${m ? " ag-live-chip" : ""}`,
7831
7847
  "data-status": e.status,
7832
- "data-sparse": y.length === 0 || void 0,
7833
- "data-activity": m ? "quiet" : e.activity ?? void 0,
7848
+ "data-sparse": S.length === 0 || void 0,
7849
+ "data-activity": g ? "quiet" : e.activity ?? void 0,
7834
7850
  "data-selected": t || void 0,
7835
7851
  title: bf(e),
7836
7852
  style: {
7837
- boxShadow: g,
7853
+ boxShadow: _,
7838
7854
  ...yf(e.status),
7839
- ...t ? w : {},
7840
- "--ag-status": h.color
7855
+ ...t ? E : {},
7856
+ "--ag-status": b.color
7841
7857
  },
7842
7858
  children: [
7843
- f && /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [/* @__PURE__ */ (0, P.jsx)(vf, {
7859
+ m && /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [/* @__PURE__ */ (0, P.jsx)(vf, {
7844
7860
  status: e.status,
7845
7861
  size: 16
7846
7862
  }), /* @__PURE__ */ (0, P.jsx)("span", {
7847
7863
  className: "ag-live-chip-status",
7848
- children: h.label
7864
+ children: b.label
7849
7865
  })] }),
7850
7866
  /* @__PURE__ */ (0, P.jsxs)("div", {
7851
7867
  className: "ag-live-head",
7852
7868
  children: [
7853
7869
  /* @__PURE__ */ (0, P.jsx)("span", {
7854
7870
  className: "grayscale hover:grayscale-0",
7855
- children: /* @__PURE__ */ (0, P.jsx)(S, {
7871
+ children: /* @__PURE__ */ (0, P.jsx)(T, {
7856
7872
  agent: e,
7857
7873
  layout: "tree",
7858
7874
  size: 18
@@ -7862,76 +7878,76 @@ function Pf({ agent: e, selected: t, direction: n = "TB", now: i, handles: o = !
7862
7878
  className: "ag-live-names",
7863
7879
  children: [/* @__PURE__ */ (0, P.jsxs)("span", {
7864
7880
  className: "ag-live-name",
7865
- children: [c && /* @__PURE__ */ (0, P.jsxs)("span", {
7881
+ children: [s && /* @__PURE__ */ (0, P.jsxs)("span", {
7866
7882
  className: "ag-parent-label",
7867
- children: [c, " / "]
7883
+ children: [s, " / "]
7868
7884
  }), e.label]
7869
- }), !f && _ && /* @__PURE__ */ (0, P.jsx)("span", {
7885
+ }), !m && x && /* @__PURE__ */ (0, P.jsx)("span", {
7870
7886
  className: "ag-live-meta",
7871
- children: _
7887
+ children: x
7872
7888
  })]
7873
7889
  }),
7874
7890
  /* @__PURE__ */ (0, P.jsxs)("div", {
7875
7891
  className: "ag-live-stats",
7876
- children: [p && s ? /* @__PURE__ */ (0, P.jsxs)("button", {
7892
+ children: [h && a ? /* @__PURE__ */ (0, P.jsxs)("button", {
7877
7893
  type: "button",
7878
7894
  className: "ag-live-pill ag-live-inspect nodrag nopan",
7879
7895
  onClick: (e) => {
7880
- e.stopPropagation(), s();
7896
+ e.stopPropagation(), a();
7881
7897
  },
7882
7898
  children: [
7883
7899
  /* @__PURE__ */ (0, P.jsx)(vf, {
7884
7900
  status: e.status,
7885
7901
  size: 16
7886
7902
  }),
7887
- h.label,
7903
+ b.label,
7888
7904
  /* @__PURE__ */ (0, P.jsx)("span", { children: "Inspect" })
7889
7905
  ]
7890
7906
  }) : /* @__PURE__ */ (0, P.jsxs)("span", {
7891
- className: `ag-live-pill${m ? " ag-live-quiet" : ""}`,
7907
+ className: `ag-live-pill${g ? " ag-live-quiet" : ""}`,
7892
7908
  children: [/* @__PURE__ */ (0, P.jsx)(vf, {
7893
7909
  status: e.status,
7894
7910
  size: 16
7895
- }), m?.label ?? h.label]
7896
- }), !f && /* @__PURE__ */ (0, P.jsx)("span", {
7911
+ }), g?.label ?? b.label]
7912
+ }), !m && /* @__PURE__ */ (0, P.jsx)("span", {
7897
7913
  className: "ag-live-accounting",
7898
- title: C,
7899
- children: C
7914
+ title: w,
7915
+ children: w
7900
7916
  })]
7901
7917
  })
7902
7918
  ]
7903
7919
  }),
7904
- f ? /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [/* @__PURE__ */ (0, P.jsx)("span", {
7920
+ m ? /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [/* @__PURE__ */ (0, P.jsx)("span", {
7905
7921
  className: "ag-live-chip-result",
7906
- children: e.result ?? e.turn ?? h.label
7907
- }), x && /* @__PURE__ */ (0, P.jsx)("span", {
7922
+ children: e.result ?? e.turn ?? b.label
7923
+ }), C && /* @__PURE__ */ (0, P.jsx)("span", {
7908
7924
  className: "ag-live-chip-cost",
7909
7925
  title: "Cost",
7910
- children: x
7926
+ children: C
7911
7927
  })] }) : /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [/* @__PURE__ */ (0, P.jsxs)("div", {
7912
7928
  className: "ag-live-thinking-row",
7913
7929
  children: [/* @__PURE__ */ (0, P.jsx)("p", {
7914
- className: `ag-live-thinking${p ? " ag-live-failure" : ""}`,
7915
- children: p ? e.result ?? y.at(-1)?.label ?? e.turn ?? h.label : e.turn || "—"
7930
+ className: `ag-live-thinking${h ? " ag-live-failure" : ""}`,
7931
+ children: h ? e.result ?? S.at(-1)?.label ?? e.turn ?? b.label : e.turn || "—"
7916
7932
  }), e.status === "needs-you" && /* @__PURE__ */ (0, P.jsx)("button", {
7917
7933
  type: "button",
7918
7934
  className: "ag-live-respond nodrag nopan",
7919
- disabled: !s,
7920
- title: s ? void 0 : "Responses unavailable in this view",
7935
+ disabled: !a,
7936
+ title: a ? void 0 : "Responses unavailable in this view",
7921
7937
  onClick: (e) => {
7922
- e.stopPropagation(), s?.();
7938
+ e.stopPropagation(), a?.();
7923
7939
  },
7924
7940
  children: "Respond"
7925
7941
  })]
7926
- }), y.length > 0 && /* @__PURE__ */ (0, P.jsx)("div", {
7942
+ }), S.length > 0 && /* @__PURE__ */ (0, P.jsx)("div", {
7927
7943
  className: "ag-live-events-clip",
7928
7944
  children: /* @__PURE__ */ (0, P.jsx)("ol", {
7929
7945
  className: "ag-live-events",
7930
7946
  "aria-label": "Latest events",
7931
- children: y.map((e) => /* @__PURE__ */ (0, P.jsxs)("li", {
7947
+ children: S.map((e) => /* @__PURE__ */ (0, P.jsxs)("li", {
7932
7948
  title: e.label,
7933
7949
  children: [
7934
- l?.(e) ?? /* @__PURE__ */ (0, P.jsx)(T, {
7950
+ c?.(e) ?? /* @__PURE__ */ (0, P.jsx)(D, {
7935
7951
  size: 12,
7936
7952
  strokeWidth: 1.75,
7937
7953
  "aria-hidden": !0
@@ -7943,7 +7959,7 @@ function Pf({ agent: e, selected: t, direction: n = "TB", now: i, handles: o = !
7943
7959
  /* @__PURE__ */ (0, P.jsxs)("time", {
7944
7960
  className: "ag-live-event-at",
7945
7961
  dateTime: Number.isFinite(e.at) ? new Date(e.at).toISOString() : void 0,
7946
- children: [p && e.at != null ? "at " : "", A(e.at, u, p)]
7962
+ children: [h && e.at != null ? "at " : "", v(e.at, d, h)]
7947
7963
  })
7948
7964
  ]
7949
7965
  }, e.id))
@@ -7988,23 +8004,23 @@ function Vf(e, t, n) {
7988
8004
  zoom: l
7989
8005
  });
7990
8006
  }
7991
- function Hf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: a = "TB", className: o, emptyState: c, live: f = !1, renderEventIcon: p, showLatestEvents: h = !0, now: g }) {
7992
- let _ = f ? y : D, S = b(g), C = s(), w = (0, M.useId)(), T = (0, M.useRef)(void 0), E = (0, M.useRef)(null), O = (0, M.useRef)(!1), k = () => clearTimeout(T.current), A = () => {
7993
- k(), F(null);
8007
+ function Hf({ nodes: e, edges: t, selectedId: n, onSelect: i, direction: a = "TB", className: s, emptyState: l, live: d = !1, renderEventIcon: p, showLatestEvents: h = !0, now: g }) {
8008
+ let _ = d ? b : k, v = u(g), y = c(), x = (0, M.useId)(), C = (0, M.useRef)(void 0), T = (0, M.useRef)(null), E = (0, M.useRef)(!1), D = () => clearTimeout(C.current), O = () => {
8009
+ D(), F(null);
7994
8010
  }, j = () => {
7995
- k(), T.current = setTimeout(() => F(null), l("--duration-fast", B.current));
8011
+ D(), C.current = setTimeout(() => F(null), r("--duration-fast", B.current));
7996
8012
  };
7997
- (0, M.useEffect)(() => () => clearTimeout(T.current), []);
7998
- let [N, F] = (0, M.useState)(null), [I, L] = (0, M.useState)(/* @__PURE__ */ new Set()), [R, z] = (0, M.useState)(0), B = (0, M.useRef)(null), [V, H] = Bf(), U = i(B, e.length > 0), W = V !== null && V.width < 600, G = m(e, t), ee = (0, M.useRef)(G);
8013
+ (0, M.useEffect)(() => () => clearTimeout(C.current), []);
8014
+ let [N, F] = (0, M.useState)(null), [I, L] = (0, M.useState)(/* @__PURE__ */ new Set()), [R, z] = (0, M.useState)(0), B = (0, M.useRef)(null), [V, H] = Bf(), U = A(B, e.length > 0), W = V !== null && V.width < 600, G = m(e, t), ee = (0, M.useRef)(G);
7999
8015
  ee.current.key !== G.key && (ee.current = G);
8000
- let K = ee.current, te = `${a}:${f}:${K.key}`, ne = (0, M.useRef)(null);
8016
+ let K = ee.current, te = `${a}:${d}:${K.key}`, ne = (0, M.useRef)(null);
8001
8017
  V && !W && ne.current?.key !== te && (ne.current = {
8002
8018
  key: te,
8003
- columns: Math.max(1, Math.min(6, Math.floor((V.width - 32) / (_.width + 10))))
8019
+ columns: Math.max(1, Math.min(6, Math.floor((V.width - 32 - (!d && a === "LR" ? _.width + 70 : 0)) / (_.width + 10))))
8004
8020
  });
8005
8021
  let re = ne.current?.columns ?? 1, ie = JSON.stringify([
8006
8022
  a,
8007
- f,
8023
+ d,
8008
8024
  K.key,
8009
8025
  re,
8010
8026
  [...I]
@@ -8012,7 +8028,7 @@ function Hf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: a = "TB
8012
8028
  (0, M.useEffect)(() => {
8013
8029
  if (W) return;
8014
8030
  let e = !0;
8015
- return x(K, a, re, _, I).then((t) => {
8031
+ return S(K, a, re, _, I, d).then((t) => {
8016
8032
  e && oe({
8017
8033
  key: ie,
8018
8034
  layout: t
@@ -8049,9 +8065,10 @@ function Hf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: a = "TB
8049
8065
  data: {
8050
8066
  frame: e,
8051
8067
  direction: a,
8068
+ groupParents: d,
8052
8069
  label: J.get(e.group.parentId)?.label ?? "Agent",
8053
8070
  onToggle: () => {
8054
- !e.collapsed && n && e.group.memberIds.includes(n) && r?.(e.group.parentId), L((t) => {
8071
+ !e.collapsed && n && e.group.memberIds.includes(n) && i?.(e.group.parentId), L((t) => {
8055
8072
  let n = new Set(t);
8056
8073
  return n.has(e.group.id) ? n.delete(e.group.id) : n.add(e.group.id), n;
8057
8074
  });
@@ -8059,30 +8076,30 @@ function Hf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: a = "TB
8059
8076
  }
8060
8077
  })), t = [];
8061
8078
  for (let e of K.agentIds) {
8062
- let i = J.get(e), o = q.positions.get(e);
8063
- if (!i || !o) continue;
8064
- let s = n === e, c = q.frames.find((t) => t.group.parentId === e), l = c ? c.width - 64 : _.width, u = c ? 64 : _.height, d = se.current?.getInternalNode(e)?.measured;
8079
+ let r = J.get(e), o = q.positions.get(e);
8080
+ if (!r || !o) continue;
8081
+ let s = n === e, c = d && q.frames.find((t) => t.group.parentId === e), l = c ? c.width - 64 : _.width, u = c ? 64 : _.height, f = se.current?.getInternalNode(e)?.measured;
8065
8082
  t.push({
8066
8083
  id: e,
8067
- type: f ? "liveAgent" : "agent",
8084
+ type: d ? "liveAgent" : "agent",
8068
8085
  position: o,
8069
8086
  width: l,
8070
8087
  height: u,
8071
- measured: d?.width === l && d.height === u ? d : void 0,
8088
+ measured: f?.width === l && f.height === u ? f : void 0,
8072
8089
  className: `${xf}${c ? " ag-frame-owner" : ""}`,
8073
8090
  draggable: !1,
8074
8091
  ariaRole: "button",
8075
- ariaLabel: bf(i),
8092
+ ariaLabel: bf(r),
8076
8093
  domAttributes: {
8077
8094
  "aria-pressed": s,
8078
- "aria-describedby": N?.id === e ? w : void 0
8095
+ "aria-describedby": N?.id === e ? x : void 0
8079
8096
  },
8080
8097
  data: {
8081
- agent: i,
8098
+ agent: r,
8082
8099
  selected: s,
8083
8100
  direction: a,
8084
- now: S,
8085
- onOpen: r ? () => r(i.id) : void 0,
8101
+ now: v,
8102
+ onOpen: i ? () => i(r.id) : void 0,
8086
8103
  renderEventIcon: p
8087
8104
  }
8088
8105
  });
@@ -8094,17 +8111,17 @@ function Hf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: a = "TB
8094
8111
  J,
8095
8112
  n,
8096
8113
  a,
8097
- f,
8114
+ d,
8098
8115
  _,
8099
- S,
8100
- r,
8116
+ v,
8117
+ i,
8101
8118
  p,
8102
8119
  N
8103
8120
  ]), le = (0, M.useMemo)(() => {
8104
8121
  if (!q) return [];
8105
8122
  let e = [], r = /* @__PURE__ */ new Set();
8106
8123
  for (let t of K.spawns) {
8107
- let n = K.groups.find((e) => e.parentId === t.from)?.id ?? t.from, i = K.groupOf.get(t.to) ?? t.to;
8124
+ let n = d && K.groups.find((e) => e.parentId === t.from)?.id || t.from, i = K.groupOf.get(t.to) ?? t.to;
8108
8125
  if (n === i) continue;
8109
8126
  let a = `spawn:${n}:${i}`;
8110
8127
  r.has(a) || (r.add(a), e.push({
@@ -8116,7 +8133,7 @@ function Hf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: a = "TB
8116
8133
  selectable: !1,
8117
8134
  focusable: !1,
8118
8135
  style: {
8119
- stroke: u(void 0),
8136
+ stroke: w(void 0),
8120
8137
  strokeWidth: 1.5
8121
8138
  }
8122
8139
  }));
@@ -8161,39 +8178,39 @@ function Hf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: a = "TB
8161
8178
  (0, M.useEffect)(() => {
8162
8179
  W && (se.current = null, de(!1), pe(!1), he.current = null);
8163
8180
  }, [W]);
8164
- let ge = q ? `${ie}:${q.columns}` : null, _e = `${a}:${K.key}`, ve = q && V ? Math.max(.02, Math.min(.2, (V.width - 32) / q.width, (V.height - 32) / q.height)) : .2;
8181
+ let ge = q ? `${ie}:${q.columns}` : null, _e = `${a}:${K.key}`, ve = d ? q && V ? Math.max(.02, Math.min(.2, (V.width - 32) / q.width, (V.height - 32) / q.height)) : .2 : 1;
8165
8182
  (0, M.useEffect)(() => {
8166
8183
  let e = se.current;
8167
8184
  if (!ue || !e || !ge || !V) return;
8168
8185
  let t = he.current !== _e, n = !t;
8169
8186
  if (n && !me.current) return;
8170
- let r = he.current !== null && t && C;
8187
+ let i = he.current !== null && t && y;
8171
8188
  he.current = _e;
8172
- let i = requestAnimationFrame(() => {
8189
+ let a = requestAnimationFrame(() => {
8173
8190
  if (n) Vf(e, B.current, me.current);
8174
8191
  else {
8175
- let t = me.current ?? K.agentIds[0], n = q?.positions.get(t), i = e.getInternalNode(t)?.width ?? _.width, a = q.width + 32 <= V.width ? (V.width - q.width) / 2 : n ? Math.max(Rf - n.x, V.width / 2 - n.x - i / 2) : Rf, o = q.height + 32 <= V.height ? Rf : Rf - (n?.y ?? 0);
8192
+ let t = me.current ?? K.agentIds[0], n = q?.positions.get(t), a = e.getInternalNode(t)?.width ?? _.width, o = q.width + 32 <= V.width ? (V.width - q.width) / 2 : n ? Math.max(Rf - n.x, V.width / 2 - n.x - a / 2) : Rf, s = q.height + 32 <= V.height ? Rf : Rf - (n?.y ?? 0);
8176
8193
  e.setViewport({
8177
- x: a,
8178
- y: o,
8194
+ x: o,
8195
+ y: s,
8179
8196
  zoom: 1
8180
- }, { duration: r ? l("--duration-base", B.current) : 0 });
8197
+ }, { duration: i ? r("--duration-base", B.current) : 0 });
8181
8198
  }
8182
8199
  pe(!0);
8183
8200
  });
8184
- return () => cancelAnimationFrame(i);
8201
+ return () => cancelAnimationFrame(a);
8185
8202
  }, [
8186
8203
  ue,
8187
8204
  ge,
8188
8205
  _e,
8189
8206
  V,
8190
8207
  ve,
8191
- C,
8208
+ y,
8192
8209
  n
8193
8210
  ]);
8194
8211
  let Y = (0, M.useCallback)((e) => {
8195
- J.has(e) && (r?.(e), B.current?.querySelector(`[data-agent-id="${CSS.escape(e)}"]`)?.scrollIntoView({ block: "nearest" }));
8196
- }, [J, r]), ye = (0, M.useCallback)((e, t) => Y(t.id), [Y]), be = (0, M.useCallback)((e) => {
8212
+ J.has(e) && (i?.(e), B.current?.querySelector(`[data-agent-id="${CSS.escape(e)}"]`)?.scrollIntoView({ block: "nearest" }));
8213
+ }, [J, i]), ye = (0, M.useCallback)((e, t) => Y(t.id), [Y]), be = (0, M.useCallback)((e) => {
8197
8214
  if (!(e.target instanceof HTMLElement)) return;
8198
8215
  let t = e.target.closest(".react-flow__node")?.getAttribute("data-id");
8199
8216
  if (!t || !J.has(t)) return;
@@ -8224,8 +8241,8 @@ function Hf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: a = "TB
8224
8241
  q,
8225
8242
  K,
8226
8243
  _,
8227
- C
8228
- ]), xe = (e) => e.status === "needs-you" ? 0 : e.status === "failed" ? 1 : v(e, S) ? 2 : e.status === "waiting" ? 3 : e.status === "running" ? 4 : 5, Se = new Map(t.filter((e) => e.kind === "spawn").map((e) => [e.to, e.from])), Ce = (e) => {
8244
+ y
8245
+ ]), xe = (e) => e.status === "needs-you" ? 0 : e.status === "failed" ? 1 : o(e, v) ? 2 : e.status === "waiting" ? 3 : e.status === "running" ? 4 : 5, Se = new Map(t.filter((e) => e.kind === "spawn").map((e) => [e.to, e.from])), Ce = (e) => {
8229
8246
  let t = /* @__PURE__ */ new Set([e]), n = 0;
8230
8247
  for (; Se.has(e) && !t.has(Se.get(e));) e = Se.get(e), t.add(e), n++;
8231
8248
  return n;
@@ -8249,7 +8266,7 @@ function Hf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: a = "TB
8249
8266
  "failed",
8250
8267
  "quiet"
8251
8268
  ].map((t) => {
8252
- let r = e.filter((e) => t === "quiet" ? v(e, S) : e.status === t);
8269
+ let r = e.filter((e) => t === "quiet" ? o(e, v) : e.status === t);
8253
8270
  return {
8254
8271
  status: t,
8255
8272
  matches: r,
@@ -8266,12 +8283,12 @@ function Hf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: a = "TB
8266
8283
  className: "ag-status-button rounded-full border border-border px-2 py-1",
8267
8284
  style: { color: e.status === "quiet" ? "var(--surface-warning-text)" : _f(e.status).color },
8268
8285
  onClick: () => {
8269
- let t = e.matches.findIndex((e) => e.id === n), r = e.matches[(t + 1) % e.matches.length];
8270
- Y(r.id);
8271
- let i = q?.positions.get(r.id), a = se.current?.getInternalNode(r.id)?.measured;
8272
- i && se.current?.setCenter(i.x + (a?.width ?? _.width) / 2, i.y + (a?.height ?? _.height) / 2, {
8286
+ let t = e.matches.findIndex((e) => e.id === n), i = e.matches[(t + 1) % e.matches.length];
8287
+ Y(i.id);
8288
+ let a = q?.positions.get(i.id), o = se.current?.getInternalNode(i.id)?.measured;
8289
+ a && se.current?.setCenter(a.x + (o?.width ?? _.width) / 2, a.y + (o?.height ?? _.height) / 2, {
8273
8290
  zoom: 1,
8274
- duration: C ? l("--duration-base", B.current) : 0
8291
+ duration: y ? r("--duration-base", B.current) : 0
8275
8292
  });
8276
8293
  },
8277
8294
  children: [/* @__PURE__ */ (0, P.jsxs)("span", {
@@ -8291,42 +8308,42 @@ function Hf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: a = "TB
8291
8308
  }, e.status))]
8292
8309
  });
8293
8310
  return e.length === 0 ? /* @__PURE__ */ (0, P.jsx)("div", {
8294
- className: `agent-graph flex items-center justify-center rounded-lg border border-border border-dashed p-4 text-center text-muted-foreground text-xs ${o ?? ""}`,
8295
- children: c ?? "No agents yet"
8311
+ className: `agent-graph flex items-center justify-center rounded-lg border border-border border-dashed p-4 text-center text-muted-foreground text-xs ${s ?? ""}`,
8312
+ children: l ?? "No agents yet"
8296
8313
  }) : /* @__PURE__ */ (0, P.jsxs)("div", {
8297
8314
  ref: (e) => {
8298
8315
  B.current = e, H(e);
8299
8316
  },
8300
- className: `agent-graph ag-live relative flex flex-col ${o ?? ""}`,
8317
+ className: `agent-graph ag-live${d ? "" : " ag-topology"} relative flex flex-col ${s ?? ""}`,
8301
8318
  tabIndex: -1,
8302
8319
  onKeyDownCapture: (e) => {
8303
- e.target instanceof HTMLElement && e.target.closest("[data-agent-metrics]") || (e.key === "Tab" && !e.shiftKey && N ? (e.preventDefault(), document.getElementById(w)?.focus()) : (e.key === "Escape" && A(), be(e)));
8320
+ e.target instanceof HTMLElement && e.target.closest("[data-agent-metrics]") || (e.key === "Tab" && !e.shiftKey && N ? (e.preventDefault(), document.getElementById(x)?.focus()) : (e.key === "Escape" && O(), be(e)));
8304
8321
  },
8305
8322
  onFocusCapture: (e) => {
8306
- if (!(e.target instanceof HTMLElement) || O.current || (k(), e.target.closest("[data-agent-metrics]"))) return;
8323
+ if (!(e.target instanceof HTMLElement) || E.current || (D(), e.target.closest("[data-agent-metrics]"))) return;
8307
8324
  if (!e.target.matches(":focus-visible")) {
8308
- A();
8325
+ O();
8309
8326
  return;
8310
8327
  }
8311
8328
  let t = e.target.closest(".react-flow__node, [data-agent-id]"), n = t?.dataset.id ?? t?.dataset.agentId;
8312
- E.current = t ?? null, F(n && J.has(n) ? {
8329
+ T.current = t ?? null, F(n && J.has(n) ? {
8313
8330
  id: n,
8314
8331
  rect: t.getBoundingClientRect()
8315
8332
  } : null);
8316
8333
  },
8317
8334
  onBlurCapture: (e) => {
8318
- !e.currentTarget.contains(e.relatedTarget) && e.relatedTarget?.id !== w && A();
8335
+ !e.currentTarget.contains(e.relatedTarget) && e.relatedTarget?.id !== x && O();
8319
8336
  },
8320
8337
  "data-layout": W ? "list" : q && fe ? "ready" : "pending",
8321
8338
  "data-columns": q?.columns,
8322
8339
  children: [
8323
8340
  ke,
8324
- h && f && /* @__PURE__ */ (0, P.jsx)(d, {
8341
+ h && d && /* @__PURE__ */ (0, P.jsx)(f, {
8325
8342
  agents: e,
8326
8343
  now: g,
8327
- live: f,
8344
+ live: d,
8328
8345
  selectedId: n,
8329
- onSelect: r ? Y : void 0
8346
+ onSelect: i ? Y : void 0
8330
8347
  }),
8331
8348
  W ? /* @__PURE__ */ (0, P.jsxs)("ul", {
8332
8349
  className: "ag-graph-viewport ag-phone-list overflow-auto",
@@ -8344,20 +8361,20 @@ function Hf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: a = "TB
8344
8361
  onKeyDown: (t) => {
8345
8362
  (t.key === "Enter" || t.key === " ") && t.target === t.currentTarget && (t.preventDefault(), Y(e.id));
8346
8363
  },
8347
- children: f || e.status === "succeeded" || e.status === "stopped" ? /* @__PURE__ */ (0, P.jsx)(Pf, {
8364
+ children: d ? /* @__PURE__ */ (0, P.jsx)(Pf, {
8348
8365
  agent: e,
8349
8366
  parentLabel: J.get(Se.get(e.id) ?? "")?.label,
8350
8367
  selected: n === e.id,
8351
- now: S,
8368
+ now: v,
8352
8369
  renderEventIcon: p,
8353
- onOpen: r ? () => Y(e.id) : void 0
8370
+ onOpen: i ? () => Y(e.id) : void 0
8354
8371
  }) : /* @__PURE__ */ (0, P.jsx)(wf, {
8355
8372
  agent: e,
8356
8373
  parentLabel: J.get(Se.get(e.id) ?? "")?.label,
8357
8374
  selected: n === e.id,
8358
- now: S,
8375
+ now: v,
8359
8376
  direction: a,
8360
- onOpen: r ? () => Y(e.id) : void 0
8377
+ onOpen: i ? () => Y(e.id) : void 0
8361
8378
  })
8362
8379
  })
8363
8380
  }, e.id)), e.length > zf && /* @__PURE__ */ (0, P.jsxs)("li", {
@@ -8405,9 +8422,9 @@ function Hf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: a = "TB
8405
8422
  },
8406
8423
  onNodeClick: ye,
8407
8424
  onNodeMouseEnter: (e, t) => {
8408
- k(), E.current = e.target.closest(".react-flow__node"), E.current && F({
8425
+ D(), T.current = e.target.closest(".react-flow__node"), T.current && F({
8409
8426
  id: t.id,
8410
- rect: E.current.getBoundingClientRect()
8427
+ rect: T.current.getBoundingClientRect()
8411
8428
  });
8412
8429
  },
8413
8430
  onNodeMouseLeave: j,
@@ -8450,7 +8467,9 @@ function Hf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: a = "TB
8450
8467
  position: "bottom-right",
8451
8468
  fitViewOptions: {
8452
8469
  padding: `${Rf}px`,
8453
- maxZoom: 1
8470
+ minZoom: ve,
8471
+ maxZoom: 1,
8472
+ nodes: d ? void 0 : K.agentIds.slice(0, 2).map((e) => ({ id: e }))
8454
8473
  }
8455
8474
  })
8456
8475
  ]
@@ -8459,13 +8478,13 @@ function Hf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: a = "TB
8459
8478
  N && J.has(N.id) && /* @__PURE__ */ (0, P.jsx)(Uf, {
8460
8479
  anchor: B.current,
8461
8480
  mode: U,
8462
- id: w,
8481
+ id: x,
8463
8482
  agent: J.get(N.id),
8464
8483
  rect: N.rect,
8465
- onEnter: k,
8484
+ onEnter: D,
8466
8485
  onLeave: j,
8467
8486
  onClose: () => {
8468
- A(), O.current = !0, E.current?.focus({ preventScroll: !0 }), O.current = !1;
8487
+ O(), E.current = !0, T.current?.focus({ preventScroll: !0 }), E.current = !1;
8469
8488
  }
8470
8489
  })
8471
8490
  ]
@@ -8495,14 +8514,14 @@ function Uf({ anchor: e, mode: t, id: n, agent: r, rect: i, onEnter: a, onLeave:
8495
8514
  let u = new Map([
8496
8515
  {
8497
8516
  label: "Tokens",
8498
- value: p(r.tokens) ?? "Not recorded"
8517
+ value: d(r.tokens) ?? "Not recorded"
8499
8518
  },
8500
8519
  {
8501
8520
  label: "Cost",
8502
- value: O(r.costUsd ?? void 0) ?? "Not recorded"
8521
+ value: y(r.costUsd ?? void 0) ?? "Not recorded"
8503
8522
  },
8504
8523
  ...r.facts ?? []
8505
- ].map((e) => [e.label.toLowerCase(), e])), d = Math.min(420, window.innerWidth - 24), f = Math.min(560, window.innerHeight - 24), m = Math.max(12, Math.min(i.right + 12 + d <= window.innerWidth ? i.right + 12 : i.left - d - 12, window.innerWidth - d - 12));
8524
+ ].map((e) => [e.label.toLowerCase(), e])), f = Math.min(420, window.innerWidth - 24), p = Math.min(560, window.innerHeight - 24), m = Math.max(12, Math.min(i.right + 12 + f <= window.innerWidth ? i.right + 12 : i.left - f - 12, window.innerWidth - f - 12));
8506
8525
  return (0, N.createPortal)(/* @__PURE__ */ (0, P.jsxs)("div", {
8507
8526
  id: n,
8508
8527
  "data-agent-metrics": !0,
@@ -8522,11 +8541,11 @@ function Uf({ anchor: e, mode: t, id: n, agent: r, rect: i, onEnter: a, onLeave:
8522
8541
  colorScheme: t,
8523
8542
  position: "fixed",
8524
8543
  zIndex: 1e3,
8525
- width: d,
8526
- maxHeight: f,
8544
+ width: f,
8545
+ maxHeight: p,
8527
8546
  overflow: "auto",
8528
8547
  left: m,
8529
- top: Math.max(12, Math.min(i.top, window.innerHeight - f - 12))
8548
+ top: Math.max(12, Math.min(i.top, window.innerHeight - p - 12))
8530
8549
  },
8531
8550
  children: [
8532
8551
  /* @__PURE__ */ (0, P.jsxs)("div", {