@nice-code/action 0.2.17 → 0.2.18
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/build/devtools/browser/index.js +259 -158
- package/build/index.js +1 -0
- package/build/types/devtools/browser/components/ActionErrorDisplay.d.ts +2 -1
- package/build/types/devtools/browser/components/HandlerChips.d.ts +2 -1
- package/build/types/devtools/browser/components/action_list/ActionEntryRow.d.ts +3 -3
- package/build/types/devtools/core/devtools_colors.d.ts +1 -0
- package/package.json +3 -3
|
@@ -1974,6 +1974,7 @@ var DEVTOOL_COLOR_TEXT_SECONDARY = "#cbd5e1";
|
|
|
1974
1974
|
var DEVTOOL_COLOR_TEXT_MUTED = "#64748b";
|
|
1975
1975
|
var DEVTOOL_COLOR_TEXT_FAINT = "#334155";
|
|
1976
1976
|
var DEVTOOL_LIST_BASE_BACKGROUND = "#0f172a";
|
|
1977
|
+
var DEVTOOL_LIST_HEADER_SELECTED_BACKGROUND = "#1d2942";
|
|
1977
1978
|
var DEVTOOL_LIST_GROUP_DIVIDER = "#101109";
|
|
1978
1979
|
var DEVTOOL_DETAIL_BASE_BACKGROUND = "#0d1729";
|
|
1979
1980
|
var DEVTOOL_DETAIL_HEADER_BACKGROUND = "#131f35";
|
|
@@ -2027,7 +2028,8 @@ var SEMANTIC_COLORS = {
|
|
|
2027
2028
|
},
|
|
2028
2029
|
error: {
|
|
2029
2030
|
color: DEVTOOL_COLOR_SEMANTIC_ERROR,
|
|
2030
|
-
borderColor: DEVTOOL_COLOR_SEMANTIC_ERROR
|
|
2031
|
+
borderColor: DEVTOOL_COLOR_SEMANTIC_ERROR,
|
|
2032
|
+
subtle: { color: "#FF5C5C9f", borderColor: "transparent" }
|
|
2031
2033
|
},
|
|
2032
2034
|
domain: {
|
|
2033
2035
|
color: DEVTOOL_COLOR_SEMANTIC_SYSTEM,
|
|
@@ -2036,22 +2038,27 @@ var SEMANTIC_COLORS = {
|
|
|
2036
2038
|
},
|
|
2037
2039
|
handler_local: {
|
|
2038
2040
|
color: DEVTOOL_COLOR_HANDLER_LOCAL_TEXT,
|
|
2039
|
-
borderColor: DEVTOOL_COLOR_HANDLER_LOCAL_BORDER
|
|
2041
|
+
borderColor: DEVTOOL_COLOR_HANDLER_LOCAL_BORDER,
|
|
2042
|
+
subtle: { color: "#4b5563", borderColor: "transparent" }
|
|
2040
2043
|
},
|
|
2041
2044
|
handler_external: {
|
|
2042
2045
|
color: DEVTOOL_COLOR_HANDLER_EXTERNAL_TEXT,
|
|
2043
|
-
borderColor: DEVTOOL_COLOR_HANDLER_EXTERNAL_BORDER
|
|
2046
|
+
borderColor: DEVTOOL_COLOR_HANDLER_EXTERNAL_BORDER,
|
|
2047
|
+
subtle: { color: "#cfa12a9f", borderColor: "transparent" }
|
|
2044
2048
|
},
|
|
2045
2049
|
age: {
|
|
2046
2050
|
color: DEVTOOL_COLOR_SEMANTIC_METADATA,
|
|
2047
|
-
borderColor: DEVTOOL_SECTION_BACKGROUND
|
|
2051
|
+
borderColor: DEVTOOL_SECTION_BACKGROUND,
|
|
2052
|
+
subtle: { color: "#4b5563", borderColor: "transparent" }
|
|
2048
2053
|
},
|
|
2049
2054
|
io_input: {
|
|
2050
2055
|
color: "#fbbf24",
|
|
2056
|
+
subtle: { color: "#fbbe249f", borderColor: "transparent" },
|
|
2051
2057
|
borderColor: "#78350f"
|
|
2052
2058
|
},
|
|
2053
2059
|
io_output: {
|
|
2054
2060
|
color: "#a78bfa",
|
|
2061
|
+
subtle: { color: "#a78bfa9f", borderColor: "transparent" },
|
|
2055
2062
|
borderColor: "#4c1d95"
|
|
2056
2063
|
},
|
|
2057
2064
|
default: {
|
|
@@ -2310,11 +2317,12 @@ function NiceErrorBody({ error }) {
|
|
|
2310
2317
|
style: {
|
|
2311
2318
|
padding: "12px 14px",
|
|
2312
2319
|
color: DEVTOOL_COLOR_SEMANTIC_ERROR,
|
|
2313
|
-
fontSize: "
|
|
2320
|
+
fontSize: "1em",
|
|
2314
2321
|
fontWeight: "700",
|
|
2315
2322
|
lineHeight: "1.45",
|
|
2316
2323
|
wordBreak: "break-word",
|
|
2317
2324
|
fontFamily: SANS,
|
|
2325
|
+
textAlign: "left",
|
|
2318
2326
|
borderBottom: `1px solid ${DEVTOOL_ERROR_BADGE_BACKGROUND}`
|
|
2319
2327
|
},
|
|
2320
2328
|
children: error.message
|
|
@@ -2718,6 +2726,8 @@ function StackTraceSection({
|
|
|
2718
2726
|
|
|
2719
2727
|
// src/devtools/browser/components/ActionErrorDisplay.tsx
|
|
2720
2728
|
import { jsxDEV as jsxDEV5, Fragment } from "react/jsx-dev-runtime";
|
|
2729
|
+
var MONO3 = "ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace";
|
|
2730
|
+
var SANS2 = "ui-sans-serif, system-ui, -apple-system, sans-serif";
|
|
2721
2731
|
function FullErrorContent({
|
|
2722
2732
|
label,
|
|
2723
2733
|
error,
|
|
@@ -2743,10 +2753,65 @@ function FullErrorContent({
|
|
|
2743
2753
|
]
|
|
2744
2754
|
}, undefined, true, undefined, this);
|
|
2745
2755
|
}
|
|
2746
|
-
function
|
|
2756
|
+
function CompactErrorContent({ value, color }) {
|
|
2757
|
+
if (isNiceErrorJson(value)) {
|
|
2758
|
+
return /* @__PURE__ */ jsxDEV5("div", {
|
|
2759
|
+
style: { display: "flex", flexDirection: "column", gap: "1em" },
|
|
2760
|
+
children: [
|
|
2761
|
+
/* @__PURE__ */ jsxDEV5("div", {
|
|
2762
|
+
style: {
|
|
2763
|
+
color,
|
|
2764
|
+
fontFamily: SANS2,
|
|
2765
|
+
fontSize: "12px",
|
|
2766
|
+
fontWeight: 600,
|
|
2767
|
+
lineHeight: "1.4",
|
|
2768
|
+
wordBreak: "break-word",
|
|
2769
|
+
textAlign: "left"
|
|
2770
|
+
},
|
|
2771
|
+
children: value.message
|
|
2772
|
+
}, undefined, false, undefined, this),
|
|
2773
|
+
/* @__PURE__ */ jsxDEV5("div", {
|
|
2774
|
+
style: { display: "flex", flexWrap: "wrap", gap: "6px", alignItems: "center" },
|
|
2775
|
+
children: [
|
|
2776
|
+
value.ids.map((id) => /* @__PURE__ */ jsxDEV5("span", {
|
|
2777
|
+
style: { color, fontFamily: MONO3, fontSize: "10px", opacity: 0.8 },
|
|
2778
|
+
children: id
|
|
2779
|
+
}, id, false, undefined, this)),
|
|
2780
|
+
/* @__PURE__ */ jsxDEV5("span", {
|
|
2781
|
+
style: { color: DEVTOOL_COLOR_TEXT_MUTED, fontFamily: MONO3, fontSize: "10px" },
|
|
2782
|
+
children: value.def.domain
|
|
2783
|
+
}, undefined, false, undefined, this)
|
|
2784
|
+
]
|
|
2785
|
+
}, undefined, true, undefined, this)
|
|
2786
|
+
]
|
|
2787
|
+
}, undefined, true, undefined, this);
|
|
2788
|
+
}
|
|
2789
|
+
const text = typeof value === "string" ? value : value != null ? String(value) : null;
|
|
2790
|
+
if (text == null)
|
|
2791
|
+
return null;
|
|
2792
|
+
return /* @__PURE__ */ jsxDEV5("div", {
|
|
2793
|
+
style: {
|
|
2794
|
+
color,
|
|
2795
|
+
fontFamily: SANS2,
|
|
2796
|
+
fontSize: "12px",
|
|
2797
|
+
lineHeight: "1.4",
|
|
2798
|
+
wordBreak: "break-word"
|
|
2799
|
+
},
|
|
2800
|
+
children: text
|
|
2801
|
+
}, undefined, false, undefined, this);
|
|
2802
|
+
}
|
|
2803
|
+
function ActionErrorDisplay({
|
|
2804
|
+
entry,
|
|
2805
|
+
compact
|
|
2806
|
+
}) {
|
|
2747
2807
|
const { status, error, abortReason, errorStack } = entry;
|
|
2748
2808
|
if (status === "action-error") {
|
|
2749
|
-
const color =
|
|
2809
|
+
const color = DEVTOOL_COLOR_SEMANTIC_ERROR;
|
|
2810
|
+
if (compact)
|
|
2811
|
+
return /* @__PURE__ */ jsxDEV5(CompactErrorContent, {
|
|
2812
|
+
value: error,
|
|
2813
|
+
color
|
|
2814
|
+
}, undefined, false, undefined, this);
|
|
2750
2815
|
return /* @__PURE__ */ jsxDEV5(FullErrorContent, {
|
|
2751
2816
|
label: "Action Error",
|
|
2752
2817
|
error,
|
|
@@ -2756,6 +2821,11 @@ function ActionErrorDisplay({ entry }) {
|
|
|
2756
2821
|
}
|
|
2757
2822
|
if (status === "failed") {
|
|
2758
2823
|
const color = DEVTOOL_COLOR_SEMANTIC_ERROR;
|
|
2824
|
+
if (compact)
|
|
2825
|
+
return /* @__PURE__ */ jsxDEV5(CompactErrorContent, {
|
|
2826
|
+
value: error,
|
|
2827
|
+
color
|
|
2828
|
+
}, undefined, false, undefined, this);
|
|
2759
2829
|
return /* @__PURE__ */ jsxDEV5(FullErrorContent, {
|
|
2760
2830
|
label: "Error",
|
|
2761
2831
|
error,
|
|
@@ -2765,6 +2835,11 @@ function ActionErrorDisplay({ entry }) {
|
|
|
2765
2835
|
}
|
|
2766
2836
|
if (status === "aborted") {
|
|
2767
2837
|
const color = DEVTOOL_COLOR_SEMANTIC_METADATA;
|
|
2838
|
+
if (compact)
|
|
2839
|
+
return /* @__PURE__ */ jsxDEV5(CompactErrorContent, {
|
|
2840
|
+
value: abortReason,
|
|
2841
|
+
color
|
|
2842
|
+
}, undefined, false, undefined, this);
|
|
2768
2843
|
return /* @__PURE__ */ jsxDEV5(Fragment, {
|
|
2769
2844
|
children: [
|
|
2770
2845
|
abortReason != null && (isNiceErrorJson(abortReason) ? /* @__PURE__ */ jsxDEV5(NiceErrorDisplay, {
|
|
@@ -3001,7 +3076,7 @@ function getExternalLabel(hop) {
|
|
|
3001
3076
|
return null;
|
|
3002
3077
|
return hop.handlerClient != null ? `${hop.transport ?? "ext"} → ${hop.handlerClient.envId}` : `→ ${hop.transport ?? "ext"}`;
|
|
3003
3078
|
}
|
|
3004
|
-
function HandlerChips({ entry, size }) {
|
|
3079
|
+
function HandlerChips({ entry, size, subtle }) {
|
|
3005
3080
|
const firstHop = entry.meta.routing[0];
|
|
3006
3081
|
const localEnvId = firstHop != null ? firstHop.runtime.envId : null;
|
|
3007
3082
|
const externalLabel = firstHop != null ? getExternalLabel(firstHop) : null;
|
|
@@ -3011,11 +3086,13 @@ function HandlerChips({ entry, size }) {
|
|
|
3011
3086
|
localEnvId != null && (firstHopIsLocal || externalLabel == null) && /* @__PURE__ */ jsxDEV9(Chip, {
|
|
3012
3087
|
color: "handler_local" /* handler_local */,
|
|
3013
3088
|
size,
|
|
3089
|
+
subtle,
|
|
3014
3090
|
children: localEnvId
|
|
3015
3091
|
}, undefined, false, undefined, this),
|
|
3016
3092
|
externalLabel != null && /* @__PURE__ */ jsxDEV9(Chip, {
|
|
3017
3093
|
color: "handler_external" /* handler_external */,
|
|
3018
3094
|
size,
|
|
3095
|
+
subtle,
|
|
3019
3096
|
children: externalLabel
|
|
3020
3097
|
}, undefined, false, undefined, this)
|
|
3021
3098
|
]
|
|
@@ -3713,7 +3790,7 @@ function ActionDetailPanel({
|
|
|
3713
3790
|
|
|
3714
3791
|
// src/devtools/browser/components/action_list/ActionEntryRow.tsx
|
|
3715
3792
|
import { Box, CircleX as CircleX2, Variable } from "lucide-react";
|
|
3716
|
-
import { useState as useState8 } from "react";
|
|
3793
|
+
import { Fragment as Fragment7, useState as useState8 } from "react";
|
|
3717
3794
|
|
|
3718
3795
|
// src/devtools/browser/components/Icon.tsx
|
|
3719
3796
|
import { useState as useState7 } from "react";
|
|
@@ -3767,7 +3844,7 @@ function Icon({
|
|
|
3767
3844
|
}
|
|
3768
3845
|
|
|
3769
3846
|
// src/devtools/browser/components/action_list/ActionEntryRow.tsx
|
|
3770
|
-
import { jsxDEV as jsxDEV17, Fragment as
|
|
3847
|
+
import { jsxDEV as jsxDEV17, Fragment as Fragment8 } from "react/jsx-dev-runtime";
|
|
3771
3848
|
function getLatestChipColor(status) {
|
|
3772
3849
|
if (status === "failed")
|
|
3773
3850
|
return "failed" /* failed */;
|
|
@@ -3775,7 +3852,7 @@ function getLatestChipColor(status) {
|
|
|
3775
3852
|
return "action_error" /* action_error */;
|
|
3776
3853
|
if (status === "aborted")
|
|
3777
3854
|
return "aborted" /* aborted */;
|
|
3778
|
-
return "
|
|
3855
|
+
return "success" /* success */;
|
|
3779
3856
|
}
|
|
3780
3857
|
var JSON_TOKEN_RE2 = /("(?:\\.|[^"\\])*")(\s*:)?|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)|(\btrue\b|\bfalse\b|\bnull\b|\bundefined\b)|([{}[\],])/g;
|
|
3781
3858
|
function renderColoredJson2(text) {
|
|
@@ -3865,7 +3942,7 @@ function GroupDotTooltip({
|
|
|
3865
3942
|
config: {
|
|
3866
3943
|
align: "center",
|
|
3867
3944
|
maxWidth: 240,
|
|
3868
|
-
content: /* @__PURE__ */ jsxDEV17(
|
|
3945
|
+
content: /* @__PURE__ */ jsxDEV17(Fragment8, {
|
|
3869
3946
|
children: [
|
|
3870
3947
|
/* @__PURE__ */ jsxDEV17("div", {
|
|
3871
3948
|
style: { color: dotColor, marginBottom: "1px" },
|
|
@@ -3910,7 +3987,7 @@ function GroupDot({
|
|
|
3910
3987
|
const [anchor, setAnchor] = useState8(null);
|
|
3911
3988
|
const dotColor = STATUS_COLOR[entry.status];
|
|
3912
3989
|
const hovered = anchor != null;
|
|
3913
|
-
return /* @__PURE__ */ jsxDEV17(
|
|
3990
|
+
return /* @__PURE__ */ jsxDEV17(Fragment8, {
|
|
3914
3991
|
children: [
|
|
3915
3992
|
/* @__PURE__ */ jsxDEV17("button", {
|
|
3916
3993
|
"data-cuid": entry.cuid,
|
|
@@ -3951,7 +4028,7 @@ function ActionEntryRow({
|
|
|
3951
4028
|
onClick,
|
|
3952
4029
|
isLatest = false,
|
|
3953
4030
|
latestTime,
|
|
3954
|
-
|
|
4031
|
+
childEntries,
|
|
3955
4032
|
breakReasons,
|
|
3956
4033
|
groupEntries,
|
|
3957
4034
|
selectedGroupCuid,
|
|
@@ -3961,19 +4038,20 @@ function ActionEntryRow({
|
|
|
3961
4038
|
const statusIcon = STATUS_ICON[entry.status];
|
|
3962
4039
|
const timestamp = formatTimestamp(entry.startTime);
|
|
3963
4040
|
const hasGroup = groupEntries != null && groupEntries.length > 1;
|
|
4041
|
+
const hasBottomContent = childEntries != null && childEntries.length > 0 || (breakReasons?.some((r) => r !== "new input" && r !== "new output") ?? false) || entry.error != null || entry.abortReason != null;
|
|
3964
4042
|
return /* @__PURE__ */ jsxDEV17("div", {
|
|
3965
4043
|
"data-cuid": entry.cuid,
|
|
3966
4044
|
onClick,
|
|
3967
4045
|
style: {
|
|
3968
4046
|
position: "relative",
|
|
3969
4047
|
display: "flex",
|
|
3970
|
-
|
|
3971
|
-
gap: "
|
|
4048
|
+
flexDirection: "column",
|
|
4049
|
+
gap: "5px",
|
|
3972
4050
|
padding: "10px 12px",
|
|
3973
4051
|
cursor: "pointer",
|
|
3974
|
-
background: isSelected ?
|
|
4052
|
+
background: isSelected ? DEVTOOL_LIST_HEADER_SELECTED_BACKGROUND : "transparent",
|
|
3975
4053
|
border: `1px solid ${DEVTOOL_PANEL_BORDER}`,
|
|
3976
|
-
borderLeft: isSelected ? `2px solid ${STATUS_COLOR[entry.status]}` : entry.status === "failed" || entry.status === "action-error" ? `2px solid ${STATUS_COLOR[entry.status]}55` : `2px solid
|
|
4054
|
+
borderLeft: isSelected ? `2px solid ${STATUS_COLOR[entry.status]}` : entry.status === "failed" || entry.status === "action-error" ? `2px solid ${STATUS_COLOR[entry.status]}55` : `2px solid ${DEVTOOL_PANEL_BORDER}`,
|
|
3977
4055
|
borderRadius: "3px",
|
|
3978
4056
|
margin: "2px 4px"
|
|
3979
4057
|
},
|
|
@@ -3981,7 +4059,7 @@ function ActionEntryRow({
|
|
|
3981
4059
|
/* @__PURE__ */ jsxDEV17("div", {
|
|
3982
4060
|
style: {
|
|
3983
4061
|
position: "absolute",
|
|
3984
|
-
left: "
|
|
4062
|
+
left: "2em",
|
|
3985
4063
|
top: 0,
|
|
3986
4064
|
bottom: 0,
|
|
3987
4065
|
width: "1px",
|
|
@@ -3991,63 +4069,43 @@ function ActionEntryRow({
|
|
|
3991
4069
|
}
|
|
3992
4070
|
}, undefined, false, undefined, this),
|
|
3993
4071
|
/* @__PURE__ */ jsxDEV17("div", {
|
|
3994
|
-
style: {
|
|
3995
|
-
position: "relative",
|
|
3996
|
-
zIndex: 1,
|
|
3997
|
-
flexShrink: 0,
|
|
3998
|
-
minWidth: "3.5em",
|
|
3999
|
-
display: "flex",
|
|
4000
|
-
alignItems: "center",
|
|
4001
|
-
justifyContent: "flex-start"
|
|
4002
|
-
},
|
|
4003
|
-
children: isLatest ? /* @__PURE__ */ jsxDEV17(Chip, {
|
|
4004
|
-
color: getLatestChipColor(entry.status),
|
|
4005
|
-
children: "latest"
|
|
4006
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV17(Chip, {
|
|
4007
|
-
color: "age" /* age */,
|
|
4008
|
-
children: [
|
|
4009
|
-
"+",
|
|
4010
|
-
latestTime != null ? formatRelativeAge(latestTime - entry.startTime) : "?"
|
|
4011
|
-
]
|
|
4012
|
-
}, undefined, true, undefined, this)
|
|
4013
|
-
}, undefined, false, undefined, this),
|
|
4014
|
-
/* @__PURE__ */ jsxDEV17("span", {
|
|
4015
|
-
style: {
|
|
4016
|
-
position: "relative",
|
|
4017
|
-
zIndex: 1,
|
|
4018
|
-
color: statusSemantic,
|
|
4019
|
-
flexShrink: 0,
|
|
4020
|
-
display: "flex",
|
|
4021
|
-
alignItems: "center",
|
|
4022
|
-
animation: entry.status === "running" ? "__nice-action-pulse 1.2s ease-in-out infinite" : undefined
|
|
4023
|
-
},
|
|
4024
|
-
children: /* @__PURE__ */ jsxDEV17(Icon, {
|
|
4025
|
-
icon: statusIcon,
|
|
4026
|
-
color: statusSemantic
|
|
4027
|
-
}, undefined, false, undefined, this)
|
|
4028
|
-
}, undefined, false, undefined, this),
|
|
4029
|
-
/* @__PURE__ */ jsxDEV17("div", {
|
|
4030
|
-
style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column", gap: "0.3em" },
|
|
4072
|
+
style: { display: "flex", alignItems: "center", gap: "8px" },
|
|
4031
4073
|
children: [
|
|
4032
4074
|
/* @__PURE__ */ jsxDEV17("div", {
|
|
4033
4075
|
style: {
|
|
4076
|
+
position: "relative",
|
|
4077
|
+
zIndex: 1,
|
|
4078
|
+
flexShrink: 0,
|
|
4079
|
+
minWidth: "4em",
|
|
4034
4080
|
display: "flex",
|
|
4035
4081
|
alignItems: "center",
|
|
4036
|
-
|
|
4037
|
-
overflow: "hidden",
|
|
4038
|
-
gap: "0.5em"
|
|
4082
|
+
justifyContent: "flex-start"
|
|
4039
4083
|
},
|
|
4084
|
+
children: isLatest ? /* @__PURE__ */ jsxDEV17(Chip, {
|
|
4085
|
+
color: getLatestChipColor(entry.status),
|
|
4086
|
+
children: "latest"
|
|
4087
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV17(Chip, {
|
|
4088
|
+
size: "sm" /* sm */,
|
|
4089
|
+
color: getLatestChipColor(entry.status),
|
|
4090
|
+
children: [
|
|
4091
|
+
"+",
|
|
4092
|
+
latestTime != null ? formatRelativeAge(latestTime - entry.startTime) : "?"
|
|
4093
|
+
]
|
|
4094
|
+
}, undefined, true, undefined, this)
|
|
4095
|
+
}, undefined, false, undefined, this),
|
|
4096
|
+
/* @__PURE__ */ jsxDEV17("div", {
|
|
4097
|
+
style: { flex: 1, minWidth: 0, display: "flex", alignItems: "center", gap: "0.5em" },
|
|
4040
4098
|
children: [
|
|
4041
4099
|
/* @__PURE__ */ jsxDEV17("span", {
|
|
4042
4100
|
style: {
|
|
4043
4101
|
color: DEVTOOL_COLOR_TEXT_SECONDARY,
|
|
4044
|
-
fontSize: "
|
|
4102
|
+
fontSize: "1.1em",
|
|
4045
4103
|
fontFamily: "ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace",
|
|
4046
4104
|
overflow: "hidden",
|
|
4047
4105
|
textOverflow: "ellipsis",
|
|
4048
4106
|
whiteSpace: "nowrap",
|
|
4049
4107
|
flexShrink: 1,
|
|
4050
|
-
minWidth: "
|
|
4108
|
+
minWidth: "3em"
|
|
4051
4109
|
},
|
|
4052
4110
|
children: entry.actionId
|
|
4053
4111
|
}, undefined, false, undefined, this),
|
|
@@ -4055,12 +4113,23 @@ function ActionEntryRow({
|
|
|
4055
4113
|
domain: entry.domain,
|
|
4056
4114
|
allDomains: entry.allDomains
|
|
4057
4115
|
}, undefined, false, undefined, this),
|
|
4058
|
-
|
|
4116
|
+
/* @__PURE__ */ jsxDEV17(Icon, {
|
|
4059
4117
|
icon: Variable,
|
|
4060
|
-
color: "io_input" /* io_input */,
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4118
|
+
color: entry.input !== undefined ? "io_input" /* io_input */ : "default" /* default */,
|
|
4119
|
+
subtle: entry.input === undefined,
|
|
4120
|
+
tooltip: {
|
|
4121
|
+
content: entry.input !== undefined ? /* @__PURE__ */ jsxDEV17(IoTooltipContent, {
|
|
4122
|
+
value: entry.input
|
|
4123
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV17("span", {
|
|
4124
|
+
style: { color: DEVTOOL_COLOR_TEXT_MUTED, fontSize: "10px" },
|
|
4125
|
+
children: "No input required or given"
|
|
4126
|
+
}, undefined, false, undefined, this),
|
|
4127
|
+
title: "Input"
|
|
4128
|
+
}
|
|
4129
|
+
}, undefined, false, undefined, this),
|
|
4130
|
+
/* @__PURE__ */ jsxDEV17(HandlerChips, {
|
|
4131
|
+
entry,
|
|
4132
|
+
size: "sm" /* sm */
|
|
4064
4133
|
}, undefined, false, undefined, this),
|
|
4065
4134
|
entry.status === "success" && entry.output !== undefined && /* @__PURE__ */ jsxDEV17(Icon, {
|
|
4066
4135
|
icon: Box,
|
|
@@ -4073,96 +4142,118 @@ function ActionEntryRow({
|
|
|
4073
4142
|
icon: CircleX2,
|
|
4074
4143
|
color: entry.status === "aborted" ? "aborted" /* aborted */ : "error" /* error */,
|
|
4075
4144
|
tooltip: {
|
|
4076
|
-
content: /* @__PURE__ */ jsxDEV17(
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
flexDirection: "column",
|
|
4080
|
-
gap: "1em"
|
|
4081
|
-
},
|
|
4082
|
-
children: /* @__PURE__ */ jsxDEV17(ActionErrorDisplay, {
|
|
4083
|
-
entry
|
|
4084
|
-
}, undefined, false, undefined, this)
|
|
4145
|
+
content: /* @__PURE__ */ jsxDEV17(ActionErrorDisplay, {
|
|
4146
|
+
entry,
|
|
4147
|
+
compact: true
|
|
4085
4148
|
}, undefined, false, undefined, this),
|
|
4086
4149
|
title: entry.status === "aborted" ? "Aborted" : "Error",
|
|
4087
|
-
maxWidth:
|
|
4150
|
+
maxWidth: 340
|
|
4088
4151
|
}
|
|
4089
|
-
}, undefined, false, undefined, this)
|
|
4090
|
-
]
|
|
4091
|
-
}, undefined, true, undefined, this),
|
|
4092
|
-
/* @__PURE__ */ jsxDEV17("div", {
|
|
4093
|
-
style: {
|
|
4094
|
-
display: "flex",
|
|
4095
|
-
alignItems: "center",
|
|
4096
|
-
justifyContent: "space-between",
|
|
4097
|
-
gap: "6px"
|
|
4098
|
-
},
|
|
4099
|
-
children: [
|
|
4152
|
+
}, undefined, false, undefined, this),
|
|
4100
4153
|
/* @__PURE__ */ jsxDEV17("div", {
|
|
4154
|
+
style: { flex: 1 }
|
|
4155
|
+
}, undefined, false, undefined, this),
|
|
4156
|
+
/* @__PURE__ */ jsxDEV17("span", {
|
|
4101
4157
|
style: {
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
overflow: "hidden"
|
|
4158
|
+
color: DEVTOOL_COLOR_SEMANTIC_METADATA,
|
|
4159
|
+
fontSize: "10px",
|
|
4160
|
+
letterSpacing: "0.02em",
|
|
4161
|
+
fontFamily: "ui-sans-serif, system-ui, sans-serif",
|
|
4162
|
+
flexShrink: 0
|
|
4108
4163
|
},
|
|
4109
|
-
children:
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4164
|
+
children: timestamp
|
|
4165
|
+
}, undefined, false, undefined, this),
|
|
4166
|
+
/* @__PURE__ */ jsxDEV17("span", {
|
|
4167
|
+
style: { color: DEVTOOL_COLOR_SEMANTIC_WARNING, fontSize: "11px", flexShrink: 0 },
|
|
4168
|
+
children: /* @__PURE__ */ jsxDEV17(DurationDisplay, {
|
|
4169
|
+
entry
|
|
4170
|
+
}, undefined, false, undefined, this)
|
|
4171
|
+
}, undefined, false, undefined, this)
|
|
4172
|
+
]
|
|
4173
|
+
}, undefined, true, undefined, this)
|
|
4174
|
+
]
|
|
4175
|
+
}, undefined, true, undefined, this),
|
|
4176
|
+
hasBottomContent && /* @__PURE__ */ jsxDEV17("div", {
|
|
4177
|
+
style: {
|
|
4178
|
+
display: "flex",
|
|
4179
|
+
flexWrap: "wrap",
|
|
4180
|
+
alignItems: "center",
|
|
4181
|
+
gap: "4px",
|
|
4182
|
+
paddingLeft: "4.5em"
|
|
4183
|
+
},
|
|
4184
|
+
children: [
|
|
4185
|
+
childEntries?.map((child) => /* @__PURE__ */ jsxDEV17(Fragment7, {
|
|
4186
|
+
children: [
|
|
4187
|
+
/* @__PURE__ */ jsxDEV17(Icon, {
|
|
4188
|
+
icon: Variable,
|
|
4189
|
+
color: "io_input" /* io_input */,
|
|
4190
|
+
subtle: true,
|
|
4191
|
+
tooltip: {
|
|
4192
|
+
content: child.input !== undefined ? /* @__PURE__ */ jsxDEV17(IoTooltipContent, {
|
|
4193
|
+
value: child.input
|
|
4194
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV17("span", {
|
|
4195
|
+
style: { color: DEVTOOL_COLOR_TEXT_MUTED, fontSize: "10px" },
|
|
4196
|
+
children: "No input required or given"
|
|
4117
4197
|
}, undefined, false, undefined, this),
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
},
|
|
4134
|
-
children: timestamp
|
|
4198
|
+
title: `Input · ${child.actionId}`
|
|
4199
|
+
}
|
|
4200
|
+
}, undefined, false, undefined, this),
|
|
4201
|
+
/* @__PURE__ */ jsxDEV17(HandlerChips, {
|
|
4202
|
+
entry: child,
|
|
4203
|
+
size: "sm" /* sm */,
|
|
4204
|
+
subtle: true
|
|
4205
|
+
}, undefined, false, undefined, this),
|
|
4206
|
+
child.status === "success" && child.output !== undefined && /* @__PURE__ */ jsxDEV17(Icon, {
|
|
4207
|
+
icon: Box,
|
|
4208
|
+
color: "io_output" /* io_output */,
|
|
4209
|
+
subtle: true,
|
|
4210
|
+
tooltip: {
|
|
4211
|
+
content: /* @__PURE__ */ jsxDEV17(IoTooltipContent, {
|
|
4212
|
+
value: child.output
|
|
4135
4213
|
}, undefined, false, undefined, this),
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
entry
|
|
4140
|
-
}, undefined, false, undefined, this)
|
|
4141
|
-
}, undefined, false, undefined, this)
|
|
4142
|
-
]
|
|
4143
|
-
}, undefined, true, undefined, this)
|
|
4214
|
+
title: `Output · ${child.actionId}`
|
|
4215
|
+
}
|
|
4216
|
+
}, undefined, false, undefined, this)
|
|
4144
4217
|
]
|
|
4145
|
-
},
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
}
|
|
4218
|
+
}, child.actionId, true, undefined, this)),
|
|
4219
|
+
breakReasons?.filter((r) => r !== "new input" && r !== "new output").map((reason) => /* @__PURE__ */ jsxDEV17(Chip, {
|
|
4220
|
+
color: "default" /* default */,
|
|
4221
|
+
subtle: true,
|
|
4222
|
+
children: reason
|
|
4223
|
+
}, reason, false, undefined, this)),
|
|
4224
|
+
(childEntries?.length ?? 0) > 0 && (entry.error != null || entry.abortReason != null) && /* @__PURE__ */ jsxDEV17(Icon, {
|
|
4225
|
+
icon: CircleX2,
|
|
4226
|
+
color: entry.status === "aborted" ? "aborted" /* aborted */ : "error" /* error */,
|
|
4227
|
+
subtle: true,
|
|
4228
|
+
tooltip: {
|
|
4229
|
+
content: /* @__PURE__ */ jsxDEV17(ActionErrorDisplay, {
|
|
4230
|
+
entry,
|
|
4231
|
+
compact: true
|
|
4232
|
+
}, undefined, false, undefined, this),
|
|
4233
|
+
title: entry.status === "aborted" ? "Aborted" : "Error",
|
|
4234
|
+
maxWidth: 340
|
|
4235
|
+
}
|
|
4163
4236
|
}, undefined, false, undefined, this)
|
|
4164
4237
|
]
|
|
4165
|
-
}, undefined, true, undefined, this)
|
|
4238
|
+
}, undefined, true, undefined, this),
|
|
4239
|
+
hasGroup && /* @__PURE__ */ jsxDEV17("div", {
|
|
4240
|
+
style: {
|
|
4241
|
+
display: "flex",
|
|
4242
|
+
flexWrap: "wrap",
|
|
4243
|
+
alignItems: "center",
|
|
4244
|
+
gap: "5px",
|
|
4245
|
+
paddingLeft: "4.6em",
|
|
4246
|
+
paddingBottom: "2px"
|
|
4247
|
+
},
|
|
4248
|
+
children: groupEntries.map((e, i) => /* @__PURE__ */ jsxDEV17(GroupDot, {
|
|
4249
|
+
entry: e,
|
|
4250
|
+
index: i,
|
|
4251
|
+
total: groupEntries.length,
|
|
4252
|
+
refTime: groupEntries[0].startTime,
|
|
4253
|
+
isActive: selectedGroupCuid === e.cuid,
|
|
4254
|
+
onSelect: () => onSelectGroupEntry?.(e.cuid)
|
|
4255
|
+
}, e.cuid, false, undefined, this))
|
|
4256
|
+
}, undefined, false, undefined, this)
|
|
4166
4257
|
]
|
|
4167
4258
|
}, undefined, true, undefined, this);
|
|
4168
4259
|
}
|
|
@@ -4318,7 +4409,7 @@ function ResizeHandle({
|
|
|
4318
4409
|
}
|
|
4319
4410
|
|
|
4320
4411
|
// src/devtools/browser/NiceActionDevtools.tsx
|
|
4321
|
-
import { jsxDEV as jsxDEV19, Fragment as
|
|
4412
|
+
import { jsxDEV as jsxDEV19, Fragment as Fragment9 } from "react/jsx-dev-runtime";
|
|
4322
4413
|
if (typeof document !== "undefined" && !document.getElementById("__nice-action-devtools-styles")) {
|
|
4323
4414
|
const style = document.createElement("style");
|
|
4324
4415
|
style.id = "__nice-action-devtools-styles";
|
|
@@ -4429,19 +4520,16 @@ function NiceActionDevtools_Panel({
|
|
|
4429
4520
|
const roots = entries.filter((e) => e.status !== "running" && (e.parentCuid == null || !byCuid.has(e.parentCuid)));
|
|
4430
4521
|
return groupEntries(roots);
|
|
4431
4522
|
}, [entries]);
|
|
4432
|
-
const
|
|
4523
|
+
const childEntriesMap = useMemo2(() => {
|
|
4433
4524
|
const map = new Map;
|
|
4434
4525
|
for (const entry of entries) {
|
|
4435
4526
|
if (entry.parentCuid == null)
|
|
4436
4527
|
continue;
|
|
4437
|
-
const firstHop = entry.meta.routing[0];
|
|
4438
|
-
if (firstHop == null || firstHop.handlerType !== "external")
|
|
4439
|
-
continue;
|
|
4440
4528
|
const existing = map.get(entry.parentCuid) ?? [];
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4529
|
+
map.set(entry.parentCuid, [...existing, entry]);
|
|
4530
|
+
}
|
|
4531
|
+
for (const arr of map.values()) {
|
|
4532
|
+
arr.sort((a, b) => a.startTime - b.startTime);
|
|
4445
4533
|
}
|
|
4446
4534
|
return map;
|
|
4447
4535
|
}, [entries]);
|
|
@@ -4593,7 +4681,7 @@ function NiceActionDevtools_Panel({
|
|
|
4593
4681
|
onSubClick: (cuid, isSelected) => {
|
|
4594
4682
|
setSelectedCuid(isSelected ? null : cuid);
|
|
4595
4683
|
},
|
|
4596
|
-
|
|
4684
|
+
childEntriesMap
|
|
4597
4685
|
};
|
|
4598
4686
|
return /* @__PURE__ */ jsxDEV19("div", {
|
|
4599
4687
|
id: "__nice-action-devtools-panel",
|
|
@@ -4661,7 +4749,7 @@ function NiceActionDevtools_Panel({
|
|
|
4661
4749
|
}, undefined, false, undefined, this)
|
|
4662
4750
|
}, undefined, false, undefined, this)
|
|
4663
4751
|
]
|
|
4664
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */ jsxDEV19(
|
|
4752
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsxDEV19(Fragment9, {
|
|
4665
4753
|
children: [
|
|
4666
4754
|
/* @__PURE__ */ jsxDEV19("div", {
|
|
4667
4755
|
style: { position: "relative", flex: 1, minHeight: "80px" },
|
|
@@ -4715,6 +4803,19 @@ function getBreakReasons(current, previous) {
|
|
|
4715
4803
|
reasons.push("new output");
|
|
4716
4804
|
return reasons;
|
|
4717
4805
|
}
|
|
4806
|
+
function getGroupChildEntries(group, childEntriesMap) {
|
|
4807
|
+
const seen = new Set;
|
|
4808
|
+
const result = [];
|
|
4809
|
+
for (const e of [group.representative, ...group.rest]) {
|
|
4810
|
+
for (const child of childEntriesMap.get(e.cuid) ?? []) {
|
|
4811
|
+
if (!seen.has(child.actionId)) {
|
|
4812
|
+
seen.add(child.actionId);
|
|
4813
|
+
result.push(child);
|
|
4814
|
+
}
|
|
4815
|
+
}
|
|
4816
|
+
}
|
|
4817
|
+
return result.length > 0 ? result.sort((a, b) => a.startTime - b.startTime) : undefined;
|
|
4818
|
+
}
|
|
4718
4819
|
function getFlatItemKey(item) {
|
|
4719
4820
|
const oldestCuid = item.group.rest[item.group.rest.length - 1]?.cuid ?? item.group.representative.cuid;
|
|
4720
4821
|
return `g:${oldestCuid}`;
|
|
@@ -4724,7 +4825,7 @@ function ActionList({
|
|
|
4724
4825
|
selectedCuid,
|
|
4725
4826
|
onGroupClick,
|
|
4726
4827
|
onSubClick,
|
|
4727
|
-
|
|
4828
|
+
childEntriesMap,
|
|
4728
4829
|
style
|
|
4729
4830
|
}) {
|
|
4730
4831
|
const containerRef = useRef(null);
|
|
@@ -4793,7 +4894,7 @@ function ActionList({
|
|
|
4793
4894
|
isSelected: selectedCuid === group.representative.cuid || group.rest.some((e) => e.cuid === selectedCuid),
|
|
4794
4895
|
isLatest: item.groupIndex === 0,
|
|
4795
4896
|
latestTime,
|
|
4796
|
-
|
|
4897
|
+
childEntries: getGroupChildEntries(group, childEntriesMap),
|
|
4797
4898
|
breakReasons: item.breakReasons,
|
|
4798
4899
|
groupEntries: group.rest.length > 0 ? [group.representative, ...group.rest] : undefined,
|
|
4799
4900
|
selectedGroupCuid: selectedCuid,
|
package/build/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IDevtoolsActionEntry } from "../../core/ActionDevtools.types";
|
|
2
|
-
export declare function ActionErrorDisplay({ entry }: {
|
|
2
|
+
export declare function ActionErrorDisplay({ entry, compact, }: {
|
|
3
3
|
entry: IDevtoolsActionEntry;
|
|
4
|
+
compact?: boolean;
|
|
4
5
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -4,6 +4,7 @@ export declare function getExternalLabel(hop: IDevtoolsRouteItem): string | null
|
|
|
4
4
|
interface IHandlerChipsProps {
|
|
5
5
|
entry: IDevtoolsActionEntry;
|
|
6
6
|
size: ESize;
|
|
7
|
+
subtle?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare function HandlerChips({ entry, size }: IHandlerChipsProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function HandlerChips({ entry, size, subtle }: IHandlerChipsProps): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { IDevtoolsActionEntry
|
|
2
|
-
export declare function ActionEntryRow({ entry, isSelected, onClick, isLatest, latestTime,
|
|
1
|
+
import type { IDevtoolsActionEntry } from "../../../core/ActionDevtools.types";
|
|
2
|
+
export declare function ActionEntryRow({ entry, isSelected, onClick, isLatest, latestTime, childEntries, breakReasons, groupEntries, selectedGroupCuid, onSelectGroupEntry, }: {
|
|
3
3
|
entry: IDevtoolsActionEntry;
|
|
4
4
|
isSelected: boolean;
|
|
5
5
|
onClick: () => void;
|
|
6
6
|
isLatest?: boolean;
|
|
7
7
|
latestTime?: number;
|
|
8
|
-
|
|
8
|
+
childEntries?: IDevtoolsActionEntry[];
|
|
9
9
|
breakReasons?: string[];
|
|
10
10
|
groupEntries?: IDevtoolsActionEntry[];
|
|
11
11
|
selectedGroupCuid?: string | null;
|
|
@@ -13,6 +13,7 @@ export declare const DEVTOOL_COLOR_TEXT_SECONDARY = "#cbd5e1";
|
|
|
13
13
|
export declare const DEVTOOL_COLOR_TEXT_MUTED = "#64748b";
|
|
14
14
|
export declare const DEVTOOL_COLOR_TEXT_FAINT = "#334155";
|
|
15
15
|
export declare const DEVTOOL_LIST_BASE_BACKGROUND = "#0f172a";
|
|
16
|
+
export declare const DEVTOOL_LIST_HEADER_SELECTED_BACKGROUND = "#1d2942";
|
|
16
17
|
export declare const DEVTOOL_LIST_GROUP_DIVIDER = "#101109";
|
|
17
18
|
export declare const DEVTOOL_DETAIL_BASE_BACKGROUND = "#0d1729";
|
|
18
19
|
export declare const DEVTOOL_DETAIL_HEADER_BACKGROUND = "#131f35";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-code/action",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.18",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"build-types": "tsc --project tsconfig.build.json"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@nice-code/common-errors": "0.2.
|
|
48
|
-
"@nice-code/error": "0.2.
|
|
47
|
+
"@nice-code/common-errors": "0.2.18",
|
|
48
|
+
"@nice-code/error": "0.2.18",
|
|
49
49
|
"@standard-schema/spec": "^1.1.0",
|
|
50
50
|
"@tanstack/react-virtual": "^3.13.26",
|
|
51
51
|
"http-status-codes": "^2.3.0",
|