@tangle-network/sandbox-ui 7.0.4 → 7.0.5

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 (30) hide show
  1. package/README.md +2 -0
  2. package/dist/{AgentTree-Dzy6lrfP.js → AgentTree-B1iTTYNe.js} +1 -1
  3. package/dist/{use-follow-tail-Df965WQi.js → ConversationRowView-C4TXICBT.js} +2 -2
  4. package/dist/{ResearchReport-DKWDmzdK.js → ResearchReport-kYGwgHC7.js} +2 -2
  5. package/dist/globals.css +14 -0
  6. package/dist/{index-PolYo7h9.d.ts → index-CGHJonni.d.ts} +65 -2
  7. package/dist/index.d.ts +2 -2
  8. package/dist/index.js +7 -7
  9. package/dist/record/ResearchReport.js +1 -1
  10. package/dist/{record-Cc_WNtG8.js → record-Dmyq0jfl.js} +2 -2
  11. package/dist/record.js +1 -1
  12. package/dist/report-viewer.js +75 -75
  13. package/dist/run/live.js +1 -1
  14. package/dist/run/record.js +3 -3
  15. package/dist/run-CcyjQN7y.js +238 -0
  16. package/dist/run.d.ts +2 -2
  17. package/dist/run.js +6 -6
  18. package/dist/runtime-viewer/AgentGraphCanvas-P_PFS2Ko-XoCELgxL.js +563 -0
  19. package/dist/runtime-viewer/{latest-events-CMbdBLcT-uhVN4JLh.js → latest-events-wofY6ifW-4IMNEe7c.js} +576 -107
  20. package/dist/styles.css +14 -0
  21. package/dist/terminal.js +1 -1
  22. package/dist/{trace-workspace-EArXc0uP.js → trace-workspace-HCTpp-qw.js} +77 -37
  23. package/dist/{workbench-D0ALR40M.js → workbench-CugraIbl.js} +2 -1
  24. package/dist/workbench.js +1 -1
  25. package/dist/workspace-viewer.js +10510 -10366
  26. package/package.json +6 -4
  27. package/tests/visual/content-share.mjs +35 -0
  28. package/dist/run-CpJ_COuz.js +0 -5
  29. package/dist/runtime-viewer/AgentGraphCanvas-xHVW-YRV-Ch1fnK9k.js +0 -957
  30. /package/dist/{terminal-nUCznZRj.js → terminal-view-nUCznZRj.js} +0 -0
package/dist/styles.css CHANGED
@@ -548,6 +548,9 @@
548
548
  .m-0 {
549
549
  margin: 0px;
550
550
  }
551
+ .m-1 {
552
+ margin: var(--spacing);
553
+ }
551
554
  .m-4 {
552
555
  margin: calc(var(--spacing) * 4);
553
556
  }
@@ -4437,6 +4440,10 @@
4437
4440
  --tw-blur: blur(8px);
4438
4441
  filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
4439
4442
  }
4443
+ .grayscale {
4444
+ --tw-grayscale: grayscale(100%);
4445
+ filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
4446
+ }
4440
4447
  .\!filter {
4441
4448
  filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,) !important;
4442
4449
  }
@@ -5273,6 +5280,10 @@
5273
5280
  --tw-brightness: brightness(110%);
5274
5281
  filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
5275
5282
  }
5283
+ .hover\:grayscale-0:hover {
5284
+ --tw-grayscale: grayscale(0%);
5285
+ filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
5286
+ }
5276
5287
  }
