@plitzi/sdk-dev-tools 0.35.8 → 0.35.10

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 (39) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/components/DevToolsPanel/tabs/ActionsViewer/ActionsViewer.d.ts +8 -1
  3. package/dist/components/DevToolsPanel/tabs/ActionsViewer/ActionsViewer.mjs +48 -138
  4. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/ActionsToolbar/ActionsToolbar.d.ts +12 -0
  5. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/ActionsToolbar/ActionsToolbar.mjs +68 -0
  6. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/ActionsToolbar/index.d.ts +3 -0
  7. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/ActionsToolbar/index.mjs +5 -0
  8. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/DetailShell/DetailShell.d.ts +7 -0
  9. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/DetailShell/DetailShell.mjs +26 -0
  10. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/DetailShell/index.d.ts +3 -0
  11. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/DetailShell/index.mjs +5 -0
  12. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/FlowTimeline/FlowTimeline.d.ts +15 -0
  13. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/FlowTimeline/FlowTimeline.mjs +29 -0
  14. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/FlowTimeline/index.d.ts +3 -0
  15. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/FlowTimeline/index.mjs +5 -0
  16. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/PayloadView/PayloadView.d.ts +6 -0
  17. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/PayloadView/PayloadView.mjs +26 -0
  18. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/PayloadView/index.d.ts +3 -0
  19. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/PayloadView/index.mjs +5 -0
  20. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/RunDetail/RunDetail.d.ts +9 -0
  21. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/RunDetail/RunDetail.mjs +140 -0
  22. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/RunDetail/index.d.ts +3 -0
  23. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/RunDetail/index.mjs +5 -0
  24. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/RunList/RunList.d.ts +11 -0
  25. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/RunList/RunList.mjs +24 -0
  26. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/RunList/index.d.ts +3 -0
  27. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/RunList/index.mjs +5 -0
  28. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/RunRow/RunRow.d.ts +10 -0
  29. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/RunRow/RunRow.mjs +88 -0
  30. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/RunRow/index.d.ts +3 -0
  31. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/RunRow/index.mjs +5 -0
  32. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/StepRow/StepRow.d.ts +9 -0
  33. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/StepRow/StepRow.mjs +57 -0
  34. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/StepRow/index.d.ts +3 -0
  35. package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/StepRow/index.mjs +5 -0
  36. package/dist/components/DevToolsPanel/tabs/ActionsViewer/helpers.d.ts +53 -0
  37. package/dist/components/DevToolsPanel/tabs/ActionsViewer/helpers.mjs +65 -0
  38. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteraction.mjs +15 -15
  39. package/package.json +105 -5
