@tangle-network/sandbox-ui 0.72.0 → 0.74.0
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/WorkflowGraph-64XJBIW2.js +555 -0
- package/dist/{chunk-34F66QTV.js → chunk-VXGI2XUK.js} +89 -54
- package/dist/globals.css +108 -9
- package/dist/styles.css +108 -9
- package/dist/workflows.d.ts +38 -11
- package/dist/workflows.js +5 -5
- package/package.json +1 -1
- package/dist/WorkflowGraph-M5ZOY43R.js +0 -328
|
@@ -15,19 +15,21 @@ function providerLabel(provider) {
|
|
|
15
15
|
|
|
16
16
|
// src/workflows/model.ts
|
|
17
17
|
import { parse as parseYaml } from "yaml";
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var CARD_CHROME =
|
|
22
|
-
var
|
|
18
|
+
var NODE_W = 244;
|
|
19
|
+
var RANK_SEP = 76;
|
|
20
|
+
var CROSS_SEP = 22;
|
|
21
|
+
var CARD_CHROME = 22;
|
|
22
|
+
var HEADER_ROW = 30;
|
|
23
23
|
var TEXT_ROW = 20;
|
|
24
|
-
var META_ROW =
|
|
25
|
-
var PREVIEW_ROW =
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
var META_ROW = 46;
|
|
25
|
+
var PREVIEW_ROW = 36;
|
|
26
|
+
var PROGRESS_ROW = 26;
|
|
27
|
+
var COMPACT_NODE_SIZE = { width: 240, height: 64 };
|
|
28
|
+
function nodeHeight(data, withRunState) {
|
|
29
|
+
let h = CARD_CHROME + HEADER_ROW;
|
|
28
30
|
if (data.subtitle) h += TEXT_ROW;
|
|
29
31
|
if (withRunState || data.model) h += META_ROW;
|
|
30
|
-
if (withRunState) h += PREVIEW_ROW;
|
|
32
|
+
if (withRunState) h += PREVIEW_ROW + PROGRESS_ROW;
|
|
31
33
|
if (data.provider) h += TEXT_ROW;
|
|
32
34
|
return h;
|
|
33
35
|
}
|
|
@@ -65,7 +67,6 @@ function describeActionBase(action) {
|
|
|
65
67
|
kind,
|
|
66
68
|
subtitle: str(cfg.template),
|
|
67
69
|
detail: pickDetail(cfg, ["template", "size", "region"]),
|
|
68
|
-
hasBranches: false,
|
|
69
70
|
isRoot: false,
|
|
70
71
|
tone: "action"
|
|
71
72
|
};
|
|
@@ -78,7 +79,6 @@ function describeActionBase(action) {
|
|
|
78
79
|
path,
|
|
79
80
|
provider: path?.split(".")[0],
|
|
80
81
|
detail: pickDetail(cfg, ["path"]),
|
|
81
|
-
hasBranches: false,
|
|
82
82
|
isRoot: false,
|
|
83
83
|
tone: "action"
|
|
84
84
|
};
|
|
@@ -90,7 +90,6 @@ function describeActionBase(action) {
|
|
|
90
90
|
kind,
|
|
91
91
|
subtitle: url ? urlHost(url) : void 0,
|
|
92
92
|
detail: pickDetail(cfg, ["url"]),
|
|
93
|
-
hasBranches: false,
|
|
94
93
|
isRoot: false,
|
|
95
94
|
tone: "action"
|
|
96
95
|
};
|
|
@@ -99,7 +98,9 @@ function describeActionBase(action) {
|
|
|
99
98
|
return {
|
|
100
99
|
title: "Run agent",
|
|
101
100
|
kind,
|
|
102
|
-
|
|
101
|
+
// The prompt says what the agent does; the model is shown as its own
|
|
102
|
+
// chip, so it's not duplicated here.
|
|
103
|
+
subtitle: str(cfg.prompt) ?? str(cfg.profile),
|
|
103
104
|
model: str(cfg.model),
|
|
104
105
|
detail: pickDetail(cfg, [
|
|
105
106
|
"profile",
|
|
@@ -108,7 +109,6 @@ function describeActionBase(action) {
|
|
|
108
109
|
"size",
|
|
109
110
|
"prompt"
|
|
110
111
|
]),
|
|
111
|
-
hasBranches: false,
|
|
112
112
|
isRoot: false,
|
|
113
113
|
tone: "action"
|
|
114
114
|
};
|
|
@@ -119,7 +119,6 @@ function describeActionBase(action) {
|
|
|
119
119
|
kind,
|
|
120
120
|
subtitle: `${branches.length} branch${branches.length === 1 ? "" : "es"}`,
|
|
121
121
|
badge: branches.length > 0 ? `\xD7${branches.length}` : void 0,
|
|
122
|
-
hasBranches: branches.length > 0,
|
|
123
122
|
isRoot: false,
|
|
124
123
|
tone: "structural"
|
|
125
124
|
};
|
|
@@ -131,7 +130,6 @@ function describeActionBase(action) {
|
|
|
131
130
|
subtitle: typeof cfg.items === "string" ? cfg.items : "list",
|
|
132
131
|
detail: pickDetail(cfg, ["items"]),
|
|
133
132
|
// Only fans out when a `do` template is actually present.
|
|
134
|
-
hasBranches: Boolean(cfg.do),
|
|
135
133
|
isRoot: false,
|
|
136
134
|
tone: "structural"
|
|
137
135
|
};
|
|
@@ -139,7 +137,6 @@ function describeActionBase(action) {
|
|
|
139
137
|
return {
|
|
140
138
|
title: kind ? kind : "Action",
|
|
141
139
|
kind: kind ?? "action",
|
|
142
|
-
hasBranches: false,
|
|
143
140
|
isRoot: false,
|
|
144
141
|
tone: "action"
|
|
145
142
|
};
|
|
@@ -198,7 +195,6 @@ function describeTrigger(on) {
|
|
|
198
195
|
kind: "provider_event",
|
|
199
196
|
subtitle,
|
|
200
197
|
provider: connection,
|
|
201
|
-
hasBranches: false,
|
|
202
198
|
isRoot: true,
|
|
203
199
|
tone: "trigger"
|
|
204
200
|
},
|
|
@@ -214,7 +210,6 @@ function describeTrigger(on) {
|
|
|
214
210
|
title: "Schedule",
|
|
215
211
|
kind: "schedule",
|
|
216
212
|
subtitle: cron ? tz ? `${cron} (${tz})` : cron : void 0,
|
|
217
|
-
hasBranches: false,
|
|
218
213
|
isRoot: true,
|
|
219
214
|
tone: "trigger"
|
|
220
215
|
},
|
|
@@ -226,15 +221,58 @@ function describeTrigger(on) {
|
|
|
226
221
|
{
|
|
227
222
|
title: "Trigger",
|
|
228
223
|
kind: "trigger",
|
|
229
|
-
hasBranches: false,
|
|
230
224
|
isRoot: true,
|
|
231
225
|
tone: "trigger"
|
|
232
226
|
},
|
|
233
227
|
asRecord(kind ? rec[kind] : void 0)
|
|
234
228
|
);
|
|
235
229
|
}
|
|
230
|
+
function layoutLayers(nodes, direction) {
|
|
231
|
+
const isLR = direction === "LR";
|
|
232
|
+
const mainSize = (n) => isLR ? n.width : n.height;
|
|
233
|
+
const crossSize = (n) => isLR ? n.height : n.width;
|
|
234
|
+
const byRank = /* @__PURE__ */ new Map();
|
|
235
|
+
for (const n of nodes) {
|
|
236
|
+
const arr = byRank.get(n.rank);
|
|
237
|
+
if (arr) arr.push(n);
|
|
238
|
+
else byRank.set(n.rank, [n]);
|
|
239
|
+
}
|
|
240
|
+
const ranks = [...byRank.keys()].sort((a, b) => a - b);
|
|
241
|
+
const mainStart = /* @__PURE__ */ new Map();
|
|
242
|
+
let cursor = 0;
|
|
243
|
+
for (const r of ranks) {
|
|
244
|
+
mainStart.set(r, cursor);
|
|
245
|
+
cursor += Math.max(...byRank.get(r).map(mainSize)) + RANK_SEP;
|
|
246
|
+
}
|
|
247
|
+
const out = [];
|
|
248
|
+
for (const r of ranks) {
|
|
249
|
+
const layer = byRank.get(r);
|
|
250
|
+
const extent = Math.max(...layer.map(mainSize));
|
|
251
|
+
const span = layer.reduce((s, n) => s + crossSize(n), 0) + CROSS_SEP * (layer.length - 1);
|
|
252
|
+
let cross = -span / 2;
|
|
253
|
+
for (const n of layer) {
|
|
254
|
+
const main = mainStart.get(r) + (extent - mainSize(n)) / 2;
|
|
255
|
+
out.push({
|
|
256
|
+
id: n.id,
|
|
257
|
+
position: isLR ? { x: main, y: cross } : { x: cross, y: main },
|
|
258
|
+
width: n.width,
|
|
259
|
+
height: n.height,
|
|
260
|
+
data: n.data
|
|
261
|
+
});
|
|
262
|
+
cross += crossSize(n) + CROSS_SEP;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
const minX = Math.min(...out.map((n) => n.position.x));
|
|
266
|
+
const minY = Math.min(...out.map((n) => n.position.y));
|
|
267
|
+
for (const n of out) {
|
|
268
|
+
n.position = { x: n.position.x - minX, y: n.position.y - minY };
|
|
269
|
+
}
|
|
270
|
+
return out;
|
|
271
|
+
}
|
|
236
272
|
function buildWorkflowGraph(yaml, options) {
|
|
237
273
|
const reserveRunState = options?.reserveRunState ?? false;
|
|
274
|
+
const direction = options?.direction ?? "LR";
|
|
275
|
+
const measure = options?.measure;
|
|
238
276
|
if (!yaml || yaml.trim() === "") {
|
|
239
277
|
return { nodes: [], edges: [], error: "No definition" };
|
|
240
278
|
}
|
|
@@ -249,61 +287,58 @@ function buildWorkflowGraph(yaml, options) {
|
|
|
249
287
|
if (!def.on && actions.length === 0) {
|
|
250
288
|
return { nodes: [], edges: [], error: "Empty workflow" };
|
|
251
289
|
}
|
|
252
|
-
const
|
|
290
|
+
const logical = [];
|
|
253
291
|
const edges = [];
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
edges.push({
|
|
258
|
-
id: `${source}->${target}`,
|
|
259
|
-
source,
|
|
260
|
-
target,
|
|
261
|
-
sourceHandle: branch ? "branch" : "out"
|
|
262
|
-
});
|
|
292
|
+
const addNode = (id, data, rank2, withRunState) => {
|
|
293
|
+
const dims = measure ? measure(data, withRunState) : { width: NODE_W, height: nodeHeight(data, withRunState) };
|
|
294
|
+
logical.push({ id, data, width: dims.width, height: dims.height, rank: rank2 });
|
|
263
295
|
};
|
|
296
|
+
const addEdge = (source, target, kind) => {
|
|
297
|
+
edges.push({ id: `${source}->${target}`, source, target, kind });
|
|
298
|
+
};
|
|
299
|
+
let rank = 0;
|
|
300
|
+
let prevExits = [];
|
|
301
|
+
const branchLeafIds = /* @__PURE__ */ new Set();
|
|
264
302
|
if (def.on) {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
y += estimateNodeHeight(data, false) + NODE_GAP;
|
|
303
|
+
addNode("trigger", describeTrigger(def.on), rank, false);
|
|
304
|
+
prevExits = ["trigger"];
|
|
305
|
+
rank += 1;
|
|
269
306
|
}
|
|
270
307
|
actions.forEach((action, i) => {
|
|
271
308
|
const id = `a${i}`;
|
|
272
309
|
const data = describeAction(action);
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
310
|
+
if (i === 0 && !def.on) data.isRoot = true;
|
|
311
|
+
addNode(id, data, rank, reserveRunState);
|
|
312
|
+
for (const from of prevExits) {
|
|
313
|
+
addEdge(from, id, branchLeafIds.has(from) ? "join" : "spine");
|
|
314
|
+
}
|
|
277
315
|
const rec = asRecord(action);
|
|
278
316
|
const children = "parallel" in rec ? Array.isArray(asRecord(rec.parallel).branches) ? asRecord(rec.parallel).branches : [] : "foreach" in rec ? (
|
|
279
317
|
// A foreach with no `do` template has no child to render.
|
|
280
318
|
[asRecord(rec.foreach).do].filter(Boolean)
|
|
281
319
|
) : [];
|
|
282
320
|
if (children.length > 0) {
|
|
283
|
-
|
|
284
|
-
|
|
321
|
+
const branchRank = rank + 1;
|
|
322
|
+
const branchIds = [];
|
|
285
323
|
children.forEach((child, j) => {
|
|
286
324
|
const cid = `${id}-b${j}`;
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
data: childData
|
|
292
|
-
});
|
|
293
|
-
addEdge(id, cid, true);
|
|
294
|
-
const childHeight = estimateNodeHeight(childData, reserveRunState);
|
|
295
|
-
by += childHeight + BRANCH_GAP;
|
|
296
|
-
branchStackHeight += childHeight + BRANCH_GAP;
|
|
325
|
+
addNode(cid, describeAction(child), branchRank, reserveRunState);
|
|
326
|
+
addEdge(id, cid, "fork");
|
|
327
|
+
branchIds.push(cid);
|
|
328
|
+
branchLeafIds.add(cid);
|
|
297
329
|
});
|
|
298
|
-
|
|
330
|
+
prevExits = branchIds;
|
|
331
|
+
rank = branchRank + 1;
|
|
299
332
|
} else {
|
|
300
|
-
|
|
333
|
+
prevExits = [id];
|
|
334
|
+
rank += 1;
|
|
301
335
|
}
|
|
302
336
|
});
|
|
303
|
-
return { nodes, edges, error: null };
|
|
337
|
+
return { nodes: layoutLayers(logical, direction), edges, error: null };
|
|
304
338
|
}
|
|
305
339
|
|
|
306
340
|
export {
|
|
307
341
|
providerLabel,
|
|
342
|
+
COMPACT_NODE_SIZE,
|
|
308
343
|
buildWorkflowGraph
|
|
309
344
|
};
|
package/dist/globals.css
CHANGED
|
@@ -697,6 +697,9 @@
|
|
|
697
697
|
.\!h-2 {
|
|
698
698
|
height: calc(var(--spacing) * 2) !important;
|
|
699
699
|
}
|
|
700
|
+
.h-0\.5 {
|
|
701
|
+
height: calc(var(--spacing) * 0.5);
|
|
702
|
+
}
|
|
700
703
|
.h-1 {
|
|
701
704
|
height: calc(var(--spacing) * 1);
|
|
702
705
|
}
|
|
@@ -772,12 +775,24 @@
|
|
|
772
775
|
.h-\[18px\] {
|
|
773
776
|
height: 18px;
|
|
774
777
|
}
|
|
778
|
+
.h-\[24rem\] {
|
|
779
|
+
height: 24rem;
|
|
780
|
+
}
|
|
781
|
+
.h-\[28rem\] {
|
|
782
|
+
height: 28rem;
|
|
783
|
+
}
|
|
784
|
+
.h-\[32rem\] {
|
|
785
|
+
height: 32rem;
|
|
786
|
+
}
|
|
775
787
|
.h-\[70vh\] {
|
|
776
788
|
height: 70vh;
|
|
777
789
|
}
|
|
778
790
|
.h-\[72\%\] {
|
|
779
791
|
height: 72%;
|
|
780
792
|
}
|
|
793
|
+
.h-\[220px\] {
|
|
794
|
+
height: 220px;
|
|
795
|
+
}
|
|
781
796
|
.h-\[380px\] {
|
|
782
797
|
height: 380px;
|
|
783
798
|
}
|
|
@@ -1072,9 +1087,6 @@
|
|
|
1072
1087
|
.w-\[88\%\] {
|
|
1073
1088
|
width: 88%;
|
|
1074
1089
|
}
|
|
1075
|
-
.w-\[240px\] {
|
|
1076
|
-
width: 240px;
|
|
1077
|
-
}
|
|
1078
1090
|
.w-\[268px\] {
|
|
1079
1091
|
width: 268px;
|
|
1080
1092
|
}
|
|
@@ -1114,6 +1126,9 @@
|
|
|
1114
1126
|
.w-\[900px\] {
|
|
1115
1127
|
width: 900px;
|
|
1116
1128
|
}
|
|
1129
|
+
.w-\[1000px\] {
|
|
1130
|
+
width: 1000px;
|
|
1131
|
+
}
|
|
1117
1132
|
.w-\[min\(88vw\,24rem\)\] {
|
|
1118
1133
|
width: min(88vw, 24rem);
|
|
1119
1134
|
}
|
|
@@ -1994,12 +2009,6 @@
|
|
|
1994
2009
|
border-color: color-mix(in oklab, var(--color-primary) 50%, transparent);
|
|
1995
2010
|
}
|
|
1996
2011
|
}
|
|
1997
|
-
.border-primary\/60 {
|
|
1998
|
-
border-color: color-mix(in srgb, hsl(var(--primary)) 60%, transparent);
|
|
1999
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
2000
|
-
border-color: color-mix(in oklab, var(--color-primary) 60%, transparent);
|
|
2001
|
-
}
|
|
2002
|
-
}
|
|
2003
2012
|
.border-red-500 {
|
|
2004
2013
|
border-color: var(--color-red-500);
|
|
2005
2014
|
}
|
|
@@ -5116,6 +5125,11 @@
|
|
|
5116
5125
|
grid-column: span 8 / span 8;
|
|
5117
5126
|
}
|
|
5118
5127
|
}
|
|
5128
|
+
.xl\:grid-cols-2 {
|
|
5129
|
+
@media (width >= 80rem) {
|
|
5130
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
5131
|
+
}
|
|
5132
|
+
}
|
|
5119
5133
|
.xl\:grid-cols-4 {
|
|
5120
5134
|
@media (width >= 80rem) {
|
|
5121
5135
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
@@ -5991,6 +6005,91 @@
|
|
|
5991
6005
|
[data-sandbox-theme="vault"] .glow-primary:hover {
|
|
5992
6006
|
box-shadow: none;
|
|
5993
6007
|
}
|
|
6008
|
+
.tangle-prose {
|
|
6009
|
+
color: var(--text-primary);
|
|
6010
|
+
line-height: 1.7;
|
|
6011
|
+
}
|
|
6012
|
+
.tangle-prose :where(p, ul, ol) {
|
|
6013
|
+
margin: 0;
|
|
6014
|
+
}
|
|
6015
|
+
.tangle-prose > * + * {
|
|
6016
|
+
margin-top: 0.85em;
|
|
6017
|
+
}
|
|
6018
|
+
.tangle-prose h1, .tangle-prose h2, .tangle-prose h3, .tangle-prose h4 {
|
|
6019
|
+
font-weight: 600;
|
|
6020
|
+
line-height: 1.3;
|
|
6021
|
+
margin-top: 1.4em;
|
|
6022
|
+
margin-bottom: 0.5em;
|
|
6023
|
+
color: var(--text-primary);
|
|
6024
|
+
}
|
|
6025
|
+
.tangle-prose h1 {
|
|
6026
|
+
font-size: 1.4em;
|
|
6027
|
+
}
|
|
6028
|
+
.tangle-prose h2 {
|
|
6029
|
+
font-size: 1.25em;
|
|
6030
|
+
}
|
|
6031
|
+
.tangle-prose h3 {
|
|
6032
|
+
font-size: 1.1em;
|
|
6033
|
+
}
|
|
6034
|
+
.tangle-prose ul, .tangle-prose ol {
|
|
6035
|
+
padding-left: 1.4em;
|
|
6036
|
+
}
|
|
6037
|
+
.tangle-prose li {
|
|
6038
|
+
margin: 0.25em 0;
|
|
6039
|
+
}
|
|
6040
|
+
.tangle-prose li > ul, .tangle-prose li > ol {
|
|
6041
|
+
margin-top: 0.25em;
|
|
6042
|
+
}
|
|
6043
|
+
.tangle-prose a {
|
|
6044
|
+
color: var(--accent-text);
|
|
6045
|
+
text-decoration: underline;
|
|
6046
|
+
text-underline-offset: 2px;
|
|
6047
|
+
}
|
|
6048
|
+
.tangle-prose blockquote {
|
|
6049
|
+
border-left: 2px solid var(--border-default);
|
|
6050
|
+
padding-left: 0.9em;
|
|
6051
|
+
color: var(--text-muted);
|
|
6052
|
+
}
|
|
6053
|
+
.tangle-prose hr {
|
|
6054
|
+
border: 0;
|
|
6055
|
+
border-top: 1px solid var(--border-subtle);
|
|
6056
|
+
margin: 1.2em 0;
|
|
6057
|
+
}
|
|
6058
|
+
.tangle-prose :not(pre) > code {
|
|
6059
|
+
background: var(--md3-surface-container-high);
|
|
6060
|
+
padding: 0.12em 0.36em;
|
|
6061
|
+
border-radius: 4px;
|
|
6062
|
+
font-size: 0.9em;
|
|
6063
|
+
font-family: var(--font-mono);
|
|
6064
|
+
}
|
|
6065
|
+
.tangle-prose pre {
|
|
6066
|
+
margin: 0.85em 0;
|
|
6067
|
+
}
|
|
6068
|
+
.tangle-prose table {
|
|
6069
|
+
width: 100%;
|
|
6070
|
+
margin: 0.85em 0;
|
|
6071
|
+
font-size: 0.95em;
|
|
6072
|
+
display: block;
|
|
6073
|
+
overflow-x: auto;
|
|
6074
|
+
}
|
|
6075
|
+
.tangle-prose thead {
|
|
6076
|
+
border-bottom: 1px solid var(--border-default);
|
|
6077
|
+
}
|
|
6078
|
+
.tangle-prose th {
|
|
6079
|
+
text-align: left;
|
|
6080
|
+
font-weight: 600;
|
|
6081
|
+
padding: 0.5em 0.85em;
|
|
6082
|
+
color: var(--text-primary);
|
|
6083
|
+
white-space: nowrap;
|
|
6084
|
+
}
|
|
6085
|
+
.tangle-prose td {
|
|
6086
|
+
padding: 0.5em 0.85em;
|
|
6087
|
+
border-top: 1px solid var(--border-subtle);
|
|
6088
|
+
vertical-align: top;
|
|
6089
|
+
}
|
|
6090
|
+
.tangle-prose th:not(:first-child), .tangle-prose td:not(:first-child) {
|
|
6091
|
+
border-left: 1px solid var(--border-subtle);
|
|
6092
|
+
}
|
|
5994
6093
|
@property --tw-translate-x {
|
|
5995
6094
|
syntax: "*";
|
|
5996
6095
|
inherits: false;
|
package/dist/styles.css
CHANGED
|
@@ -697,6 +697,9 @@
|
|
|
697
697
|
.\!h-2 {
|
|
698
698
|
height: calc(var(--spacing) * 2) !important;
|
|
699
699
|
}
|
|
700
|
+
.h-0\.5 {
|
|
701
|
+
height: calc(var(--spacing) * 0.5);
|
|
702
|
+
}
|
|
700
703
|
.h-1 {
|
|
701
704
|
height: calc(var(--spacing) * 1);
|
|
702
705
|
}
|
|
@@ -772,12 +775,24 @@
|
|
|
772
775
|
.h-\[18px\] {
|
|
773
776
|
height: 18px;
|
|
774
777
|
}
|
|
778
|
+
.h-\[24rem\] {
|
|
779
|
+
height: 24rem;
|
|
780
|
+
}
|
|
781
|
+
.h-\[28rem\] {
|
|
782
|
+
height: 28rem;
|
|
783
|
+
}
|
|
784
|
+
.h-\[32rem\] {
|
|
785
|
+
height: 32rem;
|
|
786
|
+
}
|
|
775
787
|
.h-\[70vh\] {
|
|
776
788
|
height: 70vh;
|
|
777
789
|
}
|
|
778
790
|
.h-\[72\%\] {
|
|
779
791
|
height: 72%;
|
|
780
792
|
}
|
|
793
|
+
.h-\[220px\] {
|
|
794
|
+
height: 220px;
|
|
795
|
+
}
|
|
781
796
|
.h-\[380px\] {
|
|
782
797
|
height: 380px;
|
|
783
798
|
}
|
|
@@ -1072,9 +1087,6 @@
|
|
|
1072
1087
|
.w-\[88\%\] {
|
|
1073
1088
|
width: 88%;
|
|
1074
1089
|
}
|
|
1075
|
-
.w-\[240px\] {
|
|
1076
|
-
width: 240px;
|
|
1077
|
-
}
|
|
1078
1090
|
.w-\[268px\] {
|
|
1079
1091
|
width: 268px;
|
|
1080
1092
|
}
|
|
@@ -1114,6 +1126,9 @@
|
|
|
1114
1126
|
.w-\[900px\] {
|
|
1115
1127
|
width: 900px;
|
|
1116
1128
|
}
|
|
1129
|
+
.w-\[1000px\] {
|
|
1130
|
+
width: 1000px;
|
|
1131
|
+
}
|
|
1117
1132
|
.w-\[min\(88vw\,24rem\)\] {
|
|
1118
1133
|
width: min(88vw, 24rem);
|
|
1119
1134
|
}
|
|
@@ -1994,12 +2009,6 @@
|
|
|
1994
2009
|
border-color: color-mix(in oklab, var(--color-primary) 50%, transparent);
|
|
1995
2010
|
}
|
|
1996
2011
|
}
|
|
1997
|
-
.border-primary\/60 {
|
|
1998
|
-
border-color: color-mix(in srgb, hsl(var(--primary)) 60%, transparent);
|
|
1999
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
2000
|
-
border-color: color-mix(in oklab, var(--color-primary) 60%, transparent);
|
|
2001
|
-
}
|
|
2002
|
-
}
|
|
2003
2012
|
.border-red-500 {
|
|
2004
2013
|
border-color: var(--color-red-500);
|
|
2005
2014
|
}
|
|
@@ -5116,6 +5125,11 @@
|
|
|
5116
5125
|
grid-column: span 8 / span 8;
|
|
5117
5126
|
}
|
|
5118
5127
|
}
|
|
5128
|
+
.xl\:grid-cols-2 {
|
|
5129
|
+
@media (width >= 80rem) {
|
|
5130
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
5131
|
+
}
|
|
5132
|
+
}
|
|
5119
5133
|
.xl\:grid-cols-4 {
|
|
5120
5134
|
@media (width >= 80rem) {
|
|
5121
5135
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
@@ -5991,6 +6005,91 @@
|
|
|
5991
6005
|
[data-sandbox-theme="vault"] .glow-primary:hover {
|
|
5992
6006
|
box-shadow: none;
|
|
5993
6007
|
}
|
|
6008
|
+
.tangle-prose {
|
|
6009
|
+
color: var(--text-primary);
|
|
6010
|
+
line-height: 1.7;
|
|
6011
|
+
}
|
|
6012
|
+
.tangle-prose :where(p, ul, ol) {
|
|
6013
|
+
margin: 0;
|
|
6014
|
+
}
|
|
6015
|
+
.tangle-prose > * + * {
|
|
6016
|
+
margin-top: 0.85em;
|
|
6017
|
+
}
|
|
6018
|
+
.tangle-prose h1, .tangle-prose h2, .tangle-prose h3, .tangle-prose h4 {
|
|
6019
|
+
font-weight: 600;
|
|
6020
|
+
line-height: 1.3;
|
|
6021
|
+
margin-top: 1.4em;
|
|
6022
|
+
margin-bottom: 0.5em;
|
|
6023
|
+
color: var(--text-primary);
|
|
6024
|
+
}
|
|
6025
|
+
.tangle-prose h1 {
|
|
6026
|
+
font-size: 1.4em;
|
|
6027
|
+
}
|
|
6028
|
+
.tangle-prose h2 {
|
|
6029
|
+
font-size: 1.25em;
|
|
6030
|
+
}
|
|
6031
|
+
.tangle-prose h3 {
|
|
6032
|
+
font-size: 1.1em;
|
|
6033
|
+
}
|
|
6034
|
+
.tangle-prose ul, .tangle-prose ol {
|
|
6035
|
+
padding-left: 1.4em;
|
|
6036
|
+
}
|
|
6037
|
+
.tangle-prose li {
|
|
6038
|
+
margin: 0.25em 0;
|
|
6039
|
+
}
|
|
6040
|
+
.tangle-prose li > ul, .tangle-prose li > ol {
|
|
6041
|
+
margin-top: 0.25em;
|
|
6042
|
+
}
|
|
6043
|
+
.tangle-prose a {
|
|
6044
|
+
color: var(--accent-text);
|
|
6045
|
+
text-decoration: underline;
|
|
6046
|
+
text-underline-offset: 2px;
|
|
6047
|
+
}
|
|
6048
|
+
.tangle-prose blockquote {
|
|
6049
|
+
border-left: 2px solid var(--border-default);
|
|
6050
|
+
padding-left: 0.9em;
|
|
6051
|
+
color: var(--text-muted);
|
|
6052
|
+
}
|
|
6053
|
+
.tangle-prose hr {
|
|
6054
|
+
border: 0;
|
|
6055
|
+
border-top: 1px solid var(--border-subtle);
|
|
6056
|
+
margin: 1.2em 0;
|
|
6057
|
+
}
|
|
6058
|
+
.tangle-prose :not(pre) > code {
|
|
6059
|
+
background: var(--md3-surface-container-high);
|
|
6060
|
+
padding: 0.12em 0.36em;
|
|
6061
|
+
border-radius: 4px;
|
|
6062
|
+
font-size: 0.9em;
|
|
6063
|
+
font-family: var(--font-mono);
|
|
6064
|
+
}
|
|
6065
|
+
.tangle-prose pre {
|
|
6066
|
+
margin: 0.85em 0;
|
|
6067
|
+
}
|
|
6068
|
+
.tangle-prose table {
|
|
6069
|
+
width: 100%;
|
|
6070
|
+
margin: 0.85em 0;
|
|
6071
|
+
font-size: 0.95em;
|
|
6072
|
+
display: block;
|
|
6073
|
+
overflow-x: auto;
|
|
6074
|
+
}
|
|
6075
|
+
.tangle-prose thead {
|
|
6076
|
+
border-bottom: 1px solid var(--border-default);
|
|
6077
|
+
}
|
|
6078
|
+
.tangle-prose th {
|
|
6079
|
+
text-align: left;
|
|
6080
|
+
font-weight: 600;
|
|
6081
|
+
padding: 0.5em 0.85em;
|
|
6082
|
+
color: var(--text-primary);
|
|
6083
|
+
white-space: nowrap;
|
|
6084
|
+
}
|
|
6085
|
+
.tangle-prose td {
|
|
6086
|
+
padding: 0.5em 0.85em;
|
|
6087
|
+
border-top: 1px solid var(--border-subtle);
|
|
6088
|
+
vertical-align: top;
|
|
6089
|
+
}
|
|
6090
|
+
.tangle-prose th:not(:first-child), .tangle-prose td:not(:first-child) {
|
|
6091
|
+
border-left: 1px solid var(--border-subtle);
|
|
6092
|
+
}
|
|
5994
6093
|
@property --tw-translate-x {
|
|
5995
6094
|
syntax: "*";
|
|
5996
6095
|
inherits: false;
|
package/dist/workflows.d.ts
CHANGED
|
@@ -40,6 +40,9 @@ interface WfNodeState {
|
|
|
40
40
|
/** Input/output token usage, when known. */
|
|
41
41
|
inputTokens?: number;
|
|
42
42
|
outputTokens?: number;
|
|
43
|
+
/** Agent iteration count (agent.run only) — the number of reasoning/tool
|
|
44
|
+
* rounds the agent has taken, surfaced on the node's progress strip. */
|
|
45
|
+
rounds?: number;
|
|
43
46
|
}
|
|
44
47
|
interface WfNodeData extends Record<string, unknown> {
|
|
45
48
|
/** Headline for the node, e.g. "Run agent". */
|
|
@@ -70,8 +73,6 @@ interface WfNodeData extends Record<string, unknown> {
|
|
|
70
73
|
provider?: string;
|
|
71
74
|
/** Small corner tag, e.g. "×3" for a parallel fan-out. */
|
|
72
75
|
badge?: string;
|
|
73
|
-
/** Whether this node fans out to branch leaves (renders a right handle). */
|
|
74
|
-
hasBranches: boolean;
|
|
75
76
|
/** Whether this node is the spine root (no incoming/target handle). */
|
|
76
77
|
isRoot: boolean;
|
|
77
78
|
tone: WfNodeTone;
|
|
@@ -84,14 +85,21 @@ interface WfNode {
|
|
|
84
85
|
x: number;
|
|
85
86
|
y: number;
|
|
86
87
|
};
|
|
88
|
+
/** Authoritative rendered size (px). The card renders at exactly this box
|
|
89
|
+
* (`h-full`/`w-full`) so the layout — which spaces nodes by these dims — is
|
|
90
|
+
* collision-free by construction, with no measure-then-reflow pass. */
|
|
91
|
+
width: number;
|
|
92
|
+
height: number;
|
|
87
93
|
data: WfNodeData;
|
|
88
94
|
}
|
|
95
|
+
type WfEdgeKind = "spine" | "fork" | "join";
|
|
89
96
|
interface WfEdge {
|
|
90
97
|
id: string;
|
|
91
98
|
source: string;
|
|
92
99
|
target: string;
|
|
93
|
-
/**
|
|
94
|
-
|
|
100
|
+
/** Spine = trigger→action→action; fork = fan-out into a branch leaf; join =
|
|
101
|
+
* a branch leaf reconverging onto the next spine node. Drives edge styling. */
|
|
102
|
+
kind: WfEdgeKind;
|
|
95
103
|
}
|
|
96
104
|
interface WfGraph {
|
|
97
105
|
nodes: WfNode[];
|
|
@@ -99,21 +107,33 @@ interface WfGraph {
|
|
|
99
107
|
/** Set when the YAML couldn't be parsed into a renderable graph. */
|
|
100
108
|
error: string | null;
|
|
101
109
|
}
|
|
110
|
+
/** Main-axis flow direction: "LR" (left-to-right, default) suits the wide/short
|
|
111
|
+
* run-detail panel; "TB" (top-to-bottom) suits a narrow column. */
|
|
112
|
+
type WfDirection = "LR" | "TB";
|
|
102
113
|
/** Options for {@link buildWorkflowGraph}. */
|
|
103
114
|
interface BuildWorkflowGraphOptions {
|
|
104
115
|
/**
|
|
105
|
-
* Reserve
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
116
|
+
* Reserve space for the rows live run state adds to a node (the meta-chip row +
|
|
117
|
+
* the output/error preview), so the RUN view never overlaps once a node starts
|
|
118
|
+
* or terminates. The static/preview layout (no run overlay) leaves this off to
|
|
119
|
+
* stay compact. Defaults to `false`.
|
|
109
120
|
*/
|
|
110
121
|
reserveRunState?: boolean;
|
|
122
|
+
/** Flow direction. Defaults to "LR". */
|
|
123
|
+
direction?: WfDirection;
|
|
124
|
+
/** Override the node dimensions the layout spaces by (and the card renders at).
|
|
125
|
+
* Defaults to a fixed width + {@link nodeHeight}. A caller with a different node
|
|
126
|
+
* design supplies its own sizing so the layout stays collision-free. */
|
|
127
|
+
measure?: (data: WfNodeData, withRunState: boolean) => {
|
|
128
|
+
width: number;
|
|
129
|
+
height: number;
|
|
130
|
+
};
|
|
111
131
|
}
|
|
112
132
|
/** Build a positioned graph from a workflow YAML string. Never throws —
|
|
113
133
|
* malformed YAML or an empty definition returns an `error` the UI can fall
|
|
114
|
-
* back on (e.g. show the raw YAML while authoring).
|
|
115
|
-
*
|
|
116
|
-
*
|
|
134
|
+
* back on (e.g. show the raw YAML while authoring). `reserveRunState` leaves
|
|
135
|
+
* room for the rows live run state adds (see {@link nodeHeight}); `direction`
|
|
136
|
+
* picks the flow axis (default "LR"). */
|
|
117
137
|
declare function buildWorkflowGraph(yaml: string, options?: BuildWorkflowGraphOptions): WfGraph;
|
|
118
138
|
|
|
119
139
|
interface WorkflowGraphProps {
|
|
@@ -121,6 +141,13 @@ interface WorkflowGraphProps {
|
|
|
121
141
|
yaml: string;
|
|
122
142
|
/** "full" = interactive (pan/zoom/drag + controls); "preview" = static fit. */
|
|
123
143
|
variant?: "full" | "preview";
|
|
144
|
+
/** Flow direction: "LR" (default) reads left-to-right — best for the wide/short
|
|
145
|
+
* run-detail panel; "TB" is a vertical column. */
|
|
146
|
+
direction?: WfDirection;
|
|
147
|
+
/** Start collapsed (compact icon tiles) rather than expanded. The full variant
|
|
148
|
+
* exposes a toggle to switch densities; the preview variant is always compact.
|
|
149
|
+
* Defaults to `false` (expanded). */
|
|
150
|
+
defaultCompact?: boolean;
|
|
124
151
|
/** Sizing for the wrapper; the caller controls height. */
|
|
125
152
|
className?: string;
|
|
126
153
|
/**
|