@tangle-network/sandbox-ui 0.138.2 → 0.139.1
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.
- package/dist/{node-output-udnwhShN.js → AgentGraph-Beld8p6x.js} +1021 -204
- package/dist/AgentGraph-DL-QLjkw.d.ts +132 -0
- package/dist/AgentGraphCanvas-BHihTTsl.js +1203 -0
- package/dist/{WorkflowGraph-DXuWXMw9.js → WorkflowGraph-CbIFufIK.js} +4 -56
- package/dist/{chat-BYTVLZQW.js → chat-4OZD23RA.js} +1 -1
- package/dist/chat.js +1 -1
- package/dist/elk-loader-Dl9S7jQk.js +12 -0
- package/dist/globals.css +114 -5
- package/dist/{index-C5h5T0nb.d.ts → index-D6gtWRHq.d.ts} +7 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/node-output-DlySTwxr.js +178 -0
- package/dist/{run-CliTxkfw.js → run-CC-DESx8.js} +79 -15
- package/dist/run.d.ts +1 -1
- package/dist/run.js +1 -1
- package/dist/styles.css +114 -5
- package/dist/workflows.d.ts +3 -2
- package/dist/workflows.js +3 -82
- package/package.json +7 -8
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Where every agent of a multi-agent run sits on the `AgentGraph` canvas.
|
|
4
|
+
*
|
|
5
|
+
* Only SPAWN edges shape the layout: they make the run's tree (a manager and
|
|
6
|
+
* the workers it started). Message and delegation edges are drawn over the
|
|
7
|
+
* finished layout and never move a card.
|
|
8
|
+
*
|
|
9
|
+
* A parent that spawned many workers which spawned nobody would, laid out as a
|
|
10
|
+
* plain tree, put all of them in one row: sixteen 200px cards side by side is a
|
|
11
|
+
* 3,000px strip that a 360px pane can only show as specks. Those leaf workers
|
|
12
|
+
* are packed into a grid inside one frame instead, reached by one edge from
|
|
13
|
+
* their parent, and the grid's column count is chosen for the canvas it is
|
|
14
|
+
* shown in ({@link pickAgentLayout}). Workers that spawned workers of their own
|
|
15
|
+
* stay tree nodes, so the depth of the run is still visible.
|
|
16
|
+
*
|
|
17
|
+
* Positions come from ELK's layered algorithm (the optional `elkjs` peer,
|
|
18
|
+
* shared with `WorkflowGraph` through `loadElk`). Without it, a row-per-depth
|
|
19
|
+
* layout keeps the graph drawable.
|
|
20
|
+
*/
|
|
21
|
+
type AgentGraphStatus = "running" | "waiting" |
|
|
22
|
+
/** Blocked on a person: drawn amber, named in the header. */
|
|
23
|
+
"needs-you" | "succeeded" | "failed" | "stopped" | "idle" | "unknown";
|
|
24
|
+
interface AgentGraphNode {
|
|
25
|
+
id: string;
|
|
26
|
+
/** The agent's name, e.g. "root", "memscale". */
|
|
27
|
+
label: string;
|
|
28
|
+
/** What it was started as, e.g. "manager", "v6-battery". */
|
|
29
|
+
role?: string | null;
|
|
30
|
+
/** The coding harness it runs in, e.g. "opencode", "claude-code", "codex". */
|
|
31
|
+
harness?: string | null;
|
|
32
|
+
/** The model it runs, e.g. "glm-5.3-flash"; its brand mark identifies the card. */
|
|
33
|
+
model?: string | null;
|
|
34
|
+
status: AgentGraphStatus;
|
|
35
|
+
/** What it is doing now, or did last — one line. */
|
|
36
|
+
turn?: string | null;
|
|
37
|
+
costUsd?: number | null;
|
|
38
|
+
tokens?: number | null;
|
|
39
|
+
/** Live cards: what it is doing now, from its real state; loops the card's figure. */
|
|
40
|
+
activity?: AgentGraphActivity | null;
|
|
41
|
+
/** Live cards: its latest tool calls or events, oldest first; the card shows the last three. */
|
|
42
|
+
events?: readonly AgentGraphEvent[] | null;
|
|
43
|
+
/** Live cards: the reasoning effort it runs at, e.g. "high". */
|
|
44
|
+
effort?: string | null;
|
|
45
|
+
/** Live cards: epoch ms it was spawned, for its time alive. */
|
|
46
|
+
startedAt?: number | null;
|
|
47
|
+
/** Live cards: commits it shipped. */
|
|
48
|
+
commits?: number | null;
|
|
49
|
+
/** Live cards: a settled agent's result, shown on its chip, e.g. "rc2 · 14 commits". */
|
|
50
|
+
result?: string | null;
|
|
51
|
+
}
|
|
52
|
+
type AgentGraphActivity = "thinking" | "reading" | "building" | "proving" | "writing" | "waiting" | "restarting";
|
|
53
|
+
interface AgentGraphEvent {
|
|
54
|
+
id: string;
|
|
55
|
+
/** One line, e.g. "bash cargo test -p prover". */
|
|
56
|
+
label: string;
|
|
57
|
+
at?: number;
|
|
58
|
+
}
|
|
59
|
+
type AgentGraphEdgeKind = "spawn" | "message" | "delegation";
|
|
60
|
+
interface AgentGraphEdge {
|
|
61
|
+
from: string;
|
|
62
|
+
to: string;
|
|
63
|
+
kind: AgentGraphEdgeKind;
|
|
64
|
+
/** How many times it happened; a badge shows counts above one. */
|
|
65
|
+
count?: number;
|
|
66
|
+
label?: string;
|
|
67
|
+
}
|
|
68
|
+
type AgentGraphDirection = "TB" | "LR";
|
|
69
|
+
/** A tool or service an agent calls: drawn as an outer node with its brand mark. */
|
|
70
|
+
interface AgentGraphTool {
|
|
71
|
+
id: string;
|
|
72
|
+
label: string;
|
|
73
|
+
/** Brand id for `ProviderIcon` ("github", "slack", "postgres"…). */
|
|
74
|
+
provider?: string | null;
|
|
75
|
+
/** One line under the name in its popover, e.g. "Postgres, read-only". */
|
|
76
|
+
detail?: string | null;
|
|
77
|
+
}
|
|
78
|
+
type AgentGraphCallKind = "call" | "answer" | "needs-you" | "failed";
|
|
79
|
+
/** One recorded call between two nodes ("you", an agent id or a tool id). */
|
|
80
|
+
interface AgentGraphCall {
|
|
81
|
+
id: string;
|
|
82
|
+
from: string;
|
|
83
|
+
to: string;
|
|
84
|
+
kind: AgentGraphCallKind;
|
|
85
|
+
/** What was asked or answered, one line. */
|
|
86
|
+
label?: string | null;
|
|
87
|
+
/** Epoch ms. */
|
|
88
|
+
startedAt: number;
|
|
89
|
+
/** Absent while it runs. */
|
|
90
|
+
durationMs?: number | null;
|
|
91
|
+
}
|
|
92
|
+
interface AgentGraphProps {
|
|
93
|
+
nodes: readonly AgentGraphNode[];
|
|
94
|
+
/** `spawn` edges shape the tree; `message` and `delegation` edges are drawn
|
|
95
|
+
* over it as dashed curves and never move a card. */
|
|
96
|
+
edges: readonly AgentGraphEdge[];
|
|
97
|
+
selectedId?: string | null;
|
|
98
|
+
onSelect?: (id: string) => void;
|
|
99
|
+
/** Tree direction. Default `TB` (root at the top). */
|
|
100
|
+
direction?: AgentGraphDirection;
|
|
101
|
+
/** Sizes the canvas; the graph fills it. Give it a height. */
|
|
102
|
+
className?: string;
|
|
103
|
+
/** Shown instead of the canvas when there are no agents. */
|
|
104
|
+
emptyState?: ReactNode;
|
|
105
|
+
/**
|
|
106
|
+
* `tree` (default) lays out a spawn tree of cards for large runs. `hub` draws
|
|
107
|
+
* the run around its orchestrator: You, the agents, the tools they call, and
|
|
108
|
+
* each call travelling along its edge in its kind's colour.
|
|
109
|
+
*/
|
|
110
|
+
layout?: "tree" | "hub";
|
|
111
|
+
/** Hub layout: the tools and services agents call, drawn as outer nodes. */
|
|
112
|
+
tools?: readonly AgentGraphTool[];
|
|
113
|
+
/** Hub layout: recorded calls between nodes, newest last. They colour and animate edges and fill popovers. */
|
|
114
|
+
calls?: readonly AgentGraphCall[];
|
|
115
|
+
/** Hub layout: draw the person who asked as "You". */
|
|
116
|
+
you?: {
|
|
117
|
+
label?: string;
|
|
118
|
+
summary?: string;
|
|
119
|
+
} | boolean;
|
|
120
|
+
/** Hub layout and live cards: epoch ms to draw at (a replay position); defaults to now, ticking. */
|
|
121
|
+
now?: number;
|
|
122
|
+
/** Hub layout: the header title. Default "Agent graph". */
|
|
123
|
+
title?: ReactNode;
|
|
124
|
+
/**
|
|
125
|
+
* Tree layout: live cards for a running run. Each card loops a small figure of the agent's `activity`, shows its
|
|
126
|
+
* thinking line (`turn`) and last three `events` as they arrive, its model, effort, time alive and commits; a settled
|
|
127
|
+
* agent shrinks to a chip with its `result`, and a new spawn grows in. Cards keep a fixed size, so updates never move one.
|
|
128
|
+
*/
|
|
129
|
+
live?: 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 };
|