@tangle-network/sandbox-ui 3.0.1 → 3.0.3

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 (28) hide show
  1. package/dist/AgentTree-D4d06rfH.js +293 -0
  2. package/dist/{ResearchReport-CSNpZ-pj.js → ResearchReport-D1TFmldm.js} +2 -1
  3. package/dist/{VirtualList-DLh2JE0F.js → VirtualList-DcSGbEtA.js} +122 -67
  4. package/dist/{index-gXcuwPOX.d.ts → index-Bv2iiZaN.d.ts} +135 -2
  5. package/dist/{index-YU_b9xCK.d.ts → index-CHA38az4.d.ts} +3 -61
  6. package/dist/index.d.ts +3 -3
  7. package/dist/index.js +9 -8
  8. package/dist/record/ResearchReport.js +1 -1
  9. package/dist/{record-Ct_MZeZC.js → record-C-EUpK-n.js} +3 -2
  10. package/dist/record.js +1 -1
  11. package/dist/report-viewer.js +96 -96
  12. package/dist/run/live.js +2 -2
  13. package/dist/run/record.d.ts +2 -2
  14. package/dist/run/record.js +5 -4
  15. package/dist/run.d.ts +3 -3
  16. package/dist/run.js +6 -5
  17. package/dist/runtime-viewer/{AgentGraphCanvas-DGq7_u8--WPFPgd72.js → AgentGraphCanvas-DGq7_u8--C6yDfIUT.js} +67 -67
  18. package/dist/runtime-viewer/{latest-events-CRq9sGkK-YFXUh9qO.js → latest-events-CRq9sGkK-CfoBl1dP.js} +215 -209
  19. package/dist/{trace-workspace-BiJbv9WQ.js → trace-workspace-B634-EcA.js} +287 -201
  20. package/dist/{tree-data-B_IXAIgg.js → tree-data-rg5voiY8.js} +1 -1
  21. package/dist/{AgentTree-CJRVpgPq.js → use-follow-tail-DZFn7QDO.js} +144 -385
  22. package/dist/vault-tree.js +1 -1
  23. package/dist/{workspace-CAdAoNmW.js → workspace-CJD7oOEa.js} +1 -1
  24. package/dist/{workspace-files-pane-C0PeY6rY.js → workspace-files-pane-D24G7H_Z.js} +1 -1
  25. package/dist/workspace-viewer.js +9265 -8896
  26. package/dist/workspace.js +2 -2
  27. package/package.json +5 -4
  28. package/dist/use-follow-tail-Ht7fZGQQ.js +0 -1
package/dist/run/live.js CHANGED
@@ -1,7 +1,7 @@
1
- import { t as WorkspaceFilesPane } from "../workspace-files-pane-C0PeY6rY.js";
1
+ import { t as WorkspaceFilesPane } from "../workspace-files-pane-D24G7H_Z.js";
2
2
  import { t as DiffView } from "../diff-view-B9mNeTLF.js";
3
3
  import { t as CodeView } from "../code-view-BlhCS1SD.js";
4
- import { a as useEventStream, t as TraceWorkspace } from "../trace-workspace-BiJbv9WQ.js";
4
+ import { a as useEventStream, t as TraceWorkspace } from "../trace-workspace-B634-EcA.js";
5
5
  import { useDocument } from "../hooks/use-document.js";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
7
  import { useEffect, useMemo, useRef, useState } from "react";
