@tangle-network/sandbox-ui 2.0.10 → 2.0.12

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,132 +0,0 @@
1
- import { ReactNode } from "react";
2
- /**
3
- * Stable desktop geometry for AgentGraph. Spawn edges determine the tree and
4
- * packed leaf groups; message and delegation edges never move cards.
5
- * ELK lays out candidate column counts; a row-per-depth fallback keeps the
6
- * graph usable without that optional peer. Narrow containers use Canvas's list.
7
- */
8
- type AgentGraphStatus = "running" | "waiting" |
9
- /** Blocked on a person: drawn amber, named in the header. */
10
- "needs-you" | "succeeded" | "failed" | "stopped" | "idle" | "unknown";
11
- interface AgentGraphNode {
12
- id: string;
13
- /** The agent's name, e.g. "root", "memscale". */
14
- label: string;
15
- /** What it was started as, e.g. "manager", "v6-battery". */
16
- role?: string | null;
17
- /** The coding harness it runs in, e.g. "opencode", "claude-code", "codex". */
18
- harness?: string | null;
19
- /** The model it runs, e.g. "glm-5.3-flash"; its brand mark identifies the card. */
20
- model?: string | null;
21
- status: AgentGraphStatus;
22
- /** What it is doing now, or did last — one line. */
23
- turn?: string | null;
24
- costUsd?: number | null;
25
- tokens?: number | null;
26
- /** Recorded metrics with units; retained in pointer and keyboard detail cards. */
27
- facts?: readonly {
28
- label: string;
29
- value: string;
30
- }[];
31
- /** Live cards: what it is doing now, from its real state; the card carries it as `data-activity` for hosts to style. */
32
- activity?: AgentGraphActivity | null;
33
- /** Live cards: its latest tool calls or events, oldest first; the card shows the last three. */
34
- events?: readonly AgentGraphEvent[] | null;
35
- /** Recorded activity and full-stream median, when the visible event tail is bounded. Epoch milliseconds. */
36
- lastActivityAt?: number;
37
- /** Median interval between recorded events, in milliseconds. */
38
- medianEventGapMs?: number;
39
- /** Live cards: the reasoning effort it runs at, e.g. "high". */
40
- effort?: string | null;
41
- /** Live cards: epoch ms it was spawned, for its time alive. */
42
- startedAt?: number | null;
43
- /** Live cards: commits it shipped. */
44
- commits?: number | null;
45
- /** Live cards: a settled agent's result in its compact row, e.g. "rc2 · 14 commits". */
46
- result?: string | null;
47
- }
48
- type AgentGraphActivity = "thinking" | "reading" | "building" | "proving" | "writing" | "waiting" | "restarting";
49
- interface AgentGraphEvent {
50
- id: string;
51
- /** One line, e.g. "bash cargo test -p prover". */
52
- label: string;
53
- at?: number;
54
- }
55
- type AgentGraphEdgeKind = "spawn" | "message" | "delegation";
56
- interface AgentGraphEdge {
57
- from: string;
58
- to: string;
59
- kind: AgentGraphEdgeKind;
60
- /** How many times it happened; a badge shows counts above one. */
61
- count?: number;
62
- label?: string;
63
- }
64
- type AgentGraphDirection = "TB" | "LR";
65
- /** A tool or service an agent calls: drawn as an outer node with its brand mark. */
66
- interface AgentGraphTool {
67
- id: string;
68
- label: string;
69
- /** Brand id for `ProviderIcon` ("github", "slack", "postgres"…). */
70
- provider?: string | null;
71
- /** One line under the name in its popover, e.g. "Postgres, read-only". */
72
- detail?: string | null;
73
- }
74
- type AgentGraphCallKind = "call" | "answer" | "needs-you" | "failed";
75
- /** One recorded call between two nodes ("you", an agent id or a tool id). */
76
- interface AgentGraphCall {
77
- id: string;
78
- from: string;
79
- to: string;
80
- kind: AgentGraphCallKind;
81
- /** What was asked or answered, one line. */
82
- label?: string | null;
83
- /** Epoch ms. */
84
- startedAt: number;
85
- /** Absent while it runs. */
86
- durationMs?: number | null;
87
- }
88
- interface AgentGraphProps {
89
- nodes: readonly AgentGraphNode[];
90
- /** `spawn` edges shape the tree; `message` and `delegation` edges are drawn
91
- * over it as dashed curves and never move a card. */
92
- edges: readonly AgentGraphEdge[];
93
- selectedId?: string | null;
94
- onSelect?: (id: string) => void;
95
- /** Tree direction. Default `TB` (root at the top). */
96
- direction?: AgentGraphDirection;
97
- /** Sizes the canvas; the graph fills it. Give it a height. */
98
- className?: string;
99
- /** Shown instead of the canvas when there are no agents. */
100
- emptyState?: ReactNode;
101
- /**
102
- * `tree` (default) lays out a spawn tree of cards for large runs. `hub` draws
103
- * the run around its orchestrator: You, the agents, the tools they call, and
104
- * each call travelling along its edge in its kind's colour.
105
- */
106
- layout?: "tree" | "hub";
107
- /** Hub tools/services. Omit unreported inventory; [] records no tools. */
108
- tools?: readonly AgentGraphTool[];
109
- /** Hub calls, newest last. Omit unreported history; [] records no calls. They colour edges and fill popovers. */
110
- calls?: readonly AgentGraphCall[];
111
- /** Hub layout: draw the person who asked as "You". */
112
- you?: {
113
- label?: string;
114
- summary?: string;
115
- } | boolean;
116
- /** Hub layout and live cards: epoch ms to draw at (a replay position); defaults to now, ticking. */
117
- now?: number;
118
- /** Hub layout: the header title. Default "Agent graph". */
119
- title?: ReactNode;
120
- /**
121
- * Tree layout: readable task summaries, the latest three events and model/accounting details. Desktop slots stay
122
- * fixed through status updates; completed results compact while failures retain their evidence. Phones preserve
123
- * their initial attention order. Only the running dot breathes; commands update without routine sliding.
124
- */
125
- live?: boolean;
126
- /** Host tool identity, such as charts' toolGlyph(event.label). Core graphs need no charts dependency. */
127
- renderEventIcon?: (event: AgentGraphEvent) => ReactNode;
128
- /** Live tree activity; false when a shared workspace already supplies its strip. */
129
- showLatestEvents?: boolean;
130
- }
131
- declare function AgentGraph(props: AgentGraphProps): import("react").JSX.Element;
132
- export { AgentGraphTool as a, AgentGraphEdge as c, AgentGraphNode as d, AgentGraphStatus as f, AgentGraphCallKind as i, AgentGraphEdgeKind as l, AgentGraphProps as n, AgentGraphActivity as o, AgentGraphCall as r, AgentGraphDirection as s, AgentGraph as t, AgentGraphEvent as u };