5277
5288
  .focus\:border-\[var\(--focus-border\)\]:focus {
5278
5289
  border-color: var(--focus-border);
@@ -5943,6 +5954,9 @@
5943
5954
  .sm\:\!block {
5944
5955
  display: block !important;
5945
5956
  }
5957
+ .sm\:block {
5958
+ display: block;
5959
+ }
5946
5960
  .sm\:flex {
5947
5961
  display: flex;
5948
5962
  }
package/dist/terminal.js CHANGED
@@ -1 +1 @@
1
- export { t as DEFAULT_TERMINAL_THEME, n as TerminalView } from "./terminal-nUCznZRj.js";
1
+ export { t as DEFAULT_TERMINAL_THEME, n as TerminalView } from "./terminal-view-nUCznZRj.js";
@@ -2,7 +2,7 @@ import { t as cn$1 } from "./utils-BER_bdgE.js";
2
2
  import { i as modelBrandFor, t as ModelBrandStack } from "./model-brand-BQlarCIo.js";
3
3
  import { t as ProviderIcon } from "./provider-logo-CPKRPHcS.js";
4
4
  import { t as AgentGraph } from "./AgentGraph-BGWx9hhS.js";
5
- import { s as timelineItems, t as useFollowTail } from "./use-follow-tail-Df965WQi.js";
5
+ import { O as useFollowTail, o as timelineItems } from "./ConversationRowView-C4TXICBT.js";
6
6
  import { Button, SegmentedControl } from "@tangle-network/ui/primitives";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
@@ -427,6 +427,59 @@ function useAgentStream(url, openEventSource, history) {
427
427
  } } : {}
428
428
  };
429
429
  }
430
+ /** One agent's conversation as of a cursor: its stream, the entries said by then, and the sentence shown when none are. */
431
+ function useAgentConversation(url, openEventSource, { cursor = null, startedAt, agentStartMs, silent: why } = {}) {
432
+ const stream = useAgentStream(url, openEventSource);
433
+ const origin = useMemo(() => {
434
+ if (startedAt !== void 0) return startedAt;
435
+ const first = stream.entries[0]?.at;
436
+ return agentStartMs !== void 0 && first !== void 0 ? first - agentStartMs : void 0;
437
+ }, [
438
+ startedAt,
439
+ agentStartMs,
440
+ stream.entries
441
+ ]);
442
+ const shown = cursor === null || origin === void 0 ? stream.entries : stream.entries.filter((entry) => entry.at - origin <= cursor);
443
+ const live = stream.alive && !stream.error && cursor === null;
444
+ const ended = !stream.alive && !stream.error;
445
+ const items = useMemo(() => timelineItems(shown, live), [shown, live]);
446
+ const silent = why || "No conversation was recorded for this agent.";
447
+ return {
448
+ stream,
449
+ shown,
450
+ items,
451
+ live,
452
+ ended,
453
+ note: !url ? silent : cursor !== null && origin === void 0 ? "This conversation has no timestamps to replay at the cursor." : items.length > 0 || live ? void 0 : stream.error ? ended ? stream.error : `Reconnecting… ${stream.error}` : ended ? silent : "No messages yet.",
454
+ silent
455
+ };
456
+ }
457
+ /** The conversation's rows, or the one sentence that stands in for them. */
458
+ function AgentConversationView({ conversation, className }) {
459
+ const { items, live, note, stream, ended } = conversation;
460
+ if (note === void 0) return /* @__PURE__ */ jsx(AgentTimelineColumn, {
461
+ className: className ?? "max-w-[46rem] p-0",
462
+ children: /* @__PURE__ */ jsx(AgentTimeline, {
463
+ items,
464
+ isThinking: live && items.length === 0
465
+ })
466
+ });
467
+ return /* @__PURE__ */ jsx("p", {
468
+ className: "m-0 py-1 text-sm text-muted-foreground",
469
+ "data-stream": stream.error ? "reconnecting" : ended ? "ended" : "empty",
470
+ children: note
471
+ });
472
+ }
473
+ /** The pill that offers the newest output after the reader scrolled up. */
474
+ function NewOutputPill({ unseen, onJump }) {
475
+ if (!unseen) return null;
476
+ return /* @__PURE__ */ jsx("button", {
477
+ type: "button",
478
+ onClick: onJump,
479
+ className: "absolute bottom-14 left-1/2 -translate-x-1/2 rounded-full border border-border bg-background px-3 py-1 text-xs shadow-sm",
480
+ children: "New output"
481
+ });
482
+ }
430
483
  // src/run/agent-inspector.tsx