@@ -1,2 +1,2 @@
1
- import { a as ConversationProps, c as ToolCall, d as recordFlowTrace, f as ConversationEvent, i as Conversation, l as indexRecord, m as ConversationRecord, n as VirtualList, o as EventFlag, p as ConversationNode, r as withPrompts, s as RecordIndex, t as AgentTree, u as model_d_exports } from "../index-gXcuwPOX.js";
2
- export { AgentTree, Conversation, type ConversationEvent, type ConversationNode, type ConversationProps, type ConversationRecord, type EventFlag, type RecordIndex, type ToolCall, VirtualList, indexRecord, recordFlowTrace, model_d_exports as recordModel, withPrompts };
1
+ import { _ as ConversationRecord, a as VirtualList, c as ConversationProps, d as ToolCall, f as indexRecord, g as ConversationNode, h as ConversationEvent, i as AgentTree, l as EventFlag, m as recordFlowTrace, n as ToolStep, o as withPrompts, p as model_d_exports, r as timelineItems, s as Conversation, t as PromptMore, u as RecordIndex } from "../index-Bv2iiZaN.js";
2
+ export { AgentTree, Conversation, type ConversationEvent, type ConversationNode, type ConversationProps, type ConversationRecord, type EventFlag, PromptMore, type RecordIndex, type ToolCall, ToolStep, VirtualList, indexRecord, recordFlowTrace, model_d_exports as recordModel, timelineItems, withPrompts };
@@ -1,4 +1,5 @@
1
- import { t as VirtualList } from "../VirtualList-DLh2JE0F.js";
2
- import { d as recordFlowTrace, l as model_exports, n as Conversation, o as indexRecord, t as AgentTree } from "../AgentTree-CJRVpgPq.js";
3
- import { t as withPrompts } from "../record-Ct_MZeZC.js";
4
- export { AgentTree, Conversation, VirtualList, indexRecord, recordFlowTrace, model_exports as recordModel, withPrompts };
1
+ import { t as VirtualList } from "../VirtualList-DcSGbEtA.js";
2
+ import { S as model_exports, i as ToolStep, r as PromptMore, s as timelineItems, w as recordFlowTrace, y as indexRecord } from "../use-follow-tail-DZFn7QDO.js";
3
+ import { n as Conversation, t as AgentTree } from "../AgentTree-D4d06rfH.js";
4
+ import { t as withPrompts } from "../record-C-EUpK-n.js";
5
+ export { AgentTree, Conversation, PromptMore, ToolStep, VirtualList, indexRecord, recordFlowTrace, model_exports as recordModel, timelineItems, withPrompts };
package/dist/run.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as TraceWaterfallProps, A as ToolCallData, B as taskProgress, C as RunStatusIcon, D as TaskListItem, E as TaskList, F as isOpen, G as TraceWorkspace, H as LatestEvents, I as parseToolEvent, J as AgentStreamState, K as TraceWorkspaceProps, L as runStatus, M as ToolCallFeedProps, N as ToolCallStatus, O as TaskListProps, P as ToolCallType, Q as TraceWaterfall, R as showsTaskPriority, S as RunStatus, T as StatusMeta, U as LatestEventsProps, V as taskStatus, W as TraceEvent, X as foldAgentRows, Y as AgentTranscriptEntry, Z as useAgentStream, _ as RunPhaseList, a as ApprovalPlanStep, b as RunRowStatus, c as FeedSegment, d as InlineToolItem, et as traceSpanMark, f as InlineToolItemProps, g as RunPhase, h as RunGroupProps, i as ApprovalDiffSummary, j as ToolCallFeed, k as TaskStatus, l as InlineThinkingItem, m as RunGroup, n as ApprovalCardProps, o as ExpandedToolDetail, p as LiveDuration, q as AgentStreamRow, r as ApprovalDiffFile, s as ExpandedToolDetailProps, t as ApprovalCard, u as InlineThinkingItemProps, v as RunRowShell, w as RunStatusIconProps, x as RunRowStatusDot, y as RunRowShellProps, z as statusMeta } from "./index-YU_b9xCK.js";
1
+ import { A as ToolCallData, B as taskProgress, C as RunStatusIcon, D as TaskListItem, E as TaskList, F as isOpen, G as TraceWorkspace, H as LatestEvents, I as parseToolEvent, J as TraceWaterfallProps, K as TraceWorkspaceProps, L as runStatus, M as ToolCallFeedProps, N as ToolCallStatus, O as TaskListProps, P as ToolCallType, R as showsTaskPriority, S as RunStatus, T as StatusMeta, U as LatestEventsProps, V as taskStatus, W as TraceEvent, Y as traceSpanMark, _ as RunPhaseList, a as ApprovalPlanStep, b as RunRowStatus, c as FeedSegment, d as InlineToolItem, f as InlineToolItemProps, g as RunPhase, h as RunGroupProps, i as ApprovalDiffSummary, j as ToolCallFeed, k as TaskStatus, l as InlineThinkingItem, m as RunGroup, n as ApprovalCardProps, o as ExpandedToolDetail, p as LiveDuration, q as TraceWaterfall, r as ApprovalDiffFile, s as ExpandedToolDetailProps, t as ApprovalCard, u as InlineThinkingItemProps, v as RunRowShell, w as RunStatusIconProps, x as RunRowStatusDot, y as RunRowShellProps, z as statusMeta } from "./index-CHA38az4.js";
2
2
  import { i as useEventStream, n as AgentStreamSource, r as EventStreamHandlers, t as AgentStreamOpener } from "./event-stream-DNEbvx4s.js";