@@ -0,0 +1,140 @@
1
+ import { MODE_LABEL as e, failedStep as t, formatMs as n, formatTime as r, isLive as i, runDuration as a, statusTone as o, traceResultOf as s } from "../../helpers.mjs";
2
+ import c from "../FlowTimeline/index.mjs";
3
+ import l from "../PayloadView/index.mjs";
4
+ import u from "clsx";
5
+ import { useMemo as d } from "react";
6
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
7
+ //#region src/components/DevToolsPanel/tabs/ActionsViewer/components/RunDetail/RunDetail.tsx
8
+ var h = {
9
+ info: "bg-violet-500/15 text-violet-600 dark:text-violet-400",
10
+ success: "bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",
11
+ danger: "bg-red-500/15 text-red-600 dark:text-red-400",
12
+ warning: "bg-amber-500/15 text-amber-600 dark:text-amber-400",
13
+ custom: "bg-zinc-500/15 text-zinc-500 dark:text-zinc-400"
14
+ }, g = "This page was sent what the flow DID, not what each step read or answered. Open the action in the builder, or run the deployment in dev mode, to inspect a step.", _ = "The server did not send the steps for this run: the action is behind a session, or this page is not authorized to debug it.", v = "The flow is still running. Its steps arrive with the answer.", y = ({ run: y, selectedStepId: b, onSelectStep: x }) => {
15
+ let S = t(y.steps), C = a(y), w = d(() => b === void 0 ? void 0 : s(y.trace, b), [y.trace, b]);
16
+ return /* @__PURE__ */ m(f, { children: [
17
+ /* @__PURE__ */ m("div", {
18
+ className: "flex items-center gap-1.5",
19
+ children: [/* @__PURE__ */ p("span", {
20
+ className: "truncate text-xs font-medium text-zinc-700 dark:text-zinc-100",
21
+ children: y.actionId || "(no action named)"
22
+ }), /* @__PURE__ */ p("span", {
23
+ className: u("shrink-0 rounded px-1 py-0.5 text-[9px]", h[o(y.status)]),
24
+ children: y.reason ?? y.status
25
+ })]
26
+ }),
27
+ y.error !== void 0 && /* @__PURE__ */ m("div", {
28
+ className: "mt-1 flex flex-col gap-1 rounded border border-red-200 bg-red-50 px-2 py-1.5 dark:border-red-500/30 dark:bg-red-500/10",
29
+ children: [/* @__PURE__ */ m("span", {
30
+ className: "font-medium text-red-600 dark:text-red-400",
31
+ children: [/* @__PURE__ */ p("i", { className: "fa-solid fa-circle-exclamation mr-1" }), S === void 0 ? "The run failed" : `Failed at “${S.title}”`]
32
+ }), /* @__PURE__ */ p("span", {
33
+ className: "break-words text-red-700 dark:text-red-300",
34
+ children: y.error
35
+ })]
36
+ }),
37
+ /* @__PURE__ */ p("div", {
38
+ className: "mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",
39
+ children: "Flow"
40
+ }),
41
+ y.steps === void 0 && /* @__PURE__ */ p("span", {
42
+ className: "text-zinc-400 italic dark:text-zinc-500",
43
+ children: i(y) ? v : _
44
+ }),
45
+ y.steps !== void 0 && /* @__PURE__ */ p(c, {
46
+ steps: y.steps,
47
+ selectedStepId: b,
48
+ onSelectStep: x
49
+ }),
50
+ b !== void 0 && w === void 0 && /* @__PURE__ */ p("span", {
51
+ className: "text-zinc-400 italic dark:text-zinc-500",
52
+ children: g
53
+ }),
54
+ w !== void 0 && /* @__PURE__ */ p("div", {
55
+ className: "overflow-auto rounded border border-zinc-200 dark:border-zinc-700",
56
+ children: /* @__PURE__ */ p(l, { value: w })
57
+ }),
58
+ /* @__PURE__ */ p("div", {
59
+ className: "mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",
60
+ children: "Run"
61
+ }),
62
+ /* @__PURE__ */ m("div", {
63
+ className: "flex justify-between gap-2",
64
+ children: [/* @__PURE__ */ p("span", {
65
+ className: "text-zinc-400 dark:text-zinc-500",
66
+ children: "Mode"
67
+ }), /* @__PURE__ */ p("span", {
68
+ className: "text-zinc-700 dark:text-zinc-200",
69
+ children: e[y.mode]
70
+ })]
71
+ }),
72
+ /* @__PURE__ */ m("div", {
73
+ className: "flex justify-between gap-2",
74
+ children: [/* @__PURE__ */ p("span", {
75
+ className: "text-zinc-400 dark:text-zinc-500",
76
+ children: "Started"
77
+ }), /* @__PURE__ */ p("span", {
78
+ className: "text-zinc-700 tabular-nums dark:text-zinc-200",
79
+ children: r(y.startedAt)
80
+ })]
81
+ }),
82
+ /* @__PURE__ */ m("div", {
83
+ className: "flex justify-between gap-2",
84
+ children: [/* @__PURE__ */ p("span", {
85
+ className: "text-zinc-400 dark:text-zinc-500",
86
+ children: "Took"
87
+ }), /* @__PURE__ */ p("span", {
88
+ className: "text-zinc-700 tabular-nums dark:text-zinc-200",
89
+ children: C === void 0 ? "still running" : n(C)
90
+ })]
91
+ }),
92
+ y.elementId !== void 0 && /* @__PURE__ */ m("div", {
93
+ className: "flex justify-between gap-2",
94
+ children: [/* @__PURE__ */ p("span", {
95
+ className: "text-zinc-400 dark:text-zinc-500",
96
+ children: "Element"
97
+ }), /* @__PURE__ */ p("span", {
98
+ className: "truncate font-mono text-zinc-600 dark:text-zinc-300",
99
+ children: y.elementId
100
+ })]
101
+ }),
102
+ y.runId !== void 0 && /* @__PURE__ */ m("div", {
103
+ className: "flex flex-col gap-0.5",
104
+ children: [/* @__PURE__ */ p("span", {
105
+ className: "text-zinc-400 dark:text-zinc-500",
106
+ children: "Run id"
107
+ }), /* @__PURE__ */ p("span", {
108
+ className: "font-mono break-all text-zinc-600 dark:text-zinc-300",
109
+ children: y.runId
110
+ })]
111
+ }),
112
+ y.input !== void 0 && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
113
+ className: "mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",
114
+ children: "Input"
115
+ }), /* @__PURE__ */ p("div", {
116
+ className: "overflow-auto rounded border border-zinc-200 dark:border-zinc-700",
117
+ children: /* @__PURE__ */ p(l, { value: y.input })
118
+ })] }),
119
+ y.output !== void 0 && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
120
+ className: "mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",
121
+ children: "Output"
122
+ }), /* @__PURE__ */ p("div", {
123
+ className: "overflow-auto rounded border border-zinc-200 dark:border-zinc-700",
124
+ children: /* @__PURE__ */ p(l, { value: y.output })
125
+ })] }),
126
+ y.progress.length > 0 && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ m("div", {
127
+ className: "mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",
128
+ children: [
129
+ "Progress (",
130
+ y.progress.length,
131
+ ")"
132
+ ]
133
+ }), /* @__PURE__ */ p("div", {
134
+ className: "overflow-auto rounded border border-zinc-200 dark:border-zinc-700",
135
+ children: /* @__PURE__ */ p(l, { value: y.progress })
136
+ })] })
137
+ ] });
138
+ };
139
+ //#endregion
140
+ export { y as default };
@@ -0,0 +1,3 @@
1
+ import { default as RunDetail } from './RunDetail';
2
+ export type { RunDetailProps } from './RunDetail';
3
+ export default RunDetail;
@@ -0,0 +1,5 @@
1
+ import e from "./RunDetail.mjs";
2
+ //#region src/components/DevToolsPanel/tabs/ActionsViewer/components/RunDetail/index.ts
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,11 @@
1
+ import { ActionRunEntry } from '@plitzi/sdk-shared';
2
+ export type RunListProps = {
3
+ runs: ActionRunEntry[];
4
+ /** Whether anything has run at all, as opposed to nothing matching the filter — two different empty states. */
5
+ total: number;
6
+ selectedRunId?: string;
7
+ onSelect: (runId: string) => void;
8
+ onCancel: (runId: string) => void;
9
+ };
10
+ declare const RunList: ({ runs, total, selectedRunId, onSelect, onCancel }: RunListProps) => import("react").JSX.Element;
11
+ export default RunList;
@@ -0,0 +1,24 @@
1
+ import e from "../RunRow/index.mjs";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ //#region src/components/DevToolsPanel/tabs/ActionsViewer/components/RunList/RunList.tsx
4
+ var r = "No server action has run on this page yet. A run appears the moment one is SENT — including the ones that never come back — and the server adds the ones it ran to build the page.", i = ({ runs: i, total: a, selectedRunId: o, onSelect: s, onCancel: c }) => /* @__PURE__ */ n("div", {
5
+ className: "flex min-w-0 grow flex-col overflow-auto",
6
+ children: [
7
+ a === 0 && /* @__PURE__ */ t("div", {
8
+ className: "p-3 text-[11px] text-zinc-500 dark:text-zinc-400",
9
+ children: r
10
+ }),
11
+ a > 0 && i.length === 0 && /* @__PURE__ */ t("div", {
12
+ className: "p-3 text-[11px] text-zinc-500 dark:text-zinc-400",
13
+ children: "No run matches this filter."
14
+ }),
15
+ i.map((n) => /* @__PURE__ */ t(e, {
16
+ run: n,
17
+ selected: n.id === o,
18
+ onSelect: s,
19
+ onCancel: c
20
+ }, n.id))
21
+ ]
22
+ });
23
+ //#endregion
24
+ export { i as default };
@@ -0,0 +1,3 @@
1
+ import { default as RunList } from './RunList';
2
+ export type { RunListProps } from './RunList';
3
+ export default RunList;
@@ -0,0 +1,5 @@
1
+ import e from "./RunList.mjs";
2
+ //#region src/components/DevToolsPanel/tabs/ActionsViewer/components/RunList/index.ts
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,10 @@
1
+ import { ActionRunEntry } from '@plitzi/sdk-shared';
2
+ export type RunRowProps = {
3
+ run: ActionRunEntry;
4
+ selected: boolean;
5
+ onSelect: (runId: string) => void;
6
+ onCancel: (runId: string) => void;
7
+ };
8
+ /** One run in the log: enough to recognise it, and enough to tell a healthy one from the one to open. */
9
+ declare const RunRow: ({ run, selected, onSelect, onCancel }: RunRowProps) => import("react").JSX.Element;
10
+ export default RunRow;
@@ -0,0 +1,88 @@
1
+ import { MODE_ICON as e, MODE_LABEL as t, failedStep as n, formatMs as r, formatTime as i, isLive as a, runDuration as o, statusTone as s, stepCount as c } from "../../helpers.mjs";
2
+ import l from "../../../Logs/LogStatusIcon.mjs";
3
+ import u from "clsx";
4
+ import { useCallback as d } from "react";
5
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
6
+ import m from "@plitzi/plitzi-ui/Button";
7
+ //#region src/components/DevToolsPanel/tabs/ActionsViewer/components/RunRow/RunRow.tsx
8
+ var h = {
9
+ running: "fa-solid fa-circle-notch fa-spin",
10
+ streaming: "fa-solid fa-circle-notch fa-spin",
11
+ accepted: "fa-solid fa-paper-plane",
12
+ completed: "fa-solid fa-check",
13
+ failed: "fa-solid fa-xmark",
14
+ aborted: "fa-solid fa-hand",
15
+ skipped: "fa-solid fa-forward"
16
+ }, g = {
17
+ info: "border-l-violet-400",
18
+ success: "border-l-emerald-400",
19
+ danger: "border-l-red-400",
20
+ warning: "border-l-amber-400",
21
+ custom: "border-l-zinc-300 dark:border-l-zinc-600"
22
+ }, _ = ({ run: _, selected: v, onSelect: y, onCancel: b }) => {
23
+ let x = d(() => y(_.id), [y, _.id]), S = d(() => b(_.id), [b, _.id]), C = n(_.steps), w = o(_);
24
+ return /* @__PURE__ */ p("div", {
25
+ className: u("flex items-center gap-2 border-b border-l-2 px-2", g[s(_.status)], {
26
+ "border-b-zinc-100 bg-violet-500/5 dark:border-b-zinc-800": v,
27
+ "border-b-zinc-100 hover:bg-zinc-50 dark:border-b-zinc-800 dark:hover:bg-zinc-800/60": !v
28
+ }),
29
+ children: [/* @__PURE__ */ p("button", {
30
+ type: "button",
31
+ className: "flex grow flex-col gap-0.5 py-1.5 text-left",
32
+ onClick: x,
33
+ children: [/* @__PURE__ */ p("div", {
34
+ className: "flex items-center gap-1.5 text-[11px]",
35
+ children: [
36
+ /* @__PURE__ */ f(l, {
37
+ logType: s(_.status),
38
+ iconClassName: h[_.status]
39
+ }),
40
+ /* @__PURE__ */ f("span", {
41
+ className: "truncate font-medium text-zinc-700 dark:text-zinc-100",
42
+ children: _.actionId || "(no action named)"
43
+ }),
44
+ /* @__PURE__ */ p("span", {
45
+ className: "flex shrink-0 items-center gap-1 rounded-sm bg-zinc-100 px-1 text-[9px] text-zinc-500 uppercase dark:bg-zinc-800 dark:text-zinc-400",
46
+ title: _.mode === "render" ? "Run by the server while it built this page" : void 0,
47
+ children: [/* @__PURE__ */ f("i", { className: e[_.mode] }), t[_.mode]]
48
+ }),
49
+ /* @__PURE__ */ f("span", {
50
+ className: "ml-auto shrink-0 text-zinc-400 tabular-nums dark:text-zinc-500",
51
+ children: w === void 0 ? "…" : r(w)
52
+ })
53
+ ]
54
+ }), /* @__PURE__ */ p("div", {
55
+ className: "flex items-center gap-1.5 text-[10px] text-zinc-400 dark:text-zinc-500",
56
+ children: [
57
+ /* @__PURE__ */ f("span", {
58
+ className: "shrink-0 tabular-nums",
59
+ children: i(_.startedAt)
60
+ }),
61
+ _.steps !== void 0 && /* @__PURE__ */ f("span", {
62
+ className: "shrink-0",
63
+ children: c(_.steps.length)
64
+ }),
65
+ _.elementId !== void 0 && /* @__PURE__ */ f("span", {
66
+ className: "truncate font-mono",
67
+ children: _.elementId
68
+ }),
69
+ C !== void 0 && /* @__PURE__ */ p("span", {
70
+ className: "truncate text-red-500 dark:text-red-400",
71
+ children: [/* @__PURE__ */ f("i", { className: "fa-solid fa-circle-exclamation mr-1" }), C.title]
72
+ }),
73
+ C === void 0 && _.reason !== void 0 && /* @__PURE__ */ f("span", {
74
+ className: "truncate text-amber-600 dark:text-amber-400",
75
+ children: _.reason
76
+ })
77
+ ]
78
+ })]
79
+ }), a(_) && _.cancellable === !0 && /* @__PURE__ */ f(m, {
80
+ size: "xs",
81
+ intent: "secondary",
82
+ onClick: S,
83
+ children: "Cancel"
84
+ })]
85
+ });
86
+ };
87
+ //#endregion
88
+ export { _ as default };
@@ -0,0 +1,3 @@
1
+ import { default as RunRow } from './RunRow';
2
+ export type { RunRowProps } from './RunRow';
3
+ export default RunRow;
@@ -0,0 +1,5 @@
1
+ import e from "./RunRow.mjs";
2
+ //#region src/components/DevToolsPanel/tabs/ActionsViewer/components/RunRow/index.ts
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,9 @@
1
+ import { StepBar } from '../../helpers';
2
+ export type StepRowProps = {
3
+ bar: StepBar;
4
+ selected: boolean;
5
+ onSelect: (stepId: string) => void;
6
+ };
7
+ /** One step of a flow: what it was, how it ended, and how much of the run it took. */
8
+ declare const StepRow: ({ bar, selected, onSelect }: StepRowProps) => import("react").JSX.Element;
9
+ export default StepRow;
@@ -0,0 +1,57 @@
1
+ import { STEP_BAR as e, STEP_ICON as t, formatMs as n, stepTone as r } from "../../helpers.mjs";
2
+ import i from "../../../Logs/LogStatusIcon.mjs";
3
+ import a from "clsx";
4
+ import { useCallback as o } from "react";
5
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
6
+ //#region src/components/DevToolsPanel/tabs/ActionsViewer/components/StepRow/StepRow.tsx
7
+ var l = ({ bar: l, selected: u, onSelect: d }) => {
8
+ let { step: f, offset: p, width: m } = l, h = o(() => d(f.id), [d, f.id]);
9
+ return /* @__PURE__ */ c("button", {
10
+ type: "button",
11
+ onClick: h,
12
+ "aria-pressed": u,
13
+ className: a("flex w-full flex-col gap-1 rounded px-1.5 py-1 text-left transition-colors", {
14
+ "bg-violet-500/10": u,
15
+ "hover:bg-zinc-100 dark:hover:bg-zinc-800": !u
16
+ }),
17
+ children: [
18
+ /* @__PURE__ */ c("div", {
19
+ className: "flex items-center gap-1.5 text-[11px]",
20
+ children: [
21
+ /* @__PURE__ */ s(i, {
22
+ logType: r(f.status),
23
+ iconClassName: t[f.status]
24
+ }),
25
+ /* @__PURE__ */ s("span", {
26
+ className: "truncate font-medium text-zinc-700 dark:text-zinc-200",
27
+ children: f.title
28
+ }),
29
+ /* @__PURE__ */ s("span", {
30
+ className: "truncate font-mono text-[10px] text-zinc-400 dark:text-zinc-500",
31
+ children: f.action
32
+ }),
33
+ /* @__PURE__ */ s("span", {
34
+ className: "ml-auto shrink-0 text-zinc-400 tabular-nums dark:text-zinc-500",
35
+ children: n(f.endTime - f.startTime)
36
+ })
37
+ ]
38
+ }),
39
+ /* @__PURE__ */ s("div", {
40
+ className: "h-1 w-full rounded-full bg-zinc-100 dark:bg-zinc-800",
41
+ children: /* @__PURE__ */ s("div", {
42
+ className: a("h-1 rounded-full", e[f.status]),
43
+ style: {
44
+ marginLeft: `${p * 100}%`,
45
+ width: `${m * 100}%`
46
+ }
47
+ })
48
+ }),
49
+ f.error !== void 0 && /* @__PURE__ */ s("span", {
50
+ className: "text-[10px] break-words text-red-600 dark:text-red-400",
51
+ children: f.error
52
+ })
53
+ ]
54
+ });
55
+ };
56
+ //#endregion
57
+ export { l as default };
@@ -0,0 +1,3 @@
1
+ import { default as StepRow } from './StepRow';
2
+ export type { StepRowProps } from './StepRow';
3
+ export default StepRow;
@@ -0,0 +1,5 @@
1
+ import e from "./StepRow.mjs";
2
+ //#region src/components/DevToolsPanel/tabs/ActionsViewer/components/StepRow/index.ts
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,53 @@
1
+ import { ActionRunEntry, ActionRunStep } from '@plitzi/sdk-shared';
2
+ /** Which runs the list shows. `live` is what somebody watches a page with; `failed` is what they came to find. */
3
+ export type RunFilter = 'all' | 'live' | 'failed';
4
+ /** The tone vocabulary the rest of the panel already speaks — see `LogStatusIcon`. */
5
+ export type StatusTone = 'danger' | 'warning' | 'success' | 'info' | 'custom';
6
+ /** Still happening: no end time, and the step that started it still holds the handle. */
7
+ export declare const isLive: (run: ActionRunEntry) => boolean;
8
+ export declare const hasFailed: (run: ActionRunEntry) => boolean;
9
+ export declare const runDuration: (run: ActionRunEntry) => number | undefined;
10
+ export declare const formatMs: (ms: number) => string;
11
+ export declare const formatTime: (value: number) => string;
12
+ export declare const statusTone: (status: string) => StatusTone;
13
+ export declare const stepTone: (status: ActionRunStep["status"]) => StatusTone;
14
+ export declare const STEP_ICON: Record<ActionRunStep['status'], string>;
15
+ /** The bar's fill, by how the step ended: a skipped step is drawn as a track, not as work. */
16
+ export declare const STEP_BAR: Record<ActionRunStep['status'], string>;
17
+ /** How the run reached the server, said in one word beside the action's name. */
18
+ export declare const MODE_LABEL: Record<ActionRunEntry['mode'], string>;
19
+ export declare const MODE_ICON: Record<ActionRunEntry['mode'], string>;
20
+ export declare const stepCount: (count: number) => string;
21
+ /** Where a flow broke — the first thing anybody opening a failed run is looking for. */
22
+ export declare const failedStep: (steps: ActionRunStep[] | undefined) => ActionRunStep | undefined;
23
+ /**
24
+ * Whether a run answers to what was typed in the search box.
25
+ *
26
+ * Everything a person might have in mind when they go looking: the action, the run id the server put in the header,
27
+ * the element a render fed, how it ended, and the steps themselves — a flow is often remembered by the step that
28
+ * breaks rather than by its own name.
29
+ */
30
+ export declare const matchesQuery: (run: ActionRunEntry, query: string) => boolean;
31
+ export declare const filterRuns: (runs: ActionRunEntry[], filter: RunFilter, query: string) => ActionRunEntry[];
32
+ /** One step placed on the run's own wall clock. */
33
+ export type StepBar = {
34
+ step: ActionRunStep;
35
+ offset: number;
36
+ width: number;
37
+ };
38
+ /**
39
+ * Each step as a share of the whole run, so the timeline shows WHERE the time went.
40
+ *
41
+ * Against the run's own span rather than a fixed scale: what matters is which step took the flow, and a run of 40ms
42
+ * and one of 40s are read the same way. A step too short to see is still given a sliver — a step that ran and a step
43
+ * that did not must never look alike.
44
+ */
45
+ export declare const stepBars: (steps: ActionRunStep[]) => StepBar[];
46
+ /**
47
+ * What a step actually READ and ANSWERED, when the deployment sent the full trace.
48
+ *
49
+ * Only an authoring session and a development server ever receive it — a visitor's answer carries the outline and
50
+ * nothing else — so this returns `undefined` far more often than not, and the panel says so rather than showing a
51
+ * blank where data would be.
52
+ */
53
+ export declare const traceResultOf: (trace: Record<string, unknown>[] | undefined, stepId: string) => unknown;
@@ -0,0 +1,65 @@
1
+ //#region src/components/DevToolsPanel/tabs/ActionsViewer/helpers.ts
2
+ var e = (e) => e.endedAt === void 0, t = (e) => e.status === "failed" || e.status === "aborted", n = (e) => e.endedAt === void 0 ? void 0 : e.endedAt - e.startedAt, r = (e) => e < 1e3 ? `${Math.round(e)}ms` : `${(e / 1e3).toFixed(2)}s`, i = (e) => new Date(e).toLocaleTimeString(), a = {
3
+ running: "info",
4
+ streaming: "info",
5
+ accepted: "info",
6
+ completed: "success",
7
+ failed: "danger",
8
+ aborted: "warning",
9
+ skipped: "custom"
10
+ }, o = (e) => a[e] ?? "custom", s = {
11
+ success: "success",
12
+ failed: "danger",
13
+ skipped: "custom",
14
+ disabled: "custom"
15
+ }, c = (e) => s[e], l = {
16
+ success: "fa-solid fa-check",
17
+ failed: "fa-solid fa-xmark",
18
+ skipped: "fa-solid fa-forward",
19
+ disabled: "fa-solid fa-ban"
20
+ }, u = {
21
+ success: "bg-emerald-500/70",
22
+ failed: "bg-red-500/80",
23
+ skipped: "bg-zinc-400/40",
24
+ disabled: "bg-zinc-400/30"
25
+ }, d = {
26
+ await: "await",
27
+ detached: "detached",
28
+ stream: "stream",
29
+ render: "render"
30
+ }, f = {
31
+ await: "fa-solid fa-right-left",
32
+ detached: "fa-solid fa-paper-plane",
33
+ stream: "fa-solid fa-wave-square",
34
+ render: "fa-solid fa-server"
35
+ }, p = (e) => `${e} ${e === 1 ? "step" : "steps"}`, m = (e) => e?.find((e) => e.status === "failed"), h = (e, t) => {
36
+ let n = t.trim().toLowerCase();
37
+ return n === "" || [
38
+ e.actionId,
39
+ e.runId,
40
+ e.elementId,
41
+ e.status,
42
+ e.reason,
43
+ e.error,
44
+ ...(e.steps ?? []).map((e) => `${e.title} ${e.action} ${e.error ?? ""}`)
45
+ ].some((e) => typeof e == "string" && e.toLowerCase().includes(n));
46
+ }, g = (n, r, i) => n.filter((n) => r === "live" && !e(n) || r === "failed" && !t(n) ? !1 : h(n, i)), _ = (e) => {
47
+ if (e.length === 0) return [];
48
+ let t = Math.min(...e.map((e) => e.startTime)), n = Math.max(...e.map((e) => e.endTime)) - t;
49
+ return e.map((e) => n <= 0 ? {
50
+ step: e,
51
+ offset: 0,
52
+ width: 1
53
+ } : {
54
+ step: e,
55
+ offset: (e.startTime - t) / n,
56
+ width: Math.max((e.endTime - e.startTime) / n, .02)
57
+ });
58
+ }, v = (e) => {
59
+ let { node: t } = e;
60
+ if (typeof t != "object" || !t || !("id" in t)) return;
61
+ let { id: n } = t;
62
+ return typeof n == "string" ? n : void 0;
63
+ }, y = (e, t) => e?.find((e) => v(e) === t)?.result;
64
+ //#endregion
65
+ export { f as MODE_ICON, d as MODE_LABEL, u as STEP_BAR, l as STEP_ICON, m as failedStep, g as filterRuns, r as formatMs, i as formatTime, t as hasFailed, e as isLive, h as matchesQuery, n as runDuration, o as statusTone, _ as stepBars, p as stepCount, c as stepTone, y as traceResultOf };
@@ -1,7 +1,7 @@
1
- import e from "./LogInteractionBody.mjs";
2
- import t from "./LogInteractionHeader.mjs";
3
- import n from "./LogInteractionNote.mjs";
4
- import r from "../../LogStatusIcon.mjs";
1
+ import e from "../../LogStatusIcon.mjs";
2
+ import t from "./LogInteractionBody.mjs";
3
+ import n from "./LogInteractionHeader.mjs";
4
+ import r from "./LogInteractionNote.mjs";
5
5
  import i from "clsx";