431
484
  /** Below the tablet breakpoint the inspector is a full-screen sheet over the run, never a squeezed side pane. */
432
485
  const PHONE = "(max-width: 767px)";
@@ -859,16 +912,13 @@ function TraceWorkspace({ trace, streamUrl, openEventSource, events, onTimeChang
859
912
  const { defaultLayout = "tree", ...graphOptions } = agentGraph ?? {};
860
913
  const [graphLayout, setGraphLayout] = useState(defaultLayout);
861
914
  const [cursor, setCursor] = useState(null);
862
- const stream = useAgentStream(selected && streamUrl ? streamUrl(selected) : void 0, openEventSource);
863
- const origin = useMemo(() => {
864
- if (waterfall.startedAt !== void 0) return waterfall.startedAt;
865
- const first = stream.entries[0]?.at;
866
- return agent && first !== void 0 ? first - agent.startMs : void 0;
867
- }, [
868
- waterfall.startedAt,
869
- agent,
870
- stream.entries
871
- ]);
915
+ const conversation = useAgentConversation(selected && streamUrl ? streamUrl(selected) : void 0, openEventSource, {
916
+ cursor,
917
+ startedAt: waterfall.startedAt,
918
+ agentStartMs: agent?.startMs,
919
+ silent: agentId ? transcriptNote?.(agentId) : void 0
920
+ });
921
+ const { shown, items, live, note, silent } = conversation;
872
922
  const graph = useMemo(() => agentGraphAt(trace.spans, byId, cursor, waterfall.startedAt, agentCards, agentGraph?.edges), [
873
923
  trace,
874
924
  byId,
@@ -884,10 +934,6 @@ function TraceWorkspace({ trace, streamUrl, openEventSource, events, onTimeChang
884
934
  value
885
935
  });
886
936
  const graphNow = cursor !== null && waterfall.startedAt !== void 0 ? waterfall.startedAt + cursor : void 0;
887
- const shown = cursor === null || origin === void 0 ? stream.entries : stream.entries.filter((entry) => entry.at - origin <= cursor);
888
- const live = stream.alive && !stream.error && cursor === null;
889
- const ended = !stream.alive && !stream.error;
890
- const items = useMemo(() => timelineItems(shown, live), [shown, live]);
891
937
  const scroller = useRef(null);
892
938
  const { unseen, jump } = useFollowTail(scroller, {
893
939
  identity: showConversation ? selected : void 0,
@@ -899,19 +945,6 @@ function TraceWorkspace({ trace, streamUrl, openEventSource, events, onTimeChang
899
945
  const status = live ? "running" : selectedNode?.status ?? runStatus(agent?.status ?? "unknown");
900
946
  const failure = facts.find((fact) => fact.label === "Failure")?.value ?? (status === "failed" ? selectedNode?.result ?? void 0 : void 0);
901
947
  const said = (text) => !!text && shown.some((entry) => entry.kind === "message" && entry.role === "user" && entry.content.trim() === text.trim());
902
- const silent = agentId && transcriptNote?.(agentId) || "No conversation was recorded for this agent.";
903
- const note = !streamUrl ? silent : cursor !== null && origin === void 0 ? "This conversation has no timestamps to replay at the cursor." : items.length > 0 || live ? void 0 : stream.error ? ended ? stream.error : `Reconnecting… ${stream.error}` : ended ? silent : "No messages yet.";
904
- const conversation = note === void 0 ? /* @__PURE__ */ jsx(AgentTimelineColumn, {
905
- className: "max-w-[46rem] p-0",
906
- children: /* @__PURE__ */ jsx(AgentTimeline, {
907
- items,
908
- isThinking: live && items.length === 0
909
- })
910
- }) : /* @__PURE__ */ jsx("p", {
911
- className: "m-0 py-1 text-sm text-muted-foreground",
912
- "data-stream": stream.error ? "reconnecting" : ended ? "ended" : "empty",
913
- children: note
914
- });
915
948
  const left = /* @__PURE__ */ jsxs(Fragment, { children: [
916
949
  /* @__PURE__ */ jsx("div", {
917
950
  className: cn$1("flex min-h-[320px] min-w-0 flex-1 flex-col", showConversation && mode === "overlay" && "lg:mr-[420px]"),
@@ -939,13 +972,20 @@ function TraceWorkspace({ trace, streamUrl, openEventSource, events, onTimeChang
939
972
  value: graphLayout,
940
973
  onValueChange: setGraphLayout,
941
974
  className: "absolute right-2 top-1 z-10",
942
- options: [{
943
- value: "tree",
944
- label: "Tree"
945
- }, {
946
- value: "hub",
947
- label: "Hub"
948
- }]
975
+ options: [
976
+ {
977
+ value: "grid",
978
+ label: "Grid"
979
+ },
980
+ {
981
+ value: "tree",
982
+ label: "Tree"
983
+ },
984
+ {
985
+ value: "hub",
986
+ label: "Hub"
987
+ }
988
+ ]
949
989
  }), /* @__PURE__ */ jsx(AgentGraph, {
950
990
  ...graphOptions,
951
991
  layout: graphLayout,
@@ -1008,8 +1048,8 @@ function TraceWorkspace({ trace, streamUrl, openEventSource, events, onTimeChang
1008
1048
  onClose: () => select(void 0),
1009
1049
  mode,
1010
1050
  style: mode === "docked" ? { width: split.width } : void 0,
1011
- children: conversation
1051
+ children: /* @__PURE__ */ jsx(AgentConversationView, { conversation })
1012
1052
  })] })]
1013
1053
  });
1014
1054
  }
1015
- export { TraceWaterfall as a, useEventStream as i, foldAgentRows as n, traceSpanMark as o, useAgentStream as r, TraceWorkspace as t };
1055
+ export { useAgentConversation as a, useEventStream as c, NewOutputPill as i, TraceWaterfall as l, usePhone as n, foldAgentRows as o, AgentConversationView as r, useAgentStream as s, TraceWorkspace as t, traceSpanMark as u };
@@ -2,7 +2,8 @@ import { t as cn$1 } from "./utils-BER_bdgE.js";
2
2
  import { t as revealInScroller } from "./reveal-in-scroller-CzKwuqCG.js";
3
3
  import { t as VirtualList } from "./VirtualList-DcSGbEtA.js";
4
4
  import { a as PortsList } from "./dashboard-C7QJJw7-.js";
5
- import { n as TerminalView } from "./terminal-nUCznZRj.js";
5
+ import { n as TerminalView } from "./terminal-view-nUCznZRj.js";
6
+ import "./terminal.js";
6
7
  import { n as buildUnifiedPatch, r as computeDiffStats, t as DiffView } from "./diff-view-B9mNeTLF.js";
7
8
  import { t as CodeView } from "./code-view-BlhCS1SD.js";
8
9
  import { n as PreviewView } from "./embedded-app-view-DXsoPale.js";
package/dist/workbench.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as GitStatusBadge, i as DiffStatsBadge, n as ChangesPane, o as PanelHeader, r as SandboxArtifactPane, s as PillTabs, t as JsonView } from "./workbench-D0ALR40M.js";
1
+ import { a as GitStatusBadge, i as DiffStatsBadge, n as ChangesPane, o as PanelHeader, r as SandboxArtifactPane, s as PillTabs, t as JsonView } from "./workbench-CugraIbl.js";
2
2
  import { a as CodeSurface, i as CODE_THEME, n as buildUnifiedPatch, r as computeDiffStats, t as DiffView } from "./diff-view-B9mNeTLF.js";
3
3
  import { n as FileBreadcrumb, t as CodeView } from "./code-view-BlhCS1SD.js";
4
4
  import { n as PreviewView, t as EmbeddedAppView } from "./embedded-app-view-DXsoPale.js";