3
- import { a as ConversationProps, c as ToolCall, d as recordFlowTrace, f as ConversationEvent, i as Conversation, l as indexRecord, m as ConversationRecord, n as VirtualList, o as EventFlag, p as ConversationNode, r as withPrompts, s as RecordIndex, t as AgentTree, u as model_d_exports } from "./index-gXcuwPOX.js";
4
- export { type AgentStreamOpener, type AgentStreamRow, type AgentStreamSource, type AgentStreamState, type AgentTranscriptEntry, AgentTree, ApprovalCard, type ApprovalCardProps, type ApprovalDiffFile, ApprovalDiffSummary, type ApprovalPlanStep, Conversation, type ConversationEvent, type ConversationNode, type ConversationProps, type ConversationRecord, type EventFlag, type EventStreamHandlers, ExpandedToolDetail, type ExpandedToolDetailProps, type FeedSegment, InlineThinkingItem, type InlineThinkingItemProps, InlineToolItem, type InlineToolItemProps, LatestEvents, type LatestEventsProps, LiveDuration, type RecordIndex, RunGroup, type RunGroupProps, type RunPhase, RunPhaseList, RunRowShell, type RunRowShellProps, type RunRowStatus, RunRowStatusDot, type RunStatus, RunStatusIcon, type RunStatusIconProps, type StatusMeta, TaskList, type TaskListItem, type TaskListProps, type TaskStatus, type ToolCall, type ToolCallData, ToolCallFeed, type ToolCallFeedProps, type ToolCallStatus, type ToolCallType, type TraceEvent, TraceWaterfall, type TraceWaterfallProps, TraceWorkspace, type TraceWorkspaceProps, VirtualList, foldAgentRows, indexRecord, isOpen, parseToolEvent, recordFlowTrace, model_d_exports as recordModel, runStatus, showsTaskPriority, statusMeta, taskProgress, taskStatus, traceSpanMark, useAgentStream, useEventStream, withPrompts };
3
+ import { C as foldAgentRows, S as AgentTranscriptEntry, _ as ConversationRecord, a as VirtualList, b as AgentStreamRow, c as ConversationProps, d as ToolCall, f as indexRecord, g as ConversationNode, h as ConversationEvent, i as AgentTree, l as EventFlag, m as recordFlowTrace, n as ToolStep, o as withPrompts, p as model_d_exports, r as timelineItems, s as Conversation, t as PromptMore, u as RecordIndex, v as AgentStreamHistory, w as useAgentStream, x as AgentStreamState, y as AgentStreamPage } from "./index-Bv2iiZaN.js";
4
+ export { type AgentStreamHistory, type AgentStreamOpener, type AgentStreamPage, type AgentStreamRow, type AgentStreamSource, type AgentStreamState, type AgentTranscriptEntry, AgentTree, ApprovalCard, type ApprovalCardProps, type ApprovalDiffFile, ApprovalDiffSummary, type ApprovalPlanStep, Conversation, type ConversationEvent, type ConversationNode, type ConversationProps, type ConversationRecord, type EventFlag, type EventStreamHandlers, ExpandedToolDetail, type ExpandedToolDetailProps, type FeedSegment, InlineThinkingItem, type InlineThinkingItemProps, InlineToolItem, type InlineToolItemProps, LatestEvents, type LatestEventsProps, LiveDuration, PromptMore, type RecordIndex, RunGroup, type RunGroupProps, type RunPhase, RunPhaseList, RunRowShell, type RunRowShellProps, type RunRowStatus, RunRowStatusDot, type RunStatus, RunStatusIcon, type RunStatusIconProps, type StatusMeta, TaskList, type TaskListItem, type TaskListProps, type TaskStatus, type ToolCall, type ToolCallData, ToolCallFeed, type ToolCallFeedProps, type ToolCallStatus, type ToolCallType, ToolStep, type TraceEvent, TraceWaterfall, type TraceWaterfallProps, TraceWorkspace, type TraceWorkspaceProps, VirtualList, foldAgentRows, indexRecord, isOpen, parseToolEvent, recordFlowTrace, model_d_exports as recordModel, runStatus, showsTaskPriority, statusMeta, taskProgress, taskStatus, timelineItems, traceSpanMark, useAgentStream, useEventStream, withPrompts };
package/dist/run.js CHANGED
@@ -1,6 +1,7 @@
1
- import { t as VirtualList } from "./VirtualList-DLh2JE0F.js";
2
- import { a as useEventStream, i as useAgentStream, n as LatestEvents, o as TraceWaterfall, r as foldAgentRows, s as traceSpanMark, t as TraceWorkspace } from "./trace-workspace-BiJbv9WQ.js";
3
- import { d as recordFlowTrace, l as model_exports, n as Conversation, o as indexRecord, t as AgentTree } from "./AgentTree-CJRVpgPq.js";
4
- import { t as withPrompts } from "./record-Ct_MZeZC.js";
1
+ import { t as VirtualList } from "./VirtualList-DcSGbEtA.js";
2
+ import { a as useEventStream, i as useAgentStream, n as LatestEvents, o as TraceWaterfall, r as foldAgentRows, s as traceSpanMark, t as TraceWorkspace } from "./trace-workspace-B634-EcA.js";
3
+ import { S as model_exports, i as ToolStep, r as PromptMore, s as timelineItems, w as recordFlowTrace, y as indexRecord } from "./use-follow-tail-DZFn7QDO.js";
4
+ import { n as Conversation, t as AgentTree } from "./AgentTree-D4d06rfH.js";
5
+ import { t as withPrompts } from "./record-C-EUpK-n.js";
5
6
  import { ApprovalCard, ApprovalDiffSummary, ExpandedToolDetail, InlineThinkingItem, InlineToolItem, LiveDuration, RunGroup, RunPhaseList, RunRowShell, RunRowStatusDot, RunStatusIcon, TaskList, ToolCallFeed, isOpen, parseToolEvent, runStatus, showsTaskPriority, statusMeta, taskProgress, taskStatus } from "@tangle-network/ui/run";
6
- export { AgentTree, ApprovalCard, ApprovalDiffSummary, Conversation, ExpandedToolDetail, InlineThinkingItem, InlineToolItem, LatestEvents, LiveDuration, RunGroup, RunPhaseList, RunRowShell, RunRowStatusDot, RunStatusIcon, TaskList, ToolCallFeed, TraceWaterfall, TraceWorkspace, VirtualList, foldAgentRows, indexRecord, isOpen, parseToolEvent, recordFlowTrace, model_exports as recordModel, runStatus, showsTaskPriority, statusMeta, taskProgress, taskStatus, traceSpanMark, useAgentStream, useEventStream, withPrompts };
7
+ export { AgentTree, ApprovalCard, ApprovalDiffSummary, Conversation, ExpandedToolDetail, InlineThinkingItem, InlineToolItem, LatestEvents, LiveDuration, PromptMore, RunGroup, RunPhaseList, RunRowShell, RunRowStatusDot, RunStatusIcon, TaskList, ToolCallFeed, ToolStep, TraceWaterfall, TraceWorkspace, VirtualList, foldAgentRows, indexRecord, isOpen, parseToolEvent, recordFlowTrace, model_exports as recordModel, runStatus, showsTaskPriority, statusMeta, taskProgress, taskStatus, timelineItems, traceSpanMark, useAgentStream, useEventStream, withPrompts };
@@ -1,7 +1,7 @@
1
1
  import { i as e, t } from "./rolldown-runtime-CwxnZyOB.js";