6
6
  import { useMemo as a } from "react";
7
7
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
@@ -9,7 +9,7 @@ import c from "@plitzi/plitzi-ui/ContainerCollapsable";
9
9
  import { getDurationMs as l } from "@plitzi/sdk-shared";
10
10
  import { isInteractionFlow as u } from "@plitzi/sdk-shared/devTools";
11
11
  //#region src/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteraction.tsx
12
- var d = /* @__PURE__ */ o("i", { className: "fa-solid fa-angle-right text-[10px]" }), f = /* @__PURE__ */ o("i", { className: "fa-solid fa-angle-down text-[10px]" }), p = ({ time: n, message: u, params: { elementId: p, hostElementId: m, status: h, node: g, nodes: _, startTime: v = 0, endTime: y = 0 } }) => {
12
+ var d = /* @__PURE__ */ o("i", { className: "fa-solid fa-angle-right text-[10px]" }), f = /* @__PURE__ */ o("i", { className: "fa-solid fa-angle-down text-[10px]" }), p = ({ time: r, message: u, params: { elementId: p, hostElementId: m, status: h, node: g, nodes: _, startTime: v = 0, endTime: y = 0 } }) => {
13
13
  let b = a(() => `${l(v, y)}ms`, [v, y]), { failed: x, skipped: S, disabled: C } = a(() => {
14
14
  let e = Object.values(_).map(({ status: e }) => e);
15
15
  return {
@@ -26,10 +26,10 @@ var d = /* @__PURE__ */ o("i", { className: "fa-solid fa-angle-right text-[10px]
26
26
  }),
27
27
  collapsed: !0,
28
28
  children: [/* @__PURE__ */ o(c.Header, {
29
- title: /* @__PURE__ */ o(t, {
29
+ title: /* @__PURE__ */ o(n, {
30
30
  status: h,
31
31
  message: u,
32
- time: n
32
+ time: r
33
33
  }),
34
34
  placement: "left",
35
35
  className: { headerTitle: "overflow-hidden" },
@@ -38,17 +38,17 @@ var d = /* @__PURE__ */ o("i", { className: "fa-solid fa-angle-right text-[10px]
38
38
  children: /* @__PURE__ */ s("div", {
39
39
  className: "flex gap-3 text-zinc-400 dark:text-zinc-500",
40
40
  children: [
41
- !!x && /* @__PURE__ */ o(r, {
41
+ !!x && /* @__PURE__ */ o(e, {
42
42
  logType: "danger",
43
43
  title: "Failed",
44
44
  children: x
45
45
  }),
46
- h !== "skipped" && !!S && /* @__PURE__ */ o(r, {
46
+ h !== "skipped" && !!S && /* @__PURE__ */ o(e, {
47
47
  logType: "warning",
48
48
  title: "Skipped",
49
49
  children: S
50
50
  }),
51
- h !== "skipped" && !!C && /* @__PURE__ */ o(r, {
51
+ h !== "skipped" && !!C && /* @__PURE__ */ o(e, {
52
52
  logType: "custom",
53
53
  iconClassName: "fa-solid fa-ban",
54
54
  title: "Disabled",
@@ -57,7 +57,7 @@ var d = /* @__PURE__ */ o("i", { className: "fa-solid fa-angle-right text-[10px]
57
57
  b
58
58
  ]
59
59
  })
60
- }), /* @__PURE__ */ o(c.Content, { children: /* @__PURE__ */ o(e, {
60
+ }), /* @__PURE__ */ o(c.Content, { children: /* @__PURE__ */ o(t, {
61
61
  elementId: p,
62
62
  hostElementId: m,
63
63
  node: g,
@@ -67,14 +67,14 @@ var d = /* @__PURE__ */ o("i", { className: "fa-solid fa-angle-right text-[10px]
67
67
  duration: b
68
68
  }) })]
69
69
  });
70
- }, m = ({ time: e, message: t, params: r }) => u(r) ? /* @__PURE__ */ o(p, {
70
+ }, m = ({ time: e, message: t, params: n }) => u(n) ? /* @__PURE__ */ o(p, {
71
71
  time: e,
72
72
  message: t,
73
- params: r
74
- }) : /* @__PURE__ */ o(n, {
73
+ params: n
74
+ }) : /* @__PURE__ */ o(r, {
75
75
  time: e,
76
76
  message: t,
77
- params: r
77
+ params: n
78
78
  });
79
79
  //#endregion
80
80
  export { m as default };