@voltro/devtools 0.85.0 → 0.87.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +5987 -0
  2. package/THIRD-PARTY-NOTICES.md +1125 -34
  3. package/dist/Devtools.js +327 -0
  4. package/dist/capsuleClearance.js +42 -0
  5. package/dist/capsulePlacement.js +66 -0
  6. package/dist/components/boundary.js +47 -0
  7. package/dist/components/dockMenu.js +121 -0
  8. package/dist/components/icons.js +236 -0
  9. package/dist/components/primitives.js +75 -0
  10. package/dist/console/Capsule.js +169 -0
  11. package/dist/console/Console.js +508 -0
  12. package/dist/console/InspectRefusals.js +89 -0
  13. package/dist/console/searchIndex.js +63 -0
  14. package/dist/console/sources.js +106 -0
  15. package/dist/consoleBridge.js +76 -0
  16. package/dist/externalWindow.js +9 -0
  17. package/dist/index.js +3 -4382
  18. package/dist/inspectAuth.js +16 -0
  19. package/dist/inspectFetch.js +46 -0
  20. package/dist/inspectRefusal.js +45 -0
  21. package/dist/inspectStream.js +88 -0
  22. package/dist/logsBus.js +22 -0
  23. package/dist/panels/desktop.js +101 -0
  24. package/dist/panels/indexes.js +233 -0
  25. package/dist/panels/logs.js +55 -0
  26. package/dist/panels/mutations.js +81 -0
  27. package/dist/panels/pwa.js +171 -0
  28. package/dist/panels/routes.js +69 -0
  29. package/dist/panels/runtimes.js +67 -0
  30. package/dist/panels/stores.js +125 -0
  31. package/dist/panels/subscriptions.js +117 -0
  32. package/dist/panels/traces.js +160 -0
  33. package/dist/panels/webhooks.js +248 -0
  34. package/dist/panels/workflows.js +478 -0
  35. package/dist/pushPage.js +36 -0
  36. package/dist/shadowHost.js +77 -0
  37. package/dist/strings.js +332 -0
  38. package/dist/styles.css +20 -0
  39. package/dist/useCapsuleClearance.js +85 -0
  40. package/dist/useDevStatuses.js +6 -0
  41. package/dist/useDock.js +181 -0
  42. package/dist/useDocumentVisible.js +5 -0
  43. package/dist/useLiveCacheEntries.js +19 -0
  44. package/package.json +4 -4
@@ -0,0 +1,478 @@
1
+ import { Workflow as e } from "../components/icons.js";
2
+ import { useDevtoolsStrings as t } from "../strings.js";
3
+ import { Badge as n, Button as r, Card as i, Empty as a, SectionTitle as o } from "../components/primitives.js";
4
+ import { useInspectToken as s } from "../inspectAuth.js";
5
+ import { fetchInspect as c, postInspect as l } from "../inspectFetch.js";
6
+ import { useDocumentVisible as u } from "../useDocumentVisible.js";
7
+ import { useInspectChangeEpoch as d } from "../inspectStream.js";
8
+ import { useEffect as f, useMemo as p, useState as m } from "react";
9
+ import { useFrameworkRuntimes as h, useWorkflow as g } from "@voltro/client";
10
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
11
+ //#region src/panels/workflows.tsx
12
+ var b = {
13
+ queued: "neutral",
14
+ running: "info",
15
+ succeeded: "success",
16
+ failed: "danger",
17
+ cancelled: "warning",
18
+ paused: "accent",
19
+ suspended: "accent"
20
+ }, x = {
21
+ running: "info",
22
+ succeeded: "success",
23
+ failed: "danger"
24
+ }, S = 50, C = 1e4, w = (e) => e == null ? "—" : e < 1e3 ? `${Math.round(e)}ms` : e < 6e4 ? `${(e / 1e3).toFixed(e < 1e4 ? 2 : 1)}s` : `${Math.floor(e / 6e4)}m ${Math.floor(e % 6e4 / 1e3)}s`, T = (e) => {
25
+ let t = new Date(e), n = (e) => e < 10 ? `0${e}` : String(e);
26
+ return `${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`;
27
+ }, E = (e) => {
28
+ try {
29
+ return JSON.stringify(e, null, 2);
30
+ } catch {
31
+ return String(e);
32
+ }
33
+ }, D = (e) => e === "running" || e === "queued", O = (e, t) => e.durationMs ?? (D(e.status) ? t - new Date(e.startedAt).getTime() : null), k = (e) => {
34
+ let t = /* @__PURE__ */ new Set();
35
+ for (let n of e) {
36
+ let e = n.payload?.signalName;
37
+ typeof e == "string" && (n.eventType === "signal-awaited" && t.add(e), n.eventType === "signal-received" && t.delete(e));
38
+ }
39
+ return [...t];
40
+ }, A = async (e, t) => {
41
+ if (e === "") return null;
42
+ let n = await c(`${e}/_voltro/inspect/workflows/runs?limit=${S}`, t);
43
+ return n !== null && Array.isArray(n.runs) ? n.runs : null;
44
+ }, j = (e) => {
45
+ let t = u(), n = s(), r = t && e !== "", i = d(e, ["workflowRuns"], r), [a, o] = m([]), [c, l] = m(!1);
46
+ return f(() => {
47
+ if (!r) return;
48
+ let t = !1, i = async () => {
49
+ let r = await A(e, n);
50
+ t || (r === null ? l(!0) : (l(!1), o(r)));
51
+ };
52
+ i();
53
+ let a = setInterval(i, C);
54
+ return () => {
55
+ t = !0, clearInterval(a);
56
+ };
57
+ }, [
58
+ e,
59
+ r,
60
+ n,
61
+ i
62
+ ]), {
63
+ runs: a,
64
+ failed: c
65
+ };
66
+ }, M = (e, t) => {
67
+ let n = u(), r = s(), i = d(e, ["workflowSteps", "workflowEvents"], n && e !== ""), [a, o] = m([]), [l, p] = m([]);
68
+ return f(() => {
69
+ if (!n || e === "") return;
70
+ let i = !1, a = `${e}/_voltro/inspect/workflows/runs/${encodeURIComponent(t)}`, s = async () => {
71
+ let [e, t] = await Promise.all([c(`${a}/steps`, r), c(`${a}/events`, r)]);
72
+ i || (e !== null && Array.isArray(e.steps) && o(e.steps), t !== null && Array.isArray(t.events) && p(t.events));
73
+ };
74
+ s();
75
+ let l = setInterval(s, C);
76
+ return () => {
77
+ i = !0, clearInterval(l);
78
+ };
79
+ }, [
80
+ e,
81
+ t,
82
+ n,
83
+ r,
84
+ i
85
+ ]), {
86
+ steps: a,
87
+ events: l
88
+ };
89
+ }, N = (e) => {
90
+ let t = h(), n = u(), r = s(), i = t.names.join(","), [a, o] = m(0), c = e && n, l = i === "" ? "" : t.get(i.split(",")[0]).inspectBaseUrl ?? "", p = d(l, ["workflowRuns"], c);
91
+ return f(() => {
92
+ if (!c) {
93
+ o(0);
94
+ return;
95
+ }
96
+ let e = i === "" ? [] : i.split(",").map((e) => t.get(e).inspectBaseUrl).filter((e) => e !== "");
97
+ if (e.length === 0) {
98
+ o(0);
99
+ return;
100
+ }
101
+ let n = !1, a = async () => {
102
+ let t = await Promise.all(e.map((e) => A(e, r)));
103
+ n || o(t.reduce((e, t) => e + (t === null ? 0 : t.filter((e) => D(e.status)).length), 0));
104
+ };
105
+ a();
106
+ let s = setInterval(a, C);
107
+ return () => {
108
+ n = !0, clearInterval(s);
109
+ };
110
+ }, [
111
+ t,
112
+ i,
113
+ c,
114
+ r,
115
+ p
116
+ ]), a;
117
+ }, P = () => {
118
+ let e = h(), n = t().workflows;
119
+ return e.names.length === 0 ? /* @__PURE__ */ v(a, { children: n.noApi }) : /* @__PURE__ */ v("div", {
120
+ className: "vdt:flex vdt:flex-col vdt:gap-3 vdt:p-3",
121
+ children: e.names.map((e) => /* @__PURE__ */ v(F, { apiName: e }, e))
122
+ });
123
+ }, F = ({ apiName: r }) => {
124
+ let a = h(), s = t().workflows, c = a.get(r), l = c.inspectBaseUrl, u = p(() => Object.entries(c.descriptors).filter(([, e]) => e.kind === "workflow").map(([e]) => e).sort(), [c.descriptors]), { runs: d, failed: g } = j(l), _ = d.filter((e) => D(e.status)).length, [x, S] = m(null), [C, E] = m(() => Date.now());
125
+ return f(() => {
126
+ if (_ === 0) return;
127
+ let e = setInterval(() => E(Date.now()), 1e3);
128
+ return () => clearInterval(e);
129
+ }, [_]), /* @__PURE__ */ y(i, { children: [
130
+ /* @__PURE__ */ v(o, {
131
+ Icon: e,
132
+ right: _ > 0 ? /* @__PURE__ */ v(n, {
133
+ tone: "info",
134
+ children: s.runningBadge(_)
135
+ }) : /* @__PURE__ */ v(n, {
136
+ tone: "neutral",
137
+ children: s.runsBadge(d.length)
138
+ }),
139
+ children: r
140
+ }),
141
+ /* @__PURE__ */ v(I, {
142
+ apiName: r,
143
+ definitions: u,
144
+ runs: d
145
+ }),
146
+ /* @__PURE__ */ y("div", {
147
+ className: "vdt:px-3 vdt:py-2 vdt:border-t vdt:border-border",
148
+ children: [/* @__PURE__ */ v("div", {
149
+ className: "vdt:text-foreground-muted vdt:text-[10px] vdt:uppercase vdt:tracking-wider vdt:mb-1.5",
150
+ children: s.runs(d.length)
151
+ }), g ? /* @__PURE__ */ v("div", {
152
+ className: "vdt:text-xs vdt:text-danger",
153
+ children: s.runsUnavailable
154
+ }) : d.length === 0 ? /* @__PURE__ */ v("div", {
155
+ className: "vdt:text-xs vdt:text-foreground-subtle",
156
+ children: u.length === 0 ? s.noDefinitions : s.noRuns
157
+ }) : /* @__PURE__ */ v("div", {
158
+ className: "vdt:flex vdt:flex-col vdt:gap-0.5",
159
+ children: d.map((e) => /* @__PURE__ */ y("div", {
160
+ "data-run-id": e.id,
161
+ "data-run-status": e.status,
162
+ children: [/* @__PURE__ */ y("button", {
163
+ type: "button",
164
+ "aria-expanded": x === e.id,
165
+ onClick: () => S(x === e.id ? null : e.id),
166
+ className: "vdt:w-full vdt:flex vdt:items-center vdt:gap-2 vdt:text-left vdt:text-xs vdt:px-1.5 vdt:py-1 vdt:rounded-sm vdt:hover:bg-muted",
167
+ children: [
168
+ /* @__PURE__ */ v("span", {
169
+ className: "vdt:text-foreground-subtle vdt:w-2",
170
+ children: x === e.id ? "▾" : "▸"
171
+ }),
172
+ /* @__PURE__ */ v(n, {
173
+ tone: b[e.status] ?? "neutral",
174
+ children: e.status
175
+ }),
176
+ /* @__PURE__ */ v("code", {
177
+ className: "vdt:font-mono vdt:text-foreground vdt:truncate",
178
+ children: e.tag
179
+ }),
180
+ e.parentExecutionId === null ? null : /* @__PURE__ */ v(n, {
181
+ tone: "neutral",
182
+ children: s.child
183
+ }),
184
+ e.errorMessage === null ? null : /* @__PURE__ */ y("span", {
185
+ className: "vdt:text-danger vdt:truncate vdt:font-mono vdt:text-[11px]",
186
+ children: [e.errorTag === null ? "" : `${e.errorTag} · `, e.errorMessage]
187
+ }),
188
+ /* @__PURE__ */ v("span", {
189
+ className: "vdt:ml-auto vdt:tabular-nums vdt:text-foreground-muted vdt:whitespace-nowrap",
190
+ children: w(O(e, C))
191
+ }),
192
+ /* @__PURE__ */ v("span", {
193
+ className: "vdt:tabular-nums vdt:text-foreground-subtle vdt:whitespace-nowrap",
194
+ children: T(e.startedAt)
195
+ })
196
+ ]
197
+ }), x === e.id ? /* @__PURE__ */ v(L, {
198
+ baseUrl: l,
199
+ run: e
200
+ }) : null]
201
+ }, e.id))
202
+ })]
203
+ })
204
+ ] });
205
+ }, I = ({ apiName: e, definitions: n, runs: i }) => {
206
+ let a = t().workflows, [o, s] = m(n[0] ?? "");
207
+ f(() => {
208
+ o === "" && n.length > 0 && s(n[0]);
209
+ }, [n, o]);
210
+ let c = p(() => {
211
+ let e = i.find((e) => e.tag === o);
212
+ return e === void 0 ? "{}" : E(e.payload);
213
+ }, [i, o]), [l, u] = m(c), [d, h] = m(!1);
214
+ f(() => {
215
+ d || u(c);
216
+ }, [c, d]);
217
+ let [_, b] = m(null), x = g(e, o === "" ? "__voltro.devtools.none" : o);
218
+ if (n.length === 0) return null;
219
+ let S = async () => {
220
+ let e;
221
+ try {
222
+ e = l.trim() === "" ? {} : JSON.parse(l);
223
+ } catch (e) {
224
+ b({
225
+ tone: "danger",
226
+ text: a.invalidJson(e instanceof Error ? e.message : String(e))
227
+ });
228
+ return;
229
+ }
230
+ b(null);
231
+ try {
232
+ let t = await x.start(e);
233
+ b({
234
+ tone: "success",
235
+ text: a.started(t.executionId ?? t.id, t.status)
236
+ }), h(!1);
237
+ } catch (e) {
238
+ b({
239
+ tone: "danger",
240
+ text: a.startFailed(e instanceof Error ? e.message : String(e))
241
+ });
242
+ }
243
+ };
244
+ return /* @__PURE__ */ y("div", {
245
+ className: "vdt:px-3 vdt:py-2 vdt:flex vdt:flex-col vdt:gap-1.5",
246
+ children: [
247
+ /* @__PURE__ */ y("div", {
248
+ className: "vdt:flex vdt:items-center vdt:gap-2",
249
+ children: [
250
+ /* @__PURE__ */ v("span", {
251
+ className: "vdt:text-foreground-muted vdt:text-[10px] vdt:uppercase vdt:tracking-wider",
252
+ children: a.start
253
+ }),
254
+ /* @__PURE__ */ v("select", {
255
+ "aria-label": a.workflowLabel,
256
+ value: o,
257
+ onChange: (e) => {
258
+ s(e.target.value), h(!1), b(null);
259
+ },
260
+ className: "vdt:text-xs vdt:font-mono vdt:bg-background vdt:border vdt:border-border vdt:rounded-sm vdt:px-1.5 vdt:py-0.5 vdt:text-foreground",
261
+ children: n.map((e) => /* @__PURE__ */ v("option", {
262
+ value: e,
263
+ children: e
264
+ }, e))
265
+ }),
266
+ /* @__PURE__ */ v("span", { className: "vdt:sp" }),
267
+ /* @__PURE__ */ v(r, {
268
+ onClick: () => {
269
+ S();
270
+ },
271
+ disabled: x.pending || o === "",
272
+ children: x.pending ? a.starting : a.start
273
+ })
274
+ ]
275
+ }),
276
+ /* @__PURE__ */ v("textarea", {
277
+ "aria-label": a.payloadLabel,
278
+ value: l,
279
+ onChange: (e) => {
280
+ u(e.target.value), h(!0);
281
+ },
282
+ spellCheck: !1,
283
+ rows: Math.min(8, Math.max(2, l.split("\n").length)),
284
+ className: "vdt:w-full vdt:text-[11px] vdt:font-mono vdt:bg-background vdt:border vdt:border-border vdt:rounded-sm vdt:px-2 vdt:py-1 vdt:text-foreground vdt:resize-y"
285
+ }),
286
+ /* @__PURE__ */ v("div", {
287
+ className: "vdt:text-[10px] vdt:text-foreground-subtle",
288
+ children: a.payloadHint
289
+ }),
290
+ _ === null ? null : /* @__PURE__ */ v("div", {
291
+ role: _.tone === "danger" ? "alert" : "status",
292
+ className: `vdt:text-xs ${_.tone === "danger" ? "vdt:text-danger" : "vdt:text-success"}`,
293
+ children: _.text
294
+ })
295
+ ]
296
+ });
297
+ }, L = ({ baseUrl: e, run: i }) => {
298
+ let a = t().workflows, o = s(), { steps: c, events: u } = M(e, i.id), d = p(() => k(u), [u]), [h, g] = m(""), [b, S] = m("{}"), [C, E] = m(!1), [D, O] = m(null);
299
+ f(() => {
300
+ h === "" && d.length > 0 && g(d[0]);
301
+ }, [d, h]);
302
+ let [A, j] = m(null), N = i.status === "running" || i.status === "queued" || i.status === "suspended", P = `${e}/_voltro/inspect/workflows/runs/${encodeURIComponent(i.id)}`, F = async (e, t) => {
303
+ O(null), E(!0);
304
+ try {
305
+ O({
306
+ tone: "success",
307
+ text: await t()
308
+ });
309
+ } catch (t) {
310
+ O({
311
+ tone: "danger",
312
+ text: a.actionFailed(e, t instanceof Error ? t.message : String(t))
313
+ });
314
+ } finally {
315
+ E(!1);
316
+ }
317
+ }, I = () => F(a.cancel, async () => {
318
+ let e = await l(`${P}/cancel`, o, {});
319
+ return a.cancelResult(typeof e.kind == "string" ? e.kind : e.cancelled === !0 ? "confirmed" : "submitted");
320
+ }), L = () => F(a.sendSignal, async () => {
321
+ let e;
322
+ try {
323
+ e = b.trim() === "" ? void 0 : JSON.parse(b);
324
+ } catch (e) {
325
+ throw Error(a.invalidJson(e instanceof Error ? e.message : String(e)));
326
+ }
327
+ return await l(`${P}/signal`, o, e === void 0 ? { signalName: h } : {
328
+ signalName: h,
329
+ payload: e
330
+ }), a.signalSent(h);
331
+ });
332
+ return /* @__PURE__ */ y("div", {
333
+ className: "vdt:ml-4 vdt:pl-2 vdt:border-l vdt:border-border vdt:py-1 vdt:flex vdt:flex-col vdt:gap-2 vdt:text-xs",
334
+ children: [
335
+ /* @__PURE__ */ y("div", {
336
+ className: "vdt:grid vdt:grid-cols-1 vdt:sm:grid-cols-2 vdt:gap-2",
337
+ children: [/* @__PURE__ */ v(R, {
338
+ label: a.payloadLabel,
339
+ value: i.payload
340
+ }), /* @__PURE__ */ v(R, {
341
+ label: i.status === "failed" ? a.error : a.output,
342
+ value: i.status === "failed" ? {
343
+ tag: i.errorTag,
344
+ message: i.errorMessage
345
+ } : i.output
346
+ })]
347
+ }),
348
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("div", {
349
+ className: "vdt:text-foreground-muted vdt:text-[10px] vdt:uppercase vdt:tracking-wider vdt:mb-1",
350
+ children: a.steps(c.length)
351
+ }), c.length === 0 ? /* @__PURE__ */ v("div", {
352
+ className: "vdt:text-foreground-subtle",
353
+ children: a.noSteps
354
+ }) : /* @__PURE__ */ v("div", {
355
+ className: "vdt:flex vdt:flex-col vdt:gap-0.5",
356
+ children: c.map((e) => /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("button", {
357
+ type: "button",
358
+ onClick: () => j(A === e.id ? null : e.id),
359
+ className: "vdt:w-full vdt:flex vdt:items-center vdt:gap-2 vdt:text-left vdt:px-1 vdt:py-0.5 vdt:rounded-sm vdt:hover:bg-muted",
360
+ children: [
361
+ /* @__PURE__ */ v(n, {
362
+ tone: x[e.status] ?? "info",
363
+ children: e.status
364
+ }),
365
+ /* @__PURE__ */ v("code", {
366
+ className: "vdt:font-mono vdt:text-foreground",
367
+ children: e.stepName
368
+ }),
369
+ e.attempt > 1 ? /* @__PURE__ */ v("span", {
370
+ className: "vdt:text-warning",
371
+ children: a.attempt(e.attempt)
372
+ }) : null,
373
+ e.errorMessage === null ? null : /* @__PURE__ */ v("span", {
374
+ className: "vdt:text-danger vdt:truncate vdt:font-mono vdt:text-[11px]",
375
+ children: e.errorMessage
376
+ }),
377
+ /* @__PURE__ */ v("span", {
378
+ className: "vdt:ml-auto vdt:tabular-nums vdt:text-foreground-muted",
379
+ children: w(e.durationMs)
380
+ })
381
+ ]
382
+ }), A === e.id ? /* @__PURE__ */ y("div", {
383
+ className: "vdt:ml-3 vdt:grid vdt:grid-cols-1 vdt:sm:grid-cols-2 vdt:gap-2 vdt:py-1",
384
+ children: [/* @__PURE__ */ v(R, {
385
+ label: a.input,
386
+ value: e.input
387
+ }), /* @__PURE__ */ v(R, {
388
+ label: e.status === "failed" ? a.error : a.output,
389
+ value: e.status === "failed" ? e.errorCause ?? {
390
+ tag: e.errorTag,
391
+ message: e.errorMessage
392
+ } : e.output
393
+ })]
394
+ }) : null] }, e.id))
395
+ })] }),
396
+ u.length > 0 ? /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("div", {
397
+ className: "vdt:text-foreground-muted vdt:text-[10px] vdt:uppercase vdt:tracking-wider vdt:mb-1",
398
+ children: a.events(u.length)
399
+ }), /* @__PURE__ */ v("div", {
400
+ className: "vdt:flex vdt:flex-wrap vdt:gap-1",
401
+ children: u.map((e) => /* @__PURE__ */ y("span", {
402
+ title: T(e.occurredAt),
403
+ className: "vdt:inline-flex vdt:items-center vdt:gap-1 vdt:text-[10px] vdt:font-mono vdt:text-foreground-muted vdt:border vdt:border-border vdt:rounded-sm vdt:px-1",
404
+ children: [e.eventType, e.stepName === null ? "" : ` · ${e.stepName}`]
405
+ }, e.id))
406
+ })] }) : null,
407
+ /* @__PURE__ */ y("div", {
408
+ className: "vdt:flex vdt:flex-wrap vdt:items-center vdt:gap-2",
409
+ children: [
410
+ N ? /* @__PURE__ */ v(r, {
411
+ onClick: () => {
412
+ I();
413
+ },
414
+ disabled: C,
415
+ children: a.cancel
416
+ }) : null,
417
+ d.length > 0 && i.status === "running" ? /* @__PURE__ */ y(_, { children: [
418
+ /* @__PURE__ */ v("span", {
419
+ className: "vdt:text-foreground-muted",
420
+ children: a.awaiting
421
+ }),
422
+ /* @__PURE__ */ v("select", {
423
+ "aria-label": a.signalName,
424
+ value: h,
425
+ onChange: (e) => g(e.target.value),
426
+ className: "vdt:text-xs vdt:font-mono vdt:bg-background vdt:border vdt:border-border vdt:rounded-sm vdt:px-1.5 vdt:py-0.5 vdt:text-foreground",
427
+ children: d.map((e) => /* @__PURE__ */ v("option", {
428
+ value: e,
429
+ children: e
430
+ }, e))
431
+ }),
432
+ /* @__PURE__ */ v("input", {
433
+ "aria-label": a.signalPayload,
434
+ value: b,
435
+ onChange: (e) => S(e.target.value),
436
+ spellCheck: !1,
437
+ className: "vdt:text-[11px] vdt:font-mono vdt:bg-background vdt:border vdt:border-border vdt:rounded-sm vdt:px-1.5 vdt:py-0.5 vdt:text-foreground vdt:min-w-32"
438
+ }),
439
+ /* @__PURE__ */ v(r, {
440
+ onClick: () => {
441
+ L();
442
+ },
443
+ disabled: C || h === "",
444
+ children: a.sendSignal
445
+ })
446
+ ] }) : null,
447
+ i.traceId === null ? null : /* @__PURE__ */ y("span", {
448
+ className: "vdt:text-[10px] vdt:font-mono vdt:text-foreground-subtle",
449
+ children: [
450
+ a.trace,
451
+ " · ",
452
+ i.traceId
453
+ ]
454
+ })
455
+ ]
456
+ }),
457
+ D === null ? null : /* @__PURE__ */ v("div", {
458
+ role: D.tone === "danger" ? "alert" : "status",
459
+ className: D.tone === "danger" ? "vdt:text-danger" : "vdt:text-success",
460
+ children: D.text
461
+ })
462
+ ]
463
+ });
464
+ }, R = ({ label: e, value: t }) => /* @__PURE__ */ y("div", {
465
+ className: "vdt:min-w-0",
466
+ children: [/* @__PURE__ */ v("div", {
467
+ className: "vdt:text-foreground-muted vdt:text-[10px] vdt:uppercase vdt:tracking-wider vdt:mb-0.5",
468
+ children: e
469
+ }), t == null ? /* @__PURE__ */ v("div", {
470
+ className: "vdt:text-foreground-subtle",
471
+ children: "—"
472
+ }) : /* @__PURE__ */ v("pre", {
473
+ className: "vdt:overflow-x-auto vdt:text-[11px] vdt:font-mono vdt:p-1.5 vdt:rounded-sm vdt:bg-background vdt:border vdt:border-border vdt:text-foreground vdt:whitespace-pre-wrap vdt:break-all",
474
+ children: E(t)
475
+ })]
476
+ });
477
+ //#endregion
478
+ export { P as WorkflowsPanel, k as awaitedSignals, w as fmtDuration, N as useWorkflowsCount };
@@ -0,0 +1,36 @@
1
+ //#region src/pushPage.ts
2
+ var e = ["overflow"], t = [
3
+ "position",
4
+ "top",
5
+ "right",
6
+ "bottom",
7
+ "left",
8
+ "overflow",
9
+ "contain"
10
+ ], n = (e, t) => t.map((t) => [
11
+ t,
12
+ e.getPropertyValue(t),
13
+ e.getPropertyPriority(t)
14
+ ]), r = (e, t) => {
15
+ for (let [n, r, i] of t) r === "" ? e.removeProperty(n) : e.setProperty(n, r, i);
16
+ }, i = (i, a, o = document) => {
17
+ let s = o.documentElement, c = o.body, l = o.defaultView, u = n(s.style, e), d = n(c.style, t), f = l?.scrollX ?? 0, p = l?.scrollY ?? 0;
18
+ s.style.setProperty("overflow", "hidden"), c.style.setProperty("position", "fixed");
19
+ for (let e of [
20
+ "top",
21
+ "right",
22
+ "bottom",
23
+ "left"
24
+ ]) c.style.setProperty(e, "0px");
25
+ return c.style.setProperty(i, `${a}px`), c.style.setProperty("overflow", "auto"), c.style.setProperty("contain", "layout paint"), c.scrollTop = p, c.scrollLeft = f, {
26
+ resize: (e) => {
27
+ c.style.setProperty(i, `${e}px`);
28
+ },
29
+ release: () => {
30
+ let e = c.scrollTop, t = c.scrollLeft;
31
+ r(c.style, d), r(s.style, u), l?.scrollTo(t, e);
32
+ }
33
+ };
34
+ };
35
+ //#endregion
36
+ export { i as engagePush };
@@ -0,0 +1,77 @@
1
+ import { useLayoutEffect as e, useState as t } from "react";
2
+ import { createPortal as n } from "react-dom";
3
+ //#region src/shadowHost.tsx
4
+ var r = /vdt/, i = (e, t) => {
5
+ for (let n of Array.from(e)) if (n instanceof CSSStyleRule) (r.test(n.selectorText) || Array.from(n.style).some((e) => e.startsWith("--vdt-"))) && t.push(n.cssText);
6
+ else if (n instanceof CSSKeyframesRule) n.name.startsWith("vdt-") && t.push(n.cssText);
7
+ else if (n instanceof CSSGroupingRule || n instanceof CSSLayerBlockRule) {
8
+ let e = [];
9
+ if (i(n.cssRules, e), e.length === 0) continue;
10
+ let r = n.cssText, a = r.slice(0, r.indexOf("{")).trim();
11
+ t.push(`${a} {\n${e.join("\n")}\n}`);
12
+ } else n.constructor.name === "CSSPropertyRule" && r.test(n.cssText) && t.push(n.cssText), n.constructor.name === "CSSLayerStatementRule" && t.push(n.cssText);
13
+ }, a = (e) => {
14
+ let t = [], n = (e) => {
15
+ for (let r of Array.from(e)) r.constructor.name === "CSSPropertyRule" && /@property\s+--(tw|vdt)-/.test(r.cssText) ? t.push(r.cssText) : (r instanceof CSSGroupingRule || r instanceof CSSLayerBlockRule) && n(r.cssRules);
16
+ };
17
+ for (let t of Array.from(e.styleSheets)) {
18
+ let e;
19
+ try {
20
+ e = t.cssRules;
21
+ } catch {
22
+ continue;
23
+ }
24
+ n(e);
25
+ }
26
+ return t.join("\n");
27
+ }, o = (e) => {
28
+ let t = [];
29
+ for (let n of Array.from(e.styleSheets)) {
30
+ let e;
31
+ try {
32
+ e = n.cssRules;
33
+ } catch {
34
+ continue;
35
+ }
36
+ i(e, t);
37
+ }
38
+ return t.join("\n");
39
+ }, s = (e, t) => {
40
+ let n = e.ownerDocument.defaultView?.CSSStyleSheet;
41
+ if (n !== void 0 && "replaceSync" in n.prototype && "adoptedStyleSheets" in e) {
42
+ let r = new n();
43
+ r.replaceSync(t), e.adoptedStyleSheets = [r];
44
+ return;
45
+ }
46
+ let r = e.querySelector("style[data-vdt]");
47
+ r === null && (r = e.ownerDocument.createElement("style"), r.setAttribute("data-vdt", ""), e.prepend(r)), r.textContent = t;
48
+ }, c = ({ children: r, target: i }) => {
49
+ let [c, l] = t(null);
50
+ return e(() => {
51
+ let e = document, t = i ?? e, n = t.createElement("div");
52
+ n.className = "vdt-root", n.setAttribute("data-voltro-devtools", ""), t.documentElement.append(n);
53
+ let r = n.attachShadow({ mode: "open" }), c = t.createElement("div");
54
+ c.setAttribute("data-vdt-mount", ""), r.append(c);
55
+ let u = t === e ? null : t.createElement("style");
56
+ u !== null && (u.setAttribute("data-vdt-properties", ""), t.head.append(u));
57
+ let d = "", f = () => {
58
+ if (u !== null) {
59
+ let t = a(e);
60
+ u.textContent !== t && (u.textContent = t);
61
+ }
62
+ let t = o(e);
63
+ t !== d && (d = t, s(r, t));
64
+ };
65
+ f();
66
+ let p = typeof MutationObserver > "u" ? null : new MutationObserver(() => f());
67
+ return p?.observe(e.head, {
68
+ childList: !0,
69
+ subtree: !0,
70
+ characterData: !0
71
+ }), l(c), () => {
72
+ p?.disconnect(), n.remove(), u?.remove(), l(null);
73
+ };
74
+ }, [i]), c === null ? null : n(r, c);
75
+ };
76
+ //#endregion
77
+ export { c as ShadowHost, o as collectOverlayCss, a as collectPropertyRegistrations };