2
- import { Et as n, H as r, K as i, O as a, S as o, T as s, Tt as c, U as l, X as u, Z as d, _ as f, a as p, c as m, ct as h, et as g, f as _, g as v, h as y, i as b, l as x, lt as S, m as C, n as w, p as T, q as E, s as D, t as O, u as k, v as A, x as j, xt as M } from "./latest-events-CRq9sGkK-YFXUh9qO.js";
3
- // node_modules/.pnpm/@tangle-network+charts@4.0.2_@tangle-network+brand@1.31.3_react@19.3.1__@tangle-network_05e5010b9bb923f09b9d30109faa4cac/node_modules/@tangle-network/charts/dist/motion-DILryczn.js
4
- var N = "[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", P = /* @__PURE__ */ e(n(), 1), F = M();
2
+ import { Dt as n, Et as r, H as i, K as a, O as o, S as s, St as c, T as l, U as u, X as d, Z as f, _ as p, a as m, c as h, et as g, f as _, g as v, h as y, i as b, l as x, lt as S, m as C, n as w, p as T, q as E, s as D, t as O, u as k, ut as A, v as j, x as M } from "./latest-events-CRq9sGkK-CfoBl1dP.js";
3
+ // node_modules/.pnpm/@tangle-network+charts@4.0.2_@tangle-network+brand@1.31.3_react@19.3.1__@tangle-network_8fd2b0d675b84eae5d8adcca22ee1cb3/node_modules/@tangle-network/charts/dist/motion-DILryczn.js
4
+ var N = "[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", P = /* @__PURE__ */ e(n(), 1), F = c();
5
5
  function I(e) {
6
6
  if (typeof e == "string" || typeof e == "number") return "" + e;
7
7
  let t = "";
@@ -4225,7 +4225,7 @@ function Z(e, t) {
4225
4225
  return !0;
4226
4226
  }
4227
4227
  // node_modules/.pnpm/@xyflow+react@12.12.0_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0__a2dc164871d419910c9e7025366b0809/node_modules/@xyflow/react/dist/esm/index.js
4228
- var Cc = /* @__PURE__ */ e(c()), wc = (0, P.createContext)(null), Tc = wc.Provider, Ec = wa.error001("react");
4228
+ var Cc = /* @__PURE__ */ e(r()), wc = (0, P.createContext)(null), Tc = wc.Provider, Ec = wa.error001("react");
4229
4229
  function Q(e, t) {
4230
4230
  let n = (0, P.useContext)(wc);
4231
4231
  if (n === null) throw Error(Ec);
@@ -7582,7 +7582,7 @@ function gf({ nodeId: e, position: t, variant: n = $s.Handle, className: r, styl
7582
7582
  });
7583
7583
  }
7584
7584
  (0, P.memo)(gf);
7585
- // node_modules/.pnpm/@tangle-network+charts@4.0.2_@tangle-network+brand@1.31.3_react@19.3.1__@tangle-network_05e5010b9bb923f09b9d30109faa4cac/node_modules/@tangle-network/charts/dist/AgentGraphCanvas-DGq7_u8-.js
7585
+ // node_modules/.pnpm/@tangle-network+charts@4.0.2_@tangle-network+brand@1.31.3_react@19.3.1__@tangle-network_8fd2b0d675b84eae5d8adcca22ee1cb3/node_modules/@tangle-network/charts/dist/AgentGraphCanvas-DGq7_u8-.js
7586
7586
  var _f = {
7587
7587
  name: "chevron-down",
7588
7588
  size: 24,
@@ -7606,9 +7606,9 @@ function bf({ status: e, size: t }) {
7606
7606
  "aria-hidden": !0,
7607
7607
  "data-motion": "essential",
7608
7608
  className: "ag-running-dot",
7609
- style: a,
7610
- onAnimationStart: r
7611
- }) : /* @__PURE__ */ (0, F.jsx)(d, {
7609
+ style: o,
7610
+ onAnimationStart: i
7611
+ }) : /* @__PURE__ */ (0, F.jsx)(f, {
7612
7612
  status: e,
7613
7613
  size: t,
7614
7614
  "aria-hidden": !0
@@ -7621,7 +7621,7 @@ function xf(e) {
7621
7621
  } : { borderColor: _ };
7622
7622
  }
7623
7623
  function Sf(e) {
7624
- let t = v(e.costUsd ?? void 0), n = A(e.tokens);
7624
+ let t = v(e.costUsd ?? void 0), n = j(e.tokens);
7625
7625
  return [
7626
7626
  e.label,
7627
7627
  e.role,
@@ -7649,10 +7649,10 @@ function Tf({ direction: e, source: t = !0 }) {
7649
7649
  })] });
7650
7650
  }
