@plitzi/sdk-dev-tools 0.38.24 → 0.39.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +162 -1
  2. package/dist/DevToolsContainer.d.ts +11 -1
  3. package/dist/DevToolsContainer.mjs +68 -62
  4. package/dist/DevToolsContextProvider.mjs +5 -3
  5. package/dist/PageContext.d.ts +7 -0
  6. package/dist/PageContext.mjs +6 -0
  7. package/dist/agentInspector/flowRuns.d.ts +1 -1
  8. package/dist/agentInspector/flowRuns.mjs +22 -15
  9. package/dist/agentInspector/index.d.ts +2 -0
  10. package/dist/agentInspector/index.mjs +1 -0
  11. package/dist/agentInspector/inspector.d.ts +31 -1
  12. package/dist/agentInspector/inspector.mjs +57 -19
  13. package/dist/agentInspector/report.d.ts +27 -2
  14. package/dist/agentInspector/report.mjs +59 -38
  15. package/dist/agentInspector/useAgentInspector.d.ts +3 -2
  16. package/dist/agentInspector/useAgentInspector.mjs +20 -16
  17. package/dist/components/DevToolsIndicator/DevToolsIndicator.mjs +47 -25
  18. package/dist/components/DevToolsIndicator/sideAt.d.ts +7 -0
  19. package/dist/components/DevToolsIndicator/sideAt.mjs +4 -0
  20. package/dist/components/DevToolsOverlay/DevToolsOverlay.d.ts +3 -4
  21. package/dist/components/DevToolsOverlay/DevToolsOverlay.mjs +4 -4
  22. package/dist/components/DevToolsPanel/DevToolsBody.d.ts +4 -1
  23. package/dist/components/DevToolsPanel/DevToolsBody.mjs +33 -31
  24. package/dist/components/DevToolsPanel/DevToolsButton.d.ts +3 -1
  25. package/dist/components/DevToolsPanel/DevToolsButton.mjs +4 -3
  26. package/dist/components/DevToolsPanel/DevToolsHeader.d.ts +3 -1
  27. package/dist/components/DevToolsPanel/DevToolsHeader.mjs +52 -34
  28. package/dist/components/DevToolsPanel/DevToolsPanel.d.ts +3 -1
  29. package/dist/components/DevToolsPanel/DevToolsPanel.mjs +50 -47
  30. package/dist/components/DevToolsPanel/tabs/QaViewer/QaReplayButton.mjs +2 -2
  31. package/dist/components/DevToolsPanel/tabs/RunViewer/RunReport.d.ts +7 -0
  32. package/dist/components/DevToolsPanel/tabs/RunViewer/RunReport.mjs +97 -0
  33. package/dist/components/DevToolsPanel/tabs/RunViewer/RunTaskRow.d.ts +6 -0
  34. package/dist/components/DevToolsPanel/tabs/RunViewer/RunTaskRow.mjs +79 -0
  35. package/dist/components/DevToolsPanel/tabs/RunViewer/RunViewer.d.ts +11 -0
  36. package/dist/components/DevToolsPanel/tabs/RunViewer/RunViewer.mjs +222 -0
  37. package/dist/components/DevToolsPanel/tabs/RunViewer/index.d.ts +3 -0
  38. package/dist/components/DevToolsPanel/tabs/RunViewer/index.mjs +6 -0
  39. package/dist/components/DevToolsPanel/tabs/RunViewer/reportHelpers.d.ts +9 -0
  40. package/dist/components/DevToolsPanel/tabs/RunViewer/reportHelpers.mjs +39 -0
  41. package/dist/components/DevToolsPanel/tabs/RunViewer/stepRecorder.d.ts +27 -0
  42. package/dist/components/DevToolsPanel/tabs/RunViewer/stepRecorder.mjs +51 -0
  43. package/dist/components/DevToolsPanel/tabs/RunViewer/usePointAt.d.ts +14 -0
  44. package/dist/components/DevToolsPanel/tabs/RunViewer/usePointAt.mjs +33 -0
  45. package/dist/components/DevToolsPanel/tabs/RunViewer/useRunSnapshot.d.ts +9 -0
  46. package/dist/components/DevToolsPanel/tabs/RunViewer/useRunSnapshot.mjs +22 -0
  47. package/dist/qa/QaContext.d.ts +2 -5
  48. package/dist/qa/QaContext.mjs +28 -31
  49. package/dist/qa/QaLayer.mjs +78 -77
  50. package/dist/qa/overlays/QaInspector.mjs +28 -27
  51. package/dist/qa/overlays/QaTabOrder.mjs +2 -2
  52. package/dist/qa/overlays/QaXrayTags.mjs +22 -22
  53. package/dist/useNarrowWindow.d.ts +8 -0
  54. package/dist/useNarrowWindow.mjs +13 -0
  55. package/package.json +4 -4
@@ -1,11 +1,12 @@
1
- import { useScopeSelector as e } from "../../scope/useScope.mjs";
2
- import t from "./DevToolsButton.mjs";
3
- import n from "./ThemeControl.mjs";
4
- import r from "clsx";
5
- import { useCallback as i } from "react";
6
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
1
+ import e from "../../useNarrowWindow.mjs";
2
+ import { useScopeSelector as t } from "../../scope/useScope.mjs";
3
+ import n from "./DevToolsButton.mjs";
4
+ import r from "./ThemeControl.mjs";
5
+ import i from "clsx";
6
+ import { useCallback as a, useEffect as o, useRef as s } from "react";
7
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
7
8
  //#region src/components/DevToolsPanel/DevToolsHeader.tsx
8
- var s = [
9
+ var u = [
9
10
  {
10
11
  id: "logs",
11
12
  label: "Logs",
@@ -60,56 +61,73 @@ var s = [
60
61
  id: "qa",
61
62
  label: "QA",
62
63
  icon: "fa-solid fa-ruler-combined"
64
+ },
65
+ {
66
+ id: "run",
67
+ label: "Run",
68
+ icon: "fa-solid fa-people-group"
63
69
  }
64
- ], c = ({ tabSelected: c, orientation: l = "vertical", onChangeOrientation: u, onCollapse: d, onTabSelect: f, qa: p = !1 }) => {
65
- let m = p ? s : s.filter((e) => e.id !== "qa"), { options: h, value: g, onSelect: _ } = e(), v = i(() => {
66
- u?.(l === "horizontal" ? "vertical" : "horizontal");
67
- }, [l, u]), y = i((e) => () => f?.(e), [f]), b = i((e) => _(e.target.value), [_]);
68
- return /* @__PURE__ */ o("div", {
70
+ ], d = ({ tabSelected: d, orientation: f = "vertical", onChangeOrientation: p, onCollapse: m, onTabSelect: h, qa: g = !1, run: _ = !1 }) => {
71
+ let v = u.filter((e) => (e.id !== "qa" || g) && (e.id !== "run" || _)), y = e(), b = s(null);
72
+ o(() => {
73
+ b.current?.querySelector("[aria-selected=\"true\"]")?.scrollIntoView({
74
+ block: "nearest",
75
+ inline: "nearest"
76
+ });
77
+ }, [d]);
78
+ let { options: x, value: S, onSelect: C } = t(), w = a(() => {
79
+ p?.(f === "horizontal" ? "vertical" : "horizontal");
80
+ }, [f, p]), T = a((e) => () => h?.(e), [h]), E = a((e) => C(e.target.value), [C]);
81
+ return /* @__PURE__ */ l("div", {
69
82
  className: "flex shrink-0 items-stretch justify-between border-b border-zinc-200 bg-zinc-100 select-none dark:border-zinc-700 dark:bg-zinc-800",
70
- children: [/* @__PURE__ */ a("div", {
71
- className: "flex items-stretch overflow-x-auto",
72
- children: m.map((e) => {
73
- let t = c === e.id;
74
- return /* @__PURE__ */ o("button", {
75
- onClick: y(e.id),
76
- className: r("flex cursor-pointer items-center gap-1.5 border-b-2 px-3 py-2 font-medium transition-colors", {
83
+ children: [/* @__PURE__ */ c("div", {
84
+ ref: b,
85
+ role: "tablist",
86
+ className: "flex min-w-0 items-stretch overflow-x-auto",
87
+ children: v.map((e) => {
88
+ let t = d === e.id;
89
+ return /* @__PURE__ */ l("button", {
90
+ role: "tab",
91
+ "aria-selected": t,
92
+ onClick: T(e.id),
93
+ className: i("flex cursor-pointer items-center gap-1.5 border-b-2 px-3 py-2 font-medium transition-colors", {
77
94
  "border-violet-500 text-violet-600 dark:text-violet-400": t,
78
95
  "border-transparent text-zinc-500 hover:bg-zinc-200/70 hover:text-zinc-800 dark:text-zinc-400 dark:hover:bg-zinc-700/50 dark:hover:text-zinc-100": !t
79
96
  }),
80
- children: [/* @__PURE__ */ a("i", { className: r(e.icon, "text-[10px]") }), e.label]
97
+ children: [/* @__PURE__ */ c("i", { className: i(e.icon, "text-[10px]") }), e.label]
81
98
  }, e.id);
82
99
  })
83
- }), /* @__PURE__ */ o("div", {
100
+ }), /* @__PURE__ */ l("div", {
84
101
  className: "flex shrink-0 items-center gap-1 border-l border-zinc-200 px-2 dark:border-zinc-700",
85
102
  children: [
86
- h.length > 0 && /* @__PURE__ */ a("select", {
87
- value: g ?? "",
88
- onChange: b,
103
+ x.length > 0 && /* @__PURE__ */ c("select", {
104
+ value: S ?? "",
105
+ onChange: E,
89
106
  title: "Instance / StoreProvider driving the panel",
90
107
  className: "max-w-52 rounded border border-zinc-300 bg-white px-1 py-0.5 text-[11px] text-zinc-700 dark:border-zinc-600 dark:bg-zinc-900 dark:text-zinc-200",
91
- children: h.map((e) => /* @__PURE__ */ a("optgroup", {
108
+ children: x.map((e) => /* @__PURE__ */ c("optgroup", {
92
109
  label: e.label,
93
- children: e.options.map((e) => /* @__PURE__ */ a("option", {
110
+ children: e.options.map((e) => /* @__PURE__ */ c("option", {
94
111
  value: e.value,
95
112
  children: e.label
96
113
  }, e.value))
97
114
  }, e.label))
98
115
  }),
99
- /* @__PURE__ */ a(n, {}),
100
- /* @__PURE__ */ a(t, {
101
- iconClassName: r("fa-solid fa-table-columns", { "rotate-90": l === "vertical" }),
102
- title: l === "horizontal" ? "Switch to side panel" : "Switch to bottom panel",
103
- onClick: v
116
+ /* @__PURE__ */ c(r, {}),
117
+ /* @__PURE__ */ c(n, {
118
+ iconClassName: i("fa-solid fa-table-columns", { "rotate-90": f === "vertical" }),
119
+ title: y ? "At the bottom while the window is under 900 px: beside it, the page would have no room" : f === "horizontal" ? "Switch to side panel" : "Switch to bottom panel",
120
+ disabled: y,
121
+ onClick: w
104
122
  }),
105
- /* @__PURE__ */ a(t, {
123
+ /* @__PURE__ */ c(n, {
106
124
  iconClassName: "fa-solid fa-xmark",
107
125
  title: "Collapse to the indicator",
108
- onClick: d
126
+ onClick: m
109
127
  })
110
128
  ]
111
129
  })]
112
130
  });
113
131
  };
114
132
  //#endregion
115
- export { c as default };
133
+ export { d as default };
@@ -13,6 +13,8 @@ export type DevToolsPanelProps = {
13
13
  onChangeOrientation?: (orientation: Orientation) => void;
14
14
  /** Whether the QA tab is offered. */
15
15
  qa?: boolean;
16
+ /** Whether the page's server previews a run: the Run tab asks it for the run only then. */
17
+ run?: boolean;
16
18
  };
17
- declare const DevToolsPanel: ({ className, orientation, tabSelected, logTypeFilter, onCollapse, onTabSelect, onChangeOrientation, qa }: DevToolsPanelProps) => import('react').JSX.Element;
19
+ declare const DevToolsPanel: ({ className, orientation, tabSelected, logTypeFilter, onCollapse, onTabSelect, onChangeOrientation, qa, run: previewsRun }: DevToolsPanelProps) => import('react').JSX.Element;
18
20
  export default DevToolsPanel;
@@ -1,62 +1,65 @@
1
- import e from "./DevToolsBody.mjs";
2
- import t from "./DevToolsHeader.mjs";
3
- import n from "./DevToolsSubHeader.mjs";
4
- import r from "@plitzi/plitzi-ui/hooks/useStorage";
5
- import i from "clsx";
6
- import { useCallback as a, useMemo as o, useRef as s, useState as c } from "react";
7
- import { DEV_TOOLS_ATTRIBUTE as l } from "@plitzi/sdk-shared/devTools";
8
- import { useCommonStore as u } from "@plitzi/sdk-shared/store";
9
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
10
- import p from "@plitzi/plitzi-ui/ContainerResizable";
1
+ import e from "./tabs/RunViewer/useRunSnapshot.mjs";
2
+ import t from "./DevToolsBody.mjs";
3
+ import n from "./DevToolsHeader.mjs";
4
+ import r from "./DevToolsSubHeader.mjs";
5
+ import i from "@plitzi/plitzi-ui/hooks/useStorage";
6
+ import a from "clsx";
7
+ import { useCallback as o, useMemo as s, useRef as c, useState as l } from "react";
8
+ import { DEV_TOOLS_ATTRIBUTE as u } from "@plitzi/sdk-shared/devTools";
9
+ import { useCommonStore as d } from "@plitzi/sdk-shared/store";
10
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
11
+ import m from "@plitzi/plitzi-ui/ContainerResizable";
11
12
  //#region src/components/DevToolsPanel/DevToolsPanel.tsx
12
- var m = "vertical", h = "horizontal", g = ({ className: m, orientation: h = "vertical", tabSelected: g, logTypeFilter: _, onCollapse: v, onTabSelect: y, onChangeOrientation: b, qa: x = !1 }) => {
13
- let [S, C] = r("plitzi-sdk.dev-tools.size", {
13
+ var h = "vertical", g = "horizontal", _ = ({ className: h, orientation: g = "vertical", tabSelected: _, logTypeFilter: v, onCollapse: y, onTabSelect: b, onChangeOrientation: x, qa: S = !1, run: C = !1 }) => {
14
+ let [w, T] = i("plitzi-sdk.dev-tools.size", {
14
15
  width: 500,
15
16
  height: 200
16
- }), [w] = u("navigation.currentPageId"), [T, E] = c(), D = o(() => h === "vertical" ? ["w"] : ["n"], [h]), O = s(typeof document < "u" ? document.querySelector(".plitzi-sdk") : null), k = a((e) => E(e), [E]), A = a((e, t) => C((n) => ({
17
+ }), [E] = d("navigation.currentPageId"), [D, O] = l(), k = e(C), A = _ === "run" && k === void 0 || _ === "qa" && !S ? "logs" : _, j = s(() => g === "vertical" ? ["w"] : ["n"], [g]), M = c(typeof document < "u" ? document.querySelector(".plitzi-sdk") : null), N = o((e) => O(e), [O]), P = o((e, t) => T((n) => ({
17
18
  width: Number.isFinite(e) ? e : n.width,
18
19
  height: Number.isFinite(t) ? t : n.height
19
- })), [C]);
20
- return /* @__PURE__ */ d(p, {
21
- className: i("component__container-resizable-sidebar relative z-[1000000] text-xs", m, { "h-full": h === "vertical" }),
22
- minConstraintsX: h === "vertical" ? 500 : Infinity,
23
- maxConstraintsX: h === "vertical" ? 1e3 : Infinity,
24
- minConstraintsY: h === "vertical" ? Infinity : 34,
25
- maxConstraintsY: h === "vertical" ? Infinity : 600,
26
- width: h === "vertical" ? S.width : Infinity,
27
- height: h === "vertical" ? Infinity : S.height,
28
- resizeHandles: D,
29
- parentRef: O,
20
+ })), [T]);
21
+ return /* @__PURE__ */ f(m, {
22
+ className: a("component__container-resizable-sidebar relative z-[1000000] text-xs", h, { "h-full": g === "vertical" }),
23
+ minConstraintsX: g === "vertical" ? 500 : Infinity,
24
+ maxConstraintsX: g === "vertical" ? 1e3 : Infinity,
25
+ minConstraintsY: g === "vertical" ? Infinity : 34,
26
+ maxConstraintsY: g === "vertical" ? Infinity : 600,
27
+ width: g === "vertical" ? w.width : Infinity,
28
+ height: g === "vertical" ? Infinity : w.height,
29
+ resizeHandles: j,
30
+ parentRef: M,
30
31
  autoGrow: !1,
31
- onChange: A,
32
- children: /* @__PURE__ */ f("div", {
33
- className: "flex h-full w-full flex-col bg-white text-zinc-800 dark:bg-zinc-900 dark:text-zinc-200",
34
- [l]: "",
32
+ onChange: P,
33
+ children: /* @__PURE__ */ p("div", {
34
+ className: "flex h-full min-h-0 w-full flex-col overflow-hidden bg-white text-zinc-800 dark:bg-zinc-900 dark:text-zinc-200",
35
+ [u]: "",
35
36
  children: [
36
- /* @__PURE__ */ d(t, {
37
- orientation: h,
38
- onChangeOrientation: b,
39
- onCollapse: v,
40
- onTabSelect: y,
41
- tabSelected: g,
42
- qa: x
37
+ /* @__PURE__ */ f(n, {
38
+ orientation: g,
39
+ onChangeOrientation: x,
40
+ onCollapse: y,
41
+ onTabSelect: b,
42
+ tabSelected: A,
43
+ qa: S,
44
+ run: k !== void 0
43
45
  }),
44
- ["store", "elements"].includes(g) && /* @__PURE__ */ d(n, {
45
- elementSelected: T,
46
- onSelectElement: k,
47
- currentPageId: w
46
+ ["store", "elements"].includes(A) && /* @__PURE__ */ f(r, {
47
+ elementSelected: D,
48
+ onSelectElement: N,
49
+ currentPageId: E
48
50
  }),
49
- /* @__PURE__ */ d(e, {
50
- orientation: h,
51
- tabSelected: g,
52
- logTypeFilter: _,
53
- elementSelected: T,
54
- onSelectElement: k,
55
- qa: x
51
+ /* @__PURE__ */ f(t, {
52
+ orientation: g,
53
+ tabSelected: A,
54
+ logTypeFilter: v,
55
+ elementSelected: D,
56
+ onSelectElement: N,
57
+ qa: S,
58
+ run: k
56
59
  })
57
60
  ]
58
61
  })
59
62
  });
60
63
  };
61
64
  //#endregion
62
- export { h as ORIENTATION_HORIZONTAL, m as ORIENTATION_VERTICAL, g as default };
65
+ export { g as ORIENTATION_HORIZONTAL, h as ORIENTATION_VERTICAL, _ as default };
@@ -1,10 +1,10 @@
1
- import e from "../../../../qa/QaContext.mjs";
1
+ import e from "../../../../PageContext.mjs";
2
2
  import { use as t, useCallback as n } from "react";
3
3
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
4
  import { isMotionAnimation as a } from "@plitzi/sdk-shared/schema";
5
5
  //#region src/components/DevToolsPanel/tabs/QaViewer/QaReplayButton.tsx
6
6
  var o = () => {
7
- let { pageRef: o } = t(e), s = n(() => {
7
+ let o = t(e), s = n(() => {
8
8
  o.current?.getAnimations({ subtree: !0 }).filter(a).forEach((e) => {
9
9
  e.cancel(), e.play();
10
10
  });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * A bug the person sees on the preview, handed to the run's lead as it is: they point at the element and say what is
3
+ * wrong; the address, the window, the theme and what they did since the page loaded go with it, and the lead gets the
4
+ * command that plays it again. Nothing of it is sent until they press Send.
5
+ */
6
+ declare const RunReport: () => import('react').JSX.Element;
7
+ export default RunReport;
@@ -0,0 +1,97 @@
1
+ import { clearRecordedSteps as e } from "./stepRecorder.mjs";
2
+ import t from "../../../../PageContext.mjs";
3
+ import { reportOf as n, sendReport as r } from "./reportHelpers.mjs";
4
+ import i from "./usePointAt.mjs";
5
+ import a from "clsx";
6
+ import { use as o, useCallback as s, useState as c } from "react";
7
+ import { useTheme as l } from "@plitzi/sdk-shared/theme";
8
+ import { RUN_REPORT_TEXT_MOST as u } from "@plitzi/sdk-shared/runs";
9
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
10
+ //#region src/components/DevToolsPanel/tabs/RunViewer/RunReport.tsx
11
+ var p = () => {
12
+ let { resolvedTheme: p } = l(), m = o(t), { pointing: h, element: g, missed: _, point: v, forget: y } = i(), [b, x] = c(""), [S, C] = c({ kind: "idle" }), w = s((e) => x(e.target.value), []), T = s(async () => {
13
+ C({ kind: "sending" });
14
+ let t = await r(n(b, g, p === "dark" ? "dark" : "light", m.current));
15
+ "failed" in t ? C({
16
+ kind: "failed",
17
+ why: t.failed
18
+ }) : (e(), x(""), y(), C({
19
+ kind: "sent",
20
+ note: t.sent
21
+ }));
22
+ }, [
23
+ b,
24
+ g,
25
+ p,
26
+ m,
27
+ y
28
+ ]), E = s(() => void T(), [T]);
29
+ return /* @__PURE__ */ f("div", {
30
+ className: "flex flex-col gap-1.5",
31
+ children: [
32
+ /* @__PURE__ */ f("div", {
33
+ className: "flex flex-wrap items-center gap-1.5",
34
+ children: [
35
+ /* @__PURE__ */ f("button", {
36
+ type: "button",
37
+ onClick: v,
38
+ "aria-pressed": h,
39
+ className: a("flex h-6 items-center gap-1 rounded px-2 text-xs font-medium transition-colors", {
40
+ "bg-violet-500 text-white": h,
41
+ "text-zinc-600 hover:bg-zinc-200 dark:text-zinc-300 dark:hover:bg-zinc-700": !h
42
+ }),
43
+ children: [/* @__PURE__ */ d("i", { className: "fa-solid fa-crosshairs" }), "Point at it"]
44
+ }),
45
+ h && /* @__PURE__ */ d("span", {
46
+ className: "text-[11px] text-zinc-500 dark:text-zinc-400",
47
+ children: "Click the element on the page — Esc stops"
48
+ }),
49
+ !h && g && /* @__PURE__ */ f("span", {
50
+ className: "flex items-center gap-1 rounded bg-zinc-100 px-1.5 py-0.5 font-mono text-[11px] dark:bg-zinc-800",
51
+ children: [g, /* @__PURE__ */ d("button", {
52
+ type: "button",
53
+ onClick: y,
54
+ title: "Point at nothing",
55
+ className: "text-zinc-400 hover:text-zinc-600",
56
+ children: /* @__PURE__ */ d("i", { className: "fa-solid fa-xmark" })
57
+ })]
58
+ }),
59
+ !h && _ && /* @__PURE__ */ d("span", {
60
+ className: "text-[11px] text-amber-700 dark:text-amber-300",
61
+ children: "That is nothing of the page’s own: point at another, or send it for the page as a whole"
62
+ })
63
+ ]
64
+ }),
65
+ /* @__PURE__ */ d("textarea", {
66
+ value: b,
67
+ onChange: w,
68
+ maxLength: u,
69
+ rows: 2,
70
+ placeholder: "What is wrong — sent with where you are, the width and what you did on the page",
71
+ className: "w-full resize-y rounded border border-zinc-200 bg-white px-1.5 py-1 text-zinc-700 outline-none placeholder:text-zinc-400 focus:border-violet-400 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-100 dark:placeholder:text-zinc-500"
72
+ }),
73
+ /* @__PURE__ */ f("div", {
74
+ className: "flex flex-wrap items-center gap-2",
75
+ children: [
76
+ /* @__PURE__ */ f("button", {
77
+ type: "button",
78
+ onClick: E,
79
+ disabled: b.trim() === "" || S.kind === "sending",
80
+ className: "flex h-6 items-center gap-1 rounded bg-violet-500 px-2 text-xs font-medium text-white hover:bg-violet-600 disabled:opacity-50",
81
+ children: [/* @__PURE__ */ d("i", { className: "fa-solid fa-paper-plane" }), "Send to the lead"]
82
+ }),
83
+ S.kind === "sent" && /* @__PURE__ */ d("span", {
84
+ className: "text-[11px] text-emerald-700 dark:text-emerald-400",
85
+ children: S.note
86
+ }),
87
+ S.kind === "failed" && /* @__PURE__ */ f("span", {
88
+ className: "text-[11px] text-red-600 dark:text-red-400",
89
+ children: ["Not sent: ", S.why]
90
+ })
91
+ ]
92
+ })
93
+ ]
94
+ });
95
+ };
96
+ //#endregion
97
+ export { p as default };
@@ -0,0 +1,6 @@
1
+ import { RunSnapshotTask } from '@plitzi/sdk-shared/runs';
2
+ /** One task of the run: its state, who has it, how far, why it waits — and, opened, the files it writes. */
3
+ declare const RunTaskRow: ({ task }: {
4
+ task: RunSnapshotTask;
5
+ }) => import('react').JSX.Element;
6
+ export default RunTaskRow;
@@ -0,0 +1,79 @@
1
+ import e from "clsx";
2
+ import { useCallback as t, useState as n } from "react";
3
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
+ //#region src/components/DevToolsPanel/tabs/RunViewer/RunTaskRow.tsx
5
+ var a = {
6
+ pending: "fa-regular fa-circle",
7
+ ready: "fa-regular fa-circle-dot",
8
+ "in-progress": "fa-solid fa-play",
9
+ waiting: "fa-solid fa-hourglass-half",
10
+ "in-review": "fa-solid fa-magnifying-glass",
11
+ "changes-requested": "fa-solid fa-rotate-left",
12
+ done: "fa-solid fa-check",
13
+ blocked: "fa-solid fa-ban",
14
+ failed: "fa-solid fa-xmark"
15
+ }, o = {
16
+ done: "text-emerald-600 dark:text-emerald-400",
17
+ "in-review": "text-violet-600 dark:text-violet-400",
18
+ "in-progress": "text-sky-600 dark:text-sky-400",
19
+ "changes-requested": "text-amber-600 dark:text-amber-400",
20
+ blocked: "text-red-600 dark:text-red-400",
21
+ failed: "text-red-600 dark:text-red-400"
22
+ }, s = (e) => [e.agent, e.reviewer ? `reviewed by ${e.reviewer}` : void 0].filter(Boolean).join(" · "), c = ({ task: t }) => t.status === "done" || t.urgency !== "critical" && t.urgency !== "high" ? null : /* @__PURE__ */ r("span", {
23
+ title: `${t.urgency}: its priority, or that of a task waiting on it`,
24
+ className: e("shrink-0 text-[10px] font-bold", t.urgency === "critical" ? "text-red-600 dark:text-red-400" : "text-amber-600 dark:text-amber-400"),
25
+ children: t.urgency === "critical" ? "‼" : "!"
26
+ }), l = ({ task: l }) => {
27
+ let [u, d] = n(!1), f = t(() => d((e) => !e), []);
28
+ return /* @__PURE__ */ i("div", {
29
+ className: "border-b border-zinc-200 last:border-b-0 dark:border-zinc-700",
30
+ children: [
31
+ /* @__PURE__ */ i("button", {
32
+ type: "button",
33
+ onClick: f,
34
+ "aria-expanded": u,
35
+ className: "flex w-full items-center gap-2 px-2 py-1.5 text-left hover:bg-zinc-50 dark:hover:bg-zinc-800",
36
+ children: [
37
+ /* @__PURE__ */ r("i", { className: e(a[l.status] ?? "fa-regular fa-circle", "w-3 text-[10px]", o[l.status]) }),
38
+ /* @__PURE__ */ r(c, { task: l }),
39
+ /* @__PURE__ */ r("span", {
40
+ className: "shrink-0 font-mono text-[11px] text-zinc-500 dark:text-zinc-400",
41
+ children: l.id
42
+ }),
43
+ /* @__PURE__ */ r("span", {
44
+ className: "min-w-0 grow truncate",
45
+ children: l.title
46
+ }),
47
+ l.fraction !== void 0 && /* @__PURE__ */ i("span", {
48
+ className: "shrink-0 text-[10px] text-zinc-400",
49
+ children: [Math.round(l.fraction * 100), " %"]
50
+ }),
51
+ /* @__PURE__ */ r("span", {
52
+ className: "shrink-0 text-[10px] text-zinc-400",
53
+ children: s(l)
54
+ })
55
+ ]
56
+ }),
57
+ l.why && /* @__PURE__ */ r("div", {
58
+ className: e("truncate px-7 pb-1 text-[10px]", l.status === "blocked" ? "text-red-600 dark:text-red-400" : "text-zinc-500 dark:text-zinc-400"),
59
+ title: l.why,
60
+ children: l.why
61
+ }),
62
+ u && /* @__PURE__ */ i("div", {
63
+ className: "flex flex-col gap-0.5 px-7 pb-2 text-[11px] text-zinc-500 dark:text-zinc-400",
64
+ children: [/* @__PURE__ */ i("span", { children: [
65
+ l.status,
66
+ l.round > 0 ? ` · round ${String(l.round)}` : "",
67
+ " · ",
68
+ l.role,
69
+ l.step ? ` · ${l.step}` : ""
70
+ ] }), l.files.map((e) => /* @__PURE__ */ r("span", {
71
+ className: "font-mono",
72
+ children: e
73
+ }, e))]
74
+ })
75
+ ]
76
+ });
77
+ };
78
+ //#endregion
79
+ export { l as default };
@@ -0,0 +1,11 @@
1
+ import { RunSnapshot } from '@plitzi/sdk-shared/runs';
2
+ /**
3
+ * The run of agents this preview serves (`plitzi run preview`): what the page is being built by — how far it is, each
4
+ * task by where it stands, who has it and who reviews it, every agent, and what happened last. The page shows the
5
+ * approved work as each task is approved; this says what is coming. The run is worked from the terminal; what the
6
+ * person sees wrong on the page is reported from here, to its lead (`RunReport`).
7
+ */
8
+ declare const RunViewer: ({ snapshot }: {
9
+ snapshot?: RunSnapshot;
10
+ }) => import('react').JSX.Element;
11
+ export default RunViewer;