7651
7651
  function Ef({ agent: e, selected: t, direction: n, now: r, onOpen: i, parentLabel: a, handles: o = !1 }) {
7652
- let c = u(r), l = s(e, c), d = yf(e.status);
7652
+ let s = d(r), c = l(e, s), u = yf(e.status);
7653
7653
  return /* @__PURE__ */ (0, F.jsxs)("div", {
7654
7654
  "data-status": e.status,
7655
- "data-activity": l ? "quiet" : void 0,
7655
+ "data-activity": c ? "quiet" : void 0,
7656
7656
  "data-selected": t || void 0,
7657
7657
  title: Sf(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 ${N}`,
@@ -7689,7 +7689,7 @@ function Ef({ agent: e, selected: t, direction: n, now: r, onOpen: i, parentLabe
7689
7689
  "data-agent-identity": "",
7690
7690
  className: "m-0 truncate text-[13px] leading-[18px] text-muted-foreground",
7691
7691
  title: [e.harness, e.model].filter(Boolean).join(" · "),
7692
- children: [e.harness, e.model ? j(e.model) : null].filter(Boolean).join(" · ") || "Identity not recorded"
7692
+ children: [e.harness, e.model ? M(e.model) : null].filter(Boolean).join(" · ") || "Identity not recorded"
7693
7693
  }),
7694
7694
  (e.status === "failed" || (e.status === "done" || e.status === "stopped") && (e.result ?? e.turn)) && /* @__PURE__ */ (0, F.jsx)("p", {
7695
7695
  className: "m-0 line-clamp-2 text-[13px] leading-4",
@@ -7697,20 +7697,20 @@ function Ef({ agent: e, selected: t, direction: n, now: r, onOpen: i, parentLabe
7697
7697
  }),
7698
7698
  /* @__PURE__ */ (0, F.jsxs)("div", {
7699
7699
  className: "mt-auto flex items-center justify-between gap-1 text-[13px]",
7700
- style: { color: l ? "var(--surface-warning-text)" : d.color },
7700
+ style: { color: c ? "var(--surface-warning-text)" : u.color },
7701
7701
  children: [
7702
7702
  /* @__PURE__ */ (0, F.jsxs)("span", {
7703
7703
  className: "flex items-center gap-1",
7704
7704
  children: [/* @__PURE__ */ (0, F.jsx)(bf, {
7705
7705
  status: e.status,
7706
7706
  size: 16
7707
- }), l?.label ?? d.label]
7707
+ }), c?.label ?? u.label]
7708
7708
  }),
7709
7709
  /* @__PURE__ */ (0, F.jsx)("span", {
7710
7710
  "data-agent-tokens": "",
7711
7711
  title: e.tokens == null ? "Tokens not recorded" : "Tokens",
7712
7712
  className: "text-muted-foreground tabular-nums whitespace-nowrap",
7713
- children: A(e.tokens) ?? "—"
7713
+ children: j(e.tokens) ?? "—"
7714
7714
  }),
7715
7715
  e.status === "needs-you" && /* @__PURE__ */ (0, F.jsx)("button", {
7716
7716
  type: "button",
@@ -7830,18 +7830,18 @@ function Nf({ id: e, source: t, target: n, data: r, markerEnd: i }) {
7830
7830
  function Pf(e) {
7831
7831
  return e.length <= 52 ? e : `${e.slice(0, 32)} … ${e.slice(-17)}`;
7832
7832
  }
7833
- function Ff({ agent: e, selected: t, direction: n = "TB", now: r, handles: a = !1, onOpen: o, parentLabel: c, renderEventIcon: l }) {
7834
- let d = u(r), p = (0, P.useRef)(null);
7835
- i(p, e.status);
7836
- let m = e.status === "done" || e.status === "stopped", h = e.status === "failed", g = s(e, d), _ = yf(e.status), y = [e.model ? j(e.model) : void 0, e.effort].filter(Boolean).join(" · "), b = (e.events ?? []).slice(-3), x = Number.isFinite(e.costUsd) ? v(e.costUsd) : void 0, S = [
7833
+ function Ff({ agent: e, selected: t, direction: n = "TB", now: r, handles: i = !1, onOpen: o, parentLabel: s, renderEventIcon: c }) {
7834
+ let u = d(r), f = (0, P.useRef)(null);
7835
+ a(f, e.status);
7836
+ let m = e.status === "done" || e.status === "stopped", h = e.status === "failed", g = l(e, u), _ = yf(e.status), y = [e.model ? M(e.model) : void 0, e.effort].filter(Boolean).join(" · "), b = (e.events ?? []).slice(-3), x = Number.isFinite(e.costUsd) ? v(e.costUsd) : void 0, S = [
7837
7837
  x,
7838
- !h && e.startedAt != null ? `${f(e.startedAt, d, !1)} elapsed` : void 0,
7838
+ !h && e.startedAt != null ? `${p(e.startedAt, u, !1)} elapsed` : void 0,
7839
7839
  Number.isFinite(e.commits) ? `${e.commits} ${e.commits === 1 ? "commit" : "commits"}` : void 0
7840
7840
  ].filter(Boolean).join(" · ") || "—";
7841
7841
  return /* @__PURE__ */ (0, F.jsxs)("div", {
7842
7842
  className: "ag-live-slot",
7843
- children: [a && /* @__PURE__ */ (0, F.jsx)(Tf, { direction: n }), /* @__PURE__ */ (0, F.jsxs)("div", {
7844
- ref: p,
7843
+ children: [i && /* @__PURE__ */ (0, F.jsx)(Tf, { direction: n }), /* @__PURE__ */ (0, F.jsxs)("div", {
7844
+ ref: f,
7845
7845
  className: `ag-live-card${m ? " ag-live-chip" : ""}`,
7846
7846
  "data-status": e.status,
7847
7847
  "data-sparse": b.length === 0 || void 0,
@@ -7877,9 +7877,9 @@ function Ff({ agent: e, selected: t, direction: n = "TB", now: r, handles: a = !
7877
7877
  className: "ag-live-names",
7878
7878
  children: [/* @__PURE__ */ (0, F.jsxs)("span", {
7879
7879
  className: "ag-live-name",
7880
- children: [c && /* @__PURE__ */ (0, F.jsxs)("span", {
7880
+ children: [s && /* @__PURE__ */ (0, F.jsxs)("span", {
7881
7881
  className: "ag-parent-label",
7882
- children: [c, " / "]
7882
+ children: [s, " / "]
7883
7883
  }), e.label]
7884
7884
  }), !m && y && /* @__PURE__ */ (0, F.jsx)("span", {
7885
7885
  className: "ag-live-meta",
@@ -7946,7 +7946,7 @@ function Ff({ agent: e, selected: t, direction: n = "TB", now: r, handles: a = !
7946
7946
  children: b.map((e) => /* @__PURE__ */ (0, F.jsxs)("li", {
7947
7947
  title: e.label,
7948
7948
  children: [
7949
- l?.(e) ?? /* @__PURE__ */ (0, F.jsx)(D, {
7949
+ c?.(e) ?? /* @__PURE__ */ (0, F.jsx)(D, {
7950
7950
  size: 12,
7951
7951
  strokeWidth: 1.75,
7952
7952
  "aria-hidden": !0
@@ -7958,7 +7958,7 @@ function Ff({ agent: e, selected: t, direction: n = "TB", now: r, handles: a = !
7958
7958
  /* @__PURE__ */ (0, F.jsxs)("time", {
7959
7959
  className: "ag-live-event-at",
7960
7960
  dateTime: Number.isFinite(e.at) ? new Date(e.at).toISOString() : void 0,
7961
- children: [h && e.at != null ? "at " : "", f(e.at, d, h)]
7961
+ children: [h && e.at != null ? "at " : "", p(e.at, u, h)]
7962
7962
  })
7963
7963
  ]
7964
7964
  }, e.id))
@@ -8003,17 +8003,17 @@ function Hf(e, t, n) {
8003
8003
  zoom: l
8004
8004
  });
8005
8005
  }
8006
- function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB", className: a, emptyState: c, live: d = !1, renderEventIcon: f, showLatestEvents: g = !0, now: _ }) {
8007
- let v = d ? b : O, x = u(_), S = E(), C = (0, P.useId)(), w = (0, P.useRef)(null), T = (0, P.useRef)(!1), [D, A] = (0, P.useState)(null), j = () => A(null), [M, N] = (0, P.useState)(/* @__PURE__ */ new Set()), [I, L] = (0, P.useState)(0), R = (0, P.useRef)(null), [z, B] = Vf(), V = o(R, e.length > 0), H = z !== null && z.width < 600, U = m(e, t), W = (0, P.useRef)(U);
8006
+ function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB", className: a, emptyState: o, live: c = !1, renderEventIcon: f, showLatestEvents: p = !0, now: g }) {
8007
+ let _ = c ? b : O, v = d(g), x = E(), C = (0, P.useId)(), w = (0, P.useRef)(null), T = (0, P.useRef)(!1), [D, A] = (0, P.useState)(null), j = () => A(null), [M, N] = (0, P.useState)(/* @__PURE__ */ new Set()), [I, L] = (0, P.useState)(0), R = (0, P.useRef)(null), [z, B] = Vf(), V = s(R, e.length > 0), H = z !== null && z.width < 600, U = h(e, t), W = (0, P.useRef)(U);
8008
8008
  W.current.key !== U.key && (W.current = U);
8009
- let G = W.current, ee = `${i}:${d}:${G.key}`, te = (0, P.useRef)(null);
8009
+ let G = W.current, ee = `${i}:${c}:${G.key}`, te = (0, P.useRef)(null);
8010
8010
  z && !H && te.current?.key !== ee && (te.current = {
8011
8011
  key: ee,
8012
- columns: Math.max(1, Math.min(6, Math.floor((z.width - 32 - (!d && i === "LR" ? v.width + 70 : 0)) / (v.width + 10))))
8012
+ columns: Math.max(1, Math.min(6, Math.floor((z.width - 32 - (!c && i === "LR" ? _.width + 70 : 0)) / (_.width + 10))))
8013
8013
  });
8014
8014
  let ne = te.current?.columns ?? 1, re = JSON.stringify([
8015
8015
  i,
8016
- d,
8016
+ c,
8017
8017
  G.key,
8018
8018
  ne,
8019
8019
  [...M]
@@ -8021,7 +8021,7 @@ function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB
8021
8021
  (0, P.useEffect)(() => {
8022
8022
  if (H) return;
8023
8023
  let e = !0;
8024
- return k(G, i, ne, v, M, d).then((t) => {
8024
+ return k(G, i, ne, _, M, c).then((t) => {
8025
8025
  e && ae({
8026
8026
  key: re,
8027
8027
  layout: t
@@ -8058,7 +8058,7 @@ function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB
8058
8058
  data: {
8059
8059
  frame: e,
8060
8060
  direction: i,
8061
- groupParents: d,
8061
+ groupParents: c,
8062
8062
  label: q.get(e.group.parentId)?.label ?? "Agent",
8063
8063
  onToggle: () => {
8064
8064
  !e.collapsed && n && e.group.memberIds.includes(n) && r?.(e.group.parentId), N((t) => {
@@ -8071,15 +8071,15 @@ function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB
8071
8071
  for (let e of G.agentIds) {
8072
8072
  let a = q.get(e), o = K.positions.get(e);
8073
8073
  if (!a || !o) continue;
8074
- let s = n === e, c = d && K.frames.find((t) => t.group.parentId === e), l = c ? c.width - 64 : v.width, u = c ? 64 : v.height, p = oe.current?.getInternalNode(e)?.measured;
8074
+ let s = n === e, l = c && K.frames.find((t) => t.group.parentId === e), u = l ? l.width - 64 : _.width, d = l ? 64 : _.height, p = oe.current?.getInternalNode(e)?.measured;
8075
8075
  t.push({
8076
8076
  id: e,
8077
- type: d ? "liveAgent" : "agent",
8077
+ type: c ? "liveAgent" : "agent",
8078
8078
  position: o,
8079
- width: l,
8080
- height: u,
8081
- measured: p?.width === l && p.height === u ? p : void 0,
8082
- className: `${Cf}${c ? " ag-frame-owner" : ""}`,
8079
+ width: u,
8080
+ height: d,
8081
+ measured: p?.width === u && p.height === d ? p : void 0,
8082
+ className: `${Cf}${l ? " ag-frame-owner" : ""}`,
8083
8083
  draggable: !1,
8084
8084
  ariaRole: "button",
8085
8085
  ariaLabel: Sf(a),
@@ -8091,7 +8091,7 @@ function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB
8091
8091
  agent: a,
8092
8092
  selected: s,
8093
8093
  direction: i,
8094
- now: x,
8094
+ now: v,
8095
8095
  onOpen: r ? () => r(a.id) : void 0,
8096
8096
  renderEventIcon: f
8097
8097
  }
@@ -8104,9 +8104,9 @@ function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB
8104
8104
  q,
8105
8105
  n,
8106
8106
  i,
8107
- d,
8107
+ c,
8108
+ _,
8108
8109
  v,
8109
- x,
8110
8110
  r,
8111
8111
  f,
8112
8112
  D
@@ -8114,7 +8114,7 @@ function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB
8114
8114
  if (!K) return [];
8115
8115
  let e = [], r = /* @__PURE__ */ new Set();
8116
8116
  for (let t of G.spawns) {
8117
- let n = d && G.groups.find((e) => e.parentId === t.from)?.id || t.from, i = G.groupOf.get(t.to) ?? t.to;
8117
+ let n = c && G.groups.find((e) => e.parentId === t.from)?.id || t.from, i = G.groupOf.get(t.to) ?? t.to;
8118
8118
  if (n === i) continue;
8119
8119
  let a = `spawn:${n}:${i}`;
8120
8120
  r.has(a) || (r.add(a), e.push({
@@ -8171,23 +8171,23 @@ function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB
8171
8171
  (0, P.useEffect)(() => {
8172
8172
  H && (oe.current = null, ue(!1), fe(!1), me.current = null);
8173
8173
  }, [H]);
8174
- let he = K ? `${re}:${K.columns}` : null, ge = `${i}:${G.key}`, _e = d ? K && z ? Math.max(.02, Math.min(.2, (z.width - 32) / K.width, (z.height - 32) / K.height)) : .2 : 1;
8174
+ let he = K ? `${re}:${K.columns}` : null, ge = `${i}:${G.key}`, _e = c ? K && z ? Math.max(.02, Math.min(.2, (z.width - 32) / K.width, (z.height - 32) / K.height)) : .2 : 1;
8175
8175
  (0, P.useEffect)(() => {
8176
8176
  let e = oe.current;
8177
8177
  if (!le || !e || !he || !z) return;
8178
8178
  let t = me.current !== ge, n = !t;
8179
8179
  if (n && !pe.current) return;
8180
- let r = me.current !== null && t && S;
8180
+ let r = me.current !== null && t && x;
8181
8181
  me.current = ge;
8182
8182
  let i = requestAnimationFrame(() => {
8183
8183
  if (n) Hf(e, R.current, pe.current);
8184
8184
  else {
8185
- let t = pe.current ?? G.agentIds[0], n = K?.positions.get(t), i = e.getInternalNode(t)?.width ?? v.width, a = K.width + 32 <= z.width ? (z.width - K.width) / 2 : n ? Math.max(zf - n.x, z.width / 2 - n.x - i / 2) : zf, o = K.height + 32 <= z.height ? zf : zf - (n?.y ?? 0);
8185
+ let t = pe.current ?? G.agentIds[0], n = K?.positions.get(t), i = e.getInternalNode(t)?.width ?? _.width, a = K.width + 32 <= z.width ? (z.width - K.width) / 2 : n ? Math.max(zf - n.x, z.width / 2 - n.x - i / 2) : zf, o = K.height + 32 <= z.height ? zf : zf - (n?.y ?? 0);
8186
8186
  e.setViewport({
8187
8187
  x: a,
8188
8188
  y: o,
8189
8189
  zoom: 1
8190
- }, { duration: r ? l("--duration-base", R.current) : 0 });
8190
+ }, { duration: r ? u("--duration-base", R.current) : 0 });
8191
8191
  }
8192
8192
  fe(!0);
8193
8193
  });
@@ -8198,7 +8198,7 @@ function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB
8198
8198
  ge,
8199
8199
  z,
8200
8200
  _e,
8201
- S,
8201
+ x,
8202
8202
  n
8203
8203
  ]);
8204
8204
  let J = (0, P.useCallback)((e) => {
@@ -8225,7 +8225,7 @@ function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB
8225
8225
  if (!i) return;
8226
8226
  e.preventDefault(), e.stopPropagation();
8227
8227
  let a = K?.positions.get(i), o = oe.current?.getInternalNode(i)?.measured;
8228
- a && oe.current?.setCenter(a.x + (o?.width ?? v.width) / 2, a.y + (o?.height ?? v.height) / 2, { zoom: 1 });
8228
+ a && oe.current?.setCenter(a.x + (o?.width ?? _.width) / 2, a.y + (o?.height ?? _.height) / 2, { zoom: 1 });
8229
8229
  let s = () => R.current?.querySelector(`.react-flow__node[data-id="${CSS.escape(i)}"]`), c = s();
8230
8230
  c ? c.focus() : requestAnimationFrame(() => requestAnimationFrame(() => s()?.focus()));
8231
8231
  }, [
@@ -8233,9 +8233,9 @@ function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB
8233
8233
  J,
8234
8234
  K,
8235
8235
  G,
8236
- v,
8237
- S
8238
- ]), be = (e) => e.status === "needs-you" ? 0 : e.status === "failed" ? 1 : s(e, x) ? 2 : e.status === "waiting" ? 3 : e.status === "running" ? 4 : 5, xe = new Map(t.filter((e) => e.kind === "spawn").map((e) => [e.to, e.from])), Se = (e) => {
8236
+ _,
8237
+ x
8238
+ ]), be = (e) => e.status === "needs-you" ? 0 : e.status === "failed" ? 1 : l(e, v) ? 2 : e.status === "waiting" ? 3 : e.status === "running" ? 4 : 5, xe = new Map(t.filter((e) => e.kind === "spawn").map((e) => [e.to, e.from])), Se = (e) => {
8239
8239
  let t = /* @__PURE__ */ new Set([e]), n = 0;
8240
8240
  for (; xe.has(e) && !t.has(xe.get(e));) e = xe.get(e), t.add(e), n++;
8241
8241
  return n;
@@ -8259,7 +8259,7 @@ function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB
8259
8259
  "failed",
8260
8260
  "quiet"
8261
8261
  ].map((t) => {
8262
- let r = e.filter((e) => t === "quiet" ? s(e, x) : e.status === t);
8262
+ let r = e.filter((e) => t === "quiet" ? l(e, v) : e.status === t);
8263
8263
  return {
8264
8264
  status: t,
8265
8265
  matches: r,
@@ -8279,9 +8279,9 @@ function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB
8279
8279
  let t = e.matches.findIndex((e) => e.id === n), r = e.matches[(t + 1) % e.matches.length];
8280
8280
  J(r.id);
8281
8281
  let i = K?.positions.get(r.id), a = oe.current?.getInternalNode(r.id)?.measured;
8282
- i && oe.current?.setCenter(i.x + (a?.width ?? v.width) / 2, i.y + (a?.height ?? v.height) / 2, {
8282
+ i && oe.current?.setCenter(i.x + (a?.width ?? _.width) / 2, i.y + (a?.height ?? _.height) / 2, {
8283
8283
  zoom: 1,
8284
- duration: S ? l("--duration-base", R.current) : 0
8284
+ duration: x ? u("--duration-base", R.current) : 0
8285
8285
  });
8286
8286
  },
8287
8287
  children: [/* @__PURE__ */ (0, F.jsxs)("span", {
@@ -8302,8 +8302,8 @@ function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB
8302
8302
  });
8303
8303
  return e.length === 0 ? /* @__PURE__ */ (0, F.jsx)("div", {
8304
8304
  className: `agent-graph flex items-center justify-center rounded-lg border border-border border-dashed p-4 text-center text-muted-foreground text-xs ${a ?? ""}`,
8305
- children: c ?? "No agents yet"
8306
- }) : /* @__PURE__ */ (0, F.jsx)(h, {
8305
+ children: o ?? "No agents yet"
8306
+ }) : /* @__PURE__ */ (0, F.jsx)(S, {
8307
8307
  anchor: D?.anchor,
8308
8308
  open: !!D,
8309
8309
  onOpenChange: (e) => {
@@ -8313,7 +8313,7 @@ function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB
8313
8313
  ref: (e) => {
8314
8314
  R.current = e, B(e);
8315
8315
  },
8316
- className: `agent-graph ag-live${d ? "" : " ag-topology"} relative flex flex-col ${a ?? ""}`,
8316
+ className: `agent-graph ag-live${c ? "" : " ag-topology"} relative flex flex-col ${a ?? ""}`,
8317
8317
  tabIndex: -1,
8318
8318
  onKeyDownCapture: (e) => {
8319
8319
  e.target instanceof HTMLElement && e.target.closest("[data-agent-metrics]") || (e.key === "Tab" && !e.shiftKey && D ? (e.preventDefault(), document.getElementById(C)?.focus()) : (e.key === "Escape" && j(), ye(e)));
@@ -8337,10 +8337,10 @@ function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB
8337
8337
  "data-columns": K?.columns,
8338
8338
  children: [
8339
8339
  Oe,
8340
- g && d && /* @__PURE__ */ (0, F.jsx)(p, {
8340
+ p && c && /* @__PURE__ */ (0, F.jsx)(m, {
8341
8341
  agents: e,
8342
- now: _,
8343
- live: d,
8342
+ now: g,
8343
+ live: c,
8344
8344
  selectedId: n,
8345
8345
  onSelect: r ? J : void 0
8346
8346
  }),
@@ -8360,18 +8360,18 @@ function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB
8360
8360
  onKeyDown: (t) => {
8361
8361
  (t.key === "Enter" || t.key === " ") && t.target === t.currentTarget && (t.preventDefault(), J(e.id));
8362
8362
  },
8363
- children: d ? /* @__PURE__ */ (0, F.jsx)(Ff, {
8363
+ children: c ? /* @__PURE__ */ (0, F.jsx)(Ff, {
8364
8364
  agent: e,
8365
8365
  parentLabel: q.get(xe.get(e.id) ?? "")?.label,
8366
8366
  selected: n === e.id,
8367
- now: x,
8367
+ now: v,
8368
8368
  renderEventIcon: f,
8369
8369
  onOpen: r ? () => J(e.id) : void 0
8370
8370
  }) : /* @__PURE__ */ (0, F.jsx)(Ef, {
8371
8371
  agent: e,
8372
8372
  parentLabel: q.get(xe.get(e.id) ?? "")?.label,
8373
8373
  selected: n === e.id,
8374
- now: x,
8374
+ now: v,
8375
8375
  direction: i,
8376
8376
  onOpen: r ? () => J(e.id) : void 0
8377
8377
  })
@@ -8467,7 +8467,7 @@ function Uf({ nodes: e, edges: t, selectedId: n, onSelect: r, direction: i = "TB
8467
8467
  padding: `${zf}px`,
8468
8468
  minZoom: _e,
8469
8469
  maxZoom: 1,
8470
- nodes: d ? void 0 : G.agentIds.slice(0, 2).map((e) => ({ id: e }))
8470
+ nodes: c ? void 0 : G.agentIds.slice(0, 2).map((e) => ({ id: e }))
8471
8471
  }
8472
8472
  })
8473
8473
  ]
@@ -8491,7 +8491,7 @@ function Wf({ anchor: e, side: t, mode: n, id: r, agent: i, onClose: a }) {
8491
8491
  let o = new Map([
8492
8492
  {
8493
8493
  label: "Tokens",
8494
- value: A(i.tokens) ?? "Not recorded"
8494
+ value: j(i.tokens) ?? "Not recorded"
8495
8495
  },
8496
8496
  {
8497
8497
  label: "Cost",
@@ -8499,7 +8499,7 @@ function Wf({ anchor: e, side: t, mode: n, id: r, agent: i, onClose: a }) {
8499
8499
  },
8500
8500
  ...i.facts ?? []
8501
8501
  ].map((e) => [e.label.toLowerCase(), e]));
8502
- return /* @__PURE__ */ (0, F.jsxs)(S, {
8502
+ return /* @__PURE__ */ (0, F.jsxs)(A, {
8503
8503
  container: e,
8504
8504
  side: t,
8505
8505
  align